@latest-thinking/lt-player 1.1.0 → 1.2.0-a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ README.md +126 -0
- package/dist/css/lt-player-main.css +1 -1
- package/dist/css/lt-player-main.css.map +1 -1
- package/dist/js/lt-player-main.js +1 -1
- package/dist/js/lt-player-main.js.map +1 -1
- package/examples/basic.html +35 -0
- package/examples/lt-page-with-player.html +3529 -0
- package/examples/lt-page-with-player_files/Weiskopf_Coverphoto.jpg +0 -0
- package/examples/lt-page-with-player_files/ajax-progress.module.css +49 -0
- package/examples/lt-page-with-player_files/align.module.css +32 -0
- package/examples/lt-page-with-player_files/announce.js +49 -0
- package/examples/lt-page-with-player_files/autocomplete-loading.module.css +22 -0
- package/examples/lt-page-with-player_files/autocomplete.css +16 -0
- package/examples/lt-page-with-player_files/bootstrap.css +22691 -0
- package/examples/lt-page-with-player_files/clearfix.module.css +15 -0
- package/examples/lt-page-with-player_files/container-inline.module.css +16 -0
- package/examples/lt-page-with-player_files/cookiesjsr.min.css +10 -0
- package/examples/lt-page-with-player_files/core.css +97 -0
- package/examples/lt-page-with-player_files/details.module.css +10 -0
- package/examples/lt-page-with-player_files/fieldgroup.module.css +9 -0
- package/examples/lt-page-with-player_files/hidden.module.css +53 -0
- package/examples/lt-page-with-player_files/himme-alexander-beyond_0.jpg +0 -0
- package/examples/lt-page-with-player_files/item-list.module.css +19 -0
- package/examples/lt-page-with-player_files/js.module.css +22 -0
- package/examples/lt-page-with-player_files/latest_thinking.style.css +6496 -0
- package/examples/lt-page-with-player_files/logo-small.png +0 -0
- package/examples/lt-page-with-player_files/menu.css +64 -0
- package/examples/lt-page-with-player_files/nowrap.module.css +8 -0
- package/examples/lt-page-with-player_files/paragraphs.unpublished.css +3 -0
- package/examples/lt-page-with-player_files/position-container.module.css +8 -0
- package/examples/lt-page-with-player_files/progress.module.css +51 -0
- package/examples/lt-page-with-player_files/radix.style.css +1 -0
- package/examples/lt-page-with-player_files/reset-appearance.module.css +15 -0
- package/examples/lt-page-with-player_files/resize.module.css +21 -0
- package/examples/lt-page-with-player_files/search_api_autocomplete.css +41 -0
- package/examples/lt-page-with-player_files/sticky-header.module.css +13 -0
- package/examples/lt-page-with-player_files/system-status-counter.css +30 -0
- package/examples/lt-page-with-player_files/system-status-report-counters.css +27 -0
- package/examples/lt-page-with-player_files/system-status-report-general-info.css +14 -0
- package/examples/lt-page-with-player_files/tabledrag.module.css +98 -0
- package/examples/lt-page-with-player_files/tablesort.module.css +19 -0
- package/examples/lt-page-with-player_files/theme.css +446 -0
- package/examples/lt-page-with-player_files/thumbnail_MPI_CBS_Eingangsbereich.jpg +0 -0
- package/examples/lt-page-with-player_files/tree-child.module.css +18 -0
- package/examples/lt-page-with-player_files/widget-min.js +10 -0
- package/examples/lt-website.html +76 -0
- package/examples/portrait-with-subtitles.html +81 -0
- package/examples/samples/vtt/Pahl-Kerstin-Maria-MAIN-20230320.vtt +765 -0
- package/examples/samples/vtt/Sobolev-Anton-Subtitles-20230518_0.vtt +352 -0
- package/examples/samples/vtt/demo.vtt +7 -0
- package/package.json +1 -1
- package/src/assets/sass/abstracts/_mixins.scss +1 -1
- package/src/assets/sass/abstracts/_variables.scss +1 -1
- package/src/assets/sass/app.scss +19 -0
- package/src/assets/sass/components/_all.scss +1 -1
- package/src/assets/sass/components/_loader.scss +187 -0
- package/src/assets/sass/components/_modal.scss +6 -0
- package/src/assets/sass/core/_player.scss +23 -5
- package/src/assets/sass/sections/_additional-info.scss +1 -1
- package/src/assets/sass/sections/_control.scss +0 -1
- package/src/assets/sass/sections/_poster.scss +1 -0
- package/src/assets/sass/sections/_settings.scss +36 -53
- package/src/assets/sass/sections/_subtitles.scss +78 -23
- package/src/assets/sass/sections/controllers/_botom.scss +59 -36
- package/src/assets/sass/sections/controllers/_notification-rewind-forward.scss +29 -14
- package/src/assets/sass/sections/controllers/_top.scss +1 -1
- package/src/components/LTPlayerDevMethode.ts +106 -84
- package/src/components/LTPlayerManager.ts +16 -0
- package/src/components/LTPlayerSettingsManager.ts +117 -0
- package/src/components/LTPlayerSetup.ts +3 -10
- package/src/components/LTPlayerStatusFeedback.ts +76 -0
- package/src/components/LTPlayerStorage.ts +58 -0
- package/src/components/LTPlayerType.ts +10 -2
- package/src/components/LTPlayerUpdate.ts +61 -0
- package/src/components/captions/LTPlayerCaptions.ts +80 -0
- package/src/components/config/LTPlayerConfig.ts +43 -0
- package/src/components/config/LTPlayerConfigProcessor.ts +110 -56
- package/src/components/controls/LTPlayerChapters.ts +8 -4
- package/src/components/controls/LTPlayerControls.ts +2 -0
- package/src/components/controls/LTPlayerControlsEvents.ts +200 -49
- package/src/components/controls/settings/LTPlayerCommonSettingsControllers.ts +9 -1
- package/src/components/controls/settings/LTPlayerDesktopSettingsControllers.ts +17 -14
- package/src/components/controls/settings/LTPlayerMobileSettingsControllers.ts +50 -44
- package/src/components/events/LTPlayer.ts +24 -21
- package/src/components/events/LTPlayerCommon.ts +94 -20
- package/src/components/events/LTPlayerDesktop.ts +21 -7
- package/src/components/events/LTPlayerMobile.ts +22 -10
- package/src/global/controllers/LTPlayerController.ts +7 -0
- package/src/services/Helper.ts +6 -1
- package/src/services/ResizeService.ts +35 -30
- package/src/services/TemplateService.ts +7 -0
- package/src/views/additionalInfo.handlebars +18 -18
- package/src/views/controls.handlebars +14 -3
- package/src/views/poster.handlebars +2 -2
- package/src/views/settings.handlebars +1 -1
- package/src/views/settings.mobile.handlebars +22 -0
- package/src/views/template.handlebars +4 -1
- package/src/assets/sass/components/_spinner.scss +0 -46
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see lt-player-main.js.LICENSE.txt */
|
|
2
|
-
(()=>{var __webpack_modules__={4604:function(e){"undefined"!=typeof self&&self,e.exports=(()=>{"use strict";var e={d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function i(e){return"#"===e||""===e||Array.isArray(e)&&0===e.length||!1}e.r(t),e.d(t,{default:()=>N,get:()=>u,isRoot:()=>i,join:()=>I,remove:()=>M,removeUndefinedItems:()=>v,set:()=>g,split:()=>c});const r=/~1/g,n=/~0/g,s=/\/+/g,a=/(^[#/]*|\/+$)/g;function o(e){return e.replace(r,"/").replace(n,"~")}function l(e){return o(decodeURIComponent(e))}function c(e){if(null==e||"string"!=typeof e||i(e))return Array.isArray(e)?e:[];const t=e.indexOf("#")>=0?l:o,r=(e=(e=e.replace(s,"/")).replace(a,"")).split("/");for(let e=0,i=r.length;e<i;e+=1)r[e]=t(r[e]);return r}function u(e,t,r){if(null==t||null==e)return r;if(i(t))return e;const n=d(e,c(t));return void 0===n?r:n}function d(e,t){const i=t.shift();if(void 0!==e)return void 0!==i?d(e[i],t):e}const h=/^\[.*\]$/,p=/^\[(.+)\]$/;function f(e,t){return"__proto__"===e||"constructor"==e&&t.length>0&&"prototype"==t[0]}function g(e,t,i){if(null==t)return e;const r=c(t);if(0===r.length)return e;null==e&&(e=h.test(r[0])?[]:{});let n,s,a=e;for(;r.length>1;)n=r.shift(),s=h.test(r[0]),f(n,r)||(a=m(a,n,s));return n=r.pop(),y(a,n,i),e}function y(e,t,i){let r;const n=t.match(p);"[]"===t&&Array.isArray(e)?e.push(i):n?(r=n.pop(),e[r]=i):e[t]=i}function m(e,t,i){if(null!=e[t])return e[t];const r=i?[]:{};return y(e,t,r),r}function v(e){let t=0,i=0;for(;t+i<e.length;)void 0===e[t+i]&&(i+=1),e[t]=e[t+i],t+=1;return e.length=e.length-i,e}function M(e,t,i){const r=c(t),n=r.pop(),s=u(e,r);return s&&delete s[n],Array.isArray(s)&&!0!==i&&v(s),e}const T=/\/+/g,L=/~/g,b=/\//g;function E(e,t){if(0===e.length)return t?"#":"";for(let i=0,r=e.length;i<r;i+=1)e[i]=e[i].replace(L,"~0").replace(b,"~1"),t&&(e[i]=encodeURIComponent(e[i]));return((t?"#/":"/")+e.join("/")).replace(T,"/")}function I(e,...t){const i=[];if(Array.isArray(e))return E(e,!0===arguments[1]);const r=arguments[arguments.length-1],n="boolean"==typeof r?r:e&&"#"===e[0];for(let e=0,t=arguments.length;e<t;e+=1)i.push.apply(i,c(arguments[e]));const s=[];for(let e=0,t=i.length;e<t;e+=1)if(".."===i[e]){if(0===s.length)return n?"#":"";s.pop()}else s.push(i[e]);return E(s,n)}const N={get:u,set:g,remove:M,join:I,split:c,splitLast:function(e){const t=c(e);if(0===t.length)return"string"==typeof e&&"#"===e[0]?["#",t[0]]:["",void 0];if(1===t.length)return"#"===e[0]?["#",t[0]]:["",t[0]];const i=t.pop();return[I(t,"#"===e[0]),i]},isRoot:i,removeUndefinedItems:v};return t})()},9996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function n(e,t,i){return e.concat(t).map((function(e){return r(e,i)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=r;var c=Array.isArray(i);return c===Array.isArray(e)?c?l.arrayMerge(e,i,l):function(e,t,i){var n={};return i.isMergeableObject(e)&&s(e).forEach((function(t){n[t]=r(e[t],i)})),s(t).forEach((function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&i.isMergeableObject(t[s])?n[s]=function(e,t){if(!t.customMerge)return o;var i=t.customMerge(e);return"function"==typeof i?i:o}(s,i)(e[s],t[s],i):n[s]=r(t[s],i))})),n}(e,i,l):r(i,l)}o.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return o(e,i,t)}),{})};var l=o;e.exports=l},5723:(e,t,i)=>{"use strict";const r=i(9802);var n;!function(e){e.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[["'\"'",/[^"]*/,"'\"'"],['"\'"',/[^']*/,'"\'"']],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],e.defaultParser=new r.Parser(e.RULES,{debug:!1});const t=/^(!|&)/,i=/(\?|\+|\*)$/,n=/^%/;function s(e,a){let o=r.findRuleByName(e,a);return o?o.bnf.map((e=>function(e,a){return e.map((e=>function(e,a){if("string"==typeof e){if(t.test(e))return"";if(n.test(e)){let t=i.exec(e),n=t?t[0]+" ":"",o=function(e,t){let i=r.findRuleByName(e,t);return i&&1==i.bnf.length&&1==i.bnf[0].length&&(i.bnf[0][0]instanceof RegExp||'"'==i.bnf[0][0][0]||"'"==i.bnf[0][0][0])}(e,a);return o?s(e,a)+n:"("+s(e,a)+")"+n}return e}return e.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}(e,a))).join(" ")}(e,a))).join(" | "):"RULE_NOT_FOUND {"+e+"}"}function a(e){let t=[];return e.grammarRules.forEach((i=>{if(!/^%/.test(i.name)){let r=i.recover?" /* { recoverUntil="+i.recover+" } */":"";t.push(i.name+" ::= "+s(i.name,e)+r)}})),t.join("\n")}e.emit=a;let o=0;function l(e){return new RegExp(e.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function c(e,t,i){let r=t.children.filter((e=>"SequenceOrDifference"==e.type)).map((t=>function(e,t,i){let r=null,n=[];return t.children.forEach(((s,a)=>{"Minus"==s.type&&function(e,t){throw console.log("reberia restar "+t+" a "+e),new Error("Difference not supported yet")}(r,s);let u=t.children[a+1];switch(u=u&&"PrimaryDecoration"==u.type&&u.text||"",s.type){case"SubItem":let t="%"+(i+o++);c(e,s,t),n.push(""+t+u);break;case"NCName":case"StringLiteral":n.push(""+s.text+u);break;case"CharCode":case"CharClass":if(u){let t={name:"%"+(i+o++),bnf:[[l(s.text)]]};e.push(t),n.push(""+t.name+u)}else n.push(l(s.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+s.type+" -> "+JSON.stringify(s.text))}r=s})),n}(e,t,i))),n={name:i,bnf:r},s=null;r.forEach((e=>{s=s||e.recover,delete e.recover})),0==i.indexOf("%")&&(n.fragment=!0),s&&(n.recover=s),e.push(n)}function u(t,i=e.defaultParser){let r=i.getAST(t);if(!r)throw new Error("Could not parse "+t);if(r.errors&&r.errors.length)throw r.errors[0];let n=[];return r.children.filter((e=>"Production"==e.type)).map((e=>{let t=e.children.filter((e=>"NCName"==e.type))[0].text;c(n,e,t)})),n}e.getRules=u,e.Transform=function(t,i=e.defaultParser){return u(t.join(""),i)};class d extends r.Parser{constructor(t,i){super(u(t,i&&!0===i.debugRulesParser?new r.Parser(e.RULES,{debug:!0}):e.defaultParser),i)}emitSource(){return a(this)}}e.Parser=d}(n||(n={})),t.Z=n},9802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;const UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(2239);function readToken(e,t){let i=t.exec(e);return i&&0==i.index?0==i[0].length&&t.source.length>0?null:{type:null,text:i[0],rest:e.substr(i[0].length),start:0,end:i[0].length-1,fullText:i[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach((e=>fixRest(e)))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach((t=>fixPositions(t,e.start)))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach((t=>e.push(t))),t.children&&t.children.forEach((t=>agregateErrors(e,t)))}function parseRuleName(e){let t=decorationRE.exec(e),i=preDecorationRE.exec(e),r=t&&t[0]||"",n=i&&i[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:"?"==r||"*"==r,allowRepetition:"+"==r||"*"==r,atLeastOne:"+"==r,lookupPositive:"&"==n,lookupNegative:"!"==n,pinned:"@"==n,lookup:!1,isLiteral:!1};return s.isLiteral="'"==s.name[0]||'"'==s.name[0],s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let i=parseRuleName(e);return t.cachedRules[i.name]||null}function stripRules(e,t){if(e.children){let i=e.children.filter((e=>e.type&&t.test(e.type)));for(let t=0;t<i.length;t++){let r=e.children.indexOf(i[t]);-1!=r&&e.children.splice(r,1)}e.children.forEach((e=>stripRules(e,t)))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;const ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&!0===t.debug;let i=[],r=[];if(e.forEach((e=>{let t=parseRuleName(e.name);if(t.name in this.cachedRules)i.push("Duplicated rule "+t.name);else{if(this.cachedRules[t.name]=e,e.bnf&&e.bnf.length)e.bnf.forEach((t=>{if("string"==typeof t[0]&&parseRuleName(t[0]).name==e.name){let t="Left recursion is not allowed, rule: "+e.name;-1==i.indexOf(t)&&i.push(t)}t.forEach((e=>{if("string"==typeof e){let t=parseRuleName(e);t.isLiteral||-1!=r.indexOf(t.name)||-1!=ignoreMissingRules.indexOf(t.name)||r.push(t.name)}}))}));else{let t="Missing rule content, rule: "+e.name;-1==i.indexOf(t)&&i.push(t)}WS_RULE==e.name&&(e.implicitWs=!1),e.implicitWs&&-1==r.indexOf(WS_RULE)&&r.push(WS_RULE),e.recover&&-1==r.indexOf(e.recover)&&r.push(e.recover)}})),r.forEach((e=>{e in this.cachedRules||i.push("Missing rule "+e)})),i.length)throw new Error(i.join("\n"))}getAST(e,t){t||(t=this.grammarRules.filter((e=>!e.fragment&&0!=e.name.indexOf("%")))[0].name);let i=this.parse(e,t);if(i){agregateErrors(i.errors,i),fixPositions(i,0),stripRules(i,/^%/),this.options&&this.options.keepUpperRules||stripRules(i,UPPER_SNAKE_RE);let e=i.rest;e&&new TokenError_1.TokenError("Unexpected end of input: \n"+e,i),fixRest(i),i.rest=e}return i}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("│ ")+"Trying to get "+target+" from "+JSON.stringify(txt.split("\n")[0]));let realType=type.name,targetLex=findRuleByName(type.name,this);if("EOF"==type.name){if(txt.length)return null;if(0==txt.length)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!targetLex&&type.isLiteral){let src=eval(type.name);if(""===src)return{type:"%%EMPTY%%",text:"",rest:txt,start:0,end:0,fullText:"",errors:[],children:[],parent:null};expr=new RegExp(escapeRegExp(src)),realType=null}}catch(e){return e instanceof ReferenceError&&console.error(e),null}if(expr){let e=readToken(txt,expr);if(e)return e.type=realType,e}else{let e=targetLex.bnf;e instanceof Array&&e.forEach((e=>{if(out)return;let t=null,i={type:type.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:txt};targetLex.fragment&&(i.fragment=!0);let r=txt,n=0,s=e.length>0,a=!1;for(let o=0;o<e.length;o++)if("string"==typeof e[o]){let l,c=parseRuleName(e[o]);s=s&&c.isOptional;let u=!1;do{if(l=null,targetLex.implicitWs&&(l=this.parse(r,c.name,recursion+1),!l)){let e;do{if(e=this.parse(r,WS_RULE,recursion+1),!e)break;i.text=i.text+e.text,i.end=i.text.length,e.parent=i,i.children.push(e),r=r.substr(e.text.length),n+=e.text.length}while(e&&e.text.length)}if(l=l||this.parse(r,c.name,recursion+1),c.lookupNegative){if(l)return;break}if(c.lookupPositive&&!l)return;if(!l){if(c.isOptional)break;if(c.atLeastOne&&u)break}if(l&&targetLex.pinned==o+1&&(t=l,printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" PINNED")),l||(l=this.parseRecovery(targetLex,r,recursion+1)),!l){if(!t)return;out=i,l={type:"SyntaxError",text:r,children:[],end:r.length,errors:[],fullText:"",parent:null,start:0,rest:""},r.length?new TokenError_1.TokenError(`Unexpected end of input. Expecting ${c.name} Got: ${r}`,l):new TokenError_1.TokenError(`Unexpected end of input. Missing ${c.name}`,l),printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" "+JSON.stringify(l.text))}if(u=!0,a=!0,"%%EMPTY%%"==l.type)break;l.start+=n,l.end+=n,!c.lookupPositive&&l.type&&(l.fragment?l.children&&l.children.forEach((e=>{e.start+=n,e.end+=n,e.parent=i,i.children.push(e)})):(l.parent=i,i.children.push(l))),c.lookup&&(l.lookup=!0),printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" "+JSON.stringify(l.text)),c.lookup||l.lookup||(i.text=i.text+l.text,i.end=i.text.length,r=r.substr(l.text.length),n+=l.text.length),i.rest=r}while(l&&c.allowRepetition&&r.length&&!l.lookup)}else{let t=readToken(r,e[o]);if(!t)return;printable&&console.log(new Array(recursion+1).join("│ ")+"└> "+JSON.stringify(t.text)+e[o].source),a=!0,t.start+=n,t.end+=n,i.text=i.text+t.text,i.end=i.text.length,r=r.substr(t.text.length),n+=t.text.length,i.rest=r}a&&(out=i,printable&&console.log(new Array(recursion).join("│ ")+"├<─┴< PUSHING "+out.type+" "+JSON.stringify(out.text)))})),out&&targetLex.simplifyWhenOneChildren&&1==out.children.length&&(out=out.children[0])}return out||printable&&console.log(target+" NOT RESOLVED FROM "+txt),out}parseRecovery(e,t,i){if(e.recover&&t.length){let r=this.debug;r&&console.log(new Array(i+1).join("│ ")+"Trying to recover until token "+e.recover+" from "+JSON.stringify(t.split("\n")[0]+t.split("\n")[1]));let n,s={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""};do{if(n=this.parse(t,e.recover,i+1),n){new TokenError_1.TokenError('Unexpected input: "'+s.text+`" Expecting: ${e.name}`,s);break}s.text=s.text+t[0],s.end=s.text.length,t=t.substr(1)}while(!n&&t.length>0);if(s.text.length>0&&n)return r&&console.log(new Array(i+1).join("│ ")+"Recovered text: "+JSON.stringify(s.text)),s}return null}}exports.Parser=Parser,exports.default=Parser},2239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenError=void 0;class i extends Error{constructor(e,t){if(super(e),this.message=e,this.token=t,!t||!t.errors)throw this;t.errors.push(this)}inspect(){return"SyntaxError: "+this.message}}t.TokenError=i},4063:e=>{"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var r,n,s;if(Array.isArray(t)){if((r=t.length)!=i.length)return!1;for(n=r;0!=n--;)if(!e(t[n],i[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((r=(s=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(i,s[n]))return!1;for(n=r;0!=n--;){var a=s[n];if(!e(t[a],i[a]))return!1}return!0}return t!=t&&i!=i}},840:(e,t,i)=>{var r;!function(n,s,a,o){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),d=Math.round,h=Math.abs,p=Date.now;function f(e,t,i){return setTimeout(L(e,i),t)}function g(e,t,i){return!!Array.isArray(e)&&(y(e,i[t],i),!0)}function y(e,t,i){var r;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==o)for(r=0;r<e.length;)t.call(i,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function m(e,t,i){var r="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=n.console&&(n.console.warn||n.console.log);return s&&s.call(n.console,r,i),e.apply(this,arguments)}}l="function"!=typeof Object.assign?function(e){if(e===o||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(r!==o&&null!==r)for(var n in r)r.hasOwnProperty(n)&&(t[n]=r[n])}return t}:Object.assign;var v=m((function(e,t,i){for(var r=Object.keys(t),n=0;n<r.length;)(!i||i&&e[r[n]]===o)&&(e[r[n]]=t[r[n]]),n++;return e}),"extend","Use `assign`."),M=m((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function T(e,t,i){var r,n=t.prototype;(r=e.prototype=Object.create(n)).constructor=e,r._super=n,i&&l(r,i)}function L(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||o,t):e}function E(e,t){return e===o?t:e}function I(e,t,i){y(A(t),(function(t){e.addEventListener(t,i,!1)}))}function N(e,t,i){y(A(t),(function(t){e.removeEventListener(t,i,!1)}))}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function A(e){return e.trim().split(/\s+/g)}function D(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var r=0;r<e.length;){if(i&&e[r][i]==t||!i&&e[r]===t)return r;r++}return-1}function C(e){return Array.prototype.slice.call(e,0)}function k(e,t,i){for(var r=[],n=[],s=0;s<e.length;){var a=t?e[s][t]:e[s];D(n,a)<0&&r.push(e[s]),n[s]=a,s++}return i&&(r=t?r.sort((function(e,i){return e[t]>i[t]})):r.sort()),r}function j(e,t){for(var i,r,n=t[0].toUpperCase()+t.slice(1),s=0;s<c.length;){if((r=(i=c[s])?i+n:t)in e)return r;s++}return o}var x=1;function _(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||n}var O="ontouchstart"in n,P=j(n,"PointerEvent")!==o,R=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z="touch",F="mouse",U=["x","y"],Y=["clientX","clientY"];function B(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&i.handler(t)},this.init()}function $(e,t,i){var r=i.pointers.length,n=i.changedPointers.length,s=1&t&&r-n==0,a=12&t&&r-n==0;i.isFirst=!!s,i.isFinal=!!a,s&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,r=t.pointers,n=r.length;i.firstInput||(i.firstInput=G(t)),n>1&&!i.firstMultiple?i.firstMultiple=G(t):1===n&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,l=a?a.center:s.center,c=t.center=Q(r);t.timeStamp=p(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Z(l,c),t.distance=W(l,c),function(e,t){var i=t.center,r=e.offsetDelta||{},n=e.prevDelta||{},s=e.prevInput||{};1!==t.eventType&&4!==s.eventType||(n=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},r=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=n.x+(i.x-r.x),t.deltaY=n.y+(i.y-r.y)}(i,t),t.offsetDirection=q(t.deltaX,t.deltaY);var u,d,f=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=h(f.x)>h(f.y)?f.x:f.y,t.scale=a?(u=a.pointers,W((d=r)[0],d[1],Y)/W(u[0],u[1],Y)):1,t.rotation=a?function(e,t){return Z(t[1],t[0],Y)+Z(e[1],e[0],Y)}(a.pointers,r):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,r,n,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===o)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,d=H(l,c,u);r=d.x,n=d.y,i=h(d.x)>h(d.y)?d.x:d.y,s=q(c,u),e.lastInterval=t}else i=a.velocity,r=a.velocityX,n=a.velocityY,s=a.direction;t.velocity=i,t.velocityX=r,t.velocityY=n,t.direction=s}(i,t);var g=e.element;w(t.srcEvent.target,g)&&(g=t.srcEvent.target),t.target=g}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function G(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:d(e.pointers[i].clientX),clientY:d(e.pointers[i].clientY)},i++;return{timeStamp:p(),pointers:t,center:Q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Q(e){var t=e.length;if(1===t)return{x:d(e[0].clientX),y:d(e[0].clientY)};for(var i=0,r=0,n=0;n<t;)i+=e[n].clientX,r+=e[n].clientY,n++;return{x:d(i/t),y:d(r/t)}}function H(e,t,i){return{x:t/e||0,y:i/e||0}}function q(e,t){return e===t?1:h(e)>=h(t)?e<0?2:4:t<0?8:16}function W(e,t,i){i||(i=U);var r=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return Math.sqrt(r*r+n*n)}function Z(e,t,i){i||(i=U);var r=t[i[0]]-e[i[0]],n=t[i[1]]-e[i[1]];return 180*Math.atan2(n,r)/Math.PI}B.prototype={handler:function(){},init:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(_(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(_(this.element),this.evWin,this.domHandler)}};var V={mousedown:1,mousemove:2,mouseup:4},K="mousedown",X="mousemove mouseup";function J(){this.evEl=K,this.evWin=X,this.pressed=!1,B.apply(this,arguments)}T(J,B,{handler:function(e){var t=V[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var ee={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},te={2:z,3:"pen",4:F,5:"kinect"},ie="pointerdown",re="pointermove pointerup pointercancel";function ne(){this.evEl=ie,this.evWin=re,B.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}n.MSPointerEvent&&!n.PointerEvent&&(ie="MSPointerDown",re="MSPointerMove MSPointerUp MSPointerCancel"),T(ne,B,{handler:function(e){var t=this.store,i=!1,r=e.type.toLowerCase().replace("ms",""),n=ee[r],s=te[e.pointerType]||e.pointerType,a=s==z,o=D(t,e.pointerId,"pointerId");1&n&&(0===e.button||a)?o<0&&(t.push(e),o=t.length-1):12&n&&(i=!0),o<0||(t[o]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(o,1))}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart",oe="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.evWin=oe,this.started=!1,B.apply(this,arguments)}function ce(e,t){var i=C(e.touches),r=C(e.changedTouches);return 12&t&&(i=k(i.concat(r),"identifier",!0)),[i,r]}T(le,B,{handler:function(e){var t=se[e.type];if(1===t&&(this.started=!0),this.started){var i=ce.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:z,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function he(){this.evTarget=de,this.targetIds={},B.apply(this,arguments)}function pe(e,t){var i=C(e.touches),r=this.targetIds;if(3&t&&1===i.length)return r[i[0].identifier]=!0,[i,i];var n,s,a=C(e.changedTouches),o=[],l=this.target;if(s=i.filter((function(e){return w(e.target,l)})),1===t)for(n=0;n<s.length;)r[s[n].identifier]=!0,n++;for(n=0;n<a.length;)r[a[n].identifier]&&o.push(a[n]),12&t&&delete r[a[n].identifier],n++;return o.length?[k(s.concat(o),"identifier",!0),o]:void 0}function fe(){B.apply(this,arguments);var e=L(this.handler,this);this.touch=new he(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ge(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ye.call(this,t)):12&e&&ye.call(this,t)}function ye(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(i);e>-1&&r.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var n=this.lastTouches[r],s=Math.abs(t-n.x),a=Math.abs(i-n.y);if(s<=25&&a<=25)return!0}return!1}T(he,B,{handler:function(e){var t=ue[e.type],i=pe.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:z,srcEvent:e})}}),T(fe,B,{handler:function(e,t,i){var r=i.pointerType==z,n=i.pointerType==F;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(r)ge.call(this,t,i);else if(n&&me.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ve=j(u.style,"touchAction"),Me=ve!==o,Te="compute",Le="auto",be="manipulation",Ee="none",Ie="pan-x",Ne="pan-y",we=function(){if(!Me)return!1;var e={},t=n.CSS&&n.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!t||n.CSS.supports("touch-action",i)})),e}();function Se(e,t){this.manager=e,this.set(t)}Se.prototype={set:function(e){e==Te&&(e=this.compute()),Me&&this.manager.element.style&&we[e]&&(this.manager.element.style[ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return y(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,Ee))return Ee;var t=S(e,Ie),i=S(e,Ne);return t&&i?Ee:t||i?t?Ie:Ne:S(e,be)?be:Le}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,n=S(r,Ee)&&!we.none,s=S(r,Ne)&&!we["pan-y"],a=S(r,Ie)&&!we["pan-x"];if(n){var o=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(o&&l&&c)return}if(!a||!s)return n||s&&6&i||a&&24&i?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ae=32;function De(e){this.options=l({},this.defaults,e||{}),this.id=x++,this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ke(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function je(e,t){var i=t.manager;return i?i.get(e):e}function xe(){De.apply(this,arguments)}function _e(){xe.apply(this,arguments),this.pX=null,this.pY=null}function Oe(){xe.apply(this,arguments)}function Pe(){De.apply(this,arguments),this._timer=null,this._input=null}function Re(){xe.apply(this,arguments)}function ze(){xe.apply(this,arguments)}function Fe(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ue(e,t){return(t=t||{}).recognizers=E(t.recognizers,Ue.defaults.preset),new Ye(e,t)}function Ye(e,t){this.options=l({},Ue.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(P?ne:R?he:O?fe:J))(this,$),this.touchAction=new Se(this,this.options.touchAction),Be(this,!0),y(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Be(e,t){var i,r=e.element;r.style&&(y(e.options.cssProps,(function(n,s){i=j(r.style,s),t?(e.oldCssProps[i]=r.style[i],r.style[i]=n):r.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}De.prototype={defaults:{},set:function(e){return l(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(g(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=je(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return g(e,"dropRecognizeWith",this)||(e=je(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(g(e,"requireFailure",this))return this;var t=this.requireFail;return-1===D(t,e=je(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(g(e,"dropRequireFailure",this))return this;e=je(e,this);var t=D(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function r(i){t.manager.emit(i,e)}i<8&&r(t.options.event+Ce(i)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),i>=8&&r(t.options.event+Ce(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ae},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=l({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Ae);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},T(xe,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,r=6&t,n=this.attrTest(e);return r&&(8&i||!n)?16|t:r||n?4&i?8|t:2&t?4|t:2:Ae}}),T(_e,xe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ne),24&e&&t.push(Ie),t},directionTest:function(e){var t=this.options,i=!0,r=e.distance,n=e.direction,s=e.deltaX,a=e.deltaY;return n&t.direction||(6&t.direction?(n=0===s?1:s<0?2:4,i=s!=this.pX,r=Math.abs(e.deltaX)):(n=0===a?1:a<0?8:16,i=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=n,i&&r>t.threshold&&n&t.direction},attrTest:function(e){return xe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),T(Oe,xe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),T(Pe,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Le]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,r=e.distance<t.threshold,n=e.deltaTime>t.time;if(this._input=e,!r||!i||12&e.eventType&&!n)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ae},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),T(Re,xe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),T(ze,xe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:24&i&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),T(Fe,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,r=e.distance<t.threshold,n=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&n&&i){if(4!=e.eventType)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||W(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&s?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ae},failTimeout:function(){return this._timer=f((function(){this.state=Ae}),this.options.interval,this),Ae},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ue.VERSION="2.0.7",Ue.defaults={domEvents:!1,touchAction:Te,enable:!0,inputTarget:null,inputClass:null,preset:[[Re,{enable:!1}],[Oe,{enable:!1},["rotate"]],[ze,{direction:6}],[_e,{direction:6},["swipe"]],[Fe],[Fe,{event:"doubletap",taps:2},["tap"]],[Pe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ye.prototype={set:function(e){return l(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var r=this.recognizers,n=t.curRecognizer;(!n||n&&8&n.state)&&(n=t.curRecognizer=null);for(var s=0;s<r.length;)i=r[s],2===t.stopped||n&&i!=n&&!i.canRecognizeWith(n)?i.reset():i.recognize(e),!n&&14&i.state&&(n=t.curRecognizer=i),s++}},get:function(e){if(e instanceof De)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(g(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(g(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=D(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==o&&t!==o){var i=this.handlers;return y(A(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==o){var i=this.handlers;return y(A(e),(function(e){t?i[e]&&i[e].splice(D(i[e],t),1):delete i[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<i.length;)i[r](t),r++}},destroy:function(){this.element&&Be(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l(Ue,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ae,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ye,Input:B,TouchAction:Se,TouchInput:he,MouseInput:J,PointerEventInput:ne,TouchMouseInput:fe,SingleTouchInput:le,Recognizer:De,AttrRecognizer:xe,Tap:Fe,Pan:_e,Swipe:ze,Pinch:Oe,Rotate:Re,Press:Pe,on:I,off:N,each:y,merge:M,extend:v,assign:l,inherit:T,bindFn:L,prefixed:j}),(void 0!==n?n:"undefined"!=typeof self?self:{}).Hammer=Ue,(r=function(){return Ue}.call(t,i,t,e))===o||(e.exports=r)}(window,document)},1443:function(e,t,i){"object"==typeof navigator&&(e.exports=function(){"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var a={addCSS:!0,thumbWidth:15,watch:!0};function o(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var l=function(e){return null!=e?e.constructor:null},c=function(e,t){return!!(e&&t&&e instanceof t)},u=function(e){return l(e)===String},d=function(e){return Array.isArray(e)},h=function(e){return c(e,NodeList)},p=u,f=d,g=h,y=function(e){return c(e,Element)},m=function(e){return c(e,Event)},v=function(e){return function(e){return null==e}(e)||(u(e)||d(e)||h(e))&&!e.length||function(e){return l(e)===Object}(e)&&!Object.keys(e).length};var M=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),y(t)?this.element=t:p(t)&&(this.element=document.querySelector(t)),y(this.element)&&v(this.element.rangeTouch)&&(this.config=s({},a,{},i),this.init())}return function(e,i,r){i&&t(e.prototype,i),r&&t(e,r)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!m(t))return null;var i,r=t.target,n=t.changedTouches[0],s=parseFloat(r.getAttribute("min"))||0,a=parseFloat(r.getAttribute("max"))||100,o=parseFloat(r.getAttribute("step"))||1,l=r.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(n.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),s+function(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(a-s),o)}},{key:"set",value:function(t){e.enabled&&m(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=null;if(v(t)||p(t)?r=Array.from(document.querySelectorAll(p(t)?t:'input[type="range"]')):y(t)?r=[t]:g(t)?r=Array.from(t):f(t)&&(r=t.filter(y)),v(r))return null;var n=s({},a,{},i);if(p(t)&&n.watch){var l=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){y(i)&&o(i,t)&&new e(i,n)}))}))}));l.observe(document.body,{childList:!0,subtree:!0})}return r.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const T=e=>null!=e?e.constructor:null,L=(e,t)=>Boolean(e&&t&&e instanceof t),b=e=>null==e,E=e=>T(e)===Object,I=e=>T(e)===String,N=e=>"function"==typeof e,w=e=>Array.isArray(e),S=e=>L(e,NodeList),A=e=>b(e)||(I(e)||w(e)||S(e))&&!e.length||E(e)&&!Object.keys(e).length;var D=b,C=E,k=e=>T(e)===Number&&!Number.isNaN(e),j=I,x=e=>T(e)===Boolean,_=N,O=w,P=S,R=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,z=e=>L(e,Event),F=e=>L(e,KeyboardEvent),U=e=>L(e,TextTrack)||!b(e)&&I(e.kind),Y=e=>{if(L(e,window.URL))return!0;if(!I(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!A(new URL(t).hostname)}catch(e){return!1}},B=A;const $=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!j(i)&&t[i]})();function G(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}const Q={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function H(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function q(e={},...t){if(!t.length)return e;const i=t.shift();return C(i)?(Object.keys(i).forEach((t=>{C(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),q(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),q(e,...t)):e}function W(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const r=i>0?t.cloneNode(!0):t,n=e.parentNode,s=e.nextSibling;r.appendChild(e),s?n.insertBefore(r,s):n.appendChild(r)}))}function Z(e,t){R(e)&&!B(t)&&Object.entries(t).filter((([,e])=>!D(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function V(e,t,i){const r=document.createElement(e);return C(t)&&Z(r,t),j(i)&&(r.innerText=i),r}function K(e,t,i,r){R(t)&&t.appendChild(V(e,i,r))}function X(e){P(e)||O(e)?Array.from(e).forEach(X):R(e)&&R(e.parentNode)&&e.parentNode.removeChild(e)}function J(e){if(!R(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function ee(e,t){return R(t)&&R(t.parentNode)&&R(e)?(t.parentNode.replaceChild(e,t),e):null}function te(e,t){if(!j(e)||B(e))return{};const i={},r=q({},t);return e.split(",").forEach((e=>{const t=e.trim(),n=t.replace(".",""),s=t.replace(/[[\]]/g,"").split("="),[a]=s,o=s.length>1?s[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":j(r.class)?i.class=`${r.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[a]=o}})),q(r,i)}function ie(e,t){if(!R(e))return;let i=t;x(i)||(i=!e.hidden),e.hidden=i}function re(e,t,i){if(P(e))return Array.from(e).map((e=>re(e,t,i)));if(R(e)){let r="toggle";return void 0!==i&&(r=i?"add":"remove"),e.classList[r](t),e.classList.contains(t)}return!1}function ne(e,t){return R(e)&&e.classList.contains(t)}function se(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ae(e){return this.elements.container.querySelectorAll(e)}function oe(e){return this.elements.container.querySelector(e)}function le(e=null,t=!1){R(e)&&(e.focus({preventScroll:!0}),t&&re(e,this.config.classNames.tabFocus))}const ce={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ue={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t,i){const r=Q.isIPhone&&i&&ue.playsinline,n=ue[e]||"html5"!==t;return{api:n,ui:n&&ue.rangeInput&&("video"!==e||!Q.isIPhone||r)}},pip:!(Q.isIPhone||!_(V("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||V("video").disablePictureInPicture)),airplay:_(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(B(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(ce).includes(i)&&(i+=`; codecs="${ce[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==$,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},de=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function he(e,t,i,r=!1,n=!0,s=!1){if(!e||!("addEventListener"in e)||B(t)||!_(i))return;const a=t.split(" ");let o=s;de&&(o={passive:n,capture:s}),a.forEach((t=>{this&&this.eventListeners&&r&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[r?"addEventListener":"removeEventListener"](t,i,o)}))}function pe(e,t="",i,r=!0,n=!1){he.call(this,e,t,i,!0,r,n)}function fe(e,t="",i,r=!0,n=!1){he.call(this,e,t,i,!1,r,n)}function ge(e,t="",i,r=!0,n=!1){const s=(...a)=>{fe(e,t,s,r,n),i.apply(this,a)};he.call(this,e,t,s,!0,r,n)}function ye(e,t="",i=!1,r={}){if(!R(e)||B(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...r,plyr:this}});e.dispatchEvent(n)}function me(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:r,options:n}=e;t.removeEventListener(i,r,n)})),this.eventListeners=[])}function ve(){return new Promise((e=>this.ready?setTimeout(e,0):pe.call(this,this.elements.container,"ready",e))).then((()=>{}))}function Me(e){(e=>L(e,Promise)&&N(e.then))(e)&&e.then(null,(()=>{}))}function Te(e){return O(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function Le(e,t){return O(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}function be(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const Ee=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce(((e,[t,i])=>({...e,[t/i]:[t,i]})),{});function Ie(e){return!!(O(e)||j(e)&&e.includes(":"))&&(O(e)?e:e.split(":")).map(Number).every(k)}function Ne(e){if(!O(e)||!e.every(k))return null;const[t,i]=e,r=(e,t)=>0===t?e:r(t,e%t),n=r(t,i);return[t/n,i/n]}function we(e){const t=e=>Ie(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!B(this.embed)&&O(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Ne(i)}function Se(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=we.call(this,e);if(!O(i))return{};const[r,n]=Ne(i),s=100/r*n;if(be(`aspect-ratio: ${r}/${n}`)?t.style.aspectRatio=`${r}/${n}`:t.style.paddingBottom=`${s}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-s)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:s,ratio:i}}function Ae(e,t,i=.05){const r=e/t,n=Le(Object.keys(Ee),r);return Math.abs(n-r)<=i?Ee[n]:[e,t]}const De={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!B(t)||ue.mime.call(this,t)})):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:De.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,B(this.config.ratio)||Se.call(e),Object.defineProperty(e.media,"quality",{get(){const t=De.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&_(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=De.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:r,paused:n,preload:s,readyState:a,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==s||a)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=r,n||Me(e.play())})),e.media.load())}ye.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(X(De.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function Ce(e,...t){return B(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const ke=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),je=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function xe(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const _e={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Oe={get(e="",t={}){if(B(e)||B(t))return"";let i=H(t.i18n,e);if(B(i))return Object.keys(_e).includes(e)?_e[e]:"";const r={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(r).forEach((([e,t])=>{i=ke(i,e,t)})),i}};class Pe{constructor(t){e(this,"get",(e=>{if(!Pe.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(B(t))return null;const i=JSON.parse(t);return j(e)&&e.length?i[e]:i})),e(this,"set",(e=>{if(!Pe.supported||!this.enabled)return;if(!C(e))return;let t=this.get();B(t)&&(t={}),q(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch(e){}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function Re(e,t="text"){return new Promise(((i,r)=>{try{const r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(r.responseText))}catch(e){i(r.responseText)}else i(r.response)})),r.addEventListener("error",(()=>{throw new Error(r.status)})),r.open("GET",e,!0),r.responseType=t,r.send()}catch(e){r(e)}}))}function ze(e,t){if(!j(e))return;const i=j(t);let r=!1;const n=()=>null!==document.getElementById(t),s=(e,t)=>{e.innerHTML=t,i&&n()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!n()){const n=Pe.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),i&&a.setAttribute("id",t),n){const e=window.localStorage.getItem(`cache-${t}`);if(r=null!==e,r){const t=JSON.parse(e);s(a,t.content)}}Re(e).then((e=>{if(!B(e)){if(n)try{window.localStorage.setItem(`cache-${t}`,JSON.stringify({content:e}))}catch(e){}s(a,e)}})).catch((()=>{}))}}const Fe=e=>Math.trunc(e/60/60%60,10);function Ue(e=0,t=!1,i=!1){if(!k(e))return Ue(void 0,t,i);const r=e=>`0${e}`.slice(-2);let n=Fe(e);const s=(a=e,Math.trunc(a/60%60,10));var a;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${r(s)}:${r(o)}`}const Ye={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||Q.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=oe.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ae.call(this,this.config.selectors.buttons.play),pause:oe.call(this,this.config.selectors.buttons.pause),restart:oe.call(this,this.config.selectors.buttons.restart),rewind:oe.call(this,this.config.selectors.buttons.rewind),fastForward:oe.call(this,this.config.selectors.buttons.fastForward),mute:oe.call(this,this.config.selectors.buttons.mute),pip:oe.call(this,this.config.selectors.buttons.pip),airplay:oe.call(this,this.config.selectors.buttons.airplay),settings:oe.call(this,this.config.selectors.buttons.settings),captions:oe.call(this,this.config.selectors.buttons.captions),fullscreen:oe.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=oe.call(this,this.config.selectors.progress),this.elements.inputs={seek:oe.call(this,this.config.selectors.inputs.seek),volume:oe.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:oe.call(this,this.config.selectors.display.buffer),currentTime:oe.call(this,this.config.selectors.display.currentTime),duration:oe.call(this,this.config.selectors.display.duration)},R(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",r=Ye.getIconUrl.call(this),n=`${r.cors?"":r.url}#${this.config.iconPrefix}`,s=document.createElementNS(i,"svg");Z(s,q(t,{"aria-hidden":"true",focusable:"false"}));const a=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),s.appendChild(a),s},createLabel(e,t={}){const i=Oe.get(e,this.config);return V("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(B(e))return null;const t=V("span",{class:this.config.classNames.menu.value});return t.appendChild(V("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=q({},t);let r=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=ke(t,"-"," "),t=ke(t,"_"," "),t=je(t),ke(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])})),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||q(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,r="play",n.label="play",n.icon="play";break;default:B(n.label)&&(n.label=r),B(n.icon)&&(n.icon=e)}const s=V(n.element);return n.toggle?(s.appendChild(Ye.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),s.appendChild(Ye.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),s.appendChild(Ye.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),s.appendChild(Ye.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(s.appendChild(Ye.createIcon.call(this,n.icon)),s.appendChild(Ye.createLabel.call(this,n.label))),q(i,te(this.config.selectors.buttons[r],i)),Z(s,i),"play"===r?(O(this.elements.buttons[r])||(this.elements.buttons[r]=[]),this.elements.buttons[r].push(s)):this.elements.buttons[r]=s,s},createRange(e,t){const i=V("input",q(te(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Oe.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Ye.updateRangeFill.call(this,i),M.setup(i),i},createProgress(e,t){const i=V("progress",q(te(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(V("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],r=t?Oe.get(t,this.config):"";i.innerText=`% ${r.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=te(this.config.selectors.display[e],t),r=V("div",q(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Oe.get(e,this.config)}),"00:00");return this.elements.display[e]=r,r},bindMenuItemShortcuts(e,t){pe.call(this,e,"keydown keyup",(i=>{if(!["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const r=se(e,'[role="menuitemradio"]');if(!r&&["Space","ArrowRight"].includes(i.key))Ye.showMenuPanel.call(this,t,!0);else{let t;"Space"!==i.key&&("ArrowDown"===i.key||r&&"ArrowRight"===i.key?(t=e.nextElementSibling,R(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,R(t)||(t=e.parentNode.lastElementChild)),le.call(this,t,!0))}}),!1),pe.call(this,e,"keyup",(e=>{"Return"===e.key&&Ye.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:r,badge:n=null,checked:s=!1}){const a=te(this.config.selectors.inputs[i]),o=V("button",q(a,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${a.class?a.class:""}`.trim(),"aria-checked":s,value:e})),l=V("span");l.innerHTML=r,R(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>se(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!F(t)||"Space"===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Ye.showMenuPanel.call(this,"home",F(t))}}),i,!1),Ye.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){return k(e)?Ue(e,Fe(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,i=!1){R(e)&&k(t)&&(e.innerText=Ye.formatTime(t,i))},updateVolume(){this.supported.ui&&(R(this.elements.inputs.volume)&&Ye.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),R(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){R(e)&&(e.value=t,Ye.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!z(e))return;let t=0;const i=(e,t)=>{const i=k(t)?t:0,r=R(e)?e:this.elements.display.buffer;if(R(r)){r.value=i;const e=r.getElementsByTagName("span")[0];R(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":r=this.currentTime,n=this.duration,t=0===r||0===n||Number.isNaN(r)||Number.isNaN(n)?0:(r/n*100).toFixed(2),"timeupdate"===e.type&&Ye.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var r,n},updateRangeFill(e){const t=z(e)?e.target:e;if(R(t)&&"range"===t.getAttribute("type")){if(se(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Ye.formatTime(this.currentTime),i=Ye.formatTime(this.duration),r=Oe.get("seekLabel",this.config);t.setAttribute("aria-valuetext",r.replace("{currentTime}",e).replace("{duration}",i))}else if(se(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);Q.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!R(this.elements.inputs.seek)||!R(this.elements.display.seekTooltip)||0===this.duration)return;const r=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,s=e=>re(r,n,e);if(this.touch)return void s(!1);let a=0;const o=this.elements.progress.getBoundingClientRect();if(z(e))a=100/o.width*(e.pageX-o.left);else{if(!ne(r,n))return;a=parseFloat(r.style.left,10)}a<0?a=0:a>100&&(a=100);const l=this.duration/100*a;r.innerText=Ye.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(l)));c&&r.insertAdjacentHTML("afterbegin",`${c.label}<br>`),r.style.left=`${a}%`,z(e)&&["mouseenter","mouseleave"].includes(e.type)&&s("mouseenter"===e.type)},timeUpdate(e){const t=!R(this.elements.display.duration)&&this.config.invertTime;Ye.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Ye.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ie(this.elements.display.currentTime,!0),void ie(this.elements.progress,!0);R(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=R(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Ye.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Ye.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Ye.setMarkers.call(this),Ye.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ie(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const r=this.elements.settings.panels[e];let n=null,s=t;if("captions"===e)n=this.currentTrack;else{if(n=B(i)?this[e]:i,B(n)&&(n=this.config[e].default),!B(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(R(s)||(s=r&&r.querySelector('[role="menu"]')),!R(s))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Ye.getLabel.call(this,e,n);const a=s&&s.querySelector(`[value="${n}"]`);R(a)&&(a.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Oe.get("normal",this.config):`${t}×`;case"quality":if(k(t)){const e=Oe.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return je(t);case"captions":return Ge.getLabel.call(this);default:return null}},setQualityMenu(e){if(!R(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');O(e)&&(this.options.quality=Te(e).filter((e=>this.config.quality.options.includes(e))));const r=!B(this.options.quality)&&this.options.quality.length>1;if(Ye.toggleMenuButton.call(this,t,r),J(i),Ye.checkMenu.call(this),!r)return;const n=e=>{const t=Oe.get(`qualityBadge.${e}`,this.config);return t.length?Ye.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Ye.createMenuItem.call(this,{value:e,list:i,type:t,title:Ye.getLabel.call(this,"quality",e),badge:n(e)})})),Ye.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!R(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ge.getTracks.call(this),r=Boolean(i.length);if(Ye.toggleMenuButton.call(this,e,r),J(t),Ye.checkMenu.call(this),!r)return;const n=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ge.getLabel.call(this,e),badge:e.language&&Ye.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));n.unshift({value:-1,checked:!this.captions.toggled,title:Oe.get("disabled",this.config),list:t,type:"language"}),n.forEach(Ye.createMenuItem.bind(this)),Ye.updateSetting.call(this,e,t)},setSpeedMenu(){if(!R(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!B(this.options.speed)&&this.options.speed.length>1;Ye.toggleMenuButton.call(this,e,i),J(t),Ye.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Ye.createMenuItem.call(this,{value:i,list:t,type:e,title:Ye.getLabel.call(this,"speed",i)})})),Ye.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!B(e)&&Object.values(e).some((e=>!e.hidden));ie(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;R(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const r=i.querySelector('[role^="menuitem"]');le.call(this,r,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!R(t)||!R(i))return;const{hidden:r}=t;let n=r;if(x(e))n=e;else if(F(e)&&"Escape"===e.key)n=!1;else if(z(e)){const r=_(e.composedPath)?e.composedPath()[0]:e.target,s=t.contains(r);if(s||!s&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),ie(t,!n),re(this.elements.container,this.config.classNames.menu.open,n),n&&F(e)?Ye.focusFirstMenuItem.call(this,null,!0):n||r||le.call(this,i,F(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,r=t.scrollHeight;return X(t),{width:i,height:r}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!R(i))return;const r=i.parentNode,n=Array.from(r.children).find((e=>!e.hidden));if(ue.transitions&&!ue.reducedMotion){r.style.width=`${n.scrollWidth}px`,r.style.height=`${n.scrollHeight}px`;const e=Ye.getMenuSize.call(this,i),t=e=>{e.target===r&&["width","height"].includes(e.propertyName)&&(r.style.width="",r.style.height="",fe.call(this,r,$,t))};pe.call(this,r,$,t),r.style.width=`${e.width}px`,r.style.height=`${e.height}px`}ie(n,!0),ie(i,!1),Ye.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;R(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:r,createRange:n,createTime:s,setQualityMenu:a,setSpeedMenu:o,showMenuPanel:l}=Ye;this.elements.controls=null,O(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=V("div",te(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return Te(O(this.config.controls)?this.config.controls:[]).forEach((a=>{if("restart"===a&&c.appendChild(i.call(this,"restart",u)),"rewind"===a&&c.appendChild(i.call(this,"rewind",u)),"play"===a&&c.appendChild(i.call(this,"play",u)),"fast-forward"===a&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===a){const t=V("div",{class:`${u.class} plyr__progress__container`}),i=V("div",te(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(r.call(this,"buffer")),this.config.tooltips.seek){const e=V("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===a&&c.appendChild(s.call(this,"currentTime",u)),"duration"===a&&c.appendChild(s.call(this,"duration",u)),"mute"===a||"volume"===a){let{volume:t}=this.elements;if(R(t)&&c.contains(t)||(t=V("div",q({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===a&&t.appendChild(i.call(this,"mute")),"volume"===a&&!Q.isIos){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",q(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===a&&c.appendChild(i.call(this,"captions",u)),"settings"===a&&!B(this.config.settings)){const r=V("div",q({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));r.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=V("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),s=V("div"),a=V("div",{id:`plyr-settings-${e.id}-home`}),o=V("div",{role:"menu"});a.appendChild(o),s.appendChild(a),this.elements.settings.panels.home=a,this.config.settings.forEach((i=>{const r=V("button",q(te(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,r,i),pe.call(this,r,"click",(()=>{l.call(this,i,!1)}));const n=V("span",null,Oe.get(i,this.config)),a=V("span",{class:this.config.classNames.menu.value});a.innerHTML=e[i],n.appendChild(a),r.appendChild(n),o.appendChild(r);const c=V("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=V("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(V("span",{"aria-hidden":!0},Oe.get(i,this.config))),u.appendChild(V("span",{class:this.config.classNames.hidden},Oe.get("menuBack",this.config))),pe.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),pe.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(V("div",{role:"menu"})),s.appendChild(c),this.elements.settings.buttons[i]=r,this.elements.settings.panels[i]=c})),n.appendChild(s),r.appendChild(n),c.appendChild(r),this.elements.settings.popup=n,this.elements.settings.menu=r}if("pip"===a&&ue.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===a&&ue.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===a){const e=q({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!Y(t)&&this.isEmbed&&q(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===a&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&a.call(this,De.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=Ye.getIconUrl.call(this);e.cors&&ze(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i,r=!0;if(_(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),R(this.config.controls)||j(this.config.controls)?e=this.config.controls:(e=Ye.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ge.getLabel.call(this)}),r=!1),r&&j(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=ke(i,`{${e}}`,t)})),i})(e)),j(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),R(i)||(i=this.elements.container),i[R(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),R(this.elements.controls)||Ye.findElements.call(this),!B(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>ne(e,t),set(i=!1){re(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{O(t)||P(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(Q.isEdge&&G(i),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,r=ae.call(this,i);Array.from(r).forEach((e=>{re(e,this.config.classNames.hidden,!1),re(e,this.config.classNames.tooltip,!0)}))}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&e<this.duration));if(null==i||!i.length)return;const r=document.createDocumentFragment(),n=document.createDocumentFragment();let s=null;const a=`${this.config.classNames.tooltip}--visible`,o=e=>re(s,a,e);i.forEach((e=>{const t=V("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";s&&(t.addEventListener("mouseenter",(()=>{e.label||(s.style.left=i,s.innerHTML=e.label,o(!0))})),t.addEventListener("mouseleave",(()=>{o(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,n.appendChild(t)})),r.appendChild(n),this.config.tooltips.seek||(s=V("span",{class:this.config.classNames.tooltip},""),r.appendChild(s)),this.elements.markers={points:n,tip:s},this.elements.progress.appendChild(r)}};function Be(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function $e(e){const t=new URLSearchParams;return C(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Ge={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!ue.textTracks)return void(O(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ye.setCaptionsMenu.call(this));var e,t;if(R(this.elements.captions)||(this.elements.captions=V("div",te(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,R(e)&&R(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Q.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Be(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Re(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{X(e)}))}))}const i=Te((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let r=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===r&&([r]=i);let n=this.storage.get("captions");if(x(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:r,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";pe.call(this,this.media.textTracks,e,Ge.update.bind(this))}setTimeout(Ge.update.bind(this),0)},update(){const e=Ge.getTracks.call(this,!0),{active:t,language:i,meta:r,currentTrackNode:n}=this.captions,s=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!r.get(e))).forEach((e=>{this.debug.log("Track added",e),r.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),pe.call(this,e,"cuechange",(()=>Ge.updateCues.call(this)))})),(s&&this.language!==i||!e.includes(n))&&(Ge.setLanguage.call(this,i),Ge.toggle.call(this,t&&s)),this.elements&&re(this.elements.container,this.config.classNames.captions.enabled,!B(e)),O(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ye.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,r=this.config.classNames.captions.active,n=D(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=Ge.getTracks.call(this),t=Ge.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ge.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),re(this.elements.container,r,n),this.captions.toggled=n,Ye.updateSetting.call(this,"captions"),ye.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout((()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Ge.getTracks.call(this);if(-1!==e)if(k(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const r=i[e],{language:n}=r||{};this.captions.currentTrackNode=r,Ye.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n),ye.call(this,this.media,"languagechange")}Ge.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ge.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ge.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!j(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const r=Ge.getTracks.call(this),n=Ge.findTrack.call(this,[i]);Ge.set.call(this,r.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=Ge.getTracks.call(this),r=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort(((e,t)=>r(t)-r(e)));let s;return e.every((e=>(s=n.find((t=>t.language===e)),!s))),s||(t?n[0]:void 0)},getCurrentTrack(){return Ge.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!U(t)&&ue.textTracks&&this.captions.toggled&&(t=Ge.getCurrentTrack.call(this)),U(t)?B(t.label)?B(t.language)?Oe.get("enabled",this.config):e.language.toUpperCase():t.label:Oe.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!R(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!D(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Ge.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(xe)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){J(this.elements.captions);const e=V("span",te(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),ye.call(this,this.media,"cuechange")}}},Qe={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},He="picture-in-picture",qe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},We="video",Ze=()=>{};class Ve{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Ze}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Ze}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Ze}}class Ke{constructor(t){e(this,"onChange",(()=>{if(!this.enabled)return;const e=this.player.elements.buttons.fullscreen;R(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;ye.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",re(this.target,this.player.config.classNames.fullscreen.fallback,e),Q.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const r=j(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!r,r||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(Q.isIos||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=ae.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[r]=i,n=i[i.length-1];t!==n||e.shiftKey?t===r&&e.shiftKey&&(n.focus(),e.preventDefault()):(r.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.enabled){let e;e=this.forceFallback?"Fallback (forced)":Ke.native?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");re(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)})),e(this,"enter",(()=>{this.enabled&&(Q.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ke.native||this.forceFallback?this.toggleFallback(!0):this.prefix?B(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.enabled)if(Q.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Me(this.player.play());else if(!Ke.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!B(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=Ke.prefix,this.property=Ke.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(se.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),pe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),pe.call(this.player,this.player.elements.container,"dblclick",(e=>{R(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),pe.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return Ke.native&&!this.forceFallback}static get prefix(){if(_(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!_(document[`${t}ExitFullscreen`])&&!_(document[`${t}CancelFullScreen`])||(e=t,0)))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get enabled(){return(Ke.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!Ke.native||this.forceFallback)return ne(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return Q.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function Xe(e,t=1){return new Promise(((i,r)=>{const n=new Image,s=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:r)(n)};Object.assign(n,{onload:s,onerror:s,src:e})}))}const Je={addStyleHook(){re(this.elements.container,this.config.selectors.container.replace(".",""),!0),re(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Je.toggleNativeControls.call(this,!0);R(this.elements.controls)||(Ye.inject.call(this),this.listeners.controls()),Je.toggleNativeControls.call(this),this.isHTML5&&Ge.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ye.updateVolume.call(this),Ye.timeUpdate.call(this),Ye.durationUpdate.call(this),Je.checkPlaying.call(this),re(this.elements.container,this.config.classNames.pip.supported,ue.pip&&this.isHTML5&&this.isVideo),re(this.elements.container,this.config.classNames.airplay.supported,ue.airplay&&this.isHTML5),re(this.elements.container,this.config.classNames.isIos,Q.isIos),re(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{ye.call(this,this.media,"ready")}),0),Je.setTitle.call(this),this.poster&&Je.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Ye.durationUpdate.call(this),this.config.mediaMetadata&&Ye.setMediaMetadata.call(this)},setTitle(){let e=Oe.get("play",this.config);if(j(this.config.title)&&!B(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=oe.call(this,"iframe");if(!R(e))return;const t=B(this.config.title)?"video":this.config.title,i=Oe.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){re(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),ve.call(this).then((()=>Xe(e))).catch((t=>{throw e===this.poster&&Je.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Je.togglePoster.call(this,!0),e))))},checkPlaying(e){re(this.elements.container,this.config.classNames.playing,this.playing),re(this.elements.container,this.config.classNames.paused,this.paused),re(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Oe.get(this.playing?"pause":"play",this.config))})),z(e)&&"timeupdate"===e.type||Je.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{re(this.elements.container,this.config.classNames.loading,this.loading),Je.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!B(e)&&j(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),B(this.media.style)&&this.media.removeAttribute("style")}};class et{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,re(t.container,e.config.classNames.isTouch,!0)})),e(this,"setTabFocus",(e=>{const{player:t}=this,{elements:i}=t,{key:r,type:n,timeStamp:s}=e;if(clearTimeout(this.focusTimer),"keydown"===n&&"Tab"!==r)return;"keydown"===n&&(this.lastKeyDown=s);const a=s-this.lastKeyDown<=20;("focus"!==n||a)&&((()=>{const e=t.config.classNames.tabFocus;re(ae.call(t,`.${e}`),e,!1)})(),"focusout"!==n&&(this.focusTimer=setTimeout((()=>{const e=document.activeElement;i.container.contains(e)&&re(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&he.call(t,window,"keydown keyup",this.handleKey,e,!1),he.call(t,document.body,"click",this.toggleMenu,e),ge.call(t,document.body,"touchstart",this.firstTouch),he.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:r}=e;!t.keyboard.global&&t.keyboard.focused&&pe.call(e,i.container,"keydown keyup",this.handleKey,!1),pe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let s=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Je.toggleControls.call(e,!0),s=e.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout((()=>Je.toggleControls.call(e,!1)),s)}));const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:r}=e.fullscreen,[n,s]=we.call(e),a=be(`aspect-ratio: ${n} / ${s}`);if(!r)return void(a?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>n/s;a?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/s*n+"px":null,t.style.margin=c?"0 auto":null)},s=()=>{clearTimeout(r.resized),r.resized=setTimeout(n,50)};pe.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:r}=e.fullscreen;r===i.container&&(!e.isEmbed&&B(e.config.ratio)||(n(),("enterfullscreen"===t.type?pe:fe).call(e,window,"resize",s)))}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(pe.call(e,e.media,"timeupdate seeking seeked",(t=>Ye.timeUpdate.call(e,t))),pe.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Ye.durationUpdate.call(e,t))),pe.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),pe.call(e,e.media,"progress playing seeking seeked",(t=>Ye.updateProgress.call(e,t))),pe.call(e,e.media,"volumechange",(t=>Ye.updateVolume.call(e,t))),pe.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Je.checkPlaying.call(e,t))),pe.call(e,e.media,"waiting canplay seeked playing",(t=>Je.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=oe.call(e,`.${e.config.classNames.video}`);if(!R(i))return;pe.call(e,t.container,"click",(r=>{([t.container,i].includes(r.target)||i.contains(r.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(r,e.restart,"restart"),this.proxy(r,(()=>{Me(e.play())}),"play")):this.proxy(r,(()=>{Me(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&pe.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),pe.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),pe.call(e,e.media,"ratechange",(()=>{Ye.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),pe.call(e,e.media,"qualitychange",(t=>{Ye.updateSetting.call(e,"quality",null,t.detail.quality)})),pe.call(e,e.media,"ready qualitychange",(()=>{Ye.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");pe.call(e,e.media,i,(i=>{let{detail:r={}}=i;"error"===i.type&&(r=e.media.error),ye.call(e,t.container,i.type,!0,r)}))})),e(this,"proxy",((e,t,i)=>{const{player:r}=this,n=r.config.listeners[i];let s=!0;_(n)&&(s=n.call(r,e)),!1!==s&&_(t)&&t.call(r,e)})),e(this,"bind",((e,t,i,r,n=!0)=>{const{player:s}=this,a=s.config.listeners[r],o=_(a);pe.call(s,e,t,(e=>this.proxy(e,i,r)),n&&!o)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=Q.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{Me(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{ye.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Ye.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{["Space","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Ye.toggleMenu.call(e,t)):Ye.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Ye.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),r=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",r)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,r="play-on-seeked";if(F(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(r),s=["mouseup","touchend","keyup"].includes(t.type);n&&s?(i.removeAttribute(r),Me(e.play())):!s&&e.playing&&(i.setAttribute(r,""),e.pause())})),Q.isIos){const t=ae.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>G(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let r=i.getAttribute("seek-value");B(r)&&(r=i.value),i.removeAttribute("seek-value"),e.currentTime=r/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Ye.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),Q.isWebkit&&Array.from(ae.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Ye.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!R(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Ye.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:r}=e;re(t.controls,i.classNames.noTransition,!0),Je.toggleControls.call(e,!0),setTimeout((()=>{re(t.controls,i.classNames.noTransition,!1)}),0);const n=this.touch?3e3:4e3;clearTimeout(r.controls),r.controls=setTimeout((()=>Je.toggleControls.call(e,!1)),n)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[r,n]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),s=Math.sign(Math.abs(r)>Math.abs(n)?r:n);e.increaseVolume(s/50);const{volume:a}=e.media;(1===s&&a<1||-1===s&&a>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:r,type:n,altKey:s,ctrlKey:a,metaKey:o,shiftKey:l}=e,c="keydown"===n,u=c&&r===this.lastKey;var d;if(!(s||a||o||l)&&r)if(c){const n=document.activeElement;if(R(n)){const{editable:r}=t.config.selectors,{seek:s}=i.inputs;if(n!==s&&se(n,r))return;if("Space"===e.key&&se(n,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(r)&&(e.preventDefault(),e.stopPropagation()),r){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(d=parseInt(r,10),t.currentTime=t.duration/10*d);break;case"Space":case"k":u||Me(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===r&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=r}else this.lastKey=null}toggleMenu(e){Ye.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var tt=function(e,t){return function(e,t){e.exports=function(){var e=function(){},t={},i={},r={};function n(e,t){e=e.push?e:[e];var n,s,a,o=[],l=e.length,c=l;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)s=e[l],(a=i[s])?n(s,a):(r[s]=r[s]||[]).push(n)}function s(e,t){if(e){var n=r[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,r,n){var s,a,l=document,c=r.async,u=(r.numRetries||0)+1,d=r.before||e,h=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");n=n||0,/(^css!|\.css$)/.test(h)?((a=l.createElement("link")).rel="stylesheet",a.href=p,(s="hideFocus"in a)&&a.relList&&(s=0,a.rel="preload",a.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(a=l.createElement("img")).src=p:((a=l.createElement("script")).src=t,a.async=void 0===c||c),a.onload=a.onerror=a.onbeforeload=function(e){var l=e.type[0];if(s)try{a.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((n+=1)<u)return o(t,i,r,n)}else if("preload"==a.rel&&"style"==a.as)return a.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==d(t,a)&&l.head.appendChild(a)}function l(e,t,i){var r,n,s=(e=e.push?e:[e]).length,a=s,l=[];for(r=function(e,i,r){if("e"==i&&l.push(e),"b"==i){if(!r)return;l.push(e)}--s||t(l)},n=0;n<a;n++)o(e[n],r,i)}function c(e,i,r){var n,o;if(i&&i.trim&&(n=i),o=(n?r:i)||{},n){if(n in t)throw"LoadJS";t[n]=!0}function c(t,i){l(e,(function(e){a(o,e),t&&a({success:t,error:i},e),s(n,e)}),o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return n(e,(function(e){a(t,e)})),c},c.done=function(e){s(e,[])},c.reset=function(){t={},i={},r={}},c.isDefined=function(e){return e in t},c}()}(t={exports:{}}),t.exports}();function it(e){return new Promise(((t,i)=>{tt(e,{success:t,error:i})}))}function rt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ye.call(this,this.media,e?"play":"pause"))}const nt={setup(){const e=this;re(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Se.call(e),C(window.Vimeo)?nt.ready.call(e):it(e.config.urls.vimeo.sdk).then((()=>{nt.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:r,...n}=t;let s=e.media.getAttribute("src"),a="";B(s)?(s=e.media.getAttribute(e.config.attributes.embed.id),a=e.media.getAttribute(e.config.attributes.embed.hash)):a=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(s);const o=a?{h:a}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=$e({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...o,...n}),c=B(u=s)?null:k(Number(u))?u:u.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:u;var u;const d=V("iframe"),h=Ce(e.config.urls.vimeo.iframe,c,l);if(d.setAttribute("src",h),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),B(r)||d.setAttribute("referrerPolicy",r),i||!t.customControls)d.setAttribute("data-poster",e.poster),e.media=ee(d,e.media);else{const t=V("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(d),e.media=ee(t,e.media)}t.customControls||Re(Ce(e.config.urls.vimeo.api,h)).then((t=>{!B(t)&&t.thumbnail_url&&Je.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(d,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(rt.call(e,!0),e.embed.play()),e.media.pause=()=>(rt.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:p}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>p,set(t){const{embed:i,media:r,paused:n,volume:s}=e,a=n&&!i.hasPlayed;r.seeking=!0,ye.call(e,r,"seeking"),Promise.resolve(a&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>a&&i.pause())).then((()=>a&&i.setVolume(s))).catch((()=>{}))}});let f=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>f,set(t){e.embed.setPlaybackRate(t).then((()=>{f=t,ye.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:g}=e.config;Object.defineProperty(e.media,"volume",{get:()=>g,set(t){e.embed.setVolume(t).then((()=>{g=t,ye.call(e,e.media,"volumechange")}))}});let{muted:y}=e.config;Object.defineProperty(e.media,"muted",{get:()=>y,set(t){const i=!!x(t)&&t;e.embed.setVolume(i?0:e.config.volume).then((()=>{y=i,ye.call(e,e.media,"volumechange")}))}});let m,{loop:v}=e.config;Object.defineProperty(e.media,"loop",{get:()=>v,set(t){const i=x(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{v=i}))}}),e.embed.getVideoUrl().then((t=>{m=t,Ye.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>m}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,r]=t;e.embed.ratio=Ae(i,r),Se.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Je.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{p=t,ye.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,ye.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Ge.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));Ge.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{rt.call(e,!t),t||ye.call(e,e.media,"playing")})),R(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{ye.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{ye.call(e,e.media,"playing")})),e.embed.on("play",(()=>{rt.call(e,!0),ye.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{rt.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,p=t.seconds,ye.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,ye.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&ye.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,ye.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,ye.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,ye.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,ye.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Je.build.call(e)),0)}};function st(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ye.call(this,this.media,e?"play":"pause"))}function at(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ot={setup(){if(re(this.elements.wrapper,this.config.classNames.embed,!0),C(window.YT)&&_(window.YT.Player))ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{_(e)&&e(),ot.ready.call(this)},it(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Re(Ce(this.config.urls.youtube.api,e)).then((e=>{if(C(e)){const{title:t,height:i,width:r}=e;this.config.title=t,Je.setTitle.call(this),this.embed.ratio=Ae(r,i)}Se.call(this)})).catch((()=>{Se.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!B(i)&&i.startsWith("youtube-"))return;let r=e.media.getAttribute("src");B(r)&&(r=e.media.getAttribute(this.config.attributes.embed.id));const n=B(s=r)?null:s.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:s;var s;const a=V("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=ee(a,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Xe(t("maxres"),121).catch((()=>Xe(t("sd"),121))).catch((()=>Xe(t("hq")))).then((t=>Je.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:n,host:at(t),playerVars:q({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,r={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:r},ye.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),ye.call(e,e.media,"ratechange")},onReady(i){if(_(e.media.play))return;const r=i.target;ot.getTitle.call(e,n),e.media.play=()=>{st.call(e,!0),r.playVideo()},e.media.pause=()=>{st.call(e,!1),r.pauseVideo()},e.media.stop=()=>{r.stopVideo()},e.media.duration=r.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(r.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ye.call(e,e.media,"seeking"),r.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>r.getPlaybackRate(),set(e){r.setPlaybackRate(e)}});let{volume:s}=e.config;Object.defineProperty(e.media,"volume",{get:()=>s,set(t){s=t,r.setVolume(100*s),ye.call(e,e.media,"volumechange")}});let{muted:a}=e.config;Object.defineProperty(e.media,"muted",{get:()=>a,set(t){const i=x(t)?t:a;a=i,r[i?"mute":"unMute"](),r.setVolume(100*s),ye.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>r.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=r.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ye.call(e,e.media,"timeupdate"),ye.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=r.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&ye.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),ye.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>Je.build.call(e)),50)},onStateChange(i){const r=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,ye.call(e,e.media,"seeked")),i.data){case-1:ye.call(e,e.media,"timeupdate"),e.media.buffered=r.getVideoLoadedFraction(),ye.call(e,e.media,"progress");break;case 0:st.call(e,!1),e.media.loop?(r.stopVideo(),r.playVideo()):ye.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(st.call(e,!0),ye.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{ye.call(e,e.media,"timeupdate")}),50),e.media.duration!==r.getDuration()&&(e.media.duration=r.getDuration(),ye.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),st.call(e,!1);break;case 3:ye.call(e,e.media,"waiting")}ye.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},lt={setup(){this.media?(re(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),re(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&re(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=V("div",{class:this.config.classNames.video}),W(this.media,this.elements.wrapper),this.elements.poster=V("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?De.setup.call(this):this.isYouTube?ot.setup.call(this):this.isVimeo&&nt.setup.call(this)):this.debug.warn("No media element found!")}};class ct{constructor(t){e(this,"load",(()=>{this.enabled&&(C(window.google)&&C(window.google.ima)?this.ready():it(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=V("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Ue(Math.max(this.manager.getRemainingTime(),0)),t=`${Oe.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{B(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(R(t)){const i=100/this.player.duration*e,r=V("span",{class:this.player.config.classNames.cues});r.style.left=`${i.toString()}%`,t.appendChild(r)}}}))})),e(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),r=e.getAdData();switch((e=>{ye.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;B(this.cuePoints)||this.cuePoints.forEach(((i,r)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(r,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,Me(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const i=this.events[e];O(i)&&i.forEach((e=>{_(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(O(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{D(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!B(e.publisherId)||Y(e.tagUrl))}get tagUrl(){const{config:e}=this;return Y(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${$e({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ut(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}const dt=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(k(i.startTime)){if(!B(e.trim())&&B(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},ht=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class pt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(B(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(_(t))t((e=>{this.thumbnails=e,i()}));else{const e=(j(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{Re(e).then((i=>{const r={frames:dt(i),height:null,urlPrefix:""};r.frames[0].text.startsWith("/")||r.frames[0].text.startsWith("http://")||r.frames[0].text.startsWith("https://")||(r.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{r.height=n.naturalHeight,r.width=n.naturalWidth,this.thumbnails.push(r),t()},n.src=r.urlPrefix+r.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&z(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const r=this.player.elements.progress.getBoundingClientRect(),n=100/r.width*(e.pageX-r.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Ue(this.seekTime);const s=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));s&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${s.label}<br>`)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(D(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ge.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=V("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=V("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=V("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=V("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),R(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=V("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,r)=>{this.loadedImages.includes(t.frames[e].text)&&(i=r)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:r}=i,n=i.frames[t],s=i.frames[t].text,a=r+s;if(this.currentImageElement&&this.currentImageElement.dataset.filename===s)this.showImage(this.currentImageElement,n,e,t,s,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=a,i.dataset.index=t,i.dataset.filename=s,this.showingThumbFilename=s,this.player.debug.log(`Loading image: ${a}`),i.onload=()=>this.showImage(i,n,e,t,s,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,r,n,s=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${r}. qual: ${i}. newimg: ${s}`),this.setImageSizeAndOffset(e,t),s&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(i,e,t,n))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const r=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===r){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let s=!1;n.forEach((e=>{const t=e.text;if(t!==r&&!this.loadedImages.includes(t)){s=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],r=e+t,n=new Image;n.src=r,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),s||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,r)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,r=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,s=this.mousePosX-e.left-i.clientWidth/2,a=ut(s,r,n);i.style.left=`${a}px`,i.style.setProperty("--preview-arrow-offset",s-a+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const ft={insertElements(e,t){j(t)?K(e,this.media,{src:t}):O(t)&&t.forEach((t=>{K(e,this.media,t)}))},change(e){H(e,"sources.length")?(De.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],X(this.media),this.media=null,R(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:r=qe.html5,src:n}]=t,s="html5"===r?i:"div",a="html5"===r?{}:{src:n};Object.assign(this,{provider:r,type:i,supported:ue.check(i,r,this.config.playsinline),media:V(s,a)}),this.elements.container.appendChild(this.media),x(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),B(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Je.addStyleHook.call(this),this.isHTML5&&ft.insertElements.call(this,"source",t),this.config.title=e.title,lt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&ft.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.isHTML5&&this.media.load(),B(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class gt{constructor(t,i){if(e(this,"play",(()=>_(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>Me(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&_(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(x(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):_(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=k(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=k(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(k(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{ue.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=ne(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,r=re(this.elements.container,this.config.classNames.hideControls,i);if(r&&O(this.config.controls)&&this.config.controls.includes("settings")&&!B(this.config.settings)&&Ye.toggleMenu.call(this,!1),r!==t){const e=r?"controlshidden":"controlsshown";ye.call(this,this.media,e)}return!r}return!1})),e(this,"on",((e,t)=>{pe.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{ge.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{fe(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(X(this.elements.buttons.play),X(this.elements.captions),X(this.elements.controls),X(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),_(e)&&e()):(me.call(this),De.cancelRequests.call(this),ee(this.elements.original,this.elements.container),ye.call(this,this.elements.original,"destroyed",!0),_(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Je.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&_(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),e(this,"supports",(e=>ue.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ue.touch,this.media=t,j(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||P(this.media)||O(this.media))&&(this.media=this.media[0]),this.config=q({},Qe,gt.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Ve(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ue),D(this.media)||!R(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!ue.check().api)return void this.debug.error("Setup failed: no support");const r=this.media.cloneNode(!0);r.autoplay=!1,this.elements.original=r;const n=this.media.tagName.toLowerCase();let s=null,a=null;switch(n){case"div":if(s=this.media.querySelector("iframe"),R(s)){if(a=Be(s.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?qe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?qe.vimeo:null}(a.toString()),this.elements.container=this.media,this.media=s,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(B(this.provider)||!Object.values(qe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=We;break;case"video":case"audio":this.type=n,this.provider=qe.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=ue.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new et(this),this.storage=new Pe(this),this.media.plyr=this,R(this.elements.container)||(this.elements.container=V("div",{tabindex:0}),W(this.media,this.elements.container)),Je.migrateStyles.call(this),Je.addStyleHook.call(this),lt.setup.call(this),this.config.debug&&pe.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ke(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ct(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>Me(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===qe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===qe.youtube}get isVimeo(){return this.provider===qe.vimeo}get isVideo(){return this.type===We}get isAudio(){return"audio"===this.type}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=k(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return k(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=k(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;j(t)&&(t=Number(t)),k(t)||(t=this.storage.get("volume")),k(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!B(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;x(t)||(t=this.storage.get("muted")),x(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;k(e)&&(t=e),k(t)||(t=this.storage.get("speed")),k(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:r}=this;t=ut(t,i,r),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let r=[!B(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(k),n=!0;if(!i.includes(r)){const e=Le(i,r);this.debug.warn(`Unsupported quality option: ${r}, using ${e} instead`),r=e,n=!1}t.selected=r,this.media.quality=r,n&&this.storage.set({quality:r})}get quality(){return this.media.quality}set loop(e){const t=x(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){ft.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return Y(e)?e:this.source}set download(e){Y(e)&&(this.config.urls.download=e,Ye.setDownloadUrl.call(this))}set poster(e){this.isVideo?Je.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ne(we.call(this));return O(e)?e.join(":"):e}set ratio(e){this.isVideo?j(e)&&Ie(e)?(this.config.ratio=Ne(e),Se.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=x(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Ge.toggle.call(this,e,!1)}set currentTrack(e){Ge.set.call(this,e,!1),Ge.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ge.setLanguage.call(this,e,!1)}get language(){return(Ge.getCurrentTrack.call(this)||{}).language}set pip(e){if(!ue.pip)return;const t=x(e)?e:!this.pip;_(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?He:"inline"),_(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return ue.pip?B(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===He:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))}static supported(e,t,i){return ue.check(e,t,i)}static loadSprite(e,t){return ze(e,t)}static setup(e,t={}){let i=null;return j(e)?i=Array.from(document.querySelectorAll(e)):P(e)?i=Array.from(e):O(e)&&(i=e.filter(R)),B(i)?null:i.map((e=>new gt(e,t)))}}var yt;return gt.defaults=(yt=Qe,JSON.parse(JSON.stringify(yt))),gt}())},4096:function(e){e.exports=function(){"use strict";function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function i(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function r(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?i(Object(n),!0).forEach((function(i){t(e,i,n[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var n={addCSS:!0,thumbWidth:15,watch:!0};function s(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var a=function(e){return null!=e?e.constructor:null},o=function(e,t){return!!(e&&t&&e instanceof t)},l=function(e){return a(e)===String},c=function(e){return Array.isArray(e)},u=function(e){return o(e,NodeList)},d=l,h=c,p=u,f=function(e){return o(e,Element)},g=function(e){return o(e,Event)},y=function(e){return function(e){return null==e}(e)||(l(e)||c(e)||u(e))&&!e.length||function(e){return a(e)===Object}(e)&&!Object.keys(e).length};return function(){function t(e,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),f(e)?this.element=e:d(e)&&(this.element=document.querySelector(e)),f(this.element)&&y(this.element.rangeTouch)&&(this.config=r({},n,{},i),this.init())}return i=t,o=[{key:"setup",value:function(e){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=null;if(y(e)||d(e)?a=Array.from(document.querySelectorAll(d(e)?e:'input[type="range"]')):f(e)?a=[e]:p(e)?a=Array.from(e):h(e)&&(a=e.filter(f)),y(a))return null;var o=r({},n,{},i);if(d(e)&&o.watch){var l=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){f(i)&&s(i,e)&&new t(i,o)}))}))}));l.observe(document.body,{childList:!0,subtree:!0})}return a.map((function(e){return new t(e,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}],(a=[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(e){if(!t.enabled||!g(e))return null;var i,r=e.target,n=e.changedTouches[0],s=parseFloat(r.getAttribute("min"))||0,a=parseFloat(r.getAttribute("max"))||100,o=parseFloat(r.getAttribute("step"))||1,l=r.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(n.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),s+function(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(a-s),o)}},{key:"set",value:function(e){t.enabled&&g(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(e.target,"touchend"===e.type?"change":"input"))}}])&&e(i.prototype,a),o&&e(i,o),t;var i,a,o}()}()},481:(e,t,i)=>{!function(e){"use strict";e.exports.is_uri=i,e.exports.is_http_uri=r,e.exports.is_https_uri=n,e.exports.is_web_uri=s,e.exports.isUri=i,e.exports.isHttpUri=r,e.exports.isHttpsUri=n,e.exports.isWebUri=s;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function i(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var i,r,n,s,a,o="",l="";if(o=(i=t(e))[1],r=i[2],n=i[3],s=i[4],a=i[5],o&&o.length&&n.length>=0){if(r&&r.length){if(0!==n.length&&!/^\//.test(n))return}else if(/^\/\//.test(n))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(o.toLowerCase()))return l+=o+":",r&&r.length&&(l+="//"+r),l+=n,s&&s.length&&(l+="?"+s),a&&a.length&&(l+="#"+a),l}}}function r(e,r){if(i(e)){var n,s,a,o,l="",c="",u="",d="";if(l=(n=t(e))[1],c=n[2],s=n[3],a=n[4],o=n[5],l){if(r){if("https"!=l.toLowerCase())return}else if("http"!=l.toLowerCase())return;if(c)return/:(\d+)$/.test(c)&&(u=c.match(/:(\d+)$/)[0],c=c.replace(/:\d+$/,"")),d+=l+":",d+="//"+c,u&&(d+=u),d+=s,a&&a.length&&(d+="?"+a),o&&o.length&&(d+="#"+o),d}}}function n(e){return r(e,!0)}function s(e){return r(e)||n(e)}}(e=i.nmd(e))},3991:(e,t,i)=>{var r={"./arrow-down.svg":6785,"./arrow-left.svg":5591,"./chevron-down-full.svg":483,"./chevron-down.svg":6907,"./chevron-up-full.svg":6735,"./chevron-up.svg":5713,"./close.svg":1424,"./compass.svg":5359,"./external-link.svg":32,"./facebook.svg":1978,"./fast-backward.svg":3621,"./fast-forward.svg":4239,"./file-text.svg":1553,"./home.svg":8322,"./logo-big.png":4755,"./logo.png":971,"./maximize.svg":29,"./mini-player.svg":2536,"./minimize.svg":2529,"./more-vertical.svg":5352,"./mute.svg":6205,"./pause.svg":1935,"./play.svg":9321,"./search.svg":4682,"./settings.svg":9608,"./share.svg":735,"./skip-backward.svg":5862,"./skip-forward.svg":6707,"./speed-1-5.svg":366,"./speed-1.svg":9852,"./speed-2.svg":7270,"./subtitles.svg":2614,"./twitter.svg":4576,"./university.svg":1939,"./user.svg":6895,"./volume-1.svg":3132,"./volume-2.svg":9265,"./volume-3.svg":5929};function n(e){var t=s(e);return i(t)}function s(e){if(!i.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve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LDIuNzMsNi42cy0uOTcsNC44NC0yLjczLDYuNmMtLjIuMi0uNDUuMjktLjcxLjI5Wm0tMi45NC0yLjk0Yy0uMjYsMC0uNTEtLjEtLjcxLS4yOS0uMzktLjM5LS4zOS0xLjAyLDAtMS40MS42LS42LjkzLTEuMzkuOTMtMi4yNHMtLjMzLTEuNjQtLjkzLTIuMjRjLS4zOS0uMzktLjM5LTEuMDIsMC0xLjQxczEuMDItLjM5LDEuNDEsMGMuOTguOTgsMS41MSwyLjI3LDEuNTEsMy42NXMtLjU0LDIuNjgtMS41MSwzLjY1Yy0uMi4yLS40NS4yOS0uNzEuMjlabTYuNzQsNS4zM2MtLjMsMC0uNTktLjEzLS44Mi0uMzktLjQ1LS41My0uNDUtMS4zOCwwLTEuOSwxLjYtMS44NywyLjQ4LTQuMzUsMi40OC02Ljk4cy0uODgtNS4xMi0yLjQ4LTYuOThjLS40NS0uNTMtLjQ1LTEuMzgsMC0xLjlzMS4xOC0uNTMsMS42MywwYzIuMDMsMi4zNywzLjE1LDUuNTMsMy4xNSw4Ljg5cy0xLjEyLDYuNTEtMy4xNSw4Ljg5Yy0uMjMuMjYtLjUyLjM5LS44Mi4zOVoiLz4KPC9zdmc+"},7061:(e,t,i)=>{var r=i(8698).default;function n(){"use strict";e.exports=n=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},i=Object.prototype,s=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function h(e,t,i,r){var n=t&&t.prototype instanceof g?t:g,s=Object.create(n.prototype),o=new A(r||[]);return a(s,"_invoke",{value:I(e,i,o)}),s}function p(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var f={};function g(){}function y(){}function m(){}var v={};d(v,l,(function(){return this}));var M=Object.getPrototypeOf,T=M&&M(M(D([])));T&&T!==i&&s.call(T,l)&&(v=T);var L=m.prototype=g.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function i(n,a,o,l){var c=p(e[n],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&s.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,o,l)}),(function(e){i("throw",e,o,l)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return i("throw",e,o,l)}))}l(c.arg)}var n;a(this,"_invoke",{value:function(e,r){function s(){return new t((function(t,n){i(e,r,t,n)}))}return n=n?n.then(s,s):s()}})}function I(e,t,i){var r="suspendedStart";return function(n,s){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw s;return{value:void 0,done:!0}}for(i.method=n,i.arg=s;;){var a=i.delegate;if(a){var o=N(a,i);if(o){if(o===f)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===r)throw r="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r="executing";var l=p(e,t,i);if("normal"===l.type){if(r=i.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r="completed",i.method="throw",i.arg=l.arg)}}}function N(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,N(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=p(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var n=r.arg;return n?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function D(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(s.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return y.prototype=m,a(L,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=d(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,d(e,u,"GeneratorFunction")),e.prototype=Object.create(L),e},t.awrap=function(e){return{__await:e}},b(E.prototype),d(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,i,r,n,s){void 0===s&&(s=Promise);var a=new E(h(e,i,r,n),s);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(L),d(L,u,"Generator"),d(L,l,(function(){return this})),d(L,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var r in t)i.push(r);return i.reverse(),function e(){for(;i.length;){var r=i.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=D,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,r){return a.type="throw",a.arg=e,t.next=i,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],a=n.completion;if("root"===n.tryLoc)return i("end");if(n.tryLoc<=this.prev){var o=s.call(n,"catchLoc"),l=s.call(n,"finallyLoc");if(o&&l){if(this.prev<n.catchLoc)return i(n.catchLoc,!0);if(this.prev<n.finallyLoc)return i(n.finallyLoc)}else if(o){if(this.prev<n.catchLoc)return i(n.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return i(n.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),S(i),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var n=r.arg;S(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:D(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,i)=>{var r=i(7061)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},5266:(e,t,i)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},r.apply(this,arguments)}function n(e,t){const i=t.width,r=t.height,n=t.inlineSize,s=t.blockSize;switch(e){case 1:return null!=i?{type:3,value:i,unit:"px"}:{type:1};case 3:return null!=n?{type:3,value:n,unit:"px"}:{type:1};case 2:return null!=r?{type:3,value:r,unit:"px"}:{type:1};case 4:return null!=s?{type:3,value:s,unit:"px"}:{type:1};case 5:return null!=i&&null!=r&&r>0?{type:2,value:i/r}:{type:1};case 6:return null!=i&&null!=r?{type:4,value:r>=i?"portrait":"landscape"}:{type:1}}}function s(e,t){switch(e.type){case 1:case 2:case 3:case 4:return h(e,t);case 5:{const i=t.sizeFeatures.get(e.feature);return null==i?{type:1}:i}case 6:return e.value}}function a(e){return{type:5,value:e}}function o(e,t,i){return a(function(e,t,i){switch(i){case 1:return e===t;case 2:return e>t;case 3:return e>=t;case 4:return e<t;case 5:return e<=t}}(e,t,i))}function l(e,t,i){return null==e?t:null==t?e:i(e,t)}function c(e,t){switch(e){case"cqw":return t.cqw;case"cqh":return t.cqh;case"cqi":return 0===t.writingAxis?t.cqw:t.cqh;case"cqb":return 1===t.writingAxis?t.cqw:t.cqh;case"cqmin":return l(c("cqi",t),c("cqb",t),Math.min);case"cqmax":return l(c("cqi",t),c("cqb",t),Math.max)}}function u(e,{treeContext:t}){switch(e.unit){case"px":return e.value;case"rem":return e.value*t.rootFontSize;case"em":return e.value*t.fontSize;case"cqw":case"cqh":case"cqi":case"cqb":case"cqmin":case"cqmax":return l(e.value,c(e.unit,t),((e,t)=>e*t))}return null}function d(e,t){switch(e.type){case 2:return 0===e.value?0:null;case 3:return u(e,t)}return null}function h(e,t){switch(e.type){case 4:return function(e,t){const i=s(e.left,t),r=s(e.right,t),n=e.operator;if(4===i.type&&4===r.type||5===i.type&&5===r.type)return function(e,t,i){return 1===i?a(e.value===t.value):{type:1}}(i,r,n);if(3===i.type||3===r.type){const e=d(i,t),s=d(r,t);if(null!=e&&null!=s)return o(e,s,n)}else if(2===i.type&&2===r.type)return o(i.value,r.value,n);return{type:1}}(e,t);case 2:return function(e,t){const i=h(e.left,t);return 5!==i.type||!0!==i.value?i:h(e.right,t)}(e,t);case 3:return function(e,t){const i=h(e.left,t);return 5===i.type&&!0===i.value?i:h(e.right,t)}(e,t);case 1:{const i=h(e.value,t);return 5===i.type?{type:5,value:!i.value}:{type:1}}case 5:return p(s(e,t));case 6:return p(e.value)}}function p(e){switch(e.type){case 5:return e;case 2:case 3:return{type:5,value:e.value>0}}return{type:1}}i.r(t);const f=Array.from({length:4},(()=>Math.floor(256*Math.random()).toString(16))).join(""),g=I("container"),y=I("container-type"),m=I("container-name"),v=`data-cqs-${f}`,M=`data-cqc-${f}`,T=I("cqw"),L=I("cqh"),b=I("cqi"),E=I("cqb");function I(e){return`--cq-${e}-${f}`}const N=Symbol();function w(e,t){const i={value:t,errorIndices:[],index:-1,at(r){const n=i.index+r;return n>=e.length?t:e[n]},consume:e=>(i.index+=e,i.value=i.at(0),i.value),reconsume(){i.index-=1},error(){i.errorIndices.push(i.index)}};return i}function S(e){return w(e,{type:0})}function*A(e){const t=[];let i=!1;for(const r of e){const e=r.codePointAt(0);i&&10!==e&&(i=!1,t.push(10)),0===e||e>=55296&&e<=57343?t.push(65533):13===e?i=!0:t.push(e)}const r=w(t,-1),{at:n,consume:s,error:a,reconsume:o}=r;function l(){return String.fromCodePoint(r.value)}function c(){return{type:13,value:l()}}function u(){for(;j(n(1));)s(1)}function d(){for(;-1!==r.value;)if(s(1),42===n(0)&&47===n(1))return void s(1);a()}function h(){const[e,t]=function(){let e=0,t="",i=n(1);for(43!==i&&45!==i||(s(1),t+=l());D(n(1));)s(1),t+=l();if(46===n(1)&&D(n(2)))for(e=1,s(1),t+=l();D(n(1));)s(1),t+=l();if(i=n(1),69===i||101===i){const i=n(2);if(D(i))for(e=1,s(1),t+=l();D(n(1));)s(1),t+=l();else if((45===i||43===i)&&D(n(3)))for(e=1,s(1),t+=l(),s(1),t+=l();D(n(1));)s(1),t+=l()}return[t,e]}(),i=n(1);return y(i,n(1),n(2))?{type:15,value:e,flag:t,unit:v()}:37===i?(s(1),{type:16,value:e}):{type:17,value:e,flag:t}}function p(){const e=v();let t=n(1);if("url"===e.toLowerCase()&&40===t){for(s(1);j(n(1))&&j(n(2));)s(1);t=n(1);const i=n(2);return 34===t||39===t?{type:23,value:e}:!j(t)||34!==i&&39!==i?function(){let e="";for(u();;){const i=s(1);if(41===i)return{type:20,value:e};if(-1===i)return a(),{type:20,value:e};if(j(i)){u();const t=n(1);return 41===t||-1===t?(s(1),-1===i&&a(),{type:20,value:e}):(M(),{type:21})}if(34===i||39===i||40===i||(t=i)>=0&&t<=8||11===t||t>=14&&t<=31||127===t)return a(),M(),{type:21};if(92===i){if(!_(i,n(1)))return a(),{type:21};e+=g()}else e+=l()}var t}():{type:23,value:e}}return 40===t?(s(1),{type:23,value:e}):{type:24,value:e}}function f(e){let t="";for(;;){const i=s(1);if(-1===i||i===e)return-1===i&&a(),{type:2,value:t};if(k(i))return a(),o(),{type:3};if(92===i){const e=n(1);if(-1===e)continue;k(e)?s(1):t+=g()}else t+=l()}}function g(){const e=s(1);if(C(e)){const t=[e];for(let e=0;e<5;e++){const e=n(1);if(!C(e))break;t.push(e),s(1)}j(n(1))&&s(1);let i=parseInt(String.fromCodePoint(...t),16);return(0===i||i>=55296&&i<=57343||i>1114111)&&(i=65533),String.fromCodePoint(i)}return-1===e?(a(),String.fromCodePoint(65533)):l()}function y(e,t,i){return 45===e?x(t)||45===t||_(t,i):!!x(e)}function m(e,t,i){return 43===e||45===e?D(t)||46===t&&D(i):!(46!==e||!D(t))||!!D(e)}function v(){let e="";for(;;){const t=s(1);if(O(t))e+=l();else{if(!_(t,n(1)))return o(),e;e+=g()}}}function M(){for(;;){const e=s(1);if(-1===e)return;_(e,n(1))&&g()}}for(;;){const e=s(1);if(47===e&&42===n(1))s(2),d();else if(j(e))u(),yield{type:1};else if(34===e)yield f(e);else if(35===e){const e=n(1);O(e)||_(e,n(2))?yield{type:14,flag:y(n(1),n(2),n(3))?1:0,value:v()}:yield c()}else if(39===e)yield f(e);else if(40===e)yield{type:4};else if(41===e)yield{type:5};else if(43===e)m(e,n(1),n(2))?(o(),yield h()):yield c();else if(44===e)yield{type:6};else if(45===e){const t=n(1),i=n(2);m(e,t,i)?(o(),yield h()):45===t&&62===i?(s(2),yield{type:19}):y(e,t,i)?(o(),yield p()):yield c()}else if(46===e)m(e,n(1),n(2))?(o(),yield h()):yield c();else if(58===e)yield{type:7};else if(59===e)yield{type:8};else if(60===e)33===n(1)&&45===n(2)&&45===n(3)?yield{type:18}:yield c();else if(64===e)if(y(n(1),n(2),n(3))){const e=v();yield{type:22,value:e}}else yield c();else if(91===e)yield{type:9};else if(92===e)_(e,n(1))?(o(),yield p()):(a(),yield c());else if(93===e)yield{type:10};else if(123===e)yield{type:11};else if(125===e)yield{type:12};else if(D(e))o(),yield h();else if(x(e))o(),yield p();else{if(-1===e)return yield{type:0},r.errorIndices;yield{type:13,value:l()}}}}function D(e){return e>=48&&e<=57}function C(e){return D(e)||e>=65&&e<=70||e>=97&&e<=102}function k(e){return 10===e||13===e||12===e}function j(e){return k(e)||9===e||32===e}function x(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128||95===e}function _(e,t){return 92===e&&!k(t)}function O(e){return x(e)||D(e)||45===e}const P={11:12,9:10,4:5};function R(e,t){const i=function(e,t){const i=[];for(;;)switch(e.consume(1).type){case 1:break;case 0:return{type:3,value:i};case 18:case 19:if(!1!==t){e.reconsume();const t=B(e);t!==N&&i.push(t)}break;case 22:e.reconsume(),i.push(Y(e));break;default:{e.reconsume();const t=B(e);t!==N&&i.push(t);break}}}(S(e),!0===t);return r({},i,{value:i.value.map((e=>26===e.type?function(e,t){return 0===e.value.value.type?r({},e,{value:r({},e.value,{value:F(e.value.value.value)})}):e}(e):e))})}function z(e){const t=S(e),i=[];for(;;){if(0===t.consume(1).type)return i;t.reconsume(),i.push(G(t))}}function F(e){return function(e){const t=[],i=[];for(;;){const r=e.consume(1);switch(r.type){case 1:case 8:break;case 0:return{type:1,value:[...i,...t]};case 22:e.reconsume(),t.push(Y(e));break;case 24:{const t=[r];let n=e.at(1);for(;8!==n.type&&0!==n.type;)t.push(G(e)),n=e.at(1);const s=$(S(t));s!==N&&i.push(s);break}case 13:if("&"===r.value){e.reconsume();const i=B(e);i!==N&&t.push(i);break}default:{e.error(),e.reconsume();let t=e.at(1);for(;8!==t.type&&0!==t.type;)G(e),t=e.at(1);break}}}}(S(e))}function U(e){for(;1===e.at(1).type;)e.consume(1)}function Y(e){let t=e.consume(1);if(22!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 8:return{type:25,name:i,prelude:r,value:null};case 0:return e.error(),{type:25,name:i,prelude:r,value:null};case 11:return{type:25,name:i,prelude:r,value:Q(e)};case 28:if(11===t.source.type)return{type:25,name:i,prelude:r,value:t};default:e.reconsume(),r.push(G(e))}}function B(e){let t=e.value;const i=[];for(;;)switch(t=e.consume(1),t.type){case 0:return e.error(),N;case 11:return{type:26,prelude:i,value:Q(e)};case 28:if(11===t.source.type)return{type:26,prelude:i,value:t};default:e.reconsume(),i.push(G(e))}}function $(e){const t=e.consume(1);if(24!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,r=[];let n=!1;if(U(e),7!==e.at(1).type)return e.error(),N;for(e.consume(1),U(e);0!==e.at(1).type;)r.push(G(e));const s=r[r.length-2],a=r[r.length-1];return s&&13===s.type&&"!"===s.value&&24===a.type&&"important"===a.value.toLowerCase()&&(n=!0,r.splice(r.length-2)),{type:29,name:i,value:r,important:n}}function G(e){const t=e.consume(1);switch(t.type){case 11:case 9:case 4:return Q(e);case 23:return function(e){let t=e.value;if(23!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,r=[];for(;;)switch(t=e.consume(1),t.type){case 5:return{type:27,name:i,value:r};case 0:return e.error(),{type:27,name:i,value:r};default:e.reconsume(),r.push(G(e))}}(e);default:return t}}function Q(e){let t=e.value;const i=t,r=P[i.type];if(!r)throw new Error(`Unexpected type ${t.type}`);const n=[];for(;;)switch(t=e.consume(1),t.type){case r:return{type:28,source:i,value:{type:0,value:n}};case 0:return e.error(),{type:28,source:i,value:{type:0,value:n}};default:e.reconsume(),n.push(G(e))}}function H(e){return U(e),0===e.at(1).type}const q={11:["{","}"],9:["[","]"],4:["(",")"]};function W(e,t){switch(e.type){case 25:return`@${CSS.escape(e.name)} ${e.prelude.map((e=>W(e))).join("")}${e.value?W(e.value):";"}`;case 26:return`${e.prelude.map((e=>W(e))).join("")}${W(e.value)}`;case 28:{const[t,i]=q[e.source.type];return`${t}${Z(e.value)}${i}`}case 27:return`${CSS.escape(e.name)}(${e.value.map((e=>W(e))).join("")})`;case 29:return`${CSS.escape(e.name)}:${e.value.map((e=>W(e))).join("")}${e.important?" !important":""}`;case 1:return" ";case 8:return";";case 7:return":";case 14:return"#"+CSS.escape(e.value);case 24:return CSS.escape(e.value);case 15:return e.value+CSS.escape(e.unit);case 13:case 17:return e.value;case 2:return`"${CSS.escape(e.value)}"`;case 6:return",";case 20:return"url("+CSS.escape(e.value)+")";case 22:return"@"+CSS.escape(e.value);case 16:return e.value+"%";default:throw new Error(`Unsupported token ${e.type}`)}}function Z(e,t){return e.value.map((t=>{let i=W(t);return 29===t.type&&0!==e.type&&(i+=";"),i})).join("")}function V(e){return W(e)}function K(e){const t=e.at(1);return 13===t.type&&"="===t.value&&(e.consume(1),!0)}function X(e,t){const i=[];for(;;){const r=e.at(1);if(0===r.type||t&&7===r.type||13===r.type&&(">"===r.value||"<"===r.value||"="===r.value))break;i.push(e.consume(1))}return i}function J(e){U(e);const t=e.consume(1);return 13!==t.type?N:">"===t.value?K(e)?3:2:"<"===t.value?K(e)?5:4:"="===t.value?1:N}function ee(e){return 4===e||5===e}function te(e){return 2===e||3===e}function ie(e,t,i){const r=function(e){U(e);const t=e.consume(1);return U(e),24!==t.type||0!==e.at(1).type?N:t.value}(S(e));if(r===N)return N;let n=r.toLowerCase();return n=i?i(n):n,t.has(n)?n:N}function re(e){return{type:13,value:e}}function ne(e,t){return{type:29,name:e,value:t,important:!1}}function se(e){return{type:24,value:e}}function ae(e,t){return{type:27,name:e,value:t}}function oe(e){return ae("var",[se(e)])}function le(e,t){U(e);let i=!1,r=e.at(1);if(24===r.type){if("not"!==r.value.toLowerCase())return N;e.consume(1),U(e),i=!0}let n=function(e){const t=e.consume(1);switch(t.type){case 28:{if(4!==t.source.type)return N;const e=le(S(t.value.value),null);return e!==N?e:{type:4,value:t}}case 27:return{type:4,value:t};default:return N}}(e);if(n===N)return N;n=i?{type:1,value:n}:n,U(e),r=e.at(1);const s=24===r.type?r.value.toLowerCase():null;if(null!==s){if(e.consume(1),U(e),"and"!==s&&"or"!==s||null!==t&&s!==t)return N;const i=le(e,s);return i===N?N:{type:"and"===s?2:3,left:n,right:i}}return H(e)?n:N}function ce(e){return le(e,null)}function ue(e){switch(e.type){case 1:return[se("not"),{type:1},...ue(e.value)];case 2:case 3:return[...ue(e.left),{type:1},se(2===e.type?"and":"or"),{type:1},...ue(e.right)];case 4:return[e.value]}}const de={width:1,height:2,"inline-size":3,"block-size":4,"aspect-ratio":5,orientation:6},he=new Set(Object.keys(de)),pe=new Set(["none","and","not","or","normal","auto"]),fe=new Set(["initial","inherit","revert","revert-layer","unset"]),ge=new Set(["size","inline-size"]);function ye(e,t,i,r){const n=i();if(n===N)return N;let s=[n,null];U(e);const a=e.at(1);if(13===a.type){if(a.value!==t)return N;e.consume(1),U(e);const i=r();U(e),i!==N&&(s=[n,i])}return H(e)?s:N}function me(e){const t=e.consume(1);return 17===t.type?parseInt(t.value):N}function ve(e){const t=S(e);U(t);const i=t.consume(1);let r=N;switch(i.type){case 17:t.reconsume(),r=function(e){const t=ye(e,"/",(()=>me(e)),(()=>me(e)));return t===N?N:{type:2,value:t[0]/(null!==t[1]?t[1]:1)}}(t);break;case 15:r={type:3,value:parseInt(i.value),unit:i.unit.toLowerCase()};break;case 24:{const e=i.value.toLowerCase();switch(e){case"landscape":case"portrait":r={type:4,value:e}}}}return r===N?N:H(t)?{type:6,value:r}:N}function Me(e){return!be(e=e.toLowerCase())&&!pe.has(e)}function Te(e,t){const i=[];for(;;){U(e);const r=e.at(1);if(24!==r.type||!t(r.value))return i;e.consume(1),i.push(r.value)}}function Le(e){const t=[];for(;;){U(e);const i=e.at(1);if(24!==i.type)break;const r=i.value;if(!Me(r))break;e.consume(1),t.push(r)}return t}function be(e){return fe.has(e)}function Ee(e){return e.map((e=>"cq-"+e))}function Ie(e){const t=Te(e,(e=>be(e)));return 1===t.length?Ee(t):N}function Ne(e,t){const i=Te(e,(e=>"none"===e));if(1===i.length)return Ee(i);if(0!==i.length)return N;if(t){const t=Ie(e);if(t!==N)return t}const r=Le(e);return r.length>0&&(!t||H(e))?r:N}function we(e,t){if(t){const t=Ie(e);if(t!==N)return t}return function(e){const t=Te(e,(e=>"normal"===e));if(1===t.length)return Ee(t);if(0!==t.length)return N;const i=Te(e,(e=>ge.has(e)));return i.length>0&&H(e)?i:N}(e)}function Se(e){const t=S(e),i=Ie(t);if(i!==N)return[i,i];const r=ye(t,"/",(()=>Ne(t,!1)),(()=>we(t,!1)));return r!==N&&H(t)?[r[0],r[1]||[]]:N}function Ae(e){const t=S(e),i=Le(t);if(!i||i.length>1)return N;const r=ce(t);if(r===N)return N;const n={features:new Set},s=De(r,n);return H(t)?{name:i.length>0?i[0]:null,condition:s,features:n.features}:N}function De(e,t){switch(e.type){case 1:return{type:1,value:De(e.value,t)};case 2:case 3:return{type:2===e.type?2:3,left:De(e.left,t),right:De(e.right,t)};case 4:if(28===e.value.type){const i=function(e,t){const i=function(e,t){const i=X(e,!0),r=e.at(1);if(0===r.type){const e=ie(i,t);return e!==N&&t.has(e)?{type:1,feature:e}:N}if(7===r.type){e.consume(1);const r=X(e,!1);let n=1;const s=ie(i,t,(e=>e.startsWith("min-")?(n=3,e.substring(4)):e.startsWith("max-")?(n=5,e.substring(4)):e));return s!==N?{type:2,feature:s,bounds:[null,[n,r]]}:N}const n=J(e);if(n===N)return N;const s=X(e,!1);if(0===e.at(1).type){const e=ie(i,t);if(e!==N)return{type:2,feature:e,bounds:[null,[n,s]]};const r=ie(s,t);return r!==N?{type:2,feature:r,bounds:[[n,i],null]}:N}const a=J(e);if(a===N||!(te(n)&&te(a)||ee(n)&&ee(a)))return N;const o=X(e,!1),l=ie(s,t);return l!==N?{type:2,feature:l,bounds:[[n,i],[a,o]]}:N}(e,he);if(i===N)return N;const r=de[i.feature];if(null==r)return N;if(t.features.add(r),1===i.type)return{type:5,feature:r};{const e={type:5,feature:r};let t=N;if(null!==i.bounds[0]){const r=ve(i.bounds[0][1]);if(r===N)return N;t={type:4,operator:i.bounds[0][0],left:r,right:e}}if(null!==i.bounds[1]){const r=ve(i.bounds[1][1]);if(r===N)return N;const n={type:4,operator:i.bounds[1][0],left:e,right:r};t=t!==N?{type:2,left:t,right:n}:n}return t}}(S(e.value.value.value),t);if(i!==N)return i}return{type:6,value:{type:1}}}}let Ce=0;const ke={cqw:T,cqh:L,cqi:b,cqb:E},je=CSS.supports("selector(:where(div))"),xe=":not(.container-query-polyfill)";z(Array.from(A(xe)));const _e=document.createElement("div"),Oe=new Set(["before","after","first-line","first-letter"]);function Pe(e,t){return ae("calc",[{type:17,flag:e.flag,value:e.value},re("*"),t])}function Re(e){return e.map((e=>{switch(e.type){case 15:return function(e){const t=e.unit,i=ke[t];return null!=i?Pe(e,oe(i)):"cqmin"===t||"cqmax"===t?Pe(e,ae(e.unit.slice(2),[oe(b),{type:6},oe(E)])):e}(e);case 27:return r({},e,{value:Re(e.value)})}return e}))}function ze(e){switch(e.name){case"container":return Se(e.value)?r({},e,{name:g}):e;case"container-name":return Ne(S(e.value),!0)?r({},e,{name:m}):e;case"container-type":return null!=we(S(e.value),!0)?r({},e,{name:y}):e}return r({},e,{value:Re(e.value)})}function Fe(e,t){return r({},e,{value:e.value.map((e=>{switch(e.type){case 25:return Qe(e,t);case 26:return function(e,t){return t.transformStyleRule(r({},e,{value:Be(e.value,t)}))}(e,t);default:return e}}))})}function Ue(e){return 0===e.type||6===e.type}function Ye(e){for(let t=e.length-1;t>=0;t--)if(1!==e[t].type)return e.slice(0,t+1);return e}function Be(e,t){return function(e,t){const i=[];let n=null,s=null;for(const r of e.value.value)switch(r.type){case 25:{const e=t?t(r):r;e&&i.push(e)}break;case 29:{const e=ze(r);switch(e.name){case g:{const e=Se(r.value);e!==N&&(n=e[0],s=e[1]);break}case m:{const e=Ne(S(r.value),!0);e!==N&&(n=e);break}case y:{const e=we(S(r.value),!0);e!==N&&(s=e);break}default:i.push(e)}}}return n&&n.length>0&&i.push(ne(m,[se(n.join(" "))])),s&&s.length>0&&i.push(ne(y,[se(s.join(" "))])),r({},e,{value:{type:2,value:i}})}(e,(e=>Qe(e,t)))}function $e(e){if(1===e.type)return r({},e,{value:$e(e.value)});if(2===e.type||3===e.type)return r({},e,{left:$e(e.left),right:$e(e.right)});if(4===e.type&&28===e.value.type){const t=function(e){const t=S(e);return U(t),24!==t.at(1).type?N:$(t)||N}(e.value.value.value);if(t!==N)return r({},e,{value:r({},e.value,{value:{type:0,value:[ze(t)]}})})}return e}function Ge(e,t){let i=ce(S(e.prelude));return i=i!==N?$e(i):N,r({},e,{prelude:i!==N?ue(i):e.prelude,value:e.value?r({},e.value,{value:Fe(R(e.value.value.value),t)}):null})}function Qe(e,t){switch(e.name.toLocaleLowerCase()){case"media":case"layer":return function(e,t){return r({},e,{value:e.value?r({},e.value,{value:Fe(R(e.value.value.value),t)}):null})}(e,t);case"keyframes":return function(e,t){let i=null;return e.value&&(i=r({},e.value,{value:{type:3,value:R(e.value.value.value).value.map((e=>{switch(e.type){case 26:return function(e,t){return r({},e,{value:Be(e.value,t)})}(e,t);case 25:return Qe(e,t)}}))}})),r({},e,{value:i})}(e,t);case"supports":return Ge(e,t);case"container":return function(e,t){if(e.value){const i=Ae(e.prelude);if(i!==N){const n={rule:i,selector:null,parent:t.parent,uid:"c"+Ce++},s=new Set,a=[],o=Fe(R(e.value.value.value),{descriptors:t.descriptors,parent:n,transformStyleRule:e=>{const[t,i]=function(e,t,i){const r=S(e),n=[],s=[];for(;;){if(0===r.at(1).type)return[n,s];const i=Math.max(0,r.index);for(;o=r.at(1),l=r.at(2),!(Ue(o)||7===o.type&&(7===l.type||24===l.type&&Oe.has(l.value.toLowerCase())));)r.consume(1);const c=r.index+1,u=e.slice(i,c),d=u.length>0?Ye(u):[re("*")];for(;!Ue(r.at(1));)r.consume(1);const h=e.slice(c,Math.max(0,r.index+1));let p=d,f=[{type:28,source:{type:9},value:{type:0,value:[se(h.length>0?v:M),re("~"),re("="),{type:2,value:t}]}}];if(je)f=[re(":"),ae("where",f)];else{const e=d.map(V).join("");e.endsWith(xe)?p=z(Array.from(A(e.substring(0,e.length-xe.length)))):a.push({actual:e,expected:e+xe})}n.push(...d),s.push(...p),s.push(...f),s.push(...h),r.consume(1)}var o,l}(e.prelude,n.uid);if(a.length>0)return e;const o=t.map(V).join("");try{_e.matches(o),s.add(o)}catch(e){}return r({},e,{prelude:i})}}).value;if(a.length>0){const e=new Set,t=[];let i=0;for(const{actual:e}of a)i=Math.max(i,e.length);const r=Array.from({length:i},(()=>" ")).join("");for(const{actual:n,expected:s}of a)e.has(n)||(t.push(`${n}${r.substring(0,i-n.length)} => ${s}`),e.add(n));console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules:\n\n${t.join("\n")}`)}return s.size>0&&(n.selector=Array.from(s).join(", ")),t.descriptors.push(n),{type:25,name:"media",prelude:[se("all")],value:r({},e.value,{value:{type:3,value:o}})}}}return e}(e,t)}return e}class He{constructor(e){this.value=void 0,this.value=e}}function qe(e,t){if(e===t)return!0;if(typeof e==typeof t&&null!==e&&null!==t&&"object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t)||t.length!==e.length)return!1;for(let i=0,r=e.length;i<r;i++)if(!qe(e[i],t[i]))return!1;return!0}if(e instanceof He)return t instanceof He&&e.value===t.value;{const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let r=0,n=i.length;r<n;r++){const n=i[r];if(!qe(e[n],t[n]))return!1}return!0}}return!1}const We=Symbol("CQ_INSTANCE"),Ze=Symbol("CQ_STYLESHEET"),Ve=CSS.supports("width: 1svh"),Ke=new Set(["vertical-lr","vertical-rl","sideways-rl","sideways-lr","tb","tb-lr","tb-rl"]),Xe=["padding-left","padding-right","border-left-width","border-right-width"],Je=["padding-top","padding-bottom","border-top-width","border-bottom-width"],et=/(\w*(\s|-))?(table|ruby)(-\w*)?/;class tt{constructor(e){this.node=void 0,this.node=e}connected(){}disconnected(){}updated(){}}class it extends tt{constructor(e,t){super(e),this.context=void 0,this.controller=null,this.styleSheet=null,this.context=t}connected(){var e=this;const t=this.node;if("stylesheet"===t.rel){const i=new URL(t.href,document.baseURI);i.origin===location.origin&&(this.controller=at((async function(r){const n=await fetch(i.toString(),{signal:r}),s=await n.text(),a=e.styleSheet=await e.context.registerStyleSheet({source:s,url:i,signal:r}),o=new Blob([a.source],{type:"text/css"}),l=new Image;l.onload=l.onerror=a.refresh,l.src=t.href=URL.createObjectURL(o)})))}}disconnected(){var e,t;null==(e=this.controller)||e.abort(),this.controller=null,null==(t=this.styleSheet)||t.dispose(),this.styleSheet=null}}class rt extends tt{constructor(e,t){super(e),this.context=void 0,this.controller=null,this.styleSheet=null,this.context=t}connected(){var e=this;this.controller=at((async function(t){const i=e.node,r=e.styleSheet=await e.context.registerStyleSheet({source:i.innerHTML,signal:t});i.innerHTML=r.source,r.refresh()}))}disconnected(){var e,t;null==(e=this.controller)||e.abort(),this.controller=null,null==(t=this.styleSheet)||t.dispose(),this.styleSheet=null}}class nt extends tt{connected(){const e=`* { ${y}: cq-normal; ${m}: cq-none; }`;this.node.innerHTML=void 0===window.CSSLayerBlockRule?e:`@layer cq-polyfill-${f} { ${e} }`}}class st extends tt{constructor(e,t){super(e),this.context=void 0,this.styles=void 0,this.context=t,this.styles=window.getComputedStyle(e)}connected(){this.node.style.cssText="position: fixed; top: 0; left: 0; visibility: hidden; "+(Ve?"width: 1svw; height: 1svh;":"width: 1%; height: 1%;")}updated(){const e=dt((e=>this.styles.getPropertyValue(e)));this.context.viewportChanged({width:e.width,height:e.height})}}function at(e){const t=new AbortController;return e(t.signal).catch((e=>{if(!(e instanceof DOMException&&"AbortError"===e.message))throw e})),t}function ot(e){let t=0;if(0===e.length)return t;if(e.startsWith("cq-")&&("normal"===(e=e.substring("cq-".length))||be(e)))return t;const i=e.split(" ");for(const e of i)switch(e){case"size":t|=3;break;case"inline-size":t|=1;break;default:return 0}return t}function lt(e){let t=0;return"none"!==e&&(t|=1,"contents"===e||"inline"===e||et.test(e)||(t|=2)),t}function ct(e,t){return parseFloat(e(t))}function ut(e,t){return t.reduce(((t,i)=>t+ct(e,i)),0)}function dt(e){let t=0,i=0;return"border-box"===e("box-sizing")&&(t=ut(e,Xe),i=ut(e,Je)),{fontSize:ct(e,"font-size"),width:ct(e,"width")-t,height:ct(e,"height")-i}}function ht(e){return{containerType:ot(e(y).trim()),containerNames:(i=e(m).trim(),i.startsWith("cq-")&&("none"===(i=i.substring("cq-".length))||be(i))?new Set([]):new Set(0===i.length?[]:i.split(" "))),writingAxis:(t=e("writing-mode").trim(),Ke.has(t)?1:0),displayFlags:lt(e("display").trim())};var t,i}function pt(e,t,i){null!=i?i!=e.getPropertyValue(t)&&e.setProperty(t,i):e.removeProperty(t)}function ft(e){const t=e[Ze];return null!=t?t:[]}function gt(e,t){e[Ze]=t}new Promise((e=>{})),window.CQPolyfill={version:"1.0.2"},"container"in document.documentElement.style||function(e){function t(e){return e[We]||null}const i=document.documentElement;if(t(i))return;const s=document.createElement(`cq-polyfill-${f}`),a=document.createElement("style");new MutationObserver((e=>{for(const i of e){for(const e of i.removedNodes){const i=t(e);null==i||i.disconnect()}i.target.nodeType!==Node.DOCUMENT_NODE&&i.target.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&null===i.target.parentNode||"attributes"===i.type&&i.attributeName&&(i.attributeName===v||i.attributeName===M||i.target instanceof Element&&i.target.getAttribute(i.attributeName)===i.oldValue)||(w(i.target).mutate(),g())}})).observe(i,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0});const o=new ResizeObserver((e=>{for(const t of e)w(t.target).resize();w(i).update(I())})),l=new tt(i);async function c(e,{source:t,url:r,signal:n}){const s=function(e,t){try{const i=Array.from(A(e));if(t)for(let e=0;e<i.length;e++){const r=i[e];if(20===r.type)r.value=new URL(r.value,t).toString();else if(23===r.type&&"url"===r.value.toLowerCase()){const r=e+1<i.length?i[e+1]:null;r&&2===r.type&&(r.value=new URL(r.value,t).toString())}}const r={descriptors:[],parent:null,transformStyleRule:e=>e};return{source:Z(Fe(R(i,!0),r)),descriptors:r.descriptors}}catch(t){return console.warn("An error occurred while transpiling stylesheet: "+t),{source:e,descriptors:[]}}}(t,r?r.toString():void 0);let a=()=>{},o=()=>{};const l=w(i);let c=!1;return null!=n&&n.aborted||(o=()=>{if(!c){const{sheet:t}=e;null!=t&&(gt(t,s.descriptors),c=!0,a=()=>{gt(t),l.mutate(),g()},l.mutate(),g())}}),{source:s.source,dispose:a,refresh:o}}const u={cqw:null,cqh:null};function d({width:e,height:t}){u.cqw=e,u.cqh=t}function p(e,t,i){if(e instanceof Element&&t){let r="";for(const[i,n]of t.conditions){const t=i.value;null!=t.selector&&null!=n&&2==(2&n)&&e.matches(t.selector)&&(r.length>0&&(r+=" "),r+=t.uid)}r.length>0?e.setAttribute(i,r):e.removeAttribute(i)}}function g(){o.unobserve(i),o.observe(i)}const y=()=>{const e=[];for(const t of document.styleSheets)for(const i of ft(t))e.push([new He(i),0]);return e},m=window.getComputedStyle(i),I=()=>{const e=e=>m.getPropertyValue(e),t=ht(e),i=dt(e);return{parentState:null,conditions:y(),context:r({},u,{fontSize:i.fontSize,rootFontSize:i.fontSize,writingAxis:t.writingAxis}),displayFlags:t.displayFlags,isQueryContainer:!1}},N=e=>e;function w(e){let u=t(e);if(!u){let f,g=null,y=!1;e===i?(f=l,g=N):e===s?(y=!0,f=new st(s,{viewportChanged:d})):f=e===a?new nt(a):e instanceof HTMLLinkElement?new it(e,{registerStyleSheet:t=>c(e,r({},t))}):e instanceof HTMLStyleElement?new rt(e,{registerStyleSheet:t=>c(e,r({},t))}):new tt(e);let m=Symbol();if(null==g&&e instanceof Element){const t=function(e){const t=window.getComputedStyle(e);return function(e){let i=null;return(...e)=>{if(null==i||!qe(i[0],e)){const s=((e,i)=>{const{context:s,conditions:a}=e,o=e=>t.getPropertyValue(e),l=ht(o),c=r({},s,{writingAxis:l.writingAxis});let u=a,d=!1,p=l.displayFlags;0==(1&e.displayFlags)&&(p=0);const{containerType:f,containerNames:g}=l;if(f>0){const e=f>0&&2==(2&p),t=new Map(a.map((e=>[e[0].value,e[1]])));if(u=[],d=!0,e){const e=dt(o);c.fontSize=e.fontSize;const i=function(e,t){const i={value:t.width},r={value:t.height};let n=i,s=r;if(1===e.writingAxis){const e=n;n=s,s=e}return 2!=(2&e.containerType)&&(s.value=void 0),{width:i.value,height:r.value,inlineSize:n.value,blockSize:s.value}}(l,e),r={sizeFeatures:i,treeContext:c},d=e=>{const{rule:i}=e,s=i.name,a=null==s||g.has(s)?function(e,t){const i=new Map,r=t.sizeFeatures;for(const t of e.features){const e=n(t,r);if(1===e.type)return null;i.set(t,e)}const s=h(e.condition,{sizeFeatures:i,treeContext:t.treeContext});return 5===s.type?s.value:null}(i,r):null;var o;return null==a?1===((null!=(o=t.get(e))?o:0)&&1):!0===a},p=(e,t)=>{let i=e.get(t);if(null==i){const r=d(t);i=(r?1:0)|(!0!==r||null!=t.parent&&1!=(1&p(e,t.parent))?0:2),e.set(t,i)}return i},f=new Map;for(const e of a)u.push([e[0],p(f,e[0].value)]);c.cqw=null!=i.width?i.width/100:s.cqw,c.cqh=null!=i.height?i.height/100:s.cqh}}return{parentState:new He(e),conditions:u,context:c,displayFlags:p,isQueryContainer:d}})(...e);null!=i&&qe(i[1],s)||(i=[e,s])}return i[1]}}()}(e);g=e=>t(e,m)}const I=g||N;let S=null;const A=e=>{const t=S,i=I(e);return S=i,[S,S!==t]},D=e instanceof HTMLElement||e instanceof SVGElement?e.style:null;let C=!1;u={connect(){for(let t=e.firstChild;null!=t;t=t.nextSibling)w(t);f.connected()},disconnect(){e instanceof Element&&(o.unobserve(e),e.removeAttribute(v),e.removeAttribute(M)),D&&(D.removeProperty(b),D.removeProperty(E),D.removeProperty(T),D.removeProperty(L));for(let i=e.firstChild;null!=i;i=i.nextSibling){const e=t(i);null==e||e.disconnect()}f.disconnected(),delete e[We]},update(t){const[i,r]=A(t);if(r){if(p(e,t,M),p(e,i,v),e instanceof Element){const t=y||i.isQueryContainer;t&&!C?(o.observe(e),C=!0):!t&&C&&(o.unobserve(e),C=!1)}if(D){const e=i.context,r=e.writingAxis;let n=null,s=null,a=null,o=null;(r!==t.context.writingAxis||i.isQueryContainer)&&(n=`var(${0===r?T:L})`,s=`var(${1===r?T:L})`),t&&!i.isQueryContainer||(e.cqw&&(a=e.cqw+"px"),e.cqh&&(o=e.cqh+"px")),pt(D,b,n),pt(D,E,s),pt(D,T,a),pt(D,L,o)}f.updated()}for(let t=e.firstChild;null!=t;t=t.nextSibling)w(t).update(i)},resize(){m=Symbol()},mutate(){m=Symbol();for(let t=e.firstChild;null!=t;t=t.nextSibling)w(t).mutate()}},e[We]=u,u.connect()}return u}i.prepend(a,s),w(i),g()}()}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);__webpack_require__.r(i);var r={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var n=2&t&&e;"object"==typeof n&&!~leafPrototypes.indexOf(n);n=getProto(n))Object.getOwnPropertyNames(n).forEach((t=>r[t]=()=>e[t]));return r.default=()=>e,__webpack_require__.d(i,r),i},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";function e(e,t,i,r,n,s,a){try{var o=e[s](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,n)}function t(t){return function(){var i=this,r=arguments;return new Promise((function(n,s){var a=t.apply(i,r);function o(t){e(a,n,s,o,l,"next",t)}function l(t){e(a,n,s,o,l,"throw",t)}o(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=__webpack_require__(4687),o=__webpack_require__.n(a);function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}var f,g=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"chapters",void 0),s(this,"firstChapter",void 0),s(this,"lastChapter",void 0),s(this,"currentTime",void 0),this.chapters=t,this.setupInitChapter()}return n(e,[{key:"setupInitChapter",value:function(){0!==this.chapters.length&&(this.lastChapter=this.chapters[this.chapters.length-1],this.firstChapter=this.chapters[0])}},{key:"updateCurrentTimeAndTitle",value:function(e,t){this.player=e;var i=t.detail.plyr;if(i.id===e.plyr.id){e.playerControl.chaptersService.currentTime=i.currentTime,e.plyr.paused&&(e.playerControl.chaptersService.currentTime+=.1);var r=e.playerControl.chaptersService.findChapter(e.playerControl.chaptersService.currentTime,e.playerControl.chaptersService.chapters);void 0!==r&&(e.playerControl.chaptersService.setChapterPreviousNext(r[2],r[0]),e.playerControl.chaptersService.setTitleChapterName(r[1]),e.playerControl.chaptersService.setButtonsChapterTime(r[0],r[2]))}}},{key:"setButtonsEvents",value:function(e){this.player=e;var t=e.plyr,i=e.plyr.elements.controls,r=i.querySelector(".skip-backward"),n=i.querySelector(".skip-forward");r.addEventListener("click",(function(e){e.preventDefault(),"false"!==r.dataset.ltPlayerChaptertimestamp&&r.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(r.dataset.ltPlayerChaptertimestamp)+.1)})),n.addEventListener("click",(function(i){if(i.preventDefault(),e.playerControl.chaptersService.currentTime>e.playerControl.chaptersService.lastChapter.timestamp){t.stop();var r=t.elements.container,s=r.querySelector(".lt-player__poster"),a=r.querySelector(".plyr__controls");return r.classList.add("plyr--stopped"),s.classList.remove("d-none"),void a.classList.add("d-none")}n.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(n.dataset.ltPlayerChaptertimestamp)+.1)}))}},{key:"setMobileButtonEvents",value:function(e){this.player=e;var t=e.plyr,i=e.plyr.elements.controls,r=i.querySelector(".skip-backward"),n=i.querySelector(".skip-forward");if(r){var s=e.eventInstance.mobileEvents.setMobileEvent(r);s&&s.on("singletap",(function(i){i.preventDefault(),"false"!==r.dataset.ltPlayerChaptertimestamp&&(r.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(r.dataset.ltPlayerChaptertimestamp)+.1),e.playerControl.mobileEvents.showControls(e))}))}if(n){var a=e.eventInstance.mobileEvents.setMobileEvent(n);a&&a.on("singletap",(function(i){if(i.preventDefault(),e.playerControl.chaptersService.currentTime>e.playerControl.chaptersService.lastChapter.timestamp){t.stop();var r=t.elements.container,s=r.querySelector(".lt-player__poster"),a=r.querySelector(".plyr__controls");return r.classList.add("plyr--stopped"),s.classList.remove("d-none"),void a.classList.add("d-none")}n.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(n.dataset.ltPlayerChaptertimestamp)+.1),e.playerControl.mobileEvents.showControls(e)}))}}},{key:"setButtonsChapterTime",value:function(e,t){var i=this.player.plyr.elements.controls,r=i.querySelector(".skip-backward");r.dataset.ltPlayerChaptertimestamp=String(!1),null!==e&&(r.dataset.ltPlayerChaptertimestamp=e.timestamp);var n=i.querySelector(".skip-forward");null!==t&&(n.dataset.ltPlayerChaptertimestamp=t.timestamp)}},{key:"setChapterPreviousNext",value:function(e,t){var i=this.player.plyr.elements.controls,r=i.querySelector(".bottom-controller__previous-chapter-view"),n=i.querySelector(".bottom-controller__next-chapter-view");n&&(n.innerHTML="",e&&(n.innerHTML=e.name)),r&&(r.innerHTML="",t&&(r.innerHTML=t.name))}},{key:"setTitleChapterName",value:function(e){this.player.plyr.elements.controls.querySelector(".top-controllers__body__center").getElementsByTagName("p")[0].innerHTML=e?e.name:""}},{key:"findChapter",value:function(e,t){for(var i,r=null,n=function(e,t){return null===t?null:e[t-2]||null},s=function(e,t){return null===t?null:e[t-1]||null},a=0;a<t.length;a+=1){var o=t[a];if(o.timestamp>=e)return r=o,i=s(t,a),[n(t,a),i,r]}return i=t[t.length-1],[t[t.length-2],i,r]}}]),e}(),y=function(){function e(t){i(this,e),s(this,"instance",void 0),this.instance=t}return n(e,[{key:"addSettingsTemplate",value:function(e){var t=this.instance.templateService.getSettings(s({id:this.instance.playerConfig.getPlayerId()},e,!0)),i=this.instance.plyr.elements.controls.lastElementChild;i&&i.insertAdjacentHTML("afterend",t)}},{key:"openSettings",value:function(){this.getSelectors().playerControlsContainer.classList.contains("plyr__controls-enable-settings")||this.getSelectors().playerControlsContainer.classList.add("plyr__controls-enable-settings"),this.getSelectors().settingsContainer.classList.contains("settings-controllers-enable")||(this.getSelectors().settingsContainer.classList.add("settings-controllers-enable"),this.getSelectors().background.classList.contains("d-none")&&this.getSelectors().background.classList.remove("d-none"))}},{key:"getSelectors",value:function(){return{playerControlsContainer:this.instance.plyr.elements.controls,settingsContainer:this.instance.plyr.elements.controls.querySelector(".settings-controllers"),background:this.instance.plyr.elements.controls.querySelector(".settings-controllers-enable__background"),button:this.instance.plyr.elements.controls.querySelector(".plyr__controls_settings-button"),saveButton:this.instance.plyr.elements.controls.querySelector(".button-save"),playerContainer:this.instance.plyr.elements.container}}},{key:"closeSettings",value:function(){if(this.getSelectors().playerControlsContainer.querySelector(".settings-controllers").classList.contains("settings-controllers-enable")){var e=this.getSelectors().playerControlsContainer.querySelector(".settings-controllers");this.getSelectors().playerControlsContainer.classList.remove("plyr__controls-enable-settings"),e.classList.remove("settings-controllers-enable");var t=this.getSelectors().playerContainer.querySelector(".settings-controllers-enable__background");t.classList.contains("d-none")||t.classList.add("d-none")}}}]),e}(),m=function(){function e(t){i(this,e),s(this,"settingsInstance",void 0),this.settingsInstance=t,this.init()}return n(e,[{key:"init",value:function(){this.addOpenSettingsEventButton(),this.setButtonSpeed()}},{key:"addOpenSettingsEventButton",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_settings-button"),t=this;if(e){var i=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(e);i&&i.on("singletap",(function(){t.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(t.settingsInstance.playerInstance),t.createModal(),t.setActiveModal(),t.initCaptionsEvent(),t.initSpeedVideoEvent(),t.initSaveButton(),setTimeout((function(){t.setInactiveTouchModal()}),100)}))}}},{key:"setInactiveTouchModal",value:function(){var e=document.querySelector(".lt-player-mobile-settings-modal"),t=e.querySelector(".settings-controllers-enable__background"),i=e.querySelector(".settings-controllers-header"),r=this;if(t){var n=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(t);n&&n.on("singletap",(function(e){r.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(r.settingsInstance.playerInstance),e.preventDefault(),e.target.classList.contains("settings-controllers")||r.setInactiveModal()}))}if(i){var s=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(i);s&&s.on("pan",(function(e){r.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(r.settingsInstance.playerInstance),e.preventDefault(),e.target,r.setInactiveModal()}))}}},{key:"createModal",value:function(){var e=this.settingsInstance.playerInstance.templateService.getSettings({id:this.settingsInstance.playerInstance.playerConfig.getPlayerId()}),t=document.createElement("div");t.classList.add("lt-player-mobile-settings-modal"),t.innerHTML=e;var i=document.querySelector("body");i&&i.appendChild(t)}},{key:"setActiveModal",value:function(){var e=document.querySelector(".lt-player-mobile-settings-modal").querySelector(".settings-controllers-enable__background");e&&e.classList.contains("d-none")&&e.classList.remove("d-none")}},{key:"setInactiveModal",value:function(){var e=document.querySelector(".lt-player-mobile-settings-modal");e&&e.remove()}},{key:"initCaptionsEvent",value:function(){var e=this,t=document.querySelector(".lt-player-mobile-settings-modal").querySelector("#captions-lt-player-".concat(this.settingsInstance.playerInstance.playerConfig.getPlayerId())),i=this;t&&t.addEventListener("change",(function(){i.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(i.settingsInstance.playerInstance),t.checked?e.settingsInstance.player.toggleCaptions(!0):e.settingsInstance.player.toggleCaptions(!1)}))}},{key:"initSpeedVideoEvent",value:function(){var e=document.querySelector(".lt-player-mobile-settings-modal"),t=this.settingsInstance.playerInstance,i=this.settingsInstance.player,r=e.querySelector(".speed-range-input"),n=e.querySelector("#speed-range-".concat(t.playerConfig.getPlayerId()));n.value=String(0);var s=e.querySelector("#speed-range-value-".concat(t.playerConfig.getPlayerId()));s.style.top="-20px";var a=[1,1.25,1.5,2],o=this;n.oninput=function(){o.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(o.settingsInstance.playerInstance),i.speed=parseFloat(a[r.value]),s.innerHTML="".concat(a[r.value],"X")},i.speed=parseFloat(String(a[0])),s.innerHTML="".concat(a[0],"X")}},{key:"initSaveButton",value:function(){var e=document.querySelector(".lt-player-mobile-settings-modal"),t=this;e.querySelector(".button-save").addEventListener("click",(function(e){t.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(t.settingsInstance.playerInstance),e.preventDefault(),t.setInactiveModal()}))}},{key:"setButtonSpeed",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_speed-button"),t=this.settingsInstance.playerInstance.plyr,i=this.settingsInstance.playerInstance;if(e){var r=document.createElement("span");e.appendChild(r),r.innerHTML="1X",r.className="",r.classList.add("playback-speed--1X");var n=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(e);n&&n.on("singletap",(function(){var e=t.speed+.25;if(e>2)return r.innerHTML="1X",t.speed=1,r.className="",void r.classList.add("playback-speed--1X");if(1.75===e)return t.speed=e+.25,r.innerHTML="2X",r.className="",void r.classList.add("playback-speed--2X");t.speed=e;var n=Math.floor(10*e)/10;r.innerHTML=n+"X",r.className="",r.classList.add("playback-speed--"+e+"X"),i.playerControl.mobileEvents.showControls(i)}))}}}]),e}(),v=function(){function e(t){i(this,e),s(this,"settingsInstance",void 0),this.settingsInstance=t,this.init()}return n(e,[{key:"init",value:function(){this.setButtonSpeed(),this.settingsInstance.common.addSettingsTemplate(this.settingsInstance.playerInstance.playerConfig.getDevice()),this.addOpenSettingsEventButton(),this.initCaptionsEvent(),this.initSpeedVideoEvent(),this.initSaveButton()}},{key:"addOpenSettingsEventButton",value:function(){var e=this,t=this.settingsInstance.common.getSelectors();t.button&&t.button.addEventListener("click",(function(t){t.preventDefault(),e.settingsInstance.common.openSettings()}))}},{key:"initCaptionsEvent",value:function(){var e=this,t=this.settingsInstance.common.getSelectors().playerControlsContainer.querySelector("#captions-lt-player-".concat(this.settingsInstance.playerInstance.playerConfig.getPlayerId()));t&&t.addEventListener("change",(function(){t.checked?e.settingsInstance.player.toggleCaptions(!0):e.settingsInstance.player.toggleCaptions(!1)}))}},{key:"initSpeedVideoEvent",value:function(){var e=this.settingsInstance.playerInstance,t=this.settingsInstance.player.elements.controls,i=this.settingsInstance.player,r=t.querySelector(".speed-range-input"),n=t.querySelector("#speed-range-".concat(e.playerConfig.getPlayerId()));n.value=String(0);var s=t.querySelector("#speed-range-value-".concat(e.playerConfig.getPlayerId()));s.style.top="-20px";var a=[1,1.25,1.5,2];n.oninput=function(){i.speed=parseFloat(a[r.value]),s.innerHTML="".concat(a[r.value],"X")},i.speed=parseFloat(String(a[0])),s.innerHTML="".concat(a[0],"X")}},{key:"initSaveButton",value:function(){var e=this.settingsInstance.common.getSelectors(),t=this;e.playerControlsContainer.querySelector(".button-save").addEventListener("click",(function(e){e.preventDefault(),t.settingsInstance.common.closeSettings()}))}},{key:"setButtonSpeed",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_speed-button"),t=this.settingsInstance.playerInstance.plyr,i=this.settingsInstance.playerInstance;if(e){var r=document.createElement("span");e.appendChild(r),r.innerHTML="1X",r.className="",r.classList.add("playback-speed--1X"),e.addEventListener("click",(function(e){var n=t.speed+.25;if(n>2)return r.innerHTML="1X",t.speed=1,r.className="",void r.classList.add("playback-speed--1X");if(1.75===n)return t.speed=n+.25,r.innerHTML="2X",r.className="",void r.classList.add("playback-speed--2X");t.speed=n;var s=Math.floor(10*n)/10;r.innerHTML=s+"X",r.className="",console.log(n.toPrecision(2)),r.classList.add("playback-speed--"+n+"X"),i.playerControl.mobileEvents.showControls(i)}))}}}]),e}(),M=function(){function e(){i(this,e),s(this,"playerInstance",void 0),s(this,"player",void 0),s(this,"templateService",void 0),s(this,"playerID",void 0),s(this,"common",void 0),s(this,"mobile",void 0),s(this,"desktop",void 0)}return n(e,[{key:"init",value:function(e){this.playerInstance=e,this.player=e.plyr,this.templateService=e.templateService,this.common=new y(e);var t=this.player;this.playerID=t.id,"mobile"===e.playerConfig.getDevice()?this.mobile=new m(this):this.desktop=new v(this)}}],[{key:"closeSettingsEvent",value:function(e){var t=document.querySelectorAll(".plyr__controls");0!==t.length&&t.forEach((function(t){if(t.classList.contains("plyr__controls-enable-settings")){var i=t.querySelector(".settings-controllers");if(!e.target.classList.contains("settings")&&i.classList.contains("settings-controllers-enable")){var r=t.querySelector(".settings-controllers");t.classList.remove("plyr__controls-enable-settings"),r.classList.remove("settings-controllers-enable");var n=t.querySelector(".settings-controllers-enable__background");n.classList.contains("d-none")||n.classList.add("d-none")}}}))}}]),e}();!function(e){var t=function(){function e(){i(this,e),s(this,"backwardRewind",{getSelectors:function(e){var t={playerContainer:e.plyr.elements.container,playerControlsContainer:e.plyr.elements.controls,forwardArea:e.plyr.elements.controls.querySelector(".lt-player-forward-area"),rewindArea:e.plyr.elements.controls.querySelector(".lt-player-rewind-area"),forwardAnimation:e.plyr.elements.controls.querySelector(".lt-player-forward"),rewindAnimation:e.plyr.elements.controls.querySelector(".lt-player-rewind"),forwardAreaBackground:null,rewindAreaBackground:null,forwardAnimationBackground:null,rewindAnimationBackground:null};return"mobile"===e.playerConfig.getDevice()&&(t.forwardAreaBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-forward-area"),t.rewindAreaBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-rewind-area"),t.forwardAnimationBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-forward"),t.rewindAnimationBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-rewind")),t},updateCurrentTime:function(e,t){Math.sign(t)?e.plyr.currentTime+=t:e.plyr.currentTime-=t},playPause:function(e){var t=e.iconService.getIconsByComponent("playPause"),i=e.plyr.elements.controls.querySelector(".player-state"),r=i.querySelector(".player-state__icon"),n=function(){setTimeout((function(){i.classList.remove("active")}),200)};e.plyr.playing?(r.src=t.pause,i.classList.add("active"),e.plyr.togglePlay(!1),n()):(r.src=t.play,i.classList.add("active"),e.plyr.togglePlay(!0),n())},animateNotificationIn:function(e){e.classList.add("animate-in")},animateNotificationOut:function(e){e.classList.remove("animate-in")}})}return n(e,[{key:"checkTitleBreakWord",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".poster-paragraph__content"),r=t.querySelector(".poster-paragraph__button");if(i)if(i.scrollHeight<=i.clientHeight)r.classList.add("d-none");else{var n=i.scrollHeight,s=function(){var e=i;i.classList.contains("open-content")?(e.style.maxHeight=null,setTimeout((function(){i.classList.remove("open-content")}),300),r.innerHTML="Read more"):(r.innerHTML="Hide",e.style.maxHeight="".concat(n,"px"),i.classList.add("open-content"))};r&&("mobile"===e.playerConfig.getDevice()?e.eventInstance.mobileEvents.setMobileEvent(r).on("singletap",(function(){s(),e.playerControl.mobileEvents.showControls(e)})):r.addEventListener("click",(function(){s()})))}}},{key:"playPauseIconTimeUpdate",value:function(e){var t=e.plyr,i=t.elements.container,r=i.querySelector(".bottom-controller__play-icon"),n=i.querySelector(".bottom-controller__pause-icon");t.isEmbed?t.embed.getPaused().then((function(e){e?(n.classList.add("d-none"),r.classList.remove("d-none")):(r.classList.add("d-none"),n.classList.remove("d-none"))})):t.playing?(r.classList.add("d-none"),n.classList.remove("d-none")):(n.classList.add("d-none"),r.classList.remove("d-none"))}},{key:"subtitlesShow",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,r=t.querySelector(".plyr__captions");e.plyr.captions.active&&r&&(i.classList.contains("plyr__controls-enable")||r.classList.contains("d-none")&&r.classList.remove("d-none"))}},{key:"subtitlesHide",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,r=t.querySelector(".plyr__captions");e.plyr.captions.active&&r&&i.classList.contains("plyr__controls-enable")&&(r.classList.contains("d-none")||r.classList.add("d-none"))}}]),e}();e.Common=t;var r=function(){function e(){i(this,e),s(this,"common",void 0),this.common=new t}return n(e,[{key:"titleLineBreak",value:function(e){this.common.checkTitleBreakWord(e)}},{key:"showHide",value:function(e){var t=e.plyr.elements.controls,i=this;t.addEventListener("mouseover",(function(){t.classList.add("plyr__controls-enable"),i.common.subtitlesHide(e)})),t.addEventListener("mouseleave",(function(){t.classList.contains("plyr__controls-enable-settings")||(t.classList.remove("plyr__controls-enable"),setTimeout((function(){i.common.subtitlesShow(e)}),100))}))}},{key:"fullScreenButtons",value:function(e){var t=e.plyr.elements.controls.querySelector(".fullscreen-custom-control");t&&t.addEventListener("click",(function(t){t.preventDefault(),e.plyr.fullscreen.toggle()}))}},{key:"fullscreenIcon",value:function(e,t){var i=e.plyr.elements.controls,r=i.querySelector(".fullscreen-custom-control");switch(t){case"enterfullscreen":r.querySelector(".maximize").classList.add("d-none"),r.querySelector(".minimize").classList.remove("d-none"),i.classList.add("progress-width-mobile");break;case"exitfullscreen":r.querySelector(".maximize").classList.remove("d-none"),r.querySelector(".minimize").classList.add("d-none"),i.classList.remove("progress-width-mobile")}}},{key:"playPauseIcon",value:function(e,t){var i=this.common;switch(t){case"timeupdate":this.common.playPauseIconTimeUpdate(e);break;case"ready":var r=e.plyr.elements.controls.querySelector(".play-button");r&&r.addEventListener("click",(function(){e.plyr.playing?e.plyr.togglePlay(!1):e.plyr.togglePlay(!0),i.playPauseIconTimeUpdate(e)}))}}},{key:"backwardForward",value:function(e){var t=this.common,i=t.backwardRewind.getSelectors(e);i.forwardArea&&(i.forwardArea.addEventListener("dblclick",(function(r){r.preventDefault();var n=i.playerControlsContainer.querySelector(".lt-player-notification__notification-button-state");n&&!n.classList.contains("d-none")&&n.classList.add("d-none"),t.backwardRewind.animateNotificationIn(i.forwardAnimation),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimation),n.classList.remove("d-none")}),500)})),i.forwardArea.addEventListener("click",(function(r){r.preventDefault(),setTimeout((function(){var r=i.playerControlsContainer.querySelector(".bottom-controller__volume_control");r&&(r.classList.contains("volume-control-enable")||t.backwardRewind.playPause(e))}),100)}))),i.rewindArea&&(i.rewindArea.addEventListener("dblclick",(function(r){r.preventDefault();var n=i.playerControlsContainer.querySelector(".lt-player-notification__notification-button-state");n&&!n.classList.contains("d-none")&&n.classList.add("d-none"),t.backwardRewind.animateNotificationIn(i.rewindAnimation),t.backwardRewind.updateCurrentTime(e,-10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimation),n.classList.remove("d-none")}),500)})),i.rewindArea.addEventListener("click",(function(r){r.preventDefault(),setTimeout((function(){var r=i.playerControlsContainer.querySelector(".bottom-controller__volume_control");r&&(r.classList.contains("volume-control-enable")||t.backwardRewind.playPause(e))}),100)})))}},{key:"backwardForwardSeconds",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".skip-forward-seconds"),r=t.querySelector(".skip-backward-seconds");i&&i.addEventListener("click",(function(t){t.preventDefault(),e.plyr.currentTime+=10})),r&&r.addEventListener("click",(function(t){t.preventDefault(),e.plyr.currentTime-=10}))}},{key:"volume",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".bottom-controller__volume_control"),r=t.querySelector(".volume_control__volume-button"),n=t.querySelector(".volume_control__volume-button-close"),s=t.querySelector(".volume_control__background__area"),a=t.querySelector(".volume_control__background"),o=t.querySelector(".volume_control__background__area__range"),l=i.querySelectorAll(".volume-max, .volume-75, .volume-50, .volume-mute");r.addEventListener("mouseover",(function(e){s.classList.remove("d-none"),a.classList.remove("d-none"),r.classList.add("d-none"),i.classList.add("volume-control-enable"),i.classList.add("volume-area-open")})),i.addEventListener("mouseleave",(function(){s.classList.add("d-none"),a.classList.add("d-none"),r.classList.remove("d-none"),i.classList.remove("volume-control-enable")})),n.addEventListener("click",(function(t){return t.preventDefault(),e.plyr.volume>0?(e.playerControl.playerVolumeBefore=e.plyr.volume,e.plyr.volume=0,void c(0)):e.playerControl.playerVolumeBefore?(e.plyr.volume=e.playerControl.playerVolumeBefore,void c(e.playerControl.playerVolumeBefore)):(e.plyr.volume=1,void c(1))}));var c=function(e){"number"==typeof e&&(e=e.toString());var i=n.querySelector(".volume-max"),r=n.querySelector(".volume-75"),s=n.querySelector(".volume-50"),a=n.querySelector(".volume-mute"),o=t.querySelector(".bottom-controller__volume_control"),l=function(e){o.querySelectorAll(".volume-max, .volume-75, .volume-50, .volume-mute").forEach((function(t){e.dataset.rangeValue===t.dataset.rangeValue?t.classList.remove("d-none"):t.classList.add("d-none")}))};switch(e){case i.dataset.rangeValue:l(i);break;case r.dataset.rangeValue:l(r);break;case s.dataset.rangeValue:l(s);break;case a.dataset.rangeValue:l(a)}};o.addEventListener("input",(function(){var e=[];if(l.forEach((function(t){e.push(t.dataset.rangeValue)})),0!==e.length){var t=e.reduce((function(e,t){return function(e,t,i){return Math.abs(e-i)<Math.abs(t-i)?e:t}(t,e,o.value)}));c(t)}})),e.plyr.volume=1,c(e.plyr.volume)}}]),e}();e.Desktop=r;var a=function(){function e(){i(this,e),s(this,"common",void 0),s(this,"controlsTimeOut",void 0),this.common=new t}return n(e,[{key:"seekBar",value:function(e){var t=e.plyr.elements.controls.querySelector(".plyr__progress__seek");__webpack_require__(4096).setup(t);var i=this;t.addEventListener("change",(function(){i.showControls(e)}))}},{key:"controlsTimeShow",value:function(e){var t=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background"),i=this;if(t){var r=e.eventInstance.mobileEvents.setMobileEvent(t);r&&r.on("singletap",(function(){i.showControls(e)}))}}},{key:"removePlyrControlsClass",value:function(e){var t=e.plyr.elements.container;e.plyr.elements.controls.classList.contains("plyr__controls-enable")&&t.classList.remove("plyr--hide-controls")}},{key:"showControls",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,r=t.querySelector(".plyr__controls__mobile-background");t.classList.contains("plyr--hide-controls")&&t.classList.remove("plyr--hide-controls"),r&&(r.classList.contains("d-none")||r.classList.add("d-none")),i.classList.contains("plyr__controls-enable")||i.classList.add("plyr__controls-enable"),this.common.subtitlesHide(e),this.controlsTimeOut&&clearTimeout(this.controlsTimeOut),this.hideControls(e,!1)}},{key:"hideControls",value:function(e,t){var i=e.plyr.elements.container,r=e.plyr.elements.controls,n=i.querySelector(".plyr__controls__mobile-background");r.classList.contains("plyr__controls-enable-addInfo")||(t?(r.classList.remove("plyr__controls-enable"),i.classList.add("plyr--hide-controls"),r.classList.contains("player-lt__modal__mobile-show-modal")||n.classList.remove("d-none")):this.controlsTimeOut=setTimeout((function(){r.classList.remove("plyr__controls-enable"),i.classList.add("plyr--hide-controls"),r.classList.contains("player-lt__modal__mobile-show-modal")||n.classList.remove("d-none")}),4e3),this.common.subtitlesShow(e))}},{key:"fullScreenButtons",value:function(e){var t=e.plyr.elements.controls.querySelector(".fullscreen-custom-control"),i=e.eventInstance.mobileEvents.setMobileEvent(t);i&&i.on("singletap",(function(t){t.preventDefault(),e.plyr.fullscreen.toggle()}))}},{key:"playPauseIcon",value:function(e,t){var i=this.common,r=this;switch(t){case"timeupdate":i.playPauseIconTimeUpdate(e);break;case"ready":var n=e.plyr.elements.controls.querySelector(".play-button"),s=e.eventInstance.mobileEvents.setMobileEvent(n);s&&s.on("singletap",(function(){e.plyr.playing?e.plyr.togglePlay(!1):e.plyr.togglePlay(!0),i.playPauseIconTimeUpdate(e),r.showControls(e)}))}}},{key:"backwardForward",value:function(e){var t=this.common,i=t.backwardRewind.getSelectors(e),r=function(){e.playerControl.mobileEvents.hideControls(e,!0)};if(i.forwardArea){var n=e.eventInstance.mobileEvents.setMobileEvent(i.forwardArea);n.on("doubletap",(function(r){t.backwardRewind.animateNotificationIn(i.forwardAnimation),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimation)}),500),e.playerControl.mobileEvents.showControls(e)})),n.on("singletap",(function(e){r()})),e.eventInstance.mobileEvents.setMobileEvent(i.forwardAreaBackground).on("doubletap",(function(r){t.backwardRewind.animateNotificationIn(i.forwardAnimationBackground),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimationBackground)}),500)}))}if(i.rewindArea){var s=e.eventInstance.mobileEvents.setMobileEvent(i.rewindArea);s.on("doubletap",(function(r){t.backwardRewind.animateNotificationIn(i.rewindAnimation),t.backwardRewind.updateCurrentTime(e,-10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimation)}),500),e.playerControl.mobileEvents.showControls(e)})),s.on("singletap",(function(e){r()})),e.eventInstance.mobileEvents.setMobileEvent(i.rewindAreaBackground).on("doubletap",(function(r){t.backwardRewind.animateNotificationIn(i.rewindAnimationBackground),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimationBackground)}),500)}))}}},{key:"backwardForwardSeconds",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".skip-forward-seconds"),r=t.querySelector(".skip-backward-seconds");i&&e.eventInstance.mobileEvents.setMobileEvent(i).on("singletap",(function(){e.plyr.currentTime+=10})),r&&e.eventInstance.mobileEvents.setMobileEvent(r).on("singletap",(function(){e.plyr.currentTime-=10}))}},{key:"settings",value:function(e){e.plyr.elements.controls.querySelector(".plyr__controls_settings-button")}},{key:"volume",value:function(e){var t=e.plyr.elements.controls.querySelector(".bottom-controller__volume_control");if(t){var i=t.querySelector("button"),r=t.querySelector(".volume-max"),n=t.querySelector(".volume-mute"),s=function(e){"up"===e?(r.classList.remove("d-none"),n.classList.remove("d-none"),n.classList.add("d-none")):(r.classList.remove("d-none"),n.classList.remove("d-none"),r.classList.add("d-none"))};s("up"),e.eventInstance.mobileEvents.setMobileEvent(i).on("singletap",(function(){var t=e.plyr.muted?(e.plyr.muted=!1,"up"):(e.plyr.muted=!0,"mute");s(t),e.playerControl.mobileEvents.showControls(e)}))}}}]),e}();e.Mobile=a}(f||(f={}));var T=function(){function e(t){i(this,e),s(this,"templateService",void 0),s(this,"playerVolumeBefore",void 0),s(this,"settingsControlsManager",void 0),s(this,"chaptersService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.settingsControlsManager=new M,this.templateService=t,this.setDesktopEvents(),this.setMobileEvents()}return n(e,[{key:"setDesktopEvents",value:function(){this.desktopEvents=new f.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new f.Mobile}},{key:"initChapters",value:function(e){this.chaptersService=new g(e)}},{key:"getControls",value:function(e,t){return this.templateService.getTemplateControls(e,t)}}]),e}(),L=Object.prototype.toString,b=Array.isArray||function(e){return"[object Array]"===L.call(e)};function E(e){return"function"==typeof e}function I(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function N(e,t){return null!=e&&"object"==typeof e&&t in e}var w=RegExp.prototype.test,S=/\S/;var A={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},D=/\s*/,C=/\s+/,k=/\s*=/,j=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;function _(e){this.string=e,this.tail=e,this.pos=0}function O(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function P(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}_.prototype.eos=function(){return""===this.tail},_.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},_.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},O.prototype.push=function(e){return new O(e,this)},O.prototype.lookup=function(e){var t,i,r,n=this.cache;if(n.hasOwnProperty(e))t=n[e];else{for(var s,a,o,l=this,c=!1;l;){if(e.indexOf(".")>0)for(s=l.view,a=e.split("."),o=0;null!=s&&o<a.length;)o===a.length-1&&(c=N(s,a[o])||(i=s,r=a[o],null!=i&&"object"!=typeof i&&i.hasOwnProperty&&i.hasOwnProperty(r))),s=s[a[o++]];else s=l.view[e],c=N(l.view,e);if(c){t=s;break}l=l.parent}n[e]=t}return E(t)&&(t=t.call(this.view)),t},P.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},P.prototype.parse=function(e,t){var i=this.templateCache,r=e+":"+(t||R.tags).join(":"),n=void 0!==i,s=n?i.get(r):void 0;return null==s&&(s=function(e,t){if(!e)return[];var i,r,n,s,a=!1,o=[],l=[],c=[],u=!1,d=!1,h="",p=0;function f(){if(u&&!d)for(;c.length;)delete l[c.pop()];else c=[];u=!1,d=!1}function g(e){if("string"==typeof e&&(e=e.split(C,2)),!b(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(I(e[0])+"\\s*"),r=new RegExp("\\s*"+I(e[1])),n=new RegExp("\\s*"+I("}"+e[1]))}g(t||R.tags);for(var y,m,v,M,T,L,E=new _(e);!E.eos();){if(y=E.pos,v=E.scanUntil(i))for(var N=0,A=v.length;N<A;++N)s=M=v.charAt(N),function(e,t){return w.call(e,t)}(S,s)?(d=!0,a=!0,h+=" "):(c.push(l.length),h+=M),l.push(["text",M,y,y+1]),y+=1,"\n"===M&&(f(),h="",p=0,a=!1);if(!E.scan(i))break;if(u=!0,m=E.scan(x)||"name",E.scan(D),"="===m?(v=E.scanUntil(k),E.scan(k),E.scanUntil(r)):"{"===m?(v=E.scanUntil(n),E.scan(j),E.scanUntil(r),m="&"):v=E.scanUntil(r),!E.scan(r))throw new Error("Unclosed tag at "+E.pos);if(T=">"==m?[m,v,y,E.pos,h,p,a]:[m,v,y,E.pos],p++,l.push(T),"#"===m||"^"===m)o.push(T);else if("/"===m){if(!(L=o.pop()))throw new Error('Unopened section "'+v+'" at '+y);if(L[1]!==v)throw new Error('Unclosed section "'+L[1]+'" at '+y)}else"name"===m||"{"===m||"&"===m?d=!0:"="===m&&g(v)}if(f(),L=o.pop())throw new Error('Unclosed section "'+L[1]+'" at '+E.pos);return function(e){for(var t,i=[],r=i,n=[],s=0,a=e.length;s<a;++s)switch((t=e[s])[0]){case"#":case"^":r.push(t),n.push(t),r=t[4]=[];break;case"/":n.pop()[5]=t[2],r=n.length>0?n[n.length-1][4]:i;break;default:r.push(t)}return i}(function(e){for(var t,i,r=[],n=0,s=e.length;n<s;++n)(t=e[n])&&("text"===t[0]&&i&&"text"===i[0]?(i[1]+=t[1],i[3]=t[3]):(r.push(t),i=t));return r}(l))}(e,t),n&&i.set(r,s)),s},P.prototype.render=function(e,t,i,r){var n=this.getConfigTags(r),s=this.parse(e,n),a=t instanceof O?t:new O(t,void 0);return this.renderTokens(s,a,i,e,r)},P.prototype.renderTokens=function(e,t,i,r,n){for(var s,a,o,l="",c=0,u=e.length;c<u;++c)o=void 0,"#"===(a=(s=e[c])[0])?o=this.renderSection(s,t,i,r,n):"^"===a?o=this.renderInverted(s,t,i,r,n):">"===a?o=this.renderPartial(s,t,i,n):"&"===a?o=this.unescapedValue(s,t):"name"===a?o=this.escapedValue(s,t,n):"text"===a&&(o=this.rawValue(s)),void 0!==o&&(l+=o);return l},P.prototype.renderSection=function(e,t,i,r,n){var s=this,a="",o=t.lookup(e[1]);if(o){if(b(o))for(var l=0,c=o.length;l<c;++l)a+=this.renderTokens(e[4],t.push(o[l]),i,r,n);else if("object"==typeof o||"string"==typeof o||"number"==typeof o)a+=this.renderTokens(e[4],t.push(o),i,r,n);else if(E(o)){if("string"!=typeof r)throw new Error("Cannot use higher-order sections without the original template");null!=(o=o.call(t.view,r.slice(e[3],e[5]),(function(e){return s.render(e,t,i,n)})))&&(a+=o)}else a+=this.renderTokens(e[4],t,i,r,n);return a}},P.prototype.renderInverted=function(e,t,i,r,n){var s=t.lookup(e[1]);if(!s||b(s)&&0===s.length)return this.renderTokens(e[4],t,i,r,n)},P.prototype.indentPartial=function(e,t,i){for(var r=t.replace(/[^ \t]/g,""),n=e.split("\n"),s=0;s<n.length;s++)n[s].length&&(s>0||!i)&&(n[s]=r+n[s]);return n.join("\n")},P.prototype.renderPartial=function(e,t,i,r){if(i){var n=this.getConfigTags(r),s=E(i)?i(e[1]):i[e[1]];if(null!=s){var a=e[6],o=e[5],l=e[4],c=s;0==o&&l&&(c=this.indentPartial(s,l,a));var u=this.parse(c,n);return this.renderTokens(u,t,i,c,r)}}},P.prototype.unescapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return i},P.prototype.escapedValue=function(e,t,i){var r=this.getConfigEscape(i)||R.escape,n=t.lookup(e[1]);if(null!=n)return"number"==typeof n&&r===R.escape?String(n):r(n)},P.prototype.rawValue=function(e){return e[1]},P.prototype.getConfigTags=function(e){return b(e)?e:e&&"object"==typeof e?e.tags:void 0},P.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!b(e)?e.escape:void 0};var R={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){z.templateCache=e},get templateCache(){return z.templateCache}},z=new P;R.clearCache=function(){return z.clearCache()},R.parse=function(e,t){return z.parse(e,t)},R.render=function(e,t,i,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(b(n=e)?"array":typeof n)+'" was given as the first argument for mustache#render(template, view, partials)');var n;return z.render(e,t,i,r)},R.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return A[e]}))},R.Scanner=_,R.Context=O,R.Writer=P;const F=R,U='{{#mini_player}}\n <div class="lt-player-mini-player-controls">\n <button class="lt-player-mini-player-controls__exit">\n <img class="filter" src="{{icons.external-link}}" alt="">\n </button>\n\n <button type="button" class="lt-player-mini-player-controls__play-button">\n <img class="lt-player-mini-player-controls__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="lt-player-mini-player-controls__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n <input class=\'lt-player-mini-player-controls__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\' value=\'0\'>\n </div>\n{{/mini_player}}\n{{#player}}\n {{#landscape}}\n <div class="plyr__controls">\n <div class="top-controllers">\n <div class="top-controllers__background"></div>\n <div class="top-controllers__body">\n <div class="top-controllers__body__left">\n </div>\n <div class="top-controllers__body__center">\n <p class="chapter"></p>\n </div>\n <div class="top-controllers__body__right">\n {{#isShare}}\n <button type="button" class="plyr__control lt-player-share">\n <img class="filter" src="{{icons.share}}" alt="">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n <div class="lt-player-notification landscape">\n \x3c!-- <div class="lt-player-video-content">--\x3e\n \x3c!-- <div class="content__body">--\x3e\n \x3c!-- <h4 class="poster-title">{{videoParagraph}}</h4>--\x3e\n \x3c!-- <p class="poster-paragraph">{{videoTitle}}</p>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n <div class="lt-player-notification__notification-button-state landscape">\n <div class="player-state">\n <img class="player-state__icon filter" src="" alt="">\n </div>\n </div>\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__landscape">\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="rewind">10 sec</span>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__landscape">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n <div class="plyr__progress--wrapper">\n <div class="plyr__progress">\n <label for=\'seek{id}\' class=\'plyr__sr-only\'>Seek</label>\n <input id=\'seek{id}\' class=\'plyr__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\'\n value=\'0\'\n data-plyr=\'seek\'>\n <div class="bottom-controller__current">\n <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>\n <div class="plyr__time plyr__time--duration custom-duration" aria-label="Duration">00:00</div>\n </div>\n </div>\n </div>\n <div class="bottom-controller__background"></div>\n <div class="bottom-controller">\n {{#mobile}}\n <div class="bottom-controller__left-buttons">\n <button type="button" class="plyr__control plyr__controls_settings-button settings">\n <img class="filter settings" src="{{icons.settings}}" alt="">\n </button>\n </div>\n {{/mobile}}\n {{#desktop}}\n <div class="bottom-controller__left-buttons">\n <button type="button" class="plyr__control plyr__controls_settings-button settings">\n <img class="filter settings" src="{{icons.settings}}" alt="">\n </button>\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none filter button-open" data-range-value="0.40" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none filter button-open" data-range-value="0.02" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n <div class="volume_control__background d-none">\n <button class="volume_control__volume-button-close button-close">\n <img class="volume-max button-close" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none button-close" data-range-value="0.40" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none button-close" data-range-value="0.02" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none button-close" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n <div class="plyr__volume d-none volume_control__background__area volume-area-open">\n <input data-plyr="volume" class="volume_control__background__area__range volume-area-open" type="range" min="0" max="1"\n step="0.05" value="1"\n autocomplete="off" aria-label="Volume">\n </div>\n </div>\n </div>\n {{/desktop}}\n <div class="bottom-controller__center-buttons">\n <div class="bottom-controller__previous-chapter-view-wrapper">\n <p class="bottom-controller__previous-chapter-view"></p>\n <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-backward}}" alt="">\n </button>\n </div>\n {{#desktop}}\n <button type="button" class="plyr__control skip-backward-seconds" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.fast-backward}}" alt="">\n </button>\n {{/desktop}}\n <div class="bottom-controller__play-button_body bottom-controller__play-button_body__landscape">\n <button type="button" class="plyr__control play-button">\n <img class="bottom-controller__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="bottom-controller__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n </div>\n {{#desktop}}\n <button type="button" class="plyr__control skip-forward-seconds" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.fast-forward}}" alt="">\n </button>\n {{/desktop}}\n <div class="bottom-controller__next-chapter-view-wrapper">\n <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-forward}}" alt="">\n </button>\n <p class="bottom-controller__next-chapter-view"></p>\n </div>\n </div>\n <div class="bottom-controller__right-buttons">\n {{#desktop}}\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n {{/desktop}}\n {{#mobile}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n {{/mobile}}\n </div>\n </div>\n </div>\n {{#mobile}}\n <div class="plyr__controls__mobile-background d-none">\n <div class="lt-player-notification portrait">\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n </div>\n {{/mobile}}\n {{/landscape}}\n {{#portrait}}\n <div class="plyr__controls">\n <div class="top-controllers">\n <div class="top-controllers__background"></div>\n <div class="top-controllers__body">\n <div class="top-controllers__body__left">\n {{#isShare}}\n <button type="button" class="plyr__control lt-player-share">\n <img class="filter" src="{{icons.share}}" alt="">\n </button>\n {{/isShare}}\n </div>\n <div class="top-controllers__body__center">\n <p class="chapter"></p>\n </div>\n <div class="top-controllers__body__right">\n {{#desktop}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n {{/desktop}}\n {{#mobile}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n {{/mobile}}\n </div>\n </div>\n </div>\n <div class="lt-player-notification portrait">\n <div class="lt-player-notification__notification-button-state portrait">\n <div class="player-state">\n <img class="player-state__icon filter" src="" alt="">\n </div>\n </div>\n <div class="lt-player-video-content">\n <div class="content__body">\n <h4 class="poster-title">{{videoParagraph}}</h4>\n <div class="poster-paragraph">\n <p class="poster-paragraph__content">{{videoTitle}}</p>\n </div>\n </div>\n </div>\n <button class="poster-paragraph__button">Read more</button>\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n <div class="plyr__progress--wrapper">\n <div class="plyr__progress">\n <label for=\'seek{id}\' class=\'plyr__sr-only\'>Seek</label>\n <input id=\'seek{id}\' class=\'plyr__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\'\n value=\'0\'\n data-plyr=\'seek\'>\n <div class="bottom-controller__current">\n <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>\n <div class="plyr__time plyr__time--duration custom-duration" aria-label="Duration">00:00</div>\n </div>\n </div>\n </div>\n <div class="bottom-controller__background"></div>\n <div class="bottom-controller">\n {{#mobile}}\n <div class="bottom-controller__left-buttons">\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n </div>\n {{/mobile}}\n {{#desktop}}\n <div class="bottom-controller__left-buttons">\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none filter button-open" data-range-value="0.65" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none filter button-open" data-range-value="0.35" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n <div class="volume_control__background d-none">\n <button class="volume_control__volume-button-close button-close">\n <img class="volume-max button-close" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none button-close" data-range-value="0.65" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none button-close" data-range-value="0.35" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none button-close" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n <div class="plyr__volume d-none volume_control__background__area volume-area-open">\n <input data-plyr="volume" class="volume_control__background__area__range volume-area-open" type="range" min="0" max="1"\n step="0.05" value="1"\n autocomplete="off" aria-label="Volume">\n </div>\n </div>\n </div>\n {{/desktop}}\n <div class="bottom-controller__center-buttons">\n <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-backward}}" alt="">\n </button>\n <div class="bottom-controller__play-button_body bottom-controller__play-button_body__portrait">\n <button type="button" class="plyr__control play-button">\n <img class="bottom-controller__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="bottom-controller__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n </div>\n <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-forward}}" alt="">\n </button>\n </div>\n {{#mobile}}\n <div class="bottom-controller__right-buttons">\n <button type="button" class="plyr__control plyr__controls_speed-button"></button>\n </div>\n {{/mobile}}\n {{#mobile}}\n \x3c!--Maybe fullscreen--\x3e\n {{/mobile}}\n\n {{#desktop}}\n <div class="bottom-controller__right-buttons">\n <button type="button" class="plyr__control plyr__controls_speed-button"></button>\n </div>\n {{/desktop}}\n </div>\n </div>\n {{#mobile}}\n <div class="plyr__controls__mobile-background d-none">\n <div class="lt-player-notification portrait">\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n </div>\n {{/mobile}}\n {{/portrait}}\n{{/player}}\n',Y='{{#modal}}\n {{#mobile}}\n {{#data}}\n <div class="player-lt__modal__mobile__background"></div>\n <div class="player-lt__modal__mobile">\n <div class="player-lt__mobile__modal-header">\n <span class="line-button"></span>\n </div>\n <div class="player-lt__mobile__modal-content">\n {{{data}}}\n </div>\n </div>\n {{/data}}\n {{#object_data}}\n <div class="player-lt__modal__mobile__background"></div>\n <div class="player-lt__modal__mobile">\n <div class="player-lt__mobile__modal-header">\n <span class="line-button"></span>\n </div>\n <div class="player-lt__mobile__modal-content">\n {{#abstract}}\n <h2>{{abstract.title}}</h2>\n <p>{{abstract.description}}</p>\n <p>{{abstract.videoDOI}}</p>\n <p>{{abstract.videoCitation}}</p>\n {{/abstract}}\n\n {{#institution}}\n <h2>{{institution.title}}</h2>\n <img src="{{institution.image}}" alt="image">\n <p>{{institution.institutionName}}</p>\n <p>{{institution.description}}</p>\n {{/institution}}\n\n {{#bio}}\n <h2>{{bio.title}}</h2>\n <p>{{bio.description}}</p>\n {{/bio}}\n </div>\n </div>\n {{/object_data}}\n {{/mobile}}\n {{#desktop}}\n {{#object_data}}\n <div class="player-lt__modal lt-modal-{{id}}">\n <div class="player-lt__modal-content">\n <span class="player-lt__close-button">×</span>\n <div class="player-lt__modal-body">\n {{#abstract}}\n <h2>{{abstract.title}}</h2>\n <p>{{abstract.description}}</p>\n <hr>\n <h3>Video DOI</h3>\n <p>{{abstract.videoDOI}}</p>\n <h3>Video Citation</h3>\n <p>{{abstract.videoCitation}}</p>\n {{/abstract}}\n\n {{#institution}}\n <h2>{{institution.title}}</h2>\n <div class="modal-flex">\n <img src="{{institution.image}}" alt="image">\n <h3>{{institution.institutionName}}</h3>\n </div>\n <hr>\n <p>{{institution.description}}</p>\n {{/institution}}\n\n {{#bio}}\n <h2>{{bio.title}}</h2>\n <p>{{bio.description}}</p>\n {{/bio}}\n </div>\n </div>\n </div>\n {{/object_data}}\n {{#data}}\n <div class="player-lt__modal lt-modal-{{id}}">\n <div class="player-lt__modal-content">\n <span class="player-lt__close-button">×</span>\n {{{data}}}\n </div>\n </div>\n {{/data}}\n {{/desktop}}\n{{/modal}}\n{{#exist}}\n{{#mobile}}\n<div class="lt-player__additional-info-mobile">\n{{#buttons}}\n <button class="additional-info-mobile" data-lt-target="{{target}}">{{#icon}}<img class="additional-info-mobile" src="{{icon}}" alt="">{{/icon}}{{^icon}}<span></span>{{/icon}}</button>\n{{/buttons}}\n </div>\n{{/mobile}}\n{{#desktop}}\n<div class="lt-player__additional-info">\n{{#buttons}}\n <button data-lt-target="{{target}}">{{#icon}}<img src="{{icon}}" alt="">{{/icon}}{{^icon}}<span></span>{{/icon}}</button>\n{{/buttons}}\n</div>\n{{/desktop}}\n\n{{/exist}}\n';var B=function(){function e(){i(this,e)}return n(e,[{key:"getOnloadPoster",value:function(e){return F.render('<div class="lt-player-onload-poster"> <img src="{{logo}}" alt=""> </div>\n',e)}},{key:"getShare",value:function(e){return F.render('<div class="share-controller lt-player-mobile-share">\n <div class="share-controller-wrapper share-inactive">\n <div class="share-controller-content lt-player-mobile-share">\n <div class="share-controller-mobile-modal-header lt-player-mobile-share">\n <span class="line-button lt-player-mobile-share"></span>\n </div>\n\x3c!-- <span class="line-button lt-player-mobile-share"></span>--\x3e\n <div class="share-controller-frame lt-player-mobile-share">\n\x3c!-- <div class="player-lt__close-button-e">--\x3e\n\x3c!-- <span class="player-lt__close-button">×</span>--\x3e\n\x3c!-- </div>--\x3e\n <div class="share-controller-top lt-player-mobile-share">\n <div class="share-controller-title lt-player-mobile-share">\n <h3 class="lt-player-mobile-share">Share this video</h3>\n </div>\n <div class="share-controller-link-wrapper lt-player-mobile-share">\n <span class="share-controller-url lt-player-mobile-share" data-lt-player-copy=""></span>\n <button class="share-controller-link lt-player-mobile-share" type="button">Copy</button>\n </div>\n <hr class="share-controller-hr lt-player-mobile-share">\n </div>\n <div class="share-controller-via lt-player-mobile-share">\n <h3 class="lt-player-mobile-share">You can also share via:</h3>\n </div>\n <div class="a2a_kit a2a_kit_size_32 a2a_default_style share-controller-icons lt-player-mobile-share" data-a2a-url="{{canonicalUrl}}" data-a2a-title="{{title}}">\n <a class="button_embed lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.00028 17.0003C7.74428 17.0003 7.48825 16.9023 7.29325 16.7073L3.29325 12.7073C2.90225 12.3163 2.90225 11.6843 3.29325 11.2933L7.29325 7.29325C7.68425 6.90225 8.31631 6.90225 8.70731 7.29325C9.09831 7.68425 9.09831 8.31631 8.70731 8.70731L5.41434 12.0003L8.70731 15.2933C9.09831 15.6843 9.09831 16.3163 8.70731 16.7073C8.51231 16.9023 8.25628 17.0003 8.00028 17.0003Z" fill="#ffffff"/>\n <path d="M16.0007 17.0003C16.2567 17.0003 16.5127 16.9023 16.7077 16.7073L20.7077 12.7073C21.0987 12.3163 21.0987 11.6843 20.7077 11.2933L16.7077 7.29325C16.3167 6.90225 15.6847 6.90225 15.2937 7.29325C14.9027 7.68425 14.9027 8.31631 15.2937 8.70731L18.5866 12.0003L15.2937 15.2933C14.9027 15.6843 14.9027 16.3163 15.2937 16.7073C15.4887 16.9023 15.7447 17.0003 16.0007 17.0003Z" fill="#ffffff"/>\n </svg>\n </span>\n </a>\n <a class="a2a_button_facebook lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="10" height="20" viewBox="0 0 10 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.55277 20V10.6154H0V7.23652H2.55277V4.3505C2.55277 2.08264 4.0607 0 7.53529 0C8.9421 0 9.98237 0.1311 9.98237 0.1311L9.9004 3.28642C9.9004 3.28642 8.83949 3.27638 7.68178 3.27638C6.42879 3.27638 6.22804 3.83768 6.22804 4.7693V7.23652H10L9.83588 10.6154H6.22804V20H2.55277Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_twitter lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 1.65729C17.3377 1.93837 16.626 2.12834 15.879 2.2138C16.6415 1.7764 17.227 1.08375 17.5027 0.258472C16.7778 0.670159 15.9847 0.960219 15.1577 1.11612C14.484 0.429261 13.5243 0 12.4621 0C10.4226 0 8.76909 1.58246 8.76909 3.53422C8.76909 3.81126 8.80179 4.08097 8.86472 4.33971C5.79558 4.19228 3.07448 2.78525 1.25304 0.646953C0.935227 1.16894 0.753117 1.77613 0.753117 2.42375C0.753117 3.64996 1.40513 4.73169 2.39597 5.36553C1.80953 5.34795 1.23599 5.19636 0.723234 4.92341C0.723023 4.93822 0.723023 4.95302 0.723023 4.96789C0.723023 6.68029 1.99596 8.10878 3.68529 8.43347C3.14148 8.57502 2.57107 8.59573 2.01762 8.49404C2.48752 9.89817 3.85137 10.9199 5.46729 10.9485C4.20342 11.8964 2.61105 12.4615 0.880945 12.4615C0.58282 12.4615 0.288914 12.4447 0 12.4121C1.63427 13.4149 3.57539 14 5.66086 14C12.4535 14 16.1679 8.61449 16.1679 3.9441C16.1679 3.79081 16.1644 3.63839 16.1573 3.48684C16.8802 2.98665 17.5042 2.3671 18 1.65729Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_linkedin lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M3.85913 16V5.20483H0.215002V16H3.85913ZM2.03754 3.73004C3.30831 3.73004 4.09931 2.9011 4.09931 1.8652C4.07563 0.805935 3.30836 0 2.06165 0C0.815143 0 0 0.805951 0 1.8652C0 2.90115 0.7908 3.73004 2.01375 3.73004H2.03743H2.03754ZM5.87615 16H9.52028V9.97145C9.52028 9.64881 9.54396 9.3265 9.64019 9.09586C9.90363 8.45124 10.5032 7.78359 11.5099 7.78359C12.8286 7.78359 13.3561 8.77354 13.3561 10.2247V15.9999H17V9.81007C17 6.49422 15.2022 4.95139 12.8046 4.95139C10.8387 4.95139 9.97556 6.03334 9.49604 6.77025H9.52036V5.2046H5.87623C5.92405 6.21756 5.87623 15.9998 5.87623 15.9998L5.87615 16Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_whatsapp lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_11_828)">\n <path d="M0 16L1.13085 11.8935C0.431709 10.6882 0.0649474 9.3232 0.0687679 7.92776C0.0687679 3.55513 3.6447 0 8.03438 0C10.1662 0 12.1681 0.825095 13.6695 2.32319C15.1748 3.82129 16.0038 5.81369 16 7.93156C16 12.3042 12.4241 15.8593 8.03056 15.8593H8.02674C6.6934 15.8593 5.383 15.5247 4.21776 14.8935L0 16ZM4.42024 13.4601L4.66093 13.6046C5.67717 14.2053 6.8424 14.5209 8.03056 14.5247H8.03438C11.6829 14.5247 14.6552 11.5703 14.6552 7.93536C14.6552 6.17491 13.9675 4.52091 12.7182 3.27377C11.4689 2.02662 9.80324 1.34221 8.03438 1.34221C4.38586 1.3384 1.41356 4.29278 1.41356 7.92776C1.41356 9.17111 1.76122 10.384 2.42598 11.4335L2.58261 11.6844L1.91404 14.1141L4.42024 13.4601Z" fill="white"/>\n <path d="M0.278809 15.7225L1.37145 11.7567C0.695236 10.597 0.339936 9.27759 0.339936 7.93158C0.343756 3.71105 3.79361 0.277588 8.03429 0.277588C10.0935 0.277588 12.0228 1.07607 13.4746 2.52093C14.9264 3.9658 15.7248 5.88976 15.7248 7.93538C15.7248 12.1559 12.2712 15.5894 8.03429 15.5894H8.03047C6.74299 15.5894 5.47842 15.2662 4.35521 14.6578L0.278809 15.7225Z" fill="#27282A"/>\n <path d="M0 16L1.13085 11.8935C0.431709 10.6882 0.0649474 9.3232 0.0687679 7.92776C0.0687679 3.55513 3.6447 0 8.03438 0C10.1662 0 12.1681 0.825095 13.6695 2.32319C15.1748 3.82129 16.0038 5.81369 16 7.93156C16 12.3042 12.4241 15.8593 8.03056 15.8593H8.02674C6.6934 15.8593 5.383 15.5247 4.21776 14.8935L0 16ZM4.42024 13.4601L4.66093 13.6046C5.67717 14.2053 6.8424 14.5209 8.03056 14.5247H8.03438C11.6829 14.5247 14.6552 11.5703 14.6552 7.93536C14.6552 6.17491 13.9675 4.52091 12.7182 3.27377C11.4689 2.02662 9.80324 1.34221 8.03438 1.34221C4.38586 1.3384 1.41356 4.29278 1.41356 7.92776C1.41356 9.17111 1.76122 10.384 2.42598 11.4335L2.58261 11.6844L1.91404 14.1141L4.42024 13.4601Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.04392 4.61218C5.89492 4.28138 5.73829 4.27378 5.59693 4.26998C5.48232 4.26617 5.3486 4.26617 5.21489 4.26617C5.08117 4.26617 4.86723 4.3156 4.68384 4.51332C4.50046 4.71104 3.98853 5.19013 3.98853 6.16732C3.98853 7.1407 4.70295 8.08367 4.80228 8.21675C4.90161 8.34983 6.18146 10.4145 8.20247 11.2091C9.88346 11.8707 10.2273 11.7377 10.5902 11.7034C10.9532 11.6692 11.7669 11.2244 11.935 10.7605C12.0993 10.2966 12.0993 9.90116 12.0496 9.81751C12 9.73386 11.8663 9.68443 11.6676 9.58557C11.4689 9.48671 10.4909 9.00762 10.3075 8.93918C10.1241 8.87454 9.99043 8.84032 9.86054 9.03804C9.72682 9.23576 9.34478 9.68062 9.23016 9.8137C9.11555 9.94678 8.99712 9.96199 8.79845 9.86313C8.59979 9.76427 7.95796 9.55515 7.19769 8.87834C6.60552 8.35363 6.20438 7.70344 6.08976 7.50572C5.97515 7.308 6.0783 7.20154 6.17764 7.10268C6.26551 7.01522 6.3763 6.87074 6.47563 6.75667C6.57496 6.6426 6.60934 6.55895 6.67429 6.42587C6.73924 6.29279 6.70868 6.17872 6.65901 6.07986C6.60934 5.98481 6.21966 5.00382 6.04392 4.61218Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_11_828">\n <rect width="16" height="16" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </span>\n </a>\n <a class="a2a_button_messenger lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_11_831)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8 -0.000732422C3.494 -0.000732422 0 3.30127 0 7.75927C0 10.0913 0.956 12.1073 2.512 13.4993C2.642 13.6153 2.722 13.7793 2.726 13.9553L2.77 15.3793C2.784 15.8333 3.252 16.1293 3.668 15.9453L5.256 15.2453C5.39 15.1853 5.542 15.1753 5.684 15.2133C6.414 15.4133 7.19 15.5213 8 15.5213C12.506 15.5213 16 12.2193 16 7.76127C16 3.30327 12.506 -0.000732422 8 -0.000732422Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.19601 10.0293L5.546 6.30129C5.92 5.70729 6.72 5.56129 7.282 5.98129L9.152 7.38329C9.324 7.51129 9.56 7.51129 9.72999 7.38129L12.254 5.46529C12.59 5.20929 13.03 5.61329 12.806 5.97129L10.454 9.69729C10.08 10.2913 9.28 10.4373 8.718 10.0173L6.848 8.61529C6.676 8.48729 6.44 8.48729 6.27 8.61729L3.74601 10.5333C3.41001 10.7893 2.97001 10.3873 3.19601 10.0293Z" fill="#27282A"/>\n </g>\n <defs>\n <clipPath id="clip0_11_831">\n <rect width="16" height="16" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </span>\n </a>\n <a class="a2a_button_email lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7045 0.25C12.7102 0.25 13.6777 0.6475 14.3895 1.36075C15.102 2.0725 15.5002 3.0325 15.5002 4.0375V9.9625C15.5002 12.055 13.7977 13.75 11.7045 13.75H4.29524C2.20199 13.75 0.500244 12.055 0.500244 9.9625V4.0375C0.500244 1.945 2.19449 0.25 4.29524 0.25H11.7045ZM12.8977 5.155L12.9577 5.095C13.137 4.8775 13.137 4.5625 12.9495 4.345C12.8452 4.23325 12.702 4.165 12.5527 4.15C12.3952 4.14175 12.2452 4.195 12.132 4.3L8.75025 7C8.31525 7.36075 7.692 7.36075 7.25025 7L3.87524 4.3C3.64199 4.1275 3.31949 4.15 3.12524 4.3525C2.92274 4.555 2.90024 4.8775 3.07199 5.1025L3.17024 5.2L6.58275 7.8625C7.00275 8.1925 7.512 8.3725 8.04525 8.3725C8.577 8.3725 9.09525 8.1925 9.5145 7.8625L12.8977 5.155Z" fill="white"/>\n </svg>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n</div>\n',e)}},{key:"getPoster",value:function(e){return F.render('{{#portrait}}\n<div class="lt-player__poster">\n <div class="lt-player__poster__image-body">\n <div class="lt-player__poster--background"></div>\n <img class="lt-player__poster__img lt-player__poster__img__set-default d-none" alt="" src="{{logoBig}}">\n <img class="lt-player__poster__img--set-custom d-none" alt="" src="{{config.configData.posterImage}}">\n </div>\n <div class="lt-player__poster__body">\n <div class="content">\n <div class="content__header">\n <img src="{{config.logo}}" alt="logo">\n </div>\n <div class="content__body">\n <div class="poster-title">{{config.configData.videoParagraph}}</div>\n <div class="poster-paragraph">{{config.configData.videoTitle}}</div>\n </div>\n <div class="content__footer">\n <div class="poster-buttons">\n <button class="poster-button-play">\n <img src="{{config.play}}" alt="" class="icon--not-pressed" role="presentation">\n </button>\n <button class="poster-button-watch-now">\n Watch now\n </button>\n {{#isShare}}\n <button class="poster-lt-player-share" type="button">\n <img class="filter" src="{{config.share}}" alt="" role="presentation">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n </div>\n</div>\n{{/portrait}}\n{{#landscape}}\n <div class="lt-player__poster">\n <div class="lt-player__poster__image-body">\n <div class="lt-player__poster--background"></div>\n <img class="lt-player__poster__img lt-player__poster__img__set-default d-none" alt="" src="{{logoBig}}">\n <img class="lt-player__poster__img--set-custom d-none" alt="" src="{{config.configData.posterImage}}">\n </div>\n <div class="lt-player__poster__body">\n <div class="content">\n <div class="content__header">\n <div class="poster-title">{{config.configData.videoParagraph}}</div>\n </div>\n <div class="content__body">\n <div class="poster-paragraph">{{config.configData.videoTitle}}</div>\n </div>\n <div class="content__footer">\n <div class="poster-buttons">\n <button class="poster-button-play">\n <img src="{{config.play}}" alt="" class="icon--not-pressed" role="presentation">\n </button>\n <button class="poster-button-watch-now">\n Watch now\n </button>\n {{#isShare}}\n <button class="poster-lt-player-share" type="button">\n <img class="filter" src="{{config.share}}" alt="" role="presentation">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n </div>\n</div>\n{{/landscape}}\n',e)}},{key:"getSettings",value:function(e){return F.render('<div class="settings-controllers-enable__background d-none"></div>\n<div class="settings-controllers settings">\n <span class="line-button settings-controllers-header"></span>\n <div class="settings-controllers-enable__subtitles settings">\n <p class="settings-text settings">Subtitles</p>\n <label class="subtitles-body__switch settings">\n <input id="captions-lt-player-{{id}}" class="subtitles-body__input-switch settings" value="" type="checkbox">\n <label for="captions-lt-player-{{id}}" class="subtitles-body__slider settings"></label>\n </label>\n </div>\n <div class="settings-controllers-enable__speed-range settings">\n <p class="settings-text settings">Speed</p>\n <div class="speed-range-input-body settings">\n <output class="settings speed-range-value" style="display: flex; justify-content: center" id="speed-range-value-{{id}}"></output>\n <input id="speed-range-{{id}}" type="range" min="0" max="3" step="1" class="speed-range-input settings">\n </div>\n </div>\n\x3c!-- <div class="settings-controllers-enable__speed-range settings">--\x3e\n\x3c!-- <p class="settings-text settings">Speed</p>--\x3e\n\x3c!-- <div class="speed-range-input-body mobile settings">--\x3e\n\x3c!-- <button class="button-speed settings button_active" data-speed="1">1</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="1.25">1.25</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="1.5">1.5</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="2">2</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\n <div class="settings-controllers-enable__button-save settings">\n <button class="button-save settings">Save</button>\n </div>\n</div>\n',e)}},{key:"getAdditionalInfo",value:function(e){return F.render(Y,e)}},{key:"getAdditionalInfoButtons",value:function(e){return F.render(Y,e)}},{key:"getTemplateByType",value:function(e){var t,i=e.getConfigData();Object.assign(i,(s(t={},e.getVideoType(),!0),s(t,"mobile","mobile"!==e.getDevice()),t));var r=F.render('{{#embedded }}\n<div class="plyr__video-embed embed_player" data-plyr-provider="{{videoUrl.origin}}" data-plyr-embed-id="{{videoUrl.embedId}}" data-plyr-embed-hash="{{videoUrl.embedHash}}">\n</div>\n{{/embedded}}\n{{#video}}\n<video class="embed_player lt-player-wrapper" playsinline controls crossorigin preload="none">\n <source src="{{videoUrl.videoUrl}}"/>\n {{#defaultConfig.captions}}\n <track kind="captions" label="{{label}} captions" src="{{url}}" srclang="{{srclang}}" {{default}} />\n {{/defaultConfig.captions}}\n</video>\n{{/video}}\n',i);return delete i.mobile,r}},{key:"getTemplateControls",value:function(e,t){var i=e.getConfigData();switch(Object.assign(i,{icons:t.getIconsByComponent("controls")}),Object.assign(i,{isShare:e.isShareData()}),Object.assign(i,{player:"true"}),"mobile"===i.device?Object.assign(i,{mobile:"true"}):Object.assign(i,{desktop:"true"}),e.getPlayerType()){case"1":case 1:case"portrait":Object.assign(i,{portrait:"true"});break;case"2":case 2:case"landscape":Object.assign(i,{landscape:"true"})}var r=F.render(U,i);return delete i.mobile,delete i.desktop,r}},{key:"getBackGroundTemplate",value:function(e){return F.render('<div class="lt-player-mini-player-background {{classObserve}}">\n <div class="logo">\n <img src="{{logo}}" alt="">\n </div>\n</div>\n',e)}},{key:"getControlsMiniPlayer",value:function(e){return F.render(U,e)}}]),e}(),$=function(){function e(){i(this,e),s(this,"path",void 0),s(this,"posterMapIconsName",["play","logo","share"]),s(this,"controlsMapIconsName",["play","skip-backward","skip-forward","volume-3","volume-2","volume-1","mute","settings","pause","minimize","maximize","mini-player","share","external-link","fast-backward","fast-forward"]),s(this,"additionalInfoIconsName",["file-text","user","university"]),s(this,"playPause",["play","pause"]),this.path=__webpack_require__(3991)}return n(e,[{key:"getLogo",value:function(){var e=this,t=null;return this.path.keys().forEach((function(i){"logo-big"===i.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","")&&(t=e.path(i))})),t}},{key:"getIconsByComponent",value:function(e){var t=this,i={};switch(e){case"poster":this.path.keys().forEach((function(e){t.posterMapIconsName.forEach((function(r){var n=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");n===r&&Object.assign(i,s({},n,t.path(e)))}))}));break;case"controls":this.path.keys().forEach((function(e){t.controlsMapIconsName.forEach((function(r){var n=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");n===r&&Object.assign(i,s({},n,t.path(e)))}))}));break;case"additionalInfo":this.path.keys().forEach((function(e){t.additionalInfoIconsName.forEach((function(r){var n=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");n===r&&Object.assign(i,s({},n,t.path(e)))}))}));break;case"playPause":this.path.keys().forEach((function(e){t.playPause.forEach((function(r){var n=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");n===r&&Object.assign(i,s({},n,t.path(e)))}))}))}return i}},{key:"getControlsIcons",value:function(){var e=this,t={};return this.path.keys().forEach((function(i){e.posterMapIconsName.forEach((function(r){var n=i.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");n===r&&Object.assign(t,s({},n,e.path(i)))}))})),t}}]),e}(),G=function(){function e(t){i(this,e),s(this,"device",void 0),s(this,"playerInstance",void 0),this.playerInstance=t,this.device=t.playerConfig.getDevice()}return n(e,[{key:"setContainer",value:function(){}}]),e}(),Q=function(){function e(){i(this,e)}return n(e,[{key:"getDeviceOrientation",value:function(){return window.matchMedia("(orientation: portrait)").matches?"portrait":window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}}]),e}(),H=function(){function e(){i(this,e),s(this,"orientation",void 0),s(this,"playerInstance",void 0),s(this,"player",void 0),s(this,"playerContainer",void 0),s(this,"playerParentContainer",void 0),s(this,"device",void 0),s(this,"playerType",void 0),s(this,"addInfo",void 0),s(this,"addInfoOutSide",void 0),s(this,"addInfoInSide",void 0),s(this,"playerParam",{width:null,height:null}),s(this,"defaultPortrate",{max:{width:500,height:776},min:{width:200,height:400},size:{438:"lg",375:"md",350:"sm",200:"xs"}}),s(this,"defaultLandscape",{max:{width:1067,height:600},min:{width:300,height:150},size:{1067:"xxl",913:"xl",820:"lg",760:"md",640:"sm",480:"xs",266:"xxs"}}),this.orientation=new Q}return n(e,[{key:"init",value:function(e){this.playerInstance=e,this.playerContainer=e.playerConfig.getPlayerElementContainer(),this.player=e.plyr,this.device=e.playerConfig.getDevice(),this.playerParentContainer=this.playerContainer.parentElement,this.addInfo=new G(e),this.setPlayerDimensions()}},{key:"setPlayerDimensions",value:function(){if(this.playerInstance.playerConfig.getPlayerType())switch(this.playerInstance.playerConfig.getPlayerType()){case"1":case 1:this.setPortrate(),this.playerType="portrait";break;case"2":case 2:this.setLandScape(),this.playerType="landscape";break;case"portrait":this.playerType="landscape",this.setPortrate();break;case"landscape":this.playerType="landscape",this.setLandScape()}}},{key:"setPortrate",value:function(){}},{key:"setLandScape",value:function(){}},{key:"setEvent",value:function(e){var t=this;new ResizeObserver((function(i){t.setDimensions(i[0].target.clientWidth,i[0].target.clientHeight,e)})).observe(this.playerParentContainer)}},{key:"setEventAddInfo",value:function(e,t,i){var r=this;new ResizeObserver((function(n){r.setAddInfoByDimensions(n[0].target.clientWidth,e,t,i)})).observe(this.playerInstance.plyr.elements.container)}},{key:"setAddInfoByDimensions",value:function(e,t,i,r){var n,s=this;(n=s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info"))&&n.remove(),void 0!==s.playerInstance.plyr.elements.controls?(s.playerInstance.plyr.elements.controls.querySelector(".content__body").insertAdjacentHTML("afterend",t),s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").classList.add("lt-player__additional-info__is_set_in-side"),i.set(r,"in")):s.playerInstance.plyr.on("ready",(function(){s.playerInstance.plyr.elements.controls.querySelector(".content__body").insertAdjacentHTML("afterend",t),s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").classList.add("lt-player__additional-info__is_set_in-side"),i.set(r,"in")}))}},{key:"setDimensions",value:function(e,t,i){var r=this,n=function(){if(void 0!==r.playerInstance.plyr.elements.container){if("mobile"===r.device&&"landscape"===r.orientation.getDeviceOrientation()&&"portrate"===r.playerType)return void(r.playerContainer.style.width="100%");if(e>=i.max.width)return r.playerContainer.style.width="".concat(i.max.width,"px"),void(r.playerParam.width=i.max.width);if(e<i.max.width&&e>=i.min.width)return r.playerContainer.style.width="".concat(e,"px"),void(r.playerParam.width=e);if(e<i.min.width)return r.playerContainer.style.width="".concat(i.min.width,"px"),void(r.playerParam.width=i.min.width)}},s=function(){if(void 0!==r.playerInstance.plyr.elements.container){if("mobile"===r.device&&"landscape"===r.orientation.getDeviceOrientation()&&"portrate"===r.playerType)return void(r.playerContainer.style.height="90vh");if(t>=i.max.height)return r.playerContainer.style.height="".concat(i.max.height,"px"),void(r.playerParam.height=i.max.height);if(t>=i.min.height&&t<i.max.height)return r.playerContainer.style.height="".concat(t,"px"),void(r.playerParam.height=t);if(t<i.min.height)return r.playerContainer.style.height="".concat(i.min.height,"px"),void(r.playerParam.height=i.min.height)}},a=this.playerInstance.playerConfig.getVersion(),o=this.playerInstance.playerConfig.getObserve();o?(o.hasOwnProperty("width")&&o.width&&n(),o.hasOwnProperty("height")&&o.height&&s()):(n(),1!==a&&s()),function(){if(void 0!==r.playerInstance.plyr.elements.container){var e=!1,t=r.defaultPortrate;"landscape"===r.playerType&&(t=r.defaultLandscape),Object.keys(t.size).forEach((function(i){r.playerContainer.classList.contains("lt-player--".concat(r.playerType,"__").concat(t.size[i]))&&r.playerContainer.classList.remove("lt-player--".concat(r.playerType,"__").concat(t.size[i])),r.playerContainer.clientWidth>=parseInt(i)&&(e="lt-player--".concat(r.playerType,"__").concat(t.size[i]))})),e&&r.playerContainer.classList.add(e)}}()}}]),e}(),q=function(){function e(){i(this,e),s(this,"config",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"plyr",void 0)}return n(e,[{key:"initPreload",value:function(e,t,i,r){this.plyr=e,this.iconService=r,this.templateService=t,this.config=i;var n=e.elements.container.querySelector(".lt-player__poster__image-body");n&&(i.isAutoPreload()?this.plyr.on("play",(function(){n.classList.add("lt-player__poster__image-body--preload")})):setTimeout((function(){n.classList.add("lt-player__poster__image-body--preload")}),800))}}]),e}(),W=function(){function e(){i(this,e)}return n(e,null,[{key:"getDevice",value:function(){var e="desktop";return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(e="mobile"),e}},{key:"setDebugEvent",value:function(e,t){}},{key:"processConfigData",value:function(e){var t,i="video",r="video";return null!==(t=/^(http:\/\/|https:\/\/)(player\.vimeo\.com|vimeo\.com|youtu\.be|www\.youtube\.com)\/([\w\/]+)(\?.*)?$/.exec(e))&&t.forEach((function(e){void 0!==e&&(e.includes("vimeo")&&(i="embedded",r="vimeo"),e.includes("youtube")&&(i="embedded",r="youtube"))})),{type:i,origin:r}}},{key:"isValidHttpUrl",value:function(e){var t;if("object"===d(e))return!1;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}},{key:"checkIsHls",value:function(e){var t=!1;return["m3u8"].forEach((function(i){e.includes(i)&&(t=!0)})),t}},{key:"getVideoOrientation",value:function(e,t){return e>t?"landscape":"portrait"}},{key:"getPlayerStringType",value:function(e){var t=null;switch(e){case"1":case 1:case"portrait":t="portrait";break;case"2":case 2:case"landscape":t="landscape"}return t}}]),e}();s(W,"getEmbeddedID",(function(e){return e.split("?")[0].split("/").length>4?e.split("?")[0].split("/").slice(-2)[0]:e.split("?")[0].split("/").slice(-1)[0]})),s(W,"getEmbeddedHash",(function(e){return e.split("?")[0].split("/").length>4?e.split("?")[0].split("/").slice(-1)[0]:null}));var Z,V,K=function(){function e(t,r,n,a){i(this,e),s(this,"custom_selector","lt-player__poster"),s(this,"config",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"plyr",void 0),this.plyr=t,this.iconService=a,this.templateService=r,this.config=n}return n(e,[{key:"setTemplate",value:function(){var e;Object.assign(this.config,this.iconService.getIconsByComponent("poster"));var t=this.iconService.getLogo(),i=(s(e={},W.getPlayerStringType(this.config.getPlayerType()),!0),s(e,"config",this.config),s(e,"logoBig",t),s(e,"isShare",!!this.config.isShareData()),e),r=this.templateService.getPoster(i);this.plyr.elements.wrapper.insertAdjacentHTML("afterend",r)}},{key:"setImage",value:function(){var e,t,i,r=this.plyr.elements.container.querySelector(".lt-player__poster__img--set-custom"),n=this.plyr.elements.container.querySelector(".lt-player__poster__img__set-default"),s=function(){n&&n.classList.remove("d-none")};this.config.getPosterImage()?r&&(e=this.config.getPosterImage(),t=function(e){e?r.classList.remove("d-none"):s()},(i=new Image).onerror=function(){t(!1)},i.onload=function(){t(!0)},i.src=e):s()}}]),e}(),X=function(){function e(){i(this,e)}return n(e,null,[{key:"getSpinner",value:function(){return'<div class="lt-player-spinner__loader">\n <svg class="lt-player-spinner__loader__circle-svg" viewBox="0 0 50 50">\n <circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle>\n </svg>\n </div>'}},{key:"removeSpinner",value:function(e){if(e){var t=e.querySelector(".lt-player-spinner__loader");t&&t.remove()}}}]),e}(),J=n((function e(){i(this,e)}));s(J,"preloadEvents",{removePosterImage:function(e){var t=e.playerConfig.getPlayerElementContainer().parentElement.querySelector(".plyr__poster");t&&t.classList.add("lt-player__preload-hide")},embedPlay:function(e,t){var i=e.plyr.elements.container;i.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",X.getSpinner());var r=e.playerConfig.getPreload(),n=function(){console.log("preload play"),0!==r.start?(e.plyr.embed.setCurrentTime(r.start).then((function(){e.plyr.embed.setMuted(!0).then((function(){e.plyr.embed.play().then((function(){e.plyr.volume=0,X.removeSpinner(i)}))})).catch((function(){}))})),X.removeSpinner(i)):(e.plyr.volume=0,e.plyr.embed?e.plyr.embed.play().then((function(){X.removeSpinner(i)})):(e.plyr.play(),X.removeSpinner(i)))};switch(t){case"event":this.removePosterImage(e),e.playerConfig.isAutoPreload()?n():(console.log("preload play"),0!==r.start?e.plyr.embed.setCurrentTime(r.start).then((function(){e.plyr.embed.pause().then((function(){e.plyr.volume=0,X.removeSpinner(i)}))})):e.plyr.embed?e.plyr.embed.pause().then((function(){X.removeSpinner(i)})):(e.plyr.pause(),X.removeSpinner(i)),X.removeSpinner(i));break;case"action":n()}},html5Play:function(e,t){var i=this,r=function(){e.plyr.volume=0;var r=e.playerConfig.getPreload();switch(0!==r.start&&(e.plyr.currentTime=r.start),t){case"event":i.removePosterImage(e),e.playerConfig.isAutoPreload()?e.plyr.play():e.plyr.pause();break;case"action":e.plyr.play()}},n=!1;e.plyr.on("loadeddata",(function(){n=!0,r()})),n||r()},stop:function(e,t){var i;switch(t){case"event":i=e.playerConfig.getPreload(),e.plyr.currentTime>=i.stop&&(e.plyr.isEmbed?this.embedPlay(e,"action"):this.html5Play(e,"action"));break;case"action":e.plyr.pause()}}}),function(e){var t=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"instance",void 0),this.player=t.plyr,this.instance=t}return n(e,[{key:"play",value:function(){var e=this.player.elements.container;this.player.playing||this.player.play(),function(){var t=e.querySelector(".lt-player__poster");t&&t.classList.add("d-none");var i=e.querySelector(".player__controls");i&&i.classList.remove("d-none")}()}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){var e,t,i,r=this,n=this.player.elements.container;this.player.stop(),e=n.querySelector(".lt-player__poster"),t=n.querySelector(".plyr__controls"),n.classList.add("plyr--stopped"),e.classList.remove("d-none"),t.classList.add("d-none"),function(){if(n.querySelector(".settings-controllers").classList.contains("settings-controllers-enable")){var e=n.querySelector(".settings-controllers");r.player.elements.controls.classList.remove("plyr__controls-enable-settings"),e.classList.remove("settings-controllers-enable");var t=document.querySelector(".settings-controllers-enable__background");t.classList.contains("d-none")||t.classList.add("d-none")}}(),(i={controls:n.querySelector(".lt-player-mini-player-controls"),background:n.querySelector(".lt-player-mini-player-background"),enable:n.querySelector(".lt-player-mini-enable"),size_land:n.querySelector(".lt-player-mini-1"),size_port:n.querySelector(".lt-player-mini-2")}).controls&&i.controls.remove(),i.background&&i.background.remove(),i.size_land&&i.size_land.classList.remove("lt-player-mini-1"),i.size_port&&i.size_port.classList.remove("lt-player-mini-2"),i.enable&&i.enable.classList.remove("lt-player-mini-enable"),r.player.fullscreen.active&&r.player.fullscreen.exit()}},{key:"enterMiniPlayer",value:function(){this.instance.miniPlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){this.instance.miniPlayer.exitMiniPlayer(this.player)}}]),e}();e.Player=t;var r=function(){function e(t,r){i(this,e),s(this,"instance",void 0),s(this,"preloadPoster",void 0),this.instance=t,this.preloadPoster=r}return n(e,[{key:"play",value:function(){if(this.instance.plyr.isEmbed){var e=this.instance,t=this.instance.plyr;t.on("ready",(function(){t.embed.ready().then((function(){J.preloadEvents.embedPlay(e,"action")}))})),J.preloadEvents.embedPlay(e,"action")}if(this.instance.plyr.isHTML5){var i=this.instance;J.preloadEvents.html5Play(i,"action")}}},{key:"pause",value:function(){J.preloadEvents.stop(this.instance,"action")}},{key:"stop",value:function(){return console.error("Sorry, this method is not implemented, don't worry, be happy")}}]),e}();e.Preload=r}(Z||(Z={})),function(e){var t=n((function e(){i(this,e),s(this,"poster",{getButtons:function(e){var t=e.plyr.elements.container.querySelectorAll(".poster-button-play, .poster-button-watch-now");if(0!==t.length)return t},reset:function(e){var t=e.plyr.elements.container,i=function(){t.querySelector(".lt-player__poster").classList.add("d-none"),t.querySelector(".plyr__controls").classList.remove("d-none")};e.playerConfig.getPreload().isActive&&(e.plyr.volume=1,e.plyr.currentTime=0,e.playerConfig.getPreload().isActive=!1),e.plyr.isEmbed?(i(),t.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",X.getSpinner()),e.plyr.embed.play().then((function(){e.plyr.volume=1,X.removeSpinner(t)}),(function(){e.plyr.volume=1,X.removeSpinner(t),e.plyr.play()}))):(i(),e.plyr.volume=1,e.plyr.play()),e.playerConfig.getPreload()&&(X.removeSpinner(t),"mobile"===e.playerConfig.getDevice()&&(e.plyr.isEmbed?e.plyr.embed.getTextTracks().then((function(t){0!==t.length&&e.plyr.toggleCaptions(!0)})):e.plyr.toggleCaptions(!0)))}})}));e.Common=t;var r=function(){function e(){i(this,e)}return n(e,[{key:"posterBody",value:function(e){var t=new V.Common,i=e.plyr.elements.container.querySelector(".lt-player__poster__body");i&&i.addEventListener("click",(function(i){i.preventDefault(),i.target.classList.contains("poster-lt-player-share")||i.target.classList.contains("filter")||(e.playerControl.desktopEvents.titleLineBreak(e),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate"),t.poster.reset(e))}))}}]),e}();e.Desktop=r;var a=function(){function e(){i(this,e)}return n(e,[{key:"posterBody",value:function(e){var t=e.plyr.elements.container,i=t.querySelector(".plyr__poster"),r=t.querySelector(".lt-player__poster__body"),n=new V.Common,s=e.eventInstance.mobileEvents.setMobileEvent(r);s&&s.on("singletap",(function(){i.classList.contains("d-none")||(e.playerControl.desktopEvents.titleLineBreak(e),e.playerControl.mobileEvents.playPauseIcon(e,"timeupdate"),n.poster.reset(e),t.classList.remove("plyr__poster-enabled"),e.playerControl.mobileEvents.showControls(e))}))}},{key:"onload",value:function(e){}},{key:"showControls",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,r=t.querySelector(".plyr__poster"),n=e.eventInstance.mobileEvents.setMobileEvent(r);n&&n.on("singletap",(function(){i.classList.contains(".plyr__controls-enable")||e.playerControl.mobileEvents.showControls(e)}))}}]),e}();e.Mobile=a}(V||(V={}));var ee,te=function(){function e(){i(this,e),s(this,"instance",void 0),s(this,"preload",void 0),s(this,"poster",void 0),s(this,"playerConfig",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.desktopEvents=new V.Desktop,this.mobileEvents=new V.Mobile}return n(e,[{key:"init",value:function(e){this.instance=e,this.playerConfig=e.playerConfig,this.templateService=e.templateService,this.iconService=e.iconService,this.poster=new K(this.instance.plyr,this.templateService,this.playerConfig,this.iconService),this.poster.setTemplate(),this.poster.setImage(),this.playerConfig.getPreload()&&this.initPreload()}},{key:"initPreload",value:function(){this.preload=new q,this.preload.initPreload(this.instance.plyr,this.templateService,this.playerConfig,this.iconService),this.instance.devMethodePreload=new Z.Preload(this.instance,this.preload)}}]),e}();!function(e){var t=function(){function e(t){i(this,e),s(this,"manager",void 0),this.manager=t}return n(e,[{key:"init",value:function(){var e=this,t=[this.manager.instance.plyr.elements.container.querySelector(".poster-lt-player-share"),this.manager.instance.plyr.elements.controls.querySelector(".lt-player-share")],i=this;t.forEach((function(t){if(t){var r=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);r&&r.on("singletap",(function(e){e.preventDefault(),i.manager.mobile.activeModal()}))}}))}}]),e}();e.mobile=t;var r=function(){function e(t){i(this,e),s(this,"manager",void 0),this.manager=t}return n(e,[{key:"init",value:function(){var e=this.manager;e.desktop.getSelector().buttons.forEach((function(t){t&&t.addEventListener("click",(function(){e.desktop.activeModal()}))})),e.desktop.getSelector().shareContainer&&e.desktop.getSelector().shareContainer.addEventListener("click",(function(t){if(t.preventDefault(),e.desktop.getSelector().shareContainer.classList.contains("share-active")){var i=t.target;(i.classList.contains("share-active")||i.classList.contains("player-lt__close-button"))&&e.desktop.inactiveModal()}}))}}]),e}();e.desktop=r}(ee||(ee={}));var ie,re=function(){function e(t){i(this,e),s(this,"manager",void 0),s(this,"isPlaying",void 0),s(this,"switchButtonSet",void 0),this.manager=t,this.setTemplate()}return n(e,[{key:"setTemplate",value:function(){this.manager.instance.plyr.elements.wrapper.insertAdjacentHTML("afterend",this.manager.templateService.getShare(this.manager.playerConfig.getShareData()))}},{key:"activeModal",value:function(){var e=this.getSelector(),t=this.manager.instance;e.shareContainer.classList.remove("share-inactive"),e.shareContainer.classList.add("share-active"),window.a2a.init_all(),t.playerConfig.getShareData().canonicalUrl?this.setCopyContent(!1):t.playerConfig.getShareData().embedUrl?this.setCopyContent(!0):e.shareContainer.querySelector(".share-controller-top").classList.add("d-none"),this.setCopyButtonsEvents(),this.switchButtonSet||(this.setSwitchButton(),this.switchButtonSet=!0),t.plyr.playing?(this.isPlaying=!0,t.plyr.pause()):this.isPlaying=!1}},{key:"setSwitchButton",value:function(){var e=this,t=this.getSelector(),i=this.manager.instance;i.playerConfig.getShareData().embedUrl&&i.playerConfig.getShareData().canonicalUrl?t.switchButton.addEventListener("click",(function(){t.urlInput.classList.contains("canonicalUrl")?(t.urlInput.classList.remove("canonicalUrl"),t.urlInput.classList.add("embedUrl"),e.setCopyContent(!0)):(t.urlInput.classList.add("canonicalUrl"),t.urlInput.classList.remove("embedUrl"),e.setCopyContent(!1))})):t.switchButton.classList.add("d-none")}},{key:"setCopyContent",value:function(e){var t=this.getSelector(),i=this.manager.instance;if(!e)return t.urlInput.classList.add("canonicalUrl"),t.urlInput.innerHTML="".concat(i.playerConfig.getShareData().canonicalUrl),t.urlInput.dataset.copy=i.playerConfig.getShareData().canonicalUrl,void t.urlInput.addEventListener("click",(function(){window.open(i.playerConfig.getShareData().canonicalUrl)}));t.urlInput.classList.add("embedUrl");var r='<iframe width="560" height="315" src="'.concat(i.playerConfig.getShareData().embedUrl,'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');t.urlInput.innerText=r,t.urlInput.dataset.copy=r}},{key:"inactiveModal",value:function(){var e=this.getSelector(),t=this.manager.instance;e.shareContainer.classList.add("share-inactive"),e.shareContainer.classList.remove("share-active"),this.isPlaying&&t.plyr.play()}},{key:"getSelector",value:function(){return{buttons:[this.manager.instance.plyr.elements.container.querySelector(".poster-lt-player-share"),this.manager.instance.plyr.elements.controls.querySelector(".lt-player-share")],urlInput:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper").querySelector(".share-controller-url"),shareContainer:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper"),copyButtons:this.manager.instance.plyr.elements.container.querySelectorAll(".share-controller-link"),switchButton:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper").querySelector(".button_embed")}}},{key:"setCopyButtonsEvents",value:function(){var e=this.getSelector();e.copyButtons.length>0&&e.copyButtons.forEach((function(t){t.addEventListener("click",(function(){navigator.clipboard.writeText(e.urlInput.dataset.copy)}))}))}}]),e}(),ne=function(){function e(t){i(this,e),s(this,"manager",void 0),s(this,"isPlaying",void 0),this.manager=t}return n(e,[{key:"activeModal",value:function(){var e=this;if(this.manager.playerConfig.getShareData().canonicalUrl)this.createModal(),this.setCopyContent(!1);else{if(!this.manager.playerConfig.getShareData().embedUrl)return;this.createModal(),this.setCopyContent(!0)}window.a2a.init_all(),this.setCopyButtonsEvents(),this.setSwitchButton(),this.manager.instance.plyr.playing?(this.isPlaying=!0,this.manager.instance.plyr.pause()):this.isPlaying=!1,setTimeout((function(){var t=document.querySelector(".share-controller-wrapper"),i=document.querySelector(".share-controller-mobile-modal-header"),r=e;if(t){var n=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);n&&n.on("singletap",(function(e){e.preventDefault();var t=e.target;t.classList.contains("player-lt__close-button")||t.classList.contains("lt-player-mobile-share")||r.inactiveModal()}))}if(i){var s=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);s&&s.on("pan",(function(e){e.preventDefault(),e.target.classList.contains("player-lt__close-button")||r.inactiveModal()}))}}),100)}},{key:"setSwitchButton",value:function(){var e=this,t=document.querySelector(".share-controller-wrapper").querySelector(".button_embed"),i=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url"),r=this.manager.instance;r.playerConfig.getShareData().embedUrl&&r.playerConfig.getShareData().canonicalUrl?t.addEventListener("click",(function(){i.classList.contains("canonicalUrl")?(i.classList.remove("canonicalUrl"),i.classList.add("embedUrl"),e.setCopyContent(!0)):(i.classList.add("canonicalUrl"),i.classList.remove("embedUrl"),e.setCopyContent(!1))})):t.classList.add("d-none")}},{key:"setCopyButtonsEvents",value:function(){var e=document.querySelectorAll(".share-controller-link"),t=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url");e.length>0&&e.forEach((function(e){e.addEventListener("click",(function(){navigator.clipboard.writeText(t.dataset.copy)}))}))}},{key:"setCopyContent",value:function(e){var t=this,i=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url");if(i){if(!e)return i.classList.add("canonicalUrl"),i.innerHTML="".concat(this.manager.instance.playerConfig.getShareData().canonicalUrl),i.dataset.copy=this.manager.instance.playerConfig.getShareData().canonicalUrl,void i.addEventListener("click",(function(){window.open(t.manager.instance.playerConfig.getShareData().canonicalUrl)}));i.classList.add("embedUrl");var r='<iframe width="560" height="315" src="'.concat(this.manager.instance.playerConfig.getShareData().embedUrl,'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');i.innerText=r,i.dataset.copy=r}}},{key:"createModal",value:function(){var e=this.manager.instance.templateService.getShare(this.manager.playerConfig.getShareData()),t=document.createElement("div");t.classList.add("lt-player-mobile-share-modal"),t.innerHTML=e;var i=document.querySelector("body");i&&i.appendChild(t)}},{key:"inactiveModal",value:function(){var e=document.querySelector(".lt-player-mobile-share-modal");e&&e.remove(),this.isPlaying&&this.manager.instance.plyr.play()}}]),e}(),se=function(){function e(){i(this,e),s(this,"instance",void 0),s(this,"playerConfig",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"events",{desktop:void 0,mobile:void 0}),s(this,"desktop",void 0),s(this,"mobile",void 0)}return n(e,[{key:"init",value:function(e){this.instance=e,this.playerConfig=e.playerConfig,this.templateService=e.templateService,this.iconService=e.iconService,this.appendScriptTag(),this.setByDevice()}},{key:"setByDevice",value:function(){switch(this.playerConfig.getDevice()){case"desktop":this.desktop=new re(this),this.events.desktop=new ee.desktop(this);break;case"mobile":this.mobile=new ne(this),this.events.mobile=new ee.mobile(this)}}},{key:"appendScriptTag",value:function(){var e=document.createElement("script");e.classList.add("lt-player-add-to-any"),e.type="text/javascript",e.src="https://static.addtoany.com/menu/page.js",e.async,document.body.appendChild(e)}},{key:"removeScriptTag",value:function(){var e=document.querySelector(".lt-player-add-to-any");e&&e.remove()}}]),e}(),ae=function(){function e(){i(this,e),s(this,"instanceType",void 0),s(this,"playerConfig",void 0),s(this,"plyr",void 0),s(this,"objectFit",void 0)}return n(e,[{key:"init",value:function(e){this.instanceType=e,this.playerConfig=e.playerConfig,this.plyr=e.plyr,this.objectFit=e.playerConfig.getObjectFit(),this.appendObjectFit()}},{key:"appendObjectFit",value:function(){if(this.objectFit&&this.plyr.isHTML5){var e=this.plyr.elements.wrapper.querySelector("video");"cover"===this.objectFit&&(e.style.objectFit=this.objectFit)}}},{key:"removeObjectFit",value:function(){if(this.objectFit&&this.plyr.isHTML5){var e=this.plyr.elements.wrapper.querySelector("video");"cover"===this.objectFit&&(e.style.objectFit=null)}}}]),e}(),oe=n((function e(){i(this,e),s(this,"playerId",void 0),s(this,"windowService",void 0),s(this,"playerConfig",void 0),s(this,"playerControl",void 0),s(this,"plyr",void 0),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),s(this,"additionalInfoService",void 0),s(this,"miniPlayer",void 0),s(this,"devMethodePlayer",void 0),s(this,"devMethodePreload",void 0),s(this,"eventInstance",void 0),s(this,"posterManager",void 0),s(this,"share",void 0),s(this,"hls",void 0),s(this,"videoService",void 0),this.windowService=new H,this.iconService=new $,this.templateService=new B,this.playerControl=new T(this.templateService),this.posterManager=new te,this.share=new se,this.videoService=new ae})),le=function(){function e(){i(this,e),s(this,"player",void 0),s(this,"playerContainer",{width:null,height:null}),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"playerType",void 0),s(this,"instance",void 0),s(this,"observe",void 0),s(this,"event",{removeMiniPLOnFullScreen:function(e,t){var i=e.plyr.elements.controls.querySelector(".mini-player-control");if(i)switch(t){case"enterfullscreen":i.classList.add("d-none");break;case"exitfullscreen":i.classList.remove("d-none")}}})}return n(e,[{key:"init",value:function(e,t,i,r,n){this.instance=n,this.templateService=t,this.iconService=i,this.player=e,this.playerType=r,this.setup()}},{key:"enterMiniPlayer",value:function(){this.playerContainer.width=this.player.elements.wrapper.getBoundingClientRect().width,this.playerContainer.height=this.player.elements.wrapper.getBoundingClientRect().height,this.player.elements.wrapper.classList.add("lt-player-mini-enable"),this.player.elements.wrapper.classList.add("lt-player-mini-".concat(this.playerType)),this.setBackground(this.player.elements.wrapper),this.addMouseHoverControllers(),this.addPlayPauseEvents(),this.setSeekBar()}},{key:"setup",value:function(){var e=this.player,t=this;e.on("ready",(function(){var i=e.elements.container,r=e.elements.wrapper,n=i.querySelector(".mini-player-control");n&&n.addEventListener("click",(function(e){e.preventDefault(),t.playerContainer.width=i.getBoundingClientRect().width,t.playerContainer.height=i.getBoundingClientRect().height,r.classList.add("lt-player-mini-enable"),r.classList.add("lt-player-mini-".concat(t.playerType)),t.setBackground(r),t.addMouseHoverControllers(),t.addPlayPauseEvents(),t.setSeekBar(),t.exitMiniPlayer(t.player)}))}))}},{key:"setSeekBar",value:function(){var e=this.player,t=e.elements.container.querySelector(".lt-player-mini-player-controls__progress__seek");t.addEventListener("input",(function(){e.currentTime=parseInt(t.value)}));var i=function(t){var i=(t.value-t.min)/(t.max-t.min)*100;t.value=e.currentTime.toFixed(2).toString(),t.max=e.duration.toFixed(2).toString(),t.style.background="linear-gradient(to right, #D8D846 0%, #D8D846 "+i+"%, transparent "+i+"%, transparent 100%)"};e.on("timeupdate",(function(){t.value=e.currentTime.toFixed(2).toString(),t.max=e.duration.toFixed(2).toString(),i(t)})),i(t)}},{key:"setBackground",value:function(e){var t=this.templateService.getBackGroundTemplate({logo:this.iconService.getLogo()}),i=this.templateService.getControlsMiniPlayer({mini_player:"true",icons:this.iconService.getIconsByComponent("controls")});e.insertAdjacentHTML("afterend",t),e.children[0].insertAdjacentHTML("afterend",i),this.instance.playerConfig.getObserve()&&(void 0===this.instance.playerConfig.isObserveHeight()||this.instance.playerConfig.isObserveHeight())||this.setObserveBackground()}},{key:"setObserveBackground",value:function(){var e=this,t=this.player.elements.container.querySelector(".lt-player-mini-player-background");this.observe=new ResizeObserver((function(i){var r=i[0].contentRect.width,n=t.getBoundingClientRect().width;if(r>=n)if(r>e.playerContainer.width)103===e.player.elements.controls.getBoundingClientRect().height?(t.style.width="".concat(e.playerContainer.width,"px"),t.style.height="".concat(e.playerContainer.height,"px")):(t.style.width="".concat(e.player.elements.controls.getBoundingClientRect().width,"px"),t.style.height="".concat(e.player.elements.controls.getBoundingClientRect().height,"px"));else{t.style.width="".concat(e.playerContainer.width,"px");var s=e.playerContainer.height+(i[0].contentRect.width-e.playerContainer.width);t.style.height=s>100?"".concat(s,"px"):e.playerContainer.height}if(r<n){t.style.width="".concat(r,"px");var a=e.playerContainer.height-(e.playerContainer.width-i[0].contentRect.width);t.style.height=a>100?"".concat(a,"px"):e.playerContainer.height}})),this.observe.observe(document.body)}},{key:"addMouseHoverControllers",value:function(){var e=this.player.elements.container.querySelector(".lt-player-mini-enable");e.addEventListener("mouseover",(function(){var t=e.querySelector(".lt-player-mini-player-controls");t&&t.classList.add("lt-player-mini-player-controls-enable")})),e.addEventListener("mouseleave",(function(){var t=e.querySelector(".lt-player-mini-player-controls");t&&t.classList.remove("lt-player-mini-player-controls-enable")}))}},{key:"addPlayPauseEvents",value:function(){var e=this.player.elements.container,t=this.player,i=e.querySelector(".lt-player-mini-player-controls__play-button");if(i){var r=t.elements.container,n=r.querySelector(".lt-player-mini-player-controls__play-icon"),s=r.querySelector(".lt-player-mini-player-controls__pause-icon");t.playing?(n.classList.add("d-none"),s.classList.remove("d-none")):(s.classList.add("d-none"),n.classList.remove("d-none")),i.addEventListener("click",(function(e){e.preventDefault(),t.playing?(t.pause(),n.classList.remove("d-none"),s.classList.add("d-none")):(t.play(),s.classList.remove("d-none"),n.classList.add("d-none"))}))}}},{key:"exitMiniPlayer",value:function(e){var t=e.elements.container,i=t.querySelector(".lt-player-mini-player-controls__exit"),r=this;i&&i.addEventListener("click",(function(e){e.preventDefault(),t.querySelector(".lt-player-mini-player-controls").remove(),t.querySelector(".lt-player-mini-player-background").remove(),t.querySelector(".lt-player-mini-enable").classList.remove("lt-player-mini-".concat(r.playerType)),t.querySelector(".lt-player-mini-enable").classList.remove("lt-player-mini-enable"),r.observe.disconnect()}))}}]),e}();!function(e){var t=function(){function e(){i(this,e),s(this,"version",void 0)}return n(e,[{key:"setVersion",value:function(e){this.version=e}},{key:"processItem",value:function(e,t){return this.mapByVersion(e,t)}},{key:"mapByVersion",value:function(e,t){switch(e){case"preload":return r.processPreload(t,this.version);case"autoPlay":return r.processAutoPlay(t,this.version);case"videoTitle":return r.processVideoTitle(t,this.version);case"posterImage":return r.processPosterImage(t,this.version);case"videoParagraph":return r.processVideoParagraph(t,this.version);case"videoUrl":return r.processVideoUrl(t,this.version);case"playerContainer":return r.processPlayerContainer(t,this.version);case"share":return r.processShareData(t,this.version);case"vimeo":return r.processVimeoConfig(t,this.version);case"defaultConfig":return r.processDefaultConfig(t,this.version);case"chapters":return r.processChapters(t,this.version);case"device":return 1===this.version?t.device:t;case"playerType":return 1===this.version?t.playerType:t;case"observe":return r.processObserve(t,this.version)}}}]),e}();e.Map=t;var r=function(){function e(){i(this,e)}return n(e,null,[{key:"processObserve",value:function(e,t){var i={width:!1,height:!1};if(e&&1!==t&&0!==Object.keys(e).length)return Object.keys(e).forEach((function(t){var r;i.hasOwnProperty(t)&&(i[t]=!!(r=e[t])&&("boolean"==typeof r?r:"string"==typeof r?"true"===r||"TRUE"===r||"1"===r:"number"==typeof r&&1===r))})),i}},{key:"processChapters",value:function(e,t){if(e&&(1===t&&(e=e.chapters),0!==Object.keys(e).length))return e}},{key:"processDefaultConfig",value:function(e,t){var i={speed:{selected:1,captions:!1,update:!0},captions:{active:!1},clickToPlay:!1,playsinline:!0,pip:!1};return e?(1===t||0===Object.keys(e).length||Object.keys(e).forEach((function(t){i[t],i[t]=e[t]})),i):i}},{key:"processVimeoConfig",value:function(e,t){var i={controls:!1,active:!1,gesture:"media",transparent:!0,speed:!0,portrait:!0,keyboard:!1,title:!1,byline:!1,playsinline:!0,background:!0};return 1===t?i:e?(0===Object.keys(e).length||Object.keys(e).forEach((function(t){i[t],i[t]=e[t]})),i):i}},{key:"processShareData",value:function(e,t){if(!e)return null;var i,r,n={canonicalUrl:void 0,embedUrl:void 0,title:void 0};return 1===t&&(e={canonicalUrl:null!==(i=e.canonical_url)&&void 0!==i?i:null,embedUrl:"".concat(window.location.origin,"/embed/").concat(e.id),title:null!==(r=e.title)&&void 0!==r?r:null}),0!==Object.keys(e).length?(void 0!==e.canonicalUrl&&(n.canonicalUrl=e.canonicalUrl),void 0!==e.embedUrl&&(n.embedUrl=e.embedUrl),void 0!==e.title&&(n.title=e.title),n):void 0}},{key:"processPlayerContainer",value:function(e,t){return e?1===t?e.playerContainer:e:null}},{key:"processVideoUrl",value:function(e,t){if(!e)return null;1===t&&"object"===d(e)&&(e=e.sources.video_id);var i={videoUrl:void 0,videoType:void 0,embedHash:void 0,embedId:void 0,origin:void 0};return W.isValidHttpUrl(e)?(i=function(e,t,i){if("string"==typeof e&&(i.videoUrl=e),t.origin&&(i.origin=t.origin),t.type&&(i.videoType=t.type.toLowerCase()),"embedded"===t.type){var r=W.getEmbeddedID(e);r&&(i.embedId=r);var n=W.getEmbeddedHash(e);n&&(i.embedHash=n)}return i}(e,W.processConfigData(e),i),i):(console.error("Please insert valid url video url videoURL : ".concat(e)),i)}},{key:"processVideoParagraph",value:function(e,t){if(!e)return null;var i=void 0;return 1===t&&"object"===d(e)&&(e=e.author),"string"==typeof e&&/[a-zA-Z]/.test(e)&&(i=e),i}},{key:"processPosterImage",value:function(e,t){return e?1===t&&"object"===d(e)?e.poster:W.isValidHttpUrl(e)?e:void console.error("Set valid url for poster image config item => posterImage : ".concat(e," ")):null}},{key:"processVideoTitle",value:function(e,t){if(!e)return null;var i=void 0;return 1===t&&"object"===d(e)&&(e=e.title),e&&"string"==typeof e&&/[a-zA-Z]/.test(e)&&(i=e),i}},{key:"processAutoPlay",value:function(e,t){if(!e)return null;var i=!1;return 1===t||("string"==typeof e&&"true"===e&&(i=!0),"boolean"==typeof e&&e&&(i=!0)),i}},{key:"processPreload",value:function(e,t){if(!e)return null;if(1!==t){var i=function(e,t){return t.autoType=!0,void 0!==e.onload&&("string"==typeof e.onload&&"false"===e.onload&&(t.autoType=!1),"boolean"==typeof e.onload&&(e.onload||(t.autoType=!1))),t},r=function(e){return e.isActive=!0,e},n={start:0,stop:10,isActive:!1,autoType:!1};return"object"===d(e)?0!==Object.keys(e).length?n=r(n=i(e,n=function(e,t){if(e.start){var i=e.start;"string"==typeof i&&(i=parseFloat(i)),t.start=i,i||(t.start=0)}if(e.stop){var r=e.stop;"string"==typeof r&&(r=parseFloat(r)),t.stop=r,r||(t.stop=10)}return t}(e,n))):0===Object.keys(e).length&&(n=r(n=i(e,n))):"string"==typeof e&&"false"!==e?"true"===e&&(n=r(n=i(e,n))):"boolean"==typeof e&&!!e&&(n=r(n=i(e,n)))}}}]),e}();e.Processor=r}(ie||(ie={}));var ce=function(){function e(t){i(this,e),s(this,"configData",{version:null,preload:!1,autoPlay:!1,videoTitle:"",posterImage:"",videoParagraph:"",videoUrl:!1,playerId:"",playerContainer:"",vimeo:!1,youtube:{controls:0,noCookie:!1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,playsinline:!0},defaultConfig:!1,share:null,chapters:null,playerType:null,device:"desktop",observe:!1,videoObjectFit:!1}),s(this,"processor",void 0),this.processor=new ie.Map,this.setVersion(t),this.processor.setVersion(this.configData.version)}return n(e,[{key:"mapConfigData",value:function(e){var t=this;Object.keys(this.configData).forEach((function(i){if(1===t.processor.version){var r=t.processor.processItem(i,e);r&&(t.configData[i]=r)}else{var n,s=t.processor.processItem(i,null!==(n=e[i])&&void 0!==n?n:null);s&&(t.configData[i]=s)}}))}},{key:"setObjectFit",value:function(e,t){var i=this;return new Promise((function(r){if(e.isHTML5){var n=e.elements.wrapper.querySelector("video");n&&n.addEventListener("loadedmetadata",(function(e){var s=W.getVideoOrientation(n.videoWidth,n.videoHeight);i.configData.videoObjectFit=s===t?"cover":"clip",r(!0)}))}}))}},{key:"getObjectFit",value:function(){return this.configData.videoObjectFit}},{key:"setVersion",value:function(e){if("string"==typeof e)return this.configData.version=parseInt(e);this.configData.version=e}},{key:"getVersion",value:function(){return this.configData.version}},{key:"getObserve",value:function(){return this.configData.observe}},{key:"isObserveHeight",value:function(){return this.configData.observe.height}},{key:"isObserveWidth",value:function(){return this.configData.observe.width}},{key:"getDimensions",value:function(){return this.configData.dimensions}},{key:"getAdditionalInfo",value:function(){return this.configData.additionalInfo}},{key:"getVideoTitle",value:function(){return this.configData.videoTitle}},{key:"getPosterImage",value:function(){return this.configData.posterImage}},{key:"getParagraph",value:function(){return this.configData.videoParagraph}},{key:"getVideoType",value:function(){return this.configData.videoUrl.videoType}},{key:"getVideoUrl",value:function(){return this.configData.videoUrl}},{key:"getPlayerId",value:function(){return this.configData.playerId}},{key:"getConfigData",value:function(){return this.configData}},{key:"getPlayerElementContainer",value:function(){return this.configData.playerContainer}},{key:"getVideoOrigin",value:function(){return this.configData.videoUrl.origin}},{key:"getConfigByOrigin",value:function(e){return void 0!==this.configData[e]?this.configData[e]:null}},{key:"getDefaultConfigItems",value:function(){return this.configData.defaultConfig}},{key:"getChapters",value:function(){return this.configData.chapters}},{key:"isShareData",value:function(){return!!this.configData.share&&Object.keys(this.configData.share).length>0}},{key:"getShareData",value:function(){return this.configData.share}},{key:"getCaptions",value:function(){return this.configData.defaultConfig.captions}},{key:"getPlayerType",value:function(){return this.configData.playerType}},{key:"setPlayerId",value:function(e){this.configData.playerId=e}},{key:"isAutoPlay",value:function(){return this.configData.autoPlay}},{key:"getPreload",value:function(){return this.configData.preload}},{key:"isAutoPreload",value:function(){return this.configData.preload.autoType}},{key:"getDevice",value:function(){return this.configData.device}},{key:"getEmbedOrigin",value:function(){return s({},this.getVideoOrigin(),this.getConfigByOrigin(this.getVideoOrigin()))}},{key:"getFullscreenMode",value:function(){return{fullscreen:{enabled:!0}}}}]),e}(),ue=__webpack_require__(1443),de=__webpack_require__.n(ue),he=(__webpack_require__(840),function(){function e(){i(this,e),s(this,"player",void 0),s(this,"plyr",void 0),s(this,"preloadPoster",{ready:function(e){var t=e.playerConfig.getPreload();J.preloadEvents.removePosterImage(e),t.autoType&&(e.plyr.isEmbed&&J.preloadEvents.embedPlay(e,"event"),e.plyr.isHTML5&&J.preloadEvents.html5Play(e,"event"))},timeUpdate:function(e,t){J.preloadEvents.stop(e,t)}})}return n(e,[{key:"playerPlay",value:function(){var e=this.player;this.plyr.on("play",(function(t){e.desktopEvents.playPause(t),e.additionalInfoService&&e.additionalInfoService.setCurrentPlayerPlay(e,t)}))}},{key:"setDefaultSettingsConfig",value:function(){var e=this.player;e.plyr.speed=1,e.plyr.toggleCaptions(!1)}},{key:"removeDesktopPlyrEvents",value:function(){this.plyr.eventListeners.forEach((function(e){"dblclick"===e.type&&e.element.removeEventListener(e.type,e.callback,e.options)}))}},{key:"removeMobilePlyrEvents",value:function(){var e=this.plyr,t=this.player;e.eventListeners.forEach((function(e){if("mobile"===t.playerConfig.getDevice()){var i=function(){e.element.classList.contains("plyr__progress")||e.element.classList.contains("plyr__progress__seek")||e.element.removeEventListener(e.type,e.callback,e.options),0===e.element.classList.length&&e.element.removeEventListener(e.type,e.callback,e.options)};"touchstart"===e.type&&i(),"touchend"===e.type&&i(),"touchmove"===e.type&&i(),"mousemove"===e.type&&i(),"click"===e.type&&e.element.removeEventListener(e.type,e.callback,e.options)}}))}},{key:"onReadyPlayer",value:function(){if(this.player.playerConfig.getShareData()&&("mobile"===this.player.playerConfig.getDevice()?this.player.share.events.mobile.init():this.player.share.events.desktop.init()),this.player.posterManager.mobileEvents.onload(this.player),this.player.playerConfig.isAutoPlay()){var e=this.player.plyr.elements.container,t=function(){e.querySelector(".lt-player__poster").classList.add("d-none"),e.querySelector(".plyr__controls").classList.remove("d-none")};this.player.plyr.embed?(t(),e.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",X.getSpinner()),this.player.plyr.embed.play().then((function(){X.removeSpinner(e)})),X.removeSpinner(e)):(this.player.plyr.play(),t())}}},{key:"endVideo",value:function(){this.player.desktopEvents.endVideo(this.player)}},{key:"timeUpdate",value:function(e){this.player.playerControl.chaptersService&&this.player.playerControl.chaptersService.updateCurrentTimeAndTitle(this.player,e)}}]),e}());var pe=function(e){u(a,e);var t,r,s=(t=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=p(t);if(r){var n=p(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return h(this,e)});function a(){return i(this,a),s.apply(this,arguments)}return n(a,[{key:"setup",value:function(e){this.player=e.player,this.plyr=e.plyr,this.playerPlay(),this.removeDesktopPlyrEvents(),this.plyrOnReady(),this.plyrEmbedOnReady(),this.plyrEndVideo(),this.plyrFullScreen(),this.plyrTimeUpdate(),this.plyrOnPlay(),this.plyrOnPause(),this.plyrOnSeek()}},{key:"plyrOnSeek",value:function(){var e=this.player,t=this.plyr;t.on("seeked",(function(){if(t.isEmbed){if(t.paused)return;e.plyr.elements.container.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",X.getSpinner())}}))}},{key:"plyrOnReady",value:function(){var e=this,t=this.player;this.plyr.on("ready",(function(){t.playerConfig.getPlayerId()||(t.playerConfig.setPlayerId(t.plyr.id),t.playerId=t.playerConfig.getPlayerId()),e.setDefaultSettingsConfig(),t.plyr.isHTML5&&(t.hls&&t.hls.init(),e.onReadyPlayer(),e.modal(t),t.posterManager.desktopEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)),t.playerControl.desktopEvents.showHide(t),t.playerControl.desktopEvents.fullScreenButtons(t),t.playerControl.desktopEvents.playPauseIcon(t,"ready"),t.playerControl.desktopEvents.backwardForward(t),t.playerControl.desktopEvents.backwardForwardSeconds(t),t.playerControl.desktopEvents.volume(t),t.playerControl.settingsControlsManager.init(t),t.playerControl.chaptersService&&t.playerControl.chaptersService.setButtonsEvents(t)}))}},{key:"modal",value:function(e){window.addEventListener("click",(function(t){e.additionalInfoService&&e.additionalInfoService.desktopEvents.windowDesktopEvents(t,e),M.closeSettingsEvent(t)}))}},{key:"plyrEmbedOnReady",value:function(){var e=this,t=this.player,i=this.plyr;i.isEmbed&&i.on("ready",(function(){i.embed.ready().then((function(){e.modal(t),e.onReadyPlayer(),t.posterManager.desktopEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)}))}))}},{key:"plyrEndVideo",value:function(){var e=this;this.plyr.on("ended",(function(){e.endVideo()}))}},{key:"plyrFullScreen",value:function(){var e=this.player,t=this.plyr;t.on("enterfullscreen",(function(t){t.target.closest(".lt-player").classList.add("is-fullscreen"),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"enterfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"enterfullscreen"),e.videoService.removeObjectFit()})),t.on("exitfullscreen",(function(t){t.target.closest(".lt-player").classList.remove("is-fullscreen"),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"exitfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"exitfullscreen"),e.videoService.appendObjectFit()}))}},{key:"plyrTimeUpdate",value:function(){var e=this,t=this.player,i=this.plyr;i.on("timeupdate",(function(r){e.timeUpdate(r),t.playerConfig.getPreload().isActive&&e.preloadPoster.timeUpdate(t,"event"),X.removeSpinner(i.elements.container),t.playerControl.desktopEvents.playPauseIcon(t,"timeupdate")}))}},{key:"plyrOnPlay",value:function(){var e=this.player,t=this.plyr;t.on("play",(function(i){X.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnPause",value:function(){var e=this.player,t=this.plyr;t.on("pause",(function(i){X.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}}]),a}(he);var fe,ge=function(e){u(o,e);var t,r,a=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=p(t);if(r){var n=p(this).constructor;e=Reflect.construct(i,arguments,n)}else e=i.apply(this,arguments);return h(this,e)});function o(){var e;i(this,o);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return s(l(e=a.call.apply(a,[this].concat(r))),"setMobileEvent",(function(t){if("mobile"===l(e).player.playerConfig.getDevice()){var i=new Hammer.Manager(t);return i.add(new Hammer.Pan({direction:30})),i.add(new Hammer.Tap({event:"tripletap",taps:3})),i.add(new Hammer.Tap({event:"doubletap",taps:2})),i.add(new Hammer.Tap({event:"singletap"})),i.get("doubletap").recognizeWith("singletap"),i.get("singletap").requireFailure("doubletap"),i.get("tripletap").recognizeWith("doubletap"),i.get("doubletap").requireFailure("tripletap"),i.get("pan").set({direction:Hammer.DIRECTION_DOWN}),i}})),e}return n(o,[{key:"setup",value:function(e){this.player=e.player,this.plyr=e.plyr,this.playerPlay(),this.removeMobilePlyrEvents(),this.plyrOnReady(),this.plyrEmbedOnReady(),this.plyrEndVideo(),this.plyrFullScreen(),this.plyrTimeUpdate(),this.plyrOnPlay(),this.plyrOnPause(),this.plyrOnSeek()}},{key:"plyrOnSeek",value:function(){var e=this.player,t=this.plyr;t.on("seeked",(function(){if(t.isEmbed){if(t.paused)return;e.plyr.elements.container.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",X.getSpinner())}}))}},{key:"plyrOnReady",value:function(){var e=this,t=this.player;this.plyr.on("ready",(function(){t.playerConfig.getPlayerId()||(t.playerConfig.setPlayerId(t.plyr.id),t.playerId=t.playerConfig.getPlayerId()),e.setDefaultSettingsConfig(),t.plyr.isHTML5&&(t.hls&&t.hls.init(),e.onReadyPlayer(),t.posterManager.mobileEvents.posterBody(t),t.playerControl.mobileEvents.seekBar(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)),t.posterManager.mobileEvents.showControls(t),t.playerControl.mobileEvents.controlsTimeShow(t),t.playerControl.mobileEvents.fullScreenButtons(t),t.playerControl.mobileEvents.playPauseIcon(t,"ready"),t.playerControl.mobileEvents.backwardForward(t),t.playerControl.mobileEvents.backwardForwardSeconds(t),t.playerControl.mobileEvents.volume(t),t.playerControl.settingsControlsManager.init(t),t.playerControl.chaptersService&&t.playerControl.chaptersService.setMobileButtonEvents(t)}))}},{key:"plyrEmbedOnReady",value:function(){var e=this,t=this.player,i=this.plyr;i.isEmbed&&i.on("ready",(function(){i.embed.ready().then((function(){e.onReadyPlayer(),t.playerControl.mobileEvents.seekBar(t),t.posterManager.mobileEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)}))}))}},{key:"plyrEndVideo",value:function(){var e=this;this.plyr.on("ended",(function(){e.endVideo()}))}},{key:"plyrFullScreen",value:function(){var e=this.player,t=this.plyr;t.on("enterfullscreen",(function(t){t.target.closest(".lt-player").classList.add("is-fullscreen"),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"enterfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"enterfullscreen"),e.videoService.removeObjectFit()})),t.on("exitfullscreen",(function(t){t.target.closest(".lt-player").classList.remove("is-fullscreen"),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"exitfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"exitfullscreen"),e.videoService.appendObjectFit()}))}},{key:"plyrTimeUpdate",value:function(){var e=this,t=this.player,i=this.plyr;i.on("timeupdate",(function(r){t.playerConfig.getPreload().isActive&&e.preloadPoster.timeUpdate(t,"event"),X.removeSpinner(i.elements.container),e.timeUpdate(r),t.playerControl.desktopEvents.playPauseIcon(t,"timeupdate"),t.playerControl.mobileEvents.removePlyrControlsClass(t)}))}},{key:"plyrOnPlay",value:function(){var e=this.player,t=this.plyr;t.on("play",(function(i){X.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnPause",value:function(){var e=this.player,t=this.plyr;t.on("pause",(function(i){X.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}}]),o}(he),ye=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"plyr",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.player=t,this.plyr=t.plyr,this.setup()}return n(e,[{key:"setup",value:function(){"mobile"===this.player.playerConfig.getDevice()?(this.mobileEvents=new ge,this.mobileEvents.setup(this)):(this.desktopEvents=new pe,this.desktopEvents.setup(this))}}]),e}();function me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e){var t=function(){function e(){i(this,e)}return n(e,[{key:"playPause",value:function(e){var t=window.Player.players,i=e.detail.plyr;t.forEach((function(e){e.plyr!=i&&(e.plyr.pause(),e.plyr.on("ready",(function(){var t=e.plyr.elements.container,i=t.querySelector(".lt-player-mini-player-controls");i&&i.remove();var r=t.querySelector(".lt-player-mini-player-background");r&&r.remove();var n=t.querySelector(".lt-player-mini-enable"),s=t.querySelector(".lt-player-mini-".concat(e.playerConfig.getPlayerType()));n&&n.classList.remove("lt-player-mini-enable"),s&&s.classList.remove(".lt-player-mini-".concat(e.playerConfig.getPlayerType()))})))}))}},{key:"endVideo",value:function(e){var t,i,r,n,s=e.plyr,a=s.elements.container;t=a.querySelector(".lt-player__poster"),i=a.querySelector(".plyr__controls"),r=a.querySelector(".lt-player__poster__image-body"),a.classList.add("plyr--stopped"),t.classList.remove("d-none"),i.classList.add("d-none"),r&&r.classList.remove("lt-player__poster__image-body--preload"),s.poster||(s.poster=e.playerConfig.getPosterImage()),function(){var e=a.querySelector(".settings-controllers");if(e){if(e.classList.contains("settings-controllers-enable")){var t=a.querySelector(".settings-controllers");s.elements.controls.classList.remove("plyr__controls-enable-settings"),t.classList.remove("settings-controllers-enable");var i=document.querySelector(".settings-controllers-enable__background");i.classList.contains("d-none")||i.classList.add("d-none")}}else{var r=document.querySelector(".lt-player-mobile-settings-modal");r&&r.remove()}}(),(n={controls:a.querySelector(".lt-player-mini-player-controls"),background:a.querySelector(".lt-player-mini-player-background"),enable:a.querySelector(".lt-player-mini-enable"),size:a.querySelector(".lt-player-mini-".concat(e.playerConfig.getPlayerType()))}).controls&&n.controls.remove(),n.background&&n.background.remove(),n.size&&n.size.classList.remove("lt-player-mini-".concat(e.playerConfig.getPlayerType())),n.enable&&n.enable.classList.remove("lt-player-mini-enable"),s.fullscreen.active&&s.fullscreen.exit(),function(){var e=s.elements.controls;e.classList.contains("plyr__controls-enable")&&e.classList.remove("plyr__controls-enable");var t=e.querySelector(".bottom-controller__volume_control"),i=t.querySelector(".button-open"),r=t.querySelector(".volume_control__background"),n=t.querySelector(".volume_control__background__area"),a=t.querySelector(".volume_control__background__area__range"),o=s.elements.container.querySelector(".plyr__controls__mobile-background");i&&i.classList.remove("d-none"),r&&r.classList.add("d-none"),n&&n.classList.add("d-none"),a&&a.classList.remove("volume-area-open"),t&&(t.classList.remove("volume-area-open"),t.classList.remove("volume-control-enable")),o&&(o.classList.contains("d-none")||o.classList.add("d-none"))}(),e.plyr.elements.container.classList.contains("plyr__poster-enabled")||e.plyr.elements.container.classList.add("plyr__poster-enabled")}}]),e}();e.Desktop=t;var r=n((function e(){i(this,e)}));e.Mobile=r}(fe||(fe={}));var ve,Me,Te,Le,be,Ee={exports:{}};ve=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Me=/^(?=([^\/?#]*))\1([^]*)$/,Te=/(?:\/|^)\.(?=\/)/g,Le=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,Ee.exports=be={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=be.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=be.normalizePath(r.path),be.buildURLFromParts(r)}var n=be.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=be.normalizePath(n.path),be.buildURLFromParts(n)):t;var s=be.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var a=Me.exec(s.path);s.netLoc=a[1],s.path=a[2]}s.netLoc&&!s.path&&(s.path="/");var o={scheme:s.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(o.netLoc=s.netLoc,"/"!==n.path[0]))if(n.path){var l=s.path,c=l.substring(0,l.lastIndexOf("/")+1)+n.path;o.path=be.normalizePath(c)}else o.path=s.path,n.params||(o.params=s.params,n.query||(o.query=s.query));return null===o.path&&(o.path=i.alwaysNormalize?be.normalizePath(n.path):n.path),be.buildURLFromParts(o)},parseURL:function(e){var t=ve.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(Te,"");e.length!==(e=e.replace(Le,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};var Ie=Ee.exports;function Ne(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function we(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ne(Object(i),!0).forEach((function(t){Se(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ne(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Se(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},Ae.apply(this,arguments)}const De=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)};let Ce=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e}({}),ke=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),je=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({});const xe=function(){},_e={trace:xe,debug:xe,log:xe,warn:xe,info:xe,error:xe};let Oe=_e;const Pe=Oe,Re=/^(\d+)x(\d+)$/,ze=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Fe{constructor(e){"string"==typeof e&&(e=Fe.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&("X-"===t.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const i=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)i[e]=parseInt(t.slice(2*e,2*e+2),16);return i}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=Re.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const i={};for(ze.lastIndex=0;null!==(t=ze.exec(e));){let e=t[2];0===e.indexOf('"')&&e.lastIndexOf('"')===e.length-1&&(e=e.slice(1,-1)),i[t[1].trim()]=e}return i}}function Ue(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class Ye{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const i=t.attr;for(const t in i)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==i[t]){Pe.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=Ae(new Fe({}),i,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);De(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(De(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&De(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Be{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var $e="audio",Ge="video",Qe="audiovideo";class He{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[$e]:null,[Ge]:null,[Qe]:null},this.baseurl=e}setByteRange(e,t){const i=e.split("@",2),r=[];1===i.length?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Ie.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class qe extends He{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Be,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!De(this.programDateTime))return null;const e=De(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,i,r,n,s=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,n)):a[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:n,partial:s}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e.audio=null,e.video=null,e.audiovideo=null}}class We extends He{constructor(e,t,i,r,n){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Be,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=r;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,n),n&&(this.fragOffset=n.fragOffset+n.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}class Ze{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&De(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Ve(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function Ke(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}var Xe={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Je="org.w3.clearkey",et="com.apple.streamingkeydelivery",tt="com.microsoft.playready",it="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function rt(e){switch(e){case et:return Xe.FAIRPLAY;case tt:return Xe.PLAYREADY;case it:return Xe.WIDEVINE;case Je:return Xe.CLEARKEY}}var nt="edef8ba979d64acea3c827dcd51d21ed";function st(e){switch(e){case Xe.FAIRPLAY:return et;case Xe.PLAYREADY:return tt;case Xe.WIDEVINE:return it;case Xe.CLEARKEY:return Je}}function at(e){const{drmSystems:t,widevineLicenseUrl:i}=e,r=t?[Xe.FAIRPLAY,Xe.WIDEVINE,Xe.PLAYREADY,Xe.CLEARKEY].filter((e=>!!t[e])):[];return!r[Xe.WIDEVINE]&&i&&r.push(Xe.WIDEVINE),r}const ot="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function lt(e,t,i){return Uint8Array.prototype.slice?e.slice(t,i):new Uint8Array(Array.prototype.slice.call(e,t,i))}const ct=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,ut=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,dt=(e,t)=>{const i=t;let r=0;for(;ct(e,t);)r+=10,r+=ht(e,t+6),ut(e,t+10)&&(r+=10),t+=r;if(r>0)return e.subarray(i,i+r)},ht=(e,t)=>{let i=0;return i=(127&e[t])<<21,i|=(127&e[t+1])<<14,i|=(127&e[t+2])<<7,i|=127&e[t+3],i},pt=(e,t)=>ct(e,t)&&ht(e,t+6)+10<=e.length-t,ft=e=>e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,gt=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),i=ht(e,4);return{type:t,size:i,data:e.subarray(10,10+i)}},yt=e=>{let t=0;const i=[];for(;ct(e,t);){const r=ht(e,t+6);t+=10;const n=t+r;for(;t+8<n;){const r=gt(e.subarray(t)),n=mt(r);n&&i.push(n),t+=r.size+10}ut(e,t)&&(t+=10)}return i},mt=e=>"PRIV"===e.type?vt(e):"W"===e.type[0]?Tt(e):Mt(e),vt=e=>{if(e.size<2)return;const t=bt(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}},Mt=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const i=bt(e.data.subarray(t),!0);t+=i.length+1;const r=bt(e.data.subarray(t));return{key:e.type,info:i,data:r}}const t=bt(e.data.subarray(1));return{key:e.type,data:t}},Tt=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const i=bt(e.data.subarray(t),!0);t+=i.length+1;const r=bt(e.data.subarray(t));return{key:e.type,info:i,data:r}}const t=bt(e.data);return{key:e.type,data:t}},Lt=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),i=1&t[3];let r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},bt=(e,t=!1)=>{const i=It();if(i){const r=i.decode(e);if(t){const e=r.indexOf("\0");return-1!==e?r.substring(0,e):r}return r.replace(/\0/g,"")}const r=e.length;let n,s,a,o="",l=0;for(;l<r;){if(n=e[l++],0===n&&t)return o;if(0!==n&&3!==n)switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(n);break;case 12:case 13:s=e[l++],o+=String.fromCharCode((31&n)<<6|63&s);break;case 14:s=e[l++],a=e[l++],o+=String.fromCharCode((15&n)<<12|(63&s)<<6|(63&a)<<0)}}return o};let Et;function It(){return Et||void 0===self.TextDecoder||(Et=new self.TextDecoder("utf-8")),Et}const Nt=function(e){let t="";for(let i=0;i<e.length;i++){let r=e[i].toString(16);r.length<2&&(r="0"+r),t+=r}return t},wt=Math.pow(2,32)-1,St=[].push,At={video:1,audio:2,id3:3,text:4};function Dt(e){return String.fromCharCode.apply(null,e)}function Ct(e,t){const i=e[t]<<8|e[t+1];return i<0?65536+i:i}function kt(e,t){const i=jt(e,t);return i<0?4294967296+i:i}function jt(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function xt(e,t,i){e[t]=i>>24,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function _t(e,t){const i=[];if(!t.length)return i;const r=e.byteLength;for(let n=0;n<r;){const s=kt(e,n),a=s>1?n+s:r;if(Dt(e.subarray(n+4,n+8))===t[0])if(1===t.length)i.push(e.subarray(n+8,a));else{const r=_t(e.subarray(n+8,a),t.slice(1));r.length&&St.apply(i,r)}n=a}return i}function Ot(e){const t=[],i=e[0];let r=8;const n=kt(e,r);r+=4,r+=0===i?8:16,r+=2;let s=e.length+0;const a=Ct(e,r);r+=2;for(let i=0;i<a;i++){let i=r;const a=kt(e,i);i+=4;const o=2147483647&a;if(1==(2147483648&a)>>>31)return Pe.warn("SIDX has hierarchical references (not supported)"),null;const l=kt(e,i);i+=4,t.push({referenceSize:o,subsegmentDuration:l,info:{duration:l/n,start:s,end:s+o-1}}),s+=o,i+=4,r=i}return{earliestPresentationTime:0,timescale:n,version:i,referencesCount:a,references:t}}function Pt(e){const t=[],i=_t(e,["moov","trak"]);for(let e=0;e<i.length;e++){const r=i[e],n=_t(r,["tkhd"])[0];if(n){let e=n[0],i=0===e?12:20;const s=kt(n,i),a=_t(r,["mdia","mdhd"])[0];if(a){e=a[0],i=0===e?12:20;const n=kt(a,i),o=_t(r,["mdia","hdlr"])[0];if(o){const e=Dt(o.subarray(8,12)),i={soun:$e,vide:Ge}[e];if(i){const e=_t(r,["mdia","minf","stbl","stsd"])[0];let a;e&&(a=Dt(e.subarray(12,16))),t[s]={timescale:n,type:i},t[i]={timescale:n,id:s,codec:a}}}}}}return _t(e,["moov","mvex","trex"]).forEach((e=>{const i=kt(e,4),r=t[i];r&&(r.default={duration:kt(e,12),flags:kt(e,20)})})),t}function Rt(e){const t=_t(e,["schm"])[0];if(t){const i=Dt(t.subarray(4,8));if("cbcs"===i||"cenc"===i)return _t(e,["schi","tenc"])[0]}return Pe.error("[eme] missing 'schm' box"),null}function zt(e){const t=kt(e,0);let i=8;1&t&&(i+=4),4&t&&(i+=4);let r=0;const n=kt(e,4);for(let s=0;s<n;s++)256&t&&(r+=kt(e,i),i+=4),512&t&&(i+=4),1024&t&&(i+=4),2048&t&&(i+=4);return r}function Ft(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}function Ut(e,t){const i=[],r=t.samples,n=t.timescale,s=t.id;let a=!1;return _t(r,["moof"]).map((o=>{const l=o.byteOffset-8;_t(o,["traf"]).map((o=>{const c=_t(o,["tfdt"]).map((e=>{const t=e[0];let i=kt(e,4);return 1===t&&(i*=Math.pow(2,32),i+=kt(e,8)),i/n}))[0];return void 0!==c&&(e=c),_t(o,["tfhd"]).map((c=>{const u=kt(c,4),d=16777215&kt(c,0);let h=0;const p=0!=(16&d);let f=0;const g=0!=(32&d);let y=8;u===s&&(0!=(1&d)&&(y+=8),0!=(2&d)&&(y+=4),0!=(8&d)&&(h=kt(c,y),y+=4),p&&(f=kt(c,y),y+=4),g&&(y+=4),"video"===t.type&&(a=function(e){if(!e)return!1;const t=e.indexOf("."),i=t<0?e:e.substring(0,t);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(t.codec)),_t(o,["trun"]).map((s=>{const o=s[0],c=16777215&kt(s,0),u=0!=(1&c);let d=0;const p=0!=(4&c),g=0!=(256&c);let y=0;const m=0!=(512&c);let v=0;const M=0!=(1024&c),T=0!=(2048&c);let L=0;const b=kt(s,4);let E=8;u&&(d=kt(s,E),E+=4),p&&(E+=4);let I=d+l;for(let l=0;l<b;l++){if(g?(y=kt(s,E),E+=4):y=h,m?(v=kt(s,E),E+=4):v=f,M&&(E+=4),T&&(L=0===o?kt(s,E):jt(s,E),E+=4),t.type===Ge){let t=0;for(;t<v;){const s=kt(r,I);I+=4,Yt(a,r[I])&&Bt(r.subarray(I,I+s),a?2:1,e+L/n,i),I+=s,t+=s+4}}e+=y/n}})))}))}))})),i}function Yt(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6==(31&t)}function Bt(e,t,i,r){const n=$t(e);let s=0;s+=t;let a=0,o=0,l=!1,c=0;for(;s<n.length;){a=0;do{if(s>=n.length)break;c=n[s++],a+=c}while(255===c);o=0;do{if(s>=n.length)break;c=n[s++],o+=c}while(255===c);const e=n.length-s;if(!l&&4===a&&s<n.length){if(l=!0,181===n[s++]){const e=Ct(n,s);if(s+=2,49===e){const e=kt(n,s);if(s+=4,1195456820===e){const e=n[s++];if(3===e){const t=n[s++],o=31&t,l=64&t,c=l?2+3*o:0,u=new Uint8Array(c);if(l){u[0]=t;for(let e=1;e<c;e++)u[e]=n[s++]}r.push({type:e,payloadType:a,pts:i,bytes:u})}}}}}else if(5===a&&o<e){if(l=!0,o>16){const e=[];for(let t=0;t<16;t++){const i=n[s++].toString(16);e.push(1==i.length?"0"+i:i),3!==t&&5!==t&&7!==t&&9!==t||e.push("-")}const t=o-16,l=new Uint8Array(t);for(let e=0;e<t;e++)l[e]=n[s++];r.push({payloadType:a,pts:i,uuid:e.join(""),userData:bt(l),userDataBytes:l})}}else if(o<e)s+=o;else if(o>e)break}}function $t(e){const t=e.byteLength,i=[];let r=1;for(;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return e;const n=t-i.length,s=new Uint8Array(n);let a=0;for(r=0;r<n;a++,r++)a===i[0]&&(a++,i.shift()),s[r]=e[a];return s}let Gt={};class Qt{static clearKeyUriToKeyIdMap(){Gt={}}constructor(e,t,i,r=[1],n=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=r,this.iv=n,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&"AES-128"!==e}isSupported(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case et:case it:case tt:case Je:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof e&&("AES-128"!==this.method||this.iv||Pe.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const t=function(e){const t=new Uint8Array(16);for(let i=12;i<16;i++)t[i]=e>>8*(15-i)&255;return t}(e);return new Qt(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=function(e){const t=e.split(":");let i=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),r=e[e.length-1].split(",");if(2===r.length){const t="base64"===r[0],n=r[1];t?(e.splice(-1,1),i=Ve(n)):i=function(e){const t=Ke(e).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}(n)}}return i}(this.uri);if(t)switch(this.keyFormat){case it:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case tt:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=function(e,t,i){if(16!==e.byteLength)throw new RangeError("Invalid system id");let r,n,s;if(t){r=1,n=new Uint8Array(16*t.length);for(let e=0;e<t.length;e++){const i=t[e];if(16!==i.byteLength)throw new RangeError("Invalid key");n.set(i,16*e)}}else r=0,n=new Uint8Array;r>0?(s=new Uint8Array(4),t.length>0&&new DataView(s.buffer).setUint32(0,t.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(a.buffer).setUint32(0,i.byteLength,!1),function(e,...t){const i=t.length;let r=8,n=i;for(;n--;)r+=t[n].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=255&r,s.set(e,4),n=0,r=8;n<i;n++)s.set(t[n],r),r+=t[n].byteLength;return s}([112,115,115,104],new Uint8Array([r,0,0,0]),e,s,n,a,i||new Uint8Array)}(e,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),r=String.fromCharCode.apply(null,Array.from(i)),n=r.substring(r.indexOf("<"),r.length),s=(new DOMParser).parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(s){const e=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(e){const t=Ve(e).subarray(0,16);!function(e){const t=function(e,t,i){const r=e[t];e[t]=e[i],e[i]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Gt[this.uri];if(!e){const t=Object.keys(Gt).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16),new DataView(e.buffer,12,4).setUint32(0,t),Gt[this.uri]=e}this.keyId=e}return this}}const Ht=/\{\$([a-zA-Z0-9-_]+)\}/g;function qt(e){return Ht.test(e)}function Wt(e,t,i){if(null!==e.variableList||e.hasVariableRefs)for(let r=i.length;r--;){const n=i[r],s=t[n];s&&(t[n]=Zt(e,s))}}function Zt(e,t){if(null!==e.variableList||e.hasVariableRefs){const i=e.variableList;return t.replace(Ht,(t=>{const r=t.substring(2,t.length-1),n=null==i?void 0:i[r];return void 0===n?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),t):n}))}return t}function Vt(e,t,i){let r,n,s=e.variableList;if(s||(e.variableList=s={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{const e=new self.URL(i).searchParams;if(!e.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${i}"`);n=e.get(r)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else r=t.NAME,n=t.VALUE;r in s?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):s[r]=n||""}function Kt(e,t,i){const r=t.IMPORT;if(i&&r in i){let t=e.variableList;t||(e.variableList=t={}),t[r]=i[r]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const Xt={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function Jt(e,t){return MediaSource.isTypeSupported(`${t||"video"}/mp4;codecs="${e}"`)}const ei=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,ti=/#EXT-X-MEDIA:(.*)/g,ii=/^#EXT(?:INF|-X-TARGETDURATION):/m,ri=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ni=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class si{static findGroup(e,t){for(let i=0;i<e.length;i++){const r=e[i];if(r.id===t)return r}}static convertAVC1ToAVCOTI(e){const t=e.split(".");if(t.length>2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}static resolve(e,t){return Ie.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return ii.test(e)}static parseMasterPlaylist(e,t){const i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:qt(e)},r=[];let n;for(ei.lastIndex=0;null!=(n=ei.exec(e));)if(n[1]){var s;const e=new Fe(n[1]);Wt(i,e,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const a=Zt(i,n[2]),o={attrs:e,bitrate:e.decimalInteger("AVERAGE-BANDWIDTH")||e.decimalInteger("BANDWIDTH"),name:e.NAME,url:si.resolve(a,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),li((e.CODECS||"").split(/[ ,]+/).filter((e=>e)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=si.convertAVC1ToAVCOTI(o.videoCodec)),null!=(s=o.unknownCodecs)&&s.length||r.push(o),i.levels.push(o)}else if(n[3]){const e=n[3],r=n[4];switch(e){case"SESSION-DATA":{const e=new Fe(r);Wt(i,e,["DATA-ID","LANGUAGE","VALUE","URI"]);const t=e["DATA-ID"];t&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[t]=e);break}case"SESSION-KEY":{const e=ai(r,t,i);e.encrypted&&e.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(e)):Pe.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":{const e=new Fe(r);Wt(i,e,["NAME","VALUE","QUERYPARAM"]),Vt(i,e,t)}break;case"CONTENT-STEERING":{const e=new Fe(r);Wt(i,e,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:si.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=oi(r)}}const a=r.length>0&&r.length<i.levels.length;return i.levels=a?r:i.levels,0===i.levels.length&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,i){let r;const n={},s=i.levels,a={AUDIO:s.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:s.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(ti.lastIndex=0;null!==(r=ti.exec(e));){const e=new Fe(r[1]),s=e.TYPE;if(s){const r=a[s],l=n[s]||[];n[s]=l,Wt(i,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const c={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:s,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?si.resolve(e.URI,t):""};if(null!=r&&r.length){const e=si.findGroup(r,c.groupId)||r[0];ci(c,e,"audioCodec"),ci(c,e,"textCodec")}l.push(c)}}return n}static parseLevelPlaylist(e,t,i,r,n,s){const a=new Ze(t),o=a.fragments;let l,c,u,d=null,h=0,p=0,f=0,g=0,y=null,m=new qe(r,t),v=-1,M=!1;for(ri.lastIndex=0,a.m3u8=e,a.hasVariableRefs=qt(e);null!==(l=ri.exec(e));){M&&(M=!1,m=new qe(r,t),m.start=f,m.sn=h,m.cc=g,m.level=i,d&&(m.initSegment=d,m.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null));const e=l[1];if(e){m.duration=parseFloat(e);const t=(" "+l[2]).slice(1);m.title=t||null,m.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(De(m.duration)){m.start=f,u&&hi(m,u,a),m.sn=h,m.level=i,m.cc=g,m.urlId=n,o.push(m);const e=(" "+l[3]).slice(1);m.relurl=Zt(a,e),ui(m,y),y=m,f+=m.duration,h++,p=0,M=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);y?m.setByteRange(e,y):m.setByteRange(e)}else if(l[5])m.rawProgramDateTime=(" "+l[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),-1===v&&(v=o.length);else{if(l=l[0].match(ni),!l){Pe.warn("No matches on slow regex match for level playlist!");continue}for(c=1;c<l.length&&void 0===l[c];c++);const e=(" "+l[c]).slice(1),n=(" "+l[c+1]).slice(1),f=l[c+2]?(" "+l[c+2]).slice(1):"";switch(e){case"PLAYLIST-TYPE":a.type=n.toUpperCase();break;case"MEDIA-SEQUENCE":h=a.startSN=parseInt(n);break;case"SKIP":{const e=new Fe(n);Wt(a,e,["RECENTLY-REMOVED-DATERANGES"]);const t=e.decimalInteger("SKIPPED-SEGMENTS");if(De(t)){a.skippedSegments=t;for(let e=t;e--;)o.unshift(null);h+=t}const i=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");i&&(a.recentlyRemovedDateranges=i.split("\t"));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(n),1);break;case"VERSION":a.version=parseInt(n);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(n||f)&&m.tagList.push(f?[n,f]:[n]);break;case"DISCONTINUITY":g++,m.tagList.push(["DIS"]);break;case"GAP":m.gap=!0,m.tagList.push([e]);break;case"BITRATE":m.tagList.push([e,n]);break;case"DATERANGE":{const e=new Fe(n);Wt(a,e,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Wt(a,e,e.clientAttrs);const t=new Ye(e,a.dateRanges[e.ID]);t.isValid||a.skippedSegments?a.dateRanges[t.id]=t:Pe.warn(`Ignoring invalid DATERANGE tag: "${n}"`),m.tagList.push(["EXT-X-DATERANGE",n]);break}case"DEFINE":{const e=new Fe(n);Wt(a,e,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in e?Kt(a,e,s):Vt(a,e,t)}break;case"DISCONTINUITY-SEQUENCE":g=parseInt(n);break;case"KEY":{const e=ai(n,t,a);if(e.isSupported()){if("NONE"===e.method){u=void 0;break}u||(u={}),u[e.keyFormat]&&(u=Ae({},u)),u[e.keyFormat]=e}else Pe.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${n}"`);break}case"START":a.startTimeOffset=oi(n);break;case"MAP":{const e=new Fe(n);if(Wt(a,e,["BYTERANGE","URI"]),m.duration){const n=new qe(r,t);di(n,e,i,u),d=n,m.initSegment=d,d.rawProgramDateTime&&!m.rawProgramDateTime&&(m.rawProgramDateTime=d.rawProgramDateTime)}else di(m,e,i,u),d=m,M=!0;break}case"SERVER-CONTROL":{const e=new Fe(n);a.canBlockReload=e.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=e.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&e.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),a.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new Fe(n);a.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=a.partList;e||(e=a.partList=[]);const i=p>0?e[e.length-1]:void 0,r=p++,s=new Fe(n);Wt(a,s,["BYTERANGE","URI"]);const o=new We(s,m,t,r,i);e.push(o),m.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new Fe(n);Wt(a,e,["URI"]),a.preloadHint=e;break}case"RENDITION-REPORT":{const e=new Fe(n);Wt(a,e,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(e);break}default:Pe.warn(`line parsed but not handled: ${l}`)}}}y&&!y.relurl?(o.pop(),f-=y.duration,a.partList&&(a.fragmentHint=y)):a.partList&&(ui(m,y),m.cc=g,a.fragmentHint=m,u&&hi(m,u,a));const T=o.length,L=o[0],b=o[T-1];if(f+=a.skippedSegments*a.targetduration,f>0&&T&&b){a.averagetargetduration=f/T;const e=b.sn;a.endSN="initSegment"!==e?e:0,a.live||(b.endList=!0),L&&(a.startCC=L.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(f+=a.fragmentHint.duration),a.totalduration=f,a.endCC=g,v>0&&function(e,t){let i=e[t];for(let r=t;r--;){const t=e[r];if(!t)return;t.programDateTime=i.programDateTime-1e3*t.duration,i=t}}(o,v),a}}function ai(e,t,i){var r,n;const s=new Fe(e);Wt(i,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=null!=(r=s.METHOD)?r:"",o=s.URI,l=s.hexadecimalInteger("IV"),c=s.KEYFORMATVERSIONS,u=null!=(n=s.KEYFORMAT)?n:"identity";o&&s.IV&&!l&&Pe.error(`Invalid IV: ${s.IV}`);const d=o?si.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Qt(a,d,u,h,l)}function oi(e){const t=new Fe(e).decimalFloatingPoint("TIME-OFFSET");return De(t)?t:null}function li(e,t){["video","audio","text"].forEach((i=>{const r=e.filter((e=>function(e,t){const i=Xt[t];return!!i&&!0===i[e.slice(0,4)]}(e,i)));if(r.length){const n=r.filter((e=>0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)));t[`${i}Codec`]=n.length>0?n[0]:r[0],e=e.filter((e=>-1===r.indexOf(e)))}})),t.unknownCodecs=e}function ci(e,t,i){const r=t[i];r&&(e[i]=r)}function ui(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),De(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function di(e,t,i,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=i,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function hi(e,t,i){e.levelkeys=t;const{encryptedFragments:r}=i;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||r.push(e)}var pi="manifest",fi="level",gi="audioTrack",yi="subtitleTrack",mi="main",vi="audio",Mi="subtitle";function Ti(e){const{type:t}=e;switch(t){case gi:return vi;case yi:return Mi;default:return mi}}function Li(e,t){let i=e.url;return void 0!==i&&0!==i.indexOf("data:")||(i=t.url),i}class bi{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.on(Ce.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(Ce.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.off(Ce.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(Ce.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,r=t.loader,n=new(i||r)(t);return this.loaders[e.type]=n,n}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:pi,url:i,deliveryDirectives:null})}onLevelLoading(e,t){const{id:i,level:r,url:n,deliveryDirectives:s}=t;this.load({id:i,level:r,responseType:"text",type:fi,url:n,deliveryDirectives:s})}onAudioTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:s}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:gi,url:n,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:i,groupId:r,url:n,deliveryDirectives:s}=t;this.load({id:i,groupId:r,level:null,responseType:"text",type:yi,url:n,deliveryDirectives:s})}load(e){var t;const i=this.hls.config;let r,n=this.getInternalLoader(e);if(n){const t=n.context;if(t&&t.url===e.url)return void Pe.trace("[playlist-loader]: playlist request ongoing");Pe.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),n.abort()}if(r=e.type===pi?i.manifestLoadPolicy.default:Ae({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),n=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part){let t;if(e.type===fi&&null!==e.level?t=this.hls.levels[e.level].details:e.type===gi&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===yi&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,i=t.targetduration;if(e&&i){const t=1e3*Math.max(3*e,.8*i);r=Ae({},r,{maxTimeToFirstByteMs:Math.min(t,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},a={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},o={onSuccess:(e,t,i,r)=>{const n=this.getInternalLoader(i);this.resetInternalLoader(i.type);const s=e.data;0===s.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),si.isMediaPlaylist(s)?this.handleTrackOrLevelPlaylist(e,t,i,r||null,n):this.handleMasterPlaylist(e,t,i,r)):this.handleManifestParsingError(e,i,new Error("no EXTM3U delimiter"),r||null,t)},onError:(e,t,i,r)=>{this.handleNetworkError(t,i,!1,e,r)},onTimeout:(e,t,i)=>{this.handleNetworkError(t,i,!0,void 0,e)}};n.load(e,a,o)}handleMasterPlaylist(e,t,i,r){const n=this.hls,s=e.data,a=Li(e,i),o=si.parseMasterPlaylist(s,a);if(o.playlistParsingError)return void this.handleManifestParsingError(e,i,o.playlistParsingError,r,t);const{contentSteering:l,levels:c,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p}=o;this.variableList=p;const{AUDIO:f=[],SUBTITLES:g,"CLOSED-CAPTIONS":y}=si.parseMasterPlaylistMedia(s,a,o);f.length&&(f.some((e=>!e.url))||!c[0].audioCodec||c[0].attrs.AUDIO||(Pe.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Fe({}),bitrate:0,url:""}))),n.trigger(Ce.MANIFEST_LOADED,{levels:c,audioTracks:f,subtitles:g,captions:y,contentSteering:l,url:a,stats:t,networkDetails:r,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,t,i,r,n){const s=this.hls,{id:a,level:o,type:l}=i,c=Li(e,i),u=De(a)?a:0,d=De(o)?o:u,h=Ti(i),p=si.parseLevelPlaylist(e.data,c,d,h,u,this.variableList);if(l===pi){const e={attrs:new Fe({}),bitrate:0,details:p,name:"",url:c};s.trigger(Ce.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:c,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=p,this.handlePlaylistLoaded(p,e,t,i,r,n)}handleManifestParsingError(e,t,i,r,n){this.hls.trigger(Ce.ERROR,{type:ke.NETWORK_ERROR,details:je.MANIFEST_PARSING_ERROR,fatal:t.type===pi,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:n})}handleNetworkError(e,t,i=!1,r,n){let s=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${e.type}`;e.type===fi?s+=`: ${e.level} id: ${e.id}`:e.type!==gi&&e.type!==yi||(s+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(s);Pe.warn(`[playlist-loader]: ${s}`);let o=je.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case pi:o=i?je.MANIFEST_LOAD_TIMEOUT:je.MANIFEST_LOAD_ERROR,l=!0;break;case fi:o=i?je.LEVEL_LOAD_TIMEOUT:je.LEVEL_LOAD_ERROR,l=!1;break;case gi:o=i?je.AUDIO_TRACK_LOAD_TIMEOUT:je.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case yi:o=i?je.SUBTITLE_TRACK_LOAD_TIMEOUT:je.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(e.type);const u={type:ke.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:n};if(r){const i=(null==t?void 0:t.url)||e.url;u.response=we({url:i,data:void 0},r)}this.hls.trigger(Ce.ERROR,u)}handlePlaylistLoaded(e,t,i,r,n,s){const a=this.hls,{type:o,level:l,id:c,groupId:u,deliveryDirectives:d}=r,h=Li(t,r),p=Ti(r),f="number"==typeof r.level&&p===mi?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void a.trigger(Ce.ERROR,{type:ke.NETWORK_ERROR,details:je.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:e,reason:e.message,response:t,context:r,level:f,parent:p,networkDetails:n,stats:i})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g)a.trigger(Ce.ERROR,{type:ke.NETWORK_ERROR,details:je.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:r,level:f,parent:p,networkDetails:n,stats:i});else switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case pi:case fi:a.trigger(Ce.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:i,networkDetails:n,deliveryDirectives:d});break;case gi:a.trigger(Ce.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:n,deliveryDirectives:d});break;case yi:a.trigger(Ce.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:n,deliveryDirectives:d})}}}function Ei(e,t){let i;try{i=new Event("addtrack")}catch(e){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=e,t.dispatchEvent(i)}function Ii(e,t){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(i){Pe.debug(`[texttrack-utils]: ${i}`);const r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}"disabled"===i&&(e.mode=i)}function Ni(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let t=e.cues.length;t--;)e.removeCue(e.cues[t]);"disabled"===t&&(e.mode=t)}function wi(e,t,i,r){const n=e.mode;if("disabled"===n&&(e.mode="hidden"),e.cues&&e.cues.length>0){const n=function(e,t,i){const r=[],n=function(e,t){if(t<e[0].startTime)return 0;const i=e.length-1;if(t>e[i].endTime)return-1;let r=0,n=i;for(;r<=n;){const s=Math.floor((n+r)/2);if(t<e[s].startTime)n=s-1;else{if(!(t>e[s].startTime&&r<i))return s;r=s+1}}return e[r].startTime-t<t-e[n].startTime?r:n}(e,t);if(n>-1)for(let s=n,a=e.length;s<a;s++){const n=e[s];if(n.startTime>=t&&n.endTime<=i)r.push(n);else if(n.startTime>i)return r}return r}(e.cues,t,i);for(let t=0;t<n.length;t++)r&&!r(n[t])||e.removeCue(n[t])}"disabled"===n&&(e.mode=n)}var Si="org.id3",Ai="https://aomedia.org/emsg/ID3";function Di(){if("undefined"!=typeof self)return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const Ci=(()=>{const e=Di();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function ki(e,t){return e.getTime()/1e3-t}class ji{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Ce.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Ce.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Ni(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if("metadata"===i.kind&&"id3"===i.label)return Ei(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:r}}}=this;if(!i&&!r)return;const{samples:n}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=Di();for(let e=0;e<n.length;e++){const t=n[e].type;if(t===Ai&&!i||!r)continue;const a=yt(n[e].data);if(a){const i=n[e].pts;let r=i+n[e].duration;r>Ci&&(r=Ci),r-i<=0&&(r=i+.25);for(let e=0;e<a.length;e++){const n=a[e];if(!ft(n)){this.updateId3CueEnds(i);const e=new s(i,r,"");e.value=n,t&&(e.type=t),this.id3Track.addCue(e)}}}}}updateId3CueEnds(e){var t;const i=null==(t=this.id3Track)?void 0:t.cues;if(i)for(let t=i.length;t--;){const r=i[t];r.startTime<e&&r.endTime===Ci&&(r.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:r}){const{id3Track:n,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=s;if(n&&(a||o)){let e;e="audio"===r?e=>e.type===Si&&o:"video"===r?e=>e.type===Ai&&a:e=>e.type===Si&&o||e.type===Ai&&a,wi(n,t,i,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:r}=this,{dateRanges:n}=t,s=Object.keys(n);if(r){const e=Object.keys(i).filter((e=>!s.includes(e)));for(let t=e.length;t--;){const n=e[t];Object.keys(i[n].cues).forEach((e=>{r.removeCue(i[n].cues[e])})),delete i[n]}}const a=t.fragments[t.fragments.length-1];if(0===s.length||!De(null==a?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=a.programDateTime/1e3-a.start,l=Di();for(let e=0;e<s.length;e++){const t=s[e],r=n[t],a=i[t],d=(null==a?void 0:a.cues)||{};let h=(null==a?void 0:a.durationKnown)||!1;const p=ki(r.startDate,o);let f=Ci;const g=r.endDate;if(g)f=ki(g,o),h=!0;else if(r.endOnNext&&!h){const e=s.reduce(((e,t)=>{const i=n[t];return i.class===r.class&&i.id!==t&&i.startDate>r.startDate&&e.push(i),e}),[]).sort(((e,t)=>e.startDate.getTime()-t.startDate.getTime()))[0];e&&(f=ki(e.startDate,o),h=!0)}const y=Object.keys(r.attr);for(let e=0;e<y.length;e++){const i=y[e];if("ID"===(u=i)||"CLASS"===u||"START-DATE"===u||"DURATION"===u||"END-DATE"===u||"END-ON-NEXT"===u)continue;let n=d[i];if(n)h&&!a.durationKnown&&(n.endTime=f);else{let e=r.attr[i];n=new l(p,f,""),Ue(i)&&(c=e,e=Uint8Array.from(c.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),n.value={key:i,data:e},n.type="com.apple.quicktime.HLS",n.id=t,this.id3Track.addCue(n),d[i]=n}}i[t]={cues:d,dateRange:r,durationKnown:h}}var c,u}}class xi{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:i,targetduration:r}=e,{liveSyncDuration:n,liveSyncDurationCount:s,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&i||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==n?n:s*r);const c=r;return l+Math.min(1*this.stallCount,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(null===e||null===t||null===i)return null;const r=i.edge,n=e-t-this.edgeStalled,s=r-i.totalduration,a=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(s,n),a)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(Ce.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(Ce.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(Ce.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(Ce.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var i;t.details===je.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(i=this.levelDetails)&&i.live&&Pe.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(null===i)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:n}=this.config;if(!r||1===n)return;const s=this.targetLatency;if(null===s)return;const a=i-s,o=a<Math.min(this.maxLatency,s+t.targetduration);if(t.live&&o&&a>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,n)),i=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,i))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const _i=["NONE","TYPE-0","TYPE-1",null];class Oi{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Pi{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>e)).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}get textGroupId(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function Ri(e,t){const i=t.startPTS;if(De(i)){let r,n=0;t.sn>e.sn?(n=i-e.start,r=e):(n=e.start-i,r=t),r.duration!==n&&(r.duration=n)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function zi(e,t,i,r,n,s){r-i<=0&&(Pe.warn("Fragment should have a positive duration",t),r=i+t.duration,s=n+t.duration);let a=i,o=r;const l=t.startPTS,c=t.endPTS;if(De(l)){const e=Math.abs(l-i);De(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,a=Math.max(i,l),i=Math.min(i,l),n=Math.min(n,t.startDTS),o=Math.min(r,c),r=Math.max(r,c),s=Math.max(s,t.endDTS)}const u=i-t.start;0!==t.start&&(t.start=i),t.duration=r-t.start,t.startPTS=i,t.maxStartPTS=a,t.startDTS=n,t.endPTS=r,t.minEndPTS=o,t.endDTS=s;const d=t.sn;if(!e||d<e.startSN||d>e.endSN)return 0;let h;const p=d-e.startSN,f=e.fragments;for(f[p]=t,h=p;h>0;h--)Ri(f[h],f[h-1]);for(h=p;h<f.length-1;h++)Ri(f[h],f[h+1]);return e.fragmentHint&&Ri(f[f.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,u}function Fi(e,t){const i=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;i<0||i>=r.length||Ui(t,r[i].start)}function Ui(e,t){if(t){const i=e.fragments;for(let r=e.skippedSegments;r<i.length;r++)i[r].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function Yi(e,t,i){var r;return null!=e&&e.details?Bi(null==(r=e.details)?void 0:r.partList,t,i):null}function Bi(e,t,i){if(e)for(let r=e.length;r--;){const n=e[r];if(n.index===i&&n.fragment.sn===t)return n}return null}function $i(e){switch(e.details){case je.FRAG_LOAD_TIMEOUT:case je.KEY_LOAD_TIMEOUT:case je.LEVEL_LOAD_TIMEOUT:case je.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Gi(e,t){const i=$i(t);return e.default[(i?"timeout":"error")+"Retry"]}function Qi(e,t){const i="linear"===e.backoff?1:Math.pow(2,t);return Math.min(i*e.retryDelayMs,e.maxRetryDelayMs)}function Hi(e){return we(we({},e),{errorRetry:null,timeoutRetry:null})}function qi(e,t,i,r){return!!e&&t<e.maxNumRetry&&(function(e){return 0===e&&!1===navigator.onLine||!!e&&(e<400||e>499)}(r)||!!i)}const Wi=function(e,t){let i=0,r=e.length-1,n=null,s=null;for(;i<=r;){n=(i+r)/2|0,s=e[n];const a=t(s);if(a>0)i=n+1;else{if(!(a<0))return s;r=n-1}}return null};function Zi(e,t,i=0,r=0){let n=null;if(e?n=t[e.sn-t[0].sn+1]||null:0===i&&0===t[0].start&&(n=t[0]),n&&0===Vi(i,r,n))return n;const s=Wi(t,Vi.bind(null,i,r));return!s||s===e&&n?n:s}function Vi(e=0,t=0,i){if(i.start<=e&&i.start+i.duration>e)return 0;const r=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=e?1:i.start-r>e&&i.start?-1:0}function Ki(e,t,i){const r=1e3*Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>e}function Xi(e,t,i){if(performance.now()-e.lastErrorPerfMs>3e5)return!0;const r=e.details;if(t.details===je.FRAG_GAP&&r&&t.frag){const e=t.frag.start,i=Zi(null,r.fragments,e);if(i&&!i.gap)return!0}if(i&&e.errors.length<i.errors.length){const i=e.errors[e.errors.length-1];if(r&&i.frag&&t.frag&&Math.abs(i.frag.start-t.frag.start)>3*r.targetduration)return!0}return!1}class Ji{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=Pe.log.bind(Pe,`${t}:`),this.warn=Pe.warn.bind(Pe,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const i=null==t?void 0:t.renditionReports;if(i){let r=-1;for(let n=0;n<i.length;n++){const s=i[n];let a;try{a=new self.URL(s.URI,t.url).href}catch(e){Pe.warn(`Could not construct new URL for Rendition Report: ${e}`),a=s.URI||""}if(a===e){r=n;break}a===e.substring(0,a.length)&&(r=n)}if(-1!==r){const e=i[r],n=parseInt(e["LAST-MSN"])||(null==t?void 0:t.lastPartSn);let s=parseInt(e["LAST-PART"])||(null==t?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);s>=0&&e>t.partTarget&&(s+=1)}return new Oi(n,s>=0?s:void 0,"")}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,i){const{details:r,stats:n}=t,s=self.performance.now(),a=n.loading.first?Math.max(0,s-n.loading.first):0;if(r.advancedDateTime=Date.now()-a,r.live||null!=i&&i.live){if(r.reloaded(i),i&&this.log(`live playlist ${e} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED"}`),i&&r.fragments.length>0&&function(e,t){let i=null;const r=e.fragments;for(let e=r.length-1;e>=0;e--){const t=r[e].initSegment;if(t){i=t;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let n,s=0;if(function(e,t,i){const r=t.skippedSegments,n=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let e=n;e<=s;e++){const n=l[a+e];let s=o[e];r&&!s&&e<r&&(s=t.fragments[e]=n),n&&s&&i(n,s)}}(e,t,((e,r)=>{e.relurl&&(s=e.cc-r.cc),De(e.startPTS)&&De(e.endPTS)&&(r.start=r.startPTS=e.startPTS,r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.duration=e.endPTS-e.startPTS,r.duration&&(n=r),t.PTSKnown=t.alignedSliding=!0),r.elementaryStreams=e.elementaryStreams,r.loader=e.loader,r.stats=e.stats,r.urlId=e.urlId,e.initSegment&&(r.initSegment=e.initSegment,i=e.initSegment)})),i&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((e=>{var t;e.initSegment&&e.initSegment.relurl!==(null==(t=i)?void 0:t.relurl)||(e.initSegment=i)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((e=>!e)),t.deltaUpdateFailed){Pe.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,i){const r=Ae({},e);return i&&i.forEach((e=>{delete r[e]})),Object.keys(t).forEach((e=>{const i=new Ye(t[e].attr,r[e]);i.isValid?r[e]=i:Pe.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)})),r}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const a=t.fragments;if(s){Pe.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e<a.length;e++)a[e].cc+=s}t.skippedSegments&&(t.startCC=t.fragments[0].cc),function(e,t,i){if(e&&t){let r=0;for(let n=0,s=e.length;n<=s;n++){const s=e[n],a=t[n+r];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?i(s,a):r--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),n?zi(t,n,n.startPTS,n.endPTS,n.startDTS,n.endDTS):Fi(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}(i,r),!this.canLoad||!r.live)return;let a,o,l;if(r.canBlockReload&&r.endSN&&r.advanced){const e=this.hls.config.lowLatencyMode,n=r.lastPartSn,s=r.endSN,c=r.lastPartIndex,u=n===s,d=e?0:c;-1!==c?(o=u?s+1:n,l=u?d:c+1):o=s+1;const h=r.age,p=h+r.ageHeader;let f=Math.min(p-r.partTarget,1.5*r.targetduration);if(f>0){if(i&&f>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${f} with playlist age: ${r.age}`),f=0;else{const e=Math.floor(f/r.targetduration);o+=e,void 0!==l&&(l+=Math.round(f%r.targetduration/r.partTarget)),this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${f} skip sn ${e} to part ${l}`)}r.tuneInGoal=f}if(a=this.getDeliveryDirectives(r,t.deliveryDirectives,o,l),e||!u)return void this.loadPlaylist(a)}else r.canBlockReload&&(a=this.getDeliveryDirectives(r,t.deliveryDirectives,o,l));const c=this.hls.mainForwardBufferInfo,u=c?c.end-c.len:0,d=function(e,t=1/0){let i=1e3*e.targetduration;if(e.updated){const r=e.fragments,n=4;if(r.length&&i*n>t){const e=1e3*r[r.length-1].duration;e<i&&(i=e)}}else i/=2;return Math.round(i)}(r,1e3*(r.edge-u));r.updated&&s>this.requestScheduled+d&&(this.requestScheduled=n.loading.start),void 0!==o&&r.canBlockReload?this.requestScheduled=n.loading.first+d-(1e3*r.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+d<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=d);let h=this.requestScheduled-s;h=Math.max(0,h),this.log(`reload live playlist ${e} in ${Math.round(h)} ms`),this.timer=self.setTimeout((()=>this.loadPlaylist(a)),h)}else this.clearTimer()}getDeliveryDirectives(e,t,i,r){let n=function(e,t){const{canSkipUntil:i,canSkipDateRanges:r,endSN:n}=e;return i&&(void 0!==t?t-n:0)<i?r?"v2":"YES":""}(e,i);return null!=t&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,n=""),new Oi(i,r,n)}checkRetry(e){const t=e.details,i=$i(e),r=e.errorAction,{action:n,retryCount:s=0,retryConfig:a}=r||{},o=5===n&&!!r&&!!a;if(o){var l;if(this.requestScheduled=-1,i&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=Qi(a,s);this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,r.resolved=!0}return o}}let er;class tr extends Ji{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Ce.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Ce.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Ce.FRAG_LOADED,this.onFragLoaded,this),e.on(Ce.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ce.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Ce.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Ce.FRAG_LOADED,this.onFragLoaded,this),e.off(Ce.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=[],r={};let n;t.levels.forEach((e=>{var t;const s=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(er||(er=/chrome|firefox/i.test(navigator.userAgent)),er&&(e.audioCodec=void 0));const{AUDIO:a,CODECS:o,"FRAME-RATE":l,"PATHWAY-ID":c,RESOLUTION:u,SUBTITLES:d}=s,h=`${c||"."}-${e.bitrate}-${u}-${l}-${o}`;n=r[h],n?n.addFallback(e):(n=new Pi(e),r[h]=n,i.push(n)),ir(n,"audio",a),ir(n,"text",d)})),this.filterAndSortMediaOptions(i,t)}filterAndSortMediaOptions(e,t){let i=[],r=[],n=!1,s=!1,a=!1,o=e.filter((({audioCodec:e,videoCodec:t,width:i,height:r,unknownCodecs:o})=>(n||(n=!(!i||!r)),s||(s=!!t),a||(a=!!e),!(null!=o&&o.length)&&(!e||Jt(e,"audio"))&&(!t||Jt(t,"video")))));if((n||s)&&a&&(o=o.filter((({videoCodec:e,width:t,height:i})=>!!e||!(!t||!i)))),0===o.length)return void Promise.resolve().then((()=>{if(this.hls){const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}));t.audioTracks&&(i=t.audioTracks.filter((e=>!e.audioCodec||Jt(e.audioCodec,"audio"))),rr(i)),t.subtitles&&(r=t.subtitles,rr(r));const l=o.slice(0);o.sort(((e,t)=>e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):n&&e.height!==t.height?e.height-t.height:0));let c=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let e=0;e<l.length;e++)if(l[e].pathwayId===o[0].pathwayId){c=l[e];break}this._levels=o;for(let e=0;e<o.length;e++)if(o[e]===c){this._firstLevel=e,this.log(`manifest loaded, ${o.length} level(s) found, first bitrate: ${c.bitrate}`);break}const u=a&&!s,d={levels:o,audioTracks:i,subtitleTracks:r,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:s,altAudio:!u&&i.some((e=>!!e.url))};this.hls.trigger(Ce.MANIFEST_PARSED,d),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const i=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(Ce.ERROR,{type:ke.OTHER_ERROR,details:je.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:i,reason:i.message}),r)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,n=r?r.attrs["PATHWAY-ID"]:void 0,s=t[e],a=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,i===e&&s.details&&r&&n===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${i}${n?" with Pathway "+n:""}`);const o=Ae({},s,{level:e,maxBitrate:s.maxBitrate,attrs:s.attrs,uri:s.uri,urlId:s.urlId});delete o._attrs,delete o._urlId,this.hls.trigger(Ce.LEVEL_SWITCHING,o);const l=s.details;if(!l||l.live){const e=this.switchParams(s.uri,null==r?void 0:r.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===fi&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(void 0!==t&&t.type===mi){const e=this._levels[t.level];void 0!==e&&(e.loadError=0)}}onLevelLoaded(e,t){var i;const{level:r,details:n}=t,s=this._levels[r];var a;if(!s)return this.warn(`Invalid level index ${r}`),void(null!=(a=t.deliveryDirectives)&&a.skip&&(n.deltaUpdateFailed=!0));r===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0),this.playlistLoaded(r,t,s.details)):null!=(i=t.deliveryDirectives)&&i.skip&&(n.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const i=this.currentLevel;if(!i)return;const r=this.hls.audioTracks[t.id].groupId;if(i.audioGroupIds&&i.audioGroupId!==r){let e=-1;for(let t=0;t<i.audioGroupIds.length;t++)if(i.audioGroupIds[t]===r){e=t;break}-1!==e&&e!==i.urlId&&(i.urlId=e,this.canLoad&&this.startLoad())}}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){const r=i.urlId;let n=i.uri;if(e)try{n=e.addDirectives(n)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}const s=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""} with${s?" Pathway "+s:""} URI ${r+1}/${i.url.length} ${n}`),this.clearTimer(),this.hls.trigger(Ce.LEVEL_LOADING,{url:n,level:t,id:r,deliveryDirectives:e||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e,t){const i=(e,i)=>i!==t,r=this._levels.filter(((r,n)=>n!==e||(r.url.length>1&&void 0!==t?(r.url=r.url.filter(i),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(i)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(i)),r.urlId=0,!0):(this.steering&&this.steering.removeLevel(r),!1))));this.hls.trigger(Ce.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){t.forEach(((e,t)=>{const{details:i}=e;null!=i&&i.fragments&&i.fragments.forEach((e=>{e.level=t}))})),this._levels=t}}function ir(e,t,i){i&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=i):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=i))}function rr(e){const t={};e.forEach((e=>{const i=e.groupId||"";e.id=t[i]=t[i]||0,t[i]++}))}var nr="NOT_LOADED",sr="APPENDING",ar="PARTIAL",or="OK";class lr{constructor(e){this.mainFragEntity=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Ce.BUFFER_APPENDED,this.onBufferAppended,this),e.on(Ce.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Ce.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.BUFFER_APPENDED,this.onBufferAppended,this),e.off(Ce.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Ce.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.mainFragEntity=this.activeParts=null}getAppendedFrag(e,t){if(t===mi){const{mainFragEntity:t,activeParts:i}=this;if(t)if(t&&i)for(let r=i.length;r--;){const n=i[r],s=n?n.end:t.appendedPTS;if(n.start<=e&&null!==s&&e<=s)return r>9&&(this.activeParts=i.slice(r-9)),n}else if(t.body.start<=e&&null!==t.appendedPTS&&e<=t.appendedPTS)return t.body}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:i}=this,r=Object.keys(i);for(let n=r.length;n--;){const s=i[r[n]];if((null==s?void 0:s.body.type)===t&&s.buffered){const t=s.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,i){this.timeRanges&&(this.timeRanges[e]=t),Object.keys(this.fragments).forEach((r=>{const n=this.fragments[r];if(!n)return;if(!n.buffered&&!n.loaded)return void(n.body.type===i&&this.removeFragment(n.body));const s=n.range[e];s&&s.time.some((e=>{const i=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return i&&this.removeFragment(n.body),i}))}))}detectPartialFragments(e){const t=this.timeRanges,{frag:i,part:r}=e;if(!t||"initSegment"===i.sn)return;const n=ur(i),s=this.fragments[n];s&&(Object.keys(t).forEach((e=>{const n=i.elementaryStreams[e];if(!n)return;const a=t[e],o=null!==r||!0===n.partial;s.range[e]=this.getBufferedTimes(i,r,o,a)})),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,s.body.endList&&(this.endListFragments[s.body.type]=s)):this.removeFragment(s.body))}fragBuffered(e,t){const i=ur(e);let r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(e,t,i,r){const n={time:[],partial:i},s=t?t.start:e.start,a=t?t.end:e.end,o=e.minEndPTS||a,l=e.maxStartPTS||s;for(let e=0;e<r.length;e++){const t=r.start(e)-this.bufferPadding,i=r.end(e)+this.bufferPadding;if(l>=t&&o<=i){n.time.push({startPTS:Math.max(s,r.start(e)),endPTS:Math.min(a,r.end(e))});break}if(s<i&&a>t)n.partial=!0,n.time.push({startPTS:Math.max(s,r.start(e)),endPTS:Math.min(a,r.end(e))});else if(a<=t)break}return n}getPartialFragment(e){let t,i,r,n=null,s=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach((l=>{const c=o[l];c&&cr(c)&&(i=c.body.start-a,r=c.body.end+a,e>=i&&e<=r&&(t=Math.min(e-i,r-e),s<=t&&(n=c.body,s=t)))})),n}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||cr(t))}getState(e){const t=ur(e),i=this.fragments[t];return i?i.buffered?cr(i)?ar:or:sr:nr}isTimeBuffered(e,t,i){let r,n;for(let s=0;s<i.length;s++){if(r=i.start(s)-this.bufferPadding,n=i.end(s)+this.bufferPadding,e>=r&&t<=n)return!0;if(t<=r)return!1}return!1}onFragLoaded(e,t){const{frag:i,part:r}=t;if("initSegment"===i.sn||i.bitrateTest||r)return;const n=ur(i);this.fragments[n]={body:i,appendedPTS:null,loaded:t,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:r,timeRanges:n}=t;let s=this.mainFragEntity;if(i.type===mi){const e=s?s.body:null;if(e!==i){s&&e&&e.sn!==i.sn&&(s.buffered=!0,this.fragments[ur(e)]=s);const t=ur(i);s=this.mainFragEntity=this.fragments[t]||{body:i,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)}}if(r){let e=this.activeParts;e||(this.activeParts=e=[]),e.push(r)}else this.activeParts=null}this.timeRanges=n,Object.keys(n).forEach((e=>{const t=n[e];if(this.detectEvictedFragments(e,t),!r&&s){const r=i.elementaryStreams[e];if(!r)return;for(let e=0;e<t.length;e++){const i=t.end(e);i<=r.endPTS&&i>r.startPTS?s.appendedPTS=Math.max(i,s.appendedPTS||0):s.appendedPTS=r.endPTS}}}))}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=ur(e);return!!this.fragments[t]}removeFragmentsInRange(e,t,i,r,n){r&&!this.hasGaps||Object.keys(this.fragments).forEach((s=>{const a=this.fragments[s];if(!a)return;const o=a.body;o.type!==i||r&&!o.gap||o.start<t&&o.end>e&&(a.buffered||n)&&this.removeFragment(o)}))}removeFragment(e){const t=ur(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),this.mainFragEntity===this.fragments[t]&&(this.mainFragEntity=null),delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.mainFragEntity=null,this.activeParts=null,this.hasGaps=!1}}function cr(e){var t,i;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(i=e.range.audio)?void 0:i.partial))}function ur(e){return`${e.type}_${e.level}_${e.urlId}_${e.sn}`}const dr=Math.pow(2,17);class hr{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new gr({type:ke.NETWORK_ERROR,details:je.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();const r=this.config,n=r.fLoader,s=r.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap)return void o(fr(e));const l=this.loader=e.loader=n?new n(r):new s(r),c=pr(e),u=Hi(r.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:dr};e.stats=l.stats,l.load(c,d,{onSuccess:(t,i,r,n)=>{this.resetLoader(e,l);let s=t.data;r.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),a({frag:e,part:null,payload:s,networkDetails:n})},onError:(t,r,n,s)=>{this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:we({url:i,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:n,stats:s}))},onAbort:(t,i,r)=>{this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:r,stats:t}))},onTimeout:(t,i,r)=>{this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:r,stats:t}))},onProgress:(i,r,n,s)=>{t&&t({frag:e,part:null,payload:n,networkDetails:s})}})}))}loadPart(e,t,i){this.abort();const r=this.config,n=r.fLoader,s=r.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void o(fr(e,t));const l=this.loader=e.loader=n?new n(r):new s(r),c=pr(e,t),u=Hi(r.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:dr};t.stats=l.stats,l.load(c,d,{onSuccess:(r,n,s,o)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const c={frag:e,part:t,payload:r.data,networkDetails:o};i(c),a(c)},onError:(i,r,n,s)=>{this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:we({url:c.url,data:void 0},i),error:new Error(`HTTP Error ${i.code} ${i.text}`),networkDetails:n,stats:s}))},onAbort:(i,r,n)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:n,stats:i}))},onTimeout:(i,r,n)=>{this.resetLoader(e,l),o(new gr({type:ke.NETWORK_ERROR,details:je.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:n,stats:i}))}})}))}updateStatsFromPart(e,t){const i=e.stats,r=t.stats,n=r.total;if(i.loaded+=r.loaded,n){const r=Math.round(e.duration/t.duration),s=Math.min(Math.round(i.loaded/n),r),a=(r-s)*Math.round(i.loaded/s);i.total=i.loaded+a}else i.total=Math.max(i.loaded,i.total);const s=i.loading,a=r.loading;s.start?s.first+=a.first-a.start:(s.start=a.start,s.first=a.first),s.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function pr(e,t=null){const i=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},n=i.byteRangeStartOffset,s=i.byteRangeEndOffset;if(De(n)&&De(s)){var a;let t=n,i=s;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){const e=s-n;e%16&&(i=s+(16-e%16)),0!==n&&(r.resetIV=!0,t=n-16)}r.rangeStart=t,r.rangeEnd=i}return r}function fr(e,t){const i=new Error(`GAP ${e.gap?"tag":"attribute"} found`),r={type:ke.MEDIA_ERROR,details:je.FRAG_GAP,fatal:!1,frag:e,error:i,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new gr(r)}class gr extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class yr{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.abort()}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=je.KEY_LOAD_ERROR,i,r,n){return new gr({type:ke.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:n,error:i,networkDetails:r})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:r}=e;for(let e=0;e<t.length;e++){const n=t[e];if(r<=n.cc&&("initSegment"===i||"initSegment"===n.sn||i<n.sn)){this.emeController.selectKeySystemFormat(n).then((e=>{n.setKeyFormat(e)}));break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var i,r;t&&e.setKeyFormat(t);const n=e.decryptdata;if(!n){const i=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,je.KEY_LOAD_ERROR,i))}const s=n.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,je.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let a=this.keyUriToKeyInfo[s];if(null!=(i=a)&&i.decryptdata.key)return n.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});var o;if(null!=(r=a)&&r.keyLoadPromise)switch(null==(o=a.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then((t=>(n.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:a})))}switch(a=this.keyUriToKeyInfo[s]={decryptdata:n,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},n.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===n.keyFormat?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,je.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${n.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(i);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,i)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,r=new(0,i.loader)(i);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise(((n,s)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},o=i.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,i,r)=>{const{frag:a,keyInfo:o,url:l}=i;if(!a.decryptdata||o!==this.keyUriToKeyInfo[l])return s(this.createKeyLoadError(a,je.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,n({frag:a,keyInfo:o})},onError:(e,i,r,n)=>{this.resetLoader(i),s(this.createKeyLoadError(t,je.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),r,we({url:a.url,data:void 0},e)))},onTimeout:(e,i,r)=>{this.resetLoader(i),s(this.createKeyLoadError(t,je.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(e,i,r)=>{this.resetLoader(i),s(this.createKeyLoadError(t,je.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(a,l,c)}))}resetLoader(e){const{frag:t,keyInfo:i,url:r}=e,n=i.loader;t.keyLoader===n&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],n&&n.destroy()}}class mr{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const vr={length:0,start:()=>0,end:()=>0};class Mr{static isBuffered(e,t){try{if(e){const i=Mr.getBuffered(e);for(let e=0;e<i.length;e++)if(t>=i.start(e)&&t<=i.end(e))return!0}}catch(e){}return!1}static bufferInfo(e,t,i){try{if(e){const r=Mr.getBuffered(e),n=[];let s;for(s=0;s<r.length;s++)n.push({start:r.start(s),end:r.end(s)});return this.bufferedInfo(n,t,i)}}catch(e){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.sort((function(e,t){return e.start-t.start||t.end-e.end}));let r=[];if(i)for(let t=0;t<e.length;t++){const n=r.length;if(n){const s=r[n-1].end;e[t].start-s<i?e[t].end>s&&(r[n-1].end=e[t].end):r.push(e[t])}else r.push(e[t])}else r=e;let n,s=0,a=t,o=t;for(let e=0;e<r.length;e++){const l=r[e].start,c=r[e].end;if(t+i>=l&&t<c)a=l,o=c,s=o-t;else if(t+i<l){n=l;break}}return{len:s,start:a||0,end:o||0,nextStart:n}}static getBuffered(e){try{return e.buffered}catch(e){return Pe.log("failed to get media.buffered",e),vr}}}class Tr{constructor(e,t,i,r=0,n=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=n,this.partial=s}}function Lr(e,t){let i=null;for(let r=0,n=e.length;r<n;r++){const n=e[r];if(n&&n.cc===t){i=n;break}}return i}function br(e,t){if(e){const i=e.start+t;e.start=e.startPTS=i,e.endPTS=i+e.duration}}function Er(e,t){const i=t.fragments;for(let t=0,r=i.length;t<r;t++)br(i[t],e);t.fragmentHint&&br(t.fragmentHint,e),t.alignedSliding=!0}function Ir(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const i=e.fragments,r=t.fragments;if(!i.length||!r.length)return;const n=r[Math.round(r.length/2)-1],s=Lr(i,n.cc)||i[Math.round(i.length/2)-1],a=n.programDateTime,o=s.programDateTime;null!==a&&null!==o&&Er((o-a)/1e3-(s.start-n.start),e)}class Nr{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class wr{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class Sr{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let e=0;e<4;e++)i[e]=t.getUint32(4*e);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],n=i[1],s=i[2],a=i[3],o=this.invSubMix,l=o[0],c=o[1],u=o[2],d=o[3],h=new Uint32Array(256);let p=0,f=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){let i=f^f<<1^f<<2^f<<3^f<<4;i=i>>>8^255&i^99,e[p]=i,t[i]=p;const o=h[p],g=h[o],y=h[g];let m=257*h[i]^16843008*i;r[p]=m<<24|m>>>8,n[p]=m<<16|m>>>16,s[p]=m<<8|m>>>24,a[p]=m,m=16843009*y^65537*g^257*o^16843008*p,l[i]=m<<24|m>>>8,c[i]=m<<16|m>>>16,u[i]=m<<8|m>>>24,d[i]=m,p?(p=o^h[h[h[y^o]]],f^=h[h[f]]):p=f=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,r=0;for(;r<t.length&&i;)i=t[r]===this.key[r],r++;if(i)return;this.key=t;const n=this.keySize=t.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);const s=this.ksRows=4*(n+6+1);let a,o;const l=this.keySchedule=new Uint32Array(s),c=this.invKeySchedule=new Uint32Array(s),u=this.sBox,d=this.rcon,h=this.invSubMix,p=h[0],f=h[1],g=h[2],y=h[3];let m,v;for(a=0;a<s;a++)a<n?m=l[a]=t[a]:(v=m,a%n==0?(v=v<<8|v>>>24,v=u[v>>>24]<<24|u[v>>>16&255]<<16|u[v>>>8&255]<<8|u[255&v],v^=d[a/n|0]<<24):n>6&&a%n==4&&(v=u[v>>>24]<<24|u[v>>>16&255]<<16|u[v>>>8&255]<<8|u[255&v]),l[a]=m=(l[a-n]^v)>>>0);for(o=0;o<s;o++)a=s-o,v=3&o?l[a]:l[a-4],c[o]=o<4||a<=4?v:p[u[v>>>24]]^f[u[v>>>16&255]]^g[u[v>>>8&255]]^y[u[255&v]],c[o]=c[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,i){const r=this.keySize+6,n=this.invKeySchedule,s=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],c=a[2],u=a[3],d=this.uint8ArrayToUint32Array_(i);let h=d[0],p=d[1],f=d[2],g=d[3];const y=new Int32Array(e),m=new Int32Array(y.length);let v,M,T,L,b,E,I,N,w,S,A,D,C,k;const j=this.networkToHostOrderSwap;for(;t<y.length;){for(w=j(y[t]),S=j(y[t+1]),A=j(y[t+2]),D=j(y[t+3]),b=w^n[0],E=D^n[1],I=A^n[2],N=S^n[3],C=4,k=1;k<r;k++)v=o[b>>>24]^l[E>>16&255]^c[I>>8&255]^u[255&N]^n[C],M=o[E>>>24]^l[I>>16&255]^c[N>>8&255]^u[255&b]^n[C+1],T=o[I>>>24]^l[N>>16&255]^c[b>>8&255]^u[255&E]^n[C+2],L=o[N>>>24]^l[b>>16&255]^c[E>>8&255]^u[255&I]^n[C+3],b=v,E=M,I=T,N=L,C+=4;v=s[b>>>24]<<24^s[E>>16&255]<<16^s[I>>8&255]<<8^s[255&N]^n[C],M=s[E>>>24]<<24^s[I>>16&255]<<16^s[N>>8&255]<<8^s[255&b]^n[C+1],T=s[I>>>24]<<24^s[N>>16&255]<<16^s[b>>8&255]<<8^s[255&E]^n[C+2],L=s[N>>>24]<<24^s[b>>16&255]<<16^s[E>>8&255]<<8^s[255&I]^n[C+3],m[t]=j(v^h),m[t+1]=j(L^p),m[t+2]=j(T^f),m[t+3]=j(M^g),h=w,p=S,f=A,g=D,t+=4}return m.buffer}}class Ar{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}null===this.subtle&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,i=t&&new DataView(e.buffer).getUint8(t-1);return i?lt(e,0,t-i):e}(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i){return this.useSoftware?new Promise(((r,n)=>{this.softwareDecrypt(new Uint8Array(e),t,i);const s=this.flush();s?r(s.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,i)}softwareDecrypt(e,t,i){const{currentIV:r,currentResult:n,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=Ft(s,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;r&&(i=r);let o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new Sr),o.expandKey(t);const l=n;return this.currentResult=o.decrypt(a.buffer,0,i),this.currentIV=lt(a,-16).buffer,l||null}webCryptoDecrypt(e,t,i){const r=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new wr(r,t)),this.fastAesKey.expandKey().then((t=>r?(this.logOnce("WebCrypto AES decrypt"),new Nr(r,new Uint8Array(i)).decrypt(e.buffer,t)):Promise.reject(new Error("web crypto not initialized")))).catch((r=>(Pe.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,i))))}onWebCryptoError(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%16;return i!==e.length&&(t=lt(e,0,i),this.remainderData=lt(e,i)),t}logOnce(e){this.logEnabled&&(Pe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Dr="STOPPED",Cr="IDLE",kr="KEY_LOADING",jr="FRAG_LOADING",xr="FRAG_LOADING_WAITING_RETRY",_r="WAITING_TRACK",Or="PARSING",Pr="PARSED",Rr="ENDED",zr="ERROR",Fr="WAITING_INIT_PTS",Ur="WAITING_LEVEL";class Yr extends mr{constructor(e,t,i,r,n){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Dr,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=n,this.logPrefix=r,this.log=Pe.log.bind(Pe,`${r}:`),this.warn=Pe.warn.bind(Pe,`${r}:`),this.hls=e,this.fragmentLoader=new hr(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new Ar(e.config),e.on(Ce.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort();const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Dr}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const i=t.partList;if(null!=i&&i.length){const e=i[i.length-1];return Mr.isBuffered(this.media,e.start+e.duration/2)}const r=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(r)}getLevelDetails(){var e;if(this.levels&&null!==this.levelLastLoaded)return null==(e=this.levels[this.levelLastLoaded])?void 0:e.details}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const r=this.config;this.levels&&r.autoStartLoad&&this.state===Dr&&this.startLoad(r.startPosition)}onMediaDetaching(){const e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:i,mediaBuffer:r,state:n}=this,s=i?i.currentTime:0,a=Mr.bufferInfo(r||i,s,e.maxBufferHole);if(this.log(`media seeking to ${De(s)?s.toFixed(3):s}, state: ${n}`),this.state===Rr)this.resetLoadingState();else if(t){const i=e.maxFragLookUpTolerance,r=t.start-i,n=t.start+t.duration+i;if(!a.len||n<a.start||r>a.end){const e=s>n;(s<r||e)&&(e&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests()),this.resetLoadingState())}}i&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),this.loadedmetadata||a.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.stopLoad(),super.onHandlerDestroying()}onHandlerDestroyed(){this.state=Dr,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,i){this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){this._doFragLoad(e,t,i,(t=>{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const i=this.state;this.fragContextChanged(e)?(i===jr||!this.fragCurrent&&i===Or)&&(this.fragmentTracker.removeFragment(e),this.state=Cr):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(Ce.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((t=>{this.state!==Dr&&this.state!==zr&&(this.warn(t),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;if(this.fragmentTracker.getState(e)===sr){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=Math.max(e.duration,i?i.len:this.config.maxBufferLength);this.reduceMaxBufferLength(r)&&this.fragmentTracker.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)&&this.fragmentTracker.removeAllFragments()}flushMainBuffer(e,t,i=null){if(!(e-t))return;const r={startOffset:e,endOffset:t,type:i};this.hls.trigger(Ce.BUFFER_FLUSHING,r)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:i}=this,{payload:r}=t,n=e.decryptdata;if(r&&r.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){const s=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),n.key.buffer,n.iv.buffer).catch((t=>{throw i.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((r=>{const n=self.performance.now();return i.trigger(Ce.FRAG_DECRYPTED,{frag:e,payload:r,stats:{tstart:s,tdecrypt:n}}),t.payload=r,t}))}return t})).then((i=>{const{fragCurrent:r,hls:n,levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=Cr,t.fragmentError=0,e.data=new Uint8Array(i.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),i.frag===r&&n.trigger(Ce.FRAG_BUFFERED,{stats:a,frag:r,part:null,id:e.type}),this.tick()})).catch((t=>{this.state!==Dr&&this.state!==zr&&(this.warn(t),this.resetFragmentLoading(e))}))}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var i,r,n,s;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level} (frag:[${(null!=(i=e.startPTS)?i:NaN).toFixed(3)}-${(null!=(r=e.endPTS)?r:NaN).toFixed(3)}] > buffer:${a?function(e){let t="";const i=e.length;for(let r=0;r<i;r++)t+=`[${e.start(r).toFixed(3)}-${e.end(r).toFixed(3)}]`;return t}(Mr.getBuffered(a)):"(detached)"})`),this.state=Cr,a&&(!this.loadedmetadata&&e.type==mi&&a.buffered.length&&(null==(n=this.fragCurrent)?void 0:n.sn)===(null==(s=this.fragPrevious)?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:r,partsLoaded:n}=e,s=!n||0===n.length||n.some((e=>!e)),a=new Tr(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,r){var n;const s=null==t?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(n=e.decryptdata)&&n.key?!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=kr,this.fragCurrent=e,a=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(Ce.KEY_LOADED,e),this.state===kr&&(this.state=Cr),e})),this.hls.trigger(Ce.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),i=Math.max(e.start,i||0),this.config.lowLatencyMode){const n=s.partList;if(n&&r){i>e.end&&s.fragmentHint&&(e=s.fragmentHint);const o=this.getNextPart(n,e,i);if(o>-1){const l=n[o];let c;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${o}-${n.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=jr,c=a?a.then((i=>!i||this.fragContextChanged(i.frag)?null:this.doFragPartsLoad(e,l,t,r))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,l,t,r).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(Ce.FRAG_LOADING,{frag:e,part:l,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c}if(!e.url||this.loadedEndOfParts(n,i))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),De(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=jr;const o=this.config.progressive;let l;return l=o&&a?a.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,r))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,o?r:void 0),a]).then((([e])=>(!o&&e&&r&&r(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(Ce.FRAG_LOADING,{frag:e,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,i,r){return new Promise(((n,s)=>{var a;const o=[],l=null==(a=i.details)?void 0:a.partList,c=t=>{this.fragmentLoader.loadPart(e,t,r).then((r=>{o[t.index]=r;const s=r.part;this.hls.trigger(Ce.FRAG_LOADED,r);const a=Yi(i,e.sn,t.index+1)||Bi(l,e.sn,t.index+1);if(!a)return n({frag:e,part:s,partsLoaded:o});c(a)})).catch(s)};c(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===je.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(Ce.ERROR,t)}else this.hls.trigger(Ce.ERROR,{type:ke.OTHER_ERROR,details:je.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Or)return void(this.fragCurrent||this.state===Dr||this.state===zr||(this.state=Cr));const{frag:i,part:r,level:n}=t,s=self.performance.now();i.stats.parsing.end=s,r&&(r.stats.parsing.end=s),this.updateLevelTiming(i,r,n,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:r,sn:n,part:s}=e;if(null==t||!t[r])return this.warn(`Levels object was unset while buffering fragment ${n} of level ${r}. The current chunk will not be buffered.`),null;const a=t[r],o=s>-1?Yi(a,n,s):null,l=o?o.fragment:function(e,t,i){if(null==e||!e.details)return null;const r=e.details;let n=r.fragments[t-r.startSN];return n||(n=r.fragmentHint,n&&n.sn===t?n:t<r.startSN&&i&&i.sn===t?i:null)}(a,n,i);return l?(i&&i!==l&&(l.stats=i.stats),{frag:l,part:o,level:a}):null}bufferFragmentData(e,t,i,r){var n;if(!e||this.state!==Or)return;const{data1:s,data2:a}=e;let o=s;if(s&&a&&(o=Ft(s,a)),null==(n=o)||!n.length)return;const l={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:o};this.hls.trigger(Ce.BUFFER_APPENDING,l),e.dropped&&e.independent&&!i&&this.flushBufferGap(t)}flushBufferGap(e){const t=this.media;if(!t)return;if(!Mr.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const i=t.currentTime,r=Mr.bufferInfo(t,i,0),n=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),a=Math.max(Math.min(e.start-s,r.end-s),i+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const i=this.getLoadPosition();return De(i)?this.getFwdBufferInfoAtPos(e,i,t):null}getFwdBufferInfoAtPos(e,t,i){const{config:{maxBufferHole:r}}=this,n=Mr.bufferInfo(e,t,r);if(0===n.len&&void 0!==n.nextStart){const s=this.fragmentTracker.getBufferedFrag(t,i);if(s&&n.nextStart<s.end)return Mr.bufferInfo(e,t,Math.max(n.nextStart,r))}return n}getMaxBufferLength(e){const{config:t}=this;let i;return i=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getNextFragment(e,t){const i=t.fragments,r=i.length;if(!r)return null;const{config:n}=this,s=i[0].start;let a;if(t.live){const s=n.initialLiveManifestSize;if(r<s)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${s})`),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=s&&(a=i[0]);if(!a){const i=n.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,i,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===or||i===ar&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,r,n){const s=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,s&&e&&!e.gap&&i.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(null!==t&&i.len+t.len>=n)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,i){let r=-1,n=!1,s=!0;for(let a=0,o=e.length;a<o;a++){const o=e[a];if(s=s&&!o.independent,r>-1&&i<o.start)break;const l=o.loaded;l?r=-1:(n||o.independent||s)&&o.fragment===t&&(r=a),n=l}return r}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e,t){const i=this.fragPrevious;let r=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=function(e,t,i){if(null===t||!Array.isArray(e)||!e.length||!De(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;i=i||0;for(let r=0;r<e.length;++r){const n=e[r];if(Ki(t,i,n))return n}return null}(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){const s=t[n-e.startSN];i.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=function(e,t){return Wi(e,(e=>e.cc<t?1:e.cc>t?-1:0))}(t,i.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(r=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}getFragmentAtPosition(e,t,i){const{config:r}=this;let{fragPrevious:n}=this,{fragments:s,endSN:a}=i;const{fragmentHint:o}=i,l=r.maxFragLookUpTolerance,c=!!(r.lowLatencyMode&&i.partList&&o);let u;if(c&&o&&!this.bitrateTest&&(s=s.concat(o),a=o.sn),u=e<t?Zi(n,s,e,e>t-l?0:l):s[s.length-1],u){const e=u.sn-i.startSN,t=this.fragmentTracker.getState(u);if((t===or||t===ar&&u.gap)&&(n=u),n&&u.sn===n.sn&&!c&&n&&u.level===n.level){const t=s[e+1];u=u.sn<a&&this.fragmentTracker.getState(t)!==or?t:null}}return u}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,n=i.currentTime,s=e.fragments[0].start,a=e.edge,o=n>=s-t.maxFragLookUpTolerance&&n<=a;if(null!==r&&i.duration>r&&(n<r||!o)){const s=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!o&&i.readyState<4||n<a-s)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn(`Playback: ${n.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${r.toFixed(3)}`),i.currentTime=r))}}alignPlaylists(e,t){const{levels:i,levelLastLoaded:r,fragPrevious:n}=this,s=null!==r?i[r]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;const o=e.fragments[0].start,l=!t,c=e.alignedSliding&&De(o);if(l||!c&&!o){!function(e,t,i){t&&(function(e,t,i){if(function(e,t,i){return!(!t.details||!(i.endCC>i.startCC||e&&e.cc<i.startCC))}(e,i,t)){const e=function(e,t,i=0){const r=e.fragments,n=t.fragments;if(!n.length||!r.length)return void Pe.log("No fragments to align");const s=Lr(r,n[0].cc);if(s&&(!s||s.startPTS))return s;Pe.log("No frag in previous level to align on")}(i.details,t);e&&De(e.start)&&(Pe.log(`Adjusting PTS using last level due to CC increase within current level ${t.url}`),Er(e.start,t))}}(e,i,t),!i.alignedSliding&&t.details&&function(e,t){if(!t.fragments.length||!e.hasProgramDateTime||!t.hasProgramDateTime)return;const i=t.fragments[0].programDateTime,r=e.fragments[0].programDateTime,n=(r-i)/1e3+t.fragments[0].start;n&&De(n)&&(Pe.log(`Adjusting PTS using programDateTime delta ${r-i}ms, sliding:${n.toFixed(3)} ${e.url} `),Er(n,e))}(i,t.details),i.alignedSliding||!t.details||i.skippedSegments||Fi(t.details,i))}(n,s,e);const i=e.fragments[0].start;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${n?n.sn:"na"} fragments: ${a}`),i}return o}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let i=this.startPosition;if(i<t&&(i=-1),-1===i||-1===this.lastCurrentTime){const r=null!==this.startTimeOffset,n=r?this.startTimeOffset:e.startTimeOffset;null!==n&&De(n)?(i=t+n,n<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Start time offset ${n} found in ${r?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part"+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===xr)||(this.state=Cr)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;var r;if(this.fragContextChanged(i))return void this.warn(`Frag load error must match current frag to retry ${i.url} > ${null==(r=this.fragCurrent)?void 0:r.url}`);const n=t.details===je.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(i,!0);const s=t.errorAction,{action:a,retryCount:o=0,retryConfig:l}=s||{};if(s&&5===a&&l){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);const r=Qi(l,o);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${r}ms`),s.resolved=!0,this.retryDate=self.performance.now()+r,this.state=xr}else l&&s?(this.resetFragmentErrors(e),o<l.maxNumRetry?n||(s.resolved=!0):Pe.warn(`${t.details} reached or exceeded max retry (${o})`)):this.state=zr;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===Or||this.state===Pr){const t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len);const n=!r;return n&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),n}return!1}resetFragmentErrors(e){e===vi&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Dr&&(this.state=Cr)}afterBufferFlushed(e,t,i){if(!e)return;const r=Mr.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===Rr&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Cr}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,r){var n;const s=i.details;if(!s)return void this.warn("level.details undefined");const a=Object.keys(e.elementaryStreams).reduce(((t,n)=>{const a=e.elementaryStreams[n];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${n} duration reliably (${o})`),t||!1;const l=r?0:zi(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return this.hls.trigger(Ce.LEVEL_PTS_UPDATED,{details:s,level:i,drift:l,type:n,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1);if(a)i.fragmentError=0;else if(null===(null==(n=this.transmuxer)?void 0:n.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${i.id} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Pr,this.hls.trigger(Ce.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.resetTransmuxer(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function Br(){if("undefined"!=typeof self)return self.MediaSource||self.WebKitMediaSource}function $r(){return self.SourceBuffer||self.WebKitSourceBuffer}function Gr(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class Qr{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=Ft(this.cachedData,e),this.cachedData=null);let i,r=dt(e,0),n=r?r.length:0;const s=this._audioTrack,a=this._id3Track,o=r?(e=>{const t=yt(e);for(let e=0;e<t.length;e++){const i=t[e];if(ft(i))return Lt(i)}})(r):void 0,l=e.length;for((null===this.basePTS||0===this.frameIndex&&De(o))&&(this.basePTS=Hr(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Si,duration:Number.POSITIVE_INFINITY});n<l;){if(this.canParse(e,n)){const t=this.appendFrame(s,e,n);t?(this.frameIndex++,this.lastPTS=t.sample.pts,n+=t.length,i=n):n=l}else pt(e,n)?(r=dt(e,n),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:Si,duration:Number.POSITIVE_INFINITY}),n+=r.length,i=n):n++;if(n===l&&i!==l){const t=lt(e,i);this.cachedData?this.cachedData=Ft(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:Gr(),id3Track:a,textTrack:Gr()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Gr(),id3Track:this._id3Track,textTrack:Gr()}}destroy(){}}const Hr=(e,t,i)=>De(e)?90*e:9e4*t+(i?9e4*i.baseTime/i.timescale:0);function qr(e,t){return 255===e[t]&&240==(246&e[t+1])}function Wr(e,t){return 1&e[t+1]?7:9}function Zr(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function Vr(e,t){return t+1<e.length&&qr(e,t)}function Kr(e,t){if(Vr(e,t)){const i=Wr(e,t);if(t+i>=e.length)return!1;const r=Zr(e,t);if(r<=i)return!1;const n=t+r;return n===e.length||Vr(e,n)}return!1}function Xr(e,t,i,r,n){if(!e.samplerate){const s=function(e,t,i,r){let n,s,a,o;const l=navigator.userAgent.toLowerCase(),c=r,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];n=1+((192&t[i+2])>>>6);const d=(60&t[i+2])>>>2;if(!(d>u.length-1))return a=(1&t[i+2])<<2,a|=(192&t[i+3])>>>6,Pe.log(`manifest codec:${r}, ADTS type:${n}, samplingIndex:${d}`),/firefox/i.test(l)?d>=6?(n=5,o=new Array(4),s=d-3):(n=2,o=new Array(2),s=d):-1!==l.indexOf("android")?(n=2,o=new Array(2),s=d):(n=5,o=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?s=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===a||/vivaldi/i.test(l))||!r&&1===a)&&(n=2,o=new Array(2)),s=d)),o[0]=n<<3,o[0]|=(14&d)>>1,o[1]|=(1&d)<<7,o[1]|=a<<3,5===n&&(o[1]|=(14&s)>>1,o[2]=(1&s)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:u[d],channelCount:a,codec:"mp4a.40."+n,manifestCodec:c};e.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${d}`})}(t,i,r,n);if(!s)return;e.config=s.config,e.samplerate=s.samplerate,e.channelCount=s.channelCount,e.codec=s.codec,e.manifestCodec=s.manifestCodec,Pe.log(`parsed codec:${e.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function Jr(e){return 9216e4/e}function en(e,t,i,r,n){const s=r+n*Jr(e.samplerate),a=function(e,t){const i=Wr(e,t);if(t+i<=e.length){const r=Zr(e,t)-i;if(r>0)return{headerLength:i,frameLength:r}}}(t,i);let o;if(a){const{frameLength:r,headerLength:n}=a,l=n+r,c=Math.max(0,i+l-t.length);c?(o=new Uint8Array(l-n),o.set(t.subarray(i+n,t.length),0)):o=t.subarray(i+n,i+l);const u={unit:o,pts:s};return c||e.samples.push(u),{sample:u,length:l,missing:c}}const l=t.length-i;return o=new Uint8Array(l),o.set(t.subarray(i,t.length),0),{sample:{unit:o,pts:s},length:l,missing:-1}}const tn=/\/emsg[-/]ID3/i;let rn=null;const nn=[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],sn=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],an=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],on=[0,1,1,4];function ln(e,t,i,r,n){if(i+24>t.length)return;const s=cn(t,i);if(s&&i+s.frameLength<=t.length){const a=r+n*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:t.subarray(i,i+s.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}function cn(e,t){const i=e[t+1]>>3&3,r=e[t+1]>>1&3,n=e[t+2]>>4&15,s=e[t+2]>>2&3;if(1!==i&&0!==n&&15!==n&&3!==s){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*nn[14*(3===i?3-r:3===r?3:4)+n-1],c=sn[3*(3===i?0:2===i?1:2)+s],u=3===o?1:2,d=an[i][r],h=on[r],p=8*d*h,f=Math.floor(d*l/c+a)*h;if(null===rn){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);rn=e?parseInt(e[1]):0}return!!rn&&rn<=87&&2===r&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function un(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function dn(e,t){return t+1<e.length&&un(e,t)}function hn(e,t){if(t+1<e.length&&un(e,t)){const i=4,r=cn(e,t);let n=i;null!=r&&r.frameLength&&(n=r.frameLength);const s=t+n;return s===e.length||dn(e,s)}return!1}class pn{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),n=Math.min(4,t);if(0===n)throw new Error("no bytes available");r.set(e.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&Pe.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,i=8,r=8;for(let n=0;n<e;n++)0!==r&&(t=this.readEG(),r=(i+t+256)%256),i=0===r?i:r}readSPS(){let e,t,i,r=0,n=0,s=0,a=0;const o=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),d=this.skipBits.bind(this),h=this.skipEG.bind(this),p=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);o();const g=o();if(l(5),d(3),o(),p(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){const e=c();if(3===e&&d(1),p(),p(),d(1),u())for(t=3!==e?8:12,i=0;i<t;i++)u()&&f(i<6?16:64)}p();const y=c();if(0===y)c();else if(1===y)for(d(1),h(),h(),e=c(),i=0;i<e;i++)h();p(),d(1);const m=c(),v=c(),M=l(1);0===M&&d(1),d(1),u()&&(r=c(),n=c(),s=c(),a=c());let T=[1,1];if(u()&&u())switch(o()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:T=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(m+1)-2*r-2*n),height:(2-M)*(v+1)*16-(M?2:4)*(s+a),pixelRatio:T}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class fn{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Ar(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,i){const r=e[t].unit;if(r.length<=16)return;const n=r.subarray(16,r.length-r.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(s).then((n=>{const s=new Uint8Array(n);r.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)}))}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length)return void i();if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,i),this.decrypter.isSync())))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,i=new Int8Array(t);let r=0;for(let t=32;t<e.length-16;t+=160,r+=16)i.set(e.subarray(t,t+16),r);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let r=0;for(let t=32;t<e.length-16;t+=160,r+=16)e.set(i.subarray(r,r+16),t);return e}decryptAvcSample(e,t,i,r,n){const s=$t(n.data),a=this.getAvcEncryptedData(s);this.decryptBuffer(a.buffer).then((a=>{n.data=this.getAvcDecryptedUnit(s,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,r)}))}decryptAvcSamples(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length)return void r();const n=e[t].units;for(;!(i>=n.length);i++){const s=n[i];if(!(s.data.length<=48||1!==s.type&&5!==s.type||(this.decryptAvcSample(e,t,i,r,s),this.decrypter.isSync())))return}}}}const gn=188;class yn{constructor(e,t,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=i}static probe(e){const t=yn.syncOffset(e);return t>0&&Pe.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),-1!==t}static syncOffset(e){const t=e.length,i=Math.min(940,e.length-gn)+1;let r=0;for(;r<i;){let n=!1;for(let s=r;s<t&&71===e[s];s+=gn)if(n||0!==vn(e,s)||(n=!0),n&&s+gn>i)return r;r++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:At[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=yn.createTrack("video"),this._audioTrack=yn.createTrack("audio",r),this._id3Track=yn.createTrack("id3"),this._txtTrack=yn.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,i=!1,r=!1){let n;i||(this.sampleAes=null);const s=this._avcTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=s.pid,u=s.pesData,d=a.pid,h=o.pid,p=a.pesData,f=o.pesData,g=null,y=this.pmtParsed,m=this._pmtId,v=e.length;if(this.remainderData&&(v=(e=Ft(this.remainderData,e)).length,this.remainderData=null),v<gn&&!r)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};const M=Math.max(0,yn.syncOffset(e));v-=(v-M)%gn,v<e.byteLength&&!r&&(this.remainderData=new Uint8Array(e.buffer,v,e.buffer.byteLength-v));let T=0;for(let t=M;t<v;t+=gn)if(71===e[t]){const r=!!(64&e[t+1]),v=vn(e,t);let T;if((48&e[t+3])>>4>1){if(T=t+5+e[t+4],T===t+gn)continue}else T=t+4;switch(v){case c:r&&(u&&(n=Ln(u))&&this.parseAVCPES(s,l,n,!1),u={data:[],size:0}),u&&(u.data.push(e.subarray(T,t+gn)),u.size+=t+gn-T);break;case d:if(r){if(p&&(n=Ln(p)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,n);break;case"mp3":this.parseMPEGPES(a,n)}p={data:[],size:0}}p&&(p.data.push(e.subarray(T,t+gn)),p.size+=t+gn-T);break;case h:r&&(f&&(n=Ln(f))&&this.parseID3PES(o,n),f={data:[],size:0}),f&&(f.data.push(e.subarray(T,t+gn)),f.size+=t+gn-T);break;case 0:r&&(T+=e[T]+1),m=this._pmtId=Mn(e,T);break;case m:{r&&(T+=e[T]+1);const n=Tn(e,T,this.typeSupported,i);c=n.avc,c>0&&(s.pid=c),d=n.audio,d>0&&(a.pid=d,a.segmentCodec=n.segmentCodec),h=n.id3,h>0&&(o.pid=h),null===g||y||(Pe.warn(`MPEG-TS PMT found at ${t} after unknown PID '${g}'. Backtracking to sync byte @${M} to parse all TS packets.`),g=null,t=M-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=v}}else T++;if(T>0){const e=new Error(`Found ${T} TS packet/s that do not start with 0x47`);this.observer.emit(Ce.ERROR,Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}s.pesData=u,a.pesData=p,o.pesData=f;const L={audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};return r&&this.extractRemainingSamples(L),L}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:r,textTrack:n}=e,s=i.pesData,a=t.pesData,o=r.pesData;let l;if(s&&(l=Ln(s))?(this.parseAVCPES(i,n,l,!0),i.pesData=null):i.pesData=s,a&&(l=Ln(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l)}t.pesData=null}else null!=a&&a.size&&Pe.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=Ln(o))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=o}demuxSampleAes(e,t,i){const r=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new fn(this.observer,this.config,t);return this.decrypt(r,n)}decrypt(e,t){return new Promise((i=>{const{audioTrack:r,videoTrack:n}=e;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(()=>{n.samples?t.decryptAvcSamples(n.samples,0,0,(()=>{i(e)})):i(e)})):n.samples&&t.decryptAvcSamples(n.samples,0,0,(()=>{i(e)}))}))}destroy(){this._duration=0}parseAVCPES(e,t,i,r){const n=this.parseAVCNALu(e,i.data);let s,a=this.avcSample,o=!1;i.data=null,a&&n.length&&!e.audFound&&(bn(a,e),a=this.avcSample=mn(!1,i.pts,i.dts,"")),n.forEach((r=>{switch(r.type){case 1:{s=!0,a||(a=this.avcSample=mn(!0,i.pts,i.dts,"")),a.frame=!0;const e=r.data;if(o&&e.length>4){const t=new pn(e).readSliceType();2!==t&&4!==t&&7!==t&&9!==t||(a.key=!0)}break}case 5:s=!0,a||(a=this.avcSample=mn(!0,i.pts,i.dts,"")),a.key=!0,a.frame=!0;break;case 6:s=!0,Bt(r.data,1,i.pts,t.samples);break;case 7:if(s=!0,o=!0,!e.sps){const t=r.data,i=new pn(t).readSPS();e.width=i.width,e.height=i.height,e.pixelRatio=i.pixelRatio,e.sps=[t],e.duration=this._duration;const n=t.subarray(1,4);let s="avc1.";for(let e=0;e<3;e++){let t=n[e].toString(16);t.length<2&&(t="0"+t),s+=t}e.codec=s}break;case 8:s=!0,e.pps||(e.pps=[r.data]);break;case 9:s=!1,e.audFound=!0,a&&bn(a,e),a=this.avcSample=mn(!1,i.pts,i.dts,"");break;case 12:s=!0;break;default:s=!1,a&&(a.debug+="unknown NAL "+r.type+" ")}a&&s&&a.units.push(r)})),r&&a&&(bn(a,e),this.avcSample=null)}getLastNalUnit(e){var t;let i,r=this.avcSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){const e=r.units;i=e[e.length-1]}return i}parseAVCNALu(e,t){const i=t.byteLength;let r=e.naluState||0;const n=r,s=[];let a,o,l,c=0,u=-1,d=0;for(-1===r&&(u=0,d=31&t[0],r=0,c=1);c<i;)if(a=t[c++],r)if(1!==r)if(a)if(1===a){if(u>=0){const e={data:t.subarray(u,c-r-1),type:d};s.push(e)}else{const i=this.getLastNalUnit(e.samples);if(i&&(n&&c<=4-n&&i.state&&(i.data=i.data.subarray(0,i.data.byteLength-n)),o=c-r-1,o>0)){const e=new Uint8Array(i.data.byteLength+o);e.set(i.data,0),e.set(t.subarray(0,o),i.data.byteLength),i.data=e,i.state=0}}c<i?(l=31&t[c],u=c,d=l,r=0):r=-1}else r=0;else r=3;else r=a?0:2;else r=a?0:1;if(u>=0&&r>=0){const e={data:t.subarray(u,i),type:d,state:r};s.push(e)}if(0===s.length){const i=this.getLastNalUnit(e.samples);if(i){const e=new Uint8Array(i.data.byteLength+t.byteLength);e.set(i.data,0),e.set(t,i.data.byteLength),i.data=e}}return e.naluState=r,s}parseAACPES(e,t){let i=0;const r=this.aacOverFlow;let n,s,a,o=t.data;if(r){this.aacOverFlow=null;const t=r.missing,n=r.sample.unit.byteLength;if(-1===t){const e=new Uint8Array(n+o.byteLength);e.set(r.sample.unit,0),e.set(o,n),o=e}else{const s=n-t;r.sample.unit.set(o.subarray(0,t),s),e.samples.push(r.sample),i=r.missing}}for(n=i,s=o.length;n<s-1&&!Vr(o,n);n++);if(n!==i){let e;const t=n<s-1;e=t?`AAC PES did not start with ADTS header,offset:${n}`:"No ADTS header found in AAC PES";const i=new Error(e);if(Pe.warn(`parsing error: ${e}`),this.observer.emit(Ce.ERROR,Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:i,reason:e}),!t)return}if(Xr(e,this.observer,o,n,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!r)return void Pe.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=Jr(e.samplerate);a=r.sample.pts+t}}let l,c=0;for(;n<s;){if(l=en(e,o,n,a,c),n+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;n<s-1&&!Vr(o,n);n++);}}parseMPEGPES(e,t){const i=t.data,r=i.length;let n=0,s=0;const a=t.pts;if(void 0!==a)for(;s<r;)if(dn(i,s)){const t=ln(e,i,s,a,n);if(!t)break;s+=t.length,n++}else s++;else Pe.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseID3PES(e,t){if(void 0===t.pts)return void Pe.warn("[tsdemuxer]: ID3 PES unknown PTS");const i=Ae({},t,{type:this._avcTrack?Ai:Si,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function mn(e,t,i,r){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:r,length:0}}function vn(e,t){return((31&e[t+1])<<8)+e[t+2]}function Mn(e,t){return(31&e[t+10])<<8|e[t+11]}function Tn(e,t,i,r){const n={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<s;){const s=vn(e,t);switch(e[t]){case 207:if(!r){Pe.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===n.audio&&(n.audio=s);break;case 21:-1===n.id3&&(n.id3=s);break;case 219:if(!r){Pe.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===n.avc&&(n.avc=s);break;case 3:case 4:!0!==i.mpeg&&!0!==i.mp3?Pe.log("MPEG audio found, not supported in this browser"):-1===n.audio&&(n.audio=s,n.segmentCodec="mp3");break;case 36:Pe.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return n}function Ln(e){let t,i,r,n,s,a=0;const o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;){const e=new Uint8Array(o[0].length+o[1].length);e.set(o[0]),e.set(o[1],o[0].length),o[0]=e,o.splice(1,1)}if(t=o[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if(i=(t[4]<<8)+t[5],i&&i>e.size-6)return null;const l=t[7];192&l&&(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,n-s>54e5&&(Pe.warn(`${Math.round((n-s)/9e4)}s delta between PTS and DTS, align them`),n=s)):s=n),r=t[8];let c=r+9;if(e.size<=c)return null;e.size-=c;const u=new Uint8Array(e.size);for(let e=0,i=o.length;e<i;e++){t=o[e];let i=t.byteLength;if(c){if(c>i){c-=i;continue}t=t.subarray(c),i-=c,c=0}u.set(t,a),a+=i}return i&&(i-=r+3),{data:u,pts:n,dts:s,len:i}}return null}function bn(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const i=t.samples,r=i.length;if(!r)return void t.dropped++;{const t=i[r-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&Pe.log(e.pts+"/"+e.dts+":"+e.debug)}class En{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const In=Math.pow(2,32)-1;class Nn{static init(){let e;for(e in Nn.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:[]},Nn.types)Nn.types.hasOwnProperty(e)&&(Nn.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),i=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]);Nn.HDLR_TYPES={video:t,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);Nn.STTS=Nn.STSC=Nn.STCO=n,Nn.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Nn.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Nn.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Nn.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);Nn.FTYP=Nn.box(Nn.types.ftyp,s,o,s,a),Nn.DINF=Nn.box(Nn.types.dinf,Nn.box(Nn.types.dref,r))}static box(e,...t){let i=8,r=t.length;const n=r;for(;r--;)i+=t[r].byteLength;const s=new Uint8Array(i);for(s[0]=i>>24&255,s[1]=i>>16&255,s[2]=i>>8&255,s[3]=255&i,s.set(e,4),r=0,i=8;r<n;r++)s.set(t[r],i),i+=t[r].byteLength;return s}static hdlr(e){return Nn.box(Nn.types.hdlr,Nn.HDLR_TYPES[e])}static mdat(e){return Nn.box(Nn.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(In+1)),r=Math.floor(t%(In+1));return Nn.box(Nn.types.mdhd,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,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(e){return Nn.box(Nn.types.mdia,Nn.mdhd(e.timescale,e.duration),Nn.hdlr(e.type),Nn.minf(e))}static mfhd(e){return Nn.box(Nn.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?Nn.box(Nn.types.minf,Nn.box(Nn.types.smhd,Nn.SMHD),Nn.DINF,Nn.stbl(e)):Nn.box(Nn.types.minf,Nn.box(Nn.types.vmhd,Nn.VMHD),Nn.DINF,Nn.stbl(e))}static moof(e,t,i){return Nn.box(Nn.types.moof,Nn.mfhd(e),Nn.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=Nn.trak(e[t]);return Nn.box.apply(null,[Nn.types.moov,Nn.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(Nn.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=Nn.trex(e[t]);return Nn.box.apply(null,[Nn.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(In+1)),r=Math.floor(t%(In+1)),n=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,r>>24,r>>16&255,r>>8&255,255&r,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 Nn.box(Nn.types.mvhd,n)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let r,n;for(r=0;r<t.length;r++)n=t[r].flags,i[r+4]=n.dependsOn<<4|n.isDependedOn<<2|n.hasRedundancy;return Nn.box(Nn.types.sdtp,i)}static stbl(e){return Nn.box(Nn.types.stbl,Nn.stsd(e),Nn.box(Nn.types.stts,Nn.STTS),Nn.box(Nn.types.stsc,Nn.STSC),Nn.box(Nn.types.stsz,Nn.STSZ),Nn.box(Nn.types.stco,Nn.STCO))}static avc1(e){let t,i,r,n=[],s=[];for(t=0;t<e.sps.length;t++)i=e.sps[t],r=i.byteLength,n.push(r>>>8&255),n.push(255&r),n=n.concat(Array.prototype.slice.call(i));for(t=0;t<e.pps.length;t++)i=e.pps[t],r=i.byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(i));const a=Nn.box(Nn.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|e.sps.length].concat(n).concat([e.pps.length]).concat(s))),o=e.width,l=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return Nn.box(Nn.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,o>>8&255,255&o,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,Nn.box(Nn.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Nn.box(Nn.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,u>>24,u>>16&255,u>>8&255,255&u])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return Nn.box(Nn.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,t>>8&255,255&t,0,0]),Nn.box(Nn.types.esds,Nn.esds(e)))}static mp3(e){const t=e.samplerate;return Nn.box(Nn.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,t>>8&255,255&t,0,0]))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?Nn.box(Nn.types.stsd,Nn.STSD,Nn.mp3(e)):Nn.box(Nn.types.stsd,Nn.STSD,Nn.mp4a(e)):Nn.box(Nn.types.stsd,Nn.STSD,Nn.avc1(e))}static tkhd(e){const t=e.id,i=e.duration*e.timescale,r=e.width,n=e.height,s=Math.floor(i/(In+1)),a=Math.floor(i%(In+1));return Nn.box(Nn.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a,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,r>>8&255,255&r,0,0,n>>8&255,255&n,0,0]))}static traf(e,t){const i=Nn.sdtp(e),r=e.id,n=Math.floor(t/(In+1)),s=Math.floor(t%(In+1));return Nn.box(Nn.types.traf,Nn.box(Nn.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Nn.box(Nn.types.tfdt,new Uint8Array([1,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s])),Nn.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,Nn.box(Nn.types.trak,Nn.tkhd(e),Nn.mdia(e))}static trex(e){const t=e.id;return Nn.box(Nn.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],r=i.length,n=12+16*r,s=new Uint8Array(n);let a,o,l,c,u,d;for(t+=8+n,s.set(["video"===e.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a<r;a++)o=i[a],l=o.duration,c=o.size,u=o.flags,d=o.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a);return Nn.box(Nn.types.trun,s)}static initSegment(e){Nn.types||Nn.init();const t=Nn.moov(e),i=new Uint8Array(Nn.FTYP.byteLength+t.byteLength);return i.set(Nn.FTYP),i.set(t,Nn.FTYP.byteLength),i}}function wn(e,t,i=1,r=!1){const n=e*t*i;return r?Math.round(n):n}function Sn(e,t=!1){return wn(e,1e3,1/9e4,t)}Nn.types=void 0,Nn.HDLR_TYPES=void 0,Nn.STTS=void 0,Nn.STSC=void 0,Nn.STCO=void 0,Nn.STSZ=void 0,Nn.VMHD=void 0,Nn.SMHD=void 0,Nn.STSD=void 0,Nn.FTYP=void 0,Nn.DINF=void 0;let An,Dn=null,Cn=null;class kn{constructor(e,t,i,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,null===Dn){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Dn=e?parseInt(e[1]):0}if(null===Cn){const e=navigator.userAgent.match(/Safari\/(\d+)/i);Cn=e?parseInt(e[1]):0}}destroy(){}resetTimeStamp(e){Pe.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){Pe.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){Pe.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const i=e.reduce(((e,i)=>{const r=i.pts-e;return r<-4294967296?(t=!0,jn(e,i.pts)):r>0?e:i.pts}),e[0].pts);return t&&Pe.debug("PTS rollover detected"),i}remux(e,t,i,r,n,s,a,o){let l,c,u,d,h,p,f=n,g=n;const y=e.pid>-1,m=t.pid>-1,v=t.samples.length,M=e.samples.length>0,T=a&&v>0||v>1;if((!y||M)&&(!m||T)||this.ISGenerated||a){this.ISGenerated||(u=this.generateIS(e,t,n,s));const i=this.isVideoContiguous;let r,a=-1;if(T&&(a=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!i&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,a>0){Pe.warn(`[mp4-remuxer]: Dropped ${a} out of ${v} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,g+=(t.samples[0].pts-e)/t.inputTimeScale,r=g}else-1===a&&(Pe.warn(`[mp4-remuxer]: No keyframe found out of ${v} video samples`),p=!1);if(this.ISGenerated){if(M&&T){const i=this.getVideoStartPts(t.samples),r=(jn(e.samples[0].pts,i)-i)/t.inputTimeScale;f+=Math.max(0,r),g+=Math.max(0,-r)}if(M){if(e.samplerate||(Pe.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,n,s)),c=this.remuxAudio(e,f,this.isAudioContiguous,s,m||T||o===vi?g:void 0),T){const r=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(Pe.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,n,s)),l=this.remuxVideo(t,g,i,r)}}else T&&(l=this.remuxVideo(t,g,i,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(h=xn(i,n,this._initPTS,this._initDTS)),r.samples.length&&(d=_n(r,n,this._initPTS))),{audio:c,video:l,initSegment:u,independent:p,text:d,id3:h}}generateIS(e,t,i,r){const n=e.samples,s=t.samples,a=this.typeSupported,o={},l=this._initPTS;let c,u,d,h=!l||r,p="audio/mp4";if(h&&(c=u=1/0),e.config&&n.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(a.mpeg?(p="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3")),o.audio={id:"audio",container:p,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):Nn.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(d=e.inputTimeScale,l&&d===l.timescale?h=!1:c=u=n[0].pts-Math.round(d*i))),t.sps&&t.pps&&s.length&&(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Nn.initSegment([t]),metadata:{width:t.width,height:t.height}},h))if(d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(s),t=Math.round(d*i);u=Math.min(u,jn(s[0].dts,e)-t),c=Math.min(c,e-t)}if(Object.keys(o).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:c,timescale:d},this._initDTS={baseTime:u,timescale:d}):c=d=void 0,{tracks:o,initPTS:c,timescale:d}}remuxVideo(e,t,i,r){const n=e.inputTimeScale,s=e.samples,a=[],o=s.length,l=this._initPTS;let c,u,d=this.nextAvcDts,h=8,p=this.videoSampleDuration,f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,y=!1;i&&null!==d||(d=t*n-(s[0].pts-jn(s[0].dts,s[0].pts)));const m=l.baseTime*n/l.timescale;for(let e=0;e<o;e++){const t=s[e];t.pts=jn(t.pts-m,d),t.dts=jn(t.dts-m,d),t.dts<s[e>0?e-1:e].dts&&(y=!0)}y&&s.sort((function(e,t){const i=e.dts-t.dts,r=e.pts-t.pts;return i||r})),c=s[0].dts,u=s[s.length-1].dts;const v=u-c,M=v?Math.round(v/(o-1)):p||e.inputTimeScale/30;if(i){const e=c-d,t=e>M,i=e<-1;if((t||i)&&(t?Pe.warn(`AVC: ${Sn(e,!0)} ms (${e}dts) hole between fragments detected, filling it`):Pe.warn(`AVC: ${Sn(-e,!0)} ms (${e}dts) overlapping between fragments detected`),!i||d>s[0].pts)){c=d;const t=s[0].pts-e;s[0].dts=c,s[0].pts=t,Pe.log(`Video: First PTS/DTS adjusted: ${Sn(t,!0)}/${Sn(c,!0)}, delta: ${Sn(e,!0)} ms`)}}c=Math.max(0,c);let T=0,L=0;for(let e=0;e<o;e++){const t=s[e],i=t.units,r=i.length;let n=0;for(let e=0;e<r;e++)n+=i[e].data.length;L+=n,T+=r,t.length=n,t.dts=Math.max(t.dts,c),f=Math.min(t.pts,f),g=Math.max(t.pts,g)}u=s[o-1].dts;const b=L+4*T+8;let E;try{E=new Uint8Array(b)}catch(e){return void this.observer.emit(Ce.ERROR,Ce.ERROR,{type:ke.MUX_ERROR,details:je.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:b,reason:`fail allocating video mdat ${b}`})}const I=new DataView(E.buffer);I.setUint32(0,b),E.set(Nn.types.mdat,4);let N=!1,w=Number.POSITIVE_INFINITY,S=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,D=Number.NEGATIVE_INFINITY;for(let e=0;e<o;e++){const t=s[e],i=t.units;let l,c=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],r=t.data,n=t.data.byteLength;I.setUint32(h,n),h+=4,E.set(r,h),h+=n,c+=4+n}if(e<o-1)p=s[e+1].dts-t.dts,l=s[e+1].pts-t.pts;else{const i=this.config,a=e>0?t.dts-s[e-1].dts:M;if(l=e>0?t.pts-s[e-1].pts:M,i.stretchShortVideoTrack&&null!==this.nextAudioPts){const e=Math.floor(i.maxBufferHole*n),s=(r?f+r*n:this.nextAudioPts)-t.pts;s>e?(p=s-a,p<0?p=a:N=!0,Pe.log(`[mp4-remuxer]: It is approximately ${s/90} ms to the next segment; using duration ${p/90} ms for the last video frame.`)):p=a}else p=a}const u=Math.round(t.pts-t.dts);w=Math.min(w,p),A=Math.max(A,p),S=Math.min(S,l),D=Math.max(D,l),a.push(new On(t.key,p,c,u))}if(a.length)if(Dn){if(Dn<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(Cn&&D-S<A-w&&M/A<.025&&0===a[0].cts){Pe.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=c;for(let t=0,i=a.length;t<i;t++){const r=e+a[t].duration,n=e+a[t].cts;if(t<i-1){const e=r+a[t+1].cts;a[t].duration=e-n}else a[t].duration=t?a[t-1].duration:M;a[t].cts=0,e=r}}p=N||!p?M:p,this.nextAvcDts=d=u+p,this.videoSampleDuration=p,this.isVideoContiguous=!0;const C={data1:Nn.moof(e.sequenceNumber++,c,Ae({},e,{samples:a})),data2:E,startPTS:f/n,endPTS:(g+p)/n,startDTS:c/n,endDTS:d/n,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,C}remuxAudio(e,t,i,r,n){const s=e.inputTimeScale,a=s/(e.samplerate?e.samplerate:s),o="aac"===e.segmentCodec?1024:1152,l=o*a,c=this._initPTS,u="mp3"===e.segmentCodec&&this.typeSupported.mpeg,d=[],h=void 0!==n;let p=e.samples,f=u?0:8,g=this.nextAudioPts||-1;const y=t*s,m=c.baseTime*s/c.timescale;if(this.isAudioContiguous=i=i||p.length&&g>0&&(r&&Math.abs(y-g)<9e3||Math.abs(jn(p[0].pts-m,y)-g)<20*l),p.forEach((function(e){e.pts=jn(e.pts-m,y)})),!i||g<0){if(p=p.filter((e=>e.pts>=0)),!p.length)return;g=0===n?0:r&&!h?Math.max(0,y):p[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let i=0,r=g;i<p.length;i++){const n=p[i],a=n.pts,o=a-r,c=Math.abs(1e3*o/s);if(o<=-t*l&&h)0===i&&(Pe.warn(`Audio frame @ ${(a/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*o/s)} ms.`),this.nextAudioPts=g=r=a);else if(o>=t*l&&c<1e4&&h){let t=Math.round(o/l);r=a-t*l,r<0&&(t--,r+=l),0===i&&(this.nextAudioPts=g=r),Pe.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(r/s).toFixed(3)}s due to ${Math.round(1e3*o/s)} ms gap.`);for(let s=0;s<t;s++){const t=Math.max(r,0);let s=En.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);s||(Pe.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),s=n.unit.subarray()),p.splice(i,0,{unit:s,pts:t}),r+=l,i++}}n.pts=r,r+=l}}let v,M=null,T=null,L=0,b=p.length;for(;b--;)L+=p[b].unit.byteLength;for(let t=0,r=p.length;t<r;t++){const r=p[t],n=r.unit;let s=r.pts;if(null!==T)d[t-1].duration=Math.round((s-T)/a);else{if(i&&"aac"===e.segmentCodec&&(s=g),M=s,!(L>0))return;L+=f;try{v=new Uint8Array(L)}catch(e){return void this.observer.emit(Ce.ERROR,Ce.ERROR,{type:ke.MUX_ERROR,details:je.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:L,reason:`fail allocating audio mdat ${L}`})}u||(new DataView(v.buffer).setUint32(0,L),v.set(Nn.types.mdat,4))}v.set(n,f);const l=n.byteLength;f+=l,d.push(new On(!0,o,l,0)),T=s}const E=d.length;if(!E)return;const I=d[d.length-1];this.nextAudioPts=g=T+a*I.duration;const N=u?new Uint8Array(0):Nn.moof(e.sequenceNumber++,M/a,Ae({},e,{samples:d}));e.samples=[];const w=M/s,S=g/s,A={data1:N,data2:v,startPTS:w,endPTS:S,startDTS:w,endDTS:S,type:"audio",hasAudio:!0,hasVideo:!1,nb:E};return this.isAudioContiguous=!0,A}remuxEmptyAudio(e,t,i,r){const n=e.inputTimeScale,s=n/(e.samplerate?e.samplerate:n),a=this.nextAudioPts,o=this._initDTS,l=9e4*o.baseTime/o.timescale,c=(null!==a?a:r.startDTS*n)+l,u=r.endDTS*n+l,d=1024*s,h=Math.ceil((u-c)/d),p=En.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(Pe.warn("[mp4-remuxer]: remux empty Audio"),!p)return void Pe.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const f=[];for(let e=0;e<h;e++){const t=c+e*d;f.push({unit:p,pts:t,dts:t})}return e.samples=f,this.remuxAudio(e,t,i,!1)}}function jn(e,t){let i;if(null===t)return e;for(i=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=i;return e}function xn(e,t,i,r){const n=e.samples.length;if(!n)return;const s=e.inputTimeScale;for(let a=0;a<n;a++){const n=e.samples[a];n.pts=jn(n.pts-9e4*i.baseTime/i.timescale,t*s)/s,n.dts=jn(n.dts-9e4*r.baseTime/r.timescale,t*s)/s}const a=e.samples;return e.samples=[],{samples:a}}function _n(e,t,i){const r=e.samples.length;if(!r)return;const n=e.inputTimeScale;for(let s=0;s<r;s++){const r=e.samples[s];r.pts=jn(r.pts-9e4*i.baseTime/i.timescale,t*n)/n}e.samples.sort(((e,t)=>e.pts-t.pts));const s=e.samples;return e.samples=[],{samples:s}}class On{constructor(e,t,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=r,this.flags=new Pn(e)}}class Pn{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}function Rn(e,t){const i=null==e?void 0:e.codec;return i&&i.length>4?i:"hvc1"===i||"hev1"===i?"hvc1.1.c.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||t===Ge?"avc1.42e01e":"mp4a.40.5"}try{An=self.performance.now.bind(self.performance)}catch(e){Pe.debug("Unable to use Performance API on this environment"),An="undefined"!=typeof self&&self.Date.now}const zn=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,i,r){const n=this.videoTrack=Gr("video",1),s=this.audioTrack=Gr("audio",1),a=this.txtTrack=Gr("text",1);if(this.id3Track=Gr("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=Pt(e);if(o.video){const{id:e,timescale:t,codec:i}=o.video;n.id=e,n.timescale=a.timescale=t,n.codec=i}if(o.audio){const{id:e,timescale:t,codec:i}=o.audio;s.id=e,s.timescale=t,s.codec=i}a.id=At.text,n.sampleDuration=0,n.duration=s.duration=r}resetContiguity(){}static probe(e){return _t(e=e.length>16384?e.subarray(0,16384):e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let i=e;const r=this.videoTrack,n=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Ft(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},i=_t(e,["moof"]);if(!i)return t;if(i.length<2)return t.remainder=e,t;const r=i[i.length-1];return t.valid=lt(e,0,r.byteOffset-8),t.remainder=lt(e,r.byteOffset-8),t}(i);this.remainderData=t.remainder,r.samples=t.valid||new Uint8Array}else r.samples=i;const s=this.extractID3Track(r,t);return n.samples=Ut(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(t,this.timeOffset);return i.samples=Ut(e,t),{videoTrack:t,audioTrack:Gr(),id3Track:r,textTrack:Gr()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const r=_t(e.samples,["emsg"]);r&&r.forEach((e=>{const r=function(e){const t=e[0];let i="",r="",n=0,s=0,a=0,o=0,l=0,c=0;if(0===t){for(;"\0"!==Dt(e.subarray(c,c+1));)i+=Dt(e.subarray(c,c+1)),c+=1;for(i+=Dt(e.subarray(c,c+1)),c+=1;"\0"!==Dt(e.subarray(c,c+1));)r+=Dt(e.subarray(c,c+1)),c+=1;r+=Dt(e.subarray(c,c+1)),c+=1,n=kt(e,12),s=kt(e,16),o=kt(e,20),l=kt(e,24),c=28}else if(1===t){c+=4,n=kt(e,c),c+=4;const t=kt(e,c);c+=4;const s=kt(e,c);for(c+=4,a=2**32*t+s,Number.isSafeInteger(a)||(a=Number.MAX_SAFE_INTEGER,Pe.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=kt(e,c),c+=4,l=kt(e,c),c+=4;"\0"!==Dt(e.subarray(c,c+1));)i+=Dt(e.subarray(c,c+1)),c+=1;for(i+=Dt(e.subarray(c,c+1)),c+=1;"\0"!==Dt(e.subarray(c,c+1));)r+=Dt(e.subarray(c,c+1)),c+=1;r+=Dt(e.subarray(c,c+1)),c+=1}return{schemeIdUri:i,value:r,timeScale:n,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:e.subarray(c,e.byteLength)}}(e);if(tn.test(r.schemeIdUri)){const e=De(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale;let n=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;n<=.001&&(n=Number.POSITIVE_INFINITY);const s=r.payload;i.samples.push({data:s,len:s.byteLength,dts:e,pts:e,type:Ai,duration:n})}}))}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(function(e,t){if(!e||!t)return e;const i=t.keyId;return i&&t.isCommonEncryption&&_t(e,["moov","trak"]).forEach((e=>{const t=_t(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let r=_t(t,["enca"]);const n=r.length>0;n||(r=_t(t,["encv"])),r.forEach((e=>{_t(n?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=Rt(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(Pe.log(`[eme] Patching keyId in 'enc${n?"a":"v"}>sinf>>tenc' box: ${Nt(e)} -> ${Nt(i)}`),t.set(i,8))}}))}))})),e}(e,r)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const r=this.initData=Pt(e);t||(t=Rn(r.audio,$e)),i||(i=Rn(r.video,Ge));const n={};r.audio&&r.video?n.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?n.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?n.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:Pe.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=n}remux(e,t,i,r,n,s){var a,o;let{initPTS:l,lastEndTime:c}=this;const u={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};De(c)||(c=this.lastEndTime=n||0);const d=t.samples;if(null==d||!d.length)return u;const h={initPTS:void 0,timescale:1};let p=this.initData;if(null!=(a=p)&&a.length||(this.generateInitSegment(d),p=this.initData),null==(o=p)||!o.length)return Pe.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const f=function(e,t){return _t(t,["moof","traf"]).reduce(((t,i)=>{const r=_t(i,["tfdt"])[0],n=r[0],s=_t(i,["tfhd"]).reduce(((t,i)=>{const s=kt(i,4),a=e[s];if(a){let e=kt(r,4);if(1===n){if(e===wt)return Pe.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=wt+1,e+=kt(r,8)}const i=e/(a.timescale||9e4);if(isFinite(i)&&(null===t||i<t))return i}return t}),null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t}),null)}(p,d),g=null===f?n:f;(function(e,t,i){if(null===e)return!0;const r=t-e.baseTime/e.timescale;return r<0&&Math.abs(r-i)>1}(l,g,n)||h.timescale!==l.timescale&&s)&&(h.initPTS=g-n,this.initPTS=l={baseTime:h.initPTS,timescale:1});const y=function(e,t){let i=0,r=0,n=0;const s=_t(e,["moof","traf"]);for(let e=0;e<s.length;e++){const a=s[e],o=_t(a,["tfhd"])[0],l=t[kt(o,4)];if(!l)continue;const c=l.default,u=kt(o,0)|(null==c?void 0:c.flags);let d=null==c?void 0:c.duration;8&u&&(d=kt(o,2&u?12:8));const h=l.timescale||9e4,p=_t(a,["trun"]);for(let e=0;e<p.length;e++)i=zt(p[e]),!i&&d&&(i=d*kt(p[e],4)),l.type===Ge?r+=i/h:l.type===$e&&(n+=i/h)}if(0===r&&0===n){let t=0;const i=_t(e,["sidx"]);for(let e=0;e<i.length;e++){const r=Ot(i[e]);null!=r&&r.references&&(t+=r.references.reduce(((e,t)=>e+t.info.duration||0),0))}return t}return r||n}(d,p),m=e?g-l.baseTime/l.timescale:c,v=m+y;!function(e,t,i){_t(t,["moof","traf"]).forEach((t=>{_t(t,["tfhd"]).forEach((r=>{const n=kt(r,4),s=e[n];if(!s)return;const a=s.timescale||9e4;_t(t,["tfdt"]).forEach((e=>{const t=e[0];let r=kt(e,4);if(0===t)r-=i*a,r=Math.max(r,0),xt(e,4,r);else{r*=Math.pow(2,32),r+=kt(e,8),r-=i*a,r=Math.max(r,0);const t=Math.floor(r/(wt+1)),n=Math.floor(r%(wt+1));xt(e,4,t),xt(e,8,n)}}))}))}))}(p,d,l.baseTime/l.timescale),y>0?this.lastEndTime=v:(Pe.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const M=!!p.audio,T=!!p.video;let L="";M&&(L+="audio"),T&&(L+="video");const b={data1:d,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:L,hasAudio:M,hasVideo:T,nb:1,dropped:0};return u.audio="audio"===b.type?b:void 0,u.video="audio"!==b.type?b:void 0,u.initSegment=h,u.id3=xn(i,n,l,l),r.samples.length&&(u.text=_n(r,n,l)),u}}},{demux:yn,remux:kn},{demux:class extends Qr{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(dt(e,0)||[]).length;for(let i=e.length;t<i;t++)if(Kr(e,t))return Pe.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&qr(e,t)&&Zr(e,t)<=e.length-t}(e,t)}appendFrame(e,t,i){Xr(e,this.observer,t,i,e.manifestCodec);const r=en(e,t,i,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}},remux:kn},{demux:class extends Qr{resetInitSegment(e,t,i,r){super.resetInitSegment(e,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(dt(e,0)||[]).length;for(let i=e.length;t<i;t++)if(hn(e,t))return Pe.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return un(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,i){if(null!==this.basePTS)return ln(e,t,i,this.basePTS,this.frameIndex)}},remux:kn}];class Fn{constructor(e,t,i,r,n){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=i,this.vendor=r,this.id=n}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,r){const n=i.transmuxing;n.executeStart=An();let s=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;r&&(this.currentTransmuxState=r);const{contiguous:l,discontinuity:c,trackSwitch:u,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=r||a,{audioCodec:f,videoCodec:g,defaultInitPts:y,duration:m,initSegmentData:v}=o,M=function(e,t){let i=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(i=t),i}(s,t);if(M&&"AES-128"===M.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(s,M.key.buffer,M.iv.buffer).then((e=>{const t=this.push(e,null,i);return this.decryptionPromise=null,t})),this.decryptionPromise;{let t=e.softwareDecrypt(s,M.key.buffer,M.iv.buffer);if(i.part>-1&&(t=e.flush()),!t)return n.executeEnd=An(),Un(i);s=new Uint8Array(t)}}const T=this.needsProbing(c,u);if(T){const e=this.configureTransmuxer(s);if(e)return Pe.warn(`[transmuxer] ${e.message}`),this.observer.emit(Ce.ERROR,Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),n.executeEnd=An(),Un(i)}(c||u||p||T)&&this.resetInitSegment(v,f,g,m,t),(c||p||T)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const L=this.transmux(s,M,h,d,i),b=this.currentTransmuxState;return b.contiguous=!0,b.discontinuity=!1,b.trackSwitch=!1,n.executeEnd=An(),L}flush(e){const t=e.transmuxing;t.executeStart=An();const{decrypter:i,currentTransmuxState:r,decryptionPromise:n}=this;if(n)return n.then((()=>this.flush(e)));const s=[],{timeOffset:a}=r;if(i){const t=i.flush();t&&s.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=An(),[Un(e)];const c=o.flush(a);return Yn(c)?c.then((t=>(this.flushRemux(s,t,e),s))):(this.flushRemux(s,c,e),s)}flushRemux(e,t,i){const{audioTrack:r,videoTrack:n,id3Track:s,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;Pe.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const c=this.remuxer.remux(r,n,s,a,l,o,!0,this.id);e.push({remuxResult:c,chunkMeta:i}),i.transmuxing.executeEnd=An()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;t&&i&&(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,r,n){const{demuxer:s,remuxer:a}=this;s&&a&&(s.resetInitSegment(e,t,i,r),a.resetInitSegment(e,t,i,n))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,r,n){let s;return s=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,i,r,n):this.transmuxUnencrypted(e,i,r,n),s}transmuxUnencrypted(e,t,i,r){const{audioTrack:n,videoTrack:s,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(n,s,a,o,t,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(e,t,i,r,n){return this.demuxer.demuxSampleAes(e,t,i).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,i,r,!1,this.id),chunkMeta:n})))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:r,vendor:n}=this;let s;for(let t=0,i=zn.length;t<i;t++)if(zn[t].demux.probe(e)){s=zn[t];break}if(!s)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=s.remux,c=s.demux;o&&o instanceof l||(this.remuxer=new l(i,t,r,n)),a&&a instanceof c||(this.demuxer=new c(i,t,r),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new Ar(this.config)),e}}const Un=e=>({remuxResult:{},chunkMeta:e});function Yn(e){return"then"in e&&e.then instanceof Function}class Bn{constructor(e,t,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n||null}}class $n{constructor(e,t,i,r,n,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n,this.initSegmentChange=s}}var Gn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,r,s,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new n(r,s||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,n=[];if(0===this._eventsCount)return n;for(r in e=this._events)t.call(e,r)&&n.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,s=r.length,a=new Array(s);n<s;n++)a[n]=r[n].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,n,s,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,s),!0;case 6:return u.fn.call(u.context,t,r,n,s,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,n);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,n){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||n&&!o.once||r&&o.context!==r||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||n&&!o[l].once||r&&o[l].context!==r)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o}(Gn);var Qn=me(Gn.exports);const Hn=Br()||{isTypeSupported:()=>!1};class qn{constructor(e,t,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const n=e.config;this.hls=e,this.id=t,this.useWorker=!!n.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const s=(e,t)=>{(t=t||{}).frag=this.frag,t.id=this.id,e===Ce.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new Qn,this.observer.on(Ce.FRAG_DECRYPTED,s),this.observer.on(Ce.ERROR,s);const a={mp4:Hn.isTypeSupported("video/mp4"),mpeg:Hn.isTypeSupported("audio/mpeg"),mp3:Hn.isTypeSupported('audio/mp4; codecs="mp3"')},o=navigator.vendor;if(!this.useWorker||"undefined"==typeof Worker||!n.workerPath&&"function"!=typeof __HLS_WORKER_BUNDLE__)this.transmuxer=new Fn(this.observer,a,n,o,t);else try{n.workerPath?(Pe.log(`loading Web Worker ${n.workerPath} for "${t}"`),this.workerContext=function(e){const t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(n.workerPath)):(Pe.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const i=new Error(`${e.message} (${e.filename}:${e.lineno})`);n.enableWorker=!1,Pe.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(Ce.ERROR,{type:ke.OTHER_ERROR,details:je.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:i})},e.postMessage({cmd:"init",typeSupported:a,vendor:o,id:t,config:JSON.stringify(n)})}catch(e){Pe.warn(`Error setting up "${t}" Web Worker, fallback to inline`,e),this.resetWorker(),this.error=null,this.transmuxer=new Fn(this.observer,a,n,o,t)}}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,i,r,n,s,a,o,l,c){var u,d;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,p=s?s.start:n.start,f=n.decryptdata,g=this.frag,y=!(g&&n.cc===g.cc),m=!(g&&l.level===g.level),v=g?l.sn-g.sn:-1,M=this.part?l.part-this.part.index:-1,T=0===v&&l.id>1&&l.id===(null==g?void 0:g.stats.chunkCount),L=!m&&(1===v||0===v&&(1===M||T&&M<=0)),b=self.performance.now();(m||v||0===n.stats.parsing.start)&&(n.stats.parsing.start=b),!s||!M&&L||(s.stats.parsing.start=b);const E=!(g&&(null==(u=n.initSegment)?void 0:u.url)===(null==(d=g.initSegment)?void 0:d.url)),I=new $n(y,L,o,m,p,E);if(!L||y||E){Pe.log(`[transmuxer-interface, ${n.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${y}\n trackSwitch: ${m}\n contiguous: ${L}\n accurateTimeOffset: ${o}\n timeOffset: ${p}\n initSegmentChange: ${E}`);const e=new Bn(i,r,t,a,c);this.configureTransmuxer(e)}if(this.frag=n,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:f,chunkMeta:l,state:I},e instanceof ArrayBuffer?[e]:[]);else if(h){const t=h.push(e,f,l,I);Yn(t)?(h.async=!0,t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}))):(h.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let i=t.flush(e);Yn(i)||t.async?(Yn(i)||(i=Promise.resolve(i)),i.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}))):this.handleFlushResult(i,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}onWorkerMessage(e){const t=e.data,i=this.hls;switch(t.event){case"init":{var r;const e=null==(r=this.workerContext)?void 0:r.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":Pe[t.data.logType]&&Pe[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data)}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class Wn{constructor(e,t,i,r){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=i,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:i,media:r,stalled:n}=this;if(null===r)return;const{currentTime:s,seeking:a}=r,o=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,s!==e){if(this.moved=!0,null!==n){if(this.stallReported){const e=self.performance.now()-n;Pe.warn(`playback not stuck anymore @${s}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||o)return void(this.stalled=null);if(r.paused&&!a||r.ended||0===r.playbackRate||!Mr.getBuffered(r).length)return;const c=Mr.bufferInfo(r,s,0),u=c.len>0,d=c.nextStart||0;if(!u&&!d)return;if(a){const e=c.len>2,i=!d||t&&t.start<=s||d-s>2&&!this.fragmentTracker.getPartialFragment(s);if(e||i)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var h;const e=Math.max(d,c.start||0)-s,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,i=(null==t||null==(h=t.details)?void 0:h.live)?2*t.details.targetduration:2,r=this.fragmentTracker.getPartialFragment(s);if(e>0&&(e<=i||r))return void this._trySkipBufferHole(r)}const p=self.performance.now();if(null===n)return void(this.stalled=p);const f=p-n;if(!a&&f>=250&&(this._reportStall(c),!this.media))return;const g=Mr.bufferInfo(r,s,i.maxBufferHole);this._tryFixBufferStall(g,f)}_tryFixBufferStall(e,t){const{config:i,fragmentTracker:r,media:n}=this;if(null===n)return;const s=n.currentTime,a=r.getPartialFragment(s);(!a||!this._trySkipBufferHole(a)&&this.media)&&(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-s<i.maxBufferHole)&&t>1e3*i.highBufferWatchdogPeriod&&(Pe.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:i,stallReported:r}=this;if(!r&&i){this.stallReported=!0;const r=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(e)})`);Pe.warn(r.message),t.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:i,media:r}=this;if(null===r)return 0;const n=r.currentTime,s=Mr.bufferInfo(r,n,0),a=n<s.start?s.start:s.nextStart;if(a){const o=s.len<=t.maxBufferHole,l=s.len>0&&s.len<1&&r.readyState<3,c=a-n;if(c>0&&(o||l)){if(c>t.maxBufferHole){const{fragmentTracker:t}=this;let i=!1;if(0===n){const e=t.getAppendedFrag(0,mi);e&&a<e.end&&(i=!0)}if(!i){const i=e||t.getAppendedFrag(n,mi);if(i){let e=!1,r=i.end;for(;r<a;){const i=t.getPartialFragment(r);if(!i){e=!0;break}r+=i.duration}if(e)return 0}}}const s=Math.max(a+.05,n+.1);if(Pe.warn(`skipping hole, adjusting currentTime from ${n} to ${s}`),this.moved=!0,this.stalled=null,r.currentTime=s,e&&!e.gap){const t=new Error(`fragment loaded with buffer holes, seeking from ${n} to ${s}`);i.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,frag:e})}return s}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:i,nudgeRetry:r}=this;if(null===i)return;const n=i.currentTime;if(this.nudgeRetry++,r<e.nudgeMaxRetry){const s=n+(r+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${n} to ${s}`);Pe.warn(a.message),i.currentTime=s,t.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const i=new Error(`Playhead still not moving while enough data buffered @${n} after ${e.nudgeMaxRetry} nudges`);Pe.error(i.message),t.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_STALLED_ERROR,error:i,fatal:!0})}}}class Zn extends Yr{constructor(e,t,i){super(e,t,i,"[stream-controller]",mi),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.on(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Ce.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(Ce.ERROR,this.onError,this),e.on(Ce.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Ce.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(Ce.BUFFER_CREATED,this.onBufferCreated,this),e.on(Ce.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Ce.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ce.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(Ce.ERROR,this.onError,this),e.off(Ce.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Ce.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(Ce.BUFFER_CREATED,this.onBufferCreated,this),e.off(Ce.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Ce.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),this.onMediaDetaching()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:i}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=i.startLevel;-1===e&&(i.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=i.nextAutoLevel),this.level=i.nextLoadLevel=e,this.loadedmetadata=!1}t>0&&-1===e&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=Cr,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Dr}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ur:{var e;const{levels:t,level:i}=this,r=null==t||null==(e=t[i])?void 0:e.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=Cr;break}break}case xr:{var t;const e=self.performance.now(),i=this.retryDate;(!i||e>=i||null!=(t=this.media)&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Cr)}}this.state===Cr&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:r}=this,{config:n,nextLoadLevel:s}=e;if(null===t||!r&&(this.startFragRequested||!n.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(null==i||!i[s])return;const a=i[s],o=this.getMainFwdBufferInfo();if(null===o)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(Ce.BUFFER_EOS,e),void(this.state=Rr)}e.loadLevel!==s&&-1===e.manualLevel&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const c=a.details;if(!c||this.state===Ur||c.live&&this.levelLastLoaded!==s)return this.level=s,void(this.state=Ur);const u=o.len,d=this.getMaxBufferLength(a.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==or){var f;const e=(null!=(f=this.backtrackFragment)?f:p).sn-c.startSN,t=c.fragments[e-1];t&&p.cc===t.cc&&(p=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){const e=this.audioOnly&&!this.altAudio?$e:Ge,t=(e===Ge?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,mi)}p=this.getNextFragmentLoopLoading(p,c,o,mi,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,h))}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);this.fragCurrent=e,r===nr?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}getAppendedFrag(e){const t=this.fragmentTracker.getAppendedFrag(e,mi);return t&&"fragment"in t?t.fragment:t}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,mi)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let i;const r=this.getAppendedFrag(t.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!t.paused&&e){const t=e[this.hls.nextLoadLevel],r=this.fragLastKbps;i=r&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*r)+1:0}else i=0;const n=this.getBufferedFrag(t.currentTime+i);if(n){const e=this.followingBufferedFrag(n);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,i=e.duration,r=Math.max(n.end,t+Math.min(Math.max(i-this.config.maxFragLookUpTolerance,.5*i),.75*i));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case kr:case jr:case xr:case Or:case Pr:this.state=Cr}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new Wn(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(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),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;De(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const i=this.getMainFwdBufferInfo();null!==i&&0!==i.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(Ce.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null}onManifestParsed(e,t){let i,r=!1,n=!1;t.levels.forEach((e=>{i=e.audioCodec,i&&(-1!==i.indexOf("mp4a.40.2")&&(r=!0),-1!==i.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=r&&n&&!function(){var e;const t=$r();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==Cr)return;const r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=Ur)}onLevelLoaded(e,t){var i;const{levels:r}=this,n=t.level,s=t.details,a=s.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${n}`);this.log(`Level ${n} loaded [${s.startSN},${s.endSN}], cc [${s.startCC}, ${s.endCC}] duration:${a}`);const o=r[n],l=this.fragCurrent;!l||this.state!==jr&&this.state!==xr||l.level===t.level&&l.urlId===o.urlId||!l.loader||this.abortCurrentFrag();let c=0;if(s.live||null!=(i=o.details)&&i.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;c=this.alignPlaylists(s,o.details)}if(o.details=s,this.levelLastLoaded=n,this.hls.trigger(Ce.LEVEL_UPDATED,{details:s,level:n}),this.state===Ur){if(this.waitForCdnTuneIn(s))return;this.state=Cr}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const a=s[i.level],o=a.details;if(!o)return this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),void this.fragmentTracker.removeFragment(i);const l=a.videoCodec,c=o.PTSKnown||!o.live,u=null==(t=i.initSegment)?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new qn(this.hls,mi,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=r?r.index:-1,f=-1!==p,g=new Tr(i.level,i.sn,i.stats.chunkCount,n.byteLength,p,f),y=this.initPTS[i.cc];h.push(n,u,d,l,i,r,o.totalduration,c,g,y)}onAudioTrackSwitching(e,t){const i=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;i&&(e.trigger(Ce.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(Ce.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=t.id,r=!!this.hls.audioTracks[i].url;if(r){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=r,this.tick()}onBufferCreated(e,t){const i=t.tracks;let r,n,s=!1;for(const e in i){const t=i[e];if("main"===t.id){if(n=e,r=t,"video"===e){const t=i[e];t&&(this.videoBuffer=t.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${n}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:i,part:r}=t;if(i&&i.type!==mi)return;if(this.fragContextChanged(i))return this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Pr&&(this.state=Cr));const n=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*n.total/(n.buffering.end-n.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}onError(e,t){var i;if(t.fatal)this.state=zr;else switch(t.details){case je.FRAG_GAP:case je.FRAG_PARSING_ERROR:case je.FRAG_DECRYPT_ERROR:case je.FRAG_LOAD_ERROR:case je.FRAG_LOAD_TIMEOUT:case je.KEY_LOAD_ERROR:case je.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(mi,t);break;case je.LEVEL_LOAD_ERROR:case je.LEVEL_LOAD_TIMEOUT:case je.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Ur||(null==(i=t.context)?void 0:i.type)!==fi||(this.state=Cr);break;case je.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case je.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!Mr.getBuffered(e).length){const e=this.state!==Cr?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=Cr,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==$e||this.audioOnly&&!this.altAudio){const e=(t===Ge?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,mi)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking)return void this.log(`could not seek to ${i}, already seeking at ${t}`);const r=Mr.getBuffered(e),n=(r.length?r.start(0):0)-i;n>0&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${n} to match buffer start`),i+=n,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${t}`),e.currentTime=i}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((i=>{const{hls:r}=this;if(!i||this.fragContextChanged(e))return;t.fragmentError=0,this.state=Cr,this.startFragRequested=!1,this.bitrateTest=!1;const n=e.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),r.trigger(Ce.FRAG_LOADED,i),e.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const i="main",{hls:r}=this,{remuxResult:n,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{video:u,text:d,id3:h,initSegment:p}=n,{details:f}=c,g=this.altAudio?void 0:n.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Or,p){p.tracks&&(this._bufferInitSegment(c,p.tracks,o,s),r.trigger(Ce.FRAG_PARSING_INIT_SEGMENT,{frag:o,id:i,tracks:p.tracks}));const e=p.initPTS,t=p.timescale;De(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},r.trigger(Ce.INIT_PTS_FOUND,{frag:o,id:i,initPTS:e,timescale:t}))}if(u&&!1!==n.independent){if(f){const{startPTS:e,endPTS:t,startDTS:i,endDTS:r}=u;if(l)l.elementaryStreams[u.type]={startPTS:e,endPTS:t,startDTS:i,endDTS:r};else if(u.firstKeyFrame&&u.independent&&1===s.id&&(this.couldBacktrack=!0),u.dropped&&u.independent){const i=this.getMainFwdBufferInfo();if((i?i.end:this.getLoadPosition())+this.config.maxBufferHole<(u.firstKeyFramePTS?u.firstKeyFramePTS:e)-this.config.maxBufferHole)return void this.backtrack(o);o.setElementaryStreamInfo(u.type,o.start,t,o.start,r,!0)}o.setElementaryStreamInfo(u.type,e,t,i,r),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(u,o,l,s)}}else if(!1===n.independent)return void this.backtrack(o);if(g){const{startPTS:e,endPTS:t,startDTS:i,endDTS:r}=g;l&&(l.elementaryStreams.audio={startPTS:e,endPTS:t,startDTS:i,endDTS:r}),o.setElementaryStreamInfo($e,e,t,i,r),this.bufferFragmentData(g,o,l,s)}if(f&&null!=h&&null!=(t=h.samples)&&t.length){const e={id:i,frag:o,details:f,samples:h.samples};r.trigger(Ce.FRAG_PARSING_METADATA,e)}if(f&&d){const e={id:i,frag:o,details:f,samples:d.samples};r.trigger(Ce.FRAG_PARSING_USERDATA,e)}}}_bufferInitSegment(e,t,i,r){if(this.state!==Or)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:n,video:s,audiovideo:a}=t;if(n){let t=e.audioCodec;const i=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==n.metadata.channelCount&&-1===i.indexOf("firefox")&&(t="mp4a.40.5")),-1!==i.indexOf("android")&&"audio/mpeg"!==n.container&&(t="mp4a.40.2",this.log(`Android: force audio codec to ${t}`)),e.audioCodec&&e.audioCodec!==t&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${t}"`),n.levelCodec=t,n.id="main",this.log(`Init audio buffer, container:${n.container}, codecs[selected/level/parsed]=[${t||""}/${e.audioCodec||""}/${n.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.attrs.CODECS||""}/${a.codec}]`),this.hls.trigger(Ce.BUFFER_CODECS,t),Object.keys(t).forEach((e=>{const n=t[e].initSegment;null!=n&&n.byteLength&&this.hls.trigger(Ce.BUFFER_APPENDING,{type:e,data:n,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,mi)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Cr}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const i=e.currentTime;if(Mr.isBuffered(e,i)?t=this.getAppendedFrag(i):Mr.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,i=t.level;e&&t.sn===e.sn&&e.level===i&&t.urlId===e.urlId||(this.fragPlaying=t,this.hls.trigger(Ce.FRAG_CHANGED,{frag:t}),e&&e.level===i||this.hls.trigger(Ce.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,i=this.currentFrag;if(i&&De(t)&&De(i.programDateTime)){const e=i.programDateTime+1e3*(t-i.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class Vn{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Kn{constructor(e,t,i,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Vn(e),this.fast_=new Vn(t),this.defaultTTFB_=r,this.ttfb_=new Vn(e)}update(e,t){const{slow_:i,fast_:r,ttfb_:n}=this;i.halfLife!==e&&(this.slow_=new Vn(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new Vn(t,r.getEstimate(),r.getTotalWeight())),n.halfLife!==e&&(this.ttfb_=new Vn(e,n.getEstimate(),n.getTotalWeight()))}sample(e,t){const i=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class Xn{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;return e.length?(i=1===e.length?e[0]:function(e,t){const i=new Uint8Array(t);let r=0;for(let t=0;t<e.length;t++){const n=e[t];i.set(n,r),r+=n.length}return i}(e,t),this.reset(),i):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}function Jn(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!es(e[i].attrs,t[i].attrs))return!1;return!0}function es(e,t){const i=e["STABLE-RENDITION-ID"];return i?i===t["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some((i=>e[i]!==t[i]))}class ts{constructor(e){this.buffered=void 0;const t=(t,i,r)=>{if((i>>>=0)>r-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return e[i][t]};this.buffered={get length(){return e.length},end:i=>t("end",i,e.length),start:i=>t("start",i,e.length)}}}function is(e){const t=[];for(let i=0;i<e.length;i++){const r=e[i];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||t.push(e[i])}return t}class rs{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t){const i=this.queues[t];i.push(e),1===i.length&&this.buffers[t]&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const i=new Promise((e=>{t=e})),r={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,e),i}executeNext(e){const{buffers:t,queues:i}=this,r=t[e],n=i[e];if(n.length){const t=n[0];try{t.execute()}catch(i){Pe.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),t.onError(i),null!=r&&r.updating||(n.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const ns=Br(),ss=/([ha]vc.)(?:\.[^.,]+)+/,as={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},os=function(e){let t=e;return as.hasOwnProperty(e)&&(t=as[e]),String.fromCharCode(t)},ls=15,cs=100,us={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},ds={17:2,18:4,21:6,22:8,23:10,19:13,20:15},hs={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ps={25:2,26:4,29:6,30:8,31:10,27:13,28:15},fs=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class gs{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i="function"==typeof t?t():t;Pe.log(`${this.time} [${e}] ${i}`)}}}const ys=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class ms{constructor(e,t,i,r,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=i||!1,this.background=r||"black",this.flash=n||!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class vs{constructor(e,t,i,r,n,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new ms(t,i,r,n,s)}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Ms{constructor(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(let e=0;e<cs;e++)this.chars.push(new vs);this.logger=e,this.pos=0,this.currPenState=new ms}equals(e){let t=!0;for(let i=0;i<cs;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t}copy(e){for(let t=0;t<cs;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<cs;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>cs&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=cs)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=os(e);this.pos>=cs?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<cs;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<cs;i++){const r=this.chars[i].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Ts{constructor(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(let t=0;t<ls;t++)this.rows.push(new Ms(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}reset(){for(let e=0;e<ls;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let i=0;i<ls;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<ls;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<ls;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<ls;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){const r=i.rows[e].cueStartTime,n=this.logger.time;if(r&&null!==n&&r<n)for(let r=0;r<this.nrRollUpRows;r++)this.rows[t-this.nrRollUpRows+r+1].copy(i.rows[e+r])}}this.currRow=t;const i=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,r=Math.max(t-1,0);i.setCursor(e.indent),e.color=i.chars[r].penState.foreground}const r={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",r=-1;for(let i=0;i<ls;i++){const n=this.rows[i].getTextString();n&&(r=i+1,e?t.push("Row "+r+": '"+n+"'"):t.push(n.trim()))}return t.length>0&&(i=e?"["+t.join(" | ")+"]":t.join("\n")),i}getTextAndFormat(){return this.rows}}class Ls{constructor(e,t,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Ts(i),this.nonDisplayedMemory=new Ts(i),this.lastOutputScreen=new Ts(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){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}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class bs{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const r=new gs;this.channels=[null,new Ls(e,t,r),new Ls(e+1,i,r)],this.cmdHistory={a:null,b:null},this.logger=r}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let i,r,n,s=!1;this.logger.time=e;for(let e=0;e<t.length;e+=2)if(r=127&t[e],n=127&t[e+1],0!==r||0!==n){if(this.logger.log(3,"["+ys([t[e],t[e+1]])+"] -> ("+ys([r,n])+")"),i=this.parseCmd(r,n),i||(i=this.parseMidrow(r,n)),i||(i=this.parsePAC(r,n)),i||(i=this.parseBackgroundAttributes(r,n)),!i&&(s=this.parseChars(r,n),s)){const e=this.currentChannel;e&&e>0?this.channels[e].insertChars(s):this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||s||this.logger.log(2,"Couldn't parse cleaned data "+ys([r,n])+" orig: "+ys([t[e],t[e+1]]))}}parseCmd(e,t){const{cmdHistory:i}=this;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(Is(e,t,i))return Es(null,null,i),this.logger.log(3,"Repeated command ("+ys([e,t])+") is dropped"),!0;const r=20===e||21===e||23===e?1:2,n=this.channels[r];return 20===e||21===e||28===e||29===e?32===t?n.ccRCL():33===t?n.ccBS():34===t?n.ccAOF():35===t?n.ccAON():36===t?n.ccDER():37===t?n.ccRU(2):38===t?n.ccRU(3):39===t?n.ccRU(4):40===t?n.ccFON():41===t?n.ccRDC():42===t?n.ccTR():43===t?n.ccRTD():44===t?n.ccEDM():45===t?n.ccCR():46===t?n.ccENM():47===t&&n.ccEOC():n.ccTO(t-32),Es(e,t,i),this.currentChannel=r,!0}parseMidrow(e,t){let i=0;if((17===e||25===e)&&t>=32&&t<=47){if(i=17===e?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return!!r&&(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+ys([e,t])+")"),!0)}return!1}parsePAC(e,t){let i;const r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(Is(e,t,r))return Es(null,null,r),!0;const n=e<=23?1:2;i=t>=64&&t<=95?1===n?us[e]:hs[e]:1===n?ds[e]:ps[e];const s=this.channels[n];return!!s&&(s.setPAC(this.interpretPAC(i,t)),Es(e,t,r),this.currentChannel=n,!0)}interpretPAC(e,t){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:e};return i=t>95?t-96:t-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r}parseChars(e,t){let i,r=null,n=null;if(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19){let e;e=17===n?t+80:18===n?t+112:t+144,this.logger.log(2,"Special char '"+os(e)+"' in channel "+i),r=[e]}else e>=32&&e<=127&&(r=0===t?[e]:[e,t]);if(r){const i=ys(r);this.logger.log(3,"Char codes = "+i.join(",")),Es(e,t,this.cmdHistory)}return r}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;let i;const r={};16===e||24===e?(i=Math.floor((t-32)/2),r.background=fs[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));const n=e<=23?1:2;return this.channels[n].setBkgData(r),Es(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function Es(e,t,i){i.a=e,i.b=t}function Is(e,t,i){return i.a===e&&i.b===t}class Ns{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var ws=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function i(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const i=t.toLowerCase();return!!~e.indexOf(i)&&i}function r(e){return i(t,e)}function n(e,...t){let i=1;for(;i<arguments.length;i++){const t=arguments[i];for(const i in t)e[i]=t[i]}return e}function s(t,s,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",u=!1,d=t,h=s,p=a,f=null,g="",y=!0,m="auto",v="start",M=50,T="middle",L=50,b="middle";Object.defineProperty(o,"id",n({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",n({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(o,"startTime",n({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",n({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",n({},l,{get:function(){return p},set:function(e){p=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",n({},l,{get:function(){return f},set:function(e){f=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",n({},l,{get:function(){return g},set:function(t){const r=function(t){return i(e,t)}(t);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");g=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",n({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",n({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",n({},l,{get:function(){return v},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",n({},l,{get:function(){return M},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");M=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",n({},l,{get:function(){return T},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",n({},l,{get:function(){return L},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");L=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",n({},l,{get:function(){return b},set:function(e){const t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class Ss{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function As(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+parseFloat(r||0)}const i=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}class Ds{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function Cs(e,t,i,r){const n=r?e.split(r):[e];for(const e in n){if("string"!=typeof n[e])continue;const r=n[e].split(i);2===r.length&&t(r[0],r[1])}}const ks=new ws(0,0,""),js="middle"===ks.align?"middle":"center";function xs(e,t,i){const r=e;function n(){const t=As(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=n(),s(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),s(),t.endTime=n(),s(),function(e,t){const r=new Ds;Cs(e,(function(e,t){let n;switch(e){case"region":for(let n=i.length-1;n>=0;n--)if(i[n].id===t){r.set(e,i[n].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":n=t.split(","),r.integer(e,n[0]),r.percent(e,n[0])&&r.set("snapToLines",!1),r.alt(e,n[0],["auto"]),2===n.length&&r.alt("lineAlign",n[1],["start",js,"end"]);break;case"position":n=t.split(","),r.percent(e,n[0]),2===n.length&&r.alt("positionAlign",n[1],["start",js,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",js,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");let n=r.get("line","auto");"auto"===n&&-1===ks.line&&(n=-1),t.line=n,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",js);let s=r.get("position","auto");"auto"===s&&50===ks.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function _s(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Os{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Ss,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function i(){let e=t.buffer,i=0;for(e=_s(e);i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;const r=e.slice(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.slice(i),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=i();const r=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==r||!r[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let r=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(r?r=!1:e=i(),t.state){case"HEADER":/:/.test(e)?Cs(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new ws(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{xs(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const i=-1!==e.indexOf("--\x3e");if(!e||i&&(r=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Ps=/\r\n|\n\r|\n|\r/g,Rs=function(e,t,i=0){return e.slice(i,i+t.length)===t},zs=function(e){let t=5381,i=e.length;for(;i;)t=33*t^e.charCodeAt(--i);return(t>>>0).toString()};function Fs(e,t,i){return zs(e.toString())+zs(t.toString())+zs(i)}const Us="stpp.ttml.im1t",Ys=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Bs=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,$s={left:"start",center:"center",right:"end",start:"start",end:"end"};function Gs(e,t,i,r){const n=_t(new Uint8Array(e),["mdat"]);if(0===n.length)return void r(new Error("Could not parse IMSC1 mdat"));const s=n.map((e=>bt(e))),a=function(e,t,i=1,r=!1){return wn(e,t,1/i,r)}(t.baseTime,1,t.timescale);try{s.forEach((e=>i(function(e,t){const i=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce(((e,t)=>(e[t]=i.getAttribute(`ttp:${t}`)||r[t],e)),{}),s="preserve"!==i.getAttribute("xml:space"),a=Hs(Qs(i,"styling","style")),o=Hs(Qs(i,"layout","region")),l=Qs(i,"body","[begin]");return[].map.call(l,(e=>{const i=qs(e,s);if(!i||!e.hasAttribute("begin"))return null;const r=Vs(e.getAttribute("begin"),n),l=Vs(e.getAttribute("dur"),n);let c=Vs(e.getAttribute("end"),n);if(null===r)throw Zs(e);if(null===c){if(null===l)throw Zs(e);c=r+l}const u=new ws(r-t,c-t,i);u.id=Fs(u.startTime,u.endTime,u.text);const d=function(e,t,i){const r="http://www.w3.org/ns/ttml#styling";let n=null;const s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return s&&i.hasOwnProperty(s)&&(n=i[s]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce(((i,s)=>{const a=Ws(t,r,s)||Ws(e,r,s)||Ws(n,r,s);return a&&(i[s]=a),i}),{})}(o[e.getAttribute("region")],a[e.getAttribute("style")],a),{textAlign:h}=d;if(h){const e=$s[h];e&&(u.lineAlign=e),u.align=h}return Ae(u,d),u})).filter((e=>null!==e))}(e,a))))}catch(e){r(e)}}function Qs(e,t,i){const r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function Hs(e){return e.reduce(((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e}),{})}function qs(e,t){return[].slice.call(e.childNodes).reduce(((e,i,r)=>{var n;return"br"===i.nodeName&&r?e+"\n":null!=(n=i.childNodes)&&n.length?qs(i,t):t?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}function Ws(e,t,i){return e&&e.hasAttributeNS(t,i)?e.getAttributeNS(t,i):null}function Zs(e){return new Error(`Could not parse ttml timestamp ${e}`)}function Vs(e,t){if(!e)return null;let i=As(e);return null===i&&(Ys.test(e)?i=function(e,t){const i=Ys.exec(e),r=(0|i[4])+(0|i[5])/t.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/t.frameRate}(e,t):Bs.test(e)&&(i=function(e,t){const i=Bs.exec(e),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),i}function Ks(e,t){return!!e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}class Xs{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(Ce.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(Ce.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter(((t,i)=>this.isLevelAllowed(t)&&i<=e));return this.clientRect=null,Xs.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){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())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,t.width||t.height||(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,i){if(null==e||!e.length)return-1;let r=e.length-1;for(let a=0;a<e.length;a+=1){const o=e[a];if((o.width>=t||o.height>=i)&&(n=o,!(s=e[a+1])||n.width!==s.width||n.height!==s.height)){r=a;break}}var n,s;return r}}const Js="[eme]";class ea{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ea.CDMCleanupPromise?[ea.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=Pe.debug.bind(Pe,Js),this.log=Pe.log.bind(Pe,Js),this.warn=Pe.warn.bind(Pe,Js),this.error=Pe.error.bind(Pe,Js),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Ce.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Ce.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Ce.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Ce.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,r=t[e];if(r)return r.licenseUrl;if(e===Xe.WIDEVINE&&i)return i;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(e,t,i)=>!!e&&i.indexOf(e)===t,r=t.map((e=>e.audioCodec)).filter(i),n=t.map((e=>e.videoCodec)).filter(i);return r.length+n.length===0&&n.push("avc1.42e01e"),new Promise(((t,i)=>{const s=e=>{const a=e.shift();this.getMediaKeysPromise(a,r,n).then((e=>t({keySystem:a,mediaKeys:e}))).catch((t=>{e.length?s(e):i(t instanceof ta?t:new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};s(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if("function"!=typeof i){let e=`Configured requestMediaKeySystemAccess is not a function ${i}`;return null===ot&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return i(e,t)}getMediaKeysPromise(e,t,i){const r=function(e,t,i,r){let n;switch(e){case Xe.FAIRPLAY:n=["cenc","sinf"];break;case Xe.WIDEVINE:case Xe.PLAYREADY:n=["cenc"];break;case Xe.CLEARKEY:n=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,i,r){return[{initDataTypes:e,persistentState:r.persistentState||"not-allowed",distinctiveIdentifier:r.distinctiveIdentifier||"not-allowed",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:i.map((e=>({contentType:`video/mp4; codecs="${e}"`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(n,t,i,r)}(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e];let s=null==n?void 0:n.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(r)}`),s=this.requestMediaKeySystemAccess(e,r);const t=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),s.then((i=>{this.log(`Access for key-system "${i.keySystem}" obtained`);const r=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=i.createMediaKeys().then((t=>(this.log(`Media-keys created for "${e}"`),r.then((i=>i?this.setMediaKeysServerCertificate(t,e,i):t))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return s.then((()=>n.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${Nt(e.keyId||[])}`);const r=i.createSession(),n={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),n="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,n,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Nt(e.keyId)}updateKeySession(e,t){var i;const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Nt((null==(i=e.decryptdata)?void 0:i.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),r.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise(((t,i)=>{const r=at(this.config),n=e.map(rt).filter((e=>!!e&&-1!==r.indexOf(e)));return this.getKeySystemSelectionPromise(n).then((({keySystem:e})=>{const r=st(e);r?t(r):i(new Error(`Unable to find format for key-system "${e}"`))})).catch(i)}))}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),r=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${r}`);let n=this.keyIdToKeySessionPromise[i];return n||(n=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(t).then((({keySystem:i,mediaKeys:n})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${r}`),this.attemptSetMediaKeys(i,n).then((()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:i,mediaKeys:n,decryptdata:t});return this.generateRequestWithPreferredKeySession(e,"cenc",t.pssh,"playlist-key")}))))),n.catch((e=>this.handleError(e)))),n}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof ta?this.hls.trigger(Ce.ERROR,e.data):this.hls.trigger(Ce.ERROR,{type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const t=rt(e.keyFormat),i=t?[t]:at(this.config);return this.attemptKeySystemAccess(i)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=at(this.config)),0===e.length)throw new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:i}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===i)return;let r,n;if("sinf"===t&&this.config.drmSystems[Xe.FAIRPLAY]){const e=Dt(new Uint8Array(i));try{const t=Ve(JSON.parse(e).sinf),i=Rt(new Uint8Array(t));if(!i)return;r=i.subarray(8,24),n=Xe.FAIRPLAY}catch(e){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},i=new DataView(e),r=i.getUint32(0);if(e.byteLength!==r&&r>44)return null;if(1886614376!==i.getUint32(4))return null;if(t.version=i.getUint32(8)>>>24,t.version>1)return null;t.systemId=Nt(new Uint8Array(e,12,16));const n=i.getUint32(28);if(0===t.version){if(r-32<n)return null;t.data=new Uint8Array(e,32,n)}else if(1===t.version){t.kids=[];for(let i=0;i<n;i++)t.kids.push(new Uint8Array(e,32+16*i,16))}return t}(i);if(null===e)return;0===e.version&&e.systemId===nt&&e.data&&(r=e.data.subarray(8,24)),n=function(e){if(e===nt)return Xe.WIDEVINE}(e.systemId)}if(!n||!r)return;const s=Nt(r),{keyIdToKeySessionPromise:a,mediaKeySessions:o}=this;let l=a[s];for(let e=0;e<o.length;e++){const n=o[e],c=n.decryptdata;if(c.pssh||!c.keyId)continue;const u=Nt(c.keyId);if(s===u||-1!==c.uri.replace(/-/g,"").indexOf(s)){l=a[u],delete a[u],c.pssh=new Uint8Array(i),c.keyId=r,l=a[s]=l.then((()=>this.generateRequestWithPreferredKeySession(n,t,i,"encrypted-event-key-match")));break}}l||(l=a[s]=this.getKeySystemSelectionPromise([n]).then((({keySystem:e,mediaKeys:n})=>{var a;this.throwIfDestroyed();const o=new Qt("ISO-23001-7",s,null!=(a=st(e))?a:"");return o.pssh=new Uint8Array(i),o.keyId=r,this.attemptSetMediaKeys(e,n).then((()=>{this.throwIfDestroyed();const r=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:n});return this.generateRequestWithPreferredKeySession(r,t,i,"encrypted-event-no-match")}))}))),l.catch((e=>this.handleError(e)))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const r=Promise.all(i).then((()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${e}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===i.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,i,r){var n,s;const a=null==(n=this.config.drmSystems)||null==(s=n[e.keySystem])?void 0:s.generateRequest;if(a)try{const r=a.call(this.hls,t,i,e);if(!r)throw new Error("Invalid response from configured generateRequest filter");t=r.initDataType,i=e.decryptdata.pssh=r.initData?new Uint8Array(r.initData):null}catch(e){var o;if(this.warn(e.message),null!=(o=this.hls)&&o.config.debug)throw e}if(null===i)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${t} length: ${i?i.byteLength:null})`);const c=new Qn;e.mediaKeysSession.onmessage=t=>{const i=e.mediaKeysSession;if(!i)return void c.emit("error",new Error("invalid state"));const{messageType:r,message:n}=t;this.log(`"${r}" message event for session "${i.sessionId}" message size: ${n.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(e,n).catch((e=>{this.handleError(e),c.emit("error",e)})):"license-release"===r?e.keySystem===Xe.FAIRPLAY&&(this.updateKeySession(e,Ke("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${r}"`)},e.mediaKeysSession.onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void c.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const i=e.keyStatus;c.emit("keyStatus",i),"expired"===i&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const u=new Promise(((e,t)=>{c.on("error",t),c.on("keyStatus",(i=>{i.startsWith("usable")?e():"output-restricted"===i?t(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===i?t(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${i}"`)):"expired"===i?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${i}"`)}))}));return e.mediaKeysSession.generateRequest(t,i).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)})).catch((e=>{throw new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>u)).catch((t=>{throw c.removeAllListeners(),this.removeSession(e),t})).then((()=>(c.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,i)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Nt("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Nt(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,i=new(0,t.loader)(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching serverCertificate for "${e}"`),new Promise(((n,s)=>{const a={responseType:"arraybuffer",url:r},o=t.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,i,r)=>{n(e.data)},onError:(t,i,n,o)=>{s(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:n,response:we({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${r}). Status: ${t.code} (${t.text})`))},onTimeout:(t,i,n)=>{s(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:n,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(e,t,i)=>{s(new Error("aborted"))}};i.load(a,l,c)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise(((r,n)=>{e.setServerCertificate(i).then((n=>{this.log(`setServerCertificate ${n?"success":"not supported by CDM"} (${null==i?void 0:i.byteLength}) on "${t}"`),r(e)})).catch((e=>{n(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}setupLicenseXHR(e,t,i,r){const n=this.config.licenseXhrSetup;return n?Promise.resolve().then((()=>{if(!i.decryptdata)throw new Error("Key removed");return n.call(this.hls,e,t,i,r)})).catch((s=>{if(!i.decryptdata)throw s;return e.open("POST",t,!0),n.call(this.hls,e,t,i,r)})).then((i=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:i||r}))):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise(((r,n)=>{const s=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${s}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const i=this.config.licenseResponseCallback;if(i)try{t=i.call(this.hls,a,s,e)}catch(e){this.error(e)}r(t)}else{const o=i.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)n(new ta({type:ke.KEY_SYSTEM_ERROR,details:je.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:s,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${s}). Status: ${a.status} (${a.statusText})`));else{const i=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(e,t).then(r,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,s,e,t).then((({xhr:e,licenseChallenge:t})=>{e.send(t)}))}))}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Qt.clearKeyUriToKeyIdMap();const i=t.length;ea.CDMCleanupPromise=Promise.all(t.map((e=>this.removeSession(e))).concat(null==e?void 0:e.setMediaKeys(null).catch((t=>{this.log(`Could not clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)})))).then((()=>{i&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)})).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)}))}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),t.onmessage=null,t.onkeystatuseschange=null,i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(e);return r>-1&&this.mediaKeySessions.splice(r,1),t.remove().catch((e=>{this.log(`Could not remove session: ${e}`)})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`)}))}}}ea.CDMCleanupPromise=void 0;class ta extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var ia="a",ra="av";class na{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:"m",su:!this.initialized})}catch(e){Pe.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const t=e.frag,i=this.hls.levels[t.level],r=this.getObjectType(t),n={d:1e3*t.duration,ot:r};"v"!==r&&r!==ia&&r!=ra||(n.br=i.bitrate/1e3,n.tb=this.getTopBandwidth(r)/1e3,n.bl=this.getBufferLength(r)),this.apply(e,n)}catch(e){Pe.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;null!=i&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||na.uuid(),this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.registerListeners())}registerListeners(){const e=this.hls;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHED,this.onMediaDetached,this),e.on(Ce.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHED,this.onMediaDetached,this),e.off(Ce.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,r;this.audioBuffer=null==(i=t.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer}createData(){var e;return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){Ae(t,this.createData());const i="i"===t.ot||"v"===t.ot||t.ot===ra;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.useHeaders){const i=na.toHeaders(t);if(!Object.keys(i).length)return;e.headers||(e.headers={}),Ae(e.headers,i)}else{const i=na.toQuery(t);if(!i)return;e.url=na.appendQueryToUri(e.url,i)}}getObjectType(e){const{type:t}=e;return"subtitle"===t?"tt":"initSegment"===e.sn?"i":"audio"===t?ia:"main"===t?this.hls.audioTracks.length?"v":ra:void 0}getTopBandwidth(e){let t,i=0;const r=this.hls;if(e===ia)t=r.audioTracks;else{const e=r.maxAutoLevel,i=e>-1?e+1:r.levels.length;t=r.levels.slice(0,i)}for(const e of t)e.bitrate>i&&(i=e.bitrate);return i>0?i:NaN}getBufferLength(e){const t=this.hls.media,i=e===ia?this.audioBuffer:this.videoBuffer;return i&&t?1e3*Mr.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len:NaN}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new i(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,i,r){t(e),this.loader.load(e,i,r)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new i(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,i,r){t(e),this.loader.load(e,i,r)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],i=e=>!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e,r=e=>Math.round(e),n=e=>100*r(e/100),s={br:r,d:r,bl:n,dl:n,mtp:n,nor:e=>encodeURIComponent(e),rtp:n,tb:r},a=Object.keys(e||{}).sort();for(const r of a){let n=e[r];if(!i(n))continue;if("v"===r&&1===n)continue;if("pr"==r&&1===n)continue;const a=s[r];a&&(n=a(n));const o=typeof n;let l;l="ot"===r||"sf"===r||"st"===r?`${r}=${n}`:"boolean"===o?r:"number"===o?`${r}=${n}`:`${r}=${JSON.stringify(n)}`,t.push(l)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),i={},r=["Object","Request","Session","Status"],n=[{},{},{},{}],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};for(const i of t)n[null!=s[i]?s[i]:1][i]=e[i];for(let e=0;e<n.length;e++){const t=na.serialize(n[e]);t&&(i[`CMCD-${r[e]}`]=t)}return i}static toQuery(e){return`CMCD=${encodeURIComponent(na.serialize(e))}`}static appendQueryToUri(e,t){if(!t)return e;const i=e.includes("?")?"&":"?";return`${e}${i}${t}`}}function sa(e,t,i,r){e&&Object.keys(t).forEach((n=>{const s=e.filter((e=>e.groupId===n)).map((e=>{const s=Ae({},e);return s.details=void 0,s.attrs=new Fe(s.attrs),s.url=s.attrs.URI=aa(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),s.groupId=s.attrs["GROUP-ID"]=t[n],s.attrs["PATHWAY-ID"]=r,s}));e.push(...s)}))}function aa(e,t,i,r){const{HOST:n,PARAMS:s,[i]:a}=r;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return n&&!o&&(l.host=n),s&&Object.keys(s).sort().forEach((e=>{e&&l.searchParams.set(e,s[e])})),l.href}const oa=/^age:\s*[\d.]+\s*$/im;class la{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new Be,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;const n=this.xhrSetup;n?Promise.resolve().then((()=>{if(!this.stats.aborted)return n(i,t.url)})).catch((e=>(i.open("GET",t.url,!0),n(i,t.url)))).then((()=>{this.stats.aborted||this.openAndSendXhr(i,t,e)})).catch((e=>{this.callbacks.onError({code:i.status,text:e.message},t,i,r)})):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const r=this.context.headers,{maxTimeToFirstByteMs:n,maxLoadTimeMs:s}=i.loadPolicy;if(r)for(const t in r)e.setRequestHeader(t,r[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&De(n)?n:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const r=t.readyState,n=this.config;if(!i.aborted&&r>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),n.timeout!==n.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),n.timeout=n.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const r=t.status,s="text"!==t.responseType;if(r>=200&&r<300&&(s&&t.response||null!==t.responseText)){i.loading.end=Math.max(self.performance.now(),i.loading.first);const n=s?t.response:t.responseText,a="arraybuffer"===t.responseType?n.byteLength:n.length;if(i.loaded=i.total=a,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(i,e,n,t),!this.callbacks)return;const l={url:t.responseURL,data:n,code:r};this.callbacks.onSuccess(l,i,e,t)}else{const s=n.loadPolicy.errorRetry;qi(s,i.retry,!1,r)?this.retry(s):(Pe.error(`${r} while loading ${e.url}`),this.callbacks.onError({code:r,text:t.statusText},e,t,i))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(qi(t,this.stats.retry,!0))this.retry(t);else{Pe.warn(`timeout while loading ${this.context.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Qi(e,i.retry),i.retry++,Pe.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&oa.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const ca=/(\d+)-(\d+)\/(\d+)/;class ua{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||da,this.controller=new self.AbortController,this.stats=new Be}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const n=function(e,t){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(Ae({},e.headers))};return e.rangeEnd&&i.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),i}(e,this.controller.signal),s=i.onProgress,a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=l&&De(l)?l:c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(r,e,this.response)}),t.timeout),self.fetch(this.request).then((n=>{this.response=this.loader=n;const o=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(r,e,this.response)}),c-(o-r.loading.start)),!n.ok){const{status:e,statusText:t}=n;throw new ha(t||"fetch, bad network response",e,n)}return r.loading.first=o,r.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=ca.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(De(e))return e}const i=e.get("Content-Length");if(i)return parseInt(i)}(n.headers)||r.total,s&&De(t.highWaterMark)?this.loadProgressively(n,r,e,t.highWaterMark,s):a?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((n=>{const{response:a}=this;self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const l=n[o];l&&(r.loaded=r.total=l);const c={url:a.url,data:n,code:a.status};s&&!De(t.highWaterMark)&&s(r,e,n,a),i.onSuccess(c,r,e,a)})).catch((t=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const n=t&&t.code||0,s=t?t.message:null;i.onError({code:n,text:s},e,t?t.details:null,r)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,r=0,n){const s=new Xn,a=e.body.getReader(),o=()=>a.read().then((a=>{if(a.done)return s.dataLength&&n(t,i,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=a.value,c=l.length;return t.loaded+=c,c<r||s.dataLength?(s.push(l),s.dataLength>=r&&n(t,i,s.flush(),e)):n(t,i,l,e),o()})).catch((()=>Promise.reject()));return o()}}function da(e,t){return new self.Request(e.url,t)}class ha extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const pa=/\s/,fa={newCue(e,t,i,r){const n=[];let s,a,o,l,c;const u=self.VTTCue||self.TextTrackCue;for(let h=0;h<r.rows.length;h++)if(s=r.rows[h],o=!0,l=0,c="",!s.isEmpty()){var d;for(let e=0;e<s.chars.length;e++)pa.test(s.chars[e].uchar)&&o?l++:(c+=s.chars[e].uchar,o=!1);s.cueStartTime=t,t===i&&(i+=1e-4),l>=16?l--:l++;const r=_s(c.trim()),p=Fs(t,i,r);null!=e&&null!=(d=e.cues)&&d.getCueById(p)||(a=new u(t,i,r),a.id=p,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),n.push(a))}return e&&n.length&&(n.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),n.forEach((t=>Ii(e,t)))),n}},ga=we(we({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:la,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new Kn(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(Ce.FRAG_LOADING,this.onFragLoading,this),e.on(Ce.FRAG_LOADED,this.onFragLoaded,this),e.on(Ce.FRAG_BUFFERED,this.onFragBuffered,this),e.on(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Ce.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(Ce.FRAG_LOADING,this.onFragLoading,this),e.off(Ce.FRAG_LOADED,this.onFragLoaded,this),e.off(Ce.FRAG_BUFFERED,this.onFragBuffered,this),e.off(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Ce.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var i;const r=t.frag;this.ignoreFragment(r)||(this.fragCurrent=r,this.partCurrent=null!=(i=t.part)?i:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,i,r){return e+i/t+(r?this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const i=this.hls.config,{total:r,bwEstimate:n}=t.stats;De(r)&&De(n)&&(this.lastLevelLoadSec=8*r/n),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{autoLevelEnabled:r,media:n}=i;if(!e||!n)return;const s=performance.now(),a=t?t.stats:e.stats,o=t?t.duration:e.duration,l=s-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!r||n.paused||!n.playbackRate||!n.readyState)return;const c=i.mainForwardBufferInfo;if(null===c)return;const u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(n.playbackRate);if(l<=Math.max(u,o/(2*d)*1e3))return;const h=c.len/d;if(h>=2*o/d)return;const p=a.loading.first?a.loading.first-a.loading.start:-1,f=a.loaded&&p>-1,g=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:m}=i,v=y[e.level],M=a.total||Math.max(a.loaded,Math.round(o*v.maxBitrate/8));let T=l-p;T<1&&f&&(T=Math.min(l,8*a.loaded/g));const L=f?1e3*a.loaded/T:0,b=L?(M-a.loaded)/L:8*M/g+u/1e3;if(b<=h)return;const E=L?8*L:g;let I,N=Number.POSITIVE_INFINITY;for(I=e.level-1;I>m;I--){const e=y[I].maxBitrate;if(N=this.getTimeToLoadFrag(u/1e3,E,o*e,!y[I].details),N<h)break}N>=b||N>10*o||(i.nextLoadLevel=I,f?this.bwEstimator.sample(l-Math.min(u,p),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),Pe.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${h.toFixed(3)} s\n Estimated load time for current fragment: ${b.toFixed(3)} s\n Estimated load time for down switch fragment: ${N.toFixed(3)} s\n TTFB estimate: ${p}\n Current BW estimate: ${De(g)?(g/1024).toFixed(3):"Unknown"} Kb/s\n New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s\n Aborting and switching to level ${I}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),i.trigger(Ce.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:i}){const r=i?i.stats:t.stats;if(t.type===mi&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const e=i?i.duration:t.duration,n=this.hls.levels[t.level],s=(n.loaded?n.loaded.bytes:0)+r.loaded,a=(n.loaded?n.loaded.duration:0)+e;n.loaded={bytes:s,duration:a},n.realBitrate=Math.round(8*s/a)}if(t.bitrateTest){const e={stats:r,frag:t,part:i,id:t.type};this.onFragBuffered(Ce.FRAG_BUFFERED,e),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:i,part:r}=t,n=null!=r&&r.stats.loaded?r.stats:i.stats;if(n.aborted)return;if(this.ignoreFragment(i))return;const s=n.parsing.end-n.loading.start-Math.min(n.loading.first-n.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==mi||"initSegment"===e.sn}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;let i=this.getNextABRAutoLevel();if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,i)&&t[e].loadError<=t[i].loadError)return e}return-1!==e&&(i=Math.min(e,i)),i}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{maxAutoLevel:r,config:n,minAutoLevel:s,media:a}=i,o=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,u=i.mainForwardBufferInfo,d=(u?u.len:0)/l;let h=this.findBestLevel(c,s,r,d,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(h>=0)return h;Pe.trace(`[abr] ${d?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let p=o?Math.min(o,n.maxStarvationDelay):n.maxStarvationDelay,f=n.abrBandWidthFactor,g=n.abrBandWidthUpFactor;if(!d){const e=this.bitrateTestDelay;e&&(p=(o?Math.min(o,n.maxLoadingDelay):n.maxLoadingDelay)-e,Pe.trace(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),f=g=1)}return h=this.findBestLevel(c,s,r,d+p,f,g),Math.max(h,0)}findBestLevel(e,t,i,r,n,s){var a;const{fragCurrent:o,partCurrent:l,lastLoadedFragLevel:c}=this,{levels:u}=this.hls,d=u[c],h=!(null==d||null==(a=d.details)||!a.live),p=null==d?void 0:d.codecSet,f=l?l.duration:o?o.duration:0,g=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,m=-1;for(let a=i;a>=t;a--){const t=u[a];if(!t||p&&t.codecSet!==p){t&&(y=Math.min(a,y),m=Math.max(a,m));continue}-1!==m&&Pe.trace(`[abr] Skipped level(s) ${y}-${m} with CODECS:"${u[m].attrs.CODECS}"; not compatible with "${d.attrs.CODECS}"`);const i=t.details,o=(l?null==i?void 0:i.partTarget:null==i?void 0:i.averagetargetduration)||f;let v;v=a<=c?n*e:s*e;const M=u[a].maxBitrate,T=this.getTimeToLoadFrag(g,v,M*o,void 0===i);if(Pe.trace(`[abr] level:${a} adjustedbw-bitrate:${Math.round(v-M)} avgDuration:${o.toFixed(1)} maxFetchDuration:${r.toFixed(1)} fetchDuration:${T.toFixed(1)}`),v>M&&(0===T||!De(T)||h&&!this.bitrateTestDelay||T<r))return a}return-1}set nextAutoLevel(e){this._nextAutoLevel=e}},bufferController:class{constructor(e){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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;Pe.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(Ce.MEDIA_ATTACHED,{media:e})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{Pe.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{Pe.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:t}=this;e&&e.src!==t&&Pe.error(`Media element src was set while attaching MediaSource (${t} > ${e.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.BUFFER_RESET,this.onBufferReset,this),e.on(Ce.BUFFER_APPENDING,this.onBufferAppending,this),e.on(Ce.BUFFER_CODECS,this.onBufferCodecs,this),e.on(Ce.BUFFER_EOS,this.onBufferEos,this),e.on(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Ce.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(Ce.FRAG_PARSED,this.onFragParsed,this),e.on(Ce.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.BUFFER_RESET,this.onBufferReset,this),e.off(Ce.BUFFER_APPENDING,this.onBufferAppending,this),e.off(Ce.BUFFER_CODECS,this.onBufferCodecs,this),e.off(Ce.BUFFER_EOS,this.onBufferEos,this),e.off(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Ce.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(Ce.FRAG_PARSED,this.onFragParsed,this),e.off(Ce.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new rs(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestParsed(e,t){let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,Pe.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const i=this.media=t.media;if(i&&ns){const e=this.mediaSource=new ns;e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(e),this._objectUrl=i.src,i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:i}=this;if(t){if(Pe.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){Pe.warn(`[buffer-controller]: onMediaDetaching: ${e.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):Pe.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(Ce.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(t){Pe.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,t)}})),this._initSourceBuffer()}onBufferCodecs(e,t){const i=this.getSourceBufferTypes().length;Object.keys(t).forEach((e=>{if(i){const i=this.tracks[e];if(i&&"function"==typeof i.buffer.changeType){const{id:r,codec:n,levelCodec:s,container:a,metadata:o}=t[e],l=(i.levelCodec||i.codec).replace(ss,"$1"),c=(s||n).replace(ss,"$1");if(l!==c){const t=`${a};codecs=${s||n}`;this.appendChangeType(e,t),Pe.log(`[buffer-controller]: switching codec ${l} to ${c}`),this.tracks[e]={buffer:i.buffer,codec:n,container:a,levelCodec:s,metadata:o,id:r}}}}else this.pendingTracks[e]=t[e]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:i}=this,r={execute:()=>{const r=this.sourceBuffer[e];r&&(Pe.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),r.changeType(t)),i.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{Pe.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,t)}};i.append(r,e)}onBufferAppending(e,t){const{hls:i,operationQueue:r,tracks:n}=this,{data:s,type:a,frag:o,part:l,chunkMeta:c}=t,u=c.buffering[a],d=self.performance.now();u.start=d;const h=o.stats.buffering,p=l?l.stats.buffering:null;0===h.start&&(h.start=d),p&&0===p.start&&(p.start=d);const f=n.audio;let g=!1;"audio"===a&&"audio/mpeg"===(null==f?void 0:f.container)&&(g=!this.lastMpegAudioChunk||1===c.id||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const y=o.start,m={execute:()=>{if(u.executeStart=self.performance.now(),g){const e=this.sourceBuffer[a];if(e){const t=y-e.timestampOffset;Math.abs(t)>=.1&&(Pe.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${y} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=y)}}this.appendExecutor(s,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();u.executeEnd=u.end=e,0===h.first&&(h.first=e),p&&0===p.first&&(p.first=e);const{sourceBuffer:t}=this,i={};for(const e in t)i[e]=Mr.getBuffered(t[e]);this.appendError=0,this.hls.trigger(Ce.BUFFER_APPENDED,{type:a,frag:o,part:l,chunkMeta:c,parent:o.type,timeRanges:i})},onError:e=>{Pe.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,e);const t={type:ke.MEDIA_ERROR,parent:o.type,details:je.BUFFER_APPEND_ERROR,frag:o,part:l,chunkMeta:c,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=je.BUFFER_FULL_ERROR:(this.appendError++,t.details=je.BUFFER_APPEND_ERROR,this.appendError>i.config.appendErrorMaxRetry&&(Pe.error(`[buffer-controller]: Failed ${i.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),t.fatal=!0)),i.trigger(Ce.ERROR,t)}};r.append(m,a)}onBufferFlushing(e,t){const{operationQueue:i}=this,r=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(Ce.BUFFER_FLUSHED,{type:e})},onError:t=>{Pe.warn(`[buffer-controller]: Failed to remove from ${e} SourceBuffer`,t)}});t.type?i.append(r(t.type),t.type):this.getSourceBufferTypes().forEach((e=>{i.append(r(e),e)}))}onFragParsed(e,t){const{frag:i,part:r}=t,n=[],s=r?r.elementaryStreams:i.elementaryStreams;s.audiovideo?n.push("audiovideo"):(s.audio&&n.push("audio"),s.video&&n.push("video")),0===n.length&&Pe.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers((()=>{const e=self.performance.now();i.stats.buffering.end=e,r&&(r.stats.buffering.end=e);const t=r?r.stats:i.stats;this.hls.trigger(Ce.FRAG_BUFFERED,{frag:i,part:r,stats:t,id:i.type})}),n)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){const i=this.getSourceBufferTypes().reduce(((e,i)=>{const r=this.sourceBuffer[i];return!r||t.type&&t.type!==i||(r.ending=!0,r.ended||(r.ended=!0,Pe.log(`[buffer-controller]: ${i} sourceBuffer now EOS`))),e&&!(r&&!r.ended)}),!0);i&&(Pe.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)}));const{mediaSource:e}=this;e&&"open"===e.readyState?(Pe.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&Pe.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:i,sourceBuffer:r}=this;if(!i||null===t)return;const n=this.getSourceBufferTypes();if(!n.length)return;const s=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(!De(s)||s<0)return;const a=i.currentTime,o=t.levelTargetDuration,l=Math.max(s,o),c=Math.floor(a/o)*o-l;n.forEach((i=>{const n=r[i];if(n){const r=Mr.getBuffered(n);if(r.length>0&&c>r.start(0)){if(e.trigger(Ce.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(Ce.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(n.ended&&r.end(r.length-1)-a<2*o)return void Pe.info(`[buffer-controller]: Cannot flush ${i} back buffer while SourceBuffer is in ended state`);e.trigger(Ce.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:i})}}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:i,mediaSource:r}=this,n=e.fragments[0].start+e.totalduration,s=i.duration,a=De(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(Pe.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(e)):(n>a&&n>s||!De(s))&&(Pe.log(`[buffer-controller]: Updating Media Source duration to ${n.toFixed(3)}`),r.duration=n)}updateSeekableRange(e){const t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&null!=t&&t.setLiveSeekableRange){const r=Math.max(0,i[0].start),n=Math.max(r,r+e.totalduration);t.setLiveSeekableRange(r,n)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:i}=this,r=Object.keys(i).length;if(r&&!e||2===r){this.createSourceBuffers(i),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(Ce.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((e=>{t.executeNext(e)}));else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const r in e)if(!t[r]){const n=e[r];if(!n)throw Error(`source buffer exists for track ${r}, however track does not`);const s=n.levelCodec||n.codec,a=`${n.container};codecs=${s}`;Pe.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const e=t[r]=i.addSourceBuffer(a),o=r;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[r]={buffer:e,codec:s,container:n.container,levelCodec:n.levelCodec,metadata:n.metadata,id:n.id}}catch(e){Pe.error(`[buffer-controller]: error while trying to add sourceBuffer: ${e.message}`),this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const i=new Error(`${e} SourceBuffer error`);Pe.error(`[buffer-controller]: ${i}`,t),this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.BUFFER_APPENDING_ERROR,error:i,fatal:!1});const r=this.operationQueue.current(e);r&&r.onError(t)}removeExecutor(e,t,i){const{media:r,mediaSource:n,operationQueue:s,sourceBuffer:a}=this,o=a[e];if(!r||!n||!o)return Pe.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void s.shiftAndExecuteNext(e);const l=De(r.duration)?r.duration:1/0,c=De(n.duration)?n.duration:1/0,u=Math.max(0,t),d=Math.min(i,l,c);d>u&&!o.ending?(o.ended=!1,Pe.log(`[buffer-controller]: Removing [${u},${d}] from the ${e} SourceBuffer`),o.remove(u,d)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:i,sourceBuffer:r}=this,n=r[t];if(!n)return Pe.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),void i.shiftAndExecuteNext(t);n.ended=!1,n.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return Pe.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:i}=this,r=t.map((e=>i.appendBlocker(e)));Promise.all(r).then((()=>{e(),t.forEach((e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||i.shiftAndExecuteNext(e)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,i){const r=this.sourceBuffer[e];if(!r)return;const n=i.bind(this,e);this.listeners[e].push({event:t,listener:n}),r.addEventListener(t,n)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach((e=>{t.removeEventListener(e.event,e.listener)}))}},capLevelController:Xs,errorController:class{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=Pe.log.bind(Pe,"[info]:"),this.warn=Pe.warn.bind(Pe,"[warning]:"),this.error=Pe.error.bind(Pe,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(Ce.ERROR,this.onError,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this)}unregisterListeners(){const e=this.hls;e&&(e.off(Ce.ERROR,this.onError,this),e.off(Ce.ERROR,this.onErrorOut,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(null==e?void 0:e.type)===mi?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onError(e,t){var i;if(t.fatal)return;const r=this.hls,n=t.context;switch(t.details){case je.FRAG_LOAD_ERROR:case je.FRAG_LOAD_TIMEOUT:case je.KEY_LOAD_ERROR:case je.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case je.FRAG_GAP:case je.FRAG_PARSING_ERROR:case je.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=2);case je.LEVEL_EMPTY_ERROR:case je.LEVEL_PARSING_ERROR:{var s,a;const e=t.parent===mi?t.level:r.loadLevel;t.details===je.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(a=s.levelDetails)&&a.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case je.LEVEL_LOAD_ERROR:case je.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==n?void 0:n.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level)));case je.AUDIO_TRACK_LOAD_ERROR:case je.AUDIO_TRACK_LOAD_TIMEOUT:case je.SUBTITLE_LOAD_ERROR:case je.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){const e=r.levels[r.loadLevel];if(e&&(n.type===gi&&n.groupId===e.audioGroupId||n.type===yi&&n.groupId===e.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.loadLevel),t.errorAction.action=2,void(t.errorAction.flags=1)}return;case je.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=r.levels[r.loadLevel],i=null==e?void 0:e.attrs["HDCP-LEVEL"];i&&(t.errorAction={action:2,flags:2,hdcpLevel:i})}return;case je.BUFFER_ADD_CODEC_ERROR:case je.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(i=t.level)?i:r.loadLevel));case je.INTERNAL_EXCEPTION:case je.BUFFER_APPENDING_ERROR:case je.BUFFER_APPEND_ERROR:case je.BUFFER_FULL_ERROR:case je.LEVEL_SWITCH_ERROR:case je.BUFFER_STALLED_ERROR:case je.BUFFER_SEEK_OVER_HOLE:case je.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:0,flags:0})}if(t.type===ke.KEY_SYSTEM_ERROR){const e=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,e))}}getPlaylistRetryOrSwitchAction(e,t){var i,r;const n=Gi(this.hls.config.playlistLoadPolicy,e),s=this.playlistError++,a=null==(i=e.response)?void 0:i.code;return qi(n,s,$i(e),a)?{action:5,flags:0,retryConfig:n,retryCount:s}:null!=(r=e.context)&&r.deliveryDirectives?{action:0,flags:0,retryConfig:n||{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},retryCount:s}:this.getLevelSwitchAction(e,t)}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],{fragLoadPolicy:n,keyLoadPolicy:s}=t.config,a=Gi(e.details.startsWith("key")?s:n,e),o=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(r){var l;e.details!==je.FRAG_GAP&&r.fragmentError++;const t=null==(l=e.response)?void 0:l.code;if(qi(a,o,$i(e),t))return{action:5,flags:0,retryConfig:a,retryCount:o}}const c=this.getLevelSwitchAction(e,i);return a&&(c.retryConfig=a,c.retryCount=o),c}getLevelSwitchAction(e,t){const i=this.hls;null==t&&(t=i.loadLevel);const r=this.hls.levels[t];if(r&&(r.loadError++,i.autoLevelEnabled)){var n,s;let t=-1;const a=i.levels,o=null==(n=e.frag)?void 0:n.type,{type:l,groupId:c}=null!=(s=e.context)?s:{};for(let n=a.length;n--;){const s=(n+i.loadLevel)%a.length;if(s!==i.loadLevel&&0===a[s].loadError){const i=a[s];if(e.details===je.FRAG_GAP&&e.frag){const t=a[s].details;if(t){const i=Zi(e.frag,t.fragments,e.frag.start);if(null!=i&&i.gap)continue}}else{if(l===gi&&c===i.audioGroupId||l===yi&&c===i.textGroupId)continue;if(o===vi&&r.audioGroupId===i.audioGroupId||o===Mi&&r.textGroupId===i.textGroupId)continue}t=s;break}}if(t>-1&&i.loadLevel!==t)return e.levelRetry=!0,{action:2,flags:0,nextAutoLevel:t}}return{action:2,flags:1}}onErrorOut(e,t){var i;switch(null==(i=t.errorAction)?void 0:i.action){case 0:break;case 2:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===je.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:r,hdcpLevel:n,nextAutoLevel:s}=i;switch(r){case 0:this.switchLevel(e,s);break;case 1:i.resolved||(i.resolved=this.redundantFailover(e));break;case 2:n&&(t.maxHdcpLevel=_i[_i.indexOf(n)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}i.resolved||this.switchLevel(e,s)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:i}=this,r=e.parent===mi?e.level:t.loadLevel,n=t.levels[r],s=n.url.length,a=e.frag?e.frag.urlId:n.urlId;n.urlId!==a||e.frag&&!n.details||this.penalizeRendition(n,e);for(let o=1;o<s;o++){const l=(a+o)%s,c=i[l];if(!c||Xi(c,e,i[a]))return this.warn(`Switching to Redundant Stream ${l+1}/${s}: "${n.url[l]}" after ${e.details}`),this.playlistError=0,t.levels.forEach((e=>{e.urlId=l})),t.nextLoadLevel=r,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:i}=this,r=i[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};r.lastErrorPerfMs=performance.now(),r.errors.push(t),r.details=e.details,i[e.urlId]=r}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,i){const r=performance.now();if(t){if(this.lastTime){const e=r-this.lastTime,n=i-this.lastDroppedFrames,s=t-this.lastDecodedFrames,a=1e3*n/e,o=this.hls;if(o.trigger(Ce.FPS_DROP,{currentDropped:n,currentDecoded:s,totalDroppedFrames:i}),a>0&&n>o.config.fpsDroppedMonitoringThreshold*s){let e=o.currentLevel;Pe.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(Ce.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:ot,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:fa,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Yr{constructor(e,t,i){super(e,t,i,"[subtitle-stream-controller]",Mi),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Ce.ERROR,this.onError,this),e.on(Ce.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Ce.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(Ce.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Ce.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ce.ERROR,this.onError,this),e.off(Ce.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Ce.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(Ce.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Ce.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=Cr,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:r}=t;if(this.fragPrevious=i,this.state=Cr,!r)return;const n=this.tracksBuffered[this.currentTrackId];if(!n)return;let s;const a=i.start;for(let e=0;e<n.length;e++)if(a>=n[e].start&&a<=n[e].end){s=n[e];break}const o=i.start+i.duration;s?s.end=o:(s={start:a,end:o},n.push(s)),this.fragmentTracker.fragBuffered(i)}onBufferFlushing(e,t){const{startOffset:i,endOffset:r}=t;if(0===i&&r!==Number.POSITIVE_INFINITY){const{currentTrackId:e,levels:n}=this;if(!n.length||!n[e]||!n[e].details)return;const s=r-n[e].details.targetduration;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((e=>{for(let t=0;t<e.length;)if(e[t].end<=s)e.shift();else{if(!(e[t].start<s))break;e[t].start=s,t++}})),this.fragmentTracker.removeFragmentsInRange(i,s,Mi)}}onFragBuffered(e,t){var i;this.loadedmetadata||t.frag.type!==mi||null!=(i=this.media)&&i.buffered.length&&(this.loadedmetadata=!0)}onError(e,t){const i=t.frag;(null==i?void 0:i.type)===Mi&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Dr&&(this.state=Cr))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){Jn(this.levels,t)?this.levels=t.map((e=>new Pi(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Pi(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Mi),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId)return void this.clearInterval();const i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var i;const{details:r,id:n}=t,{currentTrackId:s,levels:a}=this;if(!a.length)return;const o=a[s];if(n>=a.length||n!==s||!o)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(r.live||null!=(i=o.details)&&i.live){const e=this.mainDetails;if(r.deltaUpdateFailed||!e)return;const t=e.fragments[0];o.details?(l=this.alignPlaylists(r,o.details),0===l&&t&&(l=t.start,Ui(r,l))):r.hasProgramDateTime&&e.hasProgramDateTime?(Ir(r,e),l=r.fragments[0].start):t&&(l=t.start,Ui(r,l))}o.details=r,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&r.live||this.setStartPosition(o.details,l),this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===Cr&&(Zi(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,r=t.decryptdata,n=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).catch((e=>{throw n.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((i=>{const r=performance.now();n.trigger(Ce.FRAG_DECRYPTED,{frag:t,payload:i,stats:{tstart:e,tdecrypt:r}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=Cr}))}}doTick(){if(this.media){if(this.state===Cr){const{currentTrackId:e,levels:t}=this,i=t[e];if(!t.length||!i||!i.details)return;const r=i.details,n=r.targetduration,{config:s}=this,a=this.getLoadPosition(),o=Mr.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a-n,s.maxBufferHole),{end:l,len:c}=o,u=this.getFwdBufferInfo(this.media,mi);if(c>this.getMaxBufferLength(null==u?void 0:u.len)+n)return;const d=r.fragments,h=d.length,p=r.edge;let f=null;const g=this.fragPrevious;if(l<p){const{maxFragLookUpTolerance:e}=s;f=Zi(g,d,Math.max(d[0].start,l),e),!f&&g&&g.start<d[0].start&&(f=d[0])}else f=d[h-1];if(!f)return;f=this.mapToInitFragWhenRequired(f),this.fragmentTracker.getState(f)===nr&&this.loadFragment(f,i,l)}}else this.state=Cr}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,i){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,i))}get mediaBufferTimeRanges(){return new ts(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends Ji{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.on(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Ce.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(Ce.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.off(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Ce.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(Ce.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-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))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),is(this.media.textTracks).forEach((e=>{Ni(e)})),this.subtitleTrack=-1,this.media=null)}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,details:r}=t,{trackId:n}=this,s=this.tracksInGroup[n];if(!s)return void this.warn(`Invalid subtitle track id ${i}`);const a=s.details;s.details=t.details,this.log(`subtitle track ${i} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.textGroupIds)return;const i=t.textGroupIds[t.urlId],r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==i){const e=this.tracks.filter((e=>!i||e.groupId===i));this.tracksInGroup=e;const t=this.findTrackId(null==r?void 0:r.name)||this.findTrackId();this.groupId=i||null;const n={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${i}" group-id`),this.hls.trigger(Ce.SUBTITLE_TRACKS_UPDATED,n),-1!==t&&this.setSubtitleTrack(t,r)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId,r)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1}onError(e,t){!t.fatal&&t.context&&t.context.type===yi&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1;const t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(Ce.SUBTITLE_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}toggleTrackModes(e){const{media:t,trackId:i}=this;if(!t)return;const r=is(t.textTracks),n=r.filter((e=>e.groupId===this.groupId));if(-1===e)[].slice.call(r).forEach((e=>{e.mode="disabled"}));else{const e=n[i];e&&(e.mode="disabled")}const s=n[e];s&&(s.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var i;const r=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(-1===e||null!=(i=r[e])&&i.details)||e<-1||e>=r.length)return;this.clearTimer();const n=r[e];if(this.log(`Switching to subtitle-track ${e}`+(n?` "${n.name}" lang:${n.lang} group:${n.groupId}`:"")),this.trackId=e,n){const{id:e,groupId:i="",name:r,type:s,url:a}=n;this.hls.trigger(Ce.SUBTITLE_TRACK_SWITCH,{id:e,groupId:i,name:r,type:s,url:a});const o=this.switchParams(n.url,null==t?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(Ce.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=is(this.media.textTracks);for(let i=0;i<t.length;i++)if("hidden"===t[i].mode)e=i;else if("showing"===t[i].mode){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},timelineController:class{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new Ns(this,"textTrack1"),t=new Ns(this,"textTrack2"),i=new Ns(this,"textTrack3"),r=new Ns(this,"textTrack4");this.cea608Parser1=new bs(1,e,t),this.cea608Parser2=new bs(3,i,r)}e.on(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ce.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(Ce.FRAG_LOADING,this.onFragLoading,this),e.on(Ce.FRAG_LOADED,this.onFragLoaded,this),e.on(Ce.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(Ce.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(Ce.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Ce.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ce.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(Ce.FRAG_LOADING,this.onFragLoading,this),e.off(Ce.FRAG_LOADED,this.onFragLoaded,this),e.off(Ce.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(Ce.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(Ce.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Ce.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(Ce.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,i,r,n){let s=!1;for(let e=n.length;e--;){const r=n[e],u=(a=r[0],o=r[1],l=t,c=i,Math.min(o,c)-Math.max(a,l));if(u>=0&&(r[0]=Math.min(r[0],t),r[1]=Math.max(r[1],i),s=!0,u/(i-t)>.5))return}var a,o,l,c;if(s||n.push([t,i]),this.config.renderTextTracksNatively){const n=this.captionsTracks[e];this.Cues.newCue(n,t,i,r)}else{const n=this.Cues.newCue(null,t,i,r);this.hls.trigger(Ce.CUES_PARSED,{type:"captions",cues:n,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){const{unparsedVttFrags:s}=this;"main"===i&&(this.initPTS[t.cc]={baseTime:r,timescale:n}),s.length&&(this.unparsedVttFrags=[],s.forEach((e=>{this.onFragLoaded(Ce.FRAG_LOADED,e)})))}getExistingTrack(e){const{media:t}=this;if(t)for(let i=0;i<t.textTracks.length;i++){const r=t.textTracks[i];if(r[e])return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:r}=this,{label:n,languageCode:s}=t[e],a=this.getExistingTrack(e);if(a)i[e]=a,Ni(i[e]),Ei(i[e],r);else{const t=this.createTextTrack("captions",n,s);t&&(t[e]=!0,i[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(Ce.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,i){const r=this.media;if(r)return r.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach((t=>{Ni(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Ni(t[e])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],r=i.some((e=>e.textCodec===Us));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Jn(this.tracks,i))return void(this.tracks=i);if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const e=this.media?this.media.textTracks:null;this.tracks.forEach(((t,i)=>{let r;if(e&&i<e.length){let i=null;for(let r=0;r<e.length;r++)if(Ks(e[r],t)){i=e[r];break}i&&(r=i)}if(r)Ni(r);else{const e=this._captionsOrSubtitlesFromCharacteristics(t);r=this.createTextTrack(e,t.name,t.lang),r&&(r.mode="disabled")}r&&(r.groupId=t.groupId,this.textTracks.push(r))}))}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(Ce.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),i=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&i)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const i=`textTrack${t[1]}`,r=this.captionsProperties[i];r&&(r.label=e.name,e.lang&&(r.languageCode=e.lang),r.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:i,cea608Parser2:r,lastSn:n,lastPartIndex:s}=this;if(this.enabled&&i&&r&&t.frag.type===mi){var a,o;const e=t.frag.sn,l=null!=(a=null==t||null==(o=t.part)?void 0:o.index)?a:-1;e===n+1||e===n&&l===s+1||(i.reset(),r.reset()),this.lastSn=e,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:i,payload:r}=t,{initPTS:n,unparsedVttFrags:s}=this;if(i.type===Mi)if(r.byteLength){if(!n[i.cc])return s.push(t),void(n.length&&this.hls.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Missing initial subtitle PTS")}));const e=i.decryptdata,a="stats"in t;if(null==e||!e.encrypted||a){const e=this.tracks[i.level],t=this.vttCCs;t[i.cc]||(t[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),e&&e.textCodec===Us?this._parseIMSC1(i,r):this._parseVTTs(i,r,t)}}else this.hls.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;Gs(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),i.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{Pe.log(`Failed to parse IMSC1: ${t}`),i.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e,t,i){var r;const n=this.hls;!function(e,t,i,r,n,s,a){const o=new Os,l=bt(new Uint8Array(e)).trim().replace(Ps,"\n").split("\n"),c=[],u=function(e,t=1){return wn(e,9e4,1/t)}(t.baseTime,t.timescale);let d,h="00:00.000",p=0,f=0,g=!0;o.oncue=function(e){const t=i[r];let s=i.ccOffset;const a=(p-u)/9e4;null!=t&&t.new&&(void 0!==f?s=i.ccOffset=t.start:function(e,t,i){let r=e[t],n=e[r.prevCC];if(!n||!n.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!=(s=n)&&s.new;){var s;e.ccOffset+=r.start-n.start,r.new=!1,r=n,n=e[r.prevCC]}e.presentationOffset=i}(i,r,a)),a&&(s=a-i.presentationOffset);const o=e.endTime-e.startTime,l=jn(9e4*(e.startTime+s-f),9e4*n)/9e4;e.startTime=Math.max(l,0),e.endTime=Math.max(l+o,0);const d=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(d)),e.id||(e.id=Fs(e.startTime,e.endTime,d)),e.endTime>0&&c.push(e)},o.onparsingerror=function(e){d=e},o.onflush=function(){d?a(d):s(c)},l.forEach((e=>{if(g){if(Rs(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{Rs(e,"LOCAL:")?h=e.slice(6):Rs(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{f=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),n=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(De(t)&&De(i)&&De(r)&&De(n)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=6e4*r,t+=36e5*n,t}(h)/1e3}catch(e){d=e}return}""===e&&(g=!1)}o.parse(e+"\n")})),o.flush()}(null!=(r=e.initSegment)&&r.data?Ft(e.initSegment.data,new Uint8Array(t)):t,this.initPTS[e.cc],i,e.cc,e.start,(t=>{this._appendCues(t,e.level),n.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(i=>{this._fallbackToIMSC1(e,t),Pe.log(`Failed to parse VTT cue: ${i}`),n.trigger(Ce.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})}))}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||Gs(t,this.initPTS[e.cc],(()=>{i.textCodec=Us,this._parseIMSC1(e,t)}),(()=>{i.textCodec="wvtt"}))}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||"disabled"===i.mode)return;e.forEach((e=>Ii(i,e)))}else{const r=this.tracks[t];if(!r)return;const n=r.default?"default":"subtitles"+t;i.trigger(Ce.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}onFragDecrypted(e,t){const{frag:i}=t;if(i.type===Mi){if(!this.initPTS[i.cc])return void this.unparsedVttFrags.push(t);this.onFragLoaded(Ce.FRAG_LOADED,t)}}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:i,cea608Parser2:r}=this;if(!this.enabled||!i||!r)return;const{frag:n,samples:s}=t;if(n.type!==mi||"NONE"!==this.closedCaptionsForLevel(n))for(let e=0;e<s.length;e++){const t=s[e].bytes;if(t){const n=this.extractCea608Data(t);i.addData(s[e].pts,n[0]),r.addData(s[e].pts,n[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:r,type:n}){const{media:s}=this;if(s&&!(s.currentTime<i)){if(!n||"video"===n){const{captionsTracks:e}=this;Object.keys(e).forEach((r=>wi(e[r],t,i)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==r){const{textTracks:e}=this;Object.keys(e).forEach((i=>wi(e[i],t,r)))}}}extractCea608Data(e){const t=[[],[]],i=31&e[0];let r=2;for(let n=0;n<i;n++){const i=e[r++],n=127&e[r++],s=127&e[r++];if((0!==n||0!==s)&&0!=(4&i)){const e=3&i;0!==e&&1!==e||(t[e].push(n),t[e].push(s))}}return t}},audioStreamController:class extends Yr{constructor(e,t,i){super(e,t,i,"[audio-stream-controller]",vi),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.on(Ce.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(Ce.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(Ce.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Ce.ERROR,this.onError,this),e.on(Ce.BUFFER_RESET,this.onBufferReset,this),e.on(Ce.BUFFER_CREATED,this.onBufferCreated,this),e.on(Ce.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(Ce.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(Ce.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(Ce.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.LEVEL_LOADED,this.onLevelLoaded,this),e.off(Ce.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(Ce.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(Ce.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Ce.ERROR,this.onError,this),e.off(Ce.BUFFER_RESET,this.onBufferReset,this),e.off(Ce.BUFFER_CREATED,this.onBufferCreated,this),e.off(Ce.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(Ce.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(Ce.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:i,initPTS:r,timescale:n}){if("main"===i){const e=t.cc;this.initPTS[t.cc]={baseTime:r,timescale:n},this.log(`InitPTS for cc: ${e} found from main: ${r}`),this.videoTrackCC=e,this.state===Fr&&this.tick()}}startLoad(e){if(!this.levels)return this.startPosition=e,void(this.state=Dr);const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),t>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=Cr):(this.loadedmetadata=!1,this.state=_r),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case Cr:this.doTickIdle();break;case _r:{var e;const{levels:t,trackId:i}=this,r=null==t||null==(e=t[i])?void 0:e.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=Fr}break}case xr:{var t;const e=performance.now(),i=this.retryDate;(!i||e>=i||null!=(t=this.media)&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Cr);break}case Fr:{const e=this.waitingData;if(e){const{frag:t,part:i,cache:r,complete:n}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=jr;const e={frag:t,part:i,payload:r.flush(),networkDetails:null};this._handleFragmentLoadProgress(e),n&&super._handleFragmentLoadComplete(e)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),i=Mr.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole);Vi(i.end,this.config.maxFragLookUpTolerance,t)<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${i.end} is needed`),this.clearWaitingFragment())}}else this.state=Cr}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Cr)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:i,trackId:r}=this,n=e.config;if(null==t||!t[r])return;if(!i&&(this.startFragRequested||!n.startFragPrefetch))return;const s=t[r],a=s.details;if(!a||a.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(a))return void(this.state=_r);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,$e,vi));const l=this.getFwdBufferInfo(o,vi);if(null===l)return;const{bufferedTrack:c,switchingTrack:u}=this;if(!u&&this._streamEnded(l,a))return e.trigger(Ce.BUFFER_EOS,{type:"audio"}),void(this.state=Rr);const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,mi),h=l.len,p=this.getMaxBufferLength(null==d?void 0:d.len);if(h>=p&&!u)return;const f=a.fragments[0].start;let g=l.end;if(u&&i){const e=this.getLoadPosition();c&&u.attrs!==c.attrs&&(g=e),a.PTSKnown&&e<f&&(l.end>f||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=f+.05)}let y=this.getNextFragment(g,a),m=!1;if(y&&this.isLoopLoading(y,g)&&(m=!!y.gap,y=this.getNextFragmentLoopLoading(y,a,l,mi,p)),!y)return void(this.bufferFlushed=!0);const v=d&&y.start>d.end+a.targetduration;if(v||(null==d||!d.len)&&l.len){const e=this.fragmentTracker.getBufferedFrag(y.start,mi);if(null===e)return;if(m||(m=!!e.gap||!!v&&0===d.len),v&&!m||m&&l.nextStart&&l.nextStart<e.end)return}this.loadFragment(y,s,g)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Pi(e)))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=Cr):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Dr),this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.bufferedTrack=null,this.switchingTrack=null}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(Ce.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var i;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:r}=this,{details:n,id:s}=t;if(!r)return void this.warn(`Audio tracks were reset while loading level ${s}`);this.log(`Track ${s} loaded [${n.startSN},${n.endSN}],duration:${n.totalduration}`);const a=r[s];let o=0;if(n.live||null!=(i=a.details)&&i.live){const e=this.mainDetails;if(n.fragments[0]||(n.deltaUpdateFailed=!0),n.deltaUpdateFailed||!e)return;!a.details&&n.hasProgramDateTime&&e.hasProgramDateTime?(Ir(n,e),o=n.fragments[0].start):o=this.alignPlaylists(n,a.details)}a.details=n,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(a.details,o),this.state!==_r||this.waitForCdnTuneIn(n)||(this.state=Cr),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:r,payload:n}=e,{config:s,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);const u=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new qn(this.hls,vi,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[i.cc],p=null==(t=i.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=r?r.index:-1,s=-1!==t,a=new Tr(i.level,i.sn,i.stats.chunkCount,n.byteLength,t,s);d.push(n,p,u,"",i,r,c.totalduration,e,a,h)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new Xn,complete:!1};e.push(new Uint8Array(n)),this.waitingVideoCC=this.videoTrackCC,this.state=Fr}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:i,part:r}=t;var n;if(i.type===vi)if(this.fragContextChanged(i))this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==i.sn){this.fragPrevious=i;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(Ce.AUDIO_TRACK_SWITCHED,we({},e)))}this.fragBufferedComplete(i,r)}else this.loadedmetadata||i.type!==mi||null!=(n=this.videoBuffer||this.media)&&n.buffered.length&&(this.loadedmetadata=!0)}onError(e,t){var i;if(t.fatal)this.state=zr;else switch(t.details){case je.FRAG_GAP:case je.FRAG_PARSING_ERROR:case je.FRAG_DECRYPT_ERROR:case je.FRAG_LOAD_ERROR:case je.FRAG_LOAD_TIMEOUT:case je.KEY_LOAD_ERROR:case je.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(vi,t);break;case je.AUDIO_TRACK_LOAD_ERROR:case je.AUDIO_TRACK_LOAD_TIMEOUT:case je.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==_r||(null==(i=t.context)?void 0:i.type)!==gi||(this.state=Cr);break;case je.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case je.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushed(e,{type:t}){t===$e&&(this.bufferFlushed=!0,this.state===Rr&&(this.state=Cr))}_handleTransmuxComplete(e){var t;const i="audio",{hls:r}=this,{remuxResult:n,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{details:u}=c,{audio:d,text:h,id3:p,initSegment:f}=n;if(!this.fragContextChanged(o)&&u){if(this.state=Or,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=f&&f.tracks&&(this._bufferInitSegment(f.tracks,o,s),r.trigger(Ce.FRAG_PARSING_INIT_SEGMENT,{frag:o,id:i,tracks:f.tracks})),d){const{startPTS:e,endPTS:t,startDTS:i,endDTS:r}=d;l&&(l.elementaryStreams.audio={startPTS:e,endPTS:t,startDTS:i,endDTS:r}),o.setElementaryStreamInfo($e,e,t,i,r),this.bufferFragmentData(d,o,l,s)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=Ae({id:i,frag:o,details:u},p);r.trigger(Ce.FRAG_PARSING_METADATA,e)}if(h){const e=Ae({id:i,frag:o,details:u},h);r.trigger(Ce.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,i){if(this.state!==Or)return;e.video&&delete e.video;const r=e.audio;if(!r)return;r.levelCodec=r.codec,r.id="audio",this.log(`Init audio buffer, container:${r.container}, codecs[parsed]=[${r.codec}]`),this.hls.trigger(Ce.BUFFER_CODECS,e);const n=r.initSegment;if(null!=n&&n.byteLength){const e={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:n};this.hls.trigger(Ce.BUFFER_APPENDING,e)}this.tick()}loadFragment(e,t,i){const r=this.fragmentTracker.getState(e);var n;this.fragCurrent=e,this.switchingTrack||r===nr||r===ar?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(n=t.details)&&n.live&&!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=Fr):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:i,bufferedTrack:r}=this,n=null==r?void 0:r.attrs,s=e.attrs;i&&n&&(n.CHANNELS!==s.CHANNELS||n.NAME!==s.NAME||n.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(Ce.AUDIO_TRACK_SWITCHED,we({},e))}},audioTrackController:class extends Ji{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.on(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(Ce.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(Ce.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.LEVEL_LOADING,this.onLevelLoading,this),e.off(Ce.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(Ce.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(Ce.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:r,details:n}=t,s=this.tracksInGroup[i];if(!s||s.groupId!==r)return void this.warn(`Track with id:${i} and group:${r} not found in active group ${s.groupId}`);const a=s.details;s.details=t.details,this.log(`audio-track ${i} "${s.name}" lang:${s.lang} group:${r} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.audioGroupIds)return;const i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i||null;const e=this.tracks.filter((e=>!i||e.groupId===i));this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),this.tracksInGroup=e;const t={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group:${i}`),this.hls.trigger(Ce.AUDIO_TRACKS_UPDATED,t),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&t.context.type===gi&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn("Invalid id passed to audio-track controller");this.clearTimer();const i=this.currentTrack;t[this.trackId];const r=t[e],{groupId:n,name:s}=r;if(this.log(`Switching to audio-track ${e} "${s}" lang:${r.lang} group:${n}`),this.trackId=e,this.currentTrack=r,this.selectDefaultTrack=!1,this.hls.trigger(Ce.AUDIO_TRACK_SWITCHING,we({},r)),r.details&&!r.details.live)return;const a=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{const t=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(Ce.ERROR,{type:ke.MEDIA_ERROR,details:je.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const r=t[i];if(!this.selectDefaultTrack||r.default){if(!e||e.attrs["STABLE-RENDITION-ID"]===r.attrs["STABLE-RENDITION-ID"])return r.id;if(e.name===r.name&&e.lang===r.lang)return r.id}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,r=t.groupId;let n=t.url;if(e)try{n=e.addDirectives(n)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}this.log(`loading audio-track playlist ${i} "${t.name}" lang:${t.lang} group:${r}`),this.clearTimer(),this.hls.trigger(Ce.AUDIO_TRACK_LOADING,{url:n,id:i,groupId:r,deliveryDirectives:e||null})}}},emeController:ea,cmcdController:na,contentSteeringController:class{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=Pe.log.bind(Pe,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.on(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.on(Ce.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(Ce.MANIFEST_LOADING,this.onManifestLoading,this),e.off(Ce.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(Ce.MANIFEST_PARSED,this.onManifestParsed,this),e.off(Ce.ERROR,this.onError,this))}startLoad(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){const e=Math.max(1e3*this.timeToLoad-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if(2===(null==i?void 0:i.action)&&1===i.flags){let e=this.pathwayPriority;const t=this.pathwayId;this.penalizedPathways[t]||(this.penalizedPathways[t]=performance.now()),!e&&this.levels&&(e=this.levels.reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])),e&&e.length>1&&(this.updatePathwayPriority(e),i.resolved=this.pathwayId!==t)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this.pathwayPriority=e;const i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach((e=>{r-i[e]>3e5&&delete i[e]}));for(let r=0;r<e.length;r++){const n=e[r];if(i[n])continue;if(n===this.pathwayId)return;const s=this.hls.nextLoadLevel,a=this.hls.levels[s];if(t=this.getLevelsForPathway(n),t.length>0){this.log(`Setting Pathway to "${n}"`),this.pathwayId=n,this.hls.trigger(Ce.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[s];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=s);break}}}clonePathways(e){const t=this.levels;if(!t)return;const i={},r={};e.forEach((e=>{const{ID:n,"BASE-ID":s,"URI-REPLACEMENT":a}=e;if(t.some((e=>e.pathwayId===n)))return;const o=this.getLevelsForPathway(s).map((e=>{const t=Ae({},e);t.details=void 0,t.url=aa(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a);const s=new Fe(e.attrs);s["PATHWAY-ID"]=n;const o=s.AUDIO&&`${s.AUDIO}_clone_${n}`,l=s.SUBTITLES&&`${s.SUBTITLES}_clone_${n}`;o&&(i[s.AUDIO]=o,s.AUDIO=o),l&&(r[s.SUBTITLES]=l,s.SUBTITLES=l),t.attrs=s;const c=new Pi(t);return ir(c,"audio",o),ir(c,"text",l),c}));t.push(...o),sa(this.audioTracks,i,a,n),sa(this.subtitleTracks,r,a,n)}))}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;let r;this.loader&&this.loader.destroy(),this.loader=new i(t);try{r=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==r.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+e)}const n={responseType:"json",url:r.href},s=t.steeringManifestLoadPolicy.default,a=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,i,n)=>{this.log(`Loaded steering manifest: "${r}"`);const s=e.data;if(1!==s.VERSION)return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=s;if(a)try{this.uri=new self.URL(a,r).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||i.url),o&&this.clonePathways(o),l&&this.updatePathwayPriority(l)},onError:(e,t,i,r)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let n=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,n);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(n=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,i)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(n,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((()=>{this.loadSteeringManifest(e)}),t)}}});function ya(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(ya):Object.keys(e).reduce(((t,i)=>(t[i]=ya(e[i]),t)),{}):e}class ma{static get version(){return"1.4.1-0.canary.9078"}static isSupported(){return function(){const e=Br();if(!e)return!1;const t=$r(),i=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!i&&!!r}()}static get Events(){return Ce}static get ErrorTypes(){return ke}static get ErrorDetails(){return je}static get DefaultConfig(){return ma.defaultConfig?ma.defaultConfig:ga}static set DefaultConfig(e){ma.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Qn,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,function(e,t){if(self.console&&!0===e||"object"==typeof e){!function(e,...t){t.forEach((function(t){Oe[t]=e[t]?e[t].bind(e):function(e){const t=self.console[e];return t?t.bind(self.console,`[${e}] >`):xe}(t)}))}(e,"debug","log","info","warn","error");try{Oe.log('Debug logs enabled for "Hls instance" in hls.js version 1.4.1-0.canary.9078')}catch(e){Oe=_e}}else Oe=_e}(e.debug||!1);const t=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=ya(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const n=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[n],a=[];r.forEach((r=>{const o=`${e}Loading${r}`,l=t[o];if(void 0!==l&&s){a.push(o);const e=i[n].default;switch(t[n]={default:e},r){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),a.length&&Pe.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${n}": ${JSON.stringify(t[n])}`)})),we(we({},i),t)}(ma.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&function(e){const t=e.loader;t!==ua&&t!==la?(Pe.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=ua,e.progressive=!0,e.enableSoftwareAES=!0,Pe.log("[config]: Progressive streaming enabled, using FetchLoader"))}(t);const{abrController:i,bufferController:r,capLevelController:n,errorController:s,fpsController:a}=t,o=new s(this),l=this.abrController=new i(this),c=this.bufferController=new r(this),u=this.capLevelController=new n(this),d=new a(this),h=new bi(this),p=new ji(this),f=t.contentSteeringController,g=f?new f(this):null,y=this.levelController=new tr(this,g),m=new lr(this),v=new yr(this.config),M=this.streamController=new Zn(this,m,v);u.setStreamController(M),d.setStreamController(M);const T=[h,y,M];g&&T.splice(1,0,g),this.networkControllers=T;const L=[l,c,u,d,p,m];this.audioTrackController=this.createController(t.audioTrackController,T);const b=t.audioStreamController;b&&T.push(new b(this,m,v)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const E=t.subtitleStreamController;E&&T.push(new E(this,m,v)),this.createController(t.timelineController,L),v.emeController=this.emeController=this.createController(t.emeController,L),this.cmcdController=this.createController(t.cmcdController,L),this.latencyController=this.createController(xi,L),this.coreComponents=L,T.push(o);const I=o.onErrorOut;"function"==typeof I&&this.on(Ce.ERROR,I,o)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,r){this._emitter.off(e,t,i,r)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){Pe.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(Ce.ERROR,{type:ke.OTHER_ERROR,details:je.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){Pe.log("destroy"),this.trigger(Ce.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){Pe.log("attachMedia"),this._media=e,this.trigger(Ce.MEDIA_ATTACHING,{media:e})}detachMedia(){Pe.log("detachMedia"),this.trigger(Ce.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,i=this.url,r=this.url=Ie.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});Pe.log(`loadSource:${r}`),t&&i&&i!==r&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(Ce.MANIFEST_LOADING,{url:e})}startLoad(e=-1){Pe.log(`startLoad(${e})`),this.networkControllers.forEach((t=>{t.startLoad(e)}))}stopLoad(){Pe.log("stopLoad"),this.networkControllers.forEach((e=>{e.stopLoad()}))}swapAudioCodec(){Pe.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){Pe.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){return this.levelController.levels||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){Pe.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){Pe.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){Pe.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){Pe.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){Pe.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(Pe.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){_i.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let r;if(r=-1===t&&e&&e.length?e.length-1:t,i)for(let t=r;t--;){const r=e[t].attrs["HDCP-LEVEL"];if(r&&r<=i)return t}return r}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}ma.defaultConfig=void 0;var va,Ma=function(){function e(t,r){i(this,e),s(this,"instance",void 0),s(this,"config",void 0),s(this,"playerSettings",void 0),s(this,"hlsInstance",void 0),this.instance=t,this.config=t.playerConfig,this.playerSettings=r,this.hlsInstance=new ma({enableWorker:!0,lowLatencyMode:!0,backBufferLength:20,abrEwmaFastVoD:1,autoStartLoad:!0,abrBandWidthUpFactor:.95,maxMaxBufferLength:15,abrEwmaDefaultEstimate:50})}return n(e,[{key:"init",value:function(){ma.isSupported()&&(this.hlsInstance.loadSource(this.config.getVideoUrl().videoUrl),this.hlsInstance.attachMedia(this.config.getPlayerElementContainer().querySelector("video")),this.hlsInstance.on(ma.Events.MANIFEST_PARSED,(function(){console.log("MANIFEST_PARSED")})))}}]),e}();function Ta(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=p(e);if(t){var n=p(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return h(this,i)}}!function(e){var t=function(e){u(r,e);var t=Ta(r);function r(){var e;i(this,r);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"pausedPlayer",void 0),e}return n(r,[{key:"setup",value:function(e,t){return!!e&&(this.setMobileEvents(),this.setDesktopEvents(),this.additionalInfoService=t,this.miniPlayer=new le,this.setPlayerConfig(e.body,e.version),this.initPlayer(),this.additionalInfoService&&this.additionalInfoService.init(this,this.playerConfig.getPlayerId(),this.iconService,this.templateService),W.checkIsHls(this.playerConfig.getVideoUrl().videoUrl)&&(this.hls=new Ma(this,void 0)),this.setEvents(),!0)}},{key:"setEvents",value:function(){this.eventInstance=new ye(this)}},{key:"setDesktopEvents",value:function(){this.desktopEvents=new fe.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new fe.Mobile}},{key:"setPlayerConfig",value:function(e,t){this.playerConfig=new ce(t),this.playerConfig.mapConfigData(e)}},{key:"innerPlayerTemplate",value:function(e){this.playerConfig.getPlayerElementContainer().innerHTML=this.templateService.getTemplateByType(e)}},{key:"getPlayerControllers",value:function(){return this.playerControl.getControls(this.playerConfig,this.iconService)}},{key:"initPlayer",value:function(){var e=this;this.innerPlayerTemplate(this.playerConfig),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-portrate--".concat(this.playerConfig.getDevice())),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-orientation--portrait");var t={},i=this.getPlayerControllers();Object.assign(t,{controls:i}),"embedded"===this.playerConfig.getVideoType()&&Object.assign(t,this.playerConfig.getEmbedOrigin()),Object.assign(t,this.playerConfig.getDefaultConfigItems()),Object.assign(t,{ratio:"9:16"}),this.playerConfig.getFullscreenMode()&&Object.assign(t,this.playerConfig.getFullscreenMode());var r=this.playerConfig.getPlayerElementContainer().querySelector(".embed_player");this.plyr=new(de())(r,t),this.playerConfig.setObjectFit(this.plyr,"portrait").then((function(){e.videoService.init(e)})),this.windowService.init(this),this.posterManager.init(this),this.playerConfig.getChapters()&&this.playerControl.initChapters(this.playerConfig.getChapters()),this.devMethodePlayer=new Z.Player(this),this.playerConfig.getShareData()&&this.share.init(this),"mobile"!==this.playerConfig.getDevice()&&this.miniPlayer.init(this.plyr,this.templateService,this.iconService,this.playerConfig.getPlayerType(),this)}},{key:"play",value:function(){this.devMethodePlayer.play()}},{key:"pause",value:function(){this.devMethodePlayer.pause()}},{key:"stop",value:function(){this.devMethodePlayer.stop()}},{key:"preload",value:function(){return this.devMethodePreload}},{key:"enterMiniPlayer",value:function(){return this.devMethodePlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){return this.devMethodePlayer.exitMiniPlayer()}},{key:"destruct",value:function(){var e=this,t=this;return new Promise((function(i){t.additionalInfoService.remove(e),t.additionalInfoService=null,e.plyr.destroy((function(){t=void 0,i(!0)}))}))}}]),r}(oe);e.PortraitType=t;var r=function(e){u(r,e);var t=Ta(r);function r(){var e;i(this,r);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"pausedPlayer",void 0),e}return n(r,[{key:"setup",value:function(e,t){return!!e&&(t&&console.warn("Additional Info is not implemented for Landscape type!"),this.setDesktopEvents(),this.setMobileEvents(),this.miniPlayer=new le,this.setPlayerConfig(e.body,e.version),this.initPlayer(),W.checkIsHls(this.playerConfig.getVideoUrl().videoUrl)&&(this.hls=new Ma(this,void 0)),this.setEvents(),!0)}},{key:"setEvents",value:function(){this.eventInstance=new ye(this)}},{key:"initPlayer",value:function(){var e=this;this.innerPlayerTemplate(this.playerConfig),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-landscape--".concat(this.playerConfig.getDevice())),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-orientation--landscape");var t={},i=this.getPlayerControllers();Object.assign(t,{controls:i}),"embedded"===this.playerConfig.getVideoType()&&Object.assign(t,this.playerConfig.getEmbedOrigin()),Object.assign(t,this.playerConfig.getDefaultConfigItems()),Object.assign(t,{ratio:"16:9"}),this.playerConfig.getFullscreenMode()&&Object.assign(t,this.playerConfig.getFullscreenMode());var r=this.playerConfig.getPlayerElementContainer().querySelector(".embed_player");this.plyr=new(de())(r,t),this.playerConfig.setObjectFit(this.plyr,"landscape").then((function(){e.videoService.init(e)})),this.windowService.init(this),this.posterManager.init(this),this.playerConfig.getChapters()&&this.playerControl.initChapters(this.playerConfig.getChapters()),this.devMethodePlayer=new Z.Player(this),this.playerConfig.getShareData()&&this.share.init(this),"mobile"!==this.playerConfig.getDevice()&&this.miniPlayer.init(this.plyr,this.templateService,this.iconService,this.playerConfig.getPlayerType(),this)}},{key:"getPlayerControllers",value:function(){return this.playerControl.getControls(this.playerConfig,this.iconService)}},{key:"innerPlayerTemplate",value:function(e){this.playerConfig.getPlayerElementContainer().innerHTML=this.templateService.getTemplateByType(e)}},{key:"setPlayerConfig",value:function(e,t){this.playerConfig=new ce(t),this.playerConfig.mapConfigData(e)}},{key:"getPlayer",value:function(){return this.plyr}},{key:"play",value:function(){this.devMethodePlayer.play()}},{key:"pause",value:function(){this.devMethodePlayer.pause()}},{key:"stop",value:function(){this.devMethodePlayer.stop()}},{key:"preload",value:function(){return this.devMethodePreload}},{key:"enterMiniPlayer",value:function(){return this.devMethodePlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){return this.devMethodePlayer.exitMiniPlayer()}},{key:"destruct",value:function(){var e=this,t=this;return new Promise((function(i){t.additionalInfoService.remove(e),t.additionalInfoService=null,e.plyr.destroy((function(){t=void 0,i(!0)}))}))}},{key:"setDesktopEvents",value:function(){this.desktopEvents=new fe.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new fe.Mobile}}]),r}(oe);e.LandscapeType=r}(va||(va={}));const La={AdditionalItemsError:"Array at `{{pointer}}` may not have an additional item `{{key}}`",AdditionalPropertiesError:"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`",AllOfError:"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`",AnyOfError:"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`",ConstError:"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`",containsAnyError:"The array at `{{pointer}}` must contain at least one item",ContainsArrayError:"The property at `{{pointer}}` must not be an array",ContainsError:"The array at `{{pointer}}` must contain an element that matches `{{schema}}`",EnumError:"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`",FormatDateError:"Value `{{value}}` at `{{pointer}}` is not a valid date",FormatDateTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid date-time",FormatEmailError:"Value `{{value}}` at `{{pointer}}` is not a valid email",FormatHostnameError:"Value `{{value}}` at `{{pointer}}` is not a valid hostname",FormatIPV4Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address",FormatIPV4LeadingZeroError:"IPv4 addresses starting with zero are invalid, since they are interpreted as octals",FormatIPV6Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address",FormatIPV6LeadingZeroError:"IPv6 addresses starting with zero are invalid, since they are interpreted as octals",FormatJSONPointerError:"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer",FormatRegExError:"Value `{{value}}` at `{{pointer}}` is not a valid regular expression",FormatTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid time",FormatURIError:"Value `{{value}}` at `{{pointer}}` is not a valid uri",FormatURIReferenceError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference",FormatURITemplateError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-template",FormatURLError:"Value `{{value}}` at `{{pointer}}` is not a valid url",InvalidDataError:"No value may be specified in `{{pointer}}`",InvalidPropertyNameError:"Invalid property name `{{property}}` at `{{pointer}}`",MaximumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum",MaxItemsError:"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MaxLengthError:"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.",MaxPropertiesError:"Too many properties in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MinimumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum",MinItemsError:"Too few items in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MinItemsOneError:"At least one item is required in `{{pointer}}`",MinLengthError:"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.",MinLengthOneError:"A value is required in `{{pointer}}`",MinPropertiesError:"Too few properties in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MissingDependencyError:"The required propery '{{missingProperty}}' in `{{pointer}}` is missing",MissingOneOfPropertyError:"Value at `{{pointer}}` property: `{{property}}`",MultipleOfError:"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`",MultipleOneOfError:"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`",NoAdditionalPropertiesError:"Additional property `{{property}}` in `{{pointer}}` is not allowed",NotError:"Value `{{value}}` at pointer should not match schema `{{not}}`",OneOfError:"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema",OneOfPropertyError:"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`",PatternError:"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`",PatternPropertiesError:"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}",RequiredPropertyError:"The required property `{{key}}` is missing at `{{pointer}}`",TypeError:"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`",UndefinedValueError:"Value must not be undefined in `{{pointer}}`",UniqueItemsError:"Expected unique items in {{pointer}}: duplicate value `{{value}}` found at {{itemPointer}} and {{duplicatePointer}}",UnknownPropertyError:"Could not find a valid schema for property `{{pointer}}` within object",ValueNotEmptyError:"A value for `{{property}}` is required at `{{pointer}}`"};function ba(e,t,i=e){return function(e,t={}){return e.replace(/\{\{\w+\}\}/g,(e=>t[e.replace(/[{}]/g,"")]))}(La[e]||i,t)}function Ea(e,t){return{type:"error",name:e,code:(i=e,i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),message:ba(e,t),data:t};var i}function Ia(e){return Ea.bind(null,e)}const Na=Object.prototype.toString;function wa(e){const t=Na.call(e).match(/\s([^\]]+)\]/).pop().toLowerCase();return"file"===t?"object":t}function Sa(e){return"error"===(null==e?void 0:e.type)}function Aa(e){return Sa(e)||e instanceof Promise}function Da(e,t=[]){for(let i=0;i<e.length;i+=1){const r=e[i];Array.isArray(r)?Da(r,t):t.push(r)}return t}const Ca={DECLARATOR_ONEOF:"oneOfProperty",GET_TEMPLATE_RECURSION_LIMIT:1,floatingPointPrecision:1e4,propertyBlacklist:["_id"]},{DECLARATOR_ONEOF:ka}=Ca;const ja=e=>JSON.parse(JSON.stringify(e));var xa=__webpack_require__(9996),_a=__webpack_require__.n(xa);const Oa=(e,t)=>t,Pa=(e,t)=>_a()(e,t,{arrayMerge:Oa}),Ra=(e,t)=>{const i=e.concat(t);return i.filter(((e,t)=>i.indexOf(e)===t))};function za(e,t,i){var r;const n={...null!==(r=e.resolveRef(t))&&void 0!==r?r:{}};if(n.if&&(n.then||n.else)){const t=e.isValid(i,n.if);if(t&&n.then)return za(e,n.then,i);if(!t&&n.else)return za(e,n.else,i);delete n.if,delete n.then,delete n.else}return n}const{DECLARATOR_ONEOF:Fa}=Ca;function Ua(e,t,i,r){if(null==i||null==t.properties)return-1;let n=0;const s=Object.keys(t.properties);for(let a=0;a<s.length;a+=1){const o=s[a];null!=i[o]&&e.isValid(i[o],t.properties[o],r)&&(n+=1)}return n}function Ya(e,t,i=e.rootSchema,r="#"){if(null!=t&&i[Fa]){const n=[],s=i[Fa],a=t[i[Fa]];if(void 0===a)return e.errors.missingOneOfPropertyError({property:s,pointer:r});for(let o=0;o<i.oneOf.length;o+=1){const l=e.resolveRef(i.oneOf[o]),c=e.step(s,l,t,r);if(Sa(c))return c;let u=Da(e.validate(a,c,r));if(u=u.filter(Aa),!(u.length>0))return l;n.push(...u)}return e.errors.oneOfPropertyError({property:s,value:a,pointer:r,errors:n})}const n=[];for(let s=0;s<i.oneOf.length;s+=1){const a=e.resolveRef(i.oneOf[s]);e.isValid(t,a,r)&&n.push(a)}if(1===n.length)return n[0];if("object"===wa(t)){let n,s=0;for(let r=0;r<i.oneOf.length;r+=1){const a=e.resolveRef(i.oneOf[r]),o=Ua(e,a,t);s<o&&(s=o,n=i.oneOf[r])}return void 0===n?e.errors.oneOfError({value:JSON.stringify(t),pointer:r,oneOf:i.oneOf}):n}return n.length>1?e.errors.multipleOneOfError({matches:n,data:t,pointer:r}):e.errors.oneOfError({value:JSON.stringify(t),pointer:r,oneOf:i.oneOf})}var Ba=__webpack_require__(4604),$a=__webpack_require__.n(Ba);const Ga={};function Qa(e,t,i,r,n=Ga){if(0===i.length)return e.resolveRef(t);const s=i.shift();return Sa(t=e.step(s,t,n,r))?t:Qa(e,t,i,`${r}/${s}`,n=n[s])}const Ha=new(__webpack_require__(5723).Z.Parser)('\nroot ::= ("#" recursion | recursion | (query | pattern) recursion* | "#" SEP? | SEP)\nrecursion ::= (SEP query | pattern)*\n\nquery ::= (ESC escaped ESC | property | all | any | regex) typecheck? lookahead?\nproperty ::= [^?/{}*,()#]+\nregex ::= "{" [^}]+ "}"\nSEP ::= "/"\nall ::= "**"\nany ::= "*"\n\ntypecheck ::= "?:" ("value" | "boolean" | "string" | "number" | "object" | "array")\nlookahead ::= "?" expression ((andExpr | orExpr) expression)*\nandExpr ::= S? "&&" S?\norExpr ::= S? "||" S?\n\nexpression ::= (exprProperty | ESC escaped ESC) ((isnot | is) (exprProperty | regex | ESC escaped ESC))*\nexprProperty ::= [a-zA-Z0-9-_ $]+\nescaped ::= [^"]+\nis ::= ":"\nisnot ::= ":!"\nESC ::= \'"\'\n\npattern ::= S? "(" (SEP query | pattern (orPattern? pattern)*)* ")" quantifier? S? lookahead?\nquantifier ::= "+" | "*" | [0-9]+\norPattern ::= S? "," S?\n\nS ::= [ ]*\n'),qa=e=>Ha.getAST(e),Wa=(e,t)=>`${e}/${t}`,Za=Object.prototype.toString,Va=/Object|Array/,Ka=e=>Va.test(Za.call(e));function Xa(e){return new RegExp(e.text.replace(/(^{|}$)/g,""))}function Ja(e){return Array.isArray(e)?e.map((function(e,t){return`${t}`})):"[object Object]"===Object.prototype.toString.call(e)?Object.keys(e):[]}const eo={mem:[],get(e,t){const i=e[0][t];if(!eo.mem.includes(i))return Ka(i)&&eo.mem.push(i),[i,t,e[0],Wa(e[3],t)]},reset(){eo.mem.length=0}},to={any(e,t){const i=t[0];return Ja(i).map((e=>[i[e],e,i,Wa(t[3],e)]))},all(e,t){const i=[t];var r,n;return r=t[0],n=(r,n)=>{const s=eo.get(t,n);s&&i.push(...to.all(e,s))},Array.isArray(r)?r.forEach(n):"[object Object]"===Object.prototype.toString.call(r)&&Object.keys(r).forEach((function(e){n(r[e],e)})),i},regex(e,t){const i=Xa(e),r=t[0];return Ja(r).filter((e=>i.test(e))).map((e=>[r[e],e,r,Wa(t[3],e)]))}},io={escaped:(e,t)=>io.property(e,t),property:(e,t)=>{const i=e.text;if(t[0]&&void 0!==t[0][i])return[t[0][i],i,t[0],Wa(t[3],i)]},typecheck:(e,t)=>{const i=e.text.replace(/^\?:/,"");return"value"===i?Ka(t[0])?void 0:t:(r=t[0],Za.call(r).match(/\s([^\]]+)\]/).pop().toLowerCase()===i?t:void 0);var r},lookahead:(e,t)=>{let i=!0,r=!1;return e.children.forEach((e=>{if("expression"===e.type){const n=void 0!==io.expression(e,t);i=!0===r?i||n:i&&n}else r="orExpr"===e.type})),i?t:void 0},expression:(e,t)=>{const i=e.children[0].text,r=e.children[1],n=e.children[2],s=t[0];if(!1!==Ka(s))return function(e,t,i){if(void 0===t)return void 0!==e;let r;const n=`${e}`;return r="regex"===i.type?Xa(i).test(n):n===i.text,"isnot"===t.type&&(r=!1===r&&void 0!==e),r}(s[i],r,n)?t:void 0}};function ro(e,t,i){const r=[];let n=e;return t.children.forEach((t=>{if("orPattern"===t.type)return r.push(...n),void(n=e);n=no(n,t,i)})),r.push(...n),r}function no(e,t,i){let r;return r="query"===t.type?function(e,t,i){let r=e;return t.children.forEach((e=>{if(to[e.type])r=function(e,t,i,r){const n=[];for(let s=0,a=t.length;s<a;s+=1)n.push(...e(i,t[s],i,r));return n}(to[e.type],r,e,i);else{if(!io[e.type])throw new Error(`Unknown filter ${e.type}`);r=function(e,t,i,r){const n=[];for(let s=0,a=t.length;s<a;s+=1){const a=e(i,t[s],r);a&&n.push(a)}return n}(io[e.type],r,e,i)}})),r}(e,t,i):"pattern"===t.type?function(e,t,i){const r=[],n=t.children.find((e=>"quantifier"===e.type)),s=function(e){if(null==e)return 1;if("*"===e||"+"===e)return 1/0;const t=parseInt(e);return isNaN(t)?1:t}(n&&n.text);let a=e;n&&"*"===n.text&&r.push(...a);let o=0;for(;a.length>0&&o<s;)a=ro(a,t,i),r.push(...a),o+=1;return r}(e,t,i):function(e,t,i){let r=e;return t.children.forEach((e=>r=no(r,e,i))),r}(e,t,i),eo.reset(),eo.mem.push(e),r}const so={value:e=>e.map((e=>e[0])),pointer:e=>e.map((e=>e[3])),all:e=>e,map:e=>{const t={};return e.forEach((e=>t[e[3]]=e[0])),t}};var ao;function oo(e,t,i=ao.VALUE){if(null==t)return[];""===(t=t.replace(/(\/$)/g,""))&&(t="#");const r=qa(t);if(null==r)throw new Error(`empty ast for '${t}'`);if(""!==r.rest)throw new Error(`Failed parsing queryString from: '${r.rest}'`);const n=function(e,t){return eo.reset(),eo.mem.push(e),no([[e,null,null,"#"]],t)}(e,r);return"function"==typeof i?n.map((e=>i(...e))):so[i]?so[i](n):n}!function(e){e.POINTER="pointer",e.VALUE="value",e.ALL="all",e.MAP="map"}(ao||(ao={})),oo.POINTER=ao.POINTER,oo.VALUE=ao.VALUE,oo.ALL=ao.ALL,oo.MAP=ao.MAP;const lo=["root","recursion"];function co(e,t=[]){return lo.includes(e.type)?(e.children.forEach((e=>co(e,t))),t):(t.push(e.text),t)}function uo(e){return null==e||""===e?[]:co(qa(e))}const ho=e=>JSON.parse(JSON.stringify(e)),po=Object.prototype.toString,fo=e=>po.call(e).match(/\s([^\]]+)\]/).pop().toLowerCase(),go=new RegExp('^("[^"]+"|[^?/{}*,()#]+)$'),yo=["string","number","boolean","null"],mo=/^\[\d*\]$/,vo=/^\[(\d+)\]$/,Mo=/^".+"$/,To=/(^\[\d*\]$|^\d+$)/;function Lo(e){return parseInt(e.replace(/^(\[|\]$)/,""))}function bo(e){return Mo.test(e)?e.replace(/(^"|"$)/g,""):e}function Eo(e,t,i,r){const n=e[0];if(/^\[\]$/.test(t)){n.push(i);const t=n.length-1;return[n[t],t,n,`${e[3]}/${t}}`]}if(null==r&&"object"===fo(n[t])&&"object"===fo(i))return[n[t],t,n,`${e[3]}/${t}}`];if(r===No.INSERT_ITEMS||null==r&&vo.test(t)){const r=Lo(t);return function(e,t,i){e.length<=t?e[t]=i:e.splice(t,0,i)}(n,r,i),[n[r],r,n,`${e[3]}/${r}}`]}if(r===No.REPLACE_ITEMS||null==r){const r=Lo(t);return n[r]=i,[n[r],r,n,`${e[3]}/${r}}`]}throw new Error(`Unknown array index '${t}' with force-option '${r}'`)}var Io;function No(e,t,i,r){if(null==t)return ho(e);if(""===(t=t.replace(/(\/$)/g,"")))return ho(i);const n=ho(e);let s=[[n,null,null,"#"]];const a=uo(t),o=a.pop(),l=mo.test(o)&&!1===vo.test(o);if(!1===go.test(o)||l)throw new Error(`Unsupported query '${t}' ending with non-property`);return a.forEach(((e,t)=>{if("__proto__"===e||"prototyped"===e||"constructor"===e)return;if(!1===go.test(e))return void(s=function(e,t){const i=[];return e.forEach((e=>i.push(...oo(e[0],t,ao.ALL)))),i}(s,e));const i=t>=a.length-1?o:a[t+1],n=To.test(i);s=function(e,t,i,r){return t=bo(t),e.filter((e=>!(!Array.isArray(e[0])||!To.test(t))||!1===yo.includes(fo(e[0][t])))).map((e=>{const n=i?[]:{},s=e[0];return Array.isArray(s)?Eo(e,t,n,r):(s[t]=s[t]||n,[s[t],t,s,`${e[3]}/${t}`])}))}(s,e,n,r)})),s.forEach((e=>{let t=i;"function"===fo(i)&&(t=i(e[3],o,e[0],`${e[3]}/${o}`));const n=e[0];if(Array.isArray(n))Eo(e,o,t,r);else{const e=bo(o);if("__proto__"===e||"prototyped"===e||"constructor"===e)return;n[e]=t}})),n}!function(e){e.REPLACE_ITEMS="replace",e.INSERT_ITEMS="insert"}(Io||(Io={})),No.REPLACE_ITEMS=Io.REPLACE_ITEMS,No.INSERT_ITEMS=Io.INSERT_ITEMS;const wo={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},So=Object.keys(wo).filter((e=>!1===wo[e].type)),Ao=Object.prototype.hasOwnProperty;function Do(e){if(0==(t=e,"[object Object]"===Object.prototype.toString.call(t)))return;var t;if(e.enum)return"enum";if(wo[e.type]||Array.isArray(e.type))return e.type;const i=So.filter((t=>e[t]));if(1===i.length)return i[0];if(0!==i.length)throw new Error(`Mutiple typeIds [${i.join(", ")}] matched in ${JSON.stringify(e)}`);for(let t=0,i=wo.object.keywords.length;t<i;t+=1){const i=wo.object.keywords[t];if(Ao.call(e,i))return"object"}for(let t=0,i=wo.array.keywords.length;t<i;t+=1){const i=wo.array.keywords[t];if(Ao.call(e,i))return"array"}}function Co(e,t){!0!==this.callback(e,t)&&function(e){const t=[],i=Do(e);if(null==i)return t;let r;if(Array.isArray(i)){r={};for(let e=0,t=i.length;e<t;e+=1)Object.assign(r,wo[i[e]])}else r=wo[i];return null==r.definitions||r.definitions.forEach((i=>{oo(e,i,((e,i,r,n)=>{(e=>"[object Object]"===Object.prototype.toString.call(e))(e)&&Do(e)&&t.push({pointer:$a().join($a().split(n),!1),def:e})}))})),t}(e).forEach((e=>this.nextTypeDefs(e.def,$a().join(t,e.pointer,!1))))}function ko(e,t,i,r="definitions"){const n=t[r];Object.keys(n).forEach((t=>{if(!1!==n[t]&&(s=n[t],"[object Object]"!==Object.prototype.toString.call(s)))var s;else e.nextTypeDefs(n[t],$a().join(i,r,t,!1))}))}function jo(e,t,i="#"){const r={callback:t,nextTypeDefs:Co};r.nextTypeDefs(e,i),null!=e.definitions&&(r.callback=(e,i)=>{t(e,i),null!=e.definitions&&ko(r,e,i)},ko(r,e,i)),null!=e.$defs&&(r.callback=(e,i)=>{t(e,i),null!=e.definitions&&ko(r,e,i)},ko(r,e,i,"$defs"))}const xo=/(#|\/)+$/,_o=/#$/,Oo=/^[^:]+:\/\/[^/]+\//,Po=/\/[^/]*$/,Ro=/#.*$/;function zo(e,t){return null==e&&null==t?"#":null==t?e.replace(_o,""):null==e?t.replace(_o,""):"#"===t[0]?`${e.replace(Ro,"")}${t.replace(xo,"")}`:Oo.test(t)?t.replace(_o,""):`${e.replace(Po,"")}/${t.replace(_o,"")}`}const Fo=/(#|\/)+$/g,Uo=["",null,"#"],Yo=/(#|\/)+$/g;function Bo(e,t,i){if("object"===wa(i)&&(i=i.__ref||i.$ref),null==i)return t;let r;const n=i.replace(Yo,"");if(e.remotes[n])return r=e.remotes[n],r&&r.$ref?Bo(e,t,r.$ref):r;if(e.ids[i])return r=(0,Ba.get)(t,e.ids[i]),r&&r.$ref?Bo(e,t,r.$ref):r;const s=function(e){if(Uo.includes(e))return[];if(-1===(e=e.replace(Fo,"")).indexOf("#"))return[e.replace(Fo,"")];if(0===e.indexOf("#"))return[e.replace(Fo,"")];const t=e.split("#");return t[0]=t[0].replace(Fo,""),t[1]=`#${t[1].replace(Fo,"")}`,t}(i);if(0===s.length)return t;if(1===s.length){if(i=s[0],e.remotes[i])return r=e.remotes[i],Bo(e,t,r.$ref);if(e.ids[i])return r=(0,Ba.get)(t,e.ids[i]),r&&r.$ref?Bo(e,t,r.$ref):r}if(2===s.length){const r=s[0];if(i=s[1],e.remotes[r])return e.remotes[r].getRef?e.remotes[r].getRef(i):Bo(e,e.remotes[r],i);if(e.ids[r])return Bo(e,(0,Ba.get)(t,e.ids[r]),i)}return r=(0,Ba.get)(t,e.ids[i]||i),r&&r.$ref?Bo(e,t,r.$ref):r}const $o="__compiled",Go=/(#|\/)+$/g;const Qo={additionalItemsError:Ia("AdditionalItemsError"),additionalPropertiesError:Ia("AdditionalPropertiesError"),anyOfError:Ia("AnyOfError"),allOfError:Ia("AllOfError"),constError:Ia("ConstError"),containsError:Ia("ContainsError"),containsArrayError:Ia("ContainsArrayError"),containsAnyError:Ia("ContainsAnyError"),enumError:Ia("EnumError"),formatURLError:Ia("FormatURLError"),formatURIError:Ia("FormatURIError"),formatURIReferenceError:Ia("FormatURIReferenceError"),formatURITemplateError:Ia("FormatURITemplateError"),formatDateError:Ia("FormatDateaError"),formatDateTimeError:Ia("FormatDateTimeError"),formatEmailError:Ia("FormatEmailError"),formatHostnameError:Ia("FormatHostnameError"),formatIPV4Error:Ia("FormatIPV4Error"),formatIPV4LeadingZeroError:Ia("FormatIPV4LeadingZeroError"),formatIPV6Error:Ia("FormatIPV6Error"),formatIPV6LeadingZeroError:Ia("FormatIPV6LeadingZeroError"),formatJSONPointerError:Ia("FormatJSONPointerError"),formatRegExError:Ia("FormatRegExError"),formatTimeError:Ia("FormatTimeError"),invalidSchemaError:Ia("InvalidSchemaError"),invalidDataError:Ia("InvalidDataError"),invalidTypeError:Ia("InvalidTypeError"),invalidPropertyNameError:Ia("InvalidPropertyNameError"),maximumError:Ia("MaximumError"),maxItemsError:Ia("MaxItemsError"),maxLengthError:Ia("MaxLengthError"),maxPropertiesError:Ia("MaxPropertiesError"),minimumError:Ia("MinimumError"),minItemsError:Ia("MinItemsError"),minItemsOneError:Ia("MinItemsOneError"),minLengthError:Ia("MinLengthError"),minLengthOneError:Ia("MinLengthOneError"),minPropertiesError:Ia("MinPropertiesError"),missingDependencyError:Ia("MissingDependencyError"),missingOneOfPropertyError:Ia("MissingOneOfPropertyError"),multipleOfError:Ia("MultipleOfError"),multipleOneOfError:Ia("MultipleOneOfError"),noAdditionalPropertiesError:Ia("NoAdditionalPropertiesError"),notError:Ia("NotError"),oneOfError:Ia("OneOfError"),oneOfPropertyError:Ia("OneOfPropertyError"),patternError:Ia("PatternError"),patternPropertiesError:Ia("PatternPropertiesError"),requiredPropertyError:Ia("RequiredPropertyError"),typeError:Ia("TypeError"),undefinedValueError:Ia("UndefinedValueError"),uniqueItemsError:Ia("UniqueItemsError"),unknownPropertyError:Ia("UnknownPropertyError"),valueNotEmptyError:Ia("ValueNotEmptyError")};var Ho=__webpack_require__(481),qo=__webpack_require__.n(Ho);const Wo=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),Zo=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vo=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){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d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,nl=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,sl={date:(e,t,i,r)=>{if("string"!=typeof i)return;const n=i.match(Xo);if(!n)return Qo.formatDateTimeError({value:i,pointer:r});const s=+n[1],a=+n[2],o=+n[3];return a>=1&&a<=12&&o>=1&&o<=(2!=a||s%4!=0||s%100==0&&s%400!=0?el[a]:29)?void 0:Qo.formatDateError({value:i,pointer:r})},"date-time":(e,t,i,r)=>{if("string"==typeof i)return""===i||Wo.test(i)?"Invalid Date"===new Date(i).toString()?Qo.formatDateTimeError({value:i,pointer:r}):void 0:Qo.formatDateTimeError({value:i,pointer:r})},email:(e,t,i,r)=>{if("string"!=typeof i)return;if('"'===i[0])return Qo.formatEmailError({value:i,pointer:r});const[n,s,...a]=i.split("@");return!n||!s||0!==a.length||n.length>64||s.length>253||"."===n[0]||n.endsWith(".")||n.includes("..")?Qo.formatEmailError({value:i,pointer:r}):/^[a-z0-9.-]+$/i.test(s)&&/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(n)&&s.split(".").every((e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e)))?void 0:Qo.formatEmailError({value:i,pointer:r})},hostname:(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!Ko.test(i))return Qo.formatHostnameError({value:i,pointer:r})},ipv4:(e,t,i,r)=>{if("string"==typeof i&&""!==i){if(i&&"0"===i[0])return Qo.formatIPV4LeadingZeroError({value:i,pointer:r});if(!(i.length<=15&&Zo.test(i)))return Qo.formatIPV4Error({value:i,pointer:r})}},ipv6:(e,t,i,r)=>{if("string"==typeof i&&""!==i){if(i&&"0"===i[0])return Qo.formatIPV6LeadingZeroError({value:i,pointer:r});if(!(i.length<=45&&Vo.test(i)))return Qo.formatIPV6Error({value:i,pointer:r})}},"json-pointer":(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!tl.test(i))return Qo.formatJSONPointerError({value:i,pointer:r})},"relative-json-pointer":(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!il.test(i))return Qo.formatJSONPointerError({value:i,pointer:r})},regex:(e,t,i,r)=>{if("string"==typeof i&&!1===/\\Z$/.test(i)){try{return void new RegExp(i)}catch(e){}return Qo.formatRegExError({value:i,pointer:r})}if("object"!=typeof i&&"number"!=typeof i&&!Array.isArray(i))return Qo.formatRegExError({value:i,pointer:r})},time:(e,t,i,r)=>{if("string"!=typeof i)return;const n=i.match(Jo);if(!n)return Qo.formatDateTimeError({value:i,pointer:r});const s=+n[1],a=+n[2],o=+n[3],l=!!n[5];return(s<=23&&a<=59&&o<=59||23==s&&59==a&&60==o)&&l?void 0:Qo.formatTimeError({value:i,pointer:r})},uri:(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!qo().isUri(i))return Qo.formatURIError({value:i,pointer:r})},"uri-reference":(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!rl.test(i))return Qo.formatURIReferenceError({value:i,pointer:r})},"uri-template":(e,t,i,r)=>{if("string"==typeof i&&""!==i&&!nl.test(i))return Qo.formatURITemplateError({value:i,pointer:r})},url:(e,t,i,r)=>{if(""!==i&&!qo().isWebUri(i))return Qo.formatUrlError({value:i,pointer:r})}},al={addOptionalProps:!0,removeInvalidData:!1};let ol;function ll(e,t){const{$ref:i}=e;return null==i||(null==ol[t]||null==ol[t][i]?0:ol[t][i])<Ca.GET_TEMPLATE_RECURSION_LIMIT}function cl(e,t,i){if(null==i)throw new Error(`missing pointer ${i}`);const{$ref:r}=t;return null==r?t:(ol[i]=ol[i]||{},ol[i][r]=ol[i][r]||0,ol[i][r]+=1,e.resolveRef(t))}function ul(e,t,i,r){if("object"!==wa(t))return Object.assign({pointer:r},t);if(!1===ll(t,r)&&null==i)return!1;let n=ja(cl(e,t,r));if(Array.isArray(t.anyOf)&&t.anyOf.length>0){if(ll(t.anyOf[0],`${r}/anyOf/0`)){const i=cl(e,t.anyOf[0],`${r}/anyOf/0`);n=Pa(n,i),n.pointer=t.anyOf[0].$ref||n.pointer}delete n.anyOf}if(Array.isArray(t.allOf)){for(let i=0,s=t.allOf.length;i<s;i+=1)ll(t.allOf[i],`${r}/allOf/${i}`)&&(n=Pa(n,cl(e,t.allOf[i],`${r}/allOf/${i}`)),n.pointer=t.allOf[i].$ref||n.pointer);delete n.allOf}return n.pointer=n.pointer||t.$ref||r,n}const dl=e=>e&&"object"==typeof e;function hl(e,t,i,r,n){if(null==i)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(t)}`);if(null==r)throw new Error("Missing pointer");let s=ul(e,i,t,r);if(!dl(s))return;if(r=s.pointer,null==s?void 0:s.const)return s.const;if(Array.isArray(s.oneOf))if(function(e){switch(wa(e)){case"string":case"array":return 0===e.length;case"null":case"undefined":return!0;case"object":return 0===Object.keys(e).length;default:return!1}}(t)){const e=s.oneOf[0].type||s.type||s.const&&typeof s.const||wa(t);s={...s.oneOf[0],type:e}}else{const i=Ya(e,t,s);if(Sa(i)){if(null!=t&&!0!==n.removeInvalidData)return t;s=s.oneOf[0],t=void 0}else s=i}if(!dl(s)||null==s.type)return;const a=Array.isArray(s.type)?function(e,t,i){if(null==t){if(null!=i){const t=wa(i);if(e.includes(t))return t}return e[0]}const r=wa(t);return e.includes(r)?r:e[0]}(s.type,t,s.default):s.type;if(null!=t&&wa(t)!==a&&(t=function(e,t){if("string"===e)return JSON.stringify(t);if("string"!=typeof t)return null;try{if(typeof(t=JSON.parse(t))===e)return t}catch(e){}return null}(a,t)),null==pl[a]){if(n.removeInvalidData)return;return t}return pl[a](e,s,t,r,n)}const pl={null:(e,t,i)=>fl(t,i,null),string:(e,t,i)=>fl(t,i,""),number:(e,t,i)=>fl(t,i,0),integer:(e,t,i)=>fl(t,i,0),boolean:(e,t,i)=>fl(t,i,!1),object:(e,t,i,r,n)=>{var s;const a=void 0===t.default?{}:t.default,o={},l=null!==(s=t.required)&&void 0!==s?s:[];if(t.properties&&Object.keys(t.properties).forEach((s=>{const c=null==i||null==i[s]?a[s]:i[s],u=l.includes(s);(null!=c||u||n.addOptionalProps)&&(o[s]=hl(e,c,t.properties[s],`${r}/properties/${s}`,n))})),t.dependencies&&Object.keys(t.dependencies).forEach((s=>{if(void 0===o[s])return;const a=t.dependencies[s];if(Array.isArray(a))return void a.forEach((i=>{o[i]=hl(e,o[i],t.properties[i],`${r}/properties/${i}`,n)}));if("object"!==wa(a))return;const l=hl(e,i,{...a,type:"object"},`${r}/dependencies/${s}`,n);l&&!Sa(l)&&Object.assign(o,l)})),i&&Object.keys(i).forEach((e=>null==o[e]&&(o[e]=i[e]))),t.if&&(t.then||t.else)){const i=e.isValid(o,t.if);if(i&&t.then){const i=e.getTemplate(o,{type:"object",...t.then},n);Object.assign(o,i)}else if(!i&&t.else){const i=e.getTemplate(o,{type:"object",...t.else},n);Object.assign(o,i)}}return o},array:(e,t,i,r,n)=>{var s,a,o;const l=void 0===t.default?[]:t.default;t.minItems=t.minItems||0;const c=i||[];if(null==t.items)return c;if(Array.isArray(t.items)){for(let i=0,u=Math.max(null!==(s=t.minItems)&&void 0!==s?s:0,null!==(o=null===(a=t.items)||void 0===a?void 0:a.length)&&void 0!==o?o:0);i<u;i+=1)c[i]=hl(e,null==c[i]?l[i]:c[i],t.items[i],`${r}/items/${i}`,n);return c}if("object"!==wa(t.items))return c;const u=ul(e,t.items,i,r);if(!1===u)return c;if(r=u.pointer||r,u.oneOf&&0===c.length){const i=u.oneOf[0];for(let s=0;s<t.minItems;s+=1)c[s]=hl(e,null==c[s]?l[s]:c[s],i,`${r}/oneOf/0`,n);return c}if(u.oneOf&&c.length>0){const i=Math.max(t.minItems,c.length);for(let t=0;t<i;t+=1){let i=null==c[t]?l[t]:c[t],s=Ya(e,i,u);null==s||Sa(s)?null!=i&&!0!==n.removeInvalidData?c[t]=i:(i=void 0,s=u.oneOf[0],c[t]=hl(e,i,s,`${r}/oneOf/${t}`,n)):c[t]=hl(e,i,s,`${r}/oneOf/${t}`,n)}return c}if(u.type){for(let i=0,s=Math.max(t.minItems,c.length);i<s;i+=1)c[i]=hl(e,null==c[i]?l[i]:c[i],u,`${r}/items`,n);return c}return c}};function fl(e,t,i){return null!=t?t:e.const?e.const:void 0===e.default&&Array.isArray(e.enum)?e.enum[0]:void 0===e.default?i:e.default}function gl(e,t){const i=typeof e;if(i!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;const i=e.length;if(i!==t.length)return!1;for(let r=0;r<i;r++)if(!gl(e[r],t[r]))return!1;return!0}if("object"===i){if(!e||!t)return e===t;const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const r of i)if(!gl(e[r],t[r]))return!1;return!0}return e===t}function yl(e){const t=[];let i=0;const r=e.length;for(;i<r;){const n=e.charCodeAt(i++);if(n>=55296&&n<=56319&&i<r){const r=e.charCodeAt(i++);56320==(64512&r)?t.push(((1023&n)<<10)+(1023&r)+65536):(t.push(n),i--)}else t.push(n)}return t}const ml=Ca.floatingPointPrecision,vl=Object.prototype.hasOwnProperty,Ml=(e,t)=>!(void 0===e[t]||!vl.call(e,t)),Tl={additionalProperties:(e,t,i,r)=>{if(!0===t.additionalProperties||null==t.additionalProperties)return;if("object"===wa(t.patternProperties)&&!1===t.additionalProperties)return;const n=[];let s=Object.keys(i).filter((e=>!1===Ca.propertyBlacklist.includes(e)));const a=Object.keys(t.properties||{});if("object"===wa(t.patternProperties)){const e=Object.keys(t.patternProperties).map((e=>new RegExp(e)));s=s.filter((t=>{for(let i=0;i<e.length;i+=1)if(e[i].test(t))return!1;return!0}))}for(let o=0,l=s.length;o<l;o+=1){const l=s[o];if(-1===a.indexOf(l)){const c="object"==typeof t.additionalProperties;if(c&&Array.isArray(t.additionalProperties.oneOf)){const c=e.resolveOneOf(i[l],t.additionalProperties,`${r}/${l}`);Sa(c)?n.push(e.errors.additionalPropertiesError({schema:t.additionalProperties,property:s[o],properties:a,pointer:r,errors:c.data.errors})):n.push(...e.validate(i[l],c,r))}else c?n.push(...e.validate(i[l],t.additionalProperties,`${r}/${l}`)):n.push(e.errors.noAdditionalPropertiesError({property:s[o],properties:a,pointer:r}))}}return n},allOf:(e,t,i,r)=>{if(!1===Array.isArray(t.allOf))return;const n=[];return t.allOf.forEach((t=>{n.push(...e.validate(i,t,r))})),n},anyOf:(e,t,i,r)=>{if(!1!==Array.isArray(t.anyOf)){for(let r=0;r<t.anyOf.length;r+=1)if(e.isValid(i,t.anyOf[r]))return;return e.errors.anyOfError({anyOf:t.anyOf,value:i,pointer:r})}},dependencies:(e,t,i,r)=>{if("object"!==wa(t.dependencies))return;const n=[];return Object.keys(i).forEach((s=>{if(void 0===t.dependencies[s])return;if(!0===t.dependencies[s])return;if(!1===t.dependencies[s])return void n.push(e.errors.missingDependencyError({pointer:r}));let a;const o=wa(t.dependencies[s]);if("array"===o)a=t.dependencies[s].filter((e=>void 0===i[e])).map((t=>e.errors.missingDependencyError({missingProperty:t,pointer:r})));else{if("object"!==o)throw new Error(`Invalid dependency definition for ${r}/${s}. Must be list or schema`);a=e.validate(i,t.dependencies[s],r)}n.push(...a)})),n.length>0?n:void 0},enum:(e,t,i,r)=>{const n=wa(i);if("object"===n||"array"===n){const e=JSON.stringify(i);for(let i=0;i<t.enum.length;i+=1)if(JSON.stringify(t.enum[i])===e)return}else if(t.enum.includes(i))return;return e.errors.enumError({values:t.enum,value:i,pointer:r})},format:(e,t,i,r)=>{if(e.validateFormat[t.format])return e.validateFormat[t.format](e,t,i,r)},items:(e,t,i,r)=>{if(!1===t.items){if(Array.isArray(i)&&0===i.length)return;return e.errors.invalidDataError({pointer:r,value:i})}const n=[];for(let s=0;s<i.length;s+=1){const a=i[s],o=e.step(s,t,i,r);if(Sa(o))return[o];const l=e.validate(a,o,`${r}/${s}`);n.push(...l)}return n},maximum:(e,t,i,r)=>{if(!isNaN(t.maximum))return t.maximum&&t.maximum<i||t.maximum&&!0===t.exclusiveMaximum&&t.maximum===i?e.errors.maximumError({maximum:t.maximum,length:i,pointer:r}):void 0},maxItems:(e,t,i,r)=>{if(!isNaN(t.maxItems))return t.maxItems<i.length?e.errors.maxItemsError({maximum:t.maxItems,length:i.length,pointer:r}):void 0},maxLength:(e,t,i,r)=>{if(isNaN(t.maxLength))return;const n=yl(i).length;return t.maxLength<n?e.errors.maxLengthError({maxLength:t.maxLength,length:n,pointer:r}):void 0},maxProperties:(e,t,i,r)=>{const n=Object.keys(i).length;if(!1===isNaN(t.maxProperties)&&t.maxProperties<n)return e.errors.maxPropertiesError({maxProperties:t.maxProperties,length:n,pointer:r})},minLength:(e,t,i,r)=>{if(isNaN(t.minLength))return;const n=yl(i).length;return t.minLength>n?1===t.minLength?e.errors.minLengthOneError({minLength:t.minLength,length:n,pointer:r}):e.errors.minLengthError({minLength:t.minLength,length:n,pointer:r}):void 0},minimum:(e,t,i,r)=>{if(!isNaN(t.minimum))return t.minimum>i||!0===t.exclusiveMinimum&&t.minimum===i?e.errors.minimumError({minimum:t.minimum,length:i,pointer:r}):void 0},minItems:(e,t,i,r)=>{if(!isNaN(t.minItems))return t.minItems>i.length?1===t.minItems?e.errors.minItemsOneError({minItems:t.minItems,length:i.length,pointer:r}):e.errors.minItemsError({minItems:t.minItems,length:i.length,pointer:r}):void 0},minProperties:(e,t,i,r)=>{if(isNaN(t.minProperties))return;const n=Object.keys(i).length;return t.minProperties>n?e.errors.minPropertiesError({minProperties:t.minProperties,length:n,pointer:r}):void 0},multipleOf:(e,t,i,r)=>{if(!isNaN(t.multipleOf))return i*ml%(t.multipleOf*ml)/ml!=0?e.errors.multipleOfError({multipleOf:t.multipleOf,value:i,pointer:r}):void 0},not:(e,t,i,r)=>{const n=[];return 0===e.validate(i,t.not,r).length&&n.push(e.errors.notError({value:i,not:t.not,pointer:r})),n},oneOf:(e,t,i,r)=>{if(!1!==Array.isArray(t.oneOf))return Sa(t=e.resolveOneOf(i,t,r))?t:void 0},pattern:(e,t,i,r)=>{if(!1===new RegExp(t.pattern,"u").test(i))return e.errors.patternError({pattern:t.pattern,description:t.patternExample||t.pattern,received:i,pointer:r})},patternProperties:(e,t,i,r)=>{const n=t.properties||{},s=t.patternProperties;if("object"!==wa(s))return;const a=[],o=Object.keys(i),l=Object.keys(s).map((e=>({regex:new RegExp(e),patternSchema:s[e]})));return o.forEach((o=>{let c=!1;for(let t=0,n=l.length;t<n;t+=1)if(l[t].regex.test(o)){c=!0;const n=e.validate(i[o],l[t].patternSchema,`${r}/${o}`);n&&n.length>0&&a.push(...n)}n[o]||!1===c&&!1===t.additionalProperties&&a.push(e.errors.patternPropertiesError({key:o,pointer:r,patterns:Object.keys(s).join(",")}))})),a},properties:(e,t,i,r)=>{const n=[],s=Object.keys(t.properties||{});for(let a=0;a<s.length;a+=1){const o=s[a];if(Ml(i,o)){const s=e.step(o,t,i,r),a=e.validate(i[o],s,`${r}/${o}`);n.push(...a)}}return n},propertiesRequired:(e,t,i,r)=>{const n=[],s=Object.keys(t.properties||{});for(let a=0;a<s.length;a+=1){const o=s[a];if(void 0===i[o])n.push(e.errors.requiredPropertyError({key:o,pointer:r}));else{const s=e.step(o,t,i,r),a=e.validate(i[o],s,`${r}/${o}`);n.push(...a)}}return n},required:(e,t,i,r)=>{if(!1!==Array.isArray(t.required))return t.required.map((t=>{if(!Ml(i,t))return e.errors.requiredPropertyError({key:t,pointer:r})}))},requiredNotEmpty:(e,t,i,r)=>{if(!1!==Array.isArray(t.required))return t.required.map((t=>{if(null==i[t]||""===i[t])return e.errors.valueNotEmptyError({property:t,pointer:`${r}/${t}`})}))},uniqueItems:(e,t,i,r)=>{if(!1===(Array.isArray(i)&&t.uniqueItems))return;const n=[];return i.forEach(((t,s)=>{for(let a=s+1;a<i.length;a+=1)gl(t,i[a])&&n.push(e.errors.uniqueItemsError({pointer:r,itemPointer:`${r}/${s}`,duplicatePointer:`${r}/${a}`,value:JSON.stringify(t)}))})),n}},Ll={...Tl,contains:(e,t,i,r)=>{if(!1===t.contains)return e.errors.containsArrayError({pointer:r,value:i});if(!0===t.contains)return Array.isArray(i)&&0===i.length?e.errors.containsAnyError({pointer:r}):void 0;if("object"===wa(t.contains)){for(let r=0;r<i.length;r+=1)if(e.isValid(i[r],t.contains))return;return e.errors.containsError({pointer:r,schema:JSON.stringify(t.contains)})}},exclusiveMaximum:(e,t,i,r)=>{if(!isNaN(t.exclusiveMaximum))return t.exclusiveMaximum<=i?e.errors.maximumError({maximum:t.exclusiveMaximum,length:i,pointer:r}):void 0},exclusiveMinimum:(e,t,i,r)=>{if(!isNaN(t.exclusiveMinimum))return t.exclusiveMinimum>=i?e.errors.minimumError({minimum:t.exclusiveMinimum,length:i,pointer:r}):void 0},if:(e,t,i,r)=>{if(null==t.if)return;const n=e.validate(i,t.if,r);return 0===n.length&&t.then?e.validate(i,t.then,r):0!==n.length&&t.else?e.validate(i,t.else,r):void 0},maximum:(e,t,i,r)=>{if(!isNaN(t.maximum))return t.maximum&&t.maximum<i?e.errors.maximumError({maximum:t.maximum,length:i,pointer:r}):void 0},minimum:(e,t,i,r)=>{if(!isNaN(t.minimum))return t.minimum>i?e.errors.minimumError({minimum:t.minimum,length:i,pointer:r}):void 0},patternProperties:(e,t,i,r)=>{const n=t.properties||{},s=t.patternProperties;if("object"!==wa(s))return;const a=[],o=Object.keys(i),l=Object.keys(s).map((e=>({regex:new RegExp(e),patternSchema:s[e]})));return o.forEach((o=>{let c=!1;for(let t=0,n=l.length;t<n;t+=1)if(l[t].regex.test(o)){if(c=!0,!1===l[t].patternSchema)return void a.push(e.errors.patternPropertiesError({key:o,pointer:r,patterns:Object.keys(s).join(",")}));const n=e.validate(i[o],l[t].patternSchema,`${r}/${o}`);n&&n.length>0&&a.push(...n)}n[o]||!1===c&&!1===t.additionalProperties&&a.push(e.errors.patternPropertiesError({key:o,pointer:r,patterns:Object.keys(s).join(",")}))})),a},propertyNames:(e,t,i,r)=>{if(!1===t.propertyNames){if(0===Object.keys(i).length)return;return e.errors.invalidPropertyNameError({property:Object.keys(i),pointer:r,value:i})}if(!0===t.propertyNames)return;if("object"!==wa(t.propertyNames))return;const n=[],s=Object.keys(i),a={...t.propertyNames,type:"string"};return s.forEach((t=>{const s=e.validate(t,a,`${r}/${t}`);s.length>0&&n.push(e.errors.invalidPropertyNameError({property:t,pointer:r,validationError:s[0],value:i[t]}))})),n}};function bl(e){const t={type:wa(e)};return"object"===t.type&&(t.properties={},Object.keys(e).forEach((i=>t.properties[i]=bl(e[i])))),"array"===t.type&&1===e.length?t.items=bl(e[0]):"array"===t.type&&(t.items=e.map(bl)),t}const El={array:(e,t,i,r,n)=>{const s=wa(i.items);if("object"===s)return Array.isArray(i.items.oneOf)?e.resolveOneOf(r[t],i.items,n):Array.isArray(i.items.anyOf)?e.resolveAnyOf(r[t],i.items,n):Array.isArray(i.items.allOf)?e.resolveAllOf(r[t],i.items,n):e.resolveRef(i.items);if("array"===s){if(!0===i.items[t])return bl(r[t]);if(!1===i.items[t])return Qo.invalidDataError({key:t,value:r[t],pointer:n});if(i.items[t])return e.resolveRef(i.items[t]);if(!1===i.additionalItems)return Qo.additionalItemsError({key:t,value:r[t],pointer:n});if(!0===i.additionalItems||void 0===i.additionalItems)return bl(r[t]);if("object"===wa(i.additionalItems))return i.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(i,null,4)} for ${JSON.stringify(r,null,4)}`)}return!1!==i.additionalItems&&r[t]?bl(r[t]):new Error(`Invalid array schema for ${t} at ${n}`)},object:(e,t,i,r,n)=>{if(Array.isArray(i.oneOf)){const t=e.resolveOneOf(r,i,n);if(Sa(i=Pa(i,t)))return i}if(Array.isArray(i.anyOf)&&Sa(i=e.resolveAnyOf(r,i,n)))return i;if(Array.isArray(i.allOf)&&Sa(i=e.resolveAllOf(r,i,n)))return i;let s;if(i.properties&&void 0!==i.properties[t]){if(s=e.resolveRef(i.properties[t]),Sa(s))return s;if(s&&Array.isArray(s.oneOf)){let i=e.resolveOneOf(r[t],s,`${n}/${t}`);const a=s.oneOf.findIndex((e=>e===i));return i=JSON.parse(JSON.stringify(i)),i.variableSchema=!0,i.oneOfIndex=a,i.oneOfSchema=s,i}if(s)return s}const{dependencies:a}=i;if("object"===wa(a)){const i=Object.keys(a).filter((e=>"object"===wa(a[e])));for(let s=0,o=i.length;s<o;s+=1){const o=i[s],l=Il(e,t,a[o],r,`${n}/${o}`);if(!Sa(l))return l}}if(i.if&&(i.then||i.else)){const s=e.isValid(r,i.if);if(s&&i.then){const s=Il(e,t,i.then,r,n);if("string"==typeof s.type&&"error"!==s.type)return s}if(!s&&i.else){const s=Il(e,t,i.else,r,n);if("string"==typeof s.type&&"error"!==s.type)return s}}if("object"===wa(i.patternProperties)){let e;const r=Object.keys(i.patternProperties);for(let n=0,s=r.length;n<s;n+=1)if(e=new RegExp(r[n]),e.test(t))return i.patternProperties[r[n]]}return"object"===wa(i.additionalProperties)?i.additionalProperties:!0===i.additionalProperties?bl(r[t]):Qo.unknownPropertyError({property:t,value:r,pointer:`${n}`})}};function Il(e,t,i,r,n="#"){if(Array.isArray(i.type)){const s=wa(r);return i.type.includes(s)?El[s](e,`${t}`,i,r,n):e.errors.typeError({value:r,pointer:n,expected:i.type,received:s})}const s=i.type||wa(r),a=El[s];return a?a(e,`${t}`,i,r,n):new Error(`Unsupported schema type ${i.type} for key ${t}`)}var Nl=__webpack_require__(4063),wl=__webpack_require__.n(Nl);const Sl={typeKeywords:{array:["enum","contains","items","minItems","maxItems","uniqueItems","not","if"],boolean:["enum","not"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","propertyNames","required","not","oneOf","allOf","anyOf","if"],string:["enum","format","maxLength","minLength","pattern","not","oneOf","allOf","anyOf","if"],number:["enum","exclusiveMaximum","exclusiveMinimum","format","maximum","minimum","multipleOf","not","oneOf","allOf","anyOf","if"],null:["enum","format","not","oneOf","allOf","anyOf"]},validateKeyword:Ll,validateType:{array:(e,t,i,r)=>e.typeKeywords.array.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),object:(e,t,i,r)=>e.typeKeywords.object.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),string:(e,t,i,r)=>e.typeKeywords.string.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),integer:(e,t,i,r)=>e.typeKeywords.number.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),number:(e,t,i,r)=>e.typeKeywords.number.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),boolean:(e,t,i,r)=>e.typeKeywords.boolean.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r))),null:(e,t,i,r)=>e.typeKeywords.null.filter((e=>t&&null!=t[e])).map((n=>e.validateKeyword[n](e,t,i,r)))},validateFormat:sl,errors:Qo,addRemoteSchema:function(e,t,i){i.id=i.id||t,e.remotes[t]=e.compileSchema(i)},compileSchema:function(e,t,i=t,r=!1){if(!0===t||!1===t||void 0===t)return t;if(void 0!==t[$o])return t;const n={ids:{},remotes:e.remotes},s=JSON.stringify(t),a=JSON.parse(s);if(Object.defineProperty(a,$o,{enumerable:!1,value:!0}),Object.defineProperty(a,"getRef",{enumerable:!1,value:Bo.bind(null,n,a)}),!1===r&&!1===s.includes("$ref"))return a;a!==i&&Object.defineProperty(a,"$defs",{enumerable:!0,value:Object.assign({},i.definitions,i.$defs,a.definitions,a.$defs)});const o={},l=()=>a;return jo(a,((e,t)=>{var i;if(e.$id){if(e.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(t)){const r=t.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),n=(0,Ba.get)(a,r);e.$id=null!==(i=n.$id)&&void 0!==i?i:e.$id}n.ids[e.$id.replace(Go,"")]=t}const r=(t=`#${t}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),s=t.replace(/\/[^/]+\/[^/]+$/,""),c=zo(o[r]||o[s],e.$id);o[t]=c,null==n.ids[c]&&(n.ids[c]=t),e.$ref&&!e.__ref&&(Object.defineProperty(e,"__ref",{enumerable:!1,value:zo(c,e.$ref)}),Object.defineProperty(e,"getRoot",{enumerable:!1,value:l}))})),a},createSchemaOf:bl,each:function(e,t,i,r=e.rootSchema,n="#"){r=e.resolveRef(r),i(r,t,n);const s=wa(t);"object"===s?Object.keys(t).forEach((s=>{const a=e.step(s,r,t,n),o=t[s];e.each(o,i,a,`${n}/${s}`)})):"array"===s&&t.forEach(((s,a)=>{const o=e.step(a,r,t,n);e.each(s,i,o,`${n}/${a}`)}))},eachSchema:jo,getChildSchemaSelection:function(e,t,i=e.rootSchema){const r=e.step(t,i,{},"#");return Sa(r)?"one-of-error"===r.code?r.data.oneOf.map((t=>e.resolveRef(t))):r:[r]},getSchema:function(e,t,i,r=e.rootSchema){const n=$a().split(t);return r=e.resolveRef(r),Qa(e,r,n,t,i)},getTemplate:(e,t,i=e.rootSchema,r=al)=>(ol={mi:{}},hl(e,t,i,"#",r)),isValid:function(e,t,i=e.rootSchema,r="#"){return 0===e.validate(t,i,r).length},resolveAllOf:function(e,t,i=e.rootSchema,r="#"){let n=ja(i);for(let r=0;r<i.allOf.length;r+=1){s=n,a=za(e,i.allOf[r],t),n=_a()(s,a,{arrayMerge:Ra}),t=e.getTemplate(t,n)}var s,a;return delete n.allOf,n},resolveAnyOf:function(e,t,i=e.rootSchema,r="#"){let n=!1,s=ja(i);for(let a=0;a<i.anyOf.length;a+=1){const o=e.resolveRef(i.anyOf[a]);e.isValid(t,i.anyOf[a],r)&&(n=!0,s=Pa(s,o))}return!1===n?Qo.anyOfError({value:t,pointer:r,anyOf:JSON.stringify(i.anyOf)}):(delete s.anyOf,s)},resolveOneOf:function(e,t,i=e.rootSchema,r="#"){if(null!=t&&i[ka]){const n=[],s=i[ka],a=t[i[ka]];if(void 0===a)return e.errors.missingOneOfPropertyError({property:s,pointer:r});for(let o=0;o<i.oneOf.length;o+=1){const l=e.resolveRef(i.oneOf[o]),c=e.step(s,l,t,r);if(Sa(c))return c;let u=Da(e.validate(a,c,r));if(u=u.filter(Aa),!(u.length>0))return l;n.push(...u)}return e.errors.oneOfPropertyError({property:s,value:a,pointer:r,errors:n})}const n=[],s=[];for(let a=0;a<i.oneOf.length;a+=1){const o=e.resolveRef(i.oneOf[a]);let l=Da(e.validate(t,o,r));l=l.filter(Aa),l.length>0?s.push(...l):n.push(o)}return 1===n.length?n[0]:n.length>1?e.errors.multipleOneOfError({value:t,pointer:r,matches:n}):e.errors.oneOfError({value:JSON.stringify(t),pointer:r,oneOf:i.oneOf,errors:s})},resolveRef:function(e,t){return null==e||null==e.$ref?e:e.getRoot?e.getRoot().getRef(e):t.getRef(e)},step:Il,validate:function(e,t,i=e.rootSchema,r="#"){if("boolean"===wa(i=e.resolveRef(i)))return i?[]:[e.errors.invalidDataError({value:t,pointer:r})];if(Sa(i))return[i];if(void 0!==i.const)return wl()(i.const,t)?[]:[e.errors.constError({value:t,expected:i.const,pointer:r})];const n=function(e,t){const i=wa(e);return"number"===i&&("integer"===t||Array.isArray(t)&&t.includes("integer"))?Number.isInteger(e)||isNaN(e)?"integer":"number":i}(t,i.type),s=i.type||n;return n===s||Array.isArray(s)&&s.includes(n)?null==e.validateType[n]?[e.errors.invalidTypeError({receivedType:n,pointer:r})]:Da(e.validateType[n](e,i,t,r)).filter(Aa):[e.errors.typeError({received:n,expected:s,value:t,pointer:r})]}};class Al{constructor(e,t){this.remotes={},this.errors={},this.typeKeywords={},this.validateKeyword={},this.validateType={},this.validateFormat={},this.config=e,this.typeKeywords=JSON.parse(JSON.stringify(e.typeKeywords)),this.validateKeyword=Object.assign({},e.validateKeyword),this.validateType=Object.assign({},e.validateType),this.validateFormat=Object.assign({},e.validateFormat),this.errors=Object.assign({},e.errors),this.setSchema(t)}get rootSchema(){return this.__rootSchema}set rootSchema(e){null!=e&&(this.__rootSchema=this.config.compileSchema(this,e))}addRemoteSchema(e,t){this.config.addRemoteSchema(this,e,t)}compileSchema(e){var t;return this.config.compileSchema(this,e,null!==(t=this.rootSchema)&&void 0!==t?t:e)}createSchemaOf(e){return this.config.createSchemaOf(e)}each(e,t,i,r){return this.config.each(this,e,t,i,r)}eachSchema(e,t=this.rootSchema){return this.config.eachSchema(t,e)}getChildSchemaSelection(e,t){return this.config.getChildSchemaSelection(this,e,t)}getSchema(e="#",t,i){return this.config.getSchema(this,e,t,i)}getTemplate(e,t,i){return this.config.getTemplate(this,e,t,i)}isValid(e,t,i){return this.config.isValid(this,e,t,i)}resolveAnyOf(e,t,i){return this.config.resolveAnyOf(this,e,t,i)}resolveAllOf(e,t,i){return this.config.resolveAllOf(this,e,t,i)}resolveRef(e){return this.config.resolveRef(e,this.rootSchema)}resolveOneOf(e,t,i){return this.config.resolveOneOf(this,e,t,i)}setSchema(e){this.rootSchema=e}step(e,t,i,r){return this.config.step(this,e,t,i,r)}validate(e,t,i){return this.config.validate(this,e,t,i)}}var Dl=function(){function e(){i(this,e)}return n(e,null,[{key:"validate",value:function(e,t,i){return!(new Al(this.type[e],t).validate(i).length>0&&(console.error("Schema Validation Errors!"),1))}}]),e}();s(Dl,"type",{init:Sl});const Cl=JSON.parse('{"type":"object","required":["version","body"],"properties":{"version":{"type":["integer","string"],"nullable":false},"body":{"type":"object"}}}');var kl=__webpack_require__.t(Cl,2),jl=function(){function e(){i(this,e)}return n(e,[{key:"set",value:function(e,t){var i=e.plyr.elements.container,r=e.plyr.elements.controls,n=i.nextElementSibling,a=r.querySelector(".lt-player__additional-info"),o=e,l=function(e){return e?e.querySelectorAll("button"):null},c=null,u=l(n),h=l(a);0!==(c="in"==t?h:u).length&&c.forEach((function(t){t.addEventListener("click",(function(i){i.preventDefault();var r,n,a,l=t.dataset.ltTarget,c=o.additionalData;void 0!==c[l]&&(n=l,null,a="object"===d(r=c[l])?e.templateService.getAdditionalInfo(s({desktop:!0,modal:!0,id:"".concat(n,"-").concat(e.playerInstance.playerConfig.getPlayerId()),object_data:!0},n,r)):e.templateService.getAdditionalInfo({desktop:!0,modal:!0,id:"".concat(n,"-").concat(e.playerInstance.playerConfig.getPlayerId()),data:r}),document.querySelector("body").insertAdjacentHTML("afterend",a));var u=document.querySelector(".lt-modal-".concat(l,"-").concat(o.playerInstance.playerConfig.getPlayerId()));u&&(u.classList.add("player-lt__show-modal"),document.body.classList.add("overflow-hidden-body-important")),window.Player.players.forEach((function(e){if(e.plyr.playing)return o.playerInstance.pausedPlayer=e.plyr,void e.plyr.pause()}))}))}))}},{key:"windowDesktopEvents",value:function(e,t){var i=document.querySelectorAll(".player-lt__modal");0!==i.length&&i.forEach((function(t){if(t.classList.contains("player-lt__show-modal")){var i=e.target;(i.classList.contains("player-lt__show-modal")||i.classList.contains("player-lt__close-button"))&&(t.classList.remove("player-lt__show-modal"),document.body.classList.remove("overflow-hidden-body-important"),document.querySelectorAll(".player-lt__modal").forEach((function(e){return e.remove()})),window.Player.players.forEach((function(e){if(void 0!==e.pausedPlayer)return e.pausedPlayer.isEmbed&&e.pausedPlayer.embed.play().then((function(){})).catch((function(){})),e.pausedPlayer.isHTML5?void e.pausedPlayer.play():void 0})))}}))}}]),e}(),xl=function(){function e(){i(this,e)}return n(e,[{key:"set",value:function(e){var t=e.plyr.elements.container.querySelector(".lt-player__additional-info-mobile"),i=e,r=this,n=t.querySelectorAll("button");0!==n.length&&n.forEach((function(t){var n=e.playerInstance.eventInstance.mobileEvents.setMobileEvent(t);n&&n.on("singletap",(function(n){n.preventDefault();var a,o,l,c=t.dataset.ltTarget,u=i.additionalData;void 0!==u[c]&&(o=c,null,l="object"===d(a=u[c])?e.templateService.getAdditionalInfo(s({desktop:!0,modal:!0,id:"".concat(o,"-").concat(e.playerInstance.playerConfig.getPlayerId()),object_data:!0},o,a)):e.templateService.getAdditionalInfo({desktop:!0,modal:!0,id:"".concat(o,"-").concat(e.playerInstance.playerConfig.getPlayerId()),data:a}),document.querySelector("body").insertAdjacentHTML("afterend",l));var h=document.querySelector(".lt-modal-".concat(c,"-").concat(i.playerInstance.playerConfig.getPlayerId()));h&&(h.classList.add("player-lt__show-modal"),document.body.classList.add("overflow-hidden-body-important")),window.Player.players.forEach((function(e){if(e.plyr.playing)return i.playerInstance.pausedPlayer=e.plyr,void e.plyr.pause()})),r.closeModal(e)}))}))}},{key:"closeModal",value:function(e){var t=document.querySelectorAll(".player-lt__modal");0!==t.length&&t.forEach((function(t){e.playerInstance.eventInstance.mobileEvents.setMobileEvent(t).on("singletap",(function(e){var i=e.target;t.classList.contains("player-lt__show-modal")&&(i.classList.contains("player-lt__show-modal")||i.classList.contains("player-lt__close-button"))&&(t.classList.remove("player-lt__show-modal"),document.body.classList.remove("overflow-hidden-body-important"),document.querySelectorAll(".player-lt__modal").forEach((function(e){return e.remove()})),window.Player.players.forEach((function(e){if(void 0!==e.pausedPlayer)return e.pausedPlayer.isEmbed&&e.pausedPlayer.embed.play().then((function(){})).catch((function(){})),e.pausedPlayer.isHTML5?void e.pausedPlayer.play():void 0})))}))}))}}]),e}();function _l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=p(e);if(t){var n=p(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return h(this,i)}}var Ol,Pl=function(){function e(){i(this,e),s(this,"container",void 0),s(this,"additionalData",{}),s(this,"playerId",void 0),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"plyr",void 0),s(this,"playerInstance",void 0),s(this,"players",void 0),s(this,"device",void 0),s(this,"addInfoType",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.setDesktopEvents(),this.setMobileEvents()}return n(e,[{key:"setDesktopEvents",value:function(){this.desktopEvents=new jl}},{key:"setMobileEvents",value:function(){this.mobileEvents=new xl}}]),e}();!function(e){var t=function(e){u(r,e);var t=_l(r);function r(){var e;i(this,r);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"activePlayer",void 0),e}return n(r,[{key:"setContainer",value:function(e){this.container=e,this.setDataContent()}},{key:"setDataContent",value:function(){var e=this,t=this.container.children;0!==t.length&&Array.from(t).forEach((function(t){t.hasAttribute("data-lt-player-additional-info-target")&&Object.assign(e.additionalData,s({},t.dataset.ltPlayerAdditionalInfoTarget,t.innerHTML))}))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){Object.keys(e[i]).length>0&&Object.assign(t.additionalData,s({},i,e[i]))}))}},{key:"init",value:function(e,t,i,r){0!==Object.keys(this.additionalData).length&&(this.playerInstance=e,this.plyr=e.plyr,this.playerId=t,this.iconService=i,this.templateService=r,this.device=e.playerConfig.getDevice(),this.setPlayerType())}},{key:"setPlayerType",value:function(){switch(this.playerInstance.playerConfig.getPlayerType()){case 1:case"1":case"portrait":this.addInfoType=(new Ol.Portrate).setAddInfo(this);break;case 2:case"2":case"landscape":this.addInfoType=new Ol.Landscape}}},{key:"setCurrentPlayerPlay",value:function(e,t){this.activePlayer=t.detail.plyr}},{key:"remove",value:function(e){var t=document.querySelectorAll(".player-lt__modal");0!==t.length&&t.forEach((function(e){e.remove()})),e.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").remove()}}]),r}(Pl);e.Controller=t;var r=function(e){u(r,e);var t=_l(r);function r(){var e;i(this,r);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"controller",void 0),e}return n(r,[{key:"setAddInfo",value:function(e){var t=this;switch(this.controller=e,this.controller.device){case"mobile":this.controller.plyr.on("ready",(function(){t.mobile()}));break;case"desktop":this.desktop()}return this}},{key:"mobile",value:function(){var e,t=this.controller.iconService.getIconsByComponent("additionalInfo"),i=this.controller.plyr.elements.controls.querySelector(".content__body"),r=[];Object.keys(this.controller.additionalData).forEach((function(e){switch(e){case"abstract":r.push({target:e,icon:t["file-text"]});break;case"bio":r.push({target:e,icon:t.user});break;case"institution":r.push({target:e,icon:t.university});break;default:r.push({target:e,icon:null})}})),e=this.controller.templateService.getAdditionalInfoButtons({mobile:!0,exist:"true",buttons:r}),i.insertAdjacentHTML("afterend",e),this.mobileEvents.set(this.controller)}},{key:"desktop",value:function(){var e,t=this.controller.iconService.getIconsByComponent("additionalInfo"),i=[];Object.keys(this.controller.additionalData).forEach((function(e){switch(e){case"abstract":i.push({target:e,icon:t["file-text"]});break;case"bio":i.push({target:e,icon:t.user});break;case"institution":i.push({target:e,icon:t.university});break;default:i.push({target:e,icon:null})}})),e=this.controller.templateService.getAdditionalInfoButtons({desktop:!0,exist:"true",buttons:i}),this.controller.playerInstance.windowService.setEventAddInfo(e,this.desktopEvents,this.controller)}}]),r}(t);e.Portrate=r;var a=function(e){u(r,e);var t=_l(r);function r(){var e;i(this,r);for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"controller",void 0),e}return n(r,[{key:"setAddInfo",value:function(){}},{key:"mobileTouchEvent",value:function(){}}]),r}(t);e.Landscape=a}(Ol||(Ol={})),Z.Player;var Rl=function(){function e(){i(this,e),s(this,"additionalInfoService",void 0)}return n(e,[{key:"checkIfPlayerExists",value:function(e){var t=!1;return e.body.playerContainer instanceof HTMLElement&&(t=!0,void 0!==window.Player&&window.Player.players.forEach((function(i){i.playerConfig.getPlayerElementContainer()===e.body.playerContainer&&(t=!1)}))),t}},{key:"init",value:function(e){var t=this;if(W.setDebugEvent("Start init player","info"),!e||0===Object.keys(e).length)return W.setDebugEvent("Lt Player: The config object is empty","error"),W.setDebugEvent("Use one of below examples","error"),void W.setDebugEvent({Example_1:'Use object to configure player (Player.init({versions : "Player versions", body : {player configure body}}))',Example_2:'Use HTML dataset attribute to configure Player (data-lt-player-config="{versions : "Player versions", body : {player configure body}"))'},"table");if(Dl.validate("init",kl,e)){if(W.setDebugEvent("Validate player config","info"),"string"==typeof e.body.playerContainer){var i=document.querySelector(".".concat(e.body.playerContainer,", #").concat(e.body.playerContainer));if(!i)return void console.error("No Element found with ".concat(e.body.playerContainer));e.body.playerContainer=i}e.body.device=W.getDevice();var r,n=e.body.playerContainer;return n.classList.add("lt-player"),this.setAdditionalInfo(e),void 0===e.body.playerType?"string"==typeof(r=e.version)&&1===parseInt(r)||"number"==typeof r&&1===r?new Promise((function(i,r){e.body.playerType=2,i(t.setType(e,n)),r(null)})):new Promise((function(i,r){e.body.playerType=t.getVideoTypeByUrl(e.body.videoUrl).then((function(r){e.body.playerType=r,i(t.setType(e,n))}))})):new Promise((function(i,r){i(t.setType(e,n)),r(null)}))}}},{key:"setType",value:function(e,t){var i=this.setPlayerType(e.body.playerType);if(i){if(i.setup(e,this.additionalInfoService))return e.body.playerContainer=i,this.additionalInfoService=null,i}else console.error('No "playerType" is set in config!')}},{key:"getVideoTypeByUrl",value:function(e){var t,i=W.processConfigData(e);switch(i.type){case"embedded":return i.embedId=W.getEmbeddedID(e),i.embedHash=W.getEmbeddedHash(e),function(e){return new Promise((function(t,i){fetch("https://vimeo.com/api/oembed.json?url=".concat(e)).then((function(e){t(e.json())}),(function(e){i(e)}))}))}(e).then((function(e){return new Promise((function(t,i){var r=e;r.width>r.height?t("landscape"):t("portrait")}))}));case"video":return(t=document.createElement("video")).src=e,e.includes(".m3u8")?new Promise((function(e){e("portrait")})):new Promise((function(e){t.addEventListener("loadedmetadata",(function(t){this.videoWidth>this.videoHeight?e("landscape"):e("portrait")}),!1)}))}}},{key:"setAdditionalInfo",value:function(e){var t=e.body.playerContainer.querySelector(".lt-player-additional-info");return t?(this.additionalInfoService=new Ol.Controller,void this.additionalInfoService.setContainer(t)):void 0!==e.body.additionalInfo&&Object.keys(e.body.additionalInfo).length>0?(this.additionalInfoService=new Ol.Controller,void this.additionalInfoService.setConfig(e.body.additionalInfo)):void(this.additionalInfoService=null)}},{key:"setPlayerType",value:function(e){var t=null;switch(e){case"1":case 1:case"portrait":t=new va.PortraitType;break;case"2":case 2:case"landscape":t=new va.LandscapeType}return t}}]),e}(),zl=function(){function e(){i(this,e),s(this,"players",[]),this.initPageDomElements()}var r;return n(e,[{key:"initPageDomElements",value:function(){var e,t=this;0!==(e=document.querySelectorAll(".".concat("lt-player",", #").concat("lt-player"))).length&&(e=document.querySelectorAll("[data-lt-player-config]")),0!==e.length&&e.forEach((function(e){t.initBySelector(e)}))}},{key:"initByClassOrID",value:function(e,t){var i=this;if("string"==typeof e){var r=document.querySelector(".".concat(e,", #").concat(e));if(r)return new Promise((function(e){i.initBySelector(r,t).then((function(t){e(t)}))}))}else console.error("Identifier has another type of")}},{key:"initBySelector",value:function(e,t){var i,r=this,n=e.dataset.ltPlayerConfig;return n||(n=t),void 0!==n?(i="string"==typeof n?JSON.parse(n):n,Object.assign(i.body,{playerContainer:e}),new Promise((function(e){r.initPlayer(i).then((function(t){e(t)}))}))):new Promise((function(t,i){console.error('Lt Player: No "data-lt-player-config" attribute is set on element!'),console.log(e),console.error("Use one of below examples"),console.table({Example_1:'<div class="lt-player" data-lt-player-config="{config}"> </div>'}),i()}))}},{key:"initPlayer",value:function(e){var t=this,i=new Rl;return new Promise((function(r,n){if(i.checkIfPlayerExists(e)){var s=i.init(e);s?s.then((function(e){t.players.push(e),r(e)})):n("Player is not setup")}else n("Duplicate player")}))}},{key:"getPlayer",value:function(e){var t=this;if(0===this.players.length)return null;var i=function(e){var i=null;return t.players.forEach((function(t){t.playerConfig.getConfigData().playerId===e&&(i=t)})),i};return"string"==typeof e?i(parseInt(e)):"number"==typeof e?i(e):e instanceof Element?function(e){var i=null,r=e.playerManager;return t.players.forEach((function(e){e===r&&(i=e)})),i}(e):void 0}},{key:"pauseAllPlayers",value:function(){this.players.forEach((function(e){e.plyr.playing&&e.plyr.pause()}))}},{key:"stopAllPlayers",value:function(){this.players.forEach((function(e){e.plyr.playing&&e.plyr.stop()}))}},{key:"destruct",value:(r=t(o().mark((function e(){var i,r,n,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=t(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.destruct();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),r=function(){var e=t(o().mark((function e(t,i){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=7;break}return e.next=4,i(t[r]);case 4:r++,e.next=1;break;case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),n=function(){var e=t(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r(s.players,function(){var e=t(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.abrupt("return",n().then((function(){s.players=[],console.clear()})));case 4:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})}]),e}();"container"in document.documentElement.style||__webpack_require__(5266),void 0===window.Player&&(window.Player=new zl)})()})();
|
|
2
|
+
(()=>{var __webpack_modules__={4604:function(e){"undefined"!=typeof self&&self,e.exports=(()=>{"use strict";var e={d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function i(e){return"#"===e||""===e||Array.isArray(e)&&0===e.length||!1}e.r(t),e.d(t,{default:()=>N,get:()=>u,isRoot:()=>i,join:()=>I,remove:()=>M,removeUndefinedItems:()=>v,set:()=>g,split:()=>c});const n=/~1/g,r=/~0/g,s=/\/+/g,a=/(^[#/]*|\/+$)/g;function o(e){return e.replace(n,"/").replace(r,"~")}function l(e){return o(decodeURIComponent(e))}function c(e){if(null==e||"string"!=typeof e||i(e))return Array.isArray(e)?e:[];const t=e.indexOf("#")>=0?l:o,n=(e=(e=e.replace(s,"/")).replace(a,"")).split("/");for(let e=0,i=n.length;e<i;e+=1)n[e]=t(n[e]);return n}function u(e,t,n){if(null==t||null==e)return n;if(i(t))return e;const r=d(e,c(t));return void 0===r?n:r}function d(e,t){const i=t.shift();if(void 0!==e)return void 0!==i?d(e[i],t):e}const h=/^\[.*\]$/,p=/^\[(.+)\]$/;function f(e,t){return"__proto__"===e||"constructor"==e&&t.length>0&&"prototype"==t[0]}function g(e,t,i){if(null==t)return e;const n=c(t);if(0===n.length)return e;null==e&&(e=h.test(n[0])?[]:{});let r,s,a=e;for(;n.length>1;)r=n.shift(),s=h.test(n[0]),f(r,n)||(a=m(a,r,s));return r=n.pop(),y(a,r,i),e}function y(e,t,i){let n;const r=t.match(p);"[]"===t&&Array.isArray(e)?e.push(i):r?(n=r.pop(),e[n]=i):e[t]=i}function m(e,t,i){if(null!=e[t])return e[t];const n=i?[]:{};return y(e,t,n),n}function v(e){let t=0,i=0;for(;t+i<e.length;)void 0===e[t+i]&&(i+=1),e[t]=e[t+i],t+=1;return e.length=e.length-i,e}function M(e,t,i){const n=c(t),r=n.pop(),s=u(e,n);return s&&delete s[r],Array.isArray(s)&&!0!==i&&v(s),e}const T=/\/+/g,L=/~/g,b=/\//g;function E(e,t){if(0===e.length)return t?"#":"";for(let i=0,n=e.length;i<n;i+=1)e[i]=e[i].replace(L,"~0").replace(b,"~1"),t&&(e[i]=encodeURIComponent(e[i]));return((t?"#/":"/")+e.join("/")).replace(T,"/")}function I(e,...t){const i=[];if(Array.isArray(e))return E(e,!0===arguments[1]);const n=arguments[arguments.length-1],r="boolean"==typeof n?n:e&&"#"===e[0];for(let e=0,t=arguments.length;e<t;e+=1)i.push.apply(i,c(arguments[e]));const s=[];for(let e=0,t=i.length;e<t;e+=1)if(".."===i[e]){if(0===s.length)return r?"#":"";s.pop()}else s.push(i[e]);return E(s,r)}const N={get:u,set:g,remove:M,join:I,split:c,splitLast:function(e){const t=c(e);if(0===t.length)return"string"==typeof e&&"#"===e[0]?["#",t[0]]:["",void 0];if(1===t.length)return"#"===e[0]?["#",t[0]]:["",t[0]];const i=t.pop();return[I(t,"#"===e[0]),i]},isRoot:i,removeUndefinedItems:v};return t})()},9996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o((i=e,Array.isArray(i)?[]:{}),e,t):e;var i}function r(e,t,i){return e.concat(t).map((function(e){return n(e,i)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(i);return c===Array.isArray(e)?c?l.arrayMerge(e,i,l):function(e,t,i){var r={};return i.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=n(e[t],i)})),s(t).forEach((function(s){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(a(e,s)&&i.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return o;var i=t.customMerge(e);return"function"==typeof i?i:o}(s,i)(e[s],t[s],i):r[s]=n(t[s],i))})),r}(e,i,l):n(i,l)}o.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,i){return o(e,i,t)}),{})};var l=o;e.exports=l},5723:(e,t,i)=>{"use strict";const n=i(9802);var r;!function(e){e.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[["'\"'",/[^"]*/,"'\"'"],['"\'"',/[^']*/,'"\'"']],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],e.defaultParser=new n.Parser(e.RULES,{debug:!1});const t=/^(!|&)/,i=/(\?|\+|\*)$/,r=/^%/;function s(e,a){let o=n.findRuleByName(e,a);return o?o.bnf.map((e=>function(e,a){return e.map((e=>function(e,a){if("string"==typeof e){if(t.test(e))return"";if(r.test(e)){let t=i.exec(e),r=t?t[0]+" ":"",o=function(e,t){let i=n.findRuleByName(e,t);return i&&1==i.bnf.length&&1==i.bnf[0].length&&(i.bnf[0][0]instanceof RegExp||'"'==i.bnf[0][0][0]||"'"==i.bnf[0][0][0])}(e,a);return o?s(e,a)+r:"("+s(e,a)+")"+r}return e}return e.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}(e,a))).join(" ")}(e,a))).join(" | "):"RULE_NOT_FOUND {"+e+"}"}function a(e){let t=[];return e.grammarRules.forEach((i=>{if(!/^%/.test(i.name)){let n=i.recover?" /* { recoverUntil="+i.recover+" } */":"";t.push(i.name+" ::= "+s(i.name,e)+n)}})),t.join("\n")}e.emit=a;let o=0;function l(e){return new RegExp(e.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function c(e,t,i){let n=t.children.filter((e=>"SequenceOrDifference"==e.type)).map((t=>function(e,t,i){let n=null,r=[];return t.children.forEach(((s,a)=>{"Minus"==s.type&&function(e,t){throw console.log("reberia restar "+t+" a "+e),new Error("Difference not supported yet")}(n,s);let u=t.children[a+1];switch(u=u&&"PrimaryDecoration"==u.type&&u.text||"",s.type){case"SubItem":let t="%"+(i+o++);c(e,s,t),r.push(""+t+u);break;case"NCName":case"StringLiteral":r.push(""+s.text+u);break;case"CharCode":case"CharClass":if(u){let t={name:"%"+(i+o++),bnf:[[l(s.text)]]};e.push(t),r.push(""+t.name+u)}else r.push(l(s.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+s.type+" -> "+JSON.stringify(s.text))}n=s})),r}(e,t,i))),r={name:i,bnf:n},s=null;n.forEach((e=>{s=s||e.recover,delete e.recover})),0==i.indexOf("%")&&(r.fragment=!0),s&&(r.recover=s),e.push(r)}function u(t,i=e.defaultParser){let n=i.getAST(t);if(!n)throw new Error("Could not parse "+t);if(n.errors&&n.errors.length)throw n.errors[0];let r=[];return n.children.filter((e=>"Production"==e.type)).map((e=>{let t=e.children.filter((e=>"NCName"==e.type))[0].text;c(r,e,t)})),r}e.getRules=u,e.Transform=function(t,i=e.defaultParser){return u(t.join(""),i)};class d extends n.Parser{constructor(t,i){super(u(t,i&&!0===i.debugRulesParser?new n.Parser(e.RULES,{debug:!0}):e.defaultParser),i)}emitSource(){return a(this)}}e.Parser=d}(r||(r={})),t.Z=r},9802:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parser=exports.findRuleByName=exports.parseRuleName=exports.escapeRegExp=exports.readToken=void 0;const UPPER_SNAKE_RE=/^[A-Z0-9_]+$/,decorationRE=/(\?|\+|\*)$/,preDecorationRE=/^(@|&|!)/,WS_RULE="WS",TokenError_1=__webpack_require__(2239);function readToken(e,t){let i=t.exec(e);return i&&0==i.index?0==i[0].length&&t.source.length>0?null:{type:null,text:i[0],rest:e.substr(i[0].length),start:0,end:i[0].length-1,fullText:i[0],errors:[],children:[],parent:null}:null}function escapeRegExp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function fixRest(e){e.rest="",e.children&&e.children.forEach((e=>fixRest(e)))}function fixPositions(e,t){e.start+=t,e.end+=t,e.children&&e.children.forEach((t=>fixPositions(t,e.start)))}function agregateErrors(e,t){t.errors&&t.errors.length&&t.errors.forEach((t=>e.push(t))),t.children&&t.children.forEach((t=>agregateErrors(e,t)))}function parseRuleName(e){let t=decorationRE.exec(e),i=preDecorationRE.exec(e),n=t&&t[0]||"",r=i&&i[0]||"",s={raw:e,name:e.replace(decorationRE,"").replace(preDecorationRE,""),isOptional:"?"==n||"*"==n,allowRepetition:"+"==n||"*"==n,atLeastOne:"+"==n,lookupPositive:"&"==r,lookupNegative:"!"==r,pinned:"@"==r,lookup:!1,isLiteral:!1};return s.isLiteral="'"==s.name[0]||'"'==s.name[0],s.lookup=s.lookupNegative||s.lookupPositive,s}function findRuleByName(e,t){let i=parseRuleName(e);return t.cachedRules[i.name]||null}function stripRules(e,t){if(e.children){let i=e.children.filter((e=>e.type&&t.test(e.type)));for(let t=0;t<i.length;t++){let n=e.children.indexOf(i[t]);-1!=n&&e.children.splice(n,1)}e.children.forEach((e=>stripRules(e,t)))}}exports.readToken=readToken,exports.escapeRegExp=escapeRegExp,exports.parseRuleName=parseRuleName,exports.findRuleByName=findRuleByName;const ignoreMissingRules=["EOF"];class Parser{constructor(e,t){this.grammarRules=e,this.options=t,this.cachedRules={},this.debug=!!t&&!0===t.debug;let i=[],n=[];if(e.forEach((e=>{let t=parseRuleName(e.name);if(t.name in this.cachedRules)i.push("Duplicated rule "+t.name);else{if(this.cachedRules[t.name]=e,e.bnf&&e.bnf.length)e.bnf.forEach((t=>{if("string"==typeof t[0]&&parseRuleName(t[0]).name==e.name){let t="Left recursion is not allowed, rule: "+e.name;-1==i.indexOf(t)&&i.push(t)}t.forEach((e=>{if("string"==typeof e){let t=parseRuleName(e);t.isLiteral||-1!=n.indexOf(t.name)||-1!=ignoreMissingRules.indexOf(t.name)||n.push(t.name)}}))}));else{let t="Missing rule content, rule: "+e.name;-1==i.indexOf(t)&&i.push(t)}WS_RULE==e.name&&(e.implicitWs=!1),e.implicitWs&&-1==n.indexOf(WS_RULE)&&n.push(WS_RULE),e.recover&&-1==n.indexOf(e.recover)&&n.push(e.recover)}})),n.forEach((e=>{e in this.cachedRules||i.push("Missing rule "+e)})),i.length)throw new Error(i.join("\n"))}getAST(e,t){t||(t=this.grammarRules.filter((e=>!e.fragment&&0!=e.name.indexOf("%")))[0].name);let i=this.parse(e,t);if(i){agregateErrors(i.errors,i),fixPositions(i,0),stripRules(i,/^%/),this.options&&this.options.keepUpperRules||stripRules(i,UPPER_SNAKE_RE);let e=i.rest;e&&new TokenError_1.TokenError("Unexpected end of input: \n"+e,i),fixRest(i),i.rest=e}return i}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(txt,target,recursion=0){let out=null,type=parseRuleName(target),expr,printable=this.debug&&!UPPER_SNAKE_RE.test(type.name);printable&&console.log(new Array(recursion).join("│ ")+"Trying to get "+target+" from "+JSON.stringify(txt.split("\n")[0]));let realType=type.name,targetLex=findRuleByName(type.name,this);if("EOF"==type.name){if(txt.length)return null;if(0==txt.length)return{type:"EOF",text:"",rest:"",start:0,end:0,fullText:"",errors:[],children:[],parent:null}}try{if(!targetLex&&type.isLiteral){let src=eval(type.name);if(""===src)return{type:"%%EMPTY%%",text:"",rest:txt,start:0,end:0,fullText:"",errors:[],children:[],parent:null};expr=new RegExp(escapeRegExp(src)),realType=null}}catch(e){return e instanceof ReferenceError&&console.error(e),null}if(expr){let e=readToken(txt,expr);if(e)return e.type=realType,e}else{let e=targetLex.bnf;e instanceof Array&&e.forEach((e=>{if(out)return;let t=null,i={type:type.name,text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:txt};targetLex.fragment&&(i.fragment=!0);let n=txt,r=0,s=e.length>0,a=!1;for(let o=0;o<e.length;o++)if("string"==typeof e[o]){let l,c=parseRuleName(e[o]);s=s&&c.isOptional;let u=!1;do{if(l=null,targetLex.implicitWs&&(l=this.parse(n,c.name,recursion+1),!l)){let e;do{if(e=this.parse(n,WS_RULE,recursion+1),!e)break;i.text=i.text+e.text,i.end=i.text.length,e.parent=i,i.children.push(e),n=n.substr(e.text.length),r+=e.text.length}while(e&&e.text.length)}if(l=l||this.parse(n,c.name,recursion+1),c.lookupNegative){if(l)return;break}if(c.lookupPositive&&!l)return;if(!l){if(c.isOptional)break;if(c.atLeastOne&&u)break}if(l&&targetLex.pinned==o+1&&(t=l,printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" PINNED")),l||(l=this.parseRecovery(targetLex,n,recursion+1)),!l){if(!t)return;out=i,l={type:"SyntaxError",text:n,children:[],end:n.length,errors:[],fullText:"",parent:null,start:0,rest:""},n.length?new TokenError_1.TokenError(`Unexpected end of input. Expecting ${c.name} Got: ${n}`,l):new TokenError_1.TokenError(`Unexpected end of input. Missing ${c.name}`,l),printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" "+JSON.stringify(l.text))}if(u=!0,a=!0,"%%EMPTY%%"==l.type)break;l.start+=r,l.end+=r,!c.lookupPositive&&l.type&&(l.fragment?l.children&&l.children.forEach((e=>{e.start+=r,e.end+=r,e.parent=i,i.children.push(e)})):(l.parent=i,i.children.push(l))),c.lookup&&(l.lookup=!0),printable&&console.log(new Array(recursion+1).join("│ ")+"└─ "+l.type+" "+JSON.stringify(l.text)),c.lookup||l.lookup||(i.text=i.text+l.text,i.end=i.text.length,n=n.substr(l.text.length),r+=l.text.length),i.rest=n}while(l&&c.allowRepetition&&n.length&&!l.lookup)}else{let t=readToken(n,e[o]);if(!t)return;printable&&console.log(new Array(recursion+1).join("│ ")+"└> "+JSON.stringify(t.text)+e[o].source),a=!0,t.start+=r,t.end+=r,i.text=i.text+t.text,i.end=i.text.length,n=n.substr(t.text.length),r+=t.text.length,i.rest=n}a&&(out=i,printable&&console.log(new Array(recursion).join("│ ")+"├<─┴< PUSHING "+out.type+" "+JSON.stringify(out.text)))})),out&&targetLex.simplifyWhenOneChildren&&1==out.children.length&&(out=out.children[0])}return out||printable&&console.log(target+" NOT RESOLVED FROM "+txt),out}parseRecovery(e,t,i){if(e.recover&&t.length){let n=this.debug;n&&console.log(new Array(i+1).join("│ ")+"Trying to recover until token "+e.recover+" from "+JSON.stringify(t.split("\n")[0]+t.split("\n")[1]));let r,s={type:"SyntaxError",text:"",children:[],end:0,errors:[],fullText:"",parent:null,start:0,rest:""};do{if(r=this.parse(t,e.recover,i+1),r){new TokenError_1.TokenError('Unexpected input: "'+s.text+`" Expecting: ${e.name}`,s);break}s.text=s.text+t[0],s.end=s.text.length,t=t.substr(1)}while(!r&&t.length>0);if(s.text.length>0&&r)return n&&console.log(new Array(i+1).join("│ ")+"Recovered text: "+JSON.stringify(s.text)),s}return null}}exports.Parser=Parser,exports.default=Parser},2239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenError=void 0;class i extends Error{constructor(e,t){if(super(e),this.message=e,this.token=t,!t||!t.errors)throw this;t.errors.push(this)}inspect(){return"SyntaxError: "+this.message}}t.TokenError=i},4063:e=>{"use strict";e.exports=function e(t,i){if(t===i)return!0;if(t&&i&&"object"==typeof t&&"object"==typeof i){if(t.constructor!==i.constructor)return!1;var n,r,s;if(Array.isArray(t)){if((n=t.length)!=i.length)return!1;for(r=n;0!=r--;)if(!e(t[r],i[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===i.source&&t.flags===i.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===i.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===i.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(i).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(i,s[r]))return!1;for(r=n;0!=r--;){var a=s[r];if(!e(t[a],i[a]))return!1}return!0}return t!=t&&i!=i}},840:(e,t,i)=>{var n;!function(r,s,a,o){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=s.createElement("div"),d=Math.round,h=Math.abs,p=Date.now;function f(e,t,i){return setTimeout(L(e,i),t)}function g(e,t,i){return!!Array.isArray(e)&&(y(e,i[t],i),!0)}function y(e,t,i){var n;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==o)for(n=0;n<e.length;)t.call(i,e[n],n,e),n++;else for(n in e)e.hasOwnProperty(n)&&t.call(i,e[n],n,e)}function m(e,t,i){var n="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",s=r.console&&(r.console.warn||r.console.log);return s&&s.call(r.console,n,i),e.apply(this,arguments)}}l="function"!=typeof Object.assign?function(e){if(e===o||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==o&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])}return t}:Object.assign;var v=m((function(e,t,i){for(var n=Object.keys(t),r=0;r<n.length;)(!i||i&&e[n[r]]===o)&&(e[n[r]]=t[n[r]]),r++;return e}),"extend","Use `assign`."),M=m((function(e,t){return v(e,t,!0)}),"merge","Use `assign`.");function T(e,t,i){var n,r=t.prototype;(n=e.prototype=Object.create(r)).constructor=e,n._super=r,i&&l(n,i)}function L(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||o,t):e}function E(e,t){return e===o?t:e}function I(e,t,i){y(A(t),(function(t){e.addEventListener(t,i,!1)}))}function N(e,t,i){y(A(t),(function(t){e.removeEventListener(t,i,!1)}))}function S(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function w(e,t){return e.indexOf(t)>-1}function A(e){return e.trim().split(/\s+/g)}function C(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function k(e,t,i){for(var n=[],r=[],s=0;s<e.length;){var a=t?e[s][t]:e[s];C(r,a)<0&&n.push(e[s]),r[s]=a,s++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function j(e,t){for(var i,n,r=t[0].toUpperCase()+t.slice(1),s=0;s<c.length;){if((n=(i=c[s])?i+r:t)in e)return n;s++}return o}var x=1;function _(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||r}var O="ontouchstart"in r,P=j(r,"PointerEvent")!==o,R=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z="touch",F="mouse",U=["x","y"],Y=["clientX","clientY"];function B(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&i.handler(t)},this.init()}function $(e,t,i){var n=i.pointers.length,r=i.changedPointers.length,s=1&t&&n-r==0,a=12&t&&n-r==0;i.isFirst=!!s,i.isFinal=!!a,s&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,n=t.pointers,r=n.length;i.firstInput||(i.firstInput=G(t)),r>1&&!i.firstMultiple?i.firstMultiple=G(t):1===r&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,l=a?a.center:s.center,c=t.center=Q(n);t.timeStamp=p(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Z(l,c),t.distance=W(l,c),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},s=e.prevInput||{};1!==t.eventType&&4!==s.eventType||(r=e.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y}),t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=q(t.deltaX,t.deltaY);var u,d,f=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=h(f.x)>h(f.y)?f.x:f.y,t.scale=a?(u=a.pointers,W((d=n)[0],d[1],Y)/W(u[0],u[1],Y)):1,t.rotation=a?function(e,t){return Z(t[1],t[0],Y)+Z(e[1],e[0],Y)}(a.pointers,n):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,n,r,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===o)){var c=t.deltaX-a.deltaX,u=t.deltaY-a.deltaY,d=H(l,c,u);n=d.x,r=d.y,i=h(d.x)>h(d.y)?d.x:d.y,s=q(c,u),e.lastInterval=t}else i=a.velocity,n=a.velocityX,r=a.velocityY,s=a.direction;t.velocity=i,t.velocityX=n,t.velocityY=r,t.direction=s}(i,t);var g=e.element;S(t.srcEvent.target,g)&&(g=t.srcEvent.target),t.target=g}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function G(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:d(e.pointers[i].clientX),clientY:d(e.pointers[i].clientY)},i++;return{timeStamp:p(),pointers:t,center:Q(t),deltaX:e.deltaX,deltaY:e.deltaY}}function Q(e){var t=e.length;if(1===t)return{x:d(e[0].clientX),y:d(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:d(i/t),y:d(n/t)}}function H(e,t,i){return{x:t/e||0,y:i/e||0}}function q(e,t){return e===t?1:h(e)>=h(t)?e<0?2:4:t<0?8:16}function W(e,t,i){i||(i=U);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function Z(e,t,i){i||(i=U);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}B.prototype={handler:function(){},init:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(_(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(_(this.element),this.evWin,this.domHandler)}};var V={mousedown:1,mousemove:2,mouseup:4},K="mousedown",X="mousemove mouseup";function J(){this.evEl=K,this.evWin=X,this.pressed=!1,B.apply(this,arguments)}T(J,B,{handler:function(e){var t=V[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:F,srcEvent:e}))}});var ee={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},te={2:z,3:"pen",4:F,5:"kinect"},ie="pointerdown",ne="pointermove pointerup pointercancel";function re(){this.evEl=ie,this.evWin=ne,B.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ie="MSPointerDown",ne="MSPointerMove MSPointerUp MSPointerCancel"),T(re,B,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),r=ee[n],s=te[e.pointerType]||e.pointerType,a=s==z,o=C(t,e.pointerId,"pointerId");1&r&&(0===e.button||a)?o<0&&(t.push(e),o=t.length-1):12&r&&(i=!0),o<0||(t[o]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:s,srcEvent:e}),i&&t.splice(o,1))}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart",oe="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.evWin=oe,this.started=!1,B.apply(this,arguments)}function ce(e,t){var i=D(e.touches),n=D(e.changedTouches);return 12&t&&(i=k(i.concat(n),"identifier",!0)),[i,n]}T(le,B,{handler:function(e){var t=se[e.type];if(1===t&&(this.started=!0),this.started){var i=ce.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:z,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function he(){this.evTarget=de,this.targetIds={},B.apply(this,arguments)}function pe(e,t){var i=D(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,s,a=D(e.changedTouches),o=[],l=this.target;if(s=i.filter((function(e){return S(e.target,l)})),1===t)for(r=0;r<s.length;)n[s[r].identifier]=!0,r++;for(r=0;r<a.length;)n[a[r].identifier]&&o.push(a[r]),12&t&&delete n[a[r].identifier],r++;return o.length?[k(s.concat(o),"identifier",!0),o]:void 0}function fe(){B.apply(this,arguments);var e=L(this.handler,this);this.touch=new he(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ge(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ye.call(this,t)):12&e&&ye.call(this,t)}function ye(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function me(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],s=Math.abs(t-r.x),a=Math.abs(i-r.y);if(s<=25&&a<=25)return!0}return!1}T(he,B,{handler:function(e){var t=ue[e.type],i=pe.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:z,srcEvent:e})}}),T(fe,B,{handler:function(e,t,i){var n=i.pointerType==z,r=i.pointerType==F;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)ge.call(this,t,i);else if(r&&me.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ve=j(u.style,"touchAction"),Me=ve!==o,Te="compute",Le="auto",be="manipulation",Ee="none",Ie="pan-x",Ne="pan-y",Se=function(){if(!Me)return!1;var e={},t=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!t||r.CSS.supports("touch-action",i)})),e}();function we(e,t){this.manager=e,this.set(t)}we.prototype={set:function(e){e==Te&&(e=this.compute()),Me&&this.manager.element.style&&Se[e]&&(this.manager.element.style[ve]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return y(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(w(e,Ee))return Ee;var t=w(e,Ie),i=w(e,Ne);return t&&i?Ee:t||i?t?Ie:Ne:w(e,be)?be:Le}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=w(n,Ee)&&!Se.none,s=w(n,Ne)&&!Se["pan-y"],a=w(n,Ie)&&!Se["pan-x"];if(r){var o=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(o&&l&&c)return}if(!a||!s)return r||s&&6&i||a&&24&i?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ae=32;function Ce(e){this.options=l({},this.defaults,e||{}),this.id=x++,this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function De(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ke(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function je(e,t){var i=t.manager;return i?i.get(e):e}function xe(){Ce.apply(this,arguments)}function _e(){xe.apply(this,arguments),this.pX=null,this.pY=null}function Oe(){xe.apply(this,arguments)}function Pe(){Ce.apply(this,arguments),this._timer=null,this._input=null}function Re(){xe.apply(this,arguments)}function ze(){xe.apply(this,arguments)}function Fe(){Ce.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ue(e,t){return(t=t||{}).recognizers=E(t.recognizers,Ue.defaults.preset),new Ye(e,t)}function Ye(e,t){this.options=l({},Ue.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new(this.options.inputClass||(P?re:R?he:O?fe:J))(this,$),this.touchAction=new we(this,this.options.touchAction),Be(this,!0),y(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Be(e,t){var i,n=e.element;n.style&&(y(e.options.cssProps,(function(r,s){i=j(n.style,s),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}Ce.prototype={defaults:{},set:function(e){return l(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(g(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=je(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return g(e,"dropRecognizeWith",this)||(e=je(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(g(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=je(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(g(e,"dropRequireFailure",this))return this;e=je(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+De(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+De(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ae},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=l({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Ae);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},T(xe,Ce,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:Ae}}),T(_e,xe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ne),24&e&&t.push(Ie),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,s=e.deltaX,a=e.deltaY;return r&t.direction||(6&t.direction?(r=0===s?1:s<0?2:4,i=s!=this.pX,n=Math.abs(e.deltaX)):(r=0===a?1:a<0?8:16,i=a!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return xe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),T(Oe,xe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),T(Pe,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Le]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Ae},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),T(Re,xe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),T(ze,xe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:24&i&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),T(Fe,Ce,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[be]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var s=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||W(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&s?this.count+=1:this.count=1,this._input=e,0==this.count%t.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Ae},failTimeout:function(){return this._timer=f((function(){this.state=Ae}),this.options.interval,this),Ae},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ue.VERSION="2.0.7",Ue.defaults={domEvents:!1,touchAction:Te,enable:!0,inputTarget:null,inputClass:null,preset:[[Re,{enable:!1}],[Oe,{enable:!1},["rotate"]],[ze,{direction:6}],[_e,{direction:6},["swipe"]],[Fe],[Fe,{event:"doubletap",taps:2},["tap"]],[Pe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ye.prototype={set:function(e){return l(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var s=0;s<n.length;)i=n[s],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),s++}},get:function(e){if(e instanceof Ce)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(g(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(g(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=C(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==o&&t!==o){var i=this.handlers;return y(A(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==o){var i=this.handlers;return y(A(e),(function(e){t?i[e]&&i[e].splice(C(i[e],t),1):delete i[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=s.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](t),n++}},destroy:function(){this.element&&Be(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l(Ue,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ae,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Ye,Input:B,TouchAction:we,TouchInput:he,MouseInput:J,PointerEventInput:re,TouchMouseInput:fe,SingleTouchInput:le,Recognizer:Ce,AttrRecognizer:xe,Tap:Fe,Pan:_e,Swipe:ze,Pinch:Oe,Rotate:Re,Press:Pe,on:I,off:N,each:y,merge:M,extend:v,assign:l,inherit:T,bindFn:L,prefixed:j}),(void 0!==r?r:"undefined"!=typeof self?self:{}).Hammer=Ue,(n=function(){return Ue}.call(t,i,t,e))===o||(e.exports=n)}(window,document)},1443:function(e,t,i){"object"==typeof navigator&&(e.exports=function(){"use strict";function e(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var a={addCSS:!0,thumbWidth:15,watch:!0};function o(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var l=function(e){return null!=e?e.constructor:null},c=function(e,t){return!!(e&&t&&e instanceof t)},u=function(e){return l(e)===String},d=function(e){return Array.isArray(e)},h=function(e){return c(e,NodeList)},p=u,f=d,g=h,y=function(e){return c(e,Element)},m=function(e){return c(e,Event)},v=function(e){return function(e){return null==e}(e)||(u(e)||d(e)||h(e))&&!e.length||function(e){return l(e)===Object}(e)&&!Object.keys(e).length};var M=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),y(t)?this.element=t:p(t)&&(this.element=document.querySelector(t)),y(this.element)&&v(this.element.rangeTouch)&&(this.config=s({},a,{},i),this.init())}return function(e,i,n){i&&t(e.prototype,i),n&&t(e,n)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(t){if(!e.enabled||!m(t))return null;var i,n=t.target,r=t.changedTouches[0],s=parseFloat(n.getAttribute("min"))||0,a=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(r.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),s+function(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(a-s),o)}},{key:"set",value:function(t){e.enabled&&m(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=null;if(v(t)||p(t)?n=Array.from(document.querySelectorAll(p(t)?t:'input[type="range"]')):y(t)?n=[t]:g(t)?n=Array.from(t):f(t)&&(n=t.filter(y)),v(n))return null;var r=s({},a,{},i);if(p(t)&&r.watch){var l=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){y(i)&&o(i,t)&&new e(i,r)}))}))}));l.observe(document.body,{childList:!0,subtree:!0})}return n.map((function(t){return new e(t,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const T=e=>null!=e?e.constructor:null,L=(e,t)=>Boolean(e&&t&&e instanceof t),b=e=>null==e,E=e=>T(e)===Object,I=e=>T(e)===String,N=e=>"function"==typeof e,S=e=>Array.isArray(e),w=e=>L(e,NodeList),A=e=>b(e)||(I(e)||S(e)||w(e))&&!e.length||E(e)&&!Object.keys(e).length;var C=b,D=E,k=e=>T(e)===Number&&!Number.isNaN(e),j=I,x=e=>T(e)===Boolean,_=N,O=S,P=w,R=e=>null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument,z=e=>L(e,Event),F=e=>L(e,KeyboardEvent),U=e=>L(e,TextTrack)||!b(e)&&I(e.kind),Y=e=>{if(L(e,window.URL))return!0;if(!I(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!A(new URL(t).hostname)}catch(e){return!1}},B=A;const $=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find((t=>void 0!==e.style[t]));return!!j(i)&&t[i]})();function G(e,t){setTimeout((()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch(e){}}),t)}const Q={isIE:Boolean(window.document.documentMode),isEdge:/Edge/g.test(navigator.userAgent),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),isIPhone:/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function H(e,t){return t.split(".").reduce(((e,t)=>e&&e[t]),e)}function q(e={},...t){if(!t.length)return e;const i=t.shift();return D(i)?(Object.keys(i).forEach((t=>{D(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),q(e[t],i[t])):Object.assign(e,{[t]:i[t]})})),q(e,...t)):e}function W(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach(((e,i)=>{const n=i>0?t.cloneNode(!0):t,r=e.parentNode,s=e.nextSibling;n.appendChild(e),s?r.insertBefore(n,s):r.appendChild(n)}))}function Z(e,t){R(e)&&!B(t)&&Object.entries(t).filter((([,e])=>!C(e))).forEach((([t,i])=>e.setAttribute(t,i)))}function V(e,t,i){const n=document.createElement(e);return D(t)&&Z(n,t),j(i)&&(n.innerText=i),n}function K(e,t,i,n){R(t)&&t.appendChild(V(e,i,n))}function X(e){P(e)||O(e)?Array.from(e).forEach(X):R(e)&&R(e.parentNode)&&e.parentNode.removeChild(e)}function J(e){if(!R(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function ee(e,t){return R(t)&&R(t.parentNode)&&R(e)?(t.parentNode.replaceChild(e,t),e):null}function te(e,t){if(!j(e)||B(e))return{};const i={},n=q({},t);return e.split(",").forEach((e=>{const t=e.trim(),r=t.replace(".",""),s=t.replace(/[[\]]/g,"").split("="),[a]=s,o=s.length>1?s[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":j(n.class)?i.class=`${n.class} ${r}`:i.class=r;break;case"#":i.id=t.replace("#","");break;case"[":i[a]=o}})),q(n,i)}function ie(e,t){if(!R(e))return;let i=t;x(i)||(i=!e.hidden),e.hidden=i}function ne(e,t,i){if(P(e))return Array.from(e).map((e=>ne(e,t,i)));if(R(e)){let n="toggle";return void 0!==i&&(n=i?"add":"remove"),e.classList[n](t),e.classList.contains(t)}return!1}function re(e,t){return R(e)&&e.classList.contains(t)}function se(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ae(e){return this.elements.container.querySelectorAll(e)}function oe(e){return this.elements.container.querySelector(e)}function le(e=null,t=!1){R(e)&&(e.focus({preventScroll:!0}),t&&ne(e,this.config.classNames.tabFocus))}const ce={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ue={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t,i){const n=Q.isIPhone&&i&&ue.playsinline,r=ue[e]||"html5"!==t;return{api:r,ui:r&&ue.rangeInput&&("video"!==e||!Q.isIPhone||n)}},pip:!(Q.isIPhone||!_(V("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||V("video").disablePictureInPicture)),airplay:_(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(B(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(ce).includes(i)&&(i+=`; codecs="${ce[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch(e){return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==$,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},de=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(e){}return e})();function he(e,t,i,n=!1,r=!0,s=!1){if(!e||!("addEventListener"in e)||B(t)||!_(i))return;const a=t.split(" ");let o=s;de&&(o={passive:r,capture:s}),a.forEach((t=>{this&&this.eventListeners&&n&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[n?"addEventListener":"removeEventListener"](t,i,o)}))}function pe(e,t="",i,n=!0,r=!1){he.call(this,e,t,i,!0,n,r)}function fe(e,t="",i,n=!0,r=!1){he.call(this,e,t,i,!1,n,r)}function ge(e,t="",i,n=!0,r=!1){const s=(...a)=>{fe(e,t,s,n,r),i.apply(this,a)};he.call(this,e,t,s,!0,n,r)}function ye(e,t="",i=!1,n={}){if(!R(e)||B(t))return;const r=new CustomEvent(t,{bubbles:i,detail:{...n,plyr:this}});e.dispatchEvent(r)}function me(){this&&this.eventListeners&&(this.eventListeners.forEach((e=>{const{element:t,type:i,callback:n,options:r}=e;t.removeEventListener(i,n,r)})),this.eventListeners=[])}function ve(){return new Promise((e=>this.ready?setTimeout(e,0):pe.call(this,this.elements.container,"ready",e))).then((()=>{}))}function Me(e){(e=>L(e,Promise)&&N(e.then))(e)&&e.then(null,(()=>{}))}function Te(e){return O(e)?e.filter(((t,i)=>e.indexOf(t)===i)):e}function Le(e,t){return O(e)&&e.length?e.reduce(((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e)):null}function be(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const Ee=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce(((e,[t,i])=>({...e,[t/i]:[t,i]})),{});function Ie(e){return!!(O(e)||j(e)&&e.includes(":"))&&(O(e)?e:e.split(":")).map(Number).every(k)}function Ne(e){if(!O(e)||!e.every(k))return null;const[t,i]=e,n=(e,t)=>0===t?e:n(t,e%t),r=n(t,i);return[t/r,i/r]}function Se(e){const t=e=>Ie(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!B(this.embed)&&O(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return Ne(i)}function we(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=Se.call(this,e);if(!O(i))return{};const[n,r]=Ne(i),s=100/n*r;if(be(`aspect-ratio: ${n}/${r}`)?t.style.aspectRatio=`${n}/${r}`:t.style.paddingBottom=`${s}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-s)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:s,ratio:i}}function Ae(e,t,i=.05){const n=e/t,r=Le(Object.keys(Ee),n);return Math.abs(r-n)<=i?Ee[r]:[e,t]}const Ce={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter((e=>{const t=e.getAttribute("type");return!!B(t)||ue.mime.call(this,t)})):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ce.getSources.call(this).map((e=>Number(e.getAttribute("size")))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,B(this.config.ratio)||we.call(e),Object.defineProperty(e.media,"quality",{get(){const t=Ce.getSources.call(e).find((t=>t.getAttribute("src")===e.source));return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&_(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=Ce.getSources.call(e).find((e=>Number(e.getAttribute("size"))===t));if(!i)return;const{currentTime:n,paused:r,preload:s,readyState:a,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==s||a)&&(e.once("loadedmetadata",(()=>{e.speed=o,e.currentTime=n,r||Me(e.play())})),e.media.load())}ye.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(X(Ce.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function De(e,...t){return B(e)?e:e.toString().replace(/{(\d+)}/g,((e,i)=>t[i].toString()))}const ke=(e="",t="",i="")=>e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),je=(e="")=>e.toString().replace(/\w\S*/g,(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()));function xe(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const _e={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Oe={get(e="",t={}){if(B(e)||B(t))return"";let i=H(t.i18n,e);if(B(i))return Object.keys(_e).includes(e)?_e[e]:"";const n={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(n).forEach((([e,t])=>{i=ke(i,e,t)})),i}};class Pe{constructor(t){e(this,"get",(e=>{if(!Pe.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(B(t))return null;const i=JSON.parse(t);return j(e)&&e.length?i[e]:i})),e(this,"set",(e=>{if(!Pe.supported||!this.enabled)return;if(!D(e))return;let t=this.get();B(t)&&(t={}),q(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch(e){}})),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}}function Re(e,t="text"){return new Promise(((i,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;n.addEventListener("load",(()=>{if("text"===t)try{i(JSON.parse(n.responseText))}catch(e){i(n.responseText)}else i(n.response)})),n.addEventListener("error",(()=>{throw new Error(n.status)})),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}}))}function ze(e,t){if(!j(e))return;const i=j(t);let n=!1;const r=()=>null!==document.getElementById(t),s=(e,t)=>{e.innerHTML=t,i&&r()||document.body.insertAdjacentElement("afterbegin",e)};if(!i||!r()){const r=Pe.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),i&&a.setAttribute("id",t),r){const e=window.localStorage.getItem(`cache-${t}`);if(n=null!==e,n){const t=JSON.parse(e);s(a,t.content)}}Re(e).then((e=>{if(!B(e)){if(r)try{window.localStorage.setItem(`cache-${t}`,JSON.stringify({content:e}))}catch(e){}s(a,e)}})).catch((()=>{}))}}const Fe=e=>Math.trunc(e/60/60%60,10);function Ue(e=0,t=!1,i=!1){if(!k(e))return Ue(void 0,t,i);const n=e=>`0${e}`.slice(-2);let r=Fe(e);const s=(a=e,Math.trunc(a/60%60,10));var a;const o=(e=>Math.trunc(e%60,10))(e);return r=t||r>0?`${r}:`:"",`${i&&e>0?"-":""}${r}${n(s)}:${n(o)}`}const Ye={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||Q.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=oe.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:ae.call(this,this.config.selectors.buttons.play),pause:oe.call(this,this.config.selectors.buttons.pause),restart:oe.call(this,this.config.selectors.buttons.restart),rewind:oe.call(this,this.config.selectors.buttons.rewind),fastForward:oe.call(this,this.config.selectors.buttons.fastForward),mute:oe.call(this,this.config.selectors.buttons.mute),pip:oe.call(this,this.config.selectors.buttons.pip),airplay:oe.call(this,this.config.selectors.buttons.airplay),settings:oe.call(this,this.config.selectors.buttons.settings),captions:oe.call(this,this.config.selectors.buttons.captions),fullscreen:oe.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=oe.call(this,this.config.selectors.progress),this.elements.inputs={seek:oe.call(this,this.config.selectors.inputs.seek),volume:oe.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:oe.call(this,this.config.selectors.display.buffer),currentTime:oe.call(this,this.config.selectors.display.currentTime),duration:oe.call(this,this.config.selectors.display.duration)},R(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",n=Ye.getIconUrl.call(this),r=`${n.cors?"":n.url}#${this.config.iconPrefix}`,s=document.createElementNS(i,"svg");Z(s,q(t,{"aria-hidden":"true",focusable:"false"}));const a=document.createElementNS(i,"use"),o=`${r}-${e}`;return"href"in a&&a.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),s.appendChild(a),s},createLabel(e,t={}){const i=Oe.get(e,this.config);return V("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(B(e))return null;const t=V("span",{class:this.config.classNames.menu.value});return t.appendChild(V("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=q({},t);let n=function(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=ke(t,"-"," "),t=ke(t,"_"," "),t=je(t),ke(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}(e);const r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach((e=>{Object.keys(i).includes(e)&&(r[e]=i[e],delete i[e])})),"button"!==r.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some((e=>e===this.config.classNames.control))||q(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,n="play",r.label="play",r.icon="play";break;default:B(r.label)&&(r.label=n),B(r.icon)&&(r.icon=e)}const s=V(r.element);return r.toggle?(s.appendChild(Ye.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),s.appendChild(Ye.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),s.appendChild(Ye.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),s.appendChild(Ye.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(s.appendChild(Ye.createIcon.call(this,r.icon)),s.appendChild(Ye.createLabel.call(this,r.label))),q(i,te(this.config.selectors.buttons[n],i)),Z(s,i),"play"===n?(O(this.elements.buttons[n])||(this.elements.buttons[n]=[]),this.elements.buttons[n].push(s)):this.elements.buttons[n]=s,s},createRange(e,t){const i=V("input",q(te(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Oe.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,Ye.updateRangeFill.call(this,i),M.setup(i),i},createProgress(e,t){const i=V("progress",q(te(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(V("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],n=t?Oe.get(t,this.config):"";i.innerText=`% ${n.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=te(this.config.selectors.display[e],t),n=V("div",q(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Oe.get(e,this.config)}),"00:00");return this.elements.display[e]=n,n},bindMenuItemShortcuts(e,t){pe.call(this,e,"keydown keyup",(i=>{if(!["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const n=se(e,'[role="menuitemradio"]');if(!n&&["Space","ArrowRight"].includes(i.key))Ye.showMenuPanel.call(this,t,!0);else{let t;"Space"!==i.key&&("ArrowDown"===i.key||n&&"ArrowRight"===i.key?(t=e.nextElementSibling,R(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,R(t)||(t=e.parentNode.lastElementChild)),le.call(this,t,!0))}}),!1),pe.call(this,e,"keyup",(e=>{"Return"===e.key&&Ye.focusFirstMenuItem.call(this,null,!0)}))},createMenuItem({value:e,list:t,type:i,title:n,badge:r=null,checked:s=!1}){const a=te(this.config.selectors.inputs[i]),o=V("button",q(a,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${a.class?a.class:""}`.trim(),"aria-checked":s,value:e})),l=V("span");l.innerHTML=n,R(r)&&l.appendChild(r),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter((e=>se(e,'[role="menuitemradio"]'))).forEach((e=>e.setAttribute("aria-checked","false"))),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",(t=>{if(!F(t)||"Space"===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}Ye.showMenuPanel.call(this,"home",F(t))}}),i,!1),Ye.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){return k(e)?Ue(e,Fe(this.duration)>0,t):e},updateTimeDisplay(e=null,t=0,i=!1){R(e)&&k(t)&&(e.innerText=Ye.formatTime(t,i))},updateVolume(){this.supported.ui&&(R(this.elements.inputs.volume)&&Ye.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),R(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){R(e)&&(e.value=t,Ye.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!z(e))return;let t=0;const i=(e,t)=>{const i=k(t)?t:0,n=R(e)?e:this.elements.display.buffer;if(R(n)){n.value=i;const e=n.getElementsByTagName("span")[0];R(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=this.currentTime,r=this.duration,t=0===n||0===r||Number.isNaN(n)||Number.isNaN(r)?0:(n/r*100).toFixed(2),"timeupdate"===e.type&&Ye.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var n,r},updateRangeFill(e){const t=z(e)?e.target:e;if(R(t)&&"range"===t.getAttribute("type")){if(se(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=Ye.formatTime(this.currentTime),i=Ye.formatTime(this.duration),n=Oe.get("seekLabel",this.config);t.setAttribute("aria-valuetext",n.replace("{currentTime}",e).replace("{duration}",i))}else if(se(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);Q.isWebkit&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!R(this.elements.inputs.seek)||!R(this.elements.display.seekTooltip)||0===this.duration)return;const n=this.elements.display.seekTooltip,r=`${this.config.classNames.tooltip}--visible`,s=e=>ne(n,r,e);if(this.touch)return void s(!1);let a=0;const o=this.elements.progress.getBoundingClientRect();if(z(e))a=100/o.width*(e.pageX-o.left);else{if(!re(n,r))return;a=parseFloat(n.style.left,10)}a<0?a=0:a>100&&(a=100);const l=this.duration/100*a;n.innerText=Ye.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(l)));c&&n.insertAdjacentHTML("afterbegin",`${c.label}<br>`),n.style.left=`${a}%`,z(e)&&["mouseenter","mouseleave"].includes(e.type)&&s("mouseenter"===e.type)},timeUpdate(e){const t=!R(this.elements.display.duration)&&this.config.invertTime;Ye.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||Ye.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ie(this.elements.display.currentTime,!0),void ie(this.elements.progress,!0);R(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=R(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&Ye.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&Ye.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&Ye.setMarkers.call(this),Ye.updateSeekTooltip.call(this)},toggleMenuButton(e,t){ie(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const n=this.elements.settings.panels[e];let r=null,s=t;if("captions"===e)r=this.currentTrack;else{if(r=B(i)?this[e]:i,B(r)&&(r=this.config[e].default),!B(this.options[e])&&!this.options[e].includes(r))return void this.debug.warn(`Unsupported value of '${r}' for ${e}`);if(!this.config[e].options.includes(r))return void this.debug.warn(`Disabled value of '${r}' for ${e}`)}if(R(s)||(s=n&&n.querySelector('[role="menu"]')),!R(s))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=Ye.getLabel.call(this,e,r);const a=s&&s.querySelector(`[value="${r}"]`);R(a)&&(a.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Oe.get("normal",this.config):`${t}×`;case"quality":if(k(t)){const e=Oe.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return je(t);case"captions":return Ge.getLabel.call(this);default:return null}},setQualityMenu(e){if(!R(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');O(e)&&(this.options.quality=Te(e).filter((e=>this.config.quality.options.includes(e))));const n=!B(this.options.quality)&&this.options.quality.length>1;if(Ye.toggleMenuButton.call(this,t,n),J(i),Ye.checkMenu.call(this),!n)return;const r=e=>{const t=Oe.get(`qualityBadge.${e}`,this.config);return t.length?Ye.createBadge.call(this,t):null};this.options.quality.sort(((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1})).forEach((e=>{Ye.createMenuItem.call(this,{value:e,list:i,type:t,title:Ye.getLabel.call(this,"quality",e),badge:r(e)})})),Ye.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!R(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ge.getTracks.call(this),n=Boolean(i.length);if(Ye.toggleMenuButton.call(this,e,n),J(t),Ye.checkMenu.call(this),!n)return;const r=i.map(((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ge.getLabel.call(this,e),badge:e.language&&Ye.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"})));r.unshift({value:-1,checked:!this.captions.toggled,title:Oe.get("disabled",this.config),list:t,type:"language"}),r.forEach(Ye.createMenuItem.bind(this)),Ye.updateSetting.call(this,e,t)},setSpeedMenu(){if(!R(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter((e=>e>=this.minimumSpeed&&e<=this.maximumSpeed));const i=!B(this.options.speed)&&this.options.speed.length>1;Ye.toggleMenuButton.call(this,e,i),J(t),Ye.checkMenu.call(this),i&&(this.options.speed.forEach((i=>{Ye.createMenuItem.call(this,{value:i,list:t,type:e,title:Ye.getLabel.call(this,"speed",i)})})),Ye.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!B(e)&&Object.values(e).some((e=>!e.hidden));ie(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;R(i)||(i=Object.values(this.elements.settings.panels).find((e=>!e.hidden)));const n=i.querySelector('[role^="menuitem"]');le.call(this,n,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!R(t)||!R(i))return;const{hidden:n}=t;let r=n;if(x(e))r=e;else if(F(e)&&"Escape"===e.key)r=!1;else if(z(e)){const n=_(e.composedPath)?e.composedPath()[0]:e.target,s=t.contains(n);if(s||!s&&e.target!==i&&r)return}i.setAttribute("aria-expanded",r),ie(t,!r),ne(this.elements.container,this.config.classNames.menu.open,r),r&&F(e)?Ye.focusFirstMenuItem.call(this,null,!0):r||n||le.call(this,i,F(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,n=t.scrollHeight;return X(t),{width:i,height:n}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!R(i))return;const n=i.parentNode,r=Array.from(n.children).find((e=>!e.hidden));if(ue.transitions&&!ue.reducedMotion){n.style.width=`${r.scrollWidth}px`,n.style.height=`${r.scrollHeight}px`;const e=Ye.getMenuSize.call(this,i),t=e=>{e.target===n&&["width","height"].includes(e.propertyName)&&(n.style.width="",n.style.height="",fe.call(this,n,$,t))};pe.call(this,n,$,t),n.style.width=`${e.width}px`,n.style.height=`${e.height}px`}ie(r,!0),ie(i,!1),Ye.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;R(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:n,createRange:r,createTime:s,setQualityMenu:a,setSpeedMenu:o,showMenuPanel:l}=Ye;this.elements.controls=null,O(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=V("div",te(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return Te(O(this.config.controls)?this.config.controls:[]).forEach((a=>{if("restart"===a&&c.appendChild(i.call(this,"restart",u)),"rewind"===a&&c.appendChild(i.call(this,"rewind",u)),"play"===a&&c.appendChild(i.call(this,"play",u)),"fast-forward"===a&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===a){const t=V("div",{class:`${u.class} plyr__progress__container`}),i=V("div",te(this.config.selectors.progress));if(i.appendChild(r.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(n.call(this,"buffer")),this.config.tooltips.seek){const e=V("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===a&&c.appendChild(s.call(this,"currentTime",u)),"duration"===a&&c.appendChild(s.call(this,"duration",u)),"mute"===a||"volume"===a){let{volume:t}=this.elements;if(R(t)&&c.contains(t)||(t=V("div",q({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===a&&t.appendChild(i.call(this,"mute")),"volume"===a&&!Q.isIos){const i={max:1,step:.05,value:this.config.volume};t.appendChild(r.call(this,"volume",q(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===a&&c.appendChild(i.call(this,"captions",u)),"settings"===a&&!B(this.config.settings)){const n=V("div",q({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));n.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const r=V("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),s=V("div"),a=V("div",{id:`plyr-settings-${e.id}-home`}),o=V("div",{role:"menu"});a.appendChild(o),s.appendChild(a),this.elements.settings.panels.home=a,this.config.settings.forEach((i=>{const n=V("button",q(te(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,n,i),pe.call(this,n,"click",(()=>{l.call(this,i,!1)}));const r=V("span",null,Oe.get(i,this.config)),a=V("span",{class:this.config.classNames.menu.value});a.innerHTML=e[i],r.appendChild(a),n.appendChild(r),o.appendChild(n);const c=V("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=V("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(V("span",{"aria-hidden":!0},Oe.get(i,this.config))),u.appendChild(V("span",{class:this.config.classNames.hidden},Oe.get("menuBack",this.config))),pe.call(this,c,"keydown",(e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))}),!1),pe.call(this,u,"click",(()=>{l.call(this,"home",!1)})),c.appendChild(u),c.appendChild(V("div",{role:"menu"})),s.appendChild(c),this.elements.settings.buttons[i]=n,this.elements.settings.panels[i]=c})),r.appendChild(s),n.appendChild(r),c.appendChild(n),this.elements.settings.popup=r,this.elements.settings.menu=n}if("pip"===a&&ue.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===a&&ue.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===a){const e=q({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!Y(t)&&this.isEmbed&&q(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===a&&c.appendChild(i.call(this,"fullscreen",u))})),this.isHTML5&&a.call(this,Ce.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=Ye.getIconUrl.call(this);e.cors&&ze(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i,n=!0;if(_(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),R(this.config.controls)||j(this.config.controls)?e=this.config.controls:(e=Ye.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ge.getLabel.call(this)}),n=!1),n&&j(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach((([e,t])=>{i=ke(i,`{${e}}`,t)})),i})(e)),j(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),R(i)||(i=this.elements.container),i[R(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),R(this.elements.controls)||Ye.findElements.call(this),!B(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>re(e,t),set(i=!1){ne(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach((t=>{O(t)||P(t)?Array.from(t).filter(Boolean).forEach(e):e(t)}))}if(Q.isEdge&&G(i),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,n=ae.call(this,i);Array.from(n).forEach((e=>{ne(e,this.config.classNames.hidden,!1),ne(e,this.config.classNames.tooltip,!0)}))}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch(e){}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter((({time:e})=>e>0&&e<this.duration));if(null==i||!i.length)return;const n=document.createDocumentFragment(),r=document.createDocumentFragment();let s=null;const a=`${this.config.classNames.tooltip}--visible`,o=e=>ne(s,a,e);i.forEach((e=>{const t=V("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";s&&(t.addEventListener("mouseenter",(()=>{e.label||(s.style.left=i,s.innerHTML=e.label,o(!0))})),t.addEventListener("mouseleave",(()=>{o(!1)}))),t.addEventListener("click",(()=>{this.currentTime=e.time})),t.style.left=i,r.appendChild(t)})),n.appendChild(r),this.config.tooltips.seek||(s=V("span",{class:this.config.classNames.tooltip},""),n.appendChild(s)),this.elements.markers={points:r,tip:s},this.elements.progress.appendChild(n)}};function Be(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch(e){return null}}function $e(e){const t=new URLSearchParams;return D(e)&&Object.entries(e).forEach((([e,i])=>{t.set(e,i)})),t}const Ge={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!ue.textTracks)return void(O(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ye.setCaptionsMenu.call(this));var e,t;if(R(this.elements.captions)||(this.elements.captions=V("div",te(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,R(e)&&R(t)&&t.parentNode.insertBefore(e,t.nextSibling)),Q.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach((e=>{const t=e.getAttribute("src"),i=Be(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Re(t,"blob").then((t=>{e.setAttribute("src",window.URL.createObjectURL(t))})).catch((()=>{X(e)}))}))}const i=Te((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map((e=>e.split("-")[0])));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();"auto"===n&&([n]=i);let r=this.storage.get("captions");if(x(r)||({active:r}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:r,language:n,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";pe.call(this,this.media.textTracks,e,Ge.update.bind(this))}setTimeout(Ge.update.bind(this),0)},update(){const e=Ge.getTracks.call(this,!0),{active:t,language:i,meta:n,currentTrackNode:r}=this.captions,s=Boolean(e.find((e=>e.language===i)));this.isHTML5&&this.isVideo&&e.filter((e=>!n.get(e))).forEach((e=>{this.debug.log("Track added",e),n.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),pe.call(this,e,"cuechange",(()=>Ge.updateCues.call(this)))})),(s&&this.language!==i||!e.includes(r))&&(Ge.setLanguage.call(this,i),Ge.toggle.call(this,t&&s)),this.elements&&ne(this.elements.container,this.config.classNames.captions.enabled,!B(e)),O(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&Ye.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,n=this.config.classNames.captions.active,r=C(e)?!i:e;if(r!==i){if(t||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!t){const e=Ge.getTracks.call(this),t=Ge.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ge.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),ne(this.elements.container,n,r),this.captions.toggled=r,Ye.updateSetting.call(this,"captions"),ye.call(this,this.media,r?"captionsenabled":"captionsdisabled")}setTimeout((()=>{r&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")}))},set(e,t=!0){const i=Ge.getTracks.call(this);if(-1!==e)if(k(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const n=i[e],{language:r}=n||{};this.captions.currentTrackNode=n,Ye.updateSetting.call(this,"captions"),t||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),ye.call(this,this.media,"languagechange")}Ge.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ge.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ge.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!j(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const n=Ge.getTracks.call(this),r=Ge.findTrack.call(this,[i]);Ge.set.call(this,n.indexOf(r),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter((t=>!this.isHTML5||e||this.captions.meta.has(t))).filter((e=>["captions","subtitles"].includes(e.kind)))},findTrack(e,t=!1){const i=Ge.getTracks.call(this),n=e=>Number((this.captions.meta.get(e)||{}).default),r=Array.from(i).sort(((e,t)=>n(t)-n(e)));let s;return e.every((e=>(s=r.find((t=>t.language===e)),!s))),s||(t?r[0]:void 0)},getCurrentTrack(){return Ge.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!U(t)&&ue.textTracks&&this.captions.toggled&&(t=Ge.getCurrentTrack.call(this)),U(t)?B(t.label)?B(t.language)?Oe.get("enabled",this.config):e.language.toUpperCase():t.label:Oe.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!R(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!C(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Ge.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map((e=>e.getCueAsHTML())).map(xe)}const i=t.map((e=>e.trim())).join("\n");if(i!==this.elements.captions.innerHTML){J(this.elements.captions);const e=V("span",te(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),ye.call(this,this.media,"cuechange")}}},Qe={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.3/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},He="picture-in-picture",qe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},We="video",Ze=()=>{};class Ve{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Ze}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Ze}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Ze}}class Ke{constructor(t){e(this,"onChange",(()=>{if(!this.enabled)return;const e=this.player.elements.buttons.fullscreen;R(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;ye.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)})),e(this,"toggleFallback",((e=!1)=>{if(e?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=e?"hidden":"",ne(this.target,this.player.config.classNames.fullscreen.fallback,e),Q.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const n=j(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!n,n||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter((e=>e.trim()!==i)).join(","))}this.onChange()})),e(this,"trapFocus",(e=>{if(Q.isIos||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=ae.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[n]=i,r=i[i.length-1];t!==r||e.shiftKey?t===n&&e.shiftKey&&(r.focus(),e.preventDefault()):(n.focus(),e.preventDefault())})),e(this,"update",(()=>{if(this.enabled){let e;e=this.forceFallback?"Fallback (forced)":Ke.native?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");ne(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)})),e(this,"enter",(()=>{this.enabled&&(Q.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ke.native||this.forceFallback?this.toggleFallback(!0):this.prefix?B(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))})),e(this,"exit",(()=>{if(this.enabled)if(Q.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Me(this.player.play());else if(!Ke.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!B(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)})),e(this,"toggle",(()=>{this.active?this.exit():this.enter()})),this.player=t,this.prefix=Ke.prefix,this.property=Ke.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(se.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),pe.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,(()=>{this.onChange()})),pe.call(this.player,this.player.elements.container,"dblclick",(e=>{R(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")})),pe.call(this,this.player.elements.container,"keydown",(e=>this.trapFocus(e))),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return Ke.native&&!this.forceFallback}static get prefix(){if(_(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some((t=>!(!_(document[`${t}ExitFullscreen`])&&!_(document[`${t}CancelFullScreen`])||(e=t,0)))),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get enabled(){return(Ke.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!Ke.native||this.forceFallback)return re(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return Q.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function Xe(e,t=1){return new Promise(((i,n)=>{const r=new Image,s=()=>{delete r.onload,delete r.onerror,(r.naturalWidth>=t?i:n)(r)};Object.assign(r,{onload:s,onerror:s,src:e})}))}const Je={addStyleHook(){ne(this.elements.container,this.config.selectors.container.replace(".",""),!0),ne(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Je.toggleNativeControls.call(this,!0);R(this.elements.controls)||(Ye.inject.call(this),this.listeners.controls()),Je.toggleNativeControls.call(this),this.isHTML5&&Ge.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,Ye.updateVolume.call(this),Ye.timeUpdate.call(this),Ye.durationUpdate.call(this),Je.checkPlaying.call(this),ne(this.elements.container,this.config.classNames.pip.supported,ue.pip&&this.isHTML5&&this.isVideo),ne(this.elements.container,this.config.classNames.airplay.supported,ue.airplay&&this.isHTML5),ne(this.elements.container,this.config.classNames.isIos,Q.isIos),ne(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout((()=>{ye.call(this,this.media,"ready")}),0),Je.setTitle.call(this),this.poster&&Je.setPoster.call(this,this.poster,!1).catch((()=>{})),this.config.duration&&Ye.durationUpdate.call(this),this.config.mediaMetadata&&Ye.setMediaMetadata.call(this)},setTitle(){let e=Oe.get("play",this.config);if(j(this.config.title)&&!B(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach((t=>{t.setAttribute("aria-label",e)})),this.isEmbed){const e=oe.call(this,"iframe");if(!R(e))return;const t=B(this.config.title)?"video":this.config.title,i=Oe.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){ne(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),ve.call(this).then((()=>Xe(e))).catch((t=>{throw e===this.poster&&Je.togglePoster.call(this,!1),t})).then((()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")})).then((()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Je.togglePoster.call(this,!0),e))))},checkPlaying(e){ne(this.elements.container,this.config.classNames.playing,this.playing),ne(this.elements.container,this.config.classNames.paused,this.paused),ne(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach((e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Oe.get(this.playing?"pause":"play",this.config))})),z(e)&&"timeupdate"===e.type||Je.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout((()=>{ne(this.elements.container,this.config.classNames.loading,this.loading),Je.toggleControls.call(this)}),this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter((e=>!B(e)&&j(e)&&e.startsWith("--plyr"))).forEach((e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)})),B(this.media.style)&&this.media.removeAttribute("style")}};class et{constructor(t){e(this,"firstTouch",(()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,ne(t.container,e.config.classNames.isTouch,!0)})),e(this,"setTabFocus",(e=>{const{player:t}=this,{elements:i}=t,{key:n,type:r,timeStamp:s}=e;if(clearTimeout(this.focusTimer),"keydown"===r&&"Tab"!==n)return;"keydown"===r&&(this.lastKeyDown=s);const a=s-this.lastKeyDown<=20;("focus"!==r||a)&&((()=>{const e=t.config.classNames.tabFocus;ne(ae.call(t,`.${e}`),e,!1)})(),"focusout"!==r&&(this.focusTimer=setTimeout((()=>{const e=document.activeElement;i.container.contains(e)&&ne(document.activeElement,t.config.classNames.tabFocus,!0)}),10)))})),e(this,"global",((e=!0)=>{const{player:t}=this;t.config.keyboard.global&&he.call(t,window,"keydown keyup",this.handleKey,e,!1),he.call(t,document.body,"click",this.toggleMenu,e),ge.call(t,document.body,"touchstart",this.firstTouch),he.call(t,document.body,"keydown focus blur focusout",this.setTabFocus,e,!1,!0)})),e(this,"container",(()=>{const{player:e}=this,{config:t,elements:i,timers:n}=e;!t.keyboard.global&&t.keyboard.focused&&pe.call(e,i.container,"keydown keyup",this.handleKey,!1),pe.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",(t=>{const{controls:r}=i;r&&"enterfullscreen"===t.type&&(r.pressed=!1,r.hover=!1);let s=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Je.toggleControls.call(e,!0),s=e.touch?3e3:2e3),clearTimeout(n.controls),n.controls=setTimeout((()=>Je.toggleControls.call(e,!1)),s)}));const r=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:n}=e.fullscreen,[r,s]=Se.call(e),a=be(`aspect-ratio: ${r} / ${s}`);if(!n)return void(a?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>r/s;a?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/s*r+"px":null,t.style.margin=c?"0 auto":null)},s=()=>{clearTimeout(n.resized),n.resized=setTimeout(r,50)};pe.call(e,i.container,"enterfullscreen exitfullscreen",(t=>{const{target:n}=e.fullscreen;n===i.container&&(!e.isEmbed&&B(e.config.ratio)||(r(),("enterfullscreen"===t.type?pe:fe).call(e,window,"resize",s)))}))})),e(this,"media",(()=>{const{player:e}=this,{elements:t}=e;if(pe.call(e,e.media,"timeupdate seeking seeked",(t=>Ye.timeUpdate.call(e,t))),pe.call(e,e.media,"durationchange loadeddata loadedmetadata",(t=>Ye.durationUpdate.call(e,t))),pe.call(e,e.media,"ended",(()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())})),pe.call(e,e.media,"progress playing seeking seeked",(t=>Ye.updateProgress.call(e,t))),pe.call(e,e.media,"volumechange",(t=>Ye.updateVolume.call(e,t))),pe.call(e,e.media,"playing play pause ended emptied timeupdate",(t=>Je.checkPlaying.call(e,t))),pe.call(e,e.media,"waiting canplay seeked playing",(t=>Je.checkLoading.call(e,t))),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=oe.call(e,`.${e.config.classNames.video}`);if(!R(i))return;pe.call(e,t.container,"click",(n=>{([t.container,i].includes(n.target)||i.contains(n.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(n,e.restart,"restart"),this.proxy(n,(()=>{Me(e.play())}),"play")):this.proxy(n,(()=>{Me(e.togglePlay())}),"play")))}))}e.supported.ui&&e.config.disableContextMenu&&pe.call(e,t.wrapper,"contextmenu",(e=>{e.preventDefault()}),!1),pe.call(e,e.media,"volumechange",(()=>{e.storage.set({volume:e.volume,muted:e.muted})})),pe.call(e,e.media,"ratechange",(()=>{Ye.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})})),pe.call(e,e.media,"qualitychange",(t=>{Ye.updateSetting.call(e,"quality",null,t.detail.quality)})),pe.call(e,e.media,"ready qualitychange",(()=>{Ye.setDownloadUrl.call(e)}));const i=e.config.events.concat(["keyup","keydown"]).join(" ");pe.call(e,e.media,i,(i=>{let{detail:n={}}=i;"error"===i.type&&(n=e.media.error),ye.call(e,t.container,i.type,!0,n)}))})),e(this,"proxy",((e,t,i)=>{const{player:n}=this,r=n.config.listeners[i];let s=!0;_(r)&&(s=r.call(n,e)),!1!==s&&_(t)&&t.call(n,e)})),e(this,"bind",((e,t,i,n,r=!0)=>{const{player:s}=this,a=s.config.listeners[n],o=_(a);pe.call(s,e,t,(e=>this.proxy(e,i,n)),r&&!o)})),e(this,"controls",(()=>{const{player:e}=this,{elements:t}=e,i=Q.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach((t=>{this.bind(t,"click",(()=>{Me(e.togglePlay())}),"play")})),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",(()=>{e.lastSeekTime=Date.now(),e.rewind()}),"rewind"),this.bind(t.buttons.fastForward,"click",(()=>{e.lastSeekTime=Date.now(),e.forward()}),"fastForward"),this.bind(t.buttons.mute,"click",(()=>{e.muted=!e.muted}),"mute"),this.bind(t.buttons.captions,"click",(()=>e.toggleCaptions())),this.bind(t.buttons.download,"click",(()=>{ye.call(e,e.media,"download")}),"download"),this.bind(t.buttons.fullscreen,"click",(()=>{e.fullscreen.toggle()}),"fullscreen"),this.bind(t.buttons.pip,"click",(()=>{e.pip="toggle"}),"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",(t=>{t.stopPropagation(),t.preventDefault(),Ye.toggleMenu.call(e,t)}),null,!1),this.bind(t.buttons.settings,"keyup",(t=>{["Space","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),Ye.toggleMenu.call(e,t)):Ye.focusFirstMenuItem.call(e,null,!0))}),null,!1),this.bind(t.settings.menu,"keydown",(t=>{"Escape"===t.key&&Ye.toggleMenu.call(e,t)})),this.bind(t.inputs.seek,"mousedown mousemove",(e=>{const i=t.progress.getBoundingClientRect(),n=100/i.width*(e.pageX-i.left);e.currentTarget.setAttribute("seek-value",n)})),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",(t=>{const i=t.currentTarget,n="play-on-seeked";if(F(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const r=i.hasAttribute(n),s=["mouseup","touchend","keyup"].includes(t.type);r&&s?(i.removeAttribute(n),Me(e.play())):!s&&e.playing&&(i.setAttribute(n,""),e.pause())})),Q.isIos){const t=ae.call(e,'input[type="range"]');Array.from(t).forEach((e=>this.bind(e,i,(e=>G(e.target)))))}this.bind(t.inputs.seek,i,(t=>{const i=t.currentTarget;let n=i.getAttribute("seek-value");B(n)&&(n=i.value),i.removeAttribute("seek-value"),e.currentTime=n/i.max*e.duration}),"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",(t=>Ye.updateSeekTooltip.call(e,t))),this.bind(t.progress,"mousemove touchmove",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)})),this.bind(t.progress,"mouseleave touchend click",(()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)})),this.bind(t.progress,"mousedown touchstart",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)})),this.bind(t.progress,"mouseup touchend",(t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)})),Q.isWebkit&&Array.from(ae.call(e,'input[type="range"]')).forEach((t=>{this.bind(t,"input",(t=>Ye.updateRangeFill.call(e,t.target)))})),e.config.toggleInvert&&!R(t.display.duration)&&this.bind(t.display.currentTime,"click",(()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,Ye.timeUpdate.call(e))})),this.bind(t.inputs.volume,i,(t=>{e.volume=t.target.value}),"volume"),this.bind(t.controls,"mouseenter mouseleave",(i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type})),t.fullscreen&&Array.from(t.fullscreen.children).filter((e=>!e.contains(t.container))).forEach((i=>{this.bind(i,"mouseenter mouseleave",(i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)}))})),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",(e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)})),this.bind(t.controls,"focusin",(()=>{const{config:i,timers:n}=e;ne(t.controls,i.classNames.noTransition,!0),Je.toggleControls.call(e,!0),setTimeout((()=>{ne(t.controls,i.classNames.noTransition,!1)}),0);const r=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout((()=>Je.toggleControls.call(e,!1)),r)})),this.bind(t.inputs.volume,"wheel",(t=>{const i=t.webkitDirectionInvertedFromDevice,[n,r]=[t.deltaX,-t.deltaY].map((e=>i?-e:e)),s=Math.sign(Math.abs(n)>Math.abs(r)?n:r);e.increaseVolume(s/50);const{volume:a}=e.media;(1===s&&a<1||-1===s&&a>0)&&t.preventDefault()}),"volume",!1)})),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:n,type:r,altKey:s,ctrlKey:a,metaKey:o,shiftKey:l}=e,c="keydown"===r,u=c&&n===this.lastKey;var d;if(!(s||a||o||l)&&n)if(c){const r=document.activeElement;if(R(r)){const{editable:n}=t.config.selectors,{seek:s}=i.inputs;if(r!==s&&se(r,n))return;if("Space"===e.key&&se(r,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(n)&&(e.preventDefault(),e.stopPropagation()),n){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(d=parseInt(n,10),t.currentTime=t.duration/10*d);break;case"Space":case"k":u||Me(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===n&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=n}else this.lastKey=null}toggleMenu(e){Ye.toggleMenu.call(this.player,e)}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self&&self;var tt=function(e,t){return function(e,t){e.exports=function(){var e=function(){},t={},i={},n={};function r(e,t){e=e.push?e:[e];var r,s,a,o=[],l=e.length,c=l;for(r=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)s=e[l],(a=i[s])?r(s,a):(n[s]=n[s]||[]).push(r)}function s(e,t){if(e){var r=n[e];if(i[e]=t,r)for(;r.length;)r[0](e,t),r.splice(0,1)}}function a(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,n,r){var s,a,l=document,c=n.async,u=(n.numRetries||0)+1,d=n.before||e,h=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img)!/,"");r=r||0,/(^css!|\.css$)/.test(h)?((a=l.createElement("link")).rel="stylesheet",a.href=p,(s="hideFocus"in a)&&a.relList&&(s=0,a.rel="preload",a.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)?(a=l.createElement("img")).src=p:((a=l.createElement("script")).src=t,a.async=void 0===c||c),a.onload=a.onerror=a.onbeforeload=function(e){var l=e.type[0];if(s)try{a.sheet.cssText.length||(l="e")}catch(e){18!=e.code&&(l="e")}if("e"==l){if((r+=1)<u)return o(t,i,n,r)}else if("preload"==a.rel&&"style"==a.as)return a.rel="stylesheet";i(t,l,e.defaultPrevented)},!1!==d(t,a)&&l.head.appendChild(a)}function l(e,t,i){var n,r,s=(e=e.push?e:[e]).length,a=s,l=[];for(n=function(e,i,n){if("e"==i&&l.push(e),"b"==i){if(!n)return;l.push(e)}--s||t(l)},r=0;r<a;r++)o(e[r],n,i)}function c(e,i,n){var r,o;if(i&&i.trim&&(r=i),o=(r?n:i)||{},r){if(r in t)throw"LoadJS";t[r]=!0}function c(t,i){l(e,(function(e){a(o,e),t&&a({success:t,error:i},e),s(r,e)}),o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return r(e,(function(e){a(t,e)})),c},c.done=function(e){s(e,[])},c.reset=function(){t={},i={},n={}},c.isDefined=function(e){return e in t},c}()}(t={exports:{}}),t.exports}();function it(e){return new Promise(((t,i)=>{tt(e,{success:t,error:i})}))}function nt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ye.call(this,this.media,e?"play":"pause"))}const rt={setup(){const e=this;ne(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,we.call(e),D(window.Vimeo)?rt.ready.call(e):it(e.config.urls.vimeo.sdk).then((()=>{rt.ready.call(e)})).catch((t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)}))},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:n,...r}=t;let s=e.media.getAttribute("src"),a="";B(s)?(s=e.media.getAttribute(e.config.attributes.embed.id),a=e.media.getAttribute(e.config.attributes.embed.hash)):a=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(s);const o=a?{h:a}:{};i&&Object.assign(r,{controls:!1,sidedock:!1});const l=$e({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative,...o,...r}),c=B(u=s)?null:k(Number(u))?u:u.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:u;var u;const d=V("iframe"),h=De(e.config.urls.vimeo.iframe,c,l);if(d.setAttribute("src",h),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),B(n)||d.setAttribute("referrerPolicy",n),i||!t.customControls)d.setAttribute("data-poster",e.poster),e.media=ee(d,e.media);else{const t=V("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(d),e.media=ee(t,e.media)}t.customControls||Re(De(e.config.urls.vimeo.api,h)).then((t=>{!B(t)&&t.thumbnail_url&&Je.setPoster.call(e,t.thumbnail_url).catch((()=>{}))})),e.embed=new window.Vimeo.Player(d,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(nt.call(e,!0),e.embed.play()),e.media.pause=()=>(nt.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:p}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>p,set(t){const{embed:i,media:n,paused:r,volume:s}=e,a=r&&!i.hasPlayed;n.seeking=!0,ye.call(e,n,"seeking"),Promise.resolve(a&&i.setVolume(0)).then((()=>i.setCurrentTime(t))).then((()=>a&&i.pause())).then((()=>a&&i.setVolume(s))).catch((()=>{}))}});let f=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>f,set(t){e.embed.setPlaybackRate(t).then((()=>{f=t,ye.call(e,e.media,"ratechange")})).catch((()=>{e.options.speed=[1]}))}});let{volume:g}=e.config;Object.defineProperty(e.media,"volume",{get:()=>g,set(t){e.embed.setVolume(t).then((()=>{g=t,ye.call(e,e.media,"volumechange")}))}});let{muted:y}=e.config;Object.defineProperty(e.media,"muted",{get:()=>y,set(t){const i=!!x(t)&&t;e.embed.setVolume(i?0:e.config.volume).then((()=>{y=i,ye.call(e,e.media,"volumechange")}))}});let m,{loop:v}=e.config;Object.defineProperty(e.media,"loop",{get:()=>v,set(t){const i=x(t)?t:e.config.loop.active;e.embed.setLoop(i).then((()=>{v=i}))}}),e.embed.getVideoUrl().then((t=>{m=t,Ye.setDownloadUrl.call(e)})).catch((e=>{this.debug.warn(e)})),Object.defineProperty(e.media,"currentSrc",{get:()=>m}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then((t=>{const[i,n]=t;e.embed.ratio=Ae(i,n),we.call(this)})),e.embed.setAutopause(e.config.autopause).then((t=>{e.config.autopause=t})),e.embed.getVideoTitle().then((t=>{e.config.title=t,Je.setTitle.call(this)})),e.embed.getCurrentTime().then((t=>{p=t,ye.call(e,e.media,"timeupdate")})),e.embed.getDuration().then((t=>{e.media.duration=t,ye.call(e,e.media,"durationchange")})),e.embed.getTextTracks().then((t=>{e.media.textTracks=t,Ge.setup.call(e)})),e.embed.on("cuechange",(({cues:t=[]})=>{const i=t.map((e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText}(e.text)));Ge.updateCues.call(e,i)})),e.embed.on("loaded",(()=>{e.embed.getPaused().then((t=>{nt.call(e,!t),t||ye.call(e,e.media,"playing")})),R(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)})),e.embed.on("bufferstart",(()=>{ye.call(e,e.media,"waiting")})),e.embed.on("bufferend",(()=>{ye.call(e,e.media,"playing")})),e.embed.on("play",(()=>{nt.call(e,!0),ye.call(e,e.media,"playing")})),e.embed.on("pause",(()=>{nt.call(e,!1)})),e.embed.on("timeupdate",(t=>{e.media.seeking=!1,p=t.seconds,ye.call(e,e.media,"timeupdate")})),e.embed.on("progress",(t=>{e.media.buffered=t.percent,ye.call(e,e.media,"progress"),1===parseInt(t.percent,10)&&ye.call(e,e.media,"canplaythrough"),e.embed.getDuration().then((t=>{t!==e.media.duration&&(e.media.duration=t,ye.call(e,e.media,"durationchange"))}))})),e.embed.on("seeked",(()=>{e.media.seeking=!1,ye.call(e,e.media,"seeked")})),e.embed.on("ended",(()=>{e.media.paused=!0,ye.call(e,e.media,"ended")})),e.embed.on("error",(t=>{e.media.error=t,ye.call(e,e.media,"error")})),t.customControls&&setTimeout((()=>Je.build.call(e)),0)}};function st(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ye.call(this,this.media,e?"play":"pause"))}function at(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const ot={setup(){if(ne(this.elements.wrapper,this.config.classNames.embed,!0),D(window.YT)&&_(window.YT.Player))ot.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{_(e)&&e(),ot.ready.call(this)},it(this.config.urls.youtube.sdk).catch((e=>{this.debug.warn("YouTube API failed to load",e)}))}},getTitle(e){Re(De(this.config.urls.youtube.api,e)).then((e=>{if(D(e)){const{title:t,height:i,width:n}=e;this.config.title=t,Je.setTitle.call(this),this.embed.ratio=Ae(n,i)}we.call(this)})).catch((()=>{we.call(this)}))},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!B(i)&&i.startsWith("youtube-"))return;let n=e.media.getAttribute("src");B(n)&&(n=e.media.getAttribute(this.config.attributes.embed.id));const r=B(s=n)?null:s.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:s;var s;const a=V("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=ee(a,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${r}/${e}default.jpg`;Xe(t("maxres"),121).catch((()=>Xe(t("sd"),121))).catch((()=>Xe(t("hq")))).then((t=>Je.setPoster.call(e,t.src))).then((t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")})).catch((()=>{}))}e.embed=new window.YT.Player(e.media,{videoId:r,host:at(t),playerVars:q({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.fullscreen.iosNative?0:1,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,n={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occured";e.media.error={code:i,message:n},ye.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),ye.call(e,e.media,"ratechange")},onReady(i){if(_(e.media.play))return;const n=i.target;ot.getTitle.call(e,r),e.media.play=()=>{st.call(e,!0),n.playVideo()},e.media.pause=()=>{st.call(e,!1),n.pauseVideo()},e.media.stop=()=>{n.stopVideo()},e.media.duration=n.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(n.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ye.call(e,e.media,"seeking"),n.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>n.getPlaybackRate(),set(e){n.setPlaybackRate(e)}});let{volume:s}=e.config;Object.defineProperty(e.media,"volume",{get:()=>s,set(t){s=t,n.setVolume(100*s),ye.call(e,e.media,"volumechange")}});let{muted:a}=e.config;Object.defineProperty(e.media,"muted",{get:()=>a,set(t){const i=x(t)?t:a;a=i,n[i?"mute":"unMute"](),n.setVolume(100*s),ye.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>n.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=n.getAvailablePlaybackRates();e.options.speed=o.filter((t=>e.config.speed.options.includes(t))),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ye.call(e,e.media,"timeupdate"),ye.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval((()=>{e.media.buffered=n.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&ye.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),ye.call(e,e.media,"canplaythrough"))}),200),t.customControls&&setTimeout((()=>Je.build.call(e)),50)},onStateChange(i){const n=i.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,ye.call(e,e.media,"seeked")),i.data){case-1:ye.call(e,e.media,"timeupdate"),e.media.buffered=n.getVideoLoadedFraction(),ye.call(e,e.media,"progress");break;case 0:st.call(e,!1),e.media.loop?(n.stopVideo(),n.playVideo()):ye.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(st.call(e,!0),ye.call(e,e.media,"playing"),e.timers.playing=setInterval((()=>{ye.call(e,e.media,"timeupdate")}),50),e.media.duration!==n.getDuration()&&(e.media.duration=n.getDuration(),ye.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),st.call(e,!1);break;case 3:ye.call(e,e.media,"waiting")}ye.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},lt={setup(){this.media?(ne(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),ne(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&ne(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=V("div",{class:this.config.classNames.video}),W(this.media,this.elements.wrapper),this.elements.poster=V("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ce.setup.call(this):this.isYouTube?ot.setup.call(this):this.isVimeo&&rt.setup.call(this)):this.debug.warn("No media element found!")}};class ct{constructor(t){e(this,"load",(()=>{this.enabled&&(D(window.google)&&D(window.google.ima)?this.ready():it(this.player.config.urls.googleIMA.sdk).then((()=>{this.ready()})).catch((()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))})))})),e(this,"ready",(()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then((()=>{this.clearSafetyTimer("onAdsManagerLoaded()")})),this.listeners(),this.setupIMA()})),e(this,"setupIMA",(()=>{this.elements.container=V("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,(e=>this.onAdsManagerLoaded(e)),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e)),!1),this.requestAds()})),e(this,"requestAds",(()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}})),e(this,"pollCountdown",((e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval((()=>{const e=Ue(Math.max(this.manager.getRemainingTime(),0)),t=`${Oe.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)}),100)})),e(this,"onAdsManagerLoaded",(e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,(e=>this.onAdError(e))),Object.keys(google.ima.AdEvent.Type).forEach((e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],(e=>this.onAdEvent(e)))})),this.trigger("loaded")})),e(this,"addCuePoints",(()=>{B(this.cuePoints)||this.cuePoints.forEach((e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(R(t)){const i=100/this.player.duration*e,n=V("span",{class:this.player.config.classNames.cues});n.style.left=`${i.toString()}%`,t.appendChild(n)}}}))})),e(this,"onAdEvent",(e=>{const{container:t}=this.player.elements,i=e.getAd(),n=e.getAdData();switch((e=>{ye.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:n.adError&&this.player.debug.warn(`Non-fatal ad error: ${n.adError.getMessage()}`)}})),e(this,"onAdError",(e=>{this.cancel(),this.player.debug.warn("Ads error",e)})),e(this,"listeners",(()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",(()=>{this.addCuePoints()})),this.player.on("ended",(()=>{this.loader.contentComplete()})),this.player.on("timeupdate",(()=>{t=this.player.currentTime})),this.player.on("seeked",(()=>{const e=this.player.currentTime;B(this.cuePoints)||this.cuePoints.forEach(((i,n)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(n,1))}))})),window.addEventListener("resize",(()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)}))})),e(this,"play",(()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then((()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}})).catch((()=>{}))})),e(this,"resumeContent",(()=>{this.elements.container.style.zIndex="",this.playing=!1,Me(this.player.media.play())})),e(this,"pauseContent",(()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()})),e(this,"cancel",(()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()})),e(this,"loadAds",(()=>{this.managerPromise.then((()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise((e=>{this.on("loaded",e),this.player.debug.log(this.manager)})),this.initialized=!1,this.requestAds()})).catch((()=>{}))})),e(this,"trigger",((e,...t)=>{const i=this.events[e];O(i)&&i.forEach((e=>{_(e)&&e.apply(this,t)}))})),e(this,"on",((e,t)=>(O(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this))),e(this,"startSafetyTimer",((e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout((()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")}),e)})),e(this,"clearSafetyTimer",(e=>{C(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)})),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise(((e,t)=>{this.on("loaded",e),this.on("error",t)})),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!B(e.publisherId)||Y(e.tagUrl))}get tagUrl(){const{config:e}=this;return Y(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${$e({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ut(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}const dt=e=>{const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach((e=>{const i={};e.split(/\r\n|\n|\r/).forEach((e=>{if(k(i.startTime)){if(!B(e.trim())&&B(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}})),i.text&&t.push(i)})),t},ht=(e,t)=>{const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i};class pt{constructor(t){e(this,"load",(()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then((()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)}))})),e(this,"getThumbnails",(()=>new Promise((e=>{const{src:t}=this.player.config.previewThumbnails;if(B(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort(((e,t)=>e.height-t.height)),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(_(t))t((e=>{this.thumbnails=e,i()}));else{const e=(j(t)?[t]:t).map((e=>this.getThumbnail(e)));Promise.all(e).then(i)}})))),e(this,"getThumbnail",(e=>new Promise((t=>{Re(e).then((i=>{const n={frames:dt(i),height:null,urlPrefix:""};n.frames[0].text.startsWith("/")||n.frames[0].text.startsWith("http://")||n.frames[0].text.startsWith("https://")||(n.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const r=new Image;r.onload=()=>{n.height=r.naturalHeight,n.width=r.naturalWidth,this.thumbnails.push(n),t()},r.src=n.urlPrefix+n.frames[0].text}))})))),e(this,"startMove",(e=>{if(this.loaded&&z(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const n=this.player.elements.progress.getBoundingClientRect(),r=100/n.width*(e.pageX-n.left);this.seekTime=this.player.media.duration*(r/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.innerText=Ue(this.seekTime);const s=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find((({time:e})=>e===Math.round(this.seekTime)));s&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${s.label}<br>`)}this.showImageAtCurrentTime()}})),e(this,"endMove",(()=>{this.toggleThumbContainer(!1,!0)})),e(this,"startScrubbing",(e=>{(C(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))})),e(this,"endScrubbing",(()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ge.call(this.player,this.player.media,"timeupdate",(()=>{this.mouseDown||this.toggleScrubbingContainer(!1)}))})),e(this,"listeners",(()=>{this.player.on("play",(()=>{this.toggleThumbContainer(!1,!0)})),this.player.on("seeked",(()=>{this.toggleThumbContainer(!1)})),this.player.on("timeupdate",(()=>{this.lastTime=this.player.media.currentTime}))})),e(this,"render",(()=>{this.elements.thumb.container=V("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=V("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=V("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=V("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),R(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=V("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)})),e(this,"destroy",(()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()})),e(this,"showImageAtCurrentTime",(()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex((e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime)),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach(((t,n)=>{this.loadedImages.includes(t.frames[e].text)&&(i=n)})),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))})),e(this,"loadImage",((e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:n}=i,r=i.frames[t],s=i.frames[t].text,a=n+s;if(this.currentImageElement&&this.currentImageElement.dataset.filename===s)this.showImage(this.currentImageElement,r,e,t,s,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=a,i.dataset.index=t,i.dataset.filename=s,this.showingThumbFilename=s,this.player.debug.log(`Loading image: ${a}`),i.onload=()=>this.showImage(i,r,e,t,s,!0),this.loadingImage=i,this.removeOldImages(i)}})),e(this,"showImage",((e,t,i,n,r,s=!0)=>{this.player.debug.log(`Showing thumb: ${r}. num: ${n}. qual: ${i}. newimg: ${s}`),this.setImageSizeAndOffset(e,t),s&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(r)||this.loadedImages.push(r)),this.preloadNearby(n,!0).then(this.preloadNearby(n,!1)).then(this.getHigherQuality(i,e,t,r))})),e(this,"removeOldImages",(e=>{Array.from(this.currentImageContainer.children).forEach((t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout((()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)}),i)}}))})),e(this,"preloadNearby",((e,t=!0)=>new Promise((i=>{setTimeout((()=>{const n=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===n){let r;r=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let s=!1;r.forEach((e=>{const t=e.text;if(t!==n&&!this.loadedImages.includes(t)){s=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],n=e+t,r=new Image;r.src=n,r.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}})),s||i()}}),300)})))),e(this,"getHigherQuality",((e,t,i,n)=>{if(e<this.thumbnails.length-1){let r=t.naturalHeight;this.usingSprites&&(r=i.h),r<this.thumbContainerHeight&&setTimeout((()=>{this.showingThumbFilename===n&&(this.player.debug.log(`Showing higher quality thumb for: ${n}`),this.loadImage(e+1))}),300)}})),e(this,"toggleThumbContainer",((e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"toggleScrubbingContainer",((e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)})),e(this,"determineContainerAutoSizing",(()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)})),e(this,"setThumbContainerSizeAndPos",(()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()})),e(this,"setThumbContainerPos",(()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,n=t.left-e.left+10,r=t.right-e.left-i.clientWidth-10,s=this.mousePosX-e.left-i.clientWidth/2,a=ut(s,n,r);i.style.left=`${a}px`,i.style.setProperty("--preview-arrow-offset",s-a+"px")})),e(this,"setScrubbingContainerSize",(()=>{const{width:e,height:t}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`})),e(this,"setImageSizeAndOffset",((e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`})),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=ht(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const ft={insertElements(e,t){j(t)?K(e,this.media,{src:t}):O(t)&&t.forEach((t=>{K(e,this.media,t)}))},change(e){H(e,"sources.length")?(Ce.cancelRequests.call(this),this.destroy.call(this,(()=>{this.options.quality=[],X(this.media),this.media=null,R(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:n=qe.html5,src:r}]=t,s="html5"===n?i:"div",a="html5"===n?{}:{src:r};Object.assign(this,{provider:n,type:i,supported:ue.check(i,n,this.config.playsinline),media:V(s,a)}),this.elements.container.appendChild(this.media),x(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),B(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Je.addStyleHook.call(this),this.isHTML5&&ft.insertElements.call(this,"source",t),this.config.title=e.title,lt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&ft.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.isHTML5&&this.media.load(),B(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))),this.fullscreen.update()}),!0)):this.debug.warn("Invalid source format")}};class gt{constructor(t,i){if(e(this,"play",(()=>_(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then((()=>this.ads.play())).catch((()=>Me(this.media.play()))),this.media.play()):null)),e(this,"pause",(()=>this.playing&&_(this.media.pause)?this.media.pause():null)),e(this,"togglePlay",(e=>(x(e)?e:!this.playing)?this.play():this.pause())),e(this,"stop",(()=>{this.isHTML5?(this.pause(),this.restart()):_(this.media.stop)&&this.media.stop()})),e(this,"restart",(()=>{this.currentTime=0})),e(this,"rewind",(e=>{this.currentTime-=k(e)?e:this.config.seekTime})),e(this,"forward",(e=>{this.currentTime+=k(e)?e:this.config.seekTime})),e(this,"increaseVolume",(e=>{const t=this.media.muted?0:this.volume;this.volume=t+(k(e)?e:0)})),e(this,"decreaseVolume",(e=>{this.increaseVolume(-e)})),e(this,"airplay",(()=>{ue.airplay&&this.media.webkitShowPlaybackTargetPicker()})),e(this,"toggleControls",(e=>{if(this.supported.ui&&!this.isAudio){const t=re(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,n=ne(this.elements.container,this.config.classNames.hideControls,i);if(n&&O(this.config.controls)&&this.config.controls.includes("settings")&&!B(this.config.settings)&&Ye.toggleMenu.call(this,!1),n!==t){const e=n?"controlshidden":"controlsshown";ye.call(this,this.media,e)}return!n}return!1})),e(this,"on",((e,t)=>{pe.call(this,this.elements.container,e,t)})),e(this,"once",((e,t)=>{ge.call(this,this.elements.container,e,t)})),e(this,"off",((e,t)=>{fe(this.elements.container,e,t)})),e(this,"destroy",((e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(X(this.elements.buttons.play),X(this.elements.captions),X(this.elements.controls),X(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),_(e)&&e()):(me.call(this),Ce.cancelRequests.call(this),ee(this.elements.original,this.elements.container),ye.call(this,this.elements.original,"destroyed",!0),_(e)&&e.call(this.elements.original),this.ready=!1,setTimeout((()=>{this.elements=null,this.media=null}),200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Je.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&_(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))})),e(this,"supports",(e=>ue.mime.call(this,e))),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ue.touch,this.media=t,j(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||P(this.media)||O(this.media))&&(this.media=this.media[0]),this.config=q({},Qe,gt.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch(e){return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Ve(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ue),C(this.media)||!R(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!ue.check().api)return void this.debug.error("Setup failed: no support");const n=this.media.cloneNode(!0);n.autoplay=!1,this.elements.original=n;const r=this.media.tagName.toLowerCase();let s=null,a=null;switch(r){case"div":if(s=this.media.querySelector("iframe"),R(s)){if(a=Be(s.getAttribute("src")),this.provider=function(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?qe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?qe.vimeo:null}(a.toString()),this.elements.container=this.media,this.media=s,this.elements.container.className="",a.search.length){const e=["1","true"];e.includes(a.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(a.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(a.searchParams.get("playsinline")),this.config.youtube.hl=a.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(B(this.provider)||!Object.values(qe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=We;break;case"video":case"audio":this.type=r,this.provider=qe.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=ue.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new et(this),this.storage=new Pe(this),this.media.plyr=this,R(this.elements.container)||(this.elements.container=V("div",{tabindex:0}),W(this.media,this.elements.container)),Je.migrateStyles.call(this),Je.addStyleHook.call(this),lt.setup.call(this),this.config.debug&&pe.call(this,this.elements.container,this.config.events.join(" "),(e=>{this.debug.log(`event: ${e.type}`)})),this.fullscreen=new Ke(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ct(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",(()=>Me(this.play()))),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===qe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===qe.youtube}get isVimeo(){return this.provider===qe.vimeo}get isVideo(){return this.type===We}get isAudio(){return"audio"===this.type}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=k(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return k(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),t=(this.media||{}).duration,i=k(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;j(t)&&(t=Number(t)),k(t)||(t=this.storage.get("volume")),k(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!B(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;x(t)||(t=this.storage.get("muted")),x(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let t=null;k(e)&&(t=e),k(t)||(t=this.storage.get("speed")),k(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:n}=this;t=ut(t,i,n),this.config.speed.selected=t,setTimeout((()=>{this.media&&(this.media.playbackRate=t)}),0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let n=[!B(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(k),r=!0;if(!i.includes(n)){const e=Le(i,n);this.debug.warn(`Unsupported quality option: ${n}, using ${e} instead`),n=e,r=!1}t.selected=n,this.media.quality=n,r&&this.storage.set({quality:n})}get quality(){return this.media.quality}set loop(e){const t=x(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){ft.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return Y(e)?e:this.source}set download(e){Y(e)&&(this.config.urls.download=e,Ye.setDownloadUrl.call(this))}set poster(e){this.isVideo?Je.setPoster.call(this,e,!1).catch((()=>{})):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ne(Se.call(this));return O(e)?e.join(":"):e}set ratio(e){this.isVideo?j(e)&&Ie(e)?(this.config.ratio=Ne(e),we.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=x(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Ge.toggle.call(this,e,!1)}set currentTrack(e){Ge.set.call(this,e,!1),Ge.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ge.setLanguage.call(this,e,!1)}get language(){return(Ge.getCurrentTrack.call(this)||{}).language}set pip(e){if(!ue.pip)return;const t=x(e)?e:!this.pip;_(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?He:"inline"),_(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return ue.pip?B(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===He:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new pt(this))}static supported(e,t,i){return ue.check(e,t,i)}static loadSprite(e,t){return ze(e,t)}static setup(e,t={}){let i=null;return j(e)?i=Array.from(document.querySelectorAll(e)):P(e)?i=Array.from(e):O(e)&&(i=e.filter(R)),B(i)?null:i.map((e=>new gt(e,t)))}}var yt;return gt.defaults=(yt=Qe,JSON.parse(JSON.stringify(yt))),gt}())},4096:function(e){e.exports=function(){"use strict";function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function t(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function i(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?i(Object(r),!0).forEach((function(i){t(e,i,r[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var r={addCSS:!0,thumbWidth:15,watch:!0};function s(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}var a=function(e){return null!=e?e.constructor:null},o=function(e,t){return!!(e&&t&&e instanceof t)},l=function(e){return a(e)===String},c=function(e){return Array.isArray(e)},u=function(e){return o(e,NodeList)},d=l,h=c,p=u,f=function(e){return o(e,Element)},g=function(e){return o(e,Event)},y=function(e){return function(e){return null==e}(e)||(l(e)||c(e)||u(e))&&!e.length||function(e){return a(e)===Object}(e)&&!Object.keys(e).length};return function(){function t(e,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),f(e)?this.element=e:d(e)&&(this.element=document.querySelector(e)),f(this.element)&&y(this.element.rangeTouch)&&(this.config=n({},r,{},i),this.init())}return i=t,o=[{key:"setup",value:function(e){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},a=null;if(y(e)||d(e)?a=Array.from(document.querySelectorAll(d(e)?e:'input[type="range"]')):f(e)?a=[e]:p(e)?a=Array.from(e):h(e)&&(a=e.filter(f)),y(a))return null;var o=n({},r,{},i);if(d(e)&&o.watch){var l=new MutationObserver((function(i){Array.from(i).forEach((function(i){Array.from(i.addedNodes).forEach((function(i){f(i)&&s(i,e)&&new t(i,o)}))}))}));l.observe(document.body,{childList:!0,subtree:!0})}return a.map((function(e){return new t(e,i)}))}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}],(a=[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach((function(e){t.element[i](e,(function(e){return t.set(e)}),!1)}))}},{key:"get",value:function(e){if(!t.enabled||!g(e))return null;var i,n=e.target,r=e.changedTouches[0],s=parseFloat(n.getAttribute("min"))||0,a=parseFloat(n.getAttribute("max"))||100,o=parseFloat(n.getAttribute("step"))||1,l=n.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(r.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),s+function(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}(i/100*(a-s),o)}},{key:"set",value:function(e){t.enabled&&g(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(e.target,"touchend"===e.type?"change":"input"))}}])&&e(i.prototype,a),o&&e(i,o),t;var i,a,o}()}()},481:(e,t,i)=>{!function(e){"use strict";e.exports.is_uri=i,e.exports.is_http_uri=n,e.exports.is_https_uri=r,e.exports.is_web_uri=s,e.exports.isUri=i,e.exports.isHttpUri=n,e.exports.isHttpsUri=r,e.exports.isWebUri=s;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function i(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var i,n,r,s,a,o="",l="";if(o=(i=t(e))[1],n=i[2],r=i[3],s=i[4],a=i[5],o&&o.length&&r.length>=0){if(n&&n.length){if(0!==r.length&&!/^\//.test(r))return}else if(/^\/\//.test(r))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(o.toLowerCase()))return l+=o+":",n&&n.length&&(l+="//"+n),l+=r,s&&s.length&&(l+="?"+s),a&&a.length&&(l+="#"+a),l}}}function n(e,n){if(i(e)){var r,s,a,o,l="",c="",u="",d="";if(l=(r=t(e))[1],c=r[2],s=r[3],a=r[4],o=r[5],l){if(n){if("https"!=l.toLowerCase())return}else if("http"!=l.toLowerCase())return;if(c)return/:(\d+)$/.test(c)&&(u=c.match(/:(\d+)$/)[0],c=c.replace(/:\d+$/,"")),d+=l+":",d+="//"+c,u&&(d+=u),d+=s,a&&a.length&&(d+="?"+a),o&&o.length&&(d+="#"+o),d}}}function r(e){return n(e,!0)}function s(e){return n(e)||r(e)}}(e=i.nmd(e))},3991:(e,t,i)=>{var n={"./arrow-down.svg":6785,"./arrow-left.svg":5591,"./chevron-down-full.svg":483,"./chevron-down.svg":6907,"./chevron-up-full.svg":6735,"./chevron-up.svg":5713,"./close.svg":1424,"./compass.svg":5359,"./external-link.svg":32,"./facebook.svg":1978,"./fast-backward.svg":3621,"./fast-forward.svg":4239,"./file-text.svg":1553,"./home.svg":8322,"./logo-big.png":4755,"./logo.png":971,"./maximize.svg":29,"./mini-player.svg":2536,"./minimize.svg":2529,"./more-vertical.svg":5352,"./mute.svg":6205,"./pause.svg":1935,"./play.svg":9321,"./search.svg":4682,"./settings.svg":9608,"./share.svg":735,"./skip-backward.svg":5862,"./skip-forward.svg":6707,"./speed-1-5.svg":366,"./speed-1.svg":9852,"./speed-2.svg":7270,"./subtitles.svg":2614,"./twitter.svg":4576,"./university.svg":1939,"./user.svg":6895,"./volume-1.svg":3132,"./volume-2.svg":9265,"./volume-3.svg":5929};function r(e){var t=s(e);return i(t)}function s(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=s,e.exports=r,r.id=3991},6785:e=>{"use strict";e.exports="data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMjQiIGhlaWdodD0iMTAyNCIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCI+Cjx0aXRsZT48L3RpdGxlPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik01MTIgODUzLjMzM2MtMjMuNDY3IDAtNDIuNjY3LTE5LjItNDIuNjY3LTQyLjY2N3YtNTk3LjMzM2MwLTIzLjQ2NyAxOS4yLTQyLjY2NyA0Mi42NjctNDIuNjY3czQyLjY2NyAxOS4yIDQyLjY2NyA0Mi42Njd2NTk3LjMzM2MwIDIzLjQ2Ny0xOS4yIDQyLjY2Ny00Mi42NjcgNDIuNjY3eiI+PC9wYXRo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g5cy0xLjEyLDYuNTEtMy4xNSw4Ljg5Yy0uMjMuMjYtLjUyLjM5LS44Mi4zOVoiLz4KPC9zdmc+"},7061:(e,t,i)=>{var n=i(8698).default;function r(){"use strict";e.exports=r=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},i=Object.prototype,s=i.hasOwnProperty,a=Object.defineProperty||function(e,t,i){e[t]=i.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,i){return e[t]=i}}function h(e,t,i,n){var r=t&&t.prototype instanceof g?t:g,s=Object.create(r.prototype),o=new A(n||[]);return a(s,"_invoke",{value:I(e,i,o)}),s}function p(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var f={};function g(){}function y(){}function m(){}var v={};d(v,l,(function(){return this}));var M=Object.getPrototypeOf,T=M&&M(M(C([])));T&&T!==i&&s.call(T,l)&&(v=T);var L=m.prototype=g.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function i(r,a,o,l){var c=p(e[r],e,a);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==n(d)&&s.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,o,l)}),(function(e){i("throw",e,o,l)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return i("throw",e,o,l)}))}l(c.arg)}var r;a(this,"_invoke",{value:function(e,n){function s(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(s,s):s()}})}function I(e,t,i){var n="suspendedStart";return function(r,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw s;return{value:void 0,done:!0}}for(i.method=r,i.arg=s;;){var a=i.delegate;if(a){var o=N(a,i);if(o){if(o===f)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var l=p(e,t,i);if("normal"===l.type){if(n=i.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n="completed",i.method="throw",i.arg=l.arg)}}}function N(e,t){var i=e.iterator[t.method];if(void 0===i){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,N(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=p(i,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var r=n.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,n=function t(){for(;++i<e.length;)if(s.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:D}}function D(){return{value:void 0,done:!0}}return y.prototype=m,a(L,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=d(m,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,d(e,u,"GeneratorFunction")),e.prototype=Object.create(L),e},t.awrap=function(e){return{__await:e}},b(E.prototype),d(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,i,n,r,s){void 0===s&&(s=Promise);var a=new E(h(e,i,n,r),s);return t.isGeneratorFunction(i)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(L),d(L,u,"Generator"),d(L,l,(function(){return this})),d(L,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=C,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(i,n){return a.type="throw",a.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var o=s.call(r,"catchLoc"),l=s.call(r,"finallyLoc");if(o&&l){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var a=r?r.completion:{};return a.type=e,a.arg=t,r?(this.method="next",this.next=r.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),w(i),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;w(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:C(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),f}},t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(i){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,i)=>{var n=i(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},5266:(e,t,i)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},n.apply(this,arguments)}function r(e,t){const i=t.width,n=t.height,r=t.inlineSize,s=t.blockSize;switch(e){case 1:return null!=i?{type:3,value:i,unit:"px"}:{type:1};case 3:return null!=r?{type:3,value:r,unit:"px"}:{type:1};case 2:return null!=n?{type:3,value:n,unit:"px"}:{type:1};case 4:return null!=s?{type:3,value:s,unit:"px"}:{type:1};case 5:return null!=i&&null!=n&&n>0?{type:2,value:i/n}:{type:1};case 6:return null!=i&&null!=n?{type:4,value:n>=i?"portrait":"landscape"}:{type:1}}}function s(e,t){switch(e.type){case 1:case 2:case 3:case 4:return h(e,t);case 5:{const i=t.sizeFeatures.get(e.feature);return null==i?{type:1}:i}case 6:return e.value}}function a(e){return{type:5,value:e}}function o(e,t,i){return a(function(e,t,i){switch(i){case 1:return e===t;case 2:return e>t;case 3:return e>=t;case 4:return e<t;case 5:return e<=t}}(e,t,i))}function l(e,t,i){return null==e?t:null==t?e:i(e,t)}function c(e,t){switch(e){case"cqw":return t.cqw;case"cqh":return t.cqh;case"cqi":return 0===t.writingAxis?t.cqw:t.cqh;case"cqb":return 1===t.writingAxis?t.cqw:t.cqh;case"cqmin":return l(c("cqi",t),c("cqb",t),Math.min);case"cqmax":return l(c("cqi",t),c("cqb",t),Math.max)}}function u(e,{treeContext:t}){switch(e.unit){case"px":return e.value;case"rem":return e.value*t.rootFontSize;case"em":return e.value*t.fontSize;case"cqw":case"cqh":case"cqi":case"cqb":case"cqmin":case"cqmax":return l(e.value,c(e.unit,t),((e,t)=>e*t))}return null}function d(e,t){switch(e.type){case 2:return 0===e.value?0:null;case 3:return u(e,t)}return null}function h(e,t){switch(e.type){case 4:return function(e,t){const i=s(e.left,t),n=s(e.right,t),r=e.operator;if(4===i.type&&4===n.type||5===i.type&&5===n.type)return function(e,t,i){return 1===i?a(e.value===t.value):{type:1}}(i,n,r);if(3===i.type||3===n.type){const e=d(i,t),s=d(n,t);if(null!=e&&null!=s)return o(e,s,r)}else if(2===i.type&&2===n.type)return o(i.value,n.value,r);return{type:1}}(e,t);case 2:return function(e,t){const i=h(e.left,t);return 5!==i.type||!0!==i.value?i:h(e.right,t)}(e,t);case 3:return function(e,t){const i=h(e.left,t);return 5===i.type&&!0===i.value?i:h(e.right,t)}(e,t);case 1:{const i=h(e.value,t);return 5===i.type?{type:5,value:!i.value}:{type:1}}case 5:return p(s(e,t));case 6:return p(e.value)}}function p(e){switch(e.type){case 5:return e;case 2:case 3:return{type:5,value:e.value>0}}return{type:1}}i.r(t);const f=Array.from({length:4},(()=>Math.floor(256*Math.random()).toString(16))).join(""),g=I("container"),y=I("container-type"),m=I("container-name"),v=`data-cqs-${f}`,M=`data-cqc-${f}`,T=I("cqw"),L=I("cqh"),b=I("cqi"),E=I("cqb");function I(e){return`--cq-${e}-${f}`}const N=Symbol();function S(e,t){const i={value:t,errorIndices:[],index:-1,at(n){const r=i.index+n;return r>=e.length?t:e[r]},consume:e=>(i.index+=e,i.value=i.at(0),i.value),reconsume(){i.index-=1},error(){i.errorIndices.push(i.index)}};return i}function w(e){return S(e,{type:0})}function*A(e){const t=[];let i=!1;for(const n of e){const e=n.codePointAt(0);i&&10!==e&&(i=!1,t.push(10)),0===e||e>=55296&&e<=57343?t.push(65533):13===e?i=!0:t.push(e)}const n=S(t,-1),{at:r,consume:s,error:a,reconsume:o}=n;function l(){return String.fromCodePoint(n.value)}function c(){return{type:13,value:l()}}function u(){for(;j(r(1));)s(1)}function d(){for(;-1!==n.value;)if(s(1),42===r(0)&&47===r(1))return void s(1);a()}function h(){const[e,t]=function(){let e=0,t="",i=r(1);for(43!==i&&45!==i||(s(1),t+=l());C(r(1));)s(1),t+=l();if(46===r(1)&&C(r(2)))for(e=1,s(1),t+=l();C(r(1));)s(1),t+=l();if(i=r(1),69===i||101===i){const i=r(2);if(C(i))for(e=1,s(1),t+=l();C(r(1));)s(1),t+=l();else if((45===i||43===i)&&C(r(3)))for(e=1,s(1),t+=l(),s(1),t+=l();C(r(1));)s(1),t+=l()}return[t,e]}(),i=r(1);return y(i,r(1),r(2))?{type:15,value:e,flag:t,unit:v()}:37===i?(s(1),{type:16,value:e}):{type:17,value:e,flag:t}}function p(){const e=v();let t=r(1);if("url"===e.toLowerCase()&&40===t){for(s(1);j(r(1))&&j(r(2));)s(1);t=r(1);const i=r(2);return 34===t||39===t?{type:23,value:e}:!j(t)||34!==i&&39!==i?function(){let e="";for(u();;){const i=s(1);if(41===i)return{type:20,value:e};if(-1===i)return a(),{type:20,value:e};if(j(i)){u();const t=r(1);return 41===t||-1===t?(s(1),-1===i&&a(),{type:20,value:e}):(M(),{type:21})}if(34===i||39===i||40===i||(t=i)>=0&&t<=8||11===t||t>=14&&t<=31||127===t)return a(),M(),{type:21};if(92===i){if(!_(i,r(1)))return a(),{type:21};e+=g()}else e+=l()}var t}():{type:23,value:e}}return 40===t?(s(1),{type:23,value:e}):{type:24,value:e}}function f(e){let t="";for(;;){const i=s(1);if(-1===i||i===e)return-1===i&&a(),{type:2,value:t};if(k(i))return a(),o(),{type:3};if(92===i){const e=r(1);if(-1===e)continue;k(e)?s(1):t+=g()}else t+=l()}}function g(){const e=s(1);if(D(e)){const t=[e];for(let e=0;e<5;e++){const e=r(1);if(!D(e))break;t.push(e),s(1)}j(r(1))&&s(1);let i=parseInt(String.fromCodePoint(...t),16);return(0===i||i>=55296&&i<=57343||i>1114111)&&(i=65533),String.fromCodePoint(i)}return-1===e?(a(),String.fromCodePoint(65533)):l()}function y(e,t,i){return 45===e?x(t)||45===t||_(t,i):!!x(e)}function m(e,t,i){return 43===e||45===e?C(t)||46===t&&C(i):!(46!==e||!C(t))||!!C(e)}function v(){let e="";for(;;){const t=s(1);if(O(t))e+=l();else{if(!_(t,r(1)))return o(),e;e+=g()}}}function M(){for(;;){const e=s(1);if(-1===e)return;_(e,r(1))&&g()}}for(;;){const e=s(1);if(47===e&&42===r(1))s(2),d();else if(j(e))u(),yield{type:1};else if(34===e)yield f(e);else if(35===e){const e=r(1);O(e)||_(e,r(2))?yield{type:14,flag:y(r(1),r(2),r(3))?1:0,value:v()}:yield c()}else if(39===e)yield f(e);else if(40===e)yield{type:4};else if(41===e)yield{type:5};else if(43===e)m(e,r(1),r(2))?(o(),yield h()):yield c();else if(44===e)yield{type:6};else if(45===e){const t=r(1),i=r(2);m(e,t,i)?(o(),yield h()):45===t&&62===i?(s(2),yield{type:19}):y(e,t,i)?(o(),yield p()):yield c()}else if(46===e)m(e,r(1),r(2))?(o(),yield h()):yield c();else if(58===e)yield{type:7};else if(59===e)yield{type:8};else if(60===e)33===r(1)&&45===r(2)&&45===r(3)?yield{type:18}:yield c();else if(64===e)if(y(r(1),r(2),r(3))){const e=v();yield{type:22,value:e}}else yield c();else if(91===e)yield{type:9};else if(92===e)_(e,r(1))?(o(),yield p()):(a(),yield c());else if(93===e)yield{type:10};else if(123===e)yield{type:11};else if(125===e)yield{type:12};else if(C(e))o(),yield h();else if(x(e))o(),yield p();else{if(-1===e)return yield{type:0},n.errorIndices;yield{type:13,value:l()}}}}function C(e){return e>=48&&e<=57}function D(e){return C(e)||e>=65&&e<=70||e>=97&&e<=102}function k(e){return 10===e||13===e||12===e}function j(e){return k(e)||9===e||32===e}function x(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128||95===e}function _(e,t){return 92===e&&!k(t)}function O(e){return x(e)||C(e)||45===e}const P={11:12,9:10,4:5};function R(e,t){const i=function(e,t){const i=[];for(;;)switch(e.consume(1).type){case 1:break;case 0:return{type:3,value:i};case 18:case 19:if(!1!==t){e.reconsume();const t=B(e);t!==N&&i.push(t)}break;case 22:e.reconsume(),i.push(Y(e));break;default:{e.reconsume();const t=B(e);t!==N&&i.push(t);break}}}(w(e),!0===t);return n({},i,{value:i.value.map((e=>26===e.type?function(e,t){return 0===e.value.value.type?n({},e,{value:n({},e.value,{value:F(e.value.value.value)})}):e}(e):e))})}function z(e){const t=w(e),i=[];for(;;){if(0===t.consume(1).type)return i;t.reconsume(),i.push(G(t))}}function F(e){return function(e){const t=[],i=[];for(;;){const n=e.consume(1);switch(n.type){case 1:case 8:break;case 0:return{type:1,value:[...i,...t]};case 22:e.reconsume(),t.push(Y(e));break;case 24:{const t=[n];let r=e.at(1);for(;8!==r.type&&0!==r.type;)t.push(G(e)),r=e.at(1);const s=$(w(t));s!==N&&i.push(s);break}case 13:if("&"===n.value){e.reconsume();const i=B(e);i!==N&&t.push(i);break}default:{e.error(),e.reconsume();let t=e.at(1);for(;8!==t.type&&0!==t.type;)G(e),t=e.at(1);break}}}}(w(e))}function U(e){for(;1===e.at(1).type;)e.consume(1)}function Y(e){let t=e.consume(1);if(22!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,n=[];for(;;)switch(t=e.consume(1),t.type){case 8:return{type:25,name:i,prelude:n,value:null};case 0:return e.error(),{type:25,name:i,prelude:n,value:null};case 11:return{type:25,name:i,prelude:n,value:Q(e)};case 28:if(11===t.source.type)return{type:25,name:i,prelude:n,value:t};default:e.reconsume(),n.push(G(e))}}function B(e){let t=e.value;const i=[];for(;;)switch(t=e.consume(1),t.type){case 0:return e.error(),N;case 11:return{type:26,prelude:i,value:Q(e)};case 28:if(11===t.source.type)return{type:26,prelude:i,value:t};default:e.reconsume(),i.push(G(e))}}function $(e){const t=e.consume(1);if(24!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,n=[];let r=!1;if(U(e),7!==e.at(1).type)return e.error(),N;for(e.consume(1),U(e);0!==e.at(1).type;)n.push(G(e));const s=n[n.length-2],a=n[n.length-1];return s&&13===s.type&&"!"===s.value&&24===a.type&&"important"===a.value.toLowerCase()&&(r=!0,n.splice(n.length-2)),{type:29,name:i,value:n,important:r}}function G(e){const t=e.consume(1);switch(t.type){case 11:case 9:case 4:return Q(e);case 23:return function(e){let t=e.value;if(23!==t.type)throw new Error(`Unexpected type ${t.type}`);const i=t.value,n=[];for(;;)switch(t=e.consume(1),t.type){case 5:return{type:27,name:i,value:n};case 0:return e.error(),{type:27,name:i,value:n};default:e.reconsume(),n.push(G(e))}}(e);default:return t}}function Q(e){let t=e.value;const i=t,n=P[i.type];if(!n)throw new Error(`Unexpected type ${t.type}`);const r=[];for(;;)switch(t=e.consume(1),t.type){case n:return{type:28,source:i,value:{type:0,value:r}};case 0:return e.error(),{type:28,source:i,value:{type:0,value:r}};default:e.reconsume(),r.push(G(e))}}function H(e){return U(e),0===e.at(1).type}const q={11:["{","}"],9:["[","]"],4:["(",")"]};function W(e,t){switch(e.type){case 25:return`@${CSS.escape(e.name)} ${e.prelude.map((e=>W(e))).join("")}${e.value?W(e.value):";"}`;case 26:return`${e.prelude.map((e=>W(e))).join("")}${W(e.value)}`;case 28:{const[t,i]=q[e.source.type];return`${t}${Z(e.value)}${i}`}case 27:return`${CSS.escape(e.name)}(${e.value.map((e=>W(e))).join("")})`;case 29:return`${CSS.escape(e.name)}:${e.value.map((e=>W(e))).join("")}${e.important?" !important":""}`;case 1:return" ";case 8:return";";case 7:return":";case 14:return"#"+CSS.escape(e.value);case 24:return CSS.escape(e.value);case 15:return e.value+CSS.escape(e.unit);case 13:case 17:return e.value;case 2:return`"${CSS.escape(e.value)}"`;case 6:return",";case 20:return"url("+CSS.escape(e.value)+")";case 22:return"@"+CSS.escape(e.value);case 16:return e.value+"%";default:throw new Error(`Unsupported token ${e.type}`)}}function Z(e,t){return e.value.map((t=>{let i=W(t);return 29===t.type&&0!==e.type&&(i+=";"),i})).join("")}function V(e){return W(e)}function K(e){const t=e.at(1);return 13===t.type&&"="===t.value&&(e.consume(1),!0)}function X(e,t){const i=[];for(;;){const n=e.at(1);if(0===n.type||t&&7===n.type||13===n.type&&(">"===n.value||"<"===n.value||"="===n.value))break;i.push(e.consume(1))}return i}function J(e){U(e);const t=e.consume(1);return 13!==t.type?N:">"===t.value?K(e)?3:2:"<"===t.value?K(e)?5:4:"="===t.value?1:N}function ee(e){return 4===e||5===e}function te(e){return 2===e||3===e}function ie(e,t,i){const n=function(e){U(e);const t=e.consume(1);return U(e),24!==t.type||0!==e.at(1).type?N:t.value}(w(e));if(n===N)return N;let r=n.toLowerCase();return r=i?i(r):r,t.has(r)?r:N}function ne(e){return{type:13,value:e}}function re(e,t){return{type:29,name:e,value:t,important:!1}}function se(e){return{type:24,value:e}}function ae(e,t){return{type:27,name:e,value:t}}function oe(e){return ae("var",[se(e)])}function le(e,t){U(e);let i=!1,n=e.at(1);if(24===n.type){if("not"!==n.value.toLowerCase())return N;e.consume(1),U(e),i=!0}let r=function(e){const t=e.consume(1);switch(t.type){case 28:{if(4!==t.source.type)return N;const e=le(w(t.value.value),null);return e!==N?e:{type:4,value:t}}case 27:return{type:4,value:t};default:return N}}(e);if(r===N)return N;r=i?{type:1,value:r}:r,U(e),n=e.at(1);const s=24===n.type?n.value.toLowerCase():null;if(null!==s){if(e.consume(1),U(e),"and"!==s&&"or"!==s||null!==t&&s!==t)return N;const i=le(e,s);return i===N?N:{type:"and"===s?2:3,left:r,right:i}}return H(e)?r:N}function ce(e){return le(e,null)}function ue(e){switch(e.type){case 1:return[se("not"),{type:1},...ue(e.value)];case 2:case 3:return[...ue(e.left),{type:1},se(2===e.type?"and":"or"),{type:1},...ue(e.right)];case 4:return[e.value]}}const de={width:1,height:2,"inline-size":3,"block-size":4,"aspect-ratio":5,orientation:6},he=new Set(Object.keys(de)),pe=new Set(["none","and","not","or","normal","auto"]),fe=new Set(["initial","inherit","revert","revert-layer","unset"]),ge=new Set(["size","inline-size"]);function ye(e,t,i,n){const r=i();if(r===N)return N;let s=[r,null];U(e);const a=e.at(1);if(13===a.type){if(a.value!==t)return N;e.consume(1),U(e);const i=n();U(e),i!==N&&(s=[r,i])}return H(e)?s:N}function me(e){const t=e.consume(1);return 17===t.type?parseInt(t.value):N}function ve(e){const t=w(e);U(t);const i=t.consume(1);let n=N;switch(i.type){case 17:t.reconsume(),n=function(e){const t=ye(e,"/",(()=>me(e)),(()=>me(e)));return t===N?N:{type:2,value:t[0]/(null!==t[1]?t[1]:1)}}(t);break;case 15:n={type:3,value:parseInt(i.value),unit:i.unit.toLowerCase()};break;case 24:{const e=i.value.toLowerCase();switch(e){case"landscape":case"portrait":n={type:4,value:e}}}}return n===N?N:H(t)?{type:6,value:n}:N}function Me(e){return!be(e=e.toLowerCase())&&!pe.has(e)}function Te(e,t){const i=[];for(;;){U(e);const n=e.at(1);if(24!==n.type||!t(n.value))return i;e.consume(1),i.push(n.value)}}function Le(e){const t=[];for(;;){U(e);const i=e.at(1);if(24!==i.type)break;const n=i.value;if(!Me(n))break;e.consume(1),t.push(n)}return t}function be(e){return fe.has(e)}function Ee(e){return e.map((e=>"cq-"+e))}function Ie(e){const t=Te(e,(e=>be(e)));return 1===t.length?Ee(t):N}function Ne(e,t){const i=Te(e,(e=>"none"===e));if(1===i.length)return Ee(i);if(0!==i.length)return N;if(t){const t=Ie(e);if(t!==N)return t}const n=Le(e);return n.length>0&&(!t||H(e))?n:N}function Se(e,t){if(t){const t=Ie(e);if(t!==N)return t}return function(e){const t=Te(e,(e=>"normal"===e));if(1===t.length)return Ee(t);if(0!==t.length)return N;const i=Te(e,(e=>ge.has(e)));return i.length>0&&H(e)?i:N}(e)}function we(e){const t=w(e),i=Ie(t);if(i!==N)return[i,i];const n=ye(t,"/",(()=>Ne(t,!1)),(()=>Se(t,!1)));return n!==N&&H(t)?[n[0],n[1]||[]]:N}function Ae(e){const t=w(e),i=Le(t);if(!i||i.length>1)return N;const n=ce(t);if(n===N)return N;const r={features:new Set},s=Ce(n,r);return H(t)?{name:i.length>0?i[0]:null,condition:s,features:r.features}:N}function Ce(e,t){switch(e.type){case 1:return{type:1,value:Ce(e.value,t)};case 2:case 3:return{type:2===e.type?2:3,left:Ce(e.left,t),right:Ce(e.right,t)};case 4:if(28===e.value.type){const i=function(e,t){const i=function(e,t){const i=X(e,!0),n=e.at(1);if(0===n.type){const e=ie(i,t);return e!==N&&t.has(e)?{type:1,feature:e}:N}if(7===n.type){e.consume(1);const n=X(e,!1);let r=1;const s=ie(i,t,(e=>e.startsWith("min-")?(r=3,e.substring(4)):e.startsWith("max-")?(r=5,e.substring(4)):e));return s!==N?{type:2,feature:s,bounds:[null,[r,n]]}:N}const r=J(e);if(r===N)return N;const s=X(e,!1);if(0===e.at(1).type){const e=ie(i,t);if(e!==N)return{type:2,feature:e,bounds:[null,[r,s]]};const n=ie(s,t);return n!==N?{type:2,feature:n,bounds:[[r,i],null]}:N}const a=J(e);if(a===N||!(te(r)&&te(a)||ee(r)&&ee(a)))return N;const o=X(e,!1),l=ie(s,t);return l!==N?{type:2,feature:l,bounds:[[r,i],[a,o]]}:N}(e,he);if(i===N)return N;const n=de[i.feature];if(null==n)return N;if(t.features.add(n),1===i.type)return{type:5,feature:n};{const e={type:5,feature:n};let t=N;if(null!==i.bounds[0]){const n=ve(i.bounds[0][1]);if(n===N)return N;t={type:4,operator:i.bounds[0][0],left:n,right:e}}if(null!==i.bounds[1]){const n=ve(i.bounds[1][1]);if(n===N)return N;const r={type:4,operator:i.bounds[1][0],left:e,right:n};t=t!==N?{type:2,left:t,right:r}:r}return t}}(w(e.value.value.value),t);if(i!==N)return i}return{type:6,value:{type:1}}}}let De=0;const ke={cqw:T,cqh:L,cqi:b,cqb:E},je=CSS.supports("selector(:where(div))"),xe=":not(.container-query-polyfill)";z(Array.from(A(xe)));const _e=document.createElement("div"),Oe=new Set(["before","after","first-line","first-letter"]);function Pe(e,t){return ae("calc",[{type:17,flag:e.flag,value:e.value},ne("*"),t])}function Re(e){return e.map((e=>{switch(e.type){case 15:return function(e){const t=e.unit,i=ke[t];return null!=i?Pe(e,oe(i)):"cqmin"===t||"cqmax"===t?Pe(e,ae(e.unit.slice(2),[oe(b),{type:6},oe(E)])):e}(e);case 27:return n({},e,{value:Re(e.value)})}return e}))}function ze(e){switch(e.name){case"container":return we(e.value)?n({},e,{name:g}):e;case"container-name":return Ne(w(e.value),!0)?n({},e,{name:m}):e;case"container-type":return null!=Se(w(e.value),!0)?n({},e,{name:y}):e}return n({},e,{value:Re(e.value)})}function Fe(e,t){return n({},e,{value:e.value.map((e=>{switch(e.type){case 25:return Qe(e,t);case 26:return function(e,t){return t.transformStyleRule(n({},e,{value:Be(e.value,t)}))}(e,t);default:return e}}))})}function Ue(e){return 0===e.type||6===e.type}function Ye(e){for(let t=e.length-1;t>=0;t--)if(1!==e[t].type)return e.slice(0,t+1);return e}function Be(e,t){return function(e,t){const i=[];let r=null,s=null;for(const n of e.value.value)switch(n.type){case 25:{const e=t?t(n):n;e&&i.push(e)}break;case 29:{const e=ze(n);switch(e.name){case g:{const e=we(n.value);e!==N&&(r=e[0],s=e[1]);break}case m:{const e=Ne(w(n.value),!0);e!==N&&(r=e);break}case y:{const e=Se(w(n.value),!0);e!==N&&(s=e);break}default:i.push(e)}}}return r&&r.length>0&&i.push(re(m,[se(r.join(" "))])),s&&s.length>0&&i.push(re(y,[se(s.join(" "))])),n({},e,{value:{type:2,value:i}})}(e,(e=>Qe(e,t)))}function $e(e){if(1===e.type)return n({},e,{value:$e(e.value)});if(2===e.type||3===e.type)return n({},e,{left:$e(e.left),right:$e(e.right)});if(4===e.type&&28===e.value.type){const t=function(e){const t=w(e);return U(t),24!==t.at(1).type?N:$(t)||N}(e.value.value.value);if(t!==N)return n({},e,{value:n({},e.value,{value:{type:0,value:[ze(t)]}})})}return e}function Ge(e,t){let i=ce(w(e.prelude));return i=i!==N?$e(i):N,n({},e,{prelude:i!==N?ue(i):e.prelude,value:e.value?n({},e.value,{value:Fe(R(e.value.value.value),t)}):null})}function Qe(e,t){switch(e.name.toLocaleLowerCase()){case"media":case"layer":return function(e,t){return n({},e,{value:e.value?n({},e.value,{value:Fe(R(e.value.value.value),t)}):null})}(e,t);case"keyframes":return function(e,t){let i=null;return e.value&&(i=n({},e.value,{value:{type:3,value:R(e.value.value.value).value.map((e=>{switch(e.type){case 26:return function(e,t){return n({},e,{value:Be(e.value,t)})}(e,t);case 25:return Qe(e,t)}}))}})),n({},e,{value:i})}(e,t);case"supports":return Ge(e,t);case"container":return function(e,t){if(e.value){const i=Ae(e.prelude);if(i!==N){const r={rule:i,selector:null,parent:t.parent,uid:"c"+De++},s=new Set,a=[],o=Fe(R(e.value.value.value),{descriptors:t.descriptors,parent:r,transformStyleRule:e=>{const[t,i]=function(e,t,i){const n=w(e),r=[],s=[];for(;;){if(0===n.at(1).type)return[r,s];const i=Math.max(0,n.index);for(;o=n.at(1),l=n.at(2),!(Ue(o)||7===o.type&&(7===l.type||24===l.type&&Oe.has(l.value.toLowerCase())));)n.consume(1);const c=n.index+1,u=e.slice(i,c),d=u.length>0?Ye(u):[ne("*")];for(;!Ue(n.at(1));)n.consume(1);const h=e.slice(c,Math.max(0,n.index+1));let p=d,f=[{type:28,source:{type:9},value:{type:0,value:[se(h.length>0?v:M),ne("~"),ne("="),{type:2,value:t}]}}];if(je)f=[ne(":"),ae("where",f)];else{const e=d.map(V).join("");e.endsWith(xe)?p=z(Array.from(A(e.substring(0,e.length-xe.length)))):a.push({actual:e,expected:e+xe})}r.push(...d),s.push(...p),s.push(...f),s.push(...h),n.consume(1)}var o,l}(e.prelude,r.uid);if(a.length>0)return e;const o=t.map(V).join("");try{_e.matches(o),s.add(o)}catch(e){}return n({},e,{prelude:i})}}).value;if(a.length>0){const e=new Set,t=[];let i=0;for(const{actual:e}of a)i=Math.max(i,e.length);const n=Array.from({length:i},(()=>" ")).join("");for(const{actual:r,expected:s}of a)e.has(r)||(t.push(`${r}${n.substring(0,i-r.length)} => ${s}`),e.add(r));console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules:\n\n${t.join("\n")}`)}return s.size>0&&(r.selector=Array.from(s).join(", ")),t.descriptors.push(r),{type:25,name:"media",prelude:[se("all")],value:n({},e.value,{value:{type:3,value:o}})}}}return e}(e,t)}return e}class He{constructor(e){this.value=void 0,this.value=e}}function qe(e,t){if(e===t)return!0;if(typeof e==typeof t&&null!==e&&null!==t&&"object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t)||t.length!==e.length)return!1;for(let i=0,n=e.length;i<n;i++)if(!qe(e[i],t[i]))return!1;return!0}if(e instanceof He)return t instanceof He&&e.value===t.value;{const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!1;for(let n=0,r=i.length;n<r;n++){const r=i[n];if(!qe(e[r],t[r]))return!1}return!0}}return!1}const We=Symbol("CQ_INSTANCE"),Ze=Symbol("CQ_STYLESHEET"),Ve=CSS.supports("width: 1svh"),Ke=new Set(["vertical-lr","vertical-rl","sideways-rl","sideways-lr","tb","tb-lr","tb-rl"]),Xe=["padding-left","padding-right","border-left-width","border-right-width"],Je=["padding-top","padding-bottom","border-top-width","border-bottom-width"],et=/(\w*(\s|-))?(table|ruby)(-\w*)?/;class tt{constructor(e){this.node=void 0,this.node=e}connected(){}disconnected(){}updated(){}}class it extends tt{constructor(e,t){super(e),this.context=void 0,this.controller=null,this.styleSheet=null,this.context=t}connected(){var e=this;const t=this.node;if("stylesheet"===t.rel){const i=new URL(t.href,document.baseURI);i.origin===location.origin&&(this.controller=at((async function(n){const r=await fetch(i.toString(),{signal:n}),s=await r.text(),a=e.styleSheet=await e.context.registerStyleSheet({source:s,url:i,signal:n}),o=new Blob([a.source],{type:"text/css"}),l=new Image;l.onload=l.onerror=a.refresh,l.src=t.href=URL.createObjectURL(o)})))}}disconnected(){var e,t;null==(e=this.controller)||e.abort(),this.controller=null,null==(t=this.styleSheet)||t.dispose(),this.styleSheet=null}}class nt extends tt{constructor(e,t){super(e),this.context=void 0,this.controller=null,this.styleSheet=null,this.context=t}connected(){var e=this;this.controller=at((async function(t){const i=e.node,n=e.styleSheet=await e.context.registerStyleSheet({source:i.innerHTML,signal:t});i.innerHTML=n.source,n.refresh()}))}disconnected(){var e,t;null==(e=this.controller)||e.abort(),this.controller=null,null==(t=this.styleSheet)||t.dispose(),this.styleSheet=null}}class rt extends tt{connected(){const e=`* { ${y}: cq-normal; ${m}: cq-none; }`;this.node.innerHTML=void 0===window.CSSLayerBlockRule?e:`@layer cq-polyfill-${f} { ${e} }`}}class st extends tt{constructor(e,t){super(e),this.context=void 0,this.styles=void 0,this.context=t,this.styles=window.getComputedStyle(e)}connected(){this.node.style.cssText="position: fixed; top: 0; left: 0; visibility: hidden; "+(Ve?"width: 1svw; height: 1svh;":"width: 1%; height: 1%;")}updated(){const e=dt((e=>this.styles.getPropertyValue(e)));this.context.viewportChanged({width:e.width,height:e.height})}}function at(e){const t=new AbortController;return e(t.signal).catch((e=>{if(!(e instanceof DOMException&&"AbortError"===e.message))throw e})),t}function ot(e){let t=0;if(0===e.length)return t;if(e.startsWith("cq-")&&("normal"===(e=e.substring("cq-".length))||be(e)))return t;const i=e.split(" ");for(const e of i)switch(e){case"size":t|=3;break;case"inline-size":t|=1;break;default:return 0}return t}function lt(e){let t=0;return"none"!==e&&(t|=1,"contents"===e||"inline"===e||et.test(e)||(t|=2)),t}function ct(e,t){return parseFloat(e(t))}function ut(e,t){return t.reduce(((t,i)=>t+ct(e,i)),0)}function dt(e){let t=0,i=0;return"border-box"===e("box-sizing")&&(t=ut(e,Xe),i=ut(e,Je)),{fontSize:ct(e,"font-size"),width:ct(e,"width")-t,height:ct(e,"height")-i}}function ht(e){return{containerType:ot(e(y).trim()),containerNames:(i=e(m).trim(),i.startsWith("cq-")&&("none"===(i=i.substring("cq-".length))||be(i))?new Set([]):new Set(0===i.length?[]:i.split(" "))),writingAxis:(t=e("writing-mode").trim(),Ke.has(t)?1:0),displayFlags:lt(e("display").trim())};var t,i}function pt(e,t,i){null!=i?i!=e.getPropertyValue(t)&&e.setProperty(t,i):e.removeProperty(t)}function ft(e){const t=e[Ze];return null!=t?t:[]}function gt(e,t){e[Ze]=t}new Promise((e=>{})),window.CQPolyfill={version:"1.0.2"},"container"in document.documentElement.style||function(e){function t(e){return e[We]||null}const i=document.documentElement;if(t(i))return;const s=document.createElement(`cq-polyfill-${f}`),a=document.createElement("style");new MutationObserver((e=>{for(const i of e){for(const e of i.removedNodes){const i=t(e);null==i||i.disconnect()}i.target.nodeType!==Node.DOCUMENT_NODE&&i.target.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&null===i.target.parentNode||"attributes"===i.type&&i.attributeName&&(i.attributeName===v||i.attributeName===M||i.target instanceof Element&&i.target.getAttribute(i.attributeName)===i.oldValue)||(S(i.target).mutate(),g())}})).observe(i,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0});const o=new ResizeObserver((e=>{for(const t of e)S(t.target).resize();S(i).update(I())})),l=new tt(i);async function c(e,{source:t,url:n,signal:r}){const s=function(e,t){try{const i=Array.from(A(e));if(t)for(let e=0;e<i.length;e++){const n=i[e];if(20===n.type)n.value=new URL(n.value,t).toString();else if(23===n.type&&"url"===n.value.toLowerCase()){const n=e+1<i.length?i[e+1]:null;n&&2===n.type&&(n.value=new URL(n.value,t).toString())}}const n={descriptors:[],parent:null,transformStyleRule:e=>e};return{source:Z(Fe(R(i,!0),n)),descriptors:n.descriptors}}catch(t){return console.warn("An error occurred while transpiling stylesheet: "+t),{source:e,descriptors:[]}}}(t,n?n.toString():void 0);let a=()=>{},o=()=>{};const l=S(i);let c=!1;return null!=r&&r.aborted||(o=()=>{if(!c){const{sheet:t}=e;null!=t&&(gt(t,s.descriptors),c=!0,a=()=>{gt(t),l.mutate(),g()},l.mutate(),g())}}),{source:s.source,dispose:a,refresh:o}}const u={cqw:null,cqh:null};function d({width:e,height:t}){u.cqw=e,u.cqh=t}function p(e,t,i){if(e instanceof Element&&t){let n="";for(const[i,r]of t.conditions){const t=i.value;null!=t.selector&&null!=r&&2==(2&r)&&e.matches(t.selector)&&(n.length>0&&(n+=" "),n+=t.uid)}n.length>0?e.setAttribute(i,n):e.removeAttribute(i)}}function g(){o.unobserve(i),o.observe(i)}const y=()=>{const e=[];for(const t of document.styleSheets)for(const i of ft(t))e.push([new He(i),0]);return e},m=window.getComputedStyle(i),I=()=>{const e=e=>m.getPropertyValue(e),t=ht(e),i=dt(e);return{parentState:null,conditions:y(),context:n({},u,{fontSize:i.fontSize,rootFontSize:i.fontSize,writingAxis:t.writingAxis}),displayFlags:t.displayFlags,isQueryContainer:!1}},N=e=>e;function S(e){let u=t(e);if(!u){let f,g=null,y=!1;e===i?(f=l,g=N):e===s?(y=!0,f=new st(s,{viewportChanged:d})):f=e===a?new rt(a):e instanceof HTMLLinkElement?new it(e,{registerStyleSheet:t=>c(e,n({},t))}):e instanceof HTMLStyleElement?new nt(e,{registerStyleSheet:t=>c(e,n({},t))}):new tt(e);let m=Symbol();if(null==g&&e instanceof Element){const t=function(e){const t=window.getComputedStyle(e);return function(e){let i=null;return(...e)=>{if(null==i||!qe(i[0],e)){const s=((e,i)=>{const{context:s,conditions:a}=e,o=e=>t.getPropertyValue(e),l=ht(o),c=n({},s,{writingAxis:l.writingAxis});let u=a,d=!1,p=l.displayFlags;0==(1&e.displayFlags)&&(p=0);const{containerType:f,containerNames:g}=l;if(f>0){const e=f>0&&2==(2&p),t=new Map(a.map((e=>[e[0].value,e[1]])));if(u=[],d=!0,e){const e=dt(o);c.fontSize=e.fontSize;const i=function(e,t){const i={value:t.width},n={value:t.height};let r=i,s=n;if(1===e.writingAxis){const e=r;r=s,s=e}return 2!=(2&e.containerType)&&(s.value=void 0),{width:i.value,height:n.value,inlineSize:r.value,blockSize:s.value}}(l,e),n={sizeFeatures:i,treeContext:c},d=e=>{const{rule:i}=e,s=i.name,a=null==s||g.has(s)?function(e,t){const i=new Map,n=t.sizeFeatures;for(const t of e.features){const e=r(t,n);if(1===e.type)return null;i.set(t,e)}const s=h(e.condition,{sizeFeatures:i,treeContext:t.treeContext});return 5===s.type?s.value:null}(i,n):null;var o;return null==a?1===((null!=(o=t.get(e))?o:0)&&1):!0===a},p=(e,t)=>{let i=e.get(t);if(null==i){const n=d(t);i=(n?1:0)|(!0!==n||null!=t.parent&&1!=(1&p(e,t.parent))?0:2),e.set(t,i)}return i},f=new Map;for(const e of a)u.push([e[0],p(f,e[0].value)]);c.cqw=null!=i.width?i.width/100:s.cqw,c.cqh=null!=i.height?i.height/100:s.cqh}}return{parentState:new He(e),conditions:u,context:c,displayFlags:p,isQueryContainer:d}})(...e);null!=i&&qe(i[1],s)||(i=[e,s])}return i[1]}}()}(e);g=e=>t(e,m)}const I=g||N;let w=null;const A=e=>{const t=w,i=I(e);return w=i,[w,w!==t]},C=e instanceof HTMLElement||e instanceof SVGElement?e.style:null;let D=!1;u={connect(){for(let t=e.firstChild;null!=t;t=t.nextSibling)S(t);f.connected()},disconnect(){e instanceof Element&&(o.unobserve(e),e.removeAttribute(v),e.removeAttribute(M)),C&&(C.removeProperty(b),C.removeProperty(E),C.removeProperty(T),C.removeProperty(L));for(let i=e.firstChild;null!=i;i=i.nextSibling){const e=t(i);null==e||e.disconnect()}f.disconnected(),delete e[We]},update(t){const[i,n]=A(t);if(n){if(p(e,t,M),p(e,i,v),e instanceof Element){const t=y||i.isQueryContainer;t&&!D?(o.observe(e),D=!0):!t&&D&&(o.unobserve(e),D=!1)}if(C){const e=i.context,n=e.writingAxis;let r=null,s=null,a=null,o=null;(n!==t.context.writingAxis||i.isQueryContainer)&&(r=`var(${0===n?T:L})`,s=`var(${1===n?T:L})`),t&&!i.isQueryContainer||(e.cqw&&(a=e.cqw+"px"),e.cqh&&(o=e.cqh+"px")),pt(C,b,r),pt(C,E,s),pt(C,T,a),pt(C,L,o)}f.updated()}for(let t=e.firstChild;null!=t;t=t.nextSibling)S(t).update(i)},resize(){m=Symbol()},mutate(){m=Symbol();for(let t=e.firstChild;null!=t;t=t.nextSibling)S(t).mutate()}},e[We]=u,u.connect()}return u}i.prepend(a,s),S(i),g()}()}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},getProto=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);__webpack_require__.r(i);var n={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&t&&e;"object"==typeof r&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,__webpack_require__.d(i,n),i},__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";function e(e,t,i,n,r,s,a){try{var o=e[s](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(n,r)}function t(t){return function(){var i=this,n=arguments;return new Promise((function(r,s){var a=t.apply(i,n);function o(t){e(a,r,s,o,l,"next",t)}function l(t){e(a,r,s,o,l,"throw",t)}o(void 0)}))}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var a=__webpack_require__(4687),o=__webpack_require__.n(a);function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){if(t&&("object"===d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}var f,g=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"chapters",void 0),s(this,"firstChapter",void 0),s(this,"lastChapter",void 0),s(this,"currentTime",void 0),this.chapters=t,this.setupInitChapter()}return r(e,[{key:"setupInitChapter",value:function(){0!==this.chapters.length&&(this.lastChapter=this.chapters[this.chapters.length-1],this.firstChapter=this.chapters[0])}},{key:"updateCurrentTimeAndTitle",value:function(e,t){this.player=e;var i=t.detail.plyr;if(i.id===e.plyr.id){e.playerControl.chaptersService.currentTime=i.currentTime,e.plyr.paused&&(e.playerControl.chaptersService.currentTime+=.1);var n=e.playerControl.chaptersService.findChapter(e.playerControl.chaptersService.currentTime,e.playerControl.chaptersService.chapters);void 0!==n&&(e.playerControl.chaptersService.setChapterPreviousNext(n[2],n[0]),e.playerControl.chaptersService.setButtonsChapterTime(n[0],n[2]))}}},{key:"setButtonsEvents",value:function(e){this.player=e;var t=e.plyr,i=e.plyr.elements.controls,n=i.querySelector(".skip-backward"),r=i.querySelector(".skip-forward");n.addEventListener("click",(function(e){e.preventDefault(),"false"!==n.dataset.ltPlayerChaptertimestamp&&n.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(n.dataset.ltPlayerChaptertimestamp)+.1)})),r.addEventListener("click",(function(i){if(i.preventDefault(),e.playerControl.chaptersService.currentTime>e.playerControl.chaptersService.lastChapter.timestamp){t.stop();var n=t.elements.container,s=n.querySelector(".lt-player__poster"),a=n.querySelector(".plyr__controls");return n.classList.add("plyr--stopped"),s.classList.remove("d-none"),void a.classList.add("d-none")}r.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(r.dataset.ltPlayerChaptertimestamp)+.1)}))}},{key:"setMobileButtonEvents",value:function(e){this.player=e;var t=e.plyr,i=e.plyr.elements.controls,n=i.querySelector(".skip-backward"),r=i.querySelector(".skip-forward");if(n){var s=e.eventInstance.mobileEvents.setMobileEvent(n);s&&s.on("singletap",(function(i){i.preventDefault(),"false"!==n.dataset.ltPlayerChaptertimestamp&&(n.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(n.dataset.ltPlayerChaptertimestamp)+.1),e.playerControl.mobileEvents.showControls(e))}))}if(r){var a=e.eventInstance.mobileEvents.setMobileEvent(r);a&&a.on("singletap",(function(i){if(i.preventDefault(),e.playerControl.chaptersService.currentTime>e.playerControl.chaptersService.lastChapter.timestamp){t.stop();var n=t.elements.container,s=n.querySelector(".lt-player__poster"),a=n.querySelector(".plyr__controls");return n.classList.add("plyr--stopped"),s.classList.remove("d-none"),void a.classList.add("d-none")}r.dataset.ltPlayerChaptertimestamp&&(t.currentTime=parseFloat(r.dataset.ltPlayerChaptertimestamp)+.1),e.playerControl.mobileEvents.showControls(e)}))}}},{key:"setButtonsChapterTime",value:function(e,t){var i=this.player.plyr.elements.controls,n=i.querySelector(".skip-backward");n.dataset.ltPlayerChaptertimestamp=String(!1),null!==e&&null!=e&&(n.dataset.ltPlayerChaptertimestamp=e.timestamp);var r=i.querySelector(".skip-forward");null!==t&&null!=t&&(r.dataset.ltPlayerChaptertimestamp=t.timestamp)}},{key:"setChapterPreviousNext",value:function(e,t){var i=this.player.plyr.elements.controls,n=i.querySelector(".bottom-controller__previous-chapter-view"),r=i.querySelector(".bottom-controller__next-chapter-view");r&&(r.innerHTML="",e&&(r.innerHTML=e.name)),n&&(n.innerHTML="",t&&(n.innerHTML=t.name))}},{key:"setTitleChapterName",value:function(e){this.player.plyr.elements.controls.querySelector(".top-controllers__body__center").getElementsByTagName("p")[0].innerHTML=e?e.name:""}},{key:"findChapter",value:function(e,t){if(null!=e&&0!=t.length){for(var i,n=null,r=function(e,t){return null===t?null:e[t-2]||null},s=function(e,t){return null===t?null:e[t-1]||null},a=0;a<t.length;a+=1){var o=t[a];if(o.timestamp>=e)return n=o,i=s(t,a),[r(t,a),i,n]}return i=t[t.length-1],[t[t.length-2],i,n]}}}]),e}(),y=function(){function e(t){i(this,e),s(this,"instance",void 0),this.instance=t}return r(e,[{key:"addSettingsTemplate",value:function(e){var t,i=this.instance.templateService.getSettings((s(t={id:this.instance.playerConfig.getPlayerId()},e,!0),s(t,"captions_enabled",this.instance.playerConfig.getCaptionsEnabled()&&this.instance.playerConfig.hasCaptionsUrl()),s(t,"captions_missing",!this.instance.playerConfig.hasCaptionsUrl()),t)),n=this.instance.plyr.elements.controls.lastElementChild;n&&n.insertAdjacentHTML("afterend",i)}},{key:"openSettings",value:function(){this.getSelectors().playerControlsContainer.classList.contains("plyr__controls-enable-settings")||this.getSelectors().playerControlsContainer.classList.add("plyr__controls-enable-settings"),this.getSelectors().settingsContainer.classList.contains("settings-controllers-enable")||(this.getSelectors().settingsContainer.classList.add("settings-controllers-enable"),this.getSelectors().background.classList.contains("d-none")&&this.getSelectors().background.classList.remove("d-none"))}},{key:"getSelectors",value:function(){return{playerControlsContainer:this.instance.plyr.elements.controls,settingsContainer:this.instance.plyr.elements.controls.querySelector(".settings-controllers"),background:this.instance.plyr.elements.controls.querySelector(".settings-controllers-enable__background"),button:this.instance.plyr.elements.controls.querySelector(".plyr__controls_settings-button"),saveButton:this.instance.plyr.elements.controls.querySelector(".button-save"),playerContainer:this.instance.plyr.elements.container}}},{key:"closeSettings",value:function(){if(this.getSelectors().playerControlsContainer.querySelector(".settings-controllers").classList.contains("settings-controllers-enable")){var e=this.getSelectors().playerControlsContainer.querySelector(".settings-controllers");this.getSelectors().playerControlsContainer.classList.remove("plyr__controls-enable-settings"),e.classList.remove("settings-controllers-enable");var t=this.getSelectors().playerContainer.querySelector(".settings-controllers-enable__background");t.classList.contains("d-none")||t.classList.add("d-none")}}}]),e}(),m=function(){function e(t){i(this,e),s(this,"settingsInstance",void 0),this.settingsInstance=t,this.init()}return r(e,[{key:"init",value:function(){this.addOpenSettingsEventButton(),this.setButtonSpeed(),this.createModal()}},{key:"addOpenSettingsEventButton",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_settings-button"),t=this;if(e){var i=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(e);i&&i.on("singletap",(function(){t.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(t.settingsInstance.playerInstance),t.initCaptionsEvent(),t.initSpeedVideoEvent(),t.initSaveButton(),t.showModal(),setTimeout((function(){t.setInactiveTouchModal()}),100)}))}}},{key:"hideModal",value:function(){document.body.removeAttribute("modal-open-body"),this.getModal().close()}},{key:"showModal",value:function(){document.body.setAttribute("modal-open-body",""),this.getModal().showModal()}},{key:"setInactiveTouchModal",value:function(){var e=this.getModal(),t=e.querySelector(".settings-controllers-enable__background"),i=e.querySelector(".settings-controllers-header"),n=this;if(t){var r=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(t);r&&r.on("singletap",(function(e){n.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(n.settingsInstance.playerInstance),e.preventDefault()}))}if(i){var s=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(i);s&&s.on("pan",(function(e){n.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(n.settingsInstance.playerInstance),e.preventDefault(),e.target,n.hideModal()}))}}},{key:"getModal",value:function(){return this.settingsInstance.playerInstance.playerConfig.getPlayerElementContainer().querySelector("dialog")}},{key:"createModal",value:function(){var e=this,t=this.settingsInstance.playerInstance.templateService.getMobileSettings({id:this.settingsInstance.playerInstance.playerConfig.getPlayerId(),captions_enabled:this.settingsInstance.playerInstance.playerConfig.hasCaptionsUrl()&&this.settingsInstance.playerInstance.playerConfig.getCaptionsEnabled(),captions_missing:!this.settingsInstance.playerInstance.playerConfig.hasCaptionsUrl()});this.settingsInstance.playerInstance.playerConfig.getPlayerElementContainer().insertAdjacentHTML("beforeend",t);var i=this.getModal();i.addEventListener("click",(function(t){t.target===i&&e.hideModal()}))}},{key:"initCaptionsEvent",value:function(){var e=this,t=this.getModal().querySelector(".subtitles-body__input-switch"),i=this;t&&t.addEventListener("change",(function(){i.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(i.settingsInstance.playerInstance),t.checked?e.settingsInstance.playerInstance.captionsService.enableCaptions():e.settingsInstance.playerInstance.captionsService.disableCaptions()}))}},{key:"initSpeedVideoEvent",value:function(){var e=this.getModal(),t=this.settingsInstance.playerInstance,i=this.settingsInstance.player,n=e.querySelector(".speed-range-input"),r=e.querySelector("#speed-range-".concat(t.playerConfig.getPlayerId()));r.value=String(0);var s=e.querySelector("#speed-range-value-".concat(t.playerConfig.getPlayerId()));s.style.top="-20px";var a=[1,1.25,1.5,2],o=this;r.oninput=function(){o.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(o.settingsInstance.playerInstance),i.speed=parseFloat(a[n.value]),s.innerHTML="".concat(a[n.value],"X")},i.speed=parseFloat(String(a[0])),s.innerHTML="".concat(a[0],"X")}},{key:"initSaveButton",value:function(){var e=this.getModal(),t=this;e.querySelector(".button-save").addEventListener("click",(function(e){t.settingsInstance.playerInstance.playerControl.mobileEvents.showControls(t.settingsInstance.playerInstance),e.preventDefault(),t.hideModal()}))}},{key:"setButtonSpeed",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_speed-button"),t=this.settingsInstance.playerInstance.plyr,i=this.settingsInstance.playerInstance;if(e){var n=document.createElement("span");e.appendChild(n),n.innerHTML="1X",n.className="",n.classList.add("playback-speed--1X");var r=this.settingsInstance.playerInstance.eventInstance.mobileEvents.setMobileEvent(e);r&&r.on("singletap",(function(){var e=t.speed+.25;if(e>2)return n.innerHTML="1X",t.speed=1,n.className="",void n.classList.add("playback-speed--1X");if(1.75===e)return t.speed=e+.25,n.innerHTML="2X",n.className="",void n.classList.add("playback-speed--2X");t.speed=e;var r=Math.floor(10*e)/10;n.innerHTML=r+"X",n.className="",n.classList.add("playback-speed--"+e+"X"),i.playerControl.mobileEvents.showControls(i)}))}}}]),e}(),v=function(){function e(){i(this,e),localStorage.getItem("lt-player")||this.createStorage()}return r(e,[{key:"createStorage",value:function(){localStorage.setItem("lt-player",JSON.stringify({speed:1,volume:1,muted:!1}))}},{key:"setSettings",value:function(e){localStorage.setItem("lt-player",JSON.stringify(e))}},{key:"getSettings",value:function(){return JSON.parse(localStorage.getItem("lt-player"))}},{key:"getSpeed",value:function(){var e=JSON.parse(localStorage.getItem("lt-player"));return e?e.speed:1}},{key:"setSpeed",value:function(e){var t=JSON.parse(localStorage.getItem("lt-player"))||{};t.speed=e,localStorage.setItem("lt-player",JSON.stringify(t))}},{key:"getVolume",value:function(){var e=JSON.parse(localStorage.getItem("lt-player"));return e?e.volume:1}},{key:"setVolume",value:function(e){var t=JSON.parse(localStorage.getItem("lt-player"))||{};t.volume=e,localStorage.setItem("lt-player",JSON.stringify(t))}},{key:"getMutedState",value:function(){var e=JSON.parse(localStorage.getItem("lt-player"));return!!e&&e.muted}},{key:"setMutedState",value:function(e){var t=JSON.parse(localStorage.getItem("lt-player"))||{};t.muted=e,localStorage.setItem("lt-player",JSON.stringify(t))}}]),e}(),M=function(){function e(t){i(this,e),s(this,"settingsInstance",void 0),this.settingsInstance=t,this.init()}return r(e,[{key:"init",value:function(){this.setButtonSpeed(),this.settingsInstance.common.addSettingsTemplate(this.settingsInstance.playerInstance.playerConfig.getDevice()),this.addOpenSettingsEventButton(),this.initCaptionsEvent(),this.initSpeedVideoEvent(),this.initSaveButton()}},{key:"addOpenSettingsEventButton",value:function(){var e=this,t=this.settingsInstance.common.getSelectors();t.button&&t.button.addEventListener("click",(function(t){t.preventDefault(),e.settingsInstance.common.openSettings()}))}},{key:"initCaptionsEvent",value:function(){var e=this,t=this.settingsInstance.common.getSelectors().playerControlsContainer.querySelector(".subtitles-body__input-switch");t&&t.addEventListener("change",(function(){t.checked?e.settingsInstance.playerInstance.captionsService.enableCaptions():e.settingsInstance.playerInstance.captionsService.disableCaptions()}))}},{key:"initSpeedVideoEvent",value:function(){var e=this.settingsInstance.playerInstance,t=this.settingsInstance.player.elements.controls,i=this.settingsInstance.player,n=t.querySelector(".speed-range-input"),r=t.querySelector("#speed-range-".concat(e.playerConfig.getPlayerId()));r.value=String(0);var s=t.querySelector("#speed-range-value-".concat(e.playerConfig.getPlayerId()));s.style.top="-20px";var a=[1,1.25,1.5,2];r.oninput=function(){i.speed=parseFloat(a[n.value]),s.innerHTML="".concat(a[n.value],"X")},i.speed=parseFloat(String(a[0])),s.innerHTML="".concat(a[0],"X")}},{key:"initSaveButton",value:function(){var e=this.settingsInstance.common.getSelectors(),t=this;e.playerControlsContainer.querySelector(".button-save").addEventListener("click",(function(e){e.preventDefault(),t.settingsInstance.common.closeSettings()}))}},{key:"setButtonSpeed",value:function(){var e=this.settingsInstance.playerInstance.plyr.elements.controls.querySelector(".plyr__controls_speed-button"),t=this.settingsInstance.playerInstance.plyr,i=this.settingsInstance.playerInstance;if(new v,e){var n=document.createElement("span");e.appendChild(n);var r=Math.floor(10*t.speed)/10;n.innerHTML=r+"X",n.className="",n.classList.add("playback-speed--"+t.speed+"X"),e.addEventListener("click",(function(e){var r=t.speed+.25;if(r>2)return n.innerHTML="1X",t.speed=1,n.className="",void n.classList.add("playback-speed--1X");if(1.75===r)return t.speed=r+.25,n.innerHTML="2X",n.className="",void n.classList.add("playback-speed--2X");t.speed=r;var s=Math.floor(10*r)/10;n.innerHTML=s+"X",n.className="",console.log(r.toPrecision(2)),n.classList.add("playback-speed--"+r+"X"),i.playerControl.mobileEvents.showControls(i)}))}}}]),e}(),T=function(){function e(){i(this,e),s(this,"playerInstance",void 0),s(this,"player",void 0),s(this,"templateService",void 0),s(this,"playerID",void 0),s(this,"common",void 0),s(this,"mobile",void 0),s(this,"desktop",void 0)}return r(e,[{key:"init",value:function(e){this.playerInstance=e,this.player=e.plyr,this.templateService=e.templateService,this.common=new y(e);var t=this.player;this.playerID=t.id,"mobile"===e.playerConfig.getDevice()?this.mobile=new m(this):this.desktop=new M(this)}}],[{key:"closeSettingsEvent",value:function(e){var t=document.querySelectorAll(".plyr__controls");0!==t.length&&t.forEach((function(t){if(t.classList.contains("plyr__controls-enable-settings")){var i=t.querySelector(".settings-controllers");if(!e.target.classList.contains("settings")&&i.classList.contains("settings-controllers-enable")){var n=t.querySelector(".settings-controllers");t.classList.remove("plyr__controls-enable-settings"),n.classList.remove("settings-controllers-enable");var r=t.querySelector(".settings-controllers-enable__background");r.classList.contains("d-none")||r.classList.add("d-none")}}}))}}]),e}();!function(e){var t=function(){function e(){i(this,e),s(this,"backwardRewind",{getSelectors:function(e){var t={playerContainer:e.plyr.elements.container,playerControlsContainer:e.plyr.elements.controls,forwardArea:e.plyr.elements.controls.querySelector(".lt-player-forward-area"),rewindArea:e.plyr.elements.controls.querySelector(".lt-player-rewind-area"),forwardAnimation:e.plyr.elements.controls.querySelector(".lt-player-forward"),rewindAnimation:e.plyr.elements.controls.querySelector(".lt-player-rewind"),forwardAreaBackground:null,rewindAreaBackground:null,forwardAnimationBackground:null,rewindAnimationBackground:null};return"mobile"===e.playerConfig.getDevice()&&(t.forwardAreaBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-forward-area"),t.rewindAreaBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-rewind-area"),t.forwardAnimationBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-forward"),t.rewindAnimationBackground=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background").querySelector(".lt-player-rewind")),t},updateCurrentTime:function(e,t){Math.sign(t)?e.plyr.currentTime+=t:e.plyr.currentTime-=t},playPause:function(e){var t=e.iconService.getIconsByComponent("playPause"),i=e.plyr.elements.controls.querySelector(".player-state"),n=i.querySelector(".player-state__icon"),r=function(){setTimeout((function(){i.classList.remove("active")}),200)};e.plyr.playing?(n.src=t.pause,i.classList.add("active"),e.plyr.togglePlay(!1),r()):(n.src=t.play,i.classList.add("active"),e.plyr.togglePlay(!0),r())},animateNotificationIn:function(e){e.classList.add("animate-in")},animateNotificationOut:function(e){e.classList.remove("animate-in")}})}return r(e,[{key:"checkTitleBreakWord",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".poster-paragraph__content"),n=t.querySelector(".poster-paragraph__button");if(i)if(i.scrollHeight<=i.clientHeight)n.classList.add("d-none");else{var r=i.scrollHeight,s=function(){var e=i;i.classList.contains("open-content")?(e.style.maxHeight=null,setTimeout((function(){i.classList.remove("open-content")}),300),n.innerHTML="Read more"):(n.innerHTML="Hide",e.style.maxHeight="".concat(r,"px"),i.classList.add("open-content"))};n&&("mobile"===e.playerConfig.getDevice()?e.eventInstance.mobileEvents.setMobileEvent(n).on("singletap",(function(){s(),e.playerControl.mobileEvents.showControls(e)})):n.addEventListener("click",(function(){s()})))}}},{key:"playPauseIconTimeUpdate",value:function(e){var t=e.plyr,i=t.elements.container,n=i.querySelector(".bottom-controller__play-icon"),r=i.querySelector(".bottom-controller__pause-icon");t.isEmbed?t.embed.getPaused().then((function(e){e?(r.classList.add("d-none"),n.classList.remove("d-none")):(n.classList.add("d-none"),r.classList.remove("d-none"))})):t.playing?(n.classList.add("d-none"),r.classList.remove("d-none")):(r.classList.add("d-none"),n.classList.remove("d-none"))}},{key:"subtitlesShow",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,n=t.querySelector(".plyr__captions");e.plyr.captions.active&&n&&(i.classList.contains("plyr__controls-enable")||n.classList.contains("d-none")&&n.classList.remove("d-none"))}},{key:"subtitlesHide",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,n=t.querySelector(".plyr__captions");e.plyr.captions.active&&n&&i.classList.contains("plyr__controls-enable")&&(n.classList.contains("d-none")||n.classList.add("d-none"))}},{key:"showHideText",value:function(e,t){var i=t.querySelector(".lt-player-video-content");i&&(e?i.classList.contains("lt-player-video-content-enable")||i.classList.add("lt-player-video-content-enable"):i.classList.remove("lt-player-video-content-enable"))}},{key:"showHideSeekBar",value:function(e,t){var i=t.querySelector(".plyr__progress--wrapper");i&&(e?i.classList.contains("plyr__progress--wrapper-enable")||i.classList.add("plyr__progress--wrapper-enable"):i.classList.remove("plyr__progress--wrapper-enable"))}},{key:"showHideBottomControls",value:function(e,t){var i=t.querySelector(".bottom-controller");i&&(e?i.classList.contains("bottom-controller-enable")||i.classList.add("bottom-controller-enable"):i.classList.remove("bottom-controller-enable"))}},{key:"showHideAllControls",value:function(e,t){this.showHideText(e,t),this.showHideSeekBar(e,t),this.showHideBottomControls(e,t)}}]),e}();e.Common=t;var n=function(){function e(){i(this,e),s(this,"common",void 0),this.common=new t}return r(e,[{key:"titleLineBreak",value:function(e){}},{key:"showHide",value:function(e){var t=e.plyr.elements.controls,i=this.common;t.classList.add("plyr__controls-enable"),e.statusFeedbackService.setControlsVisible(),i.showHideText(!0,t),i.showHideSeekBar(!0,t),i.showHideBottomControls(!0,t);var n=null,r=null,s=null;t.addEventListener("mouseover",(function(){n&&clearTimeout(n),r&&clearTimeout(r),s&&clearTimeout(s),e.plyr.paused?i.showHideAllControls(!0,t):(e.playerConfig.isPinTextControls()||i.showHideText(!0,t),e.playerConfig.isPinSeekBarControls()||i.showHideSeekBar(!0,t),e.playerConfig.isPinBottomControls()||i.showHideBottomControls(!0,t))})),t.addEventListener("mouseleave",(function(){e.plyr.paused?i.showHideAllControls(!0,t):(e.playerConfig.isPinTextControls()||(n=setTimeout((function(){i.showHideText(!1,t)}),5e3)),e.playerConfig.isPinSeekBarControls()||(r=setTimeout((function(){i.showHideSeekBar(!1,t)}),5e3)),e.playerConfig.isPinBottomControls()||(s=setTimeout((function(){e.statusFeedbackService.clearControlsVisible(),i.showHideBottomControls(!1,t)}),5e3)))}))}},{key:"fullScreenButtons",value:function(e){var t=e.plyr.elements.controls.querySelector(".fullscreen-custom-control");t&&t.addEventListener("click",(function(t){t.preventDefault(),e.plyr.fullscreen.toggle()}))}},{key:"fullscreenIcon",value:function(e,t){var i=e.plyr.elements.controls,n=i.querySelector(".fullscreen-custom-control");switch(t){case"enterfullscreen":n.querySelector(".maximize").classList.add("d-none"),n.querySelector(".minimize").classList.remove("d-none"),i.classList.add("progress-width-mobile");break;case"exitfullscreen":n.querySelector(".maximize").classList.remove("d-none"),n.querySelector(".minimize").classList.add("d-none"),i.classList.remove("progress-width-mobile")}}},{key:"playPauseIcon",value:function(e,t){var i=this.common;switch(t){case"timeupdate":this.common.playPauseIconTimeUpdate(e);break;case"ready":var n=e.plyr.elements.controls.querySelector(".play-button");n&&n.addEventListener("click",(function(){e.plyr.playing?e.plyr.togglePlay(!1):e.plyr.togglePlay(!0),i.playPauseIconTimeUpdate(e)}))}}},{key:"backwardForward",value:function(e){var t=this.common,i=t.backwardRewind.getSelectors(e);i.forwardArea&&(i.forwardArea.addEventListener("dblclick",(function(n){n.preventDefault();var r=i.playerControlsContainer.querySelector(".lt-player-notification__notification-button-state");r&&!r.classList.contains("d-none")&&r.classList.add("d-none"),t.backwardRewind.animateNotificationIn(i.forwardAnimation),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimation),r.classList.remove("d-none")}),500)})),i.forwardArea.addEventListener("click",(function(n){n.preventDefault(),setTimeout((function(){var n=i.playerControlsContainer.querySelector(".bottom-controller__volume_control");n&&(n.classList.contains("volume-control-enable")||t.backwardRewind.playPause(e))}),100)}))),i.rewindArea&&(i.rewindArea.addEventListener("dblclick",(function(n){n.preventDefault();var r=i.playerControlsContainer.querySelector(".lt-player-notification__notification-button-state");r&&!r.classList.contains("d-none")&&r.classList.add("d-none"),t.backwardRewind.animateNotificationIn(i.rewindAnimation),t.backwardRewind.updateCurrentTime(e,-10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimation),r.classList.remove("d-none")}),500)})),i.rewindArea.addEventListener("click",(function(n){n.preventDefault(),setTimeout((function(){var n=i.playerControlsContainer.querySelector(".bottom-controller__volume_control");n&&(n.classList.contains("volume-control-enable")||t.backwardRewind.playPause(e))}),100)})))}},{key:"backwardForwardSeconds",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".skip-forward-seconds"),n=t.querySelector(".skip-backward-seconds");i&&i.addEventListener("click",(function(t){t.preventDefault(),e.plyr.currentTime+=10})),n&&n.addEventListener("click",(function(t){t.preventDefault(),e.plyr.currentTime-=10}))}},{key:"volume",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".bottom-controller__volume_control"),n=t.querySelector(".volume_control__volume-button"),r=t.querySelector(".volume_control__volume-button-close"),s=t.querySelector(".volume_control__background__area"),a=t.querySelector(".volume_control__background"),o=t.querySelector(".volume_control__background__area__range"),l=i.querySelectorAll(".volume-max, .volume-75, .volume-50, .volume-mute");n.addEventListener("mouseover",(function(e){s.classList.remove("d-none"),a.classList.remove("d-none"),n.classList.add("d-none"),i.classList.add("volume-control-enable"),i.classList.add("volume-area-open")})),i.addEventListener("mouseleave",(function(){s.classList.add("d-none"),a.classList.add("d-none"),n.classList.remove("d-none"),i.classList.remove("volume-control-enable")})),r.addEventListener("click",(function(t){return t.preventDefault(),e.plyr.volume>0?(e.playerControl.playerVolumeBefore=e.plyr.volume,e.plyr.volume=0,void c(0)):e.playerControl.playerVolumeBefore?(e.plyr.volume=e.playerControl.playerVolumeBefore,void c(e.playerControl.playerVolumeBefore)):(e.plyr.volume=1,void c(1))}));var c=function(e){"number"==typeof e&&(e=e.toString());var i=r.querySelector(".volume-max"),n=r.querySelector(".volume-75"),s=r.querySelector(".volume-50"),a=r.querySelector(".volume-mute"),o=t.querySelector(".bottom-controller__volume_control"),l=function(e){o.querySelectorAll(".volume-max, .volume-75, .volume-50, .volume-mute").forEach((function(t){e.dataset.rangeValue===t.dataset.rangeValue?t.classList.remove("d-none"):t.classList.add("d-none")}))};switch(e){case i.dataset.rangeValue:l(i);break;case n.dataset.rangeValue:l(n);break;case s.dataset.rangeValue:l(s);break;case a.dataset.rangeValue:l(a)}};o.addEventListener("input",(function(){var e=[];if(l.forEach((function(t){e.push(t.dataset.rangeValue)})),0!==e.length){var t=e.reduce((function(e,t){return function(e,t,i){return Math.abs(e-i)<Math.abs(t-i)?e:t}(t,e,o.value)}));c(t)}})),e.plyr.volume=1,c(e.plyr.volume)}}]),e}();e.Desktop=n;var a=function(){function e(){i(this,e),s(this,"common",void 0),s(this,"controlsTimeOut",void 0),this.common=new t}return r(e,[{key:"seekBar",value:function(e){var t=e.plyr.elements.controls.querySelector(".plyr__progress__seek");__webpack_require__(4096).setup(t);var i=this;t.addEventListener("change",(function(){i.showControls(e)}))}},{key:"controlsTimeShow",value:function(e){var t=e.plyr.elements.container.querySelector(".plyr__controls__mobile-background"),i=this;if(t){var n=e.eventInstance.mobileEvents.setMobileEvent(t);n&&n.on("singletap",(function(){i.showControls(e)}))}}},{key:"removePlyrControlsClass",value:function(e){var t=e.plyr.elements.container;e.plyr.elements.controls.classList.contains("plyr__controls-enable")&&t.classList.remove("plyr--hide-controls")}},{key:"showControls",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,n=this.common,r=t.querySelector(".plyr__controls__mobile-background");e.statusFeedbackService.setControlsVisible(),t.classList.contains("plyr--hide-controls")&&t.classList.remove("plyr--hide-controls"),r&&(r.classList.contains("d-none")||r.classList.add("d-none")),i.classList.contains("plyr__controls-enable")||i.classList.add("plyr__controls-enable"),this.common.subtitlesHide(e),this.controlsTimeOut&&clearTimeout(this.controlsTimeOut),n.showHideText(!0,i),n.showHideSeekBar(!0,i),n.showHideBottomControls(!0,i),e.plyr.paused?n.showHideAllControls(!0,i):this.hideControls(e,!1)}},{key:"hideControls",value:function(e,t){var i=e.plyr.elements.container,n=e.plyr.elements.controls,r=this.common,s=i.querySelector(".plyr__controls__mobile-background"),a=function(){e.statusFeedbackService.clearControlsVisible(),e.playerConfig.isPinTextControls()||r.showHideText(!1,n),e.playerConfig.isPinSeekBarControls()||r.showHideSeekBar(!1,n),e.playerConfig.isPinBottomControls()||r.showHideBottomControls(!1,n)};if(!n.classList.contains("plyr__controls-enable-addInfo")){if(t){if(e.plyr.paused)return void r.showHideAllControls(!0,n);a(),n.classList.contains("player-lt__modal__mobile-show-modal")||s.classList.remove("d-none")}else this.controlsTimeOut=setTimeout((function(){e.plyr.paused?r.showHideAllControls(!0,n):(a(),s&&!n.classList.contains("player-lt__modal__mobile-show-modal")&&s.classList.remove("d-none"))}),5e3);this.common.subtitlesShow(e)}}},{key:"fullScreenButtons",value:function(e){var t=e.plyr.elements.controls.querySelector(".fullscreen-custom-control"),i=e.eventInstance.mobileEvents.setMobileEvent(t);i&&i.on("singletap",(function(t){t.preventDefault(),e.plyr.fullscreen.toggle()}))}},{key:"playPauseIcon",value:function(e,t){var i=this.common,n=this;switch(t){case"timeupdate":i.playPauseIconTimeUpdate(e);break;case"ready":var r=e.plyr.elements.controls.querySelector(".play-button"),s=e.eventInstance.mobileEvents.setMobileEvent(r);s&&s.on("singletap",(function(){e.plyr.playing?e.plyr.togglePlay(!1):e.plyr.togglePlay(!0),i.playPauseIconTimeUpdate(e),n.showControls(e)}))}}},{key:"backwardForward",value:function(e){var t=this.common,i=t.backwardRewind.getSelectors(e),n=function(){e.playerControl.mobileEvents.hideControls(e,!0)};if(i.forwardArea){var r=e.eventInstance.mobileEvents.setMobileEvent(i.forwardArea);r.on("doubletap",(function(n){t.backwardRewind.animateNotificationIn(i.forwardAnimation),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimation)}),500),e.playerControl.mobileEvents.showControls(e)})),r.on("singletap",(function(e){n()})),e.eventInstance.mobileEvents.setMobileEvent(i.forwardAreaBackground).on("doubletap",(function(n){t.backwardRewind.animateNotificationIn(i.forwardAnimationBackground),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.forwardAnimationBackground)}),500)}))}if(i.rewindArea){var s=e.eventInstance.mobileEvents.setMobileEvent(i.rewindArea);s.on("doubletap",(function(n){t.backwardRewind.animateNotificationIn(i.rewindAnimation),t.backwardRewind.updateCurrentTime(e,-10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimation)}),500),e.playerControl.mobileEvents.showControls(e)})),s.on("singletap",(function(e){n()})),e.eventInstance.mobileEvents.setMobileEvent(i.rewindAreaBackground).on("doubletap",(function(n){t.backwardRewind.animateNotificationIn(i.rewindAnimationBackground),t.backwardRewind.updateCurrentTime(e,10),setTimeout((function(){t.backwardRewind.animateNotificationOut(i.rewindAnimationBackground)}),500)}))}}},{key:"backwardForwardSeconds",value:function(e){var t=e.plyr.elements.controls,i=t.querySelector(".skip-forward-seconds"),n=t.querySelector(".skip-backward-seconds");i&&e.eventInstance.mobileEvents.setMobileEvent(i).on("singletap",(function(){e.plyr.currentTime+=10})),n&&e.eventInstance.mobileEvents.setMobileEvent(n).on("singletap",(function(){e.plyr.currentTime-=10}))}},{key:"settings",value:function(e){e.plyr.elements.controls.querySelector(".plyr__controls_settings-button")}},{key:"volume",value:function(e){var t=e.plyr.elements.controls.querySelector(".bottom-controller__volume_control");if(t){var i=t.querySelector("button"),n=t.querySelector(".volume-max"),r=t.querySelector(".volume-mute"),s=function(e){"up"===e?(n.classList.remove("d-none"),r.classList.remove("d-none"),r.classList.add("d-none")):(n.classList.remove("d-none"),r.classList.remove("d-none"),n.classList.add("d-none"))};s("up"),e.eventInstance.mobileEvents.setMobileEvent(i).on("singletap",(function(){var t=e.plyr.muted?(e.plyr.muted=!1,"up"):(e.plyr.muted=!0,"mute");s(t),e.playerControl.mobileEvents.showControls(e)}))}}}]),e}();e.Mobile=a}(f||(f={}));var L=function(){function e(t){i(this,e),s(this,"templateService",void 0),s(this,"playerVolumeBefore",void 0),s(this,"settingsControlsManager",void 0),s(this,"chaptersService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),s(this,"commonEvents",void 0),this.settingsControlsManager=new T,this.templateService=t,this.commonEvents=new f.Common,this.setDesktopEvents(),this.setMobileEvents()}return r(e,[{key:"setDesktopEvents",value:function(){this.desktopEvents=new f.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new f.Mobile}},{key:"initChapters",value:function(e){this.chaptersService=new g(e)}},{key:"getControls",value:function(e,t){return this.templateService.getTemplateControls(e,t)}}]),e}(),b=Object.prototype.toString,E=Array.isArray||function(e){return"[object Array]"===b.call(e)};function I(e){return"function"==typeof e}function N(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function S(e,t){return null!=e&&"object"==typeof e&&t in e}var w=RegExp.prototype.test,A=/\S/;var C={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},D=/\s*/,k=/\s+/,j=/\s*=/,x=/\s*\}/,_=/#|\^|\/|>|\{|&|=|!/;function O(e){this.string=e,this.tail=e,this.pos=0}function P(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function R(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}O.prototype.eos=function(){return""===this.tail},O.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var i=t[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},O.prototype.scanUntil=function(e){var t,i=this.tail.search(e);switch(i){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=t.length,t},P.prototype.push=function(e){return new P(e,this)},P.prototype.lookup=function(e){var t,i,n,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var s,a,o,l=this,c=!1;l;){if(e.indexOf(".")>0)for(s=l.view,a=e.split("."),o=0;null!=s&&o<a.length;)o===a.length-1&&(c=S(s,a[o])||(i=s,n=a[o],null!=i&&"object"!=typeof i&&i.hasOwnProperty&&i.hasOwnProperty(n))),s=s[a[o++]];else s=l.view[e],c=S(l.view,e);if(c){t=s;break}l=l.parent}r[e]=t}return I(t)&&(t=t.call(this.view)),t},R.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},R.prototype.parse=function(e,t){var i=this.templateCache,n=e+":"+(t||z.tags).join(":"),r=void 0!==i,s=r?i.get(n):void 0;return null==s&&(s=function(e,t){if(!e)return[];var i,n,r,s,a=!1,o=[],l=[],c=[],u=!1,d=!1,h="",p=0;function f(){if(u&&!d)for(;c.length;)delete l[c.pop()];else c=[];u=!1,d=!1}function g(e){if("string"==typeof e&&(e=e.split(k,2)),!E(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(N(e[0])+"\\s*"),n=new RegExp("\\s*"+N(e[1])),r=new RegExp("\\s*"+N("}"+e[1]))}g(t||z.tags);for(var y,m,v,M,T,L,b=new O(e);!b.eos();){if(y=b.pos,v=b.scanUntil(i))for(var I=0,S=v.length;I<S;++I)s=M=v.charAt(I),function(e,t){return w.call(e,t)}(A,s)?(d=!0,a=!0,h+=" "):(c.push(l.length),h+=M),l.push(["text",M,y,y+1]),y+=1,"\n"===M&&(f(),h="",p=0,a=!1);if(!b.scan(i))break;if(u=!0,m=b.scan(_)||"name",b.scan(D),"="===m?(v=b.scanUntil(j),b.scan(j),b.scanUntil(n)):"{"===m?(v=b.scanUntil(r),b.scan(x),b.scanUntil(n),m="&"):v=b.scanUntil(n),!b.scan(n))throw new Error("Unclosed tag at "+b.pos);if(T=">"==m?[m,v,y,b.pos,h,p,a]:[m,v,y,b.pos],p++,l.push(T),"#"===m||"^"===m)o.push(T);else if("/"===m){if(!(L=o.pop()))throw new Error('Unopened section "'+v+'" at '+y);if(L[1]!==v)throw new Error('Unclosed section "'+L[1]+'" at '+y)}else"name"===m||"{"===m||"&"===m?d=!0:"="===m&&g(v)}if(f(),L=o.pop())throw new Error('Unclosed section "'+L[1]+'" at '+b.pos);return function(e){for(var t,i=[],n=i,r=[],s=0,a=e.length;s<a;++s)switch((t=e[s])[0]){case"#":case"^":n.push(t),r.push(t),n=t[4]=[];break;case"/":r.pop()[5]=t[2],n=r.length>0?r[r.length-1][4]:i;break;default:n.push(t)}return i}(function(e){for(var t,i,n=[],r=0,s=e.length;r<s;++r)(t=e[r])&&("text"===t[0]&&i&&"text"===i[0]?(i[1]+=t[1],i[3]=t[3]):(n.push(t),i=t));return n}(l))}(e,t),r&&i.set(n,s)),s},R.prototype.render=function(e,t,i,n){var r=this.getConfigTags(n),s=this.parse(e,r),a=t instanceof P?t:new P(t,void 0);return this.renderTokens(s,a,i,e,n)},R.prototype.renderTokens=function(e,t,i,n,r){for(var s,a,o,l="",c=0,u=e.length;c<u;++c)o=void 0,"#"===(a=(s=e[c])[0])?o=this.renderSection(s,t,i,n,r):"^"===a?o=this.renderInverted(s,t,i,n,r):">"===a?o=this.renderPartial(s,t,i,r):"&"===a?o=this.unescapedValue(s,t):"name"===a?o=this.escapedValue(s,t,r):"text"===a&&(o=this.rawValue(s)),void 0!==o&&(l+=o);return l},R.prototype.renderSection=function(e,t,i,n,r){var s=this,a="",o=t.lookup(e[1]);if(o){if(E(o))for(var l=0,c=o.length;l<c;++l)a+=this.renderTokens(e[4],t.push(o[l]),i,n,r);else if("object"==typeof o||"string"==typeof o||"number"==typeof o)a+=this.renderTokens(e[4],t.push(o),i,n,r);else if(I(o)){if("string"!=typeof n)throw new Error("Cannot use higher-order sections without the original template");null!=(o=o.call(t.view,n.slice(e[3],e[5]),(function(e){return s.render(e,t,i,r)})))&&(a+=o)}else a+=this.renderTokens(e[4],t,i,n,r);return a}},R.prototype.renderInverted=function(e,t,i,n,r){var s=t.lookup(e[1]);if(!s||E(s)&&0===s.length)return this.renderTokens(e[4],t,i,n,r)},R.prototype.indentPartial=function(e,t,i){for(var n=t.replace(/[^ \t]/g,""),r=e.split("\n"),s=0;s<r.length;s++)r[s].length&&(s>0||!i)&&(r[s]=n+r[s]);return r.join("\n")},R.prototype.renderPartial=function(e,t,i,n){if(i){var r=this.getConfigTags(n),s=I(i)?i(e[1]):i[e[1]];if(null!=s){var a=e[6],o=e[5],l=e[4],c=s;0==o&&l&&(c=this.indentPartial(s,l,a));var u=this.parse(c,r);return this.renderTokens(u,t,i,c,n)}}},R.prototype.unescapedValue=function(e,t){var i=t.lookup(e[1]);if(null!=i)return i},R.prototype.escapedValue=function(e,t,i){var n=this.getConfigEscape(i)||z.escape,r=t.lookup(e[1]);if(null!=r)return"number"==typeof r&&n===z.escape?String(r):n(r)},R.prototype.rawValue=function(e){return e[1]},R.prototype.getConfigTags=function(e){return E(e)?e:e&&"object"==typeof e?e.tags:void 0},R.prototype.getConfigEscape=function(e){return e&&"object"==typeof e&&!E(e)?e.escape:void 0};var z={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){F.templateCache=e},get templateCache(){return F.templateCache}},F=new R;z.clearCache=function(){return F.clearCache()},z.parse=function(e,t){return F.parse(e,t)},z.render=function(e,t,i,n){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(E(r=e)?"array":typeof r)+'" was given as the first argument for mustache#render(template, view, partials)');var r;return F.render(e,t,i,n)},z.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return C[e]}))},z.Scanner=O,z.Context=P,z.Writer=R;const U=z,Y='{{#mini_player}}\n <div class="lt-player-mini-player-controls">\n <button class="lt-player-mini-player-controls__exit">\n <img class="filter" src="{{icons.external-link}}" alt="">\n </button>\n\n <button type="button" class="lt-player-mini-player-controls__play-button">\n <img class="lt-player-mini-player-controls__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="lt-player-mini-player-controls__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n <input class=\'lt-player-mini-player-controls__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\' value=\'0\'>\n </div>\n{{/mini_player}}\n{{#player}}\n {{#landscape}}\n <div class="plyr__controls">\n <div class="top-controllers">\n <div class="top-controllers__background"></div>\n <div class="top-controllers__body">\n <div class="top-controllers__body__left">\n </div>\n <div class="top-controllers__body__center">\n </div>\n <div class="top-controllers__body__right">\n {{#isShare}}\n <button type="button" class="plyr__control lt-player-share">\n <img class="filter" src="{{icons.share}}" alt="">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n <div class="lt-player-notification landscape">\n <div class="lt-player-custom-captions"><span></span></div>\n \x3c!-- <div class="lt-player-video-content">--\x3e\n \x3c!-- <div class="content__body">--\x3e\n \x3c!-- <h4 class="poster-title">{{videoParagraph}}</h4>--\x3e\n \x3c!-- <p class="poster-paragraph">{{videoTitle}}</p>--\x3e\n \x3c!-- </div>--\x3e\n \x3c!-- </div>--\x3e\n <div class="lt-player-notification__notification-button-state landscape">\n\n <div class="player-state">\n <img class="player-state__icon filter" src="" alt="">\n </div>\n </div>\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__landscape">\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="rewind">10 sec</span>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__landscape">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n <div class="plyr__progress--wrapper">\n <div class="plyr__progress">\n <label for=\'seek{id}\' class=\'plyr__sr-only\'>Seek</label>\n <input id=\'seek{id}\' class=\'plyr__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\'\n value=\'0\'\n data-plyr=\'seek\'>\n <div class="bottom-controller__current">\n <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>\n <div class="plyr__time plyr__time--duration custom-duration" aria-label="Duration">00:00</div>\n </div>\n </div>\n </div>\n <div class="bottom-controller__background"></div>\n <div class="bottom-controller">\n {{#mobile}}\n <div class="bottom-controller__left-buttons">\n <button type="button" class="plyr__control plyr__controls_settings-button settings">\n <img class="filter settings" src="{{icons.settings}}" alt="">\n </button>\n </div>\n {{/mobile}}\n {{#desktop}}\n <div class="bottom-controller__left-buttons">\n <button type="button" class="plyr__control plyr__controls_settings-button settings">\n <img class="filter settings" src="{{icons.settings}}" alt="">\n </button>\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none filter button-open" data-range-value="0.40" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none filter button-open" data-range-value="0.02" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n <div class="volume_control__background d-none">\n <button class="volume_control__volume-button-close button-close">\n <img class="volume-max button-close" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none button-close" data-range-value="0.40" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none button-close" data-range-value="0.02" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none button-close" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n <div class="plyr__volume d-none volume_control__background__area volume-area-open">\n <input data-plyr="volume" class="volume_control__background__area__range volume-area-open" type="range" min="0" max="1"\n step="0.05" value="1"\n autocomplete="off" aria-label="Volume">\n </div>\n </div>\n </div>\n {{/desktop}}\n <div class="bottom-controller__center-buttons">\n {{#chaptersEnabled}}\n <div class="bottom-controller__previous-chapter-view-wrapper">\n <p class="bottom-controller__previous-chapter-view"></p>\n <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-backward}}" alt="">\n </button>\n </div>\n {{/chaptersEnabled}}\n {{#desktop}}\n <button type="button" class="plyr__control skip-backward-seconds" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.fast-backward}}" alt="">\n </button>\n {{/desktop}}\n <div class="bottom-controller__play-button_body bottom-controller__play-button_body__landscape">\n <button type="button" class="plyr__control play-button">\n <img class="bottom-controller__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="bottom-controller__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n </div>\n {{#desktop}}\n <button type="button" class="plyr__control skip-forward-seconds" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.fast-forward}}" alt="">\n </button>\n {{/desktop}}\n {{#chaptersEnabled}}\n <div class="bottom-controller__next-chapter-view-wrapper">\n <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-forward}}" alt="">\n </button>\n <p class="bottom-controller__next-chapter-view"></p>\n </div>\n {{/chaptersEnabled}}\n </div>\n <div class="bottom-controller__right-buttons">\n {{#desktop}}\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n {{/desktop}}\n {{#mobile}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n {{/mobile}}\n </div>\n </div>\n </div>\n {{#mobile}}\n <div class="plyr__controls__mobile-background d-none">\n <div class="lt-player-notification portrait">\n <div class="lt-player-custom-captions"><span></span></div>\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n </div>\n {{/mobile}}\n {{/landscape}}\n {{#portrait}}\n <div class="plyr__controls">\n <div class="top-controllers">\n <div class="top-controllers__background"></div>\n <div class="top-controllers__body">\n <div class="top-controllers__body__left">\n {{#isShare}}\n <button type="button" class="plyr__control lt-player-share">\n <img class="filter" src="{{icons.share}}" alt="">\n </button>\n {{/isShare}}\n </div>\n <div class="top-controllers__body__center">\n </div>\n <div class="top-controllers__body__right">\n {{#desktop}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n {{/desktop}}\n {{#mobile}}\n <button type="button" class="plyr__control fullscreen-custom-control">\n <img class="filter minimize d-none" src="{{icons.minimize}}" alt="">\n <img class="filter maximize" src="{{icons.maximize}}" alt="">\n </button>\n <button type="button" class="plyr__control mini-player-control">\n <img class="filter" src="{{icons.mini-player}}" alt="">\n </button>\n {{/mobile}}\n </div>\n </div>\n </div>\n <div class="lt-player-notification portrait">\n <div class="lt-player-custom-captions"><span></span></div>\n <div class="lt-player-notification__notification-button-state portrait">\n <div class="player-state">\n <img class="player-state__icon filter" src="" alt="">\n </div>\n </div>\n <div class="lt-player-video-content">\n <div class="content__body">\n <h4 class="poster-title">{{videoParagraph}}</h4>\n <div class="poster-paragraph">\n <p class="poster-paragraph__content">{{videoTitle}}</p>\n </div>\n </div>\n </div>\n\x3c!-- <button class="poster-paragraph__button">Read more</button>--\x3e\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n <div class="plyr__progress--wrapper">\n <div class="plyr__progress">\n <label for=\'seek{id}\' class=\'plyr__sr-only\'>Seek</label>\n <input id=\'seek{id}\' class=\'plyr__progress__seek\' type=\'range\' min=\'0\' max=\'100\' step=\'0.1\'\n value=\'0\'\n data-plyr=\'seek\'>\n <div class="bottom-controller__current">\n <div class="plyr__time plyr__time--current" aria-label="Current time">00:00</div>\n <div class="plyr__time plyr__time--duration custom-duration" aria-label="Duration">00:00</div>\n </div>\n </div>\n </div>\n <div class="bottom-controller__background"></div>\n <div class="bottom-controller">\n {{#mobile}}\n <div class="bottom-controller__left-buttons">\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n </div>\n {{/mobile}}\n {{#desktop}}\n <div class="bottom-controller__left-buttons">\n <div class="bottom-controller__volume_control">\n <button type="button" class="plyr__control volume_control__volume-button button-open">\n <img class="volume-max filter button-open" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none filter button-open" data-range-value="0.65" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none filter button-open" data-range-value="0.35" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none filter button-open" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n <div class="volume_control__background d-none">\n <button class="volume_control__volume-button-close button-close">\n <img class="volume-max button-close" data-range-value="1" src="{{icons.volume-3}}" alt="">\n <img class="volume-75 d-none button-close" data-range-value="0.65" src="{{icons.volume-2}}" alt="">\n <img class="volume-50 d-none button-close" data-range-value="0.35" src="{{icons.volume-1}}" alt="">\n <img class="volume-mute d-none button-close" data-range-value="0" src="{{icons.mute}}" alt="">\n </button>\n </div>\n <div class="plyr__volume d-none volume_control__background__area volume-area-open">\n <input data-plyr="volume" class="volume_control__background__area__range volume-area-open" type="range" min="0" max="1"\n step="0.05" value="1"\n autocomplete="off" aria-label="Volume">\n </div>\n </div>\n </div>\n {{/desktop}}\n <div class="bottom-controller__center-buttons">\n {{#chaptersEnabled}}\n <button type="button" class="plyr__control skip-backward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-backward}}" alt="">\n </button>\n {{/chaptersEnabled}}\n <div class="bottom-controller__play-button_body bottom-controller__play-button_body__portrait">\n <button type="button" class="plyr__control play-button">\n <img class="bottom-controller__play-icon d-none" src="{{icons.play}}" alt="">\n <img class="bottom-controller__pause-icon" src="{{icons.pause}}" alt="">\n </button>\n </div>\n {{#chaptersEnabled}}\n <button type="button" class="plyr__control skip-forward" data-lt-player-chapterTimeStamp="">\n <img class="filter" src="{{icons.skip-forward}}" alt="">\n </button>\n {{/chaptersEnabled}}\n </div>\n {{#mobile}}\n <div class="bottom-controller__right-buttons">\n <button type="button" class="plyr__control plyr__controls_speed-button"></button>\n </div>\n {{/mobile}}\n {{#mobile}}\n \x3c!--Maybe fullscreen--\x3e\n {{/mobile}}\n\n {{#desktop}}\n <div class="bottom-controller__right-buttons">\n <button type="button" class="plyr__control plyr__controls_speed-button"></button>\n </div>\n {{/desktop}}\n </div>\n </div>\n {{#mobile}}\n <div class="plyr__controls__mobile-background d-none">\n <div class="lt-player-notification portrait">\n <div class="lt-player-custom-captions"><span></span></div>\n <div class="lt-player-rewind-area">\n </div>\n <div class="lt-player-rewind lt-player-notify">\n <div class="lt-player-rewind__icon lt-player-rewind__icon__portrait">\n <span class="rewind">10 sec</span>\n <div class="lt-player-rewind__icon-wrapper rotate">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n </div>\n </div>\n <div class="lt-player-forward-area">\n </div>\n <div class="lt-player-forward lt-player-notify">\n <div class="lt-player-forward__icon lt-player-forward__icon__portrait">\n <div class="lt-player-rewind__icon-wrapper">\n <img class="filter" src="{{icons.play}}" alt="">\n <img class="filter" src="{{icons.play}}" alt="">\n </div>\n <span class="forward">10 sec</span>\n </div>\n </div>\n </div>\n </div>\n {{/mobile}}\n {{/portrait}}\n{{/player}}\n',B='{{#modal}}\n {{#mobile}}\n {{#data}}\n <div class="player-lt__modal__mobile__background"></div>\n <div class="player-lt__modal__mobile">\n <div class="player-lt__mobile__modal-header">\n <span class="line-button"></span>\n </div>\n <div class="player-lt__mobile__modal-content">\n {{{data}}}\n </div>\n </div>\n {{/data}}\n {{#object_data}}\n <div class="player-lt__modal__mobile__background"></div>\n <div class="player-lt__modal__mobile">\n <div class="player-lt__mobile__modal-header">\n <span class="line-button"></span>\n </div>\n <div class="player-lt__mobile__modal-content">\n {{#abstract}}\n <h2>{{{abstract.title}}}</h2>\n <p>{{{abstract.description}}}</p>\n <p>{{{abstract.videoDOI}}}</p>\n <p>{{{abstract.videoCitation}}}</p>\n {{/abstract}}\n\n {{#institution}}\n <h2>{{{institution.title}}}</h2>\n <img src="{{institution.image}}" alt="image">\n <p>{{{institution.institutionName}}}</p>\n <p>{{{institution.description}}}</p>\n {{/institution}}\n\n {{#bio}}\n <h2>{{{bio.title}}}</h2>\n <p>{{{bio.description}}}</p>\n {{/bio}}\n </div>\n </div>\n {{/object_data}}\n {{/mobile}}\n {{#desktop}}\n {{#object_data}}\n <div class="player-lt__modal lt-modal-{{id}}">\n <div class="player-lt__modal-content">\n <span class="player-lt__close-button">×</span>\n <div class="player-lt__modal-body">\n {{#abstract}}\n <h2>{{{abstract.title}}}</h2>\n <p>{{{abstract.description}}}</p>\n <hr>\n <h3>Video DOI</h3>\n <p>{{{abstract.videoDOI}}}</p>\n <h3>Video Citation</h3>\n <p>{{{abstract.videoCitation}}}</p>\n {{/abstract}}\n\n {{#institution}}\n <h2>{{{institution.title}}}</h2>\n <div class="modal-flex">\n <img src="{{institution.image}}" alt="image">\n <h3>{{{institution.institutionName}}}</h3>\n </div>\n <hr>\n <p>{{{institution.description}}}</p>\n {{/institution}}\n\n {{#bio}}\n <h2>{{{bio.title}}}</h2>\n <p>{{{bio.description}}}</p>\n {{/bio}}\n </div>\n </div>\n </div>\n {{/object_data}}\n {{#data}}\n <div class="player-lt__modal lt-modal-{{id}}">\n <div class="player-lt__modal-content">\n <span class="player-lt__close-button">×</span>\n {{{data}}}\n </div>\n </div>\n {{/data}}\n {{/desktop}}\n{{/modal}}\n{{#exist}}\n{{#mobile}}\n<div class="lt-player__additional-info-mobile">\n{{#buttons}}\n <button class="additional-info-mobile" data-lt-target="{{target}}">{{#icon}}<img class="additional-info-mobile" src="{{icon}}" alt="">{{/icon}}{{^icon}}<span></span>{{/icon}}</button>\n{{/buttons}}\n </div>\n{{/mobile}}\n{{#desktop}}\n<div class="lt-player__additional-info">\n{{#buttons}}\n <button data-lt-target="{{target}}">{{#icon}}<img src="{{icon}}" alt="">{{/icon}}{{^icon}}<span></span>{{/icon}}</button>\n{{/buttons}}\n</div>\n{{/desktop}}\n\n{{/exist}}\n';var $=function(){function e(){i(this,e)}return r(e,[{key:"getOnloadPoster",value:function(e){return U.render('<div class="lt-player-onload-poster"> <img src="{{logo}}" alt=""> </div>\n',e)}},{key:"getShare",value:function(e){return U.render('<div class="share-controller lt-player-mobile-share">\n <div class="share-controller-wrapper share-inactive">\n <div class="share-controller-content lt-player-mobile-share">\n <div class="share-controller-mobile-modal-header lt-player-mobile-share">\n <span class="line-button lt-player-mobile-share"></span>\n </div>\n\x3c!-- <span class="line-button lt-player-mobile-share"></span>--\x3e\n <div class="share-controller-frame lt-player-mobile-share">\n\x3c!-- <div class="player-lt__close-button-e">--\x3e\n\x3c!-- <span class="player-lt__close-button">×</span>--\x3e\n\x3c!-- </div>--\x3e\n <div class="share-controller-top lt-player-mobile-share">\n <div class="share-controller-title lt-player-mobile-share">\n <h3 class="lt-player-mobile-share">Share this video</h3>\n </div>\n <div class="share-controller-link-wrapper lt-player-mobile-share">\n <span class="share-controller-url lt-player-mobile-share" data-lt-player-copy=""></span>\n <button class="share-controller-link lt-player-mobile-share" type="button">Copy</button>\n </div>\n <hr class="share-controller-hr lt-player-mobile-share">\n </div>\n <div class="share-controller-via lt-player-mobile-share">\n <h3 class="lt-player-mobile-share">You can also share via:</h3>\n </div>\n <div class="a2a_kit a2a_kit_size_32 a2a_default_style share-controller-icons lt-player-mobile-share" data-a2a-url="{{canonicalUrl}}" data-a2a-title="{{title}}">\n <a class="button_embed lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.00028 17.0003C7.74428 17.0003 7.48825 16.9023 7.29325 16.7073L3.29325 12.7073C2.90225 12.3163 2.90225 11.6843 3.29325 11.2933L7.29325 7.29325C7.68425 6.90225 8.31631 6.90225 8.70731 7.29325C9.09831 7.68425 9.09831 8.31631 8.70731 8.70731L5.41434 12.0003L8.70731 15.2933C9.09831 15.6843 9.09831 16.3163 8.70731 16.7073C8.51231 16.9023 8.25628 17.0003 8.00028 17.0003Z" fill="#ffffff"/>\n <path d="M16.0007 17.0003C16.2567 17.0003 16.5127 16.9023 16.7077 16.7073L20.7077 12.7073C21.0987 12.3163 21.0987 11.6843 20.7077 11.2933L16.7077 7.29325C16.3167 6.90225 15.6847 6.90225 15.2937 7.29325C14.9027 7.68425 14.9027 8.31631 15.2937 8.70731L18.5866 12.0003L15.2937 15.2933C14.9027 15.6843 14.9027 16.3163 15.2937 16.7073C15.4887 16.9023 15.7447 17.0003 16.0007 17.0003Z" fill="#ffffff"/>\n </svg>\n </span>\n </a>\n <a class="a2a_button_facebook lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="10" height="20" viewBox="0 0 10 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.55277 20V10.6154H0V7.23652H2.55277V4.3505C2.55277 2.08264 4.0607 0 7.53529 0C8.9421 0 9.98237 0.1311 9.98237 0.1311L9.9004 3.28642C9.9004 3.28642 8.83949 3.27638 7.68178 3.27638C6.42879 3.27638 6.22804 3.83768 6.22804 4.7693V7.23652H10L9.83588 10.6154H6.22804V20H2.55277Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_twitter lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 1.65729C17.3377 1.93837 16.626 2.12834 15.879 2.2138C16.6415 1.7764 17.227 1.08375 17.5027 0.258472C16.7778 0.670159 15.9847 0.960219 15.1577 1.11612C14.484 0.429261 13.5243 0 12.4621 0C10.4226 0 8.76909 1.58246 8.76909 3.53422C8.76909 3.81126 8.80179 4.08097 8.86472 4.33971C5.79558 4.19228 3.07448 2.78525 1.25304 0.646953C0.935227 1.16894 0.753117 1.77613 0.753117 2.42375C0.753117 3.64996 1.40513 4.73169 2.39597 5.36553C1.80953 5.34795 1.23599 5.19636 0.723234 4.92341C0.723023 4.93822 0.723023 4.95302 0.723023 4.96789C0.723023 6.68029 1.99596 8.10878 3.68529 8.43347C3.14148 8.57502 2.57107 8.59573 2.01762 8.49404C2.48752 9.89817 3.85137 10.9199 5.46729 10.9485C4.20342 11.8964 2.61105 12.4615 0.880945 12.4615C0.58282 12.4615 0.288914 12.4447 0 12.4121C1.63427 13.4149 3.57539 14 5.66086 14C12.4535 14 16.1679 8.61449 16.1679 3.9441C16.1679 3.79081 16.1644 3.63839 16.1573 3.48684C16.8802 2.98665 17.5042 2.3671 18 1.65729Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_linkedin lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M3.85913 16V5.20483H0.215002V16H3.85913ZM2.03754 3.73004C3.30831 3.73004 4.09931 2.9011 4.09931 1.8652C4.07563 0.805935 3.30836 0 2.06165 0C0.815143 0 0 0.805951 0 1.8652C0 2.90115 0.7908 3.73004 2.01375 3.73004H2.03743H2.03754ZM5.87615 16H9.52028V9.97145C9.52028 9.64881 9.54396 9.3265 9.64019 9.09586C9.90363 8.45124 10.5032 7.78359 11.5099 7.78359C12.8286 7.78359 13.3561 8.77354 13.3561 10.2247V15.9999H17V9.81007C17 6.49422 15.2022 4.95139 12.8046 4.95139C10.8387 4.95139 9.97556 6.03334 9.49604 6.77025H9.52036V5.2046H5.87623C5.92405 6.21756 5.87623 15.9998 5.87623 15.9998L5.87615 16Z" fill="white"/>\n </svg>\n </span>\n </a>\n\n <a class="a2a_button_whatsapp lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg class="lt-player-mobile-share" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_11_828)">\n <path d="M0 16L1.13085 11.8935C0.431709 10.6882 0.0649474 9.3232 0.0687679 7.92776C0.0687679 3.55513 3.6447 0 8.03438 0C10.1662 0 12.1681 0.825095 13.6695 2.32319C15.1748 3.82129 16.0038 5.81369 16 7.93156C16 12.3042 12.4241 15.8593 8.03056 15.8593H8.02674C6.6934 15.8593 5.383 15.5247 4.21776 14.8935L0 16ZM4.42024 13.4601L4.66093 13.6046C5.67717 14.2053 6.8424 14.5209 8.03056 14.5247H8.03438C11.6829 14.5247 14.6552 11.5703 14.6552 7.93536C14.6552 6.17491 13.9675 4.52091 12.7182 3.27377C11.4689 2.02662 9.80324 1.34221 8.03438 1.34221C4.38586 1.3384 1.41356 4.29278 1.41356 7.92776C1.41356 9.17111 1.76122 10.384 2.42598 11.4335L2.58261 11.6844L1.91404 14.1141L4.42024 13.4601Z" fill="white"/>\n <path d="M0.278809 15.7225L1.37145 11.7567C0.695236 10.597 0.339936 9.27759 0.339936 7.93158C0.343756 3.71105 3.79361 0.277588 8.03429 0.277588C10.0935 0.277588 12.0228 1.07607 13.4746 2.52093C14.9264 3.9658 15.7248 5.88976 15.7248 7.93538C15.7248 12.1559 12.2712 15.5894 8.03429 15.5894H8.03047C6.74299 15.5894 5.47842 15.2662 4.35521 14.6578L0.278809 15.7225Z" fill="#27282A"/>\n <path d="M0 16L1.13085 11.8935C0.431709 10.6882 0.0649474 9.3232 0.0687679 7.92776C0.0687679 3.55513 3.6447 0 8.03438 0C10.1662 0 12.1681 0.825095 13.6695 2.32319C15.1748 3.82129 16.0038 5.81369 16 7.93156C16 12.3042 12.4241 15.8593 8.03056 15.8593H8.02674C6.6934 15.8593 5.383 15.5247 4.21776 14.8935L0 16ZM4.42024 13.4601L4.66093 13.6046C5.67717 14.2053 6.8424 14.5209 8.03056 14.5247H8.03438C11.6829 14.5247 14.6552 11.5703 14.6552 7.93536C14.6552 6.17491 13.9675 4.52091 12.7182 3.27377C11.4689 2.02662 9.80324 1.34221 8.03438 1.34221C4.38586 1.3384 1.41356 4.29278 1.41356 7.92776C1.41356 9.17111 1.76122 10.384 2.42598 11.4335L2.58261 11.6844L1.91404 14.1141L4.42024 13.4601Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M6.04392 4.61218C5.89492 4.28138 5.73829 4.27378 5.59693 4.26998C5.48232 4.26617 5.3486 4.26617 5.21489 4.26617C5.08117 4.26617 4.86723 4.3156 4.68384 4.51332C4.50046 4.71104 3.98853 5.19013 3.98853 6.16732C3.98853 7.1407 4.70295 8.08367 4.80228 8.21675C4.90161 8.34983 6.18146 10.4145 8.20247 11.2091C9.88346 11.8707 10.2273 11.7377 10.5902 11.7034C10.9532 11.6692 11.7669 11.2244 11.935 10.7605C12.0993 10.2966 12.0993 9.90116 12.0496 9.81751C12 9.73386 11.8663 9.68443 11.6676 9.58557C11.4689 9.48671 10.4909 9.00762 10.3075 8.93918C10.1241 8.87454 9.99043 8.84032 9.86054 9.03804C9.72682 9.23576 9.34478 9.68062 9.23016 9.8137C9.11555 9.94678 8.99712 9.96199 8.79845 9.86313C8.59979 9.76427 7.95796 9.55515 7.19769 8.87834C6.60552 8.35363 6.20438 7.70344 6.08976 7.50572C5.97515 7.308 6.0783 7.20154 6.17764 7.10268C6.26551 7.01522 6.3763 6.87074 6.47563 6.75667C6.57496 6.6426 6.60934 6.55895 6.67429 6.42587C6.73924 6.29279 6.70868 6.17872 6.65901 6.07986C6.60934 5.98481 6.21966 5.00382 6.04392 4.61218Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0_11_828">\n <rect width="16" height="16" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </span>\n </a>\n <a class="a2a_button_messenger lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_11_831)">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M8 -0.000732422C3.494 -0.000732422 0 3.30127 0 7.75927C0 10.0913 0.956 12.1073 2.512 13.4993C2.642 13.6153 2.722 13.7793 2.726 13.9553L2.77 15.3793C2.784 15.8333 3.252 16.1293 3.668 15.9453L5.256 15.2453C5.39 15.1853 5.542 15.1753 5.684 15.2133C6.414 15.4133 7.19 15.5213 8 15.5213C12.506 15.5213 16 12.2193 16 7.76127C16 3.30327 12.506 -0.000732422 8 -0.000732422Z" fill="white"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.19601 10.0293L5.546 6.30129C5.92 5.70729 6.72 5.56129 7.282 5.98129L9.152 7.38329C9.324 7.51129 9.56 7.51129 9.72999 7.38129L12.254 5.46529C12.59 5.20929 13.03 5.61329 12.806 5.97129L10.454 9.69729C10.08 10.2913 9.28 10.4373 8.718 10.0173L6.848 8.61529C6.676 8.48729 6.44 8.48729 6.27 8.61729L3.74601 10.5333C3.41001 10.7893 2.97001 10.3873 3.19601 10.0293Z" fill="#27282A"/>\n </g>\n <defs>\n <clipPath id="clip0_11_831">\n <rect width="16" height="16" fill="white"/>\n </clipPath>\n </defs>\n </svg>\n </span>\n </a>\n <a class="a2a_button_email lt-player-mobile-share">\n <span class="share-icon__icon lt-player-mobile-share">\n <svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M11.7045 0.25C12.7102 0.25 13.6777 0.6475 14.3895 1.36075C15.102 2.0725 15.5002 3.0325 15.5002 4.0375V9.9625C15.5002 12.055 13.7977 13.75 11.7045 13.75H4.29524C2.20199 13.75 0.500244 12.055 0.500244 9.9625V4.0375C0.500244 1.945 2.19449 0.25 4.29524 0.25H11.7045ZM12.8977 5.155L12.9577 5.095C13.137 4.8775 13.137 4.5625 12.9495 4.345C12.8452 4.23325 12.702 4.165 12.5527 4.15C12.3952 4.14175 12.2452 4.195 12.132 4.3L8.75025 7C8.31525 7.36075 7.692 7.36075 7.25025 7L3.87524 4.3C3.64199 4.1275 3.31949 4.15 3.12524 4.3525C2.92274 4.555 2.90024 4.8775 3.07199 5.1025L3.17024 5.2L6.58275 7.8625C7.00275 8.1925 7.512 8.3725 8.04525 8.3725C8.577 8.3725 9.09525 8.1925 9.5145 7.8625L12.8977 5.155Z" fill="white"/>\n </svg>\n </span>\n </a>\n </div>\n </div>\n </div>\n </div>\n</div>\n',e)}},{key:"getPoster",value:function(e){return U.render('{{#portrait}}\n<div class="lt-player__poster">\n <div class="lt-player__poster__image-body">\n <div class="lt-player__poster--background"></div>\n <img class="lt-player__poster__img lt-player__poster__img__set-default d-none" alt="" src="{{logoBig}}">\n <img class="lt-player__poster__img--set-custom d-none" alt="" src="{{config.configData.posterImage}}">\n </div>\n <div class="lt-player__poster__body">\n <div class="content">\n <div class="content__header">\n <img src="{{config.logo}}" alt="logo">\n </div>\n <div class="content__body">\n <div class="poster-title">{{config.configData.videoTitle}}</div>\n <div class="poster-paragraph">{{config.configData.videoParagraph}}</div>\n </div>\n <div class="content__footer">\n <div class="poster-buttons">\n <button class="poster-button-play">\n <img src="{{config.play}}" alt="" class="icon--not-pressed" role="presentation">\n </button>\n <button class="poster-button-watch-now">\n Watch now\n </button>\n {{#isShare}}\n <button class="poster-lt-player-share" type="button">\n <img class="filter" src="{{config.share}}" alt="" role="presentation">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n </div>\n</div>\n{{/portrait}}\n{{#landscape}}\n <div class="lt-player__poster">\n <div class="lt-player__poster__image-body">\n <div class="lt-player__poster--background"></div>\n <img class="lt-player__poster__img lt-player__poster__img__set-default d-none" alt="" src="{{logoBig}}">\n <img class="lt-player__poster__img--set-custom d-none" alt="" src="{{config.configData.posterImage}}">\n </div>\n <div class="lt-player__poster__body">\n <div class="content">\n <div class="content__header">\n <div class="poster-title">{{config.configData.videoParagraph}}</div>\n </div>\n <div class="content__body">\n <div class="poster-paragraph">{{config.configData.videoTitle}}</div>\n </div>\n <div class="content__footer">\n <div class="poster-buttons">\n <button class="poster-button-play">\n <img src="{{config.play}}" alt="" class="icon--not-pressed" role="presentation">\n </button>\n <button class="poster-button-watch-now">\n Watch now\n </button>\n {{#isShare}}\n <button class="poster-lt-player-share" type="button">\n <img class="filter" src="{{config.share}}" alt="" role="presentation">\n </button>\n {{/isShare}}\n </div>\n </div>\n </div>\n </div>\n</div>\n{{/landscape}}\n',e)}},{key:"getSettings",value:function(e){return U.render('<div class="settings-controllers-enable__background d-none"></div>\n<div class="settings-controllers settings">\n <span class="line-button settings-controllers-header"></span>\n <div class="settings-controllers-enable__subtitles settings">\n <p class="settings-text settings">Subtitles</p>\n <label class="subtitles-body__switch settings">\n <input id="captions-lt-player-{{id}}" class="subtitles-body__input-switch settings" {{#captions_enabled }}checked{{/captions_enabled}} {{#captions_missing}}disabled{{/captions_missing}} type="checkbox">\n <label for="captions-lt-player-{{id}}" class="subtitles-body__slider settings"></label>\n </label>\n </div>\n <div class="settings-controllers-enable__speed-range settings">\n <p class="settings-text settings">Speed</p>\n <div class="speed-range-input-body settings">\n <output class="settings speed-range-value" style="display: flex; justify-content: center" id="speed-range-value-{{id}}"></output>\n <input id="speed-range-{{id}}" type="range" min="0" max="3" step="1" class="speed-range-input settings">\n </div>\n </div>\n\x3c!-- <div class="settings-controllers-enable__speed-range settings">--\x3e\n\x3c!-- <p class="settings-text settings">Speed</p>--\x3e\n\x3c!-- <div class="speed-range-input-body mobile settings">--\x3e\n\x3c!-- <button class="button-speed settings button_active" data-speed="1">1</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="1.25">1.25</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="1.5">1.5</button>--\x3e\n\x3c!-- <button class="button-speed settings" data-speed="2">2</button>--\x3e\n\x3c!-- </div>--\x3e\n\x3c!-- </div>--\x3e\n\n <div class="settings-controllers-enable__button-save settings">\n <button class="button-save settings">Save</button>\n </div>\n</div>\n',e)}},{key:"getMobileSettings",value:function(e){return U.render('<dialog class="settings-dialog">\n<div class="settings-controllers settings">\n <span class="line-button settings-controllers-header"></span>\n <div class="settings-controllers-enable__subtitles settings">\n <p class="settings-text settings">Subtitles</p>\n <label class="subtitles-body__switch settings">\n <input id="captions-lt-player-{{id}}" class="subtitles-body__input-switch settings" {{#captions_enabled }}checked{{/captions_enabled}} {{#captions_missing}}disabled{{/captions_missing}} type="checkbox">\n <label for="captions-lt-player-{{id}}" class="subtitles-body__slider settings"></label>\n </label>\n </div>\n <div class="settings-controllers-enable__speed-range settings">\n <p class="settings-text settings">Speed</p>\n <div class="speed-range-input-body settings">\n <output class="settings speed-range-value" style="display: flex; justify-content: center" id="speed-range-value-{{id}}"></output>\n <input id="speed-range-{{id}}" type="range" min="0" max="3" step="1" class="speed-range-input settings">\n </div>\n </div>\n <div class="settings-controllers-enable__button-save settings">\n <button class="button-save settings">Save</button>\n </div>\n</div>\n</dialog>\n',e)}},{key:"getAdditionalInfo",value:function(e){return U.render(B,e)}},{key:"getAdditionalInfoButtons",value:function(e){return U.render(B,e)}},{key:"getTemplateByType",value:function(e){var t,i=e.getConfigData();Object.assign(i,(s(t={},e.getVideoType(),!0),s(t,"mobile","mobile"!==e.getDevice()),t));var n=U.render('{{#embedded }}\n<div class="plyr__video-embed embed_player" data-plyr-provider="{{videoUrl.origin}}" data-plyr-embed-id="{{videoUrl.embedId}}" data-plyr-embed-hash="{{videoUrl.embedHash}}">\n</div>\n{{/embedded}}\n{{#video}}\n<video class="embed_player lt-player-wrapper" playsinline muted controls crossorigin preload="none">\n <source src="{{videoUrl.videoUrl}}"/>\n {{#defaultConfig.captions}}\n <track kind="captions" label="{{label}} captions" src="{{url}}" srclang="{{srclang}}" {{default}} />\n {{/defaultConfig.captions}}\n</video>\n<div class="loader__backdrop">\n <div class="loader"><div></div><div></div><div></div><div></div></div>\n</div>\n{{/video}}\n',i);return delete i.mobile,n}},{key:"getTemplateControls",value:function(e,t){var i=e.getConfigData();switch(Object.assign(i,{icons:t.getIconsByComponent("controls")}),Object.assign(i,{isShare:e.isShareData()}),Object.assign(i,{player:"true"}),"mobile"===i.device?Object.assign(i,{mobile:"true"}):Object.assign(i,{desktop:"true"}),e.getPlayerType()){case"1":case 1:case"portrait":Object.assign(i,{portrait:"true"});break;case"2":case 2:case"landscape":Object.assign(i,{landscape:"true"})}Object.assign(i,{chaptersEnabled:!!i.chapters});var n=U.render(Y,i);return delete i.mobile,delete i.desktop,n}},{key:"getBackGroundTemplate",value:function(e){return U.render('<div class="lt-player-mini-player-background {{classObserve}}">\n <div class="logo">\n <img src="{{logo}}" alt="">\n </div>\n</div>\n',e)}},{key:"getControlsMiniPlayer",value:function(e){return U.render(Y,e)}}]),e}(),G=function(){function e(){i(this,e),s(this,"path",void 0),s(this,"posterMapIconsName",["play","logo","share"]),s(this,"controlsMapIconsName",["play","skip-backward","skip-forward","volume-3","volume-2","volume-1","mute","settings","pause","minimize","maximize","mini-player","share","external-link","fast-backward","fast-forward"]),s(this,"additionalInfoIconsName",["file-text","user","university"]),s(this,"playPause",["play","pause"]),this.path=__webpack_require__(3991)}return r(e,[{key:"getLogo",value:function(){var e=this,t=null;return this.path.keys().forEach((function(i){"logo-big"===i.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","")&&(t=e.path(i))})),t}},{key:"getIconsByComponent",value:function(e){var t=this,i={};switch(e){case"poster":this.path.keys().forEach((function(e){t.posterMapIconsName.forEach((function(n){var r=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");r===n&&Object.assign(i,s({},r,t.path(e)))}))}));break;case"controls":this.path.keys().forEach((function(e){t.controlsMapIconsName.forEach((function(n){var r=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");r===n&&Object.assign(i,s({},r,t.path(e)))}))}));break;case"additionalInfo":this.path.keys().forEach((function(e){t.additionalInfoIconsName.forEach((function(n){var r=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");r===n&&Object.assign(i,s({},r,t.path(e)))}))}));break;case"playPause":this.path.keys().forEach((function(e){t.playPause.forEach((function(n){var r=e.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");r===n&&Object.assign(i,s({},r,t.path(e)))}))}))}return i}},{key:"getControlsIcons",value:function(){var e=this,t={};return this.path.keys().forEach((function(i){e.posterMapIconsName.forEach((function(n){var r=i.replace(/(\.(?:jpg|png|svg))$/i,"").replace("./","");r===n&&Object.assign(t,s({},r,e.path(i)))}))})),t}}]),e}(),Q=function(){function e(t){i(this,e),s(this,"device",void 0),s(this,"playerInstance",void 0),this.playerInstance=t,this.device=t.playerConfig.getDevice()}return r(e,[{key:"setContainer",value:function(){}}]),e}(),H=function(){function e(){i(this,e)}return r(e,[{key:"getDeviceOrientation",value:function(){return window.matchMedia("(orientation: portrait)").matches?"portrait":window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait"}}]),e}(),q=function(){function e(){i(this,e),s(this,"orientation",void 0),s(this,"playerInstance",void 0),s(this,"player",void 0),s(this,"playerContainer",void 0),s(this,"playerParentContainer",void 0),s(this,"device",void 0),s(this,"playerType",void 0),s(this,"addInfo",void 0),s(this,"addInfoOutSide",void 0),s(this,"addInfoInSide",void 0),s(this,"playerParam",{width:null,height:null}),s(this,"defaultPortrate",{max:{width:500,height:776},min:{width:200,height:400},size:{438:"lg",375:"md",350:"sm",200:"xs"}}),s(this,"defaultLandscape",{max:{width:1067,height:600},min:{width:300,height:150},size:{1067:"xxl",913:"xl",820:"lg",760:"md",640:"sm",480:"xs",266:"xxs"}}),this.orientation=new H}return r(e,[{key:"init",value:function(e){this.playerInstance=e,this.playerContainer=e.playerConfig.getPlayerElementContainer(),this.player=e.plyr,this.device=e.playerConfig.getDevice(),this.playerParentContainer=this.playerContainer.parentElement,this.addInfo=new Q(e),this.setPlayerDimensions()}},{key:"setPlayerDimensions",value:function(){if(this.playerInstance.playerConfig.getPlayerType())switch(this.playerInstance.playerConfig.getPlayerType()){case"1":case 1:this.setPortrate(),this.playerType="portrait";break;case"2":case 2:this.setLandScape(),this.playerType="landscape";break;case"portrait":this.playerType="landscape",this.setPortrate();break;case"landscape":this.playerType="landscape",this.setLandScape()}}},{key:"setPortrate",value:function(){}},{key:"setLandScape",value:function(){}},{key:"setEvent",value:function(e){var t=this;new ResizeObserver((function(i){t.setDimensions(i[0].target.clientWidth,i[0].target.clientHeight,e)})).observe(this.playerParentContainer)}},{key:"setEventAddInfo",value:function(e,t,i){var n=this;new ResizeObserver((function(r){n.setAddInfoByDimensions(r[0].target.clientWidth,e,t,i)})).observe(this.playerInstance.plyr.elements.container)}},{key:"setAddInfoByDimensions",value:function(e,t,i,n){var r,s=this;this.playerInstance.playerConfig.getEmbed(),(r=s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info"))&&r.remove(),void 0!==s.playerInstance.plyr.elements.controls?(s.playerInstance.plyr.elements.controls.querySelector(".content__body").insertAdjacentHTML("afterend",t),s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").classList.add("lt-player__additional-info__is_set_in-side"),i.set(n,"in")):s.playerInstance.plyr.on("ready",(function(){s.playerInstance.plyr.elements.controls.querySelector(".content__body").insertAdjacentHTML("afterend",t),s.playerInstance.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").classList.add("lt-player__additional-info__is_set_in-side"),i.set(n,"in")}))}},{key:"setDimensions",value:function(e,t,i){var n=this,r=function(){if(void 0!==n.playerInstance.plyr.elements.container){if("mobile"===n.device&&"landscape"===n.orientation.getDeviceOrientation()&&"portrate"===n.playerType)return void(n.playerContainer.style.width="100%");if(e>=i.max.width)return n.playerContainer.style.width="".concat(i.max.width,"px"),void(n.playerParam.width=i.max.width);if(e<i.max.width&&e>=i.min.width)return n.playerContainer.style.width="".concat(e,"px"),void(n.playerParam.width=e);if(e<i.min.width)return n.playerContainer.style.width="".concat(i.min.width,"px"),void(n.playerParam.width=i.min.width)}},s=function(){if(void 0!==n.playerInstance.plyr.elements.container){if("mobile"===n.device&&"landscape"===n.orientation.getDeviceOrientation()&&"portrate"===n.playerType)return void(n.playerContainer.style.height="90vh");if(t>=i.max.height)return n.playerContainer.style.height="".concat(i.max.height,"px"),void(n.playerParam.height=i.max.height);if(t>=i.min.height&&t<i.max.height)return n.playerContainer.style.height="".concat(t,"px"),void(n.playerParam.height=t);if(t<i.min.height)return n.playerContainer.style.height="".concat(i.min.height,"px"),void(n.playerParam.height=i.min.height)}},a=this.playerInstance.playerConfig.getVersion(),o=this.playerInstance.playerConfig.getObserve();o?(o.hasOwnProperty("width")&&o.width&&r(),o.hasOwnProperty("height")&&o.height&&s()):(r(),1!==a&&s()),function(){if(void 0!==n.playerInstance.plyr.elements.container){var e=!1,t=n.defaultPortrate;"landscape"===n.playerType&&(t=n.defaultLandscape),Object.keys(t.size).forEach((function(i){n.playerContainer.classList.contains("lt-player--".concat(n.playerType,"__").concat(t.size[i]))&&n.playerContainer.classList.remove("lt-player--".concat(n.playerType,"__").concat(t.size[i])),n.playerContainer.clientWidth>=parseInt(i)&&(e="lt-player--".concat(n.playerType,"__").concat(t.size[i]))})),e&&n.playerContainer.classList.add(e)}}()}}]),e}(),W=function(){function e(){i(this,e),s(this,"config",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"plyr",void 0)}return r(e,[{key:"initPreload",value:function(e,t,i,n){this.plyr=e,this.iconService=n,this.templateService=t,this.config=i;var r=e.elements.container.querySelector(".lt-player__poster__image-body");r&&(i.isAutoPreload()?this.plyr.on("play",(function(){r.classList.add("lt-player__poster__image-body--preload")})):setTimeout((function(){r.classList.add("lt-player__poster__image-body--preload")}),800))}}]),e}(),Z=function(){function e(){i(this,e)}return r(e,null,[{key:"getDevice",value:function(){var e="desktop";return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(e="mobile"),e}},{key:"setDebugEvent",value:function(e,t){void 0===t&&(t="info")}},{key:"processConfigData",value:function(e){var t,i="video",n="video";return null!==(t=/^(http:\/\/|https:\/\/)(player\.vimeo\.com|vimeo\.com|youtu\.be|www\.youtube\.com)\/([\w\/]+)(\?.*)?$/.exec(e))&&t.forEach((function(e){void 0!==e&&(e.includes("vimeo")&&(i="embedded",n="vimeo"),e.includes("youtube")&&(i="embedded",n="youtube"))})),{type:i,origin:n}}},{key:"isValidHttpUrl",value:function(e){var t;if("object"===d(e))return!1;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}},{key:"checkIsHls",value:function(e){var t=!1;return["m3u8"].forEach((function(i){e.includes(i)&&(t=!0)})),t}},{key:"getVideoOrientation",value:function(e,t){return e>t?"landscape":"portrait"}},{key:"getPlayerStringType",value:function(e){var t=null;switch(e){case"1":case 1:case"portrait":t="portrait";break;case"2":case 2:case"landscape":t="landscape"}return t}}]),e}();s(Z,"getEmbeddedID",(function(e){return e.split("?")[0].split("/").length>4?e.split("?")[0].split("/").slice(-2)[0]:e.split("?")[0].split("/").slice(-1)[0]})),s(Z,"getEmbeddedHash",(function(e){return e.split("?")[0].split("/").length>4?e.split("?")[0].split("/").slice(-1)[0]:null}));var V=function(){function e(t,n,r,a){i(this,e),s(this,"custom_selector","lt-player__poster"),s(this,"config",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"plyr",void 0),this.plyr=t,this.iconService=a,this.templateService=n,this.config=r}return r(e,[{key:"setTemplate",value:function(){var e;Object.assign(this.config,this.iconService.getIconsByComponent("poster"));var t=this.iconService.getLogo(),i=(s(e={},Z.getPlayerStringType(this.config.getPlayerType()),!0),s(e,"config",this.config),s(e,"logoBig",t),s(e,"isShare",!!this.config.isShareData()),e),n=this.templateService.getPoster(i);this.plyr.elements.wrapper.insertAdjacentHTML("afterend",n)}},{key:"setImage",value:function(){var e,t,i,n=this.plyr.elements.container.querySelector(".lt-player__poster__img--set-custom"),r=this.plyr.elements.container.querySelector(".lt-player__poster__img__set-default"),s=function(){r&&r.classList.remove("d-none")};this.config.getPosterImage()?n&&(e=this.config.getPosterImage(),t=function(e){e?n.classList.remove("d-none"):s()},(i=new Image).onerror=function(){t(!1)},i.onload=function(){t(!0)},i.src=e):s()}}]),e}(),K=function(){function e(){i(this,e)}return r(e,null,[{key:"getSpinner",value:function(){return'<div class="lt-player-spinner__loader">\n <svg class="lt-player-spinner__loader__circle-svg" viewBox="0 0 50 50">\n <circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle>\n </svg>\n </div>'}},{key:"removeSpinner",value:function(e){if(e){var t=e.querySelector(".lt-player-spinner__loader");t&&t.remove()}}}]),e}(),X=r((function e(){i(this,e)}));s(X,"preloadEvents",{removePosterImage:function(e){var t=e.playerConfig.getPlayerElementContainer().parentElement.querySelector(".plyr__poster");t&&t.classList.add("lt-player__preload-hide")},embedPlay:function(e,t){var i=e.plyr.elements.container;i.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",K.getSpinner());var n=e.playerConfig.getPreload(),r=function(){console.log("preload play"),0!==n.start?(e.plyr.embed.setCurrentTime(n.start).then((function(){e.plyr.embed.setMuted(!0).then((function(){e.plyr.embed.play().then((function(){e.plyr.volume=0,K.removeSpinner(i)}))})).catch((function(){}))})),K.removeSpinner(i)):(e.plyr.volume=0,e.plyr.embed?e.plyr.embed.play().then((function(){K.removeSpinner(i)})):(e.plyr.play(),K.removeSpinner(i)))};switch(t){case"event":this.removePosterImage(e),e.playerConfig.isAutoPreload()?r():(console.log("preload play"),0!==n.start?e.plyr.embed.setCurrentTime(n.start).then((function(){e.plyr.embed.pause().then((function(){e.plyr.volume=0,K.removeSpinner(i)}))})):e.plyr.embed?e.plyr.embed.pause().then((function(){K.removeSpinner(i)})):(e.plyr.pause(),K.removeSpinner(i)),K.removeSpinner(i));break;case"action":r()}},html5Play:function(e,t){var i=this,n=function(){e.plyr.volume=0;var n=e.playerConfig.getPreload();switch(0!==n.start&&(e.plyr.currentTime=n.start),t){case"event":i.removePosterImage(e),e.playerConfig.isAutoPreload()?e.plyr.play():e.plyr.pause();break;case"action":e.plyr.play()}},r=!1;e.plyr.on("loadeddata",(function(){r=!0,n()})),r||n()},stop:function(e,t){var i;switch(t){case"event":i=e.playerConfig.getPreload(),e.plyr.currentTime>=i.stop&&(e.plyr.isEmbed?this.embedPlay(e,"action"):this.html5Play(e,"action"));break;case"action":e.plyr.pause()}}});var J,ee,te=function(){function e(t){i(this,e),s(this,"instance",void 0),s(this,"player",void 0),s(this,"storage",void 0),this.player=t.plyr,this.instance=t,this.storage=new v}return r(e,[{key:"applyGlobalSettings",value:function(){var e=this.storage.getSettings();this.player.speed=e.speed,this.player.volume=e.volume,this.player.muted=e.muted,this.volumeIconsChange(),this.speedButtonChange(this.player.elements.container)}},{key:"setGlobalSettings",value:function(){var e={speed:this.player.speed,volume:this.player.volume,muted:this.player.muted};console.log(e.volume),console.log(e.muted),this.storage.setSettings(e)}},{key:"speedButtonChange",value:function(e){var t=(new v).getSpeed(),i=Math.floor(10*t)/10,n=e.querySelector(".plyr__control.plyr__controls_speed-button > span");n&&(n.innerHTML=i+"X",n.className="",n.classList.add("playback-speed--"+t+"X"))}},{key:"volumeIconsChange",value:function(){"desktop"===this.instance.playerConfig.getDevice()?this.volumeItemsDesktop():this.volumeIconsMobile()}},{key:"volumeIconsMobile",value:function(){!1===this.storage.getMutedState()&&(this.player.volume=1,this.storage.setVolume(1));var e=this.player.elements.controls.querySelector(".bottom-controller__volume_control");if(e){var t=e.querySelector(".volume-max"),i=e.querySelector(".volume-mute");this.player.muted?(t.classList.remove("d-none"),i.classList.remove("d-none"),t.classList.add("d-none")):(t.classList.remove("d-none"),i.classList.remove("d-none"),i.classList.add("d-none"))}}},{key:"volumeItemsDesktop",value:function(){for(var e=this.storage.getVolume().toString(),t=this.player.elements.controls,i=t.querySelector(".volume-max"),n=t.querySelector(".volume-75"),r=t.querySelector(".volume-50"),s=t.querySelector(".volume-mute"),a=t.querySelector(".bottom-controller__volume_control"),o=function(e){a.querySelectorAll(".volume-max, .volume-75, .volume-50, .volume-mute").forEach((function(t){e.dataset.rangeValue===t.dataset.rangeValue?t.classList.remove("d-none"):t.classList.add("d-none")}))},l=[{threshold:1,element:i},{threshold:.65,element:n},{threshold:.35,element:r},{threshold:0,element:s}],c=0;c<l.length;c++)if(e>=l[c].threshold){o(l[c].element);break}}}]),e}();!function(e){var t=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"instance",void 0),s(this,"settingsManager",void 0),this.player=t.plyr,this.instance=t,this.settingsManager=new te(t)}return r(e,[{key:"play",value:function(e){var t=this;console.log("is it the first video? "+e);var i=this.player.elements.container;e&&(this.player.muted=!0,this.player.volume=0,this.settingsManager.setGlobalSettings()),i.addEventListener("ratechange",(function(){t.settingsManager.setGlobalSettings()})),i.addEventListener("volumechange",(function(){t.settingsManager.setGlobalSettings()})),this.settingsManager.applyGlobalSettings(),this.player.playing||this.player.play(),function(){var e=i.querySelector(".lt-player__poster");e&&e.classList.add("d-none");var t=i.querySelector(".player__controls");t&&t.classList.remove("d-none")}()}},{key:"pause",value:function(){this.player.pause()}},{key:"stop",value:function(){var e,t,i,n=this,r=this.player.elements.container;this.settingsManager.setGlobalSettings(),this.player.stop(),e=r.querySelector(".lt-player__poster"),t=r.querySelector(".plyr__controls"),r.classList.add("plyr--stopped"),e.classList.remove("d-none"),t.classList.add("d-none"),function(){var e=r.querySelector(".settings-controllers");if(e&&e.classList.contains("settings-controllers-enable")){var t=r.querySelector(".settings-controllers");n.player.elements.controls.classList.remove("plyr__controls-enable-settings"),t.classList.remove("settings-controllers-enable");var i=document.querySelector(".settings-controllers-enable__background");i.classList.contains("d-none")||i.classList.add("d-none")}}(),(i={controls:r.querySelector(".lt-player-mini-player-controls"),background:r.querySelector(".lt-player-mini-player-background"),enable:r.querySelector(".lt-player-mini-enable"),size_land:r.querySelector(".lt-player-mini-1"),size_port:r.querySelector(".lt-player-mini-2")}).controls&&i.controls.remove(),i.background&&i.background.remove(),i.size_land&&i.size_land.classList.remove("lt-player-mini-1"),i.size_port&&i.size_port.classList.remove("lt-player-mini-2"),i.enable&&i.enable.classList.remove("lt-player-mini-enable"),n.player.fullscreen.active&&n.player.fullscreen.exit()}},{key:"enterMiniPlayer",value:function(){this.instance.miniPlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){this.instance.miniPlayer.exitMiniPlayer(this.player)}}]),e}();e.Player=t;var n=function(){function e(t,n){i(this,e),s(this,"instance",void 0),s(this,"preloadPoster",void 0),this.instance=t,this.preloadPoster=n}return r(e,[{key:"play",value:function(){if(this.instance.plyr.isEmbed){var e=this.instance,t=this.instance.plyr;t.on("ready",(function(){t.embed.ready().then((function(){X.preloadEvents.embedPlay(e,"action")}))})),X.preloadEvents.embedPlay(e,"action")}if(this.instance.plyr.isHTML5){var i=this.instance;X.preloadEvents.html5Play(i,"action")}}},{key:"pause",value:function(){X.preloadEvents.stop(this.instance,"action")}},{key:"stop",value:function(){return console.error("Sorry, this method is not implemented, don't worry, be happy")}}]),e}();e.Preload=n}(J||(J={})),function(e){var t=r((function e(){i(this,e),s(this,"poster",{getButtons:function(e){var t=e.plyr.elements.container.querySelectorAll(".poster-button-play, .poster-button-watch-now");if(0!==t.length)return t},reset:function(e){var t=e.plyr.elements.container,i=function(){t.querySelector(".lt-player__poster").classList.add("d-none"),t.querySelector(".plyr__controls").classList.remove("d-none")};e.playerConfig.getPreload().isActive&&(e.plyr.volume=1,e.plyr.currentTime=0,e.playerConfig.getPreload().isActive=!1),e.plyr.isEmbed?(i(),t.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",K.getSpinner()),e.plyr.embed.play().then((function(){e.plyr.volume=1,K.removeSpinner(t)}),(function(){e.plyr.volume=1,K.removeSpinner(t),e.plyr.play()}))):(i(),e.plyr.volume=1,e.plyr.play()),e.playerConfig.getPreload()&&(K.removeSpinner(t),"mobile"===e.playerConfig.getDevice()&&(e.plyr.isEmbed?e.plyr.embed.getTextTracks().then((function(t){0!==t.length&&e.plyr.toggleCaptions(!0)})):e.plyr.toggleCaptions(!0)))}})}));e.Common=t;var n=function(){function e(){i(this,e)}return r(e,[{key:"posterBody",value:function(e){var t=new ee.Common,i=e.plyr.elements.container.querySelector(".lt-player__poster__body");i&&i.addEventListener("click",(function(i){i.preventDefault(),i.target.classList.contains("poster-lt-player-share")||i.target.classList.contains("filter")||(e.playerControl.desktopEvents.titleLineBreak(e),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate"),t.poster.reset(e))}))}}]),e}();e.Desktop=n;var a=function(){function e(){i(this,e)}return r(e,[{key:"posterBody",value:function(e){var t=e.plyr.elements.container,i=t.querySelector(".plyr__poster"),n=t.querySelector(".lt-player__poster__body"),r=new ee.Common,s=e.eventInstance.mobileEvents.setMobileEvent(n);s&&s.on("singletap",(function(){i.classList.contains("d-none")||(e.playerControl.desktopEvents.titleLineBreak(e),e.playerControl.mobileEvents.playPauseIcon(e,"timeupdate"),r.poster.reset(e),t.classList.remove("plyr__poster-enabled"),e.playerControl.mobileEvents.showControls(e))}))}},{key:"onload",value:function(e){}},{key:"showControls",value:function(e){var t=e.plyr.elements.container,i=e.plyr.elements.controls,n=t.querySelector(".plyr__poster"),r=e.eventInstance.mobileEvents.setMobileEvent(n);r&&r.on("singletap",(function(){i.classList.contains(".plyr__controls-enable")||e.playerControl.mobileEvents.showControls(e)}))}}]),e}();e.Mobile=a}(ee||(ee={}));var ie,ne=function(){function e(){i(this,e),s(this,"instance",void 0),s(this,"preload",void 0),s(this,"poster",void 0),s(this,"playerConfig",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.desktopEvents=new ee.Desktop,this.mobileEvents=new ee.Mobile}return r(e,[{key:"init",value:function(e){this.instance=e,this.playerConfig=e.playerConfig,this.templateService=e.templateService,this.iconService=e.iconService,this.poster=new V(this.instance.plyr,this.templateService,this.playerConfig,this.iconService),this.poster.setTemplate(),this.poster.setImage(),this.playerConfig.getPreload()&&this.initPreload()}},{key:"initPreload",value:function(){this.preload=new W,this.preload.initPreload(this.instance.plyr,this.templateService,this.playerConfig,this.iconService),this.instance.devMethodePreload=new J.Preload(this.instance,this.preload)}}]),e}();!function(e){var t=function(){function e(t){i(this,e),s(this,"manager",void 0),this.manager=t}return r(e,[{key:"init",value:function(){var e=this,t=[this.manager.instance.plyr.elements.container.querySelector(".poster-lt-player-share"),this.manager.instance.plyr.elements.controls.querySelector(".lt-player-share")],i=this;t.forEach((function(t){if(t){var n=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);n&&n.on("singletap",(function(e){e.preventDefault(),i.manager.mobile.activeModal()}))}}))}}]),e}();e.mobile=t;var n=function(){function e(t){i(this,e),s(this,"manager",void 0),this.manager=t}return r(e,[{key:"init",value:function(){var e=this.manager;e.desktop.getSelector().buttons.forEach((function(t){t&&t.addEventListener("click",(function(){e.desktop.activeModal()}))})),e.desktop.getSelector().shareContainer&&e.desktop.getSelector().shareContainer.addEventListener("click",(function(t){if(t.preventDefault(),e.desktop.getSelector().shareContainer.classList.contains("share-active")){var i=t.target;(i.classList.contains("share-active")||i.classList.contains("player-lt__close-button"))&&e.desktop.inactiveModal()}}))}}]),e}();e.desktop=n}(ie||(ie={}));var re,se=function(){function e(t){i(this,e),s(this,"manager",void 0),s(this,"isPlaying",void 0),s(this,"switchButtonSet",void 0),this.manager=t,this.setTemplate()}return r(e,[{key:"setTemplate",value:function(){this.manager.instance.plyr.elements.wrapper.insertAdjacentHTML("afterend",this.manager.templateService.getShare(this.manager.playerConfig.getShareData()))}},{key:"activeModal",value:function(){var e=this.getSelector(),t=this.manager.instance;e.shareContainer.classList.remove("share-inactive"),e.shareContainer.classList.add("share-active"),window.a2a.init_all(),t.playerConfig.getShareData().canonicalUrl?this.setCopyContent(!1):t.playerConfig.getShareData().embedUrl?this.setCopyContent(!0):e.shareContainer.querySelector(".share-controller-top").classList.add("d-none"),this.setCopyButtonsEvents(),this.switchButtonSet||(this.setSwitchButton(),this.switchButtonSet=!0),t.plyr.playing?(this.isPlaying=!0,t.plyr.pause()):this.isPlaying=!1}},{key:"setSwitchButton",value:function(){var e=this,t=this.getSelector(),i=this.manager.instance;i.playerConfig.getShareData().embedUrl&&i.playerConfig.getShareData().canonicalUrl?t.switchButton.addEventListener("click",(function(){t.urlInput.classList.contains("canonicalUrl")?(t.urlInput.classList.remove("canonicalUrl"),t.urlInput.classList.add("embedUrl"),e.setCopyContent(!0)):(t.urlInput.classList.add("canonicalUrl"),t.urlInput.classList.remove("embedUrl"),e.setCopyContent(!1))})):t.switchButton.classList.add("d-none")}},{key:"setCopyContent",value:function(e){var t=this.getSelector(),i=this.manager.instance;if(!e)return t.urlInput.classList.add("canonicalUrl"),t.urlInput.innerHTML="".concat(i.playerConfig.getShareData().canonicalUrl),t.urlInput.dataset.copy=i.playerConfig.getShareData().canonicalUrl,void t.urlInput.addEventListener("click",(function(){window.open(i.playerConfig.getShareData().canonicalUrl)}));t.urlInput.classList.add("embedUrl");var n='<iframe width="560" height="315" src="'.concat(i.playerConfig.getShareData().embedUrl,'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');t.urlInput.innerText=n,t.urlInput.dataset.copy=n}},{key:"inactiveModal",value:function(){var e=this.getSelector(),t=this.manager.instance;e.shareContainer.classList.add("share-inactive"),e.shareContainer.classList.remove("share-active"),this.isPlaying&&t.plyr.play()}},{key:"getSelector",value:function(){return{buttons:[this.manager.instance.plyr.elements.container.querySelector(".poster-lt-player-share"),this.manager.instance.plyr.elements.controls.querySelector(".lt-player-share")],urlInput:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper").querySelector(".share-controller-url"),shareContainer:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper"),copyButtons:this.manager.instance.plyr.elements.container.querySelectorAll(".share-controller-link"),switchButton:this.manager.instance.plyr.elements.container.querySelector(".share-controller-wrapper").querySelector(".button_embed")}}},{key:"setCopyButtonsEvents",value:function(){var e=this.getSelector();e.copyButtons.length>0&&e.copyButtons.forEach((function(t){t.addEventListener("click",(function(){navigator.clipboard.writeText(e.urlInput.dataset.copy)}))}))}}]),e}(),ae=function(){function e(t){i(this,e),s(this,"manager",void 0),s(this,"isPlaying",void 0),this.manager=t}return r(e,[{key:"activeModal",value:function(){var e=this;if(this.manager.playerConfig.getShareData().canonicalUrl)this.createModal(),this.setCopyContent(!1);else{if(!this.manager.playerConfig.getShareData().embedUrl)return;this.createModal(),this.setCopyContent(!0)}window.a2a.init_all(),this.setCopyButtonsEvents(),this.setSwitchButton(),this.manager.instance.plyr.playing?(this.isPlaying=!0,this.manager.instance.plyr.pause()):this.isPlaying=!1,setTimeout((function(){var t=document.querySelector(".share-controller-wrapper"),i=document.querySelector(".share-controller-mobile-modal-header"),n=e;if(t){var r=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);r&&r.on("singletap",(function(e){e.preventDefault();var t=e.target;t.classList.contains("player-lt__close-button")||t.classList.contains("lt-player-mobile-share")||n.inactiveModal()}))}if(i){var s=e.manager.instance.eventInstance.mobileEvents.setMobileEvent(t);s&&s.on("pan",(function(e){e.preventDefault(),e.target.classList.contains("player-lt__close-button")||n.inactiveModal()}))}}),100)}},{key:"setSwitchButton",value:function(){var e=this,t=document.querySelector(".share-controller-wrapper").querySelector(".button_embed"),i=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url"),n=this.manager.instance;n.playerConfig.getShareData().embedUrl&&n.playerConfig.getShareData().canonicalUrl?t.addEventListener("click",(function(){i.classList.contains("canonicalUrl")?(i.classList.remove("canonicalUrl"),i.classList.add("embedUrl"),e.setCopyContent(!0)):(i.classList.add("canonicalUrl"),i.classList.remove("embedUrl"),e.setCopyContent(!1))})):t.classList.add("d-none")}},{key:"setCopyButtonsEvents",value:function(){var e=document.querySelectorAll(".share-controller-link"),t=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url");e.length>0&&e.forEach((function(e){e.addEventListener("click",(function(){navigator.clipboard.writeText(t.dataset.copy)}))}))}},{key:"setCopyContent",value:function(e){var t=this,i=document.querySelector(".share-controller-wrapper").querySelector(".share-controller-url");if(i){if(!e)return i.classList.add("canonicalUrl"),i.innerHTML="".concat(this.manager.instance.playerConfig.getShareData().canonicalUrl),i.dataset.copy=this.manager.instance.playerConfig.getShareData().canonicalUrl,void i.addEventListener("click",(function(){window.open(t.manager.instance.playerConfig.getShareData().canonicalUrl)}));i.classList.add("embedUrl");var n='<iframe width="560" height="315" src="'.concat(this.manager.instance.playerConfig.getShareData().embedUrl,'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');i.innerText=n,i.dataset.copy=n}}},{key:"createModal",value:function(){var e=this.manager.instance.templateService.getShare(this.manager.playerConfig.getShareData()),t=document.createElement("div");t.classList.add("lt-player-mobile-share-modal"),t.innerHTML=e;var i=document.querySelector("body");i&&i.appendChild(t)}},{key:"inactiveModal",value:function(){var e=document.querySelector(".lt-player-mobile-share-modal");e&&e.remove(),this.isPlaying&&this.manager.instance.plyr.play()}}]),e}(),oe=function(){function e(){i(this,e),s(this,"instance",void 0),s(this,"playerConfig",void 0),s(this,"iconService",void 0),s(this,"templateService",void 0),s(this,"events",{desktop:void 0,mobile:void 0}),s(this,"desktop",void 0),s(this,"mobile",void 0)}return r(e,[{key:"init",value:function(e){this.instance=e,this.playerConfig=e.playerConfig,this.templateService=e.templateService,this.iconService=e.iconService,this.appendScriptTag(),this.setByDevice()}},{key:"setByDevice",value:function(){switch(this.playerConfig.getDevice()){case"desktop":this.desktop=new se(this),this.events.desktop=new ie.desktop(this);break;case"mobile":this.mobile=new ae(this),this.events.mobile=new ie.mobile(this)}}},{key:"appendScriptTag",value:function(){var e=document.createElement("script");e.classList.add("lt-player-add-to-any"),e.type="text/javascript",e.src="https://static.addtoany.com/menu/page.js",e.async,document.body.appendChild(e)}},{key:"removeScriptTag",value:function(){var e=document.querySelector(".lt-player-add-to-any");e&&e.remove()}}]),e}(),le=function(){function e(){i(this,e),s(this,"instanceType",void 0),s(this,"playerConfig",void 0),s(this,"plyr",void 0),s(this,"objectFit",void 0)}return r(e,[{key:"init",value:function(e){this.instanceType=e,this.playerConfig=e.playerConfig,this.plyr=e.plyr,this.objectFit=e.playerConfig.getObjectFit(),this.appendObjectFit()}},{key:"appendObjectFit",value:function(){if(this.objectFit&&this.plyr.isHTML5){var e=this.plyr.elements.wrapper.querySelector("video");"cover"===this.objectFit&&(e.style.objectFit=this.objectFit)}}},{key:"removeObjectFit",value:function(){if(this.objectFit&&this.plyr.isHTML5){var e=this.plyr.elements.wrapper.querySelector("video");"cover"===this.objectFit&&(e.style.objectFit=null)}}}]),e}(),ce=function(){function e(t){i(this,e),s(this,"player",void 0),this.player=t}return r(e,[{key:"enableSubtitlesCheckbox",value:function(){this.player.playerConfig.getPlayerElementContainer().querySelector(".subtitles-body__input-switch").removeAttribute("disabled")}},{key:"disableSubtitlesCheckbox",value:function(){this.player.playerConfig.getPlayerElementContainer().querySelector(".subtitles-body__input-switch").setAttribute("disabled","")}},{key:"setCaptions",value:function(e){var t=this,i=this.player.playerConfig.getPlayerElementContainer().querySelector("video"),n=i.querySelector("track");if(this.player.plyr.currentTrack=-1,this.clearSubtitles(),n&&n.remove(),e){var r=document.createElement("track");Object.assign(r,{kind:"captions",label:"English captions",srclang:"en",default:"default",src:e}),r.addEventListener("load",(function(e){t.player.plyr.currentTrack=0})),this.enableSubtitlesCheckbox(),this.player.plyr.toggleCaptions(!0),i.appendChild(r)}else this.disableSubtitlesCheckbox()}},{key:"enableCaptions",value:function(){this.player.playerConfig.setCaptionsEnabled(!0),this.player.plyr.currentTrack=0,this.player.plyr.toggleCaptions(!0),this.player.statusFeedbackService.setCaptionsEnabled()}},{key:"disableCaptions",value:function(){this.player.playerConfig.setCaptionsEnabled(!1),this.player.plyr.currentTrack=-1,this.player.plyr.toggleCaptions(!1),this.clearSubtitles(),this.player.statusFeedbackService.clearCaptionsEnabled()}},{key:"clearSubtitles",value:function(){var e=this.player.plyr.elements.controls.querySelector(".lt-player-custom-captions").querySelector("span");e&&(e.innerHTML="")}}]),e}(),ue=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"element",void 0),this.player=t}return r(e,[{key:"getElement",value:function(){return this.element||(this.player.playerConfig?this.element=this.player.playerConfig.getPlayerElementContainer():console.error("Failed to get element from playerConfig")),this.element}},{key:"addClass",value:function(e){var t=this.getElement();t&&!t.classList.contains(e)&&t.classList.add(e)}},{key:"removeClass",value:function(e){var t=this.getElement();t&&t.classList.contains(e)&&t.classList.remove(e)}},{key:"setLoading",value:function(){this.addClass("lt-state-loader-active")}},{key:"setLoadingSeek",value:function(){this.addClass("lt-state-seeking"),this.setLoading()}},{key:"clearLoading",value:function(){this.removeClass("lt-state-loader-active"),this.removeClass("lt-state-seeking")}},{key:"setFullscreen",value:function(){this.addClass("lt-state-fullscreen")}},{key:"clearFullscreen",value:function(){this.removeClass("lt-state-fullscreen")}},{key:"setControlsVisible",value:function(){this.addClass("lt-state-controls-visible")}},{key:"clearControlsVisible",value:function(){this.removeClass("lt-state-controls-visible")}},{key:"setCaptionsEnabled",value:function(){this.addClass("lt-state-captions-enabled")}},{key:"clearCaptionsEnabled",value:function(){this.removeClass("lt-state-captions-enabled")}}]),e}(),de=r((function e(){i(this,e),s(this,"playerId",void 0),s(this,"windowService",void 0),s(this,"playerConfig",void 0),s(this,"playerControl",void 0),s(this,"plyr",void 0),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),s(this,"additionalInfoService",void 0),s(this,"miniPlayer",void 0),s(this,"devMethodePlayer",void 0),s(this,"devMethodePreload",void 0),s(this,"eventInstance",void 0),s(this,"posterManager",void 0),s(this,"share",void 0),s(this,"hls",void 0),s(this,"videoService",void 0),s(this,"captionsService",void 0),s(this,"statusFeedbackService",void 0),this.windowService=new q,this.iconService=new G,this.templateService=new $,this.playerControl=new L(this.templateService),this.posterManager=new ne,this.share=new oe,this.videoService=new le,this.captionsService=new ce(this),this.statusFeedbackService=new ue(this)})),he=function(){function e(){i(this,e),s(this,"player",void 0),s(this,"playerContainer",{width:null,height:null}),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"playerType",void 0),s(this,"instance",void 0),s(this,"observe",void 0),s(this,"event",{removeMiniPLOnFullScreen:function(e,t){var i=e.plyr.elements.controls.querySelector(".mini-player-control");if(i)switch(t){case"enterfullscreen":i.classList.add("d-none");break;case"exitfullscreen":i.classList.remove("d-none")}}})}return r(e,[{key:"init",value:function(e,t,i,n,r){this.instance=r,this.templateService=t,this.iconService=i,this.player=e,this.playerType=n,this.setup()}},{key:"enterMiniPlayer",value:function(){this.playerContainer.width=this.player.elements.wrapper.getBoundingClientRect().width,this.playerContainer.height=this.player.elements.wrapper.getBoundingClientRect().height,this.player.elements.wrapper.classList.add("lt-player-mini-enable"),this.player.elements.wrapper.classList.add("lt-player-mini-".concat(this.playerType)),this.setBackground(this.player.elements.wrapper),this.addMouseHoverControllers(),this.addPlayPauseEvents(),this.setSeekBar()}},{key:"setup",value:function(){var e=this.player,t=this;e.on("ready",(function(){var i=e.elements.container,n=e.elements.wrapper,r=i.querySelector(".mini-player-control");r&&r.addEventListener("click",(function(e){e.preventDefault(),t.playerContainer.width=i.getBoundingClientRect().width,t.playerContainer.height=i.getBoundingClientRect().height,n.classList.add("lt-player-mini-enable"),n.classList.add("lt-player-mini-".concat(t.playerType)),t.setBackground(n),t.addMouseHoverControllers(),t.addPlayPauseEvents(),t.setSeekBar(),t.exitMiniPlayer(t.player)}))}))}},{key:"setSeekBar",value:function(){var e=this.player,t=e.elements.container.querySelector(".lt-player-mini-player-controls__progress__seek");t.addEventListener("input",(function(){e.currentTime=parseInt(t.value)}));var i=function(t){var i=(t.value-t.min)/(t.max-t.min)*100;t.value=e.currentTime.toFixed(2).toString(),t.max=e.duration.toFixed(2).toString(),t.style.background="linear-gradient(to right, #D8D846 0%, #D8D846 "+i+"%, transparent "+i+"%, transparent 100%)"};e.on("timeupdate",(function(){t.value=e.currentTime.toFixed(2).toString(),t.max=e.duration.toFixed(2).toString(),i(t)})),i(t)}},{key:"setBackground",value:function(e){var t=this.templateService.getBackGroundTemplate({logo:this.iconService.getLogo()}),i=this.templateService.getControlsMiniPlayer({mini_player:"true",icons:this.iconService.getIconsByComponent("controls")});e.insertAdjacentHTML("afterend",t),e.children[0].insertAdjacentHTML("afterend",i),this.instance.playerConfig.getObserve()&&(void 0===this.instance.playerConfig.isObserveHeight()||this.instance.playerConfig.isObserveHeight())||this.setObserveBackground()}},{key:"setObserveBackground",value:function(){var e=this,t=this.player.elements.container.querySelector(".lt-player-mini-player-background");this.observe=new ResizeObserver((function(i){var n=i[0].contentRect.width,r=t.getBoundingClientRect().width;if(n>=r)if(n>e.playerContainer.width)103===e.player.elements.controls.getBoundingClientRect().height?(t.style.width="".concat(e.playerContainer.width,"px"),t.style.height="".concat(e.playerContainer.height,"px")):(t.style.width="".concat(e.player.elements.controls.getBoundingClientRect().width,"px"),t.style.height="".concat(e.player.elements.controls.getBoundingClientRect().height,"px"));else{t.style.width="".concat(e.playerContainer.width,"px");var s=e.playerContainer.height+(i[0].contentRect.width-e.playerContainer.width);t.style.height=s>100?"".concat(s,"px"):e.playerContainer.height}if(n<r){t.style.width="".concat(n,"px");var a=e.playerContainer.height-(e.playerContainer.width-i[0].contentRect.width);t.style.height=a>100?"".concat(a,"px"):e.playerContainer.height}})),this.observe.observe(document.body)}},{key:"addMouseHoverControllers",value:function(){var e=this.player.elements.container.querySelector(".lt-player-mini-enable");e.addEventListener("mouseover",(function(){var t=e.querySelector(".lt-player-mini-player-controls");t&&t.classList.add("lt-player-mini-player-controls-enable")})),e.addEventListener("mouseleave",(function(){var t=e.querySelector(".lt-player-mini-player-controls");t&&t.classList.remove("lt-player-mini-player-controls-enable")}))}},{key:"addPlayPauseEvents",value:function(){var e=this.player.elements.container,t=this.player,i=e.querySelector(".lt-player-mini-player-controls__play-button");if(i){var n=t.elements.container,r=n.querySelector(".lt-player-mini-player-controls__play-icon"),s=n.querySelector(".lt-player-mini-player-controls__pause-icon");t.playing?(r.classList.add("d-none"),s.classList.remove("d-none")):(s.classList.add("d-none"),r.classList.remove("d-none")),i.addEventListener("click",(function(e){e.preventDefault(),t.playing?(t.pause(),r.classList.remove("d-none"),s.classList.add("d-none")):(t.play(),s.classList.remove("d-none"),r.classList.add("d-none"))}))}}},{key:"exitMiniPlayer",value:function(e){var t=e.elements.container,i=t.querySelector(".lt-player-mini-player-controls__exit"),n=this;i&&i.addEventListener("click",(function(e){e.preventDefault(),t.querySelector(".lt-player-mini-player-controls").remove(),t.querySelector(".lt-player-mini-player-background").remove(),t.querySelector(".lt-player-mini-enable").classList.remove("lt-player-mini-".concat(n.playerType)),t.querySelector(".lt-player-mini-enable").classList.remove("lt-player-mini-enable"),n.observe.disconnect()}))}}]),e}();!function(e){var t=function(){function e(){i(this,e),s(this,"version",void 0)}return r(e,[{key:"setVersion",value:function(e){this.version=e}},{key:"processItem",value:function(e,t){return this.mapByVersion(e,t)}},{key:"mapByVersion",value:function(e,t){switch(e){case"embed":return n.processEmbed(t,this.version);case"preload":return n.processPreload(t,this.version);case"autoPlay":return n.processAutoPlay(t,this.version);case"videoTitle":return n.processVideoTitle(t,this.version);case"posterImage":return n.processPosterImage(t,this.version);case"fullscreenDisabled":return n.processFullscreenDisabled(t,this.version);case"videoParagraph":return n.processVideoParagraph(t,this.version);case"videoUrl":return n.processVideoUrl(t,this.version);case"playerContainer":return n.processPlayerContainer(t,this.version);case"share":return n.processShareData(t,this.version);case"vimeo":return n.processVimeoConfig(t,this.version);case"defaultConfig":return n.processDefaultConfig(t,this.version);case"chapters":return n.processChapters(t,this.version);case"device":return 1===this.version?t.device:t;case"playerType":return 1===this.version?t.playerType:t;case"observe":return n.processObserve(t,this.version);default:return t}}}]),e}();e.Map=t;var n=function(){function e(){i(this,e)}return r(e,null,[{key:"processObserve",value:function(e,t){var i={width:!1,height:!1};if(e&&1!==t&&0!==Object.keys(e).length)return Object.keys(e).forEach((function(t){var n;i.hasOwnProperty(t)&&(i[t]=!!(n=e[t])&&("boolean"==typeof n?n:"string"==typeof n?"true"===n||"TRUE"===n||"1"===n:"number"==typeof n&&1===n))})),i}},{key:"processChapters",value:function(e,t){if(e&&(1===t&&(e=e.chapters),0!==Object.keys(e).length))return e}},{key:"processDefaultConfig",value:function(e,t){var i={speed:{selected:1,captions:!1,update:!0},captions:{active:!1,update:!0},clickToPlay:!1,playsinline:!0,pip:!1};return e?(1===t||0===Object.keys(e).length||Object.keys(e).forEach((function(t){i[t],i[t]=e[t]})),i):i}},{key:"processVimeoConfig",value:function(e,t){var i={controls:!1,active:!1,gesture:"media",transparent:!0,speed:!0,portrait:!0,keyboard:!1,title:!1,byline:!1,playsinline:!0,background:!0};return 1===t?i:e?(0===Object.keys(e).length||Object.keys(e).forEach((function(t){i[t],i[t]=e[t]})),i):i}},{key:"processShareData",value:function(e,t){if(!e)return null;var i,n,r={canonicalUrl:void 0,embedUrl:void 0,title:void 0};return 1===t&&(e={canonicalUrl:null!==(i=e.canonical_url)&&void 0!==i?i:null,embedUrl:"".concat(window.location.origin,"/embed/").concat(e.id),title:null!==(n=e.title)&&void 0!==n?n:null}),0!==Object.keys(e).length?(void 0!==e.canonicalUrl&&(r.canonicalUrl=e.canonicalUrl),void 0!==e.embedUrl&&(r.embedUrl=e.embedUrl),void 0!==e.title&&(r.title=e.title),r):void 0}},{key:"processPlayerContainer",value:function(e,t){return e?1===t?e.playerContainer:e:null}},{key:"processVideoUrl",value:function(e,t){if(!e)return null;1===t&&"object"===d(e)&&(e=e.sources.video_id);var i={videoUrl:void 0,videoType:void 0,embedHash:void 0,embedId:void 0,origin:void 0};return Z.isValidHttpUrl(e)?(i=function(e,t,i){if("string"==typeof e&&(i.videoUrl=e),t.origin&&(i.origin=t.origin),t.type&&(i.videoType=t.type.toLowerCase()),"embedded"===t.type){var n=Z.getEmbeddedID(e);n&&(i.embedId=n);var r=Z.getEmbeddedHash(e);r&&(i.embedHash=r)}return i}(e,Z.processConfigData(e),i),i):(console.error("Please insert valid url video url videoURL : ".concat(e)),i)}},{key:"processVideoParagraph",value:function(e,t){if(!e)return null;var i=void 0;return 1===t&&"object"===d(e)&&(e=e.author),"string"==typeof e&&/[a-zA-Z]/.test(e)&&(i=e),i}},{key:"processPosterImage",value:function(e,t){return e?1===t&&"object"===d(e)?e.poster:Z.isValidHttpUrl(e)?e:void console.error("Set valid url for poster image config item => posterImage : ".concat(e," ")):null}},{key:"processVideoTitle",value:function(e,t){if(!e)return null;var i=void 0;return 1===t&&"object"===d(e)&&(e=e.title),e&&"string"==typeof e&&/[a-zA-Z]/.test(e)&&(i=e),i}},{key:"processAutoPlay",value:function(e,t){if(!e)return null;var i=!1;return 1===t||("string"==typeof e&&"true"===e&&(i=!0),"boolean"==typeof e&&e&&(i=!0)),i}},{key:"processPreload",value:function(e,t){if(!e)return null;if(1!==t){var i=function(e,t){return t.autoType=!0,void 0!==e.onload&&("string"==typeof e.onload&&"false"===e.onload&&(t.autoType=!1),"boolean"==typeof e.onload&&(e.onload||(t.autoType=!1))),t},n=function(e){return e.isActive=!0,e},r={start:0,stop:10,isActive:!1,autoType:!1};return"object"===d(e)?0!==Object.keys(e).length?r=n(r=i(e,r=function(e,t){if(e.start){var i=e.start;"string"==typeof i&&(i=parseFloat(i)),t.start=i,i||(t.start=0)}if(e.stop){var n=e.stop;"string"==typeof n&&(n=parseFloat(n)),t.stop=n,n||(t.stop=10)}return t}(e,r))):0===Object.keys(e).length&&(r=n(r=i(e,r))):"string"==typeof e&&"false"!==e?"true"===e&&(r=n(r=i(e,r))):"boolean"==typeof e&&!!e&&(r=n(r=i(e,r)))}}},{key:"processEmbed",value:function(e,t){if(!e)return null;var i=!1;return 1===t||("string"==typeof e&&"true"===e&&(i=!0),"boolean"==typeof e&&e&&(i=!0)),i}},{key:"processFullscreenDisabled",value:function(e,t){var i=!1;return"string"==typeof e&&"true"===e&&(i=!0),"boolean"==typeof e&&e&&(i=!0),i}}]),e}();e.Processor=n}(re||(re={}));var pe=function(){function e(t){i(this,e),s(this,"configData",{version:null,pinText:!1,pinSeekBar:!1,pinControls:!1,embed:!1,preload:!1,autoPlay:!1,fullscreenDisabled:!1,videoTitle:"",posterImage:"",videoParagraph:"",videoUrl:!1,playerId:"",externalId:"",playerContainer:"",vimeo:!1,youtube:{controls:0,noCookie:!1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,playsinline:!0},defaultConfig:!1,captionsEnabled:!1,share:null,chapters:null,playerType:null,device:"desktop",observe:!1,videoObjectFit:!1}),s(this,"processor",void 0),this.processor=new re.Map,this.setVersion(t),this.processor.setVersion(this.configData.version)}return r(e,[{key:"mapConfigData",value:function(e){var t=this;Object.keys(this.configData).forEach((function(i){if(1===t.processor.version){var n=t.processor.processItem(i,e);n&&(t.configData[i]=n)}else{var r,s=t.processor.processItem(i,null!==(r=e[i])&&void 0!==r?r:null);s&&(t.configData[i]=s)}}))}},{key:"setObjectFit",value:function(e,t){var i=this;return new Promise((function(n){if(e.isHTML5){var r=e.elements.wrapper.querySelector("video");r&&r.addEventListener("loadedmetadata",(function(e){var s=Z.getVideoOrientation(r.videoWidth,r.videoHeight);i.configData.videoObjectFit=s===t?"cover":"clip",n(!0)}))}}))}},{key:"isPinTextControls",value:function(){return this.configData.pinText}},{key:"isPinSeekBarControls",value:function(){return this.configData.pinSeekBar}},{key:"isPinBottomControls",value:function(){return this.configData.pinControls}},{key:"getObjectFit",value:function(){return this.configData.videoObjectFit}},{key:"setVersion",value:function(e){if("string"==typeof e)return this.configData.version=parseInt(e);this.configData.version=e}},{key:"getVersion",value:function(){return this.configData.version}},{key:"getObserve",value:function(){return this.configData.observe}},{key:"isObserveHeight",value:function(){return this.configData.observe.height}},{key:"isObserveWidth",value:function(){return this.configData.observe.width}},{key:"getDimensions",value:function(){return this.configData.dimensions}},{key:"getAdditionalInfo",value:function(){return this.configData.additionalInfo}},{key:"getVideoTitle",value:function(){return this.configData.videoTitle}},{key:"getPosterImage",value:function(){return this.configData.posterImage}},{key:"setPosterImage",value:function(e){this.configData.posterImage=e}},{key:"getParagraph",value:function(){return this.configData.videoParagraph}},{key:"getVideoType",value:function(){return this.configData.videoUrl.videoType}},{key:"getVideoUrl",value:function(){return this.configData.videoUrl}},{key:"getPlayerId",value:function(){return this.configData.playerId}},{key:"getConfigData",value:function(){return this.configData}},{key:"getPlayerElementContainer",value:function(){return this.configData.playerContainer}},{key:"getVideoOrigin",value:function(){return this.configData.videoUrl.origin}},{key:"getConfigByOrigin",value:function(e){return void 0!==this.configData[e]?this.configData[e]:null}},{key:"getDefaultConfigItems",value:function(){return this.configData.defaultConfig}},{key:"getChapters",value:function(){return this.configData.chapters}},{key:"isShareData",value:function(){return!!this.configData.share&&Object.keys(this.configData.share).length>0}},{key:"getShareData",value:function(){return this.configData.share}},{key:"getCaptions",value:function(){return this.configData.defaultConfig.captions}},{key:"getPlayerType",value:function(){return this.configData.playerType}},{key:"setPlayerId",value:function(e){this.configData.playerId=e}},{key:"isAutoPlay",value:function(){return this.configData.autoPlay}},{key:"getPreload",value:function(){return this.configData.preload}},{key:"isAutoPreload",value:function(){return this.configData.preload.autoType}},{key:"getDevice",value:function(){return this.configData.device}},{key:"getEmbedOrigin",value:function(){return s({},this.getVideoOrigin(),this.getConfigByOrigin(this.getVideoOrigin()))}},{key:"getFullscreenMode",value:function(){return this.configData.fullscreenDisabled?{fullscreen:{enabled:!1}}:{fullscreen:{enabled:!0}}}},{key:"getEmbed",value:function(){return this.configData.embed}},{key:"getCaptionsEnabled",value:function(){return this.configData.captionsEnabled}},{key:"setCaptionsEnabled",value:function(e){this.configData.captionsEnabled=e}},{key:"hasCaptionsUrl",value:function(){return!!this.getDefaultConfigItems().captions.url}}]),e}(),fe=__webpack_require__(1443),ge=__webpack_require__.n(fe),ye=(__webpack_require__(840),function(){function e(){i(this,e),s(this,"player",void 0),s(this,"plyr",void 0),s(this,"preloadPoster",{ready:function(e){var t=e.playerConfig.getPreload();X.preloadEvents.removePosterImage(e),t.autoType&&(e.plyr.isEmbed&&X.preloadEvents.embedPlay(e,"event"),e.plyr.isHTML5&&X.preloadEvents.html5Play(e,"event"))},timeUpdate:function(e,t){X.preloadEvents.stop(e,t)}})}return r(e,[{key:"setupCommon",value:function(){this.playerPlay(),this.plyrOnPlaying(),this.plyrOnSeeking(),this.plyrOnControlsShown(),this.plyrOnCanplay()}},{key:"playerPlay",value:function(){var e=this.player;this.plyr.on("play",(function(t){e.plyr.elements.controls.classList.contains("plyr__controls-enable")||e.plyr.elements.controls.classList.add("plyr__controls-enable"),e.desktopEvents.playPause(t),e.additionalInfoService&&e.additionalInfoService.setCurrentPlayerPlay(e,t)}))}},{key:"setDefaultSettingsConfig",value:function(){var e=this.player;if(e.plyr.speed=1,!e.plyr.isEmbed)return e.plyr.captions.currentTrack>=0?void e.plyr.toggleCaptions(!0):void e.plyr.toggleCaptions(!1);e.plyr.embed.getTextTracks().then((function(t){0===t.length?e.plyr.toggleCaptions(!1):e.plyr.toggleCaptions(!0)}))}},{key:"removeDesktopPlyrEvents",value:function(){this.plyr.eventListeners.forEach((function(e){"dblclick"===e.type&&e.element.removeEventListener(e.type,e.callback,e.options)}))}},{key:"removeMobilePlyrEvents",value:function(){var e=this.plyr,t=this.player;e.eventListeners.forEach((function(e){if("mobile"===t.playerConfig.getDevice()){var i=function(){e.element.classList.contains("plyr__progress")||e.element.classList.contains("plyr__progress__seek")||e.element.removeEventListener(e.type,e.callback,e.options),0===e.element.classList.length&&e.element.removeEventListener(e.type,e.callback,e.options)};"touchstart"===e.type&&i(),"touchend"===e.type&&i(),"touchmove"===e.type&&i(),"mousemove"===e.type&&i(),"click"===e.type&&e.element.removeEventListener(e.type,e.callback,e.options)}}))}},{key:"onReadyPlayer",value:function(){if(this.player.playerConfig.getShareData()&&("mobile"===this.player.playerConfig.getDevice()?this.player.share.events.mobile.init():this.player.share.events.desktop.init()),this.player.posterManager.mobileEvents.onload(this.player),this.player.playerConfig.isAutoPlay()){var e=this.player.plyr.elements.container,t=function(){e.querySelector(".lt-player__poster").classList.add("d-none"),e.querySelector(".plyr__controls").classList.remove("d-none")};this.player.plyr.embed?(t(),e.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",K.getSpinner()),this.player.plyr.embed.play().then((function(){K.removeSpinner(e)})),K.removeSpinner(e)):(this.player.plyr.play(),t())}}},{key:"endVideo",value:function(){this.player.desktopEvents.endVideo(this.player)}},{key:"timeUpdate",value:function(e){this.player.playerControl.chaptersService&&this.player.playerControl.chaptersService.updateCurrentTimeAndTitle(this.player,e)}},{key:"setCustomSubtitles",value:function(e,t){var i=t.detail.plyr,n=e.querySelector(".lt-player-custom-captions").querySelector("span");n&&i.captions.currentTrackNode.activeCues&&(i.captions.currentTrackNode.activeCues.length>0?n.innerHTML=i.captions.currentTrackNode.activeCues[0].text:n.innerHTML="")}},{key:"clearCustomSubtitles",value:function(e){var t=e.querySelector(".lt-player-custom-captions").querySelector("span");t&&(t.innerHTML="")}},{key:"plyrOnSeeking",value:function(){var e=this.player;this.plyr.on("seeking",(function(){e.statusFeedbackService.setLoadingSeek()}))}},{key:"plyrOnPlaying",value:function(){var e=this.player;this.plyr.on("playing",(function(){e.statusFeedbackService.clearLoading()}))}},{key:"plyrOnCanplay",value:function(){var e=this.player;this.plyr.on("canplay",(function(){e.statusFeedbackService.clearLoading()}))}},{key:"plyrOnControlsShown",value:function(){var e=this.player;this.plyr.on("controlsshown",(function(){e.statusFeedbackService.setControlsVisible()}))}}]),e}());var me=function(e){u(a,e);var t,n,s=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=p(t);if(n){var r=p(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return h(this,e)});function a(){return i(this,a),s.apply(this,arguments)}return r(a,[{key:"setup",value:function(e){this.player=e.player,this.plyr=e.plyr,this.removeDesktopPlyrEvents(),this.plyrOnReady(),this.plyrEmbedOnReady(),this.plyrEndVideo(),this.plyrFullScreen(),this.plyrTimeUpdate(),this.plyrOnPlay(),this.plyrOnPause(),this.plyrOnSeek(),this.plyrOnCueChange(),this.setupCommon()}},{key:"plyrOnSeek",value:function(){var e=this,t=this.player,i=this.plyr;i.on("seeked",(function(){if(!0===i.stopped&&e.endVideo(),i.isEmbed){if(i.paused)return;t.plyr.elements.container.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",K.getSpinner())}}))}},{key:"plyrOnReady",value:function(){var e=this,t=this.player;this.plyr.on("ready",(function(){t.playerConfig.getPlayerId()||(t.playerConfig.setPlayerId(t.plyr.id),t.playerId=t.playerConfig.getPlayerId()),e.setDefaultSettingsConfig(),t.plyr.isHTML5&&(t.hls&&t.hls.init(),e.onReadyPlayer(),e.modal(t),t.posterManager.desktopEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)),t.playerControl.desktopEvents.showHide(t),t.playerControl.desktopEvents.fullScreenButtons(t),t.playerControl.desktopEvents.playPauseIcon(t,"ready"),t.playerControl.desktopEvents.backwardForward(t),t.playerControl.desktopEvents.backwardForwardSeconds(t),t.playerControl.desktopEvents.volume(t),t.playerControl.settingsControlsManager.init(t),t.playerControl.chaptersService&&t.playerControl.chaptersService.setButtonsEvents(t)}))}},{key:"modal",value:function(e){window.addEventListener("click",(function(t){e.additionalInfoService&&e.additionalInfoService.desktopEvents.windowDesktopEvents(t,e),T.closeSettingsEvent(t)}))}},{key:"plyrEmbedOnReady",value:function(){var e=this,t=this.player,i=this.plyr;i.isEmbed&&i.on("ready",(function(){i.embed.ready().then((function(){e.modal(t),e.onReadyPlayer(),t.posterManager.desktopEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)}))}))}},{key:"plyrEndVideo",value:function(){var e=this;this.plyr.on("ended",(function(){e.endVideo()}))}},{key:"plyrFullScreen",value:function(){var e=this.player,t=this.plyr;t.on("enterfullscreen",(function(t){e.statusFeedbackService.setFullscreen(),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"enterfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"enterfullscreen"),e.videoService.removeObjectFit()})),t.on("exitfullscreen",(function(t){e.statusFeedbackService.clearFullscreen(),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"exitfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"exitfullscreen"),e.videoService.appendObjectFit()}))}},{key:"plyrTimeUpdate",value:function(){var e=this,t=this.player,i=this.plyr;i.on("timeupdate",(function(n){e.timeUpdate(n),t.playerConfig.getPreload().isActive&&e.preloadPoster.timeUpdate(t,"event"),K.removeSpinner(i.elements.container),t.playerControl.desktopEvents.playPauseIcon(t,"timeupdate")}))}},{key:"plyrOnPlay",value:function(){var e=this.player,t=this.plyr;t.on("play",(function(i){e.statusFeedbackService.setLoading(),K.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnPause",value:function(){var e=this.player,t=this.plyr;t.on("pause",(function(i){K.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnCueChange",value:function(){var e=this,t=this.player,i=this.plyr;i.on("cuechange",(function(n){t.playerConfig.getCaptionsEnabled()&&i.currentTrack>=0&&e.setCustomSubtitles(i.elements.controls,n)}))}}]),a}(ye);var ve,Me=function(e){u(o,e);var t,n,a=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,i=p(t);if(n){var r=p(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return h(this,e)});function o(){var e;i(this,o);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return s(l(e=a.call.apply(a,[this].concat(n))),"setMobileEvent",(function(t){if("mobile"===l(e).player.playerConfig.getDevice()){var i=new Hammer.Manager(t);return i.add(new Hammer.Pan({direction:30})),i.add(new Hammer.Tap({event:"tripletap",taps:3})),i.add(new Hammer.Tap({event:"doubletap",taps:2})),i.add(new Hammer.Tap({event:"singletap"})),i.get("doubletap").recognizeWith("singletap"),i.get("singletap").requireFailure("doubletap"),i.get("tripletap").recognizeWith("doubletap"),i.get("doubletap").requireFailure("tripletap"),i.get("pan").set({direction:Hammer.DIRECTION_DOWN}),i}})),e}return r(o,[{key:"setup",value:function(e){this.player=e.player,this.plyr=e.plyr,this.removeMobilePlyrEvents(),this.plyrOnReady(),this.plyrEmbedOnReady(),this.plyrEndVideo(),this.plyrFullScreen(),this.plyrTimeUpdate(),this.plyrOnPlay(),this.plyrOnPause(),this.plyrOnSeek(),this.plyrOnCueChange(),this.setupCommon()}},{key:"plyrOnSeek",value:function(){var e=this,t=this.player,i=this.plyr;i.on("seeked",(function(){if(!0===i.stopped&&e.endVideo(),i.isEmbed){if(i.paused)return;t.plyr.elements.container.querySelector(".lt-player__poster").insertAdjacentHTML("afterend",K.getSpinner())}}))}},{key:"plyrOnReady",value:function(){var e=this,t=this.player;this.plyr.on("ready",(function(){t.playerConfig.getPlayerId()||(t.playerConfig.setPlayerId(t.plyr.id),t.playerId=t.playerConfig.getPlayerId()),e.setDefaultSettingsConfig(),t.plyr.isHTML5&&(t.hls&&t.hls.init(),e.onReadyPlayer(),t.posterManager.mobileEvents.posterBody(t),t.playerControl.mobileEvents.seekBar(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)),t.posterManager.mobileEvents.showControls(t),t.playerControl.mobileEvents.controlsTimeShow(t),t.playerControl.mobileEvents.fullScreenButtons(t),t.playerControl.mobileEvents.playPauseIcon(t,"ready"),t.playerControl.mobileEvents.backwardForward(t),t.playerControl.mobileEvents.backwardForwardSeconds(t),t.playerControl.mobileEvents.volume(t),t.playerControl.settingsControlsManager.init(t),t.playerControl.chaptersService&&t.playerControl.chaptersService.setMobileButtonEvents(t)}))}},{key:"plyrEmbedOnReady",value:function(){var e=this,t=this.player,i=this.plyr;i.isEmbed&&i.on("ready",(function(){i.embed.ready().then((function(){e.onReadyPlayer(),t.playerControl.mobileEvents.seekBar(t),t.posterManager.mobileEvents.posterBody(t),t.playerConfig.getPreload()&&e.preloadPoster.ready(t)}))}))}},{key:"plyrEndVideo",value:function(){var e=this;this.plyr.on("ended",(function(){e.endVideo()}))}},{key:"plyrFullScreen",value:function(){var e=this.player,t=this.plyr;t.on("enterfullscreen",(function(t){e.statusFeedbackService.setFullscreen(),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"enterfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"enterfullscreen"),e.videoService.removeObjectFit()})),t.on("exitfullscreen",(function(t){e.statusFeedbackService.clearFullscreen(),e.miniPlayer.event.removeMiniPLOnFullScreen(e,"exitfullscreen"),e.playerControl.desktopEvents.fullscreenIcon(e,"exitfullscreen"),e.videoService.appendObjectFit()}))}},{key:"plyrTimeUpdate",value:function(){var e=this,t=this.player,i=this.plyr;i.on("timeupdate",(function(n){t.playerConfig.getPreload().isActive&&e.preloadPoster.timeUpdate(t,"event"),K.removeSpinner(i.elements.container),e.timeUpdate(n),t.playerControl.desktopEvents.playPauseIcon(t,"timeupdate"),t.playerControl.mobileEvents.removePlyrControlsClass(t)}))}},{key:"plyrOnPlay",value:function(){var e=this.player;this.plyr.on("play",(function(t){e.statusFeedbackService.setLoading(),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnPause",value:function(){var e=this.player,t=this.plyr;t.on("pause",(function(i){K.removeSpinner(t.elements.container),e.playerControl.desktopEvents.playPauseIcon(e,"timeupdate")}))}},{key:"plyrOnCueChange",value:function(){var e=this,t=this.player,i=this.plyr;i.on("cuechange",(function(n){t.playerConfig.getCaptionsEnabled()&&i.currentTrack>=0&&e.setCustomSubtitles(i.elements.controls,n)}))}}]),o}(ye),Te=function(){function e(t){i(this,e),s(this,"player",void 0),s(this,"plyr",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.player=t,this.plyr=t.plyr,this.setup()}return r(e,[{key:"setup",value:function(){"mobile"===this.player.playerConfig.getDevice()?(this.mobileEvents=new Me,this.mobileEvents.setup(this)):(this.desktopEvents=new me,this.desktopEvents.setup(this))}}]),e}();function Le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e){var t=function(){function e(){i(this,e)}return r(e,[{key:"playPause",value:function(e){var t=window.Player.players,i=e.detail.plyr;t.forEach((function(e){e.plyr!=i&&(e.plyr.pause(),e.plyr.on("ready",(function(){var t=e.plyr.elements.container,i=t.querySelector(".lt-player-mini-player-controls");i&&i.remove();var n=t.querySelector(".lt-player-mini-player-background");n&&n.remove();var r=t.querySelector(".lt-player-mini-enable"),s=t.querySelector(".lt-player-mini-".concat(e.playerConfig.getPlayerType()));r&&r.classList.remove("lt-player-mini-enable"),s&&s.classList.remove(".lt-player-mini-".concat(e.playerConfig.getPlayerType()))})))}))}},{key:"endVideo",value:function(e){var t,i,n,r,s=e.plyr,a=s.elements.container;t=a.querySelector(".lt-player__poster"),i=a.querySelector(".plyr__controls"),n=a.querySelector(".lt-player__poster__image-body"),a.classList.add("plyr--stopped"),t.classList.remove("d-none"),i.classList.add("d-none"),n&&n.classList.remove("lt-player__poster__image-body--preload"),s.poster||(s.poster=e.playerConfig.getPosterImage()),function(){var e=a.querySelector(".settings-controllers");if(e){if(e.classList.contains("settings-controllers-enable")){var t=a.querySelector(".settings-controllers");s.elements.controls.classList.remove("plyr__controls-enable-settings"),t.classList.remove("settings-controllers-enable");var i=document.querySelector(".settings-controllers-enable__background");i.classList.contains("d-none")||i.classList.add("d-none")}}else{var n=document.querySelector(".lt-player-mobile-settings-modal");n&&n.remove()}}(),(r={controls:a.querySelector(".lt-player-mini-player-controls"),background:a.querySelector(".lt-player-mini-player-background"),enable:a.querySelector(".lt-player-mini-enable"),size:a.querySelector(".lt-player-mini-".concat(e.playerConfig.getPlayerType()))}).controls&&r.controls.remove(),r.background&&r.background.remove(),r.size&&r.size.classList.remove("lt-player-mini-".concat(e.playerConfig.getPlayerType())),r.enable&&r.enable.classList.remove("lt-player-mini-enable"),s.fullscreen.active&&s.fullscreen.exit(),function(){var e=s.elements.controls;e.classList.contains("plyr__controls-enable")&&e.classList.remove("plyr__controls-enable");var t=e.querySelector(".bottom-controller__volume_control");if(t){var i=t.querySelector(".button-open"),n=t.querySelector(".volume_control__background"),r=t.querySelector(".volume_control__background__area"),a=t.querySelector(".volume_control__background__area__range");i&&i.classList.remove("d-none"),n&&n.classList.add("d-none"),r&&r.classList.add("d-none"),a&&a.classList.remove("volume-area-open"),t&&(t.classList.remove("volume-area-open"),t.classList.remove("volume-control-enable"))}var o=s.elements.container.querySelector(".plyr__controls__mobile-background");o&&(o.classList.contains("d-none")||o.classList.add("d-none"))}(),e.plyr.elements.container.classList.contains("plyr__poster-enabled")||e.plyr.elements.container.classList.add("plyr__poster-enabled"),e.statusFeedbackService.clearLoading()}}]),e}();e.Desktop=t;var n=r((function e(){i(this,e)}));e.Mobile=n}(ve||(ve={}));var be,Ee,Ie,Ne,Se,we={exports:{}};be=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,Ee=/^(?=([^\/?#]*))\1([^]*)$/,Ie=/(?:\/|^)\.(?=\/)/g,Ne=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,we.exports=Se={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var n=Se.parseURL(e);if(!n)throw new Error("Error trying to parse base URL.");return n.path=Se.normalizePath(n.path),Se.buildURLFromParts(n)}var r=Se.parseURL(t);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return i.alwaysNormalize?(r.path=Se.normalizePath(r.path),Se.buildURLFromParts(r)):t;var s=Se.parseURL(e);if(!s)throw new Error("Error trying to parse base URL.");if(!s.netLoc&&s.path&&"/"!==s.path[0]){var a=Ee.exec(s.path);s.netLoc=a[1],s.path=a[2]}s.netLoc&&!s.path&&(s.path="/");var o={scheme:s.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(o.netLoc=s.netLoc,"/"!==r.path[0]))if(r.path){var l=s.path,c=l.substring(0,l.lastIndexOf("/")+1)+r.path;o.path=Se.normalizePath(c)}else o.path=s.path,r.params||(o.params=s.params,r.query||(o.query=s.query));return null===o.path&&(o.path=i.alwaysNormalize?Se.normalizePath(r.path):r.path),Se.buildURLFromParts(o)},parseURL:function(e){var t=be.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(Ie,"");e.length!==(e=e.replace(Ne,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};var Ae=we.exports;function Ce(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function De(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(i),!0).forEach((function(t){ke(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ce(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function ke(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},je.apply(this,arguments)}const xe=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)};let _e=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e}({}),Oe=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),Pe=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({});const Re=function(){},ze={trace:Re,debug:Re,log:Re,warn:Re,info:Re,error:Re};let Fe=ze;const Ue=Fe,Ye=/^(\d+)x(\d+)$/,Be=/(.+?)=(".*?"|.*?)(?:,|$)/g;class $e{constructor(e){"string"==typeof e&&(e=$e.parseAttrList(e));for(const t in e)e.hasOwnProperty(t)&&("X-"===t.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(t)),this[t]=e[t])}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;const i=new Uint8Array(t.length/2);for(let e=0;e<t.length/2;e++)i[e]=parseInt(t.slice(2*e,2*e+2),16);return i}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}bool(e){return"YES"===this[e]}decimalResolution(e){const t=Ye.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e){let t;const i={};for(Be.lastIndex=0;null!==(t=Be.exec(e));){let e=t[2];0===e.indexOf('"')&&e.lastIndexOf('"')===e.length-1&&(e=e.slice(1,-1)),i[t[1].trim()]=e}return i}}function Ge(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}class Qe{constructor(e,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){const i=t.attr;for(const t in i)if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==i[t]){Ue.warn(`DATERANGE tag attribute: "${t}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=t;break}e=je(new $e({}),i,e)}if(this.attr=e,this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const e=new Date(this.attr["END-DATE"]);xe(e.getTime())&&(this._endDate=e)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(xe(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&xe(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class He{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var qe="audio",We="video",Ze="audiovideo";class Ve{constructor(e){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[qe]:null,[We]:null,[Ze]:null},this.baseurl=e}setByteRange(e,t){const i=e.split("@",2),n=[];1===i.length?n[0]=t?t.byteRangeEndOffset:0:n[0]=parseInt(i[1]),n[1]=parseInt(i[0])+n[0],this._byteRange=n}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Ae.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}}class Ke extends Ve{constructor(e,t){super(t),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new He,this.urlId=0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.type=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{const e=Object.keys(this.levelkeys);if(1===e.length)return this._decryptdata=this.levelkeys[e[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!xe(this.programDateTime))return null;const e=xe(this.duration)?this.duration:0;return this.programDateTime+1e3*e}get encrypted(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){const e=Object.keys(this.levelkeys),t=e.length;if(t>1||1===t&&this.levelkeys[e[0]].encrypted)return!0}return!1}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}setElementaryStreamInfo(e,t,i,n,r,s=!1){const{elementaryStreams:a}=this,o=a[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,n),o.endDTS=Math.max(o.endDTS,r)):a[e]={startPTS:t,endPTS:i,startDTS:n,endDTS:r,partial:s}}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e.audio=null,e.video=null,e.audiovideo=null}}class Xe extends Ve{constructor(e,t,i,n,r){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new He,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=n;const s=e.enumeratedString("BYTERANGE");s&&this.setByteRange(s,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}class Je{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e)return this.advanced=!0,void(this.updated=!0);const t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&xe(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function et(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0)))}function tt(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(e=>e.charCodeAt(0)))}var it={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},nt="org.w3.clearkey",rt="com.apple.streamingkeydelivery",st="com.microsoft.playready",at="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function ot(e){switch(e){case rt:return it.FAIRPLAY;case st:return it.PLAYREADY;case at:return it.WIDEVINE;case nt:return it.CLEARKEY}}var lt="edef8ba979d64acea3c827dcd51d21ed";function ct(e){switch(e){case it.FAIRPLAY:return rt;case it.PLAYREADY:return st;case it.WIDEVINE:return at;case it.CLEARKEY:return nt}}function ut(e){const{drmSystems:t,widevineLicenseUrl:i}=e,n=t?[it.FAIRPLAY,it.WIDEVINE,it.PLAYREADY,it.CLEARKEY].filter((e=>!!t[e])):[];return!n[it.WIDEVINE]&&i&&n.push(it.WIDEVINE),n}const dt="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function ht(e,t,i){return Uint8Array.prototype.slice?e.slice(t,i):new Uint8Array(Array.prototype.slice.call(e,t,i))}const pt=(e,t)=>t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,ft=(e,t)=>t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128,gt=(e,t)=>{const i=t;let n=0;for(;pt(e,t);)n+=10,n+=yt(e,t+6),ft(e,t+10)&&(n+=10),t+=n;if(n>0)return e.subarray(i,i+n)},yt=(e,t)=>{let i=0;return i=(127&e[t])<<21,i|=(127&e[t+1])<<14,i|=(127&e[t+2])<<7,i|=127&e[t+3],i},mt=(e,t)=>pt(e,t)&&yt(e,t+6)+10<=e.length-t,vt=e=>e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info,Mt=e=>{const t=String.fromCharCode(e[0],e[1],e[2],e[3]),i=yt(e,4);return{type:t,size:i,data:e.subarray(10,10+i)}},Tt=e=>{let t=0;const i=[];for(;pt(e,t);){const n=yt(e,t+6);t+=10;const r=t+n;for(;t+8<r;){const n=Mt(e.subarray(t)),r=Lt(n);r&&i.push(r),t+=n.size+10}ft(e,t)&&(t+=10)}return i},Lt=e=>"PRIV"===e.type?bt(e):"W"===e.type[0]?It(e):Et(e),bt=e=>{if(e.size<2)return;const t=St(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}},Et=e=>{if(e.size<2)return;if("TXXX"===e.type){let t=1;const i=St(e.data.subarray(t),!0);t+=i.length+1;const n=St(e.data.subarray(t));return{key:e.type,info:i,data:n}}const t=St(e.data.subarray(1));return{key:e.type,data:t}},It=e=>{if("WXXX"===e.type){if(e.size<2)return;let t=1;const i=St(e.data.subarray(t),!0);t+=i.length+1;const n=St(e.data.subarray(t));return{key:e.type,info:i,data:n}}const t=St(e.data);return{key:e.type,data:t}},Nt=e=>{if(8===e.data.byteLength){const t=new Uint8Array(e.data),i=1&t[3];let n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,i&&(n+=47721858.84),Math.round(n)}},St=(e,t=!1)=>{const i=At();if(i){const n=i.decode(e);if(t){const e=n.indexOf("\0");return-1!==e?n.substring(0,e):n}return n.replace(/\0/g,"")}const n=e.length;let r,s,a,o="",l=0;for(;l<n;){if(r=e[l++],0===r&&t)return o;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:s=e[l++],o+=String.fromCharCode((31&r)<<6|63&s);break;case 14:s=e[l++],a=e[l++],o+=String.fromCharCode((15&r)<<12|(63&s)<<6|(63&a)<<0)}}return o};let wt;function At(){return wt||void 0===self.TextDecoder||(wt=new self.TextDecoder("utf-8")),wt}const Ct=function(e){let t="";for(let i=0;i<e.length;i++){let n=e[i].toString(16);n.length<2&&(n="0"+n),t+=n}return t},Dt=Math.pow(2,32)-1,kt=[].push,jt={video:1,audio:2,id3:3,text:4};function xt(e){return String.fromCharCode.apply(null,e)}function _t(e,t){const i=e[t]<<8|e[t+1];return i<0?65536+i:i}function Ot(e,t){const i=Pt(e,t);return i<0?4294967296+i:i}function Pt(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Rt(e,t,i){e[t]=i>>24,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function zt(e,t){const i=[];if(!t.length)return i;const n=e.byteLength;for(let r=0;r<n;){const s=Ot(e,r),a=s>1?r+s:n;if(xt(e.subarray(r+4,r+8))===t[0])if(1===t.length)i.push(e.subarray(r+8,a));else{const n=zt(e.subarray(r+8,a),t.slice(1));n.length&&kt.apply(i,n)}r=a}return i}function Ft(e){const t=[],i=e[0];let n=8;const r=Ot(e,n);n+=4,n+=0===i?8:16,n+=2;let s=e.length+0;const a=_t(e,n);n+=2;for(let i=0;i<a;i++){let i=n;const a=Ot(e,i);i+=4;const o=2147483647&a;if(1==(2147483648&a)>>>31)return Ue.warn("SIDX has hierarchical references (not supported)"),null;const l=Ot(e,i);i+=4,t.push({referenceSize:o,subsegmentDuration:l,info:{duration:l/r,start:s,end:s+o-1}}),s+=o,i+=4,n=i}return{earliestPresentationTime:0,timescale:r,version:i,referencesCount:a,references:t}}function Ut(e){const t=[],i=zt(e,["moov","trak"]);for(let e=0;e<i.length;e++){const n=i[e],r=zt(n,["tkhd"])[0];if(r){let e=r[0],i=0===e?12:20;const s=Ot(r,i),a=zt(n,["mdia","mdhd"])[0];if(a){e=a[0],i=0===e?12:20;const r=Ot(a,i),o=zt(n,["mdia","hdlr"])[0];if(o){const e=xt(o.subarray(8,12)),i={soun:qe,vide:We}[e];if(i){const e=zt(n,["mdia","minf","stbl","stsd"])[0];let a;e&&(a=xt(e.subarray(12,16))),t[s]={timescale:r,type:i},t[i]={timescale:r,id:s,codec:a}}}}}}return zt(e,["moov","mvex","trex"]).forEach((e=>{const i=Ot(e,4),n=t[i];n&&(n.default={duration:Ot(e,12),flags:Ot(e,20)})})),t}function Yt(e){const t=zt(e,["schm"])[0];if(t){const i=xt(t.subarray(4,8));if("cbcs"===i||"cenc"===i)return zt(e,["schi","tenc"])[0]}return Ue.error("[eme] missing 'schm' box"),null}function Bt(e){const t=Ot(e,0);let i=8;1&t&&(i+=4),4&t&&(i+=4);let n=0;const r=Ot(e,4);for(let s=0;s<r;s++)256&t&&(n+=Ot(e,i),i+=4),512&t&&(i+=4),1024&t&&(i+=4),2048&t&&(i+=4);return n}function $t(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}function Gt(e,t){const i=[],n=t.samples,r=t.timescale,s=t.id;let a=!1;return zt(n,["moof"]).map((o=>{const l=o.byteOffset-8;zt(o,["traf"]).map((o=>{const c=zt(o,["tfdt"]).map((e=>{const t=e[0];let i=Ot(e,4);return 1===t&&(i*=Math.pow(2,32),i+=Ot(e,8)),i/r}))[0];return void 0!==c&&(e=c),zt(o,["tfhd"]).map((c=>{const u=Ot(c,4),d=16777215&Ot(c,0);let h=0;const p=0!=(16&d);let f=0;const g=0!=(32&d);let y=8;u===s&&(0!=(1&d)&&(y+=8),0!=(2&d)&&(y+=4),0!=(8&d)&&(h=Ot(c,y),y+=4),p&&(f=Ot(c,y),y+=4),g&&(y+=4),"video"===t.type&&(a=function(e){if(!e)return!1;const t=e.indexOf("."),i=t<0?e:e.substring(0,t);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(t.codec)),zt(o,["trun"]).map((s=>{const o=s[0],c=16777215&Ot(s,0),u=0!=(1&c);let d=0;const p=0!=(4&c),g=0!=(256&c);let y=0;const m=0!=(512&c);let v=0;const M=0!=(1024&c),T=0!=(2048&c);let L=0;const b=Ot(s,4);let E=8;u&&(d=Ot(s,E),E+=4),p&&(E+=4);let I=d+l;for(let l=0;l<b;l++){if(g?(y=Ot(s,E),E+=4):y=h,m?(v=Ot(s,E),E+=4):v=f,M&&(E+=4),T&&(L=0===o?Ot(s,E):Pt(s,E),E+=4),t.type===We){let t=0;for(;t<v;){const s=Ot(n,I);I+=4,Qt(a,n[I])&&Ht(n.subarray(I,I+s),a?2:1,e+L/r,i),I+=s,t+=s+4}}e+=y/r}})))}))}))})),i}function Qt(e,t){if(e){const e=t>>1&63;return 39===e||40===e}return 6==(31&t)}function Ht(e,t,i,n){const r=qt(e);let s=0;s+=t;let a=0,o=0,l=!1,c=0;for(;s<r.length;){a=0;do{if(s>=r.length)break;c=r[s++],a+=c}while(255===c);o=0;do{if(s>=r.length)break;c=r[s++],o+=c}while(255===c);const e=r.length-s;if(!l&&4===a&&s<r.length){if(l=!0,181===r[s++]){const e=_t(r,s);if(s+=2,49===e){const e=Ot(r,s);if(s+=4,1195456820===e){const e=r[s++];if(3===e){const t=r[s++],o=31&t,l=64&t,c=l?2+3*o:0,u=new Uint8Array(c);if(l){u[0]=t;for(let e=1;e<c;e++)u[e]=r[s++]}n.push({type:e,payloadType:a,pts:i,bytes:u})}}}}}else if(5===a&&o<e){if(l=!0,o>16){const e=[];for(let t=0;t<16;t++){const i=r[s++].toString(16);e.push(1==i.length?"0"+i:i),3!==t&&5!==t&&7!==t&&9!==t||e.push("-")}const t=o-16,l=new Uint8Array(t);for(let e=0;e<t;e++)l[e]=r[s++];n.push({payloadType:a,pts:i,uuid:e.join(""),userData:St(l),userDataBytes:l})}}else if(o<e)s+=o;else if(o>e)break}}function qt(e){const t=e.byteLength,i=[];let n=1;for(;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;const r=t-i.length,s=new Uint8Array(r);let a=0;for(n=0;n<r;a++,n++)a===i[0]&&(a++,i.shift()),s[n]=e[a];return s}let Wt={};class Zt{static clearKeyUriToKeyIdMap(){Wt={}}constructor(e,t,i,n=[1],r=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=i,this.keyFormatVersions=n,this.iv=r,this.encrypted=!!e&&"NONE"!==e,this.isCommonEncryption=this.encrypted&&"AES-128"!==e}isSupported(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case rt:case at:case st:case nt:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof e&&("AES-128"!==this.method||this.iv||Ue.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const t=function(e){const t=new Uint8Array(16);for(let i=12;i<16;i++)t[i]=e>>8*(15-i)&255;return t}(e);return new Zt(this.method,this.uri,"identity",this.keyFormatVersions,t)}const t=function(e){const t=e.split(":");let i=null;if("data"===t[0]&&2===t.length){const e=t[1].split(";"),n=e[e.length-1].split(",");if(2===n.length){const t="base64"===n[0],r=n[1];t?(e.splice(-1,1),i=et(r)):i=function(e){const t=tt(e).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}(r)}}return i}(this.uri);if(t)switch(this.keyFormat){case at:this.pssh=t,t.length>=22&&(this.keyId=t.subarray(t.length-22,t.length-6));break;case st:{const e=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=function(e,t,i){if(16!==e.byteLength)throw new RangeError("Invalid system id");let n,r,s;if(t){n=1,r=new Uint8Array(16*t.length);for(let e=0;e<t.length;e++){const i=t[e];if(16!==i.byteLength)throw new RangeError("Invalid key");r.set(i,16*e)}}else n=0,r=new Uint8Array;n>0?(s=new Uint8Array(4),t.length>0&&new DataView(s.buffer).setUint32(0,t.length,!1)):s=new Uint8Array;const a=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(a.buffer).setUint32(0,i.byteLength,!1),function(e,...t){const i=t.length;let n=8,r=i;for(;r--;)n+=t[r].byteLength;const s=new Uint8Array(n);for(s[0]=n>>24&255,s[1]=n>>16&255,s[2]=n>>8&255,s[3]=255&n,s.set(e,4),r=0,n=8;r<i;r++)s.set(t[r],n),n+=t[r].byteLength;return s}([112,115,115,104],new Uint8Array([n,0,0,0]),e,s,r,a,i||new Uint8Array)}(e,null,t);const i=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),n=String.fromCharCode.apply(null,Array.from(i)),r=n.substring(n.indexOf("<"),n.length),s=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const e=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(e){const t=et(e).subarray(0,16);!function(e){const t=function(e,t,i){const n=e[t];e[t]=e[i],e[i]=n};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)}(t),this.keyId=t}}break}default:{let e=t.subarray(0,16);if(16!==e.length){const t=new Uint8Array(16);t.set(e,16-e.length),e=t}this.keyId=e;break}}if(!this.keyId||16!==this.keyId.byteLength){let e=Wt[this.uri];if(!e){const t=Object.keys(Wt).length%Number.MAX_SAFE_INTEGER;e=new Uint8Array(16),new DataView(e.buffer,12,4).setUint32(0,t),Wt[this.uri]=e}this.keyId=e}return this}}const Vt=/\{\$([a-zA-Z0-9-_]+)\}/g;function Kt(e){return Vt.test(e)}function Xt(e,t,i){if(null!==e.variableList||e.hasVariableRefs)for(let n=i.length;n--;){const r=i[n],s=t[r];s&&(t[r]=Jt(e,s))}}function Jt(e,t){if(null!==e.variableList||e.hasVariableRefs){const i=e.variableList;return t.replace(Vt,(t=>{const n=t.substring(2,t.length-1),r=null==i?void 0:i[n];return void 0===r?(e.playlistParsingError||(e.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${n}"`)),t):r}))}return t}function ei(e,t,i){let n,r,s=e.variableList;if(s||(e.variableList=s={}),"QUERYPARAM"in t){n=t.QUERYPARAM;try{const e=new self.URL(i).searchParams;if(!e.has(n))throw new Error(`"${n}" does not match any query parameter in URI: "${i}"`);r=e.get(n)}catch(t){e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${t.message}`))}}else n=t.NAME,r=t.VALUE;n in s?e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${n}"`)):s[n]=r||""}function ti(e,t,i){const n=t.IMPORT;if(i&&n in i){let t=e.variableList;t||(e.variableList=t={}),t[n]=i[n]}else e.playlistParsingError||(e.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const ii={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function ni(e,t){return MediaSource.isTypeSupported(`${t||"video"}/mp4;codecs="${e}"`)}const ri=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,si=/#EXT-X-MEDIA:(.*)/g,ai=/^#EXT(?:INF|-X-TARGETDURATION):/m,oi=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),li=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ci{static findGroup(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(n.id===t)return n}}static convertAVC1ToAVCOTI(e){const t=e.split(".");if(t.length>2){let e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4),e}return e}static resolve(e,t){return Ae.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return ai.test(e)}static parseMasterPlaylist(e,t){const i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Kt(e)},n=[];let r;for(ri.lastIndex=0;null!=(r=ri.exec(e));)if(r[1]){var s;const e=new $e(r[1]);Xt(i,e,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const a=Jt(i,r[2]),o={attrs:e,bitrate:e.decimalInteger("AVERAGE-BANDWIDTH")||e.decimalInteger("BANDWIDTH"),name:e.NAME,url:ci.resolve(a,t)},l=e.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),hi((e.CODECS||"").split(/[ ,]+/).filter((e=>e)),o),o.videoCodec&&-1!==o.videoCodec.indexOf("avc1")&&(o.videoCodec=ci.convertAVC1ToAVCOTI(o.videoCodec)),null!=(s=o.unknownCodecs)&&s.length||n.push(o),i.levels.push(o)}else if(r[3]){const e=r[3],n=r[4];switch(e){case"SESSION-DATA":{const e=new $e(n);Xt(i,e,["DATA-ID","LANGUAGE","VALUE","URI"]);const t=e["DATA-ID"];t&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[t]=e);break}case"SESSION-KEY":{const e=ui(n,t,i);e.encrypted&&e.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(e)):Ue.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${n}"`);break}case"DEFINE":{const e=new $e(n);Xt(i,e,["NAME","VALUE","QUERYPARAM"]),ei(i,e,t)}break;case"CONTENT-STEERING":{const e=new $e(n);Xt(i,e,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:ci.resolve(e["SERVER-URI"],t),pathwayId:e["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=di(n)}}const a=n.length>0&&n.length<i.levels.length;return i.levels=a?n:i.levels,0===i.levels.length&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(e,t,i){let n;const r={},s=i.levels,a={AUDIO:s.map((e=>({id:e.attrs.AUDIO,audioCodec:e.audioCodec}))),SUBTITLES:s.map((e=>({id:e.attrs.SUBTITLES,textCodec:e.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(si.lastIndex=0;null!==(n=si.exec(e));){const e=new $e(n[1]),s=e.TYPE;if(s){const n=a[s],l=r[s]||[];r[s]=l,Xt(i,e,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const c={attrs:e,bitrate:0,id:o++,groupId:e["GROUP-ID"]||"",instreamId:e["INSTREAM-ID"],name:e.NAME||e.LANGUAGE||"",type:s,default:e.bool("DEFAULT"),autoselect:e.bool("AUTOSELECT"),forced:e.bool("FORCED"),lang:e.LANGUAGE,url:e.URI?ci.resolve(e.URI,t):""};if(null!=n&&n.length){const e=ci.findGroup(n,c.groupId)||n[0];pi(c,e,"audioCodec"),pi(c,e,"textCodec")}l.push(c)}}return r}static parseLevelPlaylist(e,t,i,n,r,s){const a=new Je(t),o=a.fragments;let l,c,u,d=null,h=0,p=0,f=0,g=0,y=null,m=new Ke(n,t),v=-1,M=!1;for(oi.lastIndex=0,a.m3u8=e,a.hasVariableRefs=Kt(e);null!==(l=oi.exec(e));){M&&(M=!1,m=new Ke(n,t),m.start=f,m.sn=h,m.cc=g,m.level=i,d&&(m.initSegment=d,m.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null));const e=l[1];if(e){m.duration=parseFloat(e);const t=(" "+l[2]).slice(1);m.title=t||null,m.tagList.push(t?["INF",e,t]:["INF",e])}else if(l[3]){if(xe(m.duration)){m.start=f,u&&yi(m,u,a),m.sn=h,m.level=i,m.cc=g,m.urlId=r,o.push(m);const e=(" "+l[3]).slice(1);m.relurl=Jt(a,e),fi(m,y),y=m,f+=m.duration,h++,p=0,M=!0}}else if(l[4]){const e=(" "+l[4]).slice(1);y?m.setByteRange(e,y):m.setByteRange(e)}else if(l[5])m.rawProgramDateTime=(" "+l[5]).slice(1),m.tagList.push(["PROGRAM-DATE-TIME",m.rawProgramDateTime]),-1===v&&(v=o.length);else{if(l=l[0].match(li),!l){Ue.warn("No matches on slow regex match for level playlist!");continue}for(c=1;c<l.length&&void 0===l[c];c++);const e=(" "+l[c]).slice(1),r=(" "+l[c+1]).slice(1),f=l[c+2]?(" "+l[c+2]).slice(1):"";switch(e){case"PLAYLIST-TYPE":a.type=r.toUpperCase();break;case"MEDIA-SEQUENCE":h=a.startSN=parseInt(r);break;case"SKIP":{const e=new $e(r);Xt(a,e,["RECENTLY-REMOVED-DATERANGES"]);const t=e.decimalInteger("SKIPPED-SEGMENTS");if(xe(t)){a.skippedSegments=t;for(let e=t;e--;)o.unshift(null);h+=t}const i=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");i&&(a.recentlyRemovedDateranges=i.split("\t"));break}case"TARGETDURATION":a.targetduration=Math.max(parseInt(r),1);break;case"VERSION":a.version=parseInt(r);break;case"EXTM3U":break;case"ENDLIST":a.live=!1;break;case"#":(r||f)&&m.tagList.push(f?[r,f]:[r]);break;case"DISCONTINUITY":g++,m.tagList.push(["DIS"]);break;case"GAP":m.gap=!0,m.tagList.push([e]);break;case"BITRATE":m.tagList.push([e,r]);break;case"DATERANGE":{const e=new $e(r);Xt(a,e,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Xt(a,e,e.clientAttrs);const t=new Qe(e,a.dateRanges[e.ID]);t.isValid||a.skippedSegments?a.dateRanges[t.id]=t:Ue.warn(`Ignoring invalid DATERANGE tag: "${r}"`),m.tagList.push(["EXT-X-DATERANGE",r]);break}case"DEFINE":{const e=new $e(r);Xt(a,e,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in e?ti(a,e,s):ei(a,e,t)}break;case"DISCONTINUITY-SEQUENCE":g=parseInt(r);break;case"KEY":{const e=ui(r,t,a);if(e.isSupported()){if("NONE"===e.method){u=void 0;break}u||(u={}),u[e.keyFormat]&&(u=je({},u)),u[e.keyFormat]=e}else Ue.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${r}"`);break}case"START":a.startTimeOffset=di(r);break;case"MAP":{const e=new $e(r);if(Xt(a,e,["BYTERANGE","URI"]),m.duration){const r=new Ke(n,t);gi(r,e,i,u),d=r,m.initSegment=d,d.rawProgramDateTime&&!m.rawProgramDateTime&&(m.rawProgramDateTime=d.rawProgramDateTime)}else gi(m,e,i,u),d=m,M=!0;break}case"SERVER-CONTROL":{const e=new $e(r);a.canBlockReload=e.bool("CAN-BLOCK-RELOAD"),a.canSkipUntil=e.optionalFloat("CAN-SKIP-UNTIL",0),a.canSkipDateRanges=a.canSkipUntil>0&&e.bool("CAN-SKIP-DATERANGES"),a.partHoldBack=e.optionalFloat("PART-HOLD-BACK",0),a.holdBack=e.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const e=new $e(r);a.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let e=a.partList;e||(e=a.partList=[]);const i=p>0?e[e.length-1]:void 0,n=p++,s=new $e(r);Xt(a,s,["BYTERANGE","URI"]);const o=new Xe(s,m,t,n,i);e.push(o),m.duration+=o.duration;break}case"PRELOAD-HINT":{const e=new $e(r);Xt(a,e,["URI"]),a.preloadHint=e;break}case"RENDITION-REPORT":{const e=new $e(r);Xt(a,e,["URI"]),a.renditionReports=a.renditionReports||[],a.renditionReports.push(e);break}default:Ue.warn(`line parsed but not handled: ${l}`)}}}y&&!y.relurl?(o.pop(),f-=y.duration,a.partList&&(a.fragmentHint=y)):a.partList&&(fi(m,y),m.cc=g,a.fragmentHint=m,u&&yi(m,u,a));const T=o.length,L=o[0],b=o[T-1];if(f+=a.skippedSegments*a.targetduration,f>0&&T&&b){a.averagetargetduration=f/T;const e=b.sn;a.endSN="initSegment"!==e?e:0,a.live||(b.endList=!0),L&&(a.startCC=L.cc)}else a.endSN=0,a.startCC=0;return a.fragmentHint&&(f+=a.fragmentHint.duration),a.totalduration=f,a.endCC=g,v>0&&function(e,t){let i=e[t];for(let n=t;n--;){const t=e[n];if(!t)return;t.programDateTime=i.programDateTime-1e3*t.duration,i=t}}(o,v),a}}function ui(e,t,i){var n,r;const s=new $e(e);Xt(i,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const a=null!=(n=s.METHOD)?n:"",o=s.URI,l=s.hexadecimalInteger("IV"),c=s.KEYFORMATVERSIONS,u=null!=(r=s.KEYFORMAT)?r:"identity";o&&s.IV&&!l&&Ue.error(`Invalid IV: ${s.IV}`);const d=o?ci.resolve(o,t):"",h=(c||"1").split("/").map(Number).filter(Number.isFinite);return new Zt(a,d,u,h,l)}function di(e){const t=new $e(e).decimalFloatingPoint("TIME-OFFSET");return xe(t)?t:null}function hi(e,t){["video","audio","text"].forEach((i=>{const n=e.filter((e=>function(e,t){const i=ii[t];return!!i&&!0===i[e.slice(0,4)]}(e,i)));if(n.length){const r=n.filter((e=>0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)));t[`${i}Codec`]=r.length>0?r[0]:n[0],e=e.filter((e=>-1===n.indexOf(e)))}})),t.unknownCodecs=e}function pi(e,t,i){const n=t[i];n&&(e[i]=n)}function fi(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),xe(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function gi(e,t,i,n){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=i,e.sn="initSegment",n&&(e.levelkeys=n),e.initSegment=null}function yi(e,t,i){e.levelkeys=t;const{encryptedFragments:n}=i;n.length&&n[n.length-1].levelkeys===t||!Object.keys(t).some((e=>t[e].isCommonEncryption))||n.push(e)}var mi="manifest",vi="level",Mi="audioTrack",Ti="subtitleTrack",Li="main",bi="audio",Ei="subtitle";function Ii(e){const{type:t}=e;switch(t){case Mi:return bi;case Ti:return Ei;default:return Li}}function Ni(e,t){let i=e.url;return void 0!==i&&0!==i.indexOf("data:")||(i=t.url),i}class Si{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.LEVEL_LOADING,this.onLevelLoading,this),e.on(_e.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(_e.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:e}=this;e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.LEVEL_LOADING,this.onLevelLoading,this),e.off(_e.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(_e.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(e){const t=this.hls.config,i=t.pLoader,n=t.loader,r=new(i||n)(t);return this.loaders[e.type]=r,r}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:mi,url:i,deliveryDirectives:null})}onLevelLoading(e,t){const{id:i,level:n,url:r,deliveryDirectives:s}=t;this.load({id:i,level:n,responseType:"text",type:vi,url:r,deliveryDirectives:s})}onAudioTrackLoading(e,t){const{id:i,groupId:n,url:r,deliveryDirectives:s}=t;this.load({id:i,groupId:n,level:null,responseType:"text",type:Mi,url:r,deliveryDirectives:s})}onSubtitleTrackLoading(e,t){const{id:i,groupId:n,url:r,deliveryDirectives:s}=t;this.load({id:i,groupId:n,level:null,responseType:"text",type:Ti,url:r,deliveryDirectives:s})}load(e){var t;const i=this.hls.config;let n,r=this.getInternalLoader(e);if(r){const t=r.context;if(t&&t.url===e.url)return void Ue.trace("[playlist-loader]: playlist request ongoing");Ue.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),r.abort()}if(n=e.type===mi?i.manifestLoadPolicy.default:je({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),r=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part){let t;if(e.type===vi&&null!==e.level?t=this.hls.levels[e.level].details:e.type===Mi&&null!==e.id?t=this.hls.audioTracks[e.id].details:e.type===Ti&&null!==e.id&&(t=this.hls.subtitleTracks[e.id].details),t){const e=t.partTarget,i=t.targetduration;if(e&&i){const t=1e3*Math.max(3*e,.8*i);n=je({},n,{maxTimeToFirstByteMs:Math.min(t,n.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(t,n.maxTimeToFirstByteMs)})}}}const s=n.errorRetry||n.timeoutRetry||{},a={loadPolicy:n,timeout:n.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},o={onSuccess:(e,t,i,n)=>{const r=this.getInternalLoader(i);this.resetInternalLoader(i.type);const s=e.data;0===s.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),ci.isMediaPlaylist(s)?this.handleTrackOrLevelPlaylist(e,t,i,n||null,r):this.handleMasterPlaylist(e,t,i,n)):this.handleManifestParsingError(e,i,new Error("no EXTM3U delimiter"),n||null,t)},onError:(e,t,i,n)=>{this.handleNetworkError(t,i,!1,e,n)},onTimeout:(e,t,i)=>{this.handleNetworkError(t,i,!0,void 0,e)}};r.load(e,a,o)}handleMasterPlaylist(e,t,i,n){const r=this.hls,s=e.data,a=Ni(e,i),o=ci.parseMasterPlaylist(s,a);if(o.playlistParsingError)return void this.handleManifestParsingError(e,i,o.playlistParsingError,n,t);const{contentSteering:l,levels:c,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p}=o;this.variableList=p;const{AUDIO:f=[],SUBTITLES:g,"CLOSED-CAPTIONS":y}=ci.parseMasterPlaylistMedia(s,a,o);f.length&&(f.some((e=>!e.url))||!c[0].audioCodec||c[0].attrs.AUDIO||(Ue.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),f.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new $e({}),bitrate:0,url:""}))),r.trigger(_e.MANIFEST_LOADED,{levels:c,audioTracks:f,subtitles:g,captions:y,contentSteering:l,url:a,stats:t,networkDetails:n,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,t,i,n,r){const s=this.hls,{id:a,level:o,type:l}=i,c=Ni(e,i),u=xe(a)?a:0,d=xe(o)?o:u,h=Ii(i),p=ci.parseLevelPlaylist(e.data,c,d,h,u,this.variableList);if(l===mi){const e={attrs:new $e({}),bitrate:0,details:p,name:"",url:c};s.trigger(_e.MANIFEST_LOADED,{levels:[e],audioTracks:[],url:c,stats:t,networkDetails:n,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=p,this.handlePlaylistLoaded(p,e,t,i,n,r)}handleManifestParsingError(e,t,i,n,r){this.hls.trigger(_e.ERROR,{type:Oe.NETWORK_ERROR,details:Pe.MANIFEST_PARSING_ERROR,fatal:t.type===mi,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:n,stats:r})}handleNetworkError(e,t,i=!1,n,r){let s=`A network ${i?"timeout":"error"+(n?" (status "+n.code+")":"")} occurred while loading ${e.type}`;e.type===vi?s+=`: ${e.level} id: ${e.id}`:e.type!==Mi&&e.type!==Ti||(s+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(s);Ue.warn(`[playlist-loader]: ${s}`);let o=Pe.UNKNOWN,l=!1;const c=this.getInternalLoader(e);switch(e.type){case mi:o=i?Pe.MANIFEST_LOAD_TIMEOUT:Pe.MANIFEST_LOAD_ERROR,l=!0;break;case vi:o=i?Pe.LEVEL_LOAD_TIMEOUT:Pe.LEVEL_LOAD_ERROR,l=!1;break;case Mi:o=i?Pe.AUDIO_TRACK_LOAD_TIMEOUT:Pe.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Ti:o=i?Pe.SUBTITLE_TRACK_LOAD_TIMEOUT:Pe.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(e.type);const u={type:Oe.NETWORK_ERROR,details:o,fatal:l,url:e.url,loader:c,context:e,error:a,networkDetails:t,stats:r};if(n){const i=(null==t?void 0:t.url)||e.url;u.response=De({url:i,data:void 0},n)}this.hls.trigger(_e.ERROR,u)}handlePlaylistLoaded(e,t,i,n,r,s){const a=this.hls,{type:o,level:l,id:c,groupId:u,deliveryDirectives:d}=n,h=Ni(t,n),p=Ii(n),f="number"==typeof n.level&&p===Li?l:void 0;if(!e.fragments.length){const e=new Error("No Segments found in Playlist");return void a.trigger(_e.ERROR,{type:Oe.NETWORK_ERROR,details:Pe.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:e,reason:e.message,response:t,context:n,level:f,parent:p,networkDetails:r,stats:i})}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g)a.trigger(_e.ERROR,{type:Oe.NETWORK_ERROR,details:Pe.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:n,level:f,parent:p,networkDetails:r,stats:i});else switch(e.live&&s&&(s.getCacheAge&&(e.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case mi:case vi:a.trigger(_e.LEVEL_LOADED,{details:e,level:f||0,id:c||0,stats:i,networkDetails:r,deliveryDirectives:d});break;case Mi:a.trigger(_e.AUDIO_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:r,deliveryDirectives:d});break;case Ti:a.trigger(_e.SUBTITLE_TRACK_LOADED,{details:e,id:c||0,groupId:u||"",stats:i,networkDetails:r,deliveryDirectives:d})}}}function wi(e,t){let i;try{i=new Event("addtrack")}catch(e){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=e,t.dispatchEvent(i)}function Ai(e,t){const i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error(`addCue is failed for: ${t}`)}catch(i){Ue.debug(`[texttrack-utils]: ${i}`);const n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}"disabled"===i&&(e.mode=i)}function Ci(e){const t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(let t=e.cues.length;t--;)e.removeCue(e.cues[t]);"disabled"===t&&(e.mode=t)}function Di(e,t,i,n){const r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&e.cues.length>0){const r=function(e,t,i){const n=[],r=function(e,t){if(t<e[0].startTime)return 0;const i=e.length-1;if(t>e[i].endTime)return-1;let n=0,r=i;for(;n<=r;){const s=Math.floor((r+n)/2);if(t<e[s].startTime)r=s-1;else{if(!(t>e[s].startTime&&n<i))return s;n=s+1}}return e[n].startTime-t<t-e[r].startTime?n:r}(e,t);if(r>-1)for(let s=r,a=e.length;s<a;s++){const r=e[s];if(r.startTime>=t&&r.endTime<=i)n.push(r);else if(r.startTime>i)return n}return n}(e.cues,t,i);for(let t=0;t<r.length;t++)n&&!n(r[t])||e.removeCue(r[t])}"disabled"===r&&(e.mode=r)}var ki="org.id3",ji="https://aomedia.org/emsg/ID3";function xi(){if("undefined"!=typeof self)return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}const _i=(()=>{const e=xi();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(e){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Oi(e,t){return e.getTime()/1e3-t}class Pi{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_e.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_e.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(e,t){this.media=t.media}onMediaDetaching(){this.id3Track&&(Ci(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const i=e[t];if("metadata"===i.kind&&"id3"===i.label)return wi(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:n}}}=this;if(!i&&!n)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=xi();for(let e=0;e<r.length;e++){const t=r[e].type;if(t===ji&&!i||!n)continue;const a=Tt(r[e].data);if(a){const i=r[e].pts;let n=i+r[e].duration;n>_i&&(n=_i),n-i<=0&&(n=i+.25);for(let e=0;e<a.length;e++){const r=a[e];if(!vt(r)){this.updateId3CueEnds(i);const e=new s(i,n,"");e.value=r,t&&(e.type=t),this.id3Track.addCue(e)}}}}}updateId3CueEnds(e){var t;const i=null==(t=this.id3Track)?void 0:t.cues;if(i)for(let t=i.length;t--;){const n=i[t];n.startTime<e&&n.endTime===_i&&(n.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,type:n}){const{id3Track:r,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:o}}=s;if(r&&(a||o)){let e;e="audio"===n?e=>e.type===ki&&o:"video"===n?e=>e.type===ji&&a:e=>e.type===ki&&o||e.type===ji&&a,Di(r,t,i,e)}}onLevelUpdated(e,{details:t}){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:n}=this,{dateRanges:r}=t,s=Object.keys(r);if(n){const e=Object.keys(i).filter((e=>!s.includes(e)));for(let t=e.length;t--;){const r=e[t];Object.keys(i[r].cues).forEach((e=>{n.removeCue(i[r].cues[e])})),delete i[r]}}const a=t.fragments[t.fragments.length-1];if(0===s.length||!xe(null==a?void 0:a.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=a.programDateTime/1e3-a.start,l=xi();for(let e=0;e<s.length;e++){const t=s[e],n=r[t],a=i[t],d=(null==a?void 0:a.cues)||{};let h=(null==a?void 0:a.durationKnown)||!1;const p=Oi(n.startDate,o);let f=_i;const g=n.endDate;if(g)f=Oi(g,o),h=!0;else if(n.endOnNext&&!h){const e=s.reduce(((e,t)=>{const i=r[t];return i.class===n.class&&i.id!==t&&i.startDate>n.startDate&&e.push(i),e}),[]).sort(((e,t)=>e.startDate.getTime()-t.startDate.getTime()))[0];e&&(f=Oi(e.startDate,o),h=!0)}const y=Object.keys(n.attr);for(let e=0;e<y.length;e++){const i=y[e];if("ID"===(u=i)||"CLASS"===u||"START-DATE"===u||"DURATION"===u||"END-DATE"===u||"END-ON-NEXT"===u)continue;let r=d[i];if(r)h&&!a.durationKnown&&(r.endTime=f);else{let e=n.attr[i];r=new l(p,f,""),Ge(i)&&(c=e,e=Uint8Array.from(c.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),r.value={key:i,data:e},r.type="com.apple.quicktime.HLS",r.id=t,this.id3Track.addCue(r),d[i]=r}}i[t]={cues:d,dateRange:n,durationKnown:h}}var c,u}}class Ri{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=e,this.config=e.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:e,levelDetails:t}=this;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const{levelDetails:e}=this;if(null===e)return null;const{holdBack:t,partHoldBack:i,targetduration:n}=e,{liveSyncDuration:r,liveSyncDurationCount:s,lowLatencyMode:a}=this.config,o=this.hls.userConfig;let l=a&&i||t;(o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==r?r:s*n);const c=n;return l+Math.min(1*this.stallCount,c)}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(null===e||null===t||null===i)return null;const n=i.edge,r=e-t-this.edgeStalled,s=n-i.totalduration,a=n-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(s,r),a)}get drift(){const{levelDetails:e}=this;return null===e?1:e.drift}get edgeStalled(){const{levelDetails:e}=this;if(null===e)return 0;const t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e,levelDetails:t}=this;if(!e||!t)return 0;const i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(_e.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(_e.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(_e.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(_e.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){this.levelDetails=t,t.advanced&&this.timeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(e,t){var i;t.details===Pe.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(i=this.levelDetails)&&i.live&&Ue.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:e,levelDetails:t}=this;if(!e||!t)return;this.currentTime=e.currentTime;const i=this.computeLatency();if(null===i)return;this._latency=i;const{lowLatencyMode:n,maxLiveSyncPlaybackRate:r}=this.config;if(!n||1===r)return;const s=this.targetLatency;if(null===s)return;const a=i-s,o=a<Math.min(this.maxLatency,s+t.targetduration);if(t.live&&o&&a>.05&&this.forwardBufferLength>1){const t=Math.min(2,Math.max(1,r)),i=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(t,Math.max(1,i))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}estimateLiveEdge(){const{levelDetails:e}=this;return null===e?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}const zi=["NONE","TYPE-0","TYPE-1",null];class Fi{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}addDirectives(e){const t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Ui{constructor(e){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((e=>e)).join(",").replace(/\.[^.,]+/g,"")}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get attrs(){return this._attrs[this._urlId]}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get uri(){return this.url[this._urlId]||""}get urlId(){return this._urlId}set urlId(e){const t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}get audioGroupId(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}get textGroupId(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}addFallback(e){this.url.push(e.url),this._attrs.push(e.attrs)}}function Yi(e,t){const i=t.startPTS;if(xe(i)){let n,r=0;t.sn>e.sn?(r=i-e.start,n=e):(r=e.start-i,n=t),n.duration!==r&&(n.duration=r)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function Bi(e,t,i,n,r,s){n-i<=0&&(Ue.warn("Fragment should have a positive duration",t),n=i+t.duration,s=r+t.duration);let a=i,o=n;const l=t.startPTS,c=t.endPTS;if(xe(l)){const e=Math.abs(l-i);xe(t.deltaPTS)?t.deltaPTS=Math.max(e,t.deltaPTS):t.deltaPTS=e,a=Math.max(i,l),i=Math.min(i,l),r=Math.min(r,t.startDTS),o=Math.min(n,c),n=Math.max(n,c),s=Math.max(s,t.endDTS)}const u=i-t.start;0!==t.start&&(t.start=i),t.duration=n-t.start,t.startPTS=i,t.maxStartPTS=a,t.startDTS=r,t.endPTS=n,t.minEndPTS=o,t.endDTS=s;const d=t.sn;if(!e||d<e.startSN||d>e.endSN)return 0;let h;const p=d-e.startSN,f=e.fragments;for(f[p]=t,h=p;h>0;h--)Yi(f[h],f[h-1]);for(h=p;h<f.length-1;h++)Yi(f[h],f[h+1]);return e.fragmentHint&&Yi(f[f.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,u}function $i(e,t){const i=t.startSN+t.skippedSegments-e.startSN,n=e.fragments;i<0||i>=n.length||Gi(t,n[i].start)}function Gi(e,t){if(t){const i=e.fragments;for(let n=e.skippedSegments;n<i.length;n++)i[n].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function Qi(e,t,i){var n;return null!=e&&e.details?Hi(null==(n=e.details)?void 0:n.partList,t,i):null}function Hi(e,t,i){if(e)for(let n=e.length;n--;){const r=e[n];if(r.index===i&&r.fragment.sn===t)return r}return null}function qi(e){switch(e.details){case Pe.FRAG_LOAD_TIMEOUT:case Pe.KEY_LOAD_TIMEOUT:case Pe.LEVEL_LOAD_TIMEOUT:case Pe.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Wi(e,t){const i=qi(t);return e.default[(i?"timeout":"error")+"Retry"]}function Zi(e,t){const i="linear"===e.backoff?1:Math.pow(2,t);return Math.min(i*e.retryDelayMs,e.maxRetryDelayMs)}function Vi(e){return De(De({},e),{errorRetry:null,timeoutRetry:null})}function Ki(e,t,i,n){return!!e&&t<e.maxNumRetry&&(function(e){return 0===e&&!1===navigator.onLine||!!e&&(e<400||e>499)}(n)||!!i)}const Xi=function(e,t){let i=0,n=e.length-1,r=null,s=null;for(;i<=n;){r=(i+n)/2|0,s=e[r];const a=t(s);if(a>0)i=r+1;else{if(!(a<0))return s;n=r-1}}return null};function Ji(e,t,i=0,n=0){let r=null;if(e?r=t[e.sn-t[0].sn+1]||null:0===i&&0===t[0].start&&(r=t[0]),r&&0===en(i,n,r))return r;const s=Xi(t,en.bind(null,i,n));return!s||s===e&&r?r:s}function en(e=0,t=0,i){if(i.start<=e&&i.start+i.duration>e)return 0;const n=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-n<=e?1:i.start-n>e&&i.start?-1:0}function tn(e,t,i){const n=1e3*Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-n>e}function nn(e,t,i){if(performance.now()-e.lastErrorPerfMs>3e5)return!0;const n=e.details;if(t.details===Pe.FRAG_GAP&&n&&t.frag){const e=t.frag.start,i=Ji(null,n.fragments,e);if(i&&!i.gap)return!0}if(i&&e.errors.length<i.errors.length){const i=e.errors[e.errors.length-1];if(n&&i.frag&&t.frag&&Math.abs(i.frag.start-t.frag.start)>3*n.targetduration)return!0}return!1}class rn{constructor(e,t){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=Ue.log.bind(Ue,`${t}:`),this.warn=Ue.warn.bind(Ue,`${t}:`),this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){clearTimeout(this.timer),this.timer=-1}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t){const i=null==t?void 0:t.renditionReports;if(i){let n=-1;for(let r=0;r<i.length;r++){const s=i[r];let a;try{a=new self.URL(s.URI,t.url).href}catch(e){Ue.warn(`Could not construct new URL for Rendition Report: ${e}`),a=s.URI||""}if(a===e){n=r;break}a===e.substring(0,a.length)&&(n=r)}if(-1!==n){const e=i[n],r=parseInt(e["LAST-MSN"])||(null==t?void 0:t.lastPartSn);let s=parseInt(e["LAST-PART"])||(null==t?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const e=Math.min(t.age-t.partTarget,t.targetduration);s>=0&&e>t.partTarget&&(s+=1)}return new Fi(r,s>=0?s:void 0,"")}}}loadPlaylist(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}shouldReloadPlaylist(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}playlistLoaded(e,t,i){const{details:n,stats:r}=t,s=self.performance.now(),a=r.loading.first?Math.max(0,s-r.loading.first):0;if(n.advancedDateTime=Date.now()-a,n.live||null!=i&&i.live){if(n.reloaded(i),i&&this.log(`live playlist ${e} ${n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED"}`),i&&n.fragments.length>0&&function(e,t){let i=null;const n=e.fragments;for(let e=n.length-1;e>=0;e--){const t=n[e].initSegment;if(t){i=t;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;let r,s=0;if(function(e,t,i){const n=t.skippedSegments,r=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(n?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,a=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments;for(let e=r;e<=s;e++){const r=l[a+e];let s=o[e];n&&!s&&e<n&&(s=t.fragments[e]=r),r&&s&&i(r,s)}}(e,t,((e,n)=>{e.relurl&&(s=e.cc-n.cc),xe(e.startPTS)&&xe(e.endPTS)&&(n.start=n.startPTS=e.startPTS,n.startDTS=e.startDTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.duration=e.endPTS-e.startPTS,n.duration&&(r=n),t.PTSKnown=t.alignedSliding=!0),n.elementaryStreams=e.elementaryStreams,n.loader=e.loader,n.stats=e.stats,n.urlId=e.urlId,e.initSegment&&(n.initSegment=e.initSegment,i=e.initSegment)})),i&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((e=>{var t;e.initSegment&&e.initSegment.relurl!==(null==(t=i)?void 0:t.relurl)||(e.initSegment=i)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((e=>!e)),t.deltaUpdateFailed){Ue.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let e=t.skippedSegments;e--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,i){const n=je({},e);return i&&i.forEach((e=>{delete n[e]})),Object.keys(t).forEach((e=>{const i=new Qe(t[e].attr,n[e]);i.isValid?n[e]=i:Ue.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(t[e].attr)}"`)})),n}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));const a=t.fragments;if(s){Ue.warn("discontinuity sliding from playlist, take drift into account");for(let e=0;e<a.length;e++)a[e].cc+=s}t.skippedSegments&&(t.startCC=t.fragments[0].cc),function(e,t,i){if(e&&t){let n=0;for(let r=0,s=e.length;r<=s;r++){const s=e[r],a=t[r+n];s&&a&&s.index===a.index&&s.fragment.sn===a.fragment.sn?i(s,a):n--}}}(e.partList,t.partList,((e,t)=>{t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),r?Bi(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS):$i(e,t),a.length&&(t.totalduration=t.edge-a[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;const o=t.advancedDateTime;if(t.advanced&&o){const e=t.edge;t.driftStart||(t.driftStartTime=o,t.driftStart=e),t.driftEndTime=o,t.driftEnd=e}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}(i,n),!this.canLoad||!n.live)return;let a,o,l;if(n.canBlockReload&&n.endSN&&n.advanced){const e=this.hls.config.lowLatencyMode,r=n.lastPartSn,s=n.endSN,c=n.lastPartIndex,u=r===s,d=e?0:c;-1!==c?(o=u?s+1:r,l=u?d:c+1):o=s+1;const h=n.age,p=h+n.ageHeader;let f=Math.min(p-n.partTarget,1.5*n.targetduration);if(f>0){if(i&&f>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${f} with playlist age: ${n.age}`),f=0;else{const e=Math.floor(f/n.targetduration);o+=e,void 0!==l&&(l+=Math.round(f%n.targetduration/n.partTarget)),this.log(`CDN Tune-in age: ${n.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${f} skip sn ${e} to part ${l}`)}n.tuneInGoal=f}if(a=this.getDeliveryDirectives(n,t.deliveryDirectives,o,l),e||!u)return void this.loadPlaylist(a)}else n.canBlockReload&&(a=this.getDeliveryDirectives(n,t.deliveryDirectives,o,l));const c=this.hls.mainForwardBufferInfo,u=c?c.end-c.len:0,d=function(e,t=1/0){let i=1e3*e.targetduration;if(e.updated){const n=e.fragments,r=4;if(n.length&&i*r>t){const e=1e3*n[n.length-1].duration;e<i&&(i=e)}}else i/=2;return Math.round(i)}(n,1e3*(n.edge-u));n.updated&&s>this.requestScheduled+d&&(this.requestScheduled=r.loading.start),void 0!==o&&n.canBlockReload?this.requestScheduled=r.loading.first+d-(1e3*n.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+d<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=d);let h=this.requestScheduled-s;h=Math.max(0,h),this.log(`reload live playlist ${e} in ${Math.round(h)} ms`),this.timer=self.setTimeout((()=>this.loadPlaylist(a)),h)}else this.clearTimer()}getDeliveryDirectives(e,t,i,n){let r=function(e,t){const{canSkipUntil:i,canSkipDateRanges:n,endSN:r}=e;return i&&(void 0!==t?t-r:0)<i?n?"v2":"YES":""}(e,i);return null!=t&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,n=t.part,r=""),new Fi(i,n,r)}checkRetry(e){const t=e.details,i=qi(e),n=e.errorAction,{action:r,retryCount:s=0,retryConfig:a}=n||{},o=5===r&&!!n&&!!a;if(o){var l;if(this.requestScheduled=-1,i&&null!=(l=e.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const e=Zi(a,s);this.timer=self.setTimeout((()=>this.loadPlaylist()),e),this.warn(`Retrying playlist loading ${s+1}/${a.maxNumRetry} after "${t}" in ${e}ms`)}e.levelRetry=!0,n.resolved=!0}return o}}let sn;class an extends rn{constructor(e,t){super(e,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_e.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_e.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(_e.FRAG_LOADED,this.onFragLoaded,this),e.on(_e.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_e.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_e.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(_e.FRAG_LOADED,this.onFragLoaded,this),e.off(_e.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}startLoad(){this._levels.forEach((e=>{e.loadError=0,e.fragmentError=0})),super.startLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const i=[],n={};let r;t.levels.forEach((e=>{var t;const s=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(sn||(sn=/chrome|firefox/i.test(navigator.userAgent)),sn&&(e.audioCodec=void 0));const{AUDIO:a,CODECS:o,"FRAME-RATE":l,"PATHWAY-ID":c,RESOLUTION:u,SUBTITLES:d}=s,h=`${c||"."}-${e.bitrate}-${u}-${l}-${o}`;r=n[h],r?r.addFallback(e):(r=new Ui(e),n[h]=r,i.push(r)),on(r,"audio",a),on(r,"text",d)})),this.filterAndSortMediaOptions(i,t)}filterAndSortMediaOptions(e,t){let i=[],n=[],r=!1,s=!1,a=!1,o=e.filter((({audioCodec:e,videoCodec:t,width:i,height:n,unknownCodecs:o})=>(r||(r=!(!i||!n)),s||(s=!!t),a||(a=!!e),!(null!=o&&o.length)&&(!e||ni(e,"audio"))&&(!t||ni(t,"video")))));if((r||s)&&a&&(o=o.filter((({videoCodec:e,width:t,height:i})=>!!e||!(!t||!i)))),0===o.length)return void Promise.resolve().then((()=>{if(this.hls){const e=new Error("no level with compatible codecs found in manifest");this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}));t.audioTracks&&(i=t.audioTracks.filter((e=>!e.audioCodec||ni(e.audioCodec,"audio"))),ln(i)),t.subtitles&&(n=t.subtitles,ln(n));const l=o.slice(0);o.sort(((e,t)=>e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):r&&e.height!==t.height?e.height-t.height:0));let c=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let e=0;e<l.length;e++)if(l[e].pathwayId===o[0].pathwayId){c=l[e];break}this._levels=o;for(let e=0;e<o.length;e++)if(o[e]===c){this._firstLevel=e,this.log(`manifest loaded, ${o.length} level(s) found, first bitrate: ${c.bitrate}`);break}const u=a&&!s,d={levels:o,audioTracks:i,subtitleTracks:n,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:s,altAudio:!u&&i.some((e=>!!e.url))};this.hls.trigger(_e.MANIFEST_PARSED,d),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(0===t.length)return;if(e<0||e>=t.length){const i=new Error("invalid level idx"),n=e<0;if(this.hls.trigger(_e.ERROR,{type:Oe.OTHER_ERROR,details:Pe.LEVEL_SWITCH_ERROR,level:e,fatal:n,error:i,reason:i.message}),n)return;e=Math.min(e,t.length-1)}const i=this.currentLevelIndex,n=this.currentLevel,r=n?n.attrs["PATHWAY-ID"]:void 0,s=t[e],a=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=s,i===e&&s.details&&n&&r===a)return;this.log(`Switching to level ${e}${a?" with Pathway "+a:""} from level ${i}${r?" with Pathway "+r:""}`);const o=je({},s,{level:e,maxBitrate:s.maxBitrate,attrs:s.attrs,uri:s.uri,urlId:s.urlId});delete o._attrs,delete o._urlId,this.hls.trigger(_e.LEVEL_SWITCHING,o);const l=s.details;if(!l||l.live){const e=this.switchParams(s.uri,null==n?void 0:n.details);this.loadPlaylist(e)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(void 0===this._startLevel){const e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel}set startLevel(e){this._startLevel=e}onError(e,t){!t.fatal&&t.context&&t.context.type===vi&&t.context.level===this.level&&this.checkRetry(t)}onFragLoaded(e,{frag:t}){if(void 0!==t&&t.type===Li){const e=this._levels[t.level];void 0!==e&&(e.loadError=0)}}onLevelLoaded(e,t){var i;const{level:n,details:r}=t,s=this._levels[n];var a;if(!s)return this.warn(`Invalid level index ${n}`),void(null!=(a=t.deliveryDirectives)&&a.skip&&(r.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0),this.playlistLoaded(n,t,s.details)):null!=(i=t.deliveryDirectives)&&i.skip&&(r.deltaUpdateFailed=!0)}onAudioTrackSwitched(e,t){const i=this.currentLevel;if(!i)return;const n=this.hls.audioTracks[t.id].groupId;if(i.audioGroupIds&&i.audioGroupId!==n){let e=-1;for(let t=0;t<i.audioGroupIds.length;t++)if(i.audioGroupIds[t]===n){e=t;break}-1!==e&&e!==i.urlId&&(i.urlId=e,this.canLoad&&this.startLoad())}}loadPlaylist(e){super.loadPlaylist();const t=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){const n=i.urlId;let r=i.uri;if(e)try{r=e.addDirectives(r)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}const s=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${t}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""} with${s?" Pathway "+s:""} URI ${n+1}/${i.url.length} ${r}`),this.clearTimer(),this.hls.trigger(_e.LEVEL_LOADING,{url:r,level:t,id:n,deliveryDirectives:e||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}removeLevel(e,t){const i=(e,i)=>i!==t,n=this._levels.filter(((n,r)=>r!==e||(n.url.length>1&&void 0!==t?(n.url=n.url.filter(i),n.audioGroupIds&&(n.audioGroupIds=n.audioGroupIds.filter(i)),n.textGroupIds&&(n.textGroupIds=n.textGroupIds.filter(i)),n.urlId=0,!0):(this.steering&&this.steering.removeLevel(n),!1))));this.hls.trigger(_e.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){t.forEach(((e,t)=>{const{details:i}=e;null!=i&&i.fragments&&i.fragments.forEach((e=>{e.level=t}))})),this._levels=t}}function on(e,t,i){i&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=i):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=i))}function ln(e){const t={};e.forEach((e=>{const i=e.groupId||"";e.id=t[i]=t[i]||0,t[i]++}))}var cn="NOT_LOADED",un="APPENDING",dn="PARTIAL",hn="OK";class pn{constructor(e){this.mainFragEntity=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(_e.BUFFER_APPENDED,this.onBufferAppended,this),e.on(_e.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_e.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.BUFFER_APPENDED,this.onBufferAppended,this),e.off(_e.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_e.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.mainFragEntity=this.activeParts=null}getAppendedFrag(e,t){if(t===Li){const{mainFragEntity:t,activeParts:i}=this;if(t)if(t&&i)for(let n=i.length;n--;){const r=i[n],s=r?r.end:t.appendedPTS;if(r.start<=e&&null!==s&&e<=s)return n>9&&(this.activeParts=i.slice(n-9)),r}else if(t.body.start<=e&&null!==t.appendedPTS&&e<=t.appendedPTS)return t.body}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){const{fragments:i}=this,n=Object.keys(i);for(let r=n.length;r--;){const s=i[n[r]];if((null==s?void 0:s.body.type)===t&&s.buffered){const t=s.body;if(t.start<=e&&e<=t.end)return t}}return null}detectEvictedFragments(e,t,i){this.timeRanges&&(this.timeRanges[e]=t),Object.keys(this.fragments).forEach((n=>{const r=this.fragments[n];if(!r)return;if(!r.buffered&&!r.loaded)return void(r.body.type===i&&this.removeFragment(r.body));const s=r.range[e];s&&s.time.some((e=>{const i=!this.isTimeBuffered(e.startPTS,e.endPTS,t);return i&&this.removeFragment(r.body),i}))}))}detectPartialFragments(e){const t=this.timeRanges,{frag:i,part:n}=e;if(!t||"initSegment"===i.sn)return;const r=gn(i),s=this.fragments[r];s&&(Object.keys(t).forEach((e=>{const r=i.elementaryStreams[e];if(!r)return;const a=t[e],o=null!==n||!0===r.partial;s.range[e]=this.getBufferedTimes(i,n,o,a)})),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,s.body.endList&&(this.endListFragments[s.body.type]=s)):this.removeFragment(s.body))}fragBuffered(e,t){const i=gn(e);let n=this.fragments[i];!n&&t&&(n=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),n&&(n.loaded=null,n.buffered=!0)}getBufferedTimes(e,t,i,n){const r={time:[],partial:i},s=t?t.start:e.start,a=t?t.end:e.end,o=e.minEndPTS||a,l=e.maxStartPTS||s;for(let e=0;e<n.length;e++){const t=n.start(e)-this.bufferPadding,i=n.end(e)+this.bufferPadding;if(l>=t&&o<=i){r.time.push({startPTS:Math.max(s,n.start(e)),endPTS:Math.min(a,n.end(e))});break}if(s<i&&a>t)r.partial=!0,r.time.push({startPTS:Math.max(s,n.start(e)),endPTS:Math.min(a,n.end(e))});else if(a<=t)break}return r}getPartialFragment(e){let t,i,n,r=null,s=0;const{bufferPadding:a,fragments:o}=this;return Object.keys(o).forEach((l=>{const c=o[l];c&&fn(c)&&(i=c.body.start-a,n=c.body.end+a,e>=i&&e<=n&&(t=Math.min(e-i,n-e),s<=t&&(r=c.body,s=t)))})),r}isEndListAppended(e){const t=this.endListFragments[e];return void 0!==t&&(t.buffered||fn(t))}getState(e){const t=gn(e),i=this.fragments[t];return i?i.buffered?fn(i)?dn:hn:un:cn}isTimeBuffered(e,t,i){let n,r;for(let s=0;s<i.length;s++){if(n=i.start(s)-this.bufferPadding,r=i.end(s)+this.bufferPadding,e>=n&&t<=r)return!0;if(t<=n)return!1}return!1}onFragLoaded(e,t){const{frag:i,part:n}=t;if("initSegment"===i.sn||i.bitrateTest||n)return;const r=gn(i);this.fragments[r]={body:i,appendedPTS:null,loaded:t,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:n,timeRanges:r}=t;let s=this.mainFragEntity;if(i.type===Li){const e=s?s.body:null;if(e!==i){s&&e&&e.sn!==i.sn&&(s.buffered=!0,this.fragments[gn(e)]=s);const t=gn(i);s=this.mainFragEntity=this.fragments[t]||{body:i,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)}}if(n){let e=this.activeParts;e||(this.activeParts=e=[]),e.push(n)}else this.activeParts=null}this.timeRanges=r,Object.keys(r).forEach((e=>{const t=r[e];if(this.detectEvictedFragments(e,t),!n&&s){const n=i.elementaryStreams[e];if(!n)return;for(let e=0;e<t.length;e++){const i=t.end(e);i<=n.endPTS&&i>n.startPTS?s.appendedPTS=Math.max(i,s.appendedPTS||0):s.appendedPTS=n.endPTS}}}))}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=gn(e);return!!this.fragments[t]}removeFragmentsInRange(e,t,i,n,r){n&&!this.hasGaps||Object.keys(this.fragments).forEach((s=>{const a=this.fragments[s];if(!a)return;const o=a.body;o.type!==i||n&&!o.gap||o.start<t&&o.end>e&&(a.buffered||r)&&this.removeFragment(o)}))}removeFragment(e){const t=gn(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),this.mainFragEntity===this.fragments[t]&&(this.mainFragEntity=null),delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.mainFragEntity=null,this.activeParts=null,this.hasGaps=!1}}function fn(e){var t,i;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(i=e.range.audio)?void 0:i.partial))}function gn(e){return`${e.type}_${e.level}_${e.urlId}_${e.sn}`}const yn=Math.pow(2,17);class mn{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const i=e.url;if(!i)return Promise.reject(new Tn({type:Oe.NETWORK_ERROR,details:Pe.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();const n=this.config,r=n.fLoader,s=n.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap)return void o(Mn(e));const l=this.loader=e.loader=r?new r(n):new s(n),c=vn(e),u=Vi(n.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:yn};e.stats=l.stats,l.load(c,d,{onSuccess:(t,i,n,r)=>{this.resetLoader(e,l);let s=t.data;n.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),a({frag:e,part:null,payload:s,networkDetails:r})},onError:(t,n,r,s)=>{this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:De({url:i,data:void 0},t),error:new Error(`HTTP Error ${t.code} ${t.text}`),networkDetails:r,stats:s}))},onAbort:(t,i,n)=>{this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:n,stats:t}))},onTimeout:(t,i,n)=>{this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:n,stats:t}))},onProgress:(i,n,r,s)=>{t&&t({frag:e,part:null,payload:r,networkDetails:s})}})}))}loadPart(e,t,i){this.abort();const n=this.config,r=n.fLoader,s=n.loader;return new Promise(((a,o)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap)return void o(Mn(e,t));const l=this.loader=e.loader=r?new r(n):new s(n),c=vn(e,t),u=Vi(n.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:yn};t.stats=l.stats,l.load(c,d,{onSuccess:(n,r,s,o)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const c={frag:e,part:t,payload:n.data,networkDetails:o};i(c),a(c)},onError:(i,n,r,s)=>{this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:De({url:c.url,data:void 0},i),error:new Error(`HTTP Error ${i.code} ${i.text}`),networkDetails:r,stats:s}))},onAbort:(i,n,r)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:r,stats:i}))},onTimeout:(i,n,r)=>{this.resetLoader(e,l),o(new Tn({type:Oe.NETWORK_ERROR,details:Pe.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:r,stats:i}))}})}))}updateStatsFromPart(e,t){const i=e.stats,n=t.stats,r=n.total;if(i.loaded+=n.loaded,r){const n=Math.round(e.duration/t.duration),s=Math.min(Math.round(i.loaded/r),n),a=(n-s)*Math.round(i.loaded/s);i.total=i.loaded+a}else i.total=Math.max(i.loaded,i.total);const s=i.loading,a=n.loading;s.start?s.first+=a.first-a.start:(s.start=a.start,s.first=a.first),s.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function vn(e,t=null){const i=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},r=i.byteRangeStartOffset,s=i.byteRangeEndOffset;if(xe(r)&&xe(s)){var a;let t=r,i=s;if("initSegment"===e.sn&&"AES-128"===(null==(a=e.decryptdata)?void 0:a.method)){const e=s-r;e%16&&(i=s+(16-e%16)),0!==r&&(n.resetIV=!0,t=r-16)}n.rangeStart=t,n.rangeEnd=i}return n}function Mn(e,t){const i=new Error(`GAP ${e.gap?"tag":"attribute"} found`),n={type:Oe.MEDIA_ERROR,details:Pe.FRAG_GAP,fatal:!1,frag:e,error:i,networkDetails:null};return t&&(n.part=t),(t||e).stats.aborted=!0,new Tn(n)}class Tn extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Ln{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.abort()}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=Pe.KEY_LOAD_ERROR,i,n,r){return new Tn({type:Oe.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:i,networkDetails:n})}loadClear(e,t){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:n}=e;for(let e=0;e<t.length;e++){const r=t[e];if(n<=r.cc&&("initSegment"===i||"initSegment"===r.sn||i<r.sn)){this.emeController.selectKeySystemFormat(r).then((e=>{r.setKeyFormat(e)}));break}}}}load(e){return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((t=>this.loadInternal(e,t))):this.loadInternal(e)}loadInternal(e,t){var i,n;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const i=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,Pe.KEY_LOAD_ERROR,i))}const s=r.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,Pe.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let a=this.keyUriToKeyInfo[s];if(null!=(i=a)&&i.decryptdata.key)return r.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});var o;if(null!=(n=a)&&n.keyLoadPromise)switch(null==(o=a.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then((t=>(r.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:a})))}switch(a=this.keyUriToKeyInfo[s]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===r.keyFormat?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,Pe.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const t=this.emeController.loadKey(i);if(t)return(e.keyLoadPromise=t.then((t=>(e.mediaKeySessionContext=t,i)))).catch((t=>{throw e.keyLoadPromise=null,t}))}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,n=new(0,i.loader)(i);return t.keyLoader=e.loader=n,e.keyLoadPromise=new Promise(((r,s)=>{const a={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},o=i.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,i,n)=>{const{frag:a,keyInfo:o,url:l}=i;if(!a.decryptdata||o!==this.keyUriToKeyInfo[l])return s(this.createKeyLoadError(a,Pe.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),n));o.decryptdata.key=a.decryptdata.key=new Uint8Array(e.data),a.keyLoader=null,o.loader=null,r({frag:a,keyInfo:o})},onError:(e,i,n,r)=>{this.resetLoader(i),s(this.createKeyLoadError(t,Pe.KEY_LOAD_ERROR,new Error(`HTTP Error ${e.code} loading key ${e.text}`),n,De({url:a.url,data:void 0},e)))},onTimeout:(e,i,n)=>{this.resetLoader(i),s(this.createKeyLoadError(t,Pe.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),n))},onAbort:(e,i,n)=>{this.resetLoader(i),s(this.createKeyLoadError(t,Pe.INTERNAL_ABORTED,new Error("key loading aborted"),n))}};n.load(a,l,c)}))}resetLoader(e){const{frag:t,keyInfo:i,url:n}=e,r=i.loader;t.keyLoader===r&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[n],r&&r.destroy()}}class bn{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}const En={length:0,start:()=>0,end:()=>0};class In{static isBuffered(e,t){try{if(e){const i=In.getBuffered(e);for(let e=0;e<i.length;e++)if(t>=i.start(e)&&t<=i.end(e))return!0}}catch(e){}return!1}static bufferInfo(e,t,i){try{if(e){const n=In.getBuffered(e),r=[];let s;for(s=0;s<n.length;s++)r.push({start:n.start(s),end:n.end(s)});return this.bufferedInfo(r,t,i)}}catch(e){}return{len:0,start:t,end:t,nextStart:void 0}}static bufferedInfo(e,t,i){t=Math.max(0,t),e.sort((function(e,t){return e.start-t.start||t.end-e.end}));let n=[];if(i)for(let t=0;t<e.length;t++){const r=n.length;if(r){const s=n[r-1].end;e[t].start-s<i?e[t].end>s&&(n[r-1].end=e[t].end):n.push(e[t])}else n.push(e[t])}else n=e;let r,s=0,a=t,o=t;for(let e=0;e<n.length;e++){const l=n[e].start,c=n[e].end;if(t+i>=l&&t<c)a=l,o=c,s=o-t;else if(t+i<l){r=l;break}}return{len:s,start:a||0,end:o||0,nextStart:r}}static getBuffered(e){try{return e.buffered}catch(e){return Ue.log("failed to get media.buffered",e),En}}}class Nn{constructor(e,t,i,n=0,r=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=i,this.size=n,this.part=r,this.partial=s}}function Sn(e,t){let i=null;for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r&&r.cc===t){i=r;break}}return i}function wn(e,t){if(e){const i=e.start+t;e.start=e.startPTS=i,e.endPTS=i+e.duration}}function An(e,t){const i=t.fragments;for(let t=0,n=i.length;t<n;t++)wn(i[t],e);t.fragmentHint&&wn(t.fragmentHint,e),t.alignedSliding=!0}function Cn(e,t){if(!e.hasProgramDateTime||!t.hasProgramDateTime)return;const i=e.fragments,n=t.fragments;if(!i.length||!n.length)return;const r=n[Math.round(n.length/2)-1],s=Sn(i,r.cc)||i[Math.round(i.length/2)-1],a=r.programDateTime,o=s.programDateTime;null!==a&&null!==o&&An((o-a)/1e3-(s.start-r.start),e)}class Dn{constructor(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}decrypt(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}class kn{constructor(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class jn{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),i=new Uint32Array(4);for(let e=0;e<4;e++)i[e]=t.getUint32(4*e);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,n=i[0],r=i[1],s=i[2],a=i[3],o=this.invSubMix,l=o[0],c=o[1],u=o[2],d=o[3],h=new Uint32Array(256);let p=0,f=0,g=0;for(g=0;g<256;g++)h[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){let i=f^f<<1^f<<2^f<<3^f<<4;i=i>>>8^255&i^99,e[p]=i,t[i]=p;const o=h[p],g=h[o],y=h[g];let m=257*h[i]^16843008*i;n[p]=m<<24|m>>>8,r[p]=m<<16|m>>>16,s[p]=m<<8|m>>>24,a[p]=m,m=16843009*y^65537*g^257*o^16843008*p,l[i]=m<<24|m>>>8,c[i]=m<<16|m>>>16,u[i]=m<<8|m>>>24,d[i]=m,p?(p=o^h[h[h[y^o]]],f^=h[h[f]]):p=f=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let i=!0,n=0;for(;n<t.length&&i;)i=t[n]===this.key[n],n++;if(i)return;this.key=t;const r=this.keySize=t.length;if(4!==r&&6!==r&&8!==r)throw new Error("Invalid aes key size="+r);const s=this.ksRows=4*(r+6+1);let a,o;const l=this.keySchedule=new Uint32Array(s),c=this.invKeySchedule=new Uint32Array(s),u=this.sBox,d=this.rcon,h=this.invSubMix,p=h[0],f=h[1],g=h[2],y=h[3];let m,v;for(a=0;a<s;a++)a<r?m=l[a]=t[a]:(v=m,a%r==0?(v=v<<8|v>>>24,v=u[v>>>24]<<24|u[v>>>16&255]<<16|u[v>>>8&255]<<8|u[255&v],v^=d[a/r|0]<<24):r>6&&a%r==4&&(v=u[v>>>24]<<24|u[v>>>16&255]<<16|u[v>>>8&255]<<8|u[255&v]),l[a]=m=(l[a-r]^v)>>>0);for(o=0;o<s;o++)a=s-o,v=3&o?l[a]:l[a-4],c[o]=o<4||a<=4?v:p[u[v>>>24]]^f[u[v>>>16&255]]^g[u[v>>>8&255]]^y[u[255&v]],c[o]=c[o]>>>0}networkToHostOrderSwap(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}decrypt(e,t,i){const n=this.keySize+6,r=this.invKeySchedule,s=this.invSBox,a=this.invSubMix,o=a[0],l=a[1],c=a[2],u=a[3],d=this.uint8ArrayToUint32Array_(i);let h=d[0],p=d[1],f=d[2],g=d[3];const y=new Int32Array(e),m=new Int32Array(y.length);let v,M,T,L,b,E,I,N,S,w,A,C,D,k;const j=this.networkToHostOrderSwap;for(;t<y.length;){for(S=j(y[t]),w=j(y[t+1]),A=j(y[t+2]),C=j(y[t+3]),b=S^r[0],E=C^r[1],I=A^r[2],N=w^r[3],D=4,k=1;k<n;k++)v=o[b>>>24]^l[E>>16&255]^c[I>>8&255]^u[255&N]^r[D],M=o[E>>>24]^l[I>>16&255]^c[N>>8&255]^u[255&b]^r[D+1],T=o[I>>>24]^l[N>>16&255]^c[b>>8&255]^u[255&E]^r[D+2],L=o[N>>>24]^l[b>>16&255]^c[E>>8&255]^u[255&I]^r[D+3],b=v,E=M,I=T,N=L,D+=4;v=s[b>>>24]<<24^s[E>>16&255]<<16^s[I>>8&255]<<8^s[255&N]^r[D],M=s[E>>>24]<<24^s[I>>16&255]<<16^s[N>>8&255]<<8^s[255&b]^r[D+1],T=s[I>>>24]<<24^s[N>>16&255]<<16^s[b>>8&255]<<8^s[255&E]^r[D+2],L=s[N>>>24]<<24^s[b>>16&255]<<16^s[E>>8&255]<<8^s[255&I]^r[D+3],m[t]=j(v^h),m[t+1]=j(L^p),m[t+2]=j(T^f),m[t+3]=j(M^g),h=S,p=w,f=A,g=C,t+=4}return m.buffer}}class xn{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const e=self.crypto;e&&(this.subtle=e.subtle||e.webkitSubtle)}catch(e){}null===this.subtle&&(this.useSoftware=!0)}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){const t=e.byteLength,i=t&&new DataView(e.buffer).getUint8(t-1);return i?ht(e,0,t-i):e}(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i){return this.useSoftware?new Promise(((n,r)=>{this.softwareDecrypt(new Uint8Array(e),t,i);const s=this.flush();s?n(s.buffer):r(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,i)}softwareDecrypt(e,t,i){const{currentIV:n,currentResult:r,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(e=$t(s,e),this.remainderData=null);const a=this.getValidChunk(e);if(!a.length)return null;n&&(i=n);let o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new jn),o.expandKey(t);const l=r;return this.currentResult=o.decrypt(a.buffer,0,i),this.currentIV=ht(a,-16).buffer,l||null}webCryptoDecrypt(e,t,i){const n=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new kn(n,t)),this.fastAesKey.expandKey().then((t=>n?(this.logOnce("WebCrypto AES decrypt"),new Dn(n,new Uint8Array(i)).decrypt(e.buffer,t)):Promise.reject(new Error("web crypto not initialized")))).catch((n=>(Ue.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${n.name}: ${n.message}`),this.onWebCryptoError(e,t,i))))}onWebCryptoError(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);const n=this.flush();if(n)return n.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(e){let t=e;const i=e.length-e.length%16;return i!==e.length&&(t=ht(e,0,i),this.remainderData=ht(e,i)),t}logOnce(e){this.logEnabled&&(Ue.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const _n="STOPPED",On="IDLE",Pn="KEY_LOADING",Rn="FRAG_LOADING",zn="FRAG_LOADING_WAITING_RETRY",Fn="WAITING_TRACK",Un="PARSING",Yn="PARSED",Bn="ENDED",$n="ERROR",Gn="WAITING_INIT_PTS",Qn="WAITING_LEVEL";class Hn extends bn{constructor(e,t,i,n,r){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=_n,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=r,this.logPrefix=n,this.log=Ue.log.bind(Ue,`${n}:`),this.warn=Ue.warn.bind(Ue,`${n}:`),this.hls=e,this.fragmentLoader=new mn(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new xn(e.config),e.on(_e.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort();const e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_n}_streamEnded(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;const i=t.partList;if(null!=i&&i.length){const e=i[i.length-1];return In.isBuffered(this.media,e.start+e.duration/2)}const n=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(n)}getLevelDetails(){var e;if(this.levels&&null!==this.levelLastLoaded)return null==(e=this.levels[this.levelLastLoaded])?void 0:e.details}onMediaAttached(e,t){const i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const n=this.config;this.levels&&n.autoStartLoad&&this.state===_n&&this.startLoad(n.startPosition)}onMediaDetaching(){const e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:e,fragCurrent:t,media:i,mediaBuffer:n,state:r}=this,s=i?i.currentTime:0,a=In.bufferInfo(n||i,s,e.maxBufferHole);if(this.log(`media seeking to ${xe(s)?s.toFixed(3):s}, state: ${r}`),this.state===Bn)this.resetLoadingState();else if(t){const i=e.maxFragLookUpTolerance,n=t.start-i,r=t.start+t.duration+i;if(!a.len||r<a.start||n>a.end){const e=s>r;(s<n||e)&&(e&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests()),this.resetLoadingState())}}i&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),this.loadedmetadata||a.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.stopLoad(),super.onHandlerDestroying()}onHandlerDestroyed(){this.state=_n,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,i){this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){this._doFragLoad(e,t,i,(t=>{if(this.fragContextChanged(e))return this.warn(`Fragment ${e.sn}${t.part?" p: "+t.part.index:""} of level ${e.level} was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)})).then((t=>{if(!t)return;const i=this.state;this.fragContextChanged(e)?(i===Rn||!this.fragCurrent&&i===Un)&&(this.fragmentTracker.removeFragment(e),this.state=On):("payload"in t&&(this.log(`Loaded fragment ${e.sn} of level ${e.level}`),this.hls.trigger(_e.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))})).catch((t=>{this.state!==_n&&this.state!==$n&&(this.warn(t),this.resetFragmentLoading(e))}))}clearTrackerIfNeeded(e){var t;if(this.fragmentTracker.getState(e)===un){const t=e.type,i=this.getFwdBufferInfo(this.mediaBuffer,t),n=Math.max(e.duration,i?i.len:this.config.maxBufferLength);this.reduceMaxBufferLength(n)&&this.fragmentTracker.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)&&this.fragmentTracker.removeAllFragments()}flushMainBuffer(e,t,i=null){if(!(e-t))return;const n={startOffset:e,endOffset:t,type:i};this.hls.trigger(_e.BUFFER_FLUSHING,n)}_loadInitSegment(e,t){this._doFragLoad(e,t).then((t=>{if(!t||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t})).then((t=>{const{hls:i}=this,{payload:n}=t,r=e.decryptdata;if(n&&n.byteLength>0&&r&&r.key&&r.iv&&"AES-128"===r.method){const s=self.performance.now();return this.decrypter.decrypt(new Uint8Array(n),r.key.buffer,r.iv.buffer).catch((t=>{throw i.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((n=>{const r=self.performance.now();return i.trigger(_e.FRAG_DECRYPTED,{frag:e,payload:n,stats:{tstart:s,tdecrypt:r}}),t.payload=n,t}))}return t})).then((i=>{const{fragCurrent:n,hls:r,levels:s}=this;if(!s)throw new Error("init load aborted, missing levels");const a=e.stats;this.state=On,t.fragmentError=0,e.data=new Uint8Array(i.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),i.frag===n&&r.trigger(_e.FRAG_BUFFERED,{stats:a,frag:n,part:null,id:e.type}),this.tick()})).catch((t=>{this.state!==_n&&this.state!==$n&&(this.warn(t),this.resetFragmentLoading(e))}))}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}fragBufferedComplete(e,t){var i,n,r,s;const a=this.mediaBuffer?this.mediaBuffer:this.media;this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level} (frag:[${(null!=(i=e.startPTS)?i:NaN).toFixed(3)}-${(null!=(n=e.endPTS)?n:NaN).toFixed(3)}] > buffer:${a?function(e){let t="";const i=e.length;for(let n=0;n<i;n++)t+=`[${e.start(n).toFixed(3)}-${e.end(n).toFixed(3)}]`;return t}(In.getBuffered(a)):"(detached)"})`),this.state=On,a&&(!this.loadedmetadata&&e.type==Li&&a.buffered.length&&(null==(r=this.fragCurrent)?void 0:r.sn)===(null==(s=this.fragPrevious)?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:i,part:n,partsLoaded:r}=e,s=!r||0===r.length||r.some((e=>!e)),a=new Nn(i.level,i.sn,i.stats.chunkCount+1,0,n?n.index:-1,!s);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=null,n){var r;const s=null==t?void 0:t.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let a=null;if(!e.encrypted||null!=(r=e.decryptdata)&&r.key?!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments):(this.log(`Loading key for ${e.sn} of [${s.startSN}-${s.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${e.level}`),this.state=Pn,this.fragCurrent=e,a=this.keyLoader.load(e).then((e=>{if(!this.fragContextChanged(e.frag))return this.hls.trigger(_e.KEY_LOADED,e),this.state===Pn&&(this.state=On),e})),this.hls.trigger(_e.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),i=Math.max(e.start,i||0),this.config.lowLatencyMode){const r=s.partList;if(r&&n){i>e.end&&s.fragmentHint&&(e=s.fragmentHint);const o=this.getNextPart(r,e,i);if(o>-1){const l=r[o];let c;return this.log(`Loading part sn: ${e.sn} p: ${l.index} cc: ${e.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${o}-${r.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Rn,c=a?a.then((i=>!i||this.fragContextChanged(i.frag)?null:this.doFragPartsLoad(e,l,t,n))).catch((e=>this.handleFragLoadError(e))):this.doFragPartsLoad(e,l,t,n).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(_e.FRAG_LOADING,{frag:e,part:l,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c}if(!e.url||this.loadedEndOfParts(r,i))return Promise.resolve(null)}}this.log(`Loading fragment ${e.sn} cc: ${e.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${e.level}, target: ${parseFloat(i.toFixed(3))}`),xe(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Rn;const o=this.config.progressive;let l;return l=o&&a?a.then((t=>!t||this.fragContextChanged(null==t?void 0:t.frag)?null:this.fragmentLoader.load(e,n))).catch((e=>this.handleFragLoadError(e))):Promise.all([this.fragmentLoader.load(e,o?n:void 0),a]).then((([e])=>(!o&&e&&n&&n(e),e))).catch((e=>this.handleFragLoadError(e))),this.hls.trigger(_e.FRAG_LOADING,{frag:e,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):l}doFragPartsLoad(e,t,i,n){return new Promise(((r,s)=>{var a;const o=[],l=null==(a=i.details)?void 0:a.partList,c=t=>{this.fragmentLoader.loadPart(e,t,n).then((n=>{o[t.index]=n;const s=n.part;this.hls.trigger(_e.FRAG_LOADED,n);const a=Qi(i,e.sn,t.index+1)||Hi(l,e.sn,t.index+1);if(!a)return r({frag:e,part:s,partsLoaded:o});c(a)})).catch(s)};c(t)}))}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===Pe.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(_e.ERROR,t)}else this.hls.trigger(_e.ERROR,{type:Oe.OTHER_ERROR,details:Pe.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Un)return void(this.fragCurrent||this.state===_n||this.state===$n||(this.state=On));const{frag:i,part:n,level:r}=t,s=self.performance.now();i.stats.parsing.end=s,n&&(n.stats.parsing.end=s),this.updateLevelTiming(i,n,r,e.partial)}getCurrentContext(e){const{levels:t,fragCurrent:i}=this,{level:n,sn:r,part:s}=e;if(null==t||!t[n])return this.warn(`Levels object was unset while buffering fragment ${r} of level ${n}. The current chunk will not be buffered.`),null;const a=t[n],o=s>-1?Qi(a,r,s):null,l=o?o.fragment:function(e,t,i){if(null==e||!e.details)return null;const n=e.details;let r=n.fragments[t-n.startSN];return r||(r=n.fragmentHint,r&&r.sn===t?r:t<n.startSN&&i&&i.sn===t?i:null)}(a,r,i);return l?(i&&i!==l&&(l.stats=i.stats),{frag:l,part:o,level:a}):null}bufferFragmentData(e,t,i,n){var r;if(!e||this.state!==Un)return;const{data1:s,data2:a}=e;let o=s;if(s&&a&&(o=$t(s,a)),null==(r=o)||!r.length)return;const l={type:e.type,frag:t,part:i,chunkMeta:n,parent:t.type,data:o};this.hls.trigger(_e.BUFFER_APPENDING,l),e.dropped&&e.independent&&!i&&this.flushBufferGap(t)}flushBufferGap(e){const t=this.media;if(!t)return;if(!In.isBuffered(t,t.currentTime))return void this.flushMainBuffer(0,e.start);const i=t.currentTime,n=In.bufferInfo(t,i,0),r=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*r),a=Math.max(Math.min(e.start-s,n.end-s),i+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){const i=this.getLoadPosition();return xe(i)?this.getFwdBufferInfoAtPos(e,i,t):null}getFwdBufferInfoAtPos(e,t,i){const{config:{maxBufferHole:n}}=this,r=In.bufferInfo(e,t,n);if(0===r.len&&void 0!==r.nextStart){const s=this.fragmentTracker.getBufferedFrag(t,i);if(s&&r.nextStart<s.end)return In.bufferInfo(e,t,Math.max(r.nextStart,n))}return r}getMaxBufferLength(e){const{config:t}=this;let i;return i=e?Math.max(8*t.maxBufferSize/e,t.maxBufferLength):t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e){const t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i&&(t.maxMaxBufferLength/=2,this.warn(`Reduce max buffer length to ${t.maxMaxBufferLength}s`),!0)}getNextFragment(e,t){const i=t.fragments,n=i.length;if(!n)return null;const{config:r}=this,s=i[0].start;let a;if(t.live){const s=r.initialLiveManifestSize;if(n<s)return this.warn(`Not enough fragments to start playback (have: ${n}, need: ${s})`),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=s&&(a=i[0]);if(!a){const i=r.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,i,t)}return this.mapToInitFragWhenRequired(a)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===hn||i===dn&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,n,r){const s=e.gap,a=this.getNextFragment(this.nextLoadPosition,t);if(null===a)return a;if(e=a,s&&e&&!e.gap&&i.nextStart){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,n);if(null!==t&&i.len+t.len>=r)return this.log(`buffer full after gaps in "${n}" playlist starting at sn: ${e.sn}`),null}return e}mapToInitFragWhenRequired(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}getNextPart(e,t,i){let n=-1,r=!1,s=!0;for(let a=0,o=e.length;a<o;a++){const o=e[a];if(s=s&&!o.independent,n>-1&&i<o.start)break;const l=o.loaded;l?n=-1:(r||o.independent||s)&&o.fragment===t&&(n=a),r=l}return n}loadedEndOfParts(e,t){const i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e,t){const i=this.fragPrevious;let n=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),n=function(e,t,i){if(null===t||!Array.isArray(e)||!e.length||!xe(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;i=i||0;for(let n=0;n<e.length;++n){const r=e[n];if(tn(t,i,r))return r}return null}(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!n){const r=i.sn+1;if(r>=e.startSN&&r<=e.endSN){const s=t[r-e.startSN];i.cc===s.cc&&(n=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${n.sn}`))}n||(n=function(e,t){return Xi(e,(e=>e.cc<t?1:e.cc>t?-1:0))}(t,i.cc),n&&this.log(`Live playlist, switching playlist, load frag with same CC: ${n.sn}`))}}else{const t=this.hls.liveSyncPosition;null!==t&&(n=this.getFragmentAtPosition(t,this.bitrateTest?e.fragmentEnd:e.edge,e))}return n}getFragmentAtPosition(e,t,i){const{config:n}=this;let{fragPrevious:r}=this,{fragments:s,endSN:a}=i;const{fragmentHint:o}=i,l=n.maxFragLookUpTolerance,c=!!(n.lowLatencyMode&&i.partList&&o);let u;if(c&&o&&!this.bitrateTest&&(s=s.concat(o),a=o.sn),u=e<t?Ji(r,s,e,e>t-l?0:l):s[s.length-1],u){const e=u.sn-i.startSN,t=this.fragmentTracker.getState(u);if((t===hn||t===dn&&u.gap)&&(r=u),r&&u.sn===r.sn&&!c&&r&&u.level===r.level){const t=s[e+1];u=u.sn<a&&this.fragmentTracker.getState(t)!==hn?t:null}}return u}synchronizeToLiveEdge(e){const{config:t,media:i}=this;if(!i)return;const n=this.hls.liveSyncPosition,r=i.currentTime,s=e.fragments[0].start,a=e.edge,o=r>=s-t.maxFragLookUpTolerance&&r<=a;if(null!==n&&i.duration>n&&(r<n||!o)){const s=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!o&&i.readyState<4||r<a-s)&&(this.loadedmetadata||(this.nextLoadPosition=n),i.readyState&&(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${n.toFixed(3)}`),i.currentTime=n))}}alignPlaylists(e,t){const{levels:i,levelLastLoaded:n,fragPrevious:r}=this,s=null!==n?i[n]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;const o=e.fragments[0].start,l=!t,c=e.alignedSliding&&xe(o);if(l||!c&&!o){!function(e,t,i){t&&(function(e,t,i){if(function(e,t,i){return!(!t.details||!(i.endCC>i.startCC||e&&e.cc<i.startCC))}(e,i,t)){const e=function(e,t,i=0){const n=e.fragments,r=t.fragments;if(!r.length||!n.length)return void Ue.log("No fragments to align");const s=Sn(n,r[0].cc);if(s&&(!s||s.startPTS))return s;Ue.log("No frag in previous level to align on")}(i.details,t);e&&xe(e.start)&&(Ue.log(`Adjusting PTS using last level due to CC increase within current level ${t.url}`),An(e.start,t))}}(e,i,t),!i.alignedSliding&&t.details&&function(e,t){if(!t.fragments.length||!e.hasProgramDateTime||!t.hasProgramDateTime)return;const i=t.fragments[0].programDateTime,n=e.fragments[0].programDateTime,r=(n-i)/1e3+t.fragments[0].start;r&&xe(r)&&(Ue.log(`Adjusting PTS using programDateTime delta ${n-i}ms, sliding:${r.toFixed(3)} ${e.url} `),An(r,e))}(i,t.details),i.alignedSliding||!t.details||i.skippedSegments||$i(t.details,i))}(r,s,e);const i=e.fragments[0].start;return this.log(`Live playlist sliding: ${i.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} prev-sn: ${r?r.sn:"na"} fragments: ${a}`),i}return o}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}setStartPosition(e,t){let i=this.startPosition;if(i<t&&(i=-1),-1===i||-1===this.lastCurrentTime){const n=null!==this.startTimeOffset,r=n?this.startTimeOffset:e.startTimeOffset;null!==r&&xe(r)?(i=t+r,r<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Start time offset ${r} found in ${n?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:e}=this;let t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}handleFragLoadAborted(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn(`Fragment ${e.sn}${t?" part"+t.index:""} of level ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===zn)||(this.state=On)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const e=this.getCurrentContext(t.chunkMeta);e&&(t.frag=e.frag)}const i=t.frag;if(!i||i.type!==e||!this.levels)return;var n;if(this.fragContextChanged(i))return void this.warn(`Frag load error must match current frag to retry ${i.url} > ${null==(n=this.fragCurrent)?void 0:n.url}`);const r=t.details===Pe.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(i,!0);const s=t.errorAction,{action:a,retryCount:o=0,retryConfig:l}=s||{};if(s&&5===a&&l){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);const n=Zi(l,o);this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${o+1}/${l.maxNumRetry} in ${n}ms`),s.resolved=!0,this.retryDate=self.performance.now()+n,this.state=zn}else l&&s?(this.resetFragmentErrors(e),o<l.maxNumRetry?r||(s.resolved=!0):Ue.warn(`${t.details} reached or exceeded max retry (${o})`)):this.state=$n;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===Un||this.state===Yn){const t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),n=i&&i.len>.5;n&&this.reduceMaxBufferLength(i.len);const r=!n;return r&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${t} buffer`),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),r}return!1}resetFragmentErrors(e){e===bi&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==_n&&(this.state=On)}afterBufferFlushed(e,t,i){if(!e)return;const n=In.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,n,i),this.state===Bn&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=On}resetStartWhenNotLoaded(e){if(!this.loadedmetadata){this.startFragRequested=!1;const t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of level ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(e.level),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,i,n){var r;const s=i.details;if(!s)return void this.warn("level.details undefined");const a=Object.keys(e.elementaryStreams).reduce(((t,r)=>{const a=e.elementaryStreams[r];if(a){const o=a.endPTS-a.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${e.sn} ${r} duration reliably (${o})`),t||!1;const l=n?0:Bi(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return this.hls.trigger(_e.LEVEL_PTS_UPDATED,{details:s,level:i,drift:l,type:r,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1);if(a)i.fragmentError=0;else if(null===(null==(r=this.transmuxer)?void 0:r.error)){const t=new Error(`Found no media in fragment ${e.sn} of level ${i.id} resetting transmuxer to fallback to playlist timing`);if(this.warn(t.message),this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,fatal:!1,error:t,frag:e,reason:`Found no media in msn ${e.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Yn,this.hls.trigger(_e.FRAG_PARSED,{frag:e,part:t})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(e){"demuxerWorker"===e.event&&(this.resetTransmuxer(),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function qn(){if("undefined"!=typeof self)return self.MediaSource||self.WebKitMediaSource}function Wn(){return self.SourceBuffer||self.WebKitSourceBuffer}function Zn(e="",t=9e4){return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}class Vn{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,i,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,i){}demux(e,t){this.cachedData&&(e=$t(this.cachedData,e),this.cachedData=null);let i,n=gt(e,0),r=n?n.length:0;const s=this._audioTrack,a=this._id3Track,o=n?(e=>{const t=Tt(e);for(let e=0;e<t.length;e++){const i=t[e];if(vt(i))return Nt(i)}})(n):void 0,l=e.length;for((null===this.basePTS||0===this.frameIndex&&xe(o))&&(this.basePTS=Kn(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ki,duration:Number.POSITIVE_INFINITY});r<l;){if(this.canParse(e,r)){const t=this.appendFrame(s,e,r);t?(this.frameIndex++,this.lastPTS=t.sample.pts,r+=t.length,i=r):r=l}else mt(e,r)?(n=gt(e,r),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ki,duration:Number.POSITIVE_INFINITY}),r+=n.length,i=r):r++;if(r===l&&i!==l){const t=ht(e,i);this.cachedData?this.cachedData=$t(this.cachedData,t):this.cachedData=t}}return{audioTrack:s,videoTrack:Zn(),id3Track:a,textTrack:Zn()}}demuxSampleAes(e,t,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Zn(),id3Track:this._id3Track,textTrack:Zn()}}destroy(){}}const Kn=(e,t,i)=>xe(e)?90*e:9e4*t+(i?9e4*i.baseTime/i.timescale:0);function Xn(e,t){return 255===e[t]&&240==(246&e[t+1])}function Jn(e,t){return 1&e[t+1]?7:9}function er(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function tr(e,t){return t+1<e.length&&Xn(e,t)}function ir(e,t){if(tr(e,t)){const i=Jn(e,t);if(t+i>=e.length)return!1;const n=er(e,t);if(n<=i)return!1;const r=t+n;return r===e.length||tr(e,r)}return!1}function nr(e,t,i,n,r){if(!e.samplerate){const s=function(e,t,i,n){let r,s,a,o;const l=navigator.userAgent.toLowerCase(),c=n,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];r=1+((192&t[i+2])>>>6);const d=(60&t[i+2])>>>2;if(!(d>u.length-1))return a=(1&t[i+2])<<2,a|=(192&t[i+3])>>>6,Ue.log(`manifest codec:${n}, ADTS type:${r}, samplingIndex:${d}`),/firefox/i.test(l)?d>=6?(r=5,o=new Array(4),s=d-3):(r=2,o=new Array(2),s=d):-1!==l.indexOf("android")?(r=2,o=new Array(2),s=d):(r=5,o=new Array(4),n&&(-1!==n.indexOf("mp4a.40.29")||-1!==n.indexOf("mp4a.40.5"))||!n&&d>=6?s=d-3:((n&&-1!==n.indexOf("mp4a.40.2")&&(d>=6&&1===a||/vivaldi/i.test(l))||!n&&1===a)&&(r=2,o=new Array(2)),s=d)),o[0]=r<<3,o[0]|=(14&d)>>1,o[1]|=(1&d)<<7,o[1]|=a<<3,5===r&&(o[1]|=(14&s)>>1,o[2]=(1&s)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:u[d],channelCount:a,codec:"mp4a.40."+r,manifestCodec:c};e.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,fatal:!0,reason:`invalid ADTS sampling index:${d}`})}(t,i,n,r);if(!s)return;e.config=s.config,e.samplerate=s.samplerate,e.channelCount=s.channelCount,e.codec=s.codec,e.manifestCodec=s.manifestCodec,Ue.log(`parsed codec:${e.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function rr(e){return 9216e4/e}function sr(e,t,i,n,r){const s=n+r*rr(e.samplerate),a=function(e,t){const i=Jn(e,t);if(t+i<=e.length){const n=er(e,t)-i;if(n>0)return{headerLength:i,frameLength:n}}}(t,i);let o;if(a){const{frameLength:n,headerLength:r}=a,l=r+n,c=Math.max(0,i+l-t.length);c?(o=new Uint8Array(l-r),o.set(t.subarray(i+r,t.length),0)):o=t.subarray(i+r,i+l);const u={unit:o,pts:s};return c||e.samples.push(u),{sample:u,length:l,missing:c}}const l=t.length-i;return o=new Uint8Array(l),o.set(t.subarray(i,t.length),0),{sample:{unit:o,pts:s},length:l,missing:-1}}const ar=/\/emsg[-/]ID3/i;let or=null;const lr=[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],cr=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],ur=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],dr=[0,1,1,4];function hr(e,t,i,n,r){if(i+24>t.length)return;const s=pr(t,i);if(s&&i+s.frameLength<=t.length){const a=n+r*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:t.subarray(i,i+s.frameLength),pts:a,dts:a};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}function pr(e,t){const i=e[t+1]>>3&3,n=e[t+1]>>1&3,r=e[t+2]>>4&15,s=e[t+2]>>2&3;if(1!==i&&0!==r&&15!==r&&3!==s){const a=e[t+2]>>1&1,o=e[t+3]>>6,l=1e3*lr[14*(3===i?3-n:3===n?3:4)+r-1],c=cr[3*(3===i?0:2===i?1:2)+s],u=3===o?1:2,d=ur[i][n],h=dr[n],p=8*d*h,f=Math.floor(d*l/c+a)*h;if(null===or){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);or=e?parseInt(e[1]):0}return!!or&&or<=87&&2===n&&l>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:c,channelCount:u,frameLength:f,samplesPerFrame:p}}}function fr(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function gr(e,t){return t+1<e.length&&fr(e,t)}function yr(e,t){if(t+1<e.length&&fr(e,t)){const i=4,n=pr(e,t);let r=i;null!=n&&n.frameLength&&(r=n.frameLength);const s=t+r;return s===e.length||gr(e,s)}return!1}class mr{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,i=e.byteLength-t,n=new Uint8Array(4),r=Math.min(4,t);if(0===r)throw new Error("no bytes available");n.set(e.subarray(i,i+r)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*r,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const i=this.word>>>32-t;if(e>32&&Ue.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(e){let t,i=8,n=8;for(let r=0;r<e;r++)0!==n&&(t=this.readEG(),n=(i+t+256)%256),i=0===n?i:n}readSPS(){let e,t,i,n=0,r=0,s=0,a=0;const o=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),d=this.skipBits.bind(this),h=this.skipEG.bind(this),p=this.skipUEG.bind(this),f=this.skipScalingList.bind(this);o();const g=o();if(l(5),d(3),o(),p(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){const e=c();if(3===e&&d(1),p(),p(),d(1),u())for(t=3!==e?8:12,i=0;i<t;i++)u()&&f(i<6?16:64)}p();const y=c();if(0===y)c();else if(1===y)for(d(1),h(),h(),e=c(),i=0;i<e;i++)h();p(),d(1);const m=c(),v=c(),M=l(1);0===M&&d(1),d(1),u()&&(n=c(),r=c(),s=c(),a=c());let T=[1,1];if(u()&&u())switch(o()){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:T=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(m+1)-2*n-2*r),height:(2-M)*(v+1)*16-(M?2:4)*(s+a),pixelRatio:T}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class vr{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new xn(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(e,t,i){const n=e[t].unit;if(n.length<=16)return;const r=n.subarray(16,n.length-n.length%16),s=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(s).then((r=>{const s=new Uint8Array(r);n.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,i)}))}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length)return void i();if(!(e[t].unit.length<32||(this.decryptAacSample(e,t,i),this.decrypter.isSync())))return}}getAvcEncryptedData(e){const t=16*Math.floor((e.length-48)/160)+16,i=new Int8Array(t);let n=0;for(let t=32;t<e.length-16;t+=160,n+=16)i.set(e.subarray(t,t+16),n);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let n=0;for(let t=32;t<e.length-16;t+=160,n+=16)e.set(i.subarray(n,n+16),t);return e}decryptAvcSample(e,t,i,n,r){const s=qt(r.data),a=this.getAvcEncryptedData(s);this.decryptBuffer(a.buffer).then((a=>{r.data=this.getAvcDecryptedUnit(s,a),this.decrypter.isSync()||this.decryptAvcSamples(e,t,i+1,n)}))}decryptAvcSamples(e,t,i,n){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length)return void n();const r=e[t].units;for(;!(i>=r.length);i++){const s=r[i];if(!(s.data.length<=48||1!==s.type&&5!==s.type||(this.decryptAvcSample(e,t,i,n,s),this.decrypter.isSync())))return}}}}const Mr=188;class Tr{constructor(e,t,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=e,this.config=t,this.typeSupported=i}static probe(e){const t=Tr.syncOffset(e);return t>0&&Ue.warn(`MPEG2-TS detected but first sync word found @ offset ${t}`),-1!==t}static syncOffset(e){const t=e.length,i=Math.min(940,e.length-Mr)+1;let n=0;for(;n<i;){let r=!1;for(let s=n;s<t&&71===e[s];s+=Mr)if(r||0!==br(e,s)||(r=!0),r&&s+Mr>i)return n;n++}return-1}static createTrack(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:jt[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}resetInitSegment(e,t,i,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=Tr.createTrack("video"),this._audioTrack=Tr.createTrack("audio",n),this._id3Track=Tr.createTrack("id3"),this._txtTrack=Tr.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i,this._duration=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_avcTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}demux(e,t,i=!1,n=!1){let r;i||(this.sampleAes=null);const s=this._avcTrack,a=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=s.pid,u=s.pesData,d=a.pid,h=o.pid,p=a.pesData,f=o.pesData,g=null,y=this.pmtParsed,m=this._pmtId,v=e.length;if(this.remainderData&&(v=(e=$t(this.remainderData,e)).length,this.remainderData=null),v<Mr&&!n)return this.remainderData=e,{audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};const M=Math.max(0,Tr.syncOffset(e));v-=(v-M)%Mr,v<e.byteLength&&!n&&(this.remainderData=new Uint8Array(e.buffer,v,e.buffer.byteLength-v));let T=0;for(let t=M;t<v;t+=Mr)if(71===e[t]){const n=!!(64&e[t+1]),v=br(e,t);let T;if((48&e[t+3])>>4>1){if(T=t+5+e[t+4],T===t+Mr)continue}else T=t+4;switch(v){case c:n&&(u&&(r=Nr(u))&&this.parseAVCPES(s,l,r,!1),u={data:[],size:0}),u&&(u.data.push(e.subarray(T,t+Mr)),u.size+=t+Mr-T);break;case d:if(n){if(p&&(r=Nr(p)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,r);break;case"mp3":this.parseMPEGPES(a,r)}p={data:[],size:0}}p&&(p.data.push(e.subarray(T,t+Mr)),p.size+=t+Mr-T);break;case h:n&&(f&&(r=Nr(f))&&this.parseID3PES(o,r),f={data:[],size:0}),f&&(f.data.push(e.subarray(T,t+Mr)),f.size+=t+Mr-T);break;case 0:n&&(T+=e[T]+1),m=this._pmtId=Er(e,T);break;case m:{n&&(T+=e[T]+1);const r=Ir(e,T,this.typeSupported,i);c=r.avc,c>0&&(s.pid=c),d=r.audio,d>0&&(a.pid=d,a.segmentCodec=r.segmentCodec),h=r.id3,h>0&&(o.pid=h),null===g||y||(Ue.warn(`MPEG-TS PMT found at ${t} after unknown PID '${g}'. Backtracking to sync byte @${M} to parse all TS packets.`),g=null,t=M-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=v}}else T++;if(T>0){const e=new Error(`Found ${T} TS packet/s that do not start with 0x47`);this.observer.emit(_e.ERROR,_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message})}s.pesData=u,a.pesData=p,o.pesData=f;const L={audioTrack:a,videoTrack:s,id3Track:o,textTrack:l};return n&&this.extractRemainingSamples(L),L}flush(){const{remainderData:e}=this;let t;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:i,id3Track:n,textTrack:r}=e,s=i.pesData,a=t.pesData,o=n.pesData;let l;if(s&&(l=Nr(s))?(this.parseAVCPES(i,r,l,!0),i.pesData=null):i.pesData=s,a&&(l=Nr(a))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l)}t.pesData=null}else null!=a&&a.size&&Ue.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;o&&(l=Nr(o))?(this.parseID3PES(n,l),n.pesData=null):n.pesData=o}demuxSampleAes(e,t,i){const n=this.demux(e,i,!0,!this.config.progressive),r=this.sampleAes=new vr(this.observer,this.config,t);return this.decrypt(n,r)}decrypt(e,t){return new Promise((i=>{const{audioTrack:n,videoTrack:r}=e;n.samples&&"aac"===n.segmentCodec?t.decryptAacSamples(n.samples,0,(()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,(()=>{i(e)})):i(e)})):r.samples&&t.decryptAvcSamples(r.samples,0,0,(()=>{i(e)}))}))}destroy(){this._duration=0}parseAVCPES(e,t,i,n){const r=this.parseAVCNALu(e,i.data);let s,a=this.avcSample,o=!1;i.data=null,a&&r.length&&!e.audFound&&(Sr(a,e),a=this.avcSample=Lr(!1,i.pts,i.dts,"")),r.forEach((n=>{switch(n.type){case 1:{s=!0,a||(a=this.avcSample=Lr(!0,i.pts,i.dts,"")),a.frame=!0;const e=n.data;if(o&&e.length>4){const t=new mr(e).readSliceType();2!==t&&4!==t&&7!==t&&9!==t||(a.key=!0)}break}case 5:s=!0,a||(a=this.avcSample=Lr(!0,i.pts,i.dts,"")),a.key=!0,a.frame=!0;break;case 6:s=!0,Ht(n.data,1,i.pts,t.samples);break;case 7:if(s=!0,o=!0,!e.sps){const t=n.data,i=new mr(t).readSPS();e.width=i.width,e.height=i.height,e.pixelRatio=i.pixelRatio,e.sps=[t],e.duration=this._duration;const r=t.subarray(1,4);let s="avc1.";for(let e=0;e<3;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),s+=t}e.codec=s}break;case 8:s=!0,e.pps||(e.pps=[n.data]);break;case 9:s=!1,e.audFound=!0,a&&Sr(a,e),a=this.avcSample=Lr(!1,i.pts,i.dts,"");break;case 12:s=!0;break;default:s=!1,a&&(a.debug+="unknown NAL "+n.type+" ")}a&&s&&a.units.push(n)})),n&&a&&(Sr(a,e),this.avcSample=null)}getLastNalUnit(e){var t;let i,n=this.avcSample;if(n&&0!==n.units.length||(n=e[e.length-1]),null!=(t=n)&&t.units){const e=n.units;i=e[e.length-1]}return i}parseAVCNALu(e,t){const i=t.byteLength;let n=e.naluState||0;const r=n,s=[];let a,o,l,c=0,u=-1,d=0;for(-1===n&&(u=0,d=31&t[0],n=0,c=1);c<i;)if(a=t[c++],n)if(1!==n)if(a)if(1===a){if(u>=0){const e={data:t.subarray(u,c-n-1),type:d};s.push(e)}else{const i=this.getLastNalUnit(e.samples);if(i&&(r&&c<=4-r&&i.state&&(i.data=i.data.subarray(0,i.data.byteLength-r)),o=c-n-1,o>0)){const e=new Uint8Array(i.data.byteLength+o);e.set(i.data,0),e.set(t.subarray(0,o),i.data.byteLength),i.data=e,i.state=0}}c<i?(l=31&t[c],u=c,d=l,n=0):n=-1}else n=0;else n=3;else n=a?0:2;else n=a?0:1;if(u>=0&&n>=0){const e={data:t.subarray(u,i),type:d,state:n};s.push(e)}if(0===s.length){const i=this.getLastNalUnit(e.samples);if(i){const e=new Uint8Array(i.data.byteLength+t.byteLength);e.set(i.data,0),e.set(t,i.data.byteLength),i.data=e}}return e.naluState=n,s}parseAACPES(e,t){let i=0;const n=this.aacOverFlow;let r,s,a,o=t.data;if(n){this.aacOverFlow=null;const t=n.missing,r=n.sample.unit.byteLength;if(-1===t){const e=new Uint8Array(r+o.byteLength);e.set(n.sample.unit,0),e.set(o,r),o=e}else{const s=r-t;n.sample.unit.set(o.subarray(0,t),s),e.samples.push(n.sample),i=n.missing}}for(r=i,s=o.length;r<s-1&&!tr(o,r);r++);if(r!==i){let e;const t=r<s-1;e=t?`AAC PES did not start with ADTS header,offset:${r}`:"No ADTS header found in AAC PES";const i=new Error(e);if(Ue.warn(`parsing error: ${e}`),this.observer.emit(_e.ERROR,_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:i,reason:e}),!t)return}if(nr(e,this.observer,o,r,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!n)return void Ue.warn("[tsdemuxer]: AAC PES unknown PTS");{const t=rr(e.samplerate);a=n.sample.pts+t}}let l,c=0;for(;r<s;){if(l=sr(e,o,r,a,c),r+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;r<s-1&&!tr(o,r);r++);}}parseMPEGPES(e,t){const i=t.data,n=i.length;let r=0,s=0;const a=t.pts;if(void 0!==a)for(;s<n;)if(gr(i,s)){const t=hr(e,i,s,a,r);if(!t)break;s+=t.length,r++}else s++;else Ue.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseID3PES(e,t){if(void 0===t.pts)return void Ue.warn("[tsdemuxer]: ID3 PES unknown PTS");const i=je({},t,{type:this._avcTrack?ji:ki,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Lr(e,t,i,n){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:n,length:0}}function br(e,t){return((31&e[t+1])<<8)+e[t+2]}function Er(e,t){return(31&e[t+10])<<8|e[t+11]}function Ir(e,t,i,n){const r={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<s;){const s=br(e,t);switch(e[t]){case 207:if(!n){Ue.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===r.audio&&(r.audio=s);break;case 21:-1===r.id3&&(r.id3=s);break;case 219:if(!n){Ue.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===r.avc&&(r.avc=s);break;case 3:case 4:!0!==i.mpeg&&!0!==i.mp3?Ue.log("MPEG audio found, not supported in this browser"):-1===r.audio&&(r.audio=s,r.segmentCodec="mp3");break;case 36:Ue.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return r}function Nr(e){let t,i,n,r,s,a=0;const o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;){const e=new Uint8Array(o[0].length+o[1].length);e.set(o[0]),e.set(o[1],o[0].length),o[0]=e,o.splice(1,1)}if(t=o[0],1===(t[0]<<16)+(t[1]<<8)+t[2]){if(i=(t[4]<<8)+t[5],i&&i>e.size-6)return null;const l=t[7];192&l&&(r=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,r-s>54e5&&(Ue.warn(`${Math.round((r-s)/9e4)}s delta between PTS and DTS, align them`),r=s)):s=r),n=t[8];let c=n+9;if(e.size<=c)return null;e.size-=c;const u=new Uint8Array(e.size);for(let e=0,i=o.length;e<i;e++){t=o[e];let i=t.byteLength;if(c){if(c>i){c-=i;continue}t=t.subarray(c),i-=c,c=0}u.set(t,a),a+=i}return i&&(i-=n+3),{data:u,pts:r,dts:s,len:i}}return null}function Sr(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){const i=t.samples,n=i.length;if(!n)return void t.dropped++;{const t=i[n-1];e.pts=t.pts,e.dts=t.dts}}t.samples.push(e)}e.debug.length&&Ue.log(e.pts+"/"+e.dts+":"+e.debug)}class wr{static getSilentFrame(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const Ar=Math.pow(2,32)-1;class Cr{static init(){let e;for(e in Cr.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:[]},Cr.types)Cr.types.hasOwnProperty(e)&&(Cr.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),i=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]);Cr.HDLR_TYPES={video:t,audio:i};const n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);Cr.STTS=Cr.STSC=Cr.STCO=r,Cr.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Cr.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Cr.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Cr.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);Cr.FTYP=Cr.box(Cr.types.ftyp,s,o,s,a),Cr.DINF=Cr.box(Cr.types.dinf,Cr.box(Cr.types.dref,n))}static box(e,...t){let i=8,n=t.length;const r=n;for(;n--;)i+=t[n].byteLength;const s=new Uint8Array(i);for(s[0]=i>>24&255,s[1]=i>>16&255,s[2]=i>>8&255,s[3]=255&i,s.set(e,4),n=0,i=8;n<r;n++)s.set(t[n],i),i+=t[n].byteLength;return s}static hdlr(e){return Cr.box(Cr.types.hdlr,Cr.HDLR_TYPES[e])}static mdat(e){return Cr.box(Cr.types.mdat,e)}static mdhd(e,t){t*=e;const i=Math.floor(t/(Ar+1)),n=Math.floor(t%(Ar+1));return Cr.box(Cr.types.mdhd,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,n>>24,n>>16&255,n>>8&255,255&n,85,196,0,0]))}static mdia(e){return Cr.box(Cr.types.mdia,Cr.mdhd(e.timescale,e.duration),Cr.hdlr(e.type),Cr.minf(e))}static mfhd(e){return Cr.box(Cr.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e]))}static minf(e){return"audio"===e.type?Cr.box(Cr.types.minf,Cr.box(Cr.types.smhd,Cr.SMHD),Cr.DINF,Cr.stbl(e)):Cr.box(Cr.types.minf,Cr.box(Cr.types.vmhd,Cr.VMHD),Cr.DINF,Cr.stbl(e))}static moof(e,t,i){return Cr.box(Cr.types.moof,Cr.mfhd(e),Cr.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=Cr.trak(e[t]);return Cr.box.apply(null,[Cr.types.moov,Cr.mvhd(e[0].timescale,e[0].duration)].concat(i).concat(Cr.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=Cr.trex(e[t]);return Cr.box.apply(null,[Cr.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(Ar+1)),n=Math.floor(t%(Ar+1)),r=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,n>>24,n>>16&255,n>>8&255,255&n,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 Cr.box(Cr.types.mvhd,r)}static sdtp(e){const t=e.samples||[],i=new Uint8Array(4+t.length);let n,r;for(n=0;n<t.length;n++)r=t[n].flags,i[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return Cr.box(Cr.types.sdtp,i)}static stbl(e){return Cr.box(Cr.types.stbl,Cr.stsd(e),Cr.box(Cr.types.stts,Cr.STTS),Cr.box(Cr.types.stsc,Cr.STSC),Cr.box(Cr.types.stsz,Cr.STSZ),Cr.box(Cr.types.stco,Cr.STCO))}static avc1(e){let t,i,n,r=[],s=[];for(t=0;t<e.sps.length;t++)i=e.sps[t],n=i.byteLength,r.push(n>>>8&255),r.push(255&n),r=r.concat(Array.prototype.slice.call(i));for(t=0;t<e.pps.length;t++)i=e.pps[t],n=i.byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(i));const a=Cr.box(Cr.types.avcC,new Uint8Array([1,r[3],r[4],r[5],255,224|e.sps.length].concat(r).concat([e.pps.length]).concat(s))),o=e.width,l=e.height,c=e.pixelRatio[0],u=e.pixelRatio[1];return Cr.box(Cr.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,o>>8&255,255&o,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,Cr.box(Cr.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Cr.box(Cr.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,u>>24,u>>16&255,u>>8&255,255&u])))}static esds(e){const t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))}static mp4a(e){const t=e.samplerate;return Cr.box(Cr.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,t>>8&255,255&t,0,0]),Cr.box(Cr.types.esds,Cr.esds(e)))}static mp3(e){const t=e.samplerate;return Cr.box(Cr.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,t>>8&255,255&t,0,0]))}static stsd(e){return"audio"===e.type?"mp3"===e.segmentCodec&&"mp3"===e.codec?Cr.box(Cr.types.stsd,Cr.STSD,Cr.mp3(e)):Cr.box(Cr.types.stsd,Cr.STSD,Cr.mp4a(e)):Cr.box(Cr.types.stsd,Cr.STSD,Cr.avc1(e))}static tkhd(e){const t=e.id,i=e.duration*e.timescale,n=e.width,r=e.height,s=Math.floor(i/(Ar+1)),a=Math.floor(i%(Ar+1));return Cr.box(Cr.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a,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,n>>8&255,255&n,0,0,r>>8&255,255&r,0,0]))}static traf(e,t){const i=Cr.sdtp(e),n=e.id,r=Math.floor(t/(Ar+1)),s=Math.floor(t%(Ar+1));return Cr.box(Cr.types.traf,Cr.box(Cr.types.tfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n])),Cr.box(Cr.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,s>>24,s>>16&255,s>>8&255,255&s])),Cr.trun(e,i.length+16+20+8+16+8+8),i)}static trak(e){return e.duration=e.duration||4294967295,Cr.box(Cr.types.trak,Cr.tkhd(e),Cr.mdia(e))}static trex(e){const t=e.id;return Cr.box(Cr.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const i=e.samples||[],n=i.length,r=12+16*n,s=new Uint8Array(r);let a,o,l,c,u,d;for(t+=8+r,s.set(["video"===e.type?1:0,0,15,1,n>>>24&255,n>>>16&255,n>>>8&255,255&n,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),a=0;a<n;a++)o=i[a],l=o.duration,c=o.size,u=o.flags,d=o.cts,s.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,61440&u.degradPrio,15&u.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*a);return Cr.box(Cr.types.trun,s)}static initSegment(e){Cr.types||Cr.init();const t=Cr.moov(e),i=new Uint8Array(Cr.FTYP.byteLength+t.byteLength);return i.set(Cr.FTYP),i.set(t,Cr.FTYP.byteLength),i}}function Dr(e,t,i=1,n=!1){const r=e*t*i;return n?Math.round(r):r}function kr(e,t=!1){return Dr(e,1e3,1/9e4,t)}Cr.types=void 0,Cr.HDLR_TYPES=void 0,Cr.STTS=void 0,Cr.STSC=void 0,Cr.STCO=void 0,Cr.STSZ=void 0,Cr.VMHD=void 0,Cr.SMHD=void 0,Cr.STSD=void 0,Cr.FTYP=void 0,Cr.DINF=void 0;let jr,xr=null,_r=null;class Or{constructor(e,t,i,n=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,null===xr){const e=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);xr=e?parseInt(e[1]):0}if(null===_r){const e=navigator.userAgent.match(/Safari\/(\d+)/i);_r=e?parseInt(e[1]):0}}destroy(){}resetTimeStamp(e){Ue.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){Ue.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){Ue.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}getVideoStartPts(e){let t=!1;const i=e.reduce(((e,i)=>{const n=i.pts-e;return n<-4294967296?(t=!0,Pr(e,i.pts)):n>0?e:i.pts}),e[0].pts);return t&&Ue.debug("PTS rollover detected"),i}remux(e,t,i,n,r,s,a,o){let l,c,u,d,h,p,f=r,g=r;const y=e.pid>-1,m=t.pid>-1,v=t.samples.length,M=e.samples.length>0,T=a&&v>0||v>1;if((!y||M)&&(!m||T)||this.ISGenerated||a){this.ISGenerated||(u=this.generateIS(e,t,r,s));const i=this.isVideoContiguous;let n,a=-1;if(T&&(a=function(e){for(let t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!i&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,a>0){Ue.warn(`[mp4-remuxer]: Dropped ${a} out of ${v} video samples due to a missing keyframe`);const e=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(a),t.dropped+=a,g+=(t.samples[0].pts-e)/t.inputTimeScale,n=g}else-1===a&&(Ue.warn(`[mp4-remuxer]: No keyframe found out of ${v} video samples`),p=!1);if(this.ISGenerated){if(M&&T){const i=this.getVideoStartPts(t.samples),n=(Pr(e.samples[0].pts,i)-i)/t.inputTimeScale;f+=Math.max(0,n),g+=Math.max(0,-n)}if(M){if(e.samplerate||(Ue.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,r,s)),c=this.remuxAudio(e,f,this.isAudioContiguous,s,m||T||o===bi?g:void 0),T){const n=c?c.endPTS-c.startPTS:0;t.inputTimeScale||(Ue.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,r,s)),l=this.remuxVideo(t,g,i,n)}}else T&&(l=this.remuxVideo(t,g,i,0));l&&(l.firstKeyFrame=a,l.independent=-1!==a,l.firstKeyFramePTS=n)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(h=Rr(i,r,this._initPTS,this._initDTS)),n.samples.length&&(d=zr(n,r,this._initPTS))),{audio:c,video:l,initSegment:u,independent:p,text:d,id3:h}}generateIS(e,t,i,n){const r=e.samples,s=t.samples,a=this.typeSupported,o={},l=this._initPTS;let c,u,d,h=!l||n,p="audio/mp4";if(h&&(c=u=1/0),e.config&&r.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(a.mpeg?(p="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3")),o.audio={id:"audio",container:p,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&a.mpeg?new Uint8Array(0):Cr.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(d=e.inputTimeScale,l&&d===l.timescale?h=!1:c=u=r[0].pts-Math.round(d*i))),t.sps&&t.pps&&s.length&&(t.timescale=t.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:Cr.initSegment([t]),metadata:{width:t.width,height:t.height}},h))if(d=t.inputTimeScale,l&&d===l.timescale)h=!1;else{const e=this.getVideoStartPts(s),t=Math.round(d*i);u=Math.min(u,Pr(s[0].dts,e)-t),c=Math.min(c,e-t)}if(Object.keys(o).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:c,timescale:d},this._initDTS={baseTime:u,timescale:d}):c=d=void 0,{tracks:o,initPTS:c,timescale:d}}remuxVideo(e,t,i,n){const r=e.inputTimeScale,s=e.samples,a=[],o=s.length,l=this._initPTS;let c,u,d=this.nextAvcDts,h=8,p=this.videoSampleDuration,f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,y=!1;i&&null!==d||(d=t*r-(s[0].pts-Pr(s[0].dts,s[0].pts)));const m=l.baseTime*r/l.timescale;for(let e=0;e<o;e++){const t=s[e];t.pts=Pr(t.pts-m,d),t.dts=Pr(t.dts-m,d),t.dts<s[e>0?e-1:e].dts&&(y=!0)}y&&s.sort((function(e,t){const i=e.dts-t.dts,n=e.pts-t.pts;return i||n})),c=s[0].dts,u=s[s.length-1].dts;const v=u-c,M=v?Math.round(v/(o-1)):p||e.inputTimeScale/30;if(i){const e=c-d,t=e>M,i=e<-1;if((t||i)&&(t?Ue.warn(`AVC: ${kr(e,!0)} ms (${e}dts) hole between fragments detected, filling it`):Ue.warn(`AVC: ${kr(-e,!0)} ms (${e}dts) overlapping between fragments detected`),!i||d>s[0].pts)){c=d;const t=s[0].pts-e;s[0].dts=c,s[0].pts=t,Ue.log(`Video: First PTS/DTS adjusted: ${kr(t,!0)}/${kr(c,!0)}, delta: ${kr(e,!0)} ms`)}}c=Math.max(0,c);let T=0,L=0;for(let e=0;e<o;e++){const t=s[e],i=t.units,n=i.length;let r=0;for(let e=0;e<n;e++)r+=i[e].data.length;L+=r,T+=n,t.length=r,t.dts=Math.max(t.dts,c),f=Math.min(t.pts,f),g=Math.max(t.pts,g)}u=s[o-1].dts;const b=L+4*T+8;let E;try{E=new Uint8Array(b)}catch(e){return void this.observer.emit(_e.ERROR,_e.ERROR,{type:Oe.MUX_ERROR,details:Pe.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:b,reason:`fail allocating video mdat ${b}`})}const I=new DataView(E.buffer);I.setUint32(0,b),E.set(Cr.types.mdat,4);let N=!1,S=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let e=0;e<o;e++){const t=s[e],i=t.units;let l,c=0;for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.data,r=t.data.byteLength;I.setUint32(h,r),h+=4,E.set(n,h),h+=r,c+=4+r}if(e<o-1)p=s[e+1].dts-t.dts,l=s[e+1].pts-t.pts;else{const i=this.config,a=e>0?t.dts-s[e-1].dts:M;if(l=e>0?t.pts-s[e-1].pts:M,i.stretchShortVideoTrack&&null!==this.nextAudioPts){const e=Math.floor(i.maxBufferHole*r),s=(n?f+n*r:this.nextAudioPts)-t.pts;s>e?(p=s-a,p<0?p=a:N=!0,Ue.log(`[mp4-remuxer]: It is approximately ${s/90} ms to the next segment; using duration ${p/90} ms for the last video frame.`)):p=a}else p=a}const u=Math.round(t.pts-t.dts);S=Math.min(S,p),A=Math.max(A,p),w=Math.min(w,l),C=Math.max(C,l),a.push(new Fr(t.key,p,c,u))}if(a.length)if(xr){if(xr<70){const e=a[0].flags;e.dependsOn=2,e.isNonSync=0}}else if(_r&&C-w<A-S&&M/A<.025&&0===a[0].cts){Ue.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let e=c;for(let t=0,i=a.length;t<i;t++){const n=e+a[t].duration,r=e+a[t].cts;if(t<i-1){const e=n+a[t+1].cts;a[t].duration=e-r}else a[t].duration=t?a[t-1].duration:M;a[t].cts=0,e=n}}p=N||!p?M:p,this.nextAvcDts=d=u+p,this.videoSampleDuration=p,this.isVideoContiguous=!0;const D={data1:Cr.moof(e.sequenceNumber++,c,je({},e,{samples:a})),data2:E,startPTS:f/r,endPTS:(g+p)/r,startDTS:c/r,endDTS:d/r,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,D}remuxAudio(e,t,i,n,r){const s=e.inputTimeScale,a=s/(e.samplerate?e.samplerate:s),o="aac"===e.segmentCodec?1024:1152,l=o*a,c=this._initPTS,u="mp3"===e.segmentCodec&&this.typeSupported.mpeg,d=[],h=void 0!==r;let p=e.samples,f=u?0:8,g=this.nextAudioPts||-1;const y=t*s,m=c.baseTime*s/c.timescale;if(this.isAudioContiguous=i=i||p.length&&g>0&&(n&&Math.abs(y-g)<9e3||Math.abs(Pr(p[0].pts-m,y)-g)<20*l),p.forEach((function(e){e.pts=Pr(e.pts-m,y)})),!i||g<0){if(p=p.filter((e=>e.pts>=0)),!p.length)return;g=0===r?0:n&&!h?Math.max(0,y):p[0].pts}if("aac"===e.segmentCodec){const t=this.config.maxAudioFramesDrift;for(let i=0,n=g;i<p.length;i++){const r=p[i],a=r.pts,o=a-n,c=Math.abs(1e3*o/s);if(o<=-t*l&&h)0===i&&(Ue.warn(`Audio frame @ ${(a/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*o/s)} ms.`),this.nextAudioPts=g=n=a);else if(o>=t*l&&c<1e4&&h){let t=Math.round(o/l);n=a-t*l,n<0&&(t--,n+=l),0===i&&(this.nextAudioPts=g=n),Ue.warn(`[mp4-remuxer]: Injecting ${t} audio frame @ ${(n/s).toFixed(3)}s due to ${Math.round(1e3*o/s)} ms gap.`);for(let s=0;s<t;s++){const t=Math.max(n,0);let s=wr.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);s||(Ue.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),s=r.unit.subarray()),p.splice(i,0,{unit:s,pts:t}),n+=l,i++}}r.pts=n,n+=l}}let v,M=null,T=null,L=0,b=p.length;for(;b--;)L+=p[b].unit.byteLength;for(let t=0,n=p.length;t<n;t++){const n=p[t],r=n.unit;let s=n.pts;if(null!==T)d[t-1].duration=Math.round((s-T)/a);else{if(i&&"aac"===e.segmentCodec&&(s=g),M=s,!(L>0))return;L+=f;try{v=new Uint8Array(L)}catch(e){return void this.observer.emit(_e.ERROR,_e.ERROR,{type:Oe.MUX_ERROR,details:Pe.REMUX_ALLOC_ERROR,fatal:!1,error:e,bytes:L,reason:`fail allocating audio mdat ${L}`})}u||(new DataView(v.buffer).setUint32(0,L),v.set(Cr.types.mdat,4))}v.set(r,f);const l=r.byteLength;f+=l,d.push(new Fr(!0,o,l,0)),T=s}const E=d.length;if(!E)return;const I=d[d.length-1];this.nextAudioPts=g=T+a*I.duration;const N=u?new Uint8Array(0):Cr.moof(e.sequenceNumber++,M/a,je({},e,{samples:d}));e.samples=[];const S=M/s,w=g/s,A={data1:N,data2:v,startPTS:S,endPTS:w,startDTS:S,endDTS:w,type:"audio",hasAudio:!0,hasVideo:!1,nb:E};return this.isAudioContiguous=!0,A}remuxEmptyAudio(e,t,i,n){const r=e.inputTimeScale,s=r/(e.samplerate?e.samplerate:r),a=this.nextAudioPts,o=this._initDTS,l=9e4*o.baseTime/o.timescale,c=(null!==a?a:n.startDTS*r)+l,u=n.endDTS*r+l,d=1024*s,h=Math.ceil((u-c)/d),p=wr.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(Ue.warn("[mp4-remuxer]: remux empty Audio"),!p)return void Ue.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const f=[];for(let e=0;e<h;e++){const t=c+e*d;f.push({unit:p,pts:t,dts:t})}return e.samples=f,this.remuxAudio(e,t,i,!1)}}function Pr(e,t){let i;if(null===t)return e;for(i=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=i;return e}function Rr(e,t,i,n){const r=e.samples.length;if(!r)return;const s=e.inputTimeScale;for(let a=0;a<r;a++){const r=e.samples[a];r.pts=Pr(r.pts-9e4*i.baseTime/i.timescale,t*s)/s,r.dts=Pr(r.dts-9e4*n.baseTime/n.timescale,t*s)/s}const a=e.samples;return e.samples=[],{samples:a}}function zr(e,t,i){const n=e.samples.length;if(!n)return;const r=e.inputTimeScale;for(let s=0;s<n;s++){const n=e.samples[s];n.pts=Pr(n.pts-9e4*i.baseTime/i.timescale,t*r)/r}e.samples.sort(((e,t)=>e.pts-t.pts));const s=e.samples;return e.samples=[],{samples:s}}class Fr{constructor(e,t,i,n){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=n,this.flags=new Ur(e)}}class Ur{constructor(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}}function Yr(e,t){const i=null==e?void 0:e.codec;return i&&i.length>4?i:"hvc1"===i||"hev1"===i?"hvc1.1.c.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||t===We?"avc1.42e01e":"mp4a.40.5"}try{jr=self.performance.now.bind(self.performance)}catch(e){Ue.debug("Unable to use Performance API on this environment"),jr="undefined"!=typeof self&&self.Date.now}const Br=[{demux:class{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,i,n){const r=this.videoTrack=Zn("video",1),s=this.audioTrack=Zn("audio",1),a=this.txtTrack=Zn("text",1);if(this.id3Track=Zn("id3",1),this.timeOffset=0,null==e||!e.byteLength)return;const o=Ut(e);if(o.video){const{id:e,timescale:t,codec:i}=o.video;r.id=e,r.timescale=a.timescale=t,r.codec=i}if(o.audio){const{id:e,timescale:t,codec:i}=o.audio;s.id=e,s.timescale=t,s.codec=i}a.id=jt.text,r.sampleDuration=0,r.duration=s.duration=n}resetContiguity(){}static probe(e){return zt(e=e.length>16384?e.subarray(0,16384):e,["moof"]).length>0}demux(e,t){this.timeOffset=t;let i=e;const n=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=$t(this.remainderData,e));const t=function(e){const t={valid:null,remainder:null},i=zt(e,["moof"]);if(!i)return t;if(i.length<2)return t.remainder=e,t;const n=i[i.length-1];return t.valid=ht(e,0,n.byteOffset-8),t.remainder=ht(e,n.byteOffset-8),t}(i);this.remainderData=t.remainder,n.samples=t.valid||new Uint8Array}else n.samples=i;const s=this.extractID3Track(n,t);return r.samples=Gt(t,n),{videoTrack:n,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const n=this.extractID3Track(t,this.timeOffset);return i.samples=Gt(e,t),{videoTrack:t,audioTrack:Zn(),id3Track:n,textTrack:Zn()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const n=zt(e.samples,["emsg"]);n&&n.forEach((e=>{const n=function(e){const t=e[0];let i="",n="",r=0,s=0,a=0,o=0,l=0,c=0;if(0===t){for(;"\0"!==xt(e.subarray(c,c+1));)i+=xt(e.subarray(c,c+1)),c+=1;for(i+=xt(e.subarray(c,c+1)),c+=1;"\0"!==xt(e.subarray(c,c+1));)n+=xt(e.subarray(c,c+1)),c+=1;n+=xt(e.subarray(c,c+1)),c+=1,r=Ot(e,12),s=Ot(e,16),o=Ot(e,20),l=Ot(e,24),c=28}else if(1===t){c+=4,r=Ot(e,c),c+=4;const t=Ot(e,c);c+=4;const s=Ot(e,c);for(c+=4,a=2**32*t+s,Number.isSafeInteger(a)||(a=Number.MAX_SAFE_INTEGER,Ue.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Ot(e,c),c+=4,l=Ot(e,c),c+=4;"\0"!==xt(e.subarray(c,c+1));)i+=xt(e.subarray(c,c+1)),c+=1;for(i+=xt(e.subarray(c,c+1)),c+=1;"\0"!==xt(e.subarray(c,c+1));)n+=xt(e.subarray(c,c+1)),c+=1;n+=xt(e.subarray(c,c+1)),c+=1}return{schemeIdUri:i,value:n,timeScale:r,presentationTime:a,presentationTimeDelta:s,eventDuration:o,id:l,payload:e.subarray(c,e.byteLength)}}(e);if(ar.test(n.schemeIdUri)){const e=xe(n.presentationTime)?n.presentationTime/n.timeScale:t+n.presentationTimeDelta/n.timeScale;let r=4294967295===n.eventDuration?Number.POSITIVE_INFINITY:n.eventDuration/n.timeScale;r<=.001&&(r=Number.POSITIVE_INFINITY);const s=n.payload;i.samples.push({data:s,len:s.byteLength,dts:e,pts:e,type:ji,duration:r})}}))}return i}demuxSampleAes(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(e){this.initPTS=e,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(e,t,i,n){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(function(e,t){if(!e||!t)return e;const i=t.keyId;return i&&t.isCommonEncryption&&zt(e,["moov","trak"]).forEach((e=>{const t=zt(e,["mdia","minf","stbl","stsd"])[0].subarray(8);let n=zt(t,["enca"]);const r=n.length>0;r||(n=zt(t,["encv"])),n.forEach((e=>{zt(r?e.subarray(28):e.subarray(78),["sinf"]).forEach((e=>{const t=Yt(e);if(t){const e=t.subarray(8,24);e.some((e=>0!==e))||(Ue.log(`[eme] Patching keyId in 'enc${r?"a":"v"}>sinf>>tenc' box: ${Ct(e)} -> ${Ct(i)}`),t.set(i,8))}}))}))})),e}(e,n)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const n=this.initData=Ut(e);t||(t=Yr(n.audio,qe)),i||(i=Yr(n.video,We));const r={};n.audio&&n.video?r.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:n.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:n.video?r.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:Ue.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,i,n,r,s){var a,o;let{initPTS:l,lastEndTime:c}=this;const u={audio:void 0,video:void 0,text:n,id3:i,initSegment:void 0};xe(c)||(c=this.lastEndTime=r||0);const d=t.samples;if(null==d||!d.length)return u;const h={initPTS:void 0,timescale:1};let p=this.initData;if(null!=(a=p)&&a.length||(this.generateInitSegment(d),p=this.initData),null==(o=p)||!o.length)return Ue.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const f=function(e,t){return zt(t,["moof","traf"]).reduce(((t,i)=>{const n=zt(i,["tfdt"])[0],r=n[0],s=zt(i,["tfhd"]).reduce(((t,i)=>{const s=Ot(i,4),a=e[s];if(a){let e=Ot(n,4);if(1===r){if(e===Dt)return Ue.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;e*=Dt+1,e+=Ot(n,8)}const i=e/(a.timescale||9e4);if(isFinite(i)&&(null===t||i<t))return i}return t}),null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t}),null)}(p,d),g=null===f?r:f;(function(e,t,i){if(null===e)return!0;const n=t-e.baseTime/e.timescale;return n<0&&Math.abs(n-i)>1}(l,g,r)||h.timescale!==l.timescale&&s)&&(h.initPTS=g-r,this.initPTS=l={baseTime:h.initPTS,timescale:1});const y=function(e,t){let i=0,n=0,r=0;const s=zt(e,["moof","traf"]);for(let e=0;e<s.length;e++){const a=s[e],o=zt(a,["tfhd"])[0],l=t[Ot(o,4)];if(!l)continue;const c=l.default,u=Ot(o,0)|(null==c?void 0:c.flags);let d=null==c?void 0:c.duration;8&u&&(d=Ot(o,2&u?12:8));const h=l.timescale||9e4,p=zt(a,["trun"]);for(let e=0;e<p.length;e++)i=Bt(p[e]),!i&&d&&(i=d*Ot(p[e],4)),l.type===We?n+=i/h:l.type===qe&&(r+=i/h)}if(0===n&&0===r){let t=0;const i=zt(e,["sidx"]);for(let e=0;e<i.length;e++){const n=Ft(i[e]);null!=n&&n.references&&(t+=n.references.reduce(((e,t)=>e+t.info.duration||0),0))}return t}return n||r}(d,p),m=e?g-l.baseTime/l.timescale:c,v=m+y;!function(e,t,i){zt(t,["moof","traf"]).forEach((t=>{zt(t,["tfhd"]).forEach((n=>{const r=Ot(n,4),s=e[r];if(!s)return;const a=s.timescale||9e4;zt(t,["tfdt"]).forEach((e=>{const t=e[0];let n=Ot(e,4);if(0===t)n-=i*a,n=Math.max(n,0),Rt(e,4,n);else{n*=Math.pow(2,32),n+=Ot(e,8),n-=i*a,n=Math.max(n,0);const t=Math.floor(n/(Dt+1)),r=Math.floor(n%(Dt+1));Rt(e,4,t),Rt(e,8,r)}}))}))}))}(p,d,l.baseTime/l.timescale),y>0?this.lastEndTime=v:(Ue.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const M=!!p.audio,T=!!p.video;let L="";M&&(L+="audio"),T&&(L+="video");const b={data1:d,startPTS:m,startDTS:m,endPTS:v,endDTS:v,type:L,hasAudio:M,hasVideo:T,nb:1,dropped:0};return u.audio="audio"===b.type?b:void 0,u.video="audio"!==b.type?b:void 0,u.initSegment=h,u.id3=Rr(i,r,l,l),n.samples.length&&(u.text=zr(n,r,l)),u}}},{demux:Tr,remux:Or},{demux:class extends Vn{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,n){super.resetInitSegment(e,t,i,n),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(gt(e,0)||[]).length;for(let i=e.length;t<i;t++)if(ir(e,t))return Ue.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&Xn(e,t)&&er(e,t)<=e.length-t}(e,t)}appendFrame(e,t,i){nr(e,this.observer,t,i,e.manifestCodec);const n=sr(e,t,i,this.basePTS,this.frameIndex);if(n&&0===n.missing)return n}},remux:Or},{demux:class extends Vn{resetInitSegment(e,t,i,n){super.resetInitSegment(e,t,i,n),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:n,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;let t=(gt(e,0)||[]).length;for(let i=e.length;t<i;t++)if(yr(e,t))return Ue.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return function(e,t){return fr(e,t)&&4<=e.length-t}(e,t)}appendFrame(e,t,i){if(null!==this.basePTS)return hr(e,t,i,this.basePTS,this.frameIndex)}},remux:Or}];class $r{constructor(e,t,i,n,r){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=i,this.vendor=n,this.id=r}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,n){const r=i.transmuxing;r.executeStart=jr();let s=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:o}=this;n&&(this.currentTransmuxState=n);const{contiguous:l,discontinuity:c,trackSwitch:u,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=n||a,{audioCodec:f,videoCodec:g,defaultInitPts:y,duration:m,initSegmentData:v}=o,M=function(e,t){let i=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(i=t),i}(s,t);if(M&&"AES-128"===M.method){const e=this.getDecrypter();if(!e.isSync())return this.decryptionPromise=e.webCryptoDecrypt(s,M.key.buffer,M.iv.buffer).then((e=>{const t=this.push(e,null,i);return this.decryptionPromise=null,t})),this.decryptionPromise;{let t=e.softwareDecrypt(s,M.key.buffer,M.iv.buffer);if(i.part>-1&&(t=e.flush()),!t)return r.executeEnd=jr(),Gr(i);s=new Uint8Array(t)}}const T=this.needsProbing(c,u);if(T){const e=this.configureTransmuxer(s);if(e)return Ue.warn(`[transmuxer] ${e.message}`),this.observer.emit(_e.ERROR,_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,fatal:!1,error:e,reason:e.message}),r.executeEnd=jr(),Gr(i)}(c||u||p||T)&&this.resetInitSegment(v,f,g,m,t),(c||p||T)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const L=this.transmux(s,M,h,d,i),b=this.currentTransmuxState;return b.contiguous=!0,b.discontinuity=!1,b.trackSwitch=!1,r.executeEnd=jr(),L}flush(e){const t=e.transmuxing;t.executeStart=jr();const{decrypter:i,currentTransmuxState:n,decryptionPromise:r}=this;if(r)return r.then((()=>this.flush(e)));const s=[],{timeOffset:a}=n;if(i){const t=i.flush();t&&s.push(this.push(t,null,e))}const{demuxer:o,remuxer:l}=this;if(!o||!l)return t.executeEnd=jr(),[Gr(e)];const c=o.flush(a);return Qr(c)?c.then((t=>(this.flushRemux(s,t,e),s))):(this.flushRemux(s,c,e),s)}flushRemux(e,t,i){const{audioTrack:n,videoTrack:r,id3Track:s,textTrack:a}=t,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;Ue.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const c=this.remuxer.remux(n,r,s,a,l,o,!0,this.id);e.push({remuxResult:c,chunkMeta:i}),i.transmuxing.executeEnd=jr()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;t&&i&&(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,n,r){const{demuxer:s,remuxer:a}=this;s&&a&&(s.resetInitSegment(e,t,i,n),a.resetInitSegment(e,t,i,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,n,r){let s;return s=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,i,n,r):this.transmuxUnencrypted(e,i,n,r),s}transmuxUnencrypted(e,t,i,n){const{audioTrack:r,videoTrack:s,id3Track:a,textTrack:o}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,s,a,o,t,i,!1,this.id),chunkMeta:n}}transmuxSampleAes(e,t,i,n,r){return this.demuxer.demuxSampleAes(e,t,i).then((e=>({remuxResult:this.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,i,n,!1,this.id),chunkMeta:r})))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:n,vendor:r}=this;let s;for(let t=0,i=Br.length;t<i;t++)if(Br[t].demux.probe(e)){s=Br[t];break}if(!s)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,o=this.remuxer,l=s.remux,c=s.demux;o&&o instanceof l||(this.remuxer=new l(i,t,n,r)),a&&a instanceof c||(this.demuxer=new c(i,t,n),this.probe=c.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new xn(this.config)),e}}const Gr=e=>({remuxResult:{},chunkMeta:e});function Qr(e){return"then"in e&&e.then instanceof Function}class Hr{constructor(e,t,i,n,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=n,this.defaultInitPts=r||null}}class qr{constructor(e,t,i,n,r,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=n,this.timeOffset=r,this.initSegmentChange=s}}var Wr={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},o.prototype.emit=function(e,t,n,r,s,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,n),!0;case 4:return u.fn.call(u.context,t,n,r),!0;case 5:return u.fn.call(u.context,t,n,r,s),!0;case 6:return u.fn.call(u.context,t,n,r,s,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,n);break;case 4:u[c].fn.call(u[c].context,t,n,r);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||r&&!o[l].once||n&&o[l].context!==n)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o}(Wr);var Zr=Le(Wr.exports);const Vr=qn()||{isTypeSupported:()=>!1};class Kr{constructor(e,t,i,n){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=i,this.onFlush=n;const s=(e,t)=>{(t=t||{}).frag=this.frag,t.id=this.id,e===_e.ERROR&&(this.error=t.error),this.hls.trigger(e,t)};this.observer=new Zr,this.observer.on(_e.FRAG_DECRYPTED,s),this.observer.on(_e.ERROR,s);const a={mp4:Vr.isTypeSupported("video/mp4"),mpeg:Vr.isTypeSupported("audio/mpeg"),mp3:Vr.isTypeSupported('audio/mp4; codecs="mp3"')},o=navigator.vendor;if(!this.useWorker||"undefined"==typeof Worker||!r.workerPath&&"function"!=typeof __HLS_WORKER_BUNDLE__)this.transmuxer=new $r(this.observer,a,r,o,t);else try{r.workerPath?(Ue.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=function(e){const t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(r.workerPath)):(Ue.log(`injecting Web Worker for "${t}"`),this.workerContext=function(){const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=e=>this.onWorkerMessage(e);const{worker:e}=this.workerContext;e.addEventListener("message",this.onwmsg),e.onerror=e=>{const i=new Error(`${e.message} (${e.filename}:${e.lineno})`);r.enableWorker=!1,Ue.warn(`Error in "${t}" Web Worker, fallback to inline`),this.hls.trigger(_e.ERROR,{type:Oe.OTHER_ERROR,details:Pe.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:i})},e.postMessage({cmd:"init",typeSupported:a,vendor:o,id:t,config:JSON.stringify(r)})}catch(e){Ue.warn(`Error setting up "${t}" Web Worker, fallback to inline`,e),this.resetWorker(),this.error=null,this.transmuxer=new $r(this.observer,a,r,o,t)}}resetWorker(){if(this.workerContext){const{worker:e,objectURL:t}=this.workerContext;t&&self.URL.revokeObjectURL(t),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(e,t,i,n,r,s,a,o,l,c){var u,d;l.transmuxing.start=self.performance.now();const{transmuxer:h}=this,p=s?s.start:r.start,f=r.decryptdata,g=this.frag,y=!(g&&r.cc===g.cc),m=!(g&&l.level===g.level),v=g?l.sn-g.sn:-1,M=this.part?l.part-this.part.index:-1,T=0===v&&l.id>1&&l.id===(null==g?void 0:g.stats.chunkCount),L=!m&&(1===v||0===v&&(1===M||T&&M<=0)),b=self.performance.now();(m||v||0===r.stats.parsing.start)&&(r.stats.parsing.start=b),!s||!M&&L||(s.stats.parsing.start=b);const E=!(g&&(null==(u=r.initSegment)?void 0:u.url)===(null==(d=g.initSegment)?void 0:d.url)),I=new qr(y,L,o,m,p,E);if(!L||y||E){Ue.log(`[transmuxer-interface, ${r.type}]: Starting new transmux session for sn: ${l.sn} p: ${l.part} level: ${l.level} id: ${l.id}\n discontinuity: ${y}\n trackSwitch: ${m}\n contiguous: ${L}\n accurateTimeOffset: ${o}\n timeOffset: ${p}\n initSegmentChange: ${E}`);const e=new Hr(i,n,t,a,c);this.configureTransmuxer(e)}if(this.frag=r,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:f,chunkMeta:l,state:I},e instanceof ArrayBuffer?[e]:[]);else if(h){const t=h.push(e,f,l,I);Qr(t)?(h.async=!0,t.then((e=>{this.handleTransmuxComplete(e)})).catch((e=>{this.transmuxerError(e,l,"transmuxer-interface push error")}))):(h.async=!1,this.handleTransmuxComplete(t))}}flush(e){e.transmuxing.start=self.performance.now();const{transmuxer:t}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(t){let i=t.flush(e);Qr(i)||t.async?(Qr(i)||(i=Promise.resolve(i)),i.then((t=>{this.handleFlushResult(t,e)})).catch((t=>{this.transmuxerError(t,e,"transmuxer-interface flush error")}))):this.handleFlushResult(i,e)}}transmuxerError(e,t,i){this.hls&&(this.error=e,this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}handleFlushResult(e,t){e.forEach((e=>{this.handleTransmuxComplete(e)})),this.onFlush(t)}onWorkerMessage(e){const t=e.data,i=this.hls;switch(t.event){case"init":{var n;const e=null==(n=this.workerContext)?void 0:n.objectURL;e&&self.URL.revokeObjectURL(e);break}case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":Ue[t.data.logType]&&Ue[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data)}}configureTransmuxer(e){const{transmuxer:t}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}class Xr{constructor(e,t,i,n){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=e,this.media=t,this.fragmentTracker=i,this.hls=n}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(e,t){const{config:i,media:n,stalled:r}=this;if(null===n)return;const{currentTime:s,seeking:a}=n,o=this.seeking&&!a,l=!this.seeking&&a;if(this.seeking=a,s!==e){if(this.moved=!0,null!==r){if(this.stallReported){const e=self.performance.now()-r;Ue.warn(`playback not stuck anymore @${s}, after ${Math.round(e)}ms`),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if(l||o)return void(this.stalled=null);if(n.paused&&!a||n.ended||0===n.playbackRate||!In.getBuffered(n).length)return;const c=In.bufferInfo(n,s,0),u=c.len>0,d=c.nextStart||0;if(!u&&!d)return;if(a){const e=c.len>2,i=!d||t&&t.start<=s||d-s>2&&!this.fragmentTracker.getPartialFragment(s);if(e||i)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var h;const e=Math.max(d,c.start||0)-s,t=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,i=(null==t||null==(h=t.details)?void 0:h.live)?2*t.details.targetduration:2,n=this.fragmentTracker.getPartialFragment(s);if(e>0&&(e<=i||n))return void this._trySkipBufferHole(n)}const p=self.performance.now();if(null===r)return void(this.stalled=p);const f=p-r;if(!a&&f>=250&&(this._reportStall(c),!this.media))return;const g=In.bufferInfo(n,s,i.maxBufferHole);this._tryFixBufferStall(g,f)}_tryFixBufferStall(e,t){const{config:i,fragmentTracker:n,media:r}=this;if(null===r)return;const s=r.currentTime,a=n.getPartialFragment(s);(!a||!this._trySkipBufferHole(a)&&this.media)&&(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-s<i.maxBufferHole)&&t>1e3*i.highBufferWatchdogPeriod&&(Ue.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(e){const{hls:t,media:i,stallReported:n}=this;if(!n&&i){this.stallReported=!0;const n=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(e)})`);Ue.warn(n.message),t.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_STALLED_ERROR,fatal:!1,error:n,buffer:e.len})}}_trySkipBufferHole(e){const{config:t,hls:i,media:n}=this;if(null===n)return 0;const r=n.currentTime,s=In.bufferInfo(n,r,0),a=r<s.start?s.start:s.nextStart;if(a){const o=s.len<=t.maxBufferHole,l=s.len>0&&s.len<1&&n.readyState<3,c=a-r;if(c>0&&(o||l)){if(c>t.maxBufferHole){const{fragmentTracker:t}=this;let i=!1;if(0===r){const e=t.getAppendedFrag(0,Li);e&&a<e.end&&(i=!0)}if(!i){const i=e||t.getAppendedFrag(r,Li);if(i){let e=!1,n=i.end;for(;n<a;){const i=t.getPartialFragment(n);if(!i){e=!0;break}n+=i.duration}if(e)return 0}}}const s=Math.max(a+.05,r+.1);if(Ue.warn(`skipping hole, adjusting currentTime from ${r} to ${s}`),this.moved=!0,this.stalled=null,n.currentTime=s,e&&!e.gap){const t=new Error(`fragment loaded with buffer holes, seeking from ${r} to ${s}`);i.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:t,reason:t.message,frag:e})}return s}}return 0}_tryNudgeBuffer(){const{config:e,hls:t,media:i,nudgeRetry:n}=this;if(null===i)return;const r=i.currentTime;if(this.nudgeRetry++,n<e.nudgeMaxRetry){const s=r+(n+1)*e.nudgeOffset,a=new Error(`Nudging 'currentTime' from ${r} to ${s}`);Ue.warn(a.message),i.currentTime=s,t.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_NUDGE_ON_STALL,error:a,fatal:!1})}else{const i=new Error(`Playhead still not moving while enough data buffered @${r} after ${e.nudgeMaxRetry} nudges`);Ue.error(i.message),t.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_STALLED_ERROR,error:i,fatal:!0})}}}class Jr extends Hn{constructor(e,t,i){super(e,t,i,"[stream-controller]",Li),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.LEVEL_LOADING,this.onLevelLoading,this),e.on(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_e.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(_e.ERROR,this.onError,this),e.on(_e.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_e.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(_e.BUFFER_CREATED,this.onBufferCreated,this),e.on(_e.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_e.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(_e.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_e.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(_e.ERROR,this.onError,this),e.off(_e.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_e.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(_e.BUFFER_CREATED,this.onBufferCreated,this),e.off(_e.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_e.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(_e.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),this.onMediaDetaching()}startLoad(e){if(this.levels){const{lastCurrentTime:t,hls:i}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let e=i.startLevel;-1===e&&(i.config.testBandwidth&&this.levels.length>1?(e=0,this.bitrateTest=!0):e=i.nextAutoLevel),this.level=i.nextLoadLevel=e,this.loadedmetadata=!1}t>0&&-1===e&&(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t),this.state=On,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=_n}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Qn:{var e;const{levels:t,level:i}=this,n=null==t||null==(e=t[i])?void 0:e.details;if(n&&(!n.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(n))break;this.state=On;break}break}case zn:{var t;const e=self.performance.now(),i=this.retryDate;(!i||e>=i||null!=(t=this.media)&&t.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=On)}}this.state===On&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:i,media:n}=this,{config:r,nextLoadLevel:s}=e;if(null===t||!n&&(this.startFragRequested||!r.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(null==i||!i[s])return;const a=i[s],o=this.getMainFwdBufferInfo();if(null===o)return;const l=this.getLevelDetails();if(l&&this._streamEnded(o,l)){const e={};return this.altAudio&&(e.type="video"),this.hls.trigger(_e.BUFFER_EOS,e),void(this.state=Bn)}e.loadLevel!==s&&-1===e.manualLevel&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=e.nextLoadLevel=s;const c=a.details;if(!c||this.state===Qn||c.live&&this.levelLastLoaded!==s)return this.level=s,void(this.state=Qn);const u=o.len,d=this.getMaxBufferLength(a.maxBitrate);if(u>=d)return;this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:o.end;let p=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==hn){var f;const e=(null!=(f=this.backtrackFragment)?f:p).sn-c.startSN,t=c.fragments[e-1];t&&p.cc===t.cc&&(p=t,this.fragmentTracker.removeFragment(t))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){const e=this.audioOnly&&!this.altAudio?qe:We,t=(e===We?this.videoBuffer:this.mediaBuffer)||this.media;t&&this.afterBufferFlushed(t,e,Li)}p=this.getNextFragmentLoopLoading(p,c,o,Li,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,h))}loadFragment(e,t,i){const n=this.fragmentTracker.getState(e);this.fragCurrent=e,n===cn?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}getAppendedFrag(e){const t=this.fragmentTracker.getAppendedFrag(e,Li);return t&&"fragment"in t?t.fragment:t}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Li)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(null!=t&&t.readyState){let i;const n=this.getAppendedFrag(t.currentTime);if(n&&n.start>1&&this.flushMainBuffer(0,n.start-1),!t.paused&&e){const t=e[this.hls.nextLoadLevel],n=this.fragLastKbps;i=n&&this.fragCurrent?this.fragCurrent.duration*t.maxBitrate/(1e3*n)+1:0}else i=0;const r=this.getBufferedFrag(t.currentTime+i);if(r){const e=this.followingBufferedFrag(r);if(e){this.abortCurrentFrag();const t=e.maxStartPTS?e.maxStartPTS:e.start,i=e.duration,n=Math.max(r.end,t+Math.min(Math.max(i-this.config.maxFragLookUpTolerance,.5*i),.75*i));this.flushMainBuffer(n,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Pn:case Rn:case zn:case Un:case Yn:this.state=On}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const i=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new Xr(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:e}=this;e&&this.onvplaying&&this.onvseeked&&(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),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const e=this.media,t=e?e.currentTime:null;xe(t)&&this.log(`Media seeked to ${t.toFixed(3)}`);const i=this.getMainFwdBufferInfo();null!==i&&0!==i.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(_e.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null}onManifestParsed(e,t){let i,n=!1,r=!1;t.levels.forEach((e=>{i=e.audioCodec,i&&(-1!==i.indexOf("mp4a.40.2")&&(n=!0),-1!==i.indexOf("mp4a.40.5")&&(r=!0))})),this.audioCodecSwitch=n&&r&&!function(){var e;const t=Wn();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:i}=this;if(!i||this.state!==On)return;const n=i[t.level];(!n.details||n.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(n.details))&&(this.state=Qn)}onLevelLoaded(e,t){var i;const{levels:n}=this,r=t.level,s=t.details,a=s.totalduration;if(!n)return void this.warn(`Levels were reset while loading level ${r}`);this.log(`Level ${r} loaded [${s.startSN},${s.endSN}], cc [${s.startCC}, ${s.endCC}] duration:${a}`);const o=n[r],l=this.fragCurrent;!l||this.state!==Rn&&this.state!==zn||l.level===t.level&&l.urlId===o.urlId||!l.loader||this.abortCurrentFrag();let c=0;if(s.live||null!=(i=o.details)&&i.live){if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed)return;c=this.alignPlaylists(s,o.details)}if(o.details=s,this.levelLastLoaded=r,this.hls.trigger(_e.LEVEL_UPDATED,{details:s,level:r}),this.state===Qn){if(this.waitForCdnTuneIn(s))return;this.state=On}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,c),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:n,payload:r}=e,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const a=s[i.level],o=a.details;if(!o)return this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),void this.fragmentTracker.removeFragment(i);const l=a.videoCodec,c=o.PTSKnown||!o.live,u=null==(t=i.initSegment)?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new Kr(this.hls,Li,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=n?n.index:-1,f=-1!==p,g=new Nn(i.level,i.sn,i.stats.chunkCount,r.byteLength,p,f),y=this.initPTS[i.cc];h.push(r,u,d,l,i,n,o.totalduration,c,g,y)}onAudioTrackSwitching(e,t){const i=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const e=this.fragCurrent;e&&(this.log("Switching to main audio track, cancel main fragment load"),e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const e=this.hls;i&&(e.trigger(_e.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),e.trigger(_e.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=t.id,n=!!this.hls.audioTracks[i].url;if(n){const e=this.videoBuffer;e&&this.mediaBuffer!==e&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=e)}this.altAudio=n,this.tick()}onBufferCreated(e,t){const i=t.tracks;let n,r,s=!1;for(const e in i){const t=i[e];if("main"===t.id){if(r=e,n=t,"video"===e){const t=i[e];t&&(this.videoBuffer=t.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}onFragBuffered(e,t){const{frag:i,part:n}=t;if(i&&i.type!==Li)return;if(this.fragContextChanged(i))return this.warn(`Fragment ${i.sn}${n?" p: "+n.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===Yn&&(this.state=On));const r=n?n.stats:i.stats;this.fragLastKbps=Math.round(8*r.total/(r.buffering.end-r.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,n)}onError(e,t){var i;if(t.fatal)this.state=$n;else switch(t.details){case Pe.FRAG_GAP:case Pe.FRAG_PARSING_ERROR:case Pe.FRAG_DECRYPT_ERROR:case Pe.FRAG_LOAD_ERROR:case Pe.FRAG_LOAD_TIMEOUT:case Pe.KEY_LOAD_ERROR:case Pe.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Li,t);break;case Pe.LEVEL_LOAD_ERROR:case Pe.LEVEL_LOAD_TIMEOUT:case Pe.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Qn||(null==(i=t.context)?void 0:i.type)!==vi||(this.state=On);break;case Pe.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case Pe.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}checkBuffer(){const{media:e,gapController:t}=this;if(e&&t&&e.readyState){if(this.loadedmetadata||!In.getBuffered(e).length){const e=this.state!==On?this.fragCurrent:null;t.poll(this.lastCurrentTime,e)}this.lastCurrentTime=e.currentTime}}onFragLoadEmergencyAborted(){this.state=On,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==qe||this.audioOnly&&!this.altAudio){const e=(t===We?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(e,t,Li)}}onLevelsUpdated(e,t){this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let i=this.startPosition;if(i>=0&&t<i){if(e.seeking)return void this.log(`could not seek to ${i}, already seeking at ${t}`);const n=In.getBuffered(e),r=(n.length?n.start(0):0)-i;r>0&&(r<this.config.maxBufferHole||r<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${r} to match buffer start`),i+=r,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${t}`),e.currentTime=i}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then((i=>{const{hls:n}=this;if(!i||this.fragContextChanged(e))return;t.fragmentError=0,this.state=On,this.startFragRequested=!1,this.bitrateTest=!1;const r=e.stats;r.parsing.start=r.parsing.end=r.buffering.start=r.buffering.end=self.performance.now(),n.trigger(_e.FRAG_LOADED,i),e.bitrateTest=!1}))}_handleTransmuxComplete(e){var t;const i="main",{hls:n}=this,{remuxResult:r,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{video:u,text:d,id3:h,initSegment:p}=r,{details:f}=c,g=this.altAudio?void 0:r.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Un,p){p.tracks&&(this._bufferInitSegment(c,p.tracks,o,s),n.trigger(_e.FRAG_PARSING_INIT_SEGMENT,{frag:o,id:i,tracks:p.tracks}));const e=p.initPTS,t=p.timescale;xe(e)&&(this.initPTS[o.cc]={baseTime:e,timescale:t},n.trigger(_e.INIT_PTS_FOUND,{frag:o,id:i,initPTS:e,timescale:t}))}if(u&&!1!==r.independent){if(f){const{startPTS:e,endPTS:t,startDTS:i,endDTS:n}=u;if(l)l.elementaryStreams[u.type]={startPTS:e,endPTS:t,startDTS:i,endDTS:n};else if(u.firstKeyFrame&&u.independent&&1===s.id&&(this.couldBacktrack=!0),u.dropped&&u.independent){const i=this.getMainFwdBufferInfo();if((i?i.end:this.getLoadPosition())+this.config.maxBufferHole<(u.firstKeyFramePTS?u.firstKeyFramePTS:e)-this.config.maxBufferHole)return void this.backtrack(o);o.setElementaryStreamInfo(u.type,o.start,t,o.start,n,!0)}o.setElementaryStreamInfo(u.type,e,t,i,n),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(u,o,l,s)}}else if(!1===r.independent)return void this.backtrack(o);if(g){const{startPTS:e,endPTS:t,startDTS:i,endDTS:n}=g;l&&(l.elementaryStreams.audio={startPTS:e,endPTS:t,startDTS:i,endDTS:n}),o.setElementaryStreamInfo(qe,e,t,i,n),this.bufferFragmentData(g,o,l,s)}if(f&&null!=h&&null!=(t=h.samples)&&t.length){const e={id:i,frag:o,details:f,samples:h.samples};n.trigger(_e.FRAG_PARSING_METADATA,e)}if(f&&d){const e={id:i,frag:o,details:f,samples:d.samples};n.trigger(_e.FRAG_PARSING_USERDATA,e)}}}_bufferInitSegment(e,t,i,n){if(this.state!==Un)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;const{audio:r,video:s,audiovideo:a}=t;if(r){let t=e.audioCodec;const i=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(t&&(t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==r.metadata.channelCount&&-1===i.indexOf("firefox")&&(t="mp4a.40.5")),-1!==i.indexOf("android")&&"audio/mpeg"!==r.container&&(t="mp4a.40.2",this.log(`Android: force audio codec to ${t}`)),e.audioCodec&&e.audioCodec!==t&&this.log(`Swapping manifest audio codec "${e.audioCodec}" for "${t}"`),r.levelCodec=t,r.id="main",this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${t||""}/${e.audioCodec||""}/${r.codec}]`)}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${e.videoCodec||""}/${s.codec}]`)),a&&this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.attrs.CODECS||""}/${a.codec}]`),this.hls.trigger(_e.BUFFER_CODECS,t),Object.keys(t).forEach((e=>{const r=t[e].initSegment;null!=r&&r.byteLength&&this.hls.trigger(_e.BUFFER_APPENDING,{type:e,data:r,frag:i,part:null,chunkMeta:n,parent:i.type})})),this.tick()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Li)}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=On}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&!1===e.seeking){const i=e.currentTime;if(In.isBuffered(e,i)?t=this.getAppendedFrag(i):In.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;const e=this.fragPlaying,i=t.level;e&&t.sn===e.sn&&e.level===i&&t.urlId===e.urlId||(this.fragPlaying=t,this.hls.trigger(_e.FRAG_CHANGED,{frag:t}),e&&e.level===i||this.hls.trigger(_e.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){const e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}get currentProgramDateTime(){const e=this.media;if(e){const t=e.currentTime,i=this.currentFrag;if(i&&xe(t)&&xe(i.programDateTime)){const e=i.programDateTime+1e3*(t-i.start);return new Date(e)}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class es{constructor(e,t=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class ts{constructor(e,t,i,n=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new es(e),this.fast_=new es(t),this.defaultTTFB_=n,this.ttfb_=new es(e)}update(e,t){const{slow_:i,fast_:n,ttfb_:r}=this;i.halfLife!==e&&(this.slow_=new es(e,i.getEstimate(),i.getTotalWeight())),n.halfLife!==t&&(this.fast_=new es(t,n.getEstimate(),n.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new es(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){const i=(e=Math.max(e,this.minDelayMs_))/1e3,n=8*t/i;this.fast_.sample(i,n),this.slow_.sample(i,n)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}class is{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;return e.length?(i=1===e.length?e[0]:function(e,t){const i=new Uint8Array(t);let n=0;for(let t=0;t<e.length;t++){const r=e[t];i.set(r,n),n+=r.length}return i}(e,t),this.reset(),i):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}function ns(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!rs(e[i].attrs,t[i].attrs))return!1;return!0}function rs(e,t){const i=e["STABLE-RENDITION-ID"];return i?i===t["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some((i=>e[i]!==t[i]))}class ss{constructor(e){this.buffered=void 0;const t=(t,i,n)=>{if((i>>>=0)>n-1)throw new DOMException(`Failed to execute '${t}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${n})`);return e[i][t]};this.buffered={get length(){return e.length},end:i=>t("end",i,e.length),start:i=>t("start",i,e.length)}}}function as(e){const t=[];for(let i=0;i<e.length;i++){const n=e[i];"subtitles"!==n.kind&&"captions"!==n.kind||!n.label||t.push(e[i])}return t}class os{constructor(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}append(e,t){const i=this.queues[t];i.push(e),1===i.length&&this.buffers[t]&&this.executeNext(t)}insertAbort(e,t){this.queues[t].unshift(e),this.executeNext(t)}appendBlocker(e){let t;const i=new Promise((e=>{t=e})),n={execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(n,e),i}executeNext(e){const{buffers:t,queues:i}=this,n=t[e],r=i[e];if(r.length){const t=r[0];try{t.execute()}catch(i){Ue.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),t.onError(i),null!=n&&n.updating||(r.shift(),this.executeNext(e))}}}shiftAndExecuteNext(e){this.queues[e].shift(),this.executeNext(e)}current(e){return this.queues[e][0]}}const ls=qn(),cs=/([ha]vc.)(?:\.[^.,]+)+/,us={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},ds=function(e){let t=e;return us.hasOwnProperty(e)&&(t=us[e]),String.fromCharCode(t)},hs=15,ps=100,fs={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},gs={17:2,18:4,21:6,22:8,23:10,19:13,20:15},ys={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},ms={25:2,26:4,29:6,30:8,31:10,27:13,28:15},vs=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Ms{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i="function"==typeof t?t():t;Ue.log(`${this.time} [${e}] ${i}`)}}}const Ts=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class Ls{constructor(e,t,i,n,r){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=i||!1,this.background=n||"black",this.flash=r||!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let i=0;i<t.length;i++){const n=t[i];e.hasOwnProperty(n)&&(this[n]=e[n])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class bs{constructor(e,t,i,n,r,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new Ls(t,i,n,r,s)}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Es{constructor(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(let e=0;e<ps;e++)this.chars.push(new bs);this.logger=e,this.pos=0,this.currPenState=new Ls}equals(e){let t=!0;for(let i=0;i<ps;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t}copy(e){for(let t=0;t<ps;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<ps;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>ps&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=ps)}moveCursor(e){const t=this.pos+e;if(e>1)for(let e=this.pos+1;e<t+1;e++)this.chars[e].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=ds(e);this.pos>=ps?this.logger.log(0,(()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))}clearFromPos(e){let t;for(t=e;t<ps;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let i=0;i<ps;i++){const n=this.chars[i].uchar;" "!==n&&(t=!1),e.push(n)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class Is{constructor(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(let t=0;t<hs;t++)this.rows.push(new Es(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}reset(){for(let e=0;e<hs;e++)this.rows[e].clear();this.currRow=14}equals(e){let t=!0;for(let i=0;i<hs;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<hs;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<hs;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,(()=>"pacData = "+JSON.stringify(e)));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let e=0;e<hs;e++)this.rows[e].clear();const e=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){const n=i.rows[e].cueStartTime,r=this.logger.time;if(n&&null!==r&&n<r)for(let n=0;n<this.nrRollUpRows;n++)this.rows[t-this.nrRollUpRows+n+1].copy(i.rows[e+n])}}this.currRow=t;const i=this.rows[this.currRow];if(null!==e.indent){const t=e.indent,n=Math.max(t-1,0);i.setCursor(e.indent),e.color=i.chars[n].penState.foreground}const n={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(n)}setBkgData(e){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(e))),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let i="",n=-1;for(let i=0;i<hs;i++){const r=this.rows[i].getTextString();r&&(n=i+1,e?t.push("Row "+n+": '"+r+"'"):t.push(r.trim()))}return t.length>0&&(i=e?"["+t.join(" | ")+"]":t.join("\n")),i}getTextAndFormat(){return this.rows}}class Ns{constructor(e,t,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new Is(i),this.nonDisplayedMemory=new Is(i),this.lastOutputScreen=new Is(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){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}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(()=>"MODE="+e)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>t+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{const i=Math.floor(e/2)-16,n=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=n[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class Ss{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;const n=new Ms;this.channels=[null,new Ns(e,t,n),new Ns(e+1,i,n)],this.cmdHistory={a:null,b:null},this.logger=n}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){let i,n,r,s=!1;this.logger.time=e;for(let e=0;e<t.length;e+=2)if(n=127&t[e],r=127&t[e+1],0!==n||0!==r){if(this.logger.log(3,"["+Ts([t[e],t[e+1]])+"] -> ("+Ts([n,r])+")"),i=this.parseCmd(n,r),i||(i=this.parseMidrow(n,r)),i||(i=this.parsePAC(n,r)),i||(i=this.parseBackgroundAttributes(n,r)),!i&&(s=this.parseChars(n,r),s)){const e=this.currentChannel;e&&e>0?this.channels[e].insertChars(s):this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||s||this.logger.log(2,"Couldn't parse cleaned data "+Ts([n,r])+" orig: "+Ts([t[e],t[e+1]]))}}parseCmd(e,t){const{cmdHistory:i}=this;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(As(e,t,i))return ws(null,null,i),this.logger.log(3,"Repeated command ("+Ts([e,t])+") is dropped"),!0;const n=20===e||21===e||23===e?1:2,r=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?r.ccRCL():33===t?r.ccBS():34===t?r.ccAOF():35===t?r.ccAON():36===t?r.ccDER():37===t?r.ccRU(2):38===t?r.ccRU(3):39===t?r.ccRU(4):40===t?r.ccFON():41===t?r.ccRDC():42===t?r.ccTR():43===t?r.ccRTD():44===t?r.ccEDM():45===t?r.ccCR():46===t?r.ccENM():47===t&&r.ccEOC():r.ccTO(t-32),ws(e,t,i),this.currentChannel=n,!0}parseMidrow(e,t){let i=0;if((17===e||25===e)&&t>=32&&t<=47){if(i=17===e?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const n=this.channels[i];return!!n&&(n.ccMIDROW(t),this.logger.log(3,"MIDROW ("+Ts([e,t])+")"),!0)}return!1}parsePAC(e,t){let i;const n=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(As(e,t,n))return ws(null,null,n),!0;const r=e<=23?1:2;i=t>=64&&t<=95?1===r?fs[e]:ys[e]:1===r?gs[e]:ms[e];const s=this.channels[r];return!!s&&(s.setPAC(this.interpretPAC(i,t)),ws(e,t,n),this.currentChannel=r,!0)}interpretPAC(e,t){let i;const n={color:null,italics:!1,indent:null,underline:!1,row:e};return i=t>95?t-96:t-64,n.underline=1==(1&i),i<=13?n.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(n.italics=!0,n.color="white"):n.indent=4*Math.floor((i-16)/2),n}parseChars(e,t){let i,n=null,r=null;if(e>=25?(i=2,r=e-8):(i=1,r=e),r>=17&&r<=19){let e;e=17===r?t+80:18===r?t+112:t+144,this.logger.log(2,"Special char '"+ds(e)+"' in channel "+i),n=[e]}else e>=32&&e<=127&&(n=0===t?[e]:[e,t]);if(n){const i=Ts(n);this.logger.log(3,"Char codes = "+i.join(",")),ws(e,t,this.cmdHistory)}return n}parseBackgroundAttributes(e,t){if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;let i;const n={};16===e||24===e?(i=Math.floor((t-32)/2),n.background=vs[i],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0));const r=e<=23?1:2;return this.channels[r].setBkgData(n),ws(e,t,this.cmdHistory),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function ws(e,t,i){i.a=e,i.b=t}function As(e,t,i){return i.a===e&&i.b===t}class Cs{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,i){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var Ds=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;const e=["","lr","rl"],t=["start","middle","end","left","right"];function i(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;const i=t.toLowerCase();return!!~e.indexOf(i)&&i}function n(e){return i(t,e)}function r(e,...t){let i=1;for(;i<arguments.length;i++){const t=arguments[i];for(const i in t)e[i]=t[i]}return e}function s(t,s,a){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",u=!1,d=t,h=s,p=a,f=null,g="",y=!0,m="auto",v="start",M=50,T="middle",L=50,b="middle";Object.defineProperty(o,"id",r({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(o,"pauseOnExit",r({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(o,"startTime",r({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",r({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",r({},l,{get:function(){return p},set:function(e){p=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",r({},l,{get:function(){return f},set:function(e){f=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",r({},l,{get:function(){return g},set:function(t){const n=function(t){return i(e,t)}(t);if(!1===n)throw new SyntaxError("An invalid or illegal string was specified.");g=n,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",r({},l,{get:function(){return y},set:function(e){y=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",r({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",r({},l,{get:function(){return v},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",r({},l,{get:function(){return M},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");M=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",r({},l,{get:function(){return T},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");T=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",r({},l,{get:function(){return L},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");L=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",r({},l,{get:function(){return b},set:function(e){const t=n(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class ks{decode(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function js(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+parseFloat(n||0)}const i=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}class xs{constructor(){this.values=Object.create(null)}set(e,t){this.get(e)||""===t||(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function _s(e,t,i,n){const r=n?e.split(n):[e];for(const e in r){if("string"!=typeof r[e])continue;const n=r[e].split(i);2===n.length&&t(n[0],n[1])}}const Os=new Ds(0,0,""),Ps="middle"===Os.align?"middle":"center";function Rs(e,t,i){const n=e;function r(){const t=js(e);if(null===t)throw new Error("Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function s(){e=e.replace(/^\s+/,"")}if(s(),t.startTime=r(),s(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.slice(3),s(),t.endTime=r(),s(),function(e,t){const n=new xs;_s(e,(function(e,t){let r;switch(e){case"region":for(let r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":r=t.split(","),n.integer(e,r[0]),n.percent(e,r[0])&&n.set("snapToLines",!1),n.alt(e,r[0],["auto"]),2===r.length&&n.alt("lineAlign",r[1],["start",Ps,"end"]);break;case"position":r=t.split(","),n.percent(e,r[0]),2===r.length&&n.alt("positionAlign",r[1],["start",Ps,"end","line-left","line-right","auto"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start",Ps,"end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");let r=n.get("line","auto");"auto"===r&&-1===Os.line&&(r=-1),t.line=r,t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100),t.align=n.get("align",Ps);let s=n.get("position","auto");"auto"===s&&50===Os.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function zs(e){return e.replace(/<br(?: \/)?>/gi,"\n")}class Fs{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new ks,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;function i(){let e=t.buffer,i=0;for(e=zs(e);i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;const n=e.slice(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.slice(i),n}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{let e="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;e=i();const n=e.match(/^()?WEBVTT([ \t].*)?$/);if(null==n||!n[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let n=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(n?n=!1:e=i(),t.state){case"HEADER":/:/.test(e)?_s(e,(function(e,t){}),/:/):e||(t.state="ID");continue;case"NOTE":e||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){t.state="NOTE";break}if(!e)continue;if(t.cue=new Ds(0,0,""),t.state="CUE",-1===e.indexOf("--\x3e")){t.cue.id=e;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Rs(e,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const i=-1!==e.indexOf("--\x3e");if(!e||i&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=e}continue;case"BADCUE":e||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Us=/\r\n|\n\r|\n|\r/g,Ys=function(e,t,i=0){return e.slice(i,i+t.length)===t},Bs=function(e){let t=5381,i=e.length;for(;i;)t=33*t^e.charCodeAt(--i);return(t>>>0).toString()};function $s(e,t,i){return Bs(e.toString())+Bs(t.toString())+Bs(i)}const Gs="stpp.ttml.im1t",Qs=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Hs=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,qs={left:"start",center:"center",right:"end",start:"start",end:"end"};function Ws(e,t,i,n){const r=zt(new Uint8Array(e),["mdat"]);if(0===r.length)return void n(new Error("Could not parse IMSC1 mdat"));const s=r.map((e=>St(e))),a=function(e,t,i=1,n=!1){return Dr(e,t,1/i,n)}(t.baseTime,1,t.timescale);try{s.forEach((e=>i(function(e,t){const i=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");const n={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},r=Object.keys(n).reduce(((e,t)=>(e[t]=i.getAttribute(`ttp:${t}`)||n[t],e)),{}),s="preserve"!==i.getAttribute("xml:space"),a=Vs(Zs(i,"styling","style")),o=Vs(Zs(i,"layout","region")),l=Zs(i,"body","[begin]");return[].map.call(l,(e=>{const i=Ks(e,s);if(!i||!e.hasAttribute("begin"))return null;const n=ea(e.getAttribute("begin"),r),l=ea(e.getAttribute("dur"),r);let c=ea(e.getAttribute("end"),r);if(null===n)throw Js(e);if(null===c){if(null===l)throw Js(e);c=n+l}const u=new Ds(n-t,c-t,i);u.id=$s(u.startTime,u.endTime,u.text);const d=function(e,t,i){const n="http://www.w3.org/ns/ttml#styling";let r=null;const s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return s&&i.hasOwnProperty(s)&&(r=i[s]),["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce(((i,s)=>{const a=Xs(t,n,s)||Xs(e,n,s)||Xs(r,n,s);return a&&(i[s]=a),i}),{})}(o[e.getAttribute("region")],a[e.getAttribute("style")],a),{textAlign:h}=d;if(h){const e=qs[h];e&&(u.lineAlign=e),u.align=h}return je(u,d),u})).filter((e=>null!==e))}(e,a))))}catch(e){n(e)}}function Zs(e,t,i){const n=e.getElementsByTagName(t)[0];return n?[].slice.call(n.querySelectorAll(i)):[]}function Vs(e){return e.reduce(((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e}),{})}function Ks(e,t){return[].slice.call(e.childNodes).reduce(((e,i,n)=>{var r;return"br"===i.nodeName&&n?e+"\n":null!=(r=i.childNodes)&&r.length?Ks(i,t):t?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}function Xs(e,t,i){return e&&e.hasAttributeNS(t,i)?e.getAttributeNS(t,i):null}function Js(e){return new Error(`Could not parse ttml timestamp ${e}`)}function ea(e,t){if(!e)return null;let i=js(e);return null===i&&(Qs.test(e)?i=function(e,t){const i=Qs.exec(e),n=(0|i[4])+(0|i[5])/t.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+n/t.frameRate}(e,t):Hs.test(e)&&(i=function(e,t){const i=Hs.exec(e),n=Number(i[1]);switch(i[2]){case"h":return 3600*n;case"m":return 60*n;case"ms":return 1e3*n;case"f":return n/t.frameRate;case"t":return n/t.tickRate}return n}(e,t))),i}function ta(e,t){return!!e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}class ia{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(_e.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(_e.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}onManifestParsed(e,t){const i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){const e=this.hls.levels;if(e.length){const t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const i=t.filter(((t,i)=>this.isLevelAllowed(t)&&i<=e));return this.clientRect=null,ia.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){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())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,t.width||t.height||(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(e){}return e}isLevelAllowed(e){return!this.restrictedLevels.some((t=>e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height))}static getMaxLevelByMediaSize(e,t,i){if(null==e||!e.length)return-1;let n=e.length-1;for(let a=0;a<e.length;a+=1){const o=e[a];if((o.width>=t||o.height>=i)&&(r=o,!(s=e[a+1])||r.width!==s.width||r.height!==s.height)){n=a;break}}var r,s;return n}}const na="[eme]";class ra{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=ra.CDMCleanupPromise?[ra.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=Ue.debug.bind(Ue,na),this.log=Ue.log.bind(Ue,na),this.warn=Ue.warn.bind(Ue,na),this.error=Ue.error.bind(Ue,na),this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}registerListeners(){this.hls.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(_e.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(_e.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(_e.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(_e.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:i}=this.config,n=t[e];if(n)return n.licenseUrl;if(e===it.WIDEVINE&&i)return i;throw new Error(`no license server URL configured for key-system "${e}"`)}getServerCertificateUrl(e){const{drmSystems:t}=this.config,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(e,t,i)=>!!e&&i.indexOf(e)===t,n=t.map((e=>e.audioCodec)).filter(i),r=t.map((e=>e.videoCodec)).filter(i);return n.length+r.length===0&&r.push("avc1.42e01e"),new Promise(((t,i)=>{const s=e=>{const a=e.shift();this.getMediaKeysPromise(a,n,r).then((e=>t({keySystem:a,mediaKeys:e}))).catch((t=>{e.length?s(e):i(t instanceof sa?t:new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};s(e)}))}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if("function"!=typeof i){let e=`Configured requestMediaKeySystemAccess is not a function ${i}`;return null===dt&&"http:"===self.location.protocol&&(e=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(e))}return i(e,t)}getMediaKeysPromise(e,t,i){const n=function(e,t,i,n){let r;switch(e){case it.FAIRPLAY:r=["cenc","sinf"];break;case it.WIDEVINE:case it.PLAYREADY:r=["cenc"];break;case it.CLEARKEY:r=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${e}`)}return function(e,t,i,n){return[{initDataTypes:e,persistentState:n.persistentState||"not-allowed",distinctiveIdentifier:n.distinctiveIdentifier||"not-allowed",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:t.map((e=>({contentType:`audio/mp4; codecs="${e}"`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null}))),videoCapabilities:i.map((e=>({contentType:`video/mp4; codecs="${e}"`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null})))}]}(r,t,i,n)}(e,t,i,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let s=null==r?void 0:r.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${e}" key-system access with config: ${JSON.stringify(n)}`),s=this.requestMediaKeySystemAccess(e,n);const t=this.keySystemAccessPromises[e]={keySystemAccess:s};return s.catch((t=>{this.log(`Failed to obtain access to key-system "${e}": ${t}`)})),s.then((i=>{this.log(`Access for key-system "${i.keySystem}" obtained`);const n=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),t.mediaKeys=i.createMediaKeys().then((t=>(this.log(`Media-keys created for "${e}"`),n.then((i=>i?this.setMediaKeysServerCertificate(t,e,i):t))))),t.mediaKeys.catch((t=>{this.error(`Failed to create media-keys for "${e}"}: ${t}`)})),t.mediaKeys}))}return s.then((()=>r.mediaKeys))}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:i}){this.log(`Creating key-system session "${t}" keyId: ${Ct(e.keyId||[])}`);const n=i.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:n,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),n=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[n]=this.generateRequestWithPreferredKeySession(i,r,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return Ct(e.keyId)}updateKeySession(e,t){var i;const n=e.mediaKeysSession;return this.log(`Updating key-session "${n.sessionId}" for keyID ${Ct((null==(i=e.decryptdata)?void 0:i.keyId)||[])}\n } (data length: ${t?t.byteLength:t})`),n.update(t)}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){return new Promise(((t,i)=>{const n=ut(this.config),r=e.map(ot).filter((e=>!!e&&-1!==n.indexOf(e)));return this.getKeySystemSelectionPromise(r).then((({keySystem:e})=>{const n=ct(e);n?t(n):i(new Error(`Unable to find format for key-system "${e}"`))})).catch(i)}))}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),n=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${n}`);let r=this.keyIdToKeySessionPromise[i];return r||(r=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(t).then((({keySystem:i,mediaKeys:r})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${n}`),this.attemptSetMediaKeys(i,r).then((()=>{this.throwIfDestroyed();const e=this.createMediaKeySessionContext({keySystem:i,mediaKeys:r,decryptdata:t});return this.generateRequestWithPreferredKeySession(e,"cenc",t.pssh,"playlist-key")}))))),r.catch((e=>this.handleError(e)))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof sa?this.hls.trigger(_e.ERROR,e.data):this.hls.trigger(_e.ERROR,{type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){const t=ot(e.keyFormat),i=t?[t]:ut(this.config);return this.attemptKeySystemAccess(i)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=ut(this.config)),0===e.length)throw new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}_onMediaEncrypted(e){const{initDataType:t,initData:i}=e;if(this.debug(`"${e.type}" event: init data type: "${t}"`),null===i)return;let n,r;if("sinf"===t&&this.config.drmSystems[it.FAIRPLAY]){const e=xt(new Uint8Array(i));try{const t=et(JSON.parse(e).sinf),i=Yt(new Uint8Array(t));if(!i)return;n=i.subarray(8,24),r=it.FAIRPLAY}catch(e){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{const e=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;const t={version:0,systemId:"",kids:null,data:null},i=new DataView(e),n=i.getUint32(0);if(e.byteLength!==n&&n>44)return null;if(1886614376!==i.getUint32(4))return null;if(t.version=i.getUint32(8)>>>24,t.version>1)return null;t.systemId=Ct(new Uint8Array(e,12,16));const r=i.getUint32(28);if(0===t.version){if(n-32<r)return null;t.data=new Uint8Array(e,32,r)}else if(1===t.version){t.kids=[];for(let i=0;i<r;i++)t.kids.push(new Uint8Array(e,32+16*i,16))}return t}(i);if(null===e)return;0===e.version&&e.systemId===lt&&e.data&&(n=e.data.subarray(8,24)),r=function(e){if(e===lt)return it.WIDEVINE}(e.systemId)}if(!r||!n)return;const s=Ct(n),{keyIdToKeySessionPromise:a,mediaKeySessions:o}=this;let l=a[s];for(let e=0;e<o.length;e++){const r=o[e],c=r.decryptdata;if(c.pssh||!c.keyId)continue;const u=Ct(c.keyId);if(s===u||-1!==c.uri.replace(/-/g,"").indexOf(s)){l=a[u],delete a[u],c.pssh=new Uint8Array(i),c.keyId=n,l=a[s]=l.then((()=>this.generateRequestWithPreferredKeySession(r,t,i,"encrypted-event-key-match")));break}}l||(l=a[s]=this.getKeySystemSelectionPromise([r]).then((({keySystem:e,mediaKeys:r})=>{var a;this.throwIfDestroyed();const o=new Zt("ISO-23001-7",s,null!=(a=ct(e))?a:"");return o.pssh=new Uint8Array(i),o.keyId=n,this.attemptSetMediaKeys(e,r).then((()=>{this.throwIfDestroyed();const n=this.createMediaKeySessionContext({decryptdata:o,keySystem:e,mediaKeys:r});return this.generateRequestWithPreferredKeySession(n,t,i,"encrypted-event-no-match")}))}))),l.catch((e=>this.handleError(e)))}_onWaitingForKey(e){this.log(`"${e.type}" event`)}attemptSetMediaKeys(e,t){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const n=Promise.all(i).then((()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(n),n.then((()=>{this.log(`Media-keys set for "${e}"`),i.push(n),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((e=>-1===i.indexOf(e)))}))}generateRequestWithPreferredKeySession(e,t,i,n){var r,s;const a=null==(r=this.config.drmSystems)||null==(s=r[e.keySystem])?void 0:s.generateRequest;if(a)try{const n=a.call(this.hls,t,i,e);if(!n)throw new Error("Invalid response from configured generateRequest filter");t=n.initDataType,i=e.decryptdata.pssh=n.initData?new Uint8Array(n.initData):null}catch(e){var o;if(this.warn(e.message),null!=(o=this.hls)&&o.config.debug)throw e}if(null===i)return this.log(`Skipping key-session request for "${n}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${n}": ${l} (init data type: ${t} length: ${i?i.byteLength:null})`);const c=new Zr;e.mediaKeysSession.onmessage=t=>{const i=e.mediaKeysSession;if(!i)return void c.emit("error",new Error("invalid state"));const{messageType:n,message:r}=t;this.log(`"${n}" message event for session "${i.sessionId}" message size: ${r.byteLength}`),"license-request"===n||"license-renewal"===n?this.renewLicense(e,r).catch((e=>{this.handleError(e),c.emit("error",e)})):"license-release"===n?e.keySystem===it.FAIRPLAY&&(this.updateKeySession(e,tt("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${n}"`)},e.mediaKeysSession.onkeystatuseschange=t=>{if(!e.mediaKeysSession)return void c.emit("error",new Error("invalid state"));this.onKeyStatusChange(e);const i=e.keyStatus;c.emit("keyStatus",i),"expired"===i&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};const u=new Promise(((e,t)=>{c.on("error",t),c.on("keyStatus",(i=>{i.startsWith("usable")?e():"output-restricted"===i?t(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===i?t(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${i}"`)):"expired"===i?t(new Error("key expired while generating request")):this.warn(`unhandled key status change "${i}"`)}))}));return e.mediaKeysSession.generateRequest(t,i).then((()=>{var t;this.log(`Request generated for key-session "${null==(t=e.mediaKeysSession)?void 0:t.sessionId}" keyId: ${l}`)})).catch((e=>{throw new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},`Error generating key-session request: ${e}`)})).then((()=>u)).catch((t=>{throw c.removeAllListeners(),this.removeSession(e),t})).then((()=>(c.removeAllListeners(),e)))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach(((t,i)=>{this.log(`key status change "${t}" for keyStatuses keyId: ${Ct("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Ct(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t}))}fetchServerCertificate(e){const t=this.config,i=new(0,t.loader)(t),n=this.getServerCertificateUrl(e);return n?(this.log(`Fetching serverCertificate for "${e}"`),new Promise(((r,s)=>{const a={responseType:"arraybuffer",url:n},o=t.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,t,i,n)=>{r(e.data)},onError:(t,i,r,o)=>{s(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:De({url:a.url,data:void 0},t)},`"${e}" certificate request failed (${n}). Status: ${t.code} (${t.text})`))},onTimeout:(t,i,r)=>{s(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:r,response:{url:a.url,data:void 0}},`"${e}" certificate request timed out (${n})`))},onAbort:(e,t,i)=>{s(new Error("aborted"))}};i.load(a,l,c)}))):Promise.resolve()}setMediaKeysServerCertificate(e,t,i){return new Promise(((n,r)=>{e.setServerCertificate(i).then((r=>{this.log(`setServerCertificate ${r?"success":"not supported by CDM"} (${null==i?void 0:i.byteLength}) on "${t}"`),n(e)})).catch((e=>{r(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then((t=>this.updateKeySession(e,new Uint8Array(t)).catch((e=>{throw new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))))}setupLicenseXHR(e,t,i,n){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then((()=>{if(!i.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,i,n)})).catch((s=>{if(!i.decryptdata)throw s;return e.open("POST",t,!0),r.call(this.hls,e,t,i,n)})).then((i=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:i||n}))):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:n}))}requestLicense(e,t){const i=this.config.keyLoadPolicy.default;return new Promise(((n,r)=>{const s=this.getLicenseServerUrl(e.keySystem);this.log(`Sending license request to URL: ${s}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(4===a.readyState)if(200===a.status){this._requestLicenseFailureCount=0;let t=a.response;this.log(`License received ${t instanceof ArrayBuffer?t.byteLength:t}`);const i=this.config.licenseResponseCallback;if(i)try{t=i.call(this.hls,a,s,e)}catch(e){this.error(e)}n(t)}else{const o=i.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)r(new sa({type:Oe.KEY_SYSTEM_ERROR,details:Pe.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:s,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${s}). Status: ${a.status} (${a.statusText})`));else{const i=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(e,t).then(n,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,s,e,t).then((({xhr:e,licenseChallenge:t})=>{e.send(t)}))}))}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media,t=this.mediaKeySessions;e&&(e.removeEventListener("encrypted",this.onMediaEncrypted),e.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Zt.clearKeyUriToKeyIdMap();const i=t.length;ra.CDMCleanupPromise=Promise.all(t.map((e=>this.removeSession(e))).concat(null==e?void 0:e.setMediaKeys(null).catch((t=>{this.log(`Could not clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)})))).then((()=>{i&&(this.log("finished closing key sessions and clearing media keys"),t.length=0)})).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}. media.src: ${null==e?void 0:e.src}`)}))}onManifestLoaded(e,{sessionKeys:t}){if(t&&this.config.emeEnabled&&!this.keyFormatPromise){const e=t.reduce(((e,t)=>(-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e)),[]);this.log(`Selecting key-system from session-keys ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),t.onmessage=null,t.onkeystatuseschange=null,i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const n=this.mediaKeySessions.indexOf(e);return n>-1&&this.mediaKeySessions.splice(n,1),t.remove().catch((e=>{this.log(`Could not remove session: ${e}`)})).then((()=>t.close())).catch((e=>{this.log(`Could not close session: ${e}`)}))}}}ra.CDMCleanupPromise=void 0;class sa extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}var aa="a",oa="av";class la{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=e=>{try{this.apply(e,{ot:"m",su:!this.initialized})}catch(e){Ue.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=e=>{try{const t=e.frag,i=this.hls.levels[t.level],n=this.getObjectType(t),r={d:1e3*t.duration,ot:n};"v"!==n&&n!==aa&&n!=oa||(r.br=i.bitrate/1e3,r.tb=this.getTopBandwidth(n)/1e3,r.bl=this.getBufferLength(n)),this.apply(e,r)}catch(e){Ue.warn("Could not generate segment CMCD data.",e)}},this.hls=e;const t=this.config=e.config,{cmcd:i}=t;null!=i&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||la.uuid(),this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.registerListeners())}registerListeners(){const e=this.hls;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHED,this.onMediaDetached,this),e.on(_e.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHED,this.onMediaDetached,this),e.off(_e.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var i,n;this.audioBuffer=null==(i=t.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(n=t.tracks.video)?void 0:n.buffer}createData(){var e;return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){je(t,this.createData());const i="i"===t.ot||"v"===t.ot||t.ot===oa;if(this.starved&&i&&(t.bs=!0,t.su=!0,this.starved=!1),null==t.su&&(t.su=this.buffering),this.useHeaders){const i=la.toHeaders(t);if(!Object.keys(i).length)return;e.headers||(e.headers={}),je(e.headers,i)}else{const i=la.toQuery(t);if(!i)return;e.url=la.appendQueryToUri(e.url,i)}}getObjectType(e){const{type:t}=e;return"subtitle"===t?"tt":"initSegment"===e.sn?"i":"audio"===t?aa:"main"===t?this.hls.audioTracks.length?"v":oa:void 0}getTopBandwidth(e){let t,i=0;const n=this.hls;if(e===aa)t=n.audioTracks;else{const e=n.maxAutoLevel,i=e>-1?e+1:n.levels.length;t=n.levels.slice(0,i)}for(const e of t)e.bitrate>i&&(i=e.bitrate);return i>0?i:NaN}getBufferLength(e){const t=this.hls.media,i=e===aa?this.audioBuffer:this.videoBuffer;return i&&t?1e3*In.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len:NaN}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new i(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,i,n){t(e),this.loader.load(e,i,n)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,i=e||this.config.loader;return class{constructor(e){this.loader=void 0,this.loader=new i(e)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(e,i,n){t(e),this.loader.load(e,i,n)}}}static uuid(){const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}static serialize(e){const t=[],i=e=>!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e,n=e=>Math.round(e),r=e=>100*n(e/100),s={br:n,d:n,bl:r,dl:r,mtp:r,nor:e=>encodeURIComponent(e),rtp:r,tb:n},a=Object.keys(e||{}).sort();for(const n of a){let r=e[n];if(!i(r))continue;if("v"===n&&1===r)continue;if("pr"==n&&1===r)continue;const a=s[n];a&&(r=a(r));const o=typeof r;let l;l="ot"===n||"sf"===n||"st"===n?`${n}=${r}`:"boolean"===o?n:"number"===o?`${n}=${r}`:`${n}=${JSON.stringify(r)}`,t.push(l)}return t.join(",")}static toHeaders(e){const t=Object.keys(e),i={},n=["Object","Request","Session","Status"],r=[{},{},{},{}],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};for(const i of t)r[null!=s[i]?s[i]:1][i]=e[i];for(let e=0;e<r.length;e++){const t=la.serialize(r[e]);t&&(i[`CMCD-${n[e]}`]=t)}return i}static toQuery(e){return`CMCD=${encodeURIComponent(la.serialize(e))}`}static appendQueryToUri(e,t){if(!t)return e;const i=e.includes("?")?"&":"?";return`${e}${i}${t}`}}function ca(e,t,i,n){e&&Object.keys(t).forEach((r=>{const s=e.filter((e=>e.groupId===r)).map((e=>{const s=je({},e);return s.details=void 0,s.attrs=new $e(s.attrs),s.url=s.attrs.URI=ua(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),s.groupId=s.attrs["GROUP-ID"]=t[r],s.attrs["PATHWAY-ID"]=n,s}));e.push(...s)}))}function ua(e,t,i,n){const{HOST:r,PARAMS:s,[i]:a}=n;let o;t&&(o=null==a?void 0:a[t],o&&(e=o));const l=new self.URL(e);return r&&!o&&(l.host=r),s&&Object.keys(s).sort().forEach((e=>{e&&l.searchParams.set(e,s[e])})),l.href}const da=/^age:\s*[\d.]+\s*$/im;class ha{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new He,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e)return;const i=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;const r=this.xhrSetup;r?Promise.resolve().then((()=>{if(!this.stats.aborted)return r(i,t.url)})).catch((e=>(i.open("GET",t.url,!0),r(i,t.url)))).then((()=>{this.stats.aborted||this.openAndSendXhr(i,t,e)})).catch((e=>{this.callbacks.onError({code:i.status,text:e.message},t,i,n)})):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const n=this.context.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:s}=i.loadPolicy;if(n)for(const t in n)e.setRequestHeader(t,n[t]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=r&&xe(r)?r:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const n=t.readyState,r=this.config;if(!i.aborted&&n>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===n)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const n=t.status,s="text"!==t.responseType;if(n>=200&&n<300&&(s&&t.response||null!==t.responseText)){i.loading.end=Math.max(self.performance.now(),i.loading.first);const r=s?t.response:t.responseText,a="arraybuffer"===t.responseType?r.byteLength:r.length;if(i.loaded=i.total=a,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first),!this.callbacks)return;const o=this.callbacks.onProgress;if(o&&o(i,e,r,t),!this.callbacks)return;const l={url:t.responseURL,data:r,code:n};this.callbacks.onSuccess(l,i,e,t)}else{const s=r.loadPolicy.errorRetry;Ki(s,i.retry,!1,n)?this.retry(s):(Ue.error(`${n} while loading ${e.url}`),this.callbacks.onError({code:n,text:t.statusText},e,t,i))}}}loadtimeout(){var e;const t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(Ki(t,this.stats.retry,!0))this.retry(t);else{Ue.warn(`timeout while loading ${this.context.url}`);const e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=Zi(e,i.retry),i.retry++,Ue.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&da.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const pa=/(\d+)-(\d+)\/(\d+)/;class fa{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||ga,this.controller=new self.AbortController,this.stats=new He}destroy(){this.loader=this.callbacks=null,this.abortInternal()}abortInternal(){const e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,i){const n=this.stats;if(n.loading.start)throw new Error("Loader can only be used once.");n.loading.start=self.performance.now();const r=function(e,t){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(je({},e.headers))};return e.rangeEnd&&i.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),i}(e,this.controller.signal),s=i.onProgress,a="arraybuffer"===e.responseType,o=a?"byteLength":"length",{maxTimeToFirstByteMs:l,maxLoadTimeMs:c}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=l&&xe(l)?l:c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(n,e,this.response)}),t.timeout),self.fetch(this.request).then((r=>{this.response=this.loader=r;const o=Math.max(self.performance.now(),n.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=c,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(n,e,this.response)}),c-(o-n.loading.start)),!r.ok){const{status:e,statusText:t}=r;throw new ya(t||"fetch, bad network response",e,r)}return n.loading.first=o,n.total=function(e){const t=e.get("Content-Range");if(t){const e=function(e){const t=pa.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(xe(e))return e}const i=e.get("Content-Length");if(i)return parseInt(i)}(r.headers)||n.total,s&&xe(t.highWaterMark)?this.loadProgressively(r,n,e,t.highWaterMark,s):a?r.arrayBuffer():"json"===e.responseType?r.json():r.text()})).then((r=>{const{response:a}=this;self.clearTimeout(this.requestTimeout),n.loading.end=Math.max(self.performance.now(),n.loading.first);const l=r[o];l&&(n.loaded=n.total=l);const c={url:a.url,data:r,code:a.status};s&&!xe(t.highWaterMark)&&s(n,e,r,a),i.onSuccess(c,n,e,a)})).catch((t=>{if(self.clearTimeout(this.requestTimeout),n.aborted)return;const r=t&&t.code||0,s=t?t.message:null;i.onError({code:r,text:s},e,t?t.details:null,n)}))}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,i,n=0,r){const s=new is,a=e.body.getReader(),o=()=>a.read().then((a=>{if(a.done)return s.dataLength&&r(t,i,s.flush(),e),Promise.resolve(new ArrayBuffer(0));const l=a.value,c=l.length;return t.loaded+=c,c<n||s.dataLength?(s.push(l),s.dataLength>=n&&r(t,i,s.flush(),e)):r(t,i,l,e),o()})).catch((()=>Promise.reject()));return o()}}function ga(e,t){return new self.Request(e.url,t)}class ya extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const ma=/\s/,va={newCue(e,t,i,n){const r=[];let s,a,o,l,c;const u=self.VTTCue||self.TextTrackCue;for(let h=0;h<n.rows.length;h++)if(s=n.rows[h],o=!0,l=0,c="",!s.isEmpty()){var d;for(let e=0;e<s.chars.length;e++)ma.test(s.chars[e].uchar)&&o?l++:(c+=s.chars[e].uchar,o=!1);s.cueStartTime=t,t===i&&(i+=1e-4),l>=16?l--:l++;const n=zs(c.trim()),p=$s(t,i,n);null!=e&&null!=(d=e.cues)&&d.getCueById(p)||(a=new u(t,i,n),a.id=p,a.line=h+1,a.align="left",a.position=10+Math.min(80,10*Math.floor(8*l/32)),r.push(a))}return e&&r.length&&(r.sort(((e,t)=>"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line)),r.forEach((t=>Ai(e,t)))),r}},Ma=De(De({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:ha,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class{constructor(e){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=e;const t=e.config;this.bwEstimator=new ts(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(_e.FRAG_LOADING,this.onFragLoading,this),e.on(_e.FRAG_LOADED,this.onFragLoaded,this),e.on(_e.FRAG_BUFFERED,this.onFragBuffered,this),e.on(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_e.LEVEL_LOADED,this.onLevelLoaded,this)}unregisterListeners(){const{hls:e}=this;e.off(_e.FRAG_LOADING,this.onFragLoading,this),e.off(_e.FRAG_LOADED,this.onFragLoaded,this),e.off(_e.FRAG_BUFFERED,this.onFragBuffered,this),e.off(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_e.LEVEL_LOADED,this.onLevelLoaded,this)}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}onFragLoading(e,t){var i;const n=t.frag;this.ignoreFragment(n)||(this.fragCurrent=n,this.partCurrent=null!=(i=t.part)?i:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}onLevelSwitching(e,t){this.clearTimer()}getTimeToLoadFrag(e,t,i,n){return e+i/t+(n?this.lastLevelLoadSec:0)}onLevelLoaded(e,t){const i=this.hls.config,{total:n,bwEstimate:r}=t.stats;xe(n)&&xe(r)&&(this.lastLevelLoadSec=8*n/r),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}_abandonRulesCheck(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{autoLevelEnabled:n,media:r}=i;if(!e||!r)return;const s=performance.now(),a=t?t.stats:e.stats,o=t?t.duration:e.duration,l=s-a.loading.start;if(a.aborted||a.loaded&&a.loaded===a.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!n||r.paused||!r.playbackRate||!r.readyState)return;const c=i.mainForwardBufferInfo;if(null===c)return;const u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(r.playbackRate);if(l<=Math.max(u,o/(2*d)*1e3))return;const h=c.len/d;if(h>=2*o/d)return;const p=a.loading.first?a.loading.first-a.loading.start:-1,f=a.loaded&&p>-1,g=this.bwEstimator.getEstimate(),{levels:y,minAutoLevel:m}=i,v=y[e.level],M=a.total||Math.max(a.loaded,Math.round(o*v.maxBitrate/8));let T=l-p;T<1&&f&&(T=Math.min(l,8*a.loaded/g));const L=f?1e3*a.loaded/T:0,b=L?(M-a.loaded)/L:8*M/g+u/1e3;if(b<=h)return;const E=L?8*L:g;let I,N=Number.POSITIVE_INFINITY;for(I=e.level-1;I>m;I--){const e=y[I].maxBitrate;if(N=this.getTimeToLoadFrag(u/1e3,E,o*e,!y[I].details),N<h)break}N>=b||N>10*o||(i.nextLoadLevel=I,f?this.bwEstimator.sample(l-Math.min(u,p),a.loaded):this.bwEstimator.sampleTTFB(l),this.clearTimer(),Ue.warn(`[abr] Fragment ${e.sn}${t?" part "+t.index:""} of level ${e.level} is loading too slowly;\n Time to underbuffer: ${h.toFixed(3)} s\n Estimated load time for current fragment: ${b.toFixed(3)} s\n Estimated load time for down switch fragment: ${N.toFixed(3)} s\n TTFB estimate: ${p}\n Current BW estimate: ${xe(g)?(g/1024).toFixed(3):"Unknown"} Kb/s\n New BW estimate: ${(this.bwEstimator.getEstimate()/1024).toFixed(3)} Kb/s\n Aborting and switching to level ${I}`),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),i.trigger(_e.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:a}))}onFragLoaded(e,{frag:t,part:i}){const n=i?i.stats:t.stats;if(t.type===Li&&this.bwEstimator.sampleTTFB(n.loading.first-n.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){const e=i?i.duration:t.duration,r=this.hls.levels[t.level],s=(r.loaded?r.loaded.bytes:0)+n.loaded,a=(r.loaded?r.loaded.duration:0)+e;r.loaded={bytes:s,duration:a},r.realBitrate=Math.round(8*s/a)}if(t.bitrateTest){const e={stats:n,frag:t,part:i,id:t.type};this.onFragBuffered(_e.FRAG_BUFFERED,e),t.bitrateTest=!1}}}onFragBuffered(e,t){const{frag:i,part:n}=t,r=null!=n&&n.stats.loaded?n.stats:i.stats;if(r.aborted)return;if(this.ignoreFragment(i))return;const s=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,r.loaded),r.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Li||"initSegment"===e.sn}clearTimer(){self.clearInterval(this.timer)}get nextAutoLevel(){const e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;let i=this.getNextABRAutoLevel();if(-1!==e){const t=this.hls.levels;if(t.length>Math.max(e,i)&&t[e].loadError<=t[i].loadError)return e}return-1!==e&&(i=Math.min(e,i)),i}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:i}=this,{maxAutoLevel:n,config:r,minAutoLevel:s,media:a}=i,o=t?t.duration:e?e.duration:0,l=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,c=this.bwEstimator?this.bwEstimator.getEstimate():r.abrEwmaDefaultEstimate,u=i.mainForwardBufferInfo,d=(u?u.len:0)/l;let h=this.findBestLevel(c,s,n,d,r.abrBandWidthFactor,r.abrBandWidthUpFactor);if(h>=0)return h;Ue.trace(`[abr] ${d?"rebuffering expected":"buffer is empty"}, finding optimal quality level`);let p=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay,f=r.abrBandWidthFactor,g=r.abrBandWidthUpFactor;if(!d){const e=this.bitrateTestDelay;e&&(p=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-e,Ue.trace(`[abr] bitrate test took ${Math.round(1e3*e)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),f=g=1)}return h=this.findBestLevel(c,s,n,d+p,f,g),Math.max(h,0)}findBestLevel(e,t,i,n,r,s){var a;const{fragCurrent:o,partCurrent:l,lastLoadedFragLevel:c}=this,{levels:u}=this.hls,d=u[c],h=!(null==d||null==(a=d.details)||!a.live),p=null==d?void 0:d.codecSet,f=l?l.duration:o?o.duration:0,g=this.bwEstimator.getEstimateTTFB()/1e3;let y=t,m=-1;for(let a=i;a>=t;a--){const t=u[a];if(!t||p&&t.codecSet!==p){t&&(y=Math.min(a,y),m=Math.max(a,m));continue}-1!==m&&Ue.trace(`[abr] Skipped level(s) ${y}-${m} with CODECS:"${u[m].attrs.CODECS}"; not compatible with "${d.attrs.CODECS}"`);const i=t.details,o=(l?null==i?void 0:i.partTarget:null==i?void 0:i.averagetargetduration)||f;let v;v=a<=c?r*e:s*e;const M=u[a].maxBitrate,T=this.getTimeToLoadFrag(g,v,M*o,void 0===i);if(Ue.trace(`[abr] level:${a} adjustedbw-bitrate:${Math.round(v-M)} avgDuration:${o.toFixed(1)} maxFetchDuration:${n.toFixed(1)} fetchDuration:${T.toFixed(1)}`),v>M&&(0===T||!xe(T)||h&&!this.bitrateTestDelay||T<n))return a}return-1}set nextAutoLevel(e){this._nextAutoLevel=e}},bufferController:class{constructor(e){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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=()=>{const{media:e,mediaSource:t}=this;Ue.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(_e.MEDIA_ATTACHED,{media:e})),t&&t.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{Ue.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=()=>{Ue.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=()=>{const{media:e,_objectUrl:t}=this;e&&e.src!==t&&Ue.error(`Media element src was set while attaching MediaSource (${t} > ${e.src})`)},this.hls=e,this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.BUFFER_RESET,this.onBufferReset,this),e.on(_e.BUFFER_APPENDING,this.onBufferAppending,this),e.on(_e.BUFFER_CODECS,this.onBufferCodecs,this),e.on(_e.BUFFER_EOS,this.onBufferEos,this),e.on(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_e.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(_e.FRAG_PARSED,this.onFragParsed,this),e.on(_e.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.BUFFER_RESET,this.onBufferReset,this),e.off(_e.BUFFER_APPENDING,this.onBufferAppending,this),e.off(_e.BUFFER_CODECS,this.onBufferCodecs,this),e.off(_e.BUFFER_EOS,this.onBufferEos,this),e.off(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_e.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(_e.FRAG_PARSED,this.onFragParsed,this),e.off(_e.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new os(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}onManifestParsed(e,t){let i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,Ue.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(e,t){const i=this.media=t.media;if(i&&ls){const e=this.mediaSource=new ls;e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(e),this._objectUrl=i.src,i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:e,mediaSource:t,_objectUrl:i}=this;if(t){if(Ue.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){Ue.warn(`[buffer-controller]: onMediaDetaching: ${e.message} while calling endOfStream`)}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):Ue.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(_e.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];try{t&&(this.removeBufferListeners(e),this.mediaSource&&this.mediaSource.removeSourceBuffer(t),this.sourceBuffer[e]=void 0)}catch(t){Ue.warn(`[buffer-controller]: Failed to reset the ${e} buffer`,t)}})),this._initSourceBuffer()}onBufferCodecs(e,t){const i=this.getSourceBufferTypes().length;Object.keys(t).forEach((e=>{if(i){const i=this.tracks[e];if(i&&"function"==typeof i.buffer.changeType){const{id:n,codec:r,levelCodec:s,container:a,metadata:o}=t[e],l=(i.levelCodec||i.codec).replace(cs,"$1"),c=(s||r).replace(cs,"$1");if(l!==c){const t=`${a};codecs=${s||r}`;this.appendChangeType(e,t),Ue.log(`[buffer-controller]: switching codec ${l} to ${c}`),this.tracks[e]={buffer:i.buffer,codec:r,container:a,levelCodec:s,metadata:o,id:n}}}}else this.pendingTracks[e]=t[e]})),i||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}appendChangeType(e,t){const{operationQueue:i}=this,n={execute:()=>{const n=this.sourceBuffer[e];n&&(Ue.log(`[buffer-controller]: changing ${e} sourceBuffer type to ${t}`),n.changeType(t)),i.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:t=>{Ue.warn(`[buffer-controller]: Failed to change ${e} SourceBuffer type`,t)}};i.append(n,e)}onBufferAppending(e,t){const{hls:i,operationQueue:n,tracks:r}=this,{data:s,type:a,frag:o,part:l,chunkMeta:c}=t,u=c.buffering[a],d=self.performance.now();u.start=d;const h=o.stats.buffering,p=l?l.stats.buffering:null;0===h.start&&(h.start=d),p&&0===p.start&&(p.start=d);const f=r.audio;let g=!1;"audio"===a&&"audio/mpeg"===(null==f?void 0:f.container)&&(g=!this.lastMpegAudioChunk||1===c.id||this.lastMpegAudioChunk.sn!==c.sn,this.lastMpegAudioChunk=c);const y=o.start,m={execute:()=>{if(u.executeStart=self.performance.now(),g){const e=this.sourceBuffer[a];if(e){const t=y-e.timestampOffset;Math.abs(t)>=.1&&(Ue.log(`[buffer-controller]: Updating audio SourceBuffer timestampOffset to ${y} (delta: ${t}) sn: ${o.sn})`),e.timestampOffset=y)}}this.appendExecutor(s,a)},onStart:()=>{},onComplete:()=>{const e=self.performance.now();u.executeEnd=u.end=e,0===h.first&&(h.first=e),p&&0===p.first&&(p.first=e);const{sourceBuffer:t}=this,i={};for(const e in t)i[e]=In.getBuffered(t[e]);this.appendError=0,this.hls.trigger(_e.BUFFER_APPENDED,{type:a,frag:o,part:l,chunkMeta:c,parent:o.type,timeRanges:i})},onError:e=>{Ue.error(`[buffer-controller]: Error encountered while trying to append to the ${a} SourceBuffer`,e);const t={type:Oe.MEDIA_ERROR,parent:o.type,details:Pe.BUFFER_APPEND_ERROR,frag:o,part:l,chunkMeta:c,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=Pe.BUFFER_FULL_ERROR:(this.appendError++,t.details=Pe.BUFFER_APPEND_ERROR,this.appendError>i.config.appendErrorMaxRetry&&(Ue.error(`[buffer-controller]: Failed ${i.config.appendErrorMaxRetry} times to append segment in sourceBuffer`),t.fatal=!0)),i.trigger(_e.ERROR,t)}};n.append(m,a)}onBufferFlushing(e,t){const{operationQueue:i}=this,n=e=>({execute:this.removeExecutor.bind(this,e,t.startOffset,t.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(_e.BUFFER_FLUSHED,{type:e})},onError:t=>{Ue.warn(`[buffer-controller]: Failed to remove from ${e} SourceBuffer`,t)}});t.type?i.append(n(t.type),t.type):this.getSourceBufferTypes().forEach((e=>{i.append(n(e),e)}))}onFragParsed(e,t){const{frag:i,part:n}=t,r=[],s=n?n.elementaryStreams:i.elementaryStreams;s.audiovideo?r.push("audiovideo"):(s.audio&&r.push("audio"),s.video&&r.push("video")),0===r.length&&Ue.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers((()=>{const e=self.performance.now();i.stats.buffering.end=e,n&&(n.stats.buffering.end=e);const t=n?n.stats:i.stats;this.hls.trigger(_e.FRAG_BUFFERED,{frag:i,part:n,stats:t,id:i.type})}),r)}onFragChanged(e,t){this.flushBackBuffer()}onBufferEos(e,t){const i=this.getSourceBufferTypes().reduce(((e,i)=>{const n=this.sourceBuffer[i];return!n||t.type&&t.type!==i||(n.ending=!0,n.ended||(n.ended=!0,Ue.log(`[buffer-controller]: ${i} sourceBuffer now EOS`))),e&&!(n&&!n.ended)}),!0);i&&(Ue.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((e=>{const t=this.sourceBuffer[e];t&&(t.ending=!1)}));const{mediaSource:e}=this;e&&"open"===e.readyState?(Ue.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&Ue.info(`[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ${e.readyState}`)})))}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}flushBackBuffer(){const{hls:e,details:t,media:i,sourceBuffer:n}=this;if(!i||null===t)return;const r=this.getSourceBufferTypes();if(!r.length)return;const s=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(!xe(s)||s<0)return;const a=i.currentTime,o=t.levelTargetDuration,l=Math.max(s,o),c=Math.floor(a/o)*o-l;r.forEach((i=>{const r=n[i];if(r){const n=In.getBuffered(r);if(n.length>0&&c>n.start(0)){if(e.trigger(_e.BACK_BUFFER_REACHED,{bufferEnd:c}),t.live)e.trigger(_e.LIVE_BACK_BUFFER_REACHED,{bufferEnd:c});else if(r.ended&&n.end(n.length-1)-a<2*o)return void Ue.info(`[buffer-controller]: Cannot flush ${i} back buffer while SourceBuffer is in ended state`);e.trigger(_e.BUFFER_FLUSHING,{startOffset:0,endOffset:c,type:i})}}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:e,hls:t,media:i,mediaSource:n}=this,r=e.fragments[0].start+e.totalduration,s=i.duration,a=xe(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(Ue.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(r>a&&r>s||!xe(s))&&(Ue.log(`[buffer-controller]: Updating Media Source duration to ${r.toFixed(3)}`),n.duration=r)}updateSeekableRange(e){const t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&null!=t&&t.setLiveSeekableRange){const n=Math.max(0,i[0].start),r=Math.max(n,n+e.totalduration);t.setLiveSeekableRange(n,r)}}checkPendingTracks(){const{bufferCodecEventsExpected:e,operationQueue:t,pendingTracks:i}=this,n=Object.keys(i).length;if(n&&!e||2===n){this.createSourceBuffers(i),this.pendingTracks={};const e=this.getSourceBufferTypes();if(e.length)this.hls.trigger(_e.BUFFER_CREATED,{tracks:this.tracks}),e.forEach((e=>{t.executeNext(e)}));else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}}createSourceBuffers(e){const{sourceBuffer:t,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const n in e)if(!t[n]){const r=e[n];if(!r)throw Error(`source buffer exists for track ${n}, however track does not`);const s=r.levelCodec||r.codec,a=`${r.container};codecs=${s}`;Ue.log(`[buffer-controller]: creating sourceBuffer(${a})`);try{const e=t[n]=i.addSourceBuffer(a),o=n;this.addBufferListener(o,"updatestart",this._onSBUpdateStart),this.addBufferListener(o,"updateend",this._onSBUpdateEnd),this.addBufferListener(o,"error",this._onSBUpdateError),this.tracks[n]={buffer:e,codec:s,container:r.container,levelCodec:r.levelCodec,metadata:r.metadata,id:r.id}}catch(e){Ue.error(`[buffer-controller]: error while trying to add sourceBuffer: ${e.message}`),this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:a})}}}_onSBUpdateStart(e){const{operationQueue:t}=this;t.current(e).onStart()}_onSBUpdateEnd(e){const{operationQueue:t}=this;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}_onSBUpdateError(e,t){const i=new Error(`${e} SourceBuffer error`);Ue.error(`[buffer-controller]: ${i}`,t),this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.BUFFER_APPENDING_ERROR,error:i,fatal:!1});const n=this.operationQueue.current(e);n&&n.onError(t)}removeExecutor(e,t,i){const{media:n,mediaSource:r,operationQueue:s,sourceBuffer:a}=this,o=a[e];if(!n||!r||!o)return Ue.warn(`[buffer-controller]: Attempting to remove from the ${e} SourceBuffer, but it does not exist`),void s.shiftAndExecuteNext(e);const l=xe(n.duration)?n.duration:1/0,c=xe(r.duration)?r.duration:1/0,u=Math.max(0,t),d=Math.min(i,l,c);d>u&&!o.ending?(o.ended=!1,Ue.log(`[buffer-controller]: Removing [${u},${d}] from the ${e} SourceBuffer`),o.remove(u,d)):s.shiftAndExecuteNext(e)}appendExecutor(e,t){const{operationQueue:i,sourceBuffer:n}=this,r=n[t];if(!r)return Ue.warn(`[buffer-controller]: Attempting to append to the ${t} SourceBuffer, but it does not exist`),void i.shiftAndExecuteNext(t);r.ended=!1,r.appendBuffer(e)}blockBuffers(e,t=this.getSourceBufferTypes()){if(!t.length)return Ue.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);const{operationQueue:i}=this,n=t.map((e=>i.appendBlocker(e)));Promise.all(n).then((()=>{e(),t.forEach((e=>{const t=this.sourceBuffer[e];null!=t&&t.updating||i.shiftAndExecuteNext(e)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(e,t,i){const n=this.sourceBuffer[e];if(!n)return;const r=i.bind(this,e);this.listeners[e].push({event:t,listener:r}),n.addEventListener(t,r)}removeBufferListeners(e){const t=this.sourceBuffer[e];t&&this.listeners[e].forEach((e=>{t.removeEventListener(e.event,e.listener)}))}},capLevelController:ia,errorController:class{constructor(e){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=e,this.log=Ue.log.bind(Ue,"[info]:"),this.warn=Ue.warn.bind(Ue,"[warning]:"),this.error=Ue.error.bind(Ue,"[error]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(_e.ERROR,this.onError,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_e.ERROR,this.onError,this),e.off(_e.ERROR,this.onErrorOut,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){this.playlistError=0}stopLoad(){}getVariantLevelIndex(e){return(null==e?void 0:e.type)===Li?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onError(e,t){var i;if(t.fatal)return;const n=this.hls,r=t.context;switch(t.details){case Pe.FRAG_LOAD_ERROR:case Pe.FRAG_LOAD_TIMEOUT:case Pe.KEY_LOAD_ERROR:case Pe.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case Pe.FRAG_GAP:case Pe.FRAG_PARSING_ERROR:case Pe.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=2);case Pe.LEVEL_EMPTY_ERROR:case Pe.LEVEL_PARSING_ERROR:{var s,a;const e=t.parent===Li?t.level:n.loadLevel;t.details===Pe.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(a=s.levelDetails)&&a.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,e):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e))}return;case Pe.LEVEL_LOAD_ERROR:case Pe.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==r?void 0:r.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level)));case Pe.AUDIO_TRACK_LOAD_ERROR:case Pe.AUDIO_TRACK_LOAD_TIMEOUT:case Pe.SUBTITLE_LOAD_ERROR:case Pe.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const e=n.levels[n.loadLevel];if(e&&(r.type===Mi&&r.groupId===e.audioGroupId||r.type===Ti&&r.groupId===e.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.loadLevel),t.errorAction.action=2,void(t.errorAction.flags=1)}return;case Pe.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const e=n.levels[n.loadLevel],i=null==e?void 0:e.attrs["HDCP-LEVEL"];i&&(t.errorAction={action:2,flags:2,hdcpLevel:i})}return;case Pe.BUFFER_ADD_CODEC_ERROR:case Pe.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(i=t.level)?i:n.loadLevel));case Pe.INTERNAL_EXCEPTION:case Pe.BUFFER_APPENDING_ERROR:case Pe.BUFFER_APPEND_ERROR:case Pe.BUFFER_FULL_ERROR:case Pe.LEVEL_SWITCH_ERROR:case Pe.BUFFER_STALLED_ERROR:case Pe.BUFFER_SEEK_OVER_HOLE:case Pe.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:0,flags:0})}if(t.type===Oe.KEY_SYSTEM_ERROR){const e=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,e))}}getPlaylistRetryOrSwitchAction(e,t){var i,n;const r=Wi(this.hls.config.playlistLoadPolicy,e),s=this.playlistError++,a=null==(i=e.response)?void 0:i.code;return Ki(r,s,qi(e),a)?{action:5,flags:0,retryConfig:r,retryCount:s}:null!=(n=e.context)&&n.deliveryDirectives?{action:0,flags:0,retryConfig:r||{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},retryCount:s}:this.getLevelSwitchAction(e,t)}getFragRetryOrSwitchAction(e){const t=this.hls,i=this.getVariantLevelIndex(e.frag),n=t.levels[i],{fragLoadPolicy:r,keyLoadPolicy:s}=t.config,a=Wi(e.details.startsWith("key")?s:r,e),o=t.levels.reduce(((e,t)=>e+t.fragmentError),0);if(n){var l;e.details!==Pe.FRAG_GAP&&n.fragmentError++;const t=null==(l=e.response)?void 0:l.code;if(Ki(a,o,qi(e),t))return{action:5,flags:0,retryConfig:a,retryCount:o}}const c=this.getLevelSwitchAction(e,i);return a&&(c.retryConfig=a,c.retryCount=o),c}getLevelSwitchAction(e,t){const i=this.hls;null==t&&(t=i.loadLevel);const n=this.hls.levels[t];if(n&&(n.loadError++,i.autoLevelEnabled)){var r,s;let t=-1;const a=i.levels,o=null==(r=e.frag)?void 0:r.type,{type:l,groupId:c}=null!=(s=e.context)?s:{};for(let r=a.length;r--;){const s=(r+i.loadLevel)%a.length;if(s!==i.loadLevel&&0===a[s].loadError){const i=a[s];if(e.details===Pe.FRAG_GAP&&e.frag){const t=a[s].details;if(t){const i=Ji(e.frag,t.fragments,e.frag.start);if(null!=i&&i.gap)continue}}else{if(l===Mi&&c===i.audioGroupId||l===Ti&&c===i.textGroupId)continue;if(o===bi&&n.audioGroupId===i.audioGroupId||o===Ei&&n.textGroupId===i.textGroupId)continue}t=s;break}}if(t>-1&&i.loadLevel!==t)return e.levelRetry=!0,{action:2,flags:0,nextAutoLevel:t}}return{action:2,flags:1}}onErrorOut(e,t){var i;switch(null==(i=t.errorAction)?void 0:i.action){case 0:break;case 2:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===Pe.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(e){const t=this.hls,i=e.errorAction;if(!i)return;const{flags:n,hdcpLevel:r,nextAutoLevel:s}=i;switch(n){case 0:this.switchLevel(e,s);break;case 1:i.resolved||(i.resolved=this.redundantFailover(e));break;case 2:r&&(t.maxHdcpLevel=zi[zi.indexOf(r)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`)}i.resolved||this.switchLevel(e,s)}switchLevel(e,t){void 0!==t&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}redundantFailover(e){const{hls:t,penalizedRenditions:i}=this,n=e.parent===Li?e.level:t.loadLevel,r=t.levels[n],s=r.url.length,a=e.frag?e.frag.urlId:r.urlId;r.urlId!==a||e.frag&&!r.details||this.penalizeRendition(r,e);for(let o=1;o<s;o++){const l=(a+o)%s,c=i[l];if(!c||nn(c,e,i[a]))return this.warn(`Switching to Redundant Stream ${l+1}/${s}: "${r.url[l]}" after ${e.details}`),this.playlistError=0,t.levels.forEach((e=>{e.urlId=l})),t.nextLoadLevel=n,!0}return!1}penalizeRendition(e,t){const{penalizedRenditions:i}=this,n=i[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};n.lastErrorPerfMs=performance.now(),n.errors.push(t),n.details=e.details,i[e.urlId]=n}},fpsController:class{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(_e.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(_e.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const i=this.hls.config;if(i.capLevelOnFPSDrop){const e=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=e,e&&"function"==typeof e.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(e,t,i){const n=performance.now();if(t){if(this.lastTime){const e=n-this.lastTime,r=i-this.lastDroppedFrames,s=t-this.lastDecodedFrames,a=1e3*r/e,o=this.hls;if(o.trigger(_e.FPS_DROP,{currentDropped:r,currentDecoded:s,totalDroppedFrames:i}),a>0&&r>o.config.fpsDroppedMonitoringThreshold*s){let e=o.currentLevel;Ue.warn("drop FPS ratio greater than max allowed value for currentLevel: "+e),e>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=e)&&(e-=1,o.trigger(_e.FPS_DROP_LEVEL_CAPPING,{level:e,droppedLevel:o.currentLevel}),o.autoLevelCapping=e,this.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:dt,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:va,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends Hn{constructor(e,t,i){super(e,t,i,"[subtitle-stream-controller]",Ei),this.levels=[],this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null}_registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_e.ERROR,this.onError,this),e.on(_e.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_e.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(_e.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_e.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(_e.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_e.ERROR,this.onError,this),e.off(_e.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_e.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(_e.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_e.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(_e.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(e){this.stopLoad(),this.state=On,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:i,success:n}=t;if(this.fragPrevious=i,this.state=On,!n)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let s;const a=i.start;for(let e=0;e<r.length;e++)if(a>=r[e].start&&a<=r[e].end){s=r[e];break}const o=i.start+i.duration;s?s.end=o:(s={start:a,end:o},r.push(s)),this.fragmentTracker.fragBuffered(i)}onBufferFlushing(e,t){const{startOffset:i,endOffset:n}=t;if(0===i&&n!==Number.POSITIVE_INFINITY){const{currentTrackId:e,levels:r}=this;if(!r.length||!r[e]||!r[e].details)return;const s=n-r[e].details.targetduration;if(s<=0)return;t.endOffsetSubtitles=Math.max(0,s),this.tracksBuffered.forEach((e=>{for(let t=0;t<e.length;)if(e[t].end<=s)e.shift();else{if(!(e[t].start<s))break;e[t].start=s,t++}})),this.fragmentTracker.removeFragmentsInRange(i,s,Ei)}}onFragBuffered(e,t){var i;this.loadedmetadata||t.frag.type!==Li||null!=(i=this.media)&&i.buffered.length&&(this.loadedmetadata=!0)}onError(e,t){const i=t.frag;(null==i?void 0:i.type)===Ei&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==_n&&(this.state=On))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){ns(this.levels,t)?this.levels=t.map((e=>new Ui(e))):(this.tracksBuffered=[],this.levels=t.map((e=>{const t=new Ui(e);return this.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Ei),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(e,t){if(this.currentTrackId=t.id,!this.levels.length||-1===this.currentTrackId)return void this.clearInterval();const i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}onSubtitleTrackLoaded(e,t){var i;const{details:n,id:r}=t,{currentTrackId:s,levels:a}=this;if(!a.length)return;const o=a[s];if(r>=a.length||r!==s||!o)return;this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(n.live||null!=(i=o.details)&&i.live){const e=this.mainDetails;if(n.deltaUpdateFailed||!e)return;const t=e.fragments[0];o.details?(l=this.alignPlaylists(n,o.details),0===l&&t&&(l=t.start,Gi(n,l))):n.hasProgramDateTime&&e.hasProgramDateTime?(Cn(n,e),l=n.fragments[0].start):t&&(l=t.start,Gi(n,l))}o.details=n,this.levelLastLoaded=r,this.startFragRequested||!this.mainDetails&&n.live||this.setStartPosition(o.details,l),this.tick(),n.live&&!this.fragCurrent&&this.media&&this.state===On&&(Ji(null,n.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0))}_handleFragmentLoadComplete(e){const{frag:t,payload:i}=e,n=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){const e=performance.now();this.decrypter.decrypt(new Uint8Array(i),n.key.buffer,n.iv.buffer).catch((e=>{throw r.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((i=>{const n=performance.now();r.trigger(_e.FRAG_DECRYPTED,{frag:t,payload:i,stats:{tstart:e,tdecrypt:n}})})).catch((e=>{this.warn(`${e.name}: ${e.message}`),this.state=On}))}}doTick(){if(this.media){if(this.state===On){const{currentTrackId:e,levels:t}=this,i=t[e];if(!t.length||!i||!i.details)return;const n=i.details,r=n.targetduration,{config:s}=this,a=this.getLoadPosition(),o=In.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a-r,s.maxBufferHole),{end:l,len:c}=o,u=this.getFwdBufferInfo(this.media,Li);if(c>this.getMaxBufferLength(null==u?void 0:u.len)+r)return;const d=n.fragments,h=d.length,p=n.edge;let f=null;const g=this.fragPrevious;if(l<p){const{maxFragLookUpTolerance:e}=s;f=Ji(g,d,Math.max(d[0].start,l),e),!f&&g&&g.start<d[0].start&&(f=d[0])}else f=d[h-1];if(!f)return;f=this.mapToInitFragWhenRequired(f),this.fragmentTracker.getState(f)===cn&&this.loadFragment(f,i,l)}}else this.state=On}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.max(t,e):t}loadFragment(e,t,i){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e,t):(this.startFragRequested=!0,super.loadFragment(e,t,i))}get mediaBufferTimeRanges(){return new ss(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends rn{constructor(e){super(e,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.trackChangeListener=()=>this.onTextTracksChanged(),this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.LEVEL_LOADING,this.onLevelLoading,this),e.on(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_e.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(_e.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.LEVEL_LOADING,this.onLevelLoading,this),e.off(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_e.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(_e.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-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))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}onMediaDetaching(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),as(this.media.textTracks).forEach((e=>{Ci(e)})),this.subtitleTrack=-1,this.media=null)}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:i,details:n}=t,{trackId:r}=this,s=this.tracksInGroup[r];if(!s)return void this.warn(`Invalid subtitle track id ${i}`);const a=s.details;s.details=t.details,this.log(`subtitle track ${i} loaded [${n.startSN}-${n.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.textGroupIds)return;const i=t.textGroupIds[t.urlId],n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==i){const e=this.tracks.filter((e=>!i||e.groupId===i));this.tracksInGroup=e;const t=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=i||null;const r={subtitleTracks:e};this.log(`Updating subtitle tracks, ${e.length} track(s) found in "${i}" group-id`),this.hls.trigger(_e.SUBTITLE_TRACKS_UPDATED,r),-1!==t&&this.setSubtitleTrack(t,n)}else this.shouldReloadPlaylist(n)&&this.setSubtitleTrack(this.trackId,n)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const n=t[i];if((!this.selectDefaultTrack||n.default)&&(!e||e===n.name))return n.id}return-1}onError(e,t){!t.fatal&&t.context&&t.context.type===Ti&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1;const t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,n=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(_e.SUBTITLE_TRACK_LOADING,{url:r,id:i,groupId:n,deliveryDirectives:e||null})}}toggleTrackModes(e){const{media:t,trackId:i}=this;if(!t)return;const n=as(t.textTracks),r=n.filter((e=>e.groupId===this.groupId));if(-1===e)[].slice.call(n).forEach((e=>{e.mode="disabled"}));else{const e=r[i];e&&(e.mode="disabled")}const s=r[e];s&&(s.mode=this.subtitleDisplay?"showing":"hidden")}setSubtitleTrack(e,t){var i;const n=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=e);if(this.trackId!==e&&this.toggleTrackModes(e),this.trackId===e&&(-1===e||null!=(i=n[e])&&i.details)||e<-1||e>=n.length)return;this.clearTimer();const r=n[e];if(this.log(`Switching to subtitle-track ${e}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:"")),this.trackId=e,r){const{id:e,groupId:i="",name:n,type:s,url:a}=r;this.hls.trigger(_e.SUBTITLE_TRACK_SWITCH,{id:e,groupId:i,name:n,type:s,url:a});const o=this.switchParams(r.url,null==t?void 0:t.details);this.loadPlaylist(o)}else this.hls.trigger(_e.SUBTITLE_TRACK_SWITCH,{id:e})}onTextTracksChanged(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let e=-1;const t=as(this.media.textTracks);for(let i=0;i<t.length;i++)if("hidden"===t[i].mode)e=i;else if("showing"===t[i].mode){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},timelineController:class{constructor(e){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){const e=new Cs(this,"textTrack1"),t=new Cs(this,"textTrack2"),i=new Cs(this,"textTrack3"),n=new Cs(this,"textTrack4");this.cea608Parser1=new Ss(1,e,t),this.cea608Parser2=new Ss(3,i,n)}e.on(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_e.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(_e.FRAG_LOADING,this.onFragLoading,this),e.on(_e.FRAG_LOADED,this.onFragLoaded,this),e.on(_e.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(_e.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(_e.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_e.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(_e.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_e.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(_e.FRAG_LOADING,this.onFragLoading,this),e.off(_e.FRAG_LOADED,this.onFragLoaded,this),e.off(_e.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(_e.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(_e.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_e.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(_e.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}addCues(e,t,i,n,r){let s=!1;for(let e=r.length;e--;){const n=r[e],u=(a=n[0],o=n[1],l=t,c=i,Math.min(o,c)-Math.max(a,l));if(u>=0&&(n[0]=Math.min(n[0],t),n[1]=Math.max(n[1],i),s=!0,u/(i-t)>.5))return}var a,o,l,c;if(s||r.push([t,i]),this.config.renderTextTracksNatively){const r=this.captionsTracks[e];this.Cues.newCue(r,t,i,n)}else{const r=this.Cues.newCue(null,t,i,n);this.hls.trigger(_e.CUES_PARSED,{type:"captions",cues:r,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:n,timescale:r}){const{unparsedVttFrags:s}=this;"main"===i&&(this.initPTS[t.cc]={baseTime:n,timescale:r}),s.length&&(this.unparsedVttFrags=[],s.forEach((e=>{this.onFragLoaded(_e.FRAG_LOADED,e)})))}getExistingTrack(e){const{media:t}=this;if(t)for(let i=0;i<t.textTracks.length;i++){const n=t.textTracks[i];if(n[e])return n}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:i,media:n}=this,{label:r,languageCode:s}=t[e],a=this.getExistingTrack(e);if(a)i[e]=a,Ci(i[e]),wi(i[e],n);else{const t=this.createTextTrack("captions",r,s);t&&(t[e]=!0,i[e]=t)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(_e.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(e,t,i){const n=this.media;if(n)return n.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:e}=this;Object.keys(e).forEach((t=>{Ci(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let e=0;e<t.length;e++)Ci(t[e])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],n=i.some((e=>e.textCodec===Gs));if(this.config.enableWebVTT||n&&this.config.enableIMSC1){if(ns(this.tracks,i))return void(this.tracks=i);if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const e=this.media?this.media.textTracks:null;this.tracks.forEach(((t,i)=>{let n;if(e&&i<e.length){let i=null;for(let n=0;n<e.length;n++)if(ta(e[n],t)){i=e[n];break}i&&(n=i)}if(n)Ci(n);else{const e=this._captionsOrSubtitlesFromCharacteristics(t);n=this.createTextTrack(e,t.name,t.lang),n&&(n.mode="disabled")}n&&(n.groupId=t.groupId,this.textTracks.push(n))}))}else if(this.tracks.length){const e=this.tracks.map((e=>({label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e})));this.hls.trigger(_e.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:e})}}}_captionsOrSubtitlesFromCharacteristics(e){if(e.attrs.CHARACTERISTICS){const t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),i=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&i)return"captions"}return"subtitles"}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((e=>{const t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(!t)return;const i=`textTrack${t[1]}`,n=this.captionsProperties[i];n&&(n.label=e.name,e.lang&&(n.languageCode=e.lang),n.media=e)}))}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){const{cea608Parser1:i,cea608Parser2:n,lastSn:r,lastPartIndex:s}=this;if(this.enabled&&i&&n&&t.frag.type===Li){var a,o;const e=t.frag.sn,l=null!=(a=null==t||null==(o=t.part)?void 0:o.index)?a:-1;e===r+1||e===r&&l===s+1||(i.reset(),n.reset()),this.lastSn=e,this.lastPartIndex=l}}onFragLoaded(e,t){const{frag:i,payload:n}=t,{initPTS:r,unparsedVttFrags:s}=this;if(i.type===Ei)if(n.byteLength){if(!r[i.cc])return s.push(t),void(r.length&&this.hls.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Missing initial subtitle PTS")}));const e=i.decryptdata,a="stats"in t;if(null==e||!e.encrypted||a){const e=this.tracks[i.level],t=this.vttCCs;t[i.cc]||(t[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),e&&e.textCodec===Gs?this._parseIMSC1(i,n):this._parseVTTs(i,n,t)}}else this.hls.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;Ws(t,this.initPTS[e.cc],(t=>{this._appendCues(t,e.level),i.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(t=>{Ue.log(`Failed to parse IMSC1: ${t}`),i.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}_parseVTTs(e,t,i){var n;const r=this.hls;!function(e,t,i,n,r,s,a){const o=new Fs,l=St(new Uint8Array(e)).trim().replace(Us,"\n").split("\n"),c=[],u=function(e,t=1){return Dr(e,9e4,1/t)}(t.baseTime,t.timescale);let d,h="00:00.000",p=0,f=0,g=!0;o.oncue=function(e){const t=i[n];let s=i.ccOffset;const a=(p-u)/9e4;null!=t&&t.new&&(void 0!==f?s=i.ccOffset=t.start:function(e,t,i){let n=e[t],r=e[n.prevCC];if(!r||!r.new&&n.new)return e.ccOffset=e.presentationOffset=n.start,void(n.new=!1);for(;null!=(s=r)&&s.new;){var s;e.ccOffset+=n.start-r.start,n.new=!1,n=r,r=e[n.prevCC]}e.presentationOffset=i}(i,n,a)),a&&(s=a-i.presentationOffset);const o=e.endTime-e.startTime,l=Pr(9e4*(e.startTime+s-f),9e4*r)/9e4;e.startTime=Math.max(l,0),e.endTime=Math.max(l+o,0);const d=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(d)),e.id||(e.id=$s(e.startTime,e.endTime,d)),e.endTime>0&&c.push(e)},o.onparsingerror=function(e){d=e},o.onflush=function(){d?a(d):s(c)},l.forEach((e=>{if(g){if(Ys(e,"X-TIMESTAMP-MAP=")){g=!1,e.slice(16).split(",").forEach((e=>{Ys(e,"LOCAL:")?h=e.slice(6):Ys(e,"MPEGTS:")&&(p=parseInt(e.slice(7)))}));try{f=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),n=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(xe(t)&&xe(i)&&xe(n)&&xe(r)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=6e4*n,t+=36e5*r,t}(h)/1e3}catch(e){d=e}return}""===e&&(g=!1)}o.parse(e+"\n")})),o.flush()}(null!=(n=e.initSegment)&&n.data?$t(e.initSegment.data,new Uint8Array(t)):t,this.initPTS[e.cc],i,e.cc,e.start,(t=>{this._appendCues(t,e.level),r.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(i=>{this._fallbackToIMSC1(e,t),Ue.log(`Failed to parse VTT cue: ${i}`),r.trigger(_e.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})}))}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||Ws(t,this.initPTS[e.cc],(()=>{i.textCodec=Gs,this._parseIMSC1(e,t)}),(()=>{i.textCodec="wvtt"}))}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[t];if(!i||"disabled"===i.mode)return;e.forEach((e=>Ai(i,e)))}else{const n=this.tracks[t];if(!n)return;const r=n.default?"default":"subtitles"+t;i.trigger(_e.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:i}=t;if(i.type===Ei){if(!this.initPTS[i.cc])return void this.unparsedVttFrags.push(t);this.onFragLoaded(_e.FRAG_LOADED,t)}}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){const{cea608Parser1:i,cea608Parser2:n}=this;if(!this.enabled||!i||!n)return;const{frag:r,samples:s}=t;if(r.type!==Li||"NONE"!==this.closedCaptionsForLevel(r))for(let e=0;e<s.length;e++){const t=s[e].bytes;if(t){const r=this.extractCea608Data(t);i.addData(s[e].pts,r[0]),n.addData(s[e].pts,r[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:i,endOffsetSubtitles:n,type:r}){const{media:s}=this;if(s&&!(s.currentTime<i)){if(!r||"video"===r){const{captionsTracks:e}=this;Object.keys(e).forEach((n=>Di(e[n],t,i)))}if(this.config.renderTextTracksNatively&&0===t&&void 0!==n){const{textTracks:e}=this;Object.keys(e).forEach((i=>Di(e[i],t,n)))}}}extractCea608Data(e){const t=[[],[]],i=31&e[0];let n=2;for(let r=0;r<i;r++){const i=e[n++],r=127&e[n++],s=127&e[n++];if((0!==r||0!==s)&&0!=(4&i)){const e=3&i;0!==e&&1!==e||(t[e].push(r),t[e].push(s))}}return t}},audioStreamController:class extends Hn{constructor(e,t,i){super(e,t,i,"[audio-stream-controller]",bi),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:e}=this;e.on(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.on(_e.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(_e.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(_e.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_e.ERROR,this.onError,this),e.on(_e.BUFFER_RESET,this.onBufferReset,this),e.on(_e.BUFFER_CREATED,this.onBufferCreated,this),e.on(_e.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(_e.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(_e.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:e}=this;e.off(_e.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(_e.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.LEVEL_LOADED,this.onLevelLoaded,this),e.off(_e.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(_e.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(_e.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_e.ERROR,this.onError,this),e.off(_e.BUFFER_RESET,this.onBufferReset,this),e.off(_e.BUFFER_CREATED,this.onBufferCreated,this),e.off(_e.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(_e.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(_e.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(e,{frag:t,id:i,initPTS:n,timescale:r}){if("main"===i){const e=t.cc;this.initPTS[t.cc]={baseTime:n,timescale:r},this.log(`InitPTS for cc: ${e} found from main: ${n}`),this.videoTrackCC=e,this.state===Gn&&this.tick()}}startLoad(e){if(!this.levels)return this.startPosition=e,void(this.state=_n);const t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),t>0&&-1===e?(this.log(`Override startPosition with lastCurrentTime @${t.toFixed(3)}`),e=t,this.state=On):(this.loadedmetadata=!1,this.state=Fn),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}doTick(){switch(this.state){case On:this.doTickIdle();break;case Fn:{var e;const{levels:t,trackId:i}=this,n=null==t||null==(e=t[i])?void 0:e.details;if(n){if(this.waitForCdnTuneIn(n))break;this.state=Gn}break}case zn:{var t;const e=performance.now(),i=this.retryDate;(!i||e>=i||null!=(t=this.media)&&t.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=On);break}case Gn:{const e=this.waitingData;if(e){const{frag:t,part:i,cache:n,complete:r}=e;if(void 0!==this.initPTS[t.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Rn;const e={frag:t,part:i,payload:n.flush(),networkDetails:null};this._handleFragmentLoadProgress(e),r&&super._handleFragmentLoadComplete(e)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${t.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const e=this.getLoadPosition(),i=In.bufferInfo(this.mediaBuffer,e,this.config.maxBufferHole);en(i.end,this.config.maxFragLookUpTolerance,t)<0&&(this.log(`Waiting fragment cc (${t.cc}) @ ${t.start} cancelled because another fragment at ${i.end} is needed`),this.clearWaitingFragment())}}else this.state=On}}this.onTickEnd()}clearWaitingFragment(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=On)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:e}=this;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){const{hls:e,levels:t,media:i,trackId:n}=this,r=e.config;if(null==t||!t[n])return;if(!i&&(this.startFragRequested||!r.startFragPrefetch))return;const s=t[n],a=s.details;if(!a||a.live&&this.levelLastLoaded!==n||this.waitForCdnTuneIn(a))return void(this.state=Fn);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,qe,bi));const l=this.getFwdBufferInfo(o,bi);if(null===l)return;const{bufferedTrack:c,switchingTrack:u}=this;if(!u&&this._streamEnded(l,a))return e.trigger(_e.BUFFER_EOS,{type:"audio"}),void(this.state=Bn);const d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Li),h=l.len,p=this.getMaxBufferLength(null==d?void 0:d.len);if(h>=p&&!u)return;const f=a.fragments[0].start;let g=l.end;if(u&&i){const e=this.getLoadPosition();c&&u.attrs!==c.attrs&&(g=e),a.PTSKnown&&e<f&&(l.end>f||l.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=f+.05)}let y=this.getNextFragment(g,a),m=!1;if(y&&this.isLoopLoading(y,g)&&(m=!!y.gap,y=this.getNextFragmentLoopLoading(y,a,l,Li,p)),!y)return void(this.bufferFlushed=!0);const v=d&&y.start>d.end+a.targetduration;if(v||(null==d||!d.len)&&l.len){const e=this.fragmentTracker.getBufferedFrag(y.start,Li);if(null===e)return;if(m||(m=!!e.gap||!!v&&0===d.len),v&&!m||m&&l.nextStart&&l.nextStart<e.end)return}this.loadFragment(y,s,g)}getMaxBufferLength(e){const t=super.getMaxBufferLength();return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}onMediaDetaching(){this.videoBuffer=null,super.onMediaDetaching()}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map((e=>new Ui(e)))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:n}=this;n&&(n.abortRequests(),this.removeUnbufferedFrags(n.start)),this.resetLoadingState(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=On):(this.switchingTrack=null,this.bufferedTrack=t,this.state=_n),this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.bufferedTrack=null,this.switchingTrack=null}onLevelLoaded(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(_e.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(e,t){var i;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=t);const{levels:n}=this,{details:r,id:s}=t;if(!n)return void this.warn(`Audio tracks were reset while loading level ${s}`);this.log(`Track ${s} loaded [${r.startSN},${r.endSN}],duration:${r.totalduration}`);const a=n[s];let o=0;if(r.live||null!=(i=a.details)&&i.live){const e=this.mainDetails;if(r.fragments[0]||(r.deltaUpdateFailed=!0),r.deltaUpdateFailed||!e)return;!a.details&&r.hasProgramDateTime&&e.hasProgramDateTime?(Cn(r,e),o=r.fragments[0].start):o=this.alignPlaylists(r,a.details)}a.details=r,this.levelLastLoaded=s,this.startFragRequested||!this.mainDetails&&r.live||this.setStartPosition(a.details,o),this.state!==Fn||this.waitForCdnTuneIn(r)||(this.state=On),this.tick()}_handleFragmentLoadProgress(e){var t;const{frag:i,part:n,payload:r}=e,{config:s,trackId:a,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const l=o[a];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);const u=s.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new Kr(this.hls,bi,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[i.cc],p=null==(t=i.initSegment)?void 0:t.data;if(void 0!==h){const e=!1,t=n?n.index:-1,s=-1!==t,a=new Nn(i.level,i.sn,i.stats.chunkCount,r.byteLength,t,s);d.push(r,p,u,"",i,n,c.totalduration,e,a,h)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${c.startSN} ,${c.endSN}],track ${a}`);const{cache:e}=this.waitingData=this.waitingData||{frag:i,part:n,cache:new is,complete:!1};e.push(new Uint8Array(r)),this.waitingVideoCC=this.videoTrackCC,this.state=Gn}}_handleFragmentLoadComplete(e){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(e,t){const i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}onFragBuffered(e,t){const{frag:i,part:n}=t;var r;if(i.type===bi)if(this.fragContextChanged(i))this.warn(`Fragment ${i.sn}${n?" p: "+n.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==i.sn){this.fragPrevious=i;const e=this.switchingTrack;e&&(this.bufferedTrack=e,this.switchingTrack=null,this.hls.trigger(_e.AUDIO_TRACK_SWITCHED,De({},e)))}this.fragBufferedComplete(i,n)}else this.loadedmetadata||i.type!==Li||null!=(r=this.videoBuffer||this.media)&&r.buffered.length&&(this.loadedmetadata=!0)}onError(e,t){var i;if(t.fatal)this.state=$n;else switch(t.details){case Pe.FRAG_GAP:case Pe.FRAG_PARSING_ERROR:case Pe.FRAG_DECRYPT_ERROR:case Pe.FRAG_LOAD_ERROR:case Pe.FRAG_LOAD_TIMEOUT:case Pe.KEY_LOAD_ERROR:case Pe.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(bi,t);break;case Pe.AUDIO_TRACK_LOAD_ERROR:case Pe.AUDIO_TRACK_LOAD_TIMEOUT:case Pe.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Fn||(null==(i=t.context)?void 0:i.type)!==Mi||(this.state=On);break;case Pe.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Pe.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}onBufferFlushed(e,{type:t}){t===qe&&(this.bufferFlushed=!0,this.state===Bn&&(this.state=On))}_handleTransmuxComplete(e){var t;const i="audio",{hls:n}=this,{remuxResult:r,chunkMeta:s}=e,a=this.getCurrentContext(s);if(!a)return void this.resetWhenMissingContext(s);const{frag:o,part:l,level:c}=a,{details:u}=c,{audio:d,text:h,id3:p,initSegment:f}=r;if(!this.fragContextChanged(o)&&u){if(this.state=Un,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=f&&f.tracks&&(this._bufferInitSegment(f.tracks,o,s),n.trigger(_e.FRAG_PARSING_INIT_SEGMENT,{frag:o,id:i,tracks:f.tracks})),d){const{startPTS:e,endPTS:t,startDTS:i,endDTS:n}=d;l&&(l.elementaryStreams.audio={startPTS:e,endPTS:t,startDTS:i,endDTS:n}),o.setElementaryStreamInfo(qe,e,t,i,n),this.bufferFragmentData(d,o,l,s)}if(null!=p&&null!=(t=p.samples)&&t.length){const e=je({id:i,frag:o,details:u},p);n.trigger(_e.FRAG_PARSING_METADATA,e)}if(h){const e=je({id:i,frag:o,details:u},h);n.trigger(_e.FRAG_PARSING_USERDATA,e)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(e,t,i){if(this.state!==Un)return;e.video&&delete e.video;const n=e.audio;if(!n)return;n.levelCodec=n.codec,n.id="audio",this.log(`Init audio buffer, container:${n.container}, codecs[parsed]=[${n.codec}]`),this.hls.trigger(_e.BUFFER_CODECS,e);const r=n.initSegment;if(null!=r&&r.byteLength){const e={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:r};this.hls.trigger(_e.BUFFER_APPENDING,e)}this.tick()}loadFragment(e,t,i){const n=this.fragmentTracker.getState(e);var r;this.fragCurrent=e,this.switchingTrack||n===cn||n===dn?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(r=t.details)&&r.live&&!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=Gn):(this.startFragRequested=!0,super.loadFragment(e,t,i)):this.clearTrackerIfNeeded(e)}completeAudioSwitch(e){const{hls:t,media:i,bufferedTrack:n}=this,r=null==n?void 0:n.attrs,s=e.attrs;i&&r&&(r.CHANNELS!==s.CHANNELS||r.NAME!==s.NAME||r.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(_e.AUDIO_TRACK_SWITCHED,De({},e))}},audioTrackController:class extends rn{constructor(e){super(e,"[audio-track-controller]"),this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.LEVEL_LOADING,this.onLevelLoading,this),e.on(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(_e.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(_e.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.LEVEL_LOADING,this.onLevelLoading,this),e.off(_e.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(_e.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(_e.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:i,groupId:n,details:r}=t,s=this.tracksInGroup[i];if(!s||s.groupId!==n)return void this.warn(`Track with id:${i} and group:${n} not found in active group ${s.groupId}`);const a=s.details;s.details=t.details,this.log(`audio-track ${i} "${s.name}" lang:${s.lang} group:${n} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(null==t||!t.audioGroupIds)return;const i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i||null;const e=this.tracks.filter((e=>!i||e.groupId===i));this.selectDefaultTrack&&!e.some((e=>e.default))&&(this.selectDefaultTrack=!1),this.tracksInGroup=e;const t={audioTracks:e};this.log(`Updating audio tracks, ${e.length} track(s) found in group:${i}`),this.hls.trigger(_e.AUDIO_TRACKS_UPDATED,t),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}onError(e,t){!t.fatal&&t.context&&t.context.type===Mi&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length)return void this.warn("Invalid id passed to audio-track controller");this.clearTimer();const i=this.currentTrack;t[this.trackId];const n=t[e],{groupId:r,name:s}=n;if(this.log(`Switching to audio-track ${e} "${s}" lang:${n.lang} group:${r}`),this.trackId=e,this.currentTrack=n,this.selectDefaultTrack=!1,this.hls.trigger(_e.AUDIO_TRACK_SWITCHING,De({},n)),n.details&&!n.details.live)return;const a=this.switchParams(n.url,null==i?void 0:i.details);this.loadPlaylist(a)}selectInitialTrack(){const e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{const t=new Error(`No track found for running audio group-ID: ${this.groupId} track count: ${e.length}`);this.warn(t.message),this.hls.trigger(_e.ERROR,{type:Oe.MEDIA_ERROR,details:Pe.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:t})}}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const n=t[i];if(!this.selectDefaultTrack||n.default){if(!e||e.attrs["STABLE-RENDITION-ID"]===n.attrs["STABLE-RENDITION-ID"])return n.id;if(e.name===n.name&&e.lang===n.lang)return n.id}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){const i=t.id,n=t.groupId;let r=t.url;if(e)try{r=e.addDirectives(r)}catch(e){this.warn(`Could not construct new URL with HLS Delivery Directives: ${e}`)}this.log(`loading audio-track playlist ${i} "${t.name}" lang:${t.lang} group:${n}`),this.clearTimer(),this.hls.trigger(_e.AUDIO_TRACK_LOADING,{url:r,id:i,groupId:n,deliveryDirectives:e||null})}}},emeController:ra,cmcdController:la,contentSteeringController:class{constructor(e){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.log=Ue.log.bind(Ue,"[content-steering]:"),this.registerListeners()}registerListeners(){const e=this.hls;e.on(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.on(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.on(_e.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(_e.MANIFEST_LOADING,this.onManifestLoading,this),e.off(_e.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(_e.MANIFEST_PARSED,this.onManifestParsed,this),e.off(_e.ERROR,this.onError,this))}startLoad(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){const e=Math.max(1e3*this.timeToLoad-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter((t=>t!==e)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:i}=t;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if(2===(null==i?void 0:i.action)&&1===i.flags){let e=this.pathwayPriority;const t=this.pathwayId;this.penalizedPathways[t]||(this.penalizedPathways[t]=performance.now()),!e&&this.levels&&(e=this.levels.reduce(((e,t)=>(-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e)),[])),e&&e.length>1&&(this.updatePathwayPriority(e),i.resolved=this.pathwayId!==t)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){const i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t):e}getLevelsForPathway(e){return null===this.levels?[]:this.levels.filter((t=>e===t.pathwayId))}updatePathwayPriority(e){let t;this.pathwayPriority=e;const i=this.penalizedPathways,n=performance.now();Object.keys(i).forEach((e=>{n-i[e]>3e5&&delete i[e]}));for(let n=0;n<e.length;n++){const r=e[n];if(i[r])continue;if(r===this.pathwayId)return;const s=this.hls.nextLoadLevel,a=this.hls.levels[s];if(t=this.getLevelsForPathway(r),t.length>0){this.log(`Setting Pathway to "${r}"`),this.pathwayId=r,this.hls.trigger(_e.LEVELS_UPDATED,{levels:t});const e=this.hls.levels[s];a&&e&&this.levels&&(e.attrs["STABLE-VARIANT-ID"]!==a.attrs["STABLE-VARIANT-ID"]&&e.bitrate!==a.bitrate&&this.log(`Unstable Pathways change from bitrate ${a.bitrate} to ${e.bitrate}`),this.hls.nextLoadLevel=s);break}}}clonePathways(e){const t=this.levels;if(!t)return;const i={},n={};e.forEach((e=>{const{ID:r,"BASE-ID":s,"URI-REPLACEMENT":a}=e;if(t.some((e=>e.pathwayId===r)))return;const o=this.getLevelsForPathway(s).map((e=>{const t=je({},e);t.details=void 0,t.url=ua(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",a);const s=new $e(e.attrs);s["PATHWAY-ID"]=r;const o=s.AUDIO&&`${s.AUDIO}_clone_${r}`,l=s.SUBTITLES&&`${s.SUBTITLES}_clone_${r}`;o&&(i[s.AUDIO]=o,s.AUDIO=o),l&&(n[s.SUBTITLES]=l,s.SUBTITLES=l),t.attrs=s;const c=new Ui(t);return on(c,"audio",o),on(c,"text",l),c}));t.push(...o),ca(this.audioTracks,i,a,r),ca(this.subtitleTracks,n,a,r)}))}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;let n;this.loader&&this.loader.destroy(),this.loader=new i(t);try{n=new self.URL(e)}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${e}`)}if("data:"!==n.protocol){const e=0|(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate);n.searchParams.set("_HLS_pathway",this.pathwayId),n.searchParams.set("_HLS_throughput",""+e)}const r={responseType:"json",url:n.href},s=t.steeringManifestLoadPolicy.default,a=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(e,t,i,r)=>{this.log(`Loaded steering manifest: "${n}"`);const s=e.data;if(1!==s.VERSION)return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":a,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=s;if(a)try{this.uri=new self.URL(a,n).href}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${a}`)}this.scheduleRefresh(this.uri||i.url),o&&this.clonePathways(o),l&&this.updatePathwayPriority(l)},onError:(e,t,i,n)=>{if(this.log(`Error loading steering manifest: ${e.code} ${e.text} (${t.url})`),this.stopLoad(),410===e.code)return this.enabled=!1,void this.log(`Steering manifest ${t.url} no longer available`);let r=1e3*this.timeToLoad;if(429!==e.code)this.scheduleRefresh(this.uri||t.url,r);else{const e=this.loader;if("function"==typeof(null==e?void 0:e.getResponseHeader)){const t=e.getResponseHeader("Retry-After");t&&(r=1e3*parseFloat(t))}this.log(`Steering manifest ${t.url} rate limited`)}},onTimeout:(e,t,i)=>{this.log(`Timeout loading steering manifest (${t.url})`),this.scheduleRefresh(this.uri||t.url)}};this.log(`Requesting steering manifest: ${n}`),this.loader.load(r,o,l)}scheduleRefresh(e,t=1e3*this.timeToLoad){self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((()=>{this.loadSteeringManifest(e)}),t)}}});function Ta(e){return e&&"object"==typeof e?Array.isArray(e)?e.map(Ta):Object.keys(e).reduce(((t,i)=>(t[i]=Ta(e[i]),t)),{}):e}class La{static get version(){return"1.4.1-0.canary.9078"}static isSupported(){return function(){const e=qn();if(!e)return!1;const t=Wn(),i=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!i&&!!n}()}static get Events(){return _e}static get ErrorTypes(){return Oe}static get ErrorDetails(){return Pe}static get DefaultConfig(){return La.defaultConfig?La.defaultConfig:Ma}static set DefaultConfig(e){La.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Zr,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,function(e,t){if(self.console&&!0===e||"object"==typeof e){!function(e,...t){t.forEach((function(t){Fe[t]=e[t]?e[t].bind(e):function(e){const t=self.console[e];return t?t.bind(self.console,`[${e}] >`):Re}(t)}))}(e,"debug","log","info","warn","error");try{Fe.log('Debug logs enabled for "Hls instance" in hls.js version 1.4.1-0.canary.9078')}catch(e){Fe=ze}}else Fe=ze}(e.debug||!1);const t=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=Ta(e),n=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((e=>{const r=`${"level"===e?"playlist":e}LoadPolicy`,s=void 0===t[r],a=[];n.forEach((n=>{const o=`${e}Loading${n}`,l=t[o];if(void 0!==l&&s){a.push(o);const e=i[r].default;switch(t[r]={default:e},n){case"TimeOut":e.maxLoadTimeMs=l,e.maxTimeToFirstByteMs=l;break;case"MaxRetry":e.errorRetry.maxNumRetry=l,e.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":e.errorRetry.retryDelayMs=l,e.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":e.errorRetry.maxRetryDelayMs=l,e.timeoutRetry.maxRetryDelayMs=l}}})),a.length&&Ue.warn(`hls.js config: "${a.join('", "')}" setting(s) are deprecated, use "${r}": ${JSON.stringify(t[r])}`)})),De(De({},i),t)}(La.DefaultConfig,e);this.userConfig=e,this._autoLevelCapping=-1,t.progressive&&function(e){const t=e.loader;t!==fa&&t!==ha?(Ue.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=fa,e.progressive=!0,e.enableSoftwareAES=!0,Ue.log("[config]: Progressive streaming enabled, using FetchLoader"))}(t);const{abrController:i,bufferController:n,capLevelController:r,errorController:s,fpsController:a}=t,o=new s(this),l=this.abrController=new i(this),c=this.bufferController=new n(this),u=this.capLevelController=new r(this),d=new a(this),h=new Si(this),p=new Pi(this),f=t.contentSteeringController,g=f?new f(this):null,y=this.levelController=new an(this,g),m=new pn(this),v=new Ln(this.config),M=this.streamController=new Jr(this,m,v);u.setStreamController(M),d.setStreamController(M);const T=[h,y,M];g&&T.splice(1,0,g),this.networkControllers=T;const L=[l,c,u,d,p,m];this.audioTrackController=this.createController(t.audioTrackController,T);const b=t.audioStreamController;b&&T.push(new b(this,m,v)),this.subtitleTrackController=this.createController(t.subtitleTrackController,T);const E=t.subtitleStreamController;E&&T.push(new E(this,m,v)),this.createController(t.timelineController,L),v.emeController=this.emeController=this.createController(t.emeController,L),this.cmcdController=this.createController(t.cmcdController,L),this.latencyController=this.createController(Ri,L),this.coreComponents=L,T.push(o);const I=o.onErrorOut;"function"==typeof I&&this.on(_e.ERROR,I,o)}createController(e,t){if(e){const i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,n){this._emitter.off(e,t,i,n)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){Ue.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(_e.ERROR,{type:Oe.OTHER_ERROR,details:Pe.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){Ue.log("destroy"),this.trigger(_e.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((e=>e.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((e=>e.destroy())),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){Ue.log("attachMedia"),this._media=e,this.trigger(_e.MEDIA_ATTACHING,{media:e})}detachMedia(){Ue.log("detachMedia"),this.trigger(_e.MEDIA_DETACHING,void 0),this._media=null}loadSource(e){this.stopLoad();const t=this.media,i=this.url,n=this.url=Ae.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});Ue.log(`loadSource:${n}`),t&&i&&i!==n&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(_e.MANIFEST_LOADING,{url:e})}startLoad(e=-1){Ue.log(`startLoad(${e})`),this.networkControllers.forEach((t=>{t.startLoad(e)}))}stopLoad(){Ue.log("stopLoad"),this.networkControllers.forEach((e=>{e.stopLoad()}))}swapAudioCodec(){Ue.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){Ue.log("recoverMediaError");const e=this._media;this.detachMedia(),e&&this.attachMedia(e)}removeLevel(e,t=0){this.levelController.removeLevel(e,t)}get levels(){return this.levelController.levels||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){Ue.log(`set currentLevel:${e}`),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){Ue.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){Ue.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){Ue.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){return this.levelController.startLevel}set startLevel(e){Ue.log(`set startLevel:${e}`),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(Ue.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e)}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){zi.indexOf(e)>-1&&(this._maxHdcpLevel=e)}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const i=e.length;for(let n=0;n<i;n++)if(e[n].maxBitrate>=t)return n;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let n;if(n=-1===t&&e&&e.length?e.length-1:t,i)for(let t=n;t--;){const n=e[t].attrs["HDCP-LEVEL"];if(n&&n<=i)return t}return n}get nextAutoLevel(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)}set nextAutoLevel(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return!!e&&e.subtitleDisplay}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}La.defaultConfig=void 0;var ba,Ea=function(){function e(t,n){i(this,e),s(this,"instance",void 0),s(this,"config",void 0),s(this,"playerSettings",void 0),s(this,"hlsInstance",void 0),this.instance=t,this.config=t.playerConfig,this.playerSettings=n,this.hlsInstance=new La({enableWorker:!0,lowLatencyMode:!0,backBufferLength:20,abrEwmaFastVoD:1,autoStartLoad:!0,abrBandWidthUpFactor:.95,maxMaxBufferLength:15,abrEwmaDefaultEstimate:50})}return r(e,[{key:"init",value:function(){La.isSupported()&&(this.hlsInstance.loadSource(this.config.getVideoUrl().videoUrl),this.hlsInstance.attachMedia(this.config.getPlayerElementContainer().querySelector("video")),this.hlsInstance.on(La.Events.MANIFEST_PARSED,(function(){console.log("MANIFEST_PARSED")})))}}]),e}(),Ia=function(){function e(t){i(this,e),s(this,"player",void 0),this.player=t}return r(e,[{key:"updatePlayer",value:function(e){var t,i;console.log(e),this.updateVideo(e.body.videoUrl,e.body.posterImage),this.updateTitle(e.body.videoParagraph),this.updateAuthor(e.body.videoTitle),this.updateSubtitles(null!==(t=null===(i=e.body.defaultConfig)||void 0===i?void 0:i.captions.url)&&void 0!==t?t:null),this.updateChapters(e),this.player.additionalInfoService.setConfig(e.body.additionalInfo)}},{key:"updateChapters",value:function(e){this.player.playerControl.initChapters(e.body.chapters)}},{key:"updateVideo",value:function(e,t){var i=document.querySelector("video");i.poster=t,this.player.playerConfig.setPosterImage(t),this.player.posterManager.poster.setImage(),document.querySelector(".lt-player__poster__img--set-custom").src=t,La.isSupported()?(this.player.hls.hlsInstance.detachMedia(),this.player.hls.hlsInstance.loadSource(e),this.player.hls.hlsInstance.attachMedia(i)):document.querySelector("video").src=e}},{key:"updateTitle",value:function(e){var t=document.querySelector(".poster-title");t.textContent="",t.textContent=e}},{key:"updateAuthor",value:function(e){var t=document.querySelector(".poster-paragraph__content");t.textContent="",t.textContent=e}},{key:"updateSubtitles",value:function(e){this.player.captionsService.setCaptions(e)}}]),e}();function Na(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=p(e);if(t){var r=p(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return h(this,i)}}!function(e){var t=function(e){u(n,e);var t=Na(n);function n(){var e;i(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"pausedPlayer",void 0),s(l(e),"updateManager",void 0),e}return r(n,[{key:"setup",value:function(e,t){return!!e&&(this.setMobileEvents(),this.setDesktopEvents(),this.additionalInfoService=t,this.miniPlayer=new he,this.setPlayerConfig(e.body,e.version),this.initPlayer(),this.additionalInfoService&&this.additionalInfoService.init(this,this.playerConfig.getPlayerId(),this.iconService,this.templateService),Z.checkIsHls(this.playerConfig.getVideoUrl().videoUrl)&&(this.hls=new Ea(this,void 0)),this.setEvents(),this.updateManager=new Ia(this),!0)}},{key:"setEvents",value:function(){this.eventInstance=new Te(this)}},{key:"setDesktopEvents",value:function(){this.desktopEvents=new ve.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new ve.Mobile}},{key:"setPlayerConfig",value:function(e,t){this.playerConfig=new pe(t),this.playerConfig.mapConfigData(e)}},{key:"innerPlayerTemplate",value:function(e){this.playerConfig.getPlayerElementContainer().innerHTML=this.templateService.getTemplateByType(e)}},{key:"getPlayerControllers",value:function(){return this.playerControl.getControls(this.playerConfig,this.iconService)}},{key:"initPlayer",value:function(){var e=this;this.innerPlayerTemplate(this.playerConfig),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-portrate--".concat(this.playerConfig.getDevice())),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-orientation--portrait");var t={},i=this.getPlayerControllers();Object.assign(t,{controls:i}),"embedded"===this.playerConfig.getVideoType()&&Object.assign(t,this.playerConfig.getEmbedOrigin()),Object.assign(t,this.playerConfig.getDefaultConfigItems()),Object.assign(t,{ratio:"9:16"}),this.playerConfig.getFullscreenMode()&&(Object.assign(t,this.playerConfig.getFullscreenMode()),this.playerConfig.getPlayerElementContainer().classList.add("fullscreen-disabled"));var n=this.playerConfig.getPlayerElementContainer().querySelector(".embed_player");this.plyr=new(ge())(n,t),this.playerConfig.setObjectFit(this.plyr,"portrait").then((function(){e.videoService.init(e)})),this.windowService.init(this),this.posterManager.init(this),this.playerConfig.getChapters()&&this.playerControl.initChapters(this.playerConfig.getChapters()),this.devMethodePlayer=new J.Player(this),this.playerConfig.getShareData()&&this.share.init(this),"mobile"!==this.playerConfig.getDevice()&&this.miniPlayer.init(this.plyr,this.templateService,this.iconService,this.playerConfig.getPlayerType(),this)}},{key:"play",value:function(e){this.devMethodePlayer.play(e)}},{key:"pause",value:function(){this.devMethodePlayer.pause()}},{key:"stop",value:function(){this.devMethodePlayer.stop()}},{key:"preload",value:function(){return this.devMethodePreload}},{key:"enterMiniPlayer",value:function(){return this.devMethodePlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){return this.devMethodePlayer.exitMiniPlayer()}},{key:"destruct",value:function(){var e=this,t=this;return new Promise((function(i){t.additionalInfoService.remove(e),t.additionalInfoService=null,e.plyr.destroy((function(){t=void 0,i(!0)}))}))}}]),n}(de);e.PortraitType=t;var n=function(e){u(n,e);var t=Na(n);function n(){var e;i(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"pausedPlayer",void 0),e}return r(n,[{key:"setup",value:function(e,t){return!!e&&(t&&console.warn("Additional Info is not implemented for Landscape type!"),this.setDesktopEvents(),this.setMobileEvents(),this.miniPlayer=new he,this.setPlayerConfig(e.body,e.version),this.initPlayer(),Z.checkIsHls(this.playerConfig.getVideoUrl().videoUrl)&&(this.hls=new Ea(this,void 0)),this.setEvents(),!0===this.playerConfig.getCaptionsEnabled()&&this.statusFeedbackService.setCaptionsEnabled(),!0)}},{key:"setEvents",value:function(){this.eventInstance=new Te(this)}},{key:"initPlayer",value:function(){var e=this;this.innerPlayerTemplate(this.playerConfig),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-landscape--".concat(this.playerConfig.getDevice())),this.playerConfig.getPlayerElementContainer().classList.add("lt-player-orientation--landscape");var t={},i=this.getPlayerControllers();Object.assign(t,{controls:i}),"embedded"===this.playerConfig.getVideoType()&&Object.assign(t,this.playerConfig.getEmbedOrigin()),Object.assign(t,this.playerConfig.getDefaultConfigItems()),Object.assign(t,{ratio:"16:9"}),this.playerConfig.getFullscreenMode()&&Object.assign(t,this.playerConfig.getFullscreenMode());var n=this.playerConfig.getPlayerElementContainer().querySelector(".embed_player");this.plyr=new(ge())(n,t),this.playerConfig.setObjectFit(this.plyr,"landscape").then((function(){e.videoService.init(e)})),this.windowService.init(this),this.posterManager.init(this),this.playerConfig.getChapters()&&this.playerControl.initChapters(this.playerConfig.getChapters()),this.devMethodePlayer=new J.Player(this),this.playerConfig.getShareData()&&this.share.init(this),"mobile"!==this.playerConfig.getDevice()&&this.miniPlayer.init(this.plyr,this.templateService,this.iconService,this.playerConfig.getPlayerType(),this)}},{key:"getPlayerControllers",value:function(){return this.playerControl.getControls(this.playerConfig,this.iconService)}},{key:"innerPlayerTemplate",value:function(e){this.playerConfig.getPlayerElementContainer().innerHTML=this.templateService.getTemplateByType(e)}},{key:"setPlayerConfig",value:function(e,t){this.playerConfig=new pe(t),this.playerConfig.mapConfigData(e)}},{key:"getPlayer",value:function(){return this.plyr}},{key:"play",value:function(){this.devMethodePlayer.play()}},{key:"pause",value:function(){this.devMethodePlayer.pause()}},{key:"stop",value:function(){this.devMethodePlayer.stop()}},{key:"preload",value:function(){return this.devMethodePreload}},{key:"enterMiniPlayer",value:function(){return this.devMethodePlayer.enterMiniPlayer()}},{key:"exitMiniPlayer",value:function(){return this.devMethodePlayer.exitMiniPlayer()}},{key:"destruct",value:function(){var e=this,t=this;return new Promise((function(i){t.additionalInfoService.remove(e),t.additionalInfoService=null,e.plyr.destroy((function(){t=void 0,i(!0)}))}))}},{key:"setDesktopEvents",value:function(){this.desktopEvents=new ve.Desktop}},{key:"setMobileEvents",value:function(){this.mobileEvents=new ve.Mobile}}]),n}(de);e.LandscapeType=n}(ba||(ba={}));const Sa={AdditionalItemsError:"Array at `{{pointer}}` may not have an additional item `{{key}}`",AdditionalPropertiesError:"Additional property `{{property}}` on `{{pointer}}` does not match schema `{{schema}}`",AllOfError:"Value `{{value}}` at `{{pointer}}` does not match schema of `{{allOf}}`",AnyOfError:"Value `{{value}}` at `{{pointer}}` does not match any schema of `{{anyOf}}`",ConstError:"Expected value at `{{pointer}}` to be `{{expected}}`, but value given is `{{value}}`",containsAnyError:"The array at `{{pointer}}` must contain at least one item",ContainsArrayError:"The property at `{{pointer}}` must not be an array",ContainsError:"The array at `{{pointer}}` must contain an element that matches `{{schema}}`",EnumError:"Expected given value `{{value}}` in `{{pointer}}` to be one of `{{values}}`",FormatDateError:"Value `{{value}}` at `{{pointer}}` is not a valid date",FormatDateTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid date-time",FormatEmailError:"Value `{{value}}` at `{{pointer}}` is not a valid email",FormatHostnameError:"Value `{{value}}` at `{{pointer}}` is not a valid hostname",FormatIPV4Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv4 address",FormatIPV4LeadingZeroError:"IPv4 addresses starting with zero are invalid, since they are interpreted as octals",FormatIPV6Error:"Value `{{value}}` at `{{pointer}}` is not a valid IPv6 address",FormatIPV6LeadingZeroError:"IPv6 addresses starting with zero are invalid, since they are interpreted as octals",FormatJSONPointerError:"Value `{{value}}` at `{{pointer}}` is not a valid json-pointer",FormatRegExError:"Value `{{value}}` at `{{pointer}}` is not a valid regular expression",FormatTimeError:"Value `{{value}}` at `{{pointer}}` is not a valid time",FormatURIError:"Value `{{value}}` at `{{pointer}}` is not a valid uri",FormatURIReferenceError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-reference",FormatURITemplateError:"Value `{{value}}` at `{{pointer}}` is not a valid uri-template",FormatURLError:"Value `{{value}}` at `{{pointer}}` is not a valid url",InvalidDataError:"No value may be specified in `{{pointer}}`",InvalidPropertyNameError:"Invalid property name `{{property}}` at `{{pointer}}`",MaximumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{maximum}}` at maximum",MaxItemsError:"Too many items in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MaxLengthError:"Value `{{pointer}}` should have a maximum length of `{{maxLength}}`, but got `{{length}}`.",MaxPropertiesError:"Too many properties in `{{pointer}}`, should be `{{maximum}}` at most, but got `{{length}}`",MinimumError:"Value in `{{pointer}}` is `{{length}}`, but should be `{{minimum}}` at minimum",MinItemsError:"Too few items in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MinItemsOneError:"At least one item is required in `{{pointer}}`",MinLengthError:"Value `{{pointer}}` should have a minimum length of `{{minLength}}`, but got `{{length}}`.",MinLengthOneError:"A value is required in `{{pointer}}`",MinPropertiesError:"Too few properties in `{{pointer}}`, should be at least `{{minimum}}`, but got `{{length}}`",MissingDependencyError:"The required propery '{{missingProperty}}' in `{{pointer}}` is missing",MissingOneOfPropertyError:"Value at `{{pointer}}` property: `{{property}}`",MultipleOfError:"Expected `{{value}}` in `{{pointer}}` to be multiple of `{{multipleOf}}`",MultipleOneOfError:"Value `{{value}}` should not match multiple schemas in oneOf `{{matches}}`",NoAdditionalPropertiesError:"Additional property `{{property}}` in `{{pointer}}` is not allowed",NotError:"Value `{{value}}` at pointer should not match schema `{{not}}`",OneOfError:"Value `{{value}}` in `{{pointer}}` does not match any given oneof schema",OneOfPropertyError:"Failed finding a matching oneOfProperty schema in `{{pointer}}` where `{{property}}` matches `{{value}}`",PatternError:"Value in `{{pointer}}` should match `{{description}}`, but received `{{received}}`",PatternPropertiesError:"Property `{{key}}` does not match any patterns in `{{pointer}}`. Valid patterns are: {{patterns}}",RequiredPropertyError:"The required property `{{key}}` is missing at `{{pointer}}`",TypeError:"Expected `{{value}}` ({{received}}) in `{{pointer}}` to be of type `{{expected}}`",UndefinedValueError:"Value must not be undefined in `{{pointer}}`",UniqueItemsError:"Expected unique items in {{pointer}}: duplicate value `{{value}}` found at {{itemPointer}} and {{duplicatePointer}}",UnknownPropertyError:"Could not find a valid schema for property `{{pointer}}` within object",ValueNotEmptyError:"A value for `{{property}}` is required at `{{pointer}}`"};function wa(e,t,i=e){return function(e,t={}){return e.replace(/\{\{\w+\}\}/g,(e=>t[e.replace(/[{}]/g,"")]))}(Sa[e]||i,t)}function Aa(e,t){return{type:"error",name:e,code:(i=e,i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),message:wa(e,t),data:t};var i}function Ca(e){return Aa.bind(null,e)}const Da=Object.prototype.toString;function ka(e){const t=Da.call(e).match(/\s([^\]]+)\]/).pop().toLowerCase();return"file"===t?"object":t}function ja(e){return"error"===(null==e?void 0:e.type)}function xa(e){return ja(e)||e instanceof Promise}function _a(e,t=[]){for(let i=0;i<e.length;i+=1){const n=e[i];Array.isArray(n)?_a(n,t):t.push(n)}return t}const Oa={DECLARATOR_ONEOF:"oneOfProperty",GET_TEMPLATE_RECURSION_LIMIT:1,floatingPointPrecision:1e4,propertyBlacklist:["_id"]},{DECLARATOR_ONEOF:Pa}=Oa;const Ra=e=>JSON.parse(JSON.stringify(e));var za=__webpack_require__(9996),Fa=__webpack_require__.n(za);const Ua=(e,t)=>t,Ya=(e,t)=>Fa()(e,t,{arrayMerge:Ua}),Ba=(e,t)=>{const i=e.concat(t);return i.filter(((e,t)=>i.indexOf(e)===t))};function $a(e,t,i){var n;const r={...null!==(n=e.resolveRef(t))&&void 0!==n?n:{}};if(r.if&&(r.then||r.else)){const t=e.isValid(i,r.if);if(t&&r.then)return $a(e,r.then,i);if(!t&&r.else)return $a(e,r.else,i);delete r.if,delete r.then,delete r.else}return r}const{DECLARATOR_ONEOF:Ga}=Oa;function Qa(e,t,i,n){if(null==i||null==t.properties)return-1;let r=0;const s=Object.keys(t.properties);for(let a=0;a<s.length;a+=1){const o=s[a];null!=i[o]&&e.isValid(i[o],t.properties[o],n)&&(r+=1)}return r}function Ha(e,t,i=e.rootSchema,n="#"){if(null!=t&&i[Ga]){const r=[],s=i[Ga],a=t[i[Ga]];if(void 0===a)return e.errors.missingOneOfPropertyError({property:s,pointer:n});for(let o=0;o<i.oneOf.length;o+=1){const l=e.resolveRef(i.oneOf[o]),c=e.step(s,l,t,n);if(ja(c))return c;let u=_a(e.validate(a,c,n));if(u=u.filter(xa),!(u.length>0))return l;r.push(...u)}return e.errors.oneOfPropertyError({property:s,value:a,pointer:n,errors:r})}const r=[];for(let s=0;s<i.oneOf.length;s+=1){const a=e.resolveRef(i.oneOf[s]);e.isValid(t,a,n)&&r.push(a)}if(1===r.length)return r[0];if("object"===ka(t)){let r,s=0;for(let n=0;n<i.oneOf.length;n+=1){const a=e.resolveRef(i.oneOf[n]),o=Qa(e,a,t);s<o&&(s=o,r=i.oneOf[n])}return void 0===r?e.errors.oneOfError({value:JSON.stringify(t),pointer:n,oneOf:i.oneOf}):r}return r.length>1?e.errors.multipleOneOfError({matches:r,data:t,pointer:n}):e.errors.oneOfError({value:JSON.stringify(t),pointer:n,oneOf:i.oneOf})}var qa=__webpack_require__(4604),Wa=__webpack_require__.n(qa);const Za={};function Va(e,t,i,n,r=Za){if(0===i.length)return e.resolveRef(t);const s=i.shift();return ja(t=e.step(s,t,r,n))?t:Va(e,t,i,`${n}/${s}`,r=r[s])}const Ka=new(__webpack_require__(5723).Z.Parser)('\nroot ::= ("#" recursion | recursion | (query | pattern) recursion* | "#" SEP? | SEP)\nrecursion ::= (SEP query | pattern)*\n\nquery ::= (ESC escaped ESC | property | all | any | regex) typecheck? lookahead?\nproperty ::= [^?/{}*,()#]+\nregex ::= "{" [^}]+ "}"\nSEP ::= "/"\nall ::= "**"\nany ::= "*"\n\ntypecheck ::= "?:" ("value" | "boolean" | "string" | "number" | "object" | "array")\nlookahead ::= "?" expression ((andExpr | orExpr) expression)*\nandExpr ::= S? "&&" S?\norExpr ::= S? "||" S?\n\nexpression ::= (exprProperty | ESC escaped ESC) ((isnot | is) (exprProperty | regex | ESC escaped ESC))*\nexprProperty ::= [a-zA-Z0-9-_ $]+\nescaped ::= [^"]+\nis ::= ":"\nisnot ::= ":!"\nESC ::= \'"\'\n\npattern ::= S? "(" (SEP query | pattern (orPattern? pattern)*)* ")" quantifier? S? lookahead?\nquantifier ::= "+" | "*" | [0-9]+\norPattern ::= S? "," S?\n\nS ::= [ ]*\n'),Xa=e=>Ka.getAST(e),Ja=(e,t)=>`${e}/${t}`,eo=Object.prototype.toString,to=/Object|Array/,io=e=>to.test(eo.call(e));function no(e){return new RegExp(e.text.replace(/(^{|}$)/g,""))}function ro(e){return Array.isArray(e)?e.map((function(e,t){return`${t}`})):"[object Object]"===Object.prototype.toString.call(e)?Object.keys(e):[]}const so={mem:[],get(e,t){const i=e[0][t];if(!so.mem.includes(i))return io(i)&&so.mem.push(i),[i,t,e[0],Ja(e[3],t)]},reset(){so.mem.length=0}},ao={any(e,t){const i=t[0];return ro(i).map((e=>[i[e],e,i,Ja(t[3],e)]))},all(e,t){const i=[t];var n,r;return n=t[0],r=(n,r)=>{const s=so.get(t,r);s&&i.push(...ao.all(e,s))},Array.isArray(n)?n.forEach(r):"[object Object]"===Object.prototype.toString.call(n)&&Object.keys(n).forEach((function(e){r(n[e],e)})),i},regex(e,t){const i=no(e),n=t[0];return ro(n).filter((e=>i.test(e))).map((e=>[n[e],e,n,Ja(t[3],e)]))}},oo={escaped:(e,t)=>oo.property(e,t),property:(e,t)=>{const i=e.text;if(t[0]&&void 0!==t[0][i])return[t[0][i],i,t[0],Ja(t[3],i)]},typecheck:(e,t)=>{const i=e.text.replace(/^\?:/,"");return"value"===i?io(t[0])?void 0:t:(n=t[0],eo.call(n).match(/\s([^\]]+)\]/).pop().toLowerCase()===i?t:void 0);var n},lookahead:(e,t)=>{let i=!0,n=!1;return e.children.forEach((e=>{if("expression"===e.type){const r=void 0!==oo.expression(e,t);i=!0===n?i||r:i&&r}else n="orExpr"===e.type})),i?t:void 0},expression:(e,t)=>{const i=e.children[0].text,n=e.children[1],r=e.children[2],s=t[0];if(!1!==io(s))return function(e,t,i){if(void 0===t)return void 0!==e;let n;const r=`${e}`;return n="regex"===i.type?no(i).test(r):r===i.text,"isnot"===t.type&&(n=!1===n&&void 0!==e),n}(s[i],n,r)?t:void 0}};function lo(e,t,i){const n=[];let r=e;return t.children.forEach((t=>{if("orPattern"===t.type)return n.push(...r),void(r=e);r=co(r,t,i)})),n.push(...r),n}function co(e,t,i){let n;return n="query"===t.type?function(e,t,i){let n=e;return t.children.forEach((e=>{if(ao[e.type])n=function(e,t,i,n){const r=[];for(let s=0,a=t.length;s<a;s+=1)r.push(...e(i,t[s],i,n));return r}(ao[e.type],n,e,i);else{if(!oo[e.type])throw new Error(`Unknown filter ${e.type}`);n=function(e,t,i,n){const r=[];for(let s=0,a=t.length;s<a;s+=1){const a=e(i,t[s],n);a&&r.push(a)}return r}(oo[e.type],n,e,i)}})),n}(e,t,i):"pattern"===t.type?function(e,t,i){const n=[],r=t.children.find((e=>"quantifier"===e.type)),s=function(e){if(null==e)return 1;if("*"===e||"+"===e)return 1/0;const t=parseInt(e);return isNaN(t)?1:t}(r&&r.text);let a=e;r&&"*"===r.text&&n.push(...a);let o=0;for(;a.length>0&&o<s;)a=lo(a,t,i),n.push(...a),o+=1;return n}(e,t,i):function(e,t,i){let n=e;return t.children.forEach((e=>n=co(n,e,i))),n}(e,t,i),so.reset(),so.mem.push(e),n}const uo={value:e=>e.map((e=>e[0])),pointer:e=>e.map((e=>e[3])),all:e=>e,map:e=>{const t={};return e.forEach((e=>t[e[3]]=e[0])),t}};var ho;function po(e,t,i=ho.VALUE){if(null==t)return[];""===(t=t.replace(/(\/$)/g,""))&&(t="#");const n=Xa(t);if(null==n)throw new Error(`empty ast for '${t}'`);if(""!==n.rest)throw new Error(`Failed parsing queryString from: '${n.rest}'`);const r=function(e,t){return so.reset(),so.mem.push(e),co([[e,null,null,"#"]],t)}(e,n);return"function"==typeof i?r.map((e=>i(...e))):uo[i]?uo[i](r):r}!function(e){e.POINTER="pointer",e.VALUE="value",e.ALL="all",e.MAP="map"}(ho||(ho={})),po.POINTER=ho.POINTER,po.VALUE=ho.VALUE,po.ALL=ho.ALL,po.MAP=ho.MAP;const fo=["root","recursion"];function go(e,t=[]){return fo.includes(e.type)?(e.children.forEach((e=>go(e,t))),t):(t.push(e.text),t)}function yo(e){return null==e||""===e?[]:go(Xa(e))}const mo=e=>JSON.parse(JSON.stringify(e)),vo=Object.prototype.toString,Mo=e=>vo.call(e).match(/\s([^\]]+)\]/).pop().toLowerCase(),To=new RegExp('^("[^"]+"|[^?/{}*,()#]+)$'),Lo=["string","number","boolean","null"],bo=/^\[\d*\]$/,Eo=/^\[(\d+)\]$/,Io=/^".+"$/,No=/(^\[\d*\]$|^\d+$)/;function So(e){return parseInt(e.replace(/^(\[|\]$)/,""))}function wo(e){return Io.test(e)?e.replace(/(^"|"$)/g,""):e}function Ao(e,t,i,n){const r=e[0];if(/^\[\]$/.test(t)){r.push(i);const t=r.length-1;return[r[t],t,r,`${e[3]}/${t}}`]}if(null==n&&"object"===Mo(r[t])&&"object"===Mo(i))return[r[t],t,r,`${e[3]}/${t}}`];if(n===Do.INSERT_ITEMS||null==n&&Eo.test(t)){const n=So(t);return function(e,t,i){e.length<=t?e[t]=i:e.splice(t,0,i)}(r,n,i),[r[n],n,r,`${e[3]}/${n}}`]}if(n===Do.REPLACE_ITEMS||null==n){const n=So(t);return r[n]=i,[r[n],n,r,`${e[3]}/${n}}`]}throw new Error(`Unknown array index '${t}' with force-option '${n}'`)}var Co;function Do(e,t,i,n){if(null==t)return mo(e);if(""===(t=t.replace(/(\/$)/g,"")))return mo(i);const r=mo(e);let s=[[r,null,null,"#"]];const a=yo(t),o=a.pop(),l=bo.test(o)&&!1===Eo.test(o);if(!1===To.test(o)||l)throw new Error(`Unsupported query '${t}' ending with non-property`);return a.forEach(((e,t)=>{if("__proto__"===e||"prototyped"===e||"constructor"===e)return;if(!1===To.test(e))return void(s=function(e,t){const i=[];return e.forEach((e=>i.push(...po(e[0],t,ho.ALL)))),i}(s,e));const i=t>=a.length-1?o:a[t+1],r=No.test(i);s=function(e,t,i,n){return t=wo(t),e.filter((e=>!(!Array.isArray(e[0])||!No.test(t))||!1===Lo.includes(Mo(e[0][t])))).map((e=>{const r=i?[]:{},s=e[0];return Array.isArray(s)?Ao(e,t,r,n):(s[t]=s[t]||r,[s[t],t,s,`${e[3]}/${t}`])}))}(s,e,r,n)})),s.forEach((e=>{let t=i;"function"===Mo(i)&&(t=i(e[3],o,e[0],`${e[3]}/${o}`));const r=e[0];if(Array.isArray(r))Ao(e,o,t,n);else{const e=wo(o);if("__proto__"===e||"prototyped"===e||"constructor"===e)return;r[e]=t}})),r}!function(e){e.REPLACE_ITEMS="replace",e.INSERT_ITEMS="insert"}(Co||(Co={})),Do.REPLACE_ITEMS=Co.REPLACE_ITEMS,Do.INSERT_ITEMS=Co.INSERT_ITEMS;const ko={$ref:{type:!1},allOf:{type:!1,definitions:["allOf/*"]},anyOf:{type:!1,definitions:["anyOf/*"]},array:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","items","items/*","additionalItems"],validationKeywords:["minItems","maxItems","uniqueItems"],keywords:["items","additionalItems","minItems","maxItems","uniqueItems"]},boolean:{type:!0},enum:{type:!1},integer:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},not:{type:!1,definitions:["not"]},number:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minimum","maximum","multipleOf"]},null:{type:!0},object:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not","properties/*","additionalProperties","patternProperties/*","dependencies/*"],validationKeywords:["minProperties","maxProperties","required"],keywords:["properties","additionalProperties","patternProperties","dependencies","minProperties","maxProperties","required"]},oneOf:{type:!1,definitions:["oneOf/*"]},string:{type:!0,definitions:["allOf/*","anyOf/*","oneOf/*","not"],validationKeywords:["minLength","maxLength","pattern"]}},jo=Object.keys(ko).filter((e=>!1===ko[e].type)),xo=Object.prototype.hasOwnProperty;function _o(e){if(0==(t=e,"[object Object]"===Object.prototype.toString.call(t)))return;var t;if(e.enum)return"enum";if(ko[e.type]||Array.isArray(e.type))return e.type;const i=jo.filter((t=>e[t]));if(1===i.length)return i[0];if(0!==i.length)throw new Error(`Mutiple typeIds [${i.join(", ")}] matched in ${JSON.stringify(e)}`);for(let t=0,i=ko.object.keywords.length;t<i;t+=1){const i=ko.object.keywords[t];if(xo.call(e,i))return"object"}for(let t=0,i=ko.array.keywords.length;t<i;t+=1){const i=ko.array.keywords[t];if(xo.call(e,i))return"array"}}function Oo(e,t){!0!==this.callback(e,t)&&function(e){const t=[],i=_o(e);if(null==i)return t;let n;if(Array.isArray(i)){n={};for(let e=0,t=i.length;e<t;e+=1)Object.assign(n,ko[i[e]])}else n=ko[i];return null==n.definitions||n.definitions.forEach((i=>{po(e,i,((e,i,n,r)=>{(e=>"[object Object]"===Object.prototype.toString.call(e))(e)&&_o(e)&&t.push({pointer:Wa().join(Wa().split(r),!1),def:e})}))})),t}(e).forEach((e=>this.nextTypeDefs(e.def,Wa().join(t,e.pointer,!1))))}function Po(e,t,i,n="definitions"){const r=t[n];Object.keys(r).forEach((t=>{if(!1!==r[t]&&(s=r[t],"[object Object]"!==Object.prototype.toString.call(s)))var s;else e.nextTypeDefs(r[t],Wa().join(i,n,t,!1))}))}function Ro(e,t,i="#"){const n={callback:t,nextTypeDefs:Oo};n.nextTypeDefs(e,i),null!=e.definitions&&(n.callback=(e,i)=>{t(e,i),null!=e.definitions&&Po(n,e,i)},Po(n,e,i)),null!=e.$defs&&(n.callback=(e,i)=>{t(e,i),null!=e.definitions&&Po(n,e,i)},Po(n,e,i,"$defs"))}const zo=/(#|\/)+$/,Fo=/#$/,Uo=/^[^:]+:\/\/[^/]+\//,Yo=/\/[^/]*$/,Bo=/#.*$/;function $o(e,t){return null==e&&null==t?"#":null==t?e.replace(Fo,""):null==e?t.replace(Fo,""):"#"===t[0]?`${e.replace(Bo,"")}${t.replace(zo,"")}`:Uo.test(t)?t.replace(Fo,""):`${e.replace(Yo,"")}/${t.replace(Fo,"")}`}const Go=/(#|\/)+$/g,Qo=["",null,"#"],Ho=/(#|\/)+$/g;function qo(e,t,i){if("object"===ka(i)&&(i=i.__ref||i.$ref),null==i)return t;let n;const r=i.replace(Ho,"");if(e.remotes[r])return n=e.remotes[r],n&&n.$ref?qo(e,t,n.$ref):n;if(e.ids[i])return n=(0,qa.get)(t,e.ids[i]),n&&n.$ref?qo(e,t,n.$ref):n;const s=function(e){if(Qo.includes(e))return[];if(-1===(e=e.replace(Go,"")).indexOf("#"))return[e.replace(Go,"")];if(0===e.indexOf("#"))return[e.replace(Go,"")];const t=e.split("#");return t[0]=t[0].replace(Go,""),t[1]=`#${t[1].replace(Go,"")}`,t}(i);if(0===s.length)return t;if(1===s.length){if(i=s[0],e.remotes[i])return n=e.remotes[i],qo(e,t,n.$ref);if(e.ids[i])return n=(0,qa.get)(t,e.ids[i]),n&&n.$ref?qo(e,t,n.$ref):n}if(2===s.length){const n=s[0];if(i=s[1],e.remotes[n])return e.remotes[n].getRef?e.remotes[n].getRef(i):qo(e,e.remotes[n],i);if(e.ids[n])return qo(e,(0,qa.get)(t,e.ids[n]),i)}return n=(0,qa.get)(t,e.ids[i]||i),n&&n.$ref?qo(e,t,n.$ref):n}const Wo="__compiled",Zo=/(#|\/)+$/g;const Vo={additionalItemsError:Ca("AdditionalItemsError"),additionalPropertiesError:Ca("AdditionalPropertiesError"),anyOfError:Ca("AnyOfError"),allOfError:Ca("AllOfError"),constError:Ca("ConstError"),containsError:Ca("ContainsError"),containsArrayError:Ca("ContainsArrayError"),containsAnyError:Ca("ContainsAnyError"),enumError:Ca("EnumError"),formatURLError:Ca("FormatURLError"),formatURIError:Ca("FormatURIError"),formatURIReferenceError:Ca("FormatURIReferenceError"),formatURITemplateError:Ca("FormatURITemplateError"),formatDateError:Ca("FormatDateaError"),formatDateTimeError:Ca("FormatDateTimeError"),formatEmailError:Ca("FormatEmailError"),formatHostnameError:Ca("FormatHostnameError"),formatIPV4Error:Ca("FormatIPV4Error"),formatIPV4LeadingZeroError:Ca("FormatIPV4LeadingZeroError"),formatIPV6Error:Ca("FormatIPV6Error"),formatIPV6LeadingZeroError:Ca("FormatIPV6LeadingZeroError"),formatJSONPointerError:Ca("FormatJSONPointerError"),formatRegExError:Ca("FormatRegExError"),formatTimeError:Ca("FormatTimeError"),invalidSchemaError:Ca("InvalidSchemaError"),invalidDataError:Ca("InvalidDataError"),invalidTypeError:Ca("InvalidTypeError"),invalidPropertyNameError:Ca("InvalidPropertyNameError"),maximumError:Ca("MaximumError"),maxItemsError:Ca("MaxItemsError"),maxLengthError:Ca("MaxLengthError"),maxPropertiesError:Ca("MaxPropertiesError"),minimumError:Ca("MinimumError"),minItemsError:Ca("MinItemsError"),minItemsOneError:Ca("MinItemsOneError"),minLengthError:Ca("MinLengthError"),minLengthOneError:Ca("MinLengthOneError"),minPropertiesError:Ca("MinPropertiesError"),missingDependencyError:Ca("MissingDependencyError"),missingOneOfPropertyError:Ca("MissingOneOfPropertyError"),multipleOfError:Ca("MultipleOfError"),multipleOneOfError:Ca("MultipleOneOfError"),noAdditionalPropertiesError:Ca("NoAdditionalPropertiesError"),notError:Ca("NotError"),oneOfError:Ca("OneOfError"),oneOfPropertyError:Ca("OneOfPropertyError"),patternError:Ca("PatternError"),patternPropertiesError:Ca("PatternPropertiesError"),requiredPropertyError:Ca("RequiredPropertyError"),typeError:Ca("TypeError"),undefinedValueError:Ca("UndefinedValueError"),uniqueItemsError:Ca("UniqueItemsError"),unknownPropertyError:Ca("UnknownPropertyError"),valueNotEmptyError:Ca("ValueNotEmptyError")};var Ko=__webpack_require__(481),Xo=__webpack_require__.n(Ko);const Jo=new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\\.[0-9]+)?(([Zz])|([\\+|\\-]([01][0-9]|2[0-3]):[0-5][0-9]))$"),el=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,tl=/^((([0-9a-f]{1,4}:){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$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,cl=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,ul={date:(e,t,i,n)=>{if("string"!=typeof i)return;const r=i.match(nl);if(!r)return Vo.formatDateTimeError({value:i,pointer:n});const s=+r[1],a=+r[2],o=+r[3];return a>=1&&a<=12&&o>=1&&o<=(2!=a||s%4!=0||s%100==0&&s%400!=0?sl[a]:29)?void 0:Vo.formatDateError({value:i,pointer:n})},"date-time":(e,t,i,n)=>{if("string"==typeof i)return""===i||Jo.test(i)?"Invalid Date"===new Date(i).toString()?Vo.formatDateTimeError({value:i,pointer:n}):void 0:Vo.formatDateTimeError({value:i,pointer:n})},email:(e,t,i,n)=>{if("string"!=typeof i)return;if('"'===i[0])return Vo.formatEmailError({value:i,pointer:n});const[r,s,...a]=i.split("@");return!r||!s||0!==a.length||r.length>64||s.length>253||"."===r[0]||r.endsWith(".")||r.includes("..")?Vo.formatEmailError({value:i,pointer:n}):/^[a-z0-9.-]+$/i.test(s)&&/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(r)&&s.split(".").every((e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e)))?void 0:Vo.formatEmailError({value:i,pointer:n})},hostname:(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!il.test(i))return Vo.formatHostnameError({value:i,pointer:n})},ipv4:(e,t,i,n)=>{if("string"==typeof i&&""!==i){if(i&&"0"===i[0])return Vo.formatIPV4LeadingZeroError({value:i,pointer:n});if(!(i.length<=15&&el.test(i)))return Vo.formatIPV4Error({value:i,pointer:n})}},ipv6:(e,t,i,n)=>{if("string"==typeof i&&""!==i){if(i&&"0"===i[0])return Vo.formatIPV6LeadingZeroError({value:i,pointer:n});if(!(i.length<=45&&tl.test(i)))return Vo.formatIPV6Error({value:i,pointer:n})}},"json-pointer":(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!al.test(i))return Vo.formatJSONPointerError({value:i,pointer:n})},"relative-json-pointer":(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!ol.test(i))return Vo.formatJSONPointerError({value:i,pointer:n})},regex:(e,t,i,n)=>{if("string"==typeof i&&!1===/\\Z$/.test(i)){try{return void new RegExp(i)}catch(e){}return Vo.formatRegExError({value:i,pointer:n})}if("object"!=typeof i&&"number"!=typeof i&&!Array.isArray(i))return Vo.formatRegExError({value:i,pointer:n})},time:(e,t,i,n)=>{if("string"!=typeof i)return;const r=i.match(rl);if(!r)return Vo.formatDateTimeError({value:i,pointer:n});const s=+r[1],a=+r[2],o=+r[3],l=!!r[5];return(s<=23&&a<=59&&o<=59||23==s&&59==a&&60==o)&&l?void 0:Vo.formatTimeError({value:i,pointer:n})},uri:(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!Xo().isUri(i))return Vo.formatURIError({value:i,pointer:n})},"uri-reference":(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!ll.test(i))return Vo.formatURIReferenceError({value:i,pointer:n})},"uri-template":(e,t,i,n)=>{if("string"==typeof i&&""!==i&&!cl.test(i))return Vo.formatURITemplateError({value:i,pointer:n})},url:(e,t,i,n)=>{if(""!==i&&!Xo().isWebUri(i))return Vo.formatUrlError({value:i,pointer:n})}},dl={addOptionalProps:!0,removeInvalidData:!1};let hl;function pl(e,t){const{$ref:i}=e;return null==i||(null==hl[t]||null==hl[t][i]?0:hl[t][i])<Oa.GET_TEMPLATE_RECURSION_LIMIT}function fl(e,t,i){if(null==i)throw new Error(`missing pointer ${i}`);const{$ref:n}=t;return null==n?t:(hl[i]=hl[i]||{},hl[i][n]=hl[i][n]||0,hl[i][n]+=1,e.resolveRef(t))}function gl(e,t,i,n){if("object"!==ka(t))return Object.assign({pointer:n},t);if(!1===pl(t,n)&&null==i)return!1;let r=Ra(fl(e,t,n));if(Array.isArray(t.anyOf)&&t.anyOf.length>0){if(pl(t.anyOf[0],`${n}/anyOf/0`)){const i=fl(e,t.anyOf[0],`${n}/anyOf/0`);r=Ya(r,i),r.pointer=t.anyOf[0].$ref||r.pointer}delete r.anyOf}if(Array.isArray(t.allOf)){for(let i=0,s=t.allOf.length;i<s;i+=1)pl(t.allOf[i],`${n}/allOf/${i}`)&&(r=Ya(r,fl(e,t.allOf[i],`${n}/allOf/${i}`)),r.pointer=t.allOf[i].$ref||r.pointer);delete r.allOf}return r.pointer=r.pointer||t.$ref||n,r}const yl=e=>e&&"object"==typeof e;function ml(e,t,i,n,r){if(null==i)throw new Error(`getTemplate: missing schema for data: ${JSON.stringify(t)}`);if(null==n)throw new Error("Missing pointer");let s=gl(e,i,t,n);if(!yl(s))return;if(n=s.pointer,null==s?void 0:s.const)return s.const;if(Array.isArray(s.oneOf))if(function(e){switch(ka(e)){case"string":case"array":return 0===e.length;case"null":case"undefined":return!0;case"object":return 0===Object.keys(e).length;default:return!1}}(t)){const e=s.oneOf[0].type||s.type||s.const&&typeof s.const||ka(t);s={...s.oneOf[0],type:e}}else{const i=Ha(e,t,s);if(ja(i)){if(null!=t&&!0!==r.removeInvalidData)return t;s=s.oneOf[0],t=void 0}else s=i}if(!yl(s)||null==s.type)return;const a=Array.isArray(s.type)?function(e,t,i){if(null==t){if(null!=i){const t=ka(i);if(e.includes(t))return t}return e[0]}const n=ka(t);return e.includes(n)?n:e[0]}(s.type,t,s.default):s.type;if(null!=t&&ka(t)!==a&&(t=function(e,t){if("string"===e)return JSON.stringify(t);if("string"!=typeof t)return null;try{if(typeof(t=JSON.parse(t))===e)return t}catch(e){}return null}(a,t)),null==vl[a]){if(r.removeInvalidData)return;return t}return vl[a](e,s,t,n,r)}const vl={null:(e,t,i)=>Ml(t,i,null),string:(e,t,i)=>Ml(t,i,""),number:(e,t,i)=>Ml(t,i,0),integer:(e,t,i)=>Ml(t,i,0),boolean:(e,t,i)=>Ml(t,i,!1),object:(e,t,i,n,r)=>{var s;const a=void 0===t.default?{}:t.default,o={},l=null!==(s=t.required)&&void 0!==s?s:[];if(t.properties&&Object.keys(t.properties).forEach((s=>{const c=null==i||null==i[s]?a[s]:i[s],u=l.includes(s);(null!=c||u||r.addOptionalProps)&&(o[s]=ml(e,c,t.properties[s],`${n}/properties/${s}`,r))})),t.dependencies&&Object.keys(t.dependencies).forEach((s=>{if(void 0===o[s])return;const a=t.dependencies[s];if(Array.isArray(a))return void a.forEach((i=>{o[i]=ml(e,o[i],t.properties[i],`${n}/properties/${i}`,r)}));if("object"!==ka(a))return;const l=ml(e,i,{...a,type:"object"},`${n}/dependencies/${s}`,r);l&&!ja(l)&&Object.assign(o,l)})),i&&Object.keys(i).forEach((e=>null==o[e]&&(o[e]=i[e]))),t.if&&(t.then||t.else)){const i=e.isValid(o,t.if);if(i&&t.then){const i=e.getTemplate(o,{type:"object",...t.then},r);Object.assign(o,i)}else if(!i&&t.else){const i=e.getTemplate(o,{type:"object",...t.else},r);Object.assign(o,i)}}return o},array:(e,t,i,n,r)=>{var s,a,o;const l=void 0===t.default?[]:t.default;t.minItems=t.minItems||0;const c=i||[];if(null==t.items)return c;if(Array.isArray(t.items)){for(let i=0,u=Math.max(null!==(s=t.minItems)&&void 0!==s?s:0,null!==(o=null===(a=t.items)||void 0===a?void 0:a.length)&&void 0!==o?o:0);i<u;i+=1)c[i]=ml(e,null==c[i]?l[i]:c[i],t.items[i],`${n}/items/${i}`,r);return c}if("object"!==ka(t.items))return c;const u=gl(e,t.items,i,n);if(!1===u)return c;if(n=u.pointer||n,u.oneOf&&0===c.length){const i=u.oneOf[0];for(let s=0;s<t.minItems;s+=1)c[s]=ml(e,null==c[s]?l[s]:c[s],i,`${n}/oneOf/0`,r);return c}if(u.oneOf&&c.length>0){const i=Math.max(t.minItems,c.length);for(let t=0;t<i;t+=1){let i=null==c[t]?l[t]:c[t],s=Ha(e,i,u);null==s||ja(s)?null!=i&&!0!==r.removeInvalidData?c[t]=i:(i=void 0,s=u.oneOf[0],c[t]=ml(e,i,s,`${n}/oneOf/${t}`,r)):c[t]=ml(e,i,s,`${n}/oneOf/${t}`,r)}return c}if(u.type){for(let i=0,s=Math.max(t.minItems,c.length);i<s;i+=1)c[i]=ml(e,null==c[i]?l[i]:c[i],u,`${n}/items`,r);return c}return c}};function Ml(e,t,i){return null!=t?t:e.const?e.const:void 0===e.default&&Array.isArray(e.enum)?e.enum[0]:void 0===e.default?i:e.default}function Tl(e,t){const i=typeof e;if(i!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(!Tl(e[n],t[n]))return!1;return!0}if("object"===i){if(!e||!t)return e===t;const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(const n of i)if(!Tl(e[n],t[n]))return!1;return!0}return e===t}function Ll(e){const t=[];let i=0;const n=e.length;for(;i<n;){const r=e.charCodeAt(i++);if(r>=55296&&r<=56319&&i<n){const n=e.charCodeAt(i++);56320==(64512&n)?t.push(((1023&r)<<10)+(1023&n)+65536):(t.push(r),i--)}else t.push(r)}return t}const bl=Oa.floatingPointPrecision,El=Object.prototype.hasOwnProperty,Il=(e,t)=>!(void 0===e[t]||!El.call(e,t)),Nl={additionalProperties:(e,t,i,n)=>{if(!0===t.additionalProperties||null==t.additionalProperties)return;if("object"===ka(t.patternProperties)&&!1===t.additionalProperties)return;const r=[];let s=Object.keys(i).filter((e=>!1===Oa.propertyBlacklist.includes(e)));const a=Object.keys(t.properties||{});if("object"===ka(t.patternProperties)){const e=Object.keys(t.patternProperties).map((e=>new RegExp(e)));s=s.filter((t=>{for(let i=0;i<e.length;i+=1)if(e[i].test(t))return!1;return!0}))}for(let o=0,l=s.length;o<l;o+=1){const l=s[o];if(-1===a.indexOf(l)){const c="object"==typeof t.additionalProperties;if(c&&Array.isArray(t.additionalProperties.oneOf)){const c=e.resolveOneOf(i[l],t.additionalProperties,`${n}/${l}`);ja(c)?r.push(e.errors.additionalPropertiesError({schema:t.additionalProperties,property:s[o],properties:a,pointer:n,errors:c.data.errors})):r.push(...e.validate(i[l],c,n))}else c?r.push(...e.validate(i[l],t.additionalProperties,`${n}/${l}`)):r.push(e.errors.noAdditionalPropertiesError({property:s[o],properties:a,pointer:n}))}}return r},allOf:(e,t,i,n)=>{if(!1===Array.isArray(t.allOf))return;const r=[];return t.allOf.forEach((t=>{r.push(...e.validate(i,t,n))})),r},anyOf:(e,t,i,n)=>{if(!1!==Array.isArray(t.anyOf)){for(let n=0;n<t.anyOf.length;n+=1)if(e.isValid(i,t.anyOf[n]))return;return e.errors.anyOfError({anyOf:t.anyOf,value:i,pointer:n})}},dependencies:(e,t,i,n)=>{if("object"!==ka(t.dependencies))return;const r=[];return Object.keys(i).forEach((s=>{if(void 0===t.dependencies[s])return;if(!0===t.dependencies[s])return;if(!1===t.dependencies[s])return void r.push(e.errors.missingDependencyError({pointer:n}));let a;const o=ka(t.dependencies[s]);if("array"===o)a=t.dependencies[s].filter((e=>void 0===i[e])).map((t=>e.errors.missingDependencyError({missingProperty:t,pointer:n})));else{if("object"!==o)throw new Error(`Invalid dependency definition for ${n}/${s}. Must be list or schema`);a=e.validate(i,t.dependencies[s],n)}r.push(...a)})),r.length>0?r:void 0},enum:(e,t,i,n)=>{const r=ka(i);if("object"===r||"array"===r){const e=JSON.stringify(i);for(let i=0;i<t.enum.length;i+=1)if(JSON.stringify(t.enum[i])===e)return}else if(t.enum.includes(i))return;return e.errors.enumError({values:t.enum,value:i,pointer:n})},format:(e,t,i,n)=>{if(e.validateFormat[t.format])return e.validateFormat[t.format](e,t,i,n)},items:(e,t,i,n)=>{if(!1===t.items){if(Array.isArray(i)&&0===i.length)return;return e.errors.invalidDataError({pointer:n,value:i})}const r=[];for(let s=0;s<i.length;s+=1){const a=i[s],o=e.step(s,t,i,n);if(ja(o))return[o];const l=e.validate(a,o,`${n}/${s}`);r.push(...l)}return r},maximum:(e,t,i,n)=>{if(!isNaN(t.maximum))return t.maximum&&t.maximum<i||t.maximum&&!0===t.exclusiveMaximum&&t.maximum===i?e.errors.maximumError({maximum:t.maximum,length:i,pointer:n}):void 0},maxItems:(e,t,i,n)=>{if(!isNaN(t.maxItems))return t.maxItems<i.length?e.errors.maxItemsError({maximum:t.maxItems,length:i.length,pointer:n}):void 0},maxLength:(e,t,i,n)=>{if(isNaN(t.maxLength))return;const r=Ll(i).length;return t.maxLength<r?e.errors.maxLengthError({maxLength:t.maxLength,length:r,pointer:n}):void 0},maxProperties:(e,t,i,n)=>{const r=Object.keys(i).length;if(!1===isNaN(t.maxProperties)&&t.maxProperties<r)return e.errors.maxPropertiesError({maxProperties:t.maxProperties,length:r,pointer:n})},minLength:(e,t,i,n)=>{if(isNaN(t.minLength))return;const r=Ll(i).length;return t.minLength>r?1===t.minLength?e.errors.minLengthOneError({minLength:t.minLength,length:r,pointer:n}):e.errors.minLengthError({minLength:t.minLength,length:r,pointer:n}):void 0},minimum:(e,t,i,n)=>{if(!isNaN(t.minimum))return t.minimum>i||!0===t.exclusiveMinimum&&t.minimum===i?e.errors.minimumError({minimum:t.minimum,length:i,pointer:n}):void 0},minItems:(e,t,i,n)=>{if(!isNaN(t.minItems))return t.minItems>i.length?1===t.minItems?e.errors.minItemsOneError({minItems:t.minItems,length:i.length,pointer:n}):e.errors.minItemsError({minItems:t.minItems,length:i.length,pointer:n}):void 0},minProperties:(e,t,i,n)=>{if(isNaN(t.minProperties))return;const r=Object.keys(i).length;return t.minProperties>r?e.errors.minPropertiesError({minProperties:t.minProperties,length:r,pointer:n}):void 0},multipleOf:(e,t,i,n)=>{if(!isNaN(t.multipleOf))return i*bl%(t.multipleOf*bl)/bl!=0?e.errors.multipleOfError({multipleOf:t.multipleOf,value:i,pointer:n}):void 0},not:(e,t,i,n)=>{const r=[];return 0===e.validate(i,t.not,n).length&&r.push(e.errors.notError({value:i,not:t.not,pointer:n})),r},oneOf:(e,t,i,n)=>{if(!1!==Array.isArray(t.oneOf))return ja(t=e.resolveOneOf(i,t,n))?t:void 0},pattern:(e,t,i,n)=>{if(!1===new RegExp(t.pattern,"u").test(i))return e.errors.patternError({pattern:t.pattern,description:t.patternExample||t.pattern,received:i,pointer:n})},patternProperties:(e,t,i,n)=>{const r=t.properties||{},s=t.patternProperties;if("object"!==ka(s))return;const a=[],o=Object.keys(i),l=Object.keys(s).map((e=>({regex:new RegExp(e),patternSchema:s[e]})));return o.forEach((o=>{let c=!1;for(let t=0,r=l.length;t<r;t+=1)if(l[t].regex.test(o)){c=!0;const r=e.validate(i[o],l[t].patternSchema,`${n}/${o}`);r&&r.length>0&&a.push(...r)}r[o]||!1===c&&!1===t.additionalProperties&&a.push(e.errors.patternPropertiesError({key:o,pointer:n,patterns:Object.keys(s).join(",")}))})),a},properties:(e,t,i,n)=>{const r=[],s=Object.keys(t.properties||{});for(let a=0;a<s.length;a+=1){const o=s[a];if(Il(i,o)){const s=e.step(o,t,i,n),a=e.validate(i[o],s,`${n}/${o}`);r.push(...a)}}return r},propertiesRequired:(e,t,i,n)=>{const r=[],s=Object.keys(t.properties||{});for(let a=0;a<s.length;a+=1){const o=s[a];if(void 0===i[o])r.push(e.errors.requiredPropertyError({key:o,pointer:n}));else{const s=e.step(o,t,i,n),a=e.validate(i[o],s,`${n}/${o}`);r.push(...a)}}return r},required:(e,t,i,n)=>{if(!1!==Array.isArray(t.required))return t.required.map((t=>{if(!Il(i,t))return e.errors.requiredPropertyError({key:t,pointer:n})}))},requiredNotEmpty:(e,t,i,n)=>{if(!1!==Array.isArray(t.required))return t.required.map((t=>{if(null==i[t]||""===i[t])return e.errors.valueNotEmptyError({property:t,pointer:`${n}/${t}`})}))},uniqueItems:(e,t,i,n)=>{if(!1===(Array.isArray(i)&&t.uniqueItems))return;const r=[];return i.forEach(((t,s)=>{for(let a=s+1;a<i.length;a+=1)Tl(t,i[a])&&r.push(e.errors.uniqueItemsError({pointer:n,itemPointer:`${n}/${s}`,duplicatePointer:`${n}/${a}`,value:JSON.stringify(t)}))})),r}},Sl={...Nl,contains:(e,t,i,n)=>{if(!1===t.contains)return e.errors.containsArrayError({pointer:n,value:i});if(!0===t.contains)return Array.isArray(i)&&0===i.length?e.errors.containsAnyError({pointer:n}):void 0;if("object"===ka(t.contains)){for(let n=0;n<i.length;n+=1)if(e.isValid(i[n],t.contains))return;return e.errors.containsError({pointer:n,schema:JSON.stringify(t.contains)})}},exclusiveMaximum:(e,t,i,n)=>{if(!isNaN(t.exclusiveMaximum))return t.exclusiveMaximum<=i?e.errors.maximumError({maximum:t.exclusiveMaximum,length:i,pointer:n}):void 0},exclusiveMinimum:(e,t,i,n)=>{if(!isNaN(t.exclusiveMinimum))return t.exclusiveMinimum>=i?e.errors.minimumError({minimum:t.exclusiveMinimum,length:i,pointer:n}):void 0},if:(e,t,i,n)=>{if(null==t.if)return;const r=e.validate(i,t.if,n);return 0===r.length&&t.then?e.validate(i,t.then,n):0!==r.length&&t.else?e.validate(i,t.else,n):void 0},maximum:(e,t,i,n)=>{if(!isNaN(t.maximum))return t.maximum&&t.maximum<i?e.errors.maximumError({maximum:t.maximum,length:i,pointer:n}):void 0},minimum:(e,t,i,n)=>{if(!isNaN(t.minimum))return t.minimum>i?e.errors.minimumError({minimum:t.minimum,length:i,pointer:n}):void 0},patternProperties:(e,t,i,n)=>{const r=t.properties||{},s=t.patternProperties;if("object"!==ka(s))return;const a=[],o=Object.keys(i),l=Object.keys(s).map((e=>({regex:new RegExp(e),patternSchema:s[e]})));return o.forEach((o=>{let c=!1;for(let t=0,r=l.length;t<r;t+=1)if(l[t].regex.test(o)){if(c=!0,!1===l[t].patternSchema)return void a.push(e.errors.patternPropertiesError({key:o,pointer:n,patterns:Object.keys(s).join(",")}));const r=e.validate(i[o],l[t].patternSchema,`${n}/${o}`);r&&r.length>0&&a.push(...r)}r[o]||!1===c&&!1===t.additionalProperties&&a.push(e.errors.patternPropertiesError({key:o,pointer:n,patterns:Object.keys(s).join(",")}))})),a},propertyNames:(e,t,i,n)=>{if(!1===t.propertyNames){if(0===Object.keys(i).length)return;return e.errors.invalidPropertyNameError({property:Object.keys(i),pointer:n,value:i})}if(!0===t.propertyNames)return;if("object"!==ka(t.propertyNames))return;const r=[],s=Object.keys(i),a={...t.propertyNames,type:"string"};return s.forEach((t=>{const s=e.validate(t,a,`${n}/${t}`);s.length>0&&r.push(e.errors.invalidPropertyNameError({property:t,pointer:n,validationError:s[0],value:i[t]}))})),r}};function wl(e){const t={type:ka(e)};return"object"===t.type&&(t.properties={},Object.keys(e).forEach((i=>t.properties[i]=wl(e[i])))),"array"===t.type&&1===e.length?t.items=wl(e[0]):"array"===t.type&&(t.items=e.map(wl)),t}const Al={array:(e,t,i,n,r)=>{const s=ka(i.items);if("object"===s)return Array.isArray(i.items.oneOf)?e.resolveOneOf(n[t],i.items,r):Array.isArray(i.items.anyOf)?e.resolveAnyOf(n[t],i.items,r):Array.isArray(i.items.allOf)?e.resolveAllOf(n[t],i.items,r):e.resolveRef(i.items);if("array"===s){if(!0===i.items[t])return wl(n[t]);if(!1===i.items[t])return Vo.invalidDataError({key:t,value:n[t],pointer:r});if(i.items[t])return e.resolveRef(i.items[t]);if(!1===i.additionalItems)return Vo.additionalItemsError({key:t,value:n[t],pointer:r});if(!0===i.additionalItems||void 0===i.additionalItems)return wl(n[t]);if("object"===ka(i.additionalItems))return i.additionalItems;throw new Error(`Invalid schema ${JSON.stringify(i,null,4)} for ${JSON.stringify(n,null,4)}`)}return!1!==i.additionalItems&&n[t]?wl(n[t]):new Error(`Invalid array schema for ${t} at ${r}`)},object:(e,t,i,n,r)=>{if(Array.isArray(i.oneOf)){const t=e.resolveOneOf(n,i,r);if(ja(i=Ya(i,t)))return i}if(Array.isArray(i.anyOf)&&ja(i=e.resolveAnyOf(n,i,r)))return i;if(Array.isArray(i.allOf)&&ja(i=e.resolveAllOf(n,i,r)))return i;let s;if(i.properties&&void 0!==i.properties[t]){if(s=e.resolveRef(i.properties[t]),ja(s))return s;if(s&&Array.isArray(s.oneOf)){let i=e.resolveOneOf(n[t],s,`${r}/${t}`);const a=s.oneOf.findIndex((e=>e===i));return i=JSON.parse(JSON.stringify(i)),i.variableSchema=!0,i.oneOfIndex=a,i.oneOfSchema=s,i}if(s)return s}const{dependencies:a}=i;if("object"===ka(a)){const i=Object.keys(a).filter((e=>"object"===ka(a[e])));for(let s=0,o=i.length;s<o;s+=1){const o=i[s],l=Cl(e,t,a[o],n,`${r}/${o}`);if(!ja(l))return l}}if(i.if&&(i.then||i.else)){const s=e.isValid(n,i.if);if(s&&i.then){const s=Cl(e,t,i.then,n,r);if("string"==typeof s.type&&"error"!==s.type)return s}if(!s&&i.else){const s=Cl(e,t,i.else,n,r);if("string"==typeof s.type&&"error"!==s.type)return s}}if("object"===ka(i.patternProperties)){let e;const n=Object.keys(i.patternProperties);for(let r=0,s=n.length;r<s;r+=1)if(e=new RegExp(n[r]),e.test(t))return i.patternProperties[n[r]]}return"object"===ka(i.additionalProperties)?i.additionalProperties:!0===i.additionalProperties?wl(n[t]):Vo.unknownPropertyError({property:t,value:n,pointer:`${r}`})}};function Cl(e,t,i,n,r="#"){if(Array.isArray(i.type)){const s=ka(n);return i.type.includes(s)?Al[s](e,`${t}`,i,n,r):e.errors.typeError({value:n,pointer:r,expected:i.type,received:s})}const s=i.type||ka(n),a=Al[s];return a?a(e,`${t}`,i,n,r):new Error(`Unsupported schema type ${i.type} for key ${t}`)}var Dl=__webpack_require__(4063),kl=__webpack_require__.n(Dl);const jl={typeKeywords:{array:["enum","contains","items","minItems","maxItems","uniqueItems","not","if"],boolean:["enum","not"],object:["additionalProperties","dependencies","enum","format","minProperties","maxProperties","patternProperties","properties","propertyNames","required","not","oneOf","allOf","anyOf","if"],string:["enum","format","maxLength","minLength","pattern","not","oneOf","allOf","anyOf","if"],number:["enum","exclusiveMaximum","exclusiveMinimum","format","maximum","minimum","multipleOf","not","oneOf","allOf","anyOf","if"],null:["enum","format","not","oneOf","allOf","anyOf"]},validateKeyword:Sl,validateType:{array:(e,t,i,n)=>e.typeKeywords.array.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),object:(e,t,i,n)=>e.typeKeywords.object.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),string:(e,t,i,n)=>e.typeKeywords.string.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),integer:(e,t,i,n)=>e.typeKeywords.number.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),number:(e,t,i,n)=>e.typeKeywords.number.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),boolean:(e,t,i,n)=>e.typeKeywords.boolean.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n))),null:(e,t,i,n)=>e.typeKeywords.null.filter((e=>t&&null!=t[e])).map((r=>e.validateKeyword[r](e,t,i,n)))},validateFormat:ul,errors:Vo,addRemoteSchema:function(e,t,i){i.id=i.id||t,e.remotes[t]=e.compileSchema(i)},compileSchema:function(e,t,i=t,n=!1){if(!0===t||!1===t||void 0===t)return t;if(void 0!==t[Wo])return t;const r={ids:{},remotes:e.remotes},s=JSON.stringify(t),a=JSON.parse(s);if(Object.defineProperty(a,Wo,{enumerable:!1,value:!0}),Object.defineProperty(a,"getRef",{enumerable:!1,value:qo.bind(null,r,a)}),!1===n&&!1===s.includes("$ref"))return a;a!==i&&Object.defineProperty(a,"$defs",{enumerable:!0,value:Object.assign({},i.definitions,i.$defs,a.definitions,a.$defs)});const o={},l=()=>a;return Ro(a,((e,t)=>{var i;if(e.$id){if(e.$id.startsWith("http")&&/(allOf|anyOf|oneOf)\/\d+$/.test(t)){const n=t.replace(/\/(allOf|anyOf|oneOf)\/\d+$/,""),r=(0,qa.get)(a,n);e.$id=null!==(i=r.$id)&&void 0!==i?i:e.$id}r.ids[e.$id.replace(Zo,"")]=t}const n=(t=`#${t}`.replace(/##+/,"#")).replace(/\/[^/]+$/,""),s=t.replace(/\/[^/]+\/[^/]+$/,""),c=$o(o[n]||o[s],e.$id);o[t]=c,null==r.ids[c]&&(r.ids[c]=t),e.$ref&&!e.__ref&&(Object.defineProperty(e,"__ref",{enumerable:!1,value:$o(c,e.$ref)}),Object.defineProperty(e,"getRoot",{enumerable:!1,value:l}))})),a},createSchemaOf:wl,each:function(e,t,i,n=e.rootSchema,r="#"){n=e.resolveRef(n),i(n,t,r);const s=ka(t);"object"===s?Object.keys(t).forEach((s=>{const a=e.step(s,n,t,r),o=t[s];e.each(o,i,a,`${r}/${s}`)})):"array"===s&&t.forEach(((s,a)=>{const o=e.step(a,n,t,r);e.each(s,i,o,`${r}/${a}`)}))},eachSchema:Ro,getChildSchemaSelection:function(e,t,i=e.rootSchema){const n=e.step(t,i,{},"#");return ja(n)?"one-of-error"===n.code?n.data.oneOf.map((t=>e.resolveRef(t))):n:[n]},getSchema:function(e,t,i,n=e.rootSchema){const r=Wa().split(t);return n=e.resolveRef(n),Va(e,n,r,t,i)},getTemplate:(e,t,i=e.rootSchema,n=dl)=>(hl={mi:{}},ml(e,t,i,"#",n)),isValid:function(e,t,i=e.rootSchema,n="#"){return 0===e.validate(t,i,n).length},resolveAllOf:function(e,t,i=e.rootSchema,n="#"){let r=Ra(i);for(let n=0;n<i.allOf.length;n+=1){s=r,a=$a(e,i.allOf[n],t),r=Fa()(s,a,{arrayMerge:Ba}),t=e.getTemplate(t,r)}var s,a;return delete r.allOf,r},resolveAnyOf:function(e,t,i=e.rootSchema,n="#"){let r=!1,s=Ra(i);for(let a=0;a<i.anyOf.length;a+=1){const o=e.resolveRef(i.anyOf[a]);e.isValid(t,i.anyOf[a],n)&&(r=!0,s=Ya(s,o))}return!1===r?Vo.anyOfError({value:t,pointer:n,anyOf:JSON.stringify(i.anyOf)}):(delete s.anyOf,s)},resolveOneOf:function(e,t,i=e.rootSchema,n="#"){if(null!=t&&i[Pa]){const r=[],s=i[Pa],a=t[i[Pa]];if(void 0===a)return e.errors.missingOneOfPropertyError({property:s,pointer:n});for(let o=0;o<i.oneOf.length;o+=1){const l=e.resolveRef(i.oneOf[o]),c=e.step(s,l,t,n);if(ja(c))return c;let u=_a(e.validate(a,c,n));if(u=u.filter(xa),!(u.length>0))return l;r.push(...u)}return e.errors.oneOfPropertyError({property:s,value:a,pointer:n,errors:r})}const r=[],s=[];for(let a=0;a<i.oneOf.length;a+=1){const o=e.resolveRef(i.oneOf[a]);let l=_a(e.validate(t,o,n));l=l.filter(xa),l.length>0?s.push(...l):r.push(o)}return 1===r.length?r[0]:r.length>1?e.errors.multipleOneOfError({value:t,pointer:n,matches:r}):e.errors.oneOfError({value:JSON.stringify(t),pointer:n,oneOf:i.oneOf,errors:s})},resolveRef:function(e,t){return null==e||null==e.$ref?e:e.getRoot?e.getRoot().getRef(e):t.getRef(e)},step:Cl,validate:function(e,t,i=e.rootSchema,n="#"){if("boolean"===ka(i=e.resolveRef(i)))return i?[]:[e.errors.invalidDataError({value:t,pointer:n})];if(ja(i))return[i];if(void 0!==i.const)return kl()(i.const,t)?[]:[e.errors.constError({value:t,expected:i.const,pointer:n})];const r=function(e,t){const i=ka(e);return"number"===i&&("integer"===t||Array.isArray(t)&&t.includes("integer"))?Number.isInteger(e)||isNaN(e)?"integer":"number":i}(t,i.type),s=i.type||r;return r===s||Array.isArray(s)&&s.includes(r)?null==e.validateType[r]?[e.errors.invalidTypeError({receivedType:r,pointer:n})]:_a(e.validateType[r](e,i,t,n)).filter(xa):[e.errors.typeError({received:r,expected:s,value:t,pointer:n})]}};class xl{constructor(e,t){this.remotes={},this.errors={},this.typeKeywords={},this.validateKeyword={},this.validateType={},this.validateFormat={},this.config=e,this.typeKeywords=JSON.parse(JSON.stringify(e.typeKeywords)),this.validateKeyword=Object.assign({},e.validateKeyword),this.validateType=Object.assign({},e.validateType),this.validateFormat=Object.assign({},e.validateFormat),this.errors=Object.assign({},e.errors),this.setSchema(t)}get rootSchema(){return this.__rootSchema}set rootSchema(e){null!=e&&(this.__rootSchema=this.config.compileSchema(this,e))}addRemoteSchema(e,t){this.config.addRemoteSchema(this,e,t)}compileSchema(e){var t;return this.config.compileSchema(this,e,null!==(t=this.rootSchema)&&void 0!==t?t:e)}createSchemaOf(e){return this.config.createSchemaOf(e)}each(e,t,i,n){return this.config.each(this,e,t,i,n)}eachSchema(e,t=this.rootSchema){return this.config.eachSchema(t,e)}getChildSchemaSelection(e,t){return this.config.getChildSchemaSelection(this,e,t)}getSchema(e="#",t,i){return this.config.getSchema(this,e,t,i)}getTemplate(e,t,i){return this.config.getTemplate(this,e,t,i)}isValid(e,t,i){return this.config.isValid(this,e,t,i)}resolveAnyOf(e,t,i){return this.config.resolveAnyOf(this,e,t,i)}resolveAllOf(e,t,i){return this.config.resolveAllOf(this,e,t,i)}resolveRef(e){return this.config.resolveRef(e,this.rootSchema)}resolveOneOf(e,t,i){return this.config.resolveOneOf(this,e,t,i)}setSchema(e){this.rootSchema=e}step(e,t,i,n){return this.config.step(this,e,t,i,n)}validate(e,t,i){return this.config.validate(this,e,t,i)}}var _l=function(){function e(){i(this,e)}return r(e,null,[{key:"validate",value:function(e,t,i){return!(new xl(this.type[e],t).validate(i).length>0&&(console.error("Schema Validation Errors!"),1))}}]),e}();s(_l,"type",{init:jl});const Ol=JSON.parse('{"type":"object","required":["version","body"],"properties":{"version":{"type":["integer","string"],"nullable":false},"body":{"type":"object"}}}');var Pl=__webpack_require__.t(Ol,2),Rl=function(){function e(){i(this,e)}return r(e,[{key:"set",value:function(e,t){var i=e.plyr.elements.container,n=e.plyr.elements.controls,r=i.nextElementSibling,a=n.querySelector(".lt-player__additional-info"),o=e,l=function(e){return e?e.querySelectorAll("button"):null},c=null,u=l(r),h=l(a);0!==(c="in"==t?h:u).length&&c.forEach((function(t){t.addEventListener("click",(function(i){i.preventDefault();var n,r,a,l=t.dataset.ltTarget,c=o.additionalData;void 0!==c[l]&&(r=l,null,a="object"===d(n=c[l])?e.templateService.getAdditionalInfo(s({desktop:!0,modal:!0,id:"".concat(r,"-").concat(e.playerInstance.playerConfig.getPlayerId()),object_data:!0},r,n)):e.templateService.getAdditionalInfo({desktop:!0,modal:!0,id:"".concat(r,"-").concat(e.playerInstance.playerConfig.getPlayerId()),data:n}),document.querySelector("body").insertAdjacentHTML("afterend",a));var u=document.querySelector(".lt-modal-".concat(l,"-").concat(o.playerInstance.playerConfig.getPlayerId()));u&&(u.classList.add("player-lt__show-modal"),document.body.classList.add("overflow-hidden-body-important")),window.Player.players.forEach((function(e){if(e.plyr.playing)return o.playerInstance.pausedPlayer=e.plyr,void e.plyr.pause()}))}))}))}},{key:"windowDesktopEvents",value:function(e,t){var i=document.querySelectorAll(".player-lt__modal");0!==i.length&&i.forEach((function(t){if(t.classList.contains("player-lt__show-modal")){var i=e.target;(i.classList.contains("player-lt__show-modal")||i.classList.contains("player-lt__close-button"))&&(t.classList.remove("player-lt__show-modal"),document.body.classList.remove("overflow-hidden-body-important"),document.querySelectorAll(".player-lt__modal").forEach((function(e){return e.remove()})),window.Player.players.forEach((function(e){if(void 0!==e.pausedPlayer)return e.pausedPlayer.isEmbed&&e.pausedPlayer.embed.play().then((function(){})).catch((function(){})),e.pausedPlayer.isHTML5?void e.pausedPlayer.play():void 0})))}}))}}]),e}(),zl=function(){function e(){i(this,e)}return r(e,[{key:"set",value:function(e){var t=e.plyr.elements.container.querySelector(".lt-player__additional-info-mobile"),i=e,n=this,r=t.querySelectorAll("button");0!==r.length&&r.forEach((function(t){var r=e.playerInstance.eventInstance.mobileEvents.setMobileEvent(t);r&&r.on("singletap",(function(r){r.preventDefault();var a,o,l,c=t.dataset.ltTarget,u=i.additionalData;void 0!==u[c]&&(o=c,null,l="object"===d(a=u[c])?e.templateService.getAdditionalInfo(s({desktop:!0,modal:!0,id:"".concat(o,"-").concat(e.playerInstance.playerConfig.getPlayerId()),object_data:!0},o,a)):e.templateService.getAdditionalInfo({desktop:!0,modal:!0,id:"".concat(o,"-").concat(e.playerInstance.playerConfig.getPlayerId()),data:a}),document.querySelector("body").insertAdjacentHTML("afterend",l));var h=document.querySelector(".lt-modal-".concat(c,"-").concat(i.playerInstance.playerConfig.getPlayerId()));h&&(h.classList.add("player-lt__show-modal"),document.body.classList.add("overflow-hidden-body-important")),window.Player.players.forEach((function(e){if(e.plyr.playing)return i.playerInstance.pausedPlayer=e.plyr,void e.plyr.pause()})),n.closeModal(e)}))}))}},{key:"closeModal",value:function(e){var t=document.querySelectorAll(".player-lt__modal");0!==t.length&&t.forEach((function(t){e.playerInstance.eventInstance.mobileEvents.setMobileEvent(t).on("singletap",(function(e){var i=e.target;t.classList.contains("player-lt__show-modal")&&(i.classList.contains("player-lt__show-modal")||i.classList.contains("player-lt__close-button"))&&(t.classList.remove("player-lt__show-modal"),document.body.classList.remove("overflow-hidden-body-important"),document.querySelectorAll(".player-lt__modal").forEach((function(e){return e.remove()})),window.Player.players.forEach((function(e){if(void 0!==e.pausedPlayer)return e.pausedPlayer.isEmbed&&e.pausedPlayer.embed.play().then((function(){})).catch((function(){})),e.pausedPlayer.isHTML5?void e.pausedPlayer.play():void 0})))}))}))}}]),e}();function Fl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=p(e);if(t){var r=p(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return h(this,i)}}var Ul,Yl=function(){function e(){i(this,e),s(this,"container",void 0),s(this,"additionalData",{}),s(this,"playerId",void 0),s(this,"templateService",void 0),s(this,"iconService",void 0),s(this,"plyr",void 0),s(this,"playerInstance",void 0),s(this,"players",void 0),s(this,"device",void 0),s(this,"addInfoType",void 0),s(this,"desktopEvents",void 0),s(this,"mobileEvents",void 0),this.setDesktopEvents(),this.setMobileEvents()}return r(e,[{key:"setDesktopEvents",value:function(){this.desktopEvents=new Rl}},{key:"setMobileEvents",value:function(){this.mobileEvents=new zl}}]),e}();!function(e){var t=function(e){u(n,e);var t=Fl(n);function n(){var e;i(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"activePlayer",void 0),e}return r(n,[{key:"setContainer",value:function(e){this.container=e,this.setDataContent()}},{key:"setDataContent",value:function(){var e=this,t=this.container.children;0!==t.length&&Array.from(t).forEach((function(t){t.hasAttribute("data-lt-player-additional-info-target")&&Object.assign(e.additionalData,s({},t.dataset.ltPlayerAdditionalInfoTarget,t.innerHTML))}))}},{key:"setConfig",value:function(e){var t=this;Object.keys(e).forEach((function(i){Object.keys(e[i]).length>0&&Object.assign(t.additionalData,s({},i,e[i]))}))}},{key:"init",value:function(e,t,i,n){0!==Object.keys(this.additionalData).length&&(this.playerInstance=e,this.plyr=e.plyr,this.playerId=t,this.iconService=i,this.templateService=n,this.device=e.playerConfig.getDevice(),this.setPlayerType())}},{key:"setPlayerType",value:function(){switch(this.playerInstance.playerConfig.getPlayerType()){case 1:case"1":case"portrait":this.addInfoType=(new Ul.Portrate).setAddInfo(this);break;case 2:case"2":case"landscape":this.addInfoType=new Ul.Landscape}}},{key:"setCurrentPlayerPlay",value:function(e,t){this.activePlayer=t.detail.plyr}},{key:"remove",value:function(e){var t=document.querySelectorAll(".player-lt__modal");0!==t.length&&t.forEach((function(e){e.remove()})),e.playerConfig.getPlayerElementContainer().querySelector(".lt-player__additional-info").remove()}}]),n}(Yl);e.Controller=t;var n=function(e){u(n,e);var t=Fl(n);function n(){var e;i(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"controller",void 0),e}return r(n,[{key:"setAddInfo",value:function(e){var t=this;switch(this.controller=e,this.controller.device){case"mobile":this.controller.plyr.on("ready",(function(){t.mobile()}));break;case"desktop":this.desktop()}return this}},{key:"mobile",value:function(){var e,t=this.controller.iconService.getIconsByComponent("additionalInfo"),i=this.controller.plyr.elements.controls.querySelector(".content__body"),n=[];Object.keys(this.controller.additionalData).forEach((function(e){switch(e){case"abstract":n.push({target:e,icon:t["file-text"]});break;case"bio":n.push({target:e,icon:t.user});break;case"institution":n.push({target:e,icon:t.university});break;default:n.push({target:e,icon:null})}})),e=this.controller.templateService.getAdditionalInfoButtons({mobile:!0,exist:"true",buttons:n}),i.insertAdjacentHTML("afterend",e),this.mobileEvents.set(this.controller)}},{key:"desktop",value:function(){var e,t=this.controller.iconService.getIconsByComponent("additionalInfo"),i=[];Object.keys(this.controller.additionalData).forEach((function(e){switch(e){case"abstract":i.push({target:e,icon:t["file-text"]});break;case"bio":i.push({target:e,icon:t.user});break;case"institution":i.push({target:e,icon:t.university});break;default:i.push({target:e,icon:null})}})),e=this.controller.templateService.getAdditionalInfoButtons({desktop:!0,exist:"true",buttons:i}),this.controller.playerInstance.windowService.setEventAddInfo(e,this.desktopEvents,this.controller)}}]),n}(t);e.Portrate=n;var a=function(e){u(n,e);var t=Fl(n);function n(){var e;i(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return s(l(e=t.call.apply(t,[this].concat(a))),"controller",void 0),e}return r(n,[{key:"setAddInfo",value:function(){}},{key:"mobileTouchEvent",value:function(){}}]),n}(t);e.Landscape=a}(Ul||(Ul={})),J.Player;var Bl=function(){function e(){i(this,e),s(this,"additionalInfoService",void 0)}return r(e,[{key:"checkIfPlayerExists",value:function(e){var t=!1;return e.body.playerContainer instanceof HTMLElement&&(t=!e.body.playerContainer.classList.contains("is-loaded")),t}},{key:"init",value:function(e){var t=this;if(Z.setDebugEvent("Start init player","info"),!e||0===Object.keys(e).length)return Z.setDebugEvent("Lt Player: The config object is empty","error"),Z.setDebugEvent("Use one of below examples","error"),void Z.setDebugEvent({Example_1:'Use object to configure player (Player.init({versions : "Player versions", body : {player configure body}}))',Example_2:'Use HTML dataset attribute to configure Player (data-lt-player-config="{versions : "Player versions", body : {player configure body}"))'},"table");if(_l.validate("init",Pl,e)){if(Z.setDebugEvent("Validate player config","info"),"string"==typeof e.body.playerContainer){var i=document.querySelector(".".concat(e.body.playerContainer,", #").concat(e.body.playerContainer));if(!i)return void console.error("No Element found with ".concat(e.body.playerContainer));e.body.playerContainer=i}e.body.device=Z.getDevice();var n,r=e.body.playerContainer;return r.classList.add("lt-player"),r.classList.add("is-loaded"),this.setAdditionalInfo(e),void 0===e.body.playerType?"string"==typeof(n=e.version)&&1===parseInt(n)||"number"==typeof n&&1===n?new Promise((function(i,n){e.body.playerType=2,i(t.setType(e,r)),n(null)})):new Promise((function(i,n){e.body.playerType=t.getVideoTypeByUrl(e.body.videoUrl).then((function(n){e.body.playerType=n,i(t.setType(e,r))}))})):new Promise((function(i,n){i(t.setType(e,r)),n(null)}))}}},{key:"setType",value:function(e,t){var i=this.setPlayerType(e.body.playerType);if(i){if(i.setup(e,this.additionalInfoService))return e.body.playerContainer=i,this.additionalInfoService=null,i}else console.error('No "playerType" is set in config!')}},{key:"getVideoTypeByUrl",value:function(e){var t,i=Z.processConfigData(e);switch(i.type){case"embedded":return i.embedId=Z.getEmbeddedID(e),i.embedHash=Z.getEmbeddedHash(e),function(e){return new Promise((function(t,i){fetch("https://vimeo.com/api/oembed.json?url=".concat(e)).then((function(e){t(e.json())}),(function(e){i(e)}))}))}(e).then((function(e){return new Promise((function(t,i){var n=e;n.width>n.height?t("landscape"):t("portrait")}))}));case"video":return(t=document.createElement("video")).src=e,e.includes(".m3u8")?new Promise((function(e){e("portrait")})):new Promise((function(e){t.addEventListener("loadedmetadata",(function(t){this.videoWidth>this.videoHeight?e("landscape"):e("portrait")}),!1)}))}}},{key:"setAdditionalInfo",value:function(e){var t=e.body.playerContainer.querySelector(".lt-player-additional-info");return t?(this.additionalInfoService=new Ul.Controller,void this.additionalInfoService.setContainer(t)):void 0!==e.body.additionalInfo&&Object.keys(e.body.additionalInfo).length>0?(this.additionalInfoService=new Ul.Controller,void this.additionalInfoService.setConfig(e.body.additionalInfo)):void(this.additionalInfoService=null)}},{key:"setPlayerType",value:function(e){var t=null;switch(e){case"1":case 1:case"portrait":t=new ba.PortraitType;break;case"2":case 2:case"landscape":t=new ba.LandscapeType}return t}}]),e}(),$l=function(){function e(){i(this,e),s(this,"players",[]),this.initPageDomElements()}var n;return r(e,[{key:"initPageDomElements",value:function(){var e,t=this;0!==(e=document.querySelectorAll(".".concat("lt-player",", #").concat("lt-player"))).length&&(e=document.querySelectorAll("[data-lt-player-config]")),0!==e.length&&e.forEach((function(e){t.initBySelector(e)}))}},{key:"initByClassOrID",value:function(e,t){var i=this;if("string"==typeof e){var n=document.querySelector(".".concat(e,", #").concat(e));if(n)return new Promise((function(e){i.initBySelector(n,t).then((function(t){e(t)}))}))}else console.error("Identifier has another type of")}},{key:"initBySelector",value:function(e,t){var i,n=this,r=e.dataset.ltPlayerConfig;return r||(r=t),void 0!==r?(i="string"==typeof r?JSON.parse(r):r,Object.assign(i.body,{playerContainer:e}),new Promise((function(e){n.initPlayer(i).then((function(t){e(t)}))}))):new Promise((function(t,i){console.error('Lt Player: No "data-lt-player-config" attribute is set on element!'),console.log(e),console.error("Use one of below examples"),console.table({Example_1:'<div class="lt-player" data-lt-player-config="{config}"> </div>'}),i()}))}},{key:"initPlayer",value:function(e){var t=this,i=new Bl;return new Promise((function(n,r){if(i.checkIfPlayerExists(e)){var s=i.init(e);s?s.then((function(e){t.players.push(e),n(e)})):r("Player is not setup")}else r("Duplicate player")}))}},{key:"getPlayer",value:function(e){var t=this;if(0===this.players.length)return null;var i=function(e){var i=null;return t.players.forEach((function(t){t.playerConfig.getConfigData().playerId===e&&(i=t)})),i};return"string"==typeof e?i(parseInt(e)):"number"==typeof e?i(e):e instanceof Element?function(e){var i=null,n=e.playerManager;return t.players.forEach((function(e){e===n&&(i=e)})),i}(e):void 0}},{key:"getPlayerByExternalId",value:function(e){if(0===this.players.length)return null;var t=null;return this.players.forEach((function(i){i.playerConfig.getConfigData().externalId==e&&(t=i)})),t}},{key:"pauseAllPlayers",value:function(){this.players.forEach((function(e){e.plyr.playing&&e.plyr.pause()}))}},{key:"stopAllPlayers",value:function(){this.players.forEach((function(e){e.plyr.playing&&e.plyr.stop()}))}},{key:"destruct",value:(n=t(o().mark((function e(){var i,n,r,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=function(){var e=t(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.destruct();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n=function(){var e=t(o().mark((function e(t,i){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<t.length)){e.next=7;break}return e.next=4,i(t[n]);case 4:n++,e.next=1;break;case 7:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}(),r=function(){var e=t(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(s.players,function(){var e=t(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),e.abrupt("return",r().then((function(){s.players=[],console.clear()})));case 4:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})}]),e}();"container"in document.documentElement.style||__webpack_require__(5266),void 0===window.Player&&(window.Player=new $l)})()})();
|
|
3
3
|
//# sourceMappingURL=lt-player-main.js.map
|