diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/binaries/stremio_core_web_bg.wasm b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/binaries/stremio_core_web_bg.wasm similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/binaries/stremio_core_web_bg.wasm rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/binaries/stremio_core_web_bg.wasm diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/favicons/favicon.ico b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/favicons/favicon.ico similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/favicons/favicon.ico rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/favicons/favicon.ico diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/favicons/icon-96.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/favicons/icon-96.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/favicons/icon-96.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/favicons/icon-96.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/fonts/PlusJakartaSans.ttf b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/fonts/PlusJakartaSans.ttf similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/fonts/PlusJakartaSans.ttf rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/fonts/PlusJakartaSans.ttf diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/anonymous.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/anonymous.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/anonymous.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/anonymous.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/background_1.svg b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/background_1.svg similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/background_1.svg rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/background_1.svg diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/background_2.svg b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/background_2.svg similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/background_2.svg rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/background_2.svg diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/default_avatar.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/default_avatar.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/default_avatar.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/default_avatar.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/empty.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/empty.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/empty.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/empty.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/icon_x192.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/icon_x192.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/icon_x192.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/icon_x192.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/icon_x512.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/icon_x512.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/icon_x512.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/icon_x512.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/logo.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/logo.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/logo.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/logo.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/maskable_icon_x192.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/maskable_icon_x192.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/maskable_icon_x192.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/maskable_icon_x192.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/maskable_icon_x512.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/maskable_icon_x512.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/maskable_icon_x512.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/maskable_icon_x512.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/images/stremio_symbol.png b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/stremio_symbol.png similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/images/stremio_symbol.png rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/images/stremio_symbol.png diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/manifest.json b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/manifest.json similarity index 100% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/manifest.json rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/manifest.json diff --git a/development/aa236a26e03907d62a2aa7d4356502da09343532/scripts/main.js b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/scripts/main.js similarity index 99% rename from development/aa236a26e03907d62a2aa7d4356502da09343532/scripts/main.js rename to development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/scripts/main.js index 434d99d34..d64ec9a27 100644 --- a/development/aa236a26e03907d62a2aa7d4356502da09343532/scripts/main.js +++ b/development/ad5eeb7ffc6eee31a883a3bd408253c5ef69fd90/scripts/main.js @@ -1,2 +1,2 @@ -(()=>{var e={7228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},8926:e=>{function t(e,t,o,a,n,i,r){try{var E=e[i](r),s=E.value}catch(e){return void o(e)}E.done?t(s):Promise.resolve(s).then(a,n)}e.exports=function(e){return function(){var o=this,a=arguments;return new Promise((function(n,i){var r=e.apply(o,a);function E(e){t(r,n,i,E,s,"next",e)}function s(e){t(r,n,i,E,s,"throw",e)}E(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},4575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},3913:e=>{function t(e,t){for(var o=0;o{e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},5318:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},3884:e=>{e.exports=function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},6479:(e,t,o)=>{var a=o(7316);e.exports=function(e,t){if(null==e)return{};var o,n,i=a(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},7316:e=>{e.exports=function(e,t){if(null==e)return{};var o,a,n={},i=Object.keys(e);for(a=0;a=0||(n[o]=e[o]);return n},e.exports.default=e.exports,e.exports.__esModule=!0},3038:(e,t,o)=>{var a=o(2858),n=o(3884),i=o(379),r=o(521);e.exports=function(e,t){return a(e)||n(e,t)||i(e,t)||r()},e.exports.default=e.exports,e.exports.__esModule=!0},8:e=>{function t(o){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(o)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},379:(e,t,o)=>{var a=o(7228);e.exports=function(e,t){if(e){if("string"==typeof e)return a(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?a(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},7757:(e,t,o)=>{e.exports=o(5666)},6553:(e,t,o)=>{"use strict";var a=o(5318),n=a(o(7757)),i=a(o(8926));e.exports=function(e,t){t.addEventListener("message",(function(){var o=(0,i.default)(n.default.mark((function o(a){var i,r,E,s,_,T,l;return n.default.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i=a.data.request){o.next=3;break}return o.abrupt("return");case 3:if(r=i.id,E=i.path,s=i.args,o.prev=4,"function"!=typeof(_=E.reduce((function(e,t){return e[t]}),e))){o.next=13;break}return l=E.slice(0,E.length-1).reduce((function(e,t){return e[t]}),e),o.next=10,_.apply(l,s);case 10:T=o.sent,o.next=16;break;case 13:return o.next=15,_;case 15:T=o.sent;case 16:t.postMessage({response:{id:r,result:{data:T}}}),o.next=22;break;case 19:o.prev=19,o.t0=o.catch(4),t.postMessage({response:{id:r,result:{error:o.t0}}});case 22:case"end":return o.stop()}}),o,null,[[4,19]])})));return function(e){return o.apply(this,arguments)}})()),this.call=(function(){var e=(0,i.default)(n.default.mark((function e(o,a){var i;return n.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Math.random().toString(32).slice(2),e.abrupt("return",new Promise((function(e,n){t.addEventListener("message",(function o(a){var r=a.data.response;r&&r.id===i&&(t.removeEventListener("message",o),"error"in r.result?n(r.result.error):e(r.result.data))})),t.postMessage({request:{id:i,path:o,args:a}})})));case 2:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}})()}},792:(e,t,o)=>{var a=o(6729),n=o(9657);function i(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=e.chromecastTransport;if(!o)throw new Error("Chromecast transport required");var i=o.getCastDevice();if(null===i)throw new Error("Chromecast session must be started");var r=document.createElement("div");r.style.display="flex",r.style.flexDirection="row",r.style.alignItems="center",r.style.justifyContent="center",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="black";var E=document.createElement("div");E.style.flex="none",E.style.maxWidth="80%",E.style.fontSize="5vmin",E.style.lineHeight="1.2em",E.style.maxHeight="3.6em",E.style.textAlign="center",E.style.color="#FFFFFF90",E.innerText="Casting to "+i.friendlyName,r.appendChild(E),t.appendChild(r),o.on("message",u),o.on("message-error",S);var s=new a,_=!1,T={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,audioTracks:!1,selectedAudioTrackId:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,volume:!1,muted:!1,playbackSpeed:!1,extraSubtitlesTracks:!1,selectedExtraSubtitlesTrackId:!1,extraSubtitlesDelay:!1,extraSubtitlesSize:!1,extraSubtitlesOffset:!1,extraSubtitlesTextColor:!1,extraSubtitlesBackgroundColor:!1,extraSubtitlesOutlineColor:!1};function l(e,t){s.emit("error",Object.assign({},n.CHROMECAST_SENDER_VIDEO.MESSAGE_SEND_FAILED,{error:e,action:t}))}function S(e){s.emit("error",Object.assign({},n.CHROMECAST_SENDER_VIDEO.INVALID_MESSAGE_RECEIVED,{error:e}))}function u(e){if(e&&"string"==typeof e.event){var t=Array.isArray(e.args)?e.args:[];s.emit.apply(s,[e.event].concat(t))}else S(new Error("Invalid message: "+e))}function d(e,t){T[e]&&s.emit("propChanged",e,t)}this.on=function(e,t){if(_)throw new Error("Video is destroyed");s.on(e,t)},this.dispatch=function(e){if(_)throw new Error("Video is destroyed");if(e)switch(e.type){case"observeProp":return n=e.propName,T.hasOwnProperty(n)&&(T[n]=!0),void o.sendMessage(e).catch((function(t){l(t,e)}));case"setProp":return void o.sendMessage(e).catch((function(t){l(t,e)}));case"command":return a=e.commandName,e.commandArgs,"destroy"===a&&(_=!0,d("stream",null),d("loaded",null),d("paused",null),d("time",null),d("duration",null),d("buffering",null),d("buffered",null),d("audioTracks",[]),d("selectedAudioTrackId",[]),d("subtitlesTracks",[]),d("selectedSubtitlesTrackId",null),d("subtitlesOffset",null),d("subtitlesSize",null),d("subtitlesTextColor",null),d("subtitlesBackgroundColor",null),d("subtitlesOutlineColor",null),d("volume",null),d("muted",null),d("playbackSpeed",null),d("extraSubtitlesTracks",[]),d("selectedExtraSubtitlesTrackId",null),d("extraSubtitlesDelay",null),d("extraSubtitlesSize",null),d("extraSubtitlesOffset",null),d("extraSubtitlesTextColor",null),d("extraSubtitlesBackgroundColor",null),d("extraSubtitlesOutlineColor",null),s.removeAllListeners(),o.off("message",u),t.removeChild(r)),void o.sendMessage(e).catch((function(t){l(t,e)}))}var a,n;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}i.canPlayStream=function(){return Promise.resolve(!0)},i.manifest={name:"ChromecastSenderVideo",external:!0,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed","extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"],commands:["load","unload","destroy","addExtraSubtitlesTracks"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded","extraSubtitlesTrackLoaded","implementationChanged"]},e.exports=i},3153:(e,t,o)=>{var a=o(792);e.exports=a},1431:(e,t,o)=>{var a=o(6729),n=o(7631),i=o(3465),r=o(2682),E=o(6767),s=o(9657),_=o(8973),T=o(1566);function l(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=document.createElement("style");t.appendChild(o),o.sheet.insertRule("video::cue { font-size: 4vmin; color: rgb(255, 255, 255); background-color: rgba(0, 0, 0, 0); text-shadow: rgb(34, 34, 34) 1px 1px 0.1em; }");var l=document.createElement("video");l.style.width="100%",l.style.height="100%",l.style.backgroundColor="black",l.controls=!1,l.onerror=function(){!(function(){if(d)return;var e;switch(l.error.code){case 1:e=s.HTML_VIDEO.MEDIA_ERR_ABORTED;break;case 2:e=s.HTML_VIDEO.MEDIA_ERR_NETWORK;break;case 3:e=s.HTML_VIDEO.MEDIA_ERR_DECODE;break;case 4:e=s.HTML_VIDEO.MEDIA_ERR_SRC_NOT_SUPPORTED;break;default:e=s.UNKNOWN_ERROR}R(Object.assign({},e,{critical:!0,error:l.error}))})()},l.onended=function(){u.emit("ended")},l.onpause=function(){m("paused")},l.onplay=function(){m("paused")},l.ontimeupdate=function(){m("time"),m("buffered")},l.ondurationchange=function(){m("duration")},l.onwaiting=function(){m("buffering"),m("buffered")},l.onseeking=function(){m("time"),m("buffering"),m("buffered")},l.onseeked=function(){m("time"),m("buffering"),m("buffered")},l.onstalled=function(){m("buffering"),m("buffered")},l.onplaying=function(){m("time"),m("buffering"),m("buffered")},l.oncanplay=function(){m("buffering"),m("buffered")},l.canplaythrough=function(){m("buffering"),m("buffered")},l.onloadedmetadata=function(){m("loaded")},l.onloadeddata=function(){m("buffering"),m("buffered")},l.onvolumechange=function(){m("volume"),m("muted")},l.onratechange=function(){m("playbackSpeed")},l.textTracks.onchange=function(){m("subtitlesTracks"),m("selectedSubtitlesTrackId"),N(),Array.from(l.textTracks).forEach((function(e){e.oncuechange=N}))},t.appendChild(l);var S=null,u=new a,d=!1,c=null,I=0,A={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,audioTracks:!1,selectedAudioTrackId:!1,volume:!1,muted:!1,playbackSpeed:!1};function O(e){switch(e){case"stream":return c;case"loaded":return null===c?null:l.readyState>=l.HAVE_METADATA;case"paused":return null===c?null:!!l.paused;case"time":return null!==c&&null!==l.currentTime&&isFinite(l.currentTime)?Math.floor(1e3*l.currentTime):null;case"duration":return null!==c&&null!==l.duration&&isFinite(l.duration)?Math.floor(1e3*l.duration):null;case"buffering":return null===c?null:l.readyState0?e.lang:"string"==typeof e.name&&e.name.length>0?e.name:String(e.id),label:"string"==typeof e.name&&e.name.length>0?e.name:"string"==typeof e.lang&&e.lang.length>0?e.lang:String(e.id),origin:"EMBEDDED",embedded:!0})})):[];case"selectedAudioTrackId":return null!==S&&null!==S.audioTrack&&isFinite(S.audioTrack)&&-1!==S.audioTrack?"EMBEDDED_"+String(S.audioTrack):null;case"volume":return d||null===l.volume||!isFinite(l.volume)?null:Math.floor(100*l.volume);case"muted":return d?null:!!l.muted;case"playbackSpeed":return d||null===l.playbackRate||!isFinite(l.playbackRate)?null:l.playbackRate;default:return null}}function N(){Array.from(l.textTracks).forEach((function(e){Array.from(e.cues||[]).forEach((function(e){e.snapToLines=!1,e.line=100-I}))}))}function R(e){u.emit("error",e),e.critical&&p("unload")}function m(e){A[e]&&u.emit("propChanged",e,O(e))}function p(e,a){switch(e){case"load":p("unload"),a&&a.stream&&"string"==typeof a.stream.url?(c=a.stream,m("stream"),m("loaded"),l.autoplay="boolean"!=typeof a.autoplay||a.autoplay,l.currentTime=null!==a.time&&isFinite(a.time)?parseInt(a.time,10)/1e3:0,m("paused"),m("time"),m("duration"),m("buffering"),m("buffered"),m("subtitlesTracks"),m("selectedSubtitlesTrackId"),m("audioTracks"),m("selectedAudioTrackId"),_(c).then((function(e){c===a.stream&&("application/vnd.apple.mpegurl"===e&&n.isSupported()?((S=new n(T)).on(n.Events.AUDIO_TRACKS_UPDATED,(function(){m("audioTracks"),m("selectedAudioTrackId")})),S.on(n.Events.AUDIO_TRACK_SWITCHED,(function(){m("audioTracks"),m("selectedAudioTrackId")})),S.loadSource(c.url),S.attachMedia(l)):l.src=c.url)})).catch((function(){c===a.stream&&(l.src=c.url)}))):R(Object.assign({},s.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":c=null,Array.from(l.textTracks).forEach((function(e){e.oncuechange=null})),null!==S&&(S.removeAllListeners(),S.detachMedia(l),S.destroy(),S=null),l.removeAttribute("src"),l.load(),l.currentTime=0,m("stream"),m("loaded"),m("paused"),m("time"),m("duration"),m("buffering"),m("buffered"),m("subtitlesTracks"),m("selectedSubtitlesTrackId"),m("audioTracks"),m("selectedAudioTrackId");break;case"destroy":p("unload"),d=!0,m("subtitlesOffset"),m("subtitlesSize"),m("subtitlesTextColor"),m("subtitlesBackgroundColor"),m("subtitlesOutlineColor"),m("volume"),m("muted"),m("playbackSpeed"),u.removeAllListeners(),l.onerror=null,l.onended=null,l.onpause=null,l.onplay=null,l.ontimeupdate=null,l.ondurationchange=null,l.onwaiting=null,l.onseeking=null,l.onseeked=null,l.onstalled=null,l.onplaying=null,l.oncanplay=null,l.canplaythrough=null,l.onloadeddata=null,l.onvolumechange=null,l.onratechange=null,l.textTracks.onchange=null,t.removeChild(l),t.removeChild(o)}}this.on=function(e,t){if(d)throw new Error("Video is destroyed");u.on(e,t)},this.dispatch=function(e){if(d)throw new Error("Video is destroyed");if(e)switch((e=r(i(e))).type){case"observeProp":return t=e.propName,void(A.hasOwnProperty(t)&&(u.emit("propValue",t,O(t)),A[t]=!0));case"setProp":return void(function(e,t){switch(e){case"paused":null!==c&&(t?l.pause():l.play(),m("paused"));break;case"time":null!==c&&null!==t&&isFinite(t)&&(l.currentTime=parseInt(t,10)/1e3,m("time"));break;case"selectedSubtitlesTrackId":if(null!==c){Array.from(l.textTracks).forEach((function(e,o){e.mode="EMBEDDED_"+String(o)===t?"showing":"disabled"}));var a=O("subtitlesTracks").find((function(e){return e.id===t}));a&&(m("selectedSubtitlesTrackId"),u.emit("subtitlesTrackLoaded",a))}break;case"subtitlesOffset":null!==t&&isFinite(t)&&(I=Math.max(0,Math.min(100,parseInt(t,10))),N(),m("subtitlesOffset"));break;case"subtitlesSize":null!==t&&isFinite(t)&&(o.sheet.cssRules[0].style.fontSize=Math.floor(Math.max(0,parseInt(t,10))/25)+"vmin",m("subtitlesSize"));break;case"subtitlesTextColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.color=E(t).rgb().string()}catch(e){console.error("HTMLVideo",e)}m("subtitlesTextColor")}break;case"subtitlesBackgroundColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.backgroundColor=E(t).rgb().string()}catch(e){console.error("HTMLVideo",e)}m("subtitlesBackgroundColor")}break;case"subtitlesOutlineColor":if("string"==typeof t){try{o.sheet.cssRules[0].style.textShadow=E(t).rgb().string()+" 1px 1px 0.1em"}catch(e){console.error("HTMLVideo",e)}m("subtitlesOutlineColor")}break;case"selectedAudioTrackId":if(null!==S){var n=O("audioTracks").find((function(e){return e.id===t}));S.audioTrack=n?parseInt(n.id.split("_").pop(),10):-1,n&&(m("selectedAudioTrackId"),u.emit("audioTrackLoaded",n))}break;case"volume":null!==t&&isFinite(t)&&(l.muted=!1,l.volume=Math.max(0,Math.min(100,parseInt(t,10)))/100,m("muted"),m("volume"));break;case"muted":l.muted=!!t,m("muted");break;case"playbackSpeed":null!==t&&isFinite(t)&&(l.playbackRate=parseFloat(t),m("playbackSpeed"))}})(e.propName,e.propValue);case"command":return void p(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}l.canPlayStream=function(e){return!e||e.behaviorHints&&e.behaviorHints.notWebReady?Promise.resolve(!1):_(e).then((function(e){return!!document.createElement("video").canPlayType(e)||"application/vnd.apple.mpegurl"===e&&n.isSupported()})).catch((function(){return!1}))},l.manifest={name:"HTMLVideo",external:!1,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded"]},e.exports=l},8973:e=>{e.exports=function(e){return e&&"string"==typeof e.url?e.behaviorHints&&e.behaviorHints.proxyHeaders&&e.behaviorHints.proxyHeaders.response&&"string"==typeof e.behaviorHints.proxyHeaders.response["content-type"]?Promise.resolve(e.behaviorHints.proxyHeaders.response["content-type"]):fetch(e.url,{method:"HEAD"}).then((function(e){if(e.ok)return e.headers.get("content-type");throw new Error(e.status+" ("+e.statusText+")")})):Promise.reject(new Error("Invalid stream parameter!"))}},1566:e=>{e.exports={debug:!1,enableWorker:!0,lowLatencyMode:!1,backBufferLength:30,maxBufferLength:50,maxMaxBufferLength:80,maxFragLookUpTolerance:0,maxBufferHole:0,appendErrorMaxRetry:20,nudgeMaxRetry:20,manifestLoadingTimeOut:3e4,manifestLoadingMaxRetry:10}},9222:(e,t,o)=>{var a=o(1431);e.exports=a},8879:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(9657);function E(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=document.createElement("iframe");o.style.width="100%",o.style.height="100%",o.style.border=0,o.style.backgroundColor="black",o.allowFullscreen=!1,o.allow="autoplay",t.appendChild(o);var E=new a,s=!1,_={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,buffered:!1,volume:!1,muted:!1,playbackSpeed:!1};function T(e){if(e.source===o.contentWindow){var t=e.data||e.message;if(t&&"string"==typeof t.event){var a=t.event,n=Array.isArray(t.args)?t.args:[];E.emit.apply(E,[a].concat(n))}}}function l(e){o.contentWindow.postMessage(e,"*")}function S(e,t){_[e]&&E.emit("propChanged",e,t)}function u(e,a){switch(e){case"load":return u("unload"),a&&a.stream&&"string"==typeof a.stream.playerFrameUrl?(window.addEventListener("message",T,!1),o.onload=function(){l({type:"command",commandName:e,commandArgs:a})},o.src=a.stream.playerFrameUrl):(n=Object.assign({},r.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}),E.emit("error",n),n.critical&&u("unload")),!0;case"unload":return window.removeEventListener("message",T),o.onload=null,o.removeAttribute("src"),S("stream",null),S("loaded",null),S("paused",null),S("time",null),S("duration",null),S("buffering",null),S("buffered",null),S("volume",null),S("muted",null),S("playbackSpeed",null),!0;case"destroy":return u("unload"),s=!0,E.removeAllListeners(),t.removeChild(o),!0}var n}this.on=function(e,t){if(s)throw new Error("Video is destroyed");E.on(e,t)},this.dispatch=function(e){if(s)throw new Error("Video is destroyed");if(e)switch((e=i(n(e))).type){case"observeProp":return t=e.propName,_.hasOwnProperty(t)&&(_[t]=!0),void l(e);case"setProp":return void l(e);case"command":return void(u(e.commandName,e.commandArgs)||l(e))}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}E.canPlayStream=function(e){return Promise.resolve(e&&"string"==typeof e.playerFrameUrl)},E.manifest={name:"IFrameVideo",external:!0,props:["stream","loaded","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","subtitlesOutlineColor","volume","muted","playbackSpeed","extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"],commands:["load","unload","destroy","addExtraSubtitlesTracks"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded","extraSubtitlesTrackLoaded","implementationChanged"]},e.exports=E},7685:(e,t,o)=>{var a=o(8879);e.exports=a},8945:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(9657),E=.0066,s={stream:null,paused:"pause",time:"time-pos",duration:"duration",buffering:"buffering",volume:"volume",muted:"mute",playbackSpeed:"speed",audioTracks:"audioTracks",selectedAudioTrackId:"aid",subtitlesTracks:"subtitlesTracks",selectedSubtitlesTrackId:"sid",subtitlesSize:"sub-scale",subtitlesTextColor:"sub-color",subtitlesBackgroundColor:"sub-back-color",subtitlesOutlineColor:"sub-border-color"};function _(e){var t=(e=e||{}).shellTransport,o={};Object.keys(s).forEach((function(e){s[e]&&(o[s[e]]=e)})),t.send("mpv-command",["stop"]),t.send("mpv-observe-prop","path"),t.send("mpv-observe-prop","time-pos"),t.send("mpv-observe-prop","volume"),t.send("mpv-observe-prop","pause"),t.send("mpv-observe-prop","seeking"),t.send("mpv-observe-prop","eof-reached"),t.send("mpv-observe-prop","duration"),t.send("mpv-observe-prop","metadata"),t.send("mpv-observe-prop","video-params"),t.send("mpv-observe-prop","track-list"),t.send("mpv-observe-prop","paused-for-cache"),t.send("mpv-observe-prop","cache-buffering-state"),t.send("mpv-observe-prop","aid"),t.send("mpv-observe-prop","vid"),t.send("mpv-observe-prop","sid"),t.send("mpv-observe-prop","sub-scale"),t.send("mpv-observe-prop","sub-pos"),t.send("mpv-observe-prop","speed"),t.send("mpv-observe-prop","mpv-version"),t.send("mpv-observe-prop","ffmpeg-version");var _=new a,T=!1,l=null,S={},u=0,d=0,c={};function I(t){for(var o=t?"":"transparent",a=e.containerElement;a;a=a.parentElement)a.style.background=o}var A=0;function O(e){return s[e]?c[s[e]]:(console.log("Unsupported prop requested",e),null)}function N(e){_.emit("error",e),e.critical&&m("unload")}function R(e){S[e]&&_.emit("propChanged",e,O(e))}function m(o,a){switch(o){case"load":if(m("unload"),a&&a.stream&&"string"==typeof a.stream.url){l=a.stream,R("stream"),u=null!==a.time&&isFinite(a.time)?parseInt(a.time,10)/1e3:0,I(!1),t.send("mpv-set-prop",["no-sub-ass"]);var n="Win32"===navigator.platform?"direct3d":"opengl",i=e.mpvSeparateWindow?n:"opengl-cb",E=e.mpvSeparateWindow?"yes":"no";t.send("mpv-set-prop",["vo",i]),t.send("mpv-set-prop",["osc",E]),t.send("mpv-set-prop",["input-defalt-bindings",E]),t.send("mpv-set-prop",["input-vo-keyboard",E]),t.send("mpv-command",["loadfile",l.url]),t.send("mpv-set-prop",["pause",!1]),t.send("mpv-set-prop",["speed",c.speed]),t.send("mpv-set-prop",["aid",c.aid]),t.send("mpv-set-prop",["mute","no"]),R("paused"),R("time"),R("duration"),R("buffering"),R("volume"),R("muted"),R("subtitlesTracks"),R("selectedSubtitlesTrackId")}else N(Object.assign({},r.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":c={mute:!1,speed:1,subtitlesTracks:[],buffering:!0,aid:null,sid:null},u=0,d=0,t.send("mpv-command",["stop"]),R("stream"),R("paused"),R("time"),R("duration"),R("buffering"),R("volume"),R("muted"),R("subtitlesTracks"),R("selectedSubtitlesTrackId"),I(!0);break;case"destroy":m("unload"),T=!0,_.removeAllListeners()}}t.on("mpv-prop-change",(function(e){switch(e.name){case"mpv-version":case"ffmpeg-version":c[e.name]=(function(e){console.log(e.name+": "+e.data)})(e);break;case"duration":var a=0|e.data;c[e.name]=e.data>=30&&(!d||a===d)?Math.round(1e3*e.data):null,d=d?d+a>>1:a;break;case"time-pos":c[e.name]=Math.round(1e3*e.data),u&&(t.send("mpv-set-prop",["time-pos",u]),c[e.name]=Math.round(u),u=0);break;case"sub-scale":c[e.name]=Math.round(e.data/E);break;case"paused-for-cache":case"seeking":c.buffering!==e.data&&(c.buffering=e.data,R("buffering"));break;case"aid":case"sid":case"vid":c[e.name]=(function(e){return e.data?"EMBEDDED_"+e.data.toString():null})(e);break;case"track-list":c.audioTracks=e.data.filter((function(e){return"audio"===e.type})).map((function(e,t){return{id:"EMBEDDED_"+e.id,lang:void 0===e.lang?"Track"+(t+1):e.lang,label:void 0===e.title||void 0===e.lang?"":e.title||e.lang,origin:"EMBEDDED",embedded:!0,mode:e.id===c.aid?"showing":"disabled"}})),R("audioTracks"),c.subtitlesTracks=e.data.filter((function(e){return"sub"===e.type})).map((function(e,t){return{id:"EMBEDDED_"+e.id,lang:void 0===e.lang?"Track "+(t+1):e.lang,label:void 0===e.title||void 0===e.lang?"":e.title||e.lang,origin:"EMBEDDED",embedded:!0,mode:e.id===c.sid?"showing":"disabled"}})),R("subtitlesTracks");break;default:c[e.name]=e.data}var n="time-pos"===e.name?Math.floor(c["time-pos"]/1e3):null;n&&A===n||!o[e.name]||(n&&(A=n),R(o[e.name]))})),t.on("mpv-event-ended",(function(e){e.error?N(e.error):_.emit("ended")})),this.on=function(e,t){if(T)throw new Error("Video is destroyed");_.on(e,t)},this.dispatch=function(e){if(T)throw new Error("Video is destroyed");if(e)switch((e=i(n(e))).type){case"observeProp":o=e.propName,_.emit("propValue",o,O(o)),S[o]=!0;break;case"setProp":return void(function(e,o){switch(e){case"paused":null!==l&&t.send("mpv-set-prop",["pause",o]);break;case"time":null!==l&&null!==o&&isFinite(o)&&t.send("mpv-set-prop",["time-pos",o/1e3]);break;case"playbackSpeed":null!==l&&null!==o&&isFinite(o)&&t.send("mpv-set-prop",["speed",o]);break;case"volume":null!==l&&null!==o&&isFinite(o)&&(c.mute=!1,t.send("mpv-set-prop",["mute","no"]),t.send("mpv-set-prop",["volume",o]),R("muted"),R("volume"));break;case"muted":null!==l&&(t.send("mpv-set-prop",["mute",o?"yes":"no"]),c.mute=o,R("muted"));break;case"selectedAudioTrackId":if(null!==l){var a=o.slice("EMBEDDED_".length);t.send("mpv-set-prop",["aid",a])}break;case"selectedSubtitlesTrackId":null!==l&&(o?(a=o.slice("EMBEDDED_".length),t.send("mpv-set-prop",["sid",a]),_.emit("subtitlesTrackLoaded",o)):(t.send("mpv-set-prop",["sid","no"]),c.sid=null)),R("selectedSubtitlesTrackId");break;case"subtitlesSize":t.send("mpv-set-prop",[s[e],o*E]);break;case"subtitlesOffset":t.send("mpv-set-prop",[s[e],o]);break;case"subtitlesTextColor":case"subtitlesBackgroundColor":case"subtitlesOutlineColor":var n=o.replace(/^#(\w{6})(\w{2})$/,"#$2$1");t.send("mpv-set-prop",[s[e],n]);break;default:console.log("Unhandled setProp for",e)}})(e.propName,e.propValue);case"command":return void m(e.commandName,e.commandArgs)}var o}}_.canPlayStream=function(){return Promise.resolve(!0)},_.manifest={name:"ShellVideo",external:!1,props:Object.keys(s),commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded"]},e.exports=_},2024:(e,t,o)=>{var a=o(8945);e.exports=a},8117:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(2081),E=o(9657);function s(){var e=null,t=new a,o=!1;this.on=function(e,a){if(o)throw new Error("Video is destroyed");t.on(e,a)},this.dispatch=function(a,s){if(o)throw new Error("Video is destroyed");if(!a)throw new Error("Invalid action dispatched: "+JSON.stringify(a));if(s=s||{},"command"===(a=i(n(a))).type&&"load"===a.commandName&&a.commandArgs){var _=r(a.commandArgs,s);if(null!==e&&e.constructor!==_&&(e.dispatch({type:"command",commandName:"destroy"}),e=null),null===e){if(null===_)return void t.emit("error",Object.assign({},E.UNSUPPORTED_STREAM,{error:new Error("No video implementation was selected"),critical:!0,stream:a.commandArgs.stream}));(e=new _(s)).on("ended",(function(){t.emit("ended")})),e.on("error",(function(e){t.emit("error",e)})),e.on("propValue",(function(e,o){t.emit("propValue",e,o)})),e.on("propChanged",(function(e,o){t.emit("propChanged",e,o)})),e.on("subtitlesTrackLoaded",(function(e){t.emit("subtitlesTrackLoaded",e)})),e.on("audioTrackLoaded",(function(e){t.emit("audioTrackLoaded",e)})),e.on("extraSubtitlesTrackLoaded",(function(e){t.emit("extraSubtitlesTrackLoaded",e)})),_.manifest.external?e.on("implementationChanged",(function(e){t.emit("implementationChanged",e)})):t.emit("implementationChanged",_.manifest)}}if(null!==e)try{e.dispatch(a)}catch(t){console.error(e.constructor.manifest.name,t)}"command"===a.type&&"destroy"===a.commandName&&(e=null)},this.destroy=function(){o=!0,null!==e&&(e.dispatch({type:"command",commandName:"destroy"}),e=null),t.removeAllListeners()}}s.ERROR=E,e.exports=s},5010:(e,t,o)=>{var a=o(8117);e.exports=a},2081:(e,t,o)=>{var a=o(3153),n=o(2024),i=o(9222),r=o(5682),E=o(8846),s=o(7685),_=o(3142),T=o(5690),l=o(4282);e.exports=function(e,t){return e.stream&&"string"!=typeof e.stream.externalUrl?t.chromecastTransport&&t.chromecastTransport.getCastState()===cast.framework.CastState.CONNECTED?a:"string"==typeof e.stream.ytId?l(_):"string"==typeof e.stream.playerFrameUrl?s:t.shellTransport?T(l(n)):"string"==typeof e.streamingServerURL?void 0!==o.g.tizen?T(l(r)):void 0!==o.g.webOS?T(l(E)):T(l(i)):"string"==typeof e.stream.url?void 0!==o.g.webOS?l(E):void 0!==o.g.tizen?l(r):l(i):null:null}},5071:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(6767),E=o(9657);function s(e){var t=!0,o=1,s=null,_=null,T=(e=e||{}).containerElement;if(!(T instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var l,S=!1,u=100,d=0,c="rgb(255, 255, 255)",I="rgba(0, 0, 0, 0)",A="rgb(34, 34, 34)",O=document.createElement("object");O.type="application/avplayer",O.style.width="100%",O.style.height="100%",O.style.backgroundColor="black";var N=!1;function R(){if(l){var e=l.duration-(v("time")-l.now);e>0&&m(e,l.text)}}function m(e,t){if(!N){for(l={duration:e,text:t,now:v("time")},p&&(clearTimeout(p),p=!1);L.hasChildNodes();)L.removeChild(L.lastChild);L.style.bottom=d+"%";var a=document.createElement("span");a.innerHTML=t,a.style.display="inline-block",a.style.padding="0.2em",a.style.fontSize=Math.floor(u/25)+"vmin",a.style.color=c,a.style.backgroundColor=I,a.style.textShadow="1px 1px 0.1em "+A,L.appendChild(a),L.appendChild(document.createElement("br")),e&&(p=setTimeout((function(){for(;L.hasChildNodes();)L.removeChild(L.lastChild)}),parseInt(e*o)))}}var p=!1,h={onbufferingstart:function(){t=!0,P("buffering")},onbufferingprogress:function(){t=!0,P("buffering")},onbufferingcomplete:function(){t=!1,P("buffering")},oncurrentplaytime:function(){P("time")},onerror:function(){!(function(){if(C)return;var e;e=E.UNKNOWN_ERROR,y(Object.assign({},e,{critical:!0,error:e}))})()},onsubtitlechange:function(e,t){m(e,t)},onstreamcompleted:function(){f.emit("ended")}};window.webapis.avplay.setListener(h),T.appendChild(O);var L=document.createElement("div");L.style.position="absolute",L.style.right="0",L.style.bottom="0",L.style.left="0",L.style.zIndex="1",L.style.textAlign="center",T.style.position="relative",T.style.zIndex="0",T.appendChild(L);var f=new a,C=!1,D=null,g={stream:!1,paused:!1,time:!1,duration:!1,buffering:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1,subtitlesOffset:!1,subtitlesSize:!1,subtitlesTextColor:!1,subtitlesBackgroundColor:!1,subtitlesOutlineColor:!1,audioTracks:!1,selectedAudioTrackId:!1,playbackSpeed:!1};function v(e){switch(e){case"stream":return D;case"paused":if(null===D)return null;var a=!("PAUSED"!==window.webapis.avplay.getState());return!a&&S&&(window.webapis.avplay.setSelectTrack("AUDIO",parseInt(S.replace("EMBEDDED_",""))),S=!1),a;case"time":var n=window.webapis.avplay.getCurrentTime();return null!==D&&null!==n&&isFinite(n)?Math.floor(n):null;case"duration":var i=window.webapis.avplay.getDuration();return null!==D&&null!==i&&isFinite(i)?Math.floor(i):null;case"buffering":return null===D?null:t;case"subtitlesTracks":if(null===D)return[];for(var r=window.webapis.avplay.getTotalTrackInfo(),E=[],T=0;T{var a=o(5071);e.exports=a},4333:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(9657);function E(e,t,o,a){t&&(e.onSuccess=t||function(){}),e.onFailure=function(){o&&o()},window.webOS.service.request(a||"luna://com.webos.media",e)}function s(e,t){window.webOS.service.request("luna://com.webos.applicationManager",{method:"launch",parameters:{id:e.need,params:{payload:[{fullPath:e.url,artist:"",subtitle:"",dlnaInfo:{flagVal:4096,cleartextSize:"-1",contentLength:"-1",opVal:1,protocolInfo:"http-get:*:video/x-matroska:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000",duration:0},mediaType:"VIDEO",thumbnail:"",deviceType:"DMR",album:"",fileName:e.name,lastPlayPosition:e.position}]}},onSuccess:function(){},onFailure:function(){"com.webos.app.photovideo"===e.need?(e.need="com.webos.app.smartshare",s(e)):"com.webos.app.smartshare"===e.need?(e.need="com.webos.app.mediadiscovery",s(e)):"com.webos.app.mediadiscovery"===e.need&&t()}})}var _=["black","white","yellow","red","green","blue"],T={"rgba(0, 0, 0, 255)":"black","rgba(255, 255, 255, 255)":"white","rgba(255, 255, 0, 255)":"yellow","rgba(255, 0, 0, 255)":"red","rgba(0, 255, 0, 255)":"green","rgba(0, 0, 255, 255)":"blue","rgba(0, 0, 0, 1)":"black","rgba(255, 255, 255, 1)":"white","rgba(255, 255, 0, 1)":"yellow","rgba(255, 0, 0, 1)":"red","rgba(0, 255, 0, 1)":"green","rgba(0, 0, 255, 1)":"blue","rgba(0, 0, 0)":"black","rgba(255, 255, 255)":"white","rgba(255, 255, 0)":"yellow","rgba(255, 0, 0)":"red","rgba(0, 255, 0)":"green","rgba(0, 0, 255)":"blue","#000000FF":"black","#FFFFFFFF":"white","#FFFF00FF":"yellow","#FF0000FF":"red","#00FF00FF":"green","#0000FFFF":"blue","#000000":"black","#FFFFFF":"white","#FFFF00":"yellow","#FF0000":"red","#00FF00":"green","#0000FF":"blue"};function l(e){var t=(e=e||{}).containerElement;if(!(t instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var o=!1,l=75,S=!0,u=!1,d=!1,c=!1,I=[],A=[],O=0,N=function(e){if(!u){u=!0;var t=!1;E({method:"subscribe",parameters:{mediaId:o,subscribe:!0}},(function(a){if(a.sourceInfo&&!t){t=!0;var n=a.sourceInfo.programInfo[0];!(function(e){if(I=[],e.numSubtitleTracks){for(var t=0;t=h.HAVE_METADATA&&null!==t&&isFinite(t))try{h.currentTime=parseInt(t,10)/1e3}catch(e){}break;case"selectedSubtitlesTrackId":if(null!==y)if(0===(t||"").indexOf("EMBEDDED_")){S&&m(!0),d=t;var a=parseInt(t.replace("EMBEDDED_",""));E({method:"selectTrack",parameters:{type:"text",mediaId:o,index:a}},(function(){var e=M("subtitlesTracks").find((function(e){return e.id===t}));I=I.map((function(e){return e.mode=e.id===d?"showing":"disabled",e})),e&&(g.emit("subtitlesTrackLoaded",e),G("selectedSubtitlesTrackId"))}))}else t||m(!1);break;case"subtitlesOffset":if(null!==t&&isFinite(t)){B=Math.max(0,Math.min(100,parseInt(t,10)));var n=0===(O=5)?-3:O<=2?-2:O<=3?-1:O<=5?0:O<=10?1:O<=25?2:O<=50?3:O<=100&&4;!1===n&&(n=0),E({method:"setSubtitlePosition",parameters:{mediaId:o,position:n}},(function(){})),G("subtitlesOffset")}break;case"subtitlesSize":if(null!==t&&isFinite(t)){l=Math.max(0,parseInt(t,10));var i=(u=l)<=75?1:u<=100?2:u<=150?3:u<=250&&4;!1===i&&(i=2),E({method:"setSubtitleFontSize",parameters:{mediaId:o,fontSize:i}},(function(){})),G("subtitlesSize")}break;case"subtitlesTextColor":if("string"==typeof t){var r="white";T[t]&&_.indexOf(T[t])>-1&&(r=T[t]),E({method:"setSubtitleCharacterColor",parameters:{mediaId:o,charColor:r}},(function(){})),L=t,G("subtitlesTextColor")}break;case"subtitlesBackgroundColor":"string"==typeof t&&(T[t]&&_.indexOf(T[t])>-1?E({method:"setSubtitleBackgroundColor",parameters:{mediaId:o,color:T[t]}},(function(){C||E({method:"setSubtitleBackgroundOpacity",parameters:{mediaId:o,bgOpacity:255}},(function(){C=255}))})):E({method:"setSubtitleBackgroundOpacity",parameters:{mediaId:o,bgOpacity:0}},(function(){C=0})),f=t,G("subtitlesBackgroundColor"));break;case"selectedAudioTrackId":if(0===(t||"").indexOf("EMBEDDED_")){c=t;a=parseInt(t.replace("EMBEDDED_",""));if(E({method:"selectTrack",parameters:{type:"audio",mediaId:o,index:a}},(function(){var e=M("audioTracks").find((function(e){return e.id===t}));A=A.map((function(e){return e.mode=e.id===c?"showing":"disabled",e})),e&&(g.emit("audioTrackLoaded",e),G("selectedAudioTrackId"))})),h.audioTracks){for(var s=0;s4&&(clearInterval(E),i())}),300)}else U(Object.assign({},r.UNSUPPORTED_STREAM,{critical:!0,stream:a?a.stream:null}));break;case"unload":y=null,P=null,Array.from(h.textTracks).forEach((function(e){e.oncuechange=null})),h.removeAttribute("src"),h.load(),G("stream"),G("paused"),G("time"),G("duration"),G("buffering"),G("buffered"),G("subtitlesTracks"),G("selectedSubtitlesTrackId"),G("audioTracks"),G("selectedAudioTrackId");break;case"destroy":k("unload"),v=!0,G("subtitlesOffset"),G("subtitlesSize"),G("subtitlesTextColor"),G("subtitlesBackgroundColor"),G("volume"),G("muted"),G("playbackSpeed"),g.removeAllListeners(),h.onerror=null,h.onended=null,h.onpause=null,h.onplay=null,h.ontimeupdate=null,h.ondurationchange=null,h.onwaiting=null,h.onseeking=null,h.onseeked=null,h.onstalled=null,h.onplaying=null,h.oncanplay=null,h.canplaythrough=null,h.onloadeddata=null,h.onloadedmetadata=null,h.onvolumechange=null,h.onratechange=null,h.textTracks.onchange=null,t.removeChild(h),t.removeChild(p)}var i,E}this.on=function(e,t){if(v)throw new Error("Video is destroyed");g.on(e,t)},this.dispatch=function(e){if(v)throw new Error("Video is destroyed");if(e)switch((e=i(n(e))).type){case"observeProp":return t=e.propName,void(b.hasOwnProperty(t)&&(g.emit("propValue",t,M(t)),b[t]=!0));case"setProp":return void F(e.propName,e.propValue);case"command":return void k(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}l.canPlayStream=function(){return Promise.resolve(!0)},l.manifest={name:"WebOsVideo",external:!1,props:["stream","paused","time","duration","buffering","buffered","audioTracks","selectedAudioTrackId","subtitlesTracks","selectedSubtitlesTrackId","subtitlesOffset","subtitlesSize","subtitlesTextColor","subtitlesBackgroundColor","volume","muted","playbackSpeed"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded","audioTrackLoaded"]},e.exports=l},8846:(e,t,o)=>{var a=o(4333);e.exports=a},9736:(e,t,o)=>{var a=o(6729),n=o(3465),i=o(2682),r=o(9657);function E(e){var t=null!==(e=e||{}).timeChangedTimeout&&isFinite(e.timeChangedTimeout)?parseInt(e.timeChangedTimeout,10):100,o=e.containerElement;if(!(o instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var E=document.createElement("script");E.type="text/javascript",E.src="https://www.youtube.com/iframe_api",E.onload=function(){if(d)return;if(!YT||"function"!=typeof YT.ready)return void O();YT.ready((function(){d||(YT&&YT.PlayerState&&"function"==typeof YT.Player?T=new YT.Player(s,{width:"100%",height:"100%",playerVars:{autoplay:1,cc_load_policy:3,controls:0,disablekb:1,enablejsapi:1,fs:0,iv_load_policy:3,loop:0,modestbranding:1,playsinline:1,rel:0},events:{onError:N,onReady:R,onApiChange:m,onStateChange:p}}):O())}))},E.onerror=O,o.appendChild(E);var s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.backgroundColor="black",o.appendChild(s);var _=window.setInterval((function(){f("time"),f("volume"),f("muted")}),t),T=null,l=!1,S=null,u=new a,d=!1,c=null,I=null,A={stream:!1,loaded:!1,paused:!1,time:!1,duration:!1,buffering:!1,volume:!1,muted:!1,subtitlesTracks:!1,selectedSubtitlesTrackId:!1};function O(){d||L(Object.assign({},r.YOUTUBE_VIDEO.API_LOAD_FAILED,{critical:!0}))}function N(e){if(!d){var t;switch(e.data){case 2:t=r.YOUTUBE_VIDEO.INVALID_PARAMETER;break;case 5:t=r.YOUTUBE_VIDEO.HTML5_VIDEO;break;case 100:t=r.YOUTUBE_VIDEO.VIDEO_NOT_FOUND;break;case 101:case 150:t=r.YOUTUBE_VIDEO.VIDEO_NOT_EMBEDDABLE;break;default:t=r.UNKNOWN_ERROR}L(Object.assign({},t,{critical:!0,error:e}))}}function R(){d||(l=!0,null!==S&&(C("load",S),S=null))}function m(){d||("function"==typeof T.loadModule&&T.loadModule("captions"),"function"==typeof T.setOption&&T.setOption("captions","track",{}),f("paused"),f("time"),f("duration"),f("buffering"),f("volume"),f("muted"),f("subtitlesTracks"),f("selectedSubtitlesTrackId"))}function p(e){switch(f("buffering"),e.data){case YT.PlayerState.ENDED:u.emit("ended");break;case YT.PlayerState.CUED:case YT.PlayerState.UNSTARTED:case YT.PlayerState.PAUSED:case YT.PlayerState.PLAYING:f("paused"),f("time"),f("duration")}}function h(e){switch(e){case"stream":return c;case"loaded":return null!==c||null;case"paused":return null===c||"function"!=typeof T.getPlayerState?null:T.getPlayerState()!==YT.PlayerState.PLAYING;case"time":return null!==c&&"function"==typeof T.getCurrentTime&&null!==T.getCurrentTime()&&isFinite(T.getCurrentTime())?Math.floor(1e3*T.getCurrentTime()):null;case"duration":return null!==c&&"function"==typeof T.getDuration&&null!==T.getDuration()&&isFinite(T.getDuration())?Math.floor(1e3*T.getDuration()):null;case"buffering":return null===c||"function"!=typeof T.getPlayerState?null:T.getPlayerState()===YT.PlayerState.BUFFERING;case"volume":return null!==c&&"function"==typeof T.getVolume&&null!==T.getVolume()&&isFinite(T.getVolume())?T.getVolume():null;case"muted":return null===c||"function"!=typeof T.isMuted?null:T.isMuted();case"subtitlesTracks":return null===c||"function"!=typeof T.getOption?[]:(T.getOption("captions","tracklist")||[]).filter((function(e){return e&&"string"==typeof e.languageCode})).map((function(e,t){return Object.freeze({id:"EMBEDDED_"+String(t),lang:e.languageCode,label:"string"==typeof e.displayName?e.displayName:e.languageCode,origin:"EMBEDDED",embedded:!0})}));case"selectedSubtitlesTrackId":return null===c?null:I;default:return null}}function L(e){u.emit("error",e),e.critical&&C("unload")}function f(e){A[e]&&u.emit("propChanged",e,h(e))}function C(e,t){switch(e){case"load":if(C("unload"),t&&t.stream&&"string"==typeof t.stream.ytId)if(l){c=t.stream,f("stream"),f("loaded");var a="boolean"!=typeof t.autoplay||t.autoplay,n=null!==t.time&&isFinite(t.time)?parseInt(t.time,10)/1e3:0;a&&"function"==typeof T.loadVideoById?T.loadVideoById({videoId:t.stream.ytId,startSeconds:n}):"function"==typeof T.cueVideoById&&T.cueVideoById({videoId:t.stream.ytId,startSeconds:n}),f("paused"),f("time"),f("duration"),f("buffering"),f("volume"),f("muted"),f("subtitlesTracks"),f("selectedSubtitlesTrackId")}else S=t;else L(Object.assign({},r.UNSUPPORTED_STREAM,{critical:!0,stream:t?t.stream:null}));break;case"unload":S=null,c=null,f("stream"),f("loaded"),I=null,l&&"function"==typeof T.stopVideo&&T.stopVideo(),f("paused"),f("time"),f("duration"),f("buffering"),f("volume"),f("muted"),f("subtitlesTracks"),f("selectedSubtitlesTrackId");break;case"destroy":C("unload"),d=!0,u.removeAllListeners(),clearInterval(_),l&&"function"==typeof T.destroy&&T.destroy(),o.removeChild(E),o.removeChild(s)}}this.on=function(e,t){if(d)throw new Error("Video is destroyed");u.on(e,t)},this.dispatch=function(e){if(d)throw new Error("Video is destroyed");if(e)switch((e=i(n(e))).type){case"observeProp":return t=e.propName,void(A.hasOwnProperty(t)&&(u.emit("propValue",t,h(t)),A[t]=!0));case"setProp":return void(function(e,t){switch(e){case"paused":null!==c&&(t?"function"==typeof T.pauseVideo&&T.pauseVideo():"function"==typeof T.playVideo&&T.playVideo());break;case"time":null!==c&&"function"==typeof T.seekTo&&null!==t&&isFinite(t)&&T.seekTo(parseInt(t,10)/1e3);break;case"volume":null!==c&&null!==t&&isFinite(t)&&("function"==typeof T.unMute&&T.unMute(),"function"==typeof T.setVolume&&T.setVolume(Math.max(0,Math.min(100,parseInt(t,10)))),f("muted"),f("volume"));break;case"muted":null!==c&&(t?"function"==typeof T.mute&&T.mute():"function"==typeof T.unMute&&T.unMute(),f("muted"));break;case"selectedSubtitlesTrackId":if(null!==c){I=null;var o=h("subtitlesTracks").find((function(e){return e.id===t}));"function"==typeof T.setOption&&(o?(I=o.id,T.setOption("captions","track",{languageCode:o.lang}),u.emit("subtitlesTrackLoaded",o)):T.setOption("captions","track",{})),f("selectedSubtitlesTrackId")}}})(e.propName,e.propValue);case"command":return void C(e.commandName,e.commandArgs)}var t;throw new Error("Invalid action dispatched: "+JSON.stringify(e))}}E.canPlayStream=function(e){return Promise.resolve(e&&"string"==typeof e.ytId)},E.manifest={name:"YouTubeVideo",external:!1,props:["stream","loaded","paused","time","duration","buffering","volume","muted","subtitlesTracks","selectedSubtitlesTrackId"],commands:["load","unload","destroy"],events:["propValue","propChanged","ended","error","subtitlesTrackLoaded"]},e.exports=E},3142:(e,t,o)=>{var a=o(9736);e.exports=a},9657:e=>{e.exports={CHROMECAST_SENDER_VIDEO:{INVALID_MESSAGE_RECEIVED:{code:100,message:"Invalid message received"},MESSAGE_SEND_FAILED:{code:101,message:"Failed to send message"}},YOUTUBE_VIDEO:{API_LOAD_FAILED:{code:90,message:"YouTube player iframe API failed to load"},INVALID_PARAMETER:{code:91,message:"The request contains an invalid parameter value"},HTML5_VIDEO:{code:92,message:"The requested content cannot be played in an HTML5 player"},VIDEO_NOT_FOUND:{code:93,message:"The video requested was not found"},VIDEO_NOT_EMBEDDABLE:{code:94,message:"The owner of the requested video does not allow it to be played in embedded players"}},HTML_VIDEO:{MEDIA_ERR_ABORTED:{code:80,message:"Fetching process aborted"},MEDIA_ERR_NETWORK:{code:81,message:"Error occurred when downloading"},MEDIA_ERR_DECODE:{code:82,message:"Error occurred when decoding"},MEDIA_ERR_SRC_NOT_SUPPORTED:{code:83,message:"Video is not supported"}},WITH_HTML_SUBTITLES:{LOAD_FAILED:{code:70,message:"Failed to load external subtitles"}},WITH_STREAMING_SERVER:{CONVERT_FAILED:{code:60,message:"Streaming server failed to convert torrent stream"}},UNKNOWN_ERROR:{code:1,message:"Unknown error"},UNSUPPORTED_STREAM:{code:2,message:"Stream is not supported"}}},1654:(e,t,o)=>{var a=o(5010);e.exports=a},5015:e=>{var t,o=[{codec:"h264",mime:'video/mp4; codecs="avc1.42E01E"'},{codec:"h265",mime:'video/mp4; codecs="hev1.1.6.L150.B0"',aliases:["hevc"]},{codec:"vp8",mime:'video/mp4; codecs="vp8"'},{codec:"vp9",mime:'video/mp4; codecs="vp9"'}],a=[{codec:"aac",mime:'audio/mp4; codecs="mp4a.40.2"'},{codec:"mp3",mime:'audio/mp4; codecs="mp3"'},{codec:"ac3",mime:'audio/mp4; codecs="ac-3"'},{codec:"eac3",mime:'audio/mp4; codecs="ec-3"'},{codec:"vorbis",mime:'audio/mp4; codecs="vorbis"'},{codec:"opus",mime:'audio/mp4; codecs="opus"'}];function n(e,t){return t.mediaElement.canPlayType(e.mime)?[e.codec].concat(e.aliases||[]):[]}e.exports=(t=document.createElement("video"),{formats:["mp4"],videoCodecs:o.map((function(e){return n(e,{mediaElement:t})})).reduce((function(e,t){return e.concat(t)}),[]),audioCodecs:a.map((function(e){return n(e,{mediaElement:t})})).reduce((function(e,t){return e.concat(t)}),[]),maxAudioChannels:(function(){if(/firefox/i.test(window.navigator.userAgent))return 6;if(!window.AudioContext)return 2;var e=(new AudioContext).destination.maxChannelCount;return e>0?e:2})()})},9490:e=>{e.exports=function(e,t){if(tt?a=i-1:(e[i]{var a=o(4253);e.exports=a},6950:e=>{function t(e){for(var t="",o=(e=e.replace(/<[a-zA-Z/][^>]*>/g,"")).split(/\n/);o.length>3;){for(var a=3;a\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);return i?(t+=i[1]+":"+i[2]+":"+i[3]+"."+i[4]+" --\x3e "+i[5]+":"+i[6]+":"+i[7]+"."+i[8]+"\n",o[n+=1]&&(t+=o[n]+"\n\n"),t):""}e.exports={convert:function(e){if(e.includes("WEBVTT"))return e;try{return(function(e){var o=e.replace(/\r+/g,""),a=(o=o.replace(/^\s+|\s+$/g,"")).split("\n\n"),n="";if(a.length>0){n+="WEBVTT\n\n";for(var i=0;i{var a=o(8369),n=o(9490);e.exports={parse:function(e){return new Promise((function(t,o){var i=new a.WebVTT.Parser(window,a.WebVTT.StringDecoder()),r=[],E=[],s={};i.oncue=function(e){var t={startTime:1e3*e.startTime|0,endTime:1e3*e.endTime|0,text:e.text};E.push(t),s[t.startTime]=s[t.startTime]||[],s[t.endTime]=s[t.endTime]||[]},i.onparsingerror=function(e){0===e.code?(i.oncue=null,i.onparsingerror=null,i.onflush=null,o(e)):(console.warn("Subtitles parsing error",e),r.push(e))},i.onflush=function(){s.times=Object.keys(s).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t}));for(var e=0;e{var a=o(8369),n=o(9490);e.exports={render:function(e,t){var o=[],i=n(e.times,t);if(-1!==i)for(var r=e[e.times[i]],E=0;E{var a=o(6729),n=o(3465),i=o(2682),r=o(6767),E=o(9657),s=o(1494),_=o(2913),T=o(6950);e.exports=function(e){function t(t){var o=new e(t=t||{});o.on("error",(function(e){c.emit("error",e),e.critical&&P("unload")})),o.on("propValue",D.bind(null,"propValue")),o.on("propChanged",D.bind(null,"propChanged")),e.manifest.events.filter((function(e){return!["error","propValue","propChanged"].includes(e)})).forEach((function(e){o.on(e,(function(e){return function(){c.emit.apply(c,[e].concat(Array.from(arguments)))}})(e))}));var l=t.containerElement;if(!(l instanceof HTMLElement))throw new Error("Container element required to be instance of HTMLElement");var S=document.createElement("div");S.style.position="absolute",S.style.right="0",S.style.bottom="0",S.style.left="0",S.style.zIndex="1",S.style.textAlign="center",l.style.position="relative",l.style.zIndex="0",l.appendChild(S);var u={time:null},d=null,c=new a,I=!1,A=[],O=null,N=null,R=100,m=0,p="rgb(255, 255, 255)",h="rgba(0, 0, 0, 0)",L="rgb(34, 34, 34)",f={extraSubtitlesTracks:!1,selectedExtraSubtitlesTrackId:!1,extraSubtitlesDelay:!1,extraSubtitlesSize:!1,extraSubtitlesOffset:!1,extraSubtitlesTextColor:!1,extraSubtitlesBackgroundColor:!1,extraSubtitlesOutlineColor:!1};function C(){for(;S.hasChildNodes();)S.removeChild(S.lastChild);null!==d&&null!==u.time&&isFinite(u.time)&&(S.style.bottom=m+"%",_.render(d,u.time+N).forEach((function(e){e.style.display="inline-block",e.style.padding="0.2em",e.style.fontSize=Math.floor(R/25)+"vmin",e.style.color=p,e.style.backgroundColor=h,e.style.textShadow="1px 1px 0.1em "+L,S.appendChild(e),S.appendChild(document.createElement("br"))})))}function D(e,t,o){if("time"===t)u.time=o,C();c.emit(e,t,v(t,o))}function g(e){f[e]&&c.emit("propChanged",e,v(e,null))}function v(e,t){switch(e){case"extraSubtitlesTracks":return I?[]:A.slice();case"selectedExtraSubtitlesTrackId":return I?null:O;case"extraSubtitlesDelay":return I?null:N;case"extraSubtitlesSize":return I?null:R;case"extraSubtitlesOffset":return I?null:m;case"extraSubtitlesTextColor":return I?null:p;case"extraSubtitlesBackgroundColor":return I?null:h;case"extraSubtitlesOutlineColor":return I?null:L;default:return t}}function y(e,t){switch(e){case"selectedExtraSubtitlesTrackId":d=null,O=null,N=null;var a=A.find((function(e){return e.id===t}));return a&&(O=a.id,N=0,fetch(a.url).then((function(e){if(e.ok)return e.text();throw new Error(e.status+" ("+e.statusText+")")})).then((function(e){return T.convert(e)})).then((function(e){return s.parse(e)})).then((function(e){O===a.id&&(d=e,C(),c.emit("extraSubtitlesTrackLoaded",a))})).catch((function(e){O===a.id&&(function(e){c.emit("error",e),e.critical&&(P("unload"),o.dispatch({type:"command",commandName:"unload"}))})(Object.assign({},E.WITH_HTML_SUBTITLES.LOAD_FAILED,{error:e,track:a,critical:!1}))}))),C(),g("selectedExtraSubtitlesTrackId"),g("extraSubtitlesDelay"),!0;case"extraSubtitlesDelay":return null!==O&&null!==t&&isFinite(t)&&(N=parseInt(t,10),C(),g("extraSubtitlesDelay")),!0;case"extraSubtitlesSize":return null!==t&&isFinite(t)&&(R=Math.max(0,parseInt(t,10)),C(),g("extraSubtitlesSize")),!0;case"extraSubtitlesOffset":return null!==t&&isFinite(t)&&(m=Math.max(0,Math.min(100,parseInt(t,10))),C(),g("extraSubtitlesOffset")),!0;case"extraSubtitlesTextColor":if("string"==typeof t){try{p=r(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}C(),g("extraSubtitlesTextColor")}return!0;case"extraSubtitlesBackgroundColor":if("string"==typeof t){try{h=r(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}C(),g("extraSubtitlesBackgroundColor")}return!0;case"extraSubtitlesOutlineColor":if("string"==typeof t){try{L=r(t).rgb().string()}catch(e){console.error("withHTMLSubtitles",e)}C(),g("extraSubtitlesOutlineColor")}return!0;default:return!1}}function P(e,t){switch(e){case"addExtraSubtitlesTracks":return t&&Array.isArray(t.tracks)&&(A=A.concat(t.tracks).filter((function(e,t,o){return e&&"string"==typeof e.id&&"string"==typeof e.url&&"string"==typeof e.lang&&"string"==typeof e.label&&"string"==typeof e.origin&&!e.embedded&&t===o.findIndex((function(t){return t.id===e.id}))})),g("extraSubtitlesTracks")),!0;case"load":return P("unload"),t.stream&&Array.isArray(t.stream.subtitles)&&P("addExtraSubtitlesTracks",{tracks:t.stream.subtitles.map((function(e){return Object.assign({},e,{origin:"EXCLUSIVE",exclusive:!0,embedded:!1})}))}),!1;case"unload":return d=null,A=[],O=null,N=null,C(),g("extraSubtitlesTracks"),g("selectedExtraSubtitlesTrackId"),g("extraSubtitlesDelay"),!1;case"destroy":return P("unload"),I=!0,g("extraSubtitlesSize"),g("extraSubtitlesOffset"),g("extraSubtitlesTextColor"),g("extraSubtitlesBackgroundColor"),g("extraSubtitlesOutlineColor"),o.dispatch({type:"command",commandName:"destroy"}),c.removeAllListeners(),l.removeChild(S),!0;default:return!1}}this.on=function(e,t){if(I)throw new Error("Video is destroyed");c.on(e,t)},this.dispatch=function(e){if(I)throw new Error("Video is destroyed");if(e)switch((e=i(n(e))).type){case"observeProp":if((function(e){switch(e){case"extraSubtitlesTracks":case"selectedExtraSubtitlesTrackId":case"extraSubtitlesDelay":case"extraSubtitlesSize":case"extraSubtitlesOffset":case"extraSubtitlesTextColor":case"extraSubtitlesBackgroundColor":case"extraSubtitlesOutlineColor":return c.emit("propValue",e,v(e,null)),f[e]=!0,!0;default:return!1}})(e.propName))return;break;case"setProp":if(y(e.propName,e.propValue))return;break;case"command":if(P(e.commandName,e.commandArgs))return}o.dispatch(e)}}return t.canPlayStream=function(t){return e.canPlayStream(t)},t.manifest={name:e.manifest.name+"WithHTMLSubtitles",external:e.manifest.external,props:e.manifest.props.concat(["extraSubtitlesTracks","selectedExtraSubtitlesTrackId","extraSubtitlesDelay","extraSubtitlesSize","extraSubtitlesOffset","extraSubtitlesTextColor","extraSubtitlesBackgroundColor","extraSubtitlesOutlineColor"]).filter((function(e,t,o){return o.indexOf(e)===t})),commands:e.manifest.commands.concat(["load","unload","destroy","addExtraSubtitlesTracks"]).filter((function(e,t,o){return o.indexOf(e)===t})),events:e.manifest.events.concat(["propValue","propChanged","error","extraSubtitlesTrackLoaded"]).filter((function(e,t,o){return o.indexOf(e)===t}))},t}},7054:(e,t,o)=>{var a=o(9566),n=o(7190);e.exports=function(e,t,o){return new Promise((function(i,r){if("string"!=typeof t.url)"string"!=typeof t.infoHash?r(new Error("Stream cannot be converted")):n(e,t.infoHash,t.fileIdx,t.announce,o).then((function(e){i(e)})).catch((function(e){r(e)}));else if(0===t.url.indexOf("magnet:")){var E;try{if(!(E=a.decode(t.url))||"string"!=typeof E.infoHash)throw new Error("Failed to decode magnet url")}catch(e){return void r(e)}var s=Array.isArray(E.announce)?E.announce.map((function(e){return"tracker:"+e})):[];n(e,E.infoHash,null,s,o).then((function(e){i(e)})).catch((function(e){r(e)}))}else i(t.url)}))}},7190:(e,t,o)=>{var a=o(8575);function n(e,t,o,n){var i=Array.isArray(n)&&n.length>0?"?"+new URLSearchParams(n.map((function(e){return["tr",e]}))):"";return a.resolve(e,"/"+encodeURIComponent(t)+"/"+encodeURIComponent(o))+i}e.exports=function(e,t,o,i,r){if((!Array.isArray(i)||0===i.length)&&null!==o&&isFinite(o))return Promise.resolve(n(e,t,o,i));var E={torrent:{infoHash:t}};return Array.isArray(i)&&i.length>0&&(E.peerSearch={sources:["dht:"+t].concat(i).filter((function(e,t,o){return o.indexOf(e)===t})),min:40,max:200}),null!==o&&isFinite(o)?E.guessFileIdx=!1:(E.guessFileIdx={},r&&(null!==r.season&&isFinite(r.season)&&(E.guessFileIdx.season=r.season),null!==r.episode&&isFinite(r.episode)&&(E.guessFileIdx.episode=r.episode))),fetch(a.resolve(e,"/"+encodeURIComponent(t)+"/create"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(E)}).then((function(e){if(e.ok)return e.json();throw new Error(e.status+" ("+e.statusText+")")})).then((function(a){return n(e,t,E.guessFileIdx?a.guessedFileIdx:o,E.peerSearch?E.peerSearch.sources:[])}))}},5690:(e,t,o)=>{var a=o(7746);e.exports=a},7746:(e,t,o)=>{var a=o(6729),n=o(8575),i=o(542),r=o(3465),E=o(2682),s=o(5015),_=o(7054),T=o(9657);e.exports=function(e){function t(o){var l=new e(o=o||{});l.on("error",(function(e){I.emit("error",e),e.critical&&h("unload")})),l.on("propValue",N.bind(null,"propValue")),l.on("propChanged",N.bind(null,"propChanged")),e.manifest.events.filter((function(e){return!["error","propValue","propChanged"].includes(e)})).forEach((function(e){l.on(e,(function(e){return function(){I.emit.apply(I,[e].concat(Array.from(arguments)))}})(e))}));var S=this,u=null,d=!1,c=[],I=new a,A=!1,O={stream:!1};function N(e,t,o){I.emit(e,t,p(t,o))}function R(e){O[e]&&I.emit("propChanged",e,p(e,null))}function m(e){I.emit("error",e),e.critical&&(h("unload"),l.dispatch({type:"command",commandName:"unload"}))}function p(e,t){return"stream"===e?null!==u?u.stream:null:t}function h(e,o){switch(e){case"load":return o&&o.stream&&"string"==typeof o.streamingServerURL?(h("unload"),l.dispatch({type:"command",commandName:"unload"}),u=o,R("stream"),_(o.streamingServerURL,o.stream,o.seriesInfo).then((function(e){var a=Array.isArray(o.formats)?o.formats:s.formats,r=Array.isArray(o.videoCodecs)?o.videoCodecs:s.videoCodecs,E=Array.isArray(o.audioCodecs)?o.audioCodecs:s.audioCodecs,_=null!==o.maxAudioChannels&&isFinite(o.maxAudioChannels)?o.maxAudioChannels:s.maxAudioChannels,T=Object.assign({},o,{formats:a,videoCodecs:r,audioCodecs:E,maxAudioChannels:_});return(o.forceTranscoding?Promise.resolve(!1):t.canPlayStream({url:e},T)).catch((function(e){return console.warn("Media probe error",e),!1})).then((function(t){if(t)return{url:e};var a=i(),s=new URLSearchParams([["mediaURL",e]]);return o.forceTranscoding&&s.set("forceTranscoding","1"),r.forEach((function(e){s.append("videoCodecs",e)})),E.forEach((function(e){s.append("audioCodecs",e)})),s.set("maxAudioChannels",_),{url:n.resolve(o.streamingServerURL,"/hlsv2/"+a+"/master.m3u8?"+s.toString()),subtitles:Array.isArray(o.stream.subtitles)?o.stream.subtitles.map((function(e){return Object.assign({},e,{url:"string"==typeof e.url?n.resolve(o.streamingServerURL,"/subtitles.vtt?"+new URLSearchParams([["from",e.url]]).toString()):e.url})})):[],behaviorHints:{headers:{"content-type":"application/vnd.apple.mpegurl"}}}}))})).then((function(e){o===u&&(l.dispatch({type:"command",commandName:"load",commandArgs:Object.assign({},o,{stream:e})}),d=!0,(function(){for(;c.length>0;){var e=c.shift();S.dispatch.call(S,e)}})())})).catch((function(e){o===u&&m(Object.assign({},T.WITH_STREAMING_SERVER.CONVERT_FAILED,{error:e,critical:!0,stream:o.stream,streamingServerURL:o.streamingServerURL}))}))):m(Object.assign({},T.UNSUPPORTED_STREAM,{critical:!0,stream:o?o.stream:null,streamingServerURL:o&&"string"==typeof o.streamingServerURL?o.streamingServerURL:null})),!0;case"addExtraSubtitlesTracks":return u&&o&&Array.isArray(o.tracks)&&(d?l.dispatch({type:"command",commandName:"addExtraSubtitlesTracks",commandArgs:Object.assign({},o,{tracks:o.tracks.map((function(e){return Object.assign({},e,{url:"string"==typeof e.url?n.resolve(u.streamingServerURL,"/subtitles.vtt?"+new URLSearchParams([["from",e.url]]).toString()):e.url})}))})}):c.push({type:"command",commandName:"addExtraSubtitlesTracks",commandArgs:o})),!0;case"unload":return u=null,d=!1,c=[],R("stream"),!1;case"destroy":return h("unload"),A=!0,l.dispatch({type:"command",commandName:"destroy"}),I.removeAllListeners(),!0;default:return!d&&(c.push({type:"command",commandName:e,commandArgs:o}),!0)}}this.on=function(e,t){if(A)throw new Error("Video is destroyed");I.on(e,t)},this.dispatch=function(e){if(A)throw new Error("Video is destroyed");if(e)switch((e=E(r(e))).type){case"observeProp":if("stream"===(t=e.propName)&&(I.emit("propValue",t,p(t,null)),O[t]=!0,1))return;break;case"command":if(h(e.commandName,e.commandArgs))return}var t;l.dispatch(e)}}return t.canPlayStream=function(t,o){return e.canPlayStream(t).then((function(e){if(!e)throw new Error("Fallback using /hlsv2/probe");return e})).catch((function(){var e=new URLSearchParams([["mediaURL",t.url]]);return fetch(n.resolve(o.streamingServerURL,"/hlsv2/probe?"+e.toString())).then((function(e){return e.json()})).then((function(e){var t=o.formats.some((function(t){return-1!==e.format.name.indexOf(t)})),a=e.streams.every((function(e){return"audio"===e.track?e.channels<=o.maxAudioChannels&&-1!==o.audioCodecs.indexOf(e.codec):"video"!==e.track||-1!==o.videoCodecs.indexOf(e.codec)}));return t&&a}))}))},t.manifest={name:e.manifest.name+"WithStreamingServer",external:e.manifest.external,props:e.manifest.props.concat(["stream"]).filter((function(e,t,o){return o.indexOf(e)===t})),commands:e.manifest.commands.concat(["load","unload","destroy","addExtraSubtitlesTracks"]).filter((function(e,t,o){return o.indexOf(e)===t})),events:e.manifest.events.concat(["propValue","propChanged","error"]).filter((function(e,t,o){return o.indexOf(e)===t}))},t}},3746:function(e){"undefined"!=typeof self&&self,e.exports=(function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=1)})([function(e,t,o){"use strict";var a=o(3);function n(e){return!0===a(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,o;return!1!==n(e)&&"function"==typeof(t=e.constructor)&&!1!==n(o=t.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf")}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=t.PALETTE_MATERIAL_CHROME=t.PALETTE_MATERIAL_500=t.COLOR_NAMES=t.getLuminance=t.intToRgb=t.rgbToInt=t.rgbToHsv=t.rgbToHsl=t.hslToRgb=t.rgbToHex=t.parseColor=t.parseColorToHsla=t.parseColorToHsl=t.parseColorToRgba=t.parseColorToRgb=t.from=t.createPicker=void 0;var a=(function(){function e(e,t){for(var o=0;o-1,S="undefined"!=typeof window&&window.navigator.userAgent.indexOf("rv:")>-1,u={id:null,attachTo:"body",showHSL:!0,showRGB:!0,showHEX:!0,showAlpha:!1,color:"#ff0000",palette:null,paletteEditable:!1,useAlphaInPalette:"auto",slBarSize:[232,150],hueBarSize:[150,11],alphaBarSize:[150,11]},d="COLOR",c="RGBA_USER",I="HSLA_USER";function A(e,t,o){return e?e instanceof HTMLElement?e:e instanceof NodeList?e[0]:"string"==typeof e?document.querySelector(e):e.jquery?e.get(0):o?t:null:t}function O(e){var t=e.getContext("2d"),o=+e.width,a=+e.height,r=t.createLinearGradient(1,1,1,a-1);return r.addColorStop(0,"white"),r.addColorStop(1,"black"),{setHue:function(e){var n=t.createLinearGradient(1,0,o-1,0);n.addColorStop(0,"hsla("+e+", 100%, 50%, 0)"),n.addColorStop(1,"hsla("+e+", 100%, 50%, 1)"),t.fillStyle=r,t.fillRect(0,0,o,a),t.fillStyle=n,t.globalCompositeOperation="multiply",t.fillRect(0,0,o,a),t.globalCompositeOperation="source-over"},grabColor:function(e,o){return t.getImageData(e,o,1,1).data},findColor:function(e,t,r){var E=(0,i.rgbToHsv)(e,t,r),s=n(E,3),_=s[1],T=s[2];return[_*o,a-T*a]}}}function N(e,t,o){return null===e?t:/^\s*$/.test(e)?o:!!/true|yes|1/i.test(e)||!/false|no|0/i.test(e)&&t}function R(e,t,o){if(null===e)return t;if(/^\s*$/.test(e))return o;var a=e.split(",").map(Number);return 2===a.length&&a[0]&&a[1]?a:t}var m=(function(){function e(t,o){if(_(this,e),o?(t=A(t),this.options=Object.assign({},u,o)):t&&(0,r.default)(t)?(this.options=Object.assign({},u,t),t=A(this.options.attachTo)):(this.options=Object.assign({},u),t=A((0,i.nvl)(t,this.options.attachTo))),!t)throw new Error("Container not found: "+this.options.attachTo);!(function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"acp-";if(t.hasAttribute(o+"show-hsl")&&(e.showHSL=N(t.getAttribute(o+"show-hsl"),u.showHSL,!0)),t.hasAttribute(o+"show-rgb")&&(e.showRGB=N(t.getAttribute(o+"show-rgb"),u.showRGB,!0)),t.hasAttribute(o+"show-hex")&&(e.showHEX=N(t.getAttribute(o+"show-hex"),u.showHEX,!0)),t.hasAttribute(o+"show-alpha")&&(e.showAlpha=N(t.getAttribute(o+"show-alpha"),u.showAlpha,!0)),t.hasAttribute(o+"palette-editable")&&(e.paletteEditable=N(t.getAttribute(o+"palette-editable"),u.paletteEditable,!0)),t.hasAttribute(o+"sl-bar-size")&&(e.slBarSize=R(t.getAttribute(o+"sl-bar-size"),u.slBarSize,[232,150])),t.hasAttribute(o+"hue-bar-size")&&(e.hueBarSize=R(t.getAttribute(o+"hue-bar-size"),u.hueBarSize,[150,11]),e.alphaBarSize=e.hueBarSize),t.hasAttribute(o+"palette")){var a=t.getAttribute(o+"palette");switch(a){case"PALETTE_MATERIAL_500":e.palette=i.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":case"":e.palette=i.PALETTE_MATERIAL_CHROME;break;default:e.palette=a.split(/[;|]/)}}t.hasAttribute(o+"color")&&(e.color=t.getAttribute(o+"color"))})(this.options,t),this.H=0,this.S=0,this.L=0,this.R=0,this.G=0,this.B=0,this.A=1,this.palette={},this.element=document.createElement("div"),this.options.id&&(this.element.id=this.options.id),this.element.className="a-color-picker",this.element.innerHTML=E.default,t.appendChild(this.element);var a=this.element.querySelector(".a-color-picker-h");this.setupHueCanvas(a),this.hueBarHelper=O(a),this.huePointer=this.element.querySelector(".a-color-picker-h+.a-color-picker-dot");var n=this.element.querySelector(".a-color-picker-sl");this.setupSlCanvas(n),this.slBarHelper=O(n),this.slPointer=this.element.querySelector(".a-color-picker-sl+.a-color-picker-dot"),this.preview=this.element.querySelector(".a-color-picker-preview"),this.setupClipboard(this.preview.querySelector(".a-color-picker-clipbaord")),this.options.showHSL?(this.setupInput(this.inputH=this.element.querySelector(".a-color-picker-hsl>input[nameref=H]")),this.setupInput(this.inputS=this.element.querySelector(".a-color-picker-hsl>input[nameref=S]")),this.setupInput(this.inputL=this.element.querySelector(".a-color-picker-hsl>input[nameref=L]"))):this.element.querySelector(".a-color-picker-hsl").remove(),this.options.showRGB?(this.setupInput(this.inputR=this.element.querySelector(".a-color-picker-rgb>input[nameref=R]")),this.setupInput(this.inputG=this.element.querySelector(".a-color-picker-rgb>input[nameref=G]")),this.setupInput(this.inputB=this.element.querySelector(".a-color-picker-rgb>input[nameref=B]"))):this.element.querySelector(".a-color-picker-rgb").remove(),this.options.showHEX?this.setupInput(this.inputRGBHEX=this.element.querySelector("input[nameref=RGBHEX]")):this.element.querySelector(".a-color-picker-rgbhex").remove(),this.options.paletteEditable||this.options.palette&&this.options.palette.length>0?this.setPalette(this.paletteRow=this.element.querySelector(".a-color-picker-palette")):(this.paletteRow=this.element.querySelector(".a-color-picker-palette"),this.paletteRow.remove()),this.options.showAlpha?(this.setupAlphaCanvas(this.element.querySelector(".a-color-picker-a")),this.alphaPointer=this.element.querySelector(".a-color-picker-a+.a-color-picker-dot")):this.element.querySelector(".a-color-picker-alpha").remove(),this.element.style.width=this.options.slBarSize[0]+"px",this.onValueChanged(d,this.options.color)}return a(e,[{key:"setupHueCanvas",value:function(e){var t=this;e.width=this.options.hueBarSize[0],e.height=this.options.hueBarSize[1];for(var o=e.getContext("2d"),a=o.createLinearGradient(0,0,this.options.hueBarSize[0],0),n=0;n<=1;n+=1/360)a.addColorStop(n,"hsl("+360*n+", 100%, 50%)");o.fillStyle=a,o.fillRect(0,0,this.options.hueBarSize[0],this.options.hueBarSize[1]);var r=function(o){var a=(0,i.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.hueBarSize[0]),n=Math.round(360*a/t.options.hueBarSize[0]);t.huePointer.style.left=a-7+"px",t.onValueChanged("H",n)},E=function e(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){r(e),document.addEventListener("mousemove",r),document.addEventListener("mouseup",E)}))}},{key:"setupSlCanvas",value:function(e){var t=this;e.width=this.options.slBarSize[0],e.height=this.options.slBarSize[1];var o=function(o){var a=(0,i.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.slBarSize[0]-1),n=(0,i.limit)(o.clientY-e.getBoundingClientRect().top,0,t.options.slBarSize[1]-1),r=t.slBarHelper.grabColor(a,n);t.slPointer.style.left=a-7+"px",t.slPointer.style.top=n-7+"px",t.onValueChanged("RGB",r)},a=function e(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){o(e),document.addEventListener("mousemove",o),document.addEventListener("mouseup",a)}))}},{key:"setupAlphaCanvas",value:function(e){var t=this;e.width=this.options.alphaBarSize[0],e.height=this.options.alphaBarSize[1];var o=e.getContext("2d"),a=o.createLinearGradient(0,0,e.width-1,0);a.addColorStop(0,"hsla(0, 0%, 50%, 0)"),a.addColorStop(1,"hsla(0, 0%, 50%, 1)"),o.fillStyle=a,o.fillRect(0,0,this.options.alphaBarSize[0],this.options.alphaBarSize[1]);var n=function(o){var a=(0,i.limit)(o.clientX-e.getBoundingClientRect().left,0,t.options.alphaBarSize[0]),n=+(a/t.options.alphaBarSize[0]).toFixed(2);t.alphaPointer.style.left=a-7+"px",t.onValueChanged("ALPHA",n)},r=function e(){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",e)};e.addEventListener("mousedown",(function(e){n(e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}))}},{key:"setupInput",value:function(e){var t=this,o=+e.min,a=+e.max,n=e.getAttribute("nameref");e.hasAttribute("select-on-focus")&&e.addEventListener("focus",(function(){e.select()})),"text"===e.type?e.addEventListener("change",(function(){t.onValueChanged(n,e.value)})):((l||S)&&e.addEventListener("keydown",(function(r){"Up"===r.key?(e.value=(0,i.limit)(+e.value+1,o,a),t.onValueChanged(n,e.value),r.returnValue=!1):"Down"===r.key&&(e.value=(0,i.limit)(+e.value-1,o,a),t.onValueChanged(n,e.value),r.returnValue=!1)})),e.addEventListener("change",(function(){var r=+e.value;t.onValueChanged(n,(0,i.limit)(r,o,a))})))}},{key:"setupClipboard",value:function(e){var t=this;e.title="click to copy",e.addEventListener("click",(function(){e.value=(0,i.parseColor)([t.R,t.G,t.B,t.A],"hexcss4"),e.select(),document.execCommand("copy")}))}},{key:"setPalette",value:function(e){var t=this,o="auto"===this.options.useAlphaInPalette?this.options.showAlpha:this.options.useAlphaInPalette,a=null;switch(this.options.palette){case"PALETTE_MATERIAL_500":a=i.PALETTE_MATERIAL_500;break;case"PALETTE_MATERIAL_CHROME":a=i.PALETTE_MATERIAL_CHROME;break;default:a=(0,i.ensureArray)(this.options.palette)}if(this.options.paletteEditable||a.length>0){var n=function(o,a,n){var i=e.querySelector('.a-color-picker-palette-color[data-color="'+o+'"]')||document.createElement("div");i.className="a-color-picker-palette-color",i.style.backgroundColor=o,i.setAttribute("data-color",o),i.title=o,e.insertBefore(i,a),t.palette[o]=!0,n&&t.onPaletteColorAdd(o)},r=function(o,a){o?(e.removeChild(o),t.palette[o.getAttribute("data-color")]=!1,a&&t.onPaletteColorRemove(o.getAttribute("data-color"))):(e.querySelectorAll(".a-color-picker-palette-color[data-color]").forEach((function(t){e.removeChild(t)})),Object.keys(t.palette).forEach((function(e){t.palette[e]=!1})),a&&t.onPaletteColorRemove())};if(a.map((function(e){return(0,i.parseColor)(e,o?"rgbcss4":"hex")})).filter((function(e){return!!e})).forEach((function(e){return n(e)})),this.options.paletteEditable){var E=document.createElement("div");E.className="a-color-picker-palette-color a-color-picker-palette-add",E.innerHTML="+",e.appendChild(E),e.addEventListener("click",(function(e){/a-color-picker-palette-add/.test(e.target.className)?e.shiftKey?r(null,!0):n(o?(0,i.parseColor)([t.R,t.G,t.B,t.A],"rgbcss4"):(0,i.rgbToHex)(t.R,t.G,t.B),e.target,!0):/a-color-picker-palette-color/.test(e.target.className)&&(e.shiftKey?r(e.target,!0):t.onValueChanged(d,e.target.getAttribute("data-color")))}))}else e.addEventListener("click",(function(e){/a-color-picker-palette-color/.test(e.target.className)&&t.onValueChanged(d,e.target.getAttribute("data-color"))}))}else e.style.display="none"}},{key:"updatePalette",value:function(e){this.paletteRow.innerHTML="",this.palette={},this.paletteRow.parentElement||this.element.appendChild(this.paletteRow),this.options.palette=e,this.setPalette(this.paletteRow)}},{key:"onValueChanged",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{silent:!1};switch(e){case"H":this.H=t;var a=(0,i.hslToRgb)(this.H,this.S,this.L),r=n(a,3);this.R=r[0],this.G=r[1],this.B=r[2],this.slBarHelper.setHue(t),this.updatePointerH(this.H),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"S":this.S=t;var E=(0,i.hslToRgb)(this.H,this.S,this.L),s=n(E,3);this.R=s[0],this.G=s[1],this.B=s[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"L":this.L=t;var _=(0,i.hslToRgb)(this.H,this.S,this.L),T=n(_,3);this.R=T[0],this.G=T[1],this.B=T[2],this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"R":this.R=t;var l=(0,i.rgbToHsl)(this.R,this.G,this.B),S=n(l,3);this.H=S[0],this.S=S[1],this.L=S[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"G":this.G=t;var u=(0,i.rgbToHsl)(this.R,this.G,this.B),A=n(u,3);this.H=A[0],this.S=A[1],this.L=A[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"B":this.B=t;var O=(0,i.rgbToHsl)(this.R,this.G,this.B),N=n(O,3);this.H=N[0],this.S=N[1],this.L=N[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGBHEX(this.R,this.G,this.B);break;case"RGB":var R=n(t,3);this.R=R[0],this.G=R[1],this.B=R[2];var m=(0,i.rgbToHsl)(this.R,this.G,this.B),p=n(m,3);this.H=p[0],this.S=p[1],this.L=p[2],this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B);break;case c:var h=n(t,4);this.R=h[0],this.G=h[1],this.B=h[2],this.A=h[3];var L=(0,i.rgbToHsl)(this.R,this.G,this.B),f=n(L,3);this.H=f[0],this.S=f[1],this.L=f[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case I:var C=n(t,4);this.H=C[0],this.S=C[1],this.L=C[2],this.A=C[3];var D=(0,i.hslToRgb)(this.H,this.S,this.L),g=n(D,3);this.R=g[0],this.G=g[1],this.B=g[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"RGBHEX":var v=(0,i.cssColorToRgb)(t)||[this.R,this.G,this.B],y=n(v,3);this.R=y[0],this.G=y[1],this.B=y[2];var P=(0,i.rgbToHsl)(this.R,this.G,this.B),B=n(P,3);this.H=B[0],this.S=B[1],this.L=B[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B);break;case d:var b=(0,i.parseColor)(t,"rgba")||[0,0,0,1],M=n(b,4);this.R=M[0],this.G=M[1],this.B=M[2],this.A=M[3];var W=(0,i.rgbToHsl)(this.R,this.G,this.B),U=n(W,3);this.H=U[0],this.S=U[1],this.L=U[2],this.slBarHelper.setHue(this.H),this.updatePointerH(this.H),this.updatePointerSL(this.H,this.S,this.L),this.updateInputHSL(this.H,this.S,this.L),this.updateInputRGB(this.R,this.G,this.B),this.updateInputRGBHEX(this.R,this.G,this.B),this.updatePointerA(this.A);break;case"ALPHA":this.A=t}1===this.A?this.preview.style.backgroundColor="rgb("+this.R+","+this.G+","+this.B+")":this.preview.style.backgroundColor="rgba("+this.R+","+this.G+","+this.B+","+this.A+")",o&&o.silent||this.onchange&&this.onchange(this.preview.style.backgroundColor)}},{key:"onPaletteColorAdd",value:function(e){this.oncoloradd&&this.oncoloradd(e)}},{key:"onPaletteColorRemove",value:function(e){this.oncolorremove&&this.oncolorremove(e)}},{key:"updateInputHSL",value:function(e,t,o){this.options.showHSL&&(this.inputH.value=e,this.inputS.value=t,this.inputL.value=o)}},{key:"updateInputRGB",value:function(e,t,o){this.options.showRGB&&(this.inputR.value=e,this.inputG.value=t,this.inputB.value=o)}},{key:"updateInputRGBHEX",value:function(e,t,o){this.options.showHEX&&(this.inputRGBHEX.value=(0,i.rgbToHex)(e,t,o))}},{key:"updatePointerH",value:function(e){var t=this.options.hueBarSize[0]*e/360;this.huePointer.style.left=t-7+"px"}},{key:"updatePointerSL",value:function(e,t,o){var a=(0,i.hslToRgb)(e,t,o),r=n(a,3),E=r[0],s=r[1],_=r[2],T=this.slBarHelper.findColor(E,s,_),l=n(T,2),S=l[0],u=l[1];S>=0&&(this.slPointer.style.left=S-7+"px",this.slPointer.style.top=u-7+"px")}},{key:"updatePointerA",value:function(e){if(this.options.showAlpha){var t=this.options.alphaBarSize[0]*e;this.alphaPointer.style.left=t-7+"px"}}}]),e})(),p=(function(){function e(t){_(this,e),this.name=t,this.listeners=[]}return a(e,[{key:"on",value:function(e){e&&this.listeners.push(e)}},{key:"off",value:function(e){this.listeners=e?this.listeners.filter((function(t){return t!==e})):[]}},{key:"emit",value:function(e,t){for(var o=this.listeners.slice(0),a=0;a1&&void 0!==arguments[1]&&arguments[1];o.onValueChanged(d,e,{silent:t})},get all(){if(r){var e=[o.R,o.G,o.B,o.A],t=o.A<1?"rgba("+o.R+","+o.G+","+o.B+","+o.A+")":i.rgbToHex.apply(void 0,e);(E=(0,i.parseColor)(e,E)).toString=function(){return t},r=!1}return Object.assign({},E)},get onchange(){return a.change&&a.change.listeners[0]},set onchange(e){this.off("change").on("change",e)},get oncoloradd(){return a.coloradd&&a.coloradd.listeners[0]},set oncoloradd(e){this.off("coloradd").on("coloradd",e)},get oncolorremove(){return a.colorremove&&a.colorremove.listeners[0]},set oncolorremove(e){this.off("colorremove").on("colorremove",e)},get palette(){return Object.keys(o.palette).filter((function(e){return o.palette[e]}))},set palette(e){o.updatePalette(e)},show:function(){o.element.classList.remove("hidden")},hide:function(){o.element.classList.add("hidden")},toggle:function(){o.element.classList.toggle("hidden")},on:function(e,t){return e&&a[e]&&a[e].on(t),this},off:function(e,t){return e&&a[e]&&a[e].off(t),this},destroy:function(){a.change.off(),a.coloradd.off(),a.colorremove.off(),o.element.remove(),a=null,o=null}};return o.onchange=function(){for(var e=arguments.length,t=Array(e),o=0;ostyle[data-source="a-color-picker"]')){var L=o(5).toString(),f=document.createElement("style");f.setAttribute("type","text/css"),f.setAttribute("data-source","a-color-picker"),f.innerHTML=L,document.querySelector("head").appendChild(f)}t.createPicker=h,t.from=function(e,t){var o=(function(e){return e?Array.isArray(e)?e:e instanceof HTMLElement?[e]:e instanceof NodeList?[].concat(T(e)):"string"==typeof e?[].concat(T(document.querySelectorAll(e))):e.jquery?e.get():[]:[]})(e).map((function(e,o){var a=h(e,t);return a.index=o,a}));return o.on=function(e,t){return o.forEach((function(o){return o.on(e,t)})),this},o.off=function(e){return o.forEach((function(t){return t.off(e)})),this},o},t.parseColorToRgb=i.parseColorToRgb,t.parseColorToRgba=i.parseColorToRgba,t.parseColorToHsl=i.parseColorToHsl,t.parseColorToHsla=i.parseColorToHsla,t.parseColor=i.parseColor,t.rgbToHex=i.rgbToHex,t.hslToRgb=i.hslToRgb,t.rgbToHsl=i.rgbToHsl,t.rgbToHsv=i.rgbToHsv,t.rgbToInt=i.rgbToInt,t.intToRgb=i.intToRgb,t.getLuminance=i.getLuminance,t.COLOR_NAMES=i.COLOR_NAMES,t.PALETTE_MATERIAL_500=i.PALETTE_MATERIAL_500,t.PALETTE_MATERIAL_CHROME=i.PALETTE_MATERIAL_CHROME,t.VERSION="1.2.1"},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nvl=t.ensureArray=t.limit=t.getLuminance=t.parseColor=t.parseColorToHsla=t.parseColorToHsl=t.cssHslaToHsla=t.cssHslToHsl=t.parseColorToRgba=t.parseColorToRgb=t.cssRgbaToRgba=t.cssRgbToRgb=t.cssColorToRgba=t.cssColorToRgb=t.intToRgb=t.rgbToInt=t.rgbToHsv=t.rgbToHsl=t.hslToRgb=t.rgbToHex=t.PALETTE_MATERIAL_CHROME=t.PALETTE_MATERIAL_500=t.COLOR_NAMES=void 0;var a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return(function(e,t){var o=[],a=!0,n=!1,i=void 0;try{for(var r,E=e[Symbol.iterator]();!(a=(r=E.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){n=!0,i=e}finally{try{!a&&E.return&&E.return()}finally{if(n)throw i}}return o})(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=(function(e){return e&&e.__esModule?e:{default:e}})(o(0));function i(e){if(Array.isArray(e)){for(var t=0,o=Array(e.length);to?o:e}function s(e,t){return null==e?t:e}function _(e,t,o){var a=[E(e,0,255),E(t,0,255),E(o,0,255)];return"#"+("000000"+((e=a[0])<<16|(t=a[1])<<8|(o=a[2])).toString(16)).slice(-6)}function T(e,t,o){var a=void 0,n=void 0,i=void 0,r=[E(e,0,360)/360,E(t,0,100)/100,E(o,0,100)/100];if(e=r[0],o=r[2],0==(t=r[1]))a=n=i=o;else{var s=function(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e},_=o<.5?o*(1+t):o+t-o*t,T=2*o-_;a=s(T,_,e+1/3),n=s(T,_,e),i=s(T,_,e-1/3)}return[255*a,255*n,255*i].map(Math.round)}function l(e,t,o){var a=[E(e,0,255)/255,E(t,0,255)/255,E(o,0,255)/255];e=a[0],t=a[1],o=a[2];var n=Math.max(e,t,o),i=Math.min(e,t,o),r=void 0,s=void 0,_=(n+i)/2;if(n==i)r=s=0;else{var T=n-i;switch(s=_>.5?T/(2-n-i):T/(n+i),n){case e:r=(t-o)/T+(t>16&255,e>>8&255,255&e]},t.cssColorToRgb=u,t.cssColorToRgba=d,t.cssRgbToRgb=c,t.cssRgbaToRgba=I,t.parseColorToRgb=function(e){return Array.isArray(e)?e=[E(e[0],0,255),E(e[1],0,255),E(e[2],0,255)]:u(e)||c(e)},t.parseColorToRgba=A,t.cssHslToHsl=O,t.cssHslaToHsla=N,t.parseColorToHsl=function(e){return Array.isArray(e)?e=[E(e[0],0,360),E(e[1],0,100),E(e[2],0,100)]:O(e)},t.parseColorToHsla=R,t.parseColor=function(e,t){if(t=t||"rgb",null!=e){var o=void 0;if((o=A(e))||(o=R(e))&&(o=[].concat(i(T.apply(void 0,i(o))),[o[3]])))return(0,n.default)(t)?["rgb","rgbcss","rgbcss4","rgba","rgbacss","hsl","hslcss","hslcss4","hsla","hslacss","hex","hexcss4","int"].reduce((function(e,t){return e[t]=m(o,t),e}),t||{}):m(o,t.toString().toLowerCase())}},t.getLuminance=function(e,t,o){return.2126*(e=(e/=255)<.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t=(t/=255)<.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((o/=255)<.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},t.limit=E,t.ensureArray=function(e){return e?Array.from(e):[]},t.nvl=s},function(e,t,o){"use strict";e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t){e.exports='
'},function(e,t,o){var a=o(6);e.exports="string"==typeof a?a:a.toString()},function(e,t,o){(e.exports=o(7)(!1)).push([e.i,"/*!\n * a-color-picker\n * https://github.com/narsenico/a-color-picker\n *\n * Copyright (c) 2017-2018, Gianfranco Caldi.\n * Released under the MIT License.\n */.a-color-picker{background-color:#fff;padding:0;display:inline-flex;flex-direction:column;user-select:none;width:232px;font:400 10px Helvetica,Arial,sans-serif;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.05),0 2px 4px rgba(0,0,0,.25)}.a-color-picker,.a-color-picker-row,.a-color-picker input{box-sizing:border-box}.a-color-picker-row{padding:15px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;user-select:none}.a-color-picker-row-top{padding:0}.a-color-picker-row:not(:first-child){border-top:1px solid #f5f5f5}.a-color-picker-column{display:flex;flex-direction:column}.a-color-picker-cell{flex:1 1 auto;margin-bottom:4px}.a-color-picker-cell:last-child{margin-bottom:0}.a-color-picker-stack{position:relative}.a-color-picker-dot{position:absolute;width:14px;height:14px;top:0;left:0;background:#fff;pointer-events:none;border-radius:50px;z-index:1000;box-shadow:0 1px 2px rgba(0,0,0,.75)}.a-color-picker-a,.a-color-picker-h,.a-color-picker-sl{cursor:cell}.a-color-picker-a+.a-color-picker-dot,.a-color-picker-h+.a-color-picker-dot{top:-2px}.a-color-picker-a,.a-color-picker-h{border-radius:2px}.a-color-picker-preview{box-sizing:border-box;width:30px;height:30px;user-select:none;border-radius:15px}.a-color-picker-circle{border-radius:50px;border:1px solid #eee}.a-color-picker-hsl,.a-color-picker-rgb,.a-color-picker-single-input{justify-content:space-evenly}.a-color-picker-hsl>label,.a-color-picker-rgb>label,.a-color-picker-single-input>label{padding:0 8px;flex:0 0 auto;color:#969696}.a-color-picker-hsl>input,.a-color-picker-rgb>input,.a-color-picker-single-input>input{text-align:center;padding:2px 0;width:0;flex:1 1 auto;border:1px solid #e0e0e0;line-height:20px}.a-color-picker-hsl>input::-webkit-inner-spin-button,.a-color-picker-rgb>input::-webkit-inner-spin-button,.a-color-picker-single-input>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.a-color-picker-hsl>input:focus,.a-color-picker-rgb>input:focus,.a-color-picker-single-input>input:focus{border-color:#04a9f4;outline:none}.a-color-picker-transparent{background-image:linear-gradient(-45deg,#cdcdcd 25%,transparent 0),linear-gradient(45deg,#cdcdcd 25%,transparent 0),linear-gradient(-45deg,transparent 75%,#cdcdcd 0),linear-gradient(45deg,transparent 75%,#cdcdcd 0);background-size:11px 11px;background-position:0 0,0 -5.5px,-5.5px 5.5px,5.5px 0}.a-color-picker-sl{border-radius:3px 3px 0 0}.a-color-picker.hide-alpha [show-on-alpha],.a-color-picker.hide-hsl [show-on-hsl],.a-color-picker.hide-rgb [show-on-rgb],.a-color-picker.hide-single-input [show-on-single-input]{display:none}.a-color-picker-clipbaord{width:100%;height:100%;opacity:0;cursor:pointer}.a-color-picker-palette{flex-flow:wrap;flex-direction:row;justify-content:flex-start;padding:10px}.a-color-picker-palette-color{width:15px;height:15px;flex:0 1 15px;margin:3px;box-sizing:border-box;cursor:pointer;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.a-color-picker-palette-add{text-align:center;line-height:13px;color:#607d8b}.a-color-picker.hidden{display:none}",""])},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=(function(e,t){var o=e[1]||"",a=e[3];if(!a)return o;if(t&&"function"==typeof btoa){var n=(function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"})(a),i=a.sources.map((function(e){return"/*# sourceURL="+a.sourceRoot+e+" */"}));return[o].concat(i).concat([n]).join("\n")}return[o].join("\n")})(t,e);return t[2]?"@media "+t[2]+"{"+o+"}":o})).join("")},t.i=function(e,o){"string"==typeof e&&(e=[[null,e,""]]);for(var a={},n=0;n{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(1341);e.exports=a},9239:(e,t,o)=>{var a=o(7294),n=o(3662).useServices,i=o(6590).useToast;e.exports=function(){var e=n(),t=e.core,o=e.dragAndDrop,r=i();return a.useEffect((function(){var e=function(e){var t=e.event,o=e.args;switch(t){case"Error":if("UserPulledFromAPI"===o.source.event&&null===o.source.args.uid)break;if("LibrarySyncWithAPIPlanned"===o.source.event&&null===o.source.args.uid)break;if("Other"===o.error.type&&3===o.error.code&&"AddonInstalled"===o.source.event&&o.source.args.transport_url.startsWith("https://www.strem.io/trakt/addon"))break;r.show({type:"error",title:o.source.event,message:o.error.message,timeout:4e3,dataset:{type:"CoreEvent"}});break;case"TorrentParsed":r.show({type:"success",title:"Torrent file parsed",timeout:4e3});break;case"MagnetParsed":r.show({type:"success",title:"Magnet link parsed",timeout:4e3});break;case"PlayingOnDevice":r.show({type:"success",title:"Stream opened in ".concat(o.device),timeout:4e3})}},a=function(e){var t;r.show({type:"error",title:e.message,message:null===(t=e.file)||void 0===t?void 0:t.name,timeout:4e3})};return t.transport.on("CoreEvent",e),o.on("error",a),function(){t.transport.off("CoreEvent",e),o.off("error",a)}}),[]),null}},4008:(e,t,o)=>{var a=o(5677);e.exports=a},9884:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(9872),s=o(8135),_=function(e){var t=e.className,o=e.id,n=e.name,_=e.version,T=e.logo,l=e.description,S=e.types,u=e.transportUrl,d=e.official,c=a.useCallback((function(){return a.createElement(r,{className:s.icon,name:"addons"})}),[]);return a.createElement("div",{className:i(t,s["addon-details-container"])},a.createElement("div",{className:s["title-container"]},a.createElement(E,{className:s.logo,src:T,alt:" ",renderFallback:c}),a.createElement("div",{className:s["name-container"]},a.createElement("span",{className:s.name},"string"==typeof n&&n.length>0?n:o),"string"==typeof _&&_.length>0?a.createElement("span",{className:s.version},"v. ",_):null)),"string"==typeof l&&l.length>0?a.createElement("div",{className:s["section-container"]},a.createElement("span",{className:s["section-label"]},l)):null,"string"==typeof u&&u.length>0?a.createElement("div",{className:s["section-container"]},a.createElement("span",{className:s["section-header"]},"URL: "),a.createElement("span",{className:i(s["section-label"],s["transport-url-label"])},u)):null,Array.isArray(S)&&S.length>0?a.createElement("div",{className:s["section-container"]},a.createElement("span",{className:s["section-header"]},"Supported types: "),a.createElement("span",{className:s["section-label"]},1===S.length?S[0]:S.slice(0,-1).join(", ")+" & "+S[S.length-1])):null,d?null:a.createElement("div",{className:s["section-container"]},a.createElement("div",{className:i(s["section-label"],s["disclaimer-label"])},"Using third-party add-ons will always be subject to your responsibility and the governing law of the jurisdiction you are located.")))};_.propTypes={className:n.string,id:n.string,name:n.string,version:n.string,logo:n.string,description:n.string,types:n.arrayOf(n.string),transportUrl:n.string,official:n.bool},e.exports=_},5368:(e,t,o)=>{var a=o(5471);e.exports=a},8029:(e,t,o)=>{var a=["remoteAddon","localAddon"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(8253),_=o(6672).withCoreSuspender,T=o(3662).useServices,l=(function(e){var t=function(t){var o=t.remoteAddon,E=t.localAddon,s=i(t,a),_=null!==o&&"Ready"===o.content.type?o.content.content:null!==E?E:null;return null===_?null:r.createElement(e,n({},s,{id:_.manifest.id,name:_.manifest.name,version:_.manifest.version,logo:_.manifest.logo,description:_.manifest.description,types:_.manifest.types,transportUrl:_.transportUrl,official:_.flags.official}))};return t.displayName="withRemoteAndLocalAddon",t})(o(5368)),S=o(9208),u=o(355);var d=function(e){var t=e.transportUrl,o=e.onCloseRequest,a=T().core,n=S(t),i=r.useMemo((function(){var e={className:u["cancel-button"],label:"Cancel",props:{onClick:function(e){"function"==typeof o&&o({type:"cancel",reactEvent:e,nativeEvent:e.nativeEvent})}}},i=null!==n.remoteAddon&&"Ready"===n.remoteAddon.content.type&&n.remoteAddon.content.content.manifest.behaviorHints.configurable?{className:u["configure-button"],label:"Configure",props:{onClick:function(e){window.open(t.replace("manifest.json","configure")),"function"==typeof o&&o({type:"configure",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null,r=null!==n.localAddon?{className:u["uninstall-button"],label:"Uninstall",props:{onClick:function(e){a.transport.dispatch({action:"Ctx",args:{action:"UninstallAddon",args:n.localAddon}}),"function"==typeof o&&o({type:"uninstall",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null!==n.remoteAddon&&"Ready"===n.remoteAddon.content.type?{className:u["install-button"],label:"Install",props:{onClick:function(e){a.transport.dispatch({action:"Ctx",args:{action:"InstallAddon",args:n.remoteAddon.content.content}}),"function"==typeof o&&o({type:"install",reactEvent:e,nativeEvent:e.nativeEvent})}}}:null;return null!==r?i?[e,i,r]:[e,r]:[e]}),[n,o]);return r.createElement(s,{className:u["addon-details-modal-container"],title:"Stremio addon",buttons:i,onCloseRequest:o},null===n.selected?r.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest"):null===n.remoteAddon||"Loading"===n.remoteAddon.content.type?r.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest from ",n.selected.transportUrl):"Err"===n.remoteAddon.content.type&&null===n.localAddon?r.createElement("div",{className:u["addon-details-message-container"]},"Failed to get addon manifest from ",n.selected.transportUrl,r.createElement("div",null,n.remoteAddon.content.content.message)):r.createElement(l,{className:u["addon-details-container"],remoteAddon:n.remoteAddon,localAddon:n.localAddon}))};d.propTypes={transportUrl:E.string,onCloseRequest:E.func};var c=function(e){var t=e.onCloseRequest;return r.createElement(s,{className:u["addon-details-modal-container"],title:"Stremio addon",onCloseRequest:t},r.createElement("div",{className:u["addon-details-message-container"]},"Loading addon manifest"))};c.propTypes=d.propTypes,e.exports=_(d,c)},8512:(e,t,o)=>{var a=o(8029);e.exports=a},9208:(e,t,o)=>{var a=o(7294),n=o(1535);e.exports=function(e){var t=a.useMemo((function(){return"string"==typeof e?{action:"Load",args:{model:"AddonDetails",args:{transportUrl:e}}}:{action:"Unload"}}),[e]);return n({model:"addon_details",action:t})}},7458:(e,t,o)=>{var a=["className","href","disabled","children","onLongPress"];function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(4520),S=o(243).useLongPress,u=s.forwardRef((function(e,t){var o=e.className,n=e.href,r=e.disabled,_=e.children,u=e.onLongPress,d=E(e,a),c=S(u,{detect:"pointer"}),I=s.useCallback((function(e){"function"==typeof d.onKeyDown&&d.onKeyDown(e),"Enter"===e.key&&(e.preventDefault(),e.nativeEvent.buttonClickPrevented||e.currentTarget.click())}),[d.onKeyDown]),A=s.useCallback((function(e){"function"==typeof d.onMouseDown&&d.onMouseDown(e),e.nativeEvent.buttonBlurPrevented||(e.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur())}),[d.onMouseDown]);return s.createElement("string"==typeof n&&n.length>0?"a":"div",i(i({tabIndex:0},d),{},{ref:t,className:T(o,l["button-container"],{disabled:r}),href:n,onKeyDown:I,onMouseDown:A},c()),_)}));u.displayName="Button",u.propTypes={className:_.string,href:_.string,disabled:_.bool,children:_.node,onKeyDown:_.func,onMouseDown:_.func,onLongPress:_.func},e.exports=u},6851:(e,t,o)=>{var a=o(7458);e.exports=a},2734:e=>{var t={movie:10,series:9,channel:8,tv:7,music:6,radio:5,podcast:4,game:3,book:2,adult:1,other:-1/0},o=new Map([["movie","movies"],["series","series"],["channel","channels"],["tv","tv"],["book","ic_book"],["game","ic_games"],["music","ic_music"],["adult","ic_adult"],["radio","ic_radio"],["podcast","ic_podcast"],["other","movies"]]);e.exports={CHROMECAST_RECEIVER_APP_ID:"1634F54B",SUBTITLES_SIZES:[75,100,125,150,175,200,250],SUBTITLES_FONTS:["PlusJakartaSans","Arial","Halvetica","Times New Roman","Verdana","Courier","Lucida Console","sans-serif","serif","monospace"],SEEK_TIME_DURATIONS:[5e3,1e4,15e3,2e4,25e3,3e4],NEXT_VIDEO_POPUP_DURATIONS:[0,5e3,1e4,15e3,2e4,25e3,3e4,35e3,4e4,45e3,5e4],CATALOG_PREVIEW_SIZE:10,CATALOG_PAGE_SIZE:100,NONE_EXTRA_VALUE:"None",SKIP_EXTRA_NAME:"skip",META_LINK_CATEGORY:"meta",IMDB_LINK_CATEGORY:"imdb",SHARE_LINK_CATEGORY:"share",WRITERS_LINK_CATEGORY:"Writers",TYPE_PRIORITIES:t,ICON_FOR_TYPE:o}},3064:(e,t,o)=>{var a=["className","checked","children"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(6851),T=o(1726),l=r.forwardRef((function(e,t){var o=e.className,E=e.checked,l=e.children,S=i(e,a);return r.createElement(_,n({},S,{ref:t,className:s(o,T["checkbox-container"],{checked:E})}),r.createElement("div",{className:T.toggle}),l)}));l.displayName="Checkbox",l.propTypes={className:E.string,checked:E.bool,children:E.node},e.exports=l},9666:(e,t,o)=>{var a=o(3064);e.exports=a},4750:(e,t,o)=>{var a=["className","value","dataset","onChange"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(3746),S=o(1468).useTranslation,u=o(6851),d=o(8253),c=o(4024),I=o(7711),A=o(5461),O=function(e){var t=l.parseColor(e,"hexcss4");return"string"==typeof t?t:"#ffffffff"},N=function(e){var t=e.className,o=e.value,r=e.dataset,_=e.onChange,l=E(e,a),N=S().t,R=i(c(!1),3),m=R[0],p=R[1],h=R[2],L=i(s.useState((function(){return O(o)})),2),f=L[0],C=L[1],D=s.useMemo((function(){return{backgroundColor:o}}),[o]),g=s.useMemo((function(){return O(o).endsWith("00")}),[o]),v=s.useCallback((function(e){"function"==typeof l.onClick&&l.onClick(e),e.nativeEvent.openModalPrevented||p()}),[l.onClick]),y=s.useCallback((function(e){e.nativeEvent.openModalPrevented=!0}),[]),P=s.useMemo((function(){return[{label:"Select",props:{"data-autofocus":!0,onClick:function(e){"function"==typeof _&&_({type:"change",value:f,dataset:r,reactEvent:e,nativeEvent:e.nativeEvent}),h()}}}]}),[f,r,_]),B=s.useCallback((function(e){C(O(e.value))}),[]);return s.useLayoutEffect((function(){C(O(o))}),[o,m]),s.createElement(u,n({title:g?N("BUTTON_COLOR_TRANSPARENT"):o},l,{style:D,className:T(t,A["color-input-container"]),onClick:v}),g?s.createElement("div",{className:A["transparent-label-container"]},s.createElement("div",{className:A["transparent-label"]},N("BUTTON_COLOR_TRANSPARENT"))):null,m?s.createElement(d,{title:"Choose a color:",buttons:P,onCloseRequest:h,onClick:y},s.createElement(I,{className:A["color-picker-container"],value:f,onInput:B})):null)};N.propTypes={className:_.string,value:_.string,dataset:_.object,onChange:_.func,onClick:_.func},e.exports=N},3378:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(3746),E=o(4809),s=function(e){return r.parseColor(e,"hexcss4")},_=function(e){var t=e.className,o=e.value,n=e.onInput,_=a.useRef(null),T=a.useRef(null);return a.useLayoutEffect((function(){_.current=r.createPicker(T.current,{color:s(o),showHSL:!1,showHEX:!1,showRGB:!1,showAlpha:!0});var e=T.current.querySelector(".a-color-picker-clipbaord");e instanceof HTMLElement&&(e.tabIndex=-1)}),[]),a.useLayoutEffect((function(){return"function"==typeof n&&_.current.on("change",(function(e,t){n({type:"input",value:s(t)})})),function(){_.current.off("change")}}),[n]),a.useLayoutEffect((function(){var e=s(o);e!==s(_.current.color)&&(_.current.color=e)}),[o]),a.createElement("div",{ref:T,className:i(t,E["color-picker-container"])})};_.propTypes={className:n.string,value:n.string,onInput:n.func},e.exports=_},7711:(e,t,o)=>{var a=o(3378);e.exports=a},8809:(e,t,o)=>{var a=o(4750);e.exports=a},6672:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o1&&void 0!==arguments[1]?arguments[1]:function(){};return function(o){var n=r().core,T=_(),l=a(i.useState(null===T),2),S=l[0],u=l[1],d=i.useRef({}),c=i.useRef({}),I=i.useCallback((function(e){return d.current[e]||(d.current[e]=s(n.transport.getState(e))),d.current[e].read()}),[]),A=i.useCallback((function(e){return c.current[e]||(c.current[e]=s(n.transport.decodeStream(e))),c.current[e].read()}),[]),O=i.useMemo((function(){return{getState:I,decodeStream:A}}),[]);return i.useLayoutEffect((function(){S||u(!0)}),[]),S?i.createElement(i.Suspense,{fallback:i.createElement(t,o)},i.createElement(E.Provider,{value:O},i.createElement(e,o))):null}},useCoreSuspender:_}},7473:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(7473);e.exports=a},9504:(e,t,o)=>{var a=["className","src","alt","fallbackSrc","renderFallback"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=function(e){var t=e.className,o=e.src,r=e.alt,_=e.fallbackSrc,T=e.renderFallback,l=E(e,a),S=i(s.useState(!1),2),u=S[0],d=S[1],c=s.useCallback((function(e){"function"==typeof l.onError&&l.onError(e),d(!0)}),[l.onError]);return s.useLayoutEffect((function(){d(!1)}),[o]),!u&&"string"==typeof o&&0!==o.length||"function"!=typeof T&&"string"!=typeof _?s.createElement("img",n({},l,{className:t,src:o,alt:r,onError:c})):"function"==typeof T?T():s.createElement("img",n({},l,{className:t,src:_,alt:r}))};T.propTypes={className:_.string,src:_.string,alt:_.string,fallbackSrc:_.string,renderFallback:_.func,onError:_.func},e.exports=T},9872:(e,t,o)=>{var a=o(9504);e.exports=a},859:(e,t,o)=>{var a=["_id","removable"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var _=o(7294),T=o(3662).useServices,l=o(5697),S=o(8277),u=o(7049),d=o(6073).t,c=[{label:"LIBRARY_PLAY",value:"play"},{label:"LIBRARY_DETAILS",value:"details"},{label:"LIBRARY_RESUME_DISMISS",value:"dismiss"},{label:"LIBRARY_REMOVE",value:"remove"}],I=function(e){var t=e._id,o=e.removable,i=s(e,a),E=T().core,l=u(),I=_.useMemo((function(){var e,o,a,n=null!==(e=null===(o=l.items)||void 0===o||null===(a=o[t])||void 0===a?void 0:a.length)&&void 0!==e?e:0;return Math.min(Math.max(n,0),99)}),[t,l.items]),A=_.useMemo((function(){return c.filter((function(e){switch(e.value){case"play":return i.deepLinks&&"string"==typeof i.deepLinks.player;case"details":return i.deepLinks&&("string"==typeof i.deepLinks.metaDetailsVideos||"string"==typeof i.deepLinks.metaDetailsStreams);case"dismiss":return"string"==typeof t&&null!==i.progress&&!isNaN(i.progress);case"remove":return"string"==typeof t&&o}})).map((function(e){return r(r({},e),{},{label:d(e.label)})}))}),[t,o,i.progress,i.deepLinks]),O=_.useCallback((function(e){if("function"==typeof i.optionOnSelect&&i.optionOnSelect(e),!e.nativeEvent.optionSelectPrevented)switch(e.value){case"play":i.deepLinks&&"string"==typeof i.deepLinks.player&&(window.location=i.deepLinks.player);break;case"details":i.deepLinks&&("string"==typeof i.deepLinks.metaDetailsVideos?window.location=i.deepLinks.metaDetailsVideos:"string"==typeof i.deepLinks.metaDetailsStreams&&(window.location=i.deepLinks.metaDetailsStreams));break;case"dismiss":"string"==typeof t&&(E.transport.dispatch({action:"Ctx",args:{action:"RewindLibraryItem",args:t}}),E.transport.dispatch({action:"Ctx",args:{action:"DismissNotificationItem",args:t}}));break;case"remove":"string"==typeof t&&E.transport.dispatch({action:"Ctx",args:{action:"RemoveFromLibrary",args:t}})}}),[t,i.deepLinks,i.optionOnSelect]);return _.createElement(S,n({},i,{newVideos:I,options:A,optionOnSelect:O}))};I.propTypes={_id:l.string,removable:l.bool,progress:l.number,deepLinks:l.shape({metaDetailsVideos:l.string,metaDetailsStreams:l.string,player:l.string}),optionOnSelect:l.func},e.exports=I},5748:(e,t,o)=>{var a=o(859);e.exports=a},3364:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1785),E=r.VerticalNavBar,s=r.HorizontalNavBar,_=o(9684),T=[{id:"board",label:"Board",icon:"home",href:"#/"},{id:"discover",label:"Discover",icon:"discover",href:"#/discover"},{id:"library",label:"Library",icon:"library",href:"#/library"},{id:"addons",label:"ADDONS",icon:"addons",href:"#/addons"},{id:"settings",label:"SETTINGS",icon:"settings",href:"#/settings"}],l=a.memo((function(e){var t=e.className,o=e.route,n=e.query,r=e.children;return a.createElement("div",{className:i(t,_["main-nav-bars-container"])},a.createElement(s,{className:_["horizontal-nav-bar"],route:o,query:n,backButton:!1,searchBar:!0,addonsButton:!0,fullscreenButton:!0,navMenu:!0}),a.createElement(E,{className:_["vertical-nav-bar"],selected:o,tabs:T}),a.createElement("div",{className:_["nav-content-container"]},r))}));l.displayName="MainNavBars",l.propTypes={className:n.string,route:n.string,query:n.string,children:n.node},e.exports=l},1297:(e,t,o)=>{var a=o(3364);e.exports=a},3037:(e,t,o)=>{var a=["className","type","name","poster","posterShape","playIcon","progress","newVideos","options","deepLinks","dataset","optionOnSelect"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(7280).Z,S=o(5985).default,u=o(6851),d=o(9872),c=o(3981),I=o(926),A=o(4024),O=o(2734).ICON_FOR_TYPE,N=o(4661),R=s.memo((function(e){var t=e.className,o=e.type,r=e.name,_=e.poster,R=e.posterShape,m=e.playIcon,p=e.progress,h=e.newVideos,L=e.options,f=e.deepLinks,C=e.dataset,D=e.optionOnSelect,g=E(e,a),v=i(A(!1),3),y=v[0],P=v[1],B=v[2],b=s.useMemo((function(){return f?"string"==typeof f.player?f.player:"string"==typeof f.metaDetailsStreams?f.metaDetailsStreams:"string"==typeof f.metaDetailsVideos?f.metaDetailsVideos:null:null}),[f]),M=s.useCallback((function(e){"function"==typeof g.onClick&&g.onClick(e),e.nativeEvent.selectPrevented&&e.preventDefault()}),[g.onClick]),W=s.useCallback((function(e){e.nativeEvent.selectPrevented=!0}),[]),U=s.useCallback((function(e){"function"==typeof D&&D({type:"select-option",value:e.value,dataset:C,reactEvent:e.reactEvent,nativeEvent:e.nativeEvent})}),[C,D]),G=s.useCallback((function(){return s.createElement(S,{className:N["placeholder-icon"],name:O.has(o)?O.get(o):O.get("other")})}),[o]),F=s.useCallback((function(){return s.createElement(S,{className:N.icon,name:"more-vertical"})}),[]);return s.createElement(u,n({title:r,href:b},l(g),{className:T(t,N["meta-item-container"],N["poster-shape-poster"],N["poster-shape-".concat(R)],{active:y}),onClick:M}),s.createElement("div",{className:N["poster-container"]},s.createElement("div",{className:N["poster-image-layer"]},s.createElement(d,{className:N["poster-image"],src:_,alt:" ",renderFallback:G})),m?s.createElement("div",{className:N["play-icon-layer"]},s.createElement(I,{className:N["play-icon"]})):null,p>0?s.createElement("div",{className:N["progress-bar-layer"]},s.createElement("div",{className:N["progress-bar"],style:{width:"".concat(100*Math.max(0,Math.min(1,p)),"%")}})):null,h>0?s.createElement("div",{className:N["new-videos"]},s.createElement("div",{className:N.layer}),s.createElement("div",{className:N.layer}),s.createElement("div",{className:N.layer},"+",h)):null),"string"==typeof r&&r.length>0||Array.isArray(L)&&L.length>0?s.createElement("div",{className:N["title-bar-container"]},s.createElement("div",{className:N["title-label"]},"string"==typeof r&&r.length>0?r:""),Array.isArray(L)&&L.length>0?s.createElement(c,{className:N["menu-label-container"],renderLabelContent:F,options:L,onOpen:P,onClose:B,onSelect:U,tabIndex:-1,onClick:W}):null):null)}));R.displayName="MetaItem",R.propTypes={className:_.string,type:_.string,name:_.string,poster:_.string,posterShape:_.oneOf(["poster","landscape","square"]),playIcon:_.bool,progress:_.number,newVideos:_.number,options:_.array,deepLinks:_.shape({metaDetailsVideos:_.string,metaDetailsStreams:_.string,player:_.string}),dataset:_.object,optionOnSelect:_.func,onClick:_.func},e.exports=R},8277:(e,t,o)=>{var a=o(3037);e.exports=a},4902:(e,t,o)=>{var a=["className","icon","label"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(5985).default,T=o(6851),l=o(5883),S=function(e){var t=e.className,o=e.icon,E=e.label,S=i(e,a);return r.createElement(T,n({title:E},S,{className:s(t,l["action-button-container"],{wide:"string"==typeof E})}),"string"==typeof o&&o.length>0?r.createElement("div",{className:l["icon-container"]},r.createElement(_,{className:l.icon,name:o})):null,"string"==typeof E&&E.length>0?r.createElement("div",{className:l["label-container"]},r.createElement("div",{className:l.label},E)):null)};S.propTypes={className:E.string,icon:E.string,label:E.string},e.exports=S},217:(e,t,o)=>{var a=o(4902);e.exports=a},8049:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(6851),s=o(7621),_=function(e){var t=e.className,o=e.label,n=e.links,_=r().t;return a.createElement("div",{className:i(t,s["meta-links-container"])},"string"==typeof o&&o.length>0?a.createElement("div",{className:s["label-container"]},_("LINKS_".concat(o.toUpperCase()))):null,Array.isArray(n)&&n.length>0?a.createElement("div",{className:s["links-container"]},n.map((function(e,t){var o=e.label,n=e.href;return a.createElement(E,{key:t,className:s["link-container"],title:o,href:n},_(o))}))):null)};_.propTypes={className:n.string,label:n.string,links:n.arrayOf(n.shape({label:n.string,href:n.string}))},e.exports=_},7818:(e,t,o)=>{var a=o(8049);e.exports=a},6314:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&(e.has(o)||e.set(o,[]),e.get(o).push({label:a,href:"https://www.stremio.com/warning#".concat(encodeURIComponent(n))})),e}),new Map):new Map}),[P]),V=r.useMemo((function(){return y?"string"==typeof y.player?y.player:"string"==typeof y.metaDetailsStreams?y.metaDetailsStreams:"string"==typeof y.metaDetailsVideos?y.metaDetailsVideos:null:null}),[y]),H=r.useMemo((function(){return Array.isArray(B)&&0!==B.length?B[0].deepLinks.player:null}),[B]),Y=r.useCallback((function(){return r.createElement("div",{className:p["logo-placeholder"]},m)}),[m]);return r.createElement("div",{className:s(E,p["meta-preview-container"],(t={},o=p.compact,i=A,o in t?Object.defineProperty(t,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[o]=i,t))},"string"==typeof f&&f.length>0?r.createElement("div",{className:p["background-image-layer"]},r.createElement(u,{className:p["background-image"],src:f,alt:" "})):null,r.createElement("div",{className:p["meta-info-container"]},"string"==typeof L&&L.length>0?r.createElement(u,{className:p.logo,src:L,alt:" ",title:m,renderFallback:Y}):Y(),"string"==typeof D&&D.length>0||g instanceof Date&&!isNaN(g.getTime())||"string"==typeof C&&C.length>0||w.has(I.IMDB_LINK_CATEGORY)?r.createElement("div",{className:p["runtime-release-info-container"]},"string"==typeof C&&C.length>0?r.createElement("div",{className:p["runtime-label"]},C):null,"string"==typeof D&&D.length>0?r.createElement("div",{className:p["release-info-label"]},D):g instanceof Date&&!isNaN(g.getTime())?r.createElement("div",{className:p["release-info-label"]},g.getFullYear()):null,w.has(I.IMDB_LINK_CATEGORY)?r.createElement(S,a({className:p["imdb-button-container"],title:w.get(I.IMDB_LINK_CATEGORY).label,href:w.get(I.IMDB_LINK_CATEGORY).href,target:"_blank"},A?{tabIndex:-1}:null),r.createElement("div",{className:p.label},w.get(I.IMDB_LINK_CATEGORY).label),r.createElement(l,{className:p.icon,name:"imdb"})):null):null,A&&"string"==typeof v&&v.length>0?r.createElement("div",{className:p["description-container"]},v):null,Array.from(w.keys()).filter((function(e){return e!==I.IMDB_LINK_CATEGORY&&e!==I.SHARE_LINK_CATEGORY&&e!==I.WRITERS_LINK_CATEGORY})).map((function(e,t){return r.createElement(R,{key:t,className:p["meta-links"],label:e,links:w.get(e)})})),!A&&"string"==typeof v&&v.length>0?r.createElement("div",{className:p["description-container"]},r.createElement("div",{className:p["label-container"]},W("SUMMARY")),v):null),r.createElement("div",{className:p["action-buttons-container"]},"function"==typeof M?r.createElement(N,{className:p["action-button"],icon:b?"remove-from-library":"add-to-library",label:A?null:W(b?"REMOVE_FROM_LIB":"ADD_TO_LIB"),tabIndex:A?-1:0,onClick:M}):null,"string"==typeof H?r.createElement(N,{className:p["action-button"],icon:"trailer",label:A?null:W("TRAILER"),tabIndex:A?-1:0,href:H}):null,"string"==typeof V&&A?r.createElement(N,{className:p["action-button"],icon:"play",label:W("SHOW"),tabIndex:A?-1:0,href:V}):null,w.has(I.SHARE_LINK_CATEGORY)&&!A?r.createElement(r.Fragment,null,r.createElement(N,{className:p["action-button"],icon:"share",tooltip:W("CTX_SHARE"),tabIndex:A?-1:0,onClick:F}),G?r.createElement(d,{title:W("CTX_SHARE"),onCloseRequest:k},r.createElement(c,{className:p["share-prompt"],url:w.get(I.SHARE_LINK_CATEGORY).href})):null):null))};L.Placeholder=m,L.propTypes={className:E.string,compact:E.bool,name:E.string,logo:E.string,background:E.string,runtime:E.string,releaseInfo:E.string,released:E.instanceOf(Date),description:E.string,deepLinks:E.shape({metaDetailsVideos:E.string,metaDetailsStreams:E.string,player:E.string}),links:E.arrayOf(E.shape({category:E.string,name:E.string,url:E.string})),trailerStreams:E.array,inLibrary:E.bool,toggleInLibrary:E.func},e.exports=L},2641:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(6506),E=function(e){var t=e.className;return a.createElement("div",{className:i(t,r["meta-preview-placeholder-container"])},a.createElement("div",{className:r["meta-info-container"]},a.createElement("div",{className:r["logo-container"]}),a.createElement("div",{className:r["duration-release-info-container"]},a.createElement("div",{className:r["duration-container"]}),a.createElement("div",{className:r["release-info-container"]})),a.createElement("div",{className:r["genres-container"]},a.createElement("div",{className:r["genres-header-container"]}),a.createElement("div",{className:r["genre-label-container"]})),a.createElement("div",{className:r["genres-container"]},a.createElement("div",{className:r["genres-header-container"]}),a.createElement("div",{className:r["genre-label-container"]})),a.createElement("div",{className:r["genres-container"]},a.createElement("div",{className:r["genres-header-container"]}),a.createElement("div",{className:r["genre-label-container"]}))),a.createElement("div",{className:r["action-buttons-container"]}))};E.propTypes={className:n.string},e.exports=E},4322:(e,t,o)=>{var a=o(2641);e.exports=a},3070:(e,t,o)=>{var a=o(6314);e.exports=a},8370:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t0||d&&("string"==typeof d.discover||"string"==typeof d.library)?r.createElement("div",{className:c["header-container"]},"string"==typeof o&&o.length>0?r.createElement("div",{className:c["title-container"],title:o},o):null,!d||"string"!=typeof d.discover&&"string"!=typeof d.library?null:r.createElement(S,{className:c["see-all-container"],title:I("BUTTON_SEE_ALL"),href:d.discover||d.library,tabIndex:-1},r.createElement("div",{className:c.label},I("BUTTON_SEE_ALL")),r.createElement(l,{className:c.icon,name:"chevron-forward"}))):null,"string"==typeof a&&a.length>0?r.createElement("div",{className:c["message-container"],title:a},a):r.createElement("div",{className:c["meta-items-container"]},E.isValidElementType(s)?i.slice(0,u.CATALOG_PREVIEW_SIZE).map((function(e,t){return r.createElement(s,n(n({},e),{},{key:t,className:_(c["meta-item"],c["poster-shape-poster"],c["poster-shape-".concat(e.posterShape)])}))})):null,Array(Math.max(0,u.CATALOG_PREVIEW_SIZE-i.length)).fill(null).map((function(e,t){return r.createElement("div",{key:t,className:_(c["meta-item"],c["poster-shape-poster"])})}))))};I.Placeholder=d,I.propTypes={className:s.string,title:s.string,message:s.string,items:s.arrayOf(s.shape({posterShape:s.string})),itemComponent:s.elementType,deepLinks:s.shape({discover:s.string,library:s.string})},e.exports=I},2268:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(5985).default,s=o(6851),_=o(2734),T=o(7841),l=function(e){var t=e.className,o=e.title,n=e.deepLinks,l=r().t;return a.createElement("div",{className:i(t,T["meta-row-placeholder-container"])},a.createElement("div",{className:T["header-container"]},a.createElement("div",{className:T["title-container"],title:"string"==typeof o&&o.length>0?o:null},"string"==typeof o&&o.length>0?o:null),n&&"string"==typeof n.discover?a.createElement(s,{className:T["see-all-container"],title:l("BUTTON_SEE_ALL"),href:n.discover,tabIndex:-1},a.createElement("div",{className:T.label},l("BUTTON_SEE_ALL")),a.createElement(E,{className:T.icon,name:"chevron-forward"})):null),a.createElement("div",{className:T["meta-items-container"]},Array(_.CATALOG_PREVIEW_SIZE).fill(null).map((function(e,t){return a.createElement("div",{key:t,className:T["meta-item"]},a.createElement("div",{className:T["poster-container"]}),a.createElement("div",{className:T["title-bar-container"]},a.createElement("div",{className:T["title-label"]})))}))))};l.propTypes={className:n.string,title:n.string,deepLinks:n.shape({discover:n.string})},e.exports=l},411:(e,t,o)=>{var a=o(2268);e.exports=a},9321:(e,t,o)=>{var a=o(8370);e.exports=a},8787:(e,t,o)=>{var a=["className","title","buttons","children","dataset","onCloseRequest"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(1665),T=_.useRouteFocused,l=_.useModalsContainer,S=o(6851),u=o(5985).default,d=o(1665).Modal,c=o(1621),I=function(e){var t=e.className,o=e.title,E=e.buttons,_=e.children,I=e.dataset,A=e.onCloseRequest,O=i(e,a),N=T(),R=l(),m=r.useRef(null),p=r.useCallback((function(e){"function"==typeof A&&A({type:"close",dataset:I,reactEvent:e,nativeEvent:e.nativeEvent})}),[I,A]),h=r.useCallback((function(e){e.nativeEvent.closeModalDialogPrevented||"function"!=typeof A||A({type:"close",dataset:I,reactEvent:e,nativeEvent:e.nativeEvent})}),[I,A]),L=r.useCallback((function(e){e.nativeEvent.closeModalDialogPrevented=!0}),[]);return r.useEffect((function(){var e=function(e){"Escape"===e.code&&R.childNodes[R.childElementCount-2]===m.current&&"function"==typeof A&&A({type:"close",dataset:I,nativeEvent:e})};return N&&window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[N,I,A]),r.createElement(d,n({ref:m},O,{className:s(t,c["modal-container"]),onMouseDown:h}),r.createElement("div",{className:c["modal-dialog-container"],onMouseDown:L},r.createElement(S,{className:c["close-button-container"],title:"Close",onClick:p},r.createElement(u,{className:c.icon,name:"close"})),"string"==typeof o&&o.length>0?r.createElement("div",{className:c["title-container"],title:o},o):null,r.createElement("div",{className:c["modal-dialog-content"]},_),Array.isArray(E)&&E.length>0?r.createElement("div",{className:c["buttons-container"]},E.map((function(e,t){var o=e.className,a=e.label,i=e.icon,E=e.props;return r.createElement(S,n({title:a},E,{key:t,className:s(o,c["action-button"])}),"string"==typeof i&&i.length>0?r.createElement(u,{className:c.icon,name:i}):null,"string"==typeof a&&a.length>0?r.createElement("div",{className:c.label},a):null)}))):null))};I.propTypes={className:E.string,title:E.string,buttons:E.arrayOf(E.shape({className:E.string,label:E.string,icon:E.string,props:E.object})),children:E.oneOfType([E.arrayOf(E.node),E.node]),dataset:E.object,onCloseRequest:E.func},e.exports=I},8253:(e,t,o)=>{var a=o(8787);e.exports=a},2035:(e,t,o)=>{var a=["className","mode","direction","title","disabled","dataset","renderLabelContent","renderLabelText","onOpen","onClose","onSelect"],n=["children","className"];function i(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function r(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var S=o(7294),u=o(5697),d=o(4184),c=o(5985).default,I=o(6851),A=o(9418),O=o(8253),N=o(4024),R=o(7409),m=function(e){var t=e.className,o=e.mode,i=e.direction,E=e.title,T=e.disabled,u=e.dataset,m=e.renderLabelContent,p=e.renderLabelText,h=e.onOpen,L=e.onClose,f=e.onSelect,C=l(e,a),D=_(N(!1),4),g=D[0],v=D[2],y=D[3],P=S.useMemo((function(){return Array.isArray(C.options)?C.options.filter((function(e){return e&&"string"==typeof e.value})):[]}),[C.options]),B=S.useMemo((function(){return Array.isArray(C.selected)?C.selected.filter((function(e){return"string"==typeof e})):[]}),[C.selected]),b=S.useCallback((function(e){"function"==typeof C.onClick&&C.onClick(e),e.nativeEvent.toggleMenuPrevented||y()}),[C.onClick,y]),M=S.useCallback((function(e){e.nativeEvent.toggleMenuPrevented=!0}),[]),W=S.useCallback((function(e){e.nativeEvent.buttonClickPrevented=!0}),[]),U=S.useCallback((function(e){"function"==typeof f&&f({type:"select",value:e.currentTarget.dataset.value,reactEvent:e,nativeEvent:e.nativeEvent,dataset:u}),e.nativeEvent.closeMenuPrevented||v()}),[u,f]),G=S.useRef(!1);S.useLayoutEffect((function(){G.current&&(g?"function"==typeof h&&h({type:"open",dataset:u}):"function"==typeof L&&L({type:"close",dataset:u})),G.current=!0}),[g]);var F=S.useCallback((function(e){var t=e.children,o=e.className,a=l(e,n);return S.createElement(I,s({},a,{className:d(o,R["label-container"],{active:g}),title:E,disabled:T,onClick:b}),"function"==typeof m?m():S.createElement(S.Fragment,null,S.createElement("div",{className:R.label},"function"==typeof p?p():B.length>0?B.map((function(e){var t=P.find((function(t){return t.value===e}));return t&&"string"==typeof t.label?t.label:e})).join(", "):E),S.createElement(c,{className:R.icon,name:"caret-down"})),t)}),[g,E,T,P,B,b,m,p]),k=S.useCallback((function(){return S.createElement("div",{className:R["menu-container"],onKeyDown:W,onClick:M},P.length>0?P.map((function(e){var t=e.label,o=e.title,a=e.value;return S.createElement(I,{key:a,className:d(R["option-container"],{selected:B.includes(a)}),title:"string"==typeof o?o:"string"==typeof t?t:a,"data-value":a,onClick:U},S.createElement("div",{className:R.label},"string"==typeof t?t:a),S.createElement("div",{className:R.icon}))})):S.createElement("div",{className:R["no-options-container"]},S.createElement("div",{className:R.label},"No options available")))}),[P,B,W,M,U]),w=S.useMemo((function(){return function(e){return F(r(r(r({},e),C),{},{className:d(t,e.className)}))}}),[C,t,F]);return"modal"===o?F(r(r({},C),{},{className:t,children:g?S.createElement(O,{className:R["modal-container"],title:E,onCloseRequest:v,onKeyDown:W,onClick:M},k()):null})):S.createElement(A,{open:g,direction:i,onCloseRequest:v,renderLabel:w,renderMenu:k})};m.propTypes={className:u.string,mode:u.oneOf(["popup","modal"]),direction:u.any,title:u.string,options:u.arrayOf(u.shape({value:u.string.isRequired,title:u.string,label:u.string})),selected:u.arrayOf(u.string),disabled:u.bool,dataset:u.object,renderLabelContent:u.func,renderLabelText:u.func,onOpen:u.func,onClose:u.func,onSelect:u.func,onClick:u.func},e.exports=m},3981:(e,t,o)=>{var a=o(2035);e.exports=a},6934:(e,t,o)=>{var a=["className","route","query","title","backButton","searchBar","addonsButton","fullscreenButton","navMenu"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(5985).default,S=o(6851),u=o(9872),d=o(8489),c=o(5430),I=o(923),A=o(4887),O=o(6073).t,N=s.memo((function(e){var t=e.className,r=e.route,_=e.query,N=e.title,R=e.backButton,m=e.searchBar,p=e.addonsButton,h=e.fullscreenButton,L=e.navMenu,f=E(e,a),C=s.useCallback((function(){window.history.back()}),[]),D=i(d(),3),g=D[0],v=D[1],y=D[2],P=s.useCallback((function(e){var t=e.ref,o=e.className,a=e.onClick,n=e.children;return s.createElement(S,{ref:t,className:T(o,A["button-container"],A["menu-button-container"]),tabIndex:-1,onClick:a},s.createElement(l,{className:A.icon,name:"more-vertical"}),n)}),[]);return s.createElement("nav",n({},f,{className:T(t,A["horizontal-nav-bar-container"])}),R?s.createElement(S,{className:T(A["button-container"],A["back-button-container"]),tabIndex:-1,onClick:C},s.createElement(l,{className:A.icon,name:"chevron-back"})):s.createElement("div",{className:A["logo-container"]},s.createElement(u,{className:A.logo,src:o(5313),alt:" "})),"string"==typeof N&&N.length>0?s.createElement("h2",{className:A.title},N):null,m?s.createElement(c,{className:A["search-bar"],query:_,active:"search"===r}):null,s.createElement("div",{className:A["buttons-container"]},p?s.createElement(S,{className:A["button-container"],href:"#/addons",title:O("ADDONS"),tabIndex:-1},s.createElement(l,{className:A.icon,name:"addons"})):null,h?s.createElement(S,{className:A["button-container"],title:O(g?"EXIT_FULLSCREEN":"ENTER_FULLSCREEN"),tabIndex:-1,onClick:g?y:v},s.createElement(l,{className:A.icon,name:g?"minimize":"maximize"})):null,L?s.createElement(I,{renderLabel:P}):null))}));N.displayName="HorizontalNavBar",N.propTypes={className:_.string,route:_.string,query:_.string,title:_.string,backButton:_.bool,searchBar:_.bool,addonsButton:_.bool,fullscreenButton:_.bool,navMenu:_.bool},e.exports=N},1229:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t,o,a,n,i,r){try{var E=e[i](r),s=E.value}catch(e){return void o(e)}E.done?t(s):Promise.resolve(s).then(a,n)}function n(e){return function(){var t=this,o=arguments;return new Promise((function(n,i){var r=e.apply(t,o);function E(e){a(r,n,i,E,s,"next",e)}function s(e){a(r,n,i,E,s,"throw",e)}E(void 0)}))}}function i(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return r(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(1229);e.exports=a},3833:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(5985).default,s=o(1665).useRouteFocused,_=o(6851),T=o(6230),l=o(1657),S=o(6672).withCoreSuspender,u=o(7551),d=function(e){var t=e.className,o=e.query,n=e.active,S=r().t,d=s(),c=l().createTorrentFromMagnet,I=a.useRef(null),A=a.useCallback((function(){n||(window.location="#/search")}),[n]),O=a.useCallback((function(){try{c(I.current.value)}catch(e){}}),[]),N=a.useCallback((function(){if(null!==I.current){var e=new URLSearchParams([["search",I.current.value]]);window.location="#/search?".concat(e.toString())}}),[]);return a.useEffect((function(){d&&n&&I.current.focus()}),[d,n,o]),a.createElement("label",{className:i(t,u["search-bar-container"],{active:n}),onClick:A},n?a.createElement(T,{key:o,ref:I,className:u["search-input"],type:"text",placeholder:S("SEARCH_OR_PASTE_LINK"),defaultValue:o,tabIndex:-1,onChange:O,onSubmit:N}):a.createElement("div",{className:u["search-input"]},a.createElement("div",{className:u["placeholder-label"]},S("SEARCH_OR_PASTE_LINK"))),a.createElement(_,{className:u["submit-button-container"],tabIndex:-1,onClick:N},a.createElement(E,{className:u.icon,name:"search"})))};d.propTypes={className:n.string,query:n.string,active:n.bool};var c=function(e){var t=e.className,o=r().t;return a.createElement("label",{className:i(t,u["search-bar-container"])},a.createElement("div",{className:u["search-input"]},a.createElement("div",{className:u["placeholder-label"]},o("SEARCH_OR_PASTE_LINK"))),a.createElement(_,{className:u["submit-button-container"],tabIndex:-1},a.createElement(E,{className:u.icon,name:"search"})))};c.propTypes=d.propTypes,e.exports=S(d,c)},5430:(e,t,o)=>{var a=o(3833);e.exports=a},1871:(e,t,o)=>{var a=o(6934);e.exports=a},2878:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(6851),s=o(9872),_=o(9842),T=function(e){var t=e.className,o=e.logo,n=e.icon,T=e.label,l=e.href,S=e.selected,u=e.onClick,d=a.useCallback((function(){return"string"==typeof n&&n.length>0?a.createElement(r,{className:_.icon,name:n}):null}),[n]);return a.createElement(E,{className:i(t,_["nav-tab-button-container"],{selected:S}),title:T,tabIndex:-1,href:l,onClick:u},"string"==typeof o&&o.length>0?a.createElement(s,{className:_.logo,src:o,alt:" ",renderFallback:d}):"string"==typeof n&&n.length>0?a.createElement(r,{className:_.icon,name:S?n:"".concat(n,"-outline")}):null,"string"==typeof T&&T.length>0?a.createElement("div",{className:_.label},T):null)};T.propTypes={className:n.string,logo:n.string,icon:n.string,label:n.string,href:n.string,selected:n.bool,onClick:n.func},e.exports=T},3908:(e,t,o)=>{var a=o(2878);e.exports=a},6063:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(3908),s=o(7636),_=a.memo((function(e){var t=e.className,o=e.selected,n=e.tabs,_=r().t;return a.createElement("nav",{className:i(t,s["vertical-nav-bar-container"])},Array.isArray(n)?n.map((function(e,t){return a.createElement(E,{key:t,className:s["nav-tab-button"],selected:e.id===o,href:e.href,logo:e.logo,icon:e.icon,label:_(e.label),onClick:e.onClick})})):null)}));_.displayName="VerticalNavBar",_.propTypes={className:n.string,selected:n.string,tabs:n.arrayOf(n.shape({id:n.string,label:n.string,logo:n.string,icon:n.string,href:n.string,onClick:n.func}))},e.exports=_},9798:(e,t,o)=>{var a=o(6063);e.exports=a},1785:(e,t,o)=>{var a=o(1871),n=o(9798);e.exports={HorizontalNavBar:a,VerticalNavBar:n}},8417:(e,t,o)=>{var a=["className","label","dataset","onSelect"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(5985).default,T=o(6851),l=o(2168),S=function(e){var t=e.className,o=e.label,E=e.dataset,S=e.onSelect,u=i(e,a),d=r.useCallback((function(e){"function"==typeof S&&S({type:"change-page",value:e.currentTarget.dataset.value,dataset:E,reactEvent:e,nativeEvent:e.nativeEvent})}),[E,S]);return r.createElement("div",n({},u,{className:s(t,l["pagination-input-container"])}),r.createElement(T,{className:l["prev-button-container"],title:"Previous page","data-value":"prev",onClick:d},r.createElement(_,{className:l.icon,name:"chevron-back"})),r.createElement("div",{className:l["label-container"],title:o},r.createElement("div",{className:l.label},o)),r.createElement(T,{className:l["next-button-container"],title:"Next page","data-value":"next",onClick:d},r.createElement(_,{className:l.icon,name:"chevron-forward"})))};S.propTypes={className:E.string,label:E.string,dataset:E.object,onSelect:E.func},e.exports=S},2391:(e,t,o)=>{var a=o(8417);e.exports=a},7206:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(9192),r=function(e){var t=e.className;return a.createElement("svg",{className:t,viewBox:"0 0 100 100"},a.createElement("circle",{className:i.background,cx:"50",cy:"50",r:"50"}),a.createElement("svg",{className:i.icon,x:"0",y:"25",width:"100",height:"50",viewBox:"0 0 37.14 32"},a.createElement("path",{d:"M 9.14,0 37.14,16 9.14,32 Z"})))};r.propTypes={className:n.string},e.exports=r},926:(e,t,o)=>{var a=o(7206);e.exports=a},1804:(e,t,o)=>{var a=["open","direction","renderLabel","renderMenu","dataset","onCloseRequest"];function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var T=o(7294),l=o(5697),S=o(4184),u=o(6413).ZP,d=o(1665).useRouteFocused,c=o(194),I=function e(t){if(t===document.documentElement)return t;var o=window.getComputedStyle(t);return-1!==o.overflowY.indexOf("auto")||-1!==o.overflowY.indexOf("scroll")?t:e(t.parentElement)},A=function(e){var t=e.open,o=e.direction,n=e.renderLabel,s=e.renderMenu,l=e.dataset,A=e.onCloseRequest,O=_(e,a),N=d(),R=T.useRef(null),m=T.useRef(null),p=E(T.useState(null),2),h=p[0],L=p[1],f=T.useCallback((function(e){e.nativeEvent.closePopupPrevented=!0}),[]);return T.useEffect((function(){var e=function(e){if(!e.closePopupPrevented&&"function"==typeof A){var t={type:"close",nativeEvent:e,dataset:l};switch(e.type){case"keydown":"Escape"===e.code&&A(t);break;case"mousedown":case"pointerdown":e.target===document.documentElement||R.current.contains(e.target)||A(t)}}};return N&&t&&(window.addEventListener("keydown",e),window.addEventListener("mousedown",e),window.addEventListener("pointerdown",e)),function(){window.removeEventListener("keydown",e),window.removeEventListener("mousedown",e),window.removeEventListener("pointerdown",e)}}),[N,t,A,l]),T.useLayoutEffect((function(){if(t){var e=[],o=I(R.current).getBoundingClientRect(),a=R.current.getBoundingClientRect(),n=m.current.getBoundingClientRect(),i={left:a.left-o.left,top:a.top-o.top,right:o.width+o.left-(a.left+a.width),bottom:o.height+o.top-(a.top+a.height)};n.height<=i.bottom?e.push("bottom"):n.height<=i.top?e.push("top"):i.bottom>=i.top?e.push("bottom"):e.push("top"),n.width<=i.right+a.width?e.push("right"):n.width<=i.left+a.width?e.push("left"):i.right>i.left?e.push("right"):e.push("left"),L(e.join("-"))}else L(null)}),[t]),n(i(i({},O),{},{ref:R,className:S(c["label-container"],O.className,{active:t}),children:t?T.createElement(u,{ref:m,className:S(c["menu-container"],r({},c["menu-direction-".concat(h)],!o),r({},c["menu-direction-".concat(o)],o)),autoFocus:!1,lockProps:{onMouseDown:f}},s()):null}))};A.propTypes={open:l.bool,direction:l.oneOf(["top-left","bottom-left","top-right","bottom-right"]),renderLabel:l.func.isRequired,renderMenu:l.func.isRequired,dataset:l.object,onCloseRequest:l.func},e.exports=A},9418:(e,t,o)=>{var a=o(1804);e.exports=a},6182:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(6230),s=o(4830),_=o(330),T=function(e){var t=e.className,o=e.title,n=e.value,s=e.onChange;return a.createElement("label",{title:o,className:i(t,_["search-bar-container"])},a.createElement(E,{className:_["search-input"],type:"text",placeholder:o,value:n,onChange:s}),a.createElement(r,{className:_.icon,name:"search"}))};T.Placeholder=s,T.propTypes={className:n.string,title:n.string,value:n.string,onChange:n.func},e.exports=T},3994:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(3109),s=function(e){var t=e.className,o=e.title;return a.createElement("div",{className:i(t,E["search-bar-container"])},a.createElement("div",{className:E["search-input"]},o),a.createElement(r,{className:E.icon,name:"search"}))};s.propTypes={className:n.string,title:n.string},e.exports=s},4830:(e,t,o)=>{var a=o(3994);e.exports=a},6798:(e,t,o)=>{var a=o(6182);e.exports=a},5005:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(5985).default,s=o(1665).useRouteFocused,_=o(3662).useServices,T=o(6851),l=o(6230),S=o(4530),u=function(e){var t=e.className,o=e.url,n=r().t,u=_().core,d=a.useRef(null),c=s(),I=a.useCallback((function(){null!==d.current&&d.current.select()}),[]),A=a.useCallback((function(){null!==d.current&&(d.current.select(),document.execCommand("copy"))}),[]);return a.useEffect((function(){c&&null!==d.current&&d.current.select()}),[c]),a.useEffect((function(){u.transport.analytics({event:"Share",args:{url:o}})}),[o]),a.createElement("div",{className:i(t,S["share-prompt-container"])},a.createElement("div",{className:S["buttons-container"]},a.createElement(T,{className:i(S["button-container"],S["facebook-button"]),title:"Facebook",href:"https://www.facebook.com/sharer/sharer.php?u=".concat(o),target:"_blank"},a.createElement(E,{className:S.icon,name:"facebook"}),a.createElement("div",{className:S.label},"Facebook")),a.createElement(T,{className:i(S["button-container"],S["twitter-button"]),title:"Twitter",href:"https://twitter.com/home?status=".concat(o),target:"_blank"},a.createElement(E,{className:S.icon,name:"ic_twitter"}),a.createElement("div",{className:S.label},"Twitter"))),a.createElement("div",{className:S["url-container"]},a.createElement(l,{ref:d,className:S["url-text-input"],type:"text",readOnly:!0,defaultValue:o,onClick:I,tabIndex:-1}),a.createElement(T,{className:S["copy-button"],title:"Copy to clipboard",onClick:A},a.createElement(E,{className:S.icon,name:"link"}),a.createElement("div",{className:S.label},n("COPY")))))};u.propTypes={className:n.string,url:n.string},e.exports=u},9393:(e,t,o)=>{var a=o(5005);e.exports=a},4068:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(4068);e.exports=a},9009:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;tDate.now()?null:r.createElement("div",{className:_(t,d["warning-container"])},r.createElement("div",{className:d["warning-statement"]},o("SETTINGS_SERVER_UNAVAILABLE")),r.createElement("a",{href:"https://www.stremio.com/download-service",target:"_blank",rel:"noreferrer"},r.createElement(l,{className:d["warning-button"],title:o("SERVICE_INSTALL"),tabIndex:-1},r.createElement("div",{className:d["warning-label"]},o("SERVICE_INSTALL")))),r.createElement(l,{className:d["warning-button"],title:o("WARNING_STREAMING_SERVER_LATER"),onClick:s,tabIndex:-1},r.createElement("div",{className:d["warning-label"]},o("WARNING_STREAMING_SERVER_LATER"))),r.createElement(l,{className:d["warning-button"],title:o("DONT_SHOW_AGAIN"),onClick:u,tabIndex:-1},r.createElement("div",{className:d["warning-label"]},o("DONT_SHOW_AGAIN"))))};c.propTypes={className:s.string},e.exports=u(c)},861:(e,t,o)=>{var a=o(9009);e.exports=a},1007:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(1007);e.exports=a},6049:(e,t,o)=>{var a=o(7294).createContext({show:function(){},clear:function(){}});a.displayName="ToastContext",e.exports=a},3345:(e,t,o)=>{var a=["title","message","dataset","onSelect","onClose"];function n(e,t){if(null==e)return{};var o,a,n=(function(e,t){if(null==e)return{};var o,a,n={},i=Object.keys(e);for(a=0;a=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var i=o(7294),r=o(5697),E=o(4184),s=o(5985).default,_=o(6851),T=o(9775),l=function(e){var t=e.title,o=e.message,r=e.dataset,l=e.onSelect,S=e.onClose,u=n(e,a),d=i.useMemo((function(){return["success","alert","error"].includes(u.type)?u.type:"success"}),[u.type]),c=i.useMemo((function(){return"string"==typeof u.icon?u.icon:"success"===d?"checkmark":"error"===d?"warning":null}),[d,u.icon]),I=i.useCallback((function(e){e.nativeEvent.selectToastPrevented||"function"!=typeof l||l({type:"select",dataset:r,reactEvent:e,nativeEvent:e.nativeEvent}),e.nativeEvent.closeToastPrevented||"function"!=typeof S||S({type:"close",dataset:r,reactEvent:e,nativeEvent:e.nativeEvent})}),[r,l,S]),A=i.useCallback((function(e){e.nativeEvent.selectToastPrevented=!0,"function"==typeof S&&S({type:"close",dataset:r,reactEvent:e,nativeEvent:e.nativeEvent})}),[r,S]);return i.createElement(_,{className:E(T["toast-item-container"],T[d]),tabIndex:-1,onClick:I},"string"==typeof c&&c.length>0?i.createElement("div",{className:T["icon-container"]},i.createElement(s,{className:T.icon,name:c})):null,i.createElement("div",{className:T["info-container"]},"string"==typeof t&&t.length>0?i.createElement("div",{className:T["title-container"]},t):null,"string"==typeof o&&o.length>0?i.createElement("div",{className:T["message-container"]},o):null),i.createElement(_,{className:T["close-button-container"],title:"Close",tabIndex:-1,onClick:A},i.createElement(s,{className:T.icon,name:"close"})))};l.propTypes={type:r.oneOf(["success","alert","error"]),title:r.string,message:r.string,icon:r.string,dataset:r.object,onSelect:r.func,onClose:r.func},e.exports=l},5008:(e,t,o)=>{var a=o(3345);e.exports=a},9076:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o-1&&e.splice(o,1)},show:function(t){if(!e.some((function(e){return e(t)}))){var o="number"!=typeof t.timeout||isNaN(t.timeout)?3e3:t.timeout,a=setTimeout((function(){c({type:"remove",id:a})}),o);c({type:"add",item:i(i({},t),{},{id:a,dataset:i(i({},t.dataset),{},{id:a}),onClose:I})})}},clear:function(){c({type:"clear"})}}}),[]);return _.createElement(S.Provider,{value:A},r instanceof HTMLElement?o:null,_.createElement("div",{ref:s,className:t},d.map((function(e,t){return _.createElement(l,a({key:t},e))}))))};u.propTypes={className:T.string,children:T.node},e.exports=u},18:(e,t,o)=>{var a=o(9076),n=o(7263);e.exports={ToastProvider:a,useToast:n}},7263:(e,t,o)=>{var a=o(7294),n=o(6049);e.exports=function(){return a.useContext(n)}},9309:e=>{e.exports=function(e){return function(t,o){return isNaN(e[t])&&isNaN(e[o])?t.localeCompare(o):isNaN(e[t])?e[o]===Number.NEGATIVE_INFINITY?-1:1:isNaN(e[o])?e[t]===Number.NEGATIVE_INFINITY?1:-1:e[o]-e[t]}}},3418:(e,t,o)=>{var a=o(335),n=[{label:"EXTERNAL_PLAYER_DISABLED",value:"internal"}];n="ios"===a.name?n.concat([{label:"VLC",value:"vlc"},{label:"Outplayer",value:"outplayer"}]):"android"===a.name?n.concat([{label:"EXTERNAL_PLAYER_ALLOW_CHOOSING",value:"choose"},{label:"VLC",value:"vlc"},{label:"Just Player",value:"justplayer"},{label:"MX Player",value:"mxplayer"}]):["windows","macos","linux"].includes(a.name)?n.concat([{label:"VLC",value:"vlc"}]):n.concat([{label:"M3U Playlist",value:"m3u"}]),e.exports=n},9324:e=>{e.exports=function(e){return Array.from(e.children).reduce((function(t,o,a){return(function(e,t){var o=t.offsetTop,a=t.offsetTop+t.clientHeight,n=e.scrollTop,i=e.scrollTop+e.clientHeight;return o>=n&&a<=i||o{var a=o(8512),n=o(6851),i=o(9666),r=o(8809),E=o(8006),s=o(9872),_=o(5748),T=o(1297),l=o(8277),S=o(3070),u=o(9321),d=o(8253),c=o(3981),I=o(1785),A=I.HorizontalNavBar,O=I.VerticalNavBar,N=o(2391),R=o(926),m=o(9418),p=o(6798),h=o(861),L=o(9393),f=o(6e3),C=o(6230),D=o(18),g=D.ToastProvider,v=D.useToast,y=o(9309),P=o(2734),B=o(6672),b=B.withCoreSuspender,M=B.useCoreSuspender,W=o(9324),U=o(5232),G=o(8832),F=o(8803),k=o(6649),w=o(4),V=o(4024),H=o(8489),Y=o(1549),z=o(1535),x=o(7049),K=o(3760),j=o(552),Q=o(432),X=o(1657),$=o(335),q=o(3418);e.exports={AddonDetailsModal:a,Button:n,Checkbox:i,ColorInput:r,DelayedRenderer:E,Image:s,LibItem:_,MainNavBars:T,MetaItem:l,MetaPreview:S,MetaRow:u,ModalDialog:d,Multiselect:c,HorizontalNavBar:A,VerticalNavBar:O,PaginationInput:N,PlayIconCircleCentered:R,Popup:m,SearchBar:p,StreamingServerWarning:h,SharePrompt:L,Slider:f,TextInput:C,ToastProvider:g,useToast:v,comparatorWithPriorities:y,CONSTANTS:P,withCoreSuspender:b,useCoreSuspender:M,getVisibleChildrenRange:W,interfaceLanguages:U,languageNames:G,routesRegexp:F,translateOption:k,useAnimationFrame:w,useBinaryState:V,useFullscreen:H,useLiveRef:Y,useModelState:z,useNotifications:x,useOnScrollToBottom:K,useProfile:j,useStreamingServer:Q,useTorrent:X,platform:$,externalPlayerOptions:q}},335:(e,t,o)=>{var a,n;var i=o(1206).parse((null===(a=window.navigator)||void 0===a?void 0:a.userAgent)||""),r=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document?"ios":((null==i||null===(n=i.os)||void 0===n?void 0:n.name)||"unknown").toLowerCase();e.exports={name:r,isMobile:function(){return"ios"===r||"android"===r}}},8803:e=>{e.exports={intro:{regexp:/^\/intro$/,urlParamsNames:[]},board:{regexp:/^\/?$/,urlParamsNames:[]},discover:{regexp:/^\/discover(?:\/([^/]*)\/([^/]*)\/([^/]*))?$/,urlParamsNames:["transportUrl","type","catalogId"]},library:{regexp:/^\/library(?:\/([^/]*))?$/,urlParamsNames:["type"]},continuewatching:{regexp:/^\/continuewatching(?:\/([^/]*))?$/,urlParamsNames:["type"]},search:{regexp:/^\/search$/,urlParamsNames:[]},metadetails:{regexp:/^\/(?:metadetails|detail)\/([^/]*)\/([^/]*)(?:\/([^/]*))?$/,urlParamsNames:["type","id","videoId"]},addons:{regexp:/^\/addons(?:\/([^/]*)(?:\/([^/]*)\/([^/]*))?)?$/,urlParamsNames:["type","transportUrl","catalogId"]},settings:{regexp:/^\/settings$/,urlParamsNames:[]},player:{regexp:/^\/player\/([^/]*)(?:\/([^/]*)\/([^/]*)\/([^/]*)\/([^/]*)\/([^/]*))?$/,urlParamsNames:["stream","streamTransportUrl","metaTransportUrl","type","id","videoId"]}}},6649:(e,t,o)=>{var a=o(6073).t;e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o="".concat(t).concat(e),n=a(o,{defaultValue:a(o.toUpperCase(),{defaultValue:null})});return null!=n?n:e.charAt(0).toUpperCase()+e.slice(1)}},4:(e,t,o)=>{var a=o(7294);e.exports=function(){var e=a.useRef(null),t=a.useCallback((function(){cancelAnimationFrame(e.current),e.current=null}),[]);return[a.useCallback((function(o){t(),e.current=requestAnimationFrame((function(){o(),e.current=null}))}),[]),t]}},4024:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(7294);e.exports=function(e){var t=a.useRef();return t.current=e,t}},1535:(e,t,o)=>{var a=["action"];function n(e,t,o,a,n,i,r){try{var E=e[i](r),s=E.value}catch(e){return void o(e)}E.done?t(s):Promise.resolve(s).then(a,n)}function i(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return r(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(3096),T=o(2307),l=o(394),S=o(6672).useCoreSuspender,u=o(1665).useRouteFocused,d=o(3662).useServices;e.exports=function(e){var t=e.action,o=E(e,a),r=d().core,c=u(),I=s.useRef(!1),A=i(s.useMemo((function(){return[o.model,o.timeout,o.map,o.deps]}),[]),4),O=A[0],N=A[1],R=A[2],m=A[3],p=S().getState,h=i(s.useReducer((function(e,t){return Object.keys(e).reduce((function(o,a){return o[a]=T(e[a],t[a])?e[a]:t[a],o}),{})}),void 0,(function(){return"function"==typeof R?R(p(O)):p(O)})),2),L=h[0],f=h[1];return s.useInsertionEffect((function(){t&&r.transport.dispatch(t,O)}),[t]),s.useInsertionEffect((function(){return function(){r.transport.dispatch({action:"Unload"},O)}}),[]),s.useInsertionEffect((function(){var e=(function(){var e,t=(e=regeneratorRuntime.mark((function e(t){var o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(-1!==t.indexOf(O)||Array.isArray(m)&&0!==l(m,t).length){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,r.transport.getState(O);case 4:o=e.sent,f("function"==typeof R?R(o):o);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,o=arguments;return new Promise((function(a,i){var r=e.apply(t,o);function E(e){n(r,a,i,E,s,"next",e)}function s(e){n(r,a,i,E,s,"throw",e)}E(void 0)}))});return function(e){return t.apply(this,arguments)}})(),t=_(e,N);return c&&(r.transport.on("NewState",t),I.current&&e([O])),function(){t.cancel(),r.transport.off("NewState",t)}}),[c]),s.useInsertionEffect((function(){I.current=!0}),[]),L}},7049:(e,t,o)=>{var a=o(1535),n=function(e){return e.notifications};e.exports=function(){return a({model:"ctx",map:n})}},3760:(e,t,o)=>{var a=o(7294);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=a.useRef(!1),n=a.useCallback((function(a){a.target.scrollTop+a.target.clientHeight>=a.target.scrollHeight-t?o.current||(o.current=!0,"function"==typeof e&&e(a)):o.current=!1}),[e]);return n}},552:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{var a=o(1535);e.exports=function(){return a({model:"streaming_server"})}},1657:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=["className","autoFocus","disabled","children"];function n(e,t){if(null==e)return{};var o,a,n=(function(e,t){if(null==e)return{};var o,a,n={},i=Object.keys(e);for(a=0;a=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var i=o(7294),r=o(3935),E=o(5697),s=o(4184),_=o(6413).ZP,T=o(8795).useModalsContainer,l=i.forwardRef((function(e,t){var o=e.className,E=e.autoFocus,l=e.disabled,S=e.children,u=n(e,a),d=T();return r.createPortal(i.createElement(_,{ref:t,className:s(o,"modal-container"),autoFocus:!!E,disabled:!!l,lockProps:u},S),d)}));l.displayName="Modal",l.propTypes={className:E.string,autoFocus:E.bool,disabled:E.bool,children:E.node},e.exports=l},5717:(e,t,o)=>{var a=o(9900);e.exports=a},7033:(e,t,o)=>{var a=o(7294).createContext(null);a.displayName="ModalsContainerContext",e.exports=a},115:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(115),n=o(4163);e.exports={ModalsContainerProvider:a,useModalsContainer:n}},4163:(e,t,o)=>{var a=o(7294),n=o(7033);e.exports=function(){return a.useContext(n)}},9314:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(8795).ModalsContainerProvider,r=function(e){var t=e.children;return a.createElement("div",{className:"route-container"},a.createElement(i,null,a.createElement("div",{className:"route-content"},t)))};r.propTypes={children:n.node},e.exports=r},4777:(e,t,o)=>{var a=o(9314);e.exports=a},9010:(e,t,o)=>{var a=o(7294).createContext(!0);a.displayName="RouteFocusedContext",e.exports=a},6267:(e,t,o)=>{var a=o(9010),n=o(1517);e.exports={RouteFocusedProvider:a.Provider,useRouteFocused:n}},1517:(e,t,o)=>{var a=o(7294),n=o(9010);e.exports=function(){return a.useContext(n)}},8968:(e,t,o)=>{var a=["className","onPathNotMatch","onRouteChange"];function n(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return i(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var E=o(7294),s=o(9864),_=o(5697),T=o(4184),l=o(8575),S=o(2307),u=o(6267).RouteFocusedProvider,d=o(4777),c=o(3295),I=o(598),A=function(e){var t=e.className,o=e.onPathNotMatch,i=e.onRouteChange,_=r(e,a),A=E.useMemo((function(){return _.viewsConfig}),[]),O=n(E.useState((function(){return Array(A.length).fill(null)})),2),N=O[0],R=O[1];return E.useLayoutEffect((function(){var e=function(){var e=l.parse(window.location.hash.slice(1)),t=e.pathname,a=e.query,n=new URLSearchParams("string"==typeof a?a:""),r=c(A,"string"==typeof t?t:"");if(null!==r){var E=I(r,"string"==typeof t?t:""),_=A.findIndex((function(e){return e.includes(r)})),T=A[_].findIndex((function(e){return e===r}));"function"==typeof i&&i(r,E,n)||R((function(e){return e.slice(0,A.length).map((function(e,t){return t<_?e:t===_?{key:"".concat(_).concat(T),component:r.component,urlParams:null!==e&&S(e.urlParams,E)?e.urlParams:E,queryParams:null!==e&&S(Array.from(e.queryParams.entries()),Array.from(n.entries()))?e.queryParams:n}:null}))}))}else if("function"==typeof o){var u=o();s.isValidElementType(u)&&R((function(e){return e.slice(0,A.length).concat({key:"-1",component:u})}))}};return window.addEventListener("hashchange",e),e(),function(){window.removeEventListener("hashchange",e)}}),[o,i]),E.createElement("div",{className:T(t,"routes-container")},N.filter((function(e){return null!==e})).map((function(e,t,o){var a=e.key,n=e.component,i=e.urlParams,r=e.queryParams;return E.createElement(u,{key:a,value:t===o.length-1},E.createElement(d,null,E.createElement(n,{urlParams:i,queryParams:r})))})))};A.propTypes={className:_.string,onPathNotMatch:_.func,onRouteChange:_.func,viewsConfig:_.arrayOf(_.arrayOf(_.exact({regexp:_.instanceOf(RegExp).isRequired,urlParamsNames:_.arrayOf(_.string).isRequired,component:_.elementType.isRequired}))).isRequired},e.exports=A},6013:(e,t,o)=>{var a=o(8968);e.exports=a},3295:e=>{function t(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!a){if(Array.isArray(e)||(a=(function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return o(e,t)})(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,E=!0,s=!1;return{s:function(){a=a.call(e)},n:function(){var e=a.next();return E=e.done,e},e:function(e){s=!0,r=e},f:function(){try{E||null==a.return||a.return()}finally{if(s)throw r}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{e.exports=function(e,t){var o=t.match(e.regexp);return e.urlParamsNames.reduce((function(e,t,a){return Array.isArray(o)&&"string"==typeof o[a+1]?e[t]=decodeURIComponent(o[a+1]):e[t]=null,e}),{path:t})}},1665:(e,t,o)=>{var a=o(6267).useRouteFocused,n=o(8795).useModalsContainer,i=o(5717),r=o(6013);e.exports={useRouteFocused:a,useModalsContainer:n,Modal:i,Router:r}},2788:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(5985).default,s=o(6590),_=s.Button,T=s.Image,l=o(2638),S=function(e){var t=e.className,o=e.id,n=e.name,s=e.version,S=e.logo,u=e.description,d=e.types,c=e.behaviorHints,I=e.installed,A=e.onToggle,O=e.onConfigure,N=e.onShare,R=e.dataset,m=r().t,p=a.useCallback((function(e){"function"==typeof A&&A({type:"toggle",nativeEvent:e.nativeEvent,reactEvent:e,dataset:R})}),[A,R]),h=a.useCallback((function(e){"function"==typeof O&&O({type:"configure",nativeEvent:e.nativeEvent,reactEvent:e,dataset:R})}),[O,R]),L=a.useCallback((function(e){"function"==typeof N&&N({type:"share",nativeEvent:e.nativeEvent,reactEvent:e,dataset:R})}),[N,R]),f=a.useCallback((function(e){"Enter"===e.key&&"function"==typeof A&&A({type:"toggle",nativeEvent:e.nativeEvent,reactEvent:e,dataset:R})}),[A,R]),C=a.useCallback((function(){return a.createElement(E,{className:l.icon,name:"addons"})}),[]);return a.createElement(_,{className:i(t,l["addon-container"]),onKeyDown:f},a.createElement("div",{className:l["logo-container"]},a.createElement(T,{className:l.logo,src:S,alt:" ",renderFallback:C})),a.createElement("div",{className:l["info-container"]},a.createElement("div",{className:l["name-container"],title:"string"==typeof n&&n.length>0?n:o},"string"==typeof n&&n.length>0?n:o),"string"==typeof s&&s.length>0?a.createElement("div",{className:l["version-container"],title:"v.".concat(s)},"v.",s):null,Array.isArray(d)&&d.length>0?a.createElement("div",{className:l["types-container"]},1===d.length?d.join(""):d.slice(0,-1).join(", ")+" & "+d[d.length-1]):null,"string"==typeof u&&u.length>0?a.createElement("div",{className:l["description-container"],title:u},u):null),a.createElement("div",{className:l["buttons-container"]},a.createElement("div",{className:l["action-buttons-container"]},!c.configurationRequired&&c.configurable?a.createElement(_,{className:l["configure-button-container"],title:m("ADDON_CONFIGURE"),tabIndex:-1,onClick:h},a.createElement(E,{className:l.icon,name:"settings"})):null,a.createElement(_,{className:I?l["uninstall-button-container"]:l["install-button-container"],title:I?m("ADDON_UNINSTALL"):c.configurationRequired?m("ADDON_CONFIGURE"):m("ADDON_INSTALL"),tabIndex:-1,onClick:!I&&c.configurationRequired?h:p},a.createElement("div",{className:l.label},I?m("ADDON_UNINSTALL"):c.configurationRequired?m("ADDON_CONFIGURE"):m("ADDON_INSTALL")))),a.createElement(_,{className:l["share-button-container"],title:m("SHARE_ADDON"),tabIndex:-1,onClick:L},a.createElement(E,{className:l.icon,name:"share"}),a.createElement("div",{className:l.label},m("SHARE_ADDON")))))};S.propTypes={className:n.string,id:n.string,name:n.string,version:n.string,logo:n.string,description:n.string,types:n.arrayOf(n.string),behaviorHints:n.shape({adult:n.bool,configurable:n.bool,configurationRequired:n.bool,p2p:n.bool}),installed:n.bool,onToggle:n.func,onConfigure:n.func,onShare:n.func,dataset:n.object},e.exports=S},4845:(e,t,o)=>{var a=o(2788);e.exports=a},2994:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?Q.manifest.name:Q.manifest.id),"string"==typeof Q.manifest.version&&Q.manifest.version.length>0?r.createElement("span",{className:g.version},"v. ",Q.manifest.version):null)),r.createElement(N,{className:g["share-prompt-container"],url:Q.transportUrl})):null,"string"==typeof v?r.createElement(S,{transportUrl:v,onCloseRequest:ee}):null)};v.propTypes={urlParams:E.shape({path:E.string,transportUrl:E.string,catalogId:E.string,type:E.string}),queryParams:E.instanceOf(URLSearchParams)};e.exports=p(v,(function(){return r.createElement(I,{className:g["addons-container"],route:"addons"})}))},7165:(e,t,o)=>{var a=o(2994);e.exports=a},290:(e,t,o)=>{var a=o(7294);e.exports=function(e,t){var o=a.useMemo((function(){return t.get("addon")}),[t]),n=a.useCallback((function(o){var a=new URLSearchParams(t);"string"==typeof o?a.set("addon",o):a.delete("addon"),window.location.replace("#".concat(e.path,"?").concat(a))}),[e,t]);return[o,n]}},8061:(e,t,o)=>{var a=o(7294),n=o(6590).useModelState;e.exports=function(e){var t=a.useMemo((function(){return"string"!=typeof e.transportUrl&&"string"!=typeof e.catalogId?{action:"Load",args:{model:"InstalledAddonsWithFilters",args:{request:{type:"string"==typeof e.type?e.type:null}}}}:{action:"Unload"}}),[e]);return n({model:"installed_addons",action:t})}},8916:(e,t,o)=>{var a=o(7294),n=o(6590).useModelState;e.exports=function(e){var t=a.useMemo((function(){return"string"==typeof e.type&&"string"==typeof e.transportUrl&&"string"==typeof e.catalogId?{action:"Load",args:{model:"CatalogWithFilters",args:{request:{base:e.transportUrl,path:{resource:"addon_catalog",type:e.type,id:e.catalogId,extra:[]}}}}}:{action:"Unload"}}),[e]);return n({model:"remote_addons",action:t,deps:["ctx"]})}},146:(e,t,o)=>{var a=o(7294),n=o(6073).t,i=o(6590).translateOption;e.exports=function(e,t){var o=a.useMemo((function(){return(function(e,t){var o={title:n("SELECT_CATALOG"),options:t.selectable.catalogs.concat(e.selectable.catalogs).map((function(e){var t=e.name;return{value:e.deepLinks.addons,label:i(t,"ADDON_"),title:i(t,"ADDON_")}})),selected:t.selectable.catalogs.concat(e.selectable.catalogs).filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})),renderLabelText:null!==t.selected?function(){var e=t.selectable.catalogs.find((function(e){return e.id===t.selected.request.path.id}));return e?i(e.name,"ADDON_"):t.selected.request.path.id}:null,onSelect:function(e){window.location=e.value}},a={title:n("SELECT_TYPE"),options:null!==e.selected?e.selectable.types.map((function(e){var t=e.type;return{value:e.deepLinks.addons,label:null!==t?i(t,"TYPE_"):n("TYPE_ALL")}})):t.selectable.types.map((function(e){var t=e.type;return{value:e.deepLinks.addons,label:i(t,"TYPE_")}})),selected:null!==e.selected?e.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})):t.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.addons})),renderLabelText:function(){return null!==e.selected?null===e.selected.request.type?n("TYPE_ALL"):i(e.selected.request.type,"TYPE_"):null!==t.selected?i(t.selected.request.path.type,"TYPE_"):a.title},onSelect:function(e){window.location=e.value}};return[o,a]})(e,t)}),[e,t]);return o}},1180:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?1:0,p=i.useRef(),h=i.useCallback((function(){var e=A(p.current);if(null!==e){var t=Math.max(0,e.start-m-5),o=e.end-m+5;o0?i.createElement(l,{className:r(R["board-row"],R["continue-watching-row"],"animation-fade-in"),title:e("BOARD_CONTINUE_WATCHING"),items:o.items,itemComponent:S,deepLinks:o.deepLinks}):null,_.catalogs.map((function(e,t){var o;switch(null===(o=e.content)||void 0===o?void 0:o.type){case"Ready":return i.createElement(l,{key:t,className:r(R["board-row"],R["board-row-".concat(e.content.content[0].posterShape)],"animation-fade-in"),title:e.title,items:e.content.content,itemComponent:u,deepLinks:e.deepLinks});case"Err":return i.createElement(l,{key:t,className:r(R["board-row"],"animation-fade-in"),title:e.title,message:e.content.content,deepLinks:e.deepLinks});default:return i.createElement(l.Placeholder,{key:t,className:r(R["board-row"],R["board-row-poster"],"animation-fade-in"),title:e.title,deepLinks:e.deepLinks})}})))),null!==t.settings&&"Err"===t.settings.type?i.createElement(d,{className:R["board-warning-container"]}):null)}),(function(){return i.createElement("div",{className:R["board-container"]},i.createElement(T,{className:R["board-content-container"],route:"board"}))}))},8823:(e,t,o)=>{var a=o(1180);e.exports=a},6981:(e,t,o)=>{var a=o(7294),n=o(3662).useServices,i=o(6590).useModelState;e.exports=function(){var e=n().core,t=a.useMemo((function(){return{action:"Load",args:{model:"CatalogsWithExtra",args:{extra:[]}}}}),[]),o=a.useCallback((function(t){e.transport.dispatch({action:"CatalogsWithExtra",args:{action:"LoadRange",args:t}},"board")}),[]);return[i({model:"board",timeout:1500,action:t}),o]}},2916:(e,t,o)=>{var a=o(6590).useModelState;e.exports=function(){return a({model:"continue_watching_preview"})}},9694:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(9694);e.exports=a},83:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t0?{action:"Load",args:{model:"CatalogWithFilters",args:{request:{base:e.transportUrl,path:{resource:"catalog",type:e.type,id:e.catalogId,extra:Array.from(t.entries())}}}}}:{action:"Unload"}}),[e,t]);return[_({model:"discover",action:n,map:T,deps:["ctx"]}),a]}},8674:(e,t,o)=>{function a(e){return(function(e){if(Array.isArray(e))return n(e)})(e)||(function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})(e)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e)||(function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=["className","label","link","href","onToggle"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(6590),T=_.Button,l=_.Checkbox,S=o(6947),u=r.forwardRef((function(e,t){var o=e.className,E=e.label,_=e.link,u=e.href,d=e.onToggle,c=i(e,a),I=r.useCallback((function(e){"function"==typeof c.onClick&&c.onClick(e),e.nativeEvent.togglePrevented||"function"!=typeof d||d({type:"toggle",reactEvent:e,nativeEvent:e.nativeEvent})}),[d,c.onClick]),A=r.useCallback((function(e){e.nativeEvent.togglePrevented=!0}),[]);return r.createElement(l,n({},c,{ref:t,className:s(o,S["consent-checkbox-container"]),onClick:I}),r.createElement("div",{className:S.label},E," ","string"==typeof _&&_.length>0&&"string"==typeof u&&u.length>0?r.createElement(T,{className:S.link,href:u,target:"_blank",tabIndex:-1,onClick:A},_):null))}));u.displayName="ConsentCheckbox",u.propTypes={className:E.string,checked:E.bool,label:E.string,link:E.string,href:E.string,onToggle:E.func,onClick:E.func},e.exports=u},6050:(e,t,o)=>{var a=o(8465);e.exports=a},2130:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;t{var a=o(2130);e.exports=a},5398:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&void 0!==arguments[0]?arguments[0]:{},t=e.user;if(!t||"string"!=typeof t.email||"string"!=typeof t.fbLoginToken)throw new Error("Login failed at getting token from Stremio");return{email:t.email,password:t.fbLoginToken}}))})).then((function(e){var t=e.email,o=e.password;a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Login",email:t,password:o,facebook:!0}}})})).catch((function(e){k(),Y({type:"error",error:e.message})}))}),[]),x=s.useCallback((function(){"string"==typeof H.email&&0!==H.email.length&&S.current.validity.valid?"string"==typeof H.password&&0!==H.password.length?(F(),a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Login",email:H.email,password:H.password}}})):Y({type:"error",error:"Invalid password"}):Y({type:"error",error:"Invalid email"})}),[H.email,H.password]),K=s.useCallback((function(){H.termsAccepted?window.location="#/":Y({type:"error",error:"You must accept the Terms of Service"})}),[H.termsAccepted]),j=s.useCallback((function(){"string"==typeof H.email&&0!==H.email.length&&S.current.validity.valid?"string"==typeof H.password&&0!==H.password.length?H.password===H.confirmPassword?H.termsAccepted?H.privacyPolicyAccepted?(F(),a.transport.dispatch({action:"Ctx",args:{action:"Authenticate",args:{type:"Register",email:H.email,password:H.password,gdpr_consent:{tos:H.termsAccepted,privacy:H.privacyPolicyAccepted,marketing:H.marketingAccepted,from:"web"}}}})):Y({type:"error",error:"You must accept the Privacy Policy"}):Y({type:"error",error:"You must accept the Terms of Service"}):Y({type:"error",error:"Passwords do not match"}):Y({type:"error",error:"Invalid password"}):Y({type:"error",error:"Invalid email"})}),[H.email,H.password,H.confirmPassword,H.termsAccepted,H.privacyPolicyAccepted,H.marketingAccepted]),Q=s.useCallback((function(e){Y({type:"change-credentials",name:"email",value:e.currentTarget.value})}),[]),X=s.useCallback((function(){I.current.focus()}),[]),$=s.useCallback((function(e){Y({type:"change-credentials",name:"password",value:e.currentTarget.value})}),[]),q=s.useCallback((function(){H.form===f?D.current.focus():x()}),[H.form,x]),J=s.useCallback((function(e){Y({type:"change-credentials",name:"confirmPassword",value:e.currentTarget.value})}),[]),Z=s.useCallback((function(){g.current.focus()}),[]),ee=s.useCallback((function(){Y({type:"toggle-checkbox",name:"termsAccepted"})}),[]),te=s.useCallback((function(){Y({type:"toggle-checkbox",name:"privacyPolicyAccepted"})}),[]),oe=s.useCallback((function(){Y({type:"toggle-checkbox",name:"marketingAccepted"})}),[]),ae=s.useCallback((function(){var e=new URLSearchParams([["form",H.form===f?C:f]]);window.location="#/intro?".concat(e.toString())}),[H.form]);return s.useEffect((function(){[C,f].includes(t.get("form"))&&Y({type:"set-form",form:t.get("form")})}),[t]),s.useEffect((function(){E&&"string"==typeof H.error&&H.error.length>0&&P.current.scrollIntoView()}),[H.error]),s.useEffect((function(){E&&S.current.focus()}),[H.form,E]),s.useEffect((function(){var e=function(e){var t=e.event,o=e.args;switch(t){case"UserAuthenticated":k(),E&&(window.location="#/");break;case"Error":"UserAuthenticated"===o.source.event&&k()}};return a.transport.on("CoreEvent",e),function(){a.transport.off("CoreEvent",e)}}),[E]),s.createElement("div",{className:L["intro-container"]},s.createElement("div",{className:L["background-container"]}),s.createElement("div",{className:L["heading-container"]},s.createElement("div",{className:L["logo-container"]},s.createElement(O,{className:L.logo,src:o(5631),alt:" "})),s.createElement("div",{className:L["title-container"]},"Freedom to Stream"),s.createElement("div",{className:L["slogan-container"]},"All the Video Content You Enjoy in One Place")),s.createElement("div",{className:L["content-container"]},s.createElement("div",{className:L["form-container"]},s.createElement(R,{ref:S,className:L["credentials-text-input"],type:"email",placeholder:"Email",value:H.email,onChange:Q,onSubmit:X}),s.createElement(R,{ref:I,className:L["credentials-text-input"],type:"password",placeholder:"Password",value:H.password,onChange:$,onSubmit:q}),H.form===f?s.createElement(s.Fragment,null,s.createElement(R,{ref:D,className:L["credentials-text-input"],type:"password",placeholder:"Confirm Password",value:H.confirmPassword,onChange:J,onSubmit:Z}),s.createElement(m,{ref:g,className:L["consent-checkbox"],label:"I have read and agree with the Stremio",link:"Terms and conditions",href:"https://www.stremio.com/tos",checked:H.termsAccepted,onToggle:ee}),s.createElement(m,{ref:v,className:L["consent-checkbox"],label:"I have read and agree with the Stremio",link:"Privacy Policy",href:"https://www.stremio.com/privacy",checked:H.privacyPolicyAccepted,onToggle:te}),s.createElement(m,{ref:y,className:L["consent-checkbox"],label:"I agree to receive marketing communications from Stremio",checked:H.marketingAccepted,onToggle:oe})):s.createElement("div",{className:L["forgot-password-link-container"]},s.createElement(A,{className:L["forgot-password-link"],onClick:M},"Forgot password?")),H.error.length>0?s.createElement("div",{ref:P,className:L["error-message"]},H.error):null,s.createElement(A,{className:T(L["form-button"],L["submit-button"]),onClick:H.form===f?j:x},s.createElement("div",{className:L.label},H.form===f?"Sign up":"Log in"))),s.createElement("div",{className:L["options-container"]},s.createElement(A,{className:T(L["form-button"],L["facebook-button"]),onClick:z},s.createElement(l,{className:L.icon,name:"facebook"}),s.createElement("div",{className:L.label},"Continue with Facebook")),H.form===f?s.createElement(A,{className:T(L["form-button"],L["login-form-button"]),onClick:ae},s.createElement("div",{className:L.label},"LOG IN")):null,H.form===C?s.createElement(A,{className:T(L["form-button"],L["signup-form-button"]),onClick:ae},s.createElement("div",{className:L.label},"SIGN UP WITH EMAIL")):null,H.form===f?s.createElement(A,{className:T(L["form-button"],L["guest-login-button"]),onClick:K},s.createElement("div",{className:L.label},"GUEST LOGIN")):null)),b?s.createElement(p,{email:H.email,onCloseRequest:W}):null,G?s.createElement(u,{className:L["loading-modal-container"]},s.createElement("div",{className:L["loader-container"]},s.createElement(l,{className:L.icon,name:"person"}),s.createElement("div",{className:L.label},"Authenticating..."))):null)};D.propTypes={queryParams:_.instanceOf(URLSearchParams)},e.exports=D},8142:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0&&u.current.validity.valid?window.open("https://www.strem.io/reset-password/"+u.current.value,"_blank"):S("Invalid email")}),[]),c=i.useMemo((function(){return[{className:T["cancel-button"],label:"Cancel",props:{onClick:o}},{label:"Send",props:{onClick:d}}]}),[o]),I=i.useCallback((function(){S("")}),[]);return i.useEffect((function(){n&&u.current.focus()}),[n]),i.createElement(s,{className:T["password-reset-modal-container"],title:"Password reset",buttons:c,onCloseRequest:o},i.createElement(_,{ref:u,className:T["credentials-text-input"],type:"email",placeholder:"Email",defaultValue:"string"==typeof t?t:"",onChange:I,onSubmit:d}),l.length>0?i.createElement("div",{className:T["error-message"]},l):null)};l.propTypes={email:r.string,onCloseRequest:r.func},e.exports=l},2015:(e,t,o)=>{var a=o(8142);e.exports=a},6732:(e,t,o)=>{var a=o(5398);e.exports=a},4167:(e,t,o)=>{var a=o(7294);e.exports=function(){var e=a.useCallback((function(){return new Promise((function(e,t){"undefined"!=typeof FB?FB.getLoginStatus((function(o){o&&o.authResponse&&"string"==typeof o.authResponse.accessToken?e(o.authResponse.accessToken):FB.login((function(o){o&&o.authResponse&&"string"==typeof o.authResponse.accessToken?e(o.authResponse.accessToken):t(new Error("Failed to get token from Facebook"))}))})):t(new Error("Failed to connect to Facebook"))}))}),[]);return a.useEffect((function(){window.fbAsyncInit=function(){FB.init({appId:"1537119779906825",status:!0,xfbml:!1,version:"v2.7"})};var e=document.createElement("script");return e.src="https://connect.facebook.net/en_US/sdk.js",e.async=!0,e.defer=!0,document.body.appendChild(e),function(){document.body.removeChild(e)}}),[]),e}},8171:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(8171);e.exports=a},3242:(e,t,o)=>{var a=o(7294),n=o(6590).useModelState;e.exports=function(e,t,o){var i=a.useMemo((function(){return{action:"Load",args:{model:"LibraryWithFilters",args:{request:{type:"string"==typeof t.type?t.type:null,sort:o.has("sort")?o.get("sort"):void 0,page:o.has("page")?parseInt(o.get("page"),10):void 0}}}}}),[t,o]);return n({model:e,action:i})}},3780:(e,t,o)=>{var a=o(7294),n=o(1468).useTranslation,i=o(6590).translateOption;e.exports=function(e){var t=n().t,o=a.useMemo((function(){return(function(e,t){return[{title:t("SELECT_TYPE"),options:e.selectable.types.map((function(e){var o=e.type;return{value:e.deepLinks.library,label:null===o?t("TYPE_ALL"):i(o,"TYPE_")}})),selected:e.selectable.types.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.library})),onSelect:function(e){window.location=e.value}},{title:t("SELECT_SORT"),options:e.selectable.sorts.map((function(e){var t=e.sort;return{value:e.deepLinks.library,label:i(t,"SORT_")}})),selected:e.selectable.sorts.filter((function(e){return e.selected})).map((function(e){return e.deepLinks.library})),onSelect:function(e){window.location=e.value}},e.selectable.prevPage||e.selectable.nextPage?{label:e.selected.request.page.toString(),onSelect:function(t){"prev"===t.value&&e.selectable.prevPage&&(window.location=e.selectable.prevPage.deepLinks.library),"next"===t.value&&e.selectable.nextPage&&(window.location=e.selectable.nextPage.deepLinks.library)}}:null]})(e,t)}),[e]);return o}},8493:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?i.createElement(T,{className:p["vertical-nav-bar"],tabs:C,selected:null!==D?D.url:null}):null,null===y?i.createElement(c,{delay:500},i.createElement("div",{className:p["meta-message-container"]},i.createElement(d,{className:p.image,src:o(7740),alt:" "}),i.createElement("div",{className:p["message-label"]},"No meta was selected!"))):null===_.metaItem?i.createElement("div",{className:p["meta-message-container"]},i.createElement(d,{className:p.image,src:o(7740),alt:" "}),i.createElement("div",{className:p["message-label"]},"No addons ware requested for this meta!")):"Err"===_.metaItem.content.type?i.createElement("div",{className:p["meta-message-container"]},i.createElement(d,{className:p.image,src:o(7740),alt:" "}),i.createElement("div",{className:p["message-label"]},"No metadata was found!")):"Loading"===_.metaItem.content.type?i.createElement(S.Placeholder,{className:p["meta-preview"]}):i.createElement(i.Fragment,null,"string"==typeof _.metaItem.content.content.background&&_.metaItem.content.content.background.length>0?i.createElement("div",{className:p["background-image-layer"]},i.createElement(d,{className:p["background-image"],src:_.metaItem.content.content.background,renderFallback:G,alt:" "})):null,i.createElement(S,{className:E(p["meta-preview"],"animation-fade-in"),name:_.metaItem.content.content.name,logo:_.metaItem.content.content.logo,runtime:_.metaItem.content.content.runtime,releaseInfo:_.metaItem.content.content.releaseInfo,released:_.metaItem.content.content.released,description:null!==B&&"string"==typeof B.overview&&B.overview.length>0?B.overview:_.metaItem.content.content.description,links:_.metaItem.content.content.links,trailerStreams:_.metaItem.content.content.trailerStreams,inLibrary:_.metaItem.content.content.inLibrary,toggleInLibrary:_.metaItem.content.content.inLibrary?M:b})),i.createElement("div",{className:p.spacing}),null!==P?i.createElement(A,{className:p["streams-list"],streams:_.streams,video:B}):null!==y?i.createElement(O,{className:p["videos-list"],metaItem:_.metaItem,libraryItem:_.libraryItem,season:h,seasonOnSelect:U,toggleNotifications:W}):null),null!==D?i.createElement(u,{className:p["meta-extension-modal-container"],title:D.name,onCloseRequest:g},i.createElement("iframe",{className:p["meta-extension-modal-iframe"],sandbox:"allow-forms allow-scripts allow-same-origin",src:D.url})):null)};h.propTypes={urlParams:r.shape({type:r.string,id:r.string,videoId:r.string}),queryParams:r.instanceOf(URLSearchParams)};e.exports=I(h,(function(){return i.createElement("div",{className:p["metadetails-container"]},i.createElement(l,{className:p["nav-bar"],backButton:!0,addonsButton:!0,fullscreenButton:!0,navMenu:!0}))}))},2742:(e,t,o)=>{var a=["className","videoId","videoReleased","addonName","name","description","thumbnail","progress","deepLinks"];function n(){return n=Object.assign||function(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var r=o(7294),E=o(5697),s=o(4184),_=o(5985).default,T=o(6590),l=T.Button,S=T.Image,u=T.PlayIconCircleCentered,d=T.useProfile,c=T.platform,I=T.useStreamingServer,A=T.useToast,O=o(3662).useServices,N=o(4134),R=o(3458),m=function(e){var t=e.className,o=e.videoId,E=e.videoReleased,T=e.addonName,N=e.name,m=e.description,p=e.thumbnail,h=e.progress,L=e.deepLinks,f=i(e,a),C=d(),D=I(),g=O().core,v=A(),y=r.useMemo((function(){var e=null!==D.settings&&"Ready"===D.settings.type;return L?C.settings.playerType&&"internal"!==C.settings.playerType?c.isMobile()||!e?(L.externalPlayer.openPlayer||{})[c.name]||L.externalPlayer.href:null:"string"==typeof L.player?L.player:null:null}),[L,C,D]),P=r.useCallback((function(){"string"==typeof o&&g.transport.dispatch({action:"MetaDetails",args:{action:"MarkVideoAsWatched",args:[{id:o,released:E},!0]}})}),[o,E]),B=r.useCallback((function(e){null===y?(P(),g.transport.dispatch({action:"StreamingServer",args:{action:"PlayOnDevice",args:{device:"vlc",source:L.externalPlayer.streaming}}})):C.settings.playerType&&"internal"!==C.settings.playerType&&(P(),v.show({type:"success",title:"Stream opened in external player",timeout:4e3})),"function"==typeof f.onClick&&f.onClick(e)}),[y,L,f.onClick,C,v,P]),b=r.useMemo((function(){return y===L.externalPlayer.href&&L.externalPlayer.fileName}),[y]),M=r.useCallback((function(){return r.createElement(_,{className:R["placeholder-icon"],name:"ic_broken_link"})}),[]);return r.createElement(l,n({href:y,download:b},f,{onClick:B,className:s(t,R["stream-container"]),title:T}),"string"==typeof p&&p.length>0?r.createElement("div",{className:R["thumbnail-container"],title:N||T},r.createElement(S,{className:R.thumbnail,src:p,alt:" ",renderFallback:M})):r.createElement("div",{className:R["addon-name-container"],title:N||T},r.createElement("div",{className:R["addon-name"]},N||T)),r.createElement("div",{className:R["info-container"],title:m},m),r.createElement(u,{className:R["play-icon"]}),null!==h&&!isNaN(h)&&h>0?r.createElement("div",{className:R["progress-bar-container"]},r.createElement("div",{className:R["progress-bar"],style:{width:"".concat(100*Math.min(h,1),"%")}})):null)};m.Placeholder=N,m.propTypes={className:E.string,videoId:E.string,videoReleased:E.instanceOf(Date),addonName:E.string,name:E.string,description:E.string,thumbnail:E.string,progress:E.number,deepLinks:E.shape({player:E.string,externalPlayer:E.shape({href:E.string,fileName:E.string,streaming:E.string,openPlayer:E.shape({choose:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string}),vlc:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string}),outplayer:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string}),infuse:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string}),justplayer:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string}),mxplayer:E.shape({ios:E.string,android:E.string,windows:E.string,macos:E.string,linux:E.string})})})}),onClick:E.func},e.exports=m},3210:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(926),E=o(1384),s=function(e){var t=e.className;return a.createElement("div",{className:i(t,E["stream-placeholder-container"])},a.createElement("div",{className:E["addon-container"]},a.createElement("div",{className:E["addon-name"]})),a.createElement("div",{className:E["info-container"]},a.createElement("div",{className:E["description-container"]}),a.createElement("div",{className:E["description-container"]})),a.createElement(r,{className:E["play-icon"]}))};s.propTypes={className:n.string},e.exports=s},4134:(e,t,o)=>{var a=o(3210);e.exports=a},4674:(e,t,o)=>{var a=o(2742);e.exports=a},4176:(e,t,o)=>{var a=["className","video"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var u=o(7294),d=o(5697),c=o(4184),I=o(1468).useTranslation,A=o(5985).default,O=o(6590),N=O.Button,R=O.Image,m=O.Multiselect,p=o(3662).useServices,h=o(4674),L=o(6796),f="ALL",C=function(e){var t=e.className,r=e.video,s=S(e,a),T=I().t,l=p().core,d=_(u.useState(f),2),O=d[0],C=d[1],D=u.useCallback((function(e){C(e.value)}),[]),g=u.useMemo((function(){return s.streams.filter((function(e){return"Ready"===e.content.type})).reduce((function(e,t){return e[t.addon.transportUrl]={addon:t.addon,streams:t.content.content.map((function(e){return E(E({},e),{},{onClick:function(){l.transport.analytics({event:"StreamClicked",args:{stream:e}})},addonName:t.addon.manifest.name})}))},e}),{})}),[s.streams]),v=u.useMemo((function(){return O===f?Object.values(g).map((function(e){return e.streams})).flat(1):g[O]?g[O].streams:[]}),[g,O]),y=u.useMemo((function(){return{title:"Select Addon",options:[{value:f,label:T("ALL_ADDONS"),title:T("ALL_ADDONS")}].concat(i(Object.keys(g).map((function(e){return{value:e,label:g[e].addon.manifest.name,title:g[e].addon.manifest.name}})))),selected:[O],onSelect:D}}),[g,O]);return u.createElement("div",{className:c(t,L["streams-list-container"])},0===s.streams.length?u.createElement("div",{className:L["message-container"]},u.createElement(R,{className:L.image,src:o(7740),alt:" "}),u.createElement("div",{className:L.label},"No addons were requested for streams!")):s.streams.every((function(e){return"Err"===e.content.type}))?u.createElement("div",{className:L["message-container"]},u.createElement(R,{className:L.image,src:o(7740),alt:" "}),u.createElement("div",{className:L.label},T("NO_STREAM"))):0===v.length?u.createElement("div",{className:L["streams-container"]},u.createElement(h.Placeholder,null),u.createElement(h.Placeholder,null)):u.createElement(u.Fragment,null,Object.keys(g).length>1?u.createElement(m,n({},y,{className:L["select-input-container"]})):null,u.createElement("div",{className:L["streams-container"]},v.map((function(e,t){return u.createElement(h,{key:t,videoId:null==r?void 0:r.id,videoReleased:null==r?void 0:r.released,addonName:e.addonName,name:e.name,description:e.description,thumbnail:e.thumbnail,progress:e.progress,deepLinks:e.deepLinks,onClick:e.onClick})})))),u.createElement(N,{className:L["install-button-container"],title:T("ADDON_CATALOGUE_MORE"),href:"#/addons"},u.createElement(A,{className:L.icon,name:"addons"}),u.createElement("div",{className:L.label},T("ADDON_CATALOGUE_MORE"))))};C.propTypes={className:d.string,streams:d.arrayOf(d.object).isRequired,video:d.object},e.exports=C},2231:(e,t,o)=>{var a=o(4176);e.exports=a},2813:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(6073).t,E=o(5985).default,s=o(6590),_=s.Button,T=s.Multiselect,l=o(3570),S=o(6351),u=function(e){var t=e.className,o=e.seasons,n=e.season,s=e.onSelect,l=a.useMemo((function(){return o.map((function(e){return{value:String(e),label:e>0?"".concat(r("SEASON")," ").concat(e):r("SPECIAL")}}))}),[o]),u=a.useMemo((function(){return[String(n)]}),[n]),d=a.useCallback((function(e){if("function"==typeof s){var t=o.indexOf(n),a="next"===e.currentTarget.dataset.action?t+1=0?t-1:0,i=o[a];s({type:"select",value:i,reactEvent:e,nativeEvent:e.nativeEvent})}}),[n,o,s]),c=a.useCallback((function(e){var t=parseFloat(e.value);"function"==typeof s&&s({type:"select",value:t,reactEvent:e.reactEvent,nativeEvent:e.nativeEvent})}),[s]);return a.createElement("div",{className:i(t,S["seasons-bar-container"])},a.createElement(_,{className:S["prev-season-button"],title:"Previous season","data-action":"prev",onClick:d},a.createElement(E,{className:S.icon,name:"chevron-back"}),a.createElement("div",{className:S.label},"Prev")),a.createElement(T,{className:S["seasons-popup-label-container"],title:n>0?"".concat(r("SEASON")," ").concat(n):r("SPECIAL"),direction:"bottom-left",options:l,selected:u,onSelect:c}),a.createElement(_,{className:S["next-season-button"],title:"Next season","data-action":"next",onClick:d},a.createElement("div",{className:S.label},"Next"),a.createElement(E,{className:S.icon,name:"chevron-forward"})))};u.Placeholder=l,u.propTypes={className:n.string,seasons:n.arrayOf(n.number).isRequired,season:n.number.isRequired,onSelect:n.func},e.exports=u},9319:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(2180),s=function(e){var t=e.className;return a.createElement("div",{className:i(t,E["seasons-bar-placeholder-container"])},a.createElement("div",{className:E["prev-season-button"]},a.createElement(r,{className:E.icon,name:"chevron-back"}),a.createElement("div",{className:E.label},"Prev")),a.createElement("div",{className:E["seasons-popup-label-container"]},a.createElement("div",{className:E["seasons-popup-label"]},"Season 1"),a.createElement(r,{className:E["seasons-popup-icon"],name:"caret-down"})),a.createElement("div",{className:E["next-season-button"]},a.createElement("div",{className:E.label},"Next"),a.createElement(r,{className:E.icon,name:"chevron-forward"})))};s.propTypes={className:n.string},e.exports=s},3570:(e,t,o)=>{var a=o(9319);e.exports=a},3424:(e,t,o)=>{var a=o(2813);e.exports=a},2824:(e,t,o)=>{var a=["className","id","title","thumbnail","episode","released","upcoming","watched","progress","scheduled","deepLinks"],n=["className","id","title","thumbnail","episode","released","upcoming","watched","progress","scheduled","children"];function i(){return i=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var _=o(7294),T=o(5697),l=o(4184),S=o(6073).t,u=o(3662).useServices,d=o(1665).useRouteFocused,c=o(5985).default,I=o(6590),A=I.Button,O=I.Image,N=I.Popup,R=I.useBinaryState,m=o(9922),p=o(4486),h=function(e){var t=e.className,o=e.id,E=e.title,T=e.thumbnail,I=e.episode,m=e.released,h=e.upcoming,L=e.watched,f=e.progress,C=e.scheduled,D=e.deepLinks,g=s(e,a),v=u().core,y=d(),P=r(R(!1),4),B=P[0],b=P[2],M=P[3],W=_.useCallback((function(e){e.nativeEvent.togglePopupPrevented||(e.nativeEvent.ctrlKey||2===e.nativeEvent.button)&&(e.preventDefault(),M())}),[]),U=_.useCallback((function(e){e.nativeEvent.togglePopupPrevented||e.nativeEvent.ctrlKey||e.preventDefault()}),[M]),G=_.useCallback((function(e){"mouse"===e.nativeEvent.pointerType||e.nativeEvent.togglePopupPrevented||M()}),[M]),F=_.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),k=_.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),w=_.useCallback((function(e){e.nativeEvent.togglePopupPrevented=!0}),[]),V=_.useCallback((function(e){e.nativeEvent.buttonClickPrevented=!0}),[]),H=_.useCallback((function(e){e.preventDefault(),b(),v.transport.dispatch({action:"MetaDetails",args:{action:"MarkVideoAsWatched",args:[{id:o,released:m},!L]}})}),[o,m,L]),Y=_.useMemo((function(){return D?"string"==typeof D.player?D.player:"string"==typeof D.metaDetailsStreams?D.metaDetailsStreams:null:null}),[D]),z=_.useMemo((function(){return function(e){var t=e.className,o=e.id,a=e.title,r=e.thumbnail,E=e.episode,T=e.released,S=e.upcoming,u=e.watched,d=e.progress,I=e.scheduled,N=e.children,R=s(e,n);return _.createElement(A,i({},R,{className:l(t,p["video-container"]),title:a}),"string"==typeof r&&r.length>0?_.createElement("div",{className:p["thumbnail-container"]},_.createElement(O,{className:p.thumbnail,src:r,alt:" ",renderFallback:function(){return _.createElement(c,{className:p["placeholder-icon"],name:"symbol"})}})):null,_.createElement("div",{className:p["info-container"]},_.createElement("div",{className:p["title-container"]},null===E||isNaN(E)?null:"".concat(E,". "),"string"==typeof a&&a.length>0?a:o),_.createElement("div",{className:p["flex-row-container"]},T instanceof Date&&!isNaN(T.getTime())?_.createElement("div",{className:p["released-container"]},T.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric"})):I?_.createElement("div",{className:p["released-container"],title:"To be announced"},"TBA"):null,_.createElement("div",{className:p["upcoming-watched-container"]},S?_.createElement("div",{className:p["upcoming-container"]},_.createElement("div",{className:p["flag-label"]},"Upcoming")):null,u?_.createElement("div",{className:p["watched-container"]},_.createElement(c,{className:p["flag-icon"],name:"eye"}),_.createElement("div",{className:p["flag-label"]},"Watched")):null))),null!==d&&!isNaN(d)&&d>0?_.createElement("div",{className:p["progress-bar-container"]},_.createElement("div",{className:p["progress-bar"],style:{width:"".concat(100*Math.min(d,1),"%")}})):null,N)}}),[]),x=_.useMemo((function(){return function(){return _.createElement("div",{className:p["context-menu-content"],onPointerDown:F,onContextMenu:k,onClick:w,onKeyDown:V},_.createElement(A,{className:p["context-menu-option-container"],title:"Watch"},_.createElement("div",{className:p["context-menu-option-label"]},S("CTX_WATCH"))),_.createElement(A,{className:p["context-menu-option-container"],title:L?"Mark as non-watched":"Mark as watched",onClick:H},_.createElement("div",{className:p["context-menu-option-label"]},S(L?"CTX_MARK_NON_WATCHED":"CTX_MARK_WATCHED"))))}}),[L,H]);return _.useEffect((function(){y||b()}),[y]),_.createElement(N,i({className:t,id:o,title:E,thumbnail:T,episode:I,released:m,upcoming:h,watched:L,progress:f,scheduled:C,href:Y},g,{onMouseUp:W,onLongPress:G,onContextMenu:U,open:B,onCloseRequest:b,renderLabel:z,renderMenu:x}))};h.Placeholder=m,h.propTypes={className:T.string,id:T.string,title:T.string,thumbnail:T.string,episode:T.number,released:T.instanceOf(Date),upcoming:T.bool,watched:T.bool,progress:T.number,scheduled:T.bool,deepLinks:T.shape({metaDetailsStreams:T.string,player:T.string})},e.exports=h},8509:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5507),E=function(e){var t=e.className;return a.createElement("div",{className:i(t,r["video-placeholder-container"])},a.createElement("div",{className:r["info-container"]},a.createElement("div",{className:r["name-container"]}),a.createElement("div",{className:r["released-container"]})))};E.propTypes={className:n.string},e.exports=E},9922:(e,t,o)=>{var a=o(8509);e.exports=a},123:(e,t,o)=>{var a=o(2824);e.exports=a},1702:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o0?e[e.length-1]:R.length>0?R[R.length-1]:null}),[R,_]),p=i.useMemo((function(){return N.filter((function(e){return null===m||e.season===m})).sort((function(e,t){return e.episode-t.episode}))}),[N,m]),h=a(i.useState(""),2),L=h[0],f=h[1],C=i.useCallback((function(e){f(e.currentTarget.value)}),[]);return i.createElement("div",{className:E(t,c["videos-list-container"])},n&&"Loading"!==n.content.type?"Err"===n.content.type||0===p.length?i.createElement("div",{className:c["message-container"]},i.createElement(T,{className:c.image,src:o(7740),alt:" "}),i.createElement("div",{className:c.label},"No videos found for this meta!")):i.createElement(i.Fragment,null,O&&r?i.createElement(S,{className:c["notifications-checkbox"],checked:!r.state.noNotif,onClick:A},s("DETAIL_RECEIVE_NOTIF_SERIES")):null,R.length>0?i.createElement(u,{className:c["seasons-bar"],season:m,seasons:R,onSelect:I}):null,i.createElement(l,{className:c["search-bar"],title:s("SEARCH_VIDEOS"),value:L,onChange:C}),i.createElement("div",{className:c["videos-container"]},p.filter((function(e){return 0===L.length||"string"==typeof e.title&&e.title.toLowerCase().includes(L.toLowerCase())||!isNaN(e.released.getTime())&&e.released.toLocaleString(void 0,{year:"2-digit",month:"short",day:"numeric"}).toLowerCase().includes(L.toLowerCase())})).map((function(e,t){return i.createElement(d,{key:t,id:e.id,title:e.title,thumbnail:e.thumbnail,episode:e.episode,released:e.released,upcoming:e.upcoming,watched:e.watched,progress:e.progress,deepLinks:e.deepLinks,scheduled:e.scheduled})})))):i.createElement(i.Fragment,null,i.createElement(u.Placeholder,{className:c["seasons-bar"]}),i.createElement(l.Placeholder,{className:c["search-bar"],title:s("SEARCH_VIDEOS")}),i.createElement("div",{className:c["videos-scroll-container"]},i.createElement(d.Placeholder,null),i.createElement(d.Placeholder,null),i.createElement(d.Placeholder,null),i.createElement(d.Placeholder,null),i.createElement(d.Placeholder,null))))};I.propTypes={className:r.string,metaItem:r.object,libraryItem:r.object,season:r.number,seasonOnSelect:r.func,toggleNotifications:r.func},e.exports=I},8437:(e,t,o)=>{var a=o(1702);e.exports=a},9005:(e,t,o)=>{var a=o(8493);e.exports=a},8450:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(7294);e.exports=function(e,t){var o=a.useMemo((function(){return t.has("season")&&!isNaN(t.get("season"))?parseInt(t.get("season"),10):null}),[t]),n=a.useCallback((function(o){var a=new URLSearchParams(t);a.set("season",o),window.location.replace("#".concat(e.path,"?").concat(a))}),[e,t]);return[o,n]}},9096:(e,t,o)=>{var a=o(7294),n=o(6590),i=n.Image,r=n.HorizontalNavBar,E=o(5142);e.exports=function(){return a.createElement("div",{className:E["not-found-container"]},a.createElement(r,{className:E["nav-bar"],title:"Page not found",backButton:!0,fullscreenButton:!0,navMenu:!0}),a.createElement("div",{className:E["not-found-content"]},a.createElement(i,{className:E["not-found-image"],src:o(7740),alt:" "}),a.createElement("div",{className:E["not-found-label"]},"Page not found!")))}},353:(e,t,o)=>{var a=o(9096);e.exports=a},9579:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(6590).Image,E=o(1391),s=function(e){var t=e.className,n=e.logo;return a.createElement("div",{className:i(t,E["buffering-loader-container"])},a.createElement(r,{className:E["buffering-loader"],src:n,alt:" ",fallbackSrc:o(5313)}))};s.propTypes={className:n.string,logo:n.string},e.exports=s},3475:(e,t,o)=>{var a=o(9579);e.exports=a},2479:(e,t,o)=>{var a=["className","paused","time","duration","buffered","volume","muted","playbackSpeed","subtitlesTracks","audioTracks","metaItem","nextVideo","stream","statistics","onPlayRequested","onPauseRequested","onMuteRequested","onUnmuteRequested","onVolumeChangeRequested","onSeekRequested","onToggleSubtitlesMenu","onToggleInfoMenu","onToggleSpeedMenu","onToggleVideosMenu","onToggleOptionsMenu","onToggleStatisticsMenu"];function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var _=o(7294),T=o(5697),l=o(4184),S=o(5985).default,u=o(6590).Button,d=o(3662).useServices,c=o(5280),I=o(7429),A=o(578),O=o(6590).useBinaryState,N=o(6073).t,R=function(e){var t,o,E=e.className,T=e.paused,R=e.time,m=e.duration,p=e.buffered,h=e.volume,L=e.muted,f=e.playbackSpeed,C=e.subtitlesTracks,D=e.audioTracks,g=e.metaItem,v=e.nextVideo,y=e.stream,P=e.statistics,B=e.onPlayRequested,b=e.onPauseRequested,M=e.onMuteRequested,W=e.onUnmuteRequested,U=e.onVolumeChangeRequested,G=e.onSeekRequested,F=e.onToggleSubtitlesMenu,k=e.onToggleInfoMenu,w=e.onToggleSpeedMenu,V=e.onToggleVideosMenu,H=e.onToggleOptionsMenu,Y=e.onToggleStatisticsMenu,z=s(e,a),x=d().chromecast,K=r(_.useState((function(){return x.active})),2),j=K[0],Q=K[1],X=r(O(!1),4),$=X[0],q=X[3],J=_.useCallback((function(e){e.nativeEvent.subtitlesMenuClosePrevented=!0}),[]),Z=_.useCallback((function(e){e.nativeEvent.infoMenuClosePrevented=!0}),[]),ee=_.useCallback((function(e){e.nativeEvent.speedMenuClosePrevented=!0}),[]),te=_.useCallback((function(e){e.nativeEvent.videosMenuClosePrevented=!0}),[]),oe=_.useCallback((function(e){e.nativeEvent.optionsMenuClosePrevented=!0}),[]),ae=_.useCallback((function(e){e.nativeEvent.statisticsMenuClosePrevented=!0}),[]),ne=_.useCallback((function(){T?"function"==typeof B&&B():"function"==typeof b&&b()}),[T,B,b]),ie=_.useCallback((function(){null!==v&&"object"===i(v.deepLinks)&&(null!==v.deepLinks.player?window.location.replace(v.deepLinks.player):null!==v.deepLinks.metaDetailsStreams&&window.location.replace(v.deepLinks.metaDetailsStreams))}),[v]),re=_.useCallback((function(){L?"function"==typeof W&&W():"function"==typeof M&&M()}),[L,M,W]),Ee=_.useCallback((function(){"function"==typeof F&&F()}),[F]),se=_.useCallback((function(){"function"==typeof k&&k()}),[k]),_e=_.useCallback((function(){"function"==typeof w&&w()}),[w]),Te=_.useCallback((function(){"function"==typeof V&&V()}),[V]),le=_.useCallback((function(){"function"==typeof H&&H()}),[H]),Se=_.useCallback((function(){"function"==typeof Y&&Y()}),[Y]),ue=_.useCallback((function(){x.transport.requestSession()}),[]);return _.useEffect((function(){var e=function(){Q(x.active)};return x.on("stateChanged",e),function(){x.off("stateChanged",e)}}),[]),_.createElement("div",n({},z,{className:l(E,A["control-bar-container"])}),_.createElement(c,{className:A["seek-bar"],time:R,duration:m,buffered:p,onSeekRequested:G}),_.createElement("div",{className:A["control-bar-buttons-container"]},_.createElement(u,{className:l(A["control-bar-button"],{disabled:"boolean"!=typeof T}),title:N(T?"PLAYER_PLAY":"PLAYER_PAUSE"),tabIndex:-1,onClick:ne},_.createElement(S,{className:A.icon,name:"boolean"!=typeof T||T?"play":"pause"})),null!==v?_.createElement(u,{className:l(A["control-bar-button"]),title:N("PLAYER_NEXT_VIDEO"),tabIndex:-1,onClick:ie},_.createElement(S,{className:A.icon,name:"next"})):null,_.createElement(u,{className:l(A["control-bar-button"],{disabled:"boolean"!=typeof L}),title:N(L?"PLAYER_UNMUTE":"PLAYER_MUTE"),tabIndex:-1,onClick:re},_.createElement(S,{className:A.icon,name:"boolean"==typeof L&&L?"volume-mute":null===h||isNaN(h)?"volume-off":h<30?"volume-low":h<70?"volume-medium":"volume-high"})),_.createElement(I,{className:A["volume-slider"],volume:h,onVolumeChangeRequested:U}),_.createElement("div",{className:A.spacing}),_.createElement(u,{className:A["control-bar-buttons-menu-button"],onClick:q},_.createElement(S,{className:A.icon,name:"more-vertical"})),_.createElement("div",{className:l(A["control-bar-buttons-menu-container"],{open:$})},_.createElement(u,{className:l(A["control-bar-button"],{disabled:null===P||"Err"===P.type||null===y||"string"!=typeof y.infoHash||"number"!=typeof y.fileIdx}),tabIndex:-1,onMouseDown:ae,onClick:Se},_.createElement(S,{className:A.icon,name:"network"})),_.createElement(u,{className:l(A["control-bar-button"],{disabled:null===f}),tabIndex:-1,onMouseDown:ee,onClick:_e},_.createElement(S,{className:A.icon,name:"speed"})),_.createElement(u,{className:l(A["control-bar-button"],{disabled:null===g||"Ready"!==g.type}),tabIndex:-1,onMouseDown:Z,onClick:se},_.createElement(S,{className:A.icon,name:"about"})),_.createElement(u,{className:l(A["control-bar-button"],{disabled:!j}),tabIndex:-1,onClick:ue},_.createElement(S,{className:A.icon,name:"cast"})),_.createElement(u,{className:l(A["control-bar-button"],{disabled:!(Array.isArray(C)&&0!==C.length||Array.isArray(D)&&0!==D.length)}),tabIndex:-1,onMouseDown:J,onClick:Ee},_.createElement(S,{className:A.icon,name:"subtitles"})),(null==g||null===(t=g.content)||void 0===t||null===(o=t.videos)||void 0===o?void 0:o.length)>0?_.createElement(u,{className:A["control-bar-button"],tabIndex:-1,onMouseDown:te,onClick:Te},_.createElement(S,{className:A.icon,name:"episodes"})):null,_.createElement(u,{className:A["control-bar-button"],tabIndex:-1,onMouseDown:oe,onClick:le},_.createElement(S,{className:A.icon,name:"more-horizontal"})))))};R.propTypes={className:T.string,paused:T.bool,time:T.number,duration:T.number,buffered:T.number,volume:T.number,muted:T.bool,playbackSpeed:T.number,subtitlesTracks:T.array,audioTracks:T.array,metaItem:T.object,nextVideo:T.object,stream:T.object,statistics:T.object,onPlayRequested:T.func,onPauseRequested:T.func,onMuteRequested:T.func,onUnmuteRequested:T.func,onVolumeChangeRequested:T.func,onSeekRequested:T.func,onToggleSubtitlesMenu:T.func,onToggleInfoMenu:T.func,onToggleSpeedMenu:T.func,onToggleVideosMenu:T.func,onToggleOptionsMenu:T.func,onToggleStatisticsMenu:T.func},e.exports=R},6181:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var t=function(e){return("0"+e).slice(-1*Math.max(e.toString().length,2))};e.exports=function(e){if(null===e||isNaN(e))return"--:--:--";var o=Math.floor(e/36e5),a=Math.floor(e/6e4%60),n=Math.floor(e/1e3%60);return"".concat(t(o),":").concat(t(a),":").concat(t(n))}},5280:(e,t,o)=>{var a=o(6181);e.exports=a},4932:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(4932);e.exports=a},9292:(e,t,o)=>{var a=o(2479);e.exports=a},8928:(e,t,o)=>{var a=["className"];function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(6590),S=l.MetaPreview,u=l.CONSTANTS,d=o(3800),c=function(e){var t=e.className,o=E(e,a),n=s.useMemo((function(){return null!==o.metaItem?i(i({},o.metaItem),{},{links:o.metaItem.links.filter((function(e){return e.category===u.SHARE_LINK_CATEGORY}))}):null}),[o.metaItem]),r=s.useCallback((function(e){e.nativeEvent.infoMenuClosePrevented=!0}),[]);return s.createElement("div",{className:T(t,d["info-menu-container"]),onMouseDown:r},null!==n?s.createElement(S,{className:d["meta-preview"],compact:!0,name:n.name,logo:n.logo,runtime:n.runtime,releaseInfo:n.releaseInfo,released:n.released,description:n.description,links:n.links}):null)};c.propTypes={className:_.string,metaItem:_.object,addon:_.object,stream:_.object},e.exports=c},5458:(e,t,o)=>{var a=o(8928);e.exports=a},2690:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(2690);e.exports=a},9252:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(6590).Button,s=o(1530),_=function(e){var t=e.icon,o=e.label,n=e.deviceId,_=e.disabled,T=e.onClick,l=a.useCallback((function(){"function"==typeof T&&T(n)}),[T,n]);return a.createElement(E,{className:i(s["option-container"],{disabled:_}),disabled:_,onClick:l},a.createElement(r,{className:s.icon,name:t}),a.createElement("div",{className:s.label},o))};_.propTypes={icon:n.string,label:n.string,deviceId:n.string,disabled:n.bool,onClick:n.func},e.exports=_},9944:(e,t,o)=>{var a=o(9252);e.exports=a},1366:(e,t,o)=>{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(1366);e.exports=a},2230:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o0||Array.isArray(Y.extraSubtitlesTracks)&&Y.extraSubtitlesTracks.length>0||Array.isArray(Y.audioTracks)&&Y.audioTracks.length>0)&&Ae();break;case"KeyI":Se(),Ie(),Le(),ge(),Ue(),null!==K.metaItem&&"Ready"===K.metaItem.type&&me();break;case"KeyR":Se(),Re(),Ie(),ge(),Ue(),null!==Y.playbackSpeed&&fe();break;case"KeyV":Se(),Re(),Ie(),Le(),Ue(),null!==K.metaItem&&"Ready"===K.metaItem.type&&ve();break;case"KeyD":Se(),Re(),Ie(),Le(),ge(),null!==Z.statistics&&"Err"!==Z.statistics.type&&K.selected&&"string"==typeof K.selected.stream.infoHash&&"number"==typeof K.selected.stream.fileIdx&&Ge();break;case"Escape":Se(),Ie(),Re(),Le(),ge(),Ue(),ut()}},t=function(e){e.deltaY>0?ce||Ne||De||he||le||We||null===Y.volume||nt(Y.volume-5):ce||Ne||De||he||le||We||null===Y.volume||nt(Y.volume+5)};return ee&&(window.addEventListener("keydown",e),window.addEventListener("wheel",t)),function(){window.removeEventListener("keydown",e),window.removeEventListener("wheel",t)}}),[K.metaItem,K.selected,Z.statistics,q.seekTimeDuration,ee,ce,Ne,De,he,le,We,Y.paused,Y.time,Y.volume,Y.audioTracks,Y.subtitlesTracks,Y.extraSubtitlesTracks,Y.playbackSpeed,Ae,me,ve,Ge]),s.useLayoutEffect((function(){return function(){_e.cancel(),Ze.cancel(),tt.cancel()}}),[]),s.createElement("div",{className:T(G["player-container"],i({},G.immersed,Ee&&!ne&&null!==Y.paused&&!Y.paused&&!ce&&!Ne&&!he&&!De&&!Pe&&!le&&!We)),onMouseDown:At,onMouseMove:Ot,onMouseOver:Ot,onMouseLeave:Nt},s.createElement(M,{ref:ze,className:G.layer,onEnded:Qe,onError:Xe,onPropValue:je,onPropChanged:je,onSubtitlesTrackLoaded:$e,onExtraSubtitlesTrackLoaded:qe,onImplementationChanged:Ke}),Y.buffering?s.createElement(f,{className:G.layer}):null,s.createElement("div",{className:G.layer,onClick:ct,onDoubleClick:It}),null!==He?s.createElement("div",{className:T(G.layer,G["error-layer"])},s.createElement("div",{className:G["error-label"],title:He.message},He.message),2===He.code?s.createElement("div",{className:G["error-sub"],title:a("EXTERNAL_PLAYER_HINT")},a("EXTERNAL_PLAYER_HINT")):null,null!==K.selected?s.createElement(O,{className:G["playlist-button"],title:a("PLAYER_OPEN_IN_EXTERNAL"),href:K.selected.stream.deepLinks.externalPlayer.href,download:K.selected.stream.deepLinks.externalPlayer.fileName,target:"_blank"},s.createElement(L,{className:G.icon,name:"ic_downloads"}),s.createElement("div",{className:G.label},a("PLAYER_OPEN_IN_EXTERNAL"))):null):null,ce||Ne||De||he||le||We?s.createElement("div",{className:G.layer}):null,s.createElement(A,{className:T(G.layer,G["nav-bar-layer"]),title:null!==K.title?K.title:"",backButton:!0,fullscreenButton:!0,onMouseMove:Rt,onMouseOver:Rt}),s.createElement(C,{className:T(G.layer,G["control-bar-layer"]),paused:Y.paused,time:Y.time,duration:Y.duration,buffered:Y.buffered,volume:Y.volume,muted:Y.muted,playbackSpeed:Y.playbackSpeed,subtitlesTracks:Y.subtitlesTracks.concat(Y.extraSubtitlesTracks),audioTracks:Y.audioTracks,metaItem:K.metaItem,nextVideo:K.nextVideo,stream:null!==K.selected?K.selected.stream:null,statistics:Z.statistics,onPlayRequested:Je,onPauseRequested:et,onMuteRequested:ot,onUnmuteRequested:at,onVolumeChangeRequested:nt,onSeekRequested:it,onToggleOptionsMenu:ue,onToggleSubtitlesMenu:Ae,onToggleInfoMenu:me,onToggleSpeedMenu:fe,onToggleVideosMenu:ve,onToggleStatisticsMenu:Ge,onMouseMove:Rt,onMouseOver:Rt}),Pe?s.createElement(D,{className:T(G.layer,G["menu-layer"]),metaItem:null!==K.metaItem&&"Ready"===K.metaItem.type?K.metaItem.content:null,nextVideo:K.nextVideo,onDismiss:ut,onPlayNextVideoRequested:dt}):null,We?s.createElement(g,{className:T(G.layer,G["menu-layer"]),stream:null!==K.selected?K.selected.stream:null,statistics:Z.statistics}):null,ce?s.createElement(B,{className:T(G.layer,G["menu-layer"]),audioTracks:Y.audioTracks,selectedAudioTrackId:Y.selectedAudioTrackId,subtitlesTracks:Y.subtitlesTracks,selectedSubtitlesTrackId:Y.selectedSubtitlesTrackId,subtitlesOffset:Y.subtitlesOffset,subtitlesSize:Y.subtitlesSize,extraSubtitlesTracks:Y.extraSubtitlesTracks,selectedExtraSubtitlesTrackId:Y.selectedExtraSubtitlesTrackId,extraSubtitlesOffset:Y.extraSubtitlesOffset,extraSubtitlesDelay:Y.extraSubtitlesDelay,extraSubtitlesSize:Y.extraSubtitlesSize,onSubtitlesTrackSelected:Et,onExtraSubtitlesTrackSelected:st,onAudioTrackSelected:_t,onSubtitlesOffsetChanged:St,onSubtitlesSizeChanged:lt,onExtraSubtitlesOffsetChanged:St,onExtraSubtitlesDelayChanged:Tt,onExtraSubtitlesSizeChanged:lt}):null,Ne?s.createElement(v,{className:T(G.layer,G["menu-layer"]),stream:null!==K.selected?K.selected.stream:null,addon:K.addon,metaItem:null!==K.metaItem&&"Ready"===K.metaItem.type?K.metaItem.content:null}):null,he?s.createElement(b,{className:T(G.layer,G["menu-layer"]),playbackSpeed:Y.playbackSpeed,onPlaybackSpeedChanged:rt}):null,De?s.createElement(P,{className:T(G.layer,G["menu-layer"]),metaItem:null!==K.metaItem&&"Ready"===K.metaItem.type?K.metaItem.content:null,seriesInfo:K.seriesInfo}):null,le?s.createElement(y,{className:T(G.layer,G["menu-layer"]),stream:K.selected.stream,playbackDevices:null!==Z.playbackDevices&&"Ready"===Z.playbackDevices.type?Z.playbackDevices.content:[]}):null)};F.propTypes={urlParams:_.shape({stream:_.string,streamTransportUrl:_.string,metaTransportUrl:_.string,type:_.string,id:_.string,videoId:_.string}),queryParams:_.instanceOf(URLSearchParams)};e.exports=h(F,(function(){return s.createElement("div",{className:T(G["player-container"])})}))},7764:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(6590).Button,E=o(4805),s=function(e){var t=e.className,o=e.value,n=e.selected,s=e.onSelect,_=a.useCallback((function(){"function"==typeof s&&s(o)}),[s,o]);return a.createElement(r,{className:i(t,E.option,{selected:n}),onClick:_},a.createElement("div",{className:E.label},o,"x"),a.createElement("div",{className:E.icon}))};s.propTypes={className:n.string,value:n.number,selected:n.bool,onSelect:n.func},e.exports=s},9396:(e,t,o)=>{var a=o(7764);e.exports=a},5296:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(1468).useTranslation,E=o(9396),s=o(9715),_=Array.from(Array(8).keys(),(function(e){return.25*e+.25})).reverse(),T=function(e){var t=e.className,o=e.playbackSpeed,n=e.onPlaybackSpeedChanged,T=r().t,l=a.useCallback((function(e){e.nativeEvent.speedMenuClosePrevented=!0}),[]),S=a.useCallback((function(e){"function"==typeof n&&n(e)}),[n]);return a.createElement("div",{className:i(t,s["speed-menu-container"]),onMouseDown:l},a.createElement("div",{className:s.title},T("PLAYBACK_SPEED")),a.createElement("div",{className:s["options-container"]},_.map((function(e){return a.createElement(E,{className:s.option,key:e,value:e,selected:e===o,onSelect:S})}))))};T.propTypes={className:n.string,playbackSpeed:n.number,onPlaybackSpeedChanged:n.func},e.exports=T},1998:(e,t,o)=>{var a=o(5296);e.exports=a},2763:(e,t,o)=>{var a=o(7294),n=o(4184),i=o(5697),r=o(1289),E=function(e){var t=e.className,o=e.stream,i=e.statistics,E=a.useMemo((function(){var e;return"Ready"===i.type&&null!==(e=i.content)&&void 0!==e&&e.peers?i.content.peers:0}),[i]),s=a.useMemo((function(){var e;return"Ready"===i.type&&null!==(e=i.content)&&void 0!==e&&e.downloadSpeed?(i.content.downloadSpeed/1e3/1e3).toFixed(2):0}),[i]),_=a.useMemo((function(){var e;return"Ready"===i.type&&null!==(e=i.content)&&void 0!==e&&e.streamProgress?(100*i.content.streamProgress).toFixed(2):0}),[i]);return a.createElement("div",{className:n(t,r["statistics-menu-container"])},a.createElement("div",{className:r.title},"Statistics"),a.createElement("div",{className:r.stats},a.createElement("div",{className:r.stat},a.createElement("div",{className:r.label},"Peers"),a.createElement("div",{className:r.value},E)),a.createElement("div",{className:r.stat},a.createElement("div",{className:r.label},"Speed"),a.createElement("div",{className:r.value},s," MB/s")),a.createElement("div",{className:r.stat},a.createElement("div",{className:r.label},"Completed"),a.createElement("div",{className:r.value},_," %"))),a.createElement("div",{className:r["info-hash"]},a.createElement("div",{className:r.label},"Info Hash"),a.createElement("div",{className:r.value},o.infoHash)))};E.propTypes={className:i.string,stream:i.object,statistics:i.object},e.exports=E},4426:(e,t,o)=>{var a=o(2763);e.exports=a},569:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(5985).default,E=o(6590).Button,s=o(3283),_=function(e){var t=e.className,o=e.value,n=e.label,_=e.disabled,T=e.dataset,l=e.onChange,S=a.useCallback((function(e){"function"==typeof l&&l({type:"change",value:e.currentTarget.dataset.type,dataset:T,reactEvent:e,nativeEvent:e.nativeEvent})}),[T,l]);return a.createElement("div",{className:i(t,s["discrete-input-container"],{disabled:_})},a.createElement("div",{className:s.header},n),a.createElement("div",{className:s["input-container"],title:_?"".concat(n," is not configurable"):null},a.createElement(E,{className:i(s["button-container"],{disabled:_}),"data-type":"decrement",onClick:S},a.createElement(r,{className:s.icon,name:"remove"})),a.createElement("div",{className:s["option-label"],title:o},o),a.createElement(E,{className:i(s["button-container"],{disabled:_}),"data-type":"increment",onClick:S},a.createElement(r,{className:s.icon,name:"add"}))))};_.propTypes={className:n.string,value:n.string,label:n.string,disabled:n.bool,dataset:n.object,onChange:n.func},e.exports=_},3132:(e,t,o)=>{var a=o(569);e.exports=a},1346:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(6590),E=r.Button,s=r.CONSTANTS,_=r.comparatorWithPriorities,T=r.languageNames,l=o(3132),S=o(3889),u=o(6073).t,d={EMBEDDED:2,EXCLUSIVE:1},c={eng:1},I=a.memo((function(e){var t=a.useMemo((function(){return(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).reduce((function(e,t){var o=t.lang;return e.includes(o)||e.push(o),e}),[]).sort(_(c))}),[e.subtitlesTracks,e.extraSubtitlesTracks]),o=a.useMemo((function(){return"string"==typeof e.selectedSubtitlesTrackId?(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).reduce((function(t,o){var a=o.id,n=o.lang;return a===e.selectedSubtitlesTrackId?n:t}),null):"string"==typeof e.selectedExtraSubtitlesTrackId?(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).reduce((function(t,o){var a=o.id,n=o.lang;return a===e.selectedExtraSubtitlesTrackId?n:t}),null):null}),[e.subtitlesTracks,e.extraSubtitlesTracks,e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId]),n=a.useMemo((function(){return(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).filter((function(e){return e.lang===o})).sort((function(e,t){return _(d)(e.origin,t.origin)}))}),[e.subtitlesTracks,e.extraSubtitlesTracks,o]),r=a.useCallback((function(e){e.nativeEvent.subtitlesMenuClosePrevented=!0}),[]),I=a.useCallback((function(t){var o=(Array.isArray(e.subtitlesTracks)?e.subtitlesTracks:[]).concat(Array.isArray(e.extraSubtitlesTracks)?e.extraSubtitlesTracks:[]).filter((function(e){return e.lang===t.currentTarget.dataset.lang})).sort((function(e,t){return _(d)(e.origin,t.origin)})).shift();o?o.embedded?"function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(o.id):"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(o.id):("function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(null),"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(null))}),[e.subtitlesTracks,e.extraSubtitlesTracks,e.onSubtitlesTrackSelected,e.onExtraSubtitlesTrackSelected]),A=a.useCallback((function(t){"true"===t.currentTarget.dataset.embedded?"function"==typeof e.onSubtitlesTrackSelected&&e.onSubtitlesTrackSelected(t.currentTarget.dataset.id):"function"==typeof e.onExtraSubtitlesTrackSelected&&e.onExtraSubtitlesTrackSelected(t.currentTarget.dataset.id)}),[e.onSubtitlesTrackSelected,e.onExtraSubtitlesTrackSelected]),O=a.useCallback((function(t){var o="increment"===t.value?250:-250;if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.extraSubtitlesDelay&&!isNaN(e.extraSubtitlesDelay)){var a=e.extraSubtitlesDelay+o;"function"==typeof e.onExtraSubtitlesDelayChanged&&e.onExtraSubtitlesDelayChanged(a)}}),[e.selectedExtraSubtitlesTrackId,e.extraSubtitlesDelay,e.onExtraSubtitlesDelayChanged]),N=a.useCallback((function(t){var o="increment"===t.value?1:-1;if("string"==typeof e.selectedSubtitlesTrackId){if(null!==e.subtitlesSize&&!isNaN(e.subtitlesSize)){var a=s.SUBTITLES_SIZES.indexOf(e.subtitlesSize),n=s.SUBTITLES_SIZES[Math.max(0,Math.min(s.SUBTITLES_SIZES.length-1,a+o))];"function"==typeof e.onSubtitlesSizeChanged&&e.onSubtitlesSizeChanged(n)}}else if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.extraSubtitlesSize&&!isNaN(e.extraSubtitlesSize)){var i=s.SUBTITLES_SIZES.indexOf(e.extraSubtitlesSize),r=s.SUBTITLES_SIZES[Math.max(0,Math.min(s.SUBTITLES_SIZES.length-1,i+o))];"function"==typeof e.onExtraSubtitlesSizeChanged&&e.onExtraSubtitlesSizeChanged(r)}}),[e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId,e.subtitlesSize,e.extraSubtitlesSize,e.onSubtitlesSizeChanged,e.onExtraSubtitlesSizeChanged]),R=a.useCallback((function(t){var o="increment"===t.value?1:-1;if("string"==typeof e.selectedSubtitlesTrackId){if(null!==e.extraSubtitlesOffset&&!isNaN(e.extraSubtitlesOffset)){var a=Math.max(0,Math.min(100,Math.floor(e.extraSubtitlesOffset+o)));"function"==typeof e.onExtraSubtitlesOffsetChanged&&e.onExtraSubtitlesOffsetChanged(a)}}else if("string"==typeof e.selectedExtraSubtitlesTrackId&&null!==e.subtitlesOffset&&!isNaN(e.subtitlesOffset)){var n=Math.max(0,Math.min(100,Math.floor(e.subtitlesOffset+o)));"function"==typeof e.onSubtitlesOffsetChanged&&e.onSubtitlesOffsetChanged(n)}}),[e.selectedSubtitlesTrackId,e.selectedExtraSubtitlesTrackId,e.subtitlesOffset,e.extraSubtitlesOffset,e.onSubtitlesOffsetChanged,e.onExtraSubtitlesOffsetChanged]),m=a.useCallback((function(t){"function"==typeof e.onAudioTrackSelected&&e.onAudioTrackSelected(t.currentTarget.dataset.id)}),[e.onAudioTrackSelected]);return a.createElement("div",{className:i(e.className,S["subtitles-menu-container"]),onMouseDown:r},Array.isArray(e.audioTracks)&&e.audioTracks.length>1?a.createElement("div",{className:S["languages-container"]},a.createElement("div",{className:S["languages-header"]},"Audio Languages"),a.createElement("div",{className:S["languages-list"]},e.audioTracks.map((function(t,o){var n=t.id,r=t.label,s=t.lang;return a.createElement(E,{key:o,title:r,className:i(S["language-option"],{selected:e.selectedAudioTrackId===n}),"data-id":n,onClick:m},a.createElement("div",{className:S["language-label"]},"string"==typeof T[s]?T[s]:s),e.selectedAudioTrackId===n?a.createElement("div",{className:S.icon}):null)})))):null,a.createElement("div",{className:S["languages-container"]},a.createElement("div",{className:S["languages-header"]},u("PLAYER_SUBTITLES_LANGUAGES")),a.createElement("div",{className:S["languages-list"]},a.createElement(E,{title:u("OFF"),className:i(S["language-option"],{selected:null===o}),onClick:I},a.createElement("div",{className:S["language-label"]},u("OFF")),null===o?a.createElement("div",{className:S.icon}):null),t.map((function(e,t){return a.createElement(E,{key:t,title:"string"==typeof T[e]?T[e]:e,className:i(S["language-option"],{selected:o===e}),"data-lang":e,onClick:I},a.createElement("div",{className:S["language-label"]},"string"==typeof T[e]?T[e]:e),o===e?a.createElement("div",{className:S.icon}):null)})))),a.createElement("div",{className:S["variants-container"]},a.createElement("div",{className:S["variants-header"]},u("PLAYER_SUBTITLES_VARIANTS")),n.length>0?a.createElement("div",{className:S["variants-list"]},n.map((function(t,o){return a.createElement(E,{key:o,title:t.label,className:i(S["variant-option"],{selected:e.selectedSubtitlesTrackId===t.id||e.selectedExtraSubtitlesTrackId===t.id}),"data-id":t.id,"data-origin":t.origin,"data-embedded":t.embedded,onClick:A},a.createElement("div",{className:S["variant-label"]},t.origin),e.selectedSubtitlesTrackId===t.id||e.selectedExtraSubtitlesTrackId===t.id?a.createElement("div",{className:S.icon}):null)}))):a.createElement("div",{className:S["no-variants-container"]},a.createElement("div",{className:S["no-variants-label"]},u("PLAYER_SUBTITLES_DISABLED")))),a.createElement("div",{className:S["subtitles-settings-container"]},a.createElement("div",{className:S["settings-header"]},"Subtitles Settings"),a.createElement(l,{className:S["discrete-input"],label:u("DELAY"),value:"string"!=typeof e.selectedExtraSubtitlesTrackId||null===e.extraSubtitlesDelay||isNaN(e.extraSubtitlesDelay)?"--":"".concat((e.extraSubtitlesDelay/1e3).toFixed(2),"s"),disabled:"string"!=typeof e.selectedExtraSubtitlesTrackId||null===e.extraSubtitlesDelay||isNaN(e.extraSubtitlesDelay),onChange:O}),a.createElement(l,{className:S["discrete-input"],label:u("SIZE"),value:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesSize||isNaN(e.subtitlesSize)?"--":"".concat(e.subtitlesSize,"%"):"string"==typeof e.selectedExtraSubtitlesTrackId?null===e.extraSubtitlesSize||isNaN(e.extraSubtitlesSize)?"--":"".concat(e.extraSubtitlesSize,"%"):"--",disabled:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesSize||isNaN(e.subtitlesSize):"string"!=typeof e.selectedExtraSubtitlesTrackId||(null===e.extraSubtitlesSize||isNaN(e.extraSubtitlesSize)),onChange:N}),a.createElement(l,{className:S["discrete-input"],label:u("PLAYER_SUBTITLES_VERTICAL_POSIITON"),value:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesOffset||isNaN(e.subtitlesOffset)?"--":"".concat(e.subtitlesOffset,"%"):"string"==typeof e.selectedExtraSubtitlesTrackId?null===e.extraSubtitlesOffset||isNaN(e.extraSubtitlesOffset)?"--":"".concat(e.extraSubtitlesOffset,"%"):"--",disabled:"string"==typeof e.selectedSubtitlesTrackId?null===e.subtitlesOffset||isNaN(e.subtitlesOffset):"string"!=typeof e.selectedExtraSubtitlesTrackId||(null===e.extraSubtitlesOffset||isNaN(e.extraSubtitlesOffset)),onChange:R})))}));I.displayName="MainNavBars",I.propTypes={className:n.string,subtitlesTracks:n.arrayOf(n.shape({id:n.string.isRequired,lang:n.string.isRequired,origin:n.string.isRequired})),selectedSubtitlesTrackId:n.string,subtitlesOffset:n.number,subtitlesSize:n.number,extraSubtitlesTracks:n.arrayOf(n.shape({id:n.string.isRequired,lang:n.string.isRequired,origin:n.string.isRequired,label:n.string.isRequired})),selectedExtraSubtitlesTrackId:n.string,extraSubtitlesOffset:n.number,extraSubtitlesDelay:n.number,extraSubtitlesSize:n.number,audioTracks:n.arrayOf(n.shape({id:n.string.isRequired,lang:n.string.isRequired,origin:n.string.isRequired,label:n.string.isRequired})),selectedAudioTrackId:n.string,onSubtitlesTrackSelected:n.func,onExtraSubtitlesTrackSelected:n.func,onAudioTrackSelected:n.func,onSubtitlesOffsetChanged:n.func,onSubtitlesSizeChanged:n.func,onExtraSubtitlesOffsetChanged:n.func,onExtraSubtitlesDelayChanged:n.func,onExtraSubtitlesSizeChanged:n.func},e.exports=I},9646:(e,t,o)=>{var a=o(1346);e.exports=a},5245:(e,t,o)=>{var a=["className"];function n(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function i(e){for(var t=1;t=0||(n[o]=e[o]);return n})(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var s=o(7294),_=o(5697),T=o(4184),l=o(1654),S=o(6590).useLiveRef,u=o(4236),d=s.forwardRef((function(e,t){var o=e.className,n=E(e,a),r=S(n.onEnded),_=S(n.onError),d=S(n.onPropValue),c=S(n.onPropChanged),I=S(n.onSubtitlesTrackLoaded),A=S(n.onExtraSubtitlesTrackLoaded),O=S(n.onImplementationChanged),N=s.useRef(null),R=s.useRef(null),m=s.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==R.current)try{R.current.dispatch(e,i(i({},t),{},{containerElement:N.current}))}catch(e){console.error("Video",e)}}),[]);return s.useImperativeHandle(t,(function(){return{dispatch:m}}),[]),s.useEffect((function(){return null!==N.current&&(R.current=new l,R.current.on("ended",(function(){"function"==typeof r.current&&r.current()})),R.current.on("error",(function(e){"function"==typeof _.current&&_.current(e)})),R.current.on("propValue",(function(e,t){"function"==typeof d.current&&d.current(e,t)})),R.current.on("propChanged",(function(e,t){"function"==typeof c.current&&c.current(e,t)})),R.current.on("subtitlesTrackLoaded",(function(e){"function"==typeof I.current&&I.current(e)})),R.current.on("extraSubtitlesTrackLoaded",(function(e){"function"==typeof A.current&&A.current(e)})),R.current.on("implementationChanged",(function(e){"function"==typeof O.current&&O.current(e)}))),function(){R.current.destroy()}}),[]),s.createElement("div",{className:T(o,u["video-container"])},s.createElement("div",{ref:N,className:u.video}))}));d.displayName="Video",d.propTypes={className:_.string,onEnded:_.func,onError:_.func,onPropValue:_.func,onPropChanged:_.func,onSubtitlesTrackLoaded:_.func,onExtraSubtitlesTrackLoaded:_.func,onImplementationChanged:_.func},e.exports=d},5711:(e,t,o)=>{var a=o(5245);e.exports=a},4027:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(4184),r=o(123),E=o(674),s=function(e){var t=e.className,o=e.metaItem,n=e.seriesInfo,s=a.useCallback((function(e){e.nativeEvent.videosMenuClosePrevented=!0}),[]),_=a.useMemo((function(){return n&&"number"==typeof n.season&&Array.isArray(o.videos)?o.videos.filter((function(e){return e.season===n.season})):o.videos}),[o,n]);return a.createElement("div",{className:i(t,E["videos-menu-container"]),onMouseDown:s},_.map((function(e,t){return a.createElement(r,{key:t,id:e.id,title:e.title,thumbnail:e.thumbnail,episode:e.episode,released:e.released,upcoming:e.upcoming,watched:e.watched,progress:e.progress,deepLinks:e.deepLinks,scheduled:e.scheduled})})))};s.propTypes={className:n.string,metaItem:n.object,seriesInfo:n.shape({season:n.number,episode:n.number})},e.exports=s},6429:(e,t,o)=>{var a=o(4027);e.exports=a},7793:(e,t,o)=>{var a=o(2230);e.exports=a},5852:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(e,t){return(function(e){if(Array.isArray(e))return e})(e)||(function(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var a,n,i=[],r=!0,E=!1;try{for(o=o.call(e);!(r=(a=o.next()).done)&&(i.push(a.value),!t||i.length!==t);r=!0);}catch(e){E=!0,n=e}finally{try{r||null==o.return||o.return()}finally{if(E)throw n}}return i})(e,t)||(function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)})(e,t)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o{var a=o(4853);e.exports=a},4182:(e,t,o)=>{var a=o(7294),n=o(6590).useModelState,i=o(3662).useServices;e.exports=function(e){var t=i().core,o=a.useMemo((function(){return e.has("search")&&e.get("search").length>0?{action:"Load",args:{model:"CatalogsWithExtra",args:{extra:[["search",e.get("search")]]}}}:{action:"Unload"}}),[e]),r=a.useCallback((function(e){t.transport.dispatch({action:"CatalogsWithExtra",args:{action:"LoadRange",args:e}},"search")}),[]);return[n({model:"search",action:o}),r]}},5674:(e,t,o)=>{function a(){return a=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,a=new Array(t);o=Ne.current.scrollHeight-50)De(Le[Le.length-1].id);else for(var e=Le.length-1;e>=0;e--)if(Le[e].ref.current.offsetTop-Ne.current.offsetTop<=Ne.current.scrollTop){De(Le[e].id);break}}),[]),ve=E.useCallback((function(e){var t=Le.find((function(t){return t.id===e.currentTarget.dataset.section}));Ne.current.scrollTo({top:t.ref.current.offsetTop-Ne.current.offsetTop,behavior:"smooth"})}),[]),ye=E.useCallback(_((function(){ge()}),50),[]);return E.useEffect((function(){Se&&Te&&(t.transport.dispatch({action:"Ctx",args:{action:"InstallTraktAddon"}}),le(!1))}),[Se,Te]),E.useEffect((function(){null!==W.exportUrl&&"string"==typeof W.exportUrl&&window.open(W.exportUrl)}),[W.exportUrl]),E.useLayoutEffect((function(){r&&ge(),re()}),[r]),E.createElement(A,{className:y["settings-container"],route:"settings"},E.createElement("div",{className:s(y["settings-content"],"animation-fade-in")},E.createElement("div",{className:y["side-menu-container"]},E.createElement(c,{className:s(y["side-menu-button"],n({},y.selected,Ce===P)),title:e("SETTINGS_NAV_GENERAL"),"data-section":P,onClick:ve},e("SETTINGS_NAV_GENERAL")),E.createElement(c,{className:s(y["side-menu-button"],n({},y.selected,Ce===B)),title:e("SETTINGS_NAV_PLAYER"),"data-section":B,onClick:ve},e("SETTINGS_NAV_PLAYER")),E.createElement(c,{className:s(y["side-menu-button"],n({},y.selected,Ce===b)),title:e("SETTINGS_NAV_STREAMING"),"data-section":b,onClick:ve},e("SETTINGS_NAV_STREAMING")),E.createElement(c,{className:s(y["side-menu-button"],n({},y.selected,Ce===M)),title:e("SETTINGS_NAV_SHORTCUTS"),"data-section":M,onClick:ve},e("SETTINGS_NAV_SHORTCUTS")),E.createElement("div",{className:y.spacing}),E.createElement("div",{className:y["version-info-label"],title:"5.0.0-beta.0"},"App Version: ","5.0.0-beta.0"),null!==G.settings&&"Ready"===G.settings.type?E.createElement("div",{className:y["version-info-label"],title:G.settings.content.serverVersion},"Server Version: ",G.settings.content.serverVersion):null),E.createElement("div",{ref:Ne,className:y["sections-container"],onScroll:ye},E.createElement("div",{ref:Re,className:y["section-container"]},E.createElement("div",{className:s(y["option-container"],y["user-info-option-container"])},E.createElement("div",{className:y["user-info-content"]},E.createElement("div",{className:y["avatar-container"],style:{backgroundImage:null===d.auth?"url('".concat(o(3028),"')"):d.auth.user.avatar?"url('".concat(d.auth.user.avatar,"')"):"url('".concat(o(1251),"')")}}),E.createElement("div",{className:y["email-logout-container"]},E.createElement("div",{className:y["email-label-container"],title:null===d.auth?"Anonymous user":d.auth.user.email},E.createElement("div",{className:y["email-label"]},null===d.auth?"Anonymous user":d.auth.user.email)),null!==d.auth?E.createElement(c,{className:y["logout-button-container"],title:e("LOG_OUT"),onClick:de},E.createElement("div",{className:y["logout-label"]},e("LOG_OUT"))):null)),E.createElement(c,{className:y["user-panel-container"],title:"User panel",target:"_blank",href:"https://www.stremio.com/acc-settings"},E.createElement("div",{className:y["user-panel-label"]},e("USER_PANEL")))),null===d.auth?E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["button-container"]),title:"".concat(e("LOG_IN")," / ").concat(e("SIGN_UP")),href:"#/intro"},E.createElement("div",{className:y.label},e("LOG_IN")," / ",e("SIGN_UP")))):null,E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_INTERFACE_LANGUAGE"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"]),tabIndex:-1},w))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},"Trakt Scrobbling")),E.createElement(c,{className:s(y["option-input-container"],y["button-container"]),title:"Authenticate",disabled:null===d.auth,tabIndex:-1,onClick:ce},E.createElement(l,{className:y.icon,name:"trakt"}),E.createElement("div",{className:y.label},null!==d.auth&&null!==d.auth.user&&null!==d.auth.user.trakt?e("LOG_OUT"):e("SETTINGS_TRAKT_AUTHENTICATE")))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("Calendar"))),E.createElement(c,{className:s(y["option-input-container"],y["button-container"]),title:"Subscribe",disabled:!(d.auth&&d.auth.user&&d.auth.user._id),tabIndex:-1,onClick:Ie},E.createElement(l,{className:y.icon,name:"calendar"}),E.createElement("div",{className:y.label},e("SETTINGS_CALENDAR_SUBSCRIBE")))),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["link-container"]),title:e("SETTINGS_DATA_EXPORT"),tabIndex:-1,onClick:Ae},E.createElement("div",{className:y.label},e("SETTINGS_DATA_EXPORT")))),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["link-container"]),title:e("SETTINGS_SUPPORT"),target:"_blank",href:"https://stremio.zendesk.com/hc/en-us"},E.createElement("div",{className:y.label},e("SETTINGS_SUPPORT")))),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["link-container"]),title:"Source code",target:"_blank",href:"https://github.com/stremio/stremio-web/tree/".concat("aa236a26e03907d62a2aa7d4356502da09343532")},E.createElement("div",{className:y.label},"Source code"))),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["link-container"]),title:e("TERMS_OF_SERVICE"),target:"_blank",href:"https://www.stremio.com/tos"},E.createElement("div",{className:y.label},e("TERMS_OF_SERVICE")))),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["link-container"]),title:e("PRIVACY_POLICY"),target:"_blank",href:"https://www.stremio.com/privacy"},E.createElement("div",{className:y.label},e("PRIVACY_POLICY"))))),E.createElement("div",{ref:me,className:y["section-container"]},E.createElement("div",{className:y["section-title"]},e("SETTINGS_NAV_PLAYER")),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SUBTITLES_LANGUAGE"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},V))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SUBTITLES_SIZE"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},H))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SUBTITLES_COLOR"))),E.createElement(N,a({className:s(y["option-input-container"],y["color-input-container"])},Y))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SUBTITLES_COLOR_BACKGROUND"))),E.createElement(N,a({className:s(y["option-input-container"],y["color-input-container"])},z))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SUBTITLES_COLOR_OUTLINE"))),E.createElement(N,a({className:s(y["option-input-container"],y["color-input-container"])},x))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_DEFAULT_AUDIO_TRACK"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},K))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_REWIND_FAST_FORWARD_DURATION"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},j))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("AUTO_PLAY"))),E.createElement(I,a({className:s(y["option-input-container"],y["checkbox-container"])},$))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_NEXT_VIDEO_POPUP_DURATION"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"]),disabled:!d.settings.bingeWatching},X))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_PLAY_IN_BACKGROUND"))),E.createElement(I,a({className:s(y["option-input-container"],y["checkbox-container"]),disabled:!0,tabIndex:-1},q))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_PLAY_IN_EXTERNAL_PLAYER"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},Q))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_HWDEC"))),E.createElement(I,a({className:s(y["option-input-container"],y["checkbox-container"]),disabled:!0,tabIndex:-1},J)))),E.createElement("div",{ref:pe,className:y["section-container"]},E.createElement("div",{className:y["section-title"]},e("SETTINGS_NAV_STREAMING")),E.createElement("div",{className:y["option-container"]},E.createElement(c,{className:s(y["option-input-container"],y["button-container"]),title:"Reload",onClick:Oe},E.createElement("div",{className:y.label},e("RELOAD")))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("STATUS"))),E.createElement("div",{className:s(y["option-input-container"],y["info-container"])},E.createElement("div",{className:y.label},null===G.settings?"NotLoaded":"Ready"===G.settings.type?e("SETTINGS_SERVER_STATUS_ONLINE"):"Error"===G.settings.type?"".concat(e("SETTINGS_SERVER_STATUS_ERROR"),": (").concat(G.settings.content,")"):G.settings.type))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},"Url")),E.createElement("div",{className:s(y["option-input-container"],y["configure-input-container"])},E.createElement("div",{className:y.label,title:Z.value},Z.value),E.createElement(c,{className:y["configure-button-container"],title:"Configure server url",onClick:ie},E.createElement(l,{className:y.icon,name:"settings"})))),null!==te?E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SERVER_CACHE_SIZE"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},te))):null,null!==oe?E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SERVER_TORRENT_PROFILE"))),E.createElement(O,a({className:s(y["option-input-container"],y["multiselect-container"])},oe))):null),E.createElement("div",{ref:he,className:y["section-container"]},E.createElement("div",{className:y["section-title"]},e("SETTINGS_NAV_SHORTCUTS")),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_PLAY_PAUSE"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,e("SETTINGS_SHORTCUT_SPACE")))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_SEEK_FORWARD"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"→"),E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_OR")),E.createElement("kbd",null,"⇧ ",e("SETTINGS_SHORTCUT_SHIFT")),E.createElement("div",{className:y.label},"+"),E.createElement("kbd",null,"→"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_SEEK_BACKWARD"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"←"),E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_OR")),E.createElement("kbd",null,"⇧ ",e("SETTINGS_SHORTCUT_SHIFT")),E.createElement("div",{className:y.label},"+"),E.createElement("kbd",null,"←"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_VOLUME_UP"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"↑"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_VOLUME_DOWN"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"↓"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_MENU_SUBTITLES"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"S"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_MENU_INFO"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"I"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_FULLSCREEN"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"F"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_NAVIGATE_MENUS"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"1"),E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_TO")),E.createElement("kbd",null,"5"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_GO_TO_SEARCH"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,"0"))),E.createElement("div",{className:y["option-container"]},E.createElement("div",{className:y["option-name-container"]},E.createElement("div",{className:y.label},e("SETTINGS_SHORTCUT_EXIT_BACK"))),E.createElement("div",{className:s(y["option-input-container"],y["shortcut-container"])},E.createElement("kbd",null,e("SETTINGS_SHORTCUT_ESC"))))))),ne?E.createElement(m,{className:y["configure-server-url-modal-container"],title:e("SETTINGS_SERVER_CONFIGURE_TITLE"),buttons:ue,onCloseRequest:re},E.createElement(R,{ref:Ee,autoFocus:!0,className:y["server-url-input"],type:"text",defaultValue:Z.value,placeholder:e("SETTINGS_SERVER_CONFIGURE_INPUT"),onSubmit:se})):null)}),(function(){return E.createElement(A,{className:y["settings-container"],route:"settings"})}))},2465:(e,t,o)=>{var a=o(5674);e.exports=a},4137:(e,t,o)=>{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{function a(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function n(e){for(var t=1;t{var a=o(7165),n=o(8823),i=o(1901),r=o(7965),E=o(9005),s=o(353),_=o(6375),T=o(2465),l=o(7793),S=o(6732);e.exports={Addons:a,Board:n,Discover:i,Library:r,MetaDetails:E,NotFound:s,Search:_,Settings:T,Player:l,Intro:S}},1099:(e,t,o)=>{var a=o(6729),n=o(5482);e.exports=function(){var e=!1,t=null,o=!1,i=null,r=new a;function E(){e=!0,t=null,o=!1,_()}function s(a){console.error(a),e=!1,t=new Error("Google Cast API not available",{cause:a}),o=!1,_(),i=null}function _(){r.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}},error:{configurable:!1,enumerable:!0,get:function(){return t}},starting:{configurable:!1,enumerable:!0,get:function(){return o}},transport:{configurable:!1,enumerable:!0,get:function(){return i}}}),this.start=function(){e||t instanceof Error||o||(o=!0,(i=new n).on("init",E),i.on("init-error",s),_())},this.stop=function(){e=!1,t=null,o=!1,_(),null!==i&&(i.removeAllListeners(),i=null)},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)}}},5482:(e,t,o)=>{var a=o(6729),n=o(542),i="urn:x-cast:com.stremio",r=2e4,E=null,s=new a;window.__onGCastApiAvailable=function(e){delete window.__onGCastApiAvailable,E=!!e,s.emit("availabilityChanged")};e.exports=function(){var e=new a,t={};function o(o,a){try{var n=JSON.parse(a),i=n.id,r=n.chunk,E=n.index,s=n.length;if(t[i]=t[i]||[],t[i][E]=r,Object.keys(t[i]).length===s){var _=JSON.parse(t[i].join(""));delete t[i],e.emit("message",_)}}catch(t){e.emit("message-error",t)}}function _(t){e.emit(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,t)}function T(t){e.emit(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,t)}function l(t){e.emit(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,t)}function S(t){e.emit(cast.framework.CastSession.VOLUME_CHANGED,t)}function u(t){e.emit(cast.framework.CastSession.MEDIA_SESSION,t)}function d(t){e.emit(cast.framework.CastContextEventType.CAST_STATE_CHANGED,t)}function c(t){switch(e.emit(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,t),t.sessionState){case cast.framework.SessionState.SESSION_STARTED:t.session.addMessageListener(i,o),t.session.addEventListener(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,_),t.session.addEventListener(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,T),t.session.addEventListener(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,l),t.session.addEventListener(cast.framework.CastSession.VOLUME_CHANGED,S),t.session.addEventListener(cast.framework.CastSession.MEDIA_SESSION,u);break;case cast.framework.SessionState.SESSION_ENDED:t.session.removeMessageListener(i,o),t.session.removeEventListener(cast.framework.CastSession.APPLICATION_STATUS_CHANGED,_),t.session.removeEventListener(cast.framework.CastSession.APPLICATION_METADATA_CHANGED,T),t.session.removeEventListener(cast.framework.CastSession.ACTIVE_INPUT_STATE_CHANGED,l),t.session.removeEventListener(cast.framework.CastSession.VOLUME_CHANGED,S),t.session.removeEventListener(cast.framework.CastSession.MEDIA_SESSION,u)}}new Promise((function(e,t){function o(){s.off("availabilityChanged",o),E?e():t(new Error("window.cast api not available"))}null!==E?o():s.on("availabilityChanged",o)})).then((function(){cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,d),cast.framework.CastContext.getInstance().addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,c)})).then((function(){try{e.emit("init")}catch(e){console.error("ChromecastTransport",e)}})).catch((function(t){e.emit("init-error",t)})),this.on=function(t,o){e.on(t,o)},this.off=function(t,o){e.off(t,o)},this.removeAllListeners=function(){e.removeAllListeners()},this.getCastState=function(){return cast.framework.CastContext.getInstance().getCastState()},this.getSessionState=function(){return cast.framework.CastContext.getInstance().getSessionState()},this.getCastDevice=function(){var e=cast.framework.CastContext.getInstance().getCurrentSession();return null!==e?e.getCastDevice():null},this.setOptions=function(e){cast.framework.CastContext.getInstance().setOptions(e)},this.requestSession=function(){return cast.framework.CastContext.getInstance().requestSession()},this.endCurrentSession=function(e){cast.framework.CastContext.getInstance().endCurrentSession(e)},this.sendMessage=function(e){var t=cast.framework.CastContext.getInstance().getCurrentSession();if(null!==t){for(var o=JSON.stringify(e),a=Math.ceil(o.length/r),E=[],s=0;s{var a=o(1099);e.exports=a},6194:(e,t,o)=>{var a=o(6729),n=o(6806);e.exports=function(e){var t=!1,o=null,i=!1,r=null,E=new a;function s(){t=!0,o=null,i=!1,T()}function _(e){console.error(e),t=!1,o=new Error("Stremio Core Transport initialization failed",{cause:e}),i=!1,T(),r=null}function T(){E.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return t}},error:{configurable:!1,enumerable:!0,get:function(){return o}},starting:{configurable:!1,enumerable:!0,get:function(){return i}},transport:{configurable:!1,enumerable:!0,get:function(){return r}}}),this.start=function(){t||o instanceof Error||i||(i=!0,(r=new n(e)).on("init",s),r.on("error",_),T())},this.stop=function(){t=!1,o=null,i=!1,T(),null!==r&&(r.removeAllListeners(),r=null)},this.on=function(e,t){E.on(e,t)},this.off=function(e,t){E.off(e,t)}}},6806:(e,t,o)=>{function a(e,t,o,a,n,i,r){try{var E=e[i](r),s=E.value}catch(e){return void o(e)}E.done?t(s):Promise.resolve(s).then(a,n)}function n(e){return function(){var t=this,o=arguments;return new Promise((function(n,i){var r=e.apply(t,o);function E(e){a(r,n,i,E,s,"next",e)}function s(e){a(r,n,i,E,s,"throw",e)}E(void 0)}))}}var i=o(6729),r=o(6553);e.exports=function(e){var t=new i,o=new Worker("".concat("aa236a26e03907d62a2aa7d4356502da09343532","/scripts/worker.js")),a=new r(window,o);window.onCoreEvent=function(e){var o=e.name,a=e.args;try{t.emit(o,a)}catch(e){console.error("CoreTransport",e)}},a.call(["init"],[e]).then((function(){try{t.emit("init")}catch(e){console.error("CoreTransport",e)}})).catch((function(e){t.emit("error",e)})),this.on=function(e,o){t.on(e,o)},this.off=function(e,o){t.off(e,o)},this.removeAllListeners=function(){t.removeAllListeners()},this.getState=(function(){var e=n(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["getState"],[t]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),this.getDebugState=n(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["getDebugState"],[]));case 1:case"end":return e.stop()}}),e)}))),this.dispatch=(function(){var e=n(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["dispatch"],[t,o,location.hash]));case 1:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}})(),this.analytics=(function(){var e=n(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["analytics"],[t,location.hash]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})(),this.decodeStream=(function(){var e=n(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",a.call(["decodeStream"],[t]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}})()}},4937:(e,t,o)=>{var a=o(6194);e.exports=a},8634:(e,t,o)=>{function a(e,t,o,a,n,i,r){try{var E=e[i](r),s=E.value}catch(e){return void o(e)}E.done?t(s):Promise.resolve(s).then(a,n)}function n(e){return function(){var t=this,o=arguments;return new Promise((function(n,i){var r=e.apply(t,o);function E(e){a(r,n,i,E,s,"next",e)}function s(e){a(r,n,i,E,s,"throw",e)}E(void 0)}))}}var i=o(6729);e.exports=function(e){var t=e.core,o=!1,a=new i;function r(e){e.preventDefault()}function E(e){return s.apply(this,arguments)}function s(){return(s=n(regeneratorRuntime.mark((function e(o){var n,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.preventDefault(),!(o.dataTransfer.files instanceof FileList&&o.dataTransfer.files.length>0)){e.next=18;break}n=o.dataTransfer.files[0],e.t0=n.type,e.next="application/x-bittorrent"===e.t0?6:17;break;case 6:return e.prev=6,e.next=9,n.arrayBuffer();case 9:i=e.sent,t.transport.dispatch({action:"StreamingServer",args:{action:"CreateTorrent",args:Array.from(new Uint8Array(i))}}),e.next=16;break;case 13:e.prev=13,e.t1=e.catch(6),a.emit("error",{message:"Failed to process file",file:{name:n.name,type:n.type}});case 16:return e.abrupt("break",18);case 17:a.emit("error",{message:"Unsupported file",file:{name:n.name,type:n.type}});case 18:case"end":return e.stop()}}),e,null,[[6,13]])})))).apply(this,arguments)}function _(){a.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return o}}}),this.start=function(){o||(window.addEventListener("dragover",r),window.addEventListener("drop",E),o=!0,_())},this.stop=function(){window.removeEventListener("dragover",r),window.removeEventListener("drop",E),o=!1,_()},this.on=function(e,t){a.on(e,t)},this.off=function(e,t){a.off(e,t)}}},8500:(e,t,o)=>{var a=o(8634);e.exports=a},9093:(e,t,o)=>{var a=o(6729);e.exports=function(){var e=!1,t=new a;function o(e){if(!(e.keyboardShortcutPrevented||"INPUT"===e.target.tagName||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey))switch(e.code){case"Digit0":e.preventDefault(),window.location="#/search";break;case"Digit1":e.preventDefault(),window.location="#/";break;case"Digit2":e.preventDefault(),window.location="#/discover";break;case"Digit3":e.preventDefault(),window.location="#/library";break;case"Digit4":e.preventDefault(),window.location="#/settings";break;case"Digit5":e.preventDefault(),window.location="#/addons";break;case"Backspace":e.preventDefault(),e.ctrlKey?window.history.forward():window.history.back();break;case"KeyF":e.preventDefault(),document.fullscreenElement===document.documentElement?document.exitFullscreen():document.documentElement.requestFullscreen()}}function n(){t.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}}}),this.start=function(){e||(window.addEventListener("keydown",o),e=!0,n())},this.stop=function(){window.removeEventListener("keydown",o),e=!1,n()}}},7369:(e,t,o)=>{var a=o(9093);e.exports=a},2207:(e,t,o)=>{var a=o(7294).createContext({});a.displayName="ServicesContext",e.exports=a},8261:(e,t,o)=>{var a=o(7294),n=o(5697),i=o(2207),r=function(e){var t=e.services,o=void 0===t?{}:t,n=e.children;return a.createElement(i.Provider,{value:o},n)};r.propTypes={services:n.object,children:n.oneOfType([n.arrayOf(n.node),n.node])},e.exports=r},3487:(e,t,o)=>{var a=o(8261),n=o(1806);e.exports={ServicesProvider:a,useServices:n}},1806:(e,t,o)=>{var a=o(7294),n=o(2207);e.exports=function(){return a.useContext(n)}},3015:(e,t,o)=>{var a=o(6729),n=o(755);e.exports=function(){var e=!1,t=null,o=!1,i=null,r=new a;function E(){e=!0,t=null,o=!1,_()}function s(a){console.error(a),e=!1,t=new Error(a),o=!1,_(),i=null}function _(){r.emit("stateChanged")}Object.defineProperties(this,{active:{configurable:!1,enumerable:!0,get:function(){return e}},error:{configurable:!1,enumerable:!0,get:function(){return t}},starting:{configurable:!1,enumerable:!0,get:function(){return o}},transport:{configurable:!1,enumerable:!0,get:function(){return i}}}),this.start=function(){e||t instanceof Error||o||(e=!1,o=!0,(i=new n).on("init",E),i.on("init-error",s),_())},this.stop=function(){e=!1,t=null,o=!1,_()},this.on=function(e,t){r.on(e,t)},this.off=function(e,t){r.off(e,t)}}},755:(e,t,o)=>{var a=o(6729),n=!1,i=new a,r=1,E=3,s=6,_=7,T="transport";window.initShellComm=function(){delete window.initShellComm,i.emit("availabilityChanged")};e.exports=function(){var e=new a;this.props={};var t=this;(window.qt?new Promise((function(e){function t(){i.off("availabilityChanged",t),n=!0,e()}n?t():i.on("availabilityChanged",t)})):Promise.reject("Qt API not found")).then((function(){var o=window.qt&&window.qt.webChannelTransport;if(!o)throw"no viable transport found (qt.webChannelTransport)";var a=0;function n(e){e.id=a++,o.send(JSON.stringify(e))}o.onmessage=function(o){var a=JSON.parse(o.data);if(0===a.id){var i=a.data[T];i.properties.slice(1).forEach((function(e){t.props[e[1]]=e[3]})),"string"==typeof t.props.shellVersion&&(t.shellVersionArr=(t.props.shellVersion.match(/(\d+)\.(\d+)\.(\d+)/)||[]).slice(1,4).map(Number)),e.emit("received-props",t.props),i.signals.forEach((function(e){n({type:_,object:T,signal:e[1]})}));var E=i.methods.filter((function(e){return"onEvent"===e[0]}))[0];t.send=function(e,t){n({type:s,object:T,method:E[1],args:[e,t||{}]})},t.send("app-ready",{})}a.object===T&&a.type===r&&e.emit(a.args[0],a.args[1]),e.emit("init")},n({type:E})})).catch((function(t){e.emit("init-error",t)})),this.on=function(t,o){e.on(t,o)},this.off=function(t,o){e.off(t,o)},this.removeAllListeners=function(){e.removeAllListeners()}}},1921:(e,t,o)=>{var a=o(3015);e.exports=a},3662:(e,t,o)=>{var a=o(6623),n=o(4937),i=o(8500),r=o(7369),E=o(3487),s=E.ServicesProvider,_=E.useServices,T=o(1921);e.exports={Chromecast:a,Core:n,DragAndDrop:i,KeyboardShortcuts:r,ServicesProvider:s,useServices:_,Shell:T}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),o=t[0],a=t[1];return 3*(o+a)/4-a},t.toByteArray=function(e){var t,o,i=s(e),r=i[0],E=i[1],_=new n((function(e,t,o){return 3*(t+o)/4-o})(0,r,E)),T=0,l=E>0?r-4:r;for(o=0;o>16&255,_[T++]=t>>8&255,_[T++]=255&t;2===E&&(t=a[e.charCodeAt(o)]<<2|a[e.charCodeAt(o+1)]>>4,_[T++]=255&t);1===E&&(t=a[e.charCodeAt(o)]<<10|a[e.charCodeAt(o+1)]<<4|a[e.charCodeAt(o+2)]>>2,_[T++]=t>>8&255,_[T++]=255&t);return _},t.fromByteArray=function(e){for(var t,a=e.length,n=a%3,i=[],r=16383,E=0,s=a-n;Es?s:E+r));1===n?(t=e[a-1],i.push(o[t>>2]+o[t<<4&63]+"==")):2===n&&(t=(e[a-2]<<8)+e[a-1],i.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"="));return i.join("")};for(var o=[],a=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,E=i.length;r0)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.indexOf("=");return-1===o&&(o=t),[o,o===t?0:4-o%4]}function _(e,t,a){for(var n,i,r=[],E=t;E>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return r.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},7500:e=>{function t(e){return e.reduce(((e,t,o,a)=>{const n=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,o)=>o+e)))(...n))}),[])}e.exports=t,e.exports.parse=t,e.exports.compose=function(e){return e.reduce(((e,t,o,a)=>(0!==o&&t===a[o-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},1206:function(e){e.exports=(function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=90)})({17:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a=o(18),n=(function(){function e(){}return e.getFirstMatch=function(e,t){var o=t.match(e);return o&&o.length>0&&o[1]||""},e.getSecondMatch=function(e,t){var o=t.match(e);return o&&o.length>1&&o[2]||""},e.matchAndReturnConst=function(e,t,o){if(e.test(t))return o},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,o,a){void 0===a&&(a=!1);var n=e.getVersionPrecision(t),i=e.getVersionPrecision(o),r=Math.max(n,i),E=0,s=e.map([t,o],(function(t){var o=r-e.getVersionPrecision(t),a=t+new Array(o+1).join(".0");return e.map(a.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(a&&(E=r-Math.min(n,i)),r-=1;r>=E;){if(s[0][r]>s[1][r])return 1;if(s[0][r]===s[1][r]){if(r===E)return 0;r-=1}else if(s[0][r]1?n-1:0),r=1;r0){var r=Object.keys(o),s=E.default.find(r,(function(e){return t.isOS(e)}));if(s){var _=this.satisfies(o[s]);if(void 0!==_)return _}var T=E.default.find(r,(function(e){return t.isPlatform(e)}));if(T){var l=this.satisfies(o[T]);if(void 0!==l)return l}}if(i>0){var S=Object.keys(n),u=E.default.find(S,(function(e){return t.isBrowser(e,!0)}));if(void 0!==u)return this.compareVersion(n[u])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var o=this.getBrowserName().toLowerCase(),a=e.toLowerCase(),n=E.default.getBrowserTypeByAlias(a);return t&&n&&(a=n.toLowerCase()),a===o},t.compareVersion=function(e){var t=[0],o=e,a=!1,n=this.getBrowserVersion();if("string"==typeof n)return">"===e[0]||"<"===e[0]?(o=e.substr(1),"="===e[1]?(a=!0,o=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?o=e.substr(1):"~"===e[0]&&(a=!0,o=e.substr(1)),t.indexOf(E.default.compareVersions(n,o,a))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e})();t.default=_,e.exports=t.default},92:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,n=(a=o(17))&&a.__esModule?a:{default:a},i=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},o=n.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},o=n.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},o=n.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},o=n.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},o=n.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},o=n.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},o=n.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},o=n.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},o=n.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},o=n.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},o=n.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},o=n.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},o=n.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},o=n.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},o=n.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return o&&(t.version=o),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},o=n.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},o=n.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},o=n.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},o=n.default.getFirstMatch(i,e)||n.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},o=n.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},o=n.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},o=n.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},o=n.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},o=n.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},o=n.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},o=n.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},o=n.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},o=n.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){var t=!e.test(/like android/i),o=e.test(/android/i);return t&&o},describe:function(e){var t={name:"Android Browser"},o=n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},o=n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},o=n.default.getFirstMatch(i,e);return o&&(t.version=o),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:n.default.getFirstMatch(t,e),version:n.default.getSecondMatch(t,e)}}}];t.default=r,e.exports=t.default},93:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,n=(a=o(17))&&a.__esModule?a:{default:a},i=o(18),r=[{test:[/Roku\/DVP/],describe:function(e){var t=n.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:i.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=n.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=n.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),o=n.default.getWindowsVersionName(t);return{name:i.OS_MAP.Windows,version:t,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:i.OS_MAP.iOS},o=n.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return o&&(t.version=o),t}},{test:[/macintosh/i],describe:function(e){var t=n.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),o=n.default.getMacOSVersionName(t),a={name:i.OS_MAP.MacOS,version:t};return o&&(a.versionName=o),a}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=n.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),o=e.test(/android/i);return t&&o},describe:function(e){var t=n.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),o=n.default.getAndroidVersionName(t),a={name:i.OS_MAP.Android,version:t};return o&&(a.versionName=o),a}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=n.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),o={name:i.OS_MAP.WebOS};return t&&t.length&&(o.version=t),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=n.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||n.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||n.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:i.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=n.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=n.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=n.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:i.OS_MAP.PlayStation4,version:t}}}];t.default=r,e.exports=t.default},94:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,n=(a=o(17))&&a.__esModule?a:{default:a},i=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=n.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",o={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(o.model=t),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),o=e.test(/like (ipod|iphone)/i);return t&&!o},describe:function(e){var t=n.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];t.default=r,e.exports=t.default},95:function(e,t,o){"use strict";t.__esModule=!0,t.default=void 0;var a,n=(a=o(17))&&a.__esModule?a:{default:a},i=o(18),r=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:i.ENGINE_MAP.Blink};var t=n.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:i.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:i.ENGINE_MAP.Trident},o=n.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:i.ENGINE_MAP.Presto},o=n.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:function(e){var t=e.test(/gecko/i),o=e.test(/like gecko/i);return t&&!o},describe:function(e){var t={name:i.ENGINE_MAP.Gecko},o=n.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:i.ENGINE_MAP.WebKit},o=n.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return o&&(t.version=o),t}}];t.default=r,e.exports=t.default}})},8764:(e,t,o)=>{"use strict";const a=o(9742),n=o(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},t.INSPECT_MAX_BYTES=50;const r=2147483647;function E(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,o){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return _(e,t,o)}function _(e,t,o){if("string"==typeof e)return(function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const o=0|c(e,t);let a=E(o);const n=a.write(e,t);n!==o&&(a=a.slice(0,n));return a})(e,t);if(ArrayBuffer.isView(e))return(function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return u(t.buffer,t.byteOffset,t.byteLength)}return S(e)})(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return u(e,t,o);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return u(e,t,o);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return s.from(a,t,o);const n=(function(e){if(s.isBuffer(e)){const t=0|d(e.length),o=E(t);return 0===o.length||e.copy(o,0,0,t),o}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?E(0):S(e);if("Buffer"===e.type&&Array.isArray(e.data))return S(e.data)})(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function T(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return T(e),E(e<0?0:0|d(e))}function S(e){const t=e.length<0?0:0|d(e.length),o=E(t);for(let a=0;a=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function c(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const o=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===o)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*o;case"hex":return o>>>1;case"base64":return j(e).length;default:if(n)return a?-1:K(e).length;t=(""+t).toLowerCase(),n=!0}}function I(e,t,o){let a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===o||o>this.length)&&(o=this.length),o<=0)return"";if((o>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return y(this,t,o);case"utf8":case"utf-8":return C(this,t,o);case"ascii":return g(this,t,o);case"latin1":case"binary":return v(this,t,o);case"base64":return f(this,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,o);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function A(e,t,o){const a=e[t];e[t]=e[o],e[o]=a}function O(e,t,o,a,n){if(0===e.length)return-1;if("string"==typeof o?(a=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),$(o=+o)&&(o=n?0:e.length-1),o<0&&(o=e.length+o),o>=e.length){if(n)return-1;o=e.length-1}else if(o<0){if(!n)return-1;o=0}if("string"==typeof t&&(t=s.from(t,a)),s.isBuffer(t))return 0===t.length?-1:N(e,t,o,a,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,o):Uint8Array.prototype.lastIndexOf.call(e,t,o):N(e,[t],o,a,n);throw new TypeError("val must be string, number or Buffer")}function N(e,t,o,a,n){let i,r=1,E=e.length,s=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;r=2,E/=2,s/=2,o/=2}function _(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}if(n){let a=-1;for(i=o;iE&&(o=E-s),i=o;i>=0;i--){let o=!0;for(let a=0;an&&(a=n):a=n;const i=t.length;let r;for(a>i/2&&(a=i/2),r=0;r>8,n=o%256,i.push(n),i.push(a);return i})(t,e.length-o),e,o,a)}function f(e,t,o){return 0===t&&o===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,o))}function C(e,t,o){o=Math.min(e.length,o);const a=[];let n=t;for(;n239?4:t>223?3:t>191?2:1;if(n+r<=o){let o,a,E,s;switch(r){case 1:t<128&&(i=t);break;case 2:o=e[n+1],128==(192&o)&&(s=(31&t)<<6|63&o,s>127&&(i=s));break;case 3:o=e[n+1],a=e[n+2],128==(192&o)&&128==(192&a)&&(s=(15&t)<<12|(63&o)<<6|63&a,s>2047&&(s<55296||s>57343)&&(i=s));break;case 4:o=e[n+1],a=e[n+2],E=e[n+3],128==(192&o)&&128==(192&a)&&128==(192&E)&&(s=(15&t)<<18|(63&o)<<12|(63&a)<<6|63&E,s>65535&&s<1114112&&(i=s))}}null===i?(i=65533,r=1):i>65535&&(i-=65536,a.push(i>>>10&1023|55296),i=56320|1023&i),a.push(i),n+=r}return(function(e){const t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);let o="",a=0;for(;aa.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(a,n)):Uint8Array.prototype.set.call(a,t,n);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(a,n)}n+=t.length}return a},s.byteLength=c,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;to&&(e+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(e,t,o,a,n){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===o&&(o=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||o>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=o)return 0;if(a>=n)return-1;if(t>=o)return 1;if(this===e)return 0;let i=(n>>>=0)-(a>>>=0),r=(o>>>=0)-(t>>>=0);const E=Math.min(i,r),_=this.slice(a,n),T=e.slice(t,o);for(let e=0;e>>=0,isFinite(o)?(o>>>=0,void 0===a&&(a="utf8")):(a=o,o=void 0)}const n=this.length-t;if((void 0===o||o>n)&&(o=n),e.length>0&&(o<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");let i=!1;for(;;)switch(a){case"hex":return R(this,e,t,o);case"utf8":case"utf-8":return m(this,e,t,o);case"ascii":case"latin1":case"binary":return p(this,e,t,o);case"base64":return h(this,e,t,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,o);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const D=4096;function g(e,t,o){let a="";o=Math.min(e.length,o);for(let n=t;na)&&(o=a);let n="";for(let a=t;ao)throw new RangeError("Trying to access beyond buffer length")}function b(e,t,o,a,n,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function M(e,t,o,a,n){H(t,a,n,e,o,7);let i=Number(t&BigInt(4294967295));e[o++]=i,i>>=8,e[o++]=i,i>>=8,e[o++]=i,i>>=8,e[o++]=i;let r=Number(t>>BigInt(32)&BigInt(4294967295));return e[o++]=r,r>>=8,e[o++]=r,r>>=8,e[o++]=r,r>>=8,e[o++]=r,o}function W(e,t,o,a,n){H(t,a,n,e,o,7);let i=Number(t&BigInt(4294967295));e[o+7]=i,i>>=8,e[o+6]=i,i>>=8,e[o+5]=i,i>>=8,e[o+4]=i;let r=Number(t>>BigInt(32)&BigInt(4294967295));return e[o+3]=r,r>>=8,e[o+2]=r,r>>=8,e[o+1]=r,r>>=8,e[o]=r,o+8}function U(e,t,o,a,n,i){if(o+a>e.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function G(e,t,o,a,i){return t=+t,o>>>=0,i||U(e,0,o,4),n.write(e,t,o,a,23,4),o+4}function F(e,t,o,a,i){return t=+t,o>>>=0,i||U(e,0,o,8),n.write(e,t,o,a,52,8),o+8}s.prototype.slice=function(e,t){const o=this.length;(e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t>>=0,t>>>=0,o||B(e,t,this.length);let a=this[e],n=1,i=0;for(;++i>>=0,t>>>=0,o||B(e,t,this.length);let a=this[e+--t],n=1;for(;t>0&&(n*=256);)a+=this[e+--t]*n;return a},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=J((function(e){Y(e>>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+o*2**24;return BigInt(a)+(BigInt(n)<>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+o;return(BigInt(a)<>>=0,t>>>=0,o||B(e,t,this.length);let a=this[e],n=1,i=0;for(;++i=n&&(a-=Math.pow(2,8*t)),a},s.prototype.readIntBE=function(e,t,o){e>>>=0,t>>>=0,o||B(e,t,this.length);let a=t,n=1,i=this[e+--a];for(;a>0&&(n*=256);)i+=this[e+--a]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const o=this[e]|this[e+1]<<8;return 32768&o?4294901760|o:o},s.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const o=this[e+1]|this[e]<<8;return 32768&o?4294901760|o:o},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=J((function(e){Y(e>>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=this[e+4]+256*this[e+5]+65536*this[e+6]+(o<<24);return(BigInt(a)<>>=0,"offset");const t=this[e],o=this[e+7];void 0!==t&&void 0!==o||z(e,this.length-8);const a=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(a)<>>=0,t||B(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,o,a){if(e=+e,t>>>=0,o>>>=0,!a){b(this,e,t,o,Math.pow(2,8*o)-1,0)}let n=1,i=0;for(this[t]=255&e;++i>>=0,o>>>=0,!a){b(this,e,t,o,Math.pow(2,8*o)-1,0)}let n=o-1,i=1;for(this[t+n]=255&e;--n>=0&&(i*=256);)this[t+n]=e/i&255;return t+o},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=J((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=J((function(e,t=0){return W(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(e,t,o,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*o-1);b(this,e,t,o,a-1,-a)}let n=0,i=1,r=0;for(this[t]=255&e;++n>0)-r&255;return t+o},s.prototype.writeIntBE=function(e,t,o,a){if(e=+e,t>>>=0,!a){const a=Math.pow(2,8*o-1);b(this,e,t,o,a-1,-a)}let n=o-1,i=1,r=0;for(this[t+n]=255&e;--n>=0&&(i*=256);)e<0&&0===r&&0!==this[t+n+1]&&(r=1),this[t+n]=(e/i>>0)-r&255;return t+o},s.prototype.writeInt8=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,o){return e=+e,t>>>=0,o||b(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=J((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=J((function(e,t=0){return W(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(e,t,o){return G(this,e,t,!0,o)},s.prototype.writeFloatBE=function(e,t,o){return G(this,e,t,!1,o)},s.prototype.writeDoubleLE=function(e,t,o){return F(this,e,t,!0,o)},s.prototype.writeDoubleBE=function(e,t,o){return F(this,e,t,!1,o)},s.prototype.copy=function(e,t,o,a){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(o||(o=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t>>=0,o=void 0===o?this.length:o>>>0,e||(e=0),"number"==typeof e)for(n=t;n=a+4;o-=3)t=`_${e.slice(o-3,o)}${t}`;return`${e.slice(0,o)}${t}`}function H(e,t,o,a,n,i){if(e>o||e3?0===t||t===BigInt(0)?`>= 0${a} and < 2${a} ** ${8*(i+1)}${a}`:`>= -(2${a} ** ${8*(i+1)-1}${a}) and < 2 ** ${8*(i+1)-1}${a}`:`>= ${t}${a} and <= ${o}${a}`,new k.ERR_OUT_OF_RANGE("value",n,e)}!(function(e,t,o){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+o]||z(t,e.length-(o+1))})(a,n,i)}function Y(e,t){if("number"!=typeof e)throw new k.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,o){if(Math.floor(e)!==e)throw Y(e,o),new k.ERR_OUT_OF_RANGE(o||"offset","an integer",e);if(t<0)throw new k.ERR_BUFFER_OUT_OF_BOUNDS;throw new k.ERR_OUT_OF_RANGE(o||"offset",`>= ${o?1:0} and <= ${t}`,e)}w("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),w("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),w("ERR_OUT_OF_RANGE",(function(e,t,o){let a=`The value of "${e}" is out of range.`,n=o;return Number.isInteger(o)&&Math.abs(o)>2**32?n=V(String(o)):"bigint"==typeof o&&(n=String(o),(o>BigInt(2)**BigInt(32)||o<-(BigInt(2)**BigInt(32)))&&(n=V(n)),n+="n"),a+=` It must be ${t}. Received ${n}`,a}),RangeError);const x=/[^+/0-9A-Za-z-_]/g;function K(e,t){let o;t=t||1/0;const a=e.length;let n=null;const i=[];for(let r=0;r55295&&o<57344){if(!n){if(o>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(r+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=o;continue}if(o<56320){(t-=3)>-1&&i.push(239,191,189),n=o;continue}o=65536+(n-55296<<10|o-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,o<128){if((t-=1)<0)break;i.push(o)}else if(o<2048){if((t-=2)<0)break;i.push(o>>6|192,63&o|128)}else if(o<65536){if((t-=3)<0)break;i.push(o>>12|224,o>>6&63|128,63&o|128)}else{if(!(o<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}}return i}function j(e){return a.toByteArray((function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(e))}function Q(e,t,o,a){let n;for(n=0;n=t.length||n>=e.length);++n)t[n+o]=e[n];return n}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}const q=(function(){const e="0123456789abcdef",t=new Array(256);for(let o=0;o<16;++o){const a=16*o;for(let n=0;n<16;++n)t[a+n]=e[o]+e[n]}return t})();function J(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},4184:(e,t)=>{var o;!(function(){"use strict";var a={}.hasOwnProperty;function n(){for(var e=[],t=0;t{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},9818:(e,t,o)=>{var a=o(8874),n=o(1110),i=Object.hasOwnProperty,r=Object.create(null);for(var E in a)i.call(a,E)&&(r[a[E]]=E);var s=e.exports={to:{},get:{}};function _(e,t,o){return Math.min(Math.max(t,e),o)}function T(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}s.get=function(e){var t,o;switch(e.substring(0,3).toLowerCase()){case"hsl":t=s.get.hsl(e),o="hsl";break;case"hwb":t=s.get.hwb(e),o="hwb";break;default:t=s.get.rgb(e),o="rgb"}return t?{model:o,value:t}:null},s.get.rgb=function(e){if(!e)return null;var t,o,n,r=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=t[2],t=t[1],o=0;o<3;o++){var E=2*o;r[o]=parseInt(t.slice(E,E+2),16)}n&&(r[3]=parseInt(n,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(n=(t=t[1])[3],o=0;o<3;o++)r[o]=parseInt(t[o]+t[o],16);n&&(r[3]=parseInt(n+n,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(o=0;o<3;o++)r[o]=parseInt(t[o+1],0);t[4]&&(t[5]?r[3]=.01*parseFloat(t[4]):r[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:i.call(a,t[1])?((r=a[t[1]])[3]=1,r):null:null;for(o=0;o<3;o++)r[o]=Math.round(2.55*parseFloat(t[o+1]));t[4]&&(t[5]?r[3]=.01*parseFloat(t[4]):r[3]=parseFloat(t[4]))}for(o=0;o<3;o++)r[o]=_(r[o],0,255);return r[3]=_(r[3],0,1),r},s.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var o=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,_(parseFloat(t[2]),0,100),_(parseFloat(t[3]),0,100),_(isNaN(o)?1:o,0,1)]}return null},s.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var o=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,_(parseFloat(t[2]),0,100),_(parseFloat(t[3]),0,100),_(isNaN(o)?1:o,0,1)]}return null},s.to.hex=function(){var e=n(arguments);return"#"+T(e[0])+T(e[1])+T(e[2])+(e[3]<1?T(Math.round(255*e[3])):"")},s.to.rgb=function(){var e=n(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},s.to.rgb.percent=function(){var e=n(arguments),t=Math.round(e[0]/255*100),o=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+o+"%, "+a+"%)":"rgba("+t+"%, "+o+"%, "+a+"%, "+e[3]+")"},s.to.hsl=function(){var e=n(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},s.to.hwb=function(){var e=n(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},s.to.keyword=function(e){return r[e.slice(0,3)]}},6767:(e,t,o)=>{const a=o(9818),n=o(978),i=["keyword","gray","hex"],r={};for(const e of Object.keys(n))r[[...n[e].labels].sort().join("")]=e;const E={};function s(e,t){if(!(this instanceof s))return new s(e,t);if(t&&t in i&&(t=null),t&&!(t in n))throw new Error("Unknown model: "+t);let o,_;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof s)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=a.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,_=n[this.model].channels,this.color=t.value.slice(0,_),this.valpha="number"==typeof t.value[_]?t.value[_]:1}else if(e.length>0){this.model=t||"rgb",_=n[this.model].channels;const o=Array.prototype.slice.call(e,0,_);this.color=S(o,_),this.valpha="number"==typeof e[_]?e[_]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const a=t.sort().join("");if(!(a in r))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=r[a];const{labels:i}=n[this.model],E=[];for(o=0;o(e%360+360)%360)),saturationl:T("hsl",1,l(100)),lightness:T("hsl",2,l(100)),saturationv:T("hsv",1,l(100)),value:T("hsv",2,l(100)),chroma:T("hcg",1,l(100)),gray:T("hcg",2,l(100)),white:T("hwb",1,l(100)),wblack:T("hwb",2,l(100)),cyan:T("cmyk",0,l(100)),magenta:T("cmyk",1,l(100)),yellow:T("cmyk",2,l(100)),black:T("cmyk",3,l(100)),x:T("xyz",0,l(95.047)),y:T("xyz",1,l(100)),z:T("xyz",2,l(108.833)),l:T("lab",0,l(100)),a:T("lab",1),b:T("lab",2),keyword(e){return void 0!==e?new s(e):n[this.model].keyword(this.color)},hex(e){return void 0!==e?new s(e):a.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new s(e);const t=this.rgb().round().color;let o=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===o.length&&(o="0"+o),a.to.hex(t)+o},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[o,a]of e.entries()){const e=a/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),o=e.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return s.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let o=t.color[0];return o=(o+e)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const o=e.rgb(),a=this.rgb(),n=void 0===t?.5:t,i=2*n-1,r=o.alpha()-a.alpha(),E=((i*r==-1?i:(i+r)/(1+i*r))+1)/2,_=1-E;return s.rgb(E*o.red()+_*a.red(),E*o.green()+_*a.green(),E*o.blue()+_*a.blue(),o.alpha()*n+a.alpha()*(1-n))}};for(const e of Object.keys(n)){if(i.includes(e))continue;const{channels:t}=n[e];s.prototype[e]=function(...t){return this.model===e?new s(this):t.length>0?new s(t,e):new s([...(o=n[this.model][e].raw(this.color),Array.isArray(o)?o:[o]),this.valpha],e);var o},s[e]=function(...o){let a=o[0];return"number"==typeof a&&(a=S(o,t)),new s(a,e)}}function _(e){return function(t){return(function(e,t){return Number(e.toFixed(t))})(t,e)}}function T(e,t,o){e=Array.isArray(e)?e:[e];for(const a of e)(E[a]||(E[a]=[]))[t]=o;return e=e[0],function(a){let n;return void 0!==a?(o&&(a=o(a)),n=this[e](),n.color[t]=a,n):(n=this[e]().color[t],o&&(n=o(n)),n)}}function l(e){return function(t){return Math.max(0,Math.min(e,t))}}function S(e,t){for(let o=0;o{const a=o(8900),n={};for(const e of Object.keys(a))n[a[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:o}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:o})}i.rgb.hsl=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,n=Math.min(t,o,a),i=Math.max(t,o,a),r=i-n;let E,s;i===n?E=0:t===i?E=(o-a)/r:o===i?E=2+(a-t)/r:a===i&&(E=4+(t-o)/r),E=Math.min(60*E,360),E<0&&(E+=360);const _=(n+i)/2;return s=i===n?0:_<=.5?r/(i+n):r/(2-i-n),[E,100*s,100*_]},i.rgb.hsv=function(e){let t,o,a,n,i;const r=e[0]/255,E=e[1]/255,s=e[2]/255,_=Math.max(r,E,s),T=_-Math.min(r,E,s),l=function(e){return(_-e)/6/T+.5};return 0===T?(n=0,i=0):(i=T/_,t=l(r),o=l(E),a=l(s),r===_?n=a-o:E===_?n=1/3+t-a:s===_&&(n=2/3+o-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*i,100*_]},i.rgb.hwb=function(e){const t=e[0],o=e[1];let a=e[2];const n=i.rgb.hsl(e)[0],r=1/255*Math.min(t,Math.min(o,a));return a=1-1/255*Math.max(t,Math.max(o,a)),[n,100*r,100*a]},i.rgb.cmyk=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,n=Math.min(1-t,1-o,1-a);return[100*((1-t-n)/(1-n)||0),100*((1-o-n)/(1-n)||0),100*((1-a-n)/(1-n)||0),100*n]},i.rgb.keyword=function(e){const t=n[e];if(t)return t;let o,i=1/0;for(const t of Object.keys(a)){const n=a[t],s=(E=n,((r=e)[0]-E[0])**2+(r[1]-E[1])**2+(r[2]-E[2])**2);s.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;return[100*(.4124*t+.3576*o+.1805*a),100*(.2126*t+.7152*o+.0722*a),100*(.0193*t+.1192*o+.9505*a)]},i.rgb.lab=function(e){const t=i.rgb.xyz(e);let o=t[0],a=t[1],n=t[2];o/=95.047,a/=100,n/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;return[116*a-16,500*(o-a),200*(a-n)]},i.hsl.rgb=function(e){const t=e[0]/360,o=e[1]/100,a=e[2]/100;let n,i,r;if(0===o)return r=255*a,[r,r,r];n=a<.5?a*(1+o):a+o-a*o;const E=2*a-n,s=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,r=6*i<1?E+6*(n-E)*i:2*i<1?n:3*i<2?E+(n-E)*(2/3-i)*6:E,s[e]=255*r;return s},i.hsl.hsv=function(e){const t=e[0];let o=e[1]/100,a=e[2]/100,n=o;const i=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,n*=i<=1?i:2-i;return[t,100*(0===a?2*n/(i+n):2*o/(a+o)),100*((a+o)/2)]},i.hsv.rgb=function(e){const t=e[0]/60,o=e[1]/100;let a=e[2]/100;const n=Math.floor(t)%6,i=t-Math.floor(t),r=255*a*(1-o),E=255*a*(1-o*i),s=255*a*(1-o*(1-i));switch(a*=255,n){case 0:return[a,s,r];case 1:return[E,a,r];case 2:return[r,a,s];case 3:return[r,E,a];case 4:return[s,r,a];case 5:return[a,r,E]}},i.hsv.hsl=function(e){const t=e[0],o=e[1]/100,a=e[2]/100,n=Math.max(a,.01);let i,r;r=(2-o)*a;const E=(2-o)*n;return i=o*n,i/=E<=1?E:2-E,i=i||0,r/=2,[t,100*i,100*r]},i.hwb.rgb=function(e){const t=e[0]/360;let o=e[1]/100,a=e[2]/100;const n=o+a;let i;n>1&&(o/=n,a/=n);const r=Math.floor(6*t),E=1-a;i=6*t-r,0!=(1&r)&&(i=1-i);const s=o+i*(E-o);let _,T,l;switch(r){default:_=E,T=s,l=o;break;case 1:_=s,T=E,l=o;break;case 2:_=o,T=E,l=s;break;case 3:_=o,T=s,l=E;break;case 4:_=s,T=o,l=E;break;case 5:_=E,T=o,l=s}return[255*_,255*T,255*l]},i.cmyk.rgb=function(e){const t=e[0]/100,o=e[1]/100,a=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n)),255*(1-Math.min(1,a*(1-n)+n))]},i.xyz.rgb=function(e){const t=e[0]/100,o=e[1]/100,a=e[2]/100;let n,i,r;return n=3.2406*t+-1.5372*o+-.4986*a,i=-.9689*t+1.8758*o+.0415*a,r=.0557*t+-.204*o+1.057*a,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),r=Math.min(Math.max(0,r),1),[255*n,255*i,255*r]},i.xyz.lab=function(e){let t=e[0],o=e[1],a=e[2];t/=95.047,o/=100,a/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;return[116*o-16,500*(t-o),200*(o-a)]},i.lab.xyz=function(e){let t,o,a;o=(e[0]+16)/116,t=e[1]/500+o,a=o-e[2]/200;const n=o**3,i=t**3,r=a**3;return o=n>.008856?n:(o-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,a=r>.008856?r:(a-16/116)/7.787,t*=95.047,o*=100,a*=108.883,[t,o,a]},i.lab.lch=function(e){const t=e[0],o=e[1],a=e[2];let n;n=360*Math.atan2(a,o)/2/Math.PI,n<0&&(n+=360);return[t,Math.sqrt(o*o+a*a),n]},i.lch.lab=function(e){const t=e[0],o=e[1],a=e[2]/360*2*Math.PI;return[t,o*Math.cos(a),o*Math.sin(a)]},i.rgb.ansi16=function(e,t=null){const[o,a,n]=e;let r=null===t?i.rgb.hsv(e)[2]:t;if(r=Math.round(r/50),0===r)return 30;let E=30+(Math.round(n/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return 2===r&&(E+=60),E},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){const t=e[0],o=e[1],a=e[2];if(t===o&&o===a)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const o=.5*(1+~~(e>50));return[(1&t)*o*255,(t>>1&1)*o*255,(t>>2&1)*o*255]},i.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let o=t[0];3===t[0].length&&(o=o.split("").map((e=>e+e)).join(""));const a=parseInt(o,16);return[a>>16&255,a>>8&255,255&a]},i.rgb.hcg=function(e){const t=e[0]/255,o=e[1]/255,a=e[2]/255,n=Math.max(Math.max(t,o),a),i=Math.min(Math.min(t,o),a),r=n-i;let E,s;return E=r<1?i/(1-r):0,s=r<=0?0:n===t?(o-a)/r%6:n===o?2+(a-t)/r:4+(t-o)/r,s/=6,s%=1,[360*s,100*r,100*E]},i.hsl.hcg=function(e){const t=e[1]/100,o=e[2]/100,a=o<.5?2*t*o:2*t*(1-o);let n=0;return a<1&&(n=(o-.5*a)/(1-a)),[e[0],100*a,100*n]},i.hsv.hcg=function(e){const t=e[1]/100,o=e[2]/100,a=t*o;let n=0;return a<1&&(n=(o-a)/(1-a)),[e[0],100*a,100*n]},i.hcg.rgb=function(e){const t=e[0]/360,o=e[1]/100,a=e[2]/100;if(0===o)return[255*a,255*a,255*a];const n=[0,0,0],i=t%1*6,r=i%1,E=1-r;let s=0;switch(Math.floor(i)){case 0:n[0]=1,n[1]=r,n[2]=0;break;case 1:n[0]=E,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=r;break;case 3:n[0]=0,n[1]=E,n[2]=1;break;case 4:n[0]=r,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=E}return s=(1-o)*a,[255*(o*n[0]+s),255*(o*n[1]+s),255*(o*n[2]+s)]},i.hcg.hsv=function(e){const t=e[1]/100,o=t+e[2]/100*(1-t);let a=0;return o>0&&(a=t/o),[e[0],100*a,100*o]},i.hcg.hsl=function(e){const t=e[1]/100,o=e[2]/100*(1-t)+.5*t;let a=0;return o>0&&o<.5?a=t/(2*o):o>=.5&&o<1&&(a=t/(2*(1-o))),[e[0],100*a,100*o]},i.hcg.hwb=function(e){const t=e[1]/100,o=t+e[2]/100*(1-t);return[e[0],100*(o-t),100*(1-o)]},i.hwb.hcg=function(e){const t=e[1]/100,o=1-e[2]/100,a=o-t;let n=0;return a<1&&(n=(o-a)/(1-a)),[e[0],100*a,100*n]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(o.length)+o},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},978:(e,t,o)=>{const a=o(2956),n=o(7774),i={};Object.keys(a).forEach((e=>{i[e]={},Object.defineProperty(i[e],"channels",{value:a[e].channels}),Object.defineProperty(i[e],"labels",{value:a[e].labels});const t=n(e);Object.keys(t).forEach((o=>{const a=t[o];i[e][o]=(function(e){const t=function(...t){const o=t[0];if(null==o)return o;o.length>1&&(t=o);const a=e(t);if("object"==typeof a)for(let e=a.length,t=0;t1&&(t=o),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t})(a)}))})),e.exports=i},7774:(e,t,o)=>{const a=o(2956);function n(e){const t=(function(){const e={},t=Object.keys(a);for(let o=t.length,a=0;a{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},2682:e=>{e.exports=function e(t){return Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(o){!t.hasOwnProperty(o)||null===t[o]||"object"!=typeof t[o]&&"function"!=typeof t[o]||Object.isFrozen(t[o])||e(t[o])})),t}},6729:e=>{"use strict";var t=Object.prototype.hasOwnProperty,o="~";function a(){}function n(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function i(e,t,a,i,r){if("function"!=typeof a)throw new TypeError("The listener must be a function");var E=new n(a,i||e,r),s=o?o+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],E]:e._events[s].push(E):(e._events[s]=E,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new a:delete e._events[t]}function E(){this._events=new a,this._eventsCount=0}Object.create&&(a.prototype=Object.create(null),(new a).__proto__||(o=!1)),E.prototype.eventNames=function(){var e,a,n=[];if(0===this._eventsCount)return n;for(a in e=this._events)t.call(e,a)&&n.push(o?a.slice(1):a);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},E.prototype.listeners=function(e){var t=o?o+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var n=0,i=a.length,r=new Array(i);n{"use strict";t.Z=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&E(o)&&(t[o]=e[o]);return t};var a,n=o(2047),i=(a=n)&&a.__esModule?a:{default:a};var r={onCopy:!0,onCut:!0,onPaste:!0,onLoad:!0,onError:!0,onWheel:!0,onScroll:!0,onCompositionEnd:!0,onCompositionStart:!0,onCompositionUpdate:!0,onKeyDown:!0,onKeyPress:!0,onKeyUp:!0,onFocus:!0,onBlur:!0,onChange:!0,onInput:!0,onSubmit:!0,onClick:!0,onContextMenu:!0,onDoubleClick:!0,onDrag:!0,onDragEnd:!0,onDragEnter:!0,onDragExit:!0,onDragLeave:!0,onDragOver:!0,onDragStart:!0,onDrop:!0,onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOut:!0,onMouseOver:!0,onMouseUp:!0,onSelect:!0,onTouchCancel:!0,onTouchEnd:!0,onTouchMove:!0,onTouchStart:!0,onAnimationStart:!0,onAnimationEnd:!0,onAnimationIteration:!0,onTransitionEnd:!0};function E(e){return r[e]||i.default[e]||/^(data|aria)-/.test(e)}},542:e=>{var t=e.exports=function(e,o){if(o||(o=16),void 0===e&&(e=128),e<=0)return"0";for(var a=Math.log(Math.pow(2,e))/Math.log(o),n=2;a===1/0;n*=2)a=Math.log(Math.pow(2,e/n))/Math.log(o)*n;var i=a-Math.floor(a),r="";for(n=0;n=Math.pow(2,e)?t(e,o):r};t.rack=function(e,o,a){var n=function(n){var r=0;do{if(r++>10){if(!a)throw new Error("too many ID collisions, use more bits");e+=a}var E=t(e,o)}while(Object.hasOwnProperty.call(i,E));return i[E]=n,E},i=n.hats={};return n.get=function(e){return n.hats[e]},n.set=function(e,t){return n.hats[e]=t,n},n.bits=e||128,n.base=o||16,n}},7631:function(e){var t;"undefined"!=typeof window&&(t=function(){return(function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s="./src/hls.ts")})({"./node_modules/eventemitter3/index.js":function(e,t,o){"use strict";var a=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function E(e,t,o,a,i){if("function"!=typeof o)throw new TypeError("The listener must be a function");var E=new r(o,a||e,i),s=n?n+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],E]:e._events[s].push(E):(e._events[s]=E,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function _(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),_.prototype.eventNames=function(){var e,t,o=[];if(0===this._eventsCount)return o;for(t in e=this._events)a.call(e,t)&&o.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(e)):o},_.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var a=0,i=o.length,r=new Array(i);a0}),!1)}e.exports=function(e,t){t=t||{};var n={main:o.m},i=t.all?{main:Object.keys(n.main)}:(function(e,t){for(var o={main:[t]},a={main:[]},n={main:{}};s(o);)for(var i=Object.keys(o),r=0;r=2*l/u||N<=m)){var p,h=Number.POSITIVE_INFINITY;for(p=e.level-1;p>c&&!((h=l*d[p].maxBitrate/(6.4*O))=N)){var L=this.bwEstimator.getEstimate();_.logger.warn("Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+p+"\n Current BW estimate: "+(Object(a.isFiniteNumber)(L)?(L/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+N.toFixed(3)+" s\n Estimated load time for the next fragment: "+h.toFixed(3)+" s\n Time to underbuffer: "+m.toFixed(3)+" s"),o.nextLoadLevel=p,this.bwEstimator.sample(S,T.loaded),this.clearTimer(),e.loader&&(this.fragCurrent=this.partCurrent=null,e.loader.abort()),o.trigger(i.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:T})}}}}}},S.onFragLoaded=function(e,t){var o=t.frag,n=t.part;if(o.type===s.PlaylistLevelType.MAIN&&Object(a.isFiniteNumber)(o.sn)){var r=n?n.stats:o.stats,E=n?n.duration:o.duration;if(this.clearTimer(),this.lastLoadedFragLevel=o.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var _=this.hls.levels[o.level],T=(_.loaded?_.loaded.bytes:0)+r.loaded,l=(_.loaded?_.loaded.duration:0)+E;_.loaded={bytes:T,duration:l},_.realBitrate=Math.round(8*T/l)}if(o.bitrateTest){var S={stats:r,frag:o,part:n,id:o.type};this.onFragBuffered(i.Events.FRAG_BUFFERED,S)}}},S.onFragBuffered=function(e,t){var o=t.frag,a=t.part,n=a?a.stats:o.stats;if(!n.aborted&&o.type===s.PlaylistLevelType.MAIN&&"initSegment"!==o.sn){var i=n.parsing.end-n.loading.start;this.bwEstimator.sample(i,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),o.bitrateTest?this.bitrateTestDelay=i/1e3:this.bitrateTestDelay=0}},S.onError=function(e,t){switch(t.details){case E.ErrorDetails.FRAG_LOAD_ERROR:case E.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},S.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},S.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,o=this.hls,a=o.maxAutoLevel,n=o.config,i=o.minAutoLevel,E=o.media,s=t?t.duration:e?e.duration:0,T=E?E.currentTime:0,l=E&&0!==E.playbackRate?Math.abs(E.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,u=(r.BufferHelper.bufferInfo(E,T,n.maxBufferHole).end-T)/l,d=this.findBestLevel(S,i,a,u,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(d>=0)return d;_.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var c=s?Math.min(s,n.maxStarvationDelay):n.maxStarvationDelay,I=n.abrBandWidthFactor,A=n.abrBandWidthUpFactor;if(!u){var O=this.bitrateTestDelay;O&&(c=(s?Math.min(s,n.maxLoadingDelay):n.maxLoadingDelay)-O,_.logger.trace("bitrate test took "+Math.round(1e3*O)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*c)+" ms"),I=A=1)}return d=this.findBestLevel(S,i,a,u+c,I,A),Math.max(d,0)},S.findBestLevel=function(e,t,o,a,n,i){for(var r,E=this.fragCurrent,s=this.partCurrent,T=this.lastLoadedFragLevel,l=this.hls.levels,S=l[T],u=!(null==S||null===(r=S.details)||void 0===r||!r.live),d=null==S?void 0:S.codecSet,c=s?s.duration:E?E.duration:0,I=o;I>=t;I--){var A=l[I];if(A&&(!d||A.codecSet===d)){var O=A.details,N=(s?null==O?void 0:O.partTarget:null==O?void 0:O.averagetargetduration)||c,R=void 0;R=I<=T?n*e:i*e;var m=l[I].maxBitrate,p=m*N/R;if(_.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+I+"/"+Math.round(R)+"/"+m+"/"+N+"/"+a+"/"+p),R>m&&(!p||u&&!this.bitrateTestDelay||p0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t,this.state=n.State.IDLE):(this.loadedmetadata=!1,this.state=n.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},R.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_TRACK:var t,o=this.levels,a=this.trackId,i=null==o||null===(t=o[a])||void 0===t?void 0:t.details;if(i){if(this.waitForCdnTuneIn(i))break;this.state=n.State.WAITING_INIT_PTS}break;case n.State.FRAG_LOADING_WAITING_RETRY:var E,s=performance.now(),_=this.retryDate;(!_||s>=_||null!==(E=this.media)&&void 0!==E&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=n.State.IDLE);break;case n.State.WAITING_INIT_PTS:var T=this.waitingData;if(T){var l=T.frag,S=T.part,u=T.cache,c=T.complete;if(void 0!==this.initPTS[l.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.FRAG_LOADING;var I={frag:l,part:S,payload:u.flush(),networkDetails:null};this._handleFragmentLoadProgress(I),c&&e.prototype._handleFragmentLoadComplete.call(this,I)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+l.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var A=this.getLoadPosition(),O=r.BufferHelper.bufferInfo(this.mediaBuffer,A,this.config.maxBufferHole);Object(d.fragmentWithinToleranceTest)(O.end,this.config.maxFragLookUpTolerance,l)<0&&(this.log("Waiting fragment cc ("+l.cc+") @ "+l.start+" cancelled because another fragment at "+O.end+" is needed"),this.clearWaitingFragment())}}else this.state=n.State.IDLE}this.onTickEnd()},R.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.IDLE)},R.resetLoadingState=function(){this.clearWaitingFragment(),e.prototype.resetLoadingState.call(this)},R.onTickEnd=function(){var e=this.media;if(e&&e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length&&(this.loadedmetadata=!0),this.lastCurrentTime=e.currentTime}},R.doTickIdle=function(){var e,t,o=this.hls,a=this.levels,r=this.media,E=this.trackId,s=o.config;if(a&&a[E]&&(r||!this.startFragRequested&&s.startFragPrefetch)){var l=a[E].details;if(!l||l.live&&this.levelLastLoaded!==E||this.waitForCdnTuneIn(l))this.state=n.State.WAITING_TRACK;else{var S=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&S&&(this.bufferFlushed=!1,this.afterBufferFlushed(S,T.ElementaryStreamTypes.AUDIO,_.PlaylistLevelType.AUDIO));var u=this.getFwdBufferInfo(S,_.PlaylistLevelType.AUDIO);if(null!==u){var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,_.PlaylistLevelType.MAIN),c=u.len,I=this.getMaxBufferLength(null==d?void 0:d.len),A=this.audioSwitch;if(!(c>=I)||A){if(!A&&this._streamEnded(u,l))return o.trigger(i.Events.BUFFER_EOS,{type:"audio"}),void(this.state=n.State.ENDED);var O=l.fragments[0].start,N=u.end;if(A&&r){var R=this.getLoadPosition();N=R,l.PTSKnown&&RO||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=O+.05)}if(!(d&&N>d.end+l.targetduration)&&(d&&d.len||!u.len)){var m=this.getNextFragment(N,l);m?"identity"!==(null===(e=m.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=m.decryptdata)&&void 0!==t&&t.key?this.loadFragment(m,l,N):this.loadKey(m,l):this.bufferFlushed=!0}}}}}},R.getMaxBufferLength=function(t){var o=e.prototype.getMaxBufferLength.call(this);return t?Math.max(o,t):o},R.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},R.onAudioTracksUpdated=function(e,t){var o=t.audioTracks;this.resetTransmuxer(),this.levels=o.map((function(e){return new s.Level(e)}))},R.onAudioTrackSwitching=function(e,t){var o=!!t.url;this.trackId=t.id;var a=this.fragCurrent;null!=a&&a.loader&&a.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),o?this.setInterval(100):this.resetTransmuxer(),o?(this.audioSwitch=!0,this.state=n.State.IDLE):this.state=n.State.STOPPED,this.tick()},R.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},R.onLevelLoaded=function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},R.onAudioTrackLoaded=function(e,t){var o;if(null!=this.mainDetails){var a=this.levels,i=t.details,r=t.id;if(a){this.log("Track "+r+" loaded ["+i.startSN+","+i.endSN+"],duration:"+i.totalduration);var E=a[r],s=0;if(i.live||null!==(o=E.details)&&void 0!==o&&o.live){var _=this.mainDetails;if(i.fragments[0]||(i.deltaUpdateFailed=!0),i.deltaUpdateFailed||!_)return;!E.details&&i.hasProgramDateTime&&_.hasProgramDateTime?(Object(c.alignMediaPlaylistByPDT)(i,_),s=i.fragments[0].start):s=this.alignPlaylists(i,E.details)}E.details=i,this.levelLastLoaded=r,this.startFragRequested||!this.mainDetails&&i.live||this.setStartPosition(E.details,s),this.state!==n.State.WAITING_TRACK||this.waitForCdnTuneIn(i)||(this.state=n.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+r)}else this.cachedTrackLoadedData=t},R._handleFragmentLoadProgress=function(e){var t,o=e.frag,a=e.part,i=e.payload,r=this.config,E=this.trackId,s=this.levels;if(s){var T=s[E];console.assert(T,"Audio track is defined on fragment load progress");var d=T.details;console.assert(d,"Audio track details are defined on fragment load progress");var c=r.defaultAudioCodec||T.audioCodec||"mp4a.40.2",I=this.transmuxer;I||(I=this.transmuxer=new S.default(this.hls,_.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var A=this.initPTS[o.cc],O=null===(t=o.initSegment)||void 0===t?void 0:t.data;if(void 0!==A){var N=a?a.index:-1,R=-1!==N,m=new u.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,i.byteLength,N,R);I.push(i,O,c,"",o,a,d.totalduration,!1,m,A)}else this.log("Unknown video PTS for cc "+o.cc+", waiting for video PTS before demuxing audio frag "+o.sn+" of ["+d.startSN+" ,"+d.endSN+"],track "+E),(this.waitingData=this.waitingData||{frag:o,part:a,cache:new l.default,complete:!1}).cache.push(new Uint8Array(i)),this.waitingVideoCC=this.videoTrackCC,this.state=n.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered")},R._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},R.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},R.onBufferCreated=function(e,t){var o=t.tracks.audio;o&&(this.mediaBuffer=o.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)},R.onFragBuffered=function(e,t){var o=t.frag,a=t.part;o.type===_.PlaylistLevelType.AUDIO&&(this.fragContextChanged(o)?this.warn("Fragment "+o.sn+(a?" p: "+a.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==o.sn&&(this.fragPrevious=o,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(i.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(o,a)))},R.onError=function(t,o){switch(o.details){case I.ErrorDetails.FRAG_LOAD_ERROR:case I.ErrorDetails.FRAG_LOAD_TIMEOUT:case I.ErrorDetails.KEY_LOAD_ERROR:case I.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_.PlaylistLevelType.AUDIO,o);break;case I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==n.State.ERROR&&this.state!==n.State.STOPPED&&(this.state=o.fatal?n.State.ERROR:n.State.IDLE,this.warn(o.details+" while loading frag, switching to "+this.state+" state"));break;case I.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===o.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var a=!0,i=this.getFwdBufferInfo(this.mediaBuffer,_.PlaylistLevelType.AUDIO);i&&i.len>.5&&(a=!this.reduceMaxBufferLength(i.len)),a&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},R.onBufferFlushed=function(e,t){t.type===T.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},R._handleTransmuxComplete=function(e){var t,o="audio",a=this.hls,r=e.remuxResult,E=e.chunkMeta,s=this.getCurrentContext(E);if(!s)return this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),void this.resetStartWhenNotLoaded(E.level);var _=s.frag,l=s.part,S=s.level.details,u=r.audio,d=r.text,c=r.id3,I=r.initSegment;if(!this.fragContextChanged(_)&&S){if(this.state=n.State.PARSING,this.audioSwitch&&u&&this.completeAudioSwitch(),null!=I&&I.tracks&&(this._bufferInitSegment(I.tracks,_,E),a.trigger(i.Events.FRAG_PARSING_INIT_SEGMENT,{frag:_,id:o,tracks:I.tracks})),u){var O=u.startPTS,N=u.endPTS,R=u.startDTS,m=u.endDTS;l&&(l.elementaryStreams[T.ElementaryStreamTypes.AUDIO]={startPTS:O,endPTS:N,startDTS:R,endDTS:m}),_.setElementaryStreamInfo(T.ElementaryStreamTypes.AUDIO,O,N,R,m),this.bufferFragmentData(u,_,l,E)}if(null!=c&&null!==(t=c.samples)&&void 0!==t&&t.length){var p=A({id:o,frag:_,details:S},c);a.trigger(i.Events.FRAG_PARSING_METADATA,p)}if(d){var h=A({id:o,frag:_,details:S},d);a.trigger(i.Events.FRAG_PARSING_USERDATA,h)}}},R._bufferInitSegment=function(e,t,o){if(this.state===n.State.PARSING){e.video&&delete e.video;var a=e.audio;if(a){a.levelCodec=a.codec,a.id="audio",this.log("Init audio buffer, container:"+a.container+", codecs[parsed]=["+a.codec+"]"),this.hls.trigger(i.Events.BUFFER_CODECS,e);var r=a.initSegment;if(null!=r&&r.byteLength){var E={type:"audio",frag:t,part:null,chunkMeta:o,parent:t.type,data:r};this.hls.trigger(i.Events.BUFFER_APPENDING,E)}this.tick()}}},R.loadFragment=function(t,o,i){var r=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||r===E.FragmentState.NOT_LOADED||r===E.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):o.live&&!Object(a.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=n.State.WAITING_INIT_PTS):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,o,i)))},R.completeAudioSwitch=function(){var t=this.hls,o=this.media,a=this.trackId;o&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(i.Events.AUDIO_TRACK_SWITCHED,{id:a})},N})(n.default);t.default=N},"./src/controller/audio-track-controller.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/events.ts"),n=o("./src/errors.ts"),i=o("./src/controller/base-playlist-controller.ts"),r=o("./src/types/loader.ts");function E(e,t){for(var o=0;o=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var o=t[this.trackId];this.log("Now switching to audio-track index "+e);var n=t[e],i=n.id,r=n.groupId,E=void 0===r?"":r,s=n.name,_=n.type,T=n.url;if(this.trackId=e,this.trackName=s,this.selectDefaultTrack=!1,this.hls.trigger(a.Events.AUDIO_TRACK_SWITCHING,{id:i,groupId:E,name:s,type:_,url:T}),!n.details||n.details.live){var l=this.switchParams(n.url,null==o?void 0:o.details);this.loadPlaylist(l)}}},S.selectInitialTrack=function(){var e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,o=this.findTrackId(t)||this.findTrackId();-1!==o?this.setAudioTrack(o):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},S.findTrackId=function(e){for(var t=this.tracksInGroup,o=0;ot.partTarget&&(_+=1)}if(Object(a.isFiniteNumber)(s))return new n.HlsUrlParameters(s,Object(a.isFiniteNumber)(_)?_:void 0,n.HlsSkip.No)}}},t.loadPlaylist=function(e){},t.shouldLoadTrack=function(e){return this.canLoad&&e&&!!e.url&&(!e.details||e.details.live)},t.playlistLoaded=function(e,t,o){var a=this,n=t.details,r=t.stats,E=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(n.advancedDateTime=Date.now()-E,n.live||null!=o&&o.live){if(n.reloaded(o),o&&this.log("live playlist "+e+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),o&&n.fragments.length>0&&Object(i.mergeDetails)(o,n),!this.canLoad||!n.live)return;var s,_=void 0,T=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var l=this.hls.config.lowLatencyMode,S=n.lastPartSn,u=n.endSN,d=n.lastPartIndex,c=S===u;-1!==d?(_=c?u+1:S,T=c?l?0:d:d+1):_=u+1;var I=n.age,A=I+n.ageHeader,O=Math.min(A-n.partTarget,1.5*n.targetduration);if(O>0){if(o&&O>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+O+" with playlist age: "+n.age),O=0;else{var N=Math.floor(O/n.targetduration);_+=N,void 0!==T&&(T+=Math.round(O%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+I.toFixed(2)+"s goal: "+O+" skip sn "+N+" to part "+T)}n.tuneInGoal=O}if(s=this.getDeliveryDirectives(n,t.deliveryDirectives,_,T),l||!c)return void this.loadPlaylist(s)}else s=this.getDeliveryDirectives(n,t.deliveryDirectives,_,T);var R=Object(i.computeReloadInterval)(n,r);void 0!==_&&n.canBlockReload&&(R-=n.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout((function(){return a.loadPlaylist(s)}),R)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,o,a){var i=Object(n.getSkipValue)(e,o);return null!=t&&t.skip&&e.deltaUpdateFailed&&(o=t.msn,a=t.part,i=n.HlsSkip.No),new n.HlsUrlParameters(o,a,i)},t.retryLoadingOrFail=function(e){var t,o=this,a=this.hls.config,n=this.retryCount-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return o.loadPlaylist()}),i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+e.details+'"')}else this.warn('cannot recover from error "'+e.details+'"'),this.clearTimer(),e.fatal=!0;return n},e})()},"./src/controller/base-stream-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"State",(function(){return p})),o.d(t,"default",(function(){return h}));var a=o("./src/polyfills/number.ts"),n=o("./src/task-loop.ts"),i=o("./src/controller/fragment-tracker.ts"),r=o("./src/utils/buffer-helper.ts"),E=o("./src/utils/logger.ts"),s=o("./src/events.ts"),_=o("./src/errors.ts"),T=o("./src/types/transmuxer.ts"),l=o("./src/utils/mp4-tools.ts"),S=o("./src/utils/discontinuities.ts"),u=o("./src/controller/fragment-finders.ts"),d=o("./src/controller/level-helper.ts"),c=o("./src/loader/fragment-loader.ts"),I=o("./src/crypt/decrypter.ts"),A=o("./src/utils/time-ranges.ts"),O=o("./src/types/loader.ts");function N(e,t){for(var o=0;o=t.endSN&&!e.nextStart){var n=t.partList;if(null!=n&&n.length){var E=n[n.length-1];return r.BufferHelper.isBuffered(this.media,E.start+E.duration/2)}var s=a.getState(o);return s===i.FragmentState.PARTIAL||s===i.FragmentState.OK}return!1},C.onMediaAttached=function(e,t){var o=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),o.addEventListener("seeking",this.onvseeking),o.addEventListener("ended",this.onvended);var a=this.config;this.levels&&a.autoStartLoad&&this.state===p.STOPPED&&this.startLoad(a.startPosition)},C.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},C.onMediaSeeking=function(){var e=this.config,t=this.fragCurrent,o=this.media,n=this.mediaBuffer,i=this.state,E=o?o.currentTime:0,s=r.BufferHelper.bufferInfo(n||o,E,e.maxBufferHole);if(this.log("media seeking to "+(Object(a.isFiniteNumber)(E)?E.toFixed(3):E)+", state: "+i),i===p.ENDED)this.resetLoadingState();else if(t&&!s.len){var _=e.maxFragLookUpTolerance,T=t.start-_,l=E>t.start+t.duration+_;(E0&&i&&i.key&&i.iv&&"AES-128"===i.method){var r=self.performance.now();return t.decrypter.webCryptoDecrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).then((function(t){var n=self.performance.now();return a.trigger(s.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:r,tdecrypt:n}}),o.payload=t,o}))}return o})).then((function(o){var a=t.fragCurrent,n=t.hls,i=t.levels;if(!i)throw new Error("init load aborted, missing levels");var r=i[e.level].details;console.assert(r,"Level details are defined when init segment is loaded");var E=e.stats;t.state=p.IDLE,t.fragLoadError=0,e.data=new Uint8Array(o.payload),E.parsing.start=E.buffering.start=self.performance.now(),E.parsing.end=E.buffering.end=self.performance.now(),o.frag===a&&n.trigger(s.Events.FRAG_BUFFERED,{stats:E,frag:a,part:null,id:e.type}),t.tick()})).catch((function(o){t.state!==p.STOPPED&&t.state!==p.ERROR&&(t.warn(o),t.resetFragmentLoading(e))}))},C.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},C.fragBufferedComplete=function(e,t){var o=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level+" "+(o?A.default.toString(r.BufferHelper.getBuffered(o)):"(detached)")),this.state=p.IDLE,o&&(!this.loadedmetadata&&o.buffered.length&&this.fragCurrent===this.fragPrevious&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},C.seekToStartPos=function(){},C._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var o=e.frag,a=e.part,n=e.partsLoaded,i=!n||0===n.length||n.some((function(e){return!e})),r=new T.ChunkMetadata(o.level,o.sn,o.stats.chunkCount+1,0,a?a.index:-1,!i);t.flush(r)}},C._handleFragmentLoadProgress=function(e){},C._doFragLoad=function(e,t,o,n){var i=this;if(void 0===o&&(o=null),!this.levels)throw new Error("frag load aborted, missing levels");if(o=Math.max(e.start,o||0),this.config.lowLatencyMode&&t){var r=t.partList;if(r&&n){o>e.end&&t.fragmentHint&&(e=t.fragmentHint);var E=this.getNextPart(r,e,o);if(E>-1){var _=r[E];return this.log("Loading part sn: "+e.sn+" p: "+_.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+E+"-"+(r.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(o.toFixed(3))),this.nextLoadPosition=_.start+_.duration,this.state=p.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:e,part:r[E],targetBufferTime:o}),this.doFragPartsLoad(e,r,E,n).catch((function(e){return i.handleFragLoadError(e)}))}if(!e.url||this.loadedEndOfParts(r,o))return Promise.resolve(null)}}return this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(t?"of ["+t.startSN+"-"+t.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(o.toFixed(3))),Object(a.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=p.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:e,targetBufferTime:o}),this.fragmentLoader.load(e,n).catch((function(e){return i.handleFragLoadError(e)}))},C.doFragPartsLoad=function(e,t,o,a){var n=this;return new Promise((function(i,r){var E=[];!(function o(_){var T=t[_];n.fragmentLoader.loadPart(e,T,a).then((function(a){E[T.index]=a;var r=a.part;n.hls.trigger(s.Events.FRAG_LOADED,a);var l=t[_+1];if(!l||l.fragment!==e)return i({frag:e,part:r,partsLoaded:E});o(_+1)})).catch(r)})(o)}))},C.handleFragLoadError=function(e){var t=e.data;return t&&t.details===_.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(s.Events.ERROR,t),null},C._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===p.PARSING){var o=t.frag,a=t.part,n=t.level,i=self.performance.now();o.stats.parsing.end=i,a&&(a.stats.parsing.end=i),this.updateLevelTiming(o,a,n,e.partial)}else this.fragCurrent||(this.state=p.IDLE)},C.getCurrentContext=function(e){var t=this.levels,o=e.level,a=e.sn,n=e.part;if(!t||!t[o])return this.warn("Levels object was unset while buffering fragment "+a+" of level "+o+". The current chunk will not be buffered."),null;var i=t[o],r=n>-1?Object(d.getPartWith)(i,a,n):null,E=r?r.fragment:Object(d.getFragmentWithSN)(i,a,this.fragCurrent);return E?{frag:E,part:r,level:i}:null},C.bufferFragmentData=function(e,t,o,a){if(e&&this.state===p.PARSING){var n=e.data1,i=e.data2,r=n;if(n&&i&&(r=Object(l.appendUint8Array)(n,i)),r&&r.length){var E={type:e.type,frag:t,part:o,chunkMeta:a,parent:t.type,data:r};this.hls.trigger(s.Events.BUFFER_APPENDING,E),e.dropped&&e.independent&&!o&&this.flushBufferGap(t)}}},C.flushBufferGap=function(e){var t=this.media;if(t)if(r.BufferHelper.isBuffered(t,t.currentTime)){var o=t.currentTime,a=r.BufferHelper.bufferInfo(t,o,0),n=e.duration,i=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),E=Math.max(Math.min(e.start-i,a.end-i),o+i);e.start-E>i&&this.flushMainBuffer(E,e.start)}else this.flushMainBuffer(0,e.start)},C.getFwdBufferInfo=function(e,t){var o=this.config,n=this.getLoadPosition();if(!Object(a.isFiniteNumber)(n))return null;var i=r.BufferHelper.bufferInfo(e,n,o.maxBufferHole);if(0===i.len&&void 0!==i.nextStart){var E=this.fragmentTracker.getBufferedFrag(n,t);if(E&&i.nextStart=o&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},C.getNextFragment=function(e,t){var o=t.fragments,a=o.length;if(!a)return null;var n,i=this.config,r=o[0].start;if(t.live){var E=i.initialLiveManifestSize;if(a-1&&oo.start&&o.loaded},C.getInitialLiveFragment=function(e,t){var o=this.fragPrevious,a=null;if(o){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+o.programDateTime),a=Object(u.findFragmentByPDT)(t,o.endProgramDateTime,this.config.maxFragLookUpTolerance)),!a){var n=o.sn+1;if(n>=e.startSN&&n<=e.endSN){var i=t[n-e.startSN];o.cc===i.cc&&(a=i,this.log("Live playlist, switching playlist, load frag with next SN: "+a.sn))}a||(a=Object(u.findFragWithCC)(t,o.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+a.sn)}}else{var r=this.hls.liveSyncPosition;null!==r&&(a=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return a},C.getFragmentAtPosition=function(e,t,o){var a,n=this.config,r=this.fragPrevious,E=o.fragments,s=o.endSN,_=o.fragmentHint,T=n.maxFragLookUpTolerance,l=!!(n.lowLatencyMode&&o.partList&&_);if(l&&_&&!this.bitrateTest&&(E=E.concat(_),s=_.sn),et-T?0:T;a=Object(u.findFragmentByPTS)(r,E,e,S)}else a=E[E.length-1];if(a){var d=a.sn-o.startSN;if(r&&a.sn===r.sn&&!l&&r&&a.level===r.level){var c=E[d+1];a.sn=i-t.maxFragLookUpTolerance&&n<=r;if(null!==a&&o.duration>a&&(n"+e.startSN+" prev-sn: "+(i?i.sn:"na")+" fragments: "+E),l}return s},C.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},C.setStartPosition=function(e,t){var o=this.startPosition;if(o"+e))}}])&&N(h.prototype,L),f&&N(h,f),Object.defineProperty(h,"prototype",{writable:!1}),n})(n.default)},"./src/controller/buffer-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return u}));var a=o("./src/polyfills/number.ts"),n=o("./src/events.ts"),i=o("./src/utils/logger.ts"),r=o("./src/errors.ts"),E=o("./src/utils/buffer-helper.ts"),s=o("./src/utils/mediasource-helper.ts"),_=o("./src/loader/fragment.ts"),T=o("./src/controller/buffer-operation-queue.ts"),l=Object(s.getMediaSource)(),S=/([ha]vc.)(?:\.[^.,]+)+/,u=(function(){function e(e){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var e=t.hls,o=t.media,a=t.mediaSource;i.logger.log("[buffer-controller]: Media source opened"),o&&(t.updateMediaElementDuration(),e.trigger(n.Events.MEDIA_ATTACHED,{media:o})),a&&a.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){i.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){i.logger.log("[buffer-controller]: Media source ended")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null},t.registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.BUFFER_RESET,this.onBufferReset,this),e.on(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(n.Events.BUFFER_EOS,this.onBufferEos,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(n.Events.FRAG_PARSED,this.onFragParsed,this),e.on(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.BUFFER_RESET,this.onBufferReset,this),e.off(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(n.Events.BUFFER_EOS,this.onBufferEos,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(n.Events.FRAG_PARSED,this.onFragParsed,this),e.off(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new T.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var o=2;(t.audio&&!t.video||!t.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,i.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var o=this.media=t.media;if(o&&l){var a=this.mediaSource=new l;a.addEventListener("sourceopen",this._onMediaSourceOpen),a.addEventListener("sourceended",this._onMediaSourceEnded),a.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(a),this._objectUrl=o.src}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,o=this._objectUrl;if(t){if(i.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){i.logger.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(o&&self.URL.revokeObjectURL(o),e.src===o?(e.removeAttribute("src"),e.load()):i.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(n.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var o=e.sourceBuffer[t];try{o&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(o),e.sourceBuffer[t]=void 0)}catch(e){i.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var o=this,a=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(a){var n=o.tracks[e];if(n&&"function"==typeof n.buffer.changeType){var r=t[e],E=r.id,s=r.codec,_=r.levelCodec,T=r.container,l=r.metadata,u=(n.levelCodec||n.codec).replace(S,"$1"),d=(_||s).replace(S,"$1");if(u!==d){var c=T+";codecs="+(_||s);o.appendChangeType(e,c),i.logger.log("[buffer-controller]: switching codec "+u+" to "+d),o.tracks[e]={buffer:n.buffer,codec:s,container:T,levelCodec:_,metadata:l,id:E}}}}else o.pendingTracks[e]=t[e]})),a||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var o=this,a=this.operationQueue,n={execute:function(){var n=o.sourceBuffer[e];n&&(i.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),n.changeType(t)),a.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){i.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};a.append(n,e)},t.onBufferAppending=function(e,t){var o=this,a=this.hls,s=this.operationQueue,_=this.tracks,T=t.data,l=t.type,S=t.frag,u=t.part,d=t.chunkMeta,c=d.buffering[l],I=self.performance.now();c.start=I;var A=S.stats.buffering,O=u?u.stats.buffering:null;0===A.start&&(A.start=I),O&&0===O.start&&(O.start=I);var N=_.audio,R="audio"===l&&1===d.id&&"audio/mpeg"===(null==N?void 0:N.container),m={execute:function(){if(c.executeStart=self.performance.now(),R){var e=o.sourceBuffer[l];if(e){var t=S.start-e.timestampOffset;Math.abs(t)>=.1&&(i.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+S.start+" (delta: "+t+") sn: "+S.sn+")"),e.timestampOffset=S.start)}}o.appendExecutor(T,l)},onStart:function(){},onComplete:function(){var e=self.performance.now();c.executeEnd=c.end=e,0===A.first&&(A.first=e),O&&0===O.first&&(O.first=e);var t=o.sourceBuffer,a={};for(var i in t)a[i]=E.BufferHelper.getBuffered(t[i]);o.appendError=0,o.hls.trigger(n.Events.BUFFER_APPENDED,{type:l,frag:S,part:u,chunkMeta:d,parent:S.type,timeRanges:a})},onError:function(e){i.logger.error("[buffer-controller]: Error encountered while trying to append to the "+l+" SourceBuffer",e);var t={type:r.ErrorTypes.MEDIA_ERROR,parent:S.type,details:r.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=r.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,t.details=r.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>a.config.appendErrorMaxRetry&&(i.logger.error("[buffer-controller]: Failed "+a.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0,a.stopLoad())),a.trigger(n.Events.ERROR,t)}};s.append(m,l)},t.onBufferFlushing=function(e,t){var o=this,a=this.operationQueue,r=function(e){return{execute:o.removeExecutor.bind(o,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(n.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){i.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?a.append(r(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){a.append(r(e),e)}))},t.onFragParsed=function(e,t){var o=this,a=t.frag,r=t.part,E=[],s=r?r.elementaryStreams:a.elementaryStreams;s[_.ElementaryStreamTypes.AUDIOVIDEO]?E.push("audiovideo"):(s[_.ElementaryStreamTypes.AUDIO]&&E.push("audio"),s[_.ElementaryStreamTypes.VIDEO]&&E.push("video")),0===E.length&&i.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+a.type+" level: "+a.level+" sn: "+a.sn),this.blockBuffers((function(){var e=self.performance.now();a.stats.buffering.end=e,r&&(r.stats.buffering.end=e);var t=r?r.stats:a.stats;o.hls.trigger(n.Events.FRAG_BUFFERED,{frag:a,part:r,stats:t,id:a.type})}),E)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var o=this;this.getSourceBufferTypes().reduce((function(e,a){var n=o.sourceBuffer[a];return t.type&&t.type!==a||n&&!n.ended&&(n.ended=!0,i.logger.log("[buffer-controller]: "+a+" sourceBuffer now EOS")),e&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var e=o.mediaSource;e&&"open"===e.readyState&&e.endOfStream()}))},t.onLevelUpdated=function(e,t){var o=t.details;o.fragments.length&&(this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,o=this.media,i=this.sourceBuffer;if(o&&null!==t){var r=this.getSourceBufferTypes();if(r.length){var s=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(a.isFiniteNumber)(s)&&!(s<0)){var _=o.currentTime,T=t.levelTargetDuration,l=Math.max(s,T),S=Math.floor(_/T)*T-l;r.forEach((function(o){var a=i[o];if(a){var r=E.BufferHelper.getBuffered(a);r.length>0&&S>r.start(0)&&(e.trigger(n.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),t.live&&e.trigger(n.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),e.trigger(n.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:o}))}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,o=this.media,n=this.mediaSource,r=e.fragments[0].start+e.totalduration,E=o.duration,s=Object(a.isFiniteNumber)(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(i.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(r>s&&r>E||!Object(a.isFiniteNumber)(E))&&(i.logger.log("[buffer-controller]: Updating Media Source duration to "+r.toFixed(3)),n.duration=r)}},t.updateSeekableRange=function(e){var t=this.mediaSource,o=e.fragments;if(o.length&&e.live&&null!=t&&t.setLiveSeekableRange){var a=Math.max(0,o[0].start),n=Math.max(a,a+e.totalduration);t.setLiveSeekableRange(a,n)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,o=this.pendingTracks,a=Object.keys(o).length;if(a&&!e||2===a){this.createSourceBuffers(o),this.pendingTracks={};var i=this.getSourceBufferTypes();if(0===i.length)return void this.hls.trigger(n.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});i.forEach((function(e){t.executeNext(e)}))}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var a=0;for(var E in e)if(!t[E]){var s=e[E];if(!s)throw Error("source buffer exists for track "+E+", however track does not");var _=s.levelCodec||s.codec,T=s.container+";codecs="+_;i.logger.log("[buffer-controller]: creating sourceBuffer("+T+")");try{var l=t[E]=o.addSourceBuffer(T),S=E;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[E]={buffer:l,codec:_,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id},a++}catch(e){i.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(n.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:T})}}a&&this.hls.trigger(n.Events.BUFFER_CREATED,{tracks:this.tracks})},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){i.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(n.Events.ERROR,{type:r.ErrorTypes.MEDIA_ERROR,details:r.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(e);o&&o.onError(t)},t.removeExecutor=function(e,t,o){var n=this.media,r=this.mediaSource,E=this.operationQueue,s=this.sourceBuffer[e];if(!n||!r||!s)return i.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void E.shiftAndExecuteNext(e);var _=Object(a.isFiniteNumber)(n.duration)?n.duration:1/0,T=Object(a.isFiniteNumber)(r.duration)?r.duration:1/0,l=Math.max(0,t),S=Math.min(o,_,T);S>l?(i.logger.log("[buffer-controller]: Removing ["+l+","+S+"] from the "+e+" SourceBuffer"),console.assert(!s.updating,e+" sourceBuffer must not be updating"),s.remove(l,S)):E.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var o=this.operationQueue,a=this.sourceBuffer[t];if(!a)return i.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void o.shiftAndExecuteNext(t);a.ended=!1,console.assert(!a.updating,t+" sourceBuffer must not be updating"),a.appendBuffer(e)},t.blockBuffers=function(e,t){var o=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return i.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);var a=this.operationQueue,n=t.map((function(e){return a.appendBlocker(e)}));Promise.all(n).then((function(){e(),t.forEach((function(e){var t=o.sourceBuffer[e];t&&t.updating||a.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,o){var a=this.sourceBuffer[e];if(a){var n=o.bind(this,e);this.listeners[e].push({event:t,listener:n}),a.addEventListener(t,n)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e})()},"./src/controller/buffer-operation-queue.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return n}));var a=o("./src/utils/logger.ts"),n=(function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t){var o=this.queues[t];o.push(e),1===o.length&&this.buffers[t]&&this.executeNext(t)},t.insertAbort=function(e,t){this.queues[t].unshift(e),this.executeNext(t)},t.appendBlocker=function(e){var t,o=new Promise((function(e){t=e})),a={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(a,e),o},t.executeNext=function(e){var t=this.buffers,o=this.queues,n=t[e],i=o[e];if(i.length){var r=i[0];try{r.execute()}catch(t){a.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),r.onError(t),n&&n.updating||(i.shift(),this.executeNext(e))}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e})()},"./src/controller/cap-level-controller.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/events.ts");function n(e,t){for(var o=0;o0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},r.getMaxLevel=function(t){var o=this,a=this.hls.levels;if(!a.length)return-1;var n=a.filter((function(a,n){return e.isLevelAllowed(n,o.restrictedLevels)&&n<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var o=e.getBoundingClientRect();t.width=o.width,t.height=o.height,t.width||t.height||(t.width=o.right-o.left||e.width||0,t.height=o.bottom-o.top||e.height||0)}return this.clientRect=t,t},e.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},e.getMaxLevelByMediaSize=function(e,t,o){if(!e||!e.length)return-1;for(var a,n,i=e.length-1,r=0;r=t||E.height>=o)&&(a=E,!(n=e[r+1])||a.width!==n.width||a.height!==n.height)){i=r;break}}return i},t=e,(o=[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}}])&&n(t.prototype,o),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e})();t.default=i},"./src/controller/cmcd-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return S}));var a=o("./src/events.ts"),n=o("./src/types/cmcd.ts"),i=o("./src/utils/buffer-helper.ts"),r=o("./src/utils/logger.ts");function E(e,t){for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,a=new Array(t);o-1?i+1:a.levels.length;t=a.levels.slice(0,r)}for(var E,s=_(t);!(E=s()).done;){var T=E.value;T.bitrate>o&&(o=T.bitrate)}return o>0?o:NaN},t.getBufferLength=function(e){var t=this.hls.media,o=e===n.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return o&&t?1e3*i.BufferHelper.bufferInfo(o,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,o=e||this.config.loader;return(function(){function e(e){this.loader=void 0,this.loader=new o(e)}var a=e.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(e,o,a){t(e),this.loader.load(e,o,a)},s(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e})()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,o=e||this.config.loader;return(function(){function e(e){this.loader=void 0,this.loader=new o(e)}var a=e.prototype;return a.destroy=function(){this.loader.destroy()},a.abort=function(){this.loader.abort()},a.load=function(e,o,a){t(e),this.loader.load(e,o,a)},s(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e})()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,o=[],a=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},n=function(e){return Math.round(e)},i=function(e){return 100*n(e/100)},r={br:n,d:n,bl:i,dl:i,mtp:i,nor:function(e){return encodeURIComponent(e)},rtp:i,tb:n},E=_(Object.keys(e||{}).sort());!(t=E()).done;){var s=t.value,T=e[s];if(a(T)&&!("v"===s&&1===T||"pr"==s&&1===T)){var l=r[s];l&&(T=l(T));var S=typeof T,u=void 0;u="ot"===s||"sf"===s||"st"===s?s+"="+T:"boolean"===S?s:"number"===S?s+"="+T:s+"="+JSON.stringify(T),o.push(u)}}return o.join(",")},e.toHeaders=function(t){for(var o={},a=["Object","Request","Session","Status"],n=[{},{},{},{}],i={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},r=0,E=Object.keys(t);r3)return void this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var _=3-this._requestLicenseFailureCount+1;i.logger.warn("Retrying license request, "+_+" attempts left"),this._requestLicense(o,r)}},_._generateLicenseRequestChallenge=function(e,t){if(e.mediaKeySystemDomain===r.KeySystems.WIDEVINE)return t;throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},_._requestLicense=function(e,t){i.logger.log("Requesting content license for key-system");var o=this._mediaKeysList[0];if(!o)return i.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var r=this.getLicenseServerUrl(o.mediaKeySystemDomain),E=this._createLicenseXhr(r,e,t);i.logger.log("Sending license request to URL: "+r);var s=this._generateLicenseRequestChallenge(o,e);E.send(s)}catch(e){i.logger.error("Failure requesting DRM license: "+e),this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},_.onMediaAttached=function(e,t){if(this._emeEnabled){var o=t.media;this._media=o,o.addEventListener("encrypted",this._onMediaEncrypted)}},_.onMediaDetached=function(){var e=this._media,t=this._mediaKeysList;e&&(e.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.close().catch((function(){}))}))).then((function(){return e.setMediaKeys(null)})).catch((function(){})))},_.onManifestParsed=function(e,t){if(this._emeEnabled){var o=t.levels.map((function(e){return e.audioCodec})).filter((function(e){return!!e})),a=t.levels.map((function(e){return e.videoCodec})).filter((function(e){return!!e}));this._attemptKeySystemAccess(r.KeySystems.WIDEVINE,o,a)}},t=e,(o=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&E(t.prototype,o),s&&E(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e})();t.default=s},"./src/controller/fps-controller.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/events.ts"),n=o("./src/utils/logger.ts"),i=(function(){function e(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(a.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(a.Events.MEDIA_ATTACHING,this.onMediaAttaching)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var o=this.hls.config;if(o.capLevelOnFPSDrop){var a=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=a,a&&"function"==typeof a.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),o.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,o){var i=performance.now();if(t){if(this.lastTime){var r=i-this.lastTime,E=o-this.lastDroppedFrames,s=t-this.lastDecodedFrames,_=1e3*E/r,T=this.hls;if(T.trigger(a.Events.FPS_DROP,{currentDropped:E,currentDecoded:s,totalDroppedFrames:o}),_>0&&E>T.config.fpsDroppedMonitoringThreshold*s){var l=T.currentLevel;n.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(-1===T.autoLevelCapping||T.autoLevelCapping>=l)&&(l-=1,T.trigger(a.Events.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:T.currentLevel}),T.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=i,this.lastDroppedFrames=o,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e})();t.default=i},"./src/controller/fragment-finders.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"findFragmentByPDT",(function(){return i})),o.d(t,"findFragmentByPTS",(function(){return r})),o.d(t,"fragmentWithinToleranceTest",(function(){return E})),o.d(t,"pdtWithinToleranceTest",(function(){return s})),o.d(t,"findFragWithCC",(function(){return _}));var a=o("./src/polyfills/number.ts"),n=o("./src/utils/binary-search.ts");function i(e,t,o){if(null===t||!Array.isArray(e)||!e.length||!Object(a.isFiniteNumber)(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;o=o||0;for(var n=0;ne&&o.start?-1:0}function s(e,t,o){var a=1e3*Math.min(t,o.duration+(o.deltaPTS?o.deltaPTS:0));return(o.endProgramDateTime||0)-a>e}function _(e,t){return n.default.search(e,(function(e){return e.cct?-1:0}))}},"./src/controller/fragment-tracker.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"FragmentState",(function(){return a})),o.d(t,"FragmentTracker",(function(){return r}));var a,n=o("./src/events.ts"),i=o("./src/types/loader.ts");!(function(e){e.NOT_LOADED="NOT_LOADED",e.APPENDING="APPENDING",e.PARTIAL="PARTIAL",e.OK="OK"})(a||(a={}));var r=(function(){function e(e){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.on(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.off(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){if(t===i.PlaylistLevelType.MAIN){var o=this.activeFragment,a=this.activeParts;if(!o)return null;if(a)for(var n=a.length;n--;){var r=a[n],E=r?r.end:o.appendedPTS;if(r.start<=e&&void 0!==E&&e<=E)return n>9&&(this.activeParts=a.slice(n-9)),r}else if(o.start<=e&&void 0!==o.appendedPTS&&e<=o.appendedPTS)return o}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var o=this.fragments,a=Object.keys(o),n=a.length;n--;){var i=o[a[n]];if((null==i?void 0:i.body.type)===t&&i.buffered){var r=i.body;if(r.start<=e&&e<=r.end)return r}}return null},t.detectEvictedFragments=function(e,t,o){var a=this;Object.keys(this.fragments).forEach((function(n){var i=a.fragments[n];if(i)if(i.buffered){var r=i.range[e];r&&r.time.some((function(e){var o=!a.isTimeBuffered(e.startPTS,e.endPTS,t);return o&&a.removeFragment(i.body),o}))}else i.body.type===o&&a.removeFragment(i.body)}))},t.detectPartialFragments=function(e){var t=this,o=this.timeRanges,a=e.frag,n=e.part;if(o&&"initSegment"!==a.sn){var i=s(a),r=this.fragments[i];r&&(Object.keys(o).forEach((function(e){var i=a.elementaryStreams[e];if(i){var E=o[e],s=null!==n||!0===i.partial;r.range[e]=t.getBufferedTimes(a,n,s,E)}})),r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body))}},t.fragBuffered=function(e){var t=s(e),o=this.fragments[t];o&&(o.loaded=null,o.buffered=!0)},t.getBufferedTimes=function(e,t,o,a){for(var n={time:[],partial:o},i=t?t.start:e.start,r=t?t.end:e.end,E=e.minEndPTS||r,s=e.maxStartPTS||i,_=0;_=T&&E<=l){n.time.push({startPTS:Math.max(i,a.start(_)),endPTS:Math.min(r,a.end(_))});break}if(iT)n.partial=!0,n.time.push({startPTS:Math.max(i,a.start(_)),endPTS:Math.min(r,a.end(_))});else if(r<=T)break}return n},t.getPartialFragment=function(e){var t,o,a,n=null,i=0,r=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach((function(_){var T=s[_];T&&E(T)&&(o=T.body.start-r,a=T.body.end+r,e>=o&&e<=a&&(t=Math.min(e-o,a-e),i<=t&&(n=T.body,i=t)))})),n},t.getState=function(e){var t=s(e),o=this.fragments[t];return o?o.buffered?E(o)?a.PARTIAL:a.OK:a.APPENDING:a.NOT_LOADED},t.isTimeBuffered=function(e,t,o){for(var a,n,i=0;i=a&&t<=n)return!0;if(t<=a)return!1}return!1},t.onFragLoaded=function(e,t){var o=t.frag,a=t.part;if("initSegment"!==o.sn&&!o.bitrateTest&&!a){var n=s(o);this.fragments[n]={body:o,loaded:t,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var o=this,a=t.frag,n=t.part,r=t.timeRanges;if(a.type===i.PlaylistLevelType.MAIN)if(this.activeFragment=a,n){var E=this.activeParts;E||(this.activeParts=E=[]),E.push(n)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach((function(e){var t=r[e];if(o.detectEvictedFragments(e,t),!n)for(var i=0;ie&&a.removeFragment(r)}}))},t.removeFragment=function(e){var t=s(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),delete this.fragments[t]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},e})();function E(e){var t,o;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(o=e.range.audio)||void 0===o?void 0:o.partial))}function s(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}},"./src/controller/gap-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"STALL_MINIMUM_DURATION_MS",(function(){return E})),o.d(t,"MAX_START_GAP_JUMP",(function(){return s})),o.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return _})),o.d(t,"SKIP_BUFFER_RANGE_START",(function(){return T})),o.d(t,"default",(function(){return l}));var a=o("./src/utils/buffer-helper.ts"),n=o("./src/errors.ts"),i=o("./src/events.ts"),r=o("./src/utils/logger.ts"),E=250,s=2,_=.1,T=.05,l=(function(){function e(e,t,o,a){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=o,this.hls=a}var t=e.prototype;return t.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},t.poll=function(e,t){var o=this.config,n=this.media,i=this.stalled;if(null!==n){var _=n.currentTime,T=n.seeking,l=this.seeking&&!T,S=!this.seeking&&T;if(this.seeking=T,_===e){if((S||l)&&(this.stalled=null),!(n.paused&&!T||n.ended||0===n.playbackRate)&&a.BufferHelper.getBuffered(n).length){var u=a.BufferHelper.bufferInfo(n,_,0),d=u.len>0,c=u.nextStart||0;if(d||c){if(T){var I=u.len>s,A=!c||t&&t.start<=_||c-_>s&&!this.fragmentTracker.getPartialFragment(_);if(I||A)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var O,N=Math.max(c,u.start||0)-_,R=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,m=(null==R||null===(O=R.details)||void 0===O?void 0:O.live)?2*R.details.targetduration:s;if(N>0&&N<=m)return void this._trySkipBufferHole(null)}var p=self.performance.now();if(null!==i){var h=p-i;if(T||!(h>=E)||(this._reportStall(u),this.media)){var L=a.BufferHelper.bufferInfo(n,_,o.maxBufferHole);this._tryFixBufferStall(L,h)}}else this.stalled=p}}}else if(this.moved=!0,null!==i){if(this.stallReported){var f=self.performance.now()-i;r.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(f)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}},t._tryFixBufferStall=function(e,t){var o=this.config,a=this.fragmentTracker,n=this.media;if(null!==n){var i=n.currentTime,E=a.getPartialFragment(i);if(E&&(this._trySkipBufferHole(E)||!this.media))return;e.len>o.maxBufferHole&&t>1e3*o.highBufferWatchdogPeriod&&(r.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},t._reportStall=function(e){var t=this.hls,o=this.media;!this.stallReported&&o&&(this.stallReported=!0,r.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer ("+JSON.stringify(e)+")"),t.trigger(i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e.len}))},t._trySkipBufferHole=function(e){var t=this.config,o=this.hls,E=this.media;if(null===E)return 0;for(var s=E.currentTime,l=0,S=a.BufferHelper.getBuffered(E),u=0;u=l&&sa.startDate&&e.push(o),e}),[]).sort((function(e,t){return e.startDate.getTime()-t.startDate.getTime()}))[0];I&&(d=T(I.startDate,A),_=!0)}for(var R,m=Object.keys(a.attr),p=0;p.05&&this.forwardBufferLength>1){var _=Math.min(2,Math.max(1,i)),T=Math.round(2/(1+Math.exp(-.75*E-this.edgeStalled))*20)/20;e.playbackRate=Math.min(_,Math.max(1,T))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},s.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},s.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},t=e,(o=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,o=e.partHoldBack,a=e.targetduration,n=this.config,i=n.liveSyncDuration,r=n.liveSyncDurationCount,E=n.lowLatencyMode,s=this.hls.userConfig,_=E&&o||t;(s.liveSyncDuration||s.liveSyncDurationCount||0===_)&&(_=void 0!==i?i:r*a);var T=a;return _+Math.min(1*this.stallCount,T)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,o=this.levelDetails;if(null===e||null===t||null===o)return null;var a=o.edge,n=e-t-this.edgeStalled,i=a-o.totalduration,r=a-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(i,n),r)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var o=e.buffered.length;return(o?e.buffered.end(o-1):t.edge)-this.currentTime}}])&&r(t.prototype,o),E&&r(t,E),Object.defineProperty(t,"prototype",{writable:!1}),e})()},"./src/controller/level-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return d}));var a=o("./src/types/level.ts"),n=o("./src/events.ts"),i=o("./src/errors.ts"),r=o("./src/utils/codecs.ts"),E=o("./src/controller/level-helper.ts"),s=o("./src/controller/base-playlist-controller.ts"),_=o("./src/types/loader.ts");function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t0){o=_[0].bitrate,_.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=_;for(var A=0;A<_.length;A++)if(_[A].bitrate===o){this._firstLevel=A,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+o);break}var O=I&&!c,N={levels:_,audioTracks:T,subtitleTracks:l,firstLevel:this._firstLevel,stats:t.stats,audio:I,video:c,altAudio:!O&&T.some((function(e){return!!e.url}))};this.hls.trigger(n.Events.MANIFEST_PARSED,N),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,reason:"no level with compatible codecs found in manifest"})},A.onError=function(t,o){var a;if(e.prototype.onError.call(this,t,o),!o.fatal){var n=o.context,r=this._levels[this.currentLevelIndex];if(n&&(n.type===_.PlaylistContextType.AUDIO_TRACK&&r.audioGroupIds&&n.groupId===r.audioGroupIds[r.urlId]||n.type===_.PlaylistContextType.SUBTITLE_TRACK&&r.textGroupIds&&n.groupId===r.textGroupIds[r.urlId]))this.redundantFailover(this.currentLevelIndex);else{var E,s=!1,T=!0;switch(o.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:if(o.frag){var l=o.frag.type===_.PlaylistLevelType.MAIN?o.frag.level:this.currentLevelIndex,S=this._levels[l];S?(S.fragmentError++,S.fragmentError>this.hls.config.fragLoadingMaxRetry&&(E=l)):E=l}break;case i.ErrorDetails.LEVEL_LOAD_ERROR:case i.ErrorDetails.LEVEL_LOAD_TIMEOUT:n&&(n.deliveryDirectives&&(T=!1),E=n.level),s=!0;break;case i.ErrorDetails.REMUX_ALLOC_ERROR:E=null!=(a=o.level)?a:this.currentLevelIndex,s=!0}void 0!==E&&this.recoverLevel(o,E,s,T)}}},A.recoverLevel=function(e,t,o,a){var n=e.details,i=this._levels[t];if(i.loadError++,o){if(!this.retryLoadingOrFail(e))return void(this.currentLevelIndex=-1);e.levelRetry=!0}if(a){var r=i.url.length;if(r>1&&i.loadError-1&&this.currentLevelIndex!==E&&(this.warn(n+": switch to "+E),e.levelRetry=!0,this.hls.nextAutoLevel=E)}}},A.redundantFailover=function(e){var t=this._levels[e],o=t.url.length;if(o>1){var a=(t.urlId+1)%o;this.warn("Switching to redundant URL-id "+a),this._levels.forEach((function(e){e.urlId=a})),this.level=e}},A.onFragLoaded=function(e,t){var o=t.frag;if(void 0!==o&&o.type===_.PlaylistLevelType.MAIN){var a=this._levels[o.level];void 0!==a&&(a.fragmentError=0,a.loadError=0)}},A.onLevelLoaded=function(e,t){var o,a,n=t.level,i=t.details,r=this._levels[n];if(!r)return this.warn("Invalid level index "+n),void(null!==(a=t.deliveryDirectives)&&void 0!==a&&a.skip&&(i.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===r.fragmentError&&(r.loadError=0,this.retryCount=0),this.playlistLoaded(n,t,r.details)):null!==(o=t.deliveryDirectives)&&void 0!==o&&o.skip&&(i.deltaUpdateFailed=!0)},A.onAudioTrackSwitched=function(e,t){var o=this.hls.levels[this.currentLevelIndex];if(o&&o.audioGroupIds){for(var a=-1,n=this.hls.audioTracks[t.id].groupId,i=0;i0){var a=o.urlId,i=o.url[a];if(e)try{i=e.addDirectives(i)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Attempt loading level index "+t+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+a+" "+i),this.clearTimer(),this.hls.trigger(n.Events.LEVEL_LOADING,{url:i,level:t,id:a,deliveryDirectives:e||null})}},A.removeLevel=function(e,t){var o=function(e,o){return o!==t},a=this._levels.filter((function(a,n){return n!==e||a.url.length>1&&void 0!==t&&(a.url=a.url.filter(o),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(o)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(o)),a.urlId=0,!0)})).map((function(e,t){var o=e.details;return null!=o&&o.fragments&&o.fragments.forEach((function(e){e.level=t})),e}));this._levels=a,this.hls.trigger(n.Events.LEVELS_UPDATED,{levels:a})},d=s,(c=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,o=this._levels;if(0!==o.length&&(this.currentLevelIndex!==e||null===(t=o[e])||void 0===t||!t.details)){if(e<0||e>=o.length){var a=e<0;if(this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:a,reason:"invalid level idx"}),a)return;e=Math.min(e,o.length-1)}this.clearTimer();var r=this.currentLevelIndex,E=o[r],s=o[e];this.log("switching to level "+e+" from "+r),this.currentLevelIndex=e;var _=T({},s,{level:e,maxBitrate:s.maxBitrate,uri:s.uri,urlId:s.urlId});delete _._urlId,this.hls.trigger(n.Events.LEVEL_SWITCHING,_);var l=s.details;if(!l||l.live){var S=this.switchParams(s.uri,null==E?void 0:E.details);this.loadPlaylist(S)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])&&l(d.prototype,c),I&&l(d,I),Object.defineProperty(d,"prototype",{writable:!1}),s})(s.default)},"./src/controller/level-helper.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"addGroupId",(function(){return E})),o.d(t,"assignTrackIdsByGroup",(function(){return s})),o.d(t,"updatePTS",(function(){return _})),o.d(t,"updateFragPTSDTS",(function(){return l})),o.d(t,"mergeDetails",(function(){return S})),o.d(t,"mapPartIntersection",(function(){return u})),o.d(t,"mapFragmentIntersection",(function(){return d})),o.d(t,"adjustSliding",(function(){return c})),o.d(t,"addSliding",(function(){return I})),o.d(t,"computeReloadInterval",(function(){return A})),o.d(t,"getFragmentWithSN",(function(){return O})),o.d(t,"getPartWith",(function(){return N}));var a=o("./src/polyfills/number.ts"),n=o("./src/utils/logger.ts"),i=o("./src/loader/date-range.ts");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;te.sn?(i=o-e.start,n=e):(i=e.start-o,n=t),n.duration!==i&&(n.duration=i)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function l(e,t,o,i,r,E){i-o<=0&&(n.logger.warn("Fragment should have a positive duration",t),i=o+t.duration,E=r+t.duration);var s=o,_=i,l=t.startPTS,S=t.endPTS;if(Object(a.isFiniteNumber)(l)){var u=Math.abs(l-o);Object(a.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(u,t.deltaPTS):t.deltaPTS=u,s=Math.max(o,l),o=Math.min(o,l),r=Math.min(r,t.startDTS),_=Math.min(i,S),i=Math.max(i,S),E=Math.max(E,t.endDTS)}t.duration=i-o;var d=o-t.start;t.appendedPTS=i,t.start=t.startPTS=o,t.maxStartPTS=s,t.startDTS=r,t.endPTS=i,t.minEndPTS=_,t.endDTS=E;var c,I=t.sn;if(!e||Ie.endSN)return 0;var A=I-e.startSN,O=e.fragments;for(O[A]=t,c=A;c>0;c--)T(O[c],O[c-1]);for(c=A;c=0;s--){var _=E[s].initSegment;if(_){o=_;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var T,S,I,A,O,N=0;if(d(e,t,(function(e,n){e.relurl&&(N=e.cc-n.cc),Object(a.isFiniteNumber)(e.startPTS)&&Object(a.isFiniteNumber)(e.endPTS)&&(n.start=n.startPTS=e.startPTS,n.startDTS=e.startDTS,n.appendedPTS=e.appendedPTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.duration=e.endPTS-e.startPTS,n.duration&&(T=n),t.PTSKnown=t.alignedSliding=!0),n.elementaryStreams=e.elementaryStreams,n.loader=e.loader,n.stats=e.stats,n.urlId=e.urlId,e.initSegment&&(n.initSegment=e.initSegment,o=e.initSegment)})),o&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=o)||void 0===t?void 0:t.relurl)||(e.initSegment=o)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed){n.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var R=t.skippedSegments;R--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=(S=e.dateRanges,I=t.dateRanges,A=t.recentlyRemovedDateranges,O=r({},S),A&&A.forEach((function(e){delete O[e]})),Object.keys(I).forEach((function(e){var t=new i.DateRange(I[e].attr,O[e]);t.isValid?O[e]=t:n.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(I[e].attr)+'"')})),O));var m=t.fragments;if(N){n.logger.warn("discontinuity sliding from playlist, take drift into account");for(var p=0;p=a.length||I(t,a[o].start)}function I(e,t){if(t){for(var o=e.fragments,a=e.skippedSegments;a0&&i<3*a,E=t.loading.end-t.loading.start,s=e.availabilityDelay;if(!1===e.updated)if(r){var _=333*e.misses;o=Math.max(Math.min(n,2*E),_),e.availabilityDelay=(e.availabilityDelay||0)+o}else o=n;else r?(s=Math.min(s||a/2,i),e.availabilityDelay=s,o=s+a-i):o=a-E;return Math.round(o)}function O(e,t,o){if(!e||!e.details)return null;var a=e.details,n=a.fragments[t-a.startSN];return n||((n=a.fragmentHint)&&n.sn===t?n:t1?(a=0,this.bitrateTest=!0):a=o.nextAutoLevel),this.level=o.nextLoadLevel=a,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=n.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=n.State.STOPPED},m.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},m.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_LEVEL:var e,t=this.levels,o=this.level,a=null==t||null===(e=t[o])||void 0===e?void 0:e.details;if(a&&(!a.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(a))break;this.state=n.State.IDLE;break}break;case n.State.FRAG_LOADING_WAITING_RETRY:var i,r=self.performance.now(),E=this.retryDate;(!E||r>=E||null!==(i=this.media)&&void 0!==i&&i.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=n.State.IDLE)}this.onTickEnd()},m.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},m.doTickIdle=function(){var e,t,o=this.hls,a=this.levelLastLoaded,i=this.levels,E=this.media,l=o.config,S=o.nextLoadLevel;if(null!==a&&(E||!this.startFragRequested&&l.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&i&&i[S]){var u=i[S];this.level=o.nextLoadLevel=S;var d=u.details;if(!d||this.state===n.State.WAITING_LEVEL||d.live&&this.levelLastLoaded!==S)this.state=n.State.WAITING_LEVEL;else{var c=this.getMainFwdBufferInfo();if(null!==c&&!(c.len>=this.getMaxBufferLength(u.maxBitrate))){if(this._streamEnded(c,d)){var I={};return this.altAudio&&(I.type="video"),this.hls.trigger(r.Events.BUFFER_EOS,I),void(this.state=n.State.ENDED)}this.backtrackFragment&&this.backtrackFragment.start>c.end&&(this.backtrackFragment=null);var A=this.backtrackFragment?this.backtrackFragment.start:c.end,O=this.getNextFragment(A,d);if(this.couldBacktrack&&!this.fragPrevious&&O&&"initSegment"!==O.sn&&this.fragmentTracker.getState(O)!==s.FragmentState.OK){var N,R=(null!=(N=this.backtrackFragment)?N:O).sn-d.startSN,m=d.fragments[R-1];m&&O.cc===m.cc&&(O=m,this.fragmentTracker.removeFragment(m))}else this.backtrackFragment&&c.len&&(this.backtrackFragment=null);if(O&&this.fragmentTracker.getState(O)===s.FragmentState.OK&&this.nextLoadPosition>A){var p=this.audioOnly&&!this.altAudio?T.ElementaryStreamTypes.AUDIO:T.ElementaryStreamTypes.VIDEO;E&&this.afterBufferFlushed(E,p,_.PlaylistLevelType.MAIN),O=this.getNextFragment(this.nextLoadPosition,d)}O&&(!O.initSegment||O.initSegment.data||this.bitrateTest||(O=O.initSegment),"identity"!==(null===(e=O.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=O.decryptdata)&&void 0!==t&&t.key?this.loadFragment(O,d,A):this.loadKey(O,d))}}}},m.loadFragment=function(t,o,a){var n,i=this.fragmentTracker.getState(t);this.fragCurrent=t,i===s.FragmentState.NOT_LOADED?"initSegment"===t.sn?this._loadInitSegment(t):this.bitrateTest?(this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,o,a)):i===s.FragmentState.APPENDING?this.reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},m.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,_.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},m.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,_.PlaylistLevelType.MAIN)},m.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},m.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},m.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var o,a=this.getAppendedFrag(t.currentTime);if(a&&a.start>1&&this.flushMainBuffer(0,a.start-1),!t.paused&&e){var n=e[this.hls.nextLoadLevel],i=this.fragLastKbps;o=i&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*i)+1:0}else o=0;var r=this.getBufferedFrag(t.currentTime+o);if(r){var E=this.followingBufferedFrag(r);if(E){this.abortCurrentFrag();var s=E.maxStartPTS?E.maxStartPTS:E.start,_=E.duration,T=Math.max(r.end,s+Math.min(Math.max(_-this.config.maxFragLookUpTolerance,.5*_),.75*_));this.flushMainBuffer(T,Number.POSITIVE_INFINITY)}}}},m.abortCurrentFrag=function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,null!=e&&e.loader&&e.loader.abort(),this.state){case n.State.KEY_LOADING:case n.State.FRAG_LOADING:case n.State.FRAG_LOADING_WAITING_RETRY:case n.State.PARSING:case n.State.PARSED:this.state=n.State.IDLE}this.nextLoadPosition=this.getLoadPosition()},m.flushMainBuffer=function(t,o){e.prototype.flushMainBuffer.call(this,t,o,this.altAudio?"video":null)},m.onMediaAttached=function(t,o){e.prototype.onMediaAttached.call(this,t,o);var a=o.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),a.addEventListener("playing",this.onvplaying),a.addEventListener("seeked",this.onvseeked),this.gapController=new u.default(this.config,a,this.fragmentTracker,this.hls)},m.onMediaDetaching=function(){var t=this.media;t&&this.onvplaying&&this.onvseeked&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},m.onMediaPlaying=function(){this.tick()},m.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(a.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},m.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(r.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},m.onManifestParsed=function(e,t){var o,a=!1,n=!1;t.levels.forEach((function(e){(o=e.audioCodec)&&(-1!==o.indexOf("mp4a.40.2")&&(a=!0),-1!==o.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=a&&n&&!Object(i.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},m.onLevelLoading=function(e,t){var o=this.levels;if(o&&this.state===n.State.IDLE){var a=o[t.level];(!a.details||a.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(a.details))&&(this.state=n.State.WAITING_LEVEL)}},m.onLevelLoaded=function(e,t){var o,a=this.levels,i=t.level,E=t.details,s=E.totalduration;if(a){this.log("Level "+i+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+s);var _=this.fragCurrent;!_||this.state!==n.State.FRAG_LOADING&&this.state!==n.State.FRAG_LOADING_WAITING_RETRY||_.level!==t.level&&_.loader&&(this.state=n.State.IDLE,this.backtrackFragment=null,_.loader.abort());var T=a[i],l=0;if(E.live||null!==(o=T.details)&&void 0!==o&&o.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;l=this.alignPlaylists(E,T.details)}if(T.details=E,this.levelLastLoaded=i,this.hls.trigger(r.Events.LEVEL_UPDATED,{details:E,level:i}),this.state===n.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=n.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,l),this.tick()}else this.warn("Levels were reset while loading level "+i)},m._handleFragmentLoadProgress=function(e){var t,o=e.frag,a=e.part,n=e.payload,i=this.levels;if(i){var r=i[o.level],E=r.details;if(E){var s=r.videoCodec,T=E.PTSKnown||!E.live,u=null===(t=o.initSegment)||void 0===t?void 0:t.data,d=this._getAudioCodec(r),c=this.transmuxer=this.transmuxer||new l.default(this.hls,_.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),I=a?a.index:-1,A=-1!==I,O=new S.ChunkMetadata(o.level,o.sn,o.stats.chunkCount,n.byteLength,I,A),N=this.initPTS[o.cc];c.push(n,u,d,s,o,a,E.totalduration,T,O,N)}else this.warn("Dropping fragment "+o.sn+" of level "+o.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+o.sn+" of level "+o.level+" will not be buffered")},m.onAudioTrackSwitching=function(e,t){var o=this.altAudio,a=!!t.url,n=t.id;if(!a){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var i=this.fragCurrent;null!=i&&i.loader&&(this.log("Switching to main audio track, cancel main fragment load"),i.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var E=this.hls;o&&E.trigger(r.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),E.trigger(r.Events.AUDIO_TRACK_SWITCHED,{id:n})}},m.onAudioTrackSwitched=function(e,t){var o=t.id,a=!!this.hls.audioTracks[o].url;if(a){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=a,this.tick()},m.onBufferCreated=function(e,t){var o,a,n=t.tracks,i=!1;for(var r in n){var E=n[r];if("main"===E.id){if(a=r,o=E,"video"===r){var s=n[r];s&&(this.videoBuffer=s.buffer)}}else i=!0}i&&o?(this.log("Alternate track found, use "+a+".buffered to schedule main fragment loading"),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media},m.onFragBuffered=function(e,t){var o=t.frag,a=t.part;if(!o||o.type===_.PlaylistLevelType.MAIN){if(this.fragContextChanged(o))return this.warn("Fragment "+o.sn+(a?" p: "+a.index:"")+" of level "+o.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===n.State.PARSED&&(this.state=n.State.IDLE));var i=a?a.stats:o.stats;this.fragLastKbps=Math.round(8*i.total/(i.buffering.end-i.loading.first)),"initSegment"!==o.sn&&(this.fragPrevious=o),this.fragBufferedComplete(o,a)}},m.onError=function(e,t){switch(t.details){case d.ErrorDetails.FRAG_LOAD_ERROR:case d.ErrorDetails.FRAG_LOAD_TIMEOUT:case d.ErrorDetails.KEY_LOAD_ERROR:case d.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(_.PlaylistLevelType.MAIN,t);break;case d.ErrorDetails.LEVEL_LOAD_ERROR:case d.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==n.State.ERROR&&(t.fatal?(this.warn(""+t.details),this.state=n.State.ERROR):t.levelRetry||this.state!==n.State.WAITING_LEVEL||(this.state=n.State.IDLE));break;case d.ErrorDetails.BUFFER_FULL_ERROR:if("main"===t.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var o=!0,a=this.getFwdBufferInfo(this.media,_.PlaylistLevelType.MAIN);if(a&&a.len>.5&&(o=!this.reduceMaxBufferLength(a.len)),o)this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch();else{var i=this.fragCurrent;this.abortCurrentFrag(),i&&(this.flushMainBuffer(i.start,Number.POSITIVE_INFINITY),this.nextLoadPosition=i.start)}this.resetTransmuxer(),this.resetLoadingState()}}},m.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!E.BufferHelper.getBuffered(e).length){var o=this.state!==n.State.IDLE?this.fragCurrent:null;t.poll(this.lastCurrentTime,o)}this.lastCurrentTime=e.currentTime}},m.onFragLoadEmergencyAborted=function(){this.state=n.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},m.onBufferFlushed=function(e,t){var o=t.type;if(o!==T.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var a=(o===T.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(a,o,_.PlaylistLevelType.MAIN)}},m.onLevelsUpdated=function(e,t){this.levels=t.levels},m.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},m.seekToStartPos=function(){var e=this.media;if(e){var t=e.currentTime,o=this.startPosition;if(o>=0&&t0&&(n1&&!1===e.seeking){var o=e.currentTime;if(E.BufferHelper.isBuffered(e,o)?t=this.getAppendedFrag(o):E.BufferHelper.isBuffered(e,o+.1)&&(t=this.getAppendedFrag(o+.1)),t){this.backtrackFragment=null;var a=this.fragPlaying,n=t.level;a&&t.sn===a.sn&&a.level===n&&t.urlId===a.urlId||(this.hls.trigger(r.Events.FRAG_CHANGED,{frag:t}),a&&a.level===n||this.hls.trigger(r.Events.LEVEL_SWITCHED,{level:n}),this.fragPlaying=t)}}},O=A,(N=[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,o=this.currentFrag;if(o&&Object(a.isFiniteNumber)(t)&&Object(a.isFiniteNumber)(o.programDateTime)){var n=o.programDateTime+1e3*(t-o.start);return new Date(n)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&c(O.prototype,N),R&&c(O,R),Object.defineProperty(O,"prototype",{writable:!1}),A})(n.default)},"./src/controller/subtitle-stream-controller.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"SubtitleStreamController",(function(){return d}));var a=o("./src/events.ts"),n=o("./src/utils/buffer-helper.ts"),i=o("./src/controller/fragment-finders.ts"),r=o("./src/utils/discontinuities.ts"),E=o("./src/controller/level-helper.ts"),s=o("./src/controller/fragment-tracker.ts"),_=o("./src/controller/base-stream-controller.ts"),T=o("./src/types/loader.ts"),l=o("./src/types/level.ts");function S(e,t){for(var o=0;o=n[E].start&&r<=n[E].end){i=n[E];break}var s=o.start+o.duration;i?i.end=s:(i={start:r,end:s},n.push(i)),this.fragmentTracker.fragBuffered(o)}}},N.onBufferFlushing=function(e,t){var o=t.startOffset,a=t.endOffset;if(0===o&&a!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,i=this.levels;if(!i.length||!i[n]||!i[n].details)return;var r=a-i[n].details.targetduration;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach((function(e){for(var t=0;t=T.length||n!==s)&&l){if(this.mediaBuffer=this.mediaBufferTimeRanges,a.live||null!==(o=l.details)&&void 0!==o&&o.live){var S=this.mainDetails;if(a.deltaUpdateFailed||!S)return;var u=S.fragments[0];l.details?0===this.alignPlaylists(a,l.details)&&u&&Object(E.addSliding)(a,u.start):a.hasProgramDateTime&&S.hasProgramDateTime?Object(r.alignMediaPlaylistByPDT)(a,S):u&&Object(E.addSliding)(a,u.start)}l.details=a,this.levelLastLoaded=n,this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===_.State.IDLE&&(Object(i.findFragmentByPTS)(null,a.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),l.details=void 0))}}},N._handleFragmentLoadComplete=function(e){var t=e.frag,o=e.payload,n=t.decryptdata,i=this.hls;if(!this.fragContextChanged(t)&&o&&o.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){var r=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(o),n.key.buffer,n.iv.buffer).then((function(e){var o=performance.now();i.trigger(a.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:r,tdecrypt:o}})}))}},N.doTick=function(){if(this.media){if(this.state===_.State.IDLE){var e=this.currentTrackId,t=this.levels;if(!t.length||!t[e]||!t[e].details)return;var o=t[e].details,a=o.targetduration,r=this.config,E=this.media,T=n.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],E.currentTime-a,r.maxBufferHole),l=T.end;if(T.len>this.getMaxBufferLength()+a)return;console.assert(o,"Subtitle track details are defined on idle subtitle stream controller tick");var S,u=o.fragments,d=u.length,c=o.edge,I=this.fragPrevious;if(l>>=0)>a-1)throw new DOMException("Failed to execute '"+t+"' on 'TimeRanges': The index provided ("+o+") is greater than the maximum bound ("+a+")");return e[o][t]};this.buffered={get length(){return e.length},end:function(o){return t("end",o,e.length)},start:function(o){return t("start",o,e.length)}}}},"./src/controller/subtitle-track-controller.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/events.ts"),n=o("./src/utils/texttrack-utils.ts"),i=o("./src/controller/base-playlist-controller.ts"),r=o("./src/types/loader.ts");function E(e,t){for(var o=0;o-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))},u.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},u.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),T(this.media.textTracks).forEach((function(e){Object(n.clearCurrentCues)(e)})),this.subtitleTrack=-1,this.media=null)},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},u.onSubtitleTrackLoaded=function(e,t){var o=t.id,a=t.details,n=this.trackId,i=this.tracksInGroup[n];if(i){var r=i.details;i.details=t.details,this.log("subtitle track "+o+" loaded ["+a.startSN+"-"+a.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,t,r))}else this.warn("Invalid subtitle track id "+o)},u.onLevelLoading=function(e,t){this.switchLevel(t.level)},u.onLevelSwitching=function(e,t){this.switchLevel(t.level)},u.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var o=t.textGroupIds[t.urlId];if(this.groupId!==o){var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,i=this.tracks.filter((function(e){return!o||e.groupId===o}));this.tracksInGroup=i;var r=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=o;var E={subtitleTracks:i};this.log("Updating subtitle tracks, "+i.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(a.Events.SUBTITLE_TRACKS_UPDATED,E),-1!==r&&this.setSubtitleTrack(r,n)}}},u.findTrackId=function(e){for(var t=this.tracksInGroup,o=0;o=n.length)){this.clearTimer();var i=n[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,i){var r=i.id,E=i.groupId,s=void 0===E?"":E,_=i.name,T=i.type,l=i.url;this.hls.trigger(a.Events.SUBTITLE_TRACK_SWITCH,{id:r,groupId:s,name:_,type:T,url:l});var S=this.switchParams(i.url,null==t?void 0:t.details);this.loadPlaylist(S)}else this.hls.trigger(a.Events.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=T(this.media.textTracks),o=0;o-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}])&&E(_.prototype,l),S&&E(_,S),Object.defineProperty(_,"prototype",{writable:!1}),i})(i.default);function T(e){for(var t=[],o=0;o=0&&(S[0]=Math.min(S[0],t),S[1]=Math.max(S[1],o),T=!0,u/(o-t)>.5))return}if(T||i.push([t,o]),this.config.renderTextTracksNatively){var d=this.captionsTracks[e];this.Cues.newCue(d,t,o,a)}else{var c=this.Cues.newCue(null,t,o,a);this.hls.trigger(n.Events.CUES_PARSED,{type:"captions",cues:c,track:e})}},t.onInitPtsFound=function(e,t){var o=this,a=t.frag,i=t.id,r=t.initPTS,E=t.timescale,s=this.unparsedVttFrags;"main"===i&&(this.initPTS[a.cc]=r,this.timescale[a.cc]=E),s.length&&(this.unparsedVttFrags=[],s.forEach((function(e){o.onFragLoaded(n.Events.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var o=0;o>>8^255&I^99,e[u]=I,t[I]=u;var A=S[u],O=S[A],N=S[O],R=257*S[I]^16843008*I;a[u]=R<<24|R>>>8,n[u]=R<<16|R>>>16,i[u]=R<<8|R>>>24,r[u]=R,R=16843009*N^65537*O^257*A^16843008*u,s[I]=R<<24|R>>>8,_[I]=R<<16|R>>>16,T[I]=R<<8|R>>>24,l[I]=R,u?(u=A^S[S[S[N^A]]],d^=S[S[d]]):u=d=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),o=!0,a=0;a>>6);var d=(60&t[o+2])>>>2;if(!(d>u.length-1))return _=(1&t[o+2])<<2,_|=(192&t[o+3])>>>6,a.logger.log("manifest codec:"+r+", ADTS type:"+E+", samplingIndex:"+d),/firefox/i.test(l)?d>=6?(E=5,T=new Array(4),s=d-3):(E=2,T=new Array(2),s=d):-1!==l.indexOf("android")?(E=2,T=new Array(2),s=d):(E=5,T=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?s=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===_||/vivaldi/i.test(l))||!r&&1===_)&&(E=2,T=new Array(2)),s=d)),T[0]=E<<3,T[0]|=(14&d)>>1,T[1]|=(1&d)<<7,T[1]|=_<<3,5===E&&(T[1]|=(14&s)>>1,T[2]=(1&s)<<7,T[2]|=8,T[3]=0),{config:T,samplerate:u[d],channelCount:_,codec:"mp4a.40."+E,manifestCodec:S};e.trigger(i.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+d})}function E(e,t){return 255===e[t]&&240==(246&e[t+1])}function s(e,t){return 1&e[t+1]?7:9}function _(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function T(e,t){return t+5=e.length)return!1;var a=_(e,t);if(a<=o)return!1;var n=t+a;return n===e.length||l(e,n)}return!1}function d(e,t,o,n,i){if(!e.samplerate){var E=r(t,o,n,i);if(!E)return;e.config=E.config,e.samplerate=E.samplerate,e.channelCount=E.channelCount,e.codec=E.codec,e.manifestCodec=E.manifestCodec,a.logger.log("parsed codec:"+e.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function c(e){return 9216e4/e}function I(e,t){var o=s(e,t);if(t+o<=e.length){var a=_(e,t)-o;if(a>0)return{headerLength:o,frameLength:a}}}function A(e,t,o,a,n){var i,r=a+n*c(e.samplerate),E=I(t,o);if(E){var s=E.frameLength,_=E.headerLength,T=_+s,l=Math.max(0,o+T-t.length);l?(i=new Uint8Array(T-_)).set(t.subarray(o+_,t.length),0):i=t.subarray(o+_,o+T);var S={unit:i,pts:r};return l||e.samples.push(S),{sample:S,length:T,missing:l}}var u=t.length-o;return(i=new Uint8Array(u)).set(t.subarray(o,t.length),0),{sample:{unit:i,pts:r},length:u,missing:-1}}},"./src/demux/base-audio-demuxer.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"initPTSFn",(function(){return T}));var a=o("./src/polyfills/number.ts"),n=o("./src/demux/id3.ts"),i=o("./src/types/demuxer.ts"),r=o("./src/demux/dummy-demuxed-track.ts"),E=o("./src/utils/mp4-tools.ts"),s=o("./src/utils/typed-array.ts"),_=(function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,o,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(e){this.initPTS=e,this.resetContiguity()},t.resetContiguity=function(){this.basePTS=null,this.frameIndex=0},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,o){},t.demux=function(e,t){this.cachedData&&(e=Object(E.appendUint8Array)(this.cachedData,e),this.cachedData=null);var o,_,l=n.getID3Data(e,0),S=l?l.length:0,u=this._audioTrack,d=this._id3Track,c=l?n.getTimeStamp(l):void 0,I=e.length;for((null===this.basePTS||0===this.frameIndex&&Object(a.isFiniteNumber)(c))&&(this.basePTS=T(c,t,this.initPTS)),l&&l.length>0&&d.samples.push({pts:this.basePTS,dts:this.basePTS,data:l,type:i.MetadataSchema.audioId3}),_=this.basePTS;Se?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),o=this.word>>>32-t;return e>32&&a.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?o<>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,o=8,a=0;a0)return e.subarray(o,o+a)},E=function(e,t){var o=0;return o=(127&e[t])<<21,o|=(127&e[t+1])<<14,o|=(127&e[t+2])<<7,o|=127&e[t+3]},s=function(e,t){return n(e,t)&&E(e,t+6)+10<=e.length-t},_=function(e){for(var t=S(e),o=0;o>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(i);break;case 12:case 13:r=e[T++],_+=String.fromCharCode((31&i)<<6|63&r);break;case 14:r=e[T++],E=e[T++],_+=String.fromCharCode((15&i)<<12|(63&r)<<6|(63&E)<<0)}}return _},N={decodeTextFrame:c};function R(){return a||void 0===self.TextDecoder||(a=new self.TextDecoder("utf-8")),a}},"./src/demux/mp3demuxer.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/demux/base-audio-demuxer.ts"),n=o("./src/demux/id3.ts"),i=o("./src/utils/logger.ts"),r=o("./src/demux/mpegaudio.ts");function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}var s=(function(e){var t,o;function a(){return e.apply(this,arguments)||this}o=e,(t=a).prototype=Object.create(o.prototype),t.prototype.constructor=t,E(t,o);var s=a.prototype;return s.resetInitSegment=function(t,o,a,n){e.prototype.resetInitSegment.call(this,t,o,a,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:o,duration:n,inputTimeScale:9e4,dropped:0}},a.probe=function(e){if(!e)return!1;for(var t=(n.getID3Data(e,0)||[]).length,o=e.length;t16384?e.subarray(0,16384):e,Object(i.findBox)(e,["moof"]).length>0},t.demux=function(e,t){this.timeOffset=t;var o=e,a=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(o=Object(i.appendUint8Array)(this.remainderData,e));var r=Object(i.segmentValidRange)(o);this.remainderData=r.remainder,a.samples=r.valid||new Uint8Array}else a.samples=o;var E=this.extractID3Track(a,t);return n.samples=Object(i.parseSamples)(t,a),{videoTrack:a,audioTrack:this.audioTrack,id3Track:E,textTrack:this.txtTrack}},t.flush=function(){var e=this.timeOffset,t=this.videoTrack,o=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var a=this.extractID3Track(t,this.timeOffset);return o.samples=Object(i.parseSamples)(e,t),{videoTrack:t,audioTrack:Object(r.dummyTrack)(),id3Track:a,textTrack:Object(r.dummyTrack)()}},t.extractID3Track=function(e,t){var o=this.id3Track;if(e.samples.length){var r=Object(i.findBox)(e.samples,["emsg"]);r&&r.forEach((function(e){var r=Object(i.parseEmsg)(e);if(E.test(r.schemeIdUri)){var s=Object(a.isFiniteNumber)(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale,_=r.payload;o.samples.push({data:_,len:_.byteLength,dts:s,pts:s,type:n.MetadataSchema.emsg})}}))}return o},t.demuxSampleAes=function(e,t,o){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e})();t.default=s},"./src/demux/mpegaudio.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"appendFrame",(function(){return s})),o.d(t,"parseHeader",(function(){return _})),o.d(t,"isHeaderPattern",(function(){return T})),o.d(t,"isHeader",(function(){return l})),o.d(t,"canParse",(function(){return S})),o.d(t,"probe",(function(){return u}));var a=null,n=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],i=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],r=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],E=[0,1,1,4];function s(e,t,o,a,n){if(!(o+24>t.length)){var i=_(t,o);if(i&&o+i.frameLength<=t.length){var r=a+n*(9e4*i.samplesPerFrame/i.sampleRate),E={unit:t.subarray(o,o+i.frameLength),pts:r,dts:r};return e.config=[],e.channelCount=i.channelCount,e.samplerate=i.sampleRate,e.samples.push(E),{sample:E,length:i.frameLength,missing:0}}}}function _(e,t){var o=e[t+1]>>3&3,s=e[t+1]>>1&3,_=e[t+2]>>4&15,T=e[t+2]>>2&3;if(1!==o&&0!==_&&15!==_&&3!==T){var l=e[t+2]>>1&1,S=e[t+3]>>6,u=1e3*n[14*(3===o?3-s:3===s?3:4)+_-1],d=i[3*(3===o?0:2===o?1:2)+T],c=3===S?1:2,I=r[o][s],A=E[s],O=8*I*A,N=Math.floor(I*u/d+l)*A;if(null===a){var R=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);a=R?parseInt(R[1]):0}return!!a&&a<=87&&2===s&&u>=224e3&&0===S&&(e[t+3]=128|e[t+3]),{sampleRate:d,channelCount:c,frameLength:N,samplesPerFrame:O}}}function T(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function l(e,t){return t+1=e.length)return void o();if(!(e[t].unit.length<32)){var a=this.decrypter.isSync();if(this.decryptAacSample(e,t,o,a),!a)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,o=new Int8Array(t),a=0,n=32;n=e.length)return void a();for(var n=e[t].units;!(o>=n.length);o++){var i=n[o];if(!(i.data.length<=48||1!==i.type&&5!==i.type)){var r=this.decrypter.isSync();if(this.decryptAvcSample(e,t,o,a,i,r),!r)return}}}},e})();t.default=i},"./src/demux/transmuxer-interface.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return l}));var a=o("./node_modules/webworkify-webpack/index.js"),n=o("./src/events.ts"),i=o("./src/demux/transmuxer.ts"),r=o("./src/utils/logger.ts"),E=o("./src/errors.ts"),s=o("./src/utils/mediasource-helper.ts"),_=o("./node_modules/eventemitter3/index.js"),T=Object(s.getMediaSource)()||{isTypeSupported:function(){return!1}},l=(function(){function e(e,t,o,s){var l=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=e,this.id=t,this.onTransmuxComplete=o,this.onFlush=s;var S=e.config,u=function(t,o){(o=o||{}).frag=l.frag,o.id=l.id,e.trigger(t,o)};this.observer=new _.EventEmitter,this.observer.on(n.Events.FRAG_DECRYPTED,u),this.observer.on(n.Events.ERROR,u);var d={mp4:T.isTypeSupported("video/mp4"),mpeg:T.isTypeSupported("audio/mpeg"),mp3:T.isTypeSupported('audio/mp4; codecs="mp3"')},c=navigator.vendor;if(S.enableWorker&&"undefined"!=typeof Worker){var I;r.logger.log("demuxing in webworker");try{I=this.worker=a("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),I.addEventListener("message",this.onwmsg),I.onerror=function(t){e.trigger(n.Events.ERROR,{type:E.ErrorTypes.OTHER_ERROR,details:E.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},I.postMessage({cmd:"init",typeSupported:d,vendor:c,id:t,config:JSON.stringify(S)})}catch(e){r.logger.warn("Error in worker:",e),r.logger.error("Error while initializing DemuxerWorker, fallback to inline"),I&&self.URL.revokeObjectURL(I.objectURL),this.transmuxer=new i.default(this.observer,d,S,c,t),this.worker=null}}else this.transmuxer=new i.default(this.observer,d,S,c,t)}var t=e.prototype;return t.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null,this.onwmsg=void 0;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},t.push=function(e,t,o,a,n,E,s,_,T,l){var S,u,d=this;T.transmuxing.start=self.performance.now();var c=this.transmuxer,I=this.worker,A=E?E.start:n.start,O=n.decryptdata,N=this.frag,R=!(N&&n.cc===N.cc),m=!(N&&T.level===N.level),p=N?T.sn-N.sn:-1,h=this.part?T.part-this.part.index:-1,L=0===p&&T.id>1&&T.id===(null==N?void 0:N.stats.chunkCount),f=!m&&(1===p||0===p&&(1===h||L&&h<=0)),C=self.performance.now();(m||p||0===n.stats.parsing.start)&&(n.stats.parsing.start=C),!E||!h&&f||(E.stats.parsing.start=C);var D=!(N&&(null===(S=n.initSegment)||void 0===S?void 0:S.url)===(null===(u=N.initSegment)||void 0===u?void 0:u.url)),g=new i.TransmuxState(R,f,_,m,A,D);if(!f||R||D){r.logger.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+T.sn+" p: "+T.part+" level: "+T.level+" id: "+T.id+"\n discontinuity: "+R+"\n trackSwitch: "+m+"\n contiguous: "+f+"\n accurateTimeOffset: "+_+"\n timeOffset: "+A+"\n initSegmentChange: "+D);var v=new i.TransmuxConfig(o,a,t,s,l);this.configureTransmuxer(v)}if(this.frag=n,this.part=E,I)I.postMessage({cmd:"demux",data:e,decryptdata:O,chunkMeta:T,state:g},e instanceof ArrayBuffer?[e]:[]);else if(c){var y=c.push(e,O,T,g);Object(i.isPromise)(y)?y.then((function(e){d.handleTransmuxComplete(e)})):this.handleTransmuxComplete(y)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var o=this.transmuxer,a=this.worker;if(a)a.postMessage({cmd:"flush",chunkMeta:e});else if(o){var n=o.flush(e);Object(i.isPromise)(n)?n.then((function(o){t.handleFlushResult(o,e)})):this.handleFlushResult(n,e)}},t.handleFlushResult=function(e,t){var o=this;e.forEach((function(e){o.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,o=this.hls;switch(t.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":r.logger[t.data.logType]&&r.logger[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,o.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,o=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):o&&o.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e})()},"./src/demux/transmuxer-worker.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return E}));var a=o("./src/demux/transmuxer.ts"),n=o("./src/events.ts"),i=o("./src/utils/logger.ts"),r=o("./node_modules/eventemitter3/index.js");function E(e){var t=new r.EventEmitter,o=function(t,o){e.postMessage({event:t,data:o})};t.on(n.Events.FRAG_DECRYPTED,o),t.on(n.Events.ERROR,o),e.addEventListener("message",(function(n){var r=n.data;switch(r.cmd){case"init":var E=JSON.parse(r.config);e.transmuxer=new a.default(t,r.typeSupported,E,r.vendor,r.id),Object(i.enableLogs)(E.debug),(function(){var e=function(e){i.logger[e]=function(t){o("workerLog",{logType:e,message:t})}};for(var t in i.logger)e(t)})(),o("init",null);break;case"configure":e.transmuxer.configure(r.config);break;case"demux":var _=e.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(a.isPromise)(_)?_.then((function(t){s(e,t)})):s(e,_);break;case"flush":var l=r.chunkMeta,S=e.transmuxer.flush(l);Object(a.isPromise)(S)?S.then((function(t){T(e,t,l)})):T(e,S,l)}}))}function s(e,t){if(!((o=t.remuxResult).audio||o.video||o.text||o.id3||o.initSegment))return!1;var o,a=[],n=t.remuxResult,i=n.audio,r=n.video;return i&&_(a,i),r&&_(a,r),e.postMessage({event:"transmuxComplete",data:t},a),!0}function _(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function T(e,t,o){t.reduce((function(t,o){return s(e,o)||t}),!1)||e.postMessage({event:"transmuxComplete",data:t[0]}),e.postMessage({event:"flush",data:o})}},"./src/demux/transmuxer.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return c})),o.d(t,"isPromise",(function(){return A})),o.d(t,"TransmuxConfig",(function(){return O})),o.d(t,"TransmuxState",(function(){return N}));var a,n=o("./src/events.ts"),i=o("./src/errors.ts"),r=o("./src/crypt/decrypter.ts"),E=o("./src/demux/aacdemuxer.ts"),s=o("./src/demux/mp4demuxer.ts"),_=o("./src/demux/tsdemuxer.ts"),T=o("./src/demux/mp3demuxer.ts"),l=o("./src/remux/mp4-remuxer.ts"),S=o("./src/remux/passthrough-remuxer.ts"),u=o("./src/utils/logger.ts");try{a=self.performance.now.bind(self.performance)}catch(e){u.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var d=[{demux:_.default,remux:l.default},{demux:s.default,remux:S.default},{demux:E.default,remux:l.default},{demux:T.default,remux:l.default}],c=(function(){function e(e,t,o,a,n){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=o,this.vendor=a,this.id=n}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,o,n){var i=this,r=o.transmuxing;r.executeStart=a();var E=new Uint8Array(e),s=this.config,_=this.currentTransmuxState,T=this.transmuxConfig;n&&(this.currentTransmuxState=n);var l=n||_,S=l.contiguous,u=l.discontinuity,d=l.trackSwitch,c=l.accurateTimeOffset,A=l.timeOffset,O=l.initSegmentChange,N=T.audioCodec,R=T.videoCodec,m=T.defaultInitPts,p=T.duration,h=T.initSegmentData;(u||d||O)&&this.resetInitSegment(h,N,R,p),(u||O)&&this.resetInitialTimestamp(m),S||this.resetContiguity();var L=(function(e,t){var o=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(o=t),o})(E,t);if(L&&"AES-128"===L.method){var f=this.getDecrypter();if(!s.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(E,L.key.buffer,L.iv.buffer).then((function(e){var t=i.push(e,null,o);return i.decryptionPromise=null,t})),this.decryptionPromise;var C=f.softwareDecrypt(E,L.key.buffer,L.iv.buffer);if(!C)return r.executeEnd=a(),I(o);E=new Uint8Array(C)}this.needsProbing(E,u,d)&&this.configureTransmuxer(E,T);var D=this.transmux(E,L,A,c,o),g=this.currentTransmuxState;return g.contiguous=!0,g.discontinuity=!1,g.trackSwitch=!1,r.executeEnd=a(),D},t.flush=function(e){var t=this,o=e.transmuxing;o.executeStart=a();var r=this.decrypter,E=this.currentTransmuxState,s=this.decryptionPromise;if(s)return s.then((function(){return t.flush(e)}));var _=[],T=E.timeOffset;if(r){var l=r.flush();l&&_.push(this.push(l,null,e))}var S=this.demuxer,u=this.remuxer;if(!S||!u)return this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),o.executeEnd=a(),[I(e)];var d=S.flush(T);return A(d)?d.then((function(o){return t.flushRemux(_,o,e),_})):(this.flushRemux(_,d,e),_)},t.flushRemux=function(e,t,o){var n=t.audioTrack,i=t.videoTrack,r=t.id3Track,E=t.textTrack,s=this.currentTransmuxState,_=s.accurateTimeOffset,T=s.timeOffset;u.logger.log("[transmuxer.ts]: Flushed fragment "+o.sn+(o.part>-1?" p: "+o.part:"")+" of level "+o.level);var l=this.remuxer.remux(n,i,r,E,T,_,!0,this.id);e.push({remuxResult:l,chunkMeta:o}),o.transmuxing.executeEnd=a()},t.resetInitialTimestamp=function(e){var t=this.demuxer,o=this.remuxer;t&&o&&(t.resetTimeStamp(e),o.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,o,a){var n=this.demuxer,i=this.remuxer;n&&i&&(n.resetInitSegment(e,t,o,a),i.resetInitSegment(e,t,o))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,o,a,n){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,o,a,n):this.transmuxUnencrypted(e,o,a,n)},t.transmuxUnencrypted=function(e,t,o,a){var n=this.demuxer.demux(e,t,!1,!this.config.progressive),i=n.audioTrack,r=n.videoTrack,E=n.id3Track,s=n.textTrack;return{remuxResult:this.remuxer.remux(i,r,E,s,t,o,!1,this.id),chunkMeta:a}},t.transmuxSampleAes=function(e,t,o,a,n){var i=this;return this.demuxer.demuxSampleAes(e,t,o).then((function(e){return{remuxResult:i.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,o,a,!1,i.id),chunkMeta:n}}))},t.configureTransmuxer=function(e,t){for(var o,a=this.config,n=this.observer,i=this.typeSupported,r=this.vendor,E=t.audioCodec,_=t.defaultInitPts,T=t.duration,l=t.initSegmentData,c=t.videoCodec,I=0,A=d.length;I>4>1){if((y=D+5+e[D+4])===D+188)continue}else y=D+4;switch(v){case u:g&&(d&&(n=A(d))&&this.parseAVCPES(i,S,n,!1),d={data:[],size:0}),d&&(d.data.push(e.subarray(y,D+188)),d.size+=D+188-y);break;case O:if(g){if(R&&(n=A(R)))switch(r.segmentCodec){case"aac":this.parseAACPES(r,n);break;case"mp3":this.parseMPEGPES(r,n)}R={data:[],size:0}}R&&(R.data.push(e.subarray(y,D+188)),R.size+=D+188-y);break;case N:g&&(m&&(n=A(m))&&this.parseID3PES(l,n),m={data:[],size:0}),m&&(m.data.push(e.subarray(y,D+188)),m.size+=D+188-y);break;case 0:g&&(y+=e[y]+1),L=this._pmtId=c(e,y);break;case L:g&&(y+=e[y]+1);var P=I(e,y,this.typeSupported,o);(u=P.avc)>0&&(i.pid=u),(O=P.audio)>0&&(r.pid=O,r.segmentCodec=P.segmentCodec),(N=P.id3)>0&&(l.pid=N),null===p||h||(_.logger.log("unknown PID '"+p+"' in TS found"),p=null),h=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=v}}else C++;C>0&&this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+C+" TS packet/s that do not start with 0x47"}),i.pesData=d,r.pesData=R,l.pesData=m;var B={audioTrack:r,videoTrack:i,id3Track:l,textTrack:S};return a&&this.extractRemainingSamples(B),B},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,o=e.audioTrack,a=e.videoTrack,n=e.id3Track,i=e.textTrack,r=a.pesData,E=o.pesData,s=n.pesData;if(r&&(t=A(r))?(this.parseAVCPES(a,i,t,!0),a.pesData=null):a.pesData=r,E&&(t=A(E))){switch(o.segmentCodec){case"aac":this.parseAACPES(o,t);break;case"mp3":this.parseMPEGPES(o,t)}o.pesData=null}else null!=E&&E.size&&_.logger.log("last AAC PES packet truncated,might overlap between fragments"),o.pesData=E;s&&(t=A(s))?(this.parseID3PES(n,t),n.pesData=null):n.pesData=s},t.demuxSampleAes=function(e,t,o){var a=this.demux(e,o,!0,!this.config.progressive),n=this.sampleAes=new r.default(this.observer,this.config,t);return this.decrypt(a,n)},t.decrypt=function(e,t){return new Promise((function(o){var a=e.audioTrack,n=e.videoTrack;a.samples&&"aac"===a.segmentCodec?t.decryptAacSamples(a.samples,0,(function(){n.samples?t.decryptAvcSamples(n.samples,0,0,(function(){o(e)})):o(e)})):n.samples&&t.decryptAvcSamples(n.samples,0,0,(function(){o(e)}))}))},t.destroy=function(){this._duration=0},t.parseAVCPES=function(e,t,o,a){var n,r=this,E=this.parseAVCNALu(e,o.data),_=this.avcSample,T=!1;o.data=null,_&&E.length&&!e.audFound&&(O(_,e),_=this.avcSample=d(!1,o.pts,o.dts,"")),E.forEach((function(a){switch(a.type){case 1:n=!0,_||(_=r.avcSample=d(!0,o.pts,o.dts,"")),_.frame=!0;var E=a.data;if(T&&E.length>4){var l=new i.default(E).readSliceType();2!==l&&4!==l&&7!==l&&9!==l||(_.key=!0)}break;case 5:n=!0,_||(_=r.avcSample=d(!0,o.pts,o.dts,"")),_.key=!0,_.frame=!0;break;case 6:n=!0,Object(s.parseSEIMessageFromNALu)(N(a.data),o.pts,t.samples);break;case 7:if(n=!0,T=!0,!e.sps){var S=new i.default(a.data).readSPS();e.width=S.width,e.height=S.height,e.pixelRatio=S.pixelRatio,e.sps=[a.data],e.duration=r._duration;for(var u=a.data.subarray(1,4),c="avc1.",I=0;I<3;I++){var A=u[I].toString(16);A.length<2&&(A="0"+A),c+=A}e.codec=c}break;case 8:n=!0,e.pps||(e.pps=[a.data]);break;case 9:n=!1,e.audFound=!0,_&&O(_,e),_=r.avcSample=d(!1,o.pts,o.dts,"");break;case 12:n=!0;break;default:n=!1,_&&(_.debug+="unknown NAL "+a.type+" ")}_&&n&&_.units.push(a)})),a&&_&&(O(_,e),this.avcSample=null)},t.getLastNalUnit=function(e){var t,o,a=this.avcSample;if(a&&0!==a.units.length||(a=e[e.length-1]),null!==(t=a)&&void 0!==t&&t.units){var n=a.units;o=n[n.length-1]}return o},t.parseAVCNALu=function(e,t){var o,a,n=t.byteLength,i=e.naluState||0,r=i,E=[],s=0,_=-1,T=0;for(-1===i&&(_=0,T=31&t[0],i=0,s=1);s=0){var l={data:t.subarray(_,s-i-1),type:T};E.push(l)}else{var S=this.getLastNalUnit(e.samples);if(S&&(r&&s<=4-r&&S.state&&(S.data=S.data.subarray(0,S.data.byteLength-r)),(a=s-i-1)>0)){var u=new Uint8Array(S.data.byteLength+a);u.set(S.data,0),u.set(t.subarray(0,a),S.data.byteLength),S.data=u,S.state=0}}s=0&&i>=0){var d={data:t.subarray(_,n),type:T,state:i};E.push(d)}if(0===E.length){var c=this.getLastNalUnit(e.samples);if(c){var I=new Uint8Array(c.data.byteLength+t.byteLength);I.set(c.data,0),I.set(t,c.data.byteLength),c.data=I}}return e.naluState=i,E},t.parseAACPES=function(e,t){var o,n,i,r,s,l=0,S=this.aacOverFlow,u=t.data;if(S){this.aacOverFlow=null;var d=S.missing,c=S.sample.unit.byteLength;if(-1===d){var I=new Uint8Array(c+u.byteLength);I.set(S.sample.unit,0),I.set(u,c),u=I}else{var A=c-d;S.sample.unit.set(u.subarray(0,d),A),e.samples.push(S.sample),l=S.missing}}for(o=l,n=u.length;o1;){var s=new Uint8Array(E[0].length+E[1].length);s.set(E[0]),s.set(E[1],E[0].length),E[0]=s,E.splice(1,1)}if(1===((t=E[0])[0]<<16)+(t[1]<<8)+t[2]){if((o=(t[4]<<8)+t[5])&&o>e.size-6)return null;var T=t[7];192&T&&(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&T?n-(i=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(_.logger.warn(Math.round((n-i)/9e4)+"s delta between PTS and DTS, align them"),n=i):i=n);var l=(a=t[8])+9;if(e.size<=l)return null;e.size-=l;for(var S=new Uint8Array(e.size),u=0,d=E.length;uc){l-=c;continue}t=t.subarray(l),c-=l,l=0}S.set(t,r),r+=c}return o&&(o-=a+3),{data:S,pts:n,dts:i,len:o}}return null}function O(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var o=t.samples,a=o.length;if(!a)return void t.dropped++;var n=o[a-1];e.pts=n.pts,e.dts=n.dts}t.samples.push(e)}e.debug.length&&_.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function N(e){for(var t=e.byteLength,o=[],a=1;a=t)return a;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}])&&A(t.prototype,o),O&&A(t,O),Object.defineProperty(t,"prototype",{writable:!1}),e})();O.defaultConfig=void 0},"./src/is-supported.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"isSupported",(function(){return i})),o.d(t,"changeTypeSupported",(function(){return r}));var a=o("./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function i(){var e=Object(a.getMediaSource)();if(!e)return!1;var t=n(),o=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),i=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!o&&!!i}function r(){var e,t=n();return"function"==typeof(null==t||null===(e=t.prototype)||void 0===e?void 0:e.changeType)}},"./src/loader/date-range.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"DateRangeAttribute",(function(){return a})),o.d(t,"DateRange",(function(){return _}));var a,n=o("./src/polyfills/number.ts"),i=o("./src/utils/attr-list.ts"),r=o("./src/utils/logger.ts");function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(!this.endOnNext||!!this.class)}}])&&s(t.prototype,o),_&&s(t,_),Object.defineProperty(t,"prototype",{writable:!1}),e})()},"./src/loader/fragment-loader.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return l})),o.d(t,"LoadError",(function(){return u}));var a=o("./src/polyfills/number.ts"),n=o("./src/errors.ts");function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||(o=e,-1===Function.toString.call(o).indexOf("[native code]")))return e;var o;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return r(e,arguments,_(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s(a,e)},i(e)}function r(e,t,o){return r=E()?Reflect.construct.bind():function(e,t,o){var a=[null];a.push.apply(a,t);var n=new(Function.bind.apply(e,a));return o&&s(n,o.prototype),n},r.apply(null,arguments)}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function s(e,t){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s(e,t)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}var T=Math.pow(2,17),l=(function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var o=this,a=e.url;if(!a)return Promise.reject(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(a?"part list":"url")));this.abort();var i=this.config,r=i.fLoader,E=i.loader;return new Promise((function(a,s){o.loader&&o.loader.destroy();var _=o.loader=e.loader=r?new r(i):new E(i),l=S(e),d={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:"initSegment"===e.sn?1/0:T};e.stats=_.stats,_.load(l,d,{onSuccess:function(t,n,i,r){o.resetLoader(e,_),a({frag:e,part:null,payload:t.data,networkDetails:r})},onError:function(t,a,i){o.resetLoader(e,_),s(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:i}))},onAbort:function(t,a,i){o.resetLoader(e,_),s(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:i}))},onTimeout:function(t,a,i){o.resetLoader(e,_),s(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:i}))},onProgress:function(o,a,n,i){t&&t({frag:e,part:null,payload:n,networkDetails:i})}})}))},t.loadPart=function(e,t,o){var a=this;this.abort();var i=this.config,r=i.fLoader,E=i.loader;return new Promise((function(s,_){a.loader&&a.loader.destroy();var l=a.loader=e.loader=r?new r(i):new E(i),d=S(e,t),c={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:T};t.stats=l.stats,l.load(d,c,{onSuccess:function(n,i,r,E){a.resetLoader(e,l),a.updateStatsFromPart(e,t);var _={frag:e,part:t,payload:n.data,networkDetails:E};o(_),s(_)},onError:function(o,i,r){a.resetLoader(e,l),_(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:o,networkDetails:r}))},onAbort:function(o,i,r){e.stats.aborted=t.stats.aborted,a.resetLoader(e,l),_(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:r}))},onTimeout:function(o,i,r){a.resetLoader(e,l),_(new u({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:r}))}})}))},t.updateStatsFromPart=function(e,t){var o=e.stats,a=t.stats,n=a.total;if(o.loaded+=a.loaded,n){var i=Math.round(e.duration/t.duration),r=Math.min(Math.round(o.loaded/n),i),E=(i-r)*Math.round(o.loaded/r);o.total=o.loaded+E}else o.total=Math.max(o.loaded,o.total);var s=o.loading,_=a.loading;s.start?s.first+=_.first-_.start:(s.start=_.start,s.first=_.first),s.end=_.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e})();function S(e,t){void 0===t&&(t=null);var o=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:o.url,headers:{},rangeStart:0,rangeEnd:0},i=o.byteRangeStartOffset,r=o.byteRangeEndOffset;return Object(a.isFiniteNumber)(i)&&Object(a.isFiniteNumber)(r)&&(n.rangeStart=i,n.rangeEnd=r),n}var u=(function(e){var t,o;function a(t){for(var o,a=arguments.length,n=new Array(a>1?a-1:0),i=1;i>8*(15-o)&255;return t},o.setDecryptDataFromLevelKey=function(e,t){var o=e;return"AES-128"===(null==e?void 0:e.method)&&e.uri&&!e.iv&&((o=E.LevelKey.fromURI(e.uri)).method=e.method,o.iv=this.createInitializationVector(t),o.keyFormat="identity"),o},o.setElementaryStreamInfo=function(e,t,o,a,n,i){void 0===i&&(i=!1);var r=this.elementaryStreams,E=r[e];E?(E.startPTS=Math.min(E.startPTS,t),E.endPTS=Math.max(E.endPTS,o),E.startDTS=Math.min(E.startDTS,a),E.endDTS=Math.max(E.endDTS,n)):r[e]={startPTS:t,endPTS:o,startDTS:a,endDTS:n,partial:i}},o.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[a.AUDIO]=null,e[a.VIDEO]=null,e[a.AUDIOVIDEO]=null},S(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var e=this.sn;"number"!=typeof e&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&r.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),e=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,e)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.isFiniteNumber)(this.programDateTime))return null;var e=Object(n.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;return!(null===(e=this.decryptdata)||void 0===e||!e.keyFormat||!this.decryptdata.uri)}}]),t})(u),c=(function(e){function t(t,o,a,n,i){var r;(r=e.call(this,a)||this).fragOffset=0,r.duration=0,r.gap=!1,r.independent=!1,r.relurl=void 0,r.fragment=void 0,r.index=void 0,r.stats=new s.LoadStats,r.duration=t.decimalFloatingPoint("DURATION"),r.gap=t.bool("GAP"),r.independent=t.bool("INDEPENDENT"),r.relurl=t.enumeratedString("URI"),r.fragment=o,r.index=n;var E=t.enumeratedString("BYTERANGE");return E&&r.setByteRange(E,i),i&&(r.fragOffset=i.fragOffset+i.duration),r}return _(t,e),S(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t})(u)},"./src/loader/key-loader.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return r}));var a=o("./src/events.ts"),n=o("./src/errors.ts"),i=o("./src/utils/logger.ts"),r=(function(){function e(e){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){this.hls.on(a.Events.KEY_LOADING,this.onKeyLoading,this)},t.unregisterListeners=function(){this.hls.off(a.Events.KEY_LOADING,this.onKeyLoading)},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onKeyLoading=function(e,t){var o=t.frag,n=o.type,r=this.loaders[n];if(o.decryptdata){var E=o.decryptdata.uri;if(E!==this.decrypturl||null===this.decryptkey){var s=this.hls.config;if(r&&(i.logger.warn("abort previous key loader for type:"+n),r.abort()),!E)return void i.logger.warn("key uri is falsy");var _=s.loader,T=o.loader=this.loaders[n]=new _(s);this.decrypturl=E,this.decryptkey=null;var l={url:E,frag:o,responseType:"arraybuffer"},S={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},u={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(l,S,u)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(a.Events.KEY_LOADED,{frag:o}))}else i.logger.warn("Missing decryption data on fragment in onKeyLoading")},t.loadsuccess=function(e,t,o){var n=o.frag;n.decryptdata?(this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(a.Events.KEY_LOADED,{frag:n})):i.logger.error("after key load, decryptdata unset")},t.loaderror=function(e,t){var o=t.frag,i=o.loader;i&&i.abort(),delete this.loaders[o.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:e})},t.loadtimeout=function(e,t){var o=t.frag,i=o.loader;i&&i.abort(),delete this.loaders[o.type],this.hls.trigger(a.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},e})()},"./src/loader/level-details.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"LevelDetails",(function(){return i}));var a=o("./src/polyfills/number.ts");function n(e,t){for(var o=0;oe.endSN||t>0||0===t&&o>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=e,(o=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(a.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!==(e=this.fragments)&&void 0!==e&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&n(t.prototype,o),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e})()},"./src/loader/level-key.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"LevelKey",(function(){return i}));var a=o("./node_modules/url-toolkit/src/url-toolkit.js");function n(e,t){for(var o=0;o2){var o=t.shift()+".";return o+=parseInt(t.shift()).toString(16),o+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return e},e.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,o){var a,n=[],i={},r=!1;for(S.lastIndex=0;null!=(a=S.exec(t));)if(a[1]){var E=new _.AttrList(a[1]),s={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:e.resolve(a[2],o)},T=E.decimalResolution("RESOLUTION");T&&(s.width=T.width,s.height=T.height),O((E.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),s),s.videoCodec&&-1!==s.videoCodec.indexOf("avc1")&&(s.videoCodec=e.convertAVC1ToAVCOTI(s.videoCodec)),n.push(s)}else if(a[3]){var l=new _.AttrList(a[3]);l["DATA-ID"]&&(r=!0,i[l["DATA-ID"]]=l)}return{levels:n,sessionData:r?i:null}},e.parseMasterPlaylistMedia=function(t,o,a,n){var i;void 0===n&&(n=[]);var r=[],E=0;for(u.lastIndex=0;null!==(i=u.exec(t));){var s=new _.AttrList(i[1]);if(s.TYPE===a){var T={attrs:s,bitrate:0,id:E++,groupId:s["GROUP-ID"],instreamId:s["INSTREAM-ID"],name:s.NAME||s.LANGUAGE||"",type:a,default:s.bool("DEFAULT"),autoselect:s.bool("AUTOSELECT"),forced:s.bool("FORCED"),lang:s.LANGUAGE,url:s.URI?e.resolve(s.URI,o):""};if(n.length){var l=e.findGroup(n,T.groupId)||n[0];N(T,l,"audioCodec"),N(T,l,"textCodec")}r.push(T)}}return r},e.parseLevelPlaylist=function(e,t,o,l,S){var u,A,O,N=new E.LevelDetails(t),p=N.fragments,h=null,L=0,f=0,C=0,D=0,g=null,v=new r.Fragment(l,t),y=-1,P=!1;for(d.lastIndex=0,N.m3u8=e;null!==(u=d.exec(e));){P&&(P=!1,(v=new r.Fragment(l,t)).start=C,v.sn=L,v.cc=D,v.level=o,h&&(v.initSegment=h,v.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null));var B=u[1];if(B){v.duration=parseFloat(B);var b=(" "+u[2]).slice(1);v.title=b||null,v.tagList.push(b?["INF",B,b]:["INF",B])}else if(u[3])Object(a.isFiniteNumber)(v.duration)&&(v.start=C,O&&(v.levelkey=O),v.sn=L,v.level=o,v.cc=D,v.urlId=S,p.push(v),v.relurl=(" "+u[3]).slice(1),R(v,g),g=v,C+=v.duration,L++,f=0,P=!0);else if(u[4]){var M=(" "+u[4]).slice(1);g?v.setByteRange(M,g):v.setByteRange(M)}else if(u[5])v.rawProgramDateTime=(" "+u[5]).slice(1),v.tagList.push(["PROGRAM-DATE-TIME",v.rawProgramDateTime]),-1===y&&(y=p.length);else{if(!(u=u[0].match(c))){T.logger.warn("No matches on slow regex match for level playlist!");continue}for(A=1;A-1){T.logger.warn("Keyformat "+q+" is not supported from the manifest");continue}if("identity"!==q)continue;K&&(O=s.LevelKey.fromURL(t,j),j&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(K)>=0&&(O.method=K,O.keyFormat=q,$&&(O.keyID=$),X&&(O.keyFormatVersions=X),O.iv=Q));break;case"START":var J=new _.AttrList(U).decimalFloatingPoint("TIME-OFFSET");Object(a.isFiniteNumber)(J)&&(N.startTimeOffset=J);break;case"MAP":var Z=new _.AttrList(U);if(v.duration){var ee=new r.Fragment(l,t);m(ee,Z,o,O),h=ee,v.initSegment=h,h.rawProgramDateTime&&!v.rawProgramDateTime&&(v.rawProgramDateTime=h.rawProgramDateTime)}else m(v,Z,o,O),h=v,P=!0;break;case"SERVER-CONTROL":var te=new _.AttrList(U);N.canBlockReload=te.bool("CAN-BLOCK-RELOAD"),N.canSkipUntil=te.optionalFloat("CAN-SKIP-UNTIL",0),N.canSkipDateRanges=N.canSkipUntil>0&&te.bool("CAN-SKIP-DATERANGES"),N.partHoldBack=te.optionalFloat("PART-HOLD-BACK",0),N.holdBack=te.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var oe=new _.AttrList(U);N.partTarget=oe.decimalFloatingPoint("PART-TARGET");break;case"PART":var ae=N.partList;ae||(ae=N.partList=[]);var ne=f>0?ae[ae.length-1]:void 0,ie=f++,re=new r.Part(new _.AttrList(U),v,t,ie,ne);ae.push(re),v.duration+=re.duration;break;case"PRELOAD-HINT":var Ee=new _.AttrList(U);N.preloadHint=Ee;break;case"RENDITION-REPORT":var se=new _.AttrList(U);N.renditionReports=N.renditionReports||[],N.renditionReports.push(se);break;default:T.logger.warn("line parsed but not handled: "+u)}}}g&&!g.relurl?(p.pop(),C-=g.duration,N.partList&&(N.fragmentHint=g)):N.partList&&(R(v,g),v.cc=D,N.fragmentHint=v);var _e=p.length,Te=p[0],le=p[_e-1];if((C+=N.skippedSegments*N.targetduration)>0&&_e&&le){N.averagetargetduration=C/_e;var Se=le.sn;N.endSN="initSegment"!==Se?Se:0,Te&&(N.startCC=Te.cc,Te.initSegment||N.fragments.every((function(e){return e.relurl&&(t=e.relurl,I.test(null!=(o=null===(a=n.parseURL(t))||void 0===a?void 0:a.path)?o:""));var t,o,a}))&&(T.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(v=new r.Fragment(l,t)).relurl=le.relurl,v.level=o,v.sn="initSegment",Te.initSegment=v,N.needSidxRanges=!0))}else N.endSN=0,N.startCC=0;return N.fragmentHint&&(C+=N.fragmentHint.duration),N.totalduration=C,N.endCC=D,y>0&&(function(e,t){for(var o=e[t],a=t;a--;){var n=e[a];if(!n)return;n.programDateTime=o.programDateTime-1e3*n.duration,o=n}})(p,y),N},e})();function O(e,t){["video","audio","text"].forEach((function(o){var a=e.filter((function(e){return Object(l.isCodecType)(e,o)}));if(a.length){var n=a.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[o+"Codec"]=n.length>0?n[0]:a[0],e=e.filter((function(e){return-1===a.indexOf(e)}))}})),t.unknownCodecs=e}function N(e,t,o){var a=t[o];a&&(e[o]=a)}function R(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(a.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function m(e,t,o,a){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=o,e.sn="initSegment",a&&(e.levelkey=a),e.initSegment=null}},"./src/loader/playlist-loader.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/polyfills/number.ts"),n=o("./src/events.ts"),i=o("./src/errors.ts"),r=o("./src/utils/logger.ts"),E=o("./src/utils/mp4-tools.ts"),s=o("./src/loader/m3u8-parser.ts"),_=o("./src/types/loader.ts"),T=o("./src/utils/attr-list.ts");function l(e,t){var o=e.url;return void 0!==o&&0!==o.indexOf("data:")||(o=t.url),o}var S=(function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.hls=e,this.registerListeners()}var t=e.prototype;return t.startLoad=function(e){},t.stopLoad=function(){this.destroyInternalLoaders()},t.registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,o=t.pLoader,a=t.loader,n=new(o||a)(t);return e.loader=n,this.loaders[e.type]=n,n},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var o=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:_.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var o=t.id,a=t.level,n=t.url,i=t.deliveryDirectives;this.load({id:o,groupId:null,level:a,responseType:"text",type:_.PlaylistContextType.LEVEL,url:n,deliveryDirectives:i})},t.onAudioTrackLoading=function(e,t){var o=t.id,a=t.groupId,n=t.url,i=t.deliveryDirectives;this.load({id:o,groupId:a,level:null,responseType:"text",type:_.PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:i})},t.onSubtitleTrackLoading=function(e,t){var o=t.id,a=t.groupId,n=t.url,i=t.deliveryDirectives;this.load({id:o,groupId:a,level:null,responseType:"text",type:_.PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:i})},t.load=function(e){var t,o,a,n,i,E,s=this.hls.config,T=this.getInternalLoader(e);if(T){var l=T.context;if(l&&l.url===e.url)return void r.logger.trace("[playlist-loader]: playlist request ongoing");r.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),T.abort()}switch(e.type){case _.PlaylistContextType.MANIFEST:o=s.manifestLoadingMaxRetry,a=s.manifestLoadingTimeOut,n=s.manifestLoadingRetryDelay,i=s.manifestLoadingMaxRetryTimeout;break;case _.PlaylistContextType.LEVEL:case _.PlaylistContextType.AUDIO_TRACK:case _.PlaylistContextType.SUBTITLE_TRACK:o=0,a=s.levelLoadingTimeOut;break;default:o=s.levelLoadingMaxRetry,a=s.levelLoadingTimeOut,n=s.levelLoadingRetryDelay,i=s.levelLoadingMaxRetryTimeout}if(T=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===_.PlaylistContextType.LEVEL&&null!==e.level?E=this.hls.levels[e.level].details:e.type===_.PlaylistContextType.AUDIO_TRACK&&null!==e.id?E=this.hls.audioTracks[e.id].details:e.type===_.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(E=this.hls.subtitleTracks[e.id].details),E)){var S=E.partTarget,u=E.targetduration;S&&u&&(a=Math.min(1e3*Math.max(3*S,.8*u),a))}var d={timeout:a,maxRetry:o,retryDelay:n,maxRetryDelay:i,highWaterMark:0},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};T.load(e,d,c)},t.loadsuccess=function(e,t,o,a){if(void 0===a&&(a=null),o.isSidxRequest)return this.handleSidxRequest(e,o),void this.handlePlaylistLoaded(e,t,o,a);this.resetInternalLoader(o.type);var n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,o,a):this.handleMasterPlaylist(e,t,o,a)):this.handleManifestParsingError(e,o,"no EXTM3U delimiter",a)},t.loaderror=function(e,t,o){void 0===o&&(o=null),this.handleNetworkError(t,o,!1,e)},t.loadtimeout=function(e,t,o){void 0===o&&(o=null),this.handleNetworkError(t,o,!0)},t.handleMasterPlaylist=function(e,t,o,a){var i=this.hls,E=e.data,_=l(e,o),S=s.default.parseMasterPlaylist(E,_),u=S.levels,d=S.sessionData;if(u.length){var c=u.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),I=u.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),A=s.default.parseMasterPlaylistMedia(E,_,"AUDIO",c),O=s.default.parseMasterPlaylistMedia(E,_,"SUBTITLES",I),N=s.default.parseMasterPlaylistMedia(E,_,"CLOSED-CAPTIONS");A.length&&(A.some((function(e){return!e.url}))||!u[0].audioCodec||u[0].attrs.AUDIO||(r.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),A.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new T.AttrList({}),bitrate:0,url:""}))),i.trigger(n.Events.MANIFEST_LOADED,{levels:u,audioTracks:A,subtitles:O,captions:N,url:_,stats:t,networkDetails:a,sessionData:d})}else this.handleManifestParsingError(e,o,"no level found in manifest",a)},t.handleTrackOrLevelPlaylist=function(e,t,o,r){var E=this.hls,S=o.id,u=o.level,d=o.type,c=l(e,o),I=Object(a.isFiniteNumber)(S)?S:0,A=Object(a.isFiniteNumber)(u)?u:I,O=(function(e){switch(e.type){case _.PlaylistContextType.AUDIO_TRACK:return _.PlaylistLevelType.AUDIO;case _.PlaylistContextType.SUBTITLE_TRACK:return _.PlaylistLevelType.SUBTITLE;default:return _.PlaylistLevelType.MAIN}})(o),N=s.default.parseLevelPlaylist(e.data,c,A,O,I);if(N.fragments.length){if(d===_.PlaylistContextType.MANIFEST){var R={attrs:new T.AttrList({}),bitrate:0,details:N,name:"",url:c};E.trigger(n.Events.MANIFEST_LOADED,{levels:[R],audioTracks:[],url:c,stats:t,networkDetails:r,sessionData:null})}if(t.parsing.end=performance.now(),N.needSidxRanges){var m,p=null===(m=N.fragments[0].initSegment)||void 0===m?void 0:m.url;this.load({url:p,isSidxRequest:!0,type:d,level:u,levelDetails:N,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else o.levelDetails=N,this.handlePlaylistLoaded(e,t,o,r)}else E.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:c,reason:"no fragments found in level",level:"number"==typeof o.level?o.level:void 0})},t.handleSidxRequest=function(e,t){var o=new Uint8Array(e.data),a=Object(E.findBox)(o,["sidx"])[0];if(a){var n=Object(E.parseSegmentIndex)(a);if(n){var i=n.references,r=t.levelDetails;i.forEach((function(e,t){var a=e.info,n=r.fragments[t];if(0===n.byteRange.length&&n.setByteRange(String(1+a.end-a.start)+"@"+String(a.start)),n.initSegment){var i=Object(E.findBox)(o,["moov"])[0],s=i?i.length:null;n.initSegment.setByteRange(String(s)+"@0")}}))}}},t.handleManifestParsingError=function(e,t,o,a){this.hls.trigger(n.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===_.PlaylistContextType.MANIFEST,url:e.url,reason:o,response:e,context:t,networkDetails:a})},t.handleNetworkError=function(e,t,o,a){void 0===o&&(o=!1),r.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var E=i.ErrorDetails.UNKNOWN,s=!1,T=this.getInternalLoader(e);switch(e.type){case _.PlaylistContextType.MANIFEST:E=o?i.ErrorDetails.MANIFEST_LOAD_TIMEOUT:i.ErrorDetails.MANIFEST_LOAD_ERROR,s=!0;break;case _.PlaylistContextType.LEVEL:E=o?i.ErrorDetails.LEVEL_LOAD_TIMEOUT:i.ErrorDetails.LEVEL_LOAD_ERROR,s=!1;break;case _.PlaylistContextType.AUDIO_TRACK:E=o?i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,s=!1;break;case _.PlaylistContextType.SUBTITLE_TRACK:E=o?i.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:i.ErrorDetails.SUBTITLE_LOAD_ERROR,s=!1}T&&this.resetInternalLoader(e.type);var l={type:i.ErrorTypes.NETWORK_ERROR,details:E,fatal:s,url:e.url,loader:T,context:e,networkDetails:t};a&&(l.response=a),this.hls.trigger(n.Events.ERROR,l)},t.handlePlaylistLoaded=function(e,t,o,a){var i=o.type,r=o.level,E=o.id,s=o.groupId,T=o.loader,l=o.levelDetails,S=o.deliveryDirectives;if(null!=l&&l.targetduration){if(T)switch(l.live&&(T.getCacheAge&&(l.ageHeader=T.getCacheAge()||0),T.getCacheAge&&!isNaN(l.ageHeader)||(l.ageHeader=0)),i){case _.PlaylistContextType.MANIFEST:case _.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:l,level:r||0,id:E||0,stats:t,networkDetails:a,deliveryDirectives:S});break;case _.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:l,id:E||0,groupId:s||"",stats:t,networkDetails:a,deliveryDirectives:S});break;case _.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:l,id:E||0,groupId:s||"",stats:t,networkDetails:a,deliveryDirectives:S})}}else this.handleManifestParsingError(e,o,"invalid target duration",a)},e})();t.default=S},"./src/polyfills/number.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"isFiniteNumber",(function(){return a})),o.d(t,"MAX_SAFE_INTEGER",(function(){return n}));var a=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(e,t,o){"use strict";o.r(t);var a=(function(){function e(){}return e.getSilentFrame=function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},e})();t.default=a},"./src/remux/mp4-generator.ts":function(e,t,o){"use strict";o.r(t);var a=Math.pow(2,32)-1,n=(function(){function e(){}return e.init=function(){var t;for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var o=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),a=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:o,audio:a};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=i,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var r=new Uint8Array([105,115,111,109]),E=new Uint8Array([97,118,99,49]),s=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,r,s,r,E),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,n))},e.box=function(e){for(var t=8,o=arguments.length,a=new Array(o>1?o-1:0),n=1;n>24&255,E[1]=t>>16&255,E[2]=t>>8&255,E[3]=255&t,E.set(e,4),i=0,t=8;i>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,o,a){return e.box(e.types.moof,e.mfhd(t),e.traf(a,o))},e.moov=function(t){for(var o=t.length,a=[];o--;)a[o]=e.trak(t[o]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(a).concat(e.mvex(t)))},e.mvex=function(t){for(var o=t.length,a=[];o--;)a[o]=e.trex(t[o]);return e.box.apply(null,[e.types.mvex].concat(a))},e.mvhd=function(t,o){o*=t;var n=Math.floor(o/(a+1)),i=Math.floor(o%(a+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,i>>24,i>>16&255,i>>8&255,255&i,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 e.box(e.types.mvhd,r)},e.sdtp=function(t){var o,a,n=t.samples||[],i=new Uint8Array(4+n.length);for(o=0;o>>8&255),i.push(255&n),i=i.concat(Array.prototype.slice.call(a));for(o=0;o>>8&255),r.push(255&n),r=r.concat(Array.prototype.slice.call(a));var E=e.box(e.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|t.sps.length].concat(i).concat([t.pps.length]).concat(r))),s=t.width,_=t.height,T=t.pixelRatio[0],l=t.pixelRatio[1];return e.box(e.types.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,s>>8&255,255&s,_>>8&255,255&_,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),E,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([T>>24,T>>16&255,T>>8&255,255&T,l>>24,l>>16&255,l>>8&255,255&l])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var o=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,o>>8&255,255&o,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var o=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,o>>8&255,255&o,0,0]))},e.stsd=function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var o=t.id,n=t.duration*t.timescale,i=t.width,r=t.height,E=Math.floor(n/(a+1)),s=Math.floor(n%(a+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,o>>24&255,o>>16&255,o>>8&255,255&o,0,0,0,0,E>>24,E>>16&255,E>>8&255,255&E,s>>24,s>>16&255,s>>8&255,255&s,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,r>>8&255,255&r,0,0]))},e.traf=function(t,o){var n=e.sdtp(t),i=t.id,r=Math.floor(o/(a+1)),E=Math.floor(o%(a+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,E>>24,E>>16&255,E>>8&255,255&E])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var o=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,o){var a,n,i,r,E,s,_=t.samples||[],T=_.length,l=12+16*T,S=new Uint8Array(l);for(o+=8+l,S.set(["video"===t.type?1:0,0,15,1,T>>>24&255,T>>>16&255,T>>>8&255,255&T,o>>>24&255,o>>>16&255,o>>>8&255,255&o],0),a=0;a>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,E.isLeading<<2|E.dependsOn,E.isDependedOn<<6|E.hasRedundancy<<4|E.paddingValue<<1|E.isNonSync,61440&E.degradPrio,15&E.degradPrio,s>>>24&255,s>>>16&255,s>>>8&255,255&s],12+16*a);return e.box(e.types.trun,S)},e.initSegment=function(t){e.types||e.init();var o=e.moov(t),a=new Uint8Array(e.FTYP.byteLength+o.byteLength);return a.set(e.FTYP),a.set(o,e.FTYP.byteLength),a},e})();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},"./src/remux/mp4-remuxer.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return d})),o.d(t,"normalizePts",(function(){return c})),o.d(t,"flushTextTrackMetadataCueSamples",(function(){return I})),o.d(t,"flushTextTrackUserdataCueSamples",(function(){return A}));var a=o("./src/polyfills/number.ts"),n=o("./src/remux/aac-helper.ts"),i=o("./src/remux/mp4-generator.ts"),r=o("./src/events.ts"),E=o("./src/errors.ts"),s=o("./src/utils/logger.ts"),_=o("./src/types/loader.ts"),T=o("./src/utils/timescale-conversion.ts");function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?e:o.pts}),e[0].pts);return t&&s.logger.debug("PTS rollover detected"),o},t.remux=function(e,t,o,a,n,i,r,E){var T,l,S,u,d,O,N=n,R=n,m=e.pid>-1,p=t.pid>-1,h=t.samples.length,L=e.samples.length>0,f=r&&h>0||h>1;if((!m||L)&&(!p||f)||this.ISGenerated||r){this.ISGenerated||(S=this.generateIS(e,t,n));var C,D=this.isVideoContiguous,g=-1;if(f&&(g=(function(e){for(var t=0;t0){s.logger.warn("[mp4-remuxer]: Dropped "+g+" out of "+h+" video samples due to a missing keyframe");var v=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(g),t.dropped+=g,C=R+=(t.samples[0].pts-v)/t.inputTimeScale}else-1===g&&(s.logger.warn("[mp4-remuxer]: No keyframe found out of "+h+" video samples"),O=!1);if(this.ISGenerated){if(L&&f){var y=this.getVideoStartPts(t.samples),P=(c(e.samples[0].pts,y)-y)/t.inputTimeScale;N+=Math.max(0,P),R+=Math.max(0,-P)}if(L){if(e.samplerate||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),S=this.generateIS(e,t,n)),l=this.remuxAudio(e,N,this.isAudioContiguous,i,p||f||E===_.PlaylistLevelType.AUDIO?R:void 0),f){var B=l?l.endPTS-l.startPTS:0;t.inputTimeScale||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),S=this.generateIS(e,t,n)),T=this.remuxVideo(t,R,D,B)}}else f&&(T=this.remuxVideo(t,R,D,0));T&&(T.firstKeyFrame=g,T.independent=-1!==g,T.firstKeyFramePTS=C)}}return this.ISGenerated&&(o.samples.length&&(d=I(o,n,this._initPTS,this._initDTS)),a.samples.length&&(u=A(a,n,this._initPTS))),{audio:l,video:T,initSegment:S,independent:O,text:u,id3:d}},t.generateIS=function(e,t,o){var n,r,E,s=e.samples,_=t.samples,T=this.typeSupported,l={},S=!Object(a.isFiniteNumber)(this._initPTS),u="audio/mp4";if(S&&(n=r=1/0),e.config&&s.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(T.mpeg?(u="audio/mpeg",e.codec=""):T.mp3&&(e.codec="mp3")),l.audio={id:"audio",container:u,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&T.mpeg?new Uint8Array(0):i.default.initSegment([e]),metadata:{channelCount:e.channelCount}},S&&(E=e.inputTimeScale,n=r=s[0].pts-Math.round(E*o))),t.sps&&t.pps&&_.length&&(t.timescale=t.inputTimeScale,l.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:i.default.initSegment([t]),metadata:{width:t.width,height:t.height}},S)){E=t.inputTimeScale;var d=this.getVideoStartPts(_),I=Math.round(E*o);r=Math.min(r,c(_[0].dts,d)-I),n=Math.min(n,d-I)}if(Object.keys(l).length)return this.ISGenerated=!0,S&&(this._initPTS=n,this._initDTS=r),{tracks:l,initPTS:n,timescale:E}},t.remuxVideo=function(e,t,o,a){var n,_,d=e.inputTimeScale,I=e.samples,A=[],N=I.length,R=this._initPTS,m=this.nextAvcDts,p=8,h=this.videoSampleDuration,L=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,C=!1;o&&null!==m||(m=t*d-(I[0].pts-c(I[0].dts,I[0].pts)));for(var D=0;D0?D-1:D].dts&&(C=!0)}C&&I.sort((function(e,t){var o=e.dts-t.dts,a=e.pts-t.pts;return o||a})),n=I[0].dts;var v=(_=I[I.length-1].dts)-n,y=v?Math.round(v/(N-1)):h||e.inputTimeScale/30;if(o){var P=n-m,B=P>y;if(B||P<-1){B?s.logger.warn("AVC: "+Object(T.toMsFromMpegTsClock)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):s.logger.warn("AVC: "+Object(T.toMsFromMpegTsClock)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),n=m;var b=I[0].pts-P;I[0].dts=n,I[0].pts=b,s.logger.log("Video: First PTS/DTS adjusted: "+Object(T.toMsFromMpegTsClock)(b,!0)+"/"+Object(T.toMsFromMpegTsClock)(n,!0)+", delta: "+Object(T.toMsFromMpegTsClock)(P,!0)+" ms")}}n=Math.max(0,n);for(var M=0,W=0,U=0;U0?q.dts-I[$-1].dts:y;if(ie=$>0?q.pts-I[$-1].pts:y,re.stretchShortVideoTrack&&null!==this.nextAudioPts){var se=Math.floor(re.maxBufferHole*d),_e=(a?L+a*d:this.nextAudioPts)-q.pts;_e>se?((h=_e-Ee)<0?h=Ee:x=!0,s.logger.log("[mp4-remuxer]: It is approximately "+_e/90+" ms to the next segment; using duration "+h/90+" ms for the last video frame.")):h=Ee}else h=Ee}var Te=Math.round(q.pts-q.dts);K=Math.min(K,h),Q=Math.max(Q,h),j=Math.min(j,ie),X=Math.max(X,ie),A.push(new O(q.key,h,Z,Te))}if(A.length)if(S){if(S<70){var le=A[0].flags;le.dependsOn=2,le.isNonSync=0}}else if(u&&X-j0&&(a&&Math.abs(L-h)<9e3||Math.abs(c(m[0].pts-I,L)-h)<20*d),m.forEach((function(e){e.pts=c(e.pts-I,L)})),!o||h<0){if(m=m.filter((function(e){return e.pts>=0})),!m.length)return;h=0===_?0:a&&!R?Math.max(0,L):m[0].pts}if("aac"===e.segmentCodec)for(var f=this.config.maxAudioFramesDrift,C=0,D=h;C=f*d&&P<1e4&&R){var B=Math.round(y/d);(D=v-B*d)<0&&(B--,D+=d),0===C&&(this.nextAudioPts=h=D),s.logger.warn("[mp4-remuxer]: Injecting "+B+" audio frame @ "+(D/T).toFixed(3)+"s due to "+Math.round(1e3*y/T)+" ms gap.");for(var b=0;b0))return;k+=p;try{U=new Uint8Array(k)}catch(e){return void this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:E.ErrorTypes.MUX_ERROR,details:E.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:k,reason:"fail allocating audio mdat "+k})}A||(new DataView(U.buffer).setUint32(0,k),U.set(i.default.types.mdat,4))}U.set(z,p);var K=z.byteLength;p+=K,N.push(new O(!0,u,K,0)),F=x}var j=N.length;if(j){var Q=N[N.length-1];this.nextAudioPts=h=F+S*Q.duration;var X=A?new Uint8Array(0):i.default.moof(e.sequenceNumber++,G/S,l({},e,{samples:N}));e.samples=[];var $=G/T,q=h/T,J={data1:X,data2:U,startPTS:$,endPTS:q,startDTS:$,endDTS:q,type:"audio",hasAudio:!0,hasVideo:!1,nb:j};return this.isAudioContiguous=!0,console.assert(U.length,"MDAT length must not be zero"),J}},t.remuxEmptyAudio=function(e,t,o,a){var i=e.inputTimeScale,r=i/(e.samplerate?e.samplerate:i),E=this.nextAudioPts,_=(null!==E?E:a.startDTS*i)+this._initDTS,T=a.endDTS*i+this._initDTS,l=1024*r,S=Math.ceil((T-_)/l),u=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("[mp4-remuxer]: remux empty Audio"),u){for(var d=[],c=0;c4294967296;)e+=o;return e}function I(e,t,o,a){var n=e.samples.length;if(n){for(var i=e.inputTimeScale,r=0;r0?this.lastEndTime=N:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var R=!!c.audio,m=!!c.video,p="";R&&(p+="audio"),m&&(p+="video");var h={data1:u,startPTS:O,startDTS:O,endPTS:N,endDTS:N,type:p,hasAudio:R,hasVideo:m,nb:1,dropped:0};S.audio="audio"===h.type?h:void 0,S.video="audio"!==h.type?h:void 0,S.initSegment=d;var L=null!=(_=this.initPTS)?_:0;return S.id3=Object(n.flushTextTrackMetadataCueSamples)(o,s,L,L),r.samples.length&&(S.text=Object(n.flushTextTrackUserdataCueSamples)(r,s,L)),S},e})();function _(e,t){var o=null==e?void 0:e.codec;return o&&o.length>4?o:"hvc1"===o||"hev1"===o?"hvc1.1.c.L120.90":"av01"===o?"av01.0.04M.08":"avc1"===o||t===r.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=s},"./src/task-loop.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return a}));var a=(function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var t=e.prototype;return t.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},t.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.onHandlerDestroyed=function(){},t.hasInterval=function(){return!!this._tickInterval},t.hasNextTick=function(){return!!this._tickTimer},t.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,e),!0)},t.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e})()},"./src/types/cmcd.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"CMCDVersion",(function(){return r})),o.d(t,"CMCDObjectType",(function(){return a})),o.d(t,"CMCDStreamingFormat",(function(){return n})),o.d(t,"CMCDStreamType",(function(){return i}));var a,n,i,r=1;!(function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"})(a||(a={})),(function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"})(n||(n={})),(function(e){e.VOD="v",e.LIVE="l"})(i||(i={}))},"./src/types/demuxer.ts":function(e,t,o){"use strict";var a;o.r(t),o.d(t,"MetadataSchema",(function(){return a})),(function(e){e.audioId3="org.id3",e.dateRange="com.apple.quicktime.HLS",e.emsg="https://aomedia.org/emsg/ID3"})(a||(a={}))},"./src/types/level.ts":function(e,t,o){"use strict";function a(e,t){for(var o=0;oNumber.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var o=new Uint8Array(t.length/2),a=0;aNumber.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var o=this[e];return o?parseFloat(o):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=a.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,o={};for(n.lastIndex=0;null!==(t=n.exec(e));){var a=t[2];0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1&&(a=a.slice(1,-1)),o[t[1]]=a}return o},e})()},"./src/utils/binary-search.ts":function(e,t,o){"use strict";o.r(t),t.default={search:function(e,t){for(var o=0,a=e.length-1,n=null,i=null;o<=a;){var r=t(i=e[n=(o+a)/2|0]);if(r>0)o=n+1;else{if(!(r<0))return i;a=n-1}}return null}}},"./src/utils/buffer-helper.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"BufferHelper",(function(){return i}));var a=o("./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},i=(function(){function e(){}return e.isBuffered=function(t,o){try{if(t)for(var a=e.getBuffered(t),n=0;n=a.start(n)&&o<=a.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(t,o,a){try{if(t){var n,i=e.getBuffered(t),r=[];for(n=0;nr&&(a[i-1].end=e[n].end):a.push(e[n])}else a.push(e[n])}else a=e;for(var E,s=0,_=t,T=t,l=0;l=S&&t=e&&n.logger.log(this.time+" ["+e+"] "+t)},e})(),c=function(e){for(var t=[],o=0;os&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=s)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var o=this.pos+1;o=144&&this.backSpace();var t=r(e);this.pos>=s?this.logger.log(a.ERROR,"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t0&&(o=e?"["+t.join(" | ")+"]":t.join("\n")),o},t.getTextAndFormat=function(){return this.rows},e})(),R=(function(){function e(e,t,o){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new N(o),this.nonDisplayedMemory=new N(o),this.lastOutputScreen=new N(o),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=o}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(a.INFO,"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var o=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][o]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e})(),m=(function(){function e(e,t,o){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var a=new d;this.channels=[null,new R(e,t,a),new R(e+1,o,a)],this.cmdHistory={a:null,b:null},this.logger=a}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var o,n,i,r=!1;this.logger.time=e;for(var E=0;E ("+c([n,i])+")"),(o=this.parseCmd(n,i))||(o=this.parseMidrow(n,i)),o||(o=this.parsePAC(n,i)),o||(o=this.parseBackgroundAttributes(n,i)),!o&&(r=this.parseChars(n,i))){var s=this.currentChannel;s&&s>0?this.channels[s].insertChars(r):this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}o||r||this.logger.log(a.WARNING,"Couldn't parse cleaned data "+c([n,i])+" orig: "+c([t[E],t[E+1]]))}},t.parseCmd=function(e,t){var o=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(h(e,t,o))return p(null,null,o),this.logger.log(a.DEBUG,"Repeated command ("+c([e,t])+") is dropped"),!0;var n=20===e||21===e||23===e?1:2,i=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?i.ccRCL():33===t?i.ccBS():34===t?i.ccAOF():35===t?i.ccAON():36===t?i.ccDER():37===t?i.ccRU(2):38===t?i.ccRU(3):39===t?i.ccRU(4):40===t?i.ccFON():41===t?i.ccRDC():42===t?i.ccTR():43===t?i.ccRTD():44===t?i.ccEDM():45===t?i.ccCR():46===t?i.ccENM():47===t&&i.ccEOC():i.ccTO(t-32),p(e,t,o),this.currentChannel=n,!0},t.parseMidrow=function(e,t){var o=0;if((17===e||25===e)&&t>=32&&t<=47){if((o=17===e?1:2)!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var n=this.channels[o];return!!n&&(n.ccMIDROW(t),this.logger.log(a.DEBUG,"MIDROW ("+c([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var o,a=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(h(e,t,a))return p(null,null,a),!0;var n=e<=23?1:2;o=t>=64&&t<=95?1===n?_[e]:l[e]:1===n?T[e]:S[e];var i=this.channels[n];return!!i&&(i.setPAC(this.interpretPAC(o,t)),p(e,t,a),this.currentChannel=n,!0)},t.interpretPAC=function(e,t){var o,a={color:null,italics:!1,indent:null,underline:!1,row:e};return o=t>95?t-96:t-64,a.underline=1==(1&o),o<=13?a.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(o/2)]:o<=15?(a.italics=!0,a.color="white"):a.indent=4*Math.floor((o-16)/2),a},t.parseChars=function(e,t){var o,n,i=null,E=null;if(e>=25?(o=2,E=e-8):(o=1,E=e),E>=17&&E<=19?(n=17===E?t+80:18===E?t+112:t+144,this.logger.log(a.INFO,"Special char '"+r(n)+"' in channel "+o),i=[n]):e>=32&&e<=127&&(i=0===t?[e]:[e,t]),i){var s=c(i);this.logger.log(a.DEBUG,"Char codes = "+s.join(",")),p(e,t,this.cmdHistory)}return i},t.parseBackgroundAttributes=function(e,t){var o;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var a={};16===e||24===e?(o=Math.floor((t-32)/2),a.background=u[o],t%2==1&&(a.background=a.background+"_semi")):45===t?a.background="transparent":(a.foreground="black",47===t&&(a.underline=!0));var n=e<=23?1:2;return this.channels[n].setBkgData(a),p(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e=16?l--:l++;var A=Object(a.fixLineBreaks)(S.trim()),O=Object(n.generateCueId)(t,o,A);e&&e.cues&&e.cues.getCueById(O)||((_=new d(t,o,A)).id=O,_.line=c+1,_.align="left",_.position=10+Math.min(80,10*Math.floor(8*l/32)),u.push(_))}return e&&u.length&&(u.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),u.forEach((function(t){return Object(i.addCueToTrack)(e,t)}))),u}};t.default=E},"./src/utils/discontinuities.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"findFirstFragWithCC",(function(){return r})),o.d(t,"shouldAlignOnDiscontinuities",(function(){return E})),o.d(t,"findDiscontinuousReferenceFrag",(function(){return s})),o.d(t,"adjustSlidingStart",(function(){return T})),o.d(t,"alignStream",(function(){return l})),o.d(t,"alignPDT",(function(){return S})),o.d(t,"alignFragmentByPDTDelta",(function(){return u})),o.d(t,"alignMediaPlaylistByPDT",(function(){return d}));var a=o("./src/polyfills/number.ts"),n=o("./src/utils/logger.ts"),i=o("./src/controller/level-helper.ts");function r(e,t){for(var o=null,a=0,n=e.length;ao.startCC||e&&e.cc=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.destroy=function(){},e})();t.default=n},"./src/utils/ewma.ts":function(e,t,o){"use strict";o.r(t);var a=(function(){function e(e,t,o){void 0===t&&(t=0),void 0===o&&(o=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=o}var t=e.prototype;return t.sample=function(e,t){var o=Math.pow(this.alpha_,e);this.estimate_=t*(1-o)+o*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e})();t.default=a},"./src/utils/fetch-loader.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"fetchSupported",(function(){return S}));var a=o("./src/polyfills/number.ts"),n=o("./src/loader/load-stats.ts"),i=o("./src/demux/chunk-cache.ts");function r(e){var t="function"==typeof Map?new Map:void 0;return r=function(e){if(null===e||(o=e,-1===Function.toString.call(o).indexOf("[native code]")))return e;var o;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return E(e,arguments,T(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),_(a,e)},r(e)}function E(e,t,o){return E=s()?Reflect.construct.bind():function(e,t,o){var a=[null];a.push.apply(a,t);var n=new(Function.bind.apply(e,a));return o&&_(n,o.prototype),n},E.apply(null,arguments)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _(e,t){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_(e,t)}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t=a&&n(t,o,r.flush(),e)):n(t,o,s,e),i()})).catch((function(){return Promise.reject()}))})()},e})();function d(e,t){return new self.Request(e.url,t)}var c=(function(e){var t,o;function a(t,o,a){var n;return(n=e.call(this,t)||this).code=void 0,n.details=void 0,n.code=o,n.details=a,n}return o=e,(t=a).prototype=Object.create(o.prototype),t.prototype.constructor=t,_(t,o),a})(r(Error));t.default=u},"./src/utils/imsc1-ttml-parser.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"IMSC1_CODEC",(function(){return T})),o.d(t,"parseIMSC1",(function(){return d}));var a=o("./src/utils/mp4-tools.ts"),n=o("./src/utils/vttparser.ts"),i=o("./src/utils/vttcue.ts"),r=o("./src/demux/id3.ts"),E=o("./src/utils/timescale-conversion.ts"),s=o("./src/utils/webvtt-parser.ts");function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t"):a}function E(e){if(self.console&&!0===e||"object"==typeof e){!(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a>24,e[t+1]=o>>16&255,e[t+2]=o>>8&255,e[t+3]=255&o}function d(e,t){var o=[];if(!t.length)return o;for(var a=e.byteLength,n=0;n1?n+i:a;if(_(e.subarray(n+4,n+8))===t[0])if(1===t.length)o.push(e.subarray(n+8,r));else{var s=d(e.subarray(n+8,r),t.slice(1));s.length&&E.apply(o,s)}n=r}return o}function c(e){var t=[],o=e[0],a=8,n=l(e,a);a+=4,a+=0===o?8:16,a+=2;var i=e.length+0,r=T(e,a);a+=2;for(var E=0;E>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var u=l(e,s);s+=4,t.push({referenceSize:S,subsegmentDuration:u,info:{duration:u/n,start:i,end:i+S-1}}),i+=S,a=s+=4}return{earliestPresentationTime:0,timescale:n,version:o,referencesCount:r,references:t}}function I(e){for(var t=[],o=d(e,["moov","trak"]),a=0;a=a.length)break;r+=_=a[n++]}while(255===_);E=0;do{if(n>=a.length)break;E+=_=a[n++]}while(255===_);var S=a.length-n;if(!s&&4===r&&n16){for(var m=[],p=0;p<16;p++){var h=a[n++].toString(16);m.push(1==h.length?"0"+h:h),3!==p&&5!==p&&7!==p&&9!==p||m.push("-")}for(var L=E-16,f=new Uint8Array(L),C=0;CS)break}}function C(e){var t=e[0],o="",a="",n=0,i=0,r=0,E=0,s=0,T=0;if(0===t){for(;"\0"!==_(e.subarray(T,T+1));)o+=_(e.subarray(T,T+1)),T+=1;for(o+=_(e.subarray(T,T+1)),T+=1;"\0"!==_(e.subarray(T,T+1));)a+=_(e.subarray(T,T+1)),T+=1;a+=_(e.subarray(T,T+1)),T+=1,n=l(e,12),i=l(e,16),E=l(e,20),s=l(e,24),T=28}else if(1===t){n=l(e,T+=4);var S=l(e,T+=4),u=l(e,T+=4);for(T+=4,r=Math.pow(2,32)*S+u,Number.isSafeInteger(r)||(r=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),E=l(e,T),s=l(e,T+=4),T+=4;"\0"!==_(e.subarray(T,T+1));)o+=_(e.subarray(T,T+1)),T+=1;for(o+=_(e.subarray(T,T+1)),T+=1;"\0"!==_(e.subarray(T,T+1));)a+=_(e.subarray(T,T+1)),T+=1;a+=_(e.subarray(T,T+1)),T+=1}return{schemeIdUri:o,value:a,timeScale:n,presentationTime:r,presentationTimeDelta:i,eventDuration:E,id:s,payload:e.subarray(T,e.byteLength)}}},"./src/utils/output-filter.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return a}));var a=(function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,o){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=o,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[],this.startTime=null},e})()},"./src/utils/texttrack-utils.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"sendAddTrackEvent",(function(){return n})),o.d(t,"addCueToTrack",(function(){return i})),o.d(t,"clearCurrentCues",(function(){return r})),o.d(t,"removeCuesInRange",(function(){return E})),o.d(t,"getCuesInRange",(function(){return s}));var a=o("./src/utils/logger.ts");function n(e,t){var o;try{o=new Event("addtrack")}catch(e){(o=document.createEvent("Event")).initEvent("addtrack",!1,!1)}o.track=e,t.dispatchEvent(o)}function i(e,t){var o=e.mode;if("disabled"===o&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(o){a.logger.debug("[texttrack-utils]: "+o);var n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}"disabled"===o&&(e.mode=o)}function r(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var o=e.cues.length;o--;)e.removeCue(e.cues[o]);"disabled"===t&&(e.mode=t)}function E(e,t,o,a){var n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var i=s(e.cues,t,o),r=0;re[o].endTime)return-1;for(var a=0,n=o;a<=n;){var i=Math.floor((n+a)/2);if(te[i].startTime&&a-1)for(var i=n,r=e.length;i=t&&E.endTime<=o)a.push(E);else if(E.startTime>o)return a}return a}},"./src/utils/time-ranges.ts":function(e,t,o){"use strict";o.r(t),t.default={toString:function(e){for(var t="",o=e.length,a=0;a1?t-1:0),a=1;a100)throw new Error("Position must be between 0 and 100.");N=e,this.hasBeenReset=!0}})),Object.defineProperty(E,"positionAlign",n({},s,{get:function(){return R},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");R=t,this.hasBeenReset=!0}})),Object.defineProperty(E,"size",n({},s,{get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(E,"align",n({},s,{get:function(){return p},set:function(e){var t=a(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}})),E.displayState=void 0}return i.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},i})()},"./src/utils/vttparser.ts":function(e,t,o){"use strict";o.r(t),o.d(t,"parseTimeStamp",(function(){return i})),o.d(t,"fixLineBreaks",(function(){return l})),o.d(t,"VTTParser",(function(){return S}));var a=o("./src/utils/vttcue.ts"),n=(function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e})();function i(e){function t(e,t,o,a){return 3600*(0|e)+60*(0|t)+(0|o)+parseFloat(a||0)}var o=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return o?parseFloat(o[2])>59?t(o[2],o[3],0,o[4]):t(o[1],o[2],o[3],o[4]):null}var r=(function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,o){return o?this.has(e)?this.values[e]:t[o]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,o){for(var a=0;a=0&&o<=100)return this.set(e,o),!0}return!1},e})();function E(e,t,o,a){var n=a?e.split(a):[e];for(var i in n)if("string"==typeof n[i]){var r=n[i].split(o);2===r.length&&t(r[0],r[1])}}var s=new a.default(0,0,""),_="middle"===s.align?"middle":"center";function T(e,t,o){var a=e;function n(){var t=i(e);if(null===t)throw new Error("Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function T(){e=e.replace(/^\s+/,"")}if(T(),t.startTime=n(),T(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.slice(3),T(),t.endTime=n(),T(),(function(e,t){var a=new r;E(e,(function(e,t){var n;switch(e){case"region":for(var i=o.length-1;i>=0;i--)if(o[i].id===t){a.set(e,o[i].region);break}break;case"vertical":a.alt(e,t,["rl","lr"]);break;case"line":n=t.split(","),a.integer(e,n[0]),a.percent(e,n[0])&&a.set("snapToLines",!1),a.alt(e,n[0],["auto"]),2===n.length&&a.alt("lineAlign",n[1],["start",_,"end"]);break;case"position":n=t.split(","),a.percent(e,n[0]),2===n.length&&a.alt("positionAlign",n[1],["start",_,"end","line-left","line-right","auto"]);break;case"size":a.percent(e,t);break;case"align":a.alt(e,t,["start",_,"end","left","right"])}}),/:/,/\s/),t.region=a.get("region",null),t.vertical=a.get("vertical","");var n=a.get("line","auto");"auto"===n&&-1===s.line&&(n=-1),t.line=n,t.lineAlign=a.get("lineAlign","start"),t.snapToLines=a.get("snapToLines",!0),t.size=a.get("size",100),t.align=a.get("align",_);var i=a.get("position","auto");"auto"===i&&50===s.position&&(i="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=i})(e,t)}function l(e){return e.replace(//gi,"\n")}var S=(function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new n,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function o(){var e=t.buffer,o=0;for(e=l(e);o>>0).toString()};function l(e,t,o){return T(e.toString())+T(t.toString())+T(o)}function S(e,t,o,T,S,u,d,c){var I,A=new n.VTTParser,O=Object(i.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(s,"\n").split("\n"),N=[],R=Object(r.toMpegTsClockFromTimescale)(t,o),m="00:00.000",p=0,h=0,L=!0;A.oncue=function(e){var t=T[S],o=T.ccOffset,a=(p-R)/9e4;null!=t&&t.new&&(void 0!==h?o=T.ccOffset=t.start:(function(e,t,o){var a=e[t],n=e[a.prevCC];if(!n||!n.new&&a.new)return e.ccOffset=e.presentationOffset=a.start,void(a.new=!1);for(;null!==(i=n)&&void 0!==i&&i.new;){var i;e.ccOffset+=a.start-n.start,a.new=!1,n=e[(a=n).prevCC]}e.presentationOffset=o})(T,S,a)),a&&(o=a-T.presentationOffset);var n=e.endTime-e.startTime,i=Object(E.normalizePts)(9e4*(e.startTime+o-h),9e4*u)/9e4;e.startTime=Math.max(i,0),e.endTime=Math.max(i+n,0);var r=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(r)),e.id||(e.id=l(e.startTime,e.endTime,r)),e.endTime>0&&N.push(e)},A.onparsingerror=function(e){I=e},A.onflush=function(){I?c(I):d(N)},O.forEach((function(e){if(L){if(_(e,"X-TIMESTAMP-MAP=")){L=!1,e.slice(16).split(",").forEach((function(e){_(e,"LOCAL:")?m=e.slice(6):_(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{h=(function(e){var t=parseInt(e.slice(-3)),o=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),i=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(Object(a.isFiniteNumber)(t)&&Object(a.isFiniteNumber)(o)&&Object(a.isFiniteNumber)(n)&&Object(a.isFiniteNumber)(i)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*o,(t+=6e4*n)+36e5*i})(m)/1e3}catch(e){I=e}return}""===e&&(L=!1)}A.parse(e+"\n")})),A.flush()}},"./src/utils/xhr-loader.ts":function(e,t,o){"use strict";o.r(t);var a=o("./src/utils/logger.ts"),n=o("./src/loader/load-stats.ts"),i=/^age:\s*[\d.]+\s*$/m,r=(function(){function e(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e?e.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=o,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){var o=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var n=this.xhrSetup;try{if(n)try{n(o,t.url)}catch(e){o.open("GET",t.url,!0),n(o,t.url)}o.readyState||o.open("GET",t.url,!0);var i=this.context.headers;if(i)for(var r in i)o.setRequestHeader(r,i[r])}catch(e){return void this.callbacks.onError({code:o.status,text:e.message},t,o)}t.rangeEnd&&o.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),o.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,o=this.stats;if(e&&t){var n=t.readyState,i=this.config;if(!o.aborted&&n>=2)if(self.clearTimeout(this.requestTimeout),0===o.loading.first&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),4===n){t.onreadystatechange=null,t.onprogress=null;var r=t.status;if(r>=200&&r<300){var E,s;if(o.loading.end=Math.max(self.performance.now(),o.loading.first),s="arraybuffer"===e.responseType?(E=t.response).byteLength:(E=t.responseText).length,o.loaded=o.total=s,!this.callbacks)return;var _=this.callbacks.onProgress;if(_&&_(o,e,E,t),!this.callbacks)return;var T={url:t.responseURL,data:E};this.callbacks.onSuccess(T,o,e,t)}else o.retry>=i.maxRetry||r>=400&&r<499?(a.logger.error(r+" while loading "+e.url),this.callbacks.onError({code:r,text:t.statusText},e,t)):(a.logger.warn(r+" while loading "+e.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,i.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout)}},t.loadtimeout=function(){a.logger.warn("timeout while loading "+this.context.url);var e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&i.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e})();t.default=r}}).default},e.exports=t())},2047:e=>{"use strict";e.exports={abbr:"abbr",accept:"accept",acceptCharset:"accept-charset",accessKey:"accesskey",action:"action",allowFullScreen:"allowfullscreen",allowTransparency:"allowtransparency",alt:"alt",async:"async",autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",cellPadding:"cellpadding",cellSpacing:"cellspacing",challenge:"challenge",charset:"charset",checked:"checked",cite:"cite",class:"class",className:"class",cols:"cols",colSpan:"colspan",command:"command",content:"content",contentEditable:"contenteditable",contextMenu:"contextmenu",controls:"controls",coords:"coords",crossOrigin:"crossorigin",data:"data",dateTime:"datetime",default:"default",defer:"defer",dir:"dir",disabled:"disabled",download:"download",draggable:"draggable",dropzone:"dropzone",encType:"enctype",for:"for",form:"form",formAction:"formaction",formEncType:"formenctype",formMethod:"formmethod",formNoValidate:"formnovalidate",formTarget:"formtarget",frameBorder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hrefLang:"hreflang",htmlFor:"for",httpEquiv:"http-equiv",icon:"icon",id:"id",inputMode:"inputmode",isMap:"ismap",itemId:"itemid",itemProp:"itemprop",itemRef:"itemref",itemScope:"itemscope",itemType:"itemtype",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",manifest:"manifest",max:"max",maxLength:"maxlength",media:"media",mediaGroup:"mediagroup",method:"method",min:"min",minLength:"minlength",multiple:"multiple",muted:"muted",name:"name",noValidate:"novalidate",open:"open",optimum:"optimum",pattern:"pattern",ping:"ping",placeholder:"placeholder",poster:"poster",preload:"preload",radioGroup:"radiogroup",readOnly:"readonly",rel:"rel",required:"required",role:"role",rows:"rows",rowSpan:"rowspan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",sortable:"sortable",span:"span",spellCheck:"spellcheck",src:"src",srcDoc:"srcdoc",srcSet:"srcset",start:"start",step:"step",style:"style",tabIndex:"tabindex",target:"target",title:"title",translate:"translate",type:"type",typeMustMatch:"typemustmatch",useMap:"usemap",value:"value",width:"width",wmode:"wmode",wrap:"wrap"}},1613:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>S});var a=o(1739),n=o.n(a),i=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function r(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},o=e.match(/<\/?([^\s]+?)[/\s>]/);if(o&&(t.name=o[1],(n()[o[1]]||"/"===e.charAt(e.length-2))&&(t.voidElement=!0),t.name.startsWith("!--"))){var a=e.indexOf("--\x3e");return{type:"comment",comment:-1!==a?e.slice(4,a):""}}for(var r=new RegExp(i),E=null;null!==(E=r.exec(e));)if(E[0].trim())if(E[1]){var s=E[1].trim(),_=[s,""];s.indexOf("=")>-1&&(_=s.split("=")),t.attrs[_[0]]=_[1],r.lastIndex--}else E[2]&&(t.attrs[E[2]]=E[3].trim().substring(1,E[3].length-1));return t}var E=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,s=/^\s*$/,_=Object.create(null);function T(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(e){var t=[];for(var o in e)t.push(o+'="'+e[o]+'"');return t.length?" "+t.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(T,"")+"";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var l={parse:function(e,t){t||(t={}),t.components||(t.components=_);var o,a=[],n=[],i=-1,T=!1;if(0!==e.indexOf("<")){var l=e.indexOf("<");a.push({type:"text",content:-1===l?e:e.substring(0,l)})}return e.replace(E,(function(E,_){if(T){if(E!=="")return;T=!1}var l,S="/"!==E.charAt(1),u=E.startsWith("\x3c!--"),d=_+E.length,c=e.charAt(d);if(u){var I=r(E);return i<0?(a.push(I),a):((l=n[i]).children.push(I),a)}if(S&&(i++,"tag"===(o=r(E)).type&&t.components[o.name]&&(o.type="component",T=!0),o.voidElement||T||!c||"<"===c||o.children.push({type:"text",content:e.slice(d,e.indexOf("<",d))}),0===i&&a.push(o),(l=n[i-1])&&l.children.push(o),n[i]=o),(!S||o.voidElement)&&(i>-1&&(o.voidElement||o.name===E.slice(2,-1))&&(i--,o=-1===i?a:n[i]),!T&&"<"!==c&&c)){l=-1===i?a:n[i].children;var A=e.indexOf("<",d),O=e.slice(d,-1===A?void 0:A);s.test(O)&&(O=" "),(A>-1&&i+l.length>=0||" "!==O)&&l.push({type:"text",content:O})}})),a},stringify:function(e){return e.reduce((function(e,t){return e+T("",t)}),"")}};const S=l},6073:(e,t,o)=>{"use strict";var a=o(7021),n=o(949),i=o(4813),r=o(5627),E=o(6433),s=o(8542),_=o(2411),T=o(2401),l=o(9394);function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=S(a),d=S(n),c=S(i),I=S(r),A=S(E),O=S(s),N=S(_),R=S(T),m=S(l);function p(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function h(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};d.default(this,e),this.init(t,o)}return c.default(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||L,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),o=0;o1?t-1:0),a=1;a-1?e.replace(/###/g,"."):e}function n(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(n())return{};var r=a(i.shift());!e[r]&&o&&(e[r]=new o),e=Object.prototype.hasOwnProperty.call(e,r)?e[r]:{}}return n()?{}:{obj:e,k:a(i.shift())}}function P(e,t,o){var a=y(e,t,Object);a.obj[a.k]=o}function B(e,t){var o=y(e,t),a=o.obj,n=o.k;if(a)return a[n]}function b(e,t,o){var a=B(e,o);return void 0!==a?a:B(t,o)}function M(e,t,o){for(var a in t)"__proto__"!==a&&"constructor"!==a&&(a in e?"string"==typeof e[a]||e[a]instanceof String||"string"==typeof t[a]||t[a]instanceof String?o&&(e[a]=t[a]):M(e[a],t[a],o):e[a]=t[a]);return e}function W(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var U={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function G(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return U[e]})):e}var F="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,k=[" ",",","?","!",";"];function w(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function V(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var a=t.split(o),n=e,i=0;ii+r;)r++,s=n[E=a.slice(i,i+r).join(o)];if(void 0===s)return;if(null===s)return null;if(t.endsWith(E)){if("string"==typeof s)return s;if(E&&"string"==typeof s[E])return s[E]}var _=a.slice(i+r).join(o);return _?Y(s,_,o):void 0}n=n[a[i]]}return n}}var z=(function(e){A.default(o,e);var t=H(o);function o(e){var a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return d.default(this,o),a=t.call(this),F&&C.call(I.default(a)),a.data=e||{},a.options=n,void 0===a.options.keySeparator&&(a.options.keySeparator="."),void 0===a.options.ignoreJSONStructure&&(a.options.ignoreJSONStructure=!0),a}return c.default(o,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=void 0!==a.ignoreJSONStructure?a.ignoreJSONStructure:this.options.ignoreJSONStructure,r=[e,t];o&&"string"!=typeof o&&(r=r.concat(o)),o&&"string"==typeof o&&(r=r.concat(n?o.split(n):o)),e.indexOf(".")>-1&&(r=e.split("."));var E=B(this.data,r);return E||!i||"string"!=typeof o?E:Y(this.data&&this.data[e]&&this.data[e][t],o,n)}},{key:"addResource",value:function(e,t,o,a){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var r=[e,t];o&&(r=r.concat(i?o.split(i):o)),e.indexOf(".")>-1&&(a=t,t=(r=e.split("."))[1]),this.addNamespaces(t),P(this.data,r,a),n.silent||this.emit("added",e,t,o,a)}},{key:"addResources",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var n in o)"string"!=typeof o[n]&&"[object Array]"!==Object.prototype.toString.apply(o[n])||this.addResource(e,t,n,o[n],{silent:!0});a.silent||this.emit("added",e,t,o)}},{key:"addResourceBundle",value:function(e,t,o,a,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[e,t];e.indexOf(".")>-1&&(a=o,o=t,t=(r=e.split("."))[1]),this.addNamespaces(t);var E=B(this.data,r)||{};a?M(E,o,n):E=V(V({},E),o),P(this.data,r,E),i.silent||this.emit("added",e,t,o)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?V(V({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o})(C),x={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,o,a,n){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,o,a,n))})),t}};function K(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function j(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return d.default(this,o),a=t.call(this),F&&C.call(I.default(a)),v(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,I.default(a)),a.options=n,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=f.create("translator"),a}return c.default(o,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var o=this.resolve(e,t);return o&&void 0!==o.res}},{key:"extractFromKey",value:function(e,t){var o=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===o&&(o=":");var a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,n=t.ns||this.options.defaultNS||[],i=o&&e.indexOf(o)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||(function(e,t,o){t=t||"",o=o||"";var a=k.filter((function(e){return t.indexOf(e)<0&&o.indexOf(e)<0}));if(0===a.length)return!0;var n=new RegExp("(".concat(a.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!n.test(e);if(!i){var r=e.indexOf(o);r>0&&!n.test(e.substring(0,r))&&(i=!0)}return i})(e,o,a));if(i&&!r){var E=e.match(this.interpolator.nestingRegexp);if(E&&E.length>0)return{key:e,namespaces:n};var s=e.split(o);(o!==a||o===a&&this.options.ns.indexOf(s[0])>-1)&&(n=s.shift()),e=s.join(a)}return"string"==typeof n&&(n=[n]),{key:e,namespaces:n}}},{key:"translate",value:function(e,t,a){var n=this;if("object"!==u.default(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,E=this.extractFromKey(e[e.length-1],t),s=E.key,_=E.namespaces,T=_[_.length-1],l=t.lng||this.language,S=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(S){var d=t.nsSeparator||this.options.nsSeparator;return i?(c.res="".concat(T).concat(d).concat(s),c):"".concat(T).concat(d).concat(s)}return i?(c.res=s,c):s}var c=this.resolve(e,t),I=c&&c.res,A=c&&c.usedKey||s,O=c&&c.exactUsedKey||s,N=Object.prototype.toString.apply(I),R=["[object Number]","[object Function]","[object RegExp]"],m=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,p=!this.i18nFormat||this.i18nFormat.handleAsObject,h="string"!=typeof I&&"boolean"!=typeof I&&"number"!=typeof I;if(p&&I&&h&&R.indexOf(N)<0&&("string"!=typeof m||"[object Array]"!==N)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(A,I,j(j({},t),{},{ns:_})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");return i?(c.res=L,c):L}if(r){var f="[object Array]"===N,C=f?[]:{},D=f?O:A;for(var g in I)if(Object.prototype.hasOwnProperty.call(I,g)){var v="".concat(D).concat(r).concat(g);C[g]=this.translate(v,j(j({},t),{joinArrays:!1,ns:_})),C[g]===v&&(C[g]=I[g])}I=C}}else if(p&&"string"==typeof m&&"[object Array]"===N)(I=I.join(m))&&(I=this.extendTranslation(I,e,t,a));else{var y=!1,P=!1,B=void 0!==t.count&&"string"!=typeof t.count,b=o.hasDefaultValue(t),M=B?this.pluralResolver.getSuffix(l,t.count,t):"",W=t["defaultValue".concat(M)]||t.defaultValue;!this.isValidLookup(I)&&b&&(y=!0,I=W),this.isValidLookup(I)||(P=!0,I=s);var U=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,G=U&&P?void 0:I,F=b&&W!==I&&this.options.updateMissing;if(P||y||F){if(this.logger.log(F?"updateKey":"missingKey",l,T,s,F?W:I),r){var k=this.resolve(s,j(j({},t),{},{keySeparator:!1}));k&&k.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var w=[],V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&V&&V[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!r.isValidLookup(t)){var s=r.extractFromKey(e,E),_=s.key;o=_;var T=s.namespaces;r.options.fallbackNS&&(T=T.concat(r.options.fallbackNS));var l=void 0!==E.count&&"string"!=typeof E.count,S=l&&!E.ordinal&&0===E.count&&r.pluralResolver.shouldUseIntlApi(),u=void 0!==E.context&&("string"==typeof E.context||"number"==typeof E.context)&&""!==E.context,d=E.lngs?E.lngs:r.languageUtils.toResolveHierarchy(E.lng||r.language,E.fallbackLng);T.forEach((function(e){r.isValidLookup(t)||(i=e,!X["".concat(d[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(i)&&(X["".concat(d[0],"-").concat(e)]=!0,r.logger.warn('key "'.concat(o,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(o){if(!r.isValidLookup(t)){n=o;var i,s=[_];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(s,_,o,e,E);else{var T;l&&(T=r.pluralResolver.getSuffix(o,E.count,E));var d="".concat(r.options.pluralSeparator,"zero");if(l&&(s.push(_+T),S&&s.push(_+d)),u){var c="".concat(_).concat(r.options.contextSeparator).concat(E.context);s.push(c),l&&(s.push(c+T),S&&s.push(c+d))}}for(;i=s.pop();)r.isValidLookup(t)||(a=i,t=r.getResource(o,e,i,E))}})))}))}})),{res:t,usedKey:o,exactUsedKey:a,usedLng:n,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,o,a):this.resourceStore.getResource(e,t,o,a)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t===o.substring(0,t.length)&&void 0!==e[o])return!0;return!1}}]),o})(C);function q(e){return e.charAt(0).toUpperCase()+e.slice(1)}var J=(function(){function e(t){d.default(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=f.create("languageUtils")}return c.default(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],o=e.split("-");return this.options.lowerCaseLng?o=o.map((function(e){return e.toLowerCase()})):2===o.length?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=q(o[1].toLowerCase()))):3===o.length&&(o[0]=o[0].toLowerCase(),2===o[1].length&&(o[1]=o[1].toUpperCase()),"sgn"!==o[0]&&2===o[2].length&&(o[2]=o[2].toUpperCase()),t.indexOf(o[1].toLowerCase())>-1&&(o[1]=q(o[1].toLowerCase())),t.indexOf(o[2].toLowerCase())>-1&&(o[2]=q(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,o=this;return e?(e.forEach((function(e){if(!t){var a=o.formatLanguageCode(e);o.options.supportedLngs&&!o.isSupportedCode(a)||(t=a)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var a=o.getLanguagePartFromCode(e);if(o.isSupportedCode(a))return t=a;t=o.options.supportedLngs.find((function(e){if(0===e.indexOf(a))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var o=e[t];return o||(o=e[this.getScriptPartFromCode(t)]),o||(o=e[this.formatLanguageCode(t)]),o||(o=e[this.getLanguagePartFromCode(t)]),o||(o=e.default),o||[]}},{key:"toResolveHierarchy",value:function(e,t){var o=this,a=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],i=function(e){e&&(o.isSupportedCode(e)?n.push(e):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),a.forEach((function(e){n.indexOf(e)<0&&i(o.formatLanguageCode(e))})),n}}]),e})(),Z=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ee={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},te=["v1","v2","v3"],oe={zero:0,one:1,two:2,few:3,many:4,other:5};function ae(){var e={};return Z.forEach((function(t){t.lngs.forEach((function(o){e[o]={numbers:t.nr,plurals:ee[t.fc]}}))})),e}var ne=(function(){function e(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};d.default(this,e),this.languageUtils=t,this.options=o,this.logger=f.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=ae()}return c.default(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,t);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,o).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.getRule(e,o);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort((function(e,t){return oe[e]-oe[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):a.numbers.map((function(a){return t.getSuffix(e,a,o)})):[]}},{key:"getSuffix",value:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=this.getRule(e,o);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(t)):this.getSuffixRetroCompatible(a,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var o=this,a=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[a];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));var i=function(){return o.options.prepend&&n.toString()?o.options.prepend+n.toString():n.toString()};return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?"_plural_".concat(n.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!te.includes(this.options.compatibilityJSON)}}]),e})();function ie(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function re(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};d.default(this,e),this.logger=f.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return c.default(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:G,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?W(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?W(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?W(t.nestingPrefix):t.nestingPrefixEscaped||W("$t("),this.nestingSuffix=t.nestingSuffix?W(t.nestingSuffix):t.nestingSuffixEscaped||W(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(e,t,o,a){var n,i,r,E=this,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function _(e){return e.replace(/\$/g,"$$$$")}var T=function(e){if(e.indexOf(E.formatSeparator)<0){var n=b(t,s,e);return E.alwaysFormat?E.format(n,void 0,o,re(re(re({},a),t),{},{interpolationkey:e})):n}var i=e.split(E.formatSeparator),r=i.shift().trim(),_=i.join(E.formatSeparator).trim();return E.format(b(t,s,r),_,o,re(re(re({},a),t),{},{interpolationkey:r}))};this.resetRegExp();var l=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,S=a&&a.interpolation&&void 0!==a.interpolation.skipOnVariables?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return _(e)}},{regex:this.regexp,safeValue:function(e){return E.escapeValue?_(E.escape(e)):_(e)}}].forEach((function(t){for(r=0;n=t.regex.exec(e);){var o=n[1].trim();if(void 0===(i=T(o)))if("function"==typeof l){var s=l(e,n,a);i="string"==typeof s?s:""}else if(a&&a.hasOwnProperty(o))i="";else{if(S){i=n[0];continue}E.logger.warn("missed to pass in variable ".concat(o," for interpolating ").concat(e)),i=""}else"string"==typeof i||E.useRawValueToEscape||(i=g(i));var _=t.safeValue(i);if(e=e.replace(n[0],_),S?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=n[0].length):t.regex.lastIndex=0,++r>=E.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var o,a,n,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function E(e,t){var o=this.nestingOptionsSeparator;if(e.indexOf(o)<0)return e;var a=e.split(new RegExp("".concat(o,"[ ]*{"))),i="{".concat(a[1]);e=a[0];var r=(i=this.interpolate(i,n)).match(/'/g),E=i.match(/"/g);(r&&r.length%2==0&&!E||E.length%2!=0)&&(i=i.replace(/'/g,'"'));try{n=JSON.parse(i),t&&(n=re(re({},t),n))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(o).concat(i)}return delete n.defaultValue,e}for(;o=this.nestingRegexp.exec(e);){var s=[];(n=re({},r)).applyPostProcessor=!1,delete n.defaultValue;var _=!1;if(-1!==o[0].indexOf(this.formatSeparator)&&!/{.*}/.test(o[1])){var T=o[1].split(this.formatSeparator).map((function(e){return e.trim()}));o[1]=T.shift(),s=T,_=!0}if((a=t(E.call(this,o[1].trim(),n),n))&&o[0]===e&&"string"!=typeof a)return a;"string"!=typeof a&&(a=g(a)),a||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),a=""),_&&(a=s.reduce((function(e,t){return i.format(e,t,r.lng,re(re({},r),{},{interpolationkey:o[1].trim()}))}),a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}]),e})();function se(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function _e(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};d.default(this,e),this.logger=f.create("formatter"),this.options=t,this.formats={number:Te((function(e,t){var o=new Intl.NumberFormat(e,t);return function(e){return o.format(e)}})),currency:Te((function(e,t){var o=new Intl.NumberFormat(e,_e(_e({},t),{},{style:"currency"}));return function(e){return o.format(e)}})),datetime:Te((function(e,t){var o=new Intl.DateTimeFormat(e,_e({},t));return function(e){return o.format(e)}})),relativetime:Te((function(e,t){var o=new Intl.RelativeTimeFormat(e,_e({},t));return function(e){return o.format(e,t.range||"day")}})),list:Te((function(e,t){var o=new Intl.ListFormat(e,_e({},t));return function(e){return o.format(e)}}))},this.init(t)}return c.default(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},o=t.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=Te(t)}},{key:"format",value:function(e,t,o,a){var n=this;return t.split(this.formatSeparator).reduce((function(e,t){var i=(function(e){var t=e.toLowerCase().trim(),o={};if(e.indexOf("(")>-1){var a=e.split("(");t=a[0].toLowerCase().trim();var n=a[1].substring(0,a[1].length-1);"currency"===t&&n.indexOf(":")<0?o.currency||(o.currency=n.trim()):"relativetime"===t&&n.indexOf(":")<0?o.range||(o.range=n.trim()):n.split(";").forEach((function(e){if(e){var t=e.split(":"),a=m.default(t),n=a[0],i=a.slice(1).join(":").trim().replace(/^'+|'+$/g,"");o[n.trim()]||(o[n.trim()]=i),"false"===i&&(o[n.trim()]=!1),"true"===i&&(o[n.trim()]=!0),isNaN(i)||(o[n.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:o}})(t),r=i.formatName,E=i.formatOptions;if(n.formats[r]){var s=e;try{var _=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},T=_.locale||_.lng||a.locale||a.lng||o;s=n.formats[r](e,T,_e(_e(_e({},E),a),_))}catch(e){n.logger.warn(e)}return s}return n.logger.warn("there was no format function for ".concat(r)),e}),e)}}]),e})();function Se(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function ue(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return d.default(this,o),i=t.call(this),F&&C.call(I.default(i)),i.backend=e,i.store=a,i.services=n,i.languageUtils=n.languageUtils,i.options=r,i.logger=f.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=r.maxParallelReads||10,i.readingCalls=0,i.maxRetries=r.maxRetries>=0?r.maxRetries:5,i.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,r.backend,r),i}return c.default(o,[{key:"queueLoad",value:function(e,t,o,a){var n=this,i={},r={},E={},s={};return e.forEach((function(e){var a=!0;t.forEach((function(t){var E="".concat(e,"|").concat(t);!o.reload&&n.store.hasResourceBundle(e,t)?n.state[E]=2:n.state[E]<0||(1===n.state[E]?void 0===r[E]&&(r[E]=!0):(n.state[E]=1,a=!1,void 0===r[E]&&(r[E]=!0),void 0===i[E]&&(i[E]=!0),void 0===s[t]&&(s[t]=!0)))})),a||(E[e]=!0)})),(Object.keys(i).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(r),toLoadLanguages:Object.keys(E),toLoadNamespaces:Object.keys(s)}}},{key:"loaded",value:function(e,t,o){var a=e.split("|"),n=a[0],i=a[1];t&&this.emit("failedLoading",n,i,t),o&&this.store.addResourceBundle(n,i,o),this.state[e]=t?-1:2;var r={};this.queue.forEach((function(o){var a,E,s,_,T,l;a=o.loaded,E=i,_=y(a,[n],Object),T=_.obj,l=_.k,T[l]=T[l]||[],s&&(T[l]=T[l].concat(E)),s||T[l].push(E),(function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(o,e),t&&o.errors.push(t),0!==o.pendingCount||o.done||(Object.keys(o.loaded).forEach((function(e){r[e]||(r[e]={});var t=o.loaded[e];t.length&&t.forEach((function(t){void 0===r[e][t]&&(r[e][t]=!0)}))})),o.done=!0,o.errors.length?o.callback(o.errors):o.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,o){var a=this,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:o,tried:n,wait:i,callback:r});else{this.readingCalls++;var E=function(E,s){if(a.readingCalls--,a.waitingReads.length>0){var _=a.waitingReads.shift();a.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}E&&s&&n2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,a,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach((function(e){o.loadOne(e)}))}},{key:"load",value:function(e,t,o){this.prepareLoading(e,t,{},o)}},{key:"reload",value:function(e,t,o){this.prepareLoading(e,t,{reload:!0},o)}},{key:"loadOne",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=e.split("|"),n=a[0],i=a[1];this.read(n,i,"read",void 0,void 0,(function(a,r){a&&t.logger.warn("".concat(o,"loading namespace ").concat(i," for language ").concat(n," failed"),a),!a&&r&&t.logger.log("".concat(o,"loaded namespace ").concat(i," for language ").concat(n),r),t.loaded(e,a,r)}))}},{key:"saveMissing",value:function(e,t,o,a,n){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=o&&""!==o){if(this.backend&&this.backend.create){var E=ue(ue({},i),{},{isUpdate:n}),s=this.backend.create.bind(this.backend);if(s.length<6)try{var _;(_=5===s.length?s(e,t,o,a,E):s(e,t,o,a))&&"function"==typeof _.then?_.then((function(e){return r(null,e)})).catch(r):r(null,_)}catch(e){r(e)}else s(e,t,o,a,r,E)}e&&e[0]&&this.store.addResource(e[0],t,o,a)}}}]),o})(C);function Ie(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===u.default(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===u.default(e[2])||"object"===u.default(e[3])){var o=e[3]||e[2];Object.keys(o).forEach((function(e){t[e]=o[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,o,a){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ae(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Oe(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function Ne(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(d.default(this,o),e=t.call(this),F&&C.call(I.default(e)),e.options=Ae(a),e.services={},e.logger=f,e.modules={external:[]},pe(I.default(e)),n&&!e.isInitialized&&!a.isClone){if(!e.options.initImmediate)return e.init(a,n),O.default(e,I.default(e));setTimeout((function(){e.init(a,n)}),0)}return e}return c.default(o,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(o=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var a=Ie();function n(e){return e?"function"==typeof e?new e:e:null}if(this.options=Ne(Ne(Ne({},a),this.options),Ae(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Ne(Ne({},a.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?f.init(n(this.modules.logger),this.options):f.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=le);var r=new J(this.options);this.store=new z(this.options.resources,this.options);var E=this.services;E.logger=f,E.resourceStore=this.store,E.languageUtils=r,E.pluralResolver=new ne(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==a.interpolation.format||(E.formatter=n(i),E.formatter.init(E,this.options),this.options.interpolation.format=E.formatter.format.bind(E.formatter)),E.interpolator=new Ee(this.options),E.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},E.backendConnector=new ce(n(this.modules.backend),E.resourceStore,E,this.options),E.backendConnector.on("*",(function(t){for(var o=arguments.length,a=new Array(o>1?o-1:0),n=1;n1?o-1:0),n=1;n0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var _=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];_.forEach((function(t){e[t]=function(){var o;return(o=e.store)[t].apply(o,arguments)}}));var T=["addResource","addResources","addResourceBundle","removeResourceBundle"];T.forEach((function(t){e[t]=function(){var o;return(o=e.store)[t].apply(o,arguments),e}}));var l=D(),S=function(){var t=function(t,a){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),l.resolve(a),o(t,a)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),l}},{key:"loadResources",value:function(e){var t=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me,a=o,n="string"==typeof e?e:this.language;if("function"==typeof e&&(a=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase())return a();var i=[],r=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(n)r(n);else{var E=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);E.forEach((function(e){return r(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),a(e)}))}else a(null)}},{key:"reloadResources",value:function(e,t,o){var a=D();return e||(e=this.languages),t||(t=this.options.ns),o||(o=me),this.services.backendConnector.reload(e,t,(function(e){a.resolve(),o(e)})),a}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&x.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(e,t){var o=this;this.isLanguageChangingTo=e;var a=D();this.emit("languageChanging",e);var n=function(e){o.language=e,o.languages=o.services.languageUtils.toResolveHierarchy(e),o.resolvedLanguage=void 0,o.setResolvedLanguage(e)},i=function(i){e||i||!o.services.languageDetector||(i=[]);var r="string"==typeof i?i:o.services.languageUtils.getBestMatchFromCodes(i);r&&(o.language||n(r),o.translator.language||o.translator.changeLanguage(r),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage&&o.services.languageDetector.cacheUserLanguage(r)),o.loadResources(r,(function(e){!(function(e,i){i?(n(i),o.translator.changeLanguage(i),o.isLanguageChangingTo=void 0,o.emit("languageChanged",i),o.logger.log("languageChanged",i)):o.isLanguageChangingTo=void 0,a.resolve((function(){return o.t.apply(o,arguments)})),t&&t(e,(function(){return o.t.apply(o,arguments)}))})(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),a}},{key:"getFixedT",value:function(e,t,o){var a=this,n=function e(t,n){var i;if("object"!==u.default(n)){for(var r=arguments.length,E=new Array(r>2?r-2:0),s=2;s1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===a.toLowerCase())return!0;var r=function(e,o){var a=t.services.backendConnector.state["".concat(e,"|").concat(o)];return-1===a||2===a};if(o.precheck){var E=o.precheck(this,r);if(void 0!==E)return E}return!!this.hasResourceBundle(a,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(a,e)||n&&!r(i,e)))}},{key:"loadNamespaces",value:function(e,t){var o=this,a=D();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){o.options.ns.indexOf(e)<0&&o.options.ns.push(e)})),this.loadResources((function(e){a.resolve(),t&&t(e)})),a):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var o=D();"string"==typeof e&&(e=[e]);var a=this.options.preload||[],n=e.filter((function(e){return a.indexOf(e)<0}));return n.length?(this.options.preload=a.concat(n),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new J(Ie());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:me,n=Ne(Ne(Ne({},this.options),t),{isClone:!0}),i=new o(n);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var r=["store","services","language"];return r.forEach((function(t){i[t]=e[t]})),i.services=Ne({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new $(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new he(e,t)}));var Le=he.createInstance();Le.createInstance=he.createInstance,e.exports=Le},645:(e,t)=>{t.read=function(e,t,o,a,n){var i,r,E=8*n-a-1,s=(1<>1,T=-7,l=o?n-1:0,S=o?-1:1,u=e[t+l];for(l+=S,i=u&(1<<-T)-1,u>>=-T,T+=E;T>0;i=256*i+e[t+l],l+=S,T-=8);for(r=i&(1<<-T)-1,i>>=-T,T+=a;T>0;r=256*r+e[t+l],l+=S,T-=8);if(0===i)i=1-_;else{if(i===s)return r?NaN:1/0*(u?-1:1);r+=Math.pow(2,a),i-=_}return(u?-1:1)*r*Math.pow(2,i-a)},t.write=function(e,t,o,a,n,i){var r,E,s,_=8*i-n-1,T=(1<<_)-1,l=T>>1,S=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,u=a?0:i-1,d=a?1:-1,c=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(E=isNaN(t)?1:0,r=T):(r=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-r))<1&&(r--,s*=2),(t+=r+l>=1?S/s:S*Math.pow(2,1-l))*s>=2&&(r++,s/=2),r+l>=T?(E=0,r=T):r+l>=1?(E=(t*s-1)*Math.pow(2,n),r+=l):(E=t*Math.pow(2,l-1)*Math.pow(2,n),r=0));n>=8;e[o+u]=255&E,u+=d,E/=256,n-=8);for(r=r<0;e[o+u]=255&r,u+=d,r/=256,_-=8);e[o+u-d]|=128*c}},5457:e=>{e.exports=[{name:"Abkhaz",local:"Аҧсуа",1:"ab",2:"abk","2T":"abk","2B":"abk",3:"abk"},{name:"Afar",local:"Afaraf",1:"aa",2:"aar","2T":"aar","2B":"aar",3:"aar"},{name:"Afrikaans",local:"Afrikaans",1:"af",2:"afr","2T":"afr","2B":"afr",3:"afr"},{name:"Akan",local:"Akan",1:"ak",2:"aka","2T":"aka","2B":"aka",3:"aka"},{name:"Albanian",local:"Shqip",1:"sq",2:"sqi","2T":"sqi","2B":"alb",3:"sqi"},{name:"Amharic",local:"አማርኛ",1:"am",2:"amh","2T":"amh","2B":"amh",3:"amh"},{name:"Arabic",local:"العربية",1:"ar",2:"ara","2T":"ara","2B":"ara",3:"ara"},{name:"Aragonese",local:"Aragonés",1:"an",2:"arg","2T":"arg","2B":"arg",3:"arg"},{name:"Armenian",local:"Հայերեն",1:"hy",2:"hye","2T":"hye","2B":"arm",3:"hye"},{name:"Assamese",local:"অসমীয়া",1:"as",2:"asm","2T":"asm","2B":"asm",3:"asm"},{name:"Avaric",local:"Авар",1:"av",2:"ava","2T":"ava","2B":"ava",3:"ava"},{name:"Avestan",local:"avesta",1:"ae",2:"ave","2T":"ave","2B":"ave",3:"ave"},{name:"Aymara",local:"Aymar",1:"ay",2:"aym","2T":"aym","2B":"aym",3:"aym"},{name:"Azerbaijani",local:"Azərbaycanca",1:"az",2:"aze","2T":"aze","2B":"aze",3:"aze"},{name:"Bambara",local:"Bamanankan",1:"bm",2:"bam","2T":"bam","2B":"bam",3:"bam"},{name:"Bashkir",local:"Башҡортса",1:"ba",2:"bak","2T":"bak","2B":"bak",3:"bak"},{name:"Basque",local:"Euskara",1:"eu",2:"eus","2T":"eus","2B":"baq",3:"eus"},{name:"Belarusian",local:"Беларуская",1:"be",2:"bel","2T":"bel","2B":"bel",3:"bel"},{name:"Bengali",local:"বাংলা",1:"bn",2:"ben","2T":"ben","2B":"ben",3:"ben"},{name:"Bihari",local:"भोजपुरी",1:"bh",2:"bih","2T":"bih","2B":"bih",3:"bih"},{name:"Bislama",local:"Bislama",1:"bi",2:"bis","2T":"bis","2B":"bis",3:"bis"},{name:"Bosnian",local:"Bosanski",1:"bs",2:"bos","2T":"bos","2B":"bos",3:"bos"},{name:"Breton",local:"Brezhoneg",1:"br",2:"bre","2T":"bre","2B":"bre",3:"bre"},{name:"Bulgarian",local:"Български",1:"bg",2:"bul","2T":"bul","2B":"bul",3:"bul"},{name:"Burmese",local:"မြန်မာဘာသာ",1:"my",2:"mya","2T":"mya","2B":"bur",3:"mya"},{name:"Catalan",local:"Català",1:"ca",2:"cat","2T":"cat","2B":"cat",3:"cat"},{name:"Chamorro",local:"Chamoru",1:"ch",2:"cha","2T":"cha","2B":"cha",3:"cha"},{name:"Chechen",local:"Нохчийн",1:"ce",2:"che","2T":"che","2B":"che",3:"che"},{name:"Chichewa",local:"Chichewa",1:"ny",2:"nya","2T":"nya","2B":"nya",3:"nya"},{name:"Chinese",local:"中文",1:"zh",2:"zho","2T":"zho","2B":"chi",3:"zho"},{name:"Chuvash",local:"Чӑвашла",1:"cv",2:"chv","2T":"chv","2B":"chv",3:"chv"},{name:"Cornish",local:"Kernewek",1:"kw",2:"cor","2T":"cor","2B":"cor",3:"cor"},{name:"Corsican",local:"Corsu",1:"co",2:"cos","2T":"cos","2B":"cos",3:"cos"},{name:"Cree",local:"ᓀᐦᐃᔭᐍᐏᐣ",1:"cr",2:"cre","2T":"cre","2B":"cre",3:"cre"},{name:"Croatian",local:"Hrvatski",1:"hr",2:"hrv","2T":"hrv","2B":"hrv",3:"hrv"},{name:"Czech",local:"Čeština",1:"cs",2:"ces","2T":"ces","2B":"cze",3:"ces"},{name:"Danish",local:"Dansk",1:"da",2:"dan","2T":"dan","2B":"dan",3:"dan"},{name:"Divehi",local:"Divehi",1:"dv",2:"div","2T":"div","2B":"div",3:"div"},{name:"Dutch",local:"Nederlands",1:"nl",2:"nld","2T":"nld","2B":"dut",3:"nld"},{name:"Dzongkha",local:"རྫོང་ཁ",1:"dz",2:"dzo","2T":"dzo","2B":"dzo",3:"dzo"},{name:"English",local:"English",1:"en",2:"eng","2T":"eng","2B":"eng",3:"eng"},{name:"Esperanto",local:"Esperanto",1:"eo",2:"epo","2T":"epo","2B":"epo",3:"epo"},{name:"Estonian",local:"Eesti",1:"et",2:"est","2T":"est","2B":"est",3:"est"},{name:"Ewe",local:"Eʋegbe",1:"ee",2:"ewe","2T":"ewe","2B":"ewe",3:"ewe"},{name:"Faroese",local:"Føroyskt",1:"fo",2:"fao","2T":"fao","2B":"fao",3:"fao"},{name:"Fijian",local:"Na Vosa Vaka-Viti",1:"fj",2:"fij","2T":"fij","2B":"fij",3:"fij"},{name:"Finnish",local:"Suomi",1:"fi",2:"fin","2T":"fin","2B":"fin",3:"fin"},{name:"French",local:"Français",1:"fr",2:"fra","2T":"fra","2B":"fre",3:"fra"},{name:"Fula",local:"Fulfulde",1:"ff",2:"ful","2T":"ful","2B":"ful",3:"ful"},{name:"Galician",local:"Galego",1:"gl",2:"glg","2T":"glg","2B":"glg",3:"glg"},{name:"Georgian",local:"ქართული",1:"ka",2:"kat","2T":"kat","2B":"geo",3:"kat"},{name:"German",local:"Deutsch",1:"de",2:"deu","2T":"deu","2B":"ger",3:"deu"},{name:"Greek",local:"Ελληνικά",1:"el",2:"ell","2T":"ell","2B":"gre",3:"ell"},{name:"Guaraní",local:"Avañe'ẽ",1:"gn",2:"grn","2T":"grn","2B":"grn",3:"grn"},{name:"Gujarati",local:"ગુજરાતી",1:"gu",2:"guj","2T":"guj","2B":"guj",3:"guj"},{name:"Haitian",local:"Kreyòl Ayisyen",1:"ht",2:"hat","2T":"hat","2B":"hat",3:"hat"},{name:"Hausa",local:"هَوُسَ",1:"ha",2:"hau","2T":"hau","2B":"hau",3:"hau"},{name:"Hebrew",local:"עברית",1:"he",2:"heb","2T":"heb","2B":"heb",3:"heb"},{name:"Herero",local:"Otjiherero",1:"hz",2:"her","2T":"her","2B":"her",3:"her"},{name:"Hindi",local:"हिन्दी",1:"hi",2:"hin","2T":"hin","2B":"hin",3:"hin"},{name:"Hiri Motu",local:"Hiri Motu",1:"ho",2:"hmo","2T":"hmo","2B":"hmo",3:"hmo"},{name:"Hungarian",local:"Magyar",1:"hu",2:"hun","2T":"hun","2B":"hun",3:"hun"},{name:"Interlingua",local:"Interlingua",1:"ia",2:"ina","2T":"ina","2B":"ina",3:"ina"},{name:"Indonesian",local:"Bahasa Indonesia",1:"id",2:"ind","2T":"ind","2B":"ind",3:"ind"},{name:"Interlingue",local:"Interlingue",1:"ie",2:"ile","2T":"ile","2B":"ile",3:"ile"},{name:"Irish",local:"Gaeilge",1:"ga",2:"gle","2T":"gle","2B":"gle",3:"gle"},{name:"Igbo",local:"Igbo",1:"ig",2:"ibo","2T":"ibo","2B":"ibo",3:"ibo"},{name:"Inupiaq",local:"Iñupiak",1:"ik",2:"ipk","2T":"ipk","2B":"ipk",3:"ipk"},{name:"Ido",local:"Ido",1:"io",2:"ido","2T":"ido","2B":"ido",3:"ido"},{name:"Icelandic",local:"Íslenska",1:"is",2:"isl","2T":"isl","2B":"ice",3:"isl"},{name:"Italian",local:"Italiano",1:"it",2:"ita","2T":"ita","2B":"ita",3:"ita"},{name:"Inuktitut",local:"ᐃᓄᒃᑎᑐᑦ",1:"iu",2:"iku","2T":"iku","2B":"iku",3:"iku"},{name:"Japanese",local:"日本語",1:"ja",2:"jpn","2T":"jpn","2B":"jpn",3:"jpn"},{name:"Javanese",local:"Basa Jawa",1:"jv",2:"jav","2T":"jav","2B":"jav",3:"jav"},{name:"Kalaallisut",local:"Kalaallisut",1:"kl",2:"kal","2T":"kal","2B":"kal",3:"kal"},{name:"Kannada",local:"ಕನ್ನಡ",1:"kn",2:"kan","2T":"kan","2B":"kan",3:"kan"},{name:"Kanuri",local:"Kanuri",1:"kr",2:"kau","2T":"kau","2B":"kau",3:"kau"},{name:"Kashmiri",local:"كشميري",1:"ks",2:"kas","2T":"kas","2B":"kas",3:"kas"},{name:"Kazakh",local:"Қазақша",1:"kk",2:"kaz","2T":"kaz","2B":"kaz",3:"kaz"},{name:"Khmer",local:"ភាសាខ្មែរ",1:"km",2:"khm","2T":"khm","2B":"khm",3:"khm"},{name:"Kikuyu",local:"Gĩkũyũ",1:"ki",2:"kik","2T":"kik","2B":"kik",3:"kik"},{name:"Kinyarwanda",local:"Kinyarwanda",1:"rw",2:"kin","2T":"kin","2B":"kin",3:"kin"},{name:"Kyrgyz",local:"Кыргызча",1:"ky",2:"kir","2T":"kir","2B":"kir",3:"kir"},{name:"Komi",local:"Коми",1:"kv",2:"kom","2T":"kom","2B":"kom",3:"kom"},{name:"Kongo",local:"Kongo",1:"kg",2:"kon","2T":"kon","2B":"kon",3:"kon"},{name:"Korean",local:"한국어",1:"ko",2:"kor","2T":"kor","2B":"kor",3:"kor"},{name:"Kurdish",local:"Kurdî",1:"ku",2:"kur","2T":"kur","2B":"kur",3:"kur"},{name:"Kwanyama",local:"Kuanyama",1:"kj",2:"kua","2T":"kua","2B":"kua",3:"kua"},{name:"Latin",local:"Latina",1:"la",2:"lat","2T":"lat","2B":"lat",3:"lat"},{name:"Luxembourgish",local:"Lëtzebuergesch",1:"lb",2:"ltz","2T":"ltz","2B":"ltz",3:"ltz"},{name:"Ganda",local:"Luganda",1:"lg",2:"lug","2T":"lug","2B":"lug",3:"lug"},{name:"Limburgish",local:"Limburgs",1:"li",2:"lim","2T":"lim","2B":"lim",3:"lim"},{name:"Lingala",local:"Lingála",1:"ln",2:"lin","2T":"lin","2B":"lin",3:"lin"},{name:"Lao",local:"ພາສາລາວ",1:"lo",2:"lao","2T":"lao","2B":"lao",3:"lao"},{name:"Lithuanian",local:"Lietuvių",1:"lt",2:"lit","2T":"lit","2B":"lit",3:"lit"},{name:"Luba-Katanga",local:"Tshiluba",1:"lu",2:"lub","2T":"lub","2B":"lub",3:"lub"},{name:"Latvian",local:"Latviešu",1:"lv",2:"lav","2T":"lav","2B":"lav",3:"lav"},{name:"Manx",local:"Gaelg",1:"gv",2:"glv","2T":"glv","2B":"glv",3:"glv"},{name:"Macedonian",local:"Македонски",1:"mk",2:"mkd","2T":"mkd","2B":"mac",3:"mkd"},{name:"Malagasy",local:"Malagasy",1:"mg",2:"mlg","2T":"mlg","2B":"mlg",3:"mlg"},{name:"Malay",local:"Bahasa Melayu",1:"ms",2:"msa","2T":"msa","2B":"may",3:"msa"},{name:"Malayalam",local:"മലയാളം",1:"ml",2:"mal","2T":"mal","2B":"mal",3:"mal"},{name:"Maltese",local:"Malti",1:"mt",2:"mlt","2T":"mlt","2B":"mlt",3:"mlt"},{name:"Māori",local:"Māori",1:"mi",2:"mri","2T":"mri","2B":"mao",3:"mri"},{name:"Marathi",local:"मराठी",1:"mr",2:"mar","2T":"mar","2B":"mar",3:"mar"},{name:"Marshallese",local:"Kajin M̧ajeļ",1:"mh",2:"mah","2T":"mah","2B":"mah",3:"mah"},{name:"Mongolian",local:"Монгол",1:"mn",2:"mon","2T":"mon","2B":"mon",3:"mon"},{name:"Nauru",local:"Dorerin Naoero",1:"na",2:"nau","2T":"nau","2B":"nau",3:"nau"},{name:"Navajo",local:"Diné Bizaad",1:"nv",2:"nav","2T":"nav","2B":"nav",3:"nav"},{name:"Northern Ndebele",local:"isiNdebele",1:"nd",2:"nde","2T":"nde","2B":"nde",3:"nde"},{name:"Nepali",local:"नेपाली",1:"ne",2:"nep","2T":"nep","2B":"nep",3:"nep"},{name:"Ndonga",local:"Owambo",1:"ng",2:"ndo","2T":"ndo","2B":"ndo",3:"ndo"},{name:"Norwegian Bokmål",local:"Norsk (Bokmål)",1:"nb",2:"nob","2T":"nob","2B":"nob",3:"nob"},{name:"Norwegian Nynorsk",local:"Norsk (Nynorsk)",1:"nn",2:"nno","2T":"nno","2B":"nno",3:"nno"},{name:"Norwegian",local:"Norsk",1:"no",2:"nor","2T":"nor","2B":"nor",3:"nor"},{name:"Nuosu",local:"ꆈꌠ꒿ Nuosuhxop",1:"ii",2:"iii","2T":"iii","2B":"iii",3:"iii"},{name:"Southern Ndebele",local:"isiNdebele",1:"nr",2:"nbl","2T":"nbl","2B":"nbl",3:"nbl"},{name:"Occitan",local:"Occitan",1:"oc",2:"oci","2T":"oci","2B":"oci",3:"oci"},{name:"Ojibwe",local:"ᐊᓂᔑᓈᐯᒧᐎᓐ",1:"oj",2:"oji","2T":"oji","2B":"oji",3:"oji"},{name:"Old Church Slavonic",local:"Словѣ́ньскъ",1:"cu",2:"chu","2T":"chu","2B":"chu",3:"chu"},{name:"Oromo",local:"Afaan Oromoo",1:"om",2:"orm","2T":"orm","2B":"orm",3:"orm"},{name:"Oriya",local:"ଓଡି଼ଆ",1:"or",2:"ori","2T":"ori","2B":"ori",3:"ori"},{name:"Ossetian",local:"Ирон æвзаг",1:"os",2:"oss","2T":"oss","2B":"oss",3:"oss"},{name:"Panjabi",local:"ਪੰਜਾਬੀ",1:"pa",2:"pan","2T":"pan","2B":"pan",3:"pan"},{name:"Pāli",local:"पाऴि",1:"pi",2:"pli","2T":"pli","2B":"pli",3:"pli"},{name:"Persian",local:"فارسی",1:"fa",2:"fas","2T":"fas","2B":"per",3:"fas"},{name:"Polish",local:"Polski",1:"pl",2:"pol","2T":"pol","2B":"pol",3:"pol"},{name:"Pashto",local:"پښتو",1:"ps",2:"pus","2T":"pus","2B":"pus",3:"pus"},{name:"Portuguese",local:"Português",1:"pt",2:"por","2T":"por","2B":"por",3:"por"},{name:"Quechua",local:"Runa Simi",1:"qu",2:"que","2T":"que","2B":"que",3:"que"},{name:"Romansh",local:"Rumantsch",1:"rm",2:"roh","2T":"roh","2B":"roh",3:"roh"},{name:"Kirundi",local:"Kirundi",1:"rn",2:"run","2T":"run","2B":"run",3:"run"},{name:"Romanian",local:"Română",1:"ro",2:"ron","2T":"ron","2B":"rum",3:"ron"},{name:"Russian",local:"Русский",1:"ru",2:"rus","2T":"rus","2B":"rus",3:"rus"},{name:"Sanskrit",local:"संस्कृतम्",1:"sa",2:"san","2T":"san","2B":"san",3:"san"},{name:"Sardinian",local:"Sardu",1:"sc",2:"srd","2T":"srd","2B":"srd",3:"srd"},{name:"Sindhi",local:"سنڌي‎",1:"sd",2:"snd","2T":"snd","2B":"snd",3:"snd"},{name:"Northern Sami",local:"Sámegiella",1:"se",2:"sme","2T":"sme","2B":"sme",3:"sme"},{name:"Samoan",local:"Gagana Sāmoa",1:"sm",2:"smo","2T":"smo","2B":"smo",3:"smo"},{name:"Sango",local:"Sängö",1:"sg",2:"sag","2T":"sag","2B":"sag",3:"sag"},{name:"Serbian",local:"Српски",1:"sr",2:"srp","2T":"srp","2B":"srp",3:"srp"},{name:"Gaelic",local:"Gàidhlig",1:"gd",2:"gla","2T":"gla","2B":"gla",3:"gla"},{name:"Shona",local:"ChiShona",1:"sn",2:"sna","2T":"sna","2B":"sna",3:"sna"},{name:"Sinhala",local:"සිංහල",1:"si",2:"sin","2T":"sin","2B":"sin",3:"sin"},{name:"Slovak",local:"Slovenčina",1:"sk",2:"slk","2T":"slk","2B":"slo",3:"slk"},{name:"Slovene",local:"Slovenščina",1:"sl",2:"slv","2T":"slv","2B":"slv",3:"slv"},{name:"Somali",local:"Soomaaliga",1:"so",2:"som","2T":"som","2B":"som",3:"som"},{name:"Southern Sotho",local:"Sesotho",1:"st",2:"sot","2T":"sot","2B":"sot",3:"sot"},{name:"Spanish",local:"Español",1:"es",2:"spa","2T":"spa","2B":"spa",3:"spa"},{name:"Sundanese",local:"Basa Sunda",1:"su",2:"sun","2T":"sun","2B":"sun",3:"sun"},{name:"Swahili",local:"Kiswahili",1:"sw",2:"swa","2T":"swa","2B":"swa",3:"swa"},{name:"Swati",local:"SiSwati",1:"ss",2:"ssw","2T":"ssw","2B":"ssw",3:"ssw"},{name:"Swedish",local:"Svenska",1:"sv",2:"swe","2T":"swe","2B":"swe",3:"swe"},{name:"Tamil",local:"தமிழ்",1:"ta",2:"tam","2T":"tam","2B":"tam",3:"tam"},{name:"Telugu",local:"తెలుగు",1:"te",2:"tel","2T":"tel","2B":"tel",3:"tel"},{name:"Tajik",local:"Тоҷикӣ",1:"tg",2:"tgk","2T":"tgk","2B":"tgk",3:"tgk"},{name:"Thai",local:"ภาษาไทย",1:"th",2:"tha","2T":"tha","2B":"tha",3:"tha"},{name:"Tigrinya",local:"ትግርኛ",1:"ti",2:"tir","2T":"tir","2B":"tir",3:"tir"},{name:"Tibetan Standard",local:"བོད་ཡིག",1:"bo",2:"bod","2T":"bod","2B":"tib",3:"bod"},{name:"Turkmen",local:"Türkmençe",1:"tk",2:"tuk","2T":"tuk","2B":"tuk",3:"tuk"},{name:"Tagalog",local:"Tagalog",1:"tl",2:"tgl","2T":"tgl","2B":"tgl",3:"tgl"},{name:"Tswana",local:"Setswana",1:"tn",2:"tsn","2T":"tsn","2B":"tsn",3:"tsn"},{name:"Tonga",local:"faka Tonga",1:"to",2:"ton","2T":"ton","2B":"ton",3:"ton"},{name:"Turkish",local:"Türkçe",1:"tr",2:"tur","2T":"tur","2B":"tur",3:"tur"},{name:"Tsonga",local:"Xitsonga",1:"ts",2:"tso","2T":"tso","2B":"tso",3:"tso"},{name:"Tatar",local:"Татарча",1:"tt",2:"tat","2T":"tat","2B":"tat",3:"tat"},{name:"Twi",local:"Twi",1:"tw",2:"twi","2T":"twi","2B":"twi",3:"twi"},{name:"Tahitian",local:"Reo Mā’ohi",1:"ty",2:"tah","2T":"tah","2B":"tah",3:"tah"},{name:"Uyghur",local:"ئۇيغۇرچه",1:"ug",2:"uig","2T":"uig","2B":"uig",3:"uig"},{name:"Ukrainian",local:"Українська",1:"uk",2:"ukr","2T":"ukr","2B":"ukr",3:"ukr"},{name:"Urdu",local:"اردو",1:"ur",2:"urd","2T":"urd","2B":"urd",3:"urd"},{name:"Uzbek",local:"O‘zbek",1:"uz",2:"uzb","2T":"uzb","2B":"uzb",3:"uzb"},{name:"Venda",local:"Tshivenḓa",1:"ve",2:"ven","2T":"ven","2B":"ven",3:"ven"},{name:"Vietnamese",local:"Tiếng Việt",1:"vi",2:"vie","2T":"vie","2B":"vie",3:"vie"},{name:"Volapük",local:"Volapük",1:"vo",2:"vol","2T":"vol","2B":"vol",3:"vol"},{name:"Walloon",local:"Walon",1:"wa",2:"wln","2T":"wln","2B":"wln",3:"wln"},{name:"Welsh",local:"Cymraeg",1:"cy",2:"cym","2T":"cym","2B":"wel",3:"cym"},{name:"Wolof",local:"Wolof",1:"wo",2:"wol","2T":"wol","2B":"wol",3:"wol"},{name:"Western Frisian",local:"Frysk",1:"fy",2:"fry","2T":"fry","2B":"fry",3:"fry"},{name:"Xhosa",local:"isiXhosa",1:"xh",2:"xho","2T":"xho","2B":"xho",3:"xho"},{name:"Yiddish",local:"ייִדיש",1:"yi",2:"yid","2T":"yid","2B":"yid",3:"yid"},{name:"Yoruba",local:"Yorùbá",1:"yo",2:"yor","2T":"yor","2B":"yor",3:"yor"},{name:"Zhuang",local:"Cuengh",1:"za",2:"zha","2T":"zha","2B":"zha",3:"zha"},{name:"Zulu",local:"isiZulu",1:"zu",2:"zul","2T":"zul","2B":"zul",3:"zul"}]},7576:(e,t,o)=>{var a=o(5457),n={all:function(){return a},has:function(e,t){return void 0!==i(e,t)},codes:function(e){if((function(e){return-1!==[1,2,3,"1","2","2B","2T","3"].indexOf(e)})(e))return r(a,(function(t){return t[e]}))},names:function(e){return r(a,(function(t){return e?t.local:t.name}))},where:i};function i(e,t){for(var o=0;o{e=o.nmd(e);var a="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",r="[object Boolean]",E="[object Date]",s="[object Function]",_="[object GeneratorFunction]",T="[object Map]",l="[object Number]",S="[object Object]",u="[object Promise]",d="[object RegExp]",c="[object Set]",I="[object String]",A="[object Symbol]",O="[object WeakMap]",N="[object ArrayBuffer]",R="[object DataView]",m="[object Float32Array]",p="[object Float64Array]",h="[object Int8Array]",L="[object Int16Array]",f="[object Int32Array]",C="[object Uint8Array]",D="[object Uint8ClampedArray]",g="[object Uint16Array]",v="[object Uint32Array]",y=/\w*$/,P=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,b={};b[i]=b["[object Array]"]=b[N]=b[R]=b[r]=b[E]=b[m]=b[p]=b[h]=b[L]=b[f]=b[T]=b[l]=b[S]=b[d]=b[c]=b[I]=b[A]=b[C]=b[D]=b[g]=b[v]=!0,b["[object Error]"]=b[s]=b[O]=!1;var M="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,W="object"==typeof self&&self&&self.Object===Object&&self,U=M||W||Function("return this")(),G=t&&!t.nodeType&&t,F=G&&e&&!e.nodeType&&e,k=F&&F.exports===G;function w(e,t){return e.set(t[0],t[1]),e}function V(e,t){return e.add(t),e}function H(e,t,o,a){var n=-1,i=e?e.length:0;for(a&&i&&(o=e[++n]);++n-1},De.prototype.set=function(e,t){var o=this.__data__,a=Be(o,e);return a<0?o.push([e,t]):o[a][1]=t,this},ge.prototype.clear=function(){this.__data__={hash:new Ce,map:new(de||De),string:new Ce}},ge.prototype.delete=function(e){return Ge(this,e).delete(e)},ge.prototype.get=function(e){return Ge(this,e).get(e)},ge.prototype.has=function(e){return Ge(this,e).has(e)},ge.prototype.set=function(e,t){return Ge(this,e).set(e,t),this},ve.prototype.clear=function(){this.__data__=new De},ve.prototype.delete=function(e){return this.__data__.delete(e)},ve.prototype.get=function(e){return this.__data__.get(e)},ve.prototype.has=function(e){return this.__data__.has(e)},ve.prototype.set=function(e,t){var o=this.__data__;if(o instanceof De){var a=o.__data__;if(!de||a.length<199)return a.push([e,t]),this;o=this.__data__=new ge(a)}return o.set(e,t),this};var ke=Te?x(Te,Object):function(){return[]},we=function(e){return te.call(e)};function Ve(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=n})(e.length)&&!Qe(e)}var je=le||function(){return!1};function Qe(e){var t=Xe(e)?te.call(e):"";return t==s||t==_}function Xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $e(e){return Ke(e)?ye(e):(function(e){if(!He(e))return Se(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t})(e)}e.exports=function(e){return be(e,!0,!0)}},1296:(e,t,o)=>{var a=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,r=/^0o[0-7]+$/i,E=parseInt,s="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,_="object"==typeof self&&self&&self.Object===Object&&self,T=s||_||Function("return this")(),l=Object.prototype.toString,S=Math.max,u=Math.min,d=function(){return T.Date.now()};function c(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function I(e){if("number"==typeof e)return e;if((function(e){return"symbol"==typeof e||(function(e){return!!e&&"object"==typeof e})(e)&&"[object Symbol]"==l.call(e)})(e))return NaN;if(c(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=c(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var o=i.test(e);return o||r.test(e)?E(e.slice(2),o?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,o){var a,n,i,r,E,s,_=0,T=!1,l=!1,A=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function O(t){var o=a,i=n;return a=n=void 0,_=t,r=e.apply(i,o)}function N(e){return _=e,E=setTimeout(m,t),T?O(e):r}function R(e){var o=e-s;return void 0===s||o>=t||o<0||l&&e-_>=i}function m(){var e=d();if(R(e))return p(e);E=setTimeout(m,(function(e){var o=t-(e-s);return l?u(o,i-(e-_)):o})(e))}function p(e){return E=void 0,A&&a?O(e):(a=n=void 0,r)}function h(){var e=d(),o=R(e);if(a=arguments,n=this,s=e,o){if(void 0===E)return N(s);if(l)return E=setTimeout(m,t),O(s)}return void 0===E&&(E=setTimeout(m,t)),r}return t=I(t)||0,c(o)&&(T=!!o.leading,i=(l="maxWait"in o)?S(I(o.maxWait)||0,t):i,A="trailing"in o?!!o.trailing:A),h.cancel=function(){void 0!==E&&clearTimeout(E),_=0,a=s=n=E=void 0},h.flush=function(){return void 0===E?r:p(d())},h}},394:(e,t,o)=>{var a="__lodash_hash_undefined__",n=9007199254740991,i=/^\[object .+?Constructor\]$/,r="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,E="object"==typeof self&&self&&self.Object===Object&&self,s=r||E||Function("return this")();function _(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}function T(e,t){return!!(e?e.length:0)&&(function(e,t,o){if(t!=t)return(function(e,t,o,a){var n=e.length,i=o+(a?1:-1);for(;a?i--:++i-1}function l(e,t,o){for(var a=-1,n=e?e.length:0;++a-1&&e%1==0&&e<=n})(e.length)&&!Y(e)})(e)})(e)?e:[]}function F(e,t){var o,a,n=e.__data__;return("string"==(a=typeof(o=t))||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==o:null===o)?n["string"==typeof t?"string":"hash"]:n.map}function k(e,t){var o=(function(e,t){return null==e?void 0:e[t]})(e,t);return U(o)?o:void 0}P.prototype.clear=function(){this.__data__=y?y(null):{}},P.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},P.prototype.get=function(e){var t=this.__data__;if(y){var o=t[e];return o===a?void 0:o}return h.call(t,e)?t[e]:void 0},P.prototype.has=function(e){var t=this.__data__;return y?void 0!==t[e]:h.call(t,e)},P.prototype.set=function(e,t){return this.__data__[e]=y&&void 0===t?a:t,this},B.prototype.clear=function(){this.__data__=[]},B.prototype.delete=function(e){var t=this.__data__,o=W(t,e);return!(o<0)&&(o==t.length-1?t.pop():C.call(t,o,1),!0)},B.prototype.get=function(e){var t=this.__data__,o=W(t,e);return o<0?void 0:t[o][1]},B.prototype.has=function(e){return W(this.__data__,e)>-1},B.prototype.set=function(e,t){var o=this.__data__,a=W(o,e);return a<0?o.push([e,t]):o[a][1]=t,this},b.prototype.clear=function(){this.__data__={hash:new P,map:new(v||B),string:new P}},b.prototype.delete=function(e){return F(this,e).delete(e)},b.prototype.get=function(e){return F(this,e).get(e)},b.prototype.has=function(e){return F(this,e).has(e)},b.prototype.set=function(e,t){return F(this,e).set(e,t),this},M.prototype.add=M.prototype.push=function(e){return this.__data__.set(e,a),this},M.prototype.has=function(e){return this.__data__.has(e)};var w,V,H=(w=function(e){var t=S(e,G);return t.length&&t[0]===e[0]?(function(e,t,o){for(var a=o?l:T,n=e[0].length,i=e.length,r=i,E=Array(i),s=1/0,_=[];r--;){var u=e[r];r&&t&&(u=S(u,d(t))),s=g(u.length,s),E[r]=!o&&(t||n>=120&&u.length>=120)?new M(r&&u):void 0}u=e[0];var I=-1,A=E[0];e:for(;++I{e=o.nmd(e);var a="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",r="[object Array]",E="[object Boolean]",s="[object Date]",_="[object Error]",T="[object Function]",l="[object Map]",S="[object Number]",u="[object Object]",d="[object Promise]",c="[object RegExp]",I="[object Set]",A="[object String]",O="[object Symbol]",N="[object WeakMap]",R="[object ArrayBuffer]",m="[object DataView]",p=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[i]=L[r]=L[R]=L[E]=L[m]=L[s]=L[_]=L[T]=L[l]=L[S]=L[u]=L[c]=L[I]=L[A]=L[N]=!1;var f="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,C="object"==typeof self&&self&&self.Object===Object&&self,D=f||C||Function("return this")(),g=t&&!t.nodeType&&t,v=g&&e&&!e.nodeType&&e,y=v&&v.exports===g,P=y&&f.process,B=(function(){try{return P&&P.binding&&P.binding("util")}catch(e){}})(),b=B&&B.isTypedArray;function M(e,t){for(var o=-1,a=null==e?0:e.length;++oE))return!1;var _=i.get(e);if(_&&i.get(t))return _==t;var T=-1,l=!0,S=2&o?new Re:void 0;for(i.set(e,t),i.set(t,e);++T-1},Oe.prototype.set=function(e,t){var o=this.__data__,a=he(o,e);return a<0?(++this.size,o.push([e,t])):o[a][1]=t,this},Ne.prototype.clear=function(){this.size=0,this.__data__={hash:new Ae,map:new(ie||Oe),string:new Ae}},Ne.prototype.delete=function(e){var t=Pe(this,e).delete(e);return this.size-=t?1:0,t},Ne.prototype.get=function(e){return Pe(this,e).get(e)},Ne.prototype.has=function(e){return Pe(this,e).has(e)},Ne.prototype.set=function(e,t){var o=Pe(this,e),a=o.size;return o.set(e,t),this.size+=o.size==a?0:1,this},Re.prototype.add=Re.prototype.push=function(e){return this.__data__.set(e,a),this},Re.prototype.has=function(e){return this.__data__.has(e)},me.prototype.clear=function(){this.__data__=new Oe,this.size=0},me.prototype.delete=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o},me.prototype.get=function(e){return this.__data__.get(e)},me.prototype.has=function(e){return this.__data__.has(e)},me.prototype.set=function(e,t){var o=this.__data__;if(o instanceof Oe){var a=o.__data__;if(!ie||a.length<199)return a.push([e,t]),this.size=++o.size,this;o=this.__data__=new Ne(a)}return o.set(e,t),this.size=o.size,this};var be=te?function(e){return null==e?[]:(e=Object(e),(function(e,t){for(var o=-1,a=null==e?0:e.length,n=0,i=[];++o-1&&e%1==0&&e-1&&e%1==0&&e<=n}function Ye(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ze(e){return null!=e&&"object"==typeof e}var xe=b?(function(e){return function(t){return e(t)}})(b):function(e){return ze(e)&&He(e.length)&&!!L[Le(e)]};function Ke(e){return null!=(t=e)&&He(t.length)&&!Ve(t)?pe(e):ge(e);var t}e.exports=function(e,t){return Ce(e,t)}},3096:(e,t,o)=>{var a="Expected a function",n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,E=/^0o[0-7]+$/i,s=parseInt,_="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g,T="object"==typeof self&&self&&self.Object===Object&&self,l=_||T||Function("return this")(),S=Object.prototype.toString,u=Math.max,d=Math.min,c=function(){return l.Date.now()};function I(e,t,o){var n,i,r,E,s,_,T=0,l=!1,S=!1,I=!0;if("function"!=typeof e)throw new TypeError(a);function N(t){var o=n,a=i;return n=i=void 0,T=t,E=e.apply(a,o)}function R(e){return T=e,s=setTimeout(p,t),l?N(e):E}function m(e){var o=e-_;return void 0===_||o>=t||o<0||S&&e-T>=r}function p(){var e=c();if(m(e))return h(e);s=setTimeout(p,(function(e){var o=t-(e-_);return S?d(o,r-(e-T)):o})(e))}function h(e){return s=void 0,I&&n?N(e):(n=i=void 0,E)}function L(){var e=c(),o=m(e);if(n=arguments,i=this,_=e,o){if(void 0===s)return R(_);if(S)return s=setTimeout(p,t),N(_)}return void 0===s&&(s=setTimeout(p,t)),E}return t=O(t)||0,A(o)&&(l=!!o.leading,r=(S="maxWait"in o)?u(O(o.maxWait)||0,t):r,I="trailing"in o?!!o.trailing:I),L.cancel=function(){void 0!==s&&clearTimeout(s),T=0,n=_=i=s=void 0},L.flush=function(){return void 0===s?E:h(c())},L}function A(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function O(e){if("number"==typeof e)return e;if((function(e){return"symbol"==typeof e||(function(e){return!!e&&"object"==typeof e})(e)&&"[object Symbol]"==S.call(e)})(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var o=r.test(e);return o||E.test(e)?s(e.slice(2),o?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,o){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError(a);return A(o)&&(n="leading"in o?!!o.leading:n,i="trailing"in o?!!o.trailing:i),I(e,t,{leading:n,maxWait:t,trailing:i})}},9566:(e,t,o)=>{var a=o(8764).Buffer;e.exports=r,e.exports.decode=r,e.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const o=Array.from(t);1===o.length&&(e.xt=o[0]);o.length>1&&(e.xt=o);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let a="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,o)=>{const n=Array.isArray(e[t])?e[t]:[e[t]];n.forEach(((e,n)=>{(o>0||n>0)&&("kt"!==t&&"so"!==t||0===n)&&(a+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(a+="kt"===t&&n>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(a+=`${t}=${i.compose(n)}`)})),a};const n=o(5017),i=o(7500);function r(e){const t={},o=e.split("magnet:?")[1];let r;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const o=e.split("=");if(2!==o.length)return;const a=o[0];let n=o[1];"dn"===a&&(n=decodeURIComponent(n).replace(/\+/g," ")),"tr"!==a&&"xs"!==a&&"as"!==a&&"ws"!==a||(n=decodeURIComponent(n)),"kt"===a&&(n=decodeURIComponent(n).split("+")),"ix"===a&&(n=Number(n)),"so"===a&&(n=i.parse(decodeURIComponent(n).split(","))),t[a]?(Array.isArray(t[a])||(t[a]=[t[a]]),t[a].push(n)):t[a]=n})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(r=e.match(/^urn:btih:(.{40})/))t.infoHash=r[1].toLowerCase();else if(r=e.match(/^urn:btih:(.{32})/)){const e=n.decode(r[1]);t.infoHash=a.from(e,"binary").toString("hex")}else(r=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=r[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(r=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=r[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=a.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=a.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=a.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}},6499:e=>{e.exports={"error-container":"error-container-OJnoc","error-image":"error-image-qU9Qo","error-message":"error-message-kW59Z","buttons-container":"buttons-container-tQonN","button-container":"button-container-vLSQK",label:"label-Up_te"}},9448:e=>{e.exports={"fade-in":"fade-in-pFkt_","toasts-container":"toasts-container-oKECy",router:"router-_65XU","error-container":"error-container-VZXwH","loader-container":"loader-container-vwvnb"}},8135:e=>{e.exports={"addon-details-container":"addon-details-container-ZQqDB","title-container":"title-container-fR02m",icon:"icon-ScXNu",logo:"logo-BujW_","name-container":"name-container-Gfhqw",name:"name-XNqfo",version:"version-w_xoN","section-container":"section-container-l3YaI","section-header":"section-header-bs8iy","section-label":"section-label-rYxQh","transport-url-label":"transport-url-label-EW7I5","disclaimer-label":"disclaimer-label-IGdd3"}},355:e=>{e.exports={"addon-details-modal-container":"addon-details-modal-container-_bwQ0","addon-details-container":"addon-details-container-AmNx2","addon-details-message-container":"addon-details-message-container-VEzeN","cancel-button":"cancel-button-luYIO","cancel-button-label":"cancel-button-label-jqVQf"}},4520:e=>{e.exports={"button-container":"button-container-HNufV"}},1726:e=>{e.exports={"checkbox-container":"checkbox-container-heGq4",toggle:"toggle-jrHgS"}},4809:e=>{e.exports={"color-picker-container":"color-picker-container-deFkW"}},5461:e=>{e.exports={"color-input-container":"color-input-container-jRZsi","transparent-label-container":"transparent-label-container-Tx2fI","transparent-label":"transparent-label-omLaY","color-picker-container":"color-picker-container-C4puR"}},9684:e=>{e.exports={"main-nav-bars-container":"main-nav-bars-container-fA7pO","horizontal-nav-bar":"horizontal-nav-bar-x5sxp","vertical-nav-bar":"vertical-nav-bar-JNw53","nav-content-container":"nav-content-container-VHwOU"}},4661:e=>{e.exports={"meta-item-container":"meta-item-container-drt6V","poster-container":"poster-container-Fruke","title-bar-container":"title-bar-container-DFXJK","menu-label-container":"menu-label-container-dlL1I","poster-shape-poster":"poster-shape-poster-F_CO5","poster-shape-square":"poster-shape-square-UCby3","poster-shape-landscape":"poster-shape-landscape-BPmb1","poster-image-layer":"poster-image-layer-CdxrT","poster-image":"poster-image-lt9zC","placeholder-icon":"placeholder-icon-uYwsv","play-icon-layer":"play-icon-layer-_75Lo","play-icon":"play-icon-d9_ll","progress-bar-layer":"progress-bar-layer-r81Qx","progress-bar":"progress-bar-E3QY9","new-videos":"new-videos-gZv0w",layer:"layer-RqXo1","title-label":"title-label-dZZ_A",icon:"icon-IfJ81"}},5883:e=>{e.exports={"action-button-container":"action-button-container-TmbQ2","icon-container":"icon-container-hvLw4",icon:"icon-DG4TM","label-container":"label-container-eh2bk",label:"label-YhHvD"}},7621:e=>{e.exports={"meta-links-container":"meta-links-container-wSrm1","label-container":"label-container-zWFke","links-container":"links-container-o4RUG","link-container":"link-container-HUDqV"}},6506:e=>{e.exports={"meta-preview-placeholder-container":"meta-preview-placeholder-container-AQ4ld","meta-info-container":"meta-info-container-pEOFb","logo-container":"logo-container-g5eNB","duration-release-info-container":"duration-release-info-container-lNaI6","duration-container":"duration-container-x2E01","release-info-container":"release-info-container-PEmeu","genres-container":"genres-container-v3H7A","genres-header-container":"genres-header-container-lsPLU","genre-label-container":"genre-label-container-z7kU8","action-buttons-container":"action-buttons-container-U3sbl"}},6037:e=>{e.exports={"meta-preview-container":"meta-preview-container-bgBNf",compact:"compact-Wbl4Q","meta-info-container":"meta-info-container-tlmcb",logo:"logo-X9v1A","logo-placeholder":"logo-placeholder-kIy0x","runtime-release-info-container":"runtime-release-info-container-lXo3K","release-info-label":"release-info-label-XmqSY","runtime-label":"runtime-label-B29EN","description-container":"description-container-eSGft","action-buttons-container":"action-buttons-container-qQrnO","action-button":"action-button-R44aX","background-image-layer":"background-image-layer-GstuA","background-image":"background-image-B0d6i","imdb-button-container":"imdb-button-container-qCbl7",label:"label-_DfnK",icon:"icon-MBu8k","label-container":"label-container-xChHj","meta-links":"meta-links-mTHUo","share-prompt":"share-prompt-F8qOC"}},7841:e=>{e.exports={"meta-row-placeholder-container":"meta-row-placeholder-container-wpHNk","header-container":"header-container-GCHdB","title-container":"title-container-Bjp93","see-all-container":"see-all-container-FnlIf",label:"label-dU3S2",icon:"icon-FLhtv","meta-items-container":"meta-items-container-dbGXx","meta-item":"meta-item-IegjY","poster-container":"poster-container-RlQMV","title-bar-container":"title-bar-container-YJZrl","title-label":"title-label-Ka1vs"}},676:e=>{e.exports={"meta-row-container":"meta-row-container-ucOuu","header-container":"header-container-RherZ","title-container":"title-container-SJ0nR","see-all-container":"see-all-container-HlJ4b",label:"label-isJw8",icon:"icon-PO0GH","message-container":"message-container-bIcjN","meta-items-container":"meta-items-container-TqzFs","meta-item":"meta-item-x28TU","poster-shape-poster":"poster-shape-poster-B1QR0","poster-shape-square":"poster-shape-square-m5r_O","poster-shape-landscape":"poster-shape-landscape-_FSOH"}},1621:e=>{e.exports={"modal-container":"modal-container-jZglc","modal-dialog-container":"modal-dialog-container-QgsId","close-button-container":"close-button-container-QrgQo",icon:"icon-hRjWc","title-container":"title-container-wqhp3","modal-dialog-content":"modal-dialog-content-ChXwF","buttons-container":"buttons-container-EJKJF","action-button":"action-button-bi6FL",label:"label-_ADoX"}},7409:e=>{e.exports={"label-container":"label-container-ZHk2S",icon:"icon-YGvLz",label:"label-kz1K0","modal-container":"modal-container-BQwj3","menu-container":"menu-container-Z1Pou","option-container":"option-container-yVj1o","no-options-container":"no-options-container-NYx9Z"}},8147:e=>{e.exports={"nav-menu-container":"nav-menu-container-VSzwW","user-info-container":"user-info-container-BR8yb","avatar-container":"avatar-container-jmlBM","user-info-details":"user-info-details-vvVBe","email-container":"email-container-fvFrL","email-label":"email-label-WBX2T","logout-button-container":"logout-button-container-hSW_i","logout-label":"logout-label-dUa8B","nav-menu-section":"nav-menu-section-oMELF","nav-menu-option-container":"nav-menu-option-container-gZ1gT",icon:"icon-OSgm6","nav-menu-option-label":"nav-menu-option-label-XNuY6"}},7551:e=>{e.exports={"search-bar-container":"search-bar-container-TNPzI","search-input":"search-input-aOiJ2","placeholder-label":"placeholder-label-Irklk","submit-button-container":"submit-button-container-jPP5J",icon:"icon-FT4bG"}},4887:e=>{e.exports={"horizontal-nav-bar-container":"horizontal-nav-bar-container-jFw5Y","logo-container":"logo-container-fnFzY",logo:"logo-RVSxt","back-button-container":"back-button-container-K9AwF",title:"title-_UxXH","search-bar":"search-bar-NopQ6","buttons-container":"buttons-container-fHCke","button-container":"button-container-B23qB",icon:"icon-wrBcp","menu-button-container":"menu-button-container-WWcwa"}},9842:e=>{e.exports={"nav-tab-button-container":"nav-tab-button-container-r8HUb",label:"label-mc9eB",icon:"icon-vxKmB",logo:"logo-ST06l"}},7636:e=>{e.exports={"vertical-nav-bar-container":"vertical-nav-bar-container-AsGLM","nav-tab-button":"nav-tab-button-noMv6"}},2168:e=>{e.exports={"pagination-input-container":"pagination-input-container-vXhi6","next-button-container":"next-button-container-zNwG6","prev-button-container":"prev-button-container-qmJ1m",icon:"icon-UoyQ9","label-container":"label-container-VwInD",label:"label-cJKC1"}},9192:e=>{e.exports={background:"background-FNyrF",icon:"icon-XXj2q"}},194:e=>{e.exports={"label-container":"label-container-iBMb9","menu-container":"menu-container-bfvDO","menu-direction-top-left":"menu-direction-top-left-KpAQN","menu-direction-bottom-left":"menu-direction-bottom-left-Uw06K","menu-direction-top-right":"menu-direction-top-right-jOtwq","menu-direction-bottom-right":"menu-direction-bottom-right-XZ9Ch"}},3109:e=>{e.exports={"search-bar-container":"search-bar-container-Vb_fz","search-input":"search-input-BWyeG",icon:"icon-poa62"}},330:e=>{e.exports={"search-bar-container":"search-bar-container-MpNBA","search-input":"search-input-ge2wu",icon:"icon-Z_Hni"}},4530:e=>{e.exports={"share-prompt-container":"share-prompt-container-YsJwl","buttons-container":"buttons-container-Oc7PG","button-container":"button-container-oMOnv",icon:"icon-FVvQH",label:"label-iOGrs","facebook-button":"facebook-button-KaNwb","twitter-button":"twitter-button-pJka2","url-container":"url-container-fMSp4","url-text-input":"url-text-input-Yka4x","copy-button":"copy-button-ShwCB"}},5036:e=>{e.exports={"active-slider-within":"active-slider-within-lQFc1","slider-container":"slider-container-aRzVq",layer:"layer-FqnD7",track:"track-jWhBI","track-before":"track-before-FwOXh","track-after":"track-after-iD0ee",thumb:"thumb-tfDk6"}},7985:e=>{e.exports={"warning-container":"warning-container-FIITF","warning-statement":"warning-statement-I7pdD","warning-button":"warning-button-zlx_V","warning-label":"warning-label-XJnBc"}},5725:e=>{e.exports={"text-input":"text-input-jR2Nr"}},9775:e=>{e.exports={"toast-item-container":"toast-item-container-nG0uk",success:"success-eIDTa","icon-container":"icon-container-rjAiH",icon:"icon-Y4I_O",error:"error-quyOd","info-container":"info-container-xD9V6","title-container":"title-container-VFReJ","message-container":"message-container-znkCj","close-button-container":"close-button-container-YtyYE"}},2638:e=>{e.exports={"addon-container":"addon-container-lC5KN","logo-container":"logo-container-ZcSSC",logo:"logo-WrsGF",icon:"icon-GxVbY","info-container":"info-container-AdMB6","name-container":"name-container-qIAg8","version-container":"version-container-zdPyN","types-container":"types-container-DaOrg","description-container":"description-container-v7Jhe","buttons-container":"buttons-container-g0xXr","action-buttons-container":"action-buttons-container-xMVmz","configure-button-container":"configure-button-container-VwVAQ","install-button-container":"install-button-container-yfcq5","share-button-container":"share-button-container-s3gwP","uninstall-button-container":"uninstall-button-container-oV4Yo",label:"label-OnWh2"}},5531:e=>{e.exports={"addons-container":"addons-container-ogGYu","addons-content":"addons-content-zhFBl","selectable-inputs-container":"selectable-inputs-container-tUul1","add-button-container":"add-button-container-SkafT",icon:"icon-HsyZS","add-button-label":"add-button-label-NN6bu","select-input-container":"select-input-container-KqG8N",spacing:"spacing-wH1w5","search-bar":"search-bar-k7MXd","filter-button":"filter-button-lLJ1X","filter-icon":"filter-icon-LUDTS","message-container":"message-container-GBw0P","addons-list-container":"addons-list-container-Ovr2Z",addon:"addon-whmdO","filters-modal":"filters-modal-w6oWY","add-addon-modal-container":"add-addon-modal-container-KR5ny",notice:"notice-UQkO1","addon-url-input":"addon-url-input-ucetZ","cancel-button":"cancel-button-R2AxR","share-modal-container":"share-modal-container-DkzPM","title-container":"title-container-La49g",logo:"logo-PmYDP","name-container":"name-container-m_Sz0",name:"name-YD0xd",version:"version-wuAFB","share-prompt-container":"share-prompt-container-vaK4P"}},969:e=>{e.exports={"board-container":"board-container-DTN_b","board-content-container":"board-content-container-ToQTz","board-content":"board-content-nPWv1","board-row":"board-row-CoJrZ","board-warning-container":"board-warning-container-a4m04","board-row-landscape":"board-row-landscape-FRGXx","board-row-poster":"board-row-poster-QPQqC","board-row-square":"board-row-square-pgaZ3","continue-watching-row":"continue-watching-row-ZiNSa"}},820:e=>{e.exports={"discover-container":"discover-container-L6OGL","discover-content":"discover-content-CRsRg","catalog-container":"catalog-container-VNK_T","selectable-inputs-container":"selectable-inputs-container-IRz50","select-input":"select-input-CHDbe","filter-container":"filter-container-BVkqT","filter-icon":"filter-icon-zlFnX","missing-addon-warning-container":"missing-addon-warning-container-IXGuv","warning-label":"warning-label-f19Jg","install-button":"install-button-SmJe1",label:"label-ToW4S","message-container":"message-container-Zv9eF",image:"image-txC9E","message-label":"message-label-mRyRX","meta-items-container":"meta-items-container-n8vNz","meta-item-placeholder":"meta-item-placeholder-wxG4I","poster-container":"poster-container-Dch4R","title-bar-container":"title-bar-container-dtDnk","title-label":"title-label-vHdQd","meta-preview-container":"meta-preview-container-CoWs5","selectable-inputs-modal":"selectable-inputs-modal-ChpOa"}},6947:e=>{e.exports={"consent-checkbox-container":"consent-checkbox-container-WV60T",label:"label-l3LSw",link:"link-UppYg"}},9070:e=>{e.exports={"password-reset-modal-container":"password-reset-modal-container-KzJPQ","credentials-text-input":"credentials-text-input-ncrIR","error-message":"error-message-DkekN","cancel-button":"cancel-button-AneJE"}},8999:e=>{e.exports={"intro-container":"intro-container-tkNS6","background-container":"background-container-aYKCH","heading-container":"heading-container-oI70m","logo-container":"logo-container-W49kt",logo:"logo-WJ36F","slogan-container":"slogan-container-UlcYd","title-container":"title-container-CbIkM","content-container":"content-container-A1Drn","form-button":"form-button-vyqqj",icon:"icon-L_6b6",label:"label-uHD7L","guest-login-button":"guest-login-button-D8DWZ","login-form-button":"login-form-button-DqJUV","signup-form-button":"signup-form-button-UGmSk","submit-button":"submit-button-x3L8z","form-container":"form-container-HMlEh","credentials-text-input":"credentials-text-input-QMCZz","forgot-password-link-container":"forgot-password-link-container-ygZqb","forgot-password-link":"forgot-password-link-NxNUD","error-message":"error-message-cKdzB","options-container":"options-container-qxboQ","facebook-button":"facebook-button-LZ_kG","loading-modal-container":"loading-modal-container-eLyTm","loader-container":"loader-container-oe8rU",flash:"flash-wUFXY"}},1596:e=>{e.exports={"library-container":"library-container-zM_bj","library-content":"library-content-PgX4O","selectable-inputs-container":"selectable-inputs-container-hR3or","select-input-container":"select-input-container-H1VZ1","filter-container":"filter-container-oRBlw","filter-icon":"filter-icon-ZhMyS",spacing:"spacing-Rdiyt","pagination-input":"pagination-input-DvMtv","message-container":"message-container-MhY5t","no-user-message-container":"no-user-message-container-KMLpE","login-button-container":"login-button-container-RoEh7",label:"label-QqYmf",image:"image-csRHm","message-label":"message-label-UExl3","meta-items-container":"meta-items-container-IKrND","selectable-inputs-modal":"selectable-inputs-modal-rHlo7"}},1384:e=>{e.exports={"stream-placeholder-container":"stream-placeholder-container-T1nxv","addon-container":"addon-container-pm1P0","addon-name":"addon-name-zAOKP","info-container":"info-container-Z1Dl6","description-container":"description-container-ZOMcn","play-icon":"play-icon-MXqj3"}},3458:e=>{e.exports={"stream-container":"stream-container-JPdah","play-icon":"play-icon-w1yb5","addon-name-container":"addon-name-container-IZ2De","thumbnail-container":"thumbnail-container-ptbAk",thumbnail:"thumbnail-whoms","placeholder-icon":"placeholder-icon-znYz0","addon-name":"addon-name-tC8PX","info-container":"info-container-TihQo","progress-bar-container":"progress-bar-container-ADRp_","progress-bar":"progress-bar-XrEBL"}},6796:e=>{e.exports={"streams-list-container":"streams-list-container-xYMJo","message-container":"message-container-f9_L4",image:"image-rIyu6",label:"label-luvnO","select-input-container":"select-input-container-irGn_","streams-container":"streams-container-bbSc4","install-button-container":"install-button-container-Q60yJ",icon:"icon-SoFgF"}},2180:e=>{e.exports={"seasons-bar-placeholder-container":"seasons-bar-placeholder-container-M81RN","next-season-button":"next-season-button-oGnlT","prev-season-button":"prev-season-button-TCbOq",icon:"icon-UzQjF",label:"label-lmBnj","seasons-popup-label-container":"seasons-popup-label-container-r2UDB","seasons-popup-label":"seasons-popup-label-xBinL","seasons-popup-icon":"seasons-popup-icon-p1T5d"}},6351:e=>{e.exports={"seasons-bar-container":"seasons-bar-container-nOZjG","next-season-button":"next-season-button-RrYAq","prev-season-button":"prev-season-button-bs1GQ",label:"label-uJbfD",icon:"icon-_ZBEE","seasons-popup-label-container":"seasons-popup-label-container-fZcu4"}},5507:e=>{e.exports={"video-placeholder-container":"video-placeholder-container-uDsav","info-container":"info-container-KTKtT","name-container":"name-container-Jvesr","released-container":"released-container-uoc4E"}},4486:e=>{e.exports={"video-container":"video-container-UBBpR","thumbnail-container":"thumbnail-container-n_jp7",thumbnail:"thumbnail-MiS3K","placeholder-icon":"placeholder-icon-LzVIO","info-container":"info-container-szYxP","title-container":"title-container-EMXpV","flex-row-container":"flex-row-container-ExEua","released-container":"released-container-zA91y","upcoming-watched-container":"upcoming-watched-container-y_ijd","upcoming-container":"upcoming-container-ASE1L","watched-container":"watched-container-LCso2","flag-icon":"flag-icon-IJVCW","flag-label":"flag-label-dIdBb","progress-bar-container":"progress-bar-container-gMpiB","progress-bar":"progress-bar-Yhl4z","context-menu-content":"context-menu-content-MGBhW","context-menu-option-container":"context-menu-option-container-VlNjD","context-menu-option-label":"context-menu-option-label-hOUnH"}},2759:e=>{e.exports={"videos-list-container":"videos-list-container-NepX5","message-container":"message-container-_hhmQ",image:"image-_xAbP",label:"label-Ff1_X","notifications-checkbox":"notifications-checkbox-E2l5g","seasons-bar":"seasons-bar-Ma8vp","search-bar":"search-bar-mZHWa","videos-container":"videos-container-msX8s"}},9514:e=>{e.exports={"metadetails-container":"metadetails-container-K_Dqa","nav-bar":"nav-bar-MH6Vk","metadetails-content":"metadetails-content-Uz5EV","vertical-nav-bar":"vertical-nav-bar-B39nq","background-image-layer":"background-image-layer-wJa90","background-image":"background-image-tSjYu","meta-message-container":"meta-message-container-MJZN5",image:"image-R1LcJ","message-label":"message-label-Uz4_P","meta-preview":"meta-preview-ES0h3",spacing:"spacing-rgIYg","streams-list":"streams-list-Y1lCM","videos-list":"videos-list-nE0LJ","meta-extension-modal-container":"meta-extension-modal-container-gHjqy","meta-extension-modal-iframe":"meta-extension-modal-iframe-GGHlm"}},5142:e=>{e.exports={"not-found-container":"not-found-container-Q1qsP","nav-bar":"nav-bar-Eu3_y","not-found-content":"not-found-content-z_Eza","not-found-image":"not-found-image-Qab4G","not-found-label":"not-found-label-mmwyZ"}},1391:e=>{e.exports={"buffering-loader-container":"buffering-loader-container-P7S0m","buffering-loader":"buffering-loader-fMSpb"}},8982:e=>{e.exports={"seek-bar-container":"seek-bar-container-JGGTa",label:"label-QFbsS",slider:"slider-hBDOf"}},6708:e=>{e.exports={"volume-slider":"volume-slider-G_xAt"}},578:e=>{e.exports={"control-bar-container":"control-bar-container-xsWA7","seek-bar":"seek-bar-I7WeY","control-bar-buttons-container":"control-bar-buttons-container-SWhkU","control-bar-button":"control-bar-button-FQUsj",icon:"icon-qy6I6","volume-slider":"volume-slider-U9jfo",spacing:"spacing-p8NJQ","control-bar-buttons-menu-button":"control-bar-buttons-menu-button-h0MWd","control-bar-buttons-menu-container":"control-bar-buttons-menu-container-M6L0_"}},3800:e=>{e.exports={"info-menu-container":"info-menu-container-R1QKH",stream:"stream-MY2Oy"}},5626:e=>{e.exports={"next-video-popup-container":"next-video-popup-container-H4wnL","slide-fade-in":"slide-fade-in-rk2M8","poster-container":"poster-container-tXZjA","poster-image":"poster-image-2D6wg","placeholder-icon":"placeholder-icon-fu1rK","info-container":"info-container-KLOMx","details-container":"details-container-bUOTZ",name:"name-sIiDL",description:"description-gIXiC","buttons-container":"buttons-container-iYrpZ",spacing:"spacing-iFwsN","button-container":"button-container-i4F7t","play-button":"play-button-Dluk6",icon:"icon-N3Ewm",label:"label-zOq_w"}},1530:e=>{e.exports={"option-container":"option-container-m_jZq",icon:"icon-krR0X",label:"label-cmqqu"}},8183:e=>{e.exports={"options-menu-container":"options-menu-container-qlzLt"}},4805:e=>{e.exports={option:"option-_O96j",icon:"icon-kqaPF",label:"label-FEOiu"}},9715:e=>{e.exports={"speed-menu-container":"speed-menu-container-ABjzc",title:"title-Hu2Dm","options-container":"options-container-DNn3D",option:"option-GcPlB"}},1289:e=>{e.exports={"statistics-menu-container":"statistics-menu-container-DhiHn",title:"title-NCwWH",label:"label-h6nN_",value:"value-E8Ftb",stats:"stats-Tr37t",stat:"stat-zoq5A","info-hash":"info-hash-GT1Cv"}},3283:e=>{e.exports={"discrete-input-container":"discrete-input-container-CMThy",header:"header-n0jWL","input-container":"input-container-TNuI2","button-container":"button-container-ciSB5",icon:"icon-JDltr","option-label":"option-label-tjeeT"}},3889:e=>{e.exports={"subtitles-menu-container":"subtitles-menu-container-PxBRZ","languages-container":"languages-container-NS7H9","subtitles-settings-container":"subtitles-settings-container-LhRGS","variants-container":"variants-container-XglzH","languages-header":"languages-header-jGNcK","settings-header":"settings-header-eaWnm","variants-header":"variants-header-TsVSR","languages-list":"languages-list-sxIwI","variants-list":"variants-list-yZo6B","language-option":"language-option-O1Yr9","variant-option":"variant-option-t7_LA","language-label":"language-label-FjjqA","variant-label":"variant-label-opjnP",icon:"icon-I1Ruh","no-variants-container":"no-variants-container-q6u1Q","no-variants-label":"no-variants-label-RmDKZ",spacing:"spacing-AWJpt","discrete-input":"discrete-input-fXELp"}},4236:e=>{e.exports={"video-container":"video-container-v9_vA",video:"video-tkpQm"}},674:e=>{e.exports={"videos-menu-container":"videos-menu-container-ATzKq"}},9731:e=>{e.exports={"player-container":"player-container-wIELK",immersed:"immersed-Y0hn1","control-bar-layer":"control-bar-layer-m2jto","menu-layer":"menu-layer-HZFG9","nav-bar-layer":"nav-bar-layer-r9HT5",layer:"layer-qalDW","error-layer":"error-layer-RCEZC","error-label":"error-label-FPIMw","error-sub":"error-sub-Myxw2","playlist-button":"playlist-button-CB2WC",icon:"icon-aMPEE",label:"label-njZqk"}},5532:e=>{e.exports={"search-container":"search-container-uXEFf","search-content":"search-content-LX6un","search-row":"search-row-EQLaD","search-hints-container":"search-hints-container-FHpPM","search-hint-container":"search-hint-container-kd8iX",icon:"icon-fOZZl",label:"label-l6wxz","message-container":"message-container-YAunr",image:"image-Xuwya","message-label":"message-label-K8LPz","search-row-landscape":"search-row-landscape-o3Lfv","search-row-poster":"search-row-poster-m7CUE","search-row-square":"search-row-square-VesJA"}},9819:e=>{e.exports={"settings-container":"settings-container-b0DCu","settings-content":"settings-content-lLXmk","side-menu-container":"side-menu-container-NG17D","side-menu-button":"side-menu-button-vbkJ1",selected:"selected-yhdng",spacing:"spacing-fpLUM","version-info-label":"version-info-label-uMkm7","sections-container":"sections-container-EUKAe","section-container":"section-container-twzKQ","section-title":"section-title-Nt71Z","option-container":"option-container-EGlcv","user-info-option-container":"user-info-option-container-oRLJc","user-info-content":"user-info-content-ez7kZ","avatar-container":"avatar-container-YWq9E","email-logout-container":"email-logout-container-kYQDM","email-label-container":"email-label-container-oVmiO","logout-button-container":"logout-button-container-jLrU2","email-label":"email-label-Q__sJ","logout-label":"logout-label-zo4ES","user-panel-container":"user-panel-container-kkrJG","user-panel-label":"user-panel-label-beAQl","option-input-container":"option-input-container-NPgpT","option-name-container":"option-name-container-exGMI",icon:"icon-REQkK",label:"label-FFamJ","button-container":"button-container-ENMae","multiselect-container":"multiselect-container-w0c9l","link-container":"link-container-ERYsD","checkbox-container":"checkbox-container-R9LLN","color-input-container":"color-input-container-WclA_","info-container":"info-container-wfFcS",selectable:"selectable-eucrJ","configure-input-container":"configure-input-container-PMyIY","configure-button-container":"configure-button-container-xGFgg","shortcut-container":"shortcut-container-ZSm5O","configure-server-url-modal-container":"configure-server-url-modal-container-vSL44","server-url-input":"server-url-input-Dfazw","cancel-button":"cancel-button-iydew"}},2703:(e,t,o)=>{"use strict";var a=o(414);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,o,n,i,r){if(r!==a){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}function t(){return e}e.isRequired=e;var o={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return o.PropTypes=o,o}},5697:(e,t,o)=>{e.exports=o(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4971:function(e,t,o){var a;e=o.nmd(e),(function(n){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof o.g&&o.g;i.global!==i&&i.window!==i&&i.self;var r,E=2147483647,s=36,_=/^xn--/,T=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},u=Math.floor,d=String.fromCharCode;function c(e){throw RangeError(S[e])}function I(e,t){for(var o=e.length,a=[];o--;)a[o]=t(e[o]);return a}function A(e,t){var o=e.split("@"),a="";return o.length>1&&(a=o[0]+"@",e=o[1]),a+I((e=e.replace(l,".")).split("."),t).join(".")}function O(e){for(var t,o,a=[],n=0,i=e.length;n=55296&&t<=56319&&n65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function m(e,t,o){var a=0;for(e=o?u(e/700):e>>1,e+=u(e/t);e>455;a+=s)e=u(e/35);return u(a+36*e/(e+38))}function p(e){var t,o,a,n,i,r,_,T,l,S,d,I=[],A=e.length,O=0,R=128,p=72;for((o=e.lastIndexOf("-"))<0&&(o=0),a=0;a=128&&c("not-basic"),I.push(e.charCodeAt(a));for(n=o>0?o+1:0;n=A&&c("invalid-input"),((T=(d=e.charCodeAt(n++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:s)>=s||T>u((E-O)/r))&&c("overflow"),O+=T*r,!(T<(l=_<=p?1:_>=p+26?26:_-p));_+=s)r>u(E/(S=s-l))&&c("overflow"),r*=S;p=m(O-i,t=I.length+1,0==i),u(O/t)>E-R&&c("overflow"),R+=u(O/t),O%=t,I.splice(O++,0,R)}return N(I)}function h(e){var t,o,a,n,i,r,_,T,l,S,I,A,N,p,h,L=[];for(A=(e=O(e)).length,t=128,o=0,i=72,r=0;r=t&&I<_&&(_=I);for(_-t>u((E-o)/(N=a+1))&&c("overflow"),o+=(_-t)*N,t=_,r=0;rE&&c("overflow"),I==t){for(T=o,l=s;!(T<(S=l<=i?1:l>=i+26?26:l-i));l+=s)h=T-S,p=s-S,L.push(d(R(S+h%p,0))),T=u(h/p);L.push(d(R(T,0))),i=m(o,N,a==n),o=0,++a}++o,++t}return L.join("")}r={version:"1.3.2",ucs2:{decode:O,encode:N},decode:p,encode:h,toASCII:function(e){return A(e,(function(e){return T.test(e)?"xn--"+h(e):e}))},toUnicode:function(e){return A(e,(function(e){return _.test(e)?p(e.slice(4).toLowerCase()):e}))}},void 0===(a=function(){return r}.call(t,o,t,e))||(e.exports=a)})()},2587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,o,a,n){o=o||"&",a=a||"=";var i={};if("string"!=typeof e||0===e.length)return i;var r=/\+/g;e=e.split(o);var E=1e3;n&&"number"==typeof n.maxKeys&&(E=n.maxKeys);var s=e.length;E>0&&s>E&&(s=E);for(var _=0;_=0?(T=d.substr(0,c),l=d.substr(c+1)):(T=d,l=""),S=decodeURIComponent(T),u=decodeURIComponent(l),t(i,S)?Array.isArray(i[S])?i[S].push(u):i[S]=[i[S],u]:i[S]=u}return i}},2361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,o,a,n){return o=o||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(t(n))+a;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(t(e))})).join(o):i+encodeURIComponent(t(e[n]))})).join(o):n?encodeURIComponent(t(n))+a+encodeURIComponent(t(e)):""}},7673:(e,t,o)=>{"use strict";t.decode=t.parse=o(2587),t.encode=t.stringify=o(2361)},4448:(e,t,o)=>{"use strict";var a=o(7294),n=o(3840);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o