fbpx
-1 C
Olsztyn
środa, 19 stycznia, 2022
reklama

Co on zrobił? Na al. Sikorskiego jechał przed radiowozem. Nagranie ITS

reklama

Około godz. 3:00, na ul. Sikorskiego w Olsztynie policjanci z Wydziału Zabezpieczenia Miasta olsztyńskiej komendy zauważyli volvo, którego kierujący nie zastosował się do znaku poziomego i wykonał manewr skrętu w prawo z pasa ruchu przeznaczonego do jazdy na wprost.

Manewr ten wykonał bezpośrednio przed jadącym za nim radiowozem. W związku z popełnionym wykroczeniem funkcjonariusze zatrzymali kierowcę do kontroli. W trakcie interwencji policjanci wyczuli od 30-latka woń alkoholu. Badanie na zawartość tej substancji w jego organizmie wykazało ponad 2 promile. Mężczyzna stracił już prawo jazdy, a za popełnione przestępstwo odpowie przed sądem.

źródło: KMP Olsztyn

".length,u=void 0;n&&i++<5&&!("html"===(u=s(n,e))||i>1&&o+r.length*a+u.length>=80);)r.push(u),o+=u.length,n=n.parentNode;return r.reverse().join(" > ")}catch(t){return""}},e.getLocationHref=function(){var t=r.getGlobalObject();try{return t.document.location.href}catch(t){return""}}},"./node_modules/@sentry/utils/dist/dsn.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js"),i=n("./node_modules/@sentry/utils/dist/error.js"),s=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))[email protected])([\w.-]+)(?::(\d+))?\/(.+)/,o="Invalid Dsn",a=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,i=e.pass,s=e.port,o=e.projectId;return e.protocol+"://"+e.publicKey+(t&&i?":"+i:"")+"@"+n+(s?":"+s:"")+"/"+(r?r+"/":r)+o},t.prototype._fromString=function(t){var e=s.exec(t);if(!e)throw new i.SentryError(o);var n=r.__read(e.slice(1),6),a=n[0],u=n[1],l=n[2],c=void 0===l?"":l,d=n[3],h=n[4],p=void 0===h?"":h,f="",m=n[5],g=m.split("/");if(g.length>1&&(f=g.slice(0,-1).join("/"),m=g.pop()),m){var v=m.match(/^\d+/);v&&(m=v[0])}this._fromComponents({host:d,pass:c,path:f,projectId:m,port:p,protocol:a,publicKey:u})},t.prototype._fromComponents=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new i.SentryError("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new i.SentryError("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new i.SentryError("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new i.SentryError("Invalid Dsn: Invalid port "+this.port)},t}();e.Dsn=a},"./node_modules/@sentry/utils/dist/error.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js"),i=n("./node_modules/@sentry/utils/dist/polyfill.js"),s=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,i.setPrototypeOf(r,n.prototype),r}return r.__extends(e,t),e}(Error);e.SentryError=s},"./node_modules/@sentry/utils/dist/global.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/node.js"),i={};e.getGlobalObject=function(){return r.isNodeEnv()?n.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:i}},"./node_modules/@sentry/utils/dist/index.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js");r.__exportStar(n("./node_modules/@sentry/utils/dist/async.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/browser.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/dsn.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/error.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/global.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/instrument.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/is.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/logger.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/memo.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/misc.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/node.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/object.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/path.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/promisebuffer.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/stacktrace.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/string.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/supports.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/syncpromise.js"),e),r.__exportStar(n("./node_modules/@sentry/utils/dist/time.js"),e)},"./node_modules/@sentry/utils/dist/instrument.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r,i=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js"),s=n("./node_modules/@sentry/utils/dist/global.js"),o=n("./node_modules/@sentry/utils/dist/is.js"),a=n("./node_modules/@sentry/utils/dist/logger.js"),u=n("./node_modules/@sentry/utils/dist/object.js"),l=n("./node_modules/@sentry/utils/dist/stacktrace.js"),c=n("./node_modules/@sentry/utils/dist/supports.js"),d=s.getGlobalObject(),h={},p={};function f(t){if(!p[t])switch(p[t]=!0,t){case"console":!function(){if(!("console"in d))return;["debug","info","warn","error","log","assert"].forEach((function(t){t in d.console&&u.fill(d.console,t,(function(e){return function(){for(var n=[],r=0;r2?e[2]:void 0;if(i){var s=r,o=String(i);r=o,m("history",{from:s,to:o})}return t.apply(this,e)}}d.onpopstate=function(){for(var e=[],n=0;n{function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function r(t,e){try{return t instanceof e}catch(t){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.isError=function(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return r(t,Error)}},e.isErrorEvent=function(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)},e.isDOMError=function(t){return"[object DOMError]"===Object.prototype.toString.call(t)},e.isDOMException=function(t){return"[object DOMException]"===Object.prototype.toString.call(t)},e.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},e.isPrimitive=function(t){return null===t||"object"!=typeof t&&"function"!=typeof t},e.isPlainObject=n,e.isEvent=function(t){return"undefined"!=typeof Event&&r(t,Event)},e.isElement=function(t){return"undefined"!=typeof Element&&r(t,Element)},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.isThenable=function(t){return Boolean(t&&t.then&&"function"==typeof t.then)},e.isSyntheticEvent=function(t){return n(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t},e.isInstanceOf=r},"./node_modules/@sentry/utils/dist/logger.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/global.js"),i=r.getGlobalObject(),s="Sentry Logger ";function o(t){var e=r.getGlobalObject();if(!("console"in e))return t();var n=e.console,i={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(i[t]=n[t],n[t]=n[t].__sentry_original__)}));var s=t();return Object.keys(i).forEach((function(t){n[t]=i[t]})),s}e.consoleSandbox=o;var a=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e{Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js"),i=n("./node_modules/@sentry/utils/dist/global.js"),s=n("./node_modules/@sentry/utils/dist/string.js");e.uuid4=function(){var t=i.getGlobalObject(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},e.parseUrl=function(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}},e.getEventDescription=function(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||""}return t.event_id||""},e.addExceptionTypeValue=function(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"},e.addExceptionMechanism=function(t,e){var n;if(t.exception&&t.exception.values){var i=t.exception.values[0],s=i.mechanism;if(i.mechanism=r.__assign(r.__assign(r.__assign({},{type:"generic",handled:!0}),s),e),e&&"data"in e){var o=r.__assign(r.__assign({},null===(n=s)||void 0===n?void 0:n.data),e.data);i.mechanism.data=o}}};var o=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;e.parseSemver=function(t){var e=t.match(o)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:e[4]}};e.parseRetryAfterHeader=function(t,e){if(!e)return 6e4;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t},e.addContextToFrame=function(t,e,n){void 0===n&&(n=5);var r=e.lineno||0,i=t.length,o=Math.max(Math.min(i,r-1),0);e.pre_context=t.slice(Math.max(0,o-n),o).map((function(t){return s.snipLine(t,0)})),e.context_line=s.snipLine(t[Math.min(i-1,o)],e.colno||0),e.post_context=t.slice(Math.min(o+1,i),o+1+n).map((function(t){return s.snipLine(t,0)}))},e.stripUrlQueryAndFragment=function(t){return t.split(/[\?#]/,1)[0]},e.checkOrSetAlreadyCaught=function(t){var e;if(null===(e=t)||void 0===e?void 0:e.__sentry_captured__)return!0;try{Object.defineProperty(t,"__sentry_captured__",{value:!0})}catch(t){}return!1}},"./node_modules/@sentry/utils/dist/node.js":(t,e,n)=>{function r(t,e){return t.require(e)}t=n.nmd(t),Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeEnv=function(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)},e.dynamicRequire=r,e.loadModule=function(e){var n;try{n=r(t,e)}catch(t){}try{var i=r(t,"process").cwd;n=r(t,i()+"/node_modules/"+e)}catch(t){}return n}},"./node_modules/@sentry/utils/dist/object.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/node_modules/tslib/tslib.es6.js"),i=n("./node_modules/@sentry/utils/dist/browser.js"),s=n("./node_modules/@sentry/utils/dist/is.js"),o=n("./node_modules/@sentry/utils/dist/memo.js"),a=n("./node_modules/@sentry/utils/dist/stacktrace.js"),u=n("./node_modules/@sentry/utils/dist/string.js");function l(t){if(s.isError(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(s.isEvent(t)){var o=t,a={};a.type=o.type;try{a.target=s.isElement(o.target)?i.htmlTreeAsString(o.target):Object.prototype.toString.call(o.target)}catch(t){a.target=""}try{a.currentTarget=s.isElement(o.currentTarget)?i.htmlTreeAsString(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(t){a.currentTarget=""}for(var u in"undefined"!=typeof CustomEvent&&s.isInstanceOf(t,CustomEvent)&&(a.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,u)&&(a[u]=o[u]);return a}return t}function c(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function d(t,e){return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":void 0!==n.g&&t===n.g?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":s.isSyntheticEvent(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?"[Function: "+a.getFunctionName(t)+"]":"symbol"==typeof t?"["+String(t)+"]":"bigint"==typeof t?"[BigInt: "+String(t)+"]":t}function h(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new o.Memo),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=d(t);return s.isPrimitive(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var i=d(e,t);if(s.isPrimitive(i))return i;var a=l(e),u=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(u[c]=h(c,a[c],n-1,r));return r.unmemoize(e),u}function p(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return h(t,n,e)})))}catch(t){return"**non-serializable**"}}e.fill=function(t,e,n){if(e in t){var r=t[e],i=n(r);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=i}},e.urlEncode=function(t){return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},e.normalizeToSize=function t(e,n,r){void 0===n&&(n=3),void 0===r&&(r=102400);var i=p(e,n);return c(i)>r?t(e,n-1,r):i},e.walk=h,e.normalize=p,e.extractExceptionKeysForMessage=function(t,e){void 0===e&&(e=40);var n=Object.keys(l(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return u.truncate(n[0],e);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length?i:u.truncate(i,e)}return""},e.dropUndefinedKeys=function t(e){var n,i;if(s.isPlainObject(e)){var o=e,a={};try{for(var u=r.__values(Object.keys(o)),l=u.next();!l.done;l=u.next()){var c=l.value;void 0!==o[c]&&(a[c]=t(o[c]))}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return a}return Array.isArray(e)?e.map(t):e},e.objectify=function(t){var e;switch(!0){case null==t:e=new String(t);break;case"symbol"==typeof t||"bigint"==typeof t:e=Object(t);break;case s.isPrimitive(t):e=new t.constructor(t);break;default:e=t}return e}},"./node_modules/@sentry/utils/dist/path.js":(t,e)=>{function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}Object.defineProperty(e,"__esModule",{value:!0});var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;function i(t){var e=r.exec(t);return e?e.slice(1):[]}function s(){for(var t=[],e=0;e=-1&&!i;s--){var o=s>=0?t[s]:"/";o&&(r=o+"/"+r,i="/"===o.charAt(0))}return(i?"/":"")+(r=n(r.split("/").filter((function(t){return!!t})),!i).join("/"))||"."}function o(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}function a(t){var e=u(t),r="/"===t.substr(-1),i=n(t.split("/").filter((function(t){return!!t})),!e).join("/");return i||e||(i="."),i&&r&&(i+="/"),(e?"/":"")+i}function u(t){return"/"===t.charAt(0)}e.resolve=s,e.relative=function(t,e){t=s(t).substr(1),e=s(e).substr(1);for(var n=o(t.split("/")),r=o(e.split("/")),i=Math.min(n.length,r.length),a=i,u=0;u{Object.defineProperty(e,"__esModule",{value:!0}),e.setPrototypeOf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);return t})},"./node_modules/@sentry/utils/dist/promisebuffer.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/error.js"),i=n("./node_modules/@sentry/utils/dist/syncpromise.js"),s=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()0&&n(!1)}),t);i.SyncPromise.all(e._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}();e.PromiseBuffer=s},"./node_modules/@sentry/utils/dist/stacktrace.js":(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var n="";e.getFunctionName=function(t){try{return t&&"function"==typeof t&&t.name||n}catch(t){return n}}},"./node_modules/@sentry/utils/dist/string.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/is.js");e.truncate=function(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."},e.snipLine=function(t,e){var n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);var i=Math.max(e-60,0);i<5&&(i=0);var s=Math.min(i+140,r);return s>r-5&&(s=r),s===r&&(i=Math.max(s-140,0)),n=n.slice(i,s),i>0&&(n="'{snip} "+n),s{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/global.js"),i=n("./node_modules/@sentry/utils/dist/logger.js");function s(){if(!("fetch"in r.getGlobalObject()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function o(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}e.supportsErrorEvent=function(){try{return new ErrorEvent(""),!0}catch(t){return!1}},e.supportsDOMError=function(){try{return new DOMError(""),!0}catch(t){return!1}},e.supportsDOMException=function(){try{return new DOMException(""),!0}catch(t){return!1}},e.supportsFetch=s,e.isNativeFetch=o,e.supportsNativeFetch=function(){if(!s())return!1;var t=r.getGlobalObject();if(o(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var a=n.createElement("iframe");a.hidden=!0,n.head.appendChild(a),a.contentWindow&&a.contentWindow.fetch&&(e=o(a.contentWindow.fetch)),n.head.removeChild(a)}catch(t){i.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e},e.supportsReportingObserver=function(){return"ReportingObserver"in r.getGlobalObject()},e.supportsReferrerPolicy=function(){if(!s())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}},e.supportsHistory=function(){var t=r.getGlobalObject(),e=t.chrome,n=e&&e.app&&e.app.runtime,i="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&i}},"./node_modules/@sentry/utils/dist/syncpromise.js":(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/is.js"),i=function(){function t(t){var e=this;this._state="PENDING",this._handlers=[],this._resolve=function(t){e._setResult("RESOLVED",t)},this._reject=function(t){e._setResult("REJECTED",t)},this._setResult=function(t,n){"PENDING"===e._state&&(r.isThenable(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if("PENDING"!==e._state){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||("RESOLVED"===e._state&&t.onfulfilled&&t.onfulfilled(e._value),"REJECTED"===e._state&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var i=e.length,s=[];e.forEach((function(e,o){t.resolve(e).then((function(t){s[o]=t,0===(i-=1)&&n(s)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,i){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void i(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void i(t)}else i(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var i,s;return n.then((function(t){s=!1,i=t,e&&e()}),(function(t){s=!0,i=t,e&&e()})).then((function(){s?r(i):t(i)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}();e.SyncPromise=i},"./node_modules/@sentry/utils/dist/time.js":(t,e,n)=>{t=n.nmd(t),Object.defineProperty(e,"__esModule",{value:!0});var r=n("./node_modules/@sentry/utils/dist/global.js"),i=n("./node_modules/@sentry/utils/dist/node.js"),s={nowSeconds:function(){return Date.now()/1e3}};var o=i.isNodeEnv()?function(){try{return i.dynamicRequire(t,"perf_hooks").performance}catch(t){return}}():function(){var t=r.getGlobalObject().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),a=void 0===o?s:{nowSeconds:function(){return(o.timeOrigin+o.now())/1e3}};e.dateTimestampInSeconds=s.nowSeconds.bind(s),e.timestampInSeconds=a.nowSeconds.bind(a),e.timestampWithMs=e.timestampInSeconds,e.usingPerformanceAPI=void 0!==o,e.browserPerformanceTimeOrigin=function(){var t=r.getGlobalObject().performance;if(t&&t.now){var n=36e5,i=t.now(),s=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+i-s):n,a=o{"use strict";n.r(e),n.d(e,{__extends:()=>i,__assign:()=>s,__rest:()=>o,__decorate:()=>a,__param:()=>u,__metadata:()=>l,__awaiter:()=>c,__generator:()=>d,__createBinding:()=>h,__exportStar:()=>p,__values:()=>f,__read:()=>m,__spread:()=>g,__spreadArrays:()=>v,__await:()=>y,__asyncGenerator:()=>_,__asyncDelegator:()=>b,__asyncValues:()=>E,__makeTemplateObject:()=>w,__importStar:()=>S,__importDefault:()=>A,__classPrivateFieldGet:()=>T,__classPrivateFieldSet:()=>x});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s=function(){return s=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;a--)(i=t[a])&&(o=(s<3?i(o):s>3?i(e,n,o):i(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o}function u(t,e){return function(n,r){e(n,r,t)}}function l(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))}function d(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function g(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,l):c(s[0][2],n)}catch(t){c(s[0][3],t)}var n}function u(t){a("next",t)}function l(t){a("throw",t)}function c(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}function b(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function E(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=f(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function w(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function A(t){return t&&t.__esModule?t:{default:t}}function T(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},"./node_modules/classnames/index.js":(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e{"use strict";n.d(e,{Z:()=>a});var r=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(r),s=n("./node_modules/css-loader/dist/runtime/api.js"),o=n.n(s)()(i());o.push([t.id,"@import url(https://fonts.googleapis.com/css?family=Lato:400,700&subset=latin-ext);"]),o.push([t.id,'@-webkit-keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n\[email protected] fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n\[email protected] fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\[email protected] fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\n#quest a,\n#reminder-quest a {\n border: none !important;\n padding: 0 !important;\n margin: 0 !important;\n outline: none !important;\n overflow: visible !important;\n vertical-align: baseline !important;\n}\n\n#quest .clearfix__element::after,\n#reminder-quest .clearfix__element::after {\n content: " " !important;\n clear: both !important;\n display: table !important;\n}\n\n#quest .adblock,\n#reminder-quest .adblock {\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n max-width: 550px !important;\n margin: 30px auto !important;\n flex: 1 1 auto !important;\n position: relative !important;\n opacity: 0 !important;\n transition: opacity 500ms ease-in-out !important;\n}\n\n#quest .adblock--active,\n#reminder-quest .adblock--active {\n opacity: 1 !important;\n}\n\n#quest .adblock__inner,\n#reminder-quest .adblock__inner {\n background-color: #fff !important;\n border-radius: 10px !important;\n border: 1px solid #d9d9d9 !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n padding: 36px 20px 46px !important;\n text-align: center !important;\n}\n\n#quest .adblock__image,\n#reminder-quest .adblock__image {\n display: inline-block !important;\n width: 123px !important;\n height: 123px !important;\n margin: 0 0 23px !important;\n padding: 0 !important;\n opacity: 1 !important;\n transition: none !important;\n}\n\n#quest .adblock__title,\n#reminder-quest .adblock__title {\n font-size: 22px !important;\n font-weight: bold !important;\n color: #024bb5 !important;\n margin-bottom: 46px !important;\n}\n\n#quest .adblock__paragraph,\n#reminder-quest .adblock__paragraph {\n font-size: 15px !important;\n color: #000 !important;\n margin-bottom: 20px !important;\n line-height: normal !important;\n}\n\n#quest .adblock__link,\n#reminder-quest .adblock__link {\n text-decoration: underline !important;\n text-underline-position: under !important;\n color: #024bb5 !important;\n box-shadow: none !important;\n}\n\n#quest .adblock__link:after,\n#reminder-quest .adblock__link:after {\n content: " »" !important;\n}\n\n#quest .adblock__reminder,\n#reminder-quest .adblock__reminder {\n margin-top: 35px !important;\n font-size: 15px !important;\n color: #000 !important;\n}\n\n#quest .adblock__line,\n#reminder-quest .adblock__line {\n white-space: nowrap !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .adblock,\n #reminder-quest .adblock {\n margin: 20px auto !important;\n }\n\n #quest .adblock__content,\n #reminder-quest .adblock__content {\n padding: 34px 20px 25px !important;\n }\n\n #quest .adblock__image,\n #reminder-quest .adblock__image {\n width: 85px !important;\n height: 85px !important;\n margin-bottom: 34px !important;\n }\n\n #quest .adblock__title,\n #reminder-quest .adblock__title {\n margin-bottom: 40px !important;\n font-size: 18px !important;\n }\n}\n\n#quest .logo,\n#reminder-quest .logo {\n position: relative !important;\n height: 25px !important;\n margin-top: 8px !important;\n display: flex !important;\n justify-content: flex-end !important;\n}\n\n#quest .logo__link,\n#reminder-quest .logo__link {\n text-decoration: none !important;\n cursor: pointer !important;\n box-shadow: none !important;\n outline: 0 !important;\n border: none !important;\n width: 96px !important;\n height: 25px !important;\n display: block !important;\n}\n\n#quest .logo__image,\n#reminder-quest .logo__image {\n display: inline-block !important;\n position: absolute !important;\n top: 0 !important;\n right: 0 !important;\n width: 96px !important;\n height: 25px !important;\n padding: 0 !important;\n margin: 0 3px 0 0 !important;\n transition: none !important;\n box-shadow: none !important;\n opacity: 1 !important;\n}',""]);const a=o},"./node_modules/css-loader/dist/cjs.js!./node_modules/cssimportant-loader/index.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./app/main.scss":(t,e,n)=>{"use strict";n.d(e,{Z:()=>A});var r=n("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),i=n.n(r),s=n("./node_modules/css-loader/dist/runtime/api.js"),o=n.n(s),a=n("./node_modules/css-loader/dist/runtime/getUrl.js"),u=n.n(a),l=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABTAAAAUwBaYa9OQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAB8SURBVDiN5dOhEcJAEAXQgIhBxaOiaIIqGOpIC2kjdWDw6YESMoPD4XgIkkkGd5c1DH9m3e3bb64o/i/YRUEDThHQlAv2ERA80GC7FprS4xABwRMtyuX79Kqfnc042Y2uqJPOfgF3nNPLz9ALHaosZIRuOGYDCyjmi/x+3q9msxjJYDoWAAAAAElFTkSuQmCC"),n.b),c=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABTAAAAUwBaYa9OQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAA/SURBVDiNY2AYtoARXeD///8KDAwMClDuA0ZGxgf4xHGC////N/xHgAZC4jDARKIPcIJRg0YNogagXRYZPgAAt+kx+cUNsEoAAAAASUVORK5CYII="),n.b),d=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABJwAAAScBjbzwzAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAELSURBVDiNpZM5TgNBEEVfTUBkREwAoWUJC2JOQAbIEmfgClyDA7DJGVuIkAiJAYEgQRAZQ8wBmEfSYw1mPDJDRdW1/K76/Rv+aVE4ahcYRMSn2gE2gCUgA16Bs4h4mIikbqnXal/N1fd0vkp+rh6rc3UApsJtNSvlMrWnDtVbtVXkshLGADgBToGZiMhHe0bkEXEOrALzwO4faPo1aU/9UttNAbLEyQ78XGEqS6vdA+0RgHqgXjSZqJjgBVhWo644XZYBK8BzOdhJxKxPAVBNonqU3nmhpnlR/VD3qpKz6p36pm7WCOmmLKRxkJZ6mNQ4TDIuS3l/vLmStPSx1oBuCj0ClxHxNGm9xvYN69L4yKj+K2wAAAAASUVORK5CYII="),n.b),h=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABTAAAAUwBaYa9OQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADiSURBVDiN1dO7TgJBGIbh121sDA1GCkmWQywIpaUxbELnjXEr3gEUJFZyA3aGABWNxFqr12YM7mQ4uBV8zUzyzzyZI5xV1I7aO2ZstgfpATOgURlSW8A4hahXR0FqDrwAeaI2AN7VbnJZ6o1aqE/qwnKKMCZTb9VP9TmFXKsbd6dQh+o0YCP1K95iBvSBenKp27SBIdABXoFL4C6GPIAAXPxpf8+1NC8D3oCPA9ACmABz4AH4Dv1y1Jp6rz5WPuwEmqvLGAq1gbreef0JrKWuYijUkg9yH9ZU5zFUKf/5tKeXH05R75eQk8SIAAAAAElFTkSuQmCC"),n.b),p=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABTAAAAUwBaYa9OQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAD9SURBVDiN1dO9LgVRFMXxdX3kFp4AjSh4AFqJiAi5nUqpFCURUdxEzRNIVHrdjc4TeAJPQeUjPn4KZ5JxI+6gECvZmT2z9vznnD1nJ/9O6JTrOg4w9RPIGh5KvoNXPOMYo00hq7iH2rNJnHpXDyODICsVpAKhg4WSbxer2//iNJZLbOJOTaWmW7a2W+4vcIuxOujQFyo1bZzhCTNYLHYnSYYaNSxJq9V6TLKfZCTJUpKrYs1+C1QtvuKWqPLmILSTHCV5TnKZZL5Y1/WiCcyV2GjY7HPcfGj2J18f9Pu3irXXZCufHchxnJSV9TDctC/9I/LiuyNSg/1+aP9Eb4aUbTUBK/S2AAAAAElFTkSuQmCC"),n.b),f=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAABTAAAAUwBaYa9OQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC4SURBVDiN1ZOxCsIwFEWvfoNOjlInnVx10sU66OjoH/QP/Db7Ly7tqggthePyKrG0QpuCeCHkJbk5yXsh0t8J2PcBOQJ5LxAAH8gByDC13TwFtsAZeOLI8URAYPEMiKqQDVDQIPOMgQS4ATvrE2Dkgi5NkMqNFkBq0ykwL9eGLcuXW5OkzInfoFhS8Y1gKVxtGEoaSIo/UjPjBFgCp87Frjl9Bdw7PX8NbF3CvEAO7OENMpj/p/2JXnbRDl1ytWZhAAAAAElFTkSuQmCC"),n.b),m=new URL(n("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAABXUlEQVQokZXTvWrCUBwF8FMFQQoSTLt0dHEQDHKjFLq4drjglNihs6+RycHXcGhvRSJk73ah0ojESYR270dSn6ApR4xbxRwId8j55eN/kzPP85AlCIICABfAHYBrAJcAvgC8AHgAoKSUv1n/gIMgqAF4ajabwnVd2LYN0zQRxzHCMIRSCqvVagHAkVK+7xCxEKLW6XQ+lFLpsfA8e+zvbiqEKAghXn3fPwqzsMc+Hd+xb1mW3ev1cErYY5+O+N5xnJNgFs6Ejthut9u5cKvV4mIRX1Sr1VzYMAwuJvF3kiS58Ha75RITh9zHPFkul2xHxGN+AHmy74+JH6MoCmez2UmcPfbpioPBIN1sNs9a675hGOeNRuNfOJlMMBqNPtM0vZVSJsVut4t6vf6zXq99rfXNfD6/KpfLqFQqKJVK4DC11hgOh5hOp4s9fOPFjv1VgtvIqXKofEweh78KwB8zXdGx88r0IAAAAABJRU5ErkJggg=="),n.b),g=o()(i());g.push([t.id,"@import url(https://fonts.googleapis.com/css?family=Lato:400,700&subset=latin-ext);"]);var v=u()(l),y=u()(c),_=u()(d),b=u()(h),E=u()(p),w=u()(f),S=u()(m);g.push([t.id,'@-webkit-keyframes fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n\[email protected] fade-out {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n\[email protected] fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\[email protected] fade-in {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\n#quest a,\n#reminder-quest a {\n border: none !important;\n padding: 0 !important;\n margin: 0 !important;\n outline: none !important;\n overflow: visible !important;\n vertical-align: baseline !important;\n}\n\n#quest .quest,\n#reminder-quest .quest {\n width: 100% !important;\n position: relative !important;\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n box-sizing: border-box !important;\n line-height: normal !important;\n margin: 30px 0 !important;\n opacity: 0 !important;\n transition: opacity 500ms ease-in-out !important;\n}\n\n#quest .quest--active,\n#reminder-quest .quest--active {\n opacity: 1 !important;\n}\n\n#quest .quest *,\n#quest .quest :before,\n#quest .quest :after,\n#reminder-quest .quest *,\n#reminder-quest .quest :before,\n#reminder-quest .quest :after {\n box-sizing: border-box !important;\n position: static !important;\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n font-style: normal !important;\n letter-spacing: normal !important;\n font-weight: normal !important;\n -webkit-tap-highlight-color: transparent !important;\n}\n\n#quest .quest b,\n#quest .quest strong,\n#reminder-quest .quest b,\n#reminder-quest .quest strong {\n font-weight: bold !important;\n}\n\n#quest a,\n#reminder-quest a {\n text-decoration: underline !important;\n}\n\n#quest .quest__image-wrapper,\n#reminder-quest .quest__image-wrapper {\n margin: 0 auto !important;\n padding: 0 30px !important;\n position: relative !important;\n text-align: center !important;\n display: flex !important;\n flex-direction: column !important;\n max-width: 550px !important;\n}\n\n#quest .quest__image,\n#reminder-quest .quest__image {\n display: inline-block !important;\n transition: none !important;\n flex: 0 0 auto !important;\n max-width: 100% !important;\n border-radius: 0 !important;\n vertical-align: top !important;\n border: none !important;\n padding: 0 !important;\n margin: 0 !important;\n opacity: 1 !important;\n width: 100% !important;\n height: 100% !important;\n}\n\n#quest .quest__image[src],\n#reminder-quest .quest__image[src] {\n box-shadow: 0 2px 25px 2px rgba(0,0,0,.5) !important;\n}\n\n#quest .quest__image--success,\n#reminder-quest .quest__image--success {\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n opacity: 0 !important;\n width: 100% !important;\n height: 100% !important;\n transition: opacity 500ms ease-in-out !important;\n transition-delay: 1.5s !important;\n}\n\n#quest .quest__image--success-show,\n#reminder-quest .quest__image--success-show {\n opacity: 1 !important;\n}\n\n#quest .quest__children,\n#reminder-quest .quest__children {\n margin: -22px auto 0 !important;\n padding: 21px 29px 5px !important;\n border: 1px solid #d9d9d9 !important;\n border-radius: 10px !important;\n background: #fff !important;\n max-width: 550px !important;\n}\n\n#quest .quest__image-link,\n#reminder-quest .quest__image-link {\n cursor: default !important;\n box-shadow: none !important;\n border: none !important;\n outline: none !important;\n text-decoration: none !important;\n display: flex !important;\n flex-direction: column !important;\n flex: 0 0 auto !important;\n position: relative !important;\n opacity: 1 !important;\n}\n\n#quest .quest__image-link--solved,\n#reminder-quest .quest__image-link--solved {\n cursor: pointer !important;\n}\n\n#quest .quest__footer,\n#reminder-quest .quest__footer {\n display: flex !important;\n align-items: flex-start !important;\n justify-content: space-between !important;\n margin: 0 auto !important;\n max-width: 550px !important;\n}\n\n#quest .quest__privacy-policy a,\n#reminder-quest .quest__privacy-policy a {\n font-size: 11px !important;\n color: #9b9b9b !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .quest,\n #reminder-quest .quest {\n margin: 20px 0 !important;\n }\n\n #quest .quest__image-wrapper,\n #reminder-quest .quest__image-wrapper {\n padding: 0 !important;\n }\n\n #quest .quest__children,\n #reminder-quest .quest__children {\n margin: -1px auto 0 !important;\n padding: 1px 17px 5px !important;\n border-radius: 0 !important;\n }\n}\n\n#quest .pollquest .quest__image,\n#reminder-quest .pollquest .quest__image {\n box-shadow: 0 2px 25px 2px rgba(0,0,0,.2) !important;\n}\n\n#quest .is-video .quest__image,\n#reminder-quest .is-video .quest__image {\n opacity: .5 !important;\n}\n\n#quest .is-video .quest__video-image-post,\n#reminder-quest .is-video .quest__video-image-post {\n position: absolute !important;\n visibility: hidden !important;\n opacity: 0 !important;\n width: 0 !important;\n transition: opacity 200ms ease-in !important;\n}\n\n#quest .is-video .quest__image-wrapper,\n#reminder-quest .is-video .quest__image-wrapper {\n padding: 0 35px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .is-video .quest__image-wrapper,\n #reminder-quest .is-video .quest__image-wrapper {\n padding: 0 !important;\n }\n}\n\n#quest .quest__video,\n#reminder-quest .quest__video {\n display: inline-block !important;\n flex: 0 0 auto !important;\n max-width: 100% !important;\n vertical-align: top !important;\n border: none !important;\n padding: 0 !important;\n margin: 0 !important;\n width: 100% !important;\n z-index: 20 !important;\n}\n\n#quest .quest__video-overlay,\n#reminder-quest .quest__video-overlay {\n position: absolute !important;\n top: calc(50% - 35px) !important;\n left: calc(50% - 35px) !important;\n margin: 0 auto !important;\n z-index: 20 !important;\n}\n\n#quest .quest__video-overlay img,\n#reminder-quest .quest__video-overlay img {\n margin: 0 !important;\n opacity: 1 !important;\n}\n\n#quest .quest__video-play-icon,\n#reminder-quest .quest__video-play-icon {\n max-width: 69px !important;\n max-height: 69px !important;\n padding: 0 !important;\n margin: 0 !important;\n height: auto !important;\n border: 0 !important;\n opacity: 1 !important;\n}\n\n#quest .quest__video-container,\n#reminder-quest .quest__video-container {\n width: 100% !important;\n background: #000 !important;\n position: relative !important;\n cursor: pointer !important;\n}\n\n#quest .quest__video-timer,\n#reminder-quest .quest__video-timer {\n color: #fff !important;\n font-size: 18px !important;\n}\n\n#quest .quest__video-loader,\n#reminder-quest .quest__video-loader {\n display: none !important;\n position: relative !important;\n width: 64px !important;\n height: 64px !important;\n}\n\n#quest .quest__video-loader div,\n#reminder-quest .quest__video-loader div {\n box-sizing: border-box !important;\n display: block !important;\n position: absolute !important;\n width: 51px !important;\n height: 51px !important;\n margin: 6px !important;\n border: 6px solid #fff !important;\n border-radius: 50% !important;\n -webkit-animation: quest__video-loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite !important;\n animation: quest__video-loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite !important;\n border-color: #fff transparent transparent transparent !important;\n}\n\n#quest .quest__video-loader div:nth-child(1),\n#reminder-quest .quest__video-loader div:nth-child(1) {\n -webkit-animation-delay: -0.45s !important;\n animation-delay: -0.45s !important;\n}\n\n#quest .quest__video-loader div:nth-child(2),\n#reminder-quest .quest__video-loader div:nth-child(2) {\n -webkit-animation-delay: -0.3s !important;\n animation-delay: -0.3s !important;\n}\n\n#quest .quest__video-loader div:nth-child(3),\n#reminder-quest .quest__video-loader div:nth-child(3) {\n -webkit-animation-delay: -0.15s !important;\n animation-delay: -0.15s !important;\n}\n\[email protected] quest__video-loader {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\[email protected] quest__video-loader {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n#quest .quest__video-controls,\n#reminder-quest .quest__video-controls {\n height: 20px !important;\n width: 100% !important;\n background: #000 !important;\n}\n\n#quest .quest__video-wrapper,\n#reminder-quest .quest__video-wrapper {\n width: 100% !important;\n overflow: hidden !important;\n line-height: 0 !important;\n}\n\n#quest .quest__video video,\n#reminder-quest .quest__video video {\n width: 100% !important;\n -o-object-fit: fill !important;\n object-fit: fill !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n -webkit-backface-visibility: hidden !important;\n -moz-backface-visibility: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n border: 0 !important;\n font-size: 100% !important;\n vertical-align: baseline !important;\n border-image-width: 0 !important;\n}\n\n#quest .quest__video-answer-pixel,\n#reminder-quest .quest__video-answer-pixel {\n position: absolute !important;\n width: 2px !important;\n height: 100% !important;\n background-color: #fcbe00 !important;\n}\n\n#quest .quest__video-controls-icon,\n#reminder-quest .quest__video-controls-icon {\n height: 18px !important;\n width: 18px !important;\n float: left !important;\n display: block !important;\n margin: 1px 5px 0 7px !important;\n}\n\n#quest .quest__video-controls-play-icon,\n#reminder-quest .quest__video-controls-play-icon {\n background: url('+v+") !important;\n}\n\n#quest .quest__video-controls-pause-icon,\n#reminder-quest .quest__video-controls-pause-icon {\n background: url("+y+") !important;\n}\n\n#quest .quest__video-controls-replay-icon,\n#reminder-quest .quest__video-controls-replay-icon {\n width: 16px !important;\n height: 16px !important;\n margin: 2px 6px 0 8px !important;\n background: url("+_+") !important;\n}\n\n#quest .quest__video-controls-sound-icon,\n#reminder-quest .quest__video-controls-sound-icon {\n background: url("+b+") !important;\n margin-right: 15px !important;\n}\n\n#quest .quest__video-controls-sound-icon-max,\n#reminder-quest .quest__video-controls-sound-icon-max {\n background: url("+E+") !important;\n}\n\n#quest .quest__video-controls-sound-icon-muted,\n#reminder-quest .quest__video-controls-sound-icon-muted {\n background: url("+w+") !important;\n}\n\n#quest .quest__video-volume,\n#reminder-quest .quest__video-volume {\n position: absolute !important;\n transform: rotate(270deg) !important;\n width: 80px !important;\n left: 4px !important;\n bottom: 65px !important;\n cursor: pointer !important;\n display: none !important;\n padding: 0 !important;\n margin: 0 !important;\n -webkit-appearance: none !important;\n -moz-appearance: none !important;\n appearance: none !important;\n height: 7px !important;\n border-radius: 5px !important;\n background: #d3d3d3 !important;\n outline: none !important;\n opacity: 1 !important;\n}\n\n#quest .quest__video-volume--visible,\n#reminder-quest .quest__video-volume--visible {\n display: block !important;\n}\n\n#quest .quest__video-volume:hover,\n#reminder-quest .quest__video-volume:hover {\n opacity: 1 !important;\n}\n\n#quest .quest__video-volume::-webkit-slider-thumb,\n#reminder-quest .quest__video-volume::-webkit-slider-thumb {\n -webkit-appearance: none !important;\n appearance: none !important;\n width: 15px !important;\n height: 15px !important;\n border-radius: 20px !important;\n background: url("+S+") !important;\n cursor: pointer !important;\n border: 0 !important;\n}\n\n#quest .quest__video-volume::-moz-range-thumb,\n#reminder-quest .quest__video-volume::-moz-range-thumb {\n width: 15px !important;\n height: 15px !important;\n border-radius: 20px !important;\n background: url("+S+') !important;\n cursor: pointer !important;\n border: 0 !important;\n}\n\n#quest .quest__video-progressbar,\n#reminder-quest .quest__video-progressbar {\n float: left !important;\n width: calc(100% - 90px) !important;\n height: 100% !important;\n cursor: pointer !important;\n z-index: 30 !important;\n}\n\n#quest .quest__video-progressbar-progress,\n#reminder-quest .quest__video-progressbar-progress {\n position: relative !important;\n margin-top: 9px !important;\n background: #333 !important;\n cursor: pointer !important;\n height: 2px !important;\n width: 100% !important;\n}\n\n#quest .quest__video-progressbar-progress span,\n#reminder-quest .quest__video-progressbar-progress span {\n display: block !important;\n background: #707070 !important;\n height: 100% !important;\n}\n\n#quest .quest__video-audio-information,\n#reminder-quest .quest__video-audio-information {\n display: none !important;\n align-items: center !important;\n position: absolute !important;\n padding: 3px 12px !important;\n left: 8px !important;\n top: 8px !important;\n opacity: 1 !important;\n background-color: rgba(0,0,0,.5) !important;\n border-radius: 40px !important;\n border: 1px solid #fff !important;\n -webkit-animation: pulse 1.5s infinite !important;\n animation: pulse 1.5s infinite !important;\n cursor: pointer !important;\n}\n\n#quest .quest__video-audio-information .quest__video-controls-icon,\n#reminder-quest .quest__video-audio-information .quest__video-controls-icon {\n margin-left: 0 !important;\n margin-right: 8px !important;\n}\n\n#quest .quest__video-audio-information--show,\n#reminder-quest .quest__video-audio-information--show {\n display: flex !important;\n}\n\n#quest .quest__video-audio-text,\n#reminder-quest .quest__video-audio-text {\n color: #fff !important;\n font-size: 14px !important;\n}\n\[email protected] pulse {\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\[email protected] pulse {\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n#quest [data-state*=not-started] .quest__video-controls,\n#reminder-quest [data-state*=not-started] .quest__video-controls {\n display: none !important;\n}\n\n#quest [data-state*=not-started] video,\n#reminder-quest [data-state*=not-started] video {\n display: block !important;\n}\n\n#quest [data-state*=not-started] .main-quest-solved-state__success-message,\n#quest [data-state*=not-started] .main-quest-unsolved-state__question,\n#reminder-quest [data-state*=not-started] .main-quest-solved-state__success-message,\n#reminder-quest [data-state*=not-started] .main-quest-unsolved-state__question {\n margin-top: 30px !important;\n}\n\n#quest .is-video:not([data-state*=not-started]) .quest__children,\n#reminder-quest .is-video:not([data-state*=not-started]) .quest__children {\n margin-top: -42px !important;\n padding-top: 40px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .is-video:not([data-state*=not-started]) .quest__children,\n #reminder-quest .is-video:not([data-state*=not-started]) .quest__children {\n margin: 0 auto 0 !important;\n padding: 0 17px 5px !important;\n }\n}\n\n#quest [data-state*=playing] .quest__video-timer,\n#quest [data-state*=playing] .quest__video-play-icon,\n#reminder-quest [data-state*=playing] .quest__video-timer,\n#reminder-quest [data-state*=playing] .quest__video-play-icon {\n display: none !important;\n}\n\n#quest [data-state*=playing] .quest__video-controls,\n#reminder-quest [data-state*=playing] .quest__video-controls {\n display: block !important;\n}\n\n#quest [data-state*=paused] .quest__video-timer,\n#reminder-quest [data-state*=paused] .quest__video-timer {\n display: none !important;\n}\n\n#quest [data-state*=paused] .quest__video-play-icon,\n#quest [data-state*=paused] .quest__video-controls,\n#reminder-quest [data-state*=paused] .quest__video-play-icon,\n#reminder-quest [data-state*=paused] .quest__video-controls {\n display: block !important;\n}\n\n#quest [data-state*=loading] .quest__video-loader,\n#reminder-quest [data-state*=loading] .quest__video-loader {\n display: inline-block !important;\n}\n\n#quest [data-state*=loading] .quest__video-play-icon,\n#reminder-quest [data-state*=loading] .quest__video-play-icon {\n display: none !important;\n}\n\n#quest [data-state*=ended] .quest__video-image-post,\n#reminder-quest [data-state*=ended] .quest__video-image-post {\n position: static !important;\n opacity: 1 !important;\n visibility: visible !important;\n width: 100% !important;\n}\n\n#quest [data-state*=ended] .quest__video video,\n#reminder-quest [data-state*=ended] .quest__video video {\n display: none !important;\n height: 0 !important;\n}\n\n#quest [data-state*=ended] .quest__video--empty-post-image video,\n#reminder-quest [data-state*=ended] .quest__video--empty-post-image video {\n display: block !important;\n height: auto !important;\n}\n\n#quest .is-video .adquesto__tooltip,\n#reminder-quest .is-video .adquesto__tooltip {\n z-index: 4 !important;\n visibility: hidden !important;\n max-width: 160px !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n background-color: #6d6d6d !important;\n color: #fff !important;\n text-align: center !important;\n padding: 6px 10px !important;\n border-radius: 6px !important;\n position: absolute !important;\n font-size: 12px !important;\n min-height: 26px !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n white-space: normal !important;\n line-height: 1.5 !important;\n top: auto !important;\n bottom: calc(100% + 10px) !important;\n left: 0 !important;\n right: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n transform: translateX(0) !important;\n}\n\n#quest .is-video .adquesto__tooltip:after,\n#reminder-quest .is-video .adquesto__tooltip:after {\n content: "" !important;\n position: absolute !important;\n right: calc(50% - 8px) !important;\n border-style: solid !important;\n border-width: 8px 8px 0 8px !important;\n bottom: auto !important;\n top: 100% !important;\n border-color: #6d6d6d transparent transparent transparent !important;\n}\n\n#quest .is-video .adquesto__tooltip,\n#reminder-quest .is-video .adquesto__tooltip {\n position: absolute !important;\n top: auto !important;\n bottom: calc(100% + 10px) !important;\n left: 0 !important;\n right: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n transform: translateX(0) !important;\n}\n\n#quest .is-video .adquesto__tooltip:after,\n#reminder-quest .is-video .adquesto__tooltip:after {\n content: "" !important;\n position: absolute !important;\n width: 0 !important;\n height: 0 !important;\n right: calc(50% - 8px) !important;\n border-style: solid !important;\n border-width: 8px 8px 0 8px !important;\n bottom: auto !important;\n top: 100% !important;\n border-color: #6d6d6d transparent transparent transparent !important;\n}\n\n#quest .is-video[data-state*=disabled-answers] .answer-buttons__wrapper--hover .adquesto__tooltip,\n#reminder-quest .is-video[data-state*=disabled-answers] .answer-buttons__wrapper--hover .adquesto__tooltip {\n visibility: visible !important;\n}\n\n#quest .is-video[data-state*=disabled-answers] button.answer-buttons__item,\n#reminder-quest .is-video[data-state*=disabled-answers] button.answer-buttons__item {\n position: relative !important;\n}\n\n#quest .is-video[data-state*=disabled-answers] button.answer-buttons__item .answer-buttons__answer,\n#reminder-quest .is-video[data-state*=disabled-answers] button.answer-buttons__item .answer-buttons__answer {\n opacity: .5 !important;\n}\n\n#quest .is-video[data-state*=disabled-answers] button.answer-buttons__item--hover,\n#reminder-quest .is-video[data-state*=disabled-answers] button.answer-buttons__item--hover {\n background: #fff !important;\n border: solid 1px #d9d9d9 !important;\n color: #333 !important;\n}\n\n#quest .is-video.watchquest .answer-buttons__grid,\n#reminder-quest .is-video.watchquest .answer-buttons__grid {\n margin: 4px !important;\n}\n\n#quest .is-video.watchquest .answer-buttons__wrapper,\n#reminder-quest .is-video.watchquest .answer-buttons__wrapper {\n width: 100% !important;\n}\n\n#quest .is-video.watchquest button.answer-buttons__item,\n#reminder-quest .is-video.watchquest button.answer-buttons__item {\n line-height: 100% !important;\n height: 32px !important;\n margin-bottom: 0 !important;\n}\n\n#quest .is-video.watchquest .answer-buttons__wrapper--hover .adquesto__tooltip,\n#reminder-quest .is-video.watchquest .answer-buttons__wrapper--hover .adquesto__tooltip {\n visibility: visible !important;\n}\n\n#quest .is-video.watchquest[data-state*=enabled-answers] .answer-buttons__item,\n#reminder-quest .is-video.watchquest[data-state*=enabled-answers] .answer-buttons__item {\n color: #024bb5 !important;\n border-color: #024bb5 !important;\n}\n\n#quest .is-video.watchquest[data-state*=enabled-answers] .answer-buttons__item--hover,\n#reminder-quest .is-video.watchquest[data-state*=enabled-answers] .answer-buttons__item--hover {\n color: #fff !important;\n}\n\n#quest .is-video.watchquest[data-state*=not-started] .quest__children,\n#reminder-quest .is-video.watchquest[data-state*=not-started] .quest__children {\n padding-top: 40px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .is-video.watchquest[data-state*=not-started] .quest__children,\n #reminder-quest .is-video.watchquest[data-state*=not-started] .quest__children {\n padding-top: 21px !important;\n }\n}\n\n#quest .is-video.watchquest .main-quest,\n#reminder-quest .is-video.watchquest .main-quest {\n display: block !important;\n}\n\n#quest .is-video.watchquest .main-quest .answer-buttons__loader,\n#reminder-quest .is-video.watchquest .main-quest .answer-buttons__loader {\n display: none !important;\n}\n\n#quest .is-video.watchquest .main-quest__loading .answer-buttons__loader,\n#reminder-quest .is-video.watchquest .main-quest__loading .answer-buttons__loader {\n display: block !important;\n position: absolute !important;\n margin: 6px 10px !important;\n z-index: 1 !important;\n border: 2px solid #333 !important;\n opacity: .4 !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state {\n margin: 0 !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state__content,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state__content {\n height: 60px !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state__content--long,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state__content--long {\n height: 60px !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state__content--is-answered .answer-buttons__item,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state__content--is-answered .answer-buttons__item {\n opacity: .8 !important;\n background: #fff !important;\n border: solid 1px #d9d9d9 !important;\n color: #333 !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state__content--is-answered .answer-buttons__item span,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state__content--is-answered .answer-buttons__item span {\n opacity: .5 !important;\n}\n\n#quest .is-video.watchquest .main-quest-unsolved-state .answer-buttons,\n#reminder-quest .is-video.watchquest .main-quest-unsolved-state .answer-buttons {\n opacity: 1 !important;\n}\n\n#quest .is-video.watchquest .main-quest-solved-state,\n#reminder-quest .is-video.watchquest .main-quest-solved-state {\n overflow: hidden !important;\n height: 0 !important;\n}\n\n#quest .is-video.watchquest .main-quest-solved-state .main-quest-solved-state__learn-more,\n#reminder-quest .is-video.watchquest .main-quest-solved-state .main-quest-solved-state__learn-more {\n transform: translateY(-200%) !important;\n transition: all 500ms ease-in-out !important;\n transition-delay: 0s !important;\n}\n\n#quest .is-video.watchquest .main-quest-solved-state--init,\n#reminder-quest .is-video.watchquest .main-quest-solved-state--init {\n margin-top: 0 !important;\n}\n\n#quest .is-video.watchquest .main-quest-solved-state--active,\n#reminder-quest .is-video.watchquest .main-quest-solved-state--active {\n height: 60px !important;\n transition: height 500ms ease-in-out !important;\n}\n\n#quest .is-video.watchquest .main-quest-solved-state--active .main-quest-solved-state__learn-more,\n#reminder-quest .is-video.watchquest .main-quest-solved-state--active .main-quest-solved-state__learn-more {\n transform: translateY(0%) !important;\n}\n\n#quest .reminder-quest,\n#reminder-quest .reminder-quest {\n flex: 1 0 auto !important;\n display: flex !important;\n padding: 35px 0 25px !important;\n text-align: center !important;\n justify-content: center !important;\n align-items: center !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .reminder-quest,\n #reminder-quest .reminder-quest {\n padding: 28px 0 20px !important;\n }\n}\n\n#quest .success-message,\n#reminder-quest .success-message {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n height: 52px !important;\n margin: 10px 0 !important;\n}\n\n#quest .success-message__content,\n#reminder-quest .success-message__content {\n text-align: center !important;\n color: #333 !important;\n word-spacing: .1px !important;\n font-size: 15px !important;\n}\n\n#quest .success-message__yes,\n#quest .success-message__yes span,\n#reminder-quest .success-message__yes,\n#reminder-quest .success-message__yes span {\n color: #129b28 !important;\n font-weight: bold !important;\n}\n\n#quest .main-quest-solved-state-landing__learn-more,\n#reminder-quest .main-quest-solved-state-landing__learn-more {\n height: 40px !important;\n margin-bottom: 20px !important;\n text-align: center !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n opacity: 0 !important;\n transition: opacity 500ms ease-in-out !important;\n transition-delay: 1.5s !important;\n}\n\n#quest .main-quest-solved-state-landing__learn-more--no-delay,\n#reminder-quest .main-quest-solved-state-landing__learn-more--no-delay {\n transition-delay: 0ms !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .main-quest-solved-state-landing__learn-more,\n #reminder-quest .main-quest-solved-state-landing__learn-more {\n margin-bottom: 10px !important;\n }\n}\n\n#quest .main-quest-solved-lead-state,\n#reminder-quest .main-quest-solved-lead-state {\n display: flex !important;\n justify-content: center !important;\n flex-direction: column !important;\n margin-bottom: 36px !important;\n}\n\n#quest .main-quest-solved-lead-state .success-message,\n#reminder-quest .main-quest-solved-lead-state .success-message {\n margin-bottom: 0 !important;\n}\n\n#quest .main-quest-solved-lead-state__content,\n#reminder-quest .main-quest-solved-lead-state__content {\n display: flex !important;\n align-items: center !important;\n flex-direction: column !important;\n opacity: 0 !important;\n max-height: 0 !important;\n transition: opacity 500ms ease-in-out,max-height 500ms ease-in-out !important;\n transition-delay: 1.75s,1.5s !important;\n}\n\n#quest .main-quest-solved-lead-state__text,\n#reminder-quest .main-quest-solved-lead-state__text {\n margin: 0 !important;\n color: #333 !important;\n word-spacing: .1px !important;\n font-size: 15px !important;\n margin-bottom: 4px !important;\n text-align: center !important;\n}\n\n#quest .main-quest-solved-lead-state__text--margin-top,\n#reminder-quest .main-quest-solved-lead-state__text--margin-top {\n margin-top: 26px !important;\n margin-bottom: 0 !important;\n}\n\n#quest .main-quest-solved-lead-state__loader,\n#reminder-quest .main-quest-solved-lead-state__loader {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n}\n\n#quest .main-quest-solved-lead-state__form,\n#reminder-quest .main-quest-solved-lead-state__form {\n position: relative !important;\n display: flex !important;\n flex-direction: column !important;\n margin-top: 16px !important;\n width: 100% !important;\n max-width: 260px !important;\n}\n\n#quest .main-quest-solved-lead-state__input,\n#reminder-quest .main-quest-solved-lead-state__input {\n display: flex !important;\n flex-direction: column !important;\n margin-top: 16px !important;\n padding: 4px 12px !important;\n font-size: 15px !important;\n line-height: 22px !important;\n border-radius: 3px !important;\n height: 32px !important;\n border: 1px solid #b3b3b3 !important;\n width: 100% !important;\n background: #fdfdfd !important;\n color: #444 !important;\n box-shadow: none !important;\n}\n\n#quest .main-quest-solved-lead-state__input::-moz-placeholder,\n#reminder-quest .main-quest-solved-lead-state__input::-moz-placeholder {\n color: #9b9b9b !important;\n}\n\n#quest .main-quest-solved-lead-state__input:-ms-input-placeholder,\n#reminder-quest .main-quest-solved-lead-state__input:-ms-input-placeholder {\n color: #9b9b9b !important;\n}\n\n#quest .main-quest-solved-lead-state__input::placeholder,\n#reminder-quest .main-quest-solved-lead-state__input::placeholder {\n color: #9b9b9b !important;\n}\n\n#quest .main-quest-solved-lead-state__input:first-child,\n#reminder-quest .main-quest-solved-lead-state__input:first-child {\n margin-top: 0 !important;\n}\n\n#quest .main-quest-solved-lead-state__input:focus,\n#reminder-quest .main-quest-solved-lead-state__input:focus {\n outline: none !important;\n border-color: #024bb5 !important;\n}\n\n#quest .main-quest-solved-lead-state__input--error,\n#reminder-quest .main-quest-solved-lead-state__input--error {\n border-color: #ca0000 !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox,\n#reminder-quest .main-quest-solved-lead-state__checkbox {\n position: relative !important;\n display: flex !important;\n margin-top: 28px !important;\n width: 100% !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label {\n position: relative !important;\n cursor: pointer !important;\n font-size: 12px !important;\n line-height: 16px !important;\n color: #9b9b9b !important;\n text-decoration: none !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label a,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label a {\n position: relative !important;\n cursor: pointer !important;\n font-size: 12px !important;\n line-height: 16px !important;\n color: #9b9b9b !important;\n text-decoration: underline !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label:before,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__label:before {\n content: "" !important;\n background-color: transparent !important;\n border: 1px solid #9b9b9b !important;\n padding: 6px !important;\n display: inline-block !important;\n position: relative !important;\n vertical-align: middle !important;\n cursor: pointer !important;\n margin-right: 5px !important;\n border-radius: 2px !important;\n margin-bottom: 2px !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check {\n display: none !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check+.main-quest-solved-lead-state__label,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check+.main-quest-solved-lead-state__label {\n margin: 0 !important;\n position: relative !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check:checked+.main-quest-solved-lead-state__label:before,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check:checked+.main-quest-solved-lead-state__label:before {\n border-color: #024bb5 !important;\n background-color: #024bb5 !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check:checked+.main-quest-solved-lead-state__label:after,\n#reminder-quest .main-quest-solved-lead-state__checkbox .main-quest-solved-lead-state__input-check:checked+.main-quest-solved-lead-state__label:after {\n content: "" !important;\n display: block !important;\n position: absolute !important;\n top: 3px !important;\n left: 5px !important;\n width: 4px !important;\n height: 9px !important;\n border: solid #fff !important;\n border-width: 0 2px 2px 0 !important;\n transform: rotate(45deg) !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox a,\n#reminder-quest .main-quest-solved-lead-state__checkbox a {\n color: #9b9b9b !important;\n}\n\n#quest .main-quest-solved-lead-state__checkbox--error .main-quest-solved-lead-state__label:before,\n#reminder-quest .main-quest-solved-lead-state__checkbox--error .main-quest-solved-lead-state__label:before {\n border-color: #ca0000 !important;\n}\n\n#quest .main-quest-solved-lead-state__button,\n#reminder-quest .main-quest-solved-lead-state__button {\n margin-top: 18px !important;\n}\n\n#quest .main-quest-solved-lead-state__error,\n#reminder-quest .main-quest-solved-lead-state__error {\n position: absolute !important;\n color: #ca0000 !important;\n text-align: center !important;\n cursor: default !important;\n pointer-events: none !important;\n}\n\n#quest .main-quest-solved-lead-state__error--main,\n#reminder-quest .main-quest-solved-lead-state__error--main {\n font-size: 13px !important;\n bottom: 10px !important;\n left: 116px !important;\n}\n\n#quest .main-quest-solved-lead-state__error--checkbox,\n#reminder-quest .main-quest-solved-lead-state__error--checkbox {\n font-size: 12px !important;\n top: -20px !important;\n}\n\n#quest .main-quest-solved-lead-state__error--inputs,\n#reminder-quest .main-quest-solved-lead-state__error--inputs {\n font-size: 12px !important;\n top: -5px !important;\n opacity: 0 !important;\n}\n\n#quest .main-quest-solved-lead-state__error--show,\n#reminder-quest .main-quest-solved-lead-state__error--show {\n opacity: 1 !important;\n}\n\n#quest .main-quest-solved-lead-landing__learn-more,\n#reminder-quest .main-quest-solved-lead-landing__learn-more {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n margin-top: 10px !important;\n margin-bottom: -10px !important;\n}\n\n#quest .main-quest-solved-state,\n#reminder-quest .main-quest-solved-state {\n display: flex !important;\n flex-direction: column !important;\n flex: 1 !important;\n z-index: 10 !important;\n}\n\n#quest .main-quest-solved-state--active .main-quest-solved-state__type,\n#quest .main-quest-solved-state--active .main-quest-solved-state-landing__learn-more,\n#quest .main-quest-solved-state--active .main-quest-solved-lead-state__content,\n#reminder-quest .main-quest-solved-state--active .main-quest-solved-state__type,\n#reminder-quest .main-quest-solved-state--active .main-quest-solved-state-landing__learn-more,\n#reminder-quest .main-quest-solved-state--active .main-quest-solved-lead-state__content {\n opacity: 1 !important;\n}\n\n#quest .main-quest-solved-state__tracking,\n#reminder-quest .main-quest-solved-state__tracking {\n position: absolute !important;\n bottom: 0 !important;\n left: 0 !important;\n}\n\n#quest .answer-buttons,\n#reminder-quest .answer-buttons {\n opacity: 0 !important;\n transition: opacity 400ms ease-in-out !important;\n}\n\n#quest .answer-buttons__wrapper,\n#reminder-quest .answer-buttons__wrapper {\n position: relative !important;\n}\n\n#quest .answer-buttons__wrapper--fill,\n#reminder-quest .answer-buttons__wrapper--fill {\n width: 100% !important;\n}\n\n#quest .answer-buttons--delay,\n#reminder-quest .answer-buttons--delay {\n transition-delay: 400ms !important;\n}\n\n#quest .answer-buttons--active,\n#reminder-quest .answer-buttons--active {\n opacity: 1 !important;\n}\n\n#quest .answer-buttons__grid,\n#reminder-quest .answer-buttons__grid {\n display: flex !important;\n justify-content: space-between !important;\n flex-wrap: wrap !important;\n}\n\n#quest .answer-buttons__grid--column,\n#reminder-quest .answer-buttons__grid--column {\n flex-direction: column !important;\n}\n\n#quest button.answer-buttons__item,\n#reminder-quest button.answer-buttons__item {\n background: #fff !important;\n border: solid 1px #d9d9d9 !important;\n border-radius: 3px !important;\n width: 100% !important;\n height: 40px !important;\n line-height: 38px !important;\n text-align: center !important;\n font-size: 13px !important;\n cursor: pointer !important;\n box-shadow: 0 5px 10px 0 rgba(0,0,0,.1) !important;\n outline: none !important;\n transition: transform 200ms !important;\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n padding: 0 10px !important;\n color: #333 !important;\n text-transform: none !important;\n letter-spacing: normal !important;\n font-weight: normal !important;\n margin: 0 0 20px !important;\n will-change: auto !important;\n}\n\n#quest button.answer-buttons__item--hover,\n#reminder-quest button.answer-buttons__item--hover {\n color: #fff !important;\n background: #024bb5 !important;\n border-color: #1e468a !important;\n}\n\n#quest button.answer-buttons__item span,\n#reminder-quest button.answer-buttons__item span {\n white-space: nowrap !important;\n display: inline-block !important;\n text-align: center !important;\n}\n\n#quest button.answer-buttons__item--active,\n#reminder-quest button.answer-buttons__item--active {\n transform: scale(0.85) !important;\n}\n\n#quest button.answer-buttons__item--fill,\n#reminder-quest button.answer-buttons__item--fill {\n width: 100% !important;\n padding: 0 10px !important;\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest button.answer-buttons__item,\n #reminder-quest button.answer-buttons__item {\n margin-bottom: 10px !important;\n }\n}\n\n#quest .counter,\n#reminder-quest .counter {\n height: 40px !important;\n font-size: 13px !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n margin-bottom: 20px !important;\n opacity: 0 !important;\n transition: opacity 400ms ease-in-out !important;\n}\n\n#quest .counter--active,\n#reminder-quest .counter--active {\n opacity: 1 !important;\n}\n\n#quest .counter__inner,\n#reminder-quest .counter__inner {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n font-size: 14px !important;\n font-weight: bold !important;\n white-space: nowrap !important;\n}\n\n#quest .counter__try-again,\n#reminder-quest .counter__try-again {\n display: flex !important;\n align-items: center !important;\n}\n\n#quest .counter__wrong-answer,\n#reminder-quest .counter__wrong-answer {\n color: #ca0000 !important;\n}\n\n#quest .counter__try-again-in,\n#reminder-quest .counter__try-again-in {\n color: #333 !important;\n margin-right: 5px !important;\n}\n\n#quest .counter__circle-wrapper,\n#reminder-quest .counter__circle-wrapper {\n width: 28px !important;\n height: 28px !important;\n position: relative !important;\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n}\n\n#quest .counter__circle,\n#reminder-quest .counter__circle {\n width: 100% !important;\n height: 100% !important;\n position: absolute !important;\n top: 0 !important;\n left: 0 !important;\n}\n\n#quest .counter__value,\n#reminder-quest .counter__value {\n line-height: 28px !important;\n font-size: 18px !important;\n font-weight: bold !important;\n}\n\n#quest .counter__circle-bg,\n#quest .counter__circle-value,\n#reminder-quest .counter__circle-bg,\n#reminder-quest .counter__circle-value {\n fill: none !important;\n stroke-linecap: round !important;\n}\n\n#quest .counter__circle-bg,\n#reminder-quest .counter__circle-bg {\n stroke: #d9f0e8 !important;\n}\n\n#quest .counter__circle-value,\n#reminder-quest .counter__circle-value {\n stroke: #129b28 !important;\n transform: rotate(-90deg) scaleY(-1) !important;\n transform-origin: 19px 19px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .counter,\n #reminder-quest .counter {\n margin-bottom: 10px !important;\n height: 45px !important;\n }\n\n #quest .counter__inner,\n #reminder-quest .counter__inner {\n flex-direction: column !important;\n }\n}\n\n#quest .main-quest-unsolved-state,\n#reminder-quest .main-quest-unsolved-state {\n display: flex !important;\n flex-direction: column !important;\n justify-content: space-between !important;\n width: 100% !important;\n box-sizing: border-box !important;\n z-index: 10 !important;\n}\n\n#quest .main-quest-unsolved-state__content--measured,\n#reminder-quest .main-quest-unsolved-state__content--measured {\n transition: height 400ms ease-in-out !important;\n}\n\n#quest .main-quest-unsolved-state__question,\n#reminder-quest .main-quest-unsolved-state__question {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n overflow: hidden !important;\n text-align: center !important;\n height: 52px !important;\n margin: 10px 0 !important;\n font-size: 16px !important;\n font-weight: bold !important;\n opacity: 0 !important;\n transition: opacity 400ms ease-in-out !important;\n transition-delay: 400ms !important;\n color: #333 !important;\n}\n\n#quest .main-quest-unsolved-state__question--active,\n#reminder-quest .main-quest-unsolved-state__question--active {\n opacity: 1 !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .main-quest-unsolved-state__content--counter,\n #reminder-quest .main-quest-unsolved-state__content--counter {\n height: 55px !important;\n }\n}\n\n#quest .top-bar__container,\n#reminder-quest .top-bar__container {\n position: relative !important;\n}\n\n#quest .top-bar,\n#reminder-quest .top-bar {\n position: absolute !important;\n z-index: 1000 !important;\n transition: background 500ms ease-out !important;\n pointer-events: none !important;\n transform: translateY(-100%) !important;\n padding-top: 1px !important;\n padding-bottom: 15px !important;\n left: -1px !important;\n right: -1px !important;\n}\n\n#quest .top-bar--entered,\n#reminder-quest .top-bar--entered {\n pointer-events: auto !important;\n}\n\n#quest .top-bar__content,\n#reminder-quest .top-bar__content {\n opacity: 0 !important;\n max-width: 550px !important;\n z-index: 2 !important;\n margin: 58px auto 0 !important;\n transition: opacity 500ms ease-out !important;\n}\n\n#quest .top-bar__content--entered,\n#reminder-quest .top-bar__content--entered {\n opacity: 1 !important;\n}\n\n#quest .top-bar__inner,\n#reminder-quest .top-bar__inner {\n margin: 0 1px !important;\n background-color: #fff !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n border: 1px solid #d9d9d9 !important;\n border-radius: 10px !important;\n padding: 15px 0 !important;\n text-align: center !important;\n color: #000 !important;\n}\n\n#quest .top-bar__title,\n#reminder-quest .top-bar__title {\n font-size: 14px !important;\n color: #000 !important;\n}\n\n#quest .top-bar__title:after,\n#reminder-quest .top-bar__title:after {\n content: " " !important;\n display: block !important;\n margin-top: 5px !important;\n}\n\n#quest .top-bar__subtitle,\n#reminder-quest .top-bar__subtitle {\n font-size: 14px !important;\n padding: 0 5px !important;\n}\n\n#quest .top-bar__link,\n#reminder-quest .top-bar__link {\n text-decoration: underline !important;\n text-underline-position: under !important;\n color: #024bb5 !important;\n cursor: pointer !important;\n}\n\n#quest .top-bar__link:after,\n#reminder-quest .top-bar__link:after {\n content: " »" !important;\n}\n\n#quest .top-bar__subtitle-with-subscription-mobile,\n#reminder-quest .top-bar__subtitle-with-subscription-mobile {\n display: none !important;\n}\n\n#quest .top-bar__subtitle--without-subscription-mobile,\n#reminder-quest .top-bar__subtitle--without-subscription-mobile {\n display: none !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .top-bar__title,\n #reminder-quest .top-bar__title {\n font-size: 13px !important;\n }\n\n #quest .top-bar__subtitle,\n #reminder-quest .top-bar__subtitle {\n font-size: 12px !important;\n }\n\n #quest .top-bar__subtitle-with-subscription-desktop,\n #reminder-quest .top-bar__subtitle-with-subscription-desktop {\n display: none !important;\n }\n\n #quest .top-bar__subtitle-with-subscription-mobile,\n #reminder-quest .top-bar__subtitle-with-subscription-mobile {\n display: inline !important;\n }\n\n #quest .top-bar__subtitle--without-subscription-desktop,\n #reminder-quest .top-bar__subtitle--without-subscription-desktop {\n display: none !important;\n }\n\n #quest .top-bar__subtitle--without-subscription-mobile,\n #reminder-quest .top-bar__subtitle--without-subscription-mobile {\n display: inline !important;\n }\n}\n\n#quest .bottom-bar,\n#reminder-quest .bottom-bar {\n position: absolute !important;\n z-index: 1000 !important;\n transition: box-shadow 500ms ease-out !important;\n bottom: -157px !important;\n left: -1px !important;\n right: -1px !important;\n pointer-events: none !important;\n}\n\n#quest .bottom-bar--entered,\n#reminder-quest .bottom-bar--entered {\n pointer-events: auto !important;\n}\n\n#quest .bottom-bar__content,\n#reminder-quest .bottom-bar__content {\n opacity: 0 !important;\n cursor: pointer !important;\n max-width: 550px !important;\n z-index: 2 !important;\n margin: 56px auto 0 !important;\n transition: opacity 500ms ease-out,transform 400ms ease-out !important;\n}\n\n#quest .bottom-bar__content--entered,\n#reminder-quest .bottom-bar__content--entered {\n opacity: 1 !important;\n}\n\n#quest .bottom-bar__inner,\n#reminder-quest .bottom-bar__inner {\n margin: 0 1px !important;\n background-color: #fff !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n border: 1px solid #d9d9d9 !important;\n border-radius: 10px !important;\n padding: 15px !important;\n text-align: center !important;\n display: flex !important;\n flex-direction: row !important;\n align-items: center !important;\n justify-content: center !important;\n}\n\n#quest .bottom-bar__title,\n#reminder-quest .bottom-bar__title {\n font-size: 16px !important;\n color: #024bb5 !important;\n margin: 0 17px !important;\n}\n\n#quest .bottom-bar__arrow,\n#reminder-quest .bottom-bar__arrow {\n width: 0 !important;\n height: 0 !important;\n border-style: solid !important;\n border-width: 0 8px 8px 8px !important;\n border-color: transparent transparent #024bb5 transparent !important;\n}\n\n#quest .bottom-bar__line,\n#reminder-quest .bottom-bar__line {\n white-space: nowrap !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .bottom-bar,\n #reminder-quest .bottom-bar {\n bottom: -147px !important;\n }\n\n #quest .bottom-bar__title,\n #reminder-quest .bottom-bar__title {\n font-size: 14px !important;\n margin: 0 7px !important;\n }\n}\n\n#quest .charity-support-bar,\n#reminder-quest .charity-support-bar {\n padding: 0 20px 5px !important;\n text-align: center !important;\n font-size: 14px !important;\n color: #000 !important;\n flex-wrap: wrap !important;\n line-height: 18px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .charity-support-bar,\n #reminder-quest .charity-support-bar {\n padding-top: 10px !important;\n }\n}\n\n#quest .charity-support-bar-link,\n#reminder-quest .charity-support-bar-link {\n box-shadow: none !important;\n border: none !important;\n outline: none !important;\n text-decoration: none !important;\n height: 15px !important;\n}\n\n#quest .charity-support-bar-logo,\n#reminder-quest .charity-support-bar-logo {\n display: inline-block !important;\n vertical-align: middle !important;\n width: 64px !important;\n height: 18px !important;\n box-shadow: none !important;\n padding: 0 !important;\n opacity: 1 !important;\n margin: -5px 0 0 5px !important;\n transition: none !important;\n}\n\n#quest .charity-support-bar__part,\n#reminder-quest .charity-support-bar__part {\n white-space: nowrap !important;\n}\n\n#quest .charity-support-bar__part:nth-child(2),\n#reminder-quest .charity-support-bar__part:nth-child(2) {\n display: inline-block !important;\n}\n\[email protected] only screen and (max-device-width: 360px) {\n #quest .charity-support-bar__part,\n #reminder-quest .charity-support-bar__part {\n white-space: normal !important;\n }\n}\n\n#quest .main-quest,\n#reminder-quest .main-quest {\n flex: 1 0 auto !important;\n display: flex !important;\n position: relative !important;\n z-index: 30 !important;\n}\n\n#quest .main-quest__loader,\n#reminder-quest .main-quest__loader {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n position: absolute !important;\n width: 100% !important;\n height: 40px !important;\n transition: opacity .4s !important;\n top: 50% !important;\n transform: translateY(calc(-50% + 26px)) !important;\n opacity: 0 !important;\n z-index: 0 !important;\n flex-direction: column !important;\n left: 0 !important;\n}\n\n#quest .main-quest__loader--visible,\n#reminder-quest .main-quest__loader--visible {\n opacity: 1 !important;\n transition-delay: .5s !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .main-quest__loader,\n #reminder-quest .main-quest__loader {\n bottom: 10px !important;\n }\n}\n\n#quest .button,\n#reminder-quest .button {\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n text-decoration: none !important;\n height: 40px !important;\n line-height: normal !important;\n padding: 7px 15px !important;\n box-shadow: 0 5px 15px 0 rgba(0,0,0,.3) !important;\n cursor: pointer !important;\n outline: none !important;\n font-family: inherit !important;\n box-sizing: border-box !important;\n font-size: 14px !important;\n font-weight: bold !important;\n text-transform: none !important;\n margin: 0 !important;\n border-radius: 5px !important;\n}\n\n#quest .button__inner,\n#reminder-quest .button__inner {\n flex: 1 1 auto !important;\n display: flex !important;\n align-items: center !important;\n justify-content: center !important;\n}\n\n#quest .button__arrow,\n#reminder-quest .button__arrow {\n align-self: center !important;\n display: inline-block !important;\n width: 0 !important;\n height: 0 !important;\n margin-left: 8px !important;\n border-style: solid !important;\n border-width: 4.5px 0 4.5px 7px !important;\n border-color: transparent !important;\n}\n\n#quest .button--green,\n#reminder-quest .button--green {\n background: #129b28 !important;\n color: #fff !important;\n border: 1px solid #129b28 !important;\n box-shadow: 0 5px 20px 0 rgba(0,0,0,.3) !important;\n}\n\n#quest .button--green:hover,\n#reminder-quest .button--green:hover {\n background: #16b530 !important;\n border: 1px solid #16b530 !important;\n}\n\n#quest .button--green span,\n#reminder-quest .button--green span {\n color: #fff !important;\n}\n\n#quest .button--green .button__arrow,\n#reminder-quest .button--green .button__arrow {\n border-left-color: #fff !important;\n}\n\n#quest .button--blue,\n#reminder-quest .button--blue {\n background: #fff !important;\n color: #024bb5 !important;\n border: 1px solid #d9d9d9 !important;\n}\n\n#quest .button--blue:hover,\n#reminder-quest .button--blue:hover {\n background: #f2f2f2 !important;\n}\n\n#quest .button--blue span,\n#reminder-quest .button--blue span {\n color: #024bb5 !important;\n}\n\n#quest .button--blue .button__arrow,\n#reminder-quest .button--blue .button__arrow {\n border-left-color: #024bb5 !important;\n}\n\n#quest .button--grey,\n#reminder-quest .button--grey {\n background: #9b9b9b !important;\n color: #fff !important;\n border: 1px solid #9b9b9b !important;\n}\n\n#quest .button--grey:hover,\n#reminder-quest .button--grey:hover {\n background: #afafaf !important;\n}\n\n#quest .button--grey span,\n#reminder-quest .button--grey span {\n color: #fff !important;\n}\n\n#quest .button--grey .button__arrow,\n#reminder-quest .button--grey .button__arrow {\n border-left-color: #444 !important;\n}\n\n#quest .button--uppercase,\n#reminder-quest .button--uppercase {\n text-transform: uppercase !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .button,\n #reminder-quest .button {\n height: 36px !important;\n padding: 5px 15px !important;\n line-height: 26px !important;\n font-size: 12px !important;\n border-radius: 3px !important;\n }\n}\n\n#quest .subscriber-profile,\n#reminder-quest .subscriber-profile {\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n max-width: 550px !important;\n margin: 30px auto !important;\n flex: 1 1 auto !important;\n position: relative !important;\n opacity: 0 !important;\n transition: opacity 500ms ease-in-out !important;\n}\n\n#quest .subscriber-profile--active,\n#reminder-quest .subscriber-profile--active {\n opacity: 1 !important;\n}\n\n#quest .subscriber-profile__inner,\n#reminder-quest .subscriber-profile__inner {\n background-color: #fff !important;\n border-radius: 10px !important;\n border: 1px solid #d9d9d9 !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n text-align: center !important;\n}\n\n#quest .subscriber-profile__content,\n#reminder-quest .subscriber-profile__content {\n padding: 47px 20px 10px !important;\n text-align: center !important;\n}\n\n#quest .subscriber-profile__logo,\n#reminder-quest .subscriber-profile__logo {\n display: inline-block !important;\n width: 50px !important;\n height: 50px !important;\n border-radius: 5px !important;\n border: 3px solid #ddd !important;\n margin: 0 0 29px !important;\n padding: 0 !important;\n opacity: 1 !important;\n transition: none !important;\n}\n\n#quest .subscriber-profile__title,\n#reminder-quest .subscriber-profile__title {\n color: #024bb5 !important;\n font-size: 22px !important;\n font-weight: bold !important;\n margin-bottom: 23px !important;\n}\n\n#quest .subscriber-profile__subtitle,\n#reminder-quest .subscriber-profile__subtitle {\n font-size: 16px !important;\n color: #000 !important;\n margin-bottom: 28px !important;\n}\n\n#quest .subscriber-profile__extend-button,\n#reminder-quest .subscriber-profile__extend-button {\n margin-bottom: 15px !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n\n#quest .subscriber-profile__extend-button .button,\n#reminder-quest .subscriber-profile__extend-button .button {\n min-width: 160px !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .subscriber-profile__content,\n #reminder-quest .subscriber-profile__content {\n padding: 37px 30px 1px !important;\n }\n\n #quest .subscriber-profile__title,\n #reminder-quest .subscriber-profile__title {\n color: #024bb5 !important;\n font-size: 20px !important;\n margin-bottom: 20px !important;\n }\n\n #quest .subscriber-profile__subtitle,\n #reminder-quest .subscriber-profile__subtitle {\n margin-bottom: 25px !important;\n }\n\n #quest .subscriber-profile__extend-button,\n #reminder-quest .subscriber-profile__extend-button {\n margin-bottom: 28px !important;\n }\n}\n\n#quest .subscriber-footer,\n#reminder-quest .subscriber-footer {\n border-top: 1px solid #d9d9d9 !important;\n flex: 1 1 auto !important;\n color: #626262 !important;\n font-size: 14px !important;\n padding: 0 20px !important;\n}\n\n#quest .subscriber-footer__link-wrapper,\n#reminder-quest .subscriber-footer__link-wrapper {\n position: relative !important;\n}\n\n#quest .subscriber-footer__link,\n#reminder-quest .subscriber-footer__link {\n text-decoration: none !important;\n color: #024bb5 !important;\n box-shadow: none !important;\n cursor: pointer !important;\n}\n\n#quest .subscriber-footer__link--with-arrow:after,\n#reminder-quest .subscriber-footer__link--with-arrow:after {\n content: " »" !important;\n}\n\n#quest .subscriber-footer__anonymous,\n#reminder-quest .subscriber-footer__anonymous {\n height: 66px !important;\n display: flex !important;\n flex-direction: row !important;\n justify-content: center !important;\n align-items: center !important;\n}\n\n#quest .subscriber-footer__logged-in,\n#reminder-quest .subscriber-footer__logged-in {\n height: 56px !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n align-items: center !important;\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .subscriber-footer__anonymous,\n #reminder-quest .subscriber-footer__anonymous {\n height: 60px !important;\n }\n}\n\n#quest .subscription,\n#reminder-quest .subscription {\n font-family: "Lato",Arial,Helvetica,sans-serif !important;\n max-width: 550px !important;\n margin: 30px auto !important;\n flex: 1 1 auto !important;\n position: relative !important;\n line-height: normal !important;\n opacity: 0 !important;\n transition: opacity 500ms ease-in-out !important;\n}\n\n#quest .subscription--active,\n#reminder-quest .subscription--active {\n opacity: 1 !important;\n}\n\n#quest .subscription__inner,\n#reminder-quest .subscription__inner {\n background-color: #fff !important;\n border-radius: 10px !important;\n border: 1px solid #d9d9d9 !important;\n box-shadow: 0 0 20px 0 rgba(0,0,0,.2) !important;\n text-align: center !important;\n}\n\n#quest .subscription__content,\n#reminder-quest .subscription__content {\n color: #000 !important;\n padding: 49px 38px 32px !important;\n}\n\n#quest .subscription__title,\n#reminder-quest .subscription__title {\n font-size: 22px !important;\n font-weight: bold !important;\n margin-bottom: 36px !important;\n}\n\n#quest .subscription__subtitle,\n#reminder-quest .subscription__subtitle {\n font-size: 20px !important;\n font-weight: bold !important;\n display: flex !important;\n text-align: center !important;\n align-items: center !important;\n justify-content: space-between !important;\n margin-bottom: 21px !important;\n}\n\n#quest .subscription__subtitle-text,\n#reminder-quest .subscription__subtitle-text {\n flex: 2 !important;\n padding: 0 20px !important;\n white-space: nowrap !important;\n}\n\n#quest .subscription__subtitle-line,\n#reminder-quest .subscription__subtitle-line {\n border-top: 1px solid #d9d9d9 !important;\n max-width: 92px !important;\n flex: 1 !important;\n}\n\n#quest .subscription__text,\n#reminder-quest .subscription__text {\n font-size: 16px !important;\n margin-bottom: 21px !important;\n}\n\n#quest .subscription__text b,\n#reminder-quest .subscription__text b {\n color: #129b28 !important;\n}\n\n#quest .subscription__button-wrapper,\n#reminder-quest .subscription__button-wrapper {\n position: relative !important;\n}\n\n#quest .subscription__activate-button,\n#reminder-quest .subscription__activate-button {\n margin-bottom: 43px !important;\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n\n#quest .subscription__active-button--no-bottom-margin,\n#reminder-quest .subscription__active-button--no-bottom-margin {\n margin-bottom: 0 !important;\n}\n\n#quest .subscription__activate-button .button,\n#reminder-quest .subscription__activate-button .button {\n min-width: 160px !important;\n}\n\n#quest .subscription__return-button,\n#reminder-quest .subscription__return-button {\n display: flex !important;\n flex-direction: column !important;\n align-items: center !important;\n}\n\n#quest .subscription__return-button .button:before,\n#quest .subscription__return-button .button:after,\n#reminder-quest .subscription__return-button .button:before,\n#reminder-quest .subscription__return-button .button:after {\n display: none !important;\n}\n\n#quest .subscription__line,\n#reminder-quest .subscription__line {\n white-space: nowrap !important;\n}\n\[email protected] screen and (min-width: 769px)and (max-width: 1024px) {\n #quest .subscription__content,\n #reminder-quest .subscription__content {\n padding: 26px 0 !important;\n }\n\n #quest .subscription__title,\n #reminder-quest .subscription__title {\n padding: 0 10px !important;\n font-size: 20px !important;\n margin-bottom: 26px !important;\n }\n\n #quest .subscription__subtitle,\n #reminder-quest .subscription__subtitle {\n font-size: 18px !important;\n margin-bottom: 20px !important;\n }\n\n #quest .subscription__text,\n #reminder-quest .subscription__text {\n font-size: 14px !important;\n }\n}\n\[email protected] only screen and (max-device-width: 768px) {\n #quest .subscription,\n #reminder-quest .subscription {\n margin: 20px auto !important;\n }\n\n #quest .subscription__content,\n #reminder-quest .subscription__content {\n padding: 26px 0 !important;\n }\n\n #quest .subscription__title,\n #reminder-quest .subscription__title {\n padding: 0 50px !important;\n font-size: 19px !important;\n margin-bottom: 26px !important;\n }\n\n #quest .subscription__subtitle,\n #reminder-quest .subscription__subtitle {\n font-size: 16px !important;\n margin-bottom: 18px !important;\n }\n\n #quest .subscription__subtitle-line,\n #reminder-quest .subscription__subtitle-line {\n max-width: 60px !important;\n }\n\n #quest .subscription__text,\n #reminder-quest .subscription__text {\n font-size: 12px !important;\n }\n}\n\n#quest .learn-more-button,\n#reminder-quest .learn-more-button {\n text-decoration: none !important;\n box-shadow: none !important;\n border: 0 !important;\n outline: 0 !important;\n position: relative !important;\n}\n\n#quest .learn-more-button .button,\n#reminder-quest .learn-more-button .button {\n min-width: 226px !important;\n max-width: 100% !important;\n}\n\[email protected] rotator {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\[email protected] rotator {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}\n\n#quest .loader,\n#reminder-quest .loader {\n width: 20px !important;\n height: 20px !important;\n border: 2px solid #129b28 !important;\n border-radius: 100px !important;\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#quest .loader__separator,\n#reminder-quest .loader__separator {\n position: absolute !important;\n top: 2px !important;\n width: 0 !important;\n height: 0 !important;\n border-top: 6px solid transparent !important;\n border-bottom: 6px solid transparent !important;\n border-left: 12px solid #fff !important;\n transform-origin: 100% 50% !important;\n -webkit-animation: rotator 1.4s linear infinite !important;\n animation: rotator 1.4s linear infinite !important;\n left: -4px !important;\n}',""]);const A=g},"./node_modules/css-loader/dist/runtime/api.js":t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n="",r=void 0!==e[5];return e[4]&&(n+="@supports (".concat(e[4],") {")),e[2]&&(n+="@media ".concat(e[2]," {")),r&&(n+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),n+=t(e),r&&(n+="}"),e[2]&&(n+="}"),e[4]&&(n+="}"),n})).join("")},e.i=function(t,n,r,i,s){"string"==typeof t&&(t=[[null,t,void 0]]);var o={};if(r)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),n&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=n):c[2]=n),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),e.push(c))}},e}},"./node_modules/css-loader/dist/runtime/getUrl.js":t=>{"use strict";t.exports=function(t,e){return e||(e={}),t?(t=String(t.__esModule?t.default:t),/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]|(%20)/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t):t}},"./node_modules/css-loader/dist/runtime/noSourceMaps.js":t=>{"use strict";t.exports=function(t){return t[1]}},"./node_modules/fontfaceobserver/fontfaceobserver.standalone.js":t=>{!function(){function e(t,e){document.addEventListener?t.addEventListener("scroll",e,!1):t.attachEvent("scroll",e)}function n(t){this.a=document.createElement("div"),this.a.setAttribute("aria-hidden","true"),this.a.appendChild(document.createTextNode(t)),this.b=document.createElement("span"),this.c=document.createElement("span"),this.h=document.createElement("span"),this.f=document.createElement("span"),this.g=-1,this.b.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.c.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.f.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.h.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.b.appendChild(this.h),this.c.appendChild(this.f),this.a.appendChild(this.b),this.a.appendChild(this.c)}function r(t,e){t.a.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+e+";"}function i(t){var e=t.a.offsetWidth,n=e+100;return t.f.style.width=n+"px",t.c.scrollLeft=n,t.b.scrollLeft=t.b.scrollWidth+100,t.g!==e&&(t.g=e,!0)}function s(t,n){function r(){var t=s;i(t)&&t.a.parentNode&&n(t.g)}var s=t;e(t.b,r),e(t.c,r),i(t)}function o(t,e){var n=e||{};this.family=t,this.style=n.style||"normal",this.weight=n.weight||"normal",this.stretch=n.stretch||"normal"}var a=null,u=null,l=null,c=null;function d(){return null===c&&(c=!!document.fonts),c}function h(){if(null===l){var t=document.createElement("div");try{t.style.font="condensed 100px sans-serif"}catch(t){}l=""!==t.style.font}return l}function p(t,e){return[t.style,t.weight,h()?t.stretch:"","100px",e].join(" ")}o.prototype.load=function(t,e){var i=this,o=t||"BESbswy",l=0,c=e||3e3,h=(new Date).getTime();return new Promise((function(t,e){if(d()&&!function(){if(null===u)if(d()&&/Apple/.test(window.navigator.vendor)){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent);u=!!t&&603>parseInt(t[1],10)}else u=!1;return u}()){var f=new Promise((function(t,e){!function n(){(new Date).getTime()-h>=c?e(Error(c+"ms timeout exceeded")):document.fonts.load(p(i,'"'+i.family+'"'),o).then((function(e){1<=e.length?t():setTimeout(n,25)}),e)}()})),m=new Promise((function(t,e){l=setTimeout((function(){e(Error(c+"ms timeout exceeded"))}),c)}));Promise.race([m,f]).then((function(){clearTimeout(l),t(i)}),e)}else!function(t){document.body?t():document.addEventListener?document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e),t()})):document.attachEvent("onreadystatechange",(function e(){"interactive"!=document.readyState&&"complete"!=document.readyState||(document.detachEvent("onreadystatechange",e),t())}))}((function(){function u(){var e;(e=-1!=g&&-1!=v||-1!=g&&-1!=y||-1!=v&&-1!=y)&&((e=g!=v&&g!=y&&v!=y)||(null===a&&(e=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),a=!!e&&(536>parseInt(e[1],10)||536===parseInt(e[1],10)&&11>=parseInt(e[2],10))),e=a&&(g==_&&v==_&&y==_||g==b&&v==b&&y==b||g==E&&v==E&&y==E)),e=!e),e&&(w.parentNode&&w.parentNode.removeChild(w),clearTimeout(l),t(i))}var d=new n(o),f=new n(o),m=new n(o),g=-1,v=-1,y=-1,_=-1,b=-1,E=-1,w=document.createElement("div");w.dir="ltr",r(d,p(i,"sans-serif")),r(f,p(i,"serif")),r(m,p(i,"monospace")),w.appendChild(d.a),w.appendChild(f.a),w.appendChild(m.a),document.body.appendChild(w),_=d.a.offsetWidth,b=f.a.offsetWidth,E=m.a.offsetWidth,function t(){if((new Date).getTime()-h>=c)w.parentNode&&w.parentNode.removeChild(w),e(Error(c+"ms timeout exceeded"));else{var n=document.hidden;!0!==n&&void 0!==n||(g=d.a.offsetWidth,v=f.a.offsetWidth,y=m.a.offsetWidth,u()),l=setTimeout(t,50)}}(),s(d,(function(t){g=t,u()})),r(d,p(i,'"'+i.family+'",sans-serif')),s(f,(function(t){v=t,u()})),r(f,p(i,'"'+i.family+'",serif')),s(m,(function(t){y=t,u()})),r(m,p(i,'"'+i.family+'",monospace'))}))}))},t.exports=o}()},"./node_modules/hls.js/dist/hls.js":function(t){var e;"undefined"!=typeof window&&(e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i="~";function s(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,n,r,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,r||t,s),u=i?i+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=a,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),l.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)r.call(t,e)&&n.push(i?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},l.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r0}),!1)}t.exports=function(t,e){e=e||{};var i={main:n.m},s=e.all?{main:Object.keys(i.main)}:function(t,e){for(var n={main:[e]},r={main:[]},i={main:{}};l(n);)for(var s=Object.keys(n),o=0;o=2*d/p||_<=E)){var w,S=Number.POSITIVE_INFINITY;for(w=t.level-1;w>m&&!((S=d*f[w].maxBitrate/(6.4*y))=_)){var A=this.bwEstimator.getEstimate();l.logger.warn("Fragment "+t.sn+(e?" part "+e.index:"")+" of level "+t.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+w+"\n Current BW estimate: "+(Object(r.isFiniteNumber)(A)?(A/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+_.toFixed(3)+" s\n Estimated load time for the next fragment: "+S.toFixed(3)+" s\n Time to underbuffer: "+E.toFixed(3)+" s"),n.nextLoadLevel=w,this.bwEstimator.sample(h,c.loaded),this.clearTimer(),t.loader&&(this.fragCurrent=this.partCurrent=null,t.loader.abort()),n.trigger(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:c})}}}}}},h.onFragLoaded=function(t,e){var n=e.frag,i=e.part;if(n.type===u.PlaylistLevelType.MAIN&&Object(r.isFiniteNumber)(n.sn)){var o=i?i.stats:n.stats,a=i?i.duration:n.duration;if(this.clearTimer(),this.lastLoadedFragLevel=n.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var l=this.hls.levels[n.level],c=(l.loaded?l.loaded.bytes:0)+o.loaded,d=(l.loaded?l.loaded.duration:0)+a;l.loaded={bytes:c,duration:d},l.realBitrate=Math.round(8*c/d)}if(n.bitrateTest){var h={stats:o,frag:n,part:i,id:n.type};this.onFragBuffered(s.Events.FRAG_BUFFERED,h),n.bitrateTest=!1}}},h.onFragBuffered=function(t,e){var n=e.frag,r=e.part,i=r?r.stats:n.stats;if(!i.aborted&&n.type===u.PlaylistLevelType.MAIN&&"initSegment"!==n.sn){var s=i.parsing.end-i.loading.start;this.bwEstimator.sample(s,i.loaded),i.bwEstimate=this.bwEstimator.getEstimate(),n.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}},h.onError=function(t,e){switch(e.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},h.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},h.getNextABRAutoLevel=function(){var t=this.fragCurrent,e=this.partCurrent,n=this.hls,r=n.maxAutoLevel,i=n.config,s=n.minAutoLevel,a=n.media,u=e?e.duration:t?t.duration:0,c=a?a.currentTime:0,d=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():i.abrEwmaDefaultEstimate,p=(o.BufferHelper.bufferInfo(a,c,i.maxBufferHole).end-c)/d,f=this.findBestLevel(h,s,r,p,i.abrBandWidthFactor,i.abrBandWidthUpFactor);if(f>=0)return f;l.logger.trace((p?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var m=u?Math.min(u,i.maxStarvationDelay):i.maxStarvationDelay,g=i.abrBandWidthFactor,v=i.abrBandWidthUpFactor;if(!p){var y=this.bitrateTestDelay;y&&(m=(u?Math.min(u,i.maxLoadingDelay):i.maxLoadingDelay)-y,l.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*m)+" ms"),g=v=1)}return f=this.findBestLevel(h,s,r,p+m,g,v),Math.max(f,0)},h.findBestLevel=function(t,e,n,r,i,s){for(var o,a=this.fragCurrent,u=this.partCurrent,c=this.lastLoadedFragLevel,d=this.hls.levels,h=d[c],p=!(null==h||null===(o=h.details)||void 0===o||!o.live),f=null==h?void 0:h.codecSet,m=u?u.duration:a?a.duration:0,g=n;g>=e;g--){var v=d[g];if(v&&(!f||v.codecSet===f)){var y=v.details,_=(u?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||m,b=void 0;b=g<=c?i*t:s*t;var E=d[g].maxBitrate,w=E*_/b;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+g+"/"+Math.round(b)+"/"+E+"/"+_+"/"+r+"/"+w),b>E&&(!w||p&&!this.bitrateTestDelay||w0&&-1===t?(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),this.state=i.State.IDLE):(this.loadedmetadata=!1,this.state=i.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()},E.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_TRACK:var e,n=this.levels,r=this.trackId,s=null==n||null===(e=n[r])||void 0===e?void 0:e.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=i.State.WAITING_INIT_PTS}break;case i.State.FRAG_LOADING_WAITING_RETRY:var a,u=performance.now(),l=this.retryDate;(!l||u>=l||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=i.State.IDLE);break;case i.State.WAITING_INIT_PTS:var c=this.waitingData;if(c){var d=c.frag,h=c.part,p=c.cache,m=c.complete;if(void 0!==this.initPTS[d.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.FRAG_LOADING;var g={frag:d,part:h,payload:p.flush(),networkDetails:null};this._handleFragmentLoadProgress(g),m&&t.prototype._handleFragmentLoadComplete.call(this,g)}else if(this.videoTrackCC!==this.waitingVideoCC)v.logger.log("Waiting fragment cc ("+d.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),_=o.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);Object(f.fragmentWithinToleranceTest)(_.end,this.config.maxFragLookUpTolerance,d)<0&&(v.logger.log("Waiting fragment cc ("+d.cc+") @ "+d.start+" cancelled because another fragment at "+_.end+" is needed"),this.clearWaitingFragment())}}else this.state=i.State.IDLE}this.onTickEnd()},E.clearWaitingFragment=function(){var t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=i.State.IDLE)},E.onTickEnd=function(){var t=this.media;if(t&&t.readyState){var e=(this.mediaBuffer?this.mediaBuffer:t).buffered;!this.loadedmetadata&&e.length&&(this.loadedmetadata=!0),this.lastCurrentTime=t.currentTime}},E.doTickIdle=function(){var t,e,n=this.hls,r=this.levels,o=this.media,a=this.trackId,u=n.config;if(r&&r[a]&&(o||!this.startFragRequested&&u.startFragPrefetch)){var d=r[a].details;if(!d||d.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(d))this.state=i.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,c.ElementaryStreamTypes.AUDIO,l.PlaylistLevelType.AUDIO));var h=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,l.PlaylistLevelType.AUDIO);if(null!==h){var p=h.len,f=this.getMaxBufferLength(),m=this.audioSwitch;if(!(p>=f)||m){if(!m&&this._streamEnded(h,d))return n.trigger(s.Events.BUFFER_EOS,{type:"audio"}),void(this.state=i.State.ENDED);var g=d.fragments[0].start,v=h.end;if(m){var y=this.getLoadPosition();v=y,d.PTSKnown&&yg||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=g+.05)}var _=this.getNextFragment(v,d);_?"identity"!==(null===(t=_.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=_.decryptdata)&&void 0!==e&&e.key?this.loadFragment(_,d,v):this.loadKey(_,d):this.bufferFlushed=!0}}}}},E.getMaxBufferLength=function(){var e=t.prototype.getMaxBufferLength.call(this),n=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,l.PlaylistLevelType.MAIN);return null===n?e:Math.max(e,n.len)},E.onMediaDetaching=function(){this.videoBuffer=null,t.prototype.onMediaDetaching.call(this)},E.onAudioTracksUpdated=function(t,e){var n=e.audioTracks;this.resetTransmuxer(),this.levels=n.map((function(t){return new u.Level(t)}))},E.onAudioTrackSwitching=function(t,e){var n=!!e.url;this.trackId=e.id;var r=this.fragCurrent;null!=r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),n?this.setInterval(100):this.resetTransmuxer(),n?(this.audioSwitch=!0,this.state=i.State.IDLE):this.state=i.State.STOPPED,this.tick()},E.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},E.onLevelLoaded=function(t,e){this.mainDetails=e.details},E.onAudioTrackLoaded=function(t,e){var n,r=this.levels,s=e.details,o=e.id;if(r){this.log("Track "+o+" loaded ["+s.startSN+","+s.endSN+"],duration:"+s.totalduration);var a=r[o],u=0;if(s.live||null!==(n=a.details)&&void 0!==n&&n.live){var l=this.mainDetails;if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed||!l)return;!a.details&&s.hasProgramDateTime&&l.hasProgramDateTime?(Object(m.alignMediaPlaylistByPDT)(s,l),u=s.fragments[0].start):u=this.alignPlaylists(s,a.details)}a.details=s,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(a.details,u),this.state!==i.State.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=i.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)},E._handleFragmentLoadProgress=function(t){var e,n=t.frag,r=t.part,s=t.payload,o=this.config,a=this.trackId,u=this.levels;if(u){var c=u[a];console.assert(c,"Audio track is defined on fragment load progress");var f=c.details;console.assert(f,"Audio track details are defined on fragment load progress");var m=o.defaultAudioCodec||c.audioCodec||"mp4a.40.2",g=this.transmuxer;g||(g=this.transmuxer=new h.default(this.hls,l.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[n.cc],_=null===(e=n.initSegment)||void 0===e?void 0:e.data;if(void 0!==y){var b=r?r.index:-1,E=-1!==b,w=new p.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,s.byteLength,b,E);g.push(s,_,m,"",n,r,f.totalduration,!1,w,y)}else v.logger.log("Unknown video PTS for cc "+n.cc+", waiting for video PTS before demuxing audio frag "+n.sn+" of ["+f.startSN+" ,"+f.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:n,part:r,cache:new d.default,complete:!1}).cache.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=i.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},E._handleFragmentLoadComplete=function(e){this.waitingData?this.waitingData.complete=!0:t.prototype._handleFragmentLoadComplete.call(this,e)},E.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},E.onBufferCreated=function(t,e){var n=e.tracks.audio;n&&(this.mediaBuffer=n.buffer),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer)},E.onFragBuffered=function(t,e){var n=e.frag,r=e.part;n.type===l.PlaylistLevelType.AUDIO&&(this.fragContextChanged(n)?this.warn("Fragment "+n.sn+(r?" p: "+r.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==n.sn&&(this.fragPrevious=n,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(n,r)))},E.onError=function(e,n){switch(n.details){case g.ErrorDetails.FRAG_LOAD_ERROR:case g.ErrorDetails.FRAG_LOAD_TIMEOUT:case g.ErrorDetails.KEY_LOAD_ERROR:case g.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(l.PlaylistLevelType.AUDIO,n);break;case g.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case g.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==i.State.ERROR&&this.state!==i.State.STOPPED&&(this.state=n.fatal?i.State.ERROR:i.State.IDLE,this.warn(n.details+" while loading frag, switching to "+this.state+" state"));break;case g.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===n.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var r=!0,s=this.getFwdBufferInfo(this.mediaBuffer,l.PlaylistLevelType.AUDIO);s&&s.len>.5&&(r=!this.reduceMaxBufferLength(s.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},E.onBufferFlushed=function(t,e){e.type===c.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},E._handleTransmuxComplete=function(t){var e,n="audio",r=this.hls,o=t.remuxResult,a=t.chunkMeta,u=this.getCurrentContext(a);if(!u)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(a.level);var l=u.frag,d=u.part,h=o.audio,p=o.text,f=o.id3,m=o.initSegment;if(!this.fragContextChanged(l)){if(this.state=i.State.PARSING,this.audioSwitch&&h&&this.completeAudioSwitch(),null!=m&&m.tracks&&(this._bufferInitSegment(m.tracks,l,a),r.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:l,id:n,tracks:m.tracks})),h){var g=h.startPTS,v=h.endPTS,_=h.startDTS,b=h.endDTS;d&&(d.elementaryStreams[c.ElementaryStreamTypes.AUDIO]={startPTS:g,endPTS:v,startDTS:_,endDTS:b}),l.setElementaryStreamInfo(c.ElementaryStreamTypes.AUDIO,g,v,_,b),this.bufferFragmentData(h,l,d,a)}if(null!=f&&null!==(e=f.samples)&&void 0!==e&&e.length){var E=y({frag:l,id:n},f);r.trigger(s.Events.FRAG_PARSING_METADATA,E)}if(p){var w=y({frag:l,id:n},p);r.trigger(s.Events.FRAG_PARSING_USERDATA,w)}}},E._bufferInitSegment=function(t,e,n){if(this.state===i.State.PARSING){t.video&&delete t.video;var r=t.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:"+r.container+", codecs[parsed]=["+r.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,t);var o=r.initSegment;if(null!=o&&o.byteLength){var a={type:"audio",frag:e,part:null,chunkMeta:n,parent:e.type,data:o};this.hls.trigger(s.Events.BUFFER_APPENDING,a)}this.tick()}}},E.loadFragment=function(e,n,s){var o=this.fragmentTracker.getState(e);this.fragCurrent=e,(this.audioSwitch||o===a.FragmentState.NOT_LOADED||o===a.FragmentState.PARTIAL)&&("initSegment"===e.sn?this._loadInitSegment(e):n.live&&!Object(r.isFiniteNumber)(this.initPTS[e.cc])?(this.log("Waiting for video PTS in continuity counter "+e.cc+" of live stream before loading audio fragment "+e.sn+" of level "+this.trackId),this.state=i.State.WAITING_INIT_PTS):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,s)))},E.completeAudioSwitch=function(){var e=this.hls,n=this.media,r=this.trackId;n&&(this.log("Switching audio track : flushing all audio"),t.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,e.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:r})},b}(i.default);e.default=b},"./src/controller/audio-track-controller.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/events.ts"),i=n("./src/errors.ts"),s=n("./src/controller/base-playlist-controller.ts"),o=n("./src/types/loader.ts");function a(t,e){for(var n=0;n=e.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var n=e[this.trackId];this.log("Now switching to audio-track index "+t);var i=e[t],s=i.id,o=i.groupId,a=void 0===o?"":o,u=i.name,l=i.type,c=i.url;if(this.trackId=t,this.trackName=u,this.selectDefaultTrack=!1,this.hls.trigger(r.Events.AUDIO_TRACK_SWITCHING,{id:s,groupId:a,name:u,type:l,url:c}),!i.details||i.details.live){var d=this.switchParams(i.url,null==n?void 0:n.details);this.loadPlaylist(d)}}},h.selectInitialTrack=function(){var t=this.tracksInGroup;console.assert(t.length,"Initial audio track should be selected when tracks are known");var e=this.trackName,n=this.findTrackId(e)||this.findTrackId();-1!==n?this.setAudioTrack(n):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},h.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;ne.partTarget&&(l+=1)}if(Object(r.isFiniteNumber)(u))return new i.HlsUrlParameters(u,Object(r.isFiniteNumber)(l)?l:void 0,i.HlsSkip.No)}}},e.loadPlaylist=function(t){},e.shouldLoadTrack=function(t){return this.canLoad&&t&&!!t.url&&(!t.details||t.details.live)},e.playlistLoaded=function(t,e,n){var r=this,i=e.details,o=e.stats,a=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(i.advancedDateTime=Date.now()-a,i.live||null!=n&&n.live){if(i.reloaded(n),n&&this.log("live playlist "+t+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),n&&i.fragments.length>0&&Object(s.mergeDetails)(n,i),!this.canLoad||!i.live)return;var u,l=void 0,c=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var d=this.hls.config.lowLatencyMode,h=i.lastPartSn,p=i.endSN,f=i.lastPartIndex,m=h===p;-1!==f?(l=m?p+1:h,c=m?d?0:f:f+1):l=p+1;var g=i.age,v=g+i.ageHeader,y=Math.min(v-i.partTarget,1.5*i.targetduration);if(y>0){if(n&&y>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var _=Math.floor(y/i.targetduration);l+=_,void 0!==c&&(c+=Math.round(y%i.targetduration/i.partTarget)),this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+g.toFixed(2)+"s goal: "+y+" skip sn "+_+" to part "+c)}i.tuneInGoal=y}if(u=this.getDeliveryDirectives(i,e.deliveryDirectives,l,c),d||!m)return void this.loadPlaylist(u)}else u=this.getDeliveryDirectives(i,e.deliveryDirectives,l,c);var b=Object(s.computeReloadInterval)(i,o);void 0!==l&&i.canBlockReload&&(b-=i.partTarget||1),this.log("reload live playlist "+t+" in "+Math.round(b)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(u)}),b)}else this.clearTimer()},e.getDeliveryDirectives=function(t,e,n,r){var s=Object(i.getSkipValue)(t,n);return null!=e&&e.skip&&t.deltaUpdateFailed&&(n=e.msn,r=e.part,s=i.HlsSkip.No),new i.HlsUrlParameters(n,r,s)},e.retryLoadingOrFail=function(t){var e,n=this,r=this.hls.config,i=this.retryCount-1&&null!==(e=t.context)&&void 0!==e&&e.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+t.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return n.loadPlaylist()}),s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+t.details+'"')}else this.warn('cannot recover from error "'+t.details+'"'),this.clearTimer(),t.fatal=!0;return i},t}()},"./src/controller/base-stream-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"State",(function(){return E})),n.d(e,"default",(function(){return w}));var r=n("./src/polyfills/number.ts"),i=n("./src/task-loop.ts"),s=n("./src/controller/fragment-tracker.ts"),o=n("./src/utils/buffer-helper.ts"),a=n("./src/utils/logger.ts"),u=n("./src/events.ts"),l=n("./src/errors.ts"),c=n("./src/types/transmuxer.ts"),d=n("./src/utils/mp4-tools.ts"),h=n("./src/utils/discontinuities.ts"),p=n("./src/controller/fragment-finders.ts"),f=n("./src/controller/level-helper.ts"),m=n("./src/loader/fragment-loader.ts"),g=n("./src/crypt/decrypter.ts"),v=n("./src/utils/time-ranges.ts"),y=n("./src/types/loader.ts");function _(t,e){for(var n=0;ne.start+e.duration+l;(a0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return e.decrypter.webCryptoDecrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer).then((function(e){var i=self.performance.now();return r.trigger(u.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:i}}),n.payload=e,n}))}return n})).then((function(n){var r=e.fragCurrent,i=e.hls,s=e.levels;if(!s)throw new Error("init load aborted, missing levels");var o=s[t.level].details;console.assert(o,"Level details are defined when init segment is loaded");var a=t.stats;e.state=E.IDLE,e.fragLoadError=0,t.data=new Uint8Array(n.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),n.frag===r&&i.trigger(u.Events.FRAG_BUFFERED,{stats:a,frag:r,part:null,id:t.type}),e.tick()})).catch((function(n){e.warn(n),e.resetFragmentLoading(t)}))},T.fragContextChanged=function(t){var e=this.fragCurrent;return!t||!e||t.level!==e.level||t.sn!==e.sn||t.urlId!==e.urlId},T.fragBufferedComplete=function(t,e){var n=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+t.type+" sn: "+t.sn+(e?" part: "+e.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+t.level+" "+v.default.toString(o.BufferHelper.getBuffered(n))),this.state=E.IDLE,this.tick()},T._handleFragmentLoadComplete=function(t){var e=this.transmuxer;if(e){var n=t.frag,r=t.part,i=t.partsLoaded,s=!i||0===i.length||i.some((function(t){return!t})),o=new c.ChunkMetadata(n.level,n.sn,n.stats.chunkCount+1,0,r?r.index:-1,!s);e.flush(o)}},T._handleFragmentLoadProgress=function(t){},T._doFragLoad=function(t,e,n,i){var s=this;if(void 0===n&&(n=null),!this.levels)throw new Error("frag load aborted, missing levels");if(n=Math.max(t.start,n||0),this.config.lowLatencyMode&&e){var o=e.partList;if(o&&i){n>t.end&&e.fragmentHint&&(t=e.fragmentHint);var a=this.getNextPart(o,t,n);if(a>-1){var l=o[a];return this.log("Loading part sn: "+t.sn+" p: "+l.index+" cc: "+t.cc+" of playlist ["+e.startSN+"-"+e.endSN+"] parts [0-"+a+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),this.nextLoadPosition=l.start+l.duration,this.state=E.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:t,part:o[a],targetBufferTime:n}),this.doFragPartsLoad(t,o,a,i).catch((function(t){return s.handleFragLoadError(t)}))}if(!t.url||this.loadedEndOfParts(o,n))return Promise.resolve(null)}}return this.log("Loading fragment "+t.sn+" cc: "+t.cc+" "+(e?"of ["+e.startSN+"-"+e.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+t.level+", target: "+parseFloat(n.toFixed(3))),Object(r.isFiniteNumber)(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=E.FRAG_LOADING,this.hls.trigger(u.Events.FRAG_LOADING,{frag:t,targetBufferTime:n}),this.fragmentLoader.load(t,i).catch((function(t){return s.handleFragLoadError(t)}))},T.doFragPartsLoad=function(t,e,n,r){var i=this;return new Promise((function(s,o){var a=[];!function n(l){var c=e[l];i.fragmentLoader.loadPart(t,c,r).then((function(r){a[c.index]=r;var o=r.part;i.hls.trigger(u.Events.FRAG_LOADED,r);var d=e[l+1];if(!d||d.fragment!==t)return s({frag:t,part:o,partsLoaded:a});n(l+1)})).catch(o)}(n)}))},T.handleFragLoadError=function(t){var e=t.data;return e&&e.details===l.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(u.Events.ERROR,e),null},T._handleTransmuxerFlush=function(t){var e=this.getCurrentContext(t);if(e&&this.state===E.PARSING){var n=e.frag,r=e.part,i=e.level,s=self.performance.now();n.stats.parsing.end=s,r&&(r.stats.parsing.end=s),this.updateLevelTiming(n,r,i,t.partial)}else this.fragCurrent||(this.state=E.IDLE)},T.getCurrentContext=function(t){var e=this.levels,n=t.level,r=t.sn,i=t.part;if(!e||!e[n])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+n+". The current chunk will not be buffered."),null;var s=e[n],o=i>-1?Object(f.getPartWith)(s,r,i):null,a=o?o.fragment:Object(f.getFragmentWithSN)(s,r,this.fragCurrent);return a?{frag:a,part:o,level:s}:null},T.bufferFragmentData=function(t,e,n,r){if(t&&this.state===E.PARSING){var i=t.data1,s=t.data2,o=i;if(i&&s&&(o=Object(d.appendUint8Array)(i,s)),o&&o.length){var a={type:t.type,frag:e,part:n,chunkMeta:r,parent:e.type,data:o};this.hls.trigger(u.Events.BUFFER_APPENDING,a),t.dropped&&t.independent&&!n&&this.flushBufferGap(e)}}},T.flushBufferGap=function(t){var e=this.media;if(e)if(o.BufferHelper.isBuffered(e,e.currentTime)){var n=e.currentTime,r=o.BufferHelper.bufferInfo(e,n,0),i=t.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*i),a=Math.max(Math.min(t.start-s,r.end-s),n+s);t.start-a>s&&this.flushMainBuffer(a,t.start)}else this.flushMainBuffer(0,t.start)},T.getFwdBufferInfo=function(t,e){var n=this.config,i=this.getLoadPosition();if(!Object(r.isFiniteNumber)(i))return null;var s=o.BufferHelper.bufferInfo(t,i,n.maxBufferHole);if(0===s.len&&void 0!==s.nextStart){var a=this.fragmentTracker.getBufferedFrag(i,e);if(a&&s.nextStart=n&&(e.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+e.maxMaxBufferLength+"s"),!0)},T.getNextFragment=function(t,e){var n,r,i=e.fragments,s=i.length;if(!s)return null;var o,a=this.config,u=i[0].start;if(e.live){var l=a.initialLiveManifestSize;if(s-1&&nn.start&&n.loaded},T.getInitialLiveFragment=function(t,e){var n=this.fragPrevious,r=null;if(n){if(t.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+n.programDateTime),r=Object(p.findFragmentByPDT)(e,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var i=n.sn+1;if(i>=t.startSN&&i<=t.endSN){var s=e[i-t.startSN];n.cc===s.cc&&(r=s,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=Object(p.findFragWithCC)(e,n.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(r=this.getFragmentAtPosition(o,this.bitrateTest?t.fragmentEnd:t.edge,t))}return r},T.getFragmentAtPosition=function(t,e,n){var r,i=this.config,o=this.fragPrevious,a=n.fragments,u=n.endSN,l=n.fragmentHint,c=i.maxFragLookUpTolerance,d=!!(i.lowLatencyMode&&n.partList&&l);if(d&&l&&!this.bitrateTest&&(a=a.concat(l),u=l.sn),te-c?0:c;r=Object(p.findFragmentByPTS)(o,a,t,h)}else r=a[a.length-1];if(r){var f=r.sn-n.startSN,m=o&&r.level===o.level,g=a[f+1];if(this.fragmentTracker.getState(r)===s.FragmentState.BACKTRACKED){r=null;for(var v=f;a[v]&&this.fragmentTracker.getState(a[v])===s.FragmentState.BACKTRACKED;)r=o?a[v--]:a[--v];r||(r=g)}else o&&r.sn===o.sn&&!d&&m&&(r.sn=s-e.maxFragLookUpTolerance&&i<=o;if(null!==r&&n.duration>r&&(i"+t.startSN+" prev-sn: "+(s?s.sn:"na")+" fragments: "+a),d}return u},T.waitForCdnTuneIn=function(t){return t.live&&t.canBlockReload&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)},T.setStartPosition=function(t,e){var n=this.startPosition;if(n"+t))}}])&&_(w.prototype,S),A&&_(w,A),i}(i.default)},"./src/controller/buffer-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return p}));var r=n("./src/polyfills/number.ts"),i=n("./src/events.ts"),s=n("./src/utils/logger.ts"),o=n("./src/errors.ts"),a=n("./src/utils/buffer-helper.ts"),u=n("./src/utils/mediasource-helper.ts"),l=n("./src/loader/fragment.ts"),c=n("./src/controller/buffer-operation-queue.ts"),d=Object(u.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,p=function(){function t(t){var e=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 t=e.hls,n=e.media,r=e.mediaSource;s.logger.log("[buffer-controller]: Media source opened"),n&&(e.updateMediaElementDuration(),t.trigger(i.Events.MEDIA_ATTACHED,{media:n})),r&&r.removeEventListener("sourceopen",e._onMediaSourceOpen),e.checkPendingTracks()},this._onMediaSourceClose=function(){s.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){s.logger.log("[buffer-controller]: Media source ended")},this.hls=t,this._initSourceBuffer(),this.registerListeners()}var e=t.prototype;return e.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},e.destroy=function(){this.unregisterListeners(),this.details=null},e.registerListeners=function(){var t=this.hls;t.on(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(i.Events.BUFFER_RESET,this.onBufferReset,this),t.on(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(i.Events.BUFFER_EOS,this.onBufferEos,this),t.on(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(i.Events.FRAG_PARSED,this.onFragParsed,this),t.on(i.Events.FRAG_CHANGED,this.onFragChanged,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(i.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(i.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(i.Events.BUFFER_RESET,this.onBufferReset,this),t.off(i.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(i.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(i.Events.BUFFER_EOS,this.onBufferEos,this),t.off(i.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(i.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(i.Events.FRAG_PARSED,this.onFragParsed,this),t.off(i.Events.FRAG_CHANGED,this.onFragChanged,this)},e._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new c.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},e.onManifestParsed=function(t,e){var n=2;(e.audio&&!e.video||!e.altAudio)&&(n=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=n,this.details=null,s.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},e.onMediaAttaching=function(t,e){var n=this.media=e.media;if(n&&d){var r=this.mediaSource=new d;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),n.src=self.URL.createObjectURL(r),this._objectUrl=n.src}},e.onMediaDetaching=function(){var t=this.media,e=this.mediaSource,n=this._objectUrl;if(e){if(s.logger.log("[buffer-controller]: media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){s.logger.warn("[buffer-controller]: onMediaDetaching: "+t.message+" while calling endOfStream")}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(n&&self.URL.revokeObjectURL(n),t.src===n?(t.removeAttribute("src"),t.load()):s.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(i.Events.MEDIA_DETACHED,void 0)},e.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach((function(e){var n=t.sourceBuffer[e];try{n&&(t.removeBufferListeners(e),t.mediaSource&&t.mediaSource.removeSourceBuffer(n),t.sourceBuffer[e]=void 0)}catch(t){s.logger.warn("[buffer-controller]: Failed to reset the "+e+" buffer",t)}})),this._initSourceBuffer()},e.onBufferCodecs=function(t,e){var n=this,r=this.getSourceBufferTypes().length;Object.keys(e).forEach((function(t){if(r){var i=n.tracks[t];if(i&&"function"==typeof i.buffer.changeType){var s=e[t],o=s.codec,a=s.levelCodec,u=s.container;if((i.levelCodec||i.codec).replace(h,"$1")!==(a||o).replace(h,"$1")){var l=u+";codecs="+(a||o);n.appendChangeType(t,l)}}}else n.pendingTracks[t]=e[t]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},e.appendChangeType=function(t,e){var n=this,r=this.operationQueue,i={execute:function(){var i=n.sourceBuffer[t];i&&(s.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+e),i.changeType(e)),r.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(e){s.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",e)}};r.append(i,t)},e.onBufferAppending=function(t,e){var n=this,r=this.hls,u=this.operationQueue,l=this.tracks,c=e.data,d=e.type,h=e.frag,p=e.part,f=e.chunkMeta,m=f.buffering[d],g=self.performance.now();m.start=g;var v=h.stats.buffering,y=p?p.stats.buffering:null;0===v.start&&(v.start=g),y&&0===y.start&&(y.start=g);var _=l.audio,b="audio"===d&&1===f.id&&"audio/mpeg"===(null==_?void 0:_.container),E={execute:function(){if(m.executeStart=self.performance.now(),b){var t=n.sourceBuffer[d];if(t){var e=h.start-t.timestampOffset;Math.abs(e)>=.1&&(s.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+h.start+" (delta: "+e+") sn: "+h.sn+")"),t.timestampOffset=h.start)}}n.appendExecutor(c,d)},onStart:function(){},onComplete:function(){var t=self.performance.now();m.executeEnd=m.end=t,0===v.first&&(v.first=t),y&&0===y.first&&(y.first=t);var e=n.sourceBuffer,r={};for(var s in e)r[s]=a.BufferHelper.getBuffered(e[s]);n.appendError=0,n.hls.trigger(i.Events.BUFFER_APPENDED,{type:d,frag:h,part:p,chunkMeta:f,parent:h.type,timeRanges:r})},onError:function(t){s.logger.error("[buffer-controller]: Error encountered while trying to append to the "+d+" SourceBuffer",t);var e={type:o.ErrorTypes.MEDIA_ERROR,parent:h.type,details:o.ErrorDetails.BUFFER_APPEND_ERROR,err:t,fatal:!1};t.code===DOMException.QUOTA_EXCEEDED_ERR?e.details=o.ErrorDetails.BUFFER_FULL_ERROR:(n.appendError++,e.details=o.ErrorDetails.BUFFER_APPEND_ERROR,n.appendError>r.config.appendErrorMaxRetry&&(s.logger.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),e.fatal=!0)),r.trigger(i.Events.ERROR,e)}};u.append(E,d)},e.onBufferFlushing=function(t,e){var n=this,r=this.operationQueue,o=function(t){return{execute:n.removeExecutor.bind(n,t,e.startOffset,e.endOffset),onStart:function(){},onComplete:function(){n.hls.trigger(i.Events.BUFFER_FLUSHED,{type:t})},onError:function(e){s.logger.warn("[buffer-controller]: Failed to remove from "+t+" SourceBuffer",e)}}};e.type?r.append(o(e.type),e.type):this.getSourceBufferTypes().forEach((function(t){r.append(o(t),t)}))},e.onFragParsed=function(t,e){var n=this,r=e.frag,o=e.part,a=[],u=o?o.elementaryStreams:r.elementaryStreams;u[l.ElementaryStreamTypes.AUDIOVIDEO]?a.push("audiovideo"):(u[l.ElementaryStreamTypes.AUDIO]&&a.push("audio"),u[l.ElementaryStreamTypes.VIDEO]&&a.push("video")),0===a.length&&s.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var t=self.performance.now();r.stats.buffering.end=t,o&&(o.stats.buffering.end=t);var e=o?o.stats:r.stats;n.hls.trigger(i.Events.FRAG_BUFFERED,{frag:r,part:o,stats:e,id:r.type})}),a)},e.onFragChanged=function(t,e){this.flushBackBuffer()},e.onBufferEos=function(t,e){var n=this;this.getSourceBufferTypes().reduce((function(t,r){var i=n.sourceBuffer[r];return e.type&&e.type!==r||i&&!i.ended&&(i.ended=!0,s.logger.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),t&&!(i&&!i.ended)}),!0)&&this.blockBuffers((function(){var t=n.mediaSource;t&&"open"===t.readyState&&t.endOfStream()}))},e.onLevelUpdated=function(t,e){var n=e.details;n.fragments.length&&(this.details=n,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},e.flushBackBuffer=function(){var t=this.hls,e=this.details,n=this.media,s=this.sourceBuffer;if(n&&null!==e){var o=this.getSourceBufferTypes();if(o.length){var u=e.live&&null!==t.config.liveBackBufferLength?t.config.liveBackBufferLength:t.config.backBufferLength;if(Object(r.isFiniteNumber)(u)&&!(u<0)){var l=n.currentTime,c=e.levelTargetDuration,d=Math.max(u,c),h=Math.floor(l/c)*c-d;o.forEach((function(n){var r=s[n];if(r){var o=a.BufferHelper.getBuffered(r);o.length>0&&h>o.start(0)&&(t.trigger(i.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),e.live&&t.trigger(i.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),t.trigger(i.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:n}))}}))}}}},e.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var t=this.details,e=this.hls,n=this.media,i=this.mediaSource,o=t.fragments[0].start+t.totalduration,a=n.duration,u=Object(r.isFiniteNumber)(i.duration)?i.duration:0;t.live&&e.config.liveDurationInfinity?(s.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),i.duration=1/0,this.updateSeekableRange(t)):(o>u&&o>a||!Object(r.isFiniteNumber)(a))&&(s.logger.log("[buffer-controller]: Updating Media Source duration to "+o.toFixed(3)),i.duration=o)}},e.updateSeekableRange=function(t){var e=this.mediaSource,n=t.fragments;if(n.length&&t.live&&null!=e&&e.setLiveSeekableRange){var r=Math.max(0,n[0].start),i=Math.max(r,r+t.totalduration);e.setLiveSeekableRange(r,i)}},e.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,e=this.operationQueue,n=this.pendingTracks,r=Object.keys(n).length;if(r&&!t||2===r){this.createSourceBuffers(n),this.pendingTracks={};var s=this.getSourceBufferTypes();if(0===s.length)return void this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});s.forEach((function(t){e.executeNext(t)}))}},e.createSourceBuffers=function(t){var e=this.sourceBuffer,n=this.mediaSource;if(!n)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var a in t)if(!e[a]){var u=t[a];if(!u)throw Error("source buffer exists for track "+a+", however track does not");var l=u.levelCodec||u.codec,c=u.container+";codecs="+l;s.logger.log("[buffer-controller]: creating sourceBuffer("+c+")");try{var d=e[a]=n.addSourceBuffer(c),h=a;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[a]={buffer:d,codec:l,container:u.container,levelCodec:u.levelCodec,id:u.id},r++}catch(t){s.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+t.message),this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,mimeType:c})}}r&&this.hls.trigger(i.Events.BUFFER_CREATED,{tracks:this.tracks})},e._onSBUpdateStart=function(t){this.operationQueue.current(t).onStart()},e._onSBUpdateEnd=function(t){var e=this.operationQueue;e.current(t).onComplete(),e.shiftAndExecuteNext(t)},e._onSBUpdateError=function(t,e){s.logger.error("[buffer-controller]: "+t+" SourceBuffer error",e),this.hls.trigger(i.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var n=this.operationQueue.current(t);n&&n.onError(e)},e.removeExecutor=function(t,e,n){var i=this.media,o=this.mediaSource,a=this.operationQueue,u=this.sourceBuffer[t];if(!i||!o||!u)return s.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),void a.shiftAndExecuteNext(t);var l=Object(r.isFiniteNumber)(i.duration)?i.duration:1/0,c=Object(r.isFiniteNumber)(o.duration)?o.duration:1/0,d=Math.max(0,e),h=Math.min(n,l,c);h>d?(s.logger.log("[buffer-controller]: Removing ["+d+","+h+"] from the "+t+" SourceBuffer"),console.assert(!u.updating,t+" sourceBuffer must not be updating"),u.remove(d,h)):a.shiftAndExecuteNext(t)},e.appendExecutor=function(t,e){var n=this.operationQueue,r=this.sourceBuffer[e];if(!r)return s.logger.warn("[buffer-controller]: Attempting to append to the "+e+" SourceBuffer, but it does not exist"),void n.shiftAndExecuteNext(e);r.ended=!1,console.assert(!r.updating,e+" sourceBuffer must not be updating"),r.appendBuffer(t)},e.blockBuffers=function(t,e){var n=this;if(void 0===e&&(e=this.getSourceBufferTypes()),!e.length)return s.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(t);var r=this.operationQueue,i=e.map((function(t){return r.appendBlocker(t)}));Promise.all(i).then((function(){t(),e.forEach((function(t){var e=n.sourceBuffer[t];e&&e.updating||r.shiftAndExecuteNext(t)}))}))},e.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},e.addBufferListener=function(t,e,n){var r=this.sourceBuffer[t];if(r){var i=n.bind(this,t);this.listeners[t].push({event:e,listener:i}),r.addEventListener(e,i)}},e.removeBufferListeners=function(t){var e=this.sourceBuffer[t];e&&this.listeners[t].forEach((function(t){e.removeEventListener(t.event,t.listener)}))},t}()},"./src/controller/buffer-operation-queue.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return i}));var r=n("./src/utils/logger.ts"),i=function(){function t(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}var e=t.prototype;return e.append=function(t,e){var n=this.queues[e];n.push(t),1===n.length&&this.buffers[e]&&this.executeNext(e)},e.insertAbort=function(t,e){this.queues[e].unshift(t),this.executeNext(e)},e.appendBlocker=function(t){var e,n=new Promise((function(t){e=t})),r={execute:e,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,t),n},e.executeNext=function(t){var e=this.buffers,n=this.queues,i=e[t],s=n[t];if(s.length){var o=s[0];try{o.execute()}catch(e){r.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(e),i&&i.updating||(s.shift(),this.executeNext(t))}}},e.shiftAndExecuteNext=function(t){this.queues[t].shift(),this.executeNext(t)},e.current=function(t){return this.queues[t][0]},t}()},"./src/controller/cap-level-controller.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/events.ts");function i(t,e){for(var n=0;n0&&this.mediaWidth>0){var t=this.hls.levels;if(t.length){var e=this.hls;e.autoLevelCapping=this.getMaxLevel(t.length-1),e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}},o.getMaxLevel=function(e){var n=this,r=this.hls.levels;if(!r.length)return-1;var i=r.filter((function(r,i){return t.isLevelAllowed(i,n.restrictedLevels)&&i<=e}));return this.clientRect=null,t.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)},o.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())},o.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},o.getDimensions=function(){if(this.clientRect)return this.clientRect;var t=this.media,e={width:0,height:0};if(t){var n=t.getBoundingClientRect();e.width=n.width,e.height=n.height,e.width||e.height||(e.width=n.right-n.left||t.width||0,e.height=n.bottom-n.top||t.height||0)}return this.clientRect=e,e},t.isLevelAllowed=function(t,e){return void 0===e&&(e=[]),-1===e.indexOf(t)},t.getMaxLevelByMediaSize=function(t,e,n){if(!t||!t.length)return-1;for(var r,i,s=t.length-1,o=0;o=e||a.height>=n)&&(r=a,!(i=t[o+1])||r.width!==i.width||r.height!==i.height)){s=o;break}}return s},e=t,s=[{key:"contentScaleFactor",get:function(){var t=1;try{t=self.devicePixelRatio}catch(t){}return t}}],(n=[{key:"mediaWidth",get:function(){return this.getDimensions().width*t.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*t.contentScaleFactor}}])&&i(e.prototype,n),s&&i(e,s),t}();e.default=s},"./src/controller/cmcd-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return h}));var r=n("./src/events.ts"),i=n("./src/types/cmcd.ts"),s=n("./src/utils/buffer-helper.ts"),o=n("./src/utils/logger.ts");function a(t,e){for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[r++]}}}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 c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nn&&(n=s.bitrate)}return n>0?n:NaN},e.getBufferLength=function(t){var e=this.hls.media,n=t===i.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return n&&e?1e3*s.BufferHelper.bufferInfo(n,e.currentTime,this.config.maxBufferHole).len:NaN},e.createPlaylistLoader=function(){var t=this.config.pLoader,e=this.applyPlaylistData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,n,r){e(t),this.loader.load(t,n,r)},u(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},e.createFragmentLoader=function(){var t=this.config.fLoader,e=this.applyFragmentData,n=t||this.config.loader;return function(){function t(t){this.loader=void 0,this.loader=new n(t)}var r=t.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(t,n,r){e(t),this.loader.load(t,n,r)},u(t,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),t}()},t.uuid=function(){var t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.substr(e.lastIndexOf("/")+1)},t.serialize=function(t){for(var e,n=[],r=function(t){return!Number.isNaN(t)&&null!=t&&""!==t&&!1!==t},i=function(t){return Math.round(t)},s=function(t){return 100*i(t/100)},o={br:i,d:i,bl:s,dl:s,mtp:s,nor:function(t){return encodeURIComponent(t)},rtp:s,tb:i},a=l(Object.keys(t||{}).sort());!(e=a()).done;){var u=e.value,c=t[u];if(r(c)&&!("v"===u&&1===c||"pr"==u&&1===c)){var d=o[u];d&&(c=d(c));var h=typeof c,p=void 0;p="ot"===u||"sf"===u||"st"===u?u+"="+c:"boolean"===h?u:"number"===h?u+"="+c:u+"="+JSON.stringify(c),n.push(p)}}return n.join(",")},t.toHeaders=function(e){for(var n={},r=["Object","Request","Session","Status"],i=[{},{},{},{}],s={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},o=0,a=Object.keys(e);o3)return void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var l=3-this._requestLicenseFailureCount+1;s.logger.warn("Retrying license request, "+l+" attempts left"),this._requestLicense(n,o)}},l._generateLicenseRequestChallenge=function(t,e){if(t.mediaKeySystemDomain===o.KeySystems.WIDEVINE)return e;throw new Error("unsupported key-system: "+t.mediaKeySystemDomain)},l._requestLicense=function(t,e){s.logger.log("Requesting content license for key-system");var n=this._mediaKeysList[0];if(!n)return s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var o=this.getLicenseServerUrl(n.mediaKeySystemDomain),a=this._createLicenseXhr(o,t,e);s.logger.log("Sending license request to URL: "+o);var u=this._generateLicenseRequestChallenge(n,t);a.send(u)}catch(t){s.logger.error("Failure requesting DRM license: "+t),this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.KEY_SYSTEM_ERROR,details:i.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(t,e){if(this._emeEnabled){var n=e.media;this._media=n,n.addEventListener("encrypted",this._onMediaEncrypted)}},l.onMediaDetached=function(){var t=this._media,e=this._mediaKeysList;t&&(t.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(e.map((function(t){if(t.mediaKeysSession)return t.mediaKeysSession.close().catch((function(){}))}))).then((function(){return t.setMediaKeys(null)})).catch((function(){})))},l.onManifestParsed=function(t,e){if(this._emeEnabled){var n=e.levels.map((function(t){return t.audioCodec})).filter((function(t){return!!t})),r=e.levels.map((function(t){return t.videoCodec})).filter((function(t){return!!t}));this._attemptKeySystemAccess(o.KeySystems.WIDEVINE,n,r)}},e=t,(n=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&a(e.prototype,n),u&&a(e,u),t}();e.default=u},"./src/controller/fps-controller.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/events.ts"),i=n("./src/utils/logger.ts"),s=function(){function t(t){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=t,this.registerListeners()}var e=t.prototype;return e.setStreamController=function(t){this.streamController=t},e.registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},e.unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching)},e.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},e.onMediaAttaching=function(t,e){var n=this.hls.config;if(n.capLevelOnFPSDrop){var r=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}},e.checkFPS=function(t,e,n){var s=performance.now();if(e){if(this.lastTime){var o=s-this.lastTime,a=n-this.lastDroppedFrames,u=e-this.lastDecodedFrames,l=1e3*a/o,c=this.hls;if(c.trigger(r.Events.FPS_DROP,{currentDropped:a,currentDecoded:u,totalDroppedFrames:n}),l>0&&a>c.config.fpsDroppedMonitoringThreshold*u){var d=c.currentLevel;i.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(r.Events.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=n,this.lastDecodedFrames=e}},e.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},t}();e.default=s},"./src/controller/fragment-finders.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"findFragmentByPDT",(function(){return s})),n.d(e,"findFragmentByPTS",(function(){return o})),n.d(e,"fragmentWithinToleranceTest",(function(){return a})),n.d(e,"pdtWithinToleranceTest",(function(){return u})),n.d(e,"findFragWithCC",(function(){return l}));var r=n("./src/polyfills/number.ts"),i=n("./src/utils/binary-search.ts");function s(t,e,n){if(null===e||!Array.isArray(t)||!t.length||!Object(r.isFiniteNumber)(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;n=n||0;for(var i=0;it&&n.start?-1:0}function u(t,e,n){var r=1e3*Math.min(e,n.duration+(n.deltaPTS?n.deltaPTS:0));return(n.endProgramDateTime||0)-r>t}function l(t,e){return i.default.search(t,(function(t){return t.cce?-1:0}))}},"./src/controller/fragment-tracker.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"FragmentState",(function(){return r})),n.d(e,"FragmentTracker",(function(){return o}));var r,i=n("./src/events.ts"),s=n("./src/types/loader.ts");!function(t){t.NOT_LOADED="NOT_LOADED",t.BACKTRACKED="BACKTRACKED",t.APPENDING="APPENDING",t.PARTIAL="PARTIAL",t.OK="OK"}(r||(r={}));var o=function(){function t(t){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=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){var t=this.hls;t.on(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.on(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.on(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e._unregisterListeners=function(){var t=this.hls;t.off(i.Events.BUFFER_APPENDED,this.onBufferAppended,this),t.off(i.Events.FRAG_BUFFERED,this.onFragBuffered,this),t.off(i.Events.FRAG_LOADED,this.onFragLoaded,this)},e.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},e.getAppendedFrag=function(t,e){if(e===s.PlaylistLevelType.MAIN){var n=this.activeFragment,r=this.activeParts;if(!n)return null;if(r)for(var i=r.length;i--;){var o=r[i],a=o?o.end:n.appendedPTS;if(o.start<=t&&void 0!==a&&t<=a)return i>9&&(this.activeParts=r.slice(i-9)),o}else if(n.start<=t&&void 0!==n.appendedPTS&&t<=n.appendedPTS)return n}return this.getBufferedFrag(t,e)},e.getBufferedFrag=function(t,e){for(var n=this.fragments,r=Object.keys(n),i=r.length;i--;){var s=n[r[i]];if((null==s?void 0:s.body.type)===e&&s.buffered){var o=s.body;if(o.start<=t&&t<=o.end)return o}}return null},e.detectEvictedFragments=function(t,e,n){var r=this;Object.keys(this.fragments).forEach((function(i){var s=r.fragments[i];if(s)if(s.buffered){var o=s.range[t];o&&o.time.some((function(t){var n=!r.isTimeBuffered(t.startPTS,t.endPTS,e);return n&&r.removeFragment(s.body),n}))}else s.body.type===n&&r.removeFragment(s.body)}))},e.detectPartialFragments=function(t){var e=this,n=this.timeRanges,r=t.frag,i=t.part;if(n&&"initSegment"!==r.sn){var s=u(r),o=this.fragments[s];o&&(Object.keys(n).forEach((function(t){var s=r.elementaryStreams[t];if(s){var a=n[t],u=null!==i||!0===s.partial;o.range[t]=e.getBufferedTimes(r,i,u,a)}})),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body))}},e.fragBuffered=function(t){var e=u(t),n=this.fragments[e];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},e.getBufferedTimes=function(t,e,n,r){for(var i={time:[],partial:n},s=e?e.start:t.start,o=e?e.end:t.end,a=t.minEndPTS||o,u=t.maxStartPTS||s,l=0;l=c&&a<=d){i.time.push({startPTS:Math.max(s,r.start(l)),endPTS:Math.min(o,r.end(l))});break}if(sc)i.partial=!0,i.time.push({startPTS:Math.max(s,r.start(l)),endPTS:Math.min(o,r.end(l))});else if(o<=c)break}return i},e.getPartialFragment=function(t){var e,n,r,i=null,s=0,o=this.bufferPadding,u=this.fragments;return Object.keys(u).forEach((function(l){var c=u[l];c&&a(c)&&(n=c.body.start-o,r=c.body.end+o,t>=n&&t<=r&&(e=Math.min(t-n,r-t),s<=e&&(i=c.body,s=e)))})),i},e.getState=function(t){var e=u(t),n=this.fragments[e];return n?n.buffered?a(n)?r.PARTIAL:r.OK:n.backtrack?r.BACKTRACKED:r.APPENDING:r.NOT_LOADED},e.backtrack=function(t,e){var n=u(t),r=this.fragments[n];if(!r||r.backtrack)return null;var i=r.backtrack=e||r.loaded;return r.loaded=null,i},e.getBacktrackData=function(t){var e=u(t),n=this.fragments[e];if(n){var r,i=n.backtrack;if(null!=i&&null!==(r=i.payload)&&void 0!==r&&r.byteLength)return i;this.removeFragment(t)}return null},e.isTimeBuffered=function(t,e,n){for(var r,i,s=0;s=r&&e<=i)return!0;if(e<=r)return!1}return!1},e.onFragLoaded=function(t,e){var n=e.frag,r=e.part;if("initSegment"!==n.sn&&!n.bitrateTest&&!r){var i=u(n);this.fragments[i]={body:n,loaded:e,backtrack:null,buffered:!1,range:Object.create(null)}}},e.onBufferAppended=function(t,e){var n=this,r=e.frag,i=e.part,o=e.timeRanges;if(r.type===s.PlaylistLevelType.MAIN)if(this.activeFragment=r,i){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(i)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach((function(t){var e=o[t];if(n.detectEvictedFragments(t,e),!i)for(var s=0;st&&r.removeFragment(o)}}))},e.removeFragment=function(t){var e=u(t);t.stats.loaded=0,t.clearElementaryStreamInfo(),delete this.fragments[e]},e.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},t}();function a(t){var e,n;return t.buffered&&((null===(e=t.range.video)||void 0===e?void 0:e.partial)||(null===(n=t.range.audio)||void 0===n?void 0:n.partial))}function u(t){return t.type+"_"+t.level+"_"+t.urlId+"_"+t.sn}},"./src/controller/gap-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"STALL_MINIMUM_DURATION_MS",(function(){return a})),n.d(e,"MAX_START_GAP_JUMP",(function(){return u})),n.d(e,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return l})),n.d(e,"SKIP_BUFFER_RANGE_START",(function(){return c})),n.d(e,"default",(function(){return d}));var r=n("./src/utils/buffer-helper.ts"),i=n("./src/errors.ts"),s=n("./src/events.ts"),o=n("./src/utils/logger.ts"),a=250,u=2,l=.1,c=.05,d=function(){function t(t,e,n,r){this.config=void 0,this.media=void 0,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=t,this.media=e,this.fragmentTracker=n,this.hls=r}var e=t.prototype;return e.destroy=function(){this.hls=this.fragmentTracker=this.media=null},e.poll=function(t){var e=this.config,n=this.media,i=this.stalled,s=n.currentTime,l=n.seeking,c=this.seeking&&!l,d=!this.seeking&&l;if(this.seeking=l,s===t){if((d||c)&&(this.stalled=null),!n.paused&&!n.ended&&0!==n.playbackRate&&r.BufferHelper.getBuffered(n).length){var h=r.BufferHelper.bufferInfo(n,s,0),p=h.len>0,f=h.nextStart||0;if(p||f){if(l){var m=h.len>u,g=!f||f-s>u&&!this.fragmentTracker.getPartialFragment(s);if(m||g)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var v,y=Math.max(f,h.start||0)-s,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,b=(null==_||null===(v=_.details)||void 0===v?void 0:v.live)?2*_.details.targetduration:u;if(y>0&&y<=b)return void this._trySkipBufferHole(null)}var E=self.performance.now();if(null!==i){var w=E-i;!l&&w>=a&&this._reportStall(h.len);var S=r.BufferHelper.bufferInfo(n,s,e.maxBufferHole);this._tryFixBufferStall(S,w)}else this.stalled=E}}}else if(this.moved=!0,null!==i){if(this.stallReported){var A=self.performance.now()-i;o.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},e._tryFixBufferStall=function(t,e){var n=this.config,r=this.fragmentTracker,i=this.media.currentTime,s=r.getPartialFragment(i);s&&this._trySkipBufferHole(s)||t.len>n.maxBufferHole&&e>1e3*n.highBufferWatchdogPeriod&&(o.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},e._reportStall=function(t){var e=this.hls,n=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+n.currentTime+" due to low buffer (buffer="+t+")"),e.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:t}))},e._trySkipBufferHole=function(t){for(var e=this.config,n=this.hls,a=this.media,u=a.currentTime,d=0,h=r.BufferHelper.getBuffered(a),p=0;p=d&&u.05&&this.forwardBufferLength>1){var l=Math.min(2,Math.max(1,s)),c=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;t.playbackRate=Math.min(l,Math.max(1,c))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}}}}},u.estimateLiveEdge=function(){var t=this.levelDetails;return null===t?null:t.edge+t.age},u.computeLatency=function(){var t=this.estimateLiveEdge();return null===t?null:t-this.currentTime},e=t,(n=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(null===t)return null;var e=t.holdBack,n=t.partHoldBack,r=t.targetduration,i=this.config,s=i.liveSyncDuration,o=i.liveSyncDurationCount,a=i.lowLatencyMode,u=this.hls.userConfig,l=a&&n||e;(u.liveSyncDuration||u.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:o*r);var c=r;return l+Math.min(1*this.stallCount,c)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,n=this.levelDetails;if(null===t||null===e||null===n)return null;var r=n.edge,i=t-e-this.edgeStalled,s=r-n.totalduration,o=r-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(s,i),o)}},{key:"drift",get:function(){var t=this.levelDetails;return null===t?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(null===t)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var n=t.buffered.length;return n?t.buffered.end(n-1):e.edge-this.currentTime}}])&&o(e.prototype,n),a&&o(e,a),t}()},"./src/controller/level-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return f}));var r=n("./src/types/level.ts"),i=n("./src/events.ts"),s=n("./src/errors.ts"),o=n("./src/utils/codecs.ts"),a=n("./src/controller/level-helper.ts"),u=n("./src/controller/base-playlist-controller.ts"),l=n("./src/types/loader.ts");function c(){return c=Object.assign||function(t){for(var e=1;e0){n=l[0].bitrate,l.sort((function(t,e){return t.bitrate-e.bitrate})),this._levels=l;for(var v=0;vthis.hls.config.fragLoadingMaxRetry&&(o=n.frag.level)):o=n.frag.level}break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(u=!1),o=r.level),a=!0;break;case s.ErrorDetails.REMUX_ALLOC_ERROR:o=n.level,a=!0}void 0!==o&&this.recoverLevel(n,o,a,u)}}},v.recoverLevel=function(t,e,n,r){var i=t.details,s=this._levels[e];if(s.loadError++,n){if(!this.retryLoadingOrFail(t))return void(this.currentLevelIndex=-1);t.levelRetry=!0}if(r){var o=s.url.length;if(o>1&&s.loadError1){var r=(e.urlId+1)%n;this.warn("Switching to redundant URL-id "+r),this._levels.forEach((function(t){t.urlId=r})),this.level=t}},v.onFragLoaded=function(t,e){var n=e.frag;if(void 0!==n&&n.type===l.PlaylistLevelType.MAIN){var r=this._levels[n.level];void 0!==r&&(r.fragmentError=0,r.loadError=0)}},v.onLevelLoaded=function(t,e){var n,r,i=e.level,s=e.details,o=this._levels[i];if(!o)return this.warn("Invalid level index "+i),void(null!==(r=e.deliveryDirectives)&&void 0!==r&&r.skip&&(s.deltaUpdateFailed=!0));i===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(i,e,o.details)):null!==(n=e.deliveryDirectives)&&void 0!==n&&n.skip&&(s.deltaUpdateFailed=!0)},v.onAudioTrackSwitched=function(t,e){var n=this.hls.levels[this.currentLevelIndex];if(n&&n.audioGroupIds){for(var r=-1,i=this.hls.audioTracks[e.id].groupId,s=0;s0){var r=n.urlId,s=n.url[r];if(t)try{s=t.addDirectives(s)}catch(t){this.warn("Could not construct new URL with HLS Delivery Directives: "+t)}this.log("Attempt loading level index "+e+(t?" at sn "+t.msn+" part "+t.part:"")+" with URL-id "+r+" "+s),this.clearTimer(),this.hls.trigger(i.Events.LEVEL_LOADING,{url:s,level:e,id:r,deliveryDirectives:t||null})}},v.removeLevel=function(t,e){var n=function(t,n){return n!==e},r=this._levels.filter((function(r,i){return i!==t||r.url.length>1&&void 0!==e&&(r.url=r.url.filter(n),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(n)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(n)),r.urlId=0,!0)})).map((function(t,e){var n=t.details;return null!=n&&n.fragments&&n.fragments.forEach((function(t){t.level=e})),t}));this._levels=r,this.hls.trigger(i.Events.LEVELS_UPDATED,{levels:r})},f=u,(m=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(t){var e,n=this._levels;if(0!==n.length&&(this.currentLevelIndex!==t||null===(e=n[t])||void 0===e||!e.details)){if(t<0||t>=n.length){var r=t<0;if(this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.LEVEL_SWITCH_ERROR,level:t,fatal:r,reason:"invalid level idx"}),r)return;t=Math.min(t,n.length-1)}this.clearTimer();var o=this.currentLevelIndex,a=n[o],u=n[t];this.log("switching to level "+t+" from "+o),this.currentLevelIndex=t;var l=c({},u,{level:t,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete l._urlId,this.hls.trigger(i.Events.LEVEL_SWITCHING,l);var d=u.details;if(!d||d.live){var h=this.switchParams(u.uri,null==a?void 0:a.details);this.loadPlaylist(h)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(t){this._firstLevel=t}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var t=this.hls.config.startLevel;return void 0!==t?t:this._firstLevel}return this._startLevel},set:function(t){this._startLevel=t}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}}])&&d(f.prototype,m),g&&d(f,g),u}(u.default)},"./src/controller/level-helper.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"addGroupId",(function(){return s})),n.d(e,"assignTrackIdsByGroup",(function(){return o})),n.d(e,"updatePTS",(function(){return a})),n.d(e,"updateFragPTSDTS",(function(){return l})),n.d(e,"mergeDetails",(function(){return c})),n.d(e,"mapPartIntersection",(function(){return d})),n.d(e,"mapFragmentIntersection",(function(){return h})),n.d(e,"adjustSliding",(function(){return p})),n.d(e,"addSliding",(function(){return f})),n.d(e,"computeReloadInterval",(function(){return m})),n.d(e,"getFragmentWithSN",(function(){return g})),n.d(e,"getPartWith",(function(){return v}));var r=n("./src/polyfills/number.ts"),i=n("./src/utils/logger.ts");function s(t,e,n){switch(e){case"audio":t.audioGroupIds||(t.audioGroupIds=[]),t.audioGroupIds.push(n);break;case"text":t.textGroupIds||(t.textGroupIds=[]),t.textGroupIds.push(n)}}function o(t){var e={};t.forEach((function(t){var n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++}))}function a(t,e,n){u(t[e],t[n])}function u(t,e){var n=e.startPTS;if(Object(r.isFiniteNumber)(n)){var i,s=0;e.sn>t.sn?(s=n-t.start,i=t):(s=t.start-n,i=e),i.duration!==s&&(i.duration=s)}else e.sn>t.sn?t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration:e.start=Math.max(t.start-e.duration,0)}function l(t,e,n,s,o,a){s-n<=0&&(i.logger.warn("Fragment should have a positive duration",e),s=n+e.duration,a=o+e.duration);var l=n,c=s,d=e.startPTS,h=e.endPTS;if(Object(r.isFiniteNumber)(d)){var p=Math.abs(d-n);Object(r.isFiniteNumber)(e.deltaPTS)?e.deltaPTS=Math.max(p,e.deltaPTS):e.deltaPTS=p,l=Math.max(n,d),n=Math.min(n,d),o=Math.min(o,e.startDTS),c=Math.min(s,h),s=Math.max(s,h),a=Math.max(a,e.endDTS)}e.duration=s-n;var f=n-e.start;e.appendedPTS=s,e.start=e.startPTS=n,e.maxStartPTS=l,e.startDTS=o,e.endPTS=s,e.minEndPTS=c,e.endDTS=a;var m,g=e.sn;if(!t||gt.endSN)return 0;var v=g-t.startSN,y=t.fragments;for(y[v]=e,m=v;m>0;m--)u(y[m],y[m-1]);for(m=v;m=0;o--){var a=s[o].initSegment;if(a){n=a;break}}t.fragmentHint&&delete t.fragmentHint.endPTS;var u,c=0;if(h(t,e,(function(t,i){var s;t.relurl&&(c=t.cc-i.cc),Object(r.isFiniteNumber)(t.startPTS)&&Object(r.isFiniteNumber)(t.endPTS)&&(i.start=i.startPTS=t.startPTS,i.startDTS=t.startDTS,i.appendedPTS=t.appendedPTS,i.maxStartPTS=t.maxStartPTS,i.endPTS=t.endPTS,i.endDTS=t.endDTS,i.minEndPTS=t.minEndPTS,i.duration=t.endPTS-t.startPTS,i.duration&&(u=i),e.PTSKnown=e.alignedSliding=!0),i.elementaryStreams=t.elementaryStreams,i.loader=t.loader,i.stats=t.stats,i.urlId=t.urlId,t.initSegment?(i.initSegment=t.initSegment,n=t.initSegment):i.initSegment&&i.initSegment.relurl!=(null===(s=n)||void 0===s?void 0:s.relurl)||(i.initSegment=n)})),e.skippedSegments&&(e.deltaUpdateFailed=e.fragments.some((function(t){return!t})),e.deltaUpdateFailed)){i.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var f=e.skippedSegments;f--;)e.fragments.shift();e.startSN=e.fragments[0].sn,e.startCC=e.fragments[0].cc}var m=e.fragments;if(c){i.logger.warn("discontinuity sliding from playlist, take drift into account");for(var g=0;g=r.length||f(e,r[n].start)}function f(t,e){if(e){for(var n=t.fragments,r=t.skippedSegments;r0&&s<3*r,a=e.loading.end-e.loading.start,u=t.availabilityDelay;if(!1===t.updated)if(o){var l=333*t.misses;n=Math.max(Math.min(i,2*a),l),t.availabilityDelay=(t.availabilityDelay||0)+n}else n=i;else o?(u=Math.min(u||r/2,s),t.availabilityDelay=u,n=u+r-s):n=r-a;return Math.round(n)}function g(t,e,n){if(!t||!t.details)return null;var r=t.details,i=r.fragments[e-r.startSN];return i||((i=r.fragmentHint)&&i.sn===e?i:e0&&-1===t&&(this.log("Override startPosition with lastCurrentTime @"+e.toFixed(3)),t=e),this.state=i.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=i.State.STOPPED},w.stopLoad=function(){this._forceStartLoad=!1,t.prototype.stopLoad.call(this)},w.doTick=function(){switch(this.state){case i.State.IDLE:this.doTickIdle();break;case i.State.WAITING_LEVEL:var t,e=this.levels,n=this.level,r=null==e||null===(t=e[n])||void 0===t?void 0:t.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=i.State.IDLE;break}break;case i.State.FRAG_LOADING_WAITING_RETRY:var s,o=self.performance.now(),a=this.retryDate;(!a||o>=a||null!==(s=this.media)&&void 0!==s&&s.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=i.State.IDLE)}this.onTickEnd()},w.onTickEnd=function(){t.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},w.doTickIdle=function(){var t,e,n=this.hls,r=this.levelLastLoaded,s=this.levels,a=this.media,d=n.config,h=n.nextLoadLevel;if(null!==r&&(a||!this.startFragRequested&&d.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&s&&s[h]){var p=s[h];this.level=n.nextLoadLevel=h;var f=p.details;if(!f||this.state===i.State.WAITING_LEVEL||f.live&&this.levelLastLoaded!==h)this.state=i.State.WAITING_LEVEL;else{var m=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:a,l.PlaylistLevelType.MAIN);if(null!==m&&!(m.len>=this.getMaxBufferLength(p.maxBitrate))){if(this._streamEnded(m,f)){var g={};return this.altAudio&&(g.type="video"),this.hls.trigger(o.Events.BUFFER_EOS,g),void(this.state=i.State.ENDED)}var v=m.end,y=this.getNextFragment(v,f);if(this.couldBacktrack&&!this.fragPrevious&&y&&"initSegment"!==y.sn){var _=y.sn-f.startSN;_>1&&(y=f.fragments[_-1],this.fragmentTracker.removeFragment(y))}if(y&&this.fragmentTracker.getState(y)===u.FragmentState.OK&&this.nextLoadPosition>v){var b=this.audioOnly&&!this.altAudio?c.ElementaryStreamTypes.AUDIO:c.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(a,b,l.PlaylistLevelType.MAIN),y=this.getNextFragment(this.nextLoadPosition,f)}y&&(!y.initSegment||y.initSegment.data||this.bitrateTest||(y=y.initSegment),"identity"!==(null===(t=y.decryptdata)||void 0===t?void 0:t.keyFormat)||null!==(e=y.decryptdata)&&void 0!==e&&e.key?this.loadFragment(y,f,v):this.loadKey(y,f))}}}},w.loadFragment=function(e,n,r){var i,s=this.fragmentTracker.getState(e);if(this.fragCurrent=e,s===u.FragmentState.BACKTRACKED){var o=this.fragmentTracker.getBacktrackData(e);if(o)return this._handleFragmentLoadProgress(o),void this._handleFragmentLoadComplete(o);s=u.FragmentState.NOT_LOADED}s===u.FragmentState.NOT_LOADED||s===u.FragmentState.PARTIAL?"initSegment"===e.sn?this._loadInitSegment(e):this.bitrateTest?(e.bitrateTest=!0,this.log("Fragment "+e.sn+" of level "+e.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(e)):(this.startFragRequested=!0,t.prototype.loadFragment.call(this,e,n,r)):s===u.FragmentState.APPENDING?this.reduceMaxBufferLength(e.duration)&&this.fragmentTracker.removeFragment(e):0===(null===(i=this.media)||void 0===i?void 0:i.buffered.length)&&this.fragmentTracker.removeAllFragments()},w.getAppendedFrag=function(t){var e=this.fragmentTracker.getAppendedFrag(t,l.PlaylistLevelType.MAIN);return e&&"fragment"in e?e.fragment:e},w.getBufferedFrag=function(t){return this.fragmentTracker.getBufferedFrag(t,l.PlaylistLevelType.MAIN)},w.followingBufferedFrag=function(t){return t?this.getBufferedFrag(t.end+.5):null},w.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},w.nextLevelSwitch=function(){var t=this.levels,e=this.media;if(null!=e&&e.readyState){var n,r=this.getAppendedFrag(e.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!e.paused&&t){var i=t[this.hls.nextLoadLevel],s=this.fragLastKbps;n=s&&this.fragCurrent?this.fragCurrent.duration*i.maxBitrate/(1e3*s)+1:0}else n=0;var o=this.getBufferedFrag(e.currentTime+n);if(o){var a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();var u=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,c=Math.max(o.end,u+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,.5*l),.75*l));this.flushMainBuffer(c,Number.POSITIVE_INFINITY)}}}},w.abortCurrentFrag=function(){var t=this.fragCurrent;this.fragCurrent=null,null!=t&&t.loader&&t.loader.abort(),this.state===i.State.KEY_LOADING&&(this.state=i.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},w.flushMainBuffer=function(e,n){t.prototype.flushMainBuffer.call(this,e,n,this.altAudio?"video":null)},w.onMediaAttached=function(e,n){t.prototype.onMediaAttached.call(this,e,n);var r=n.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new p.default(this.config,r,this.fragmentTracker,this.hls)},w.onMediaDetaching=function(){var e=this.media;e&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),t.prototype.onMediaDetaching.call(this)},w.onMediaPlaying=function(){this.tick()},w.onMediaSeeked=function(){var t=this.media,e=t?t.currentTime:null;Object(r.isFiniteNumber)(e)&&this.log("Media seeked to "+e.toFixed(3)),this.tick()},w.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},w.onManifestParsed=function(t,e){var n,r=!1,i=!1;e.levels.forEach((function(t){(n=t.audioCodec)&&(-1!==n.indexOf("mp4a.40.2")&&(r=!0),-1!==n.indexOf("mp4a.40.5")&&(i=!0))})),this.audioCodecSwitch=r&&i&&!Object(s.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1},w.onLevelLoading=function(t,e){var n=this.levels;if(n&&this.state===i.State.IDLE){var r=n[e.level];(!r.details||r.details.live&&this.levelLastLoaded!==e.level||this.waitForCdnTuneIn(r.details))&&(this.state=i.State.WAITING_LEVEL)}},w.onLevelLoaded=function(t,e){var n,r=this.levels,s=e.level,a=e.details,u=a.totalduration;if(r){this.log("Level "+s+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+u);var l=this.fragCurrent;!l||this.state!==i.State.FRAG_LOADING&&this.state!==i.State.FRAG_LOADING_WAITING_RETRY||l.level!==e.level&&l.loader&&(this.state=i.State.IDLE,l.loader.abort());var c=r[s],d=0;if(a.live||null!==(n=c.details)&&void 0!==n&&n.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;d=this.alignPlaylists(a,c.details)}if(c.details=a,this.levelLastLoaded=s,this.hls.trigger(o.Events.LEVEL_UPDATED,{details:a,level:s}),this.state===i.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=i.State.IDLE}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,d),this.tick()}else this.warn("Levels were reset while loading level "+s)},w._handleFragmentLoadProgress=function(t){var e,n=t.frag,r=t.part,i=t.payload,s=this.levels;if(s){var o=s[n.level],a=o.details;if(a){var u=o.videoCodec,c=a.PTSKnown||!a.live,p=null===(e=n.initSegment)||void 0===e?void 0:e.data,f=this._getAudioCodec(o),m=this.transmuxer=this.transmuxer||new d.default(this.hls,l.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=r?r.index:-1,v=-1!==g,y=new h.ChunkMetadata(n.level,n.sn,n.stats.chunkCount,i.byteLength,g,v),_=this.initPTS[n.cc];m.push(i,p,f,u,n,r,a.totalduration,c,y,_)}else this.warn("Dropping fragment "+n.sn+" of level "+n.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+n.sn+" of level "+n.level+" will not be buffered")},w.onAudioTrackSwitching=function(t,e){var n=this.altAudio,r=!!e.url,i=e.id;if(!r){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;n&&a.trigger(o.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:i})}},w.onAudioTrackSwitched=function(t,e){var n=e.id,r=!!this.hls.audioTracks[n].url;if(r){var i=this.videoBuffer;i&&this.mediaBuffer!==i&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=i)}this.altAudio=r,this.tick()},w.onBufferCreated=function(t,e){var n,r,i=e.tracks,s=!1;for(var o in i){var a=i[o];if("main"===a.id){if(r=o,n=a,"video"===o){var u=i[o];u&&(this.videoBuffer=u.buffer)}}else s=!0}s&&n?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=n.buffer):this.mediaBuffer=this.media},w.onFragBuffered=function(t,e){var n=e.frag,r=e.part;if(!n||n.type===l.PlaylistLevelType.MAIN){if(this.fragContextChanged(n))return this.warn("Fragment "+n.sn+(r?" p: "+r.index:"")+" of level "+n.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===i.State.PARSED&&(this.state=i.State.IDLE));var s=r?r.stats:n.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==n.sn&&(this.fragPrevious=n),this.fragBufferedComplete(n,r)}},w.onError=function(t,e){switch(e.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(l.PlaylistLevelType.MAIN,e);break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==i.State.ERROR&&(e.fatal?(this.warn(""+e.details),this.state=i.State.ERROR):e.levelRetry||this.state!==i.State.WAITING_LEVEL||(this.state=i.State.IDLE));break;case f.ErrorDetails.BUFFER_FULL_ERROR:if("main"===e.parent&&(this.state===i.State.PARSING||this.state===i.State.PARSED)){var n=!0,r=this.getFwdBufferInfo(this.media,l.PlaylistLevelType.MAIN);r&&r.len>.5&&(n=!this.reduceMaxBufferLength(r.len)),n&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},w.checkBuffer=function(){var t=this.media,e=this.gapController;if(t&&e&&t.readyState){var n=a.BufferHelper.getBuffered(t);!this.loadedmetadata&&n.length?(this.loadedmetadata=!0,this.seekToStartPos()):e.poll(this.lastCurrentTime),this.lastCurrentTime=t.currentTime}},w.onFragLoadEmergencyAborted=function(){this.state=i.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},w.onBufferFlushed=function(t,e){var n=e.type;if(n!==c.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var r=(n===c.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,n,l.PlaylistLevelType.MAIN)}},w.onLevelsUpdated=function(t,e){this.levels=e.levels},w.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},w.seekToStartPos=function(){var t=this.media,e=t.currentTime,n=this.startPosition;if(n>=0&&e0&&(i1&&!1===t.seeking){var n=t.currentTime;if(a.BufferHelper.isBuffered(t,n)?e=this.getAppendedFrag(n):a.BufferHelper.isBuffered(t,n+.1)&&(e=this.getAppendedFrag(n+.1)),e){var r=this.fragPlaying,i=e.level;r&&e.sn===r.sn&&r.level===i&&e.urlId===r.urlId||(this.hls.trigger(o.Events.FRAG_CHANGED,{frag:e}),r&&r.level===i||this.hls.trigger(o.Events.LEVEL_SWITCHED,{level:i}),this.fragPlaying=e)}}},_=y,(b=[{key:"nextLevel",get:function(){var t=this.nextBufferedFrag;return t?t.level:-1}},{key:"currentLevel",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);if(e)return e.level}return-1}},{key:"nextBufferedFrag",get:function(){var t=this.media;if(t){var e=this.getAppendedFrag(t.currentTime);return this.followingBufferedFrag(e)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&g(_.prototype,b),E&&g(_,E),y}(i.default)},"./src/controller/subtitle-stream-controller.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"SubtitleStreamController",(function(){return m}));var r=n("./src/events.ts"),i=n("./src/utils/logger.ts"),s=n("./src/utils/buffer-helper.ts"),o=n("./src/controller/fragment-finders.ts"),a=n("./src/utils/discontinuities.ts"),u=n("./src/controller/level-helper.ts"),l=n("./src/controller/fragment-tracker.ts"),c=n("./src/controller/base-stream-controller.ts"),d=n("./src/types/loader.ts"),h=n("./src/types/level.ts");function p(t,e){for(var n=0;n=i[a].start&&o<=i[a].end){s=i[a];break}var u=n.start+n.duration;s?s.end=u:(s={start:o,end:u},i.push(s)),this.fragmentTracker.fragBuffered(n)}}},_.onBufferFlushing=function(t,e){var n=e.startOffset,r=e.endOffset;if(0===n&&r!==Number.POSITIVE_INFINITY){var i=this.currentTrackId,s=this.levels;if(!s.length||!s[i]||!s[i].details)return;var o=r-s[i].details.targetduration;if(o<=0)return;e.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(t){for(var e=0;e=l.length||i!==s)&&d){if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||null!==(n=d.details)&&void 0!==n&&n.live){var h=this.mainDetails;if(r.deltaUpdateFailed||!h)return;var p=h.fragments[0];d.details?0===this.alignPlaylists(r,d.details)&&p&&Object(u.addSliding)(r,p.start):r.hasProgramDateTime&&h.hasProgramDateTime?Object(a.alignMediaPlaylistByPDT)(r,h):p&&Object(u.addSliding)(r,p.start)}d.details=r,this.levelLastLoaded=i,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===c.State.IDLE&&(Object(o.findFragmentByPTS)(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),d.details=void 0))}}},_._handleFragmentLoadComplete=function(t){var e=t.frag,n=t.payload,i=e.decryptdata,s=this.hls;if(!this.fragContextChanged(e)&&n&&n.byteLength>0&&i&&i.key&&i.iv&&"AES-128"===i.method){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(n),i.key.buffer,i.iv.buffer).then((function(t){var n=performance.now();s.trigger(r.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:o,tdecrypt:n}})}))}},_.doTick=function(){if(this.media){if(this.state===c.State.IDLE){var t,e=this.currentTrackId,n=this.levels;if(!n.length||!n[e]||!n[e].details)return;var a=n[e].details,u=a.targetduration,d=this.config,h=this.media,p=s.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,h.currentTime-u,d.maxBufferHole),f=p.end;if(p.len>this.getMaxBufferLength()+u)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var m,g=a.fragments,v=g.length,y=a.edge,_=this.fragPrevious;if(f-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))},p.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},p.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),c(this.media.textTracks).forEach((function(t){Object(i.clearCurrentCues)(t)})),this.subtitleTrack=-1,this.media=null)},p.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},p.onManifestParsed=function(t,e){this.tracks=e.subtitleTracks},p.onSubtitleTrackLoaded=function(t,e){var n=e.id,r=e.details,i=this.trackId,s=this.tracksInGroup[i];if(s){var o=s.details;s.details=e.details,this.log("subtitle track "+n+" loaded ["+r.startSN+"-"+r.endSN+"]"),n===this.trackId&&(this.retryCount=0,this.playlistLoaded(n,e,o))}else this.warn("Invalid subtitle track id "+n)},p.onLevelLoading=function(t,e){this.switchLevel(e.level)},p.onLevelSwitching=function(t,e){this.switchLevel(e.level)},p.switchLevel=function(t){var e=this.hls.levels[t];if(null!=e&&e.textGroupIds){var n=e.textGroupIds[e.urlId];if(this.groupId!==n){var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,s=this.tracks.filter((function(t){return!n||t.groupId===n}));this.tracksInGroup=s;var o=this.findTrackId(null==i?void 0:i.name)||this.findTrackId();this.groupId=n;var a={subtitleTracks:s};this.log("Updating subtitle tracks, "+s.length+' track(s) found in "'+n+'" group-id'),this.hls.trigger(r.Events.SUBTITLE_TRACKS_UPDATED,a),-1!==o&&this.setSubtitleTrack(o,i)}}},p.findTrackId=function(t){for(var e=this.tracksInGroup,n=0;n=i.length)){this.clearTimer();var s=i[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,s){var o=s.id,a=s.groupId,u=void 0===a?"":a,l=s.name,c=s.type,d=s.url;this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:u,name:l,type:c,url:d});var h=this.switchParams(s.url,null==e?void 0:e.details);this.loadPlaylist(h)}else this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:t})}}else this.queuedDefaultTrack=t},p.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var t=-1,e=c(this.media.textTracks),n=0;n=0&&(h[0]=Math.min(h[0],e),h[1]=Math.max(h[1],n),c=!0,p/(n-e)>.5))return}if(c||s.push([e,n]),this.config.renderTextTracksNatively){var f=this.captionsTracks[t];this.Cues.newCue(f,e,n,r)}else{var m=this.Cues.newCue(null,e,n,r);this.hls.trigger(i.Events.CUES_PARSED,{type:"captions",cues:m,track:t})}},e.onInitPtsFound=function(t,e){var n=this,r=e.frag,s=e.id,o=e.initPTS,a=e.timescale,u=this.unparsedVttFrags;"main"===s&&(this.initPTS[r.cc]=o,this.timescale[r.cc]=a),u.length&&(this.unparsedVttFrags=[],u.forEach((function(t){n.onFragLoaded(i.Events.FRAG_LOADED,t)})))},e.getExistingTrack=function(t){var e=this.media;if(e)for(var n=0;n>>8^255&g^99,t[p]=g,e[g]=p;var v=h[p],y=h[v],_=h[y],b=257*h[g]^16843008*g;r[p]=b<<24|b>>>8,i[p]=b<<16|b>>>16,s[p]=b<<8|b>>>24,o[p]=b,b=16843009*_^65537*y^257*v^16843008*p,u[g]=b<<24|b>>>8,l[g]=b<<16|b>>>16,c[g]=b<<8|b>>>24,d[g]=b,p?(p=v^h[h[h[_^v]]],f^=h[h[f]]):p=f=1}},e.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),n=!0,r=0;r>>6);var f=(60&e[n+2])>>>2;if(!(f>p.length-1))return l=(1&e[n+2])<<2,l|=(192&e[n+3])>>>6,r.logger.log("manifest codec:"+o+", ADTS type:"+a+", samplingIndex:"+f),/firefox/i.test(d)?f>=6?(a=5,c=new Array(4),u=f-3):(a=2,c=new Array(2),u=f):-1!==d.indexOf("android")?(a=2,c=new Array(2),u=f):(a=5,c=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&f>=6?u=f-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(f>=6&&1===l||/vivaldi/i.test(d))||!o&&1===l)&&(a=2,c=new Array(2)),u=f)),c[0]=a<<3,c[0]|=(14&f)>>1,c[1]|=(1&f)<<7,c[1]|=l<<3,5===a&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:p[f],channelCount:l,codec:"mp4a.40."+a,manifestCodec:h};t.trigger(s.Events.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+f})}function a(t,e){return 255===t[e]&&240==(246&t[e+1])}function u(t,e){return 1&t[e+1]?7:9}function l(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function c(t,e){return e+5=t.length)return!1;var r=l(t,e);if(r<=n)return!1;var i=e+r;return i===t.length||d(t,i)}return!1}function f(t,e,n,i,s){if(!t.samplerate){var a=o(e,n,i,s);if(!a)return;t.config=a.config,t.samplerate=a.samplerate,t.channelCount=a.channelCount,t.codec=a.codec,t.manifestCodec=a.manifestCodec,r.logger.log("parsed codec:"+t.codec+", rate:"+a.samplerate+", channels:"+a.channelCount)}}function m(t){return 9216e4/t}function g(t,e,n,r,i){var s=u(t,e),o=l(t,e);if((o-=s)>0)return{headerLength:s,frameLength:o,stamp:n+r*i}}function v(t,e,n,r,i){var s=g(e,n,r,i,m(t.samplerate));if(s){var o,a=s.frameLength,u=s.headerLength,l=s.stamp,c=u+a,d=Math.max(0,n+c-e.length);d?(o=new Uint8Array(c-u)).set(e.subarray(n+u,e.length),0):o=e.subarray(n+u,n+c);var h={unit:o,pts:l};return d||t.samples.push(h),{sample:h,length:c,missing:d}}}},"./src/demux/base-audio-demuxer.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"initPTSFn",(function(){return l}));var r=n("./src/polyfills/number.ts"),i=n("./src/demux/id3.ts"),s=n("./src/demux/dummy-demuxed-track.ts"),o=n("./src/utils/mp4-tools.ts"),a=n("./src/utils/typed-array.ts"),u=function(){function t(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var e=t.prototype;return e.resetInitSegment=function(t,e,n){this._id3Track={type:"id3",id:0,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},e.resetTimeStamp=function(){},e.resetContiguity=function(){},e.canParse=function(t,e){return!1},e.appendFrame=function(t,e,n){},e.demux=function(t,e){this.cachedData&&(t=Object(o.appendUint8Array)(this.cachedData,t),this.cachedData=null);var n,r,u=i.getID3Data(t,0),c=u?u.length:0,d=this._audioTrack,h=this._id3Track,p=u?i.getTimeStamp(u):void 0,f=t.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=l(p,e)),u&&u.length>0&&h.samples.push({pts:this.initPTS,dts:this.initPTS,data:u}),r=this.initPTS;ct?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)>>3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},e.readBits=function(t){var e=Math.min(this.bitsAvailable,t),n=this.word>>>32-e;return t>32&&r.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),(e=t-e)>0&&this.bitsAvailable?n<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},e.skipUEG=function(){this.skipBits(1+this.skipLZ())},e.skipEG=function(){this.skipBits(1+this.skipLZ())},e.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},e.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},e.readBoolean=function(){return 1===this.readBits(1)},e.readUByte=function(){return this.readBits(8)},e.readUShort=function(){return this.readBits(16)},e.readUInt=function(){return this.readBits(32)},e.skipScalingList=function(t){for(var e=8,n=8,r=0;r0)return t.subarray(n,n+r)},a=function(t,e){var n=0;return n=(127&t[e])<<21,n|=(127&t[e+1])<<14,n|=(127&t[e+2])<<7,n|=127&t[e+3]},u=function(t,e){return i(t,e)&&a(t,e+6)+10<=t.length-e},l=function(t){for(var e=h(t),n=0;n>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(s);break;case 12:case 13:o=t[c++],l+=String.fromCharCode((31&s)<<6|63&o);break;case 14:o=t[c++],a=t[c++],l+=String.fromCharCode((15&s)<<12|(63&o)<<6|(63&a)<<0)}}return l},_={decodeTextFrame:m};function b(){return r||void 0===self.TextDecoder||(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/demux/base-audio-demuxer.ts"),i=n("./src/demux/id3.ts"),s=n("./src/utils/logger.ts"),o=n("./src/demux/mpegaudio.ts");function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}var u=function(t){var e,n;function r(){return t.apply(this,arguments)||this}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,a(e,n);var u=r.prototype;return u.resetInitSegment=function(e,n,r){t.prototype.resetInitSegment.call(this,e,n,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:0,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(t){if(!t)return!1;for(var e=(i.getID3Data(t,0)||[]).length,n=t.length;e0},e.demux=function(t){var e=t,n=Object(i.dummyTrack)();if(this.config.progressive){this.remainderData&&(e=Object(r.appendUint8Array)(this.remainderData,t));var s=Object(r.segmentValidRange)(e);this.remainderData=s.remainder,n.samples=s.valid||new Uint8Array}else n.samples=e;return{audioTrack:Object(i.dummyTrack)(),avcTrack:n,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},e.flush=function(){var t=Object(i.dummyTrack)();return t.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(i.dummyTrack)(),avcTrack:t,id3Track:Object(i.dummyTrack)(),textTrack:Object(i.dummyTrack)()}},e.demuxSampleAes=function(t,e,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},e.destroy=function(){},t}();s.minProbeByteLength=1024,e.default=s},"./src/demux/mpegaudio.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"appendFrame",(function(){return u})),n.d(e,"parseHeader",(function(){return l})),n.d(e,"isHeaderPattern",(function(){return c})),n.d(e,"isHeader",(function(){return d})),n.d(e,"canParse",(function(){return h})),n.d(e,"probe",(function(){return p}));var r=null,i=[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],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],o=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],a=[0,1,1,4];function u(t,e,n,r,i){if(!(n+24>e.length)){var s=l(e,n);if(s&&n+s.frameLength<=e.length){var o=r+i*(9e4*s.samplesPerFrame/s.sampleRate),a={unit:e.subarray(n,n+s.frameLength),pts:o,dts:o};return t.config=[],t.channelCount=s.channelCount,t.samplerate=s.sampleRate,t.samples.push(a),{sample:a,length:s.frameLength,missing:0}}}}function l(t,e){var n=t[e+1]>>3&3,u=t[e+1]>>1&3,l=t[e+2]>>4&15,c=t[e+2]>>2&3;if(1!==n&&0!==l&&15!==l&&3!==c){var d=t[e+2]>>1&1,h=t[e+3]>>6,p=1e3*i[14*(3===n?3-u:3===u?3:4)+l-1],f=s[3*(3===n?0:2===n?1:2)+c],m=3===h?1:2,g=o[n][u],v=a[u],y=8*g*v,_=Math.floor(g*p/f+d)*v;if(null===r){var b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);r=b?parseInt(b[1]):0}return!!r&&r<=87&&2===u&&p>=224e3&&0===h&&(t[e+3]=128|t[e+3]),{sampleRate:f,channelCount:m,frameLength:_,samplesPerFrame:y}}}function c(t,e){return 255===t[e]&&224==(224&t[e+1])&&0!=(6&t[e+1])}function d(t,e){return e+1=t.length)return void n();if(!(t[e].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(t,e,n,r),!r)return}}},e.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,n=new Int8Array(e),r=0,i=32;i<=t.length-16;i+=160,r+=16)n.set(t.subarray(i,i+16),r);return n},e.getAvcDecryptedUnit=function(t,e){for(var n=new Uint8Array(e),r=0,i=32;i<=t.length-16;i+=160,r+=16)t.set(n.subarray(r,r+16),i);return t},e.decryptAvcSample=function(t,e,n,r,s,o){var a=Object(i.discardEPB)(s.data),u=this.getAvcEncryptedData(a),l=this;this.decryptBuffer(u.buffer,(function(i){s.data=l.getAvcDecryptedUnit(a,i),o||l.decryptAvcSamples(t,e,n+1,r)}))},e.decryptAvcSamples=function(t,e,n,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,n=0){if(e>=t.length)return void r();for(var i=t[e].units;!(n>=i.length);n++){var s=i[n];if(!(s.data.length<=48||1!==s.type&&5!==s.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(t,e,n,r,s,o),!o)return}}}},t}();e.default=s},"./src/demux/transmuxer-interface.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return d}));var r=n("./node_modules/webworkify-webpack/index.js"),i=n("./src/events.ts"),s=n("./src/demux/transmuxer.ts"),o=n("./src/utils/logger.ts"),a=n("./src/errors.ts"),u=n("./src/utils/mediasource-helper.ts"),l=n("./node_modules/eventemitter3/index.js"),c=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},d=function(){function t(t,e,n,u){var d=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=t,this.id=e,this.onTransmuxComplete=n,this.onFlush=u;var h=t.config,p=function(e,n){(n=n||{}).frag=d.frag,n.id=d.id,t.trigger(e,n)};this.observer=new l.EventEmitter,this.observer.on(i.Events.FRAG_DECRYPTED,p),this.observer.on(i.Events.ERROR,p);var f={mp4:c.isTypeSupported("video/mp4"),mpeg:c.isTypeSupported("audio/mpeg"),mp3:c.isTypeSupported('audio/mp4; codecs="mp3"')},m=navigator.vendor;if(h.enableWorker&&"undefined"!=typeof Worker){var g;o.logger.log("demuxing in webworker");try{g=this.worker=r("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),g.addEventListener("message",this.onwmsg),g.onerror=function(e){t.trigger(i.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(e.message+" ("+e.filename+":"+e.lineno+")")})},g.postMessage({cmd:"init",typeSupported:f,vendor:m,id:e,config:JSON.stringify(h)})}catch(t){o.logger.warn("Error in worker:",t),o.logger.error("Error while initializing DemuxerWorker, fallback to inline"),g&&self.URL.revokeObjectURL(g.objectURL),this.transmuxer=new s.default(this.observer,f,h,m,e),this.worker=null}}else this.transmuxer=new s.default(this.observer,f,h,m,e)}var e=t.prototype;return e.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var n=this.observer;n&&n.removeAllListeners(),this.observer=null},e.push=function(t,e,n,r,i,a,u,l,c,d){var h=this;c.transmuxing.start=self.performance.now();var p=this.transmuxer,f=this.worker,m=a?a.start:i.start,g=i.decryptdata,v=this.frag,y=!(v&&i.cc===v.cc),_=!(v&&c.level===v.level),b=v?c.sn-v.sn:-1,E=this.part?c.part-this.part.index:1,w=!_&&(1===b||0===b&&1===E),S=self.performance.now();(_||b||0===i.stats.parsing.start)&&(i.stats.parsing.start=S),!a||!E&&w||(a.stats.parsing.start=S);var A=new s.TransmuxState(y,w,l,_,m);if(!w||y){o.logger.log("[transmuxer-interface, "+i.type+"]: Starting new transmux session for sn: "+c.sn+" p: "+c.part+" level: "+c.level+" id: "+c.id+"\n discontinuity: "+y+"\n trackSwitch: "+_+"\n contiguous: "+w+"\n accurateTimeOffset: "+l+"\n timeOffset: "+m);var T=new s.TransmuxConfig(n,r,e,u,d);this.configureTransmuxer(T)}if(this.frag=i,this.part=a,f)f.postMessage({cmd:"demux",data:t,decryptdata:g,chunkMeta:c,state:A},t instanceof ArrayBuffer?[t]:[]);else if(p){var x=p.push(t,g,c,A);Object(s.isPromise)(x)?x.then((function(t){h.handleTransmuxComplete(t)})):this.handleTransmuxComplete(x)}},e.flush=function(t){var e=this;t.transmuxing.start=self.performance.now();var n=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:t});else if(n){var i=n.flush(t);Object(s.isPromise)(i)?i.then((function(n){e.handleFlushResult(n,t)})):this.handleFlushResult(i,t)}},e.handleFlushResult=function(t,e){var n=this;t.forEach((function(t){n.handleTransmuxComplete(t)})),this.onFlush(e)},e.onWorkerMessage=function(t){var e=t.data,n=this.hls;switch(e.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,n.trigger(e.event,e.data)}},e.configureTransmuxer=function(t){var e=this.worker,n=this.transmuxer;e?e.postMessage({cmd:"configure",config:t}):n&&n.configure(t)},e.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},t}()},"./src/demux/transmuxer-worker.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return a}));var r=n("./src/demux/transmuxer.ts"),i=n("./src/events.ts"),s=n("./src/utils/logger.ts"),o=n("./node_modules/eventemitter3/index.js");function a(t){var e=new o.EventEmitter,n=function(e,n){t.postMessage({event:e,data:n})};e.on(i.Events.FRAG_DECRYPTED,n),e.on(i.Events.ERROR,n),t.addEventListener("message",(function(i){var o=i.data;switch(o.cmd){case"init":var a=JSON.parse(o.config);t.transmuxer=new r.default(e,o.typeSupported,a,o.vendor,o.id),Object(s.enableLogs)(a.debug),n("init",null);break;case"configure":t.transmuxer.configure(o.config);break;case"demux":var l=t.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(r.isPromise)(l)?l.then((function(e){u(t,e)})):u(t,l);break;case"flush":var d=o.chunkMeta,h=t.transmuxer.flush(d);Object(r.isPromise)(h)?h.then((function(e){c(t,e,d)})):c(t,h,d)}}))}function u(t,e){if((n=e.remuxResult).audio||n.video||n.text||n.id3||n.initSegment){var n,r=[],i=e.remuxResult,s=i.audio,o=i.video;s&&l(r,s),o&&l(r,o),t.postMessage({event:"transmuxComplete",data:e},r)}}function l(t,e){e.data1&&t.push(e.data1.buffer),e.data2&&t.push(e.data2.buffer)}function c(t,e,n){e.forEach((function(e){u(t,e)})),t.postMessage({event:"flush",data:n})}},"./src/demux/transmuxer.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y})),n.d(e,"isPromise",(function(){return b})),n.d(e,"TransmuxConfig",(function(){return E})),n.d(e,"TransmuxState",(function(){return w}));var r,i=n("./src/events.ts"),s=n("./src/errors.ts"),o=n("./src/crypt/decrypter.ts"),a=n("./src/demux/aacdemuxer.ts"),u=n("./src/demux/mp4demuxer.ts"),l=n("./src/demux/tsdemuxer.ts"),c=n("./src/demux/mp3demuxer.ts"),d=n("./src/remux/mp4-remuxer.ts"),h=n("./src/remux/passthrough-remuxer.ts"),p=n("./src/demux/chunk-cache.ts"),f=n("./src/utils/mp4-tools.ts"),m=n("./src/utils/logger.ts");try{r=self.performance.now.bind(self.performance)}catch(t){m.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var g=[{demux:l.default,remux:d.default},{demux:u.default,remux:h.default},{demux:a.default,remux:d.default},{demux:c.default,remux:d.default}],v=1024;g.forEach((function(t){var e=t.demux;v=Math.max(v,e.minProbeByteLength)}));var y=function(){function t(t,e,n,r,i){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.cache=new p.default,this.observer=t,this.typeSupported=e,this.config=n,this.vendor=r,this.id=i}var e=t.prototype;return e.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},e.push=function(t,e,n,i){var s=this,o=n.transmuxing;o.executeStart=r();var a=new Uint8Array(t),u=this.cache,l=this.config,c=this.currentTransmuxState,d=this.transmuxConfig;i&&(this.currentTransmuxState=i);var h=function(t,e){var n=null;return t.byteLength>0&&null!=e&&null!=e.key&&null!==e.iv&&null!=e.method&&(n=e),n}(a,e);if(h&&"AES-128"===h.method){var p=this.getDecrypter();if(!l.enableSoftwareAES)return this.decryptionPromise=p.webCryptoDecrypt(a,h.key.buffer,h.iv.buffer).then((function(t){var e=s.push(t,null,n);return s.decryptionPromise=null,e})),this.decryptionPromise;var m=p.softwareDecrypt(a,h.key.buffer,h.iv.buffer);if(!m)return o.executeEnd=r(),_(n);a=new Uint8Array(m)}var g=i||c,v=g.contiguous,y=g.discontinuity,b=g.trackSwitch,E=g.accurateTimeOffset,w=g.timeOffset,S=d.audioCodec,A=d.videoCodec,T=d.defaultInitPts,x=d.duration,k=d.initSegmentData;if((y||b)&&this.resetInitSegment(k,S,A,x),y&&this.resetInitialTimestamp(T),v||this.resetContiguity(),this.needsProbing(a,y,b)){if(u.dataLength){var C=u.flush();a=Object(f.appendUint8Array)(C,a)}this.configureTransmuxer(a,d)}var I=this.transmux(a,h,w,E,n),D=this.currentTransmuxState;return D.contiguous=!0,D.discontinuity=!1,D.trackSwitch=!1,o.executeEnd=r(),I},e.flush=function(t){var e=this,n=t.transmuxing;n.executeStart=r();var o=this.decrypter,a=this.cache,u=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then((function(){return e.flush(t)}));var c=[],d=u.timeOffset;if(o){var h=o.flush();h&&c.push(this.push(h,null,t))}var p=a.dataLength;a.reset();var f=this.demuxer,m=this.remuxer;if(!f||!m)return p>=v&&this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),n.executeEnd=r(),[_(t)];var g=f.flush(d);return b(g)?g.then((function(n){return e.flushRemux(c,n,t),c})):(this.flushRemux(c,g,t),c)},e.flushRemux=function(t,e,n){var i=e.audioTrack,s=e.avcTrack,o=e.id3Track,a=e.textTrack,u=this.currentTransmuxState,l=u.accurateTimeOffset,c=u.timeOffset;m.logger.log("[transmuxer.ts]: Flushed fragment "+n.sn+(n.part>-1?" p: "+n.part:"")+" of level "+n.level);var d=this.remuxer.remux(i,s,o,a,c,l,!0,this.id);t.push({remuxResult:d,chunkMeta:n}),n.transmuxing.executeEnd=r()},e.resetInitialTimestamp=function(t){var e=this.demuxer,n=this.remuxer;e&&n&&(e.resetTimeStamp(t),n.resetTimeStamp(t))},e.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},e.resetInitSegment=function(t,e,n,r){var i=this.demuxer,s=this.remuxer;i&&s&&(i.resetInitSegment(e,n,r),s.resetInitSegment(t,e,n))},e.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},e.transmux=function(t,e,n,r,i){return e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,n,r,i):this.transmuxUnencrypted(t,n,r,i)},e.transmuxUnencrypted=function(t,e,n,r){var i=this.demuxer.demux(t,e,!1,!this.config.progressive),s=i.audioTrack,o=i.avcTrack,a=i.id3Track,u=i.textTrack;return{remuxResult:this.remuxer.remux(s,o,a,u,e,n,!1,this.id),chunkMeta:r}},e.transmuxSampleAes=function(t,e,n,r,i){var s=this;return this.demuxer.demuxSampleAes(t,e,n).then((function(t){return{remuxResult:s.remuxer.remux(t.audioTrack,t.avcTrack,t.id3Track,t.textTrack,n,r,!1,s.id),chunkMeta:i}}))},e.configureTransmuxer=function(t,e){for(var n,r=this.config,i=this.observer,s=this.typeSupported,o=this.vendor,a=e.audioCodec,l=e.defaultInitPts,c=e.duration,d=e.initSegmentData,p=e.videoCodec,f=0,v=g.length;f>4>1){if((D=k+5+e[k+4])===k+188)continue}else D=k+4;switch(I){case p:C&&(f&&(s=v(f))&&this.parseAVCPES(s,!1),f={data:[],size:0}),f&&(f.data.push(e.subarray(D,k+188)),f.size+=k+188-D);break;case y:C&&(b&&(s=v(b))&&(a.isAAC?this.parseAACPES(s):this.parseMPEGPES(s)),b={data:[],size:0}),b&&(b.data.push(e.subarray(D,k+188)),b.size+=k+188-D);break;case _:C&&(E&&(s=v(E))&&this.parseID3PES(s),E={data:[],size:0}),E&&(E.data.push(e.subarray(D,k+188)),E.size+=k+188-D);break;case 0:C&&(D+=e[D]+1),A=this._pmtId=m(e,D);break;case A:C&&(D+=e[D]+1);var O=g(e,D,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,r);(p=O.avc)>0&&(o.pid=p),(y=O.audio)>0&&(a.pid=y,a.isAAC=O.isAAC),(_=O.id3)>0&&(h.pid=_),w&&!S&&(c.logger.log("reparse from beginning"),w=!1,k=x-188),S=this.pmtParsed=!0;break;case 17:case 8191:break;default:w=!0}}else this.observer.emit(u.Events.ERROR,u.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});o.pesData=f,a.pesData=b,h.pesData=E;var L={audioTrack:a,avcTrack:o,id3Track:h,textTrack:this._txtTrack};return i&&this.extractRemainingSamples(L),L},e.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},e.extractRemainingSamples=function(t){var e,n=t.audioTrack,r=t.avcTrack,i=t.id3Track,s=r.pesData,o=n.pesData,a=i.pesData;s&&(e=v(s))?(this.parseAVCPES(e,!0),r.pesData=null):r.pesData=s,o&&(e=v(o))?(n.isAAC?this.parseAACPES(e):this.parseMPEGPES(e),n.pesData=null):(null!=o&&o.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),n.pesData=o),a&&(e=v(a))?(this.parseID3PES(e),i.pesData=null):i.pesData=a},e.demuxSampleAes=function(t,e,n){var r=this.demux(t,n,!0,!this.config.progressive),i=this.sampleAes=new a.default(this.observer,this.config,e);return this.decrypt(r,i)},e.decrypt=function(t,e){return new Promise((function(n){var r=t.audioTrack,i=t.avcTrack;r.samples&&r.isAAC?e.decryptAacSamples(r.samples,0,(function(){i.samples?e.decryptAvcSamples(i.samples,0,0,(function(){n(t)})):n(t)})):i.samples&&e.decryptAvcSamples(i.samples,0,0,(function(){n(t)}))}))},e.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},e.parseAVCPES=function(t,e){var n,r=this,i=this._avcTrack,a=this.parseAVCNALu(t.data),u=this.avcSample,l=!1;t.data=null,u&&a.length&&!i.audFound&&(y(u,i),u=this.avcSample=f(!1,t.pts,t.dts,"")),a.forEach((function(e){switch(e.type){case 1:n=!0,u||(u=r.avcSample=f(!0,t.pts,t.dts,"")),u.frame=!0;var a=e.data;if(l&&a.length>4){var c=new s.default(a).readSliceType();2!==c&&4!==c&&7!==c&&9!==c||(u.key=!0)}break;case 5:n=!0,u||(u=r.avcSample=f(!0,t.pts,t.dts,"")),u.key=!0,u.frame=!0;break;case 6:n=!0;var d=new s.default(b(e.data));d.readUByte();for(var h=0,p=0,m=!1,g=0;!m&&d.bytesAvailable>1;){h=0;do{h+=g=d.readUByte()}while(255===g);p=0;do{p+=g=d.readUByte()}while(255===g);if(4===h&&0!==d.bytesAvailable){if(m=!0,181===d.readUByte()&&49===d.readUShort()&&1195456820===d.readUInt()&&3===d.readUByte()){for(var v=d.readUByte(),E=31&v,w=[v,d.readUByte()],S=0;S16){for(var A=[],T=0;T<16;T++)A.push(d.readUByte().toString(16)),3!==T&&5!==T&&7!==T&&9!==T||A.push("-");for(var x=p-16,k=new Uint8Array(x),C=0;C=0){var d={data:t.subarray(l,u-s-1),type:c};a.push(d)}else{var h=this.getLastNalUnit();if(h&&(o&&u<=4-o&&h.state&&(h.data=h.data.subarray(0,h.data.byteLength-o)),(n=u-s-1)>0)){var p=new Uint8Array(h.data.byteLength+n);p.set(h.data,0),p.set(t.subarray(0,n),h.data.byteLength),h.data=p}}u=0&&s>=0){var f={data:t.subarray(l,r),type:c,state:s};a.push(f)}if(0===a.length){var m=this.getLastNalUnit();if(m){var g=new Uint8Array(m.data.byteLength+t.byteLength);g.set(m.data,0),g.set(t,m.data.byteLength),m.data=g}}return i.naluState=s,a},e.parseAACPES=function(t){var e,n,i,s,o,a=0,l=this._audioTrack,h=this.aacOverFlow,p=t.data;if(h){this.aacOverFlow=null;var f=h.sample.unit.byteLength,m=Math.min(h.missing,f),g=f-m;h.sample.unit.set(p.subarray(0,m),g),l.samples.push(h.sample),a=h.missing}for(e=a,n=p.length;e1;){var u=new Uint8Array(a[0].length+a[1].length);u.set(a[0]),u.set(a[1],a[0].length),a[0]=u,a.splice(1,1)}if(1===((e=a[0])[0]<<16)+(e[1]<<8)+e[2]){if((n=(e[4]<<8)+e[5])&&n>t.size-6)return null;var l=e[7];192&l&&(i=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&l?i-(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2)>54e5&&(c.logger.warn(Math.round((i-s)/9e4)+"s delta between PTS and DTS, align them"),i=s):s=i);var d=(r=e[8])+9;if(t.size<=d)return null;t.size-=d;for(var h=new Uint8Array(t.size),p=0,f=a.length;pm){d-=m;continue}e=e.subarray(d),m-=d,d=0}h.set(e,o),o+=m}return n&&(n-=r+3),{data:h,pts:i,dts:s,len:n}}return null}function y(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){var n=e.samples,r=n.length;if(!r)return void e.dropped++;var i=n[r-1];t.pts=i.pts,t.dts=i.dts}e.samples.push(t)}t.debug.length&&c.logger.log(t.pts+"/"+t.dts+":"+t.debug)}function _(t,e){var n=t.length;if(n>0){if(e.pts>=t[n-1].pts)t.push(e);else for(var r=n-1;r>=0;r--)if(e.ptse)return r;return 0}},{key:"maxAutoLevel",get:function(){var t=this.levels,e=this.autoLevelCapping;return-1===e&&t&&t.length?t.length-1:e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(t){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,t)}},{key:"audioTracks",get:function(){var t=this.audioTrackController;return t?t.audioTracks:[]}},{key:"audioTrack",get:function(){var t=this.audioTrackController;return t?t.audioTrack:-1},set:function(t){var e=this.audioTrackController;e&&(e.audioTrack=t)}},{key:"subtitleTracks",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var t=this.subtitleTrackController;return t?t.subtitleTrack:-1},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var t=this.subtitleTrackController;return!!t&&t.subtitleDisplay},set:function(t){var e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(t){this.config.lowLatencyMode=t}},{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}}])&&v(e.prototype,n),y&&v(e,y),t}();y.defaultConfig=void 0},"./src/is-supported.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"isSupported",(function(){return s})),n.d(e,"changeTypeSupported",(function(){return o}));var r=n("./src/utils/mediasource-helper.ts");function i(){return self.SourceBuffer||self.WebKitSourceBuffer}function s(){var t=Object(r.getMediaSource)();if(!t)return!1;var e=i(),n=t&&"function"==typeof t.isTypeSupported&&t.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!e||e.prototype&&"function"==typeof e.prototype.appendBuffer&&"function"==typeof e.prototype.remove;return!!n&&!!s}function o(){var t,e=i();return"function"==typeof(null==e||null===(t=e.prototype)||void 0===t?void 0:t.changeType)}},"./src/loader/fragment-loader.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return d})),n.d(e,"LoadError",(function(){return p}));var r=n("./src/polyfills/number.ts"),i=n("./src/errors.ts");function s(t){var e="function"==typeof Map?new Map:void 0;return s=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return o(t,arguments,l(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,t)},s(t)}function o(t,e,n){return o=a()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&u(i,n.prototype),i},o.apply(null,arguments)}function a(){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(t){return!1}}function u(t,e){return u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},u(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var c=Math.pow(2,17),d=function(){function t(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var e=t.prototype;return e.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},e.abort=function(){this.loader&&this.loader.abort()},e.load=function(t,e){var n=this,r=t.url;if(!r)return Promise.reject(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(r,u){n.loader&&n.loader.destroy();var l=n.loader=t.loader=o?new o(s):new a(s),d=h(t),f={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:c};t.stats=l.stats,l.load(d,f,{onSuccess:function(e,i,s,o){n.resetLoader(t,l),r({frag:t,part:null,payload:e.data,networkDetails:o})},onError:function(e,r,s){n.resetLoader(t,l),u(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:e,networkDetails:s}))},onAbort:function(e,r,s){n.resetLoader(t,l),u(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:s}))},onTimeout:function(e,r,s){n.resetLoader(t,l),u(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:s}))},onProgress:function(n,r,i,s){e&&e({frag:t,part:null,payload:i,networkDetails:s})}})}))},e.loadPart=function(t,e,n){var r=this;this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(u,l){r.loader&&r.loader.destroy();var d=r.loader=t.loader=o?new o(s):new a(s),f=h(t,e),m={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:c};e.stats=d.stats,d.load(f,m,{onSuccess:function(i,s,o,a){r.resetLoader(t,d),r.updateStatsFromPart(t,e);var l={frag:t,part:e,payload:i.data,networkDetails:a};n(l),u(l)},onError:function(n,s,o){r.resetLoader(t,d),l(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:n,networkDetails:o}))},onAbort:function(n,s,o){t.stats.aborted=e.stats.aborted,r.resetLoader(t,d),l(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,networkDetails:o}))},onTimeout:function(n,s,o){r.resetLoader(t,d),l(new p({type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,networkDetails:o}))}})}))},e.updateStatsFromPart=function(t,e){var n=t.stats,r=e.stats,i=r.total;if(n.loaded+=r.loaded,i){var s=Math.round(t.duration/e.duration),o=Math.min(Math.round(n.loaded/i),s),a=(s-o)*Math.round(n.loaded/o);n.total=n.loaded+a}else n.total=Math.max(n.loaded,n.total);var u=n.loading,l=r.loading;u.start?u.first+=l.first-l.start:(u.start=l.start,u.first=l.first),u.end=l.end},e.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},t}();function h(t,e){void 0===e&&(e=null);var n=e||t,i={frag:t,part:e,responseType:"arraybuffer",url:n.url,headers:{},rangeStart:0,rangeEnd:0},s=n.byteRangeStartOffset,o=n.byteRangeEndOffset;return Object(r.isFiniteNumber)(s)&&Object(r.isFiniteNumber)(o)&&(i.rangeStart=s,i.rangeEnd=o),i}var p=function(t){var e,n;function r(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s>8*(15-n)&255;return e},n.setDecryptDataFromLevelKey=function(t,e){var n=t;return"AES-128"===(null==t?void 0:t.method)&&t.uri&&!t.iv&&((n=a.LevelKey.fromURI(t.uri)).method=t.method,n.iv=this.createInitializationVector(e),n.keyFormat="identity"),n},n.setElementaryStreamInfo=function(t,e,n,r,i,s){void 0===s&&(s=!1);var o=this.elementaryStreams,a=o[t];a?(a.startPTS=Math.min(a.startPTS,e),a.endPTS=Math.max(a.endPTS,n),a.startDTS=Math.min(a.startDTS,r),a.endDTS=Math.max(a.endDTS,i)):o[t]={startPTS:e,endPTS:n,startDTS:r,endDTS:i,partial:s}},n.clearElementaryStreamInfo=function(){var t=this.elementaryStreams;t[r.AUDIO]=null,t[r.VIDEO]=null,t[r.AUDIOVIDEO]=null},h(e,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var t=this.sn;"number"!=typeof t&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),t=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,t)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(i.isFiniteNumber)(this.programDateTime))return null;var t=Object(i.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*t}},{key:"encrypted",get:function(){var t;return!(null===(t=this.decryptdata)||void 0===t||!t.keyFormat||!this.decryptdata.uri)}}]),e}(p),m=function(t){function e(e,n,r,i,s){var o;(o=t.call(this,r)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new u.LoadStats,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=n,o.index=i;var a=e.enumeratedString("BYTERANGE");return a&&o.setByteRange(a,s),s&&(o.fragOffset=s.fragOffset+s.duration),o}return l(e,t),h(e,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),e}(p)},"./src/loader/key-loader.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));var r=n("./src/events.ts"),i=n("./src/errors.ts"),s=n("./src/utils/logger.ts"),o=function(){function t(t){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=t,this._registerListeners()}var e=t.prototype;return e._registerListeners=function(){this.hls.on(r.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(r.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){for(var t in this._unregisterListeners(),this.loaders){var e=this.loaders[t];e&&e.destroy()}this.loaders={}},e.onKeyLoading=function(t,e){var n=e.frag,i=n.type,o=this.loaders[i];if(n.decryptdata){var a=n.decryptdata.uri;if(a!==this.decrypturl||null===this.decryptkey){var u=this.hls.config;if(o&&(s.logger.warn("abort previous key loader for type:"+i),o.abort()),!a)return void s.logger.warn("key uri is falsy");var l=u.loader,c=n.loader=this.loaders[i]=new l(u);this.decrypturl=a,this.decryptkey=null;var d={url:a,frag:n,responseType:"arraybuffer"},h={timeout:u.fragLoadingTimeOut,maxRetry:0,retryDelay:u.fragLoadingRetryDelay,maxRetryDelay:u.fragLoadingMaxRetryTimeout,highWaterMark:0},p={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(d,h,p)}else this.decryptkey&&(n.decryptdata.key=this.decryptkey,this.hls.trigger(r.Events.KEY_LOADED,{frag:n}))}else s.logger.warn("Missing decryption data on fragment in onKeyLoading")},e.loadsuccess=function(t,e,n){var i=n.frag;i.decryptdata?(this.decryptkey=i.decryptdata.key=new Uint8Array(t.data),i.loader=null,delete this.loaders[i.type],this.hls.trigger(r.Events.KEY_LOADED,{frag:i})):s.logger.error("after key load, decryptdata unset")},e.loaderror=function(t,e){var n=e.frag,s=n.loader;s&&s.abort(),delete this.loaders[n.type],this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:n,response:t})},e.loadtimeout=function(t,e){var n=e.frag,s=n.loader;s&&s.abort(),delete this.loaders[n.type],this.hls.trigger(r.Events.ERROR,{type:i.ErrorTypes.NETWORK_ERROR,details:i.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:n})},t}()},"./src/loader/level-details.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"LevelDetails",(function(){return s}));var r=n("./src/polyfills/number.ts");function i(t,e){for(var n=0;nt.endSN||e>0||0===e&&n>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay},e=t,(n=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(r.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var t=this.driftEndTime-this.driftStartTime;return t>0?1e3*(this.driftEnd-this.driftStart)/t:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var t;return null!==(t=this.fragments)&&void 0!==t&&t.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 t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var t;return null!==(t=this.partList)&&void 0!==t&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&i(e.prototype,n),s&&i(e,s),t}()},"./src/loader/level-key.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"LevelKey",(function(){return s}));var r=n("./node_modules/url-toolkit/src/url-toolkit.js");function i(t,e){for(var n=0;n2){var n=e.shift()+".";return n+=parseInt(e.shift()).toString(16),n+=("000"+parseInt(e.shift()).toString(16)).substr(-4)}return t},t.resolve=function(t,e){return i.buildAbsoluteURL(e,t,{alwaysNormalize:!0})},t.parseMasterPlaylist=function(e,n){var r,i=[],s={},o=!1;for(d.lastIndex=0;null!=(r=d.exec(e));)if(r[1]){var a=new u.AttrList(r[1]),l={attrs:a,bitrate:a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),name:a.NAME,url:t.resolve(r[2],n)},c=a.decimalResolution("RESOLUTION");c&&(l.width=c.width,l.height=c.height),v((a.CODECS||"").split(/[ ,]+/).filter((function(t){return t})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=t.convertAVC1ToAVCOTI(l.videoCodec)),i.push(l)}else if(r[3]){var h=new u.AttrList(r[3]);h["DATA-ID"]&&(o=!0,s[h["DATA-ID"]]=h)}return{levels:i,sessionData:o?s:null}},t.parseMasterPlaylistMedia=function(e,n,r,i){var s;void 0===i&&(i=[]);var o=[],a=0;for(h.lastIndex=0;null!==(s=h.exec(e));){var l=new u.AttrList(s[1]);if(l.TYPE===r){var c={attrs:l,bitrate:0,id:a++,groupId:l["GROUP-ID"],instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:r,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?t.resolve(l.URI,n):""};if(i.length){var d=t.findGroup(i,c.groupId)||i[0];y(c,d,"audioCodec"),y(c,d,"textCodec")}o.push(c)}}return o},t.parseLevelPlaylist=function(t,e,n,c,d){var h,g,v,y=new o.LevelDetails(e),b=y.fragments,E=null,w=0,S=0,A=0,T=0,x=null,k=new s.Fragment(c,e),C=-1,I=!1;for(p.lastIndex=0,y.m3u8=t;null!==(h=p.exec(t));){I&&(I=!1,(k=new s.Fragment(c,e)).start=A,k.sn=w,k.cc=T,k.level=n,E&&(k.initSegment=E,k.rawProgramDateTime=E.rawProgramDateTime));var D=h[1];if(D){k.duration=parseFloat(D);var O=(" "+h[2]).slice(1);k.title=O||null,k.tagList.push(O?["INF",D,O]:["INF",D])}else if(h[3])Object(r.isFiniteNumber)(k.duration)&&(k.start=A,v&&(k.levelkey=v),k.sn=w,k.level=n,k.cc=T,k.urlId=d,b.push(k),k.relurl=(" "+h[3]).slice(1),_(k,x),x=k,A+=k.duration,w++,S=0,I=!0);else if(h[4]){var L=(" "+h[4]).slice(1);x?k.setByteRange(L,x):k.setByteRange(L)}else if(h[5])k.rawProgramDateTime=(" "+h[5]).slice(1),k.tagList.push(["PROGRAM-DATE-TIME",k.rawProgramDateTime]),-1===C&&(C=b.length);else{if(!(h=h[0].match(f))){l.logger.warn("No matches on slow regex match for level playlist!");continue}for(g=1;g-1){l.logger.warn("Keyformat "+W+" is not supported from the manifest");continue}if("identity"!==W)continue;G&&(v=a.LevelKey.fromURL(e,H),H&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(G)>=0&&(v.method=G,v.keyFormat=W,z&&(v.keyID=z),K&&(v.keyFormatVersions=K),v.iv=V));break;case"START":var Q=new u.AttrList(P).decimalFloatingPoint("TIME-OFFSET");Object(r.isFiniteNumber)(Q)&&(y.startTimeOffset=Q);break;case"MAP":var Y=new u.AttrList(P);k.relurl=Y.URI,Y.BYTERANGE&&k.setByteRange(Y.BYTERANGE),k.level=n,k.sn="initSegment",v&&(k.levelkey=v),k.initSegment=null,E=k,I=!0;break;case"SERVER-CONTROL":var X=new u.AttrList(P);y.canBlockReload=X.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=X.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&X.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=X.optionalFloat("PART-HOLD-BACK",0),y.holdBack=X.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Z=new u.AttrList(P);y.partTarget=Z.decimalFloatingPoint("PART-TARGET");break;case"PART":var J=y.partList;J||(J=y.partList=[]);var $=S>0?J[J.length-1]:void 0,tt=S++,et=new s.Part(new u.AttrList(P),k,e,tt,$);J.push(et),k.duration+=et.duration;break;case"PRELOAD-HINT":var nt=new u.AttrList(P);y.preloadHint=nt;break;case"RENDITION-REPORT":var rt=new u.AttrList(P);y.renditionReports=y.renditionReports||[],y.renditionReports.push(rt);break;default:l.logger.warn("line parsed but not handled: "+h)}}}x&&!x.relurl?(b.pop(),A-=x.duration,y.partList&&(y.fragmentHint=x)):y.partList&&(_(k,x),k.cc=T,y.fragmentHint=k);var it=b.length,st=b[0],ot=b[it-1];if((A+=y.skippedSegments*y.targetduration)>0&&it&&ot){y.averagetargetduration=A/it;var at=ot.sn;y.endSN="initSegment"!==at?at:0,st&&(y.startCC=st.cc,st.initSegment||y.fragments.every((function(t){return t.relurl&&(e=t.relurl,m.test(null!=(n=null===(r=i.parseURL(e))||void 0===r?void 0:r.path)?n:""));var e,n,r}))&&(l.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(k=new s.Fragment(c,e)).relurl=ot.relurl,k.level=n,k.sn="initSegment",st.initSegment=k,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(A+=y.fragmentHint.duration),y.totalduration=A,y.endCC=T,C>0&&function(t,e){for(var n=t[e],r=e;r--;){var i=t[r];if(!i)return;i.programDateTime=n.programDateTime-1e3*i.duration,n=i}}(b,C),y},t}();function v(t,e){["video","audio","text"].forEach((function(n){var r=t.filter((function(t){return Object(c.isCodecType)(t,n)}));if(r.length){var i=r.filter((function(t){return 0===t.lastIndexOf("avc1",0)||0===t.lastIndexOf("mp4a",0)}));e[n+"Codec"]=i.length>0?i[0]:r[0],t=t.filter((function(t){return-1===r.indexOf(t)}))}})),e.unknownCodecs=t}function y(t,e,n){var r=e[n];r&&(t[n]=r)}function _(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),Object(r.isFiniteNumber)(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/polyfills/number.ts"),i=n("./src/events.ts"),s=n("./src/errors.ts"),o=n("./src/utils/logger.ts"),a=n("./src/utils/mp4-tools.ts"),u=n("./src/loader/m3u8-parser.ts"),l=n("./src/types/loader.ts"),c=n("./src/utils/attr-list.ts");function d(t,e){var n=t.url;return void 0!==n&&0!==n.indexOf("data:")||(n=e.url),n}var h=function(){function t(t){this.hls=void 0,this.loaders=Object.create(null),this.hls=t,this.registerListeners()}var e=t.prototype;return e.registerListeners=function(){var t=this.hls;t.on(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.unregisterListeners=function(){var t=this.hls;t.off(i.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(i.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(i.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(i.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},e.createInternalLoader=function(t){var e=this.hls.config,n=e.pLoader,r=e.loader,i=new(n||r)(e);return t.loader=i,this.loaders[t.type]=i,i},e.getInternalLoader=function(t){return this.loaders[t.type]},e.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},e.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},e.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},e.onManifestLoading=function(t,e){var n=e.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:l.PlaylistContextType.MANIFEST,url:n,deliveryDirectives:null})},e.onLevelLoading=function(t,e){var n=e.id,r=e.level,i=e.url,s=e.deliveryDirectives;this.load({id:n,groupId:null,level:r,responseType:"text",type:l.PlaylistContextType.LEVEL,url:i,deliveryDirectives:s})},e.onAudioTrackLoading=function(t,e){var n=e.id,r=e.groupId,i=e.url,s=e.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:l.PlaylistContextType.AUDIO_TRACK,url:i,deliveryDirectives:s})},e.onSubtitleTrackLoading=function(t,e){var n=e.id,r=e.groupId,i=e.url,s=e.deliveryDirectives;this.load({id:n,groupId:r,level:null,responseType:"text",type:l.PlaylistContextType.SUBTITLE_TRACK,url:i,deliveryDirectives:s})},e.load=function(t){var e,n,r,i,s,a,u=this.hls.config,c=this.getInternalLoader(t);if(c){var d=c.context;if(d&&d.url===t.url)return void o.logger.trace("[playlist-loader]: playlist request ongoing");o.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),c.abort()}switch(t.type){case l.PlaylistContextType.MANIFEST:n=u.manifestLoadingMaxRetry,r=u.manifestLoadingTimeOut,i=u.manifestLoadingRetryDelay,s=u.manifestLoadingMaxRetryTimeout;break;case l.PlaylistContextType.LEVEL:case l.PlaylistContextType.AUDIO_TRACK:case l.PlaylistContextType.SUBTITLE_TRACK:n=0,r=u.levelLoadingTimeOut;break;default:n=u.levelLoadingMaxRetry,r=u.levelLoadingTimeOut,i=u.levelLoadingRetryDelay,s=u.levelLoadingMaxRetryTimeout}if(c=this.createInternalLoader(t),null!==(e=t.deliveryDirectives)&&void 0!==e&&e.part&&(t.type===l.PlaylistContextType.LEVEL&&null!==t.level?a=this.hls.levels[t.level].details:t.type===l.PlaylistContextType.AUDIO_TRACK&&null!==t.id?a=this.hls.audioTracks[t.id].details:t.type===l.PlaylistContextType.SUBTITLE_TRACK&&null!==t.id&&(a=this.hls.subtitleTracks[t.id].details),a)){var h=a.partTarget,p=a.targetduration;h&&p&&(r=Math.min(1e3*Math.max(3*h,.8*p),r))}var f={timeout:r,maxRetry:n,retryDelay:i,maxRetryDelay:s,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(t,f,m)},e.loadsuccess=function(t,e,n,r){if(void 0===r&&(r=null),n.isSidxRequest)return this.handleSidxRequest(t,n),void this.handlePlaylistLoaded(t,e,n,r);this.resetInternalLoader(n.type);var i=t.data;0===i.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),i.indexOf("#EXTINF:")>0||i.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,e,n,r):this.handleMasterPlaylist(t,e,n,r)):this.handleManifestParsingError(t,n,"no EXTM3U delimiter",r)},e.loaderror=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!1,t)},e.loadtimeout=function(t,e,n){void 0===n&&(n=null),this.handleNetworkError(e,n,!0)},e.handleMasterPlaylist=function(t,e,n,r){var s=this.hls,a=t.data,l=d(t,n),h=u.default.parseMasterPlaylist(a,l),p=h.levels,f=h.sessionData;if(p.length){var m=p.map((function(t){return{id:t.attrs.AUDIO,audioCodec:t.audioCodec}})),g=p.map((function(t){return{id:t.attrs.SUBTITLES,textCodec:t.textCodec}})),v=u.default.parseMasterPlaylistMedia(a,l,"AUDIO",m),y=u.default.parseMasterPlaylistMedia(a,l,"SUBTITLES",g),_=u.default.parseMasterPlaylistMedia(a,l,"CLOSED-CAPTIONS");v.length&&(v.some((function(t){return!t.url}))||!p[0].audioCodec||p[0].attrs.AUDIO||(o.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new c.AttrList({}),bitrate:0,url:""}))),s.trigger(i.Events.MANIFEST_LOADED,{levels:p,audioTracks:v,subtitles:y,captions:_,url:l,stats:e,networkDetails:r,sessionData:f})}else this.handleManifestParsingError(t,n,"no level found in manifest",r)},e.handleTrackOrLevelPlaylist=function(t,e,n,o){var a=this.hls,h=n.id,p=n.level,f=n.type,m=d(t,n),g=Object(r.isFiniteNumber)(h)?h:0,v=Object(r.isFiniteNumber)(p)?p:g,y=function(t){switch(t.type){case l.PlaylistContextType.AUDIO_TRACK:return l.PlaylistLevelType.AUDIO;case l.PlaylistContextType.SUBTITLE_TRACK:return l.PlaylistLevelType.SUBTITLE;default:return l.PlaylistLevelType.MAIN}}(n),_=u.default.parseLevelPlaylist(t.data,m,v,y,g);if(_.fragments.length){if(f===l.PlaylistContextType.MANIFEST){var b={attrs:new c.AttrList({}),bitrate:0,details:_,name:"",url:m};a.trigger(i.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:m,stats:e,networkDetails:o,sessionData:null})}if(e.parsing.end=performance.now(),_.needSidxRanges){var E,w=null===(E=_.fragments[0].initSegment)||void 0===E?void 0:E.url;this.load({url:w,isSidxRequest:!0,type:f,level:p,levelDetails:_,id:h,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else n.levelDetails=_,this.handlePlaylistLoaded(t,e,n,o)}else a.trigger(i.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:m,reason:"no fragments found in level",level:"number"==typeof n.level?n.level:void 0})},e.handleSidxRequest=function(t,e){var n=Object(a.parseSegmentIndex)(new Uint8Array(t.data));if(n){var r=n.references,i=e.levelDetails;r.forEach((function(t,e){var r=t.info,s=i.fragments[e];0===s.byteRange.length&&s.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),s.initSegment&&s.initSegment.setByteRange(String(n.moovEndOffset)+"@0")}))}},e.handleManifestParsingError=function(t,e,n,r){this.hls.trigger(i.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:e.type===l.PlaylistContextType.MANIFEST,url:t.url,reason:n,response:t,context:e,networkDetails:r})},e.handleNetworkError=function(t,e,n,r){void 0===n&&(n=!1),o.logger.warn("[playlist-loader]: A network "+(n?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var a=s.ErrorDetails.UNKNOWN,u=!1,c=this.getInternalLoader(t);switch(t.type){case l.PlaylistContextType.MANIFEST:a=n?s.ErrorDetails.MANIFEST_LOAD_TIMEOUT:s.ErrorDetails.MANIFEST_LOAD_ERROR,u=!0;break;case l.PlaylistContextType.LEVEL:a=n?s.ErrorDetails.LEVEL_LOAD_TIMEOUT:s.ErrorDetails.LEVEL_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.AUDIO_TRACK:a=n?s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case l.PlaylistContextType.SUBTITLE_TRACK:a=n?s.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:s.ErrorDetails.SUBTITLE_LOAD_ERROR,u=!1}c&&this.resetInternalLoader(t.type);var d={type:s.ErrorTypes.NETWORK_ERROR,details:a,fatal:u,url:t.url,loader:c,context:t,networkDetails:e};r&&(d.response=r),this.hls.trigger(i.Events.ERROR,d)},e.handlePlaylistLoaded=function(t,e,n,r){var s=n.type,o=n.level,a=n.id,u=n.groupId,c=n.loader,d=n.levelDetails,h=n.deliveryDirectives;if(null!=d&&d.targetduration){if(c)switch(d.live&&(c.getCacheAge&&(d.ageHeader=c.getCacheAge()||0),c.getCacheAge&&!isNaN(d.ageHeader)||(d.ageHeader=0)),s){case l.PlaylistContextType.MANIFEST:case l.PlaylistContextType.LEVEL:this.hls.trigger(i.Events.LEVEL_LOADED,{details:d,level:o||0,id:a||0,stats:e,networkDetails:r,deliveryDirectives:h});break;case l.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(i.Events.AUDIO_TRACK_LOADED,{details:d,id:a||0,groupId:u||"",stats:e,networkDetails:r,deliveryDirectives:h});break;case l.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(i.Events.SUBTITLE_TRACK_LOADED,{details:d,id:a||0,groupId:u||"",stats:e,networkDetails:r,deliveryDirectives:h})}}else this.handleManifestParsingError(t,n,"invalid target duration",r)},t}();e.default=h},"./src/polyfills/number.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"isFiniteNumber",(function(){return r})),n.d(e,"MAX_SAFE_INTEGER",(function(){return i}));var r=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},i=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(t,e,n){"use strict";n.r(e);var r=function(){function t(){}return t.getSilentFrame=function(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)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===e)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===e)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===e)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===e)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])}},t}();e.default=r},"./src/remux/mp4-generator.ts":function(t,e,n){"use strict";n.r(e);var r=Math.pow(2,32)-1,i=function(){function t(){}return t.init=function(){var e;for(e in t.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:[]},t.types)t.types.hasOwnProperty(e)&&(t.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var n=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]),r=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]);t.HDLR_TYPES={video:n,audio:r};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);t.STTS=t.STSC=t.STCO=s,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);t.FTYP=t.box(t.types.ftyp,o,u,o,a),t.DINF=t.box(t.types.dinf,t.box(t.types.dref,i))},t.box=function(t){for(var e=8,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i>24&255,a[1]=e>>16&255,a[2]=e>>8&255,a[3]=255&e,a.set(t,4),s=0,e=8;s>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s,85,196,0,0]))},t.mdia=function(e){return t.box(t.types.mdia,t.mdhd(e.timescale,e.duration),t.hdlr(e.type),t.minf(e))},t.mfhd=function(e){return t.box(t.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))},t.minf=function(e){return"audio"===e.type?t.box(t.types.minf,t.box(t.types.smhd,t.SMHD),t.DINF,t.stbl(e)):t.box(t.types.minf,t.box(t.types.vmhd,t.VMHD),t.DINF,t.stbl(e))},t.moof=function(e,n,r){return t.box(t.types.moof,t.mfhd(e),t.traf(r,n))},t.moov=function(e){for(var n=e.length,r=[];n--;)r[n]=t.trak(e[n]);return t.box.apply(null,[t.types.moov,t.mvhd(e[0].timescale,e[0].duration)].concat(r).concat(t.mvex(e)))},t.mvex=function(e){for(var n=e.length,r=[];n--;)r[n]=t.trex(e[n]);return t.box.apply(null,[t.types.mvex].concat(r))},t.mvhd=function(e,n){n*=e;var i=Math.floor(n/(r+1)),s=Math.floor(n%(r+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,s>>24,s>>16&255,s>>8&255,255&s,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 t.box(t.types.mvhd,o)},t.sdtp=function(e){var n,r,i=e.samples||[],s=new Uint8Array(4+i.length);for(n=0;n>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(r));for(n=0;n>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(r));var a=t.box(t.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|e.sps.length].concat(s).concat([e.pps.length]).concat(o))),u=e.width,l=e.height,c=e.pixelRatio[0],d=e.pixelRatio[1];return t.box(t.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,u>>8&255,255&u,l>>8&255,255&l,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]),a,t.box(t.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),t.box(t.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))},t.esds=function(t){var e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))},t.mp4a=function(e){var n=e.samplerate;return t.box(t.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]),t.box(t.types.esds,t.esds(e)))},t.mp3=function(e){var n=e.samplerate;return t.box(t.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount,0,16,0,0,0,0,n>>8&255,255&n,0,0]))},t.stsd=function(e){return"audio"===e.type?e.isAAC||"mp3"!==e.codec?t.box(t.types.stsd,t.STSD,t.mp4a(e)):t.box(t.types.stsd,t.STSD,t.mp3(e)):t.box(t.types.stsd,t.STSD,t.avc1(e))},t.tkhd=function(e){var n=e.id,i=e.duration*e.timescale,s=e.width,o=e.height,a=Math.floor(i/(r+1)),u=Math.floor(i%(r+1));return t.box(t.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,u>>24,u>>16&255,u>>8&255,255&u,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,s>>8&255,255&s,0,0,o>>8&255,255&o,0,0]))},t.traf=function(e,n){var i=t.sdtp(e),s=e.id,o=Math.floor(n/(r+1)),a=Math.floor(n%(r+1));return t.box(t.types.traf,t.box(t.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s])),t.box(t.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a])),t.trun(e,i.length+16+20+8+16+8+8),i)},t.trak=function(e){return e.duration=e.duration||4294967295,t.box(t.types.trak,t.tkhd(e),t.mdia(e))},t.trex=function(e){var n=e.id;return t.box(t.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},t.trun=function(e,n){var r,i,s,o,a,u,l=e.samples||[],c=l.length,d=12+16*c,h=new Uint8Array(d);for(n+=8+d,h.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0),r=0;r>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,61440&a.degradPrio,15&a.degradPrio,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*r);return t.box(t.types.trun,h)},t.initSegment=function(e){t.types||t.init();var n=t.moov(e),r=new Uint8Array(t.FTYP.byteLength+n.byteLength);return r.set(t.FTYP),r.set(n,t.FTYP.byteLength),r},t}();i.types=void 0,i.HDLR_TYPES=void 0,i.STTS=void 0,i.STSC=void 0,i.STCO=void 0,i.STSZ=void 0,i.VMHD=void 0,i.SMHD=void 0,i.STSD=void 0,i.FTYP=void 0,i.DINF=void 0,e.default=i},"./src/remux/mp4-remuxer.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return m})),n.d(e,"normalizePts",(function(){return g}));var r=n("./src/polyfills/number.ts"),i=n("./src/remux/aac-helper.ts"),s=n("./src/remux/mp4-generator.ts"),o=n("./src/events.ts"),a=n("./src/errors.ts"),u=n("./src/utils/logger.ts"),l=n("./src/types/loader.ts"),c=n("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(t){for(var e=1;e0?t:n.pts}),t[0].pts);return e&&u.logger.debug("PTS rollover detected"),n},e.remux=function(t,e,n,r,i,s,o,a){var c,d,h,p,f,m,v=i,y=i,_=t.pid>-1,b=e.pid>-1,E=e.samples.length,w=t.samples.length>0,S=E>1;if((!_||w)&&(!b||S)||this.ISGenerated||o){this.ISGenerated||(h=this.generateIS(t,e,i));var A=this.isVideoContiguous,T=-1;if(S&&(T=function(t){for(var e=0;e0){u.logger.warn("[mp4-remuxer]: Dropped "+T+" out of "+E+" video samples due to a missing keyframe");var x=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(T),e.dropped+=T,y+=(e.samples[0].pts-x)/(e.timescale||9e4)}else-1===T&&(u.logger.warn("[mp4-remuxer]: No keyframe found out of "+E+" video samples"),m=!1);if(this.ISGenerated){if(w&&S){var k=this.getVideoStartPts(e.samples),C=(g(t.samples[0].pts,k)-k)/e.inputTimeScale;v+=Math.max(0,C),y+=Math.max(0,-C)}if(w){if(t.samplerate||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),h=this.generateIS(t,e,i)),d=this.remuxAudio(t,v,this.isAudioContiguous,s,b||S||a===l.PlaylistLevelType.AUDIO?y:void 0),S){var I=d?d.endPTS-d.startPTS:0;e.inputTimeScale||(u.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),h=this.generateIS(t,e,i)),c=this.remuxVideo(e,y,A,I)}}else S&&(c=this.remuxVideo(e,y,A,0));c&&(c.firstKeyFrame=T,c.independent=-1!==T)}}return this.ISGenerated&&(n.samples.length&&(f=this.remuxID3(n,i)),r.samples.length&&(p=this.remuxText(r,i))),{audio:d,video:c,initSegment:h,independent:m,text:p,id3:f}},e.generateIS=function(t,e,n){var i,o,a,u=t.samples,l=e.samples,c=this.typeSupported,d={},h=!Object(r.isFiniteNumber)(this._initPTS),p="audio/mp4";if(h&&(i=o=1/0),t.config&&u.length&&(t.timescale=t.samplerate,t.isAAC||(c.mpeg?(p="audio/mpeg",t.codec=""):c.mp3&&(t.codec="mp3")),d.audio={id:"audio",container:p,codec:t.codec,initSegment:!t.isAAC&&c.mpeg?new Uint8Array(0):s.default.initSegment([t]),metadata:{channelCount:t.channelCount}},h&&(a=t.inputTimeScale,i=o=u[0].pts-Math.round(a*n))),e.sps&&e.pps&&l.length&&(e.timescale=e.inputTimeScale,d.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:s.default.initSegment([e]),metadata:{width:e.width,height:e.height}},h)){a=e.inputTimeScale;var f=this.getVideoStartPts(l),m=Math.round(a*n);o=Math.min(o,g(l[0].dts,f)-m),i=Math.min(i,f-m)}if(Object.keys(d).length)return this.ISGenerated=!0,h&&(this._initPTS=i,this._initDTS=o),{tracks:d,initPTS:i,timescale:a}},e.remuxVideo=function(t,e,n,r){var i,l,p,m=t.inputTimeScale,y=t.samples,_=[],b=y.length,E=this._initPTS,w=this.nextAvcDts,S=8,A=Number.POSITIVE_INFINITY,T=Number.NEGATIVE_INFINITY,x=0,k=!1;n&&null!==w||(w=e*m-(y[0].pts-g(y[0].dts,y[0].pts)));for(var C=0;CI.pts&&(x=Math.max(Math.min(x,I.pts-I.dts),-18e3)),I.dts0?C-1:C].dts&&(k=!0)}k&&y.sort((function(t,e){var n=t.dts-e.dts,r=t.pts-e.pts;return n||r})),l=y[0].dts,p=y[y.length-1].dts;var D=Math.round((p-l)/(b-1));if(x<0){if(x<-2*D){u.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(c.toMsFromMpegTsClock)(-D,!0)+" ms");for(var O=x,L=0;LD;if(q||P<-1){q?u.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):u.logger.warn("AVC: "+Object(c.toMsFromMpegTsClock)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),l=w;var M=y[0].pts-P;y[0].dts=l,y[0].pts=M,u.logger.log("Video: First PTS/DTS adjusted: "+Object(c.toMsFromMpegTsClock)(M,!0)+"/"+Object(c.toMsFromMpegTsClock)(l,!0)+", delta: "+Object(c.toMsFromMpegTsClock)(P,!0)+" ms")}}f&&(l=Math.max(0,l));for(var N=0,F=0,B=0;B0?Q-1:Q].dts;if(rt.stretchShortVideoTrack&&null!==this.nextAudioPts){var st=Math.floor(rt.maxBufferHole*m),ot=(r?A+r*m:this.nextAudioPts)-Y.pts;ot>st?((i=ot-it)<0&&(i=it),u.logger.log("[mp4-remuxer]: It is approximately "+ot/90+" ms to the next segment; using duration "+i/90+" ms for the last video frame.")):i=it}else i=it}var at=Math.round(Y.pts-Y.dts);_.push(new v(Y.key,i,Z,at))}if(_.length&&h&&h<70){var ut=_[0].flags;ut.dependsOn=2,ut.isNonSync=0}console.assert(void 0!==i,"mp4SampleDuration must be computed"),this.nextAvcDts=w=p+i,this.isVideoContiguous=!0;var lt={data1:s.default.moof(t.sequenceNumber++,l,d({},t,{samples:_})),data2:K,startPTS:A/m,endPTS:(T+i)/m,startDTS:l/m,endDTS:w/m,type:"video",hasAudio:!1,hasVideo:!0,nb:_.length,dropped:t.dropped};return t.samples=[],t.dropped=0,console.assert(K.length,"MDAT length must not be zero"),lt},e.remuxAudio=function(t,e,n,r,l){var c=t.inputTimeScale,h=c/(t.samplerate?t.samplerate:c),p=t.isAAC?1024:1152,f=p*h,m=this._initPTS,y=!t.isAAC&&this.typeSupported.mpeg,_=[],b=t.samples,E=y?0:8,w=this.nextAudioPts||-1,S=e*c;if(this.isAudioContiguous=n=n||b.length&&w>0&&(r&&Math.abs(S-w)<9e3||Math.abs(g(b[0].pts-m,S)-w)<20*f),b.forEach((function(t){t.pts=g(t.pts-m,S)})),!n||w<0){if(b=b.filter((function(t){return t.pts>=0})),!b.length)return;w=0===l?0:r?Math.max(0,S):b[0].pts}if(t.isAAC)for(var A=void 0!==l,T=this.config.maxAudioFramesDrift,x=0,k=w;x=T*f&&O<1e4&&A){var L=Math.round(D/f);(k=I-L*f)<0&&(L--,k+=f),0===x&&(this.nextAudioPts=w=k),u.logger.warn("[mp4-remuxer]: Injecting "+L+" audio frame @ "+(k/c).toFixed(3)+"s due to "+Math.round(1e3*D/c)+" ms gap.");for(var R=0;R0))return;B+=E;try{M=new Uint8Array(B)}catch(t){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:B,reason:"fail allocating audio mdat "+B})}y||(new DataView(M.buffer).setUint32(0,B),M.set(s.default.types.mdat,4))}M.set(V,E);var z=V.byteLength;E+=z,_.push(new v(!0,p,z,0)),F=K}var W=_.length;if(W){var Q=_[_.length-1];this.nextAudioPts=w=F+h*Q.duration;var Y=y?new Uint8Array(0):s.default.moof(t.sequenceNumber++,N/h,d({},t,{samples:_}));t.samples=[];var X=N/c,Z=w/c,J={data1:Y,data2:M,startPTS:X,endPTS:Z,startDTS:X,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:W};return this.isAudioContiguous=!0,console.assert(M.length,"MDAT length must not be zero"),J}},e.remuxEmptyAudio=function(t,e,n,r){var s=t.inputTimeScale,o=s/(t.samplerate?t.samplerate:s),a=this.nextAudioPts,l=(null!==a?a:r.startDTS*s)+this._initDTS,c=r.endDTS*s+this._initDTS,d=1024*o,h=Math.ceil((c-l)/d),p=i.default.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(u.logger.warn("[mp4-remuxer]: remux empty Audio"),p){for(var f=[],m=0;m4294967296;)t+=n;return t}var v=function(t,e,n,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=n,this.cts=r,this.flags=new y(t)},y=function(t){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}},"./src/remux/passthrough-remuxer.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/polyfills/number.ts"),i=n("./src/utils/mp4-tools.ts"),s=n("./src/loader/fragment.ts"),o=n("./src/utils/logger.ts"),a=function(){function t(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var e=t.prototype;return e.destroy=function(){},e.resetTimeStamp=function(t){this.initPTS=t,this.lastEndDTS=null},e.resetNextTimestamp=function(){this.lastEndDTS=null},e.resetInitSegment=function(t,e,n){this.audioCodec=e,this.videoCodec=n,this.generateInitSegment(t),this.emitInitSegment=!0},e.generateInitSegment=function(t){var e=this.audioCodec,n=this.videoCodec;if(!t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(i.parseInitSegment)(t);e||(e=l(r.audio,s.ElementaryStreamTypes.AUDIO)),n||(n=l(r.video,s.ElementaryStreamTypes.VIDEO));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:e+","+n,initSegment:t,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?a.video={container:"video/mp4",codec:n,initSegment:t,id:"main"}:o.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},e.remux=function(t,e,n,s,a){var l=this.initPTS,c=this.lastEndDTS,d={audio:void 0,video:void 0,text:s,id3:n,initSegment:void 0};Object(r.isFiniteNumber)(c)||(c=this.lastEndDTS=a||0);var h=e.samples;if(!h||!h.length)return d;var p={initPTS:void 0,timescale:1},f=this.initData;if(f&&f.length||(this.generateInitSegment(h),f=this.initData),!f||!f.length)return o.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(r.isFiniteNumber)(l)||(this.initPTS=p.initPTS=l=u(f,h,c));var m=Object(i.getDuration)(h,f),g=c,v=m+g;Object(i.offsetStartDTS)(f,h,l),m>0?this.lastEndDTS=v:(o.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!f.audio,_=!!f.video,b="";y&&(b+="audio"),_&&(b+="video");var E={data1:h,startPTS:g,startDTS:g,endPTS:v,endDTS:v,type:b,hasAudio:y,hasVideo:_,nb:1,dropped:0};return d.audio="audio"===E.type?E:void 0,d.video="audio"!==E.type?E:void 0,d.text=s,d.id3=n,d.initSegment=p,d},t}(),u=function(t,e,n){return Object(i.getStartDTS)(t,e)-n};function l(t,e){var n=null==t?void 0:t.codec;return n&&n.length>4?n:"hvc1"===n?"hvc1.1.c.L120.90":"av01"===n?"av01.0.04M.08":"avc1"===n||e===s.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}e.default=a},"./src/task-loop.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return r}));var r=function(){function t(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var e=t.prototype;return e.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},e.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},e.onHandlerDestroyed=function(){},e.hasInterval=function(){return!!this._tickInterval},e.hasNextTick=function(){return!!this._tickTimer},e.setInterval=function(t){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,t),!0)},e.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},e.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},e.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},e.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},e.doTick=function(){},t}()},"./src/types/cmcd.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"CMCDVersion",(function(){return o})),n.d(e,"CMCDObjectType",(function(){return r})),n.d(e,"CMCDStreamingFormat",(function(){return i})),n.d(e,"CMCDStreamType",(function(){return s}));var r,i,s,o=1;!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(r||(r={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(i||(i={})),function(t){t.VOD="v",t.LIVE="l"}(s||(s={}))},"./src/types/level.ts":function(t,e,n){"use strict";function r(t,e){for(var n=0;nNumber.MAX_SAFE_INTEGER?1/0:e},e.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var n=new Uint8Array(e.length/2),r=0;rNumber.MAX_SAFE_INTEGER?1/0:e},e.decimalFloatingPoint=function(t){return parseFloat(this[t])},e.optionalFloat=function(t,e){var n=this[t];return n?parseFloat(n):e},e.enumeratedString=function(t){return this[t]},e.bool=function(t){return"YES"===this[t]},e.decimalResolution=function(t){var e=r.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},t.parseAttrList=function(t){var e,n={};for(i.lastIndex=0;null!==(e=i.exec(t));){var r=e[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),n[e[1]]=r}return n},t}()},"./src/utils/binary-search.ts":function(t,e,n){"use strict";n.r(e),e.default={search:function(t,e){for(var n=0,r=t.length-1,i=null,s=null;n<=r;){var o=e(s=t[i=(n+r)/2|0]);if(o>0)n=i+1;else{if(!(o<0))return s;r=i-1}}return null}}},"./src/utils/buffer-helper.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"BufferHelper",(function(){return s}));var r=n("./src/utils/logger.ts"),i={length:0,start:function(){return 0},end:function(){return 0}},s=function(){function t(){}return t.isBuffered=function(e,n){try{if(e)for(var r=t.getBuffered(e),i=0;i=r.start(i)&&n<=r.end(i))return!0}catch(t){}return!1},t.bufferInfo=function(e,n,r){try{if(e){var i,s=t.getBuffered(e),o=[];for(i=0;io&&(r[s-1].end=t[i].end):r.push(t[i])}else r.push(t[i])}else r=t;for(var a,u=0,l=e,c=e,d=0;d=h&&e=t&&i.logger.log(this.time+" ["+t+"] "+e)},t}(),m=function(t){for(var e=[],n=0;nu&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=u)},e.moveCursor=function(t){var e=this.pos+t;if(t>1)for(var n=this.pos+1;n=144&&this.backSpace();var e=o(t);this.pos>=u?this.logger.log(r.ERROR,"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))},e.clearFromPos=function(t){var e;for(e=t;e0&&(n=t?"["+e.join(" | ")+"]":e.join("\n")),n},e.getTextAndFormat=function(){return this.rows},t}(),b=function(){function t(t,e,n){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=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new _(n),this.nonDisplayedMemory=new _(n),this.lastOutputScreen=new _(n),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}var e=t.prototype;return e.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},e.getHandler=function(){return this.outputFilter},e.setHandler=function(t){this.outputFilter=t},e.setPAC=function(t){this.writeScreen.setPAC(t)},e.setBkgData=function(t){this.writeScreen.setBkgData(t)},e.setMode=function(t){t!==this.mode&&(this.mode=t,this.logger.log(r.INFO,"MODE="+t),"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=t)},e.insertChars=function(t){for(var e=0;e=46,e.italics)e.foreground="white";else{var n=Math.floor(t/2)-16;e.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)},e.outputDataUpdate=function(t){void 0===t&&(t=!1);var e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},e.cueSplitAtTime=function(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))},t}(),E=function(){function t(t,e,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var r=new f;this.channels=[null,new b(t,e,r),new b(t+1,n,r)],this.cmdHistory={a:null,b:null},this.logger=r}var e=t.prototype;return e.getHandler=function(t){return this.channels[t].getHandler()},e.setHandler=function(t,e){this.channels[t].setHandler(e)},e.addData=function(t,e){var n,i,s,o=!1;this.logger.time=t;for(var a=0;a ("+m([i,s])+")"),(n=this.parseCmd(i,s))||(n=this.parseMidrow(i,s)),n||(n=this.parsePAC(i,s)),n||(n=this.parseBackgroundAttributes(i,s)),!n&&(o=this.parseChars(i,s))){var u=this.currentChannel;u&&u>0?this.channels[u].insertChars(o):this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}n||o||this.logger.log(r.WARNING,"Couldn't parse cleaned data "+m([i,s])+" orig: "+m([e[a],e[a+1]]))}},e.parseCmd=function(t,e){var n=this.cmdHistory;if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=33&&e<=35))return!1;if(S(t,e,n))return w(null,null,n),this.logger.log(r.DEBUG,"Repeated command ("+m([t,e])+") is dropped"),!0;var i=20===t||21===t||23===t?1:2,s=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?s.ccRCL():33===e?s.ccBS():34===e?s.ccAOF():35===e?s.ccAON():36===e?s.ccDER():37===e?s.ccRU(2):38===e?s.ccRU(3):39===e?s.ccRU(4):40===e?s.ccFON():41===e?s.ccRDC():42===e?s.ccTR():43===e?s.ccRTD():44===e?s.ccEDM():45===e?s.ccCR():46===e?s.ccENM():47===e&&s.ccEOC():s.ccTO(e-32),w(t,e,n),this.currentChannel=i,!0},e.parseMidrow=function(t,e){var n=0;if((17===t||25===t)&&e>=32&&e<=47){if((n=17===t?1:2)!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var i=this.channels[n];return!!i&&(i.ccMIDROW(e),this.logger.log(r.DEBUG,"MIDROW ("+m([t,e])+")"),!0)}return!1},e.parsePAC=function(t,e){var n,r=this.cmdHistory;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127||(16===t||24===t)&&e>=64&&e<=95))return!1;if(S(t,e,r))return w(null,null,r),!0;var i=t<=23?1:2;n=e>=64&&e<=95?1===i?l[t]:d[t]:1===i?c[t]:h[t];var s=this.channels[i];return!!s&&(s.setPAC(this.interpretPAC(n,e)),w(t,e,r),this.currentChannel=i,!0)},e.interpretPAC=function(t,e){var n,r={color:null,italics:!1,indent:null,underline:!1,row:t};return n=e>95?e-96:e-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},e.parseChars=function(t,e){var n,i,s=null,a=null;if(t>=25?(n=2,a=t-8):(n=1,a=t),a>=17&&a<=19?(i=17===a?e+80:18===a?e+112:e+144,this.logger.log(r.INFO,"Special char '"+o(i)+"' in channel "+n),s=[i]):t>=32&&t<=127&&(s=0===e?[t]:[t,e]),s){var u=m(s);this.logger.log(r.DEBUG,"Char codes = "+u.join(",")),w(t,e,this.cmdHistory)}return s},e.parseBackgroundAttributes=function(t,e){var n;if(!((16===t||24===t)&&e>=32&&e<=47||(23===t||31===t)&&e>=45&&e<=47))return!1;var r={};16===t||24===t?(n=Math.floor((e-32)/2),r.background=p[n],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));var i=t<=23?1:2;return this.channels[i].setBkgData(r),w(t,e,this.cmdHistory),!0},e.reset=function(){for(var t=0;t=16?d--:d++;var v=Object(r.fixLineBreaks)(h.trim()),y=Object(i.generateCueId)(e,n,v);t&&t.cues&&t.cues.getCueById(y)||((l=new f(e,n,v)).id=y,l.line=m+1,l.align="left",l.position=10+Math.min(80,10*Math.floor(8*d/32)),p.push(l))}return t&&p.length&&(p.sort((function(t,e){return"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line})),p.forEach((function(e){return Object(s.addCueToTrack)(t,e)}))),p}};e.default=a},"./src/utils/discontinuities.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"findFirstFragWithCC",(function(){return o})),n.d(e,"shouldAlignOnDiscontinuities",(function(){return a})),n.d(e,"findDiscontinuousReferenceFrag",(function(){return u})),n.d(e,"adjustSlidingStart",(function(){return c})),n.d(e,"alignStream",(function(){return d})),n.d(e,"alignPDT",(function(){return h})),n.d(e,"alignFragmentByPDTDelta",(function(){return p})),n.d(e,"alignMediaPlaylistByPDT",(function(){return f}));var r=n("./src/polyfills/number.ts"),i=n("./src/utils/logger.ts"),s=n("./src/controller/level-helper.ts");function o(t,e){for(var n=null,r=0,i=t.length;rn.startCC||t&&t.cc=this.minWeight_},e.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},e.destroy=function(){},t}();e.default=i},"./src/utils/ewma.ts":function(t,e,n){"use strict";n.r(e);var r=function(){function t(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=n}var e=t.prototype;return e.sample=function(t,e){var n=Math.pow(this.alpha_,t);this.estimate_=e*(1-n)+n*this.estimate_,this.totalWeight_+=t},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_},t}();e.default=r},"./src/utils/fetch-loader.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"fetchSupported",(function(){return h}));var r=n("./src/polyfills/number.ts"),i=n("./src/loader/load-stats.ts"),s=n("./src/demux/chunk-cache.ts");function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,c(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)},o(t)}function a(t,e,n){return a=u()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&l(i,n.prototype),i},a.apply(null,arguments)}function u(){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(t){return!1}}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function d(){return d=Object.assign||function(t){for(var e=1;e=r&&i(e,n,o.flush(),t)):i(e,n,u,t),s()})).catch((function(){return Promise.reject()}))}()},t}();function f(t,e){return new self.Request(t.url,e)}var m=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e)||this).code=void 0,i.details=void 0,i.code=n,i.details=r,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,l(e,n),r}(o(Error));e.default=p},"./src/utils/imsc1-ttml-parser.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"IMSC1_CODEC",(function(){return c})),n.d(e,"parseIMSC1",(function(){return f}));var r=n("./src/utils/mp4-tools.ts"),i=n("./src/utils/vttparser.ts"),s=n("./src/utils/vttcue.ts"),o=n("./src/demux/id3.ts"),a=n("./src/utils/timescale-conversion.ts"),u=n("./src/utils/webvtt-parser.ts");function l(){return l=Object.assign||function(t){for(var e=1;e"):r}function a(t){if(self.console&&!0===t||"object"==typeof t){!function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r>24,t[e+1]=n>>16&255,t[e+2]=n>>8&255,t[e+3]=255&n}function d(t,e){var n,r,i,s=[];if(!e.length)return s;"data"in t?(n=t.data,r=t.start,i=t.end):(r=0,i=(n=t).byteLength);for(var u=r;u1?u+c:i;if(a(n.subarray(u+4,u+8))===e[0])if(1===e.length)s.push({data:n,start:u+8,end:h});else{var p=d({data:n,start:u+8,end:h},e.slice(1));p.length&&o.apply(s,p)}u=h}return s}function h(t){var e=d(t,["moov"])[0],n=e?e.end:null,r=d(t,["sidx"]);if(!r||!r[0])return null;var i=[],s=r[0],o=s.data[0],a=0===o?8:16,c=l(s,a);a+=4,a+=0===o?8:16,a+=2;var h=s.end+0,p=u(s,a);a+=2;for(var f=0;f>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=l(s,m);m+=4,i.push({referenceSize:v,subsegmentDuration:y,info:{duration:y/c,start:h,end:h+v-1}}),h+=v,a=m+=4}return{earliestPresentationTime:0,timescale:c,version:o,referencesCount:p,references:i,moovEndOffset:n}}function p(t){for(var e=[],n=d(t,["moov","trak"]),r=0;rt)&&(this.startTime=t),this.endTime=e,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},e.reset=function(){this.cueRanges=[]},t}()},"./src/utils/texttrack-utils.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"sendAddTrackEvent",(function(){return i})),n.d(e,"addCueToTrack",(function(){return s})),n.d(e,"clearCurrentCues",(function(){return o})),n.d(e,"removeCuesInRange",(function(){return a})),n.d(e,"getCuesInRange",(function(){return u}));var r=n("./src/utils/logger.ts");function i(t,e){var n;try{n=new Event("addtrack")}catch(t){(n=document.createEvent("Event")).initEvent("addtrack",!1,!1)}n.track=t,e.dispatchEvent(n)}function s(t,e){var n=t.mode;if("disabled"===n&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error("addCue is failed for: "+e)}catch(n){r.logger.debug("[texttrack-utils]: "+n);var i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}"disabled"===n&&(t.mode=n)}function o(t){var e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(var n=t.cues.length;n--;)t.removeCue(t.cues[n]);"disabled"===e&&(t.mode=e)}function a(t,e,n){var r=t.mode;if("disabled"===r&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var i=u(t.cues,e,n),s=0;st[n].endTime)return-1;for(var r=0,i=n;r<=i;){var s=Math.floor((i+r)/2);if(et[s].startTime&&r-1)for(var s=i,o=t.length;s=e&&a.endTime<=n)r.push(a);else if(a.startTime>n)return r}return r}},"./src/utils/time-ranges.ts":function(t,e,n){"use strict";n.r(e),e.default={toString:function(t){for(var e="",n=t.length,r=0;r1?e-1:0),r=1;r100)throw new Error("Position must be between 0 and 100.");_=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",i({},u,{get:function(){return b},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",i({},u,{get:function(){return E},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");E=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",i({},u,{get:function(){return w},set:function(t){var e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");w=e,this.hasBeenReset=!0}})),a.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}()},"./src/utils/vttparser.ts":function(t,e,n){"use strict";n.r(e),n.d(e,"parseTimeStamp",(function(){return s})),n.d(e,"fixLineBreaks",(function(){return d})),n.d(e,"VTTParser",(function(){return h}));var r=n("./src/utils/vttcue.ts"),i=function(){function t(){}return t.prototype.decode=function(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))},t}();function s(t){function e(t,e,n,r){return 3600*(0|t)+60*(0|e)+(0|n)+parseFloat(r||0)}var n=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?e(n[2],n[3],0,n[4]):e(n[1],n[2],n[3],n[4]):null}var o=function(){function t(){this.values=Object.create(null)}var e=t.prototype;return e.set=function(t,e){this.get(t)||""===e||(this.values[t]=e)},e.get=function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},e.has=function(t){return t in this.values},e.alt=function(t,e,n){for(var r=0;r=0&&n<=100)return this.set(t,n),!0}return!1},t}();function a(t,e,n,r){var i=r?t.split(r):[t];for(var s in i)if("string"==typeof i[s]){var o=i[s].split(n);2===o.length&&e(o[0],o[1])}}var u=new r.default(0,0,""),l="middle"===u.align?"middle":"center";function c(t,e,n){var r=t;function i(){var e=s(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function c(){t=t.replace(/^\s+/,"")}if(c(),e.startTime=i(),c(),"--\x3e"!==t.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.substr(3),c(),e.endTime=i(),c(),function(t,e){var r=new o;a(t,(function(t,e){var i;switch(t){case"region":for(var s=n.length-1;s>=0;s--)if(n[s].id===e){r.set(t,n[s].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":i=e.split(","),r.integer(t,i[0]),r.percent(t,i[0])&&r.set("snapToLines",!1),r.alt(t,i[0],["auto"]),2===i.length&&r.alt("lineAlign",i[1],["start",l,"end"]);break;case"position":i=e.split(","),r.percent(t,i[0]),2===i.length&&r.alt("positionAlign",i[1],["start",l,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",l,"end","left","right"])}}),/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");var i=r.get("line","auto");"auto"===i&&-1===u.line&&(i=-1),e.line=i,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",l);var s=r.get("position","auto");"auto"===s&&50===u.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function d(t){return t.replace(//gi,"\n")}var h=function(){function t(){this.state="INITIAL",this.buffer="",this.decoder=new i,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var e=t.prototype;return e.parse=function(t){var e=this;function n(){var t=e.buffer,n=0;for(t=d(t);n>>0).toString()};function d(t,e,n){return c(t.toString())+c(e.toString())+c(n)}function h(t,e,n,c,h,p,f,m){var g,v=new i.VTTParser,y=Object(s.utf8ArrayToStr)(new Uint8Array(t)).trim().replace(u,"\n").split("\n"),_=[],b=Object(o.toMpegTsClockFromTimescale)(e,n),E="00:00.000",w=0,S=0,A=!0,T=!1;v.oncue=function(t){var e=c[h],n=c.ccOffset,r=(w-b)/9e4;if(null!=e&&e.new&&(void 0!==S?n=c.ccOffset=e.start:function(t,e,n){var r=t[e],i=t[r.prevCC];if(!i||!i.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!==(s=i)&&void 0!==s&&s.new;){var s;t.ccOffset+=r.start-i.start,r.new=!1,i=t[(r=i).prevCC]}t.presentationOffset=n}(c,h,r)),r&&(n=r-c.presentationOffset),T){var i=t.endTime-t.startTime,s=Object(a.normalizePts)(9e4*(t.startTime+n-S),9e4*p)/9e4;t.startTime=s,t.endTime=s+i}var o=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(o)),t.id||(t.id=d(t.startTime,t.endTime,o)),t.endTime>0&&_.push(t)},v.onparsingerror=function(t){g=t},v.onflush=function(){g?m(g):f(_)},y.forEach((function(t){if(A){if(l(t,"X-TIMESTAMP-MAP=")){A=!1,T=!0,t.substr(16).split(",").forEach((function(t){l(t,"LOCAL:")?E=t.substr(6):l(t,"MPEGTS:")&&(w=parseInt(t.substr(7)))}));try{S=function(t){var e=parseInt(t.substr(-3)),n=parseInt(t.substr(-6,2)),i=parseInt(t.substr(-9,2)),s=t.length>9?parseInt(t.substr(0,t.indexOf(":"))):0;if(!(Object(r.isFiniteNumber)(e)&&Object(r.isFiniteNumber)(n)&&Object(r.isFiniteNumber)(i)&&Object(r.isFiniteNumber)(s)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+t);return e+=1e3*n,(e+=6e4*i)+36e5*s}(E)/1e3}catch(t){T=!1,g=t}return}""===t&&(A=!1)}v.parse(t+"\n")})),v.flush()}},"./src/utils/xhr-loader.ts":function(t,e,n){"use strict";n.r(e);var r=n("./src/utils/logger.ts"),i=n("./src/loader/load-stats.ts"),s=/^age:\s*[\d.]+\s*$/m,o=function(){function t(t){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=t?t.xhrSetup:null,this.stats=new i.LoadStats,this.retryDelay=0}var e=t.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.abortInternal=function(){var t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))},e.abort=function(){var t;this.abortInternal(),null!==(t=this.callbacks)&&void 0!==t&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(t,e,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=n,this.retryDelay=e.retryDelay,this.loadInternal()},e.loadInternal=function(){var t=this.config,e=this.context;if(t){var n=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var i=this.xhrSetup;try{if(i)try{i(n,e.url)}catch(t){n.open("GET",e.url,!0),i(n,e.url)}n.readyState||n.open("GET",e.url,!0);var s=this.context.headers;if(s)for(var o in s)n.setRequestHeader(o,s[o])}catch(t){return void this.callbacks.onError({code:n.status,text:t.message},e,n)}e.rangeEnd&&n.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),n.onreadystatechange=this.readystatechange.bind(this),n.onprogress=this.loadprogress.bind(this),n.responseType=e.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),t.timeout),n.send()}},e.readystatechange=function(){var t=this.context,e=this.loader,n=this.stats;if(t&&e){var i=e.readyState,s=this.config;if(!n.aborted&&i>=2)if(self.clearTimeout(this.requestTimeout),0===n.loading.first&&(n.loading.first=Math.max(self.performance.now(),n.loading.start)),4===i){e.onreadystatechange=null,e.onprogress=null;var o=e.status;if(o>=200&&o<300){var a,u;if(n.loading.end=Math.max(self.performance.now(),n.loading.first),u="arraybuffer"===t.responseType?(a=e.response).byteLength:(a=e.responseText).length,n.loaded=n.total=u,!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(n,t,a,e),!this.callbacks)return;var c={url:e.responseURL,data:a};this.callbacks.onSuccess(c,n,t,e)}else n.retry>=s.maxRetry||o>=400&&o<499?(r.logger.error(o+" while loading "+t.url),this.callbacks.onError({code:o,text:e.statusText},t,e)):(r.logger.warn(o+" while loading "+t.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,s.maxRetryDelay),n.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)}},e.loadtimeout=function(){r.logger.warn("timeout while loading "+this.context.url);var t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(t){var e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)},e.getCacheAge=function(){var t=null;if(this.loader&&s.test(this.loader.getAllResponseHeaders())){var e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t},t}();e.default=o}}).default},t.exports=e())},"./node_modules/preact/dist/preact.module.js":(t,e,n)=>{"use strict";n.d(e,{sY:()=>M,h:()=>f,HY:()=>v,Vf:()=>g,wA:()=>y,YM:()=>i});var r,i,s,o,a,u,l={},c=[],d=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(t,e){for(var n in e)t[n]=e[n];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function f(t,e,n){var i,s,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?s=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return m(t,a,i,s,null)}function m(t,e,n,r,o){var a={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++s:o};return null==o&&null!=i.vnode&&i.vnode(a),a}function g(){return{current:null}}function v(t){return t.children}function y(t,e){this.props=t,this.context=e}function _(t,e){if(null==e)return t.__?_(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e0?m(g.type,g.props,g.key,null,g.__v):g)){if(g.__=n,g.__b=n.__b+1,null===(f=w[h])||f&&g.key==f.key&&g.type===f.type)w[h]=void 0;else for(p=0;p{"use strict";function n(t,e){for(var n in t)if(!(n in e))return!0;for(var r in e)if(t[r]!==e[r])return!0;return!1}e.__esModule=!0,e.default=function(t,e,r){return n(t.props,e)||n(t.state,r)},t.exports=e.default},"./node_modules/sysend/sysend.js":function(t,e,n){var r,i,s;"undefined"!=typeof window&&window,i=[n("./node_modules/sysend/sysend.js")],void 0===(s="function"==typeof(r=function(){var t,e="___sysend___",n=new RegExp(e),r=Math.random(),i={},s={},o=[],a=0,u=0;S();var l=m(i,"to"),c=m(i,"from"),d={broadcast:function(e,n){t?t.postMessage({name:e,data:l(n)}):(p(e,y(n)),setTimeout((function(){f(e)}),0)),v(e,n)},emit:function(t,e){d.broadcast(t,e),E(t,e)},serializer:function(t,e){if("function"!=typeof t||"function"!=typeof e)throw new Error("sysend::serializer: Invalid argument, expecting function");i.to=t,i.from=e},proxy:function(t){if("string"==typeof t&&b(t)!==window.location.host){var e=document.createElement("iframe");e.style.width=e.style.height=0,e.style.border="none";var n=t;t.match(/\.html$/)||(n=t.replace(/\/$/,"")+"/proxy.html"),e.addEventListener("error",(function n(){setTimeout((function(){throw new Error('html proxy file not found on "'+t+'" url')}),0),e.removeEventListener("error",n)})),e.addEventListener("load",(function t(){var n;try{n=e.contentWindow}catch(t){n=e.contentWindow}o.push({window:n,node:e}),e.removeEventListener("load",t)})),document.body.appendChild(e),e.src=n}},on:function(t,e){s[t]||(s[t]=[]),s[t].push(e)},off:function(t,e){if(s[t])if(e)for(var n=s[t].length;n--;)s[t][n]==e&&s[t].splice(n,1);else s[t]=[]}};function h(t){return localStorage.getItem(e+t)}function p(t,n){0==u&&localStorage.setItem(e+t,r),localStorage.setItem(e+t,n)}function f(t){localStorage.removeItem(e+t)}function m(t,e){var n={from:"Unserialize",to:"Serialize"}[e]+" Error: ";return function(r){var i=t[e];try{return i?i(r):r}catch(t){console.warn(n+t.message)}}}function g(){try{return window.self!==window.top}catch(t){return!0}}function v(t,n){o.forEach((function(r){var i={name:e,key:t,data:n};r.window.postMessage(JSON.stringify(i),"*")}))}function y(t){var e=[u++,r];void 0!==t&&e.push(t);var n=l(e);return n===e?JSON.stringify(e):n}function _(t){var e=c(t);return e===t?JSON.parse(t):e}var b=function(){if("undefined"!=typeof URL)return function(t){return(t=new URL(t)).host};var t=document.createElement("a");return function(e){return t.href=e,t.host}}();function E(t,e){s[t].forEach((function(n){n(e,t)}))}function w(){try{return localStorage.setItem(e,1),localStorage.removeItem(e),!1}catch(t){return!0}}function S(){var i=new RegExp("^"+e);for(var o in localStorage)o.match(i)&&localStorage.removeItem(o);"function"==typeof window.BroadcastChannel?(t=new window.BroadcastChannel(e)).addEventListener("message",(function(t){if(t.target.name===e){var n=t.data&&t.data.name;s[n]&&E(n,c(t.data.data))}})):w()?console.warn('Your browser don\'t support localStorgage. In Safari this is most of the time because of "Private Browsing Mode"'):window.addEventListener("storage",(function(t){if(t.key.match(i)&&a++%2==0){var e=t.key.replace(i,"");if(s[e]){var n=t.newValue||h(e);if(n&&n!=r){var o=_(n);o&&o[1]!=r&&E(e,o[2])}}}}),!1),g()&&window.addEventListener("message",(function(t){if("string"==typeof t.data&&t.data.match(n))try{var r=JSON.parse(t.data);r&&r.name===e&&d.broadcast(r.key,c(r.data))}catch(t){}}))}return d})?r.apply(e,i):r)||(t.exports=s)},"./app/components/clearfix/clearfix.component.tsx":(t,e,n)=>{"use strict";n.d(e,{O:()=>o});var r=n("./node_modules/preact/dist/preact.module.js"),i=n("./node_modules/shallow-compare/lib/index.js"),s=n.n(i);class o extends r.wA{shouldComponentUpdate(t,e){return s()(this,t,e)}render(){const t=this.props.id?this.props.id:"quest";return(0,r.h)("div",{id:t,className:"clearfix"},(0,r.h)("div",{className:"clearfix__element"}),(0,r.h)("div",{className:"clearfix__anchor"}),this.props.children)}}},"./app/components/logo/logo.component.tsx":(t,e,n)=>{"use strict";n.d(e,{T:()=>l});var r=n("./node_modules/preact/dist/preact.module.js"),i=n("./app/images/logo.webp"),s=n("./app/environment/template.ts"),o=n("./app/utils/request.ts"),a=n("./app/modules/utm/getCommonUtmParams.ts");const u=(t,e="")=>`${s.Z.landingUrl}${e}?${(0,o.DV)((0,a._)({utmContent:t}))}`,l=({utmContent:t})=>(0,r.h)("div",{className:"logo"},(0,r.h)("a",{className:"logo__link",href:u(t),target:"_blank"},(0,r.h)("img",{alt:"",src:i,className:"logo__image",width:"96",height:"26"})))},"./app/components/message/message.component.tsx":(t,e,n)=>{"use strict";n.d(e,{v:()=>T});var r=n("./node_modules/preact/dist/preact.module.js"),i=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,s=/[&<>"]/;function o(t){var e=String(t);return s.test(e)?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,"""):e}var a=function(t,e){return String(t).replace(/(\n+)/g,"$1"+(e||"\t"))},u=function(t,e,n){return String(t).length>(e||40)||!n&&-1!==String(t).indexOf("\n")||-1!==String(t).indexOf("<")},l={};function c(t){var e="";for(var n in t){var r=t[n];null!=r&&""!==r&&(e&&(e+=" "),e+="-"==n[0]?n:l[n]||(l[n]=n.replace(/([A-Z])/g,"-$1").toLowerCase()),e+=": ",e+=r,"number"==typeof r&&!1===i.test(n)&&(e+="px"),e+=";")}return e||void 0}function d(t,e){for(var n in e)t[n]=e[n];return t}function h(t,e){return Array.isArray(e)?e.reduce(h,t):null!=e&&!1!==e&&t.push(e),t}var p={shallow:!0},f=[],m=/^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,g=/[\s\n\\/='"\0<>]/,v=function(){};_.render=_;var y=[];function _(t,e,n){e=e||{},n=n||{};var i=r.YM.__s;r.YM.__s=!0;var s=b(t,e,n);return r.YM.__c&&r.YM.__c(t,y),y.length=0,r.YM.__s=i,s}function b(t,e,n,i,s,l){if(null==t||"boolean"==typeof t)return"";if("object"!=typeof t)return o(t);var p=n.pretty,y=p&&"string"==typeof p?p:"\t";if(Array.isArray(t)){for(var _="",E=0;E0&&(_+="\n"),_+=b(t[E],e,n,i,s,l);return _}var w,S=t.type,A=t.props,T=!1;if("function"==typeof S){if(T=!0,!n.shallow||!i&&!1!==n.renderRootComponent){if(S===r.HY){var x=[];return h(x,t.props.children),b(x,e,n,!1!==n.shallowHighOrder,s,l)}var k,C=t.__c={__v:t,context:e,props:t.props,setState:v,forceUpdate:v,__h:[]};if(r.YM.__b&&r.YM.__b(t),r.YM.__r&&r.YM.__r(t),S.prototype&&"function"==typeof S.prototype.render){var I=S.contextType,D=I&&e[I.__c],O=null!=I?D?D.props.value:I.__:e;(C=t.__c=new S(A,O)).__v=t,C._dirty=C.__d=!0,C.props=A,null==C.state&&(C.state={}),null==C._nextState&&null==C.__s&&(C._nextState=C.__s=C.state),C.context=O,S.getDerivedStateFromProps?C.state=d(d({},C.state),S.getDerivedStateFromProps(C.props,C.state)):C.componentWillMount&&(C.componentWillMount(),C.state=C._nextState!==C.state?C._nextState:C.__s!==C.state?C.__s:C.state),k=C.render(C.props,C.state,C.context)}else{var L=S.contextType,R=L&&e[L.__c];k=S.call(t.__c,A,null!=L?R?R.props.value:L.__:e)}return C.getChildContext&&(e=d(d({},e),C.getChildContext())),r.YM.diffed&&r.YM.diffed(t),b(k,e,n,!1!==n.shallowHighOrder,s,l)}S=(w=S).displayName||w!==Function&&w.name||function(t){var e=(Function.prototype.toString.call(t).match(/^\s*function\s+([^( ]+)/)||"")[1];if(!e){for(var n=-1,r=f.length;r--;)if(f[r]===t){n=r;break}n<0&&(n=f.push(t)-1),e="UnnamedComponent"+n}return e}(w)}var P,q,M="<"+S;if(A){var N=Object.keys(A);n&&!0===n.sortAttributes&&N.sort();for(var F=0;F",g.test(S))throw new Error(S+" is not a valid HTML tag name in "+M);var H,V=m.test(S)||n.voidElements&&n.voidElements.test(S),K=[];if(q)p&&u(q)&&(q="\n"+y+a(q,y)),M+=q;else if(null!=P&&h(H=[],P).length){for(var z=p&&~M.indexOf("\n"),W=!1,Q=0;Q0&&"<"!=X[0];W&&Z?K[K.length-1]+=X:K.push(X),W=Z}else K.push(X)}}if(p&&z)for(var J=K.length;J--;)K[J]="\n"+y+a(K[J],y)}if(K.length||q)M+=K.join("");else if(n&&n.xml)return M.substring(0,M.length-1)+" />";return!V||H||q?(p&&~M.indexOf("\n")&&(M+="\n"),M+=""):M=M.replace(/>$/," />"),M}_.shallowRender=function(t,e){return _(t,e,p)};const E=_,w=JSON.parse('{"wrongAnswer":"Falsche Antwort.","tryAgainIn":"Versuche erneut in","learnMore":"Erfahren Sie mehr","toShowArticle":"Um weiter zu lesen - ","toReadMoreArticle":"","orOmitQuests":"","buyingSubscription":"","answerQuestionAbove":"beantworten Sie die obige Frage","yes":"Ja!","returnToQuest":"","buySubscription":"","subscriptionBenefits":"","subscribe":"","subscriberProfileTitle":"","recurringSubscription":"","daysLeft":"","expirationDate":"","day":"","days":"","daysExtend":"","subscriberProfile":"","logout":"","alreadyRegistered":"","login":"","successPlaceholder":"","successLeadPlaceholder":"","adblockDisable":"","adblockDisableUseInstruction":"","adblockTitleFirstLine":"","adblockTitleSecondLine":"","adblockReminderFirstLine":"","adblockReminderSecondLine":"","supportBySubscription":"","supportByQuests":"","supportCreators":"","valuableContent":"","supportFoundation":"","support":"","privacyPolicy":"","defaultLeadText":"","leadFormAgreement":"","leadFormSubmitButton":"","leadFormCompletedStatus":"","clickToUnmuteAudio":""}'),S={en:JSON.parse('{"leadFormInputsError":"Please complete the data","watchQuestAnswerQuestionAbove":"watch the video above","watchQuestAnswerButtonsSolvedTooltip":"The text has already been unveiled","watchQuestTopBarSubtitleWithSubscriptionDesktop":"Watch the video or skip questpasses","watchQuestTopBarSubtitleWithSubscriptionMobile":"Watch the video or skip questpasses","watchQuestTopBarSubtitleWithoutSubscriptionDesktop":"Watch the video to reveal the content.","watchQuestTopBarSubtitleWithoutSubscriptionMobile":"Watch the video to reveal the content.","watchQuestTopBarSubtitleWithoutSubscription":"Watch the video to reveal the content.","topBarTitle":"Thanks to ads, you can read for free.","topBarSubtitleWithoutSubscriptionMobile":"Anwer the question below
to reveal the content.","topBarSubtitleWithoutSubscriptionDesktop":"Answer the question below to reveal the content.","topBarSubtitleWithoutSubscription":"Answer the question below to reveal the content.","topBarSubtitleWithSubscriptionMobile":"Answer the question belowor skip questpasses","topBarSubtitleWithSubscriptionDesktop":"Answer the question or skip questpasses","videoAnswerButtonsTooltip":"Watch {seconds} seconds of video to be able to answer","videoTopBarSubtitleWithoutSubscription":"Watch the video and answer the question below to reveal the content.","pollQuestSuccessPlaceholder":"Thank you very much for participating in the survey.","buySubscription":"30 days without questpasses for {price}","buySubscriptionWhenNoCampaignsAvailable":"30 dni dostępu do treści serwisu za {price}","subscriptionBenefits":"read for free by answering the question","subscribe":"activate","expirationDate":"Your subscription expires in {value} {daysLabel}.","day":"day","days":"days","subscriberProfile":"Subscriber panel","wrongAnswer":"Wrong answer.","tryAgainIn":"Please try again in","learnMore":"Find out more","buyingSubscription":"by buying a subscription","toShowArticle":"To reveal the content,","answerQuestionAbove":"answer the question above","watchQuestAnswerButtonMessage":"Click here, to reveal the content below","yes":"Yes!","returnToQuest":"back to the questpass","subscriberProfileTitle":"Thank you for your support!","recurringSubscription":"You subscription will be automatically renewed in {value} {daysLabel}.","daysLeft":"Your subscription will be active for {value} {daysLabel}.","daysExtend":"Renew it now","logout":"Log out","alreadyRegistered":"Already signed up?","login":"Log in","successPlaceholder":"This is the correct answer","successLeadPlaceholder":"Would you like to know the details?","adblockDisable":"To disable adblock","adblockDisableUseInstruction":"follow the guidelines","adblockTitleFirstLine":"To read further for free, please","adblockTitleSecondLine":"disable your adblock software","adblockReminderFirstLine":"After disabling adblock, don’t forget","adblockReminderSecondLine":"to reload the page :)","supportBySubscription":"by buying a subscription","supportByQuests":"or solving questpasses","supportCreators":"Support authors","valuableContent":"of valuable content:","support":"By responding, you support charity with","privacyPolicy":"Privacy policy","defaultLeadText":"Uzupełnij pożądane formy kontaktu:","leadFormAgreement":"I agree to be contacted according to the terms of the service","leadFormSubmitButton":"Zamów kontakt","leadFormCompletedStatus":"Dziękujemy za wysłanie formularza","leadFormError":"Wystąpił błąd, proszę spróbować ponownie","leadFormCheckboxError":"Prosimy potwierdzić zgodę na kontakt","clickToUnmuteAudio":"Kliknij, aby włączyć dźwięk"}'),pl:JSON.parse('{"leadFormInputsError":"Prosimy uzupełnić dane","watchQuestAnswerQuestionAbove":"obejrzyj film powyżej","watchQuestAnswerButtonsSolvedTooltip":"Tekst został już odsłonięty","watchQuestTopBarSubtitleWithSubscriptionDesktop":"Obejrzyj film lub omiń questpassy","watchQuestTopBarSubtitleWithSubscriptionMobile":"Obejrzyj film lub omiń questpassy","watchQuestTopBarSubtitleWithoutSubscriptionDesktop":"Obejrzyj film, aby odsłonić treść.","watchQuestTopBarSubtitleWithoutSubscriptionMobile":"Obejrzyj film, aby odsłonić treść.","watchQuestTopBarSubtitleWithoutSubscription":"Obejrzyj film, aby odsłonić treść.","topBarTitle":"Dzięki reklamom możesz czytać za darmo.","topBarSubtitleWithoutSubscriptionMobile":"Odpowiedz na pytanie poniżej,
żeby odsłonić dalszą część artykułu.","topBarSubtitleWithoutSubscriptionDesktop":"Odpowiedz na pytanie poniżej, żeby odsłonić dalszą część artykułu.","topBarSubtitleWithoutSubscription":"Odpowiedz na pytanie poniżej, aby odsłonić treść.","topBarSubtitleWithSubscriptionMobile":"Odpowiedz na pytanie poniżej
lub omiń questpassy","topBarSubtitleWithSubscriptionDesktop":"Odpowiedz na pytanie lub omiń questpassy","videoAnswerButtonsTooltip":"Obejrzyj {seconds} sekund filmu żeby móc odpowiedzieć","videoTopBarSubtitleWithoutSubscription":"Obejrzyj film i odpowiedz na pytanie poniżej, aby odsłonić treść.","pollQuestSuccessPlaceholder":"Dziękujemy bardzo za udział w badaniu.","buySubscription":"30 dni bez adquestów na tym serwisie za {price}","buySubscriptionWhenNoCampaignsAvailable":"30 dni dostępu do treści serwisu za {price}","subscriptionBenefits":"czytaj za darmo odpowiadając na pytanie","subscribe":"aktywuj","expirationDate":"Twoja subskrypcja wygaśnie za {value} {daysLabel}.","day":"dzień","days":"dni","subscriberProfile":"Panel subskrybenta","wrongAnswer":"Błędna odpowiedź.","tryAgainIn":"Spróbuj ponownie za","learnMore":"Dowiedz się więcej","buyingSubscription":"wykupując subskrypcję","toShowArticle":"Aby odsłonić treść,","answerQuestionAbove":"odpowiedz na pytanie powyżej","watchQuestAnswerButtonMessage":"Kliknij tutaj, aby odsłonić treść poniżej","yes":"Tak!","returnToQuest":"wróć do questpassa","subscriberProfileTitle":"Dziękujemy za wsparcie!","recurringSubscription":"Twoja subskrypcja będzie automatycznie odnowiona za {value} {daysLabel}.","daysLeft":"Twoja subskrypcja będzie aktywna jeszcze {value} {daysLabel}.","daysExtend":"Przedłuż teraz","logout":"Wyloguj się","alreadyRegistered":"Masz już konto?","login":"Zaloguj się","successPlaceholder":"To jest prawidłowa odpowiedź","successLeadPlaceholder":"Życzysz sobie poznać szczegóły?","adblockDisable":"Aby wyłączyć adblocka,","adblockDisableUseInstruction":"skorzystaj z instrukcji","adblockTitleFirstLine":"Aby czytać dalej za darmo, prosimy","adblockTitleSecondLine":"o wyłączenie adblocka","adblockReminderFirstLine":"Po wyłączeniu nie zapomnij","adblockReminderSecondLine":"o odświeżeniu strony :)","supportBySubscription":"wykupując subskrypcję","supportByQuests":"lub rozwiązując questpassy","supportCreators":"Wspieraj twórców","valuableContent":"wartościowych treści:","support":"Rozwiązując questpassa, wspierasz fundację","privacyPolicy":"Polityka prywatności","defaultLeadText":"Uzupełnij pożądane formy kontaktu:","leadFormAgreement":"Zgadzam się na kontakt zgodnie z warunkami usługi","leadFormSubmitButton":"Zamów kontakt","leadFormCompletedStatus":"Dziękujemy za wysłanie formularza","leadFormError":"Wystąpił błąd, proszę spróbować ponownie","leadFormCheckboxError":"Prosimy potwierdzić zgodę na kontakt","clickToUnmuteAudio":"Kliknij, aby włączyć dźwięk"}'),de:w},A=(t,e)=>null!=e?Object.keys(e).reduce(((t,n)=>t.replace(new RegExp(`{(\\s*)${n}(\\s*)}`,"g"),((t,e)=>null==e?`{${t}}`:"string"==typeof e?e:"number"==typeof e?e.toString():E(e))(n,e[n]))),t):t,T=({id:t,language:e,values:n,className:i})=>{const s=S[e][t];return(0,r.h)("span",{className:i,dangerouslySetInnerHTML:{__html:null!=s?A(s,n):t}})}},"./app/environment/template.ts":(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});const r=new class{constructor(){this.parse=t=>{const e=new URLSearchParams(t),n={};return e.forEach(((t,e)=>{n[e]=t})),n}}},i=t=>{if(null==t)return null;if("string"!=typeof t)return Boolean(t);switch(t.toLowerCase()){case"t":case"true":return!0;default:return Boolean(parseInt(t,10))}},s=(t,e=!1)=>{const n=i(t);return null==n?e:n},o=t=>null!=t&&"string"==typeof t&&""!==t?t:null,a=r.parse(window.location.search),u={name:"template",hashClasses:!!parseInt("__HASH_CLASSES__",10)||isNaN(parseInt("__HASH_CLASSES__",10)),apiUrl:"https://request.dqst.pl/v1",baseUrl:"https://system.questpass.pl",landingUrl:"https://questpass.pl",token:"e3d464db-3d66-44ee-9bc5-8ef703108e7b",version:"88",coreVersion:"",env:"prod",mainQuestId:"q-61e77249d0f09",reminderQuestId:"rq-61e77249d0f0a",useTcf:null,hasActiveCampaigns:!!parseInt("1",10),isSubscriptionActive:!!parseInt("0",10),isSubscriptionAvailable:s(a.isSubscriptionAvailable)||!!parseInt("0",10),isSubscriptionRecurring:!!parseInt("0",10),subscriptionDaysLeft:parseInt("0",10),isLoggedIn:!!parseInt("0",10),authorizationUri:"https://tko.pl/wp-json/questpass/v1/subscription-user/login",authorizationError:"",logoutUri:"https://tko.pl/wp-json/questpass/v1/subscription-user/logout",userLogin:"",isDraft:s(a.isDraft)||!parseInt("1",10),serviceName:null,questId:o(a.questpassId),enableCharity:i(a.questpassEnableCharity),language:o(a.questpassLanguage)}},"./app/logger/ConsoleLogger.ts":(t,e,n)=>{"use strict";n.d(e,{k:()=>i});var r=n("./app/environment/template.ts");class i{constructor(){this.DEFAULT_ERROR_MESSAGE="Unknown error",this.shouldLogOnConsole=t=>t.isForEndUser||r.Z.isDraft}makeConsoleArgs({message:t,error:e}){return null!=t?null!=e?[t,e]:[t]:null!=e?[e]:[this.DEFAULT_ERROR_MESSAGE]}debug(t){this.shouldLogOnConsole(t)&&console.debug(...this.makeConsoleArgs(t))}info(t){this.shouldLogOnConsole(t)&&console.info(...this.makeConsoleArgs(t))}warn(t){this.shouldLogOnConsole(t)&&console.warn(...this.makeConsoleArgs(t))}error(t){this.shouldLogOnConsole(t)&&console.error(...this.makeConsoleArgs(t))}}},"./app/logger/simpleLogger.ts":(t,e,n)=>{"use strict";n.d(e,{V:()=>r});const r=new(n("./app/logger/ConsoleLogger.ts").k)},"./app/modules/adblock/index.ts":(t,e,n)=>{"use strict";n.d(e,{x:()=>i});var r=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const i=new class{constructor(){this.adblockStatus=null}detect(){return r(this,void 0,void 0,(function*(){return null!==this.adblockStatus||(this.adblockStatus=yield Promise.all([this.isProvocativeElementModified(),this.isProvocativeRequestBlocked()]).then((t=>t.some((t=>t))))),this.adblockStatus}))}isProvocativeElementModified(){const t=document.createElement("div");return t.innerHTML=" ",t.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links ad_container",t.style.cssText="\n width: 1px !important;\n height: 1px !important;\n position: absolute !important;\n left: -10000px !important;\n top: -1000px !important;\n ",document.body.appendChild(t),new Promise((e=>{setTimeout((()=>{const n=0===t.offsetHeight;document.body.removeChild(t),e(n)}))}))}isProvocativeRequestBlocked(){return r(this,void 0,void 0,(function*(){try{yield Promise.race([fetch("https://cdn.dqst.pl/assets/ads.js?ad_ids=",{mode:"no-cors"}),new Promise((t=>setTimeout((()=>t()),1e3)))])}catch(t){return!0}return!1}))}}},"./app/modules/api/index.ts":(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var r=n("./app/environment/template.ts"),i=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};var s=n("./app/logger/simpleLogger.ts"),o=n("./app/utils/request.ts"),a=n("./app/modules/platform/index.ts"),u=n("./app/modules/reader/ReaderIdResolver.ts"),l=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))},c=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it!==this.params.confirmationToken))}))})}))}postLead(t){return l(this,void 0,void 0,(function*(){return(0,o.ll)(`${r.Z.apiUrl}/lead`,{method:"POST",body:(0,o.NI)(Object.assign(Object.assign({impressionId:this.params.confirmationToken,reader:yield this.params.reader,draft:this.params.isDraft,platform:this.params.platform,ignoreRequest:this.params.ignoreRequest},t),{collateralImpressions:t.collateralImpressions.filter((t=>t!==this.params.confirmationToken))}))})}))}postTrueView(){return l(this,void 0,void 0,(function*(){return(0,o.ll)(`${r.Z.apiUrl}/true_view`,{method:"POST",body:(0,o.NI)({impressionId:this.params.confirmationToken,ignoreRequest:this.params.ignoreRequest})})}))}logRedirect({clickSource:t}){return l(this,void 0,void 0,(function*(){return(0,o.ll)(`${r.Z.apiUrl}/${r.Z.token}/redirect`,{method:"POST",body:(0,o.NI)({confirmationToken:this.params.confirmationToken,reader:yield this.params.reader,clickSource:t,draft:this.params.isDraft,platform:this.params.platform,ignoreRequest:this.params.ignoreRequest})})}))}getService(){const t={platform:this.params.platform};return(0,o.A)(`${r.Z.apiUrl}/services/${r.Z.token}?${(0,o.DV)(t)}`,{method:"GET",headers:{"cache-control":"no-cache, no-store, must-revalidate"}})}logoutSubscriber(t){return l(this,void 0,void 0,(function*(){return(0,o.ll)(t,{method:"DELETE",body:(0,o.NI)({reader_id:yield this.params.reader})})}))}}},"./app/modules/app/App.tsx":(t,e,n)=>{"use strict";n.d(e,{g:()=>Oe});var r=n("./app/environment/template.ts"),i=n("./node_modules/preact/dist/preact.module.js"),s=n("./node_modules/classnames/index.js"),o=n.n(s);const a=({children:t,color:e,link:n,onClick:r,rel:s,target:a,uppercase:u,withArrow:l})=>n?(0,i.h)("a",{className:o()("button",`button--${e}`,{"button--uppercase":u}),href:n,target:a,rel:s},(0,i.h)("div",{className:"button__inner"},t,l?(0,i.h)("div",{className:"button__arrow"}):null)):r?(0,i.h)("button",{className:o()("button",`button--${e}`,{"button--uppercase":u}),onClick:r},(0,i.h)("div",{className:"button__inner"},t,l?(0,i.h)("div",{className:"button__arrow"}):null)):null;var u=n("./app/components/clearfix/clearfix.component.tsx"),l=n("./app/components/logo/logo.component.tsx"),c=n("./app/components/message/message.component.tsx"),d=n("./node_modules/shallow-compare/lib/index.js"),h=n.n(d),p=n("./app/modules/api/index.ts"),f=n("./app/modules/event/EventBus.ts"),m=n("./node_modules/sysend/sysend.js"),g=n.n(m),v=n("./app/modules/event/BaseEventBus.ts");class y extends v.K{constructor(){super(y.PREFIX),this.QUEST_SOLVED="questsolved",this.QUEST_IMPRESSION="questImpression",this.QUEST_TAB_CLOSED="questTabClosed",this.SUBSCRIBER_LOGOUT="subscriberlogout",this.SHARE_COLLATERAL_IMPRESSIONS="shareCollateralImpressions",this.collateralImpressions=new Set([])}on(t,e){const n=this.createEventName(t);g().on(n,e)}off(t){const e=this.createEventName(t);g().off(e)}reset(){[this.QUEST_IMPRESSION,this.QUEST_TAB_CLOSED,this.SHARE_COLLATERAL_IMPRESSIONS,this.QUEST_SOLVED,this.SUBSCRIBER_LOGOUT].forEach((t=>{this.off(t)}))}dispatchEvent(t,e){const n=this.createEventName(t);g().broadcast(n,e)}questSolved(t){this.dispatchEvent(this.QUEST_SOLVED,t)}questImpression(t){this.dispatchEvent(this.QUEST_IMPRESSION,t)}shareCollateralImpressions(t){this.dispatchEvent(this.SHARE_COLLATERAL_IMPRESSIONS,t)}questTabClosed(t){this.dispatchEvent(this.QUEST_TAB_CLOSED,t)}subscriberLogout(){this.dispatchEvent(this.SUBSCRIBER_LOGOUT,{})}getCollateralImpressions(){return Array.from(this.collateralImpressions.values())}}y.PREFIX="adquestoTab";const _=new y;var b=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};class E extends i.wA{constructor(t){super(t),this.logout=()=>b(this,void 0,void 0,(function*(){const{subscriptionConfig:{logoutUri:t}}=this.props;try{t?yield p.Z.logoutSubscriber(t):this.logger.warn({isForEndUser:!0,message:"No logout uri"}),_.subscriberLogout(),f.Y.subscriberLogout()}catch(t){this.logger.error({isForEndUser:!0,error:t})}})),this.logger=t.logger}shouldComponentUpdate(t,e){return h()(this,t,e)}get authorizationUri(){const{authorizationUri:t,subscriptionConfig:e}=this.props;return t||e.authorizationUri||void 0}renderLoggedIn(){const{language:t}=this.props;return(0,i.h)("div",{className:"subscriber-footer__logged-in"},(0,i.h)("div",{className:"subscriber-footer__logged--in-links"},(0,i.h)("a",{href:`${r.Z.baseUrl}/subscriber`,className:"subscriber-footer__link",target:"_blank"},(0,i.h)(c.v,{language:t,id:"subscriberProfile"})),(0,i.h)("span",{className:"subscriber-footer__logged--in-separator"}," | "),(0,i.h)("span",{className:"subscriber-footer__link",onClick:this.logout},(0,i.h)(c.v,{language:t,id:"logout"}))))}renderAnonymous(){const{language:t}=this.props;return(0,i.h)("div",{className:"subscriber-footer__anonymous"},(0,i.h)(c.v,{language:t,id:"alreadyRegistered"})," ",(0,i.h)("span",{className:"subscriber-footer__link-wrapper"},(0,i.h)("a",{className:"subscriber-footer__link subscriber-footer__link--with-arrow",href:this.authorizationUri},(0,i.h)(c.v,{language:t,id:"login"}))))}render(){const{subscriptionConfig:t}=this.props;return(0,i.h)("div",{className:"subscriber-footer"},t.isLoggedIn?this.renderLoggedIn():this.renderAnonymous())}}class w extends i.wA{constructor(){super(...arguments),this.state={active:!1},this.animateIn=()=>this.setState({active:!0})}componentDidMount(){this.animateIn(),this.props.emitOnMount&&this.props.emitOnMount()}get subscriptionDaysLeft(){return this.props.subscriptionConfig.subscriptionDaysLeft}get daysLabel(){return 1===this.subscriptionDaysLeft?(0,i.h)(c.v,{id:"day",language:this.props.language}):(0,i.h)(c.v,{id:"days",language:this.props.language})}get renewSessionLink(){const t=encodeURIComponent(window.location.href);return`${r.Z.baseUrl}/subscriber/subscription/${r.Z.token}?renew_session=true&ref=${t}`}render(){const{language:t,logger:e,service:n,subscriptionConfig:r}=this.props,{active:s}=this.state;return(0,i.h)(u.O,null,(0,i.h)("div",{className:o()("subscriber-profile",{"subscriber-profile--active":s})},(0,i.h)("div",{className:"subscriber-profile__inner"},(0,i.h)("div",{className:"subscriber-profile__content"},(0,i.h)("img",{className:"subscriber-profile__logo",src:n.logo}),(0,i.h)("div",{className:"subscriber-profile__title"},(0,i.h)(c.v,{language:t,id:"subscriberProfileTitle"})),r.isSubscriptionRecurring?(0,i.h)("div",{className:"subscriber-profile__subtitle"},(0,i.h)(c.v,{language:t,id:"recurringSubscription",values:{value:this.subscriptionDaysLeft,daysLabel:this.daysLabel}})):null,!r.isSubscriptionRecurring&&this.subscriptionDaysLeft>10?(0,i.h)("div",{className:"subscriber-profile__subtitle"},(0,i.h)(c.v,{language:t,id:"daysLeft",values:{value:this.subscriptionDaysLeft,daysLabel:this.daysLabel}})):null,!r.isSubscriptionRecurring&&this.subscriptionDaysLeft<=10?(0,i.h)("div",null,(0,i.h)("div",{className:"subscriber-profile__subtitle"},(0,i.h)(c.v,{language:t,id:"expirationDate",values:{value:this.subscriptionDaysLeft,daysLabel:this.daysLabel}})),(0,i.h)("div",{className:"subscriber-profile__extend-button"},(0,i.h)(a,{uppercase:!0,withArrow:!0,color:"green",link:this.renewSessionLink},(0,i.h)(c.v,{language:t,id:"daysExtend"})))):null),(0,i.h)("div",{className:"subscriber-profile__footer"},(0,i.h)(E,{language:t,logger:e,subscriptionConfig:r}))),(0,i.h)(l.T,{utmContent:"subscription"})))}}var S=n("./node_modules/@sentry/browser/dist/index.js"),A=n("./app/logger/ConsoleLogger.ts"),T=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};class x extends A.k{constructor(t,e){super(),this.options=t,this.scriptName=e,this.shouldSendToSentry=t=>!t.isLocalOnly,this.hub=new S.Hub(new S.BrowserClient(Object.assign({},t)))}reconfigure(t,e){var n;return T(this,void 0,void 0,(function*(){yield null===(n=this.hub.getClient())||void 0===n?void 0:n.close(e),this.hub.bindClient(new S.BrowserClient(Object.assign(Object.assign({},this.options),t)))}))}createSyntheticError(t){var e;const n=new Error(t);return Object.assign(Object.assign({},n),{stack:null===(e=n.stack)||void 0===e?void 0:e.split("\n").slice(2).join("\n")})}getErrorFromUnknown(t){const e=t;return null==e||"string"!=typeof e.message||"string"!=typeof e.name||"string"!=typeof e.stack&&void 0!==e.stack?null:e}hint(t){return{captureContext:{tags:{script:this.scriptName}},syntheticException:t}}warn(t){super.warn(t),this.shouldSendToSentry(t)&&t.message&&this.hub.captureMessage(t.message,S.Severity.Warning,this.hint(this.getErrorFromUnknown(t.error)||this.createSyntheticError(t.message)))}error(t){if(super.error(t),this.shouldSendToSentry(t)){const e=t.message||this.DEFAULT_ERROR_MESSAGE;null!=t.error?this.hub.captureException(t.error,this.hint(this.getErrorFromUnknown(t.error)||this.createSyntheticError(e))):this.hub.captureMessage(e,S.Severity.Error,this.hint(this.createSyntheticError(e)))}}}const k={adQuest:"quest",videoQuest:"videoquest",watchQuest:"watchquest",brandLift:"pollquest",surveyQuest:"surveyquest"},C=["contact_attempt","contact_impression"],I=()=>r.Z.env&&(!r.Z.isDraft||"demo"!==r.Z.name);const D=new class{constructor(){this.capping={},this.basicEventData=null,this.init=t=>{this.basicEventData=t},this.push=(t,e)=>{const n=this.capping[t]||0;n>=100||(this.capping[t]=n+1,this.send(t,e))},this.impression=t=>this.push(`${t}_impression`),this.contactAttempt=t=>{this.push("contact_attempt",{eventParams:t})},this.contactImpression=()=>{this.push("contact_impression",{})},this.answer=t=>{t!==k.videoQuest&&this.push(`${t}_answer`)},this.videoAnswer=t=>{this.push("video_answer",{eventParams:t})},this.videoPlay=t=>{this.push("video_play",{eventParams:t})},this.videoProgress=t=>{this.push("video_progress",{eventParams:t})},this.videoPause=t=>{this.push("video_pause",{eventParams:t})},this.videoEnd=t=>{this.push("video_end",{eventParams:t})},this.videoVolumeChange=t=>{this.push("video_volume_change",{eventParams:t})},this.send=(t,e)=>{I()&&window.adqt&&window.adqt(this.getStreamName(t),Object.assign(Object.assign({eventCode:t,eventTime:(new Date).getTime(),isDraft:r.Z.isDraft},this.basicEventData),e))},I()&&(t=>{var e;const n=(t=>"dev"===t?"http://localhost:5000/static/adqt.js":-1!==["prod","stage","test"].indexOf(t)?`https://cdn.dqst.pl/static/${t}/adqt.js`:void 0)(t);if(n&&void 0===window.adqt){window.adqt=window.adqt||((...t)=>{window.adqtRun?window.adqtRun(...t):(window.adqtEvents=window.adqtEvents||[]).push(t)});const t=document.createElement("script");t.src=n,t.async=!0,null===(e=document.getElementsByTagName("head")[0])||void 0===e||e.appendChild(t)}})(r.Z.env)}getStreamName(t){return C.includes(t)?`contacts_stream_${r.Z.env}`:`quests_stream_${r.Z.env}`}};var O=n("./app/modules/classRandomizer/index.ts");class L{constructor(t){this.initializationTime=(new Date).getTime(),this.hoverTime=null,this.containerElement=t,this.isScrollEventPresent=!1,this.handleWindowScrollFn=this.handleWindowScroll.bind(this),this.initializeListeners()}isTouchDevice(){return"ontouchstart"in window.document}isScrollRequired(){return window.innerHeight-1!==t.toLowerCase().indexOf("selenium")||-1!==t.toLowerCase().indexOf("webdriver")))||(!!Object.keys(document).some((t=>-1!==t.toLowerCase().indexOf("selenium")||-1!==t.toLowerCase().indexOf("webdriver")))||!!Object.keys(document).some((t=>-1!==t.toLowerCase().indexOf("$cdc_")||-1!==t.toLowerCase().indexOf("$wdc_"))))}startHoverTime(){this.hoverTime=(new Date).getTime()}getResults(t,e){const n=this.measureClickPosition(t,e);return{answerTime:this.measureInitializationTime(),hoverTime:this.measureHoverTime(),clickPositionX:n.x,clickPositionY:n.y,buttonWidth:e.offsetWidth,buttonHeight:e.offsetHeight,pointerDownEvent:!0===t.isTrusted,isValidScroll:this.isScrollEventPresent||!this.isScrollRequired(),seleniumVariablesExist:this.detectSelenium(),windowSizeX:window.innerWidth,windowSizeY:window.innerHeight,isTouch:this.isTouchDevice()}}}var R=n("./node_modules/fontfaceobserver/fontfaceobserver.standalone.js"),P=n.n(R),q=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};var M=n("./app/modules/language/detectLanguage.ts"),N=n("./app/modules/platform/index.ts"),F=n("./app/modules/quest/foldQuestResponse.ts"),B=n("./app/images/pollquest-banner-en.webp"),j=n("./app/images/pollquest-banner-pl.webp");const U=t=>{Array.from(t.getElementsByTagName("script")).filter((t=>!t.hasAttribute("data-evaluated"))).forEach((t=>{var e;const n=document.createElement("script");n.type="text/javascript",n.text=t.innerHTML;for(let e=0;e{const i=Date.now(),s=window.pageXOffset||document.documentElement.scrollLeft;n+r>i?(window.scrollTo(s,t+(t=>t*(2-t))((i-n)/r)*(e-t)),requestAnimationFrame((()=>G(t,e,n,r)))):window.scrollTo(s,e)};var H=n("./app/theme.ts");const V=t=>{if("string"==typeof t||null==t)return t||null;const e=(N.a.isIOS()||N.a.isMac())&&window.devicePixelRatio>=2,n=window.innerWidth;return e?n<=480?t.mobileRetina:t.desktopRetina:n<=480?t.mobile:t.desktop},K=(t,e)=>t.reduce(((t,n)=>{const r=null!=e.images&&e.images[n]||e[n];return Object.assign(Object.assign({},t),null!=r?{[n]:r}:{})}),{}),z=({className:t})=>(0,i.h)("div",{className:o()("loader",t)},(0,i.h)("div",{className:"loader__separator"}));class W extends i.wA{shouldComponentUpdate(){return!1}render(){const{trackingCode:t,setTrackingElementRef:e,className:n}=this.props;return(0,i.h)("div",{ref:e,className:n||"",dangerouslySetInnerHTML:{__html:t}})}}const Q=({language:t,utmContent:e})=>(0,i.h)("div",{className:"quest__footer"},(0,i.h)(l.T,{utmContent:e}),(0,i.h)("div",{className:"quest__privacy-policy"},(0,i.h)(c.v,{language:t,id:"privacyPolicy"})));var Y,X,Z,J=0,$=[],tt=i.YM.__b,et=i.YM.__r,nt=i.YM.diffed,rt=i.YM.__c,it=i.YM.unmount;function st(t,e){i.YM.__h&&i.YM.__h(X,t,J||e),J=0;var n=X.__H||(X.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function ot(t){return J=1,function(t,e,n){var r=st(Y++,2);return r.t=t,r.__c||(r.__=[n?n(e):mt(void 0,e),function(t){var e=r.t(r.__[0],t);r.__[0]!==e&&(r.__=[e,r.__[1]],r.__c.setState({}))}],r.__c=X),r.__}(mt,t)}function at(t){return J=5,ut((function(){return{current:t}}),[])}function ut(t,e){var n=st(Y++,7);return ft(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function lt(t,e){return J=8,ut((function(){return t}),e)}function ct(){var t;for($.sort((function(t,e){return t.__v.__b-e.__v.__b}));t=$.pop();)if(t.__P)try{t.__H.__h.forEach(ht),t.__H.__h.forEach(pt),t.__H.__h=[]}catch(e){t.__H.__h=[],i.YM.__e(e,t.__v)}}i.YM.__b=function(t){X=null,tt&&tt(t)},i.YM.__r=function(t){et&&et(t),Y=0;var e=(X=t.__c).__H;e&&(e.__h.forEach(ht),e.__h.forEach(pt),e.__h=[])},i.YM.diffed=function(t){nt&&nt(t);var e=t.__c;e&&e.__H&&e.__H.__h.length&&(1!==$.push(e)&&Z===i.YM.requestAnimationFrame||((Z=i.YM.requestAnimationFrame)||function(t){var e,n=function(){clearTimeout(r),dt&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);dt&&(e=requestAnimationFrame(n))})(ct)),X=null},i.YM.__c=function(t,e){e.some((function(t){try{t.__h.forEach(ht),t.__h=t.__h.filter((function(t){return!t.__||pt(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],i.YM.__e(n,t.__v)}})),rt&&rt(t,e)},i.YM.unmount=function(t){it&&it(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{ht(t)}catch(t){e=t}})),e&&i.YM.__e(e,n.__v))};var dt="function"==typeof requestAnimationFrame;function ht(t){var e=X,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),X=e}function pt(t){var e=X;t.__c=t.__(),X=e}function ft(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function mt(t,e){return"function"==typeof e?e(t):e}const gt=(t,e,n)=>{!function(t,e){var n=st(Y++,3);!i.YM.__s&&ft(n.__H,e)&&(n.__=t,n.__H=e,X.__H.__h.push(n))}((()=>{if(window.IntersectionObserver&&t){const r=new IntersectionObserver(n,{threshold:e});return r.observe(t),()=>{r.unobserve(t)}}}),[t,e,n])},vt=(t,e)=>{const n=lt((()=>{let t=null,n=!1;return r=>{r.forEach((r=>{t&&(clearTimeout(t),t=null),r.isIntersecting&&!n&&(t=setTimeout((()=>{t=null,e(),n=!0}),1e3))}))}})(),[e]);gt(t,1,n)},yt="main_button",_t=t=>e=>{1===e.button&&t(e)};var bt=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const Et=()=>bt(void 0,void 0,void 0,(function*(){f.Y.trueView(),yield p.Z.postTrueView()})),wt=({solved:t,isReminder:e,redirectUrl:n,image:s,successImg:a})=>{const u=at(null),l=lt((()=>(({solved:t,isReminder:e,redirectUrl:n})=>{if(n&&t){const t=e?"reminder_graphic":"main_graphic";f.Y.ctaClicked({clickSource:t}),r.Z.isDraft||p.Z.logRedirect({clickSource:t})}})({solved:t,isReminder:e,redirectUrl:n})),[t,e,n]),c=lt(_t(l),[l]);return vt(u.current,Et),(0,i.h)("a",{className:o()("quest__image-link",{"quest__image-link--solved":t&&n}),href:t&&n?n:void 0,target:"_blank",rel:"nofollow"},(0,i.h)("img",{ref:u,className:"quest__image",alt:"Quest image",src:s,onClick:l,onMouseDown:c,width:490,height:245}),(0,i.h)("img",{className:o()("quest__image quest__image--success",{"quest__image--success-show":t&&a}),alt:" ",src:a,onClick:l,onMouseDown:c,width:490,height:245}))};var St=n("./node_modules/hls.js/dist/hls.js"),At=n.n(St);const Tt=new class{constructor(){this.preloadHlsVideo=(t,e,n)=>{const r=t.getAttribute("data-preloading"),i=new(At());i.attachMedia(t),i.loadSource(e.hls),r&&n&&(i.on(At().Events.MANIFEST_PARSED,n),t.removeAttribute("data-preloading"))},this.preloadNativeHlsVideo=(t,e,n)=>{t.addEventListener("canplay",(()=>{t.getAttribute("data-preloading")&&(n&&n(),t.removeAttribute("data-preloading"))})),t.src=e.hls,t.autoplay=!0},this.preloadMp4Video=(t,e,n)=>{const r=document.createElement("source"),i=t.getAttribute("data-preloading");r.src=`${e.mp4}#t=0.5`,r.type="video/mp4",t.appendChild(r),i&&n&&(t.oncanplay=n,t.removeAttribute("data-preloading"))},this.preloadVideo=(t,e,n)=>{if("hls"in e&&null!=e.hls){const r=e;At().isSupported()?this.preloadHlsVideo(t,r,n):t.canPlayType("application/vnd.apple.mpegurl")&&this.preloadNativeHlsVideo(t,r,n)}else if("mp4"in e&&null!=e.mp4){const r=e;this.preloadMp4Video(t,r,n)}}}},xt=({ended:t,firstTouch:e,language:n,started:r,volume:s,onClick:a})=>(0,i.h)("div",{className:o()("quest__video-audio-information",{"quest__video-audio-information--show":0===s&&!e&&!t&&r}),onClick:a},(0,i.h)("i",{className:"quest__video-controls-icon quest__video-controls-sound-icon"}),(0,i.h)("span",{className:"quest__video-audio-text"},(0,i.h)(c.v,{language:n,id:"clickToUnmuteAudio"}))),kt=({questConfig:{secondsToActivateAnswers:t},duration:e})=>(0,i.h)("div",{className:"quest__video-answer-pixel",style:{left:t/e*100+"%"}});class Ct extends i.wA{constructor(t){super(t),this.updateProgress=t=>{this.setState({progress:t})}}render(){const{answerResponse:t,duration:e,logger:n,questConfig:r,onSeek:s}=this.props,{progress:o}=this.state,a=at(null),u=lt((t=>((t,e,n,r,i)=>{if(null!=e){const s=e.getBoundingClientRect(),o=(n.clientX-s.left)/s.width;(o<0||o>1)&&t.warn({message:`Invalid video seek fraction: ${o}`}),r((i||0)*o)}})(n,a.current,t,s,e)),[a.current,e,n,s]),l=e?o/e:0;return(0,i.h)("div",{ref:a,className:"quest__video-progressbar",onClick:u},(0,i.h)("div",{className:"quest__video-progressbar-progress"},!t&&e&&(0,i.h)(kt,{duration:e,questConfig:r}),(0,i.h)("span",{style:{width:100*l+"%"}})))}}const It=({volume:t,videoInputVolume:e,onToggleMute:n,onVolumeChange:r})=>{let s=null;const a=100*(t>0&&null!=e&&!isNaN(e)?e:t),[u,l]=ot(!1),c=lt((t=>{r(parseInt(t.target.value,10)/100)}),[r]),d=lt((()=>{null!=s&&clearTimeout(s),l(!0)}),[s,l]),h=lt((()=>{s=setTimeout((()=>l(!1)),500)}),[l]);return(0,i.h)(i.HY,null,(0,i.h)("div",{className:o()("quest__video-controls-icon quest__video-controls-sound-icon",{"quest__video-controls-sound-icon-muted":0===t,"quest__video-controls-sound-icon-max":t>.8}),onMouseOver:d,onMouseOut:h,onClick:n,onTouchStart:d}),(0,i.h)("input",{type:"range",min:"0",max:"100",value:a,className:o()("quest__video-volume",{"quest__video-volume--visible":u}),onChange:c,onMouseOver:d,onMouseOut:h}))};class Dt extends i.wA{constructor(){super(...arguments),this.progressBarRef=(0,i.Vf)(),this.updateProgress=t=>{var e,n;null===(n=null===(e=this.progressBarRef)||void 0===e?void 0:e.current)||void 0===n||n.updateProgress(t)}}render(){const{answerResponse:t,duration:e,logger:n,ended:r,paused:s,playing:o,questConfig:a,volume:u,videoInputVolume:l,onSeek:c,onToggleMute:d,onTogglePlay:h,onVolumeChange:p}=this.props;return(0,i.h)("div",{className:"quest__video-controls"},s&&(0,i.h)("div",{className:"quest__video-controls-icon quest__video-controls-play-icon",onClick:h}),o&&(0,i.h)("div",{className:"quest__video-controls-icon quest__video-controls-pause-icon",onClick:h}),r&&(0,i.h)("div",{className:"quest__video-controls-icon quest__video-controls-replay-icon",onClick:h}),(0,i.h)(It,{volume:u,onToggleMute:d,onVolumeChange:p,videoInputVolume:l}),(0,i.h)(Ct,{ref:this.progressBarRef,answerResponse:t,duration:e,questConfig:a,logger:n,onSeek:c}))}}const Ot=()=>(0,i.h)("div",{className:"quest__video-loader"},(0,i.h)("div",null),(0,i.h)("div",null),(0,i.h)("div",null),(0,i.h)("div",null));var Lt=n("./app/images/playIcon.webp");const Rt=({onClick:t})=>(0,i.h)("img",{className:"quest__video-play-icon",src:Lt,alt:"",onClick:t}),Pt=({onClick:t,questConfig:e})=>{return(0,i.h)("div",{className:"quest__video-timer",onClick:t},(n=e.secondsToActivateAnswers,String(String(new Date(1e3*n).toISOString()).substr(14,5)).replace(".",":")));var n},qt=({ended:t,started:e,questConfig:n,onTogglePlay:r})=>(0,i.h)("div",{className:"quest__video-overlay"},!t&&(0,i.h)(Rt,{onClick:r}),!e&&(0,i.h)(Pt,{onClick:r,questConfig:n}),(0,i.h)(Ot,null));var Mt=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))};const Nt={rootMargin:"0px",threshold:[.49,.5]},Ft=t=>null==t||t.intersectionRatio>Nt.threshold[0];class Bt extends i.wA{constructor(t){super(t),this.videoContainerRef=(0,i.Vf)(),this.controlsRef=(0,i.Vf)(),this.waitingTimeout=null,this.pausedByClick=!1,this.answerVideoLoaded=!1,this.answerTime=null,this.videoEndReached=!1,this.lastProgressTime=0,this.lastIntersectionEntry=null,this.intersectionObserver=null,this.videoRef=(0,i.Vf)(),this.maxTimePosition=0,this.getParamsToAnalytics=()=>{const{answerResponse:t}=this.props,e=this.videoElement.currentTime;return{currentVideoPos:e,maxVideoTime:Math.max(this.maxTimePosition,e),answered:this.props.solved,answerTime:this.answerTime,answerId:(null==t?void 0:t.id)||null,videoEndReached:this.videoEndReached}},this.generateDataStateAttribute=t=>{const{playing:e,started:n,disabledAnswers:r,played:i,paused:s,loading:o,ended:a}=t;return{playing:e,"not-started":!n,"disabled-answers":r,"enabled-answers":!r&&!this.props.solved,solved:this.props.solved,played:i,paused:s,loading:o,ended:a}},this.handlePlay=()=>Mt(this,void 0,void 0,(function*(){const{isPlayVideoTrackingCodeVisible:t,showVideoTrackingCode:e}=this.props;this.handleUpdateQuestDataState({ended:!1,playing:!0,started:!0,paused:!1});const n=this.videoRef.current;if(null!=n&&n.paused){try{yield n.play()}catch(t){return void this.logger.error({error:t})}t||e(),D.videoPlay(this.getParamsToAnalytics())}})),this.handleWaiting=()=>{const{disabledAnswers:t}=this.state;!this.waitingTimeout&&t&&(this.waitingTimeout=setTimeout((()=>{this.handleAllowToAnswer(),this.waitingTimeout=null}),3e3)),this.handleUpdateQuestDataState({loading:!0})},this.handlePlaying=()=>{this.handleUpdateQuestDataState({loading:!1})},this.handleProgress=()=>{this.waitingTimeout&&(clearTimeout(this.waitingTimeout),this.waitingTimeout=null)},this.handlePause=()=>Mt(this,void 0,void 0,(function*(){try{this.videoElement.pause()}catch(t){return void this.logger.error({error:t})}this.handleUpdateQuestDataState({playing:!1,paused:!0}),D.videoPause(this.getParamsToAnalytics())})),this.handleTogglePlay=t=>{this.videoElement.paused?this.handlePlay():(this.pausedByClick=Boolean(t),this.handlePause())},this.handleAllowToAnswer=()=>{const{onAllowToAnswer:t}=this.props,{disabledAnswers:e}=this.state;e&&(t(),this.handleUpdateQuestDataState({disabledAnswers:!1}))},this.handleUpdateQuestDataState=t=>{const{onSetVideoStateDataAttribute:e}=this.props;this.setState(Object.assign({},t)),e(this.generateDataStateAttribute(Object.assign(Object.assign({},this.state),t)))},this.handleSeekVideo=t=>{t<=this.maxTimePosition&&(this.videoElement.currentTime=t,this.updateProgress(t),this.videoElement.currentTime{const t=this.videoRef.current;if(null!=t){const{questConfig:e}=this.props;t.currentTime>this.maxTimePosition&&(this.maxTimePosition=t.currentTime),t.currentTime>this.lastProgressTime&&(this.lastProgressTime=t.currentTime,D.videoProgress(this.getParamsToAnalytics())),this.updateProgress(!this.state.ended||t.currentTime>0?t.currentTime:t.duration),t.currentTime>=e.secondsToActivateAnswers&&this.handleAllowToAnswer()}},this.handleEnded=()=>{const{onAutoAnswer:t}=this.props;this.videoElement.pause(),this.handleUpdateQuestDataState({playing:!1}),t&&t(),this.updateProgress(this.videoElement.duration),requestAnimationFrame((()=>{this.handleUpdateQuestDataState({ended:!0})})),this.videoEndReached=!0,this.lastProgressTime=0,D.videoEnd(this.getParamsToAnalytics())},this.handlePostImageAnimationEnded=t=>{"visible"===window.getComputedStyle(t.target).visibility&&(this.videoElement.currentTime=0)},this.handleVolumeChange=t=>{this.setVideoVolume(t),this.setState({volume:t})},this.setVideoVolume=t=>{this.videoElement.volume=t;const e=this.getParamsToAnalytics();D.videoVolumeChange(Object.assign({volume:100*t},e))},this.toggleMute=()=>{const{volume:t,storedVolume:e}=this.state;t>0?(this.setState({storedVolume:t,volume:0}),this.setVideoVolume(0)):(this.setState({storedVolume:0,volume:e}),this.setVideoVolume(e))},this.handleSeeking=()=>{this.handleUpdateQuestDataState({loading:!0})},this.handleSeeked=()=>{this.handleUpdateQuestDataState({loading:!1})},this.initVideo=(t,e)=>{this.maxTimePosition=0,this.videoEndReached=!1,this.lastProgressTime=0,this.videoElement.setAttribute("data-preloading","true"),Tt.preloadVideo(this.videoElement,t,e),this.initVideoEvents()},this.initVideoEvents=()=>{const t=this.videoElement;var e,n,r;t.addEventListener("waiting",this.handleWaiting),t.addEventListener("playing",this.handlePlaying),t.addEventListener("progress",this.handleProgress),t.addEventListener("seeking",this.handleSeeking,{passive:!0}),t.addEventListener("seeked",this.handleSeeked,{passive:!0}),t.addEventListener("timeupdate",this.handleTimeUpdate),t.addEventListener("ended",this.handleEnded),e=document,n=t,r=e=>{this.removeVideoEvents(t),e.disconnect()},"undefined"!=typeof MutationObserver&&new MutationObserver(((t,e)=>{t.forEach((t=>{t.removedNodes.forEach((t=>{(t===n||t.contains(n))&&r(e)}))}))})).observe(e,{childList:!0,subtree:!0})},this.removeVideoEvents=t=>{t.removeEventListener("waiting",this.handleWaiting),t.removeEventListener("playing",this.handlePlaying),t.removeEventListener("progress",this.handleProgress),t.removeEventListener("seeking",this.handleSeeking),t.removeEventListener("seeked",this.handleSeeked),t.removeEventListener("timeupdate",this.handleTimeUpdate),t.removeEventListener("ended",this.handleEnded)},this.updateProgress=t=>{var e;null===(e=this.controlsRef.current)||void 0===e||e.updateProgress(t)},this.disableRightClick=t=>{t.preventDefault()},this.handleAutoPlay=()=>{var t;const e=(t=>{let e=0;for(;t&&!isNaN(t.offsetTop);)e+=t.offsetTop-t.scrollTop,t=t.offsetParent;return e})(this.videoContainerRef.current),n=e+((null===(t=this.videoContainerRef.current)||void 0===t?void 0:t.clientHeight)||0)/2,r=window.innerHeight,i=window.scrollY;i+r/1.75>=e&&i<=n&&(this.state.ended||this.state.playing||this.state.started||(this.handlePlay(),window.removeEventListener("scroll",this.handleAutoPlay)))},this.handleTrueView=()=>Mt(this,void 0,void 0,(function*(){f.Y.trueView(),yield p.Z.postTrueView()})),this.handleVisibilityChange=()=>{const{playing:t,paused:e}=this.state,n=this.pausedByClick;"visible"!==document.visibilityState&&t&&this.handleTogglePlay(),"visible"===document.visibilityState&&e&&!n&&Ft(this.lastIntersectionEntry)&&this.handleTogglePlay()},this.watchVisibility=()=>{const t=t=>{const{playing:e,paused:n}=this.state,r=this.pausedByClick;t.forEach((t=>{this.lastIntersectionEntry=t,(e&&!Ft(t)||n&&!r&&Ft(t))&&this.handleTogglePlay()}))};window.IntersectionObserver&&(this.intersectionObserver=new IntersectionObserver(t,Nt),this.intersectionObserver.observe(this.videoElement)),document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("scroll",this.handleAutoPlay,{passive:!0})},this.unmuteVideo=()=>{this.state.firstTouch||0!==this.state.volume||(this.setState({firstTouch:!0}),this.toggleMute())},this.logger=t.logger,this.state={playing:!1,paused:!1,played:!1,started:!1,ended:!1,disabledAnswers:!0,loading:!1,visibleVolumeSlider:!1,storedVolume:1,volume:0,firstTouch:!1},this.handleUpdateQuestDataState(this.state)}get videoElement(){if(null!=this.videoRef.current)return this.videoRef.current;throw Error("Cannot provide video ref")}componentDidMount(){this.initVideo(this.props.videoParams,(()=>{this.handleAutoPlay()})),this.watchVisibility()}componentDidUpdate(t){if(!t.solved&&this.props.solved){const{answerResponse:t}=this.props;this.answerTime=this.videoElement.currentTime||this.maxTimePosition,D.videoAnswer(this.getParamsToAnalytics()),this.handleUpdateQuestDataState(this.state),(null==t?void 0:t.video)&&this.initVideo(t.video,(()=>{this.answerVideoLoaded||(this.handlePlay(),this.answerVideoLoaded=!0)}))}}componentWillUnmount(){document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("scroll",this.handleAutoPlay),null!=this.videoRef.current&&this.removeVideoEvents(this.videoRef.current)}get images(){const{videoParams:t,answerResponse:e}=this.props,n=["postImg"],r=K(n,t);if(null!=e&&null!=e.video){const t=K(n,e.video);n.forEach((e=>{r[e]=t[e]||r[e]}))}return r}render(){var t,e;const n=this.images,{answerResponse:r,language:s,questConfig:a}=this.props,{ended:u,firstTouch:l,paused:c,playing:d,started:h,volume:p}=this.state;vt(this.videoRef.current,this.handleTrueView);const f=V(n.postImg);return(0,i.h)("div",{className:"quest__video",ref:this.videoContainerRef},(0,i.h)("div",{className:"quest__video-container"},(0,i.h)(xt,{ended:u,firstTouch:l,language:s,started:h,volume:p,onClick:this.unmuteVideo}),(0,i.h)(qt,{ended:u,started:h,questConfig:a,onTogglePlay:this.handleTogglePlay}),f&&(0,i.h)("img",{className:"quest__image quest__video-image quest__video-image-post",alt:"",src:f,onClick:this.handleTogglePlay,onTransitionEnd:this.handlePostImageAnimationEnded}),(0,i.h)("div",{className:o()("quest__video-wrapper",{"quest__video--empty-post-image":!n.postImg})},(0,i.h)("video",{ref:this.videoRef,onContextMenu:this.disableRightClick,preload:"metadata",playsInline:!0,muted:!p,onClick:this.unmuteVideo}),(0,i.h)(Dt,{ref:this.controlsRef,answerResponse:r,duration:null===(t=this.videoRef.current)||void 0===t?void 0:t.duration,ended:u,logger:this.logger,paused:c,playing:d,questConfig:a,volume:p,videoInputVolume:null===(e=this.videoRef.current)||void 0===e?void 0:e.volume,onToggleMute:this.toggleMute,onTogglePlay:this.handleTogglePlay,onVolumeChange:this.handleVolumeChange,onSeek:this.handleSeekVideo}))))}}class jt extends i.wA{constructor(){super(...arguments),this.state={active:!1,isPlayVideoTrackingCodeVisible:!1},this.questContentRef=(0,i.Vf)(),this.animateIn=()=>this.setState({active:!0}),this.animateOut=()=>this.setState({active:!1}),this.handleSetVideoStateDataAttribute=t=>{this.setState({videoStateDataAttributeValue:Object.keys(t).filter((e=>t[e])).join(" ")})},this.handleShowVideoTrackingCode=()=>this.setState({isPlayVideoTrackingCodeVisible:!0}),this.renderPlayVideoTrackingCode=()=>this.props.playVideoTrackingCode?(0,i.h)(W,{trackingCode:this.props.playVideoTrackingCode,className:"video-quest__tracking"}):null}componentDidMount(){const{isVideo:t,onAllowToAnswer:e,isReminder:n,solved:r}=this.props;n||t||r||e(),this.animateIn()}shouldComponentUpdate(t,e){return h()(this,t,e)}get image(){return V(this.props.image)}get successImg(){return V(this.