@gumlet/insights-js-core 1.1.38 → 1.1.40
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see gumlet-insights.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var i in a)("object"==typeof exports?exports:t)[i]=a[i]}}(self,(()=>(()=>{var t={363:(t,e)=>{var a;a={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(t,e){var i="string"==typeof t.initial?{state:t.initial}:t.initial,s=t.terminal||t.final,n=e||t.target||{},r=t.events||[],o=t.callbacks||{},l={},c={},u=function(t){var e=Array.isArray(t.from)?t.from:t.from?[t.from]:[a.WILDCARD];l[t.name]=l[t.name]||{};for(var i=0;i<e.length;i++)c[e[i]]=c[e[i]]||[],c[e[i]].push(t.name),l[t.name][e[i]]=t.to||e[i];t.to&&(c[t.to]=c[t.to]||[])};i&&(i.event=i.event||"startup",u({name:i.event,from:"none",to:i.state}));for(var h=0;h<r.length;h++)u(r[h]);for(var E in l)l.hasOwnProperty(E)&&(n[E]=a.buildEvent(E,l[E]));for(var E in o)o.hasOwnProperty(E)&&(n[E]=o[E]);return n.current="none",n.is=function(t){return Array.isArray(t)?t.indexOf(this.current)>=0:this.current===t},n.can=function(t){return!this.transition&&void 0!==l[t]&&(l[t].hasOwnProperty(this.current)||l[t].hasOwnProperty(a.WILDCARD))},n.cannot=function(t){return!this.can(t)},n.transitions=function(){return(c[this.current]||[]).concat(c[a.WILDCARD]||[])},n.isFinished=function(){return this.is(s)},n.error=t.error||function(t,e,a,i,s,n,r){throw r||n},n.states=function(){return Object.keys(c).sort()},i&&!i.defer&&n[i.event](),n},doCallback:function(t,e,i,s,n,r){if(e)try{return e.apply(t,[i,s,n].concat(r))}catch(e){return t.error(i,s,n,r,a.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",e)}},beforeAnyEvent:function(t,e,i,s,n){return a.doCallback(t,t.onbeforeevent,e,i,s,n)},afterAnyEvent:function(t,e,i,s,n){return a.doCallback(t,t.onafterevent||t.onevent,e,i,s,n)},leaveAnyState:function(t,e,i,s,n){return a.doCallback(t,t.onleavestate,e,i,s,n)},enterAnyState:function(t,e,i,s,n){return a.doCallback(t,t.onenterstate||t.onstate,e,i,s,n)},changeState:function(t,e,i,s,n){return a.doCallback(t,t.onchangestate,e,i,s,n)},beforeThisEvent:function(t,e,i,s,n){return a.doCallback(t,t["onbefore"+e],e,i,s,n)},afterThisEvent:function(t,e,i,s,n){return a.doCallback(t,t["onafter"+e]||t["on"+e],e,i,s,n)},leaveThisState:function(t,e,i,s,n){return a.doCallback(t,t["onleave"+i],e,i,s,n)},enterThisState:function(t,e,i,s,n){return a.doCallback(t,t["onenter"+s]||t["on"+s],e,i,s,n)},beforeEvent:function(t,e,i,s,n){if(!1===a.beforeThisEvent(t,e,i,s,n)||!1===a.beforeAnyEvent(t,e,i,s,n))return!1},afterEvent:function(t,e,i,s,n){a.afterThisEvent(t,e,i,s,n),a.afterAnyEvent(t,e,i,s,n)},leaveState:function(t,e,i,s,n){var r=a.leaveThisState(t,e,i,s,n),o=a.leaveAnyState(t,e,i,s,n);return!1!==r&&!1!==o&&(a.ASYNC===r||a.ASYNC===o?a.ASYNC:void 0)},enterState:function(t,e,i,s,n){a.enterThisState(t,e,i,s,n),a.enterAnyState(t,e,i,s,n)},buildEvent:function(t,e){return function(){var i=this.current,s=e[i]||(e[a.WILDCARD]!=a.WILDCARD?e[a.WILDCARD]:i)||i,n=Array.prototype.slice.call(arguments);if(this.transition)return this.error(t,i,s,n,a.Error.PENDING_TRANSITION,"event "+t+" inappropriate because previous transition did not complete");if(this.cannot(t))return this.error(t,i,s,n,a.Error.INVALID_TRANSITION,"event "+t+" inappropriate in current state "+this.current);if(!1===a.beforeEvent(this,t,i,s,n))return a.Result.CANCELLED;if(i===s)return a.afterEvent(this,t,i,s,n),a.Result.NOTRANSITION;var r=this;this.transition=function(){return r.transition=null,r.current=s,a.enterState(r,t,i,s,n),a.changeState(r,t,i,s,n),a.afterEvent(r,t,i,s,n),a.Result.SUCCEEDED},this.transition.cancel=function(){r.transition=null,a.afterEvent(r,t,i,s,n)};var o=a.leaveState(this,t,i,s,n);return!1===o?(this.transition=null,a.Result.CANCELLED):a.ASYNC===o?a.Result.PENDING:this.transition?this.transition():void 0}}},t.exports&&(e=t.exports=a),e.StateMachine=a},795:function(t,e,a){var i;t=a.nmd(t),function(){"use strict";var s={function:!0,object:!0},n=s[typeof window]&&window||this,r=s[typeof e]&&e,o=s.object&&t&&!t.nodeType&&t,l=r&&o&&"object"==typeof a.g&&a.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(n=l);var c=Math.pow(2,53)-1,u=/\bOpera/,h=Object.prototype,E=h.hasOwnProperty,m=h.toString;function S(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function d(t){return t=_(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:S(t)}function p(t,e){for(var a in t)E.call(t,a)&&e(t[a],a,t)}function f(t){return null==t?S(t):m.call(t).slice(8,-1)}function A(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function y(t,e){var a=null;return function(t,e){var a=-1,i=t?t.length:0;if("number"==typeof i&&i>-1&&i<=c)for(;++a<i;)e(t[a],a,t);else p(t,e)}(t,(function(i,s){a=e(a,i,s,t)})),a}function _(t){return String(t).replace(/^ +| +$/g,"")}var v=function t(e){var a=n,i=e&&"object"==typeof e&&"String"!=f(e);i&&(a=e,e=null);var s=a.navigator||{},r=s.userAgent||"";e||(e=r);var o,l,c,h,E,S=i?!!s.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(m.toString()),v="Object",N=i?v:"ScriptBridgingProxyObject",T=i?v:"Environment",D=i&&a.java?"JavaPackage":f(a.java),g=i?v:"RuntimeObject",I=/\bJava/.test(D)&&a.java,b=I&&f(a.environment)==T,C=I?"a":"α",P=I?"b":"β",U=a.document||{},G=a.operamini||a.opera,R=u.test(R=i&&G?G["[[Class]]"]:f(G))?R:G=null,L=e,k=[],Y=null,O=e==r,F=O&&G&&"function"==typeof G.version&&G.version(),M=y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(t,a){return t||RegExp("\\b"+(a.pattern||A(a))+"\\b","i").exec(e)&&(a.label||a)})),w=function(t){return y(t,(function(t,a){return t||RegExp("\\b"+(a.pattern||A(a))+"\\b","i").exec(e)&&(a.label||a)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),H=B([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function(t){return y(t,(function(t,a,i){return t||(a[H]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(H)]||RegExp("\\b"+A(i)+"(?:\\b|\\w*\\d)","i").exec(e))&&i}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),V=function(t){return y(t,(function(t,a){var i=a.pattern||A(a);return!t&&(t=RegExp("\\b"+i+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,a){var i={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(i=i[/[\d.]+$/.exec(t)])&&(t="Windows "+i),t=String(t),e&&a&&(t=t.replace(RegExp(e,"i"),a)),d(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,i,a.label||a)),t}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function B(t){return y(t,(function(t,a){var i=a.pattern||A(a);return!t&&(t=RegExp("\\b"+i+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+i+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+i+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(a.label&&!RegExp(i,"i").test(a.label)?a.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),a=a.label||a,t=d(t[0].replace(RegExp(i,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),t}))}function W(t){return y(t,(function(t,a){return t||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null}))}if(M&&(M=[M]),/\bAndroid\b/.test(V)&&!H&&(o=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(H=_(o[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!H?H=B([K]):K&&H&&(H=H.replace(RegExp("^("+A(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+A(K)+")[-_.]?(\\w)","i"),K+" $2")),(o=/\bGoogle TV\b/.exec(H))&&(H=o[0]),/\bSimulator\b/i.test(e)&&(H=(H?H+" ":"")+"Simulator"),"Opera Mini"==w&&/\bOPiOS\b/.test(e)&&k.push("running in Turbo/Uncompressed mode"),"IE"==w&&/\blike iPhone OS\b/.test(e)?(K=(o=t(e.replace(/like iPhone OS/,""))).manufacturer,H=o.product):/^iP/.test(H)?(w||(w="Safari"),V="iOS"+((o=/ OS ([\d_]+)/i.exec(e))?" "+o[1].replace(/_/g,"."):"")):"Konqueror"==w&&/^Linux\b/i.test(V)?V="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(w)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(H))||/\bAndroid\b/.test(V)&&/^Chrome/.test(w)&&/\bVersion\//i.test(e)?(w="Android Browser",V=/\bAndroid\b/.test(V)?V:"Android"):"Silk"==w?(/\bMobi/i.test(e)||(V="Android",k.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&k.unshift("accelerated")):"UC Browser"==w&&/\bUCWEB\b/.test(e)?k.push("speed mode"):"PaleMoon"==w&&(o=/\bFirefox\/([\d.]+)\b/.exec(e))?k.push("identifying as Firefox "+o[1]):"Firefox"==w&&(o=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(V||(V="Firefox OS"),H||(H=o[1])):!w||(o=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(w))?(w&&!H&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(o+"/")+8))&&(w=null),(o=H||K||V)&&(H||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(V))&&(w=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(V)?V:o)+" Browser")):"Electron"==w&&(o=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&k.push("Chromium "+o),F||(F=W(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",A(w),"(?:Firefox|Minefield|NetFront)"])),(o=("iCab"==M&&parseFloat(F)>3?"WebKit":/\bOpera\b/.test(w)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(M)&&"WebKit"||!M&&/\bMSIE\b/i.test(e)&&("Mac OS"==V?"Tasman":"Trident")||"WebKit"==M&&/\bPlayStation\b(?! Vita\b)/i.test(w)&&"NetFront")&&(M=[o]),"IE"==w&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(w+=" Mobile",V="Windows Phone "+(/\+$/.test(o)?o:o+".x"),k.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(w="IE Mobile",V="Windows Phone 8.x",k.unshift("desktop mode"),F||(F=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=w&&"Trident"==M&&(o=/\brv:([\d.]+)/.exec(e))&&(w&&k.push("identifying as "+w+(F?" "+F:"")),w="IE",F=o[1]),O){if(h="global",E=null!=(c=a)?typeof c[h]:"number",/^(?:boolean|number|string|undefined)$/.test(E)||"object"==E&&!c[h])f(o=a.runtime)==N?(w="Adobe AIR",V=o.flash.system.Capabilities.os):f(o=a.phantom)==g?(w="PhantomJS",F=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof U.documentMode&&(o=/\bTrident\/(\d+)/i.exec(e))?(F=[F,U.documentMode],(o=+o[1]+4)!=F[1]&&(k.push("IE "+F[1]+" mode"),M&&(M[1]=""),F[1]=o),F="IE"==w?String(F[1].toFixed(1)):F[0]):"number"==typeof U.documentMode&&/^(?:Chrome|Firefox)\b/.test(w)&&(k.push("masking as "+w+" "+F),w="IE",F="11.0",M=["Trident"],V="Windows");else if(I&&(L=(o=I.lang.System).getProperty("os.arch"),V=V||o.getProperty("os.name")+" "+o.getProperty("os.version")),b){try{F=a.require("ringo/engine").version.join("."),w="RingoJS"}catch(t){(o=a.system)&&o.global.system==a.system&&(w="Narwhal",V||(V=o[0].os||null))}w||(w="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(o=a.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(k.push("Node "+o.versions.node),w="Electron",F=o.versions.electron):"string"==typeof o.versions.nw&&(k.push("Chromium "+F,"Node "+o.versions.node),w="NW.js",F=o.versions.nw)),w||(w="Node.js",L=o.arch,V=o.platform,F=(F=/[\d.]+/.exec(o.version))?F[0]:null));V=V&&d(V)}if(F&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(F)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(O&&s.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(Y=/b/i.test(o)?"beta":"alpha",F=F.replace(RegExp(o+"\\+?$"),"")+("beta"==Y?P:C)+(/\d+\+?/.exec(o)||"")),"Fennec"==w||"Firefox"==w&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(V))w="Firefox Mobile";else if("Maxthon"==w&&F)F=F.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(H))"Xbox 360"==H&&(V=null),"Xbox 360"==H&&/\bIEMobile\b/.test(e)&&k.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(w)&&(!w||H||/Browser|Mobi/.test(w))||"Windows CE"!=V&&!/Mobi/i.test(e))if("IE"==w&&O)try{null===a.external&&k.unshift("platform preview")}catch(t){k.unshift("embedded")}else(/\bBlackBerry\b/.test(H)||/\bBB10\b/.test(e))&&(o=(RegExp(H.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||F)?(V=((o=[o,/BB10/.test(e)])[1]?(H=null,K="BlackBerry"):"Device Software")+" "+o[0],F=null):this!=p&&"Wii"!=H&&(O&&G||/Opera/.test(w)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==w&&/\bOS X (?:\d+\.){2,}/.test(V)||"IE"==w&&(V&&!/^Win/.test(V)&&F>5.5||/\bWindows XP\b/.test(V)&&F>8||8==F&&!/\bTrident\b/.test(e)))&&!u.test(o=t.call(p,e.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(w)?(/\bIE\b/.test(o)&&"Mac OS"==V&&(V=null),o="identify"+o):(o="mask"+o,w=R?d(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(V=null),O||(F=null)),M=["Presto"],k.push(o));else w+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==w&&"+"==o[1].slice(-1)?(w="WebKit Nightly",Y="alpha",F=o[1].slice(0,-1)):F!=o[1]&&F!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(F=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==M&&(M=["Blink"]),O&&(S||o[1])?(M&&(M[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=M?"27":"28")):(M&&(M[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),M&&(M[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==w&&(!F||parseInt(F)>45)?F=o:"Chrome"==w&&/\bHeadlessChrome/i.test(e)&&k.unshift("headless")),"Opera"==w&&(o=/\bzbov|zvav$/.exec(V))?(w+=" ",k.unshift("desktop mode"),"zvav"==o?(w+="Mini",F=null):w+="Mobile",V=V.replace(RegExp(" *"+o+"$"),"")):"Safari"==w&&/\bChrome\b/.exec(M&&M[1])?(k.unshift("desktop mode"),w="Chrome Mobile",F=null,/\bOS X\b/.test(V)?(K="Apple",V="iOS 4.3+"):V=null):/\bSRWare Iron\b/.test(w)&&!F&&(F=W("Chrome")),F&&0==F.indexOf(o=/[\d.]+$/.exec(V))&&e.indexOf("/"+o+"-")>-1&&(V=_(V.replace(o,""))),V&&-1!=V.indexOf(w)&&!RegExp(w+" OS").test(V)&&(V=V.replace(RegExp(" *"+A(w)+" *"),"")),M&&!/\b(?:Avant|Nook)\b/.test(w)&&(/Browser|Lunascape|Maxthon/.test(w)||"Safari"!=w&&/^iOS/.test(V)&&/\bSafari\b/.test(M[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(w)&&M[1])&&(o=M[M.length-1])&&k.push(o),k.length&&(k=["("+k.join("; ")+")"]),K&&H&&H.indexOf(K)<0&&k.push("on "+K),H&&k.push((/^on /.test(k[k.length-1])?"":"on ")+H),V&&(o=/ ([\d.+]+)$/.exec(V),l=o&&"/"==V.charAt(V.length-o[0].length-1),V={architecture:32,family:o&&!l?V.replace(o[0],""):V,version:o?o[1]:null,toString:function(){var t=this.version;return this.family+(t&&!l?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(V&&(V.architecture=64,V.family=V.family.replace(RegExp(" *"+o),"")),w&&(/\bWOW64\b/i.test(e)||O&&/\w(?:86|32)$/.test(s.cpuClass||s.platform)&&!/\bWin64; x64\b/i.test(e))&&k.unshift("32-bit")):V&&/^OS X/.test(V.family)&&"Chrome"==w&&parseFloat(F)>=39&&(V.architecture=64),e||(e=null);var j={};return j.description=e,j.layout=M&&M[0],j.manufacturer=K,j.name=w,j.prerelease=Y,j.product=H,j.ua=e,j.version=w&&F,j.os=V||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=t,j.toString=function(){return this.description||""},j.version&&k.unshift(F),j.name&&k.unshift(w),V&&w&&(V!=String(V).split(" ")[0]||V!=w.split(" ")[0]&&!H)&&k.push(H?"("+V+")":"on "+V),k.length&&(j.description=k.join(" ")),j}();n.platform=v,void 0===(i=function(){return v}.call(e,a,e,t))||(t.exports=i)}.call(this)}},e={};function a(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}a.r(i),a.d(i,{default:()=>ra});var e=function(){return(new Date).getTime()},s=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16).toUpperCase()}))},n=function(t,e){var a,i=0;return function(){return i>=e||(a=t.apply(null,arguments),i++),a}};const r={validString:function(t){return null!=t&&"string"==typeof t},validBoolean:function(t){return null!=t&&"boolean"==typeof t},validNumber:function(t){return null!=t&&"number"==typeof t},sanitizePath:function(t){return t.replace(/\/$/g,"")},calculateTime:function(t){return t*=1e3,Math.round(t)},getCurrentTimestamp:e,getDurationFromTimestampToNow:function(t){return e()-t},uuidv4:s,getCookie:function(t){var e=t+"=",a=[];try{a=document.cookie.split(";")}catch(t){return""}for(var i="",s=0;s<a.length;s++){for(var n=a[s];" "==n.charAt(0);)n=n.substring(1);0==n.indexOf(e)&&(i=n.substring(e.length,n.length))}if(!i){try{i=localStorage.getItem(t)}catch(t){return""}var r=null;if(!i)return"";try{r=JSON.parse(i)}catch(t){return""}var o=null;if(!r.expires)return"";if(o=new Date(r.expires),"[object Date]"!==Object.prototype.toString.call(o))return"";if(isNaN(o))return"";if(!(o.getTime()>(new Date).getTime()))return"";i=r.value?r.value:""}return i},setCookie:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new Date;i.setTime(i.getTime()+60*e*1e3);var n=a||s();try{document.cookie=t+"="+n+"; expires="+i.toUTCString()+"; path=/",localStorage.setItem(t,JSON.stringify({expires:i.getTime(),value:n}))}catch(t){}return n},noOp:function(){},times:n,once:function(t){return n(t,1)},getHiddenProp:function(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if(t[e]+"Hidden"in document)return t[e]+"Hidden";return null},getCustomDataString:function e(a){return"object"===t(a)?JSON.stringify(a):"function"==typeof a?e(a()):void 0===a?a:"string"!=typeof a?String(a):a},jsonToQueryString:function(t){return"?"+Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},currentDateTimeFormatString:function(){return(new Date).toISOString()}};function o(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,a=[{key:"get",value:function(t,e,a){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.z=(new Date).getTime()/1e3;var s=[void 0,null,!1];if(Object.keys(e).forEach((function(t){return-1!==s.indexOf(e[t])&&delete e[t]})),Object.keys(e).forEach((function(t){return e[t]!=e[t]&&delete e[t]})),navigator&&navigator.sendBeacon)fetch(t,{method:"POST",body:JSON.stringify([e]),headers:{"Content-Type":"application/json"}});else{var n,o=!1;window.XDomainRequest&&(o=!0),n=o?new window.XDomainRequest:new XMLHttpRequest;var l=function(){if(n.readyState==XMLHttpRequest.DONE){if(n.responseText<=0)return;var t=JSON.parse(n.responseText);a(t)}};o?n.onload=l:n.onreadystatechange=l;var c=r.jsonToQueryString(e);t+=c,n.open("GET",t,i),n.send(null)}}},{key:"asyncGet",value:function(t,e){return new Promise((function(a,i){e.z=(new Date).getTime()/1e3;var s=[void 0,null,!1];if(Object.keys(e).forEach((function(t){return-1!==s.indexOf(e[t])&&delete e[t]})),Object.keys(e).forEach((function(t){return e[t]!=e[t]&&delete e[t]})),navigator&&navigator.sendBeacon)fetch(t,{method:"POST",body:JSON.stringify([e]),headers:{"Content-Type":"application/json"}});else{var n,o=!1;window.XDomainRequest&&(o=!0),(n=o?new window.XDomainRequest:new XMLHttpRequest).onload=function(){this.status>=200&&this.status<300?a(n.response):i({status:this.status,statusText:n.statusText})};var l=r.jsonToQueryString(e);t+=l,n.open("GET",t),n.onerror=function(){i({status:this.status,statusText:n.statusText})},n.send()}}))}}],a&&o(e.prototype,a),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var c="urn:x-cast:com.gumlet.ingest.cast",u="https://ingest.gumlytics.com",h=1e4;function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function m(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function S(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){return d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},d(t,e)}function p(t){var e=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(t){return!1}}();return function(){var a,i=y(t);if(e){var s=y(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return f(this,a)}}function f(t,e){if(e&&("object"===E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return A(t)}function A(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function _(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(n,t);var e,a,i,s=p(n);function n(){var t;S(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return _(A(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e,a,i){var s={key:t,domain:e,analyticsVersion:a};this.get(n.licenseServerUrl,s,i)})),t}return e=n,a&&m(e.prototype,a),i&&m(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);_(v,"licenseServerUrl",u+"/licensing");function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function T(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g(t,e){return g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},g(t,e)}function I(t){var e=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(t){return!1}}();return function(){var a,i=P(t);if(e){var s=P(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return b(this,a)}}function b(t,e){if(e&&("object"===N(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return C(t)}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}function U(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var G=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(n,t);var e,a,i,s=I(n);function n(){var t;D(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return U(C(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="session_event",this.get(n.analyticsServerUrl,t,e)})),U(C(t),"sendRequestAsync",(function(t){var e=this;return t.event_family="session_event",new Promise((function(a,i){e.asyncGet(n.analyticsServerUrl,t).then((function(t){a(t)})).catch((function(t){i(t)}))}))})),U(C(t),"sendRequestSynchronous",(function(t,e){t.event_family="session_event",this.get(n.analyticsServerUrl,t,e,!1)})),U(C(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&T(e.prototype,a),i&&T(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);U(G,"analyticsServerUrl",u);const R=G;function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function k(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){return O=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},O(t,e)}function F(t){var e=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(t){return!1}}();return function(){var a,i=H(t);if(e){var s=H(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return M(this,a)}}function M(t,e){if(e&&("object"===L(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return w(t)}function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function K(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var V=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&O(t,e)}(n,t);var e,a,i,s=F(n);function n(){var t;Y(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return K(w(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="session",this.get(n.analyticsServerUrl,t,e)})),K(w(t),"sendRequestSynchronous",(function(t,e){t.event_family="session",this.get(n.analyticsServerUrl,t,e,!1)})),K(w(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&k(e.prototype,a),i&&k(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);K(V,"analyticsServerUrl",u);const B=V;function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function j(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t,e){return Q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Q(t,e)}function q(t){var e=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(t){return!1}}();return function(){var a,i=X(t);if(e){var s=X(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return J(this,a)}}function J(t,e){if(e&&("object"===W(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return $(t)}function $(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function X(t){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},X(t)}function z(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Z=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Q(t,e)}(n,t);var e,a,i,s=q(n);function n(){var t;x(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return z($(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="player_init",this.get(n.analyticsServerUrl,t,e)})),z($(t),"sendRequestSynchronous",(function(t,e){t.event_family="player_init",this.get(n.analyticsServerUrl,t,e,!1)})),z($(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&j(e.prototype,a),i&&j(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);z(Z,"analyticsServerUrl",u);const tt=Z;const et=function(){var t=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"};function at(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function st(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const nt=new(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];at(this,t),st(this,"log",(function(t){this.showLogs&&console.log(t)})),st(this,"error",(function(t){this.showLogs&&console.error(t)})),st(this,"warning",(function(t){this.showLogs&&console.warn(t)})),this.showLogs=e}var e,a,i;return e=t,(a=[{key:"setLogging",value:function(t){this.showLogs=t}},{key:"isLogging",value:function(){return this.showLogs}}])&&it(e.prototype,a),i&&it(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}());function rt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ot(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var lt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"isShaka",value:function(t){return!!window.shaka&&"function"==typeof shaka.Player&&t.constructor===shaka.Player}},{key:"isDashjs",value:function(t){return"function"==typeof t.addABRCustomRule}},{key:"isHlsjs",value:function(t){return!!window.Hls&&"function"==typeof window.Hls&&t.constructor===window.Hls}}],(a=null)&&rt(e.prototype,a),i&&rt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();ot(lt,"isBitmovinVersionPre7",(function(t){return!lt.isDashjs(t)&&("function"==typeof t.getVersion&&t.getVersion()<"7")})),ot(lt,"isBitmovinVersion7Plus",(function(t){return"string"==typeof t.version&&t.version>="7"})),ot(lt,"isVideoJs",(function(t){if("function"==typeof videojs)try{if(videojs(t.id_)===t)return!0}catch(t){}return!1}));const ct=lt;const ut={READY:"ready",STARTUP:"startup",SOURCE_LOADED:"sourceLoaded",PLAY:"play",PAUSE:"pause",TIMECHANGED:"timechanged",SEEK:"seek",SEEKED:"seeked",START_CAST:"startCasting",END_CAST:"endCasting",START_BUFFERING:"startBuffering",END_BUFFERING:"endBuffering",AUDIO_CHANGE:"audioChange",VIDEO_CHANGE:"videoChange",START_FULLSCREEN:"startFullscreen",END_FULLSCREEN:"endFullscreen",START_AD:"adStart",END_AD:"adEnd",MUTE:"mute",UN_MUTE:"unMute",ERROR:"playerError",PLAYBACK_FINISHED:"end",SCREEN_RESIZE:"resize",UNLOAD:"unload",END:"end",METADATA_LOADED:"metadataLoaded",SOURCE_UNLOADED:"sourceUnloaded",PLAYBACK_PLAYING:"playback_playing"};function ht(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Et=function(){function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()}var e,a,i;return e=t,(a=[{key:"register",value:function(){var t=this;this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,(function(){t.eventCallback(ut.SOURCE_LOADED)})),this.player.addEventHandler(this.player.EVENT.ON_READY,(function(){var e=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(e=t.player.getConfig().playback.autoplay),t.eventCallback(ut.READY,{isLive:t.player.isLive(),version:t.player.getVersion(),type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:t.player.getConfig().source.videoId,userId:t.player.getConfig().source.userId,mpdUrl:t.player.getConfig().source.dash,m3u8Url:t.player.getConfig().source.hls,progUrl:t.player.getConfig().source.progressive,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:e})})),this.player.addEventHandler(this.player.EVENT.ON_CAST_START,(function(){t.eventCallback(ut.START_CAST)})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOP,(function(){t.eventCallback(ut.END_CAST)})),this.player.addEventHandler(this.player.EVENT.ON_PLAY,(function(){t.eventCallback(ut.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_PAUSE,(function(){t.eventCallback(ut.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,(function(){t.eventCallback(ut.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEK,(function(){t.eventCallback(ut.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,(function(){t.eventCallback(ut.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_START_BUFFERING,(function(){t.eventCallback(ut.START_BUFFERING)})),this.player.addEventHandler(this.player.EVENT.ON_STOP_BUFFERING,(function(){t.eventCallback(ut.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGE,(function(){var e=t.player.getPlaybackAudioData();t.eventCallback(ut.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGE,(function(){var e=t.player.getPlaybackVideoData();t.eventCallback(ut.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,(function(){t.eventCallback(ut.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.onBeforeUnLoadEvent=!1,this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,(function(){t.eventCallback(ut.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,(function(){t.eventCallback(ut.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,(function(){t.eventCallback(ut.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_MUTE,(function(){t.eventCallback(ut.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_UNMUTE,(function(){t.eventCallback(ut.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_ERROR,(function(e){t.eventCallback(ut.ERROR,{code:e.code,message:e.message})})),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,(function(){t.eventCallback(ut.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(ut.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(ut.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&ht(e.prototype,a),i&&ht(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function mt(t){return mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(t)}function St(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const dt=function(){function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()}var e,a,i;return e=t,(a=[{key:"register",value:function(){var t=this,e=function(e){if(!e)return{progUrl:void 0,progBitrate:void 0};if("string"==typeof e)return{progUrl:e,progBitrate:0};if(Array.isArray(e)){var a=t.player.getPlaybackVideoData(),i=parseInt(a.id)||0;return{progUrl:e[i].url,progBitrate:e[i].bitrate||0}}return"object"===mt(e)?{progUrl:e.url,progBitrate:e.bitrate||0}:void 0};this.player.addEventHandler(this.player.EVENT.ON_SOURCE_UNLOADED,(function(e){t.eventCallback(ut.SOURCE_UNLOADED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,(function(a){var i=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(i=t.player.getConfig().playback.autoplay);var s=t.player.getConfig(),n={},r=e(s.source.progressive);s.source&&(n={mpdUrl:s.source.dash,m3u8Url:s.source.hls,progUrl:r.progUrl,progBitrate:r.progBitrate}),t.eventCallback(ut.SOURCE_LOADED,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),mpdUrl:n.mpdUrl,m3u8Url:n.m3u8Url,progUrl:n.progUrl,progBitrate:n.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:i})})),this.player.addEventHandler(this.player.EVENT.ON_READY,(function(){var a=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(a=t.player.getConfig().playback.autoplay);var i=t.player.getConfig(),s={},n=e(i.source.progressive);i.source&&(s={videoId:i.source.videoId,userId:i.source.userId,mpdUrl:i.source.dash,m3u8Url:i.source.hls,progUrl:n.progUrl,progBitrate:n.progBitrate});var r=!0;null!=t.player.getConfig().adaptation.preload&&"boolean"==typeof t.player.getConfig().adaptation.preload&&(r=t.player.getConfig().adaptation.preload);var o=t.player.getAudio();o||(o="undetected"),t.eventCallback(ut.READY,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:s.videoId,userId:s.userId,mpdUrl:s.mpdUrl,m3u8Url:s.m3u8Url,progUrl:s.progUrl,progBitrate:s.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),preload:r,audioLanguage:o,isFullScreen:t.player.isFullscreen(),autoplay:a})})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STARTED,(function(e){t.eventCallback(ut.START_CAST,e)})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOPPED,(function(){t.eventCallback(ut.END_CAST,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_PLAY,(function(){t.eventCallback(ut.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_PAUSED,(function(){t.eventCallback(ut.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,(function(){t.eventCallback(ut.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEK,(function(){t.eventCallback(ut.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,(function(){t.eventCallback(ut.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_STALL_STARTED,(function(){t.eventCallback(ut.START_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_STALL_ENDED,(function(){t.eventCallback(ut.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGED,(function(){var e=t.player.getPlaybackAudioData();t.eventCallback(ut.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGED,(function(){var e=t.player.getPlaybackVideoData();t.eventCallback(ut.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,(function(){t.eventCallback(ut.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,(function(){t.eventCallback(ut.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,(function(){t.eventCallback(ut.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,(function(){t.eventCallback(ut.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_MUTED,(function(){t.eventCallback(ut.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_UNMUTED,(function(){t.eventCallback(ut.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_ERROR,(function(e){t.eventCallback(ut.ERROR,{code:e.code,message:e.message,currentTime:t.player.getCurrentTime()})})),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,(function(){t.eventCallback(ut.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(ut.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(ut.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&St(e.prototype,a),i&&St(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function pt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function ft(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(a),!0).forEach((function(e){At(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):pt(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function At(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const _t=function(){function t(e,a,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.stateMachine=i,this.register()}var e,a,i;return e=t,(a=[{key:"getStreamType",value:function(t){return t.endsWith(".m3u8")?"hls":t.endsWith(".mpd")?"dash":"progressive"}},{key:"getStreamSources",value:function(t){var e=null,a=null,i=null;switch(this.getStreamType(t)){case"hls":a=t;break;case"dash":e=t;break;default:i=t}return{mpdUrl:e,m3u8Url:a,progUrl:i}}},{key:"getVideoWindowDimensions",value:function(t){return{width:t.el_.clientWidth,height:t.el_.clientHeight}}},{key:"getVideoSourceDimensions",value:function(t){return{videoWidth:t.videoWidth(),videoHeight:t.videoHeight()}}},{key:"getVideojsSourceHandlerMode_",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});return t.sourceHandler_?t.sourceHandler_.options_.mode:"native"}},{key:"register",value:function(){var t,e,a=this,i=this;this.player.on("loadedmetadata",(function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),s=ft(ft(ft({isLive:this.duration()===1/0,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:this.videoWidth(),videoWindowHeight:this.videoHeight(),muted:this.muted()});i.stateMachine.updateMetadata(s),i.eventCallback(ut.SOURCE_LOADED,s)})),this.player.on("loadeddata",(function(){})),this.player.ready((function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),s=i.getVideoWindowDimensions(this),n={width:null,height:null,bitrate:null};if(this.tech_.hls){var r=this.tech_.hls.playlists.media();if(r){var o=r.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}}var l=ft(ft(ft({isLive:!1,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:s.width,videoWindowHeight:s.height,muted:this.muted(),currentVideoData:n});i.eventCallback(ut.READY,l)})),this.player.on("play",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(ut.PLAY,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("pause",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(ut.PAUSE,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("ended",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(ut.END,{currentTime:this.currentTime()})})),this.player.on("error",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height}}var s=this.player().error();i.eventCallback(ut.ERROR,{currentTime:this.currentTime(),code:s?s.code:-1,message:s?s.message:"Unknown error"})})),this.player.on("volumechange",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}this.muted()?i.eventCallback(ut.MUTE,{currentTime:this.currentTime(),currentVideoData:t}):i.eventCallback(ut.UN_MUTE,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("seeking",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(ut.SEEK,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})})),this.player.on("seeked",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(ut.SEEKED,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})})),Date.now();var s=!1;this.player.on("timeupdate",(function(){var a=this;clearTimeout(e),s=!1,Date.now();var n={width:null,height:null,bitrate:null},r=null;if(this.tech_.hls&&(r=this.tech_.hls.playlists.media())){var o=r.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}if(i.eventCallback(ut.TIMECHANGED,{currentTime:this.currentTime(),currentVideoData:n}),r){var l=r.attributes,c=l.BANDWIDTH,u=l.RESOLUTION.width,h=l.RESOLUTION.height,E=l.CODECS.split(",")[0],m=l.CODECS.split(",")[1];if(t!==c){var S={width:u,height:h,bitrate:c,videoCodec:E,audioCodec:m,currentTime:this.currentTime(),currentVideoData:n};i.eventCallback(ut.VIDEO_CHANGE,S),t=c}if(e=setTimeout((function(){(!a.paused()&&!a.ended()||s)&&i.eventCallback(ut.START_BUFFERING,{currentTime:a.currentTime()})}),1e3),this.tech({IWillNotUseThisInPlugins:!0}).hls){var d=this.tech_.hls;if(!d.playlists||"function"!=typeof d.playlists.media)return;var p=d.playlists.media();if(!p)return;var f=p.attributes,A=f.BANDWIDTH,y=f.RESOLUTION.width,_=f.RESOLUTION.height,v={width:y,height:_,bitrate:A,videoCodec:f.CODECS.split(",")[0],audioCodec:f.CODECS.split(",")[1]};if(isNaN(t)||t!==A){var N={width:y,height:_,bitrate:A,currentTime:this.currentTime(),currentVideoData:v};i.eventCallback(ut.VIDEO_CHANGE,N),t=A}}}})),this.player.on("stalled",(function(){s=!0})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){a.onBeforeUnLoadEvent||(a.onBeforeUnLoadEvent=!0,a.eventCallback(ut.UNLOAD,{currentTime:a.player.currentTime()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(ut.UNLOAD,{currentTime:this.player.currentTime()}))}}])&&yt(e.prototype,a),i&&yt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var vt,Nt="video/mp4",Tt="video/webm",Dt="application/x-mpegURL",gt="application/dash+xml",It=Dt,bt=gt;function Ct(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Pt=Tt,Ut=It,Gt=bt,Rt=(Ct(vt={},Nt,"mp4"),Ct(vt,Pt,"webm"),Ct(vt,Ut,"hls"),Ct(vt,Gt,"dash"),vt);var Lt={BITMOVIN:"bitmovin",JW:"jw",RADIANT:"radiant",VIDEOJS:"videojs",HLSJS:"hlsjs",SHAKA:"shaka",DASHJS:"dashjs",HTML:"html5",REACTNATIVEVIDEO:"react-native-video"};function kt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Ot=function(){function t(e,a,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;kt(this,t),this.eventCallback=a,this.playerSoftwareName=s||Lt.HTML,this.stateMachine=i,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_="",this.videoCodec_="",this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()}var e,a,i;return e=t,a=[{key:"setMediaElement",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),t&&(this.mediaEl=t),!this.mediaEl)throw new Error("No media element owned");if(this.mediaElementSet_)throw new Error("Media element already set (only call this once)");this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}},{key:"getCurrentQualityLevelInfo",value:function(){return null}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){var t,e=this.mediaEl,a="";return e||(a=null),a=e&&e.src?e.src:e&&e.querySelector("source")&&e.querySelector("source").src?e.querySelector("source").src:null,(t=(t=a).toLowerCase()).endsWith(".m3u8")?Dt:t.endsWith(".mp4")||t.endsWith(".m4v")||t.endsWith(".m4a")?Nt:t.endsWith(".webm")?Tt:t.endsWith(".mpd")?gt:null}},{key:"getStreamType",value:function(){return t=this.getMIMEType(),Rt[t];var t}},{key:"getPlayerVersion",value:function(){return null}},{key:"getStreamURL",value:function(){var t=this.mediaEl;return t?t&&t.src?t.src:t&&t.querySelector("source")&&t.querySelector("source").src?t.querySelector("source").src:null:null}},{key:"resetMedia",value:function(){this.mediaEl=null,this.mediaElEventHandlers=[]}},{key:"registerMediaElement",value:function(){var t=this,e=this.mediaEl;e&&(this.listenToMediaElementEvent("loadedmetadata",(function(){if(1===e.readyState){t.checkQualityLevelAttributes(!0);var a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,currentVideoData:{height:n,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),muted:r};t.needsFirstPlayIntent_||t.eventCallback(ut.METADATA_LOADED,c)}})),this.listenToMediaElementEvent("canplay",(function(){if(!t.playbackReadySet_){t.playbackReadySet_=!0;var a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,playerSoftware:t.playerSoftwareName,videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),currentVideoData:{height:n,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},muted:r};t.eventCallback(ut.SOURCE_LOADED,c)}})),this.listenToMediaElementEvent("play",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.needsFirstPlayIntent_=!1,t.eventCallback(ut.PLAY,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("pause",(function(){t.onPaused()})),this.listenToMediaElementEvent("playing",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.isPaused_=!1,t.needsFirstPlayIntent_||t.eventCallback(ut.TIMECHANGED,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("error",(function(){var a=e.currentTime,i=e.error;t.eventCallback(ut.ERROR,{currentTime:a,code:i.code,message:i.message})})),this.listenToMediaElementEvent("volumechange",(function(){var a=e.muted,i=e.currentTime;a?t.eventCallback(ut.MUTE,{currentTime:i}):t.eventCallback(ut.UN_MUTE,{currentTime:i})})),this.listenToMediaElementEvent("seeking",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.eventCallback(ut.SEEK,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})})),this.listenToMediaElementEvent("seeked",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.bufferingTimeout_&&clearTimeout(t.bufferingTimeout_),t.eventCallback(ut.SEEKED,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})})),this.listenToMediaElementEvent("ended",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.eventCallback(ut.END,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("timeupdate",(function(){var a=e.currentTime,i=e.videoHeight,s=e.videoWidth;t.isBuffering_=!1,t.needsFirstPlayIntent_||(t.isPaused_||t.eventCallback(ut.TIMECHANGED,{currentVideoData:{height:i,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a}),t.checkQualityLevelAttributes(),t.checkPlayheadProgress(),t.previousMediaTime_=a)})),this.listenToMediaElementEvent("stalled",(function(){})),this.listenToMediaElementEvent("waiting",(function(){t.onBuffering()})))}},{key:"listenToMediaElementEvent",value:function(t,e){if(!this.mediaEl)throw new Error("No media attached");var a=e.bind(this);this.mediaElEventHandlers.push({handler:a,event:t}),this.mediaEl.addEventListener(t,a,!1)}},{key:"onMaybeReady",value:function(){if(this.needsReadyEvent_&&this.mediaEl){this.needsReadyEvent_=!1;var t=!1,e=this.mediaEl,a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.preload;this.mediaEl&&this.mediaEl.src?this.mediaEl.src:this.mediaEl&&this.mediaEl.querySelector("source")&&this.mediaEl.querySelector("source").src&&this.mediaEl.querySelector("source").src;var l=this.mediaEl.clientWidth,c=this.mediaEl.clientHeight;"none"!==o&&(t=!0);var u={type:"html5",isLive:this.isLive(),version:this.getPlayerVersion()||"html5",streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:a,autoplay:i,preload:t,playerSoftware:this.playerSoftwareName,currentVideoData:{height:n,width:s,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:parseInt(l),videoWindowHeight:parseInt(c),muted:r};this.stateMachine.updateMetadata(u),this.eventCallback(ut.READY,u)}}},{key:"unregisterMediaElement",value:function(){var t=this;if(!this.mediaEl)throw new Error("No media attached");this.mediaElEventHandlers.forEach((function(e){t.mediaEl.removeEventListener(e.event,e.handler,!1)})),this.resetMedia()}},{key:"onBuffering",value:function(){var t=this.mediaEl.currentTime;this.isBuffering_||this.isPaused_||(this.eventCallback(ut.START_BUFFERING,{currentTime:t}),this.isBuffering_=!0)}},{key:"onPaused",value:function(){if(!this.isPaused_){var t=this.mediaEl,e=t.currentTime,a=t.videoHeight,i=t.videoWidth;this.eventCallback(ut.PAUSE,{currentVideoData:{height:a,width:i,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:e}),this.isPaused_=!0}}},{key:"checkPlayheadProgress",value:function(){var t=this,e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout((function(){e.paused||e.ended&&!t.isBuffering_||e.currentTime-t.previousMediaTime_<1e3&&t.onBuffering()}),1e3)}},{key:"checkQualityLevelAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.mediaEl,a=this.getCurrentQualityLevelInfo();if(a){var i=a.bitrate,s=a.width,n=a.height,r=a.videoCodec,o=a.audioCodec,l=this.isLive();if(l!==this.isLive_&&(this.isLive_=l,t||this.stateMachine.updateMetadata({isLive:l})),this.audioCodec_=o,this.videoCodec_=r,this.analyticsBitrate_!==i){var c={width:s,height:n,bitrate:i,videoCodec:r,audioCodec:o,currentTime:e.currentTime};t||this.eventCallback(ut.VIDEO_CHANGE,c),this.analyticsBitrate_=i}}}}],a&&Yt(e.prototype,a),i&&Yt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Mt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function wt(t,e){return wt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},wt(t,e)}function Ht(t){var e=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(t){return!1}}();return function(){var a,i=Vt(t);if(e){var s=Vt(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return Kt(this,a)}}function Kt(t,e){if(e&&("object"===Ft(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Vt(t){return Vt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Vt(t)}var Bt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wt(t,e)}(n,t);var e,a,i,s=Ht(n);function n(t,e,a){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=s.call(this,null,e,a,Lt.HLSJS)).hls=t,i.playerSoftwareName=Lt.HLSJS,i.resetMedia(),i.registerHlsEvents(),i}return e=n,(a=[{key:"getCurrentQualityLevelInfo",value:function(){var t=this.hls,e=t.levels[t.currentLevel];if(e){var a=e.attrs,i=parseInt(a.BANDWIDTH,10),s=parseInt(a.RESOLUTION.width,10),n=parseInt(a.RESOLUTION.height,10),r=null,o=null;return a.CODECS&&(r=a.CODECS.split(",").length>1?a.CODECS.split(",")[1]:"",o=a.CODECS.split(",").length>1?a.CODECS.split(",")[0]:""),{bitrate:i,width:s,height:n,audioCodec:r,videoCodec:o}}}},{key:"isLive",value:function(){var t=this.hls;if(t.currentLevel<0)return!1;var e=t.levels[t.currentLevel];return!!e&&e.details.live}},{key:"getPlayerVersion",value:function(){return Hls.version}},{key:"getMIMEType",value:function(){return It}},{key:"getStreamURL",value:function(){return this.hls.url}},{key:"registerHlsEvents",value:function(){var t=this,e=this.hls;if(!Hls)throw new Error("Hls.js is not defined installed (must be loaded before analytics module)");e.on(Hls.Events.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),e.on(Hls.Events.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),e.on(Hls.Events.MANIFEST_LOADING,this.onManifestLoading.bind(this)),e.on(Hls.Events.ERROR,(function(e,a){t.onError(a)})),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}},{key:"onMediaAttaching",value:function(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}},{key:"onMediaDetaching",value:function(){this.unregisterMediaElement()}},{key:"onManifestLoading",value:function(){this.onMaybeReady()}},{key:"onError",value:function(t){var e,a,i=this.mediaEl.currentTime;this.eventCallback(ut.ERROR,{currentTime:i,code:null==t?void 0:t.type,message:JSON.stringify({details:null==t?void 0:t.details,fatal:null==t?void 0:t.fatal,type:null==t?void 0:t.type,fragment_url:null==t?void 0:t.url,error:{message:null==t||null===(e=t.error)||void 0===e?void 0:e.message,stack:null==t||null===(a=t.error)||void 0===a?void 0:a.stack}})})}}])&&Mt(e.prototype,a),i&&Mt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(Ot);function Wt(t){return Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(t)}function jt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function xt(t,e){return xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},xt(t,e)}function Qt(t){var e=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(t){return!1}}();return function(){var a,i=Jt(t);if(e){var s=Jt(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return qt(this,a)}}function qt(t,e){if(e&&("object"===Wt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Jt(t)}var $t=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xt(t,e)}(n,t);var e,a,i,s=Qt(n);function n(t,e,a,i){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),r=s.call(this,i,e,a,Lt.SHAKA),!shaka)throw new Error("`shaka` lib is not installed (must be loaded before analytics module)");return r.shakaPlayer=t,r.playerSoftwareName=Lt.SHAKA,r.registerShakaEvents(),r}return e=n,(a=[{key:"getPlayerVersion",value:function(){return shaka.Player.version}},{key:"isLive",value:function(){return!!this.shakaPlayer&&this.shakaPlayer.isLive()}},{key:"getMIMEType",value:function(){return bt}},{key:"getStreamURL",value:function(){return this.shakaPlayer?this.shakaPlayer.getAssetUri():null}},{key:"registerShakaEvents",value:function(){var t=this,e=this.shakaPlayer;if(!e)throw new Error("Shaka player object is not defined");e.addEventListener("error",(function(e){t.onGumletShakaError(e,t.eventCallback,t.mediaEl)}))}},{key:"onGumletShakaError",value:function(t,e,a){var i=0;if(a&&(i=this.mediaEl.currentTime),t.detail){var s=t.detail,n=[];t.detail.data&&t.detail.data.forEach((function(t){n.push(t)})),e(ut.ERROR,{currentTime:i,code:s.code,message:JSON.stringify({category:null==s?void 0:s.v,code:null==s?void 0:s.code,severity:null==s?void 0:s.severity,handled:null==s?void 0:s.handled,timestamp:null==t?void 0:t.timestamp,extra_data:n})})}else eventCallback(ut.ERROR,{currentTime:i,code:"not_set_by_shaka",message:"{}"})}},{key:"getCurrentQualityLevelInfo",value:function(){var t=this.shakaPlayer.getVariantTracks().filter((function(t){return t.active})).filter((function(t){return t.videoCodec||void 0!==t.videoId}))[0];return t?{bitrate:t.videoBandwidth||t.bandwidth,width:t.width,height:t.height,videoCodec:t.videoCodec,audioCodec:t.audioCodec}:null}}])&&jt(e.prototype,a),i&&jt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(Ot);function Xt(t){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(t)}function zt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Zt(t,e){return Zt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Zt(t,e)}function te(t){var e=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(t){return!1}}();return function(){var a,i=ie(t);if(e){var s=ie(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return ee(this,a)}}function ee(t,e){if(e&&("object"===Xt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ae(t)}function ae(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ie(t){return ie=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ie(t)}var se=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zt(t,e)}(n,t);var e,a,i,s=te(n);function n(t,e,a){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i=s.call(this,null,e,a,Lt.DASHJS);var r=null,o=!1;i.playerSoftwareName=Lt.DASHJS;try{r=t.getVideoElement()}catch(t){}return r?i._initialize(t,r):t.on(dashjs.MediaPlayer.events.CAN_PLAY,(function(){if(!o){r=t.getVideoElement(),o=!0,i._initialize(t,r);var e=r,a=e.duration,s=e.autoplay,n=e.videoWidth,l=e.videoHeight,c=e.muted,u=r.clientWidth,h=r.clientHeight,E={type:"html5",isLive:i.isLive(),version:i.getPlayerVersion()||"html5",streamType:i.getStreamType(),streamUrl:i.getStreamURL(),duration:a,autoplay:s,playerSoftware:i.playerSoftwareName,videoWindowWidth:parseInt(u),videoWindowHeight:parseInt(h),currentVideoData:{height:l,width:n,bitrate:i.analyticsBitrate_,audioCodec:i.audioCodec_,videoCodec:i.videoCodec_},muted:c};i.eventCallback(ut.SOURCE_LOADED,E)}}),ae(i)),i}return e=n,(a=[{key:"_initialize",value:function(t,e){this.mediaPlayer=t,this.setMediaElement(e)}},{key:"getPlayerVersion",value:function(){return this.mediaPlayer.getVersion()}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){return bt}},{key:"getStreamURL",value:function(){return this.mediaPlayer?this.mediaPlayer.getSource():null}},{key:"getCurrentQualityLevelInfo",value:function(){if(this.mediaPlayer){var t=this.mediaPlayer.getBitrateInfoListFor("video")[this.mediaPlayer.getQualityFor("video")],e=this.mediaPlayer.getCurrentTrackFor("video"),a=this.mediaPlayer.getCurrentTrackFor("audio"),i=t.width,s=t.height,n=t.bitrate,r=null,o=null;return e&&(o=e.codec.split('"').length>0?e.codec.split('"')[1]:e.codec),a&&(r=a.codec.split('"').length>0?a.codec.split('"')[1]:a.codec),{width:i,height:s,bitrate:n,audioCodec:r,videoCodec:o}}return null}}])&&zt(e.prototype,a),i&&zt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(Ot);function ne(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const re=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"getAdapter",value:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ct.isBitmovinVersionPre7(t)?new Et(t,e):ct.isBitmovinVersion7Plus(t)?new dt(t,e):ct.isVideoJs(t)?new _t(t,e,a):ct.isHlsjs(t)?new Bt(t,e,a):ct.isShaka(t)?new $t(t,e,a,i):ct.isDashjs(t)?new se(t,e,a):new Ot(t,e,a)}}],(a=null)&&ne(e.prototype,a),i&&ne(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var oe=a(363),le=a.n(oe);function ce(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ue(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var he=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE"},this.createStateMachine()}var e,a,i;return e=t,i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],(a=[{key:"createStateMachine",value:function(){var e=this,a=[ut.PLAY,ut.PAUSE,ut.SEEK,ut.SEEKED,ut.PLAYBACK_PLAYING,ut.PLAYBACK_FINISHED,ut.READY,ut.SCREEN_RESIZE,ut.END,ut.ERROR,ut.UN_MUTE,ut.MUTE];this.stateMachine=le().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n,r){nt.error(n)},events:[{name:ut.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:ut.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:ut.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:ut.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:ut.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:ut.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:ut.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:ut.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:ut.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PLAYING,to:this.States.END},{name:ut.END,from:this.States.PAUSE,to:this.States.END},{name:ut.SEEK,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.END,to:this.States.END},{name:ut.TIMECHANGED,from:this.States.END,to:this.States.END},{name:ut.END_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.START_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.END,from:this.States.END,to:this.States.END},{name:ut.PLAY,from:this.States.END,to:this.States.PLAYING},{name:ut.ERROR,from:[this.States.SETUP,this.States.STARTUP,this.States.READY,this.States.PLAYING,this.States.REBUFFERING,this.States.PAUSE,this.States.QUALITYCHANGE,this.States.PAUSED_SEEKING,this.States.PLAY_SEEKING,this.States.END_PLAY_SEEKING,this.States.QUALITYCHANGE_PAUSE,"FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE",this.States.END,this.States.ERROR],to:this.States.ERROR},{name:ut.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.UNLOAD,from:[this.States.PLAYING,this.States.PAUSE],to:this.States.END},{name:ut.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:ut.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:ut.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:ut.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:ut.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:ut.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(i,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),i===ut.SEEK&&s===e.States.PAUSE&&r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY?(e.stateMachine.PLAY_SEEK(r),!1):(i===ut.SEEK&&clearTimeout(e.seekedTimeout),i===ut.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):void 0)},onafterevent:function(i,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),nt.log(t.pad(r,20)+"EVENT: "+t.pad(i,20)+" from "+t.pad(s,14)+"-> "+t.pad(n,14)),n===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(r),n===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(r),n!==e.States.MUTING_READY&&n!==e.States.MUTING_PLAY&&n!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(r)},onenterstate:function(t,i,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),e.onEnterStateTimestamp=n||(new Date).getTime(),nt.log("Entering State "+s+" with "+t),r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(r)},onleavestate:function(t,i,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),n){var o=n-e.onEnterStateTimestamp;nt.log("State "+i+" was "+o+" ms event:"+t),r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var l=i.toLowerCase();if(i===e.States.END_PLAY_SEEKING||i===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks[l](c,l,r),nt.log("Seek was "+c+"ms")}else if(t===ut.UNLOAD&&i===e.States.PLAYING)e.stateMachineCallbacks.playingAndBye(o,l,r);else if(i===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING)e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.stateMachineCallbacks.pause(o,l,r);else{var u=e.stateMachineCallbacks[l];"function"==typeof u?u(o,l,r):nt.error("Could not find callback function for "+l)}r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(r),t===ut.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===ut.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===ut.MUTE?(nt.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===ut.UN_MUTE&&(nt.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=n.currentTime-e.customData.previousRecordTime;r>0&&r<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=s-e.onEnterStateTimestamp;o>59700&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),nt.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):nt.log("Ignored Event: "+t)}}])&&ce(e.prototype,a),i&&ce(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ee(t){return function(t){if(Array.isArray(t))return me(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return me(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return me(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function me(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function Se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function de(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function pe(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}ue(he,"PAUSE_SEEK_DELAY",60),ue(he,"SEEKED_PAUSE_DELAY",120);var fe=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Se(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.seekedFrom=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING",SOURCE_CHANGING:"SOURCE_CHANGING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Ee(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[ut.PLAY,ut.PAUSE,ut.SEEK,ut.SEEKED,ut.PLAYBACK_PLAYING,ut.PLAYBACK_FINISHED,ut.READY,ut.SCREEN_RESIZE,ut.END,ut.ERROR,ut.UN_MUTE,ut.MUTE];this.stateMachine=le().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){nt.error("Error in statemachine: "+n)},events:[{name:ut.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:ut.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:ut.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:ut.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:ut.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:ut.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:ut.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:ut.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:ut.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PLAYING,to:this.States.END},{name:ut.END,from:this.States.PAUSE,to:this.States.END},{name:ut.SEEK,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.END,to:this.States.END},{name:ut.TIMECHANGED,from:this.States.END,to:this.States.END},{name:ut.END_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.START_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.END,from:this.States.END,to:this.States.END},{name:ut.PLAY,from:this.States.END,to:this.States.PLAYING},{name:ut.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:ut.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:ut.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:ut.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:ut.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:ut.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:ut.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:ut.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:ut.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:ut.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:ut.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:ut.SEEK,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.SOURCE_UNLOADED,from:this.getAllStates(),to:this.States.SOURCE_CHANGING},{name:ut.READY,from:this.States.SOURCE_CHANGING,to:this.States.READY},{name:ut.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:ut.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:ut.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(a,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===ut.SEEK&&s===e.States.PAUSE&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=r,r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(r),!1):(a===ut.SEEK&&clearTimeout(e.seekedTimeout),a!==ut.SOURCE_LOADED?a===ut.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):(s!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(r,e.States.READY,o))},onafterevent:function(t,a,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),s===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(n),s===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),s===e.States.QUALITYCHANGE_REBUFFERING&&e.stateMachine.FINISH_QUALITYCHANGE_REBUFFERING(n),s!==e.States.MUTING_READY&&s!==e.States.MUTING_PLAY&&s!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onenterstate:function(t,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(r,e.States.SETUP,o):n===e.States.READY?(o.playerSoftware="Bitmovin",e.stateMachineCallbacks.ready(r,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(r,e.States.PLAY,o):"play"===t&&s===e.States.PAUSE?(e.stateMachineCallbacks.play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o)):"timechanged"===t&&s===e.States.STARTUP&&n===e.States.PLAYING?(e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):n===e.States.PAUSE&&s===e.States.PLAYING?e.stateMachineCallbacks.pause(r,e.States.PAUSE,o):n===e.States.END?e.stateMachineCallbacks.end(r,e.States.END,o):n===e.States.END?e.stateMachineCallbacks.mute(r,o):t===ut.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(r,e.States.REBUFFERING,o):t===ut.END_BUFFERING&&e.stateMachineCallbacks.end_rebuffer(r,e.States.REBUFFERING,o),"none"===s&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onleavestate:function(t,a,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),n){i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime);var o=n-e.onEnterStateTimestamp;if(r&&s!==e.States.PAUSED_SEEKING&&s!==e.States.PLAY_SEEKING&&s!==e.States.END_PLAY_SEEKING&&(nt.log("Setting video time end to "+r.currentTime+", going to "+s),e.stateMachineCallbacks.setVideoTimeEndFromEvent(r)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*r.currentTime,c,s),nt.log("Seek was "+c+"ms")}else t===ut.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,r):a===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===ut.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===ut.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===ut.MUTE?(nt.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===ut.UN_MUTE&&(nt.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=n.currentTime-e.customData.previousRecordTime;r>0&&r<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=s-e.onEnterStateTimestamp;o>{HEARTBEAT_THRESHOLD:h}&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),nt.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):nt.log("Ignored Event: "+t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&de(e.prototype,a),i&&de(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ae(t){return function(t){if(Array.isArray(t))return ye(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ye(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ye(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function _e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ve(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ne(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}pe(fe,"PAUSE_SEEK_DELAY",200),pe(fe,"SEEKED_PAUSE_DELAY",300);var Te=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_e(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.autoPlay=!1,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Ae(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[ut.PLAY,ut.PAUSE,ut.SEEK,ut.SEEKED,ut.PLAYBACK_PLAYING,ut.PLAYBACK_FINISHED,ut.READY,ut.SCREEN_RESIZE,ut.END,ut.ERROR,ut.UN_MUTE,ut.MUTE];this.stateMachine=le().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){nt.error("Error in statemachine: "+n)},events:[{name:ut.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:ut.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:ut.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:ut.PLAY,from:this.States.SETUP,to:this.States.SETUP},{name:ut.TIMECHANGED,from:this.States.READY,to:this.States.STARTUP},{name:ut.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:ut.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:ut.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:ut.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.SEEK,from:this.States.PLAYING,to:this.States.PLAY_SEEKING},{name:ut.TIMECHANGED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:ut.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:ut.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:ut.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:ut.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:ut.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:ut.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:ut.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PLAYING,to:this.States.END},{name:ut.END,from:this.States.PAUSE,to:this.States.END},{name:ut.SEEK,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.END,to:this.States.END},{name:ut.TIMECHANGED,from:this.States.END,to:this.States.END},{name:ut.END_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.START_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.END,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.PLAY,from:this.States.END,to:this.States.PLAYING},{name:ut.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:ut.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:ut.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:ut.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:ut.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:ut.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:ut.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:ut.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:ut.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:ut.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:ut.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:ut.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:ut.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:ut.SEEK,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.SOURCE_LOADED,from:this.getAllStates(),to:this.States.SETUP},{name:ut.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:ut.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:ut.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(a,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===ut.PLAY&&s===e.States.SETUP&&n===e.States.SETUP&&(e.autoPlay=!0),a===ut.SEEK&&(s===e.States.PAUSE||s===e.States.PLAYING)&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=r,r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(r),!1):(a===ut.SEEK&&clearTimeout(e.seekedTimeout),a!==ut.SOURCE_LOADED?a===ut.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):(s!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(r,e.States.READY,o))},onenterstate:function(t,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(r,e.States.SETUP,o):n===e.States.READY?(o.playerSoftware=Lt.VIDEOJS,e.stateMachineCallbacks.ready(r,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(r,e.States.PLAY,o):"timechanged"===t&&s===e.States.STARTUP&&n===e.States.PLAYING&&e.autoPlay?(e.stateMachineCallbacks.first_play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):"play"===t&&s===e.States.PAUSE?(e.stateMachineCallbacks.play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o)):"timechanged"!==t||s!==e.States.STARTUP||n!==e.States.PLAYING||e.autoPlay?n===e.States.PAUSE&&s===e.States.PLAYING?e.stateMachineCallbacks.pause(r,e.States.PAUSE,o):n===e.States.END?e.stateMachineCallbacks.end(r,e.States.END,o):n===e.States.END?e.stateMachineCallbacks.mute(r,o):t===ut.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(r,e.States.REBUFFERING,o):"timechanged"===t&&s===e.States.REBUFFERING&&n===e.States.PLAYING&&e.stateMachineCallbacks.end_rebuffer(r,e.States.REBUFFERING,o):(e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)),"none"===s&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onafterevent:function(t,a,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),s===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),s!==e.States.MUTING_READY&&s!==e.States.MUTING_PLAY&&s!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onleavestate:function(t,a,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===ut.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),e.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-e.onEnterStateTimestamp;if(r&&s!==e.States.PAUSED_SEEKING&&s!==e.States.PLAY_SEEKING&&s!==e.States.END_PLAY_SEEKING&&(nt.log("Setting video time end to "+r.currentTime+", going to "+s),e.stateMachineCallbacks.setVideoTimeEndFromEvent(r)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*r.currentTime,c,s),nt.log("Seek was "+c+"ms")}else t===ut.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,r):a===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===ut.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===ut.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===ut.MUTE?(nt.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===ut.UN_MUTE&&(nt.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=s-e.onEnterStateTimestamp,o=n.currentTime-e.customData.previousRecordTime;o>0&&o<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime),r>h&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),nt.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(r,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n),e.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):nt.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&ve(e.prototype,a),i&&ve(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function De(t){return function(t){if(Array.isArray(t))return ge(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ge(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ge(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function Ie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function be(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}Ne(Te,"PAUSE_SEEK_DELAY",200),Ne(Te,"SEEKED_PAUSE_DELAY",300);var Ce=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ie(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.onEnterStateTimestamp=0,this.seekStartedAt=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedFrom=0,this.lastPlayHeadDuration=0,this.playTimeStamp=null,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(De(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[ut.PLAY,ut.PAUSE,ut.SEEK,ut.SEEKED,ut.PLAYBACK_PLAYING,ut.PLAYBACK_FINISHED,ut.READY,ut.SCREEN_RESIZE,ut.END,ut.ERROR,ut.UN_MUTE,ut.MUTE];this.stateMachine=le().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){nt.error("Error in statemachine: "+n)},events:[{name:ut.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:ut.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:ut.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:ut.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:ut.SEEKED,from:this.States.PAUSE,to:this.States.PAUSE},{name:ut.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:ut.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:ut.PLAY,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:ut.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:ut.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:ut.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.PAUSE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:ut.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:ut.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:ut.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:ut.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:ut.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:ut.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:ut.END,from:this.States.PLAYING,to:this.States.END},{name:ut.END,from:this.States.PAUSE,to:this.States.END},{name:ut.SEEK,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.END,to:this.States.END},{name:ut.TIMECHANGED,from:this.States.END,to:this.States.END},{name:ut.END_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.START_BUFFERING,from:this.States.END,to:this.States.END},{name:ut.END,from:this.States.END,to:this.States.END},{name:ut.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.PLAY,from:this.States.END,to:this.States.PLAYING},{name:ut.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:ut.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:ut.PLAY,from:this.States.ERROR,to:this.States.PLAYING},{name:ut.TIMECHANGED,from:this.States.ERROR,to:this.States.PLAYING},{name:ut.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:ut.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:ut.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:ut.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:ut.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:ut.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:ut.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:ut.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:ut.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:ut.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:ut.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:ut.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:ut.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:ut.SEEK,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.READY,to:this.States.READY},{name:ut.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:ut.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:ut.SOURCE_LOADED,from:this.States.STARTUP,to:this.States.STARTUP},{name:ut.SOURCE_LOADED,from:this.States.PLAYING,to:this.States.PLAYING},{name:ut.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:ut.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onbeforeevent:function(e,i,s,n,r){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===ut.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),e===ut.SEEK&&i===t.States.PAUSE&&(t.seekedFrom=t.lastPlayHeadDuration),e!==ut.SOURCE_LOADED)r&&(t.lastPlayHeadDuration=1e3*r.currentTime);else{var o=null;i===t.States.PLAYING&&(o=(new Date).getTime()-t.playTimeStamp.getTime()),t.stateMachineCallbacks.loaded(n,t.States.READY,r,o)}},onenterstate:function(i,s,n,r,o){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(i)&&(i===ut.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=o.currentTime),n===t.States.SETUP&&"none"===s?t.stateMachineCallbacks.setup(r,t.States.SETUP,o):n===t.States.READY&&s===t.States.SETUP?t.stateMachineCallbacks.ready(r,t.States.READY,o):"play"===i&&n===t.States.STARTUP?(t.playTimeStamp=new Date,t.stateMachineCallbacks.first_play(r,t.States.PLAY,o)):"play"===i&&s===t.States.PAUSE?(t.stateMachineCallbacks.play(r,t.States.PLAY,o),t.stateMachineCallbacks.playing(r,t.States.PLAYING,o)):"timechanged"===i&&s===t.States.STARTUP&&n===t.States.PLAYING?(t.stateMachineCallbacks.playing(r,t.States.PLAYING,o),t.stateMachineCallbacks.playback_started(o)):"timechanged"===i&&s===t.States.PAUSE&&n===t.States.PLAYING?t.stateMachineCallbacks.playing(r,t.States.PLAYING,o):n===t.States.PAUSE&&s===t.States.PLAYING?t.stateMachineCallbacks.pause(r,t.States.PAUSE,o):n===t.States.END?t.stateMachineCallbacks.end(r,t.States.END,o):i===ut.START_BUFFERING?t.stateMachineCallbacks.start_rebuffer(r,t.States.REBUFFERING,o):"timechanged"===i&&s===t.States.REBUFFERING&&n===t.States.PLAYING&&t.stateMachineCallbacks.end_rebuffer(r,t.States.REBUFFERING,o),"none"===s&&e.starttime?t.onEnterStateTimestamp=e.starttime:t.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==t.States.PAUSED_SEEKING&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},onafterevent:function(e,i,s,n,r){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===ut.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),s===t.States.QUALITYCHANGE&&t.stateMachine.FINISH_QUALITYCHANGE(n),s!==t.States.MUTING_READY&&s!==t.States.MUTING_PLAY&&s!==t.States.MUTING_PAUSE||t.stateMachine.FINISH_MUTING(n)},onleavestate:function(e,i,s,n,r){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===ut.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),t.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-t.onEnterStateTimestamp;r&&s!==t.States.PAUSED_SEEKING&&(nt.log("Setting video time end to "+r.currentTime+", going to "+s),t.stateMachineCallbacks.setVideoTimeEndFromEvent(r));var l=i.toLowerCase();if(i===t.States.PAUSED_SEEKING){var c=n-t.seekStartedAt;t.seekStartedAt=null,t.stateMachineCallbacks.playback_seeked(t.seekedFrom,1e3*r.currentTime,c,s),nt.log("Seek was "+c+"ms")}else e===ut.UNLOAD&&i===t.States.PLAYING?t.stateMachineCallbacks.playingAndBye(o,l,r):i===t.States.PAUSE&&s!==t.States.PAUSED_SEEKING&&s!==t.States.PLAYING&&(t.stateMachineCallbacks.setVideoTimeStartFromEvent(e),t.stateMachineCallbacks.pause(o,l,r));e===ut.VIDEO_CHANGE?t.stateMachineCallbacks.videoChange(r):e===ut.AUDIO_CHANGE?t.stateMachineCallbacks.audioChange(r):e===ut.MUTE?(nt.log("Setting sample to muted"),t.stateMachineCallbacks.mute(n,r)):e===ut.UN_MUTE&&(nt.log("Setting sample to unmuted"),t.stateMachineCallbacks.unMute(n,r))}},onseek:function(e,a,i,s,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekStartedAt=t.seekStartedAt||s},onseeked:function(e,a,i,s,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekedTimestamp=s},ontimechanged:function(e,a,i,s,n){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime);var r=s-t.onEnterStateTimestamp,o=n.currentTime-t.customData.previousRecordTime;o>0&&o<5&&(t.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-t.customData.previousRecordTime)),t.customData.previousRecordTime=n.currentTime),r>h&&(t.stateMachineCallbacks.setVideoTimeEndFromEvent(n),nt.log("Sending heartbeat"),t.stateMachineCallbacks.heartbeat(r,a.toLowerCase(),n),t.onEnterStateTimestamp=s,t.stateMachineCallbacks.setVideoTimeStartFromEvent(n),t.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(e,a,i,s,n){t.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):nt.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&be(e.prototype,a),i&&be(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pe(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Ue=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"getAnalyticsStateMachine",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ct.isBitmovinVersionPre7(t)?new he(e,a):ct.isBitmovinVersion7Plus(t)?new fe(e,a):ct.isVideoJs(t)?new Te(e,a):(ct.isHlsjs(t)||ct.isDashjs(t)||ct.isShaka(t),new Ce(e,a))}}],(a=null)&&Pe(e.prototype,a),i&&Pe(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ge(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Re=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,(a=[{key:"setUp",value:function(){nt.log("setting up cast session"),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}},{key:"addMessageListener",value:function(){var t=this,e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(c)<0?nt.log("No analytics on chrome cast receiver enabled!"):(nt.log("adding message listener"),this.castSession.addMessageListener(c,(function(e,a){nt.log("Received: "+e+" "+a);try{var i=JSON.parse(a);t.handleReceiverMessage(i)}catch(t){nt.error("Message parsing failed "+a)}})))}},{key:"handleReceiverMessage",value:function(t){nt.log(t)}},{key:"sendMessage",value:function(t){var e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(c)<0?nt.log("No analytics on chrome cast receiver enabled!"):(nt.log("Sending message: "+JSON.stringify(t)),this.castSession.sendMessage(c,t))}}])&&Ge(e.prototype,a),i&&Ge(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Le(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const ke=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,(a=[{key:"setUp",value:function(){var t=this,e=cast.receiver.CastReceiverManager.getInstance();this.messageBus=e.getCastMessageBus(c,cast.receiver.CastMessageBus.MessageType.JSON),nt.log(this.messageBus),this.messageBus.onMessage=function(e){nt.log("Received message from cast client: "+JSON.stringify(e));var a=e.data;t.handleClientMessage(a)}}},{key:"setCallback",value:function(t){this.callback=t}},{key:"handleClientMessage",value:function(t){this.callback(t)}},{key:"sendMessage",value:function(t){this.messageBus.broadcast(t)}}])&&Le(e.prototype,a),i&&Le(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();const Ye={SETUP:"event_setup",PLAYER_READY:"event_player_ready",PLAYBACK_READY:"event_playback_ready",PLAYBACK_STARTED:"event_playback_started",PAUSE:"event_pause",PLAY:"event_play",PLAYING:"event_playing",PLAYBACK_UPDATE:"event_playback_update",END:"event_ended",MUTE:"event_muted",UNMUTE:"event_unmute",SEEKED:"event_seeked",START_REBUFFER:"event_rebuffer_start",END_REBUFFER:"event_rebuffer_end",ERROR:"event_error"};var Oe=a(795),Fe=a.n(Oe);function Me(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function we(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var He=function(){function t(e){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),we(this,"register",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,e),a.analyticsStateMachine;e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=Ue.getAnalyticsStateMachine(t,a.stateMachineCallbacks,e),a.adapter=re.getAdapter(t,a.record,a.analyticsStateMachine,e.mediaElement),a.adapter||nt.error("Could not detect player.")})),we(this,"registerVideoJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Te(a.stateMachineCallbacks,e),a.adapter=new _t(t,a.record,a.analyticsStateMachine)})),we(this,"registerHLSJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,e),a.adapter=new Bt(t,a.record,a.analyticsStateMachine)})),we(this,"registerShakaPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,e),a.adapter=new $t(t,a.record,a.analyticsStateMachine,e.mediaElement)})),we(this,"registerHTML5Player",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,e),a.adapter=new Ot(t,a.record,a.analyticsStateMachine)})),we(this,"customEventHandler",(function(t,e){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValues(t,{custom_event_data:a.customEventData})})),we(this,"customEventHandlerAsync",(function(t,e){return new Promise((function(i,s){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValuesAsync(t,{custom_event_data:a.customEventData}).then((function(t){i(t)})).catch((function(t){s(t)}))}))})),we(this,"registerDashJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,e),a.adapter=new se(t,a.record,a.analyticsStateMachine)})),we(this,"registerReactNativeVideoPlayer",(function(t){return t.starttime||(t.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ce(a.stateMachineCallbacks,t),a.analyticsStateMachine})),we(this,"getCurrentImpressionId",(function(){return a.sample.impressionId})),we(this,"record",(function(t,e){e=e||{},a.analyticsStateMachine.callEvent(t,e,r.getCurrentTimestamp())})),we(this,"setDroppedFrames",(function(t){})),this.config=e,this.analyticsCall=new R,this.sessionCreationCall=new B,this.playerInitCall=new tt,this.castClient=new Re,this.castReceiver=new ke,this.droppedSampleFrames=0,this.licensing="granted",this.startupTime=0,this.pageLoadType=t.PAGE_LOAD_TYPE.FOREGROUND,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.previousState=void 0,this.previousStateTimeStamp=new Date,this.firstPlayTimestamp=0,this.isMuted=!1,this.isFullScreen=void 0,this.videoWidthPixels=void 0,this.videoHeightPixels=void 0,this.upscalePercentage=void 0,this.downscalePercentage=void 0,this.videoBitrate=void 0,this.audioCodec=void 0,this.videoCodec=void 0,this.currentTime=0;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.onchange=function(){this.orientation=screen.orientation.type.match(/\w+/)[0]}}catch(t){this.orientation="undetected"}this.setConfigParameters(),this.init(),this.setupSample(),this.setupStateMachineCallbacks()}var e,a,i;return e=t,a=[{key:"init",value:function(){if(this.isCastReceiver||""!=this.config.property_id&&r.validString(this.config.property_id)){nt.setLogging(this.config.debug||!1),this.propertyId=this.config.property_id,"undefined"!=typeof window&&void 0!==window.parent?this.pageURL=window.location!=window.parent.location?document.referrer:document.location.href:this.config.page_url?this.pageURL=this.config.page_url:this.pageURL=null;var t=!1;this.config.test&&(t=!0);var e=null;this.config.sessionID&&(e=this.config.sessionID);var a=!0;this.config.hasOwnProperty("sendSessionRequest")&&(a=this.config.sendSessionRequest);var i=null;this.config.userID&&(i=this.config.userID),this.setUserId(t,i),this.setSessionId(t,e,a),this.setPlayerInstanceId(),this.setPlaybackId()}else console.error("Invalid analytics property_id provided")}},{key:"setConfigParameters",value:function(){arguments.length>0&&void 0!==arguments[0]||this.sample;var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config;this.customData1=r.getCustomDataString(t.customData1),this.customData2=r.getCustomDataString(t.customData2),this.customData3=r.getCustomDataString(t.customData3),this.customData4=r.getCustomDataString(t.customData4),this.customData5=r.getCustomDataString(t.customData5),this.customData6=r.getCustomDataString(t.customData6),this.customData7=r.getCustomDataString(t.customData7),this.customData8=r.getCustomDataString(t.customData8),this.customData9=r.getCustomDataString(t.customData9),this.customData10=r.getCustomDataString(t.customData10),this.customPlayerIntegrationVersion=r.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=r.getCustomDataString(t.customPlayerName),this.customPageType=r.getCustomDataString(t.customPageType),this.customUserId=r.getCustomDataString(t.userId),this.userName=r.getCustomDataString(t.userName),this.userEMail=r.getCustomDataString(t.userEMail),this.userPhone=r.getCustomDataString(t.userPhone),this.userProfileImage=r.getCustomDataString(t.userProfileImage),this.userAddressLine1=r.getCustomDataString(t.userAddressLine1),this.userAddressLine2=r.getCustomDataString(t.userAddressLine2),this.userCity=r.getCustomDataString(t.userCity),this.userState=r.getCustomDataString(t.userState),this.userCountry=r.getCustomDataString(t.userCountry),this.userZipcode=r.getCustomDataString(t.userZipcode),this.customContentType=r.getCustomDataString(t.customContentType),this.customVideoDurationMillis=r.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=r.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=r.getCustomDataString(t.customVideoLanguage),this.customVideoId=r.getCustomDataString(t.customVideoId),this.customVideoSeries=r.getCustomDataString(t.customVideoSeries),this.customVideoProducer=r.getCustomDataString(t.customVideoProducer),this.customVideoTitle=r.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=r.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=r.getCustomDataString(t.customVideoVariant),this.SDKVersion="1.0.0",this.experimentName=t.experimentName}},{key:"updateCustomUserData",value:function(t){this.customUserId=r.getCustomDataString(t.userId),this.userName=r.getCustomDataString(t.userName),this.userEMail=r.getCustomDataString(t.userEMail),this.userPhone=r.getCustomDataString(t.userPhone),this.userProfileImage=r.getCustomDataString(t.userProfileImage),this.userAddressLine1=r.getCustomDataString(t.userAddressLine1),this.userAddressLine2=r.getCustomDataString(t.userAddressLine2),this.userCity=r.getCustomDataString(t.userCity),this.userState=r.getCustomDataString(t.userState),this.userCountry=r.getCustomDataString(t.userCountry),this.userZipcode=r.getCustomDataString(t.userZipcode)}},{key:"updateCustomVideoData",value:function(t){this.customContentType=r.getCustomDataString(t.customContentType),this.customVideoDurationMillis=r.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=r.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=r.getCustomDataString(t.customVideoLanguage),this.customVideoId=r.getCustomDataString(t.customVideoId),this.customVideoSeries=r.getCustomDataString(t.customVideoSeries),this.customVideoProducer=r.getCustomDataString(t.customVideoProducer),this.customVideoTitle=r.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=r.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=r.getCustomDataString(t.customVideoVariant)}},{key:"updateCustomData",value:function(t){this.customData1=r.getCustomDataString(t.customData1),this.customData2=r.getCustomDataString(t.customData2),this.customData3=r.getCustomDataString(t.customData3),this.customData4=r.getCustomDataString(t.customData4),this.customData5=r.getCustomDataString(t.customData5),this.customData6=r.getCustomDataString(t.customData6),this.customData7=r.getCustomDataString(t.customData7),this.customData8=r.getCustomDataString(t.customData8),this.customData9=r.getCustomDataString(t.customData9),this.customData10=r.getCustomDataString(t.customData10)}},{key:"updateCustomPlayerData",value:function(t){this.customPlayerIntegrationVersion=r.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=r.getCustomDataString(t.customPlayerName),this.customPageType=r.getCustomDataString(t.customPageType)}},{key:"setSessionData",value:function(){this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,meta_browser:this.meta_browser,meta_device_manufacturer:this.meta_device_manufacturer,meta_operating_system_version:this.meta_operating_system_version,meta_operating_system:this.meta_operating_system,meta_device_name:this.meta_device_name,meta_browser_version:this.meta_browser_version,meta_device_category:this.meta_device_category,meta_device_architecture:this.meta_device_architecture,meta_device_display_width:this.meta_device_display_width,meta_device_display_height:this.meta_device_display_height,meta_device_is_touchscreen:this.meta_device_is_touchscreen,meta_device_display_dpr:this.meta_device_display_dpr,meta_browser_language:this.meta_browser_language},this.config.deviceData?(this.sessionData.meta_device_name=this.config.deviceData.meta_device_name,this.sessionData.meta_device_manufacturer=this.config.deviceData.meta_device_manufacturer,this.sessionData.meta_operating_system_version=this.config.deviceData.meta_operating_system_version,this.sessionData.meta_operating_system=this.config.deviceData.meta_operating_system,this.sessionData.meta_browser=this.config.deviceData.meta_browser,this.sessionData.meta_device_display_dpr=this.config.deviceData.meta_device_display_dpr,this.sessionData.meta_browser_version=this.config.deviceData.meta_browser_version,this.sessionData.meta_device_category=this.config.deviceData.meta_device_category,this.sessionData.meta_device_architecture=this.config.deviceData.meta_device_architecture,this.sessionData.meta_device_display_width=this.config.deviceData.meta_device_display_width,this.sessionData.meta_device_display_height=this.config.deviceData.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=this.config.deviceData.meta_device_is_touchscreen,this.sessionData.meta_browser_language=this.config.deviceData.meta_browser_language):(this.sessionData.meta_device_name=Fe().product,this.sessionData.meta_device_manufacturer=Fe().manufacturer,this.sessionData.meta_operating_system_version=Fe().os.version,this.sessionData.meta_operating_system=Fe().os.family,this.sessionData.meta_browser=Fe().name,this.sessionData.meta_browser_version=Fe().version,this.sessionData.meta_device_category=et(),this.sessionData.meta_device_architecture=Fe().os.architecture,this.sessionData.meta_device_display_dpr=window.devicePixelRatio,this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_device_display_dpr=parseInt(window.devicePixelRatio),this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:"","ontouchstart"in document.documentElement&&(this.sessionData.meta_device_is_touchscreen="true"))}},{key:"setPlayerData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData&&(this.playerData.player_preload=this.config.playerData.player_preload,this.playerData.player_autoplay=this.config.playerData.player_autoplay,this.playerData.player_software_version=this.config.playerData.player_software_version,this.playerData.player_integration_version=this.config.playerData.player_integration_version,this.playerData.player_name=this.config.playerData.player_name,this.playerData.player_language_code=this.config.playerData.player_language_code,this.playerData.player_software=this.config.playerData.player_software,this.playerData.meta_page_url=this.config.playerData.meta_page_url,this.playerData.meta_page_type=this.config.playerData.meta_page_type,this.playerData.player_height_pixels=this.config.playerData.player_height_pixels,this.playerData.player_width_pixels=this.config.playerData.player_width_pixels),t&&r.validNumber(t.videoWindowHeight)&&(this.playerData.player_height_pixels=t.videoWindowHeight),t&&r.validNumber(t.videoWindowWidth)&&(this.playerData.player_width_pixels=t.videoWindowWidth),t&&r.validBoolean(t.autoplay)&&(this.playerData.player_autoplay=t.autoplay),t&&r.validBoolean(t.preload)&&(this.playerData.player_preload=t.preload),t&&r.validString(t.version)&&(this.playerData.player_software_version=t.version),t&&r.validString(t.audioLanguage)&&(this.playerData.player_language_code=t.audioLanguage),t&&r.validString(t.playerSoftware)&&(this.playerData.player_software=t.playerSoftware)}},{key:"setUserId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)this.userId=e;else if(t)this.userId=r.uuidv4();else{var a=r.getCookie("gumlet_user_id");this.userId=a&&""!==a?a:r.setCookie("gumlet_user_id",43200)}}},{key:"setPlayerInstanceId",value:function(){this.config.getUUID?this.playerInstanceId=this.config.getUUID():this.playerInstanceId=r.uuidv4(),this.setPlayerData()}},{key:"setPlaybackId",value:function(){this.config.getUUID?this.playbackId=this.config.getUUID():this.playbackId=r.uuidv4()}},{key:"setSessionId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)return this.sessionId=e,this.setSessionData(),void(a&&this.sessionCreationCall.sendRequest(this.sessionData,r.noOp));if(t)this.sessionId=r.uuidv4();else{var i=r.getCookie("gumlet_session_id");i&&""!==i?(this.sessionId=i,this.setSessionData()):(this.sessionId=r.setCookie("gumlet_session_id",30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,r.noOp))}}},{key:"sendAnalyticsSetupCall",value:function(){this.sendAnalyticsRequestAndClearValues(Ye.SETUP,{millis_from_previous_event:0}),this.setState(Ye.SETUP)}},{key:"getMillisFromPreviousState",value:function(){return(new Date).getTime()-this.previousStateTimeStamp.getTime()}},{key:"getPlaybackWatchTime",value:function(){return this.playbackWatchTime}},{key:"setPlaybackWatchTime",value:function(t){this.playbackWatchTime=t}},{key:"setVideoData",value:function(t){t&&r.validNumber(t.duration)&&(this.videoDuration=r.calculateTime(t.duration)),t&&r.validString(t.streamType)&&(this.videoSourceType=t.streamType,"dash"===t.streamType&&r.validString(t.mpdUrl)?(this.videoSourceUrl=t.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&r.validString(t.m3u8Url)?(this.videoSourceUrl=t.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&r.validString(t.streamUrl)?(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"progressive"===t.streamType&&r.validString(t.progUrl)?(this.videoSourceUrl=t.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl),t&&t.sourceHostName&&(this.videoSourceHostname=t.sourceHostName),t&&t.hasOwnProperty("muted")&&(this.isMuted=t.muted),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.height)&&t.currentVideoData.height>0&&(this.videoHeightPixels=t.currentVideoData.height),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.width)&&t.currentVideoData.width>0&&(this.videoWidthPixels=t.currentVideoData.width),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.bitrate)&&t.currentVideoData.bitrate>-1&&(this.videoBitrate=t.currentVideoData.bitrate/1e6),t&&t.currentVideoData&&r.validString(t.currentVideoData.audioCodec)&&t.currentVideoData.audioCodec.length>0&&(this.audioCodec=t.currentVideoData.audioCodec),t&&t.currentVideoData&&r.validString(t.currentVideoData.videoCodec)&&t.currentVideoData.videoCodec.length>0&&(this.videoCodec=t.currentVideoData.videoCodec);var e=0;if(!(this.videoHeightPixels&&this.playerData.player_height_pixels&&this.sessionData.meta_device_display_dpr))return this.upscalePercentage=void 0,void(this.downscalePercentage=void 0);(e=this.playerData.player_height_pixels*this.sessionData.meta_device_display_dpr/this.videoHeightPixels-1)>0?(this.upscalePercentage=100*e,this.downscalePercentage=0):e<0?(this.upscalePercentage=0,this.downscalePercentage=100*e*-1):(this.upscalePercentage=0,this.downscalePercentage=0);var a=new URL(this.videoSourceUrl);"video.gumlet.io"!==a.hostname||this.customVideoId||(this.customVideoId=a.pathname.split("/")[2])}},{key:"setupStateMachineCallbacks",value:function(){var e=this;this.stateMachineCallbacks={setup:function(t,a,i){nt.log("Setup Gumlet analytics "+e.analyticsVersion),e.setDuration(t),e.setVideoData(i),e.sendAnalyticsRequestAndClearValues(Ye.SETUP,{millis_from_previous_event:0}),e.setState(Ye.SETUP)},ready:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PLAYER_READY),e.setState(Ye.PLAYER_READY),e.setPlayerData(i),e.playerInitCall.sendRequest(e.playerData,r.noOp)},loaded:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var n={};null!==s&&(n={millis_from_previous_event:s,previous_event:Ye.PLAYER_READY}),e.sendAnalyticsRequestAndClearValues(Ye.PLAYBACK_READY,n),null===s&&e.setState(Ye.PLAYBACK_READY)},startup:function(t,a){e.setDuration(t)},first_play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PLAY),e.setState(Ye.PLAY),e.firstPlayTimestamp=new Date},play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PLAY),e.setState(Ye.PLAY)},updateSample:function(t){e.setPlaybackSettingsFromLoadedEvent(t)},playing:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PLAYING),e.setState(Ye.PLAYING)},playback_started:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var s=(new Date).getTime()-e.firstPlayTimestamp.getTime();e.sendAnalyticsRequestAndClearValues(Ye.PLAYBACK_STARTED,{millis_from_previous_event:s}),e.setState(Ye.PLAYBACK_STARTED)},playingAndBye:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i),e.sendUnloadRequest()},heartbeat:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PLAYBACK_UPDATE),e.setState(Ye.PLAYBACK_UPDATE)},playbackWatchTime:function(t){e.setPlaybackWatchTime(t)},qualitychange:function(t,a){e.setDuration(t)},qualitychange_pause:function(t,a){e.setDuration(t)},qualitychange_rebuffering:function(t,a){e.setDuration(t)},videoChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackSettingsFromLoadedEvent(t)},audioChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t)},pause:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(Ye.PAUSE),e.setState(Ye.PAUSE)},start_rebuffer:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),s||e.sendAnalyticsRequestAndClearValues(Ye.START_REBUFFER),e.setState(Ye.START_REBUFFER)},end_rebuffer:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),s)return e.getSample(Ye.END_REBUFFER);e.sendAnalyticsRequestAndClearValues(Ye.END_REBUFFER),e.setState(Ye.END_REBUFFER)},playback_seeked:function(t,a,i,s){e.sendAnalyticsRequestAndClearValues(Ye.SEEKED,{from:t,to:a}),e.setState(Ye.SEEKED),e.setupSample(),"PAUSE"===s?(e.sendAnalyticsRequestAndClearValues(Ye.PAUSE,{millis_from_previous_event:i}),e.setState(Ye.PAUSE)):"PLAYING"===s&&(e.sendAnalyticsRequestAndClearValues(Ye.PLAYING,{millis_from_previous_event:i}),e.setState(Ye.PLAYING))},paused_seeking:function(t,a,i){e.setDuration(t)},play_seeking:r.noOp,end_play_seeking:function(t,a,i){e.setDuration(t)},rebuffering:function(t,a,i){e.setDuration(t)},error:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.sendAnalyticsRequestAndClearValues(Ye.ERROR,{error_code:t.code,error:t.message}),e.setState(Ye.ERROR),e.setupSample()},end:function(t,a,i){e.setPlaybackId(),e.setDuration(t),e.sendAnalyticsRequestAndClearValues(Ye.END),e.setState(Ye.END)},ad:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i)},mute:function(t,a){e.isMuted=!0,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(Ye.MUTE)},unMute:function(t,a){e.isMuted=!1,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(Ye.UNMUTE)},muting_ready:r.noOp,muting_play:r.noOp,muting_pause:r.noOp,setVideoTimeEndFromEvent:function(t){},setVideoTimeStartFromEvent:function(t){},startCasting:function(a,i){if(i&&i.resuming)return e.isAllowedToSendSamples=!1,void nt.warning("Player started casting but a session is already casting!");e.isCastClient=!0,e.isAllowedToSendSamples=!1;var s=e.sample,n=s.domain,r=s.path,o=s.language,l=s.userAgent,c=s.userId,u=s.impressionId,h={type:t.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:e.config,userId:c,domain:n,path:r,language:o,userAgent:l,impressionId:u}};e.castClient.setUp(),e.castClient.sendMessage(h)},casting:function(){e.isCastClient=!1,e.samplesQueue=[],e.isAllowedToSendSamples=!0},source_changing:function(){},resetSessionExpiry:function(){e.config.test||e.config.sessionID||(r.setCookie("gumlet_session_id",30,e.sessionId),r.setCookie("gumlet_user_id",43200,e.userId))}}}},{key:"setDuration",value:function(t){}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;t&&(this.previousState=t,this.previousStateTimeStamp=new Date)}},{key:"setPlaybackSettingsFromLoadedEvent",value:function(t){t&&r.validNumber(t.currentTime)&&(this.currentTime=r.calculateTime(t.currentTime)),t&&r.validBoolean(t.isFullScreen)&&(this.isFullScreen=t.isFullScreen),t&&r.validBoolean(t.isCasting)&&(this.isCasting=t.isCasting)}},{key:"setupSample",value:function(){this.sample={property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,player_instance_id:this.playerInstanceId,playback_id:this.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,custom_event_data:void 0,playback_watch_time:void 0}}},{key:"getSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.sample;if(a.event=t,this.config.getUUID?a.event_id=this.config.getUUID():a.event_id=r.uuidv4(),a.custom_data_1=this.customData1,a.custom_data_2=this.customData2,a.custom_data_3=this.customData3,a.custom_data_4=this.customData4,a.custom_data_5=this.customData5,a.custom_data_6=this.customData6,a.custom_data_7=this.customData7,a.custom_data_8=this.customData8,a.custom_data_9=this.customData9,a.custom_data_10=this.customData1,a.custom_content_type=this.customContentType,a.custom_video_duration_millis=this.customVideoDurationMillis,a.custom_encoding_variant=this.customEncodingVariant,a.custom_video_language=this.customVideoLanguage,a.custom_video_id=this.customVideoId,a.custom_video_series=this.customVideoSeries,a.custom_video_producer=this.customVideoProducer,a.custom_video_title=this.customVideoTitle,a.custom_video_variant_name=this.customVideoVariantName,a.custom_video_variant=this.customVideoVariant,a.millis_from_previous_event=this.getMillisFromPreviousState(),a.previous_event=this.previousState,a.fullscreen=this.isFullScreen,a.muted=this.isMuted,a.video_width_pixels=this.videoWidthPixels,a.video_height_pixels=this.videoHeightPixels,a.video_total_duration_millis=this.videoDuration,a.bitrate=this.videoBitrate,a.audio_codec=this.audioCodec,a.video_codec=this.videoCodec,a.orientation=this.orientation,a.playback_time_instant_millis=this.currentTime,a.video_source_type=this.videoSourceType,a.video_source_url=this.videoSourceUrl,a.video_upscale_percentage=this.upscalePercentage,a.video_downscale_percentage=this.downscalePercentage,a.video_source_hostname=this.videoSourceHostname,a.custom_event_data=void 0,a.playback_watch_time=this.playbackWatchTime,Object.keys(e).forEach((function(t){a[t]=e[t]})),"undefined"!=typeof window&&void 0!==window.parent&&window.navigator)try{"function"==typeof window.navigator.getBattery&&window.navigator.getBattery().then((function(t){t&&(a.battery_level_percentage=100*t.level,a.battery_charging=t.charging)}))}catch(t){}return a}},{key:"sendAnalyticsRequest",value:function(t,e){var a=this.getSample(t,e);this.analyticsCall.sendRequest(a,r.noOp)}},{key:"sendAnalyticsRequestAsync",value:function(t,e){var a=this;return new Promise((function(i,s){var n=a.getSample(t,e);a.analyticsCall.sendRequestAsync(n).then((function(t){i(t)})).catch((function(t){s(t)}))}))}},{key:"sendAnalyticsRequestAndClearValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return nt.log("event null passed not hitting the injestion API"),False;this.sendAnalyticsRequest(t,e)}},{key:"sendAnalyticsRequestAndClearValuesAsync",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,s){e||(nt.log("event null passed not hitting the injestion API"),s("event null passed not hitting the injestion API")),t.sendAnalyticsRequestAsync(e,a).then((function(t){i(t)})).catch((function(t){s(t)}))}))}},{key:"sendUnloadRequest",value:function(){var t=this;"denied"!==this.licensing&&(void 0===navigator.sendBeacon?this.sendAnalyticsRequestSynchronous():fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:"POST",body:JSON.stringify(this.sample),headers:{"Content-Type":"application/json"}}).then((function(e){e.ok||t.sendAnalyticsRequestSynchronous()})).catch((function(e){t.sendAnalyticsRequestSynchronous()})))}},{key:"sendAnalyticsRequestSynchronous",value:function(){"denied"!==this.licensing&&this.analyticsCall.sendRequestSynchronous(this.sample,r.noOp)}},{key:"clearValues",value:function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.pageLoadType=0}},{key:"getDroppedFrames",value:function(t){if(null!=t&&0!=t){var e=t-this.droppedSampleFrames;return this.droppedSampleFrames=t,e}return 0}}],a&&Me(e.prototype,a),i&&Me(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();we(He,"PAGE_LOAD_TYPE",{FOREGROUND:1,BACKGROUND:2}),we(He,"LICENSE_CALL_PENDING_TIMEOUT",200),we(He,"PAGE_LOAD_TYPE_TIMEOUT",200),we(He,"CAST_RECEIVER_CONFIG_MESSAGE","CAST_RECEIVER_CONFIG_MESSAGE");const Ke=He;const Ve={CLOUDFLARE:"cloudflare",AKAMAI:"akamai",FASTLY:"fastly",MAXCDN:"maxcdn",CLOUDFRONT:"cloudfront",CHINACACHE:"chinacache",BITGRAVITY:"bitgravity"};var Be,We=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.register(t,e)},je=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerVideoJSPlayer(t,e)},xe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerDashJSPlayer(t,e)},Qe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerHLSJSPlayer(t,e)},qe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerShakaPlayer(t,e)},Je=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerHTML5Player(t,e)},$e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be.registerReactNativeVideoPlayer(t,e)},Xe=function(){return Be.getCurrentImpressionId()},ze=function(){return Be.analyticsStateMachine},Ze=function(t){return Be.updateCustomData(t)},ta=function(t){return Be.updateCustomVideoData(t)},ea=function(t){return Be.updateCustomUserData(t)},aa=function(t){return Be.updateCustomPlayerData(t)},ia=function(t,e){return Be.customEventHandler(t,e)},sa=function(t,e){return new Promise((function(a,i){Be.customEventHandlerAsync(t,e).then((function(t){a(t)})).catch((function(t){i(t)}))}))},na=function(t){return Be=new Ke(t),{register:We,registerVideoJSPlayer:je,registerDashJSPlayer:xe,registerHLSJSPlayer:Qe,registerShakaPlayer:qe,registerHTML5Player:Je,registerReactNativeVideoPlayer:$e,getCurrentImpressionId:Xe,stateMachine:ze,updateCustomData:Ze,updateCustomVideoData:ta,updateCustomUserData:ea,updateCustomPlayerData:aa,setCustomData:Be.setCustomData,setCustomDataOnce:Be.setCustomDataOnce,customEventHandler:ia,customEventHandlerAsync:sa}};na.Players=Lt,na.CdnProviders=Ve,na.gumletInsightsEvents=ut,na.gumletSupportedPlayers=Lt,"undefined"!=typeof window&&(window.gumlet=window.gumlet||{},window.gumlet.insights=na,window.gumletInsightsEvents=ut,window.gumletSupportedPlayers=Lt);const ra={insights:na,gumletInsightsEvents,gumletSupportedPlayers}})(),i})()));
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var a=e();for(var i in a)("object"==typeof exports?exports:t)[i]=a[i]}}(self,(()=>(()=>{var t={595:(t,e)=>{var a;a={VERSION:"2.4.0",Result:{SUCCEEDED:1,NOTRANSITION:2,CANCELLED:3,PENDING:4},Error:{INVALID_TRANSITION:100,PENDING_TRANSITION:200,INVALID_CALLBACK:300},WILDCARD:"*",ASYNC:"async",create:function(t,e){var i="string"==typeof t.initial?{state:t.initial}:t.initial,s=t.terminal||t.final,n=e||t.target||{},r=t.events||[],o=t.callbacks||{},l={},c={},u=function(t){var e=Array.isArray(t.from)?t.from:t.from?[t.from]:[a.WILDCARD];l[t.name]=l[t.name]||{};for(var i=0;i<e.length;i++)c[e[i]]=c[e[i]]||[],c[e[i]].push(t.name),l[t.name][e[i]]=t.to||e[i];t.to&&(c[t.to]=c[t.to]||[])};i&&(i.event=i.event||"startup",u({name:i.event,from:"none",to:i.state}));for(var h=0;h<r.length;h++)u(r[h]);for(var E in l)l.hasOwnProperty(E)&&(n[E]=a.buildEvent(E,l[E]));for(var E in o)o.hasOwnProperty(E)&&(n[E]=o[E]);return n.current="none",n.is=function(t){return Array.isArray(t)?t.indexOf(this.current)>=0:this.current===t},n.can=function(t){return!this.transition&&void 0!==l[t]&&(l[t].hasOwnProperty(this.current)||l[t].hasOwnProperty(a.WILDCARD))},n.cannot=function(t){return!this.can(t)},n.transitions=function(){return(c[this.current]||[]).concat(c[a.WILDCARD]||[])},n.isFinished=function(){return this.is(s)},n.error=t.error||function(t,e,a,i,s,n,r){throw r||n},n.states=function(){return Object.keys(c).sort()},i&&!i.defer&&n[i.event](),n},doCallback:function(t,e,i,s,n,r){if(e)try{return e.apply(t,[i,s,n].concat(r))}catch(e){return t.error(i,s,n,r,a.Error.INVALID_CALLBACK,"an exception occurred in a caller-provided callback function",e)}},beforeAnyEvent:function(t,e,i,s,n){return a.doCallback(t,t.onbeforeevent,e,i,s,n)},afterAnyEvent:function(t,e,i,s,n){return a.doCallback(t,t.onafterevent||t.onevent,e,i,s,n)},leaveAnyState:function(t,e,i,s,n){return a.doCallback(t,t.onleavestate,e,i,s,n)},enterAnyState:function(t,e,i,s,n){return a.doCallback(t,t.onenterstate||t.onstate,e,i,s,n)},changeState:function(t,e,i,s,n){return a.doCallback(t,t.onchangestate,e,i,s,n)},beforeThisEvent:function(t,e,i,s,n){return a.doCallback(t,t["onbefore"+e],e,i,s,n)},afterThisEvent:function(t,e,i,s,n){return a.doCallback(t,t["onafter"+e]||t["on"+e],e,i,s,n)},leaveThisState:function(t,e,i,s,n){return a.doCallback(t,t["onleave"+i],e,i,s,n)},enterThisState:function(t,e,i,s,n){return a.doCallback(t,t["onenter"+s]||t["on"+s],e,i,s,n)},beforeEvent:function(t,e,i,s,n){if(!1===a.beforeThisEvent(t,e,i,s,n)||!1===a.beforeAnyEvent(t,e,i,s,n))return!1},afterEvent:function(t,e,i,s,n){a.afterThisEvent(t,e,i,s,n),a.afterAnyEvent(t,e,i,s,n)},leaveState:function(t,e,i,s,n){var r=a.leaveThisState(t,e,i,s,n),o=a.leaveAnyState(t,e,i,s,n);return!1!==r&&!1!==o&&(a.ASYNC===r||a.ASYNC===o?a.ASYNC:void 0)},enterState:function(t,e,i,s,n){a.enterThisState(t,e,i,s,n),a.enterAnyState(t,e,i,s,n)},buildEvent:function(t,e){return function(){var i=this.current,s=e[i]||(e[a.WILDCARD]!=a.WILDCARD?e[a.WILDCARD]:i)||i,n=Array.prototype.slice.call(arguments);if(this.transition)return this.error(t,i,s,n,a.Error.PENDING_TRANSITION,"event "+t+" inappropriate because previous transition did not complete");if(this.cannot(t))return this.error(t,i,s,n,a.Error.INVALID_TRANSITION,"event "+t+" inappropriate in current state "+this.current);if(!1===a.beforeEvent(this,t,i,s,n))return a.Result.CANCELLED;if(i===s)return a.afterEvent(this,t,i,s,n),a.Result.NOTRANSITION;var r=this;this.transition=function(){return r.transition=null,r.current=s,a.enterState(r,t,i,s,n),a.changeState(r,t,i,s,n),a.afterEvent(r,t,i,s,n),a.Result.SUCCEEDED},this.transition.cancel=function(){r.transition=null,a.afterEvent(r,t,i,s,n)};var o=a.leaveState(this,t,i,s,n);return!1===o?(this.transition=null,a.Result.CANCELLED):a.ASYNC===o?a.Result.PENDING:this.transition?this.transition():void 0}}},t.exports&&(e=t.exports=a),e.StateMachine=a},503:function(t,e,a){var i;t=a.nmd(t),function(){"use strict";var s={function:!0,object:!0},n=s[typeof window]&&window||this,r=s[typeof e]&&e,o=s.object&&t&&!t.nodeType&&t,l=r&&o&&"object"==typeof a.g&&a.g;!l||l.global!==l&&l.window!==l&&l.self!==l||(n=l);var c=Math.pow(2,53)-1,u=/\bOpera/,h=Object.prototype,E=h.hasOwnProperty,m=h.toString;function S(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function d(t){return t=_(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:S(t)}function p(t,e){for(var a in t)E.call(t,a)&&e(t[a],a,t)}function f(t){return null==t?S(t):m.call(t).slice(8,-1)}function A(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function y(t,e){var a=null;return function(t,e){var a=-1,i=t?t.length:0;if("number"==typeof i&&i>-1&&i<=c)for(;++a<i;)e(t[a],a,t);else p(t,e)}(t,(function(i,s){a=e(a,i,s,t)})),a}function _(t){return String(t).replace(/^ +| +$/g,"")}var v=function t(e){var a=n,i=e&&"object"==typeof e&&"String"!=f(e);i&&(a=e,e=null);var s=a.navigator||{},r=s.userAgent||"";e||(e=r);var o,l,c,h,E,S=i?!!s.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(m.toString()),v="Object",N=i?v:"ScriptBridgingProxyObject",T=i?v:"Environment",D=i&&a.java?"JavaPackage":f(a.java),g=i?v:"RuntimeObject",I=/\bJava/.test(D)&&a.java,b=I&&f(a.environment)==T,C=I?"a":"α",P=I?"b":"β",U=a.document||{},G=a.operamini||a.opera,R=u.test(R=i&&G?G["[[Class]]"]:f(G))?R:G=null,L=e,k=[],Y=null,O=e==r,F=O&&G&&"function"==typeof G.version&&G.version(),M=y([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(t,a){return t||RegExp("\\b"+(a.pattern||A(a))+"\\b","i").exec(e)&&(a.label||a)})),w=function(t){return y(t,(function(t,a){return t||RegExp("\\b"+(a.pattern||A(a))+"\\b","i").exec(e)&&(a.label||a)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),H=B([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),K=function(t){return y(t,(function(t,a,i){return t||(a[H]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(H)]||RegExp("\\b"+A(i)+"(?:\\b|\\w*\\d)","i").exec(e))&&i}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),V=function(t){return y(t,(function(t,a){var i=a.pattern||A(a);return!t&&(t=RegExp("\\b"+i+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=function(t,e,a){var i={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return e&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(i=i[/[\d.]+$/.exec(t)])&&(t="Windows "+i),t=String(t),e&&a&&(t=t.replace(RegExp(e,"i"),a)),d(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(t,i,a.label||a)),t}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function B(t){return y(t,(function(t,a){var i=a.pattern||A(a);return!t&&(t=RegExp("\\b"+i+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+i+" *\\w+-[\\w]*","i").exec(e)||RegExp("\\b"+i+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(a.label&&!RegExp(i,"i").test(a.label)?a.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),a=a.label||a,t=d(t[0].replace(RegExp(i,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),t}))}function W(t){return y(t,(function(t,a){return t||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null}))}if(M&&(M=[M]),/\bAndroid\b/.test(V)&&!H&&(o=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e))&&(H=_(o[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),K&&!H?H=B([K]):K&&H&&(H=H.replace(RegExp("^("+A(K)+")[-_.\\s]","i"),K+" ").replace(RegExp("^("+A(K)+")[-_.]?(\\w)","i"),K+" $2")),(o=/\bGoogle TV\b/.exec(H))&&(H=o[0]),/\bSimulator\b/i.test(e)&&(H=(H?H+" ":"")+"Simulator"),"Opera Mini"==w&&/\bOPiOS\b/.test(e)&&k.push("running in Turbo/Uncompressed mode"),"IE"==w&&/\blike iPhone OS\b/.test(e)?(K=(o=t(e.replace(/like iPhone OS/,""))).manufacturer,H=o.product):/^iP/.test(H)?(w||(w="Safari"),V="iOS"+((o=/ OS ([\d_]+)/i.exec(e))?" "+o[1].replace(/_/g,"."):"")):"Konqueror"==w&&/^Linux\b/i.test(V)?V="Kubuntu":K&&"Google"!=K&&(/Chrome/.test(w)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(H))||/\bAndroid\b/.test(V)&&/^Chrome/.test(w)&&/\bVersion\//i.test(e)?(w="Android Browser",V=/\bAndroid\b/.test(V)?V:"Android"):"Silk"==w?(/\bMobi/i.test(e)||(V="Android",k.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&k.unshift("accelerated")):"UC Browser"==w&&/\bUCWEB\b/.test(e)?k.push("speed mode"):"PaleMoon"==w&&(o=/\bFirefox\/([\d.]+)\b/.exec(e))?k.push("identifying as Firefox "+o[1]):"Firefox"==w&&(o=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(V||(V="Firefox OS"),H||(H=o[1])):!w||(o=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(w))?(w&&!H&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(o+"/")+8))&&(w=null),(o=H||K||V)&&(H||K||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(V))&&(w=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(V)?V:o)+" Browser")):"Electron"==w&&(o=(/\bChrome\/([\d.]+)\b/.exec(e)||0)[1])&&k.push("Chromium "+o),F||(F=W(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",A(w),"(?:Firefox|Minefield|NetFront)"])),(o=("iCab"==M&&parseFloat(F)>3?"WebKit":/\bOpera\b/.test(w)&&(/\bOPR\b/.test(e)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(M)&&"WebKit"||!M&&/\bMSIE\b/i.test(e)&&("Mac OS"==V?"Tasman":"Trident")||"WebKit"==M&&/\bPlayStation\b(?! Vita\b)/i.test(w)&&"NetFront")&&(M=[o]),"IE"==w&&(o=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(w+=" Mobile",V="Windows Phone "+(/\+$/.test(o)?o:o+".x"),k.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(w="IE Mobile",V="Windows Phone 8.x",k.unshift("desktop mode"),F||(F=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=w&&"Trident"==M&&(o=/\brv:([\d.]+)/.exec(e))&&(w&&k.push("identifying as "+w+(F?" "+F:"")),w="IE",F=o[1]),O){if(h="global",E=null!=(c=a)?typeof c[h]:"number",/^(?:boolean|number|string|undefined)$/.test(E)||"object"==E&&!c[h])f(o=a.runtime)==N?(w="Adobe AIR",V=o.flash.system.Capabilities.os):f(o=a.phantom)==g?(w="PhantomJS",F=(o=o.version||null)&&o.major+"."+o.minor+"."+o.patch):"number"==typeof U.documentMode&&(o=/\bTrident\/(\d+)/i.exec(e))?(F=[F,U.documentMode],(o=+o[1]+4)!=F[1]&&(k.push("IE "+F[1]+" mode"),M&&(M[1]=""),F[1]=o),F="IE"==w?String(F[1].toFixed(1)):F[0]):"number"==typeof U.documentMode&&/^(?:Chrome|Firefox)\b/.test(w)&&(k.push("masking as "+w+" "+F),w="IE",F="11.0",M=["Trident"],V="Windows");else if(I&&(L=(o=I.lang.System).getProperty("os.arch"),V=V||o.getProperty("os.name")+" "+o.getProperty("os.version")),b){try{F=a.require("ringo/engine").version.join("."),w="RingoJS"}catch(t){(o=a.system)&&o.global.system==a.system&&(w="Narwhal",V||(V=o[0].os||null))}w||(w="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(o=a.process)&&("object"==typeof o.versions&&("string"==typeof o.versions.electron?(k.push("Node "+o.versions.node),w="Electron",F=o.versions.electron):"string"==typeof o.versions.nw&&(k.push("Chromium "+F,"Node "+o.versions.node),w="NW.js",F=o.versions.nw)),w||(w="Node.js",L=o.arch,V=o.platform,F=(F=/[\d.]+/.exec(o.version))?F[0]:null));V=V&&d(V)}if(F&&(o=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(F)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(O&&s.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&(Y=/b/i.test(o)?"beta":"alpha",F=F.replace(RegExp(o+"\\+?$"),"")+("beta"==Y?P:C)+(/\d+\+?/.exec(o)||"")),"Fennec"==w||"Firefox"==w&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(V))w="Firefox Mobile";else if("Maxthon"==w&&F)F=F.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(H))"Xbox 360"==H&&(V=null),"Xbox 360"==H&&/\bIEMobile\b/.test(e)&&k.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(w)&&(!w||H||/Browser|Mobi/.test(w))||"Windows CE"!=V&&!/Mobi/i.test(e))if("IE"==w&&O)try{null===a.external&&k.unshift("platform preview")}catch(t){k.unshift("embedded")}else(/\bBlackBerry\b/.test(H)||/\bBB10\b/.test(e))&&(o=(RegExp(H.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||F)?(V=((o=[o,/BB10/.test(e)])[1]?(H=null,K="BlackBerry"):"Device Software")+" "+o[0],F=null):this!=p&&"Wii"!=H&&(O&&G||/Opera/.test(w)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==w&&/\bOS X (?:\d+\.){2,}/.test(V)||"IE"==w&&(V&&!/^Win/.test(V)&&F>5.5||/\bWindows XP\b/.test(V)&&F>8||8==F&&!/\bTrident\b/.test(e)))&&!u.test(o=t.call(p,e.replace(u,"")+";"))&&o.name&&(o="ing as "+o.name+((o=o.version)?" "+o:""),u.test(w)?(/\bIE\b/.test(o)&&"Mac OS"==V&&(V=null),o="identify"+o):(o="mask"+o,w=R?d(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(o)&&(V=null),O||(F=null)),M=["Presto"],k.push(o));else w+=" Mobile";(o=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(o=[parseFloat(o.replace(/\.(\d)$/,".0$1")),o],"Safari"==w&&"+"==o[1].slice(-1)?(w="WebKit Nightly",Y="alpha",F=o[1].slice(0,-1)):F!=o[1]&&F!=(o[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(F=null),o[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e)||0)[1],537.36==o[0]&&537.36==o[2]&&parseFloat(o[1])>=28&&"WebKit"==M&&(M=["Blink"]),O&&(S||o[1])?(M&&(M[1]="like Chrome"),o=o[1]||((o=o[0])<530?1:o<532?2:o<532.05?3:o<533?4:o<534.03?5:o<534.07?6:o<534.1?7:o<534.13?8:o<534.16?9:o<534.24?10:o<534.3?11:o<535.01?12:o<535.02?"13+":o<535.07?15:o<535.11?16:o<535.19?17:o<536.05?18:o<536.1?19:o<537.01?20:o<537.11?"21+":o<537.13?23:o<537.18?24:o<537.24?25:o<537.36?26:"Blink"!=M?"27":"28")):(M&&(M[1]="like Safari"),o=(o=o[0])<400?1:o<500?2:o<526?3:o<533?4:o<534?"4+":o<535?5:o<537?6:o<538?7:o<601?8:o<602?9:o<604?10:o<606?11:o<608?12:"12"),M&&(M[1]+=" "+(o+="number"==typeof o?".x":/[.+]/.test(o)?"":"+")),"Safari"==w&&(!F||parseInt(F)>45)?F=o:"Chrome"==w&&/\bHeadlessChrome/i.test(e)&&k.unshift("headless")),"Opera"==w&&(o=/\bzbov|zvav$/.exec(V))?(w+=" ",k.unshift("desktop mode"),"zvav"==o?(w+="Mini",F=null):w+="Mobile",V=V.replace(RegExp(" *"+o+"$"),"")):"Safari"==w&&/\bChrome\b/.exec(M&&M[1])?(k.unshift("desktop mode"),w="Chrome Mobile",F=null,/\bOS X\b/.test(V)?(K="Apple",V="iOS 4.3+"):V=null):/\bSRWare Iron\b/.test(w)&&!F&&(F=W("Chrome")),F&&0==F.indexOf(o=/[\d.]+$/.exec(V))&&e.indexOf("/"+o+"-")>-1&&(V=_(V.replace(o,""))),V&&-1!=V.indexOf(w)&&!RegExp(w+" OS").test(V)&&(V=V.replace(RegExp(" *"+A(w)+" *"),"")),M&&!/\b(?:Avant|Nook)\b/.test(w)&&(/Browser|Lunascape|Maxthon/.test(w)||"Safari"!=w&&/^iOS/.test(V)&&/\bSafari\b/.test(M[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(w)&&M[1])&&(o=M[M.length-1])&&k.push(o),k.length&&(k=["("+k.join("; ")+")"]),K&&H&&H.indexOf(K)<0&&k.push("on "+K),H&&k.push((/^on /.test(k[k.length-1])?"":"on ")+H),V&&(o=/ ([\d.+]+)$/.exec(V),l=o&&"/"==V.charAt(V.length-o[0].length-1),V={architecture:32,family:o&&!l?V.replace(o[0],""):V,version:o?o[1]:null,toString:function(){var t=this.version;return this.family+(t&&!l?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(o=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(V&&(V.architecture=64,V.family=V.family.replace(RegExp(" *"+o),"")),w&&(/\bWOW64\b/i.test(e)||O&&/\w(?:86|32)$/.test(s.cpuClass||s.platform)&&!/\bWin64; x64\b/i.test(e))&&k.unshift("32-bit")):V&&/^OS X/.test(V.family)&&"Chrome"==w&&parseFloat(F)>=39&&(V.architecture=64),e||(e=null);var j={};return j.description=e,j.layout=M&&M[0],j.manufacturer=K,j.name=w,j.prerelease=Y,j.product=H,j.ua=e,j.version=w&&F,j.os=V||{architecture:null,family:null,version:null,toString:function(){return"null"}},j.parse=t,j.toString=function(){return this.description||""},j.version&&k.unshift(F),j.name&&k.unshift(w),V&&w&&(V!=String(V).split(" ")[0]||V!=w.split(" ")[0]&&!H)&&k.push(H?"("+V+")":"on "+V),k.length&&(j.description=k.join(" ")),j}();n.platform=v,void 0===(i=function(){return v}.call(e,a,e,t))||(t.exports=i)}.call(this)}},e={};function a(i){var s=e[i];if(void 0!==s)return s.exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var i={};return(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}a.r(i),a.d(i,{default:()=>We});var e=function(){return(new Date).getTime()},s=function(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16).toUpperCase()}))},n=function(t,e){var a,i=0;return function(){return i>=e||(a=t.apply(null,arguments),i++),a}};const r={validString:function(t){return null!=t&&"string"==typeof t},validBoolean:function(t){return null!=t&&"boolean"==typeof t},validNumber:function(t){return null!=t&&"number"==typeof t},sanitizePath:function(t){return t.replace(/\/$/g,"")},calculateTime:function(t){return t*=1e3,Math.round(t)},getCurrentTimestamp:e,getDurationFromTimestampToNow:function(t){return e()-t},uuidv4:s,getCookie:function(t){var e=t+"=",a=[];try{a=document.cookie.split(";")}catch(t){return""}for(var i="",s=0;s<a.length;s++){for(var n=a[s];" "==n.charAt(0);)n=n.substring(1);0==n.indexOf(e)&&(i=n.substring(e.length,n.length))}if(!i){try{i=localStorage.getItem(t)}catch(t){return""}var r=null;if(!i)return"";try{r=JSON.parse(i)}catch(t){return""}var o=null;if(!r.expires)return"";if(o=new Date(r.expires),"[object Date]"!==Object.prototype.toString.call(o))return"";if(isNaN(o))return"";if(!(o.getTime()>(new Date).getTime()))return"";i=r.value?r.value:""}return i},setCookie:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new Date;i.setTime(i.getTime()+60*e*1e3);var n=a||s();try{document.cookie=t+"="+n+"; expires="+i.toUTCString()+"; path=/",localStorage.setItem(t,JSON.stringify({expires:i.getTime(),value:n}))}catch(t){}return n},noOp:function(){},times:n,once:function(t){return n(t,1)},getHiddenProp:function(){var t=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var e=0;e<t.length;e++)if(t[e]+"Hidden"in document)return t[e]+"Hidden";return null},getCustomDataString:function e(a){return"object"===t(a)?JSON.stringify(a):"function"==typeof a?e(a()):void 0===a?a:"string"!=typeof a?String(a):a},jsonToQueryString:function(t){return"?"+Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},currentDateTimeFormatString:function(){return(new Date).toISOString()}};function o(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,a=[{key:"get",value:function(t,e,a){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.z=(new Date).getTime()/1e3;var s,n=[void 0,null,!1];Object.keys(e).forEach((function(t){return-1!==n.indexOf(e[t])&&delete e[t]})),Object.keys(e).forEach((function(t){return e[t]!=e[t]&&delete e[t]}));var o=!1;window.XDomainRequest&&(o=!0),s=o?new window.XDomainRequest:new XMLHttpRequest;var l=function(){if(s.readyState==XMLHttpRequest.DONE){if(s.responseText<=0)return;var t=JSON.parse(s.responseText);a(t)}};o?s.onload=l:s.onreadystatechange=l,t+=r.jsonToQueryString(e),s.open("GET",t,i),s.send(null)}},{key:"asyncGet",value:function(t,e){return new Promise((function(a,i){e.z=(new Date).getTime()/1e3;var s,n=[void 0,null,!1];Object.keys(e).forEach((function(t){return-1!==n.indexOf(e[t])&&delete e[t]})),Object.keys(e).forEach((function(t){return e[t]!=e[t]&&delete e[t]}));var o=!1;window.XDomainRequest&&(o=!0),(s=o?new window.XDomainRequest:new XMLHttpRequest).onload=function(){this.status>=200&&this.status<300?a(s.response):i({status:this.status,statusText:s.statusText})};var l=r.jsonToQueryString(e);t+=l,s.open("GET",t),s.onerror=function(){i({status:this.status,statusText:s.statusText})},s.send()}))}}],a&&o(e.prototype,a),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var c="urn:x-cast:com.gumlet.ingest.cast",u="https://ingest.gumlytics.com",h=1e4;function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function m(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function S(t,e){return S=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},S(t,e)}function d(t){var e=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(t){return!1}}();return function(){var a,i=f(t);if(e){var s=f(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return p(t)}(this,a)}}function p(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function A(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&S(t,e)}(n,t);var e,a,i,s=d(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return A(p(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e,a,i){var s={key:t,domain:e,analyticsVersion:a};this.get(n.licenseServerUrl,s,i)})),t}return e=n,a&&m(e.prototype,a),i&&m(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);A(y,"licenseServerUrl",u+"/licensing");function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function v(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function N(t,e){return N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},N(t,e)}function T(t){var e=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(t){return!1}}();return function(){var a,i=g(t);if(e){var s=g(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return D(t)}(this,a)}}function D(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function I(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var b=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&N(t,e)}(n,t);var e,a,i,s=T(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return I(D(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="session_event",this.get(n.analyticsServerUrl,t,e)})),I(D(t),"sendRequestAsync",(function(t){var e=this;return t.event_family="session_event",new Promise((function(a,i){e.asyncGet(n.analyticsServerUrl,t).then((function(t){a(t)})).catch((function(t){i(t)}))}))})),I(D(t),"sendRequestSynchronous",(function(t,e){t.event_family="session_event",this.get(n.analyticsServerUrl,t,e,!1)})),I(D(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&v(e.prototype,a),i&&v(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);I(b,"analyticsServerUrl",u);const C=b;function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}function U(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function G(t,e){return G=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},G(t,e)}function R(t){var e=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(t){return!1}}();return function(){var a,i=k(t);if(e){var s=k(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===P(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return L(t)}(this,a)}}function L(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},k(t)}function Y(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var O=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&G(t,e)}(n,t);var e,a,i,s=R(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return Y(L(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="session",this.get(n.analyticsServerUrl,t,e)})),Y(L(t),"sendRequestSynchronous",(function(t,e){t.event_family="session",this.get(n.analyticsServerUrl,t,e,!1)})),Y(L(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&U(e.prototype,a),i&&U(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);Y(O,"analyticsServerUrl",u);const F=O;function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function w(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function H(t,e){return H=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},H(t,e)}function K(t){var e=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(t){return!1}}();return function(){var a,i=B(t);if(e){var s=B(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===M(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return V(t)}(this,a)}}function V(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},B(t)}function W(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var j=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&H(t,e)}(n,t);var e,a,i,s=K(n);function n(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return W(V(t=s.call.apply(s,[this].concat(a))),"sendRequest",(function(t,e){t.event_family="player_init",this.get(n.analyticsServerUrl,t,e)})),W(V(t),"sendRequestSynchronous",(function(t,e){t.event_family="player_init",this.get(n.analyticsServerUrl,t,e,!1)})),W(V(t),"getAnalyticsServerUrl",(function(){return n.analyticsServerUrl})),t}return e=n,a&&w(e.prototype,a),i&&w(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}(l);W(j,"analyticsServerUrl",u);const x=j;const Q=function(){var t=window.navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"};function q(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function J(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}const $=new(function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,"log",(function(t){this.showLogs&&console.log(t)})),J(this,"error",(function(t){this.showLogs&&console.error(t)})),J(this,"warning",(function(t){this.showLogs&&console.warn(t)})),this.showLogs=e}var e,a,i;return e=t,(a=[{key:"setLogging",value:function(t){this.showLogs=t}},{key:"isLogging",value:function(){return this.showLogs}}])&&q(e.prototype,a),i&&q(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}());function X(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function z(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Z=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"isShaka",value:function(t){return!!window.shaka&&"function"==typeof shaka.Player&&t.constructor===shaka.Player}},{key:"isDashjs",value:function(t){return"function"==typeof t.addABRCustomRule}},{key:"isHlsjs",value:function(t){return!!window.Hls&&"function"==typeof window.Hls&&t.constructor===window.Hls}}],(a=null)&&X(e.prototype,a),i&&X(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();z(Z,"isBitmovinVersionPre7",(function(t){return!Z.isDashjs(t)&&("function"==typeof t.getVersion&&t.getVersion()<"7")})),z(Z,"isBitmovinVersion7Plus",(function(t){return"string"==typeof t.version&&t.version>="7"})),z(Z,"isVideoJs",(function(t){if("function"==typeof videojs)try{if(videojs(t.id_)===t)return!0}catch(t){}return!1}));const tt=Z;const et={READY:"ready",STARTUP:"startup",SOURCE_LOADED:"sourceLoaded",PLAY:"play",PAUSE:"pause",TIMECHANGED:"timechanged",SEEK:"seek",SEEKED:"seeked",START_CAST:"startCasting",END_CAST:"endCasting",START_BUFFERING:"startBuffering",END_BUFFERING:"endBuffering",AUDIO_CHANGE:"audioChange",VIDEO_CHANGE:"videoChange",START_FULLSCREEN:"startFullscreen",END_FULLSCREEN:"endFullscreen",START_AD:"adStart",END_AD:"adEnd",MUTE:"mute",UN_MUTE:"unMute",ERROR:"playerError",PLAYBACK_FINISHED:"end",SCREEN_RESIZE:"resize",UNLOAD:"unload",END:"end",METADATA_LOADED:"metadataLoaded",SOURCE_UNLOADED:"sourceUnloaded",PLAYBACK_PLAYING:"playback_playing"};function at(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const it=function(){function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()}var e,a,i;return e=t,(a=[{key:"register",value:function(){var t=this;this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,(function(){t.eventCallback(et.SOURCE_LOADED)})),this.player.addEventHandler(this.player.EVENT.ON_READY,(function(){var e=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(e=t.player.getConfig().playback.autoplay),t.eventCallback(et.READY,{isLive:t.player.isLive(),version:t.player.getVersion(),type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:t.player.getConfig().source.videoId,userId:t.player.getConfig().source.userId,mpdUrl:t.player.getConfig().source.dash,m3u8Url:t.player.getConfig().source.hls,progUrl:t.player.getConfig().source.progressive,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:e})})),this.player.addEventHandler(this.player.EVENT.ON_CAST_START,(function(){t.eventCallback(et.START_CAST)})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOP,(function(){t.eventCallback(et.END_CAST)})),this.player.addEventHandler(this.player.EVENT.ON_PLAY,(function(){t.eventCallback(et.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_PAUSE,(function(){t.eventCallback(et.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,(function(){t.eventCallback(et.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEK,(function(){t.eventCallback(et.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,(function(){t.eventCallback(et.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_START_BUFFERING,(function(){t.eventCallback(et.START_BUFFERING)})),this.player.addEventHandler(this.player.EVENT.ON_STOP_BUFFERING,(function(){t.eventCallback(et.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGE,(function(){var e=t.player.getPlaybackAudioData();t.eventCallback(et.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGE,(function(){var e=t.player.getPlaybackVideoData();t.eventCallback(et.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,(function(){t.eventCallback(et.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.onBeforeUnLoadEvent=!1,this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,(function(){t.eventCallback(et.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,(function(){t.eventCallback(et.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,(function(){t.eventCallback(et.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_MUTE,(function(){t.eventCallback(et.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_UNMUTE,(function(){t.eventCallback(et.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_ERROR,(function(e){t.eventCallback(et.ERROR,{code:e.code,message:e.message})})),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,(function(){t.eventCallback(et.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(et.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(et.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&at(e.prototype,a),i&&at(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function st(t){return st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st(t)}function nt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const rt=function(){function t(e,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.register()}var e,a,i;return e=t,(a=[{key:"register",value:function(){var t=this,e=function(e){if(!e)return{progUrl:void 0,progBitrate:void 0};if("string"==typeof e)return{progUrl:e,progBitrate:0};if(Array.isArray(e)){var a=t.player.getPlaybackVideoData(),i=parseInt(a.id)||0;return{progUrl:e[i].url,progBitrate:e[i].bitrate||0}}return"object"===st(e)?{progUrl:e.url,progBitrate:e.bitrate||0}:void 0};this.player.addEventHandler(this.player.EVENT.ON_SOURCE_UNLOADED,(function(e){t.eventCallback(et.SOURCE_UNLOADED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),this.player.addEventHandler(this.player.EVENT.ON_SOURCE_LOADED,(function(a){var i=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(i=t.player.getConfig().playback.autoplay);var s=t.player.getConfig(),n={},r=e(s.source.progressive);s.source&&(n={mpdUrl:s.source.dash,m3u8Url:s.source.hls,progUrl:r.progUrl,progBitrate:r.progBitrate}),t.eventCallback(et.SOURCE_LOADED,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),mpdUrl:n.mpdUrl,m3u8Url:n.m3u8Url,progUrl:n.progUrl,progBitrate:n.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),autoplay:i})})),this.player.addEventHandler(this.player.EVENT.ON_READY,(function(){var a=!1;t.player.getConfig().playback&&t.player.getConfig().playback.autoplay&&(a=t.player.getConfig().playback.autoplay);var i=t.player.getConfig(),s={},n=e(i.source.progressive);i.source&&(s={videoId:i.source.videoId,userId:i.source.userId,mpdUrl:i.source.dash,m3u8Url:i.source.hls,progUrl:n.progUrl,progBitrate:n.progBitrate});var r=!0;null!=t.player.getConfig().adaptation.preload&&"boolean"==typeof t.player.getConfig().adaptation.preload&&(r=t.player.getConfig().adaptation.preload);var o=t.player.getAudio();o||(o="undetected"),t.eventCallback(et.READY,{isLive:t.player.isLive(),version:t.player.version,type:t.player.getPlayerType(),duration:t.player.getDuration(),streamType:t.player.getStreamType(),videoId:s.videoId,userId:s.userId,mpdUrl:s.mpdUrl,m3u8Url:s.m3u8Url,progUrl:s.progUrl,progBitrate:s.progBitrate,videoWindowWidth:t.player.getFigure().offsetWidth,videoWindowHeight:t.player.getFigure().offsetHeight,isMuted:t.player.isMuted(),preload:r,audioLanguage:o,isFullScreen:t.player.isFullscreen(),autoplay:a})})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STARTED,(function(e){t.eventCallback(et.START_CAST,e)})),this.player.addEventHandler(this.player.EVENT.ON_CAST_STOPPED,(function(){t.eventCallback(et.END_CAST,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_PLAY,(function(){t.eventCallback(et.PLAY,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_PAUSED,(function(){t.eventCallback(et.PAUSE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_TIME_CHANGED,(function(){t.eventCallback(et.TIMECHANGED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEK,(function(){t.eventCallback(et.SEEK,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_SEEKED,(function(){t.eventCallback(et.SEEKED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_STALL_STARTED,(function(){t.eventCallback(et.START_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_STALL_ENDED,(function(){t.eventCallback(et.END_BUFFERING,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AUDIO_PLAYBACK_QUALITY_CHANGED,(function(){var e=t.player.getPlaybackAudioData();t.eventCallback(et.AUDIO_CHANGE,{bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_VIDEO_PLAYBACK_QUALITY_CHANGED,(function(){var e=t.player.getPlaybackVideoData();t.eventCallback(et.VIDEO_CHANGE,{width:e.width,height:e.height,bitrate:e.bitrate,currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_ENTER,(function(){t.eventCallback(et.START_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_FULLSCREEN_EXIT,(function(){t.eventCallback(et.END_FULLSCREEN,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_STARTED,(function(){t.eventCallback(et.START_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_AD_FINISHED,(function(){t.eventCallback(et.END_AD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_MUTED,(function(){t.eventCallback(et.MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_UNMUTED,(function(){t.eventCallback(et.UN_MUTE,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames(),currentVideoData:t.player.getPlaybackVideoData(),isFullScreen:t.player.isFullscreen(),isCasting:t.player.isCasting()})})),this.player.addEventHandler(this.player.EVENT.ON_ERROR,(function(e){t.eventCallback(et.ERROR,{code:e.code,message:e.message,currentTime:t.player.getCurrentTime()})})),this.player.addEventHandler(this.player.EVENT.ON_PLAYBACK_FINISHED,(function(){t.eventCallback(et.PLAYBACK_FINISHED,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()})})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){t.onBeforeUnLoadEvent||(t.onBeforeUnLoadEvent=!0,t.eventCallback(et.UNLOAD,{currentTime:t.player.getCurrentTime(),droppedFrames:t.player.getDroppedFrames()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(et.UNLOAD,{currentTime:this.player.getCurrentTime(),droppedFrames:this.player.getDroppedFrames()}))}}])&&nt(e.prototype,a),i&&nt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ot(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function lt(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(a),!0).forEach((function(e){ct(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ot(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function ct(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function ut(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const ht=function(){function t(e,a,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.onBeforeUnLoadEvent=!1,this.player=e,this.eventCallback=a,this.stateMachine=i,this.register()}var e,a,i;return e=t,(a=[{key:"getStreamType",value:function(t){return t.endsWith(".m3u8")?"hls":t.endsWith(".mpd")?"dash":"progressive"}},{key:"getStreamSources",value:function(t){var e=null,a=null,i=null;switch(this.getStreamType(t)){case"hls":a=t;break;case"dash":e=t;break;default:i=t}return{mpdUrl:e,m3u8Url:a,progUrl:i}}},{key:"getVideoWindowDimensions",value:function(t){return{width:t.el_.clientWidth,height:t.el_.clientHeight}}},{key:"getVideoSourceDimensions",value:function(t){return{videoWidth:t.videoWidth(),videoHeight:t.videoHeight()}}},{key:"getVideojsSourceHandlerMode_",value:function(){var t=this.player.tech({IWillNotUseThisInPlugins:!0});return t.sourceHandler_?t.sourceHandler_.options_.mode:"native"}},{key:"register",value:function(){var t,e,a=this,i=this;this.player.on("loadedmetadata",(function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),s=lt(lt(lt({isLive:this.duration()===1/0,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:this.videoWidth(),videoWindowHeight:this.videoHeight(),muted:this.muted()});i.stateMachine.updateMetadata(s),i.eventCallback(et.SOURCE_LOADED,s)})),this.player.on("loadeddata",(function(){})),this.player.ready((function(){var t=i.getStreamType(this.currentSrc()),e=i.getStreamSources(this.currentSrc()),a=i.getVideojsSourceHandlerMode_(),s=i.getVideoWindowDimensions(this),n={width:null,height:null,bitrate:null};if(this.tech_.hls){var r=this.tech_.hls.playlists.media();if(r){var o=r.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}}var l=lt(lt(lt({isLive:!1,version:videojs.VERSION,type:a,duration:this.duration(),streamType:t,autoplay:this.autoplay()},e),i.getVideoWindowDimensions(this)),{},{videoWindowWidth:s.width,videoWindowHeight:s.height,muted:this.muted(),currentVideoData:n});i.eventCallback(et.READY,l)})),this.player.on("play",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(et.PLAY,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("pause",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(et.PAUSE,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("ended",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(et.END,{currentTime:this.currentTime()})})),this.player.on("error",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height}}var s=this.player().error();i.eventCallback(et.ERROR,{currentTime:this.currentTime(),code:s?s.code:-1,message:s?s.message:"Unknown error"})})),this.player.on("volumechange",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}this.muted()?i.eventCallback(et.MUTE,{currentTime:this.currentTime(),currentVideoData:t}):i.eventCallback(et.UN_MUTE,{currentTime:this.currentTime(),currentVideoData:t})})),this.player.on("seeking",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(et.SEEK,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})})),this.player.on("seeked",(function(){var t={width:null,height:null,bitrate:null};if(this.tech_.hls){var e=this.tech_.hls.playlists.media();if(e){var a=e.attributes;t.bitrate=a.BANDWIDTH,t.width=a.RESOLUTION.width,t.height=a.RESOLUTION.height,t.videoCodec=a.CODECS.split(",")[0],t.audioCodec=a.CODECS.split(",")[1]}}i.eventCallback(et.SEEKED,{currentTime:this.currentTime(),droppedFrames:0,currentVideoData:t})})),Date.now();var s=!1;this.player.on("timeupdate",(function(){var a=this;clearTimeout(e),s=!1,Date.now();var n={width:null,height:null,bitrate:null},r=null;if(this.tech_.hls&&(r=this.tech_.hls.playlists.media())){var o=r.attributes;n.bitrate=o.BANDWIDTH,n.width=o.RESOLUTION.width,n.height=o.RESOLUTION.height,n.videoCodec=o.CODECS.split(",")[0],n.audioCodec=o.CODECS.split(",")[1]}if(i.eventCallback(et.TIMECHANGED,{currentTime:this.currentTime(),currentVideoData:n}),r){var l=r.attributes,c=l.BANDWIDTH,u=l.RESOLUTION.width,h=l.RESOLUTION.height,E=l.CODECS.split(",")[0],m=l.CODECS.split(",")[1];if(t!==c){var S={width:u,height:h,bitrate:c,videoCodec:E,audioCodec:m,currentTime:this.currentTime(),currentVideoData:n};i.eventCallback(et.VIDEO_CHANGE,S),t=c}if(e=setTimeout((function(){(!a.paused()&&!a.ended()||s)&&i.eventCallback(et.START_BUFFERING,{currentTime:a.currentTime()})}),1e3),this.tech({IWillNotUseThisInPlugins:!0}).hls){var d=this.tech_.hls;if(!d.playlists||"function"!=typeof d.playlists.media)return;var p=d.playlists.media();if(!p)return;var f=p.attributes,A=f.BANDWIDTH,y=f.RESOLUTION.width,_=f.RESOLUTION.height,v={width:y,height:_,bitrate:A,videoCodec:f.CODECS.split(",")[0],audioCodec:f.CODECS.split(",")[1]};if(isNaN(t)||t!==A){var N={width:y,height:_,bitrate:A,currentTime:this.currentTime(),currentVideoData:v};i.eventCallback(et.VIDEO_CHANGE,N),t=A}}}})),this.player.on("stalled",(function(){s=!0})),"undefined"!=typeof window?window.onunload=window.onbeforeunload=function(){a.onBeforeUnLoadEvent||(a.onBeforeUnLoadEvent=!0,a.eventCallback(et.UNLOAD,{currentTime:a.player.currentTime()}))}:this.onBeforeUnLoadEvent||(this.onBeforeUnLoadEvent=!0,this.eventCallback(et.UNLOAD,{currentTime:this.player.currentTime()}))}}])&&ut(e.prototype,a),i&&ut(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var Et,mt="video/mp4",St="video/webm",dt="application/x-mpegURL",pt="application/dash+xml",ft=dt,At=pt;function yt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var _t=St,vt=ft,Nt=At,Tt=(yt(Et={},mt,"mp4"),yt(Et,_t,"webm"),yt(Et,vt,"hls"),yt(Et,Nt,"dash"),Et);var Dt={BITMOVIN:"bitmovin",JW:"jw",RADIANT:"radiant",VIDEOJS:"videojs",HLSJS:"hlsjs",SHAKA:"shaka",DASHJS:"dashjs",HTML:"html5",REACTNATIVEVIDEO:"react-native-video"};function gt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var It=function(){function t(e,a,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.eventCallback=a,this.playerSoftwareName=s||Dt.HTML,this.stateMachine=i,this.mediaEl=e,this.mediaElEventHandlers=[],this.analyticsBitrate_=-1,this.audioCodec_="",this.videoCodec_="",this.bufferingTimeout_=null,this.isBuffering_=!1,this.isLive_=!1,this.isPaused_=!1,this.previousMediaTime_=null,this.needsReadyEvent_=!0,this.needsFirstPlayIntent_=!0,this.mediaElementSet_=!1,this.playbackReadySet_=!1,e&&this.setMediaElement()}var e,a,i;return e=t,a=[{key:"setMediaElement",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(t&&this.mediaEl&&(this.unregisterMediaElement(),this.mediaElementSet_=!1),t&&(this.mediaEl=t),!this.mediaEl)throw new Error("No media element owned");if(this.mediaElementSet_)throw new Error("Media element already set (only call this once)");this.mediaElementSet_=!0,this.registerMediaElement(),this.onMaybeReady()}},{key:"getCurrentQualityLevelInfo",value:function(){return null}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){var t,e=this.mediaEl,a="";return e||(a=null),a=e&&e.src?e.src:e&&e.querySelector("source")&&e.querySelector("source").src?e.querySelector("source").src:null,(t=(t=a).toLowerCase()).endsWith(".m3u8")?dt:t.endsWith(".mp4")||t.endsWith(".m4v")||t.endsWith(".m4a")?mt:t.endsWith(".webm")?St:t.endsWith(".mpd")?pt:null}},{key:"getStreamType",value:function(){return t=this.getMIMEType(),Tt[t];var t}},{key:"getPlayerVersion",value:function(){return null}},{key:"getStreamURL",value:function(){var t=this.mediaEl;return t?t&&t.src?t.src:t&&t.querySelector("source")&&t.querySelector("source").src?t.querySelector("source").src:null:null}},{key:"resetMedia",value:function(){this.mediaEl=null,this.mediaElEventHandlers=[]}},{key:"registerMediaElement",value:function(){var t=this,e=this.mediaEl;e&&(this.listenToMediaElementEvent("loadedmetadata",(function(){if(1===e.readyState){t.checkQualityLevelAttributes(!0);var a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,currentVideoData:{height:n,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),muted:r};t.needsFirstPlayIntent_||t.eventCallback(et.METADATA_LOADED,c)}})),this.listenToMediaElementEvent("canplay",(function(){if(!t.playbackReadySet_){t.playbackReadySet_=!0;var a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.clientWidth,l=e.clientHeight,c={type:"html5",isLive:t.isLive(),version:t.getPlayerVersion()||"html5",streamType:t.getStreamType(),streamUrl:t.getStreamURL(),duration:a,autoplay:i,playerSoftware:t.playerSoftwareName,videoWindowWidth:parseInt(o),videoWindowHeight:parseInt(l),currentVideoData:{height:n,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},muted:r};t.eventCallback(et.SOURCE_LOADED,c)}})),this.listenToMediaElementEvent("play",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.needsFirstPlayIntent_=!1,t.eventCallback(et.PLAY,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("pause",(function(){t.onPaused()})),this.listenToMediaElementEvent("playing",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.isPaused_=!1,t.needsFirstPlayIntent_||t.eventCallback(et.TIMECHANGED,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("error",(function(){var a=e.currentTime,i=e.error;t.eventCallback(et.ERROR,{currentTime:a,code:i.code,message:i.message})})),this.listenToMediaElementEvent("volumechange",(function(){var a=e.muted,i=e.currentTime;a?t.eventCallback(et.MUTE,{currentTime:i}):t.eventCallback(et.UN_MUTE,{currentTime:i})})),this.listenToMediaElementEvent("seeking",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.eventCallback(et.SEEK,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})})),this.listenToMediaElementEvent("seeked",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.bufferingTimeout_&&clearTimeout(t.bufferingTimeout_),t.eventCallback(et.SEEKED,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a,droppedFrames:0})})),this.listenToMediaElementEvent("ended",(function(){var a=e.currentTime,i=e.videoWidth,s=e.videoHeight;t.eventCallback(et.END,{currentVideoData:{height:s,width:i,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a})})),this.listenToMediaElementEvent("timeupdate",(function(){var a=e.currentTime,i=e.videoHeight,s=e.videoWidth;t.isBuffering_=!1,t.needsFirstPlayIntent_||(t.isPaused_||t.eventCallback(et.TIMECHANGED,{currentVideoData:{height:i,width:s,bitrate:t.analyticsBitrate_,audioCodec:t.audioCodec_,videoCodec:t.videoCodec_},currentTime:a}),t.checkQualityLevelAttributes(),t.checkPlayheadProgress(),t.previousMediaTime_=a)})),this.listenToMediaElementEvent("stalled",(function(){})),this.listenToMediaElementEvent("waiting",(function(){t.onBuffering()})))}},{key:"listenToMediaElementEvent",value:function(t,e){if(!this.mediaEl)throw new Error("No media attached");var a=e.bind(this);this.mediaElEventHandlers.push({handler:a,event:t}),this.mediaEl.addEventListener(t,a,!1)}},{key:"onMaybeReady",value:function(){if(this.needsReadyEvent_&&this.mediaEl){this.needsReadyEvent_=!1;var t=!1,e=this.mediaEl,a=e.duration,i=e.autoplay,s=e.videoWidth,n=e.videoHeight,r=e.muted,o=e.preload;this.mediaEl&&this.mediaEl.src?this.mediaEl.src:this.mediaEl&&this.mediaEl.querySelector("source")&&this.mediaEl.querySelector("source").src&&this.mediaEl.querySelector("source").src;var l=this.mediaEl.clientWidth,c=this.mediaEl.clientHeight;"none"!==o&&(t=!0);var u={type:"html5",isLive:this.isLive(),version:this.getPlayerVersion()||"html5",streamType:this.getStreamType(),streamUrl:this.getStreamURL(),duration:a,autoplay:i,preload:t,playerSoftware:this.playerSoftwareName,currentVideoData:{height:n,width:s,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},videoWindowWidth:parseInt(l),videoWindowHeight:parseInt(c),muted:r};this.stateMachine.updateMetadata(u),this.eventCallback(et.READY,u)}}},{key:"unregisterMediaElement",value:function(){var t=this;if(!this.mediaEl)throw new Error("No media attached");this.mediaElEventHandlers.forEach((function(e){t.mediaEl.removeEventListener(e.event,e.handler,!1)})),this.resetMedia()}},{key:"onBuffering",value:function(){var t=this.mediaEl.currentTime;this.isBuffering_||this.isPaused_||(this.eventCallback(et.START_BUFFERING,{currentTime:t}),this.isBuffering_=!0)}},{key:"onPaused",value:function(){if(!this.isPaused_){var t=this.mediaEl,e=t.currentTime,a=t.videoHeight,i=t.videoWidth;this.eventCallback(et.PAUSE,{currentVideoData:{height:a,width:i,bitrate:this.analyticsBitrate_,audioCodec:this.audioCodec_,videoCodec:this.videoCodec_},currentTime:e}),this.isPaused_=!0}}},{key:"checkPlayheadProgress",value:function(){var t=this,e=this.mediaEl;e.paused&&this.onPaused(),this.bufferingTimeout_&&clearTimeout(this.bufferingTimeout_),this.bufferingTimeout_=setTimeout((function(){e.paused||e.ended&&!t.isBuffering_||e.currentTime-t.previousMediaTime_<1e3&&t.onBuffering()}),1e3)}},{key:"checkQualityLevelAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.mediaEl,a=this.getCurrentQualityLevelInfo();if(a){var i=a.bitrate,s=a.width,n=a.height,r=a.videoCodec,o=a.audioCodec,l=this.isLive();if(l!==this.isLive_&&(this.isLive_=l,t||this.stateMachine.updateMetadata({isLive:l})),this.audioCodec_=o,this.videoCodec_=r,this.analyticsBitrate_!==i){var c={width:s,height:n,bitrate:i,videoCodec:r,audioCodec:o,currentTime:e.currentTime};t||this.eventCallback(et.VIDEO_CHANGE,c),this.analyticsBitrate_=i}}}}],a&>(e.prototype,a),i&>(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function bt(t){return bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bt(t)}function Ct(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Pt(t,e){return Pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Pt(t,e)}function Ut(t){var e=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(t){return!1}}();return function(){var a,i=Gt(t);if(e){var s=Gt(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===bt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,a)}}function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Gt(t)}var Rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pt(t,e)}(n,t);var e,a,i,s=Ut(n);function n(t,e,a){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=s.call(this,null,e,a,Dt.HLSJS)).hls=t,i.playerSoftwareName=Dt.HLSJS,i.resetMedia(),i.registerHlsEvents(),i}return e=n,(a=[{key:"getCurrentQualityLevelInfo",value:function(){var t=this.hls,e=t.levels[t.currentLevel];if(e){var a=e.attrs,i=parseInt(a.BANDWIDTH,10),s=parseInt(a.RESOLUTION.width,10),n=parseInt(a.RESOLUTION.height,10),r=null,o=null;return a.CODECS&&(r=a.CODECS.split(",").length>1?a.CODECS.split(",")[1]:"",o=a.CODECS.split(",").length>1?a.CODECS.split(",")[0]:""),{bitrate:i,width:s,height:n,audioCodec:r,videoCodec:o}}}},{key:"isLive",value:function(){var t=this.hls;if(t.currentLevel<0)return!1;var e=t.levels[t.currentLevel];return!!e&&e.details.live}},{key:"getPlayerVersion",value:function(){return Hls.version}},{key:"getMIMEType",value:function(){return ft}},{key:"getStreamURL",value:function(){return this.hls.url}},{key:"registerHlsEvents",value:function(){var t=this,e=this.hls;if(!Hls)throw new Error("Hls.js is not defined installed (must be loaded before analytics module)");e.on(Hls.Events.MEDIA_ATTACHING,this.onMediaAttaching.bind(this)),e.on(Hls.Events.MEDIA_DETACHING,this.onMediaDetaching.bind(this)),e.on(Hls.Events.MANIFEST_LOADING,this.onManifestLoading.bind(this)),e.on(Hls.Events.ERROR,(function(e,a){t.onError(a)})),e.media&&this.onMediaAttaching(),e.url&&this.onManifestLoading()}},{key:"onMediaAttaching",value:function(){this.mediaEl||(this.mediaEl=this.hls.media,this.registerMediaElement(),this.onMaybeReady())}},{key:"onMediaDetaching",value:function(){this.unregisterMediaElement()}},{key:"onManifestLoading",value:function(){this.onMaybeReady()}},{key:"onError",value:function(t){var e,a,i=this.mediaEl.currentTime;this.eventCallback(et.ERROR,{currentTime:i,code:null==t?void 0:t.type,message:JSON.stringify({details:null==t?void 0:t.details,fatal:null==t?void 0:t.fatal,type:null==t?void 0:t.type,fragment_url:null==t?void 0:t.url,error:{message:null==t||null===(e=t.error)||void 0===e?void 0:e.message,stack:null==t||null===(a=t.error)||void 0===a?void 0:a.stack}})})}}])&&Ct(e.prototype,a),i&&Ct(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(It);function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function kt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Yt(t,e){return Yt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Yt(t,e)}function Ot(t){var e=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(t){return!1}}();return function(){var a,i=Ft(t);if(e){var s=Ft(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===Lt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,a)}}function Ft(t){return Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ft(t)}var Mt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Yt(t,e)}(n,t);var e,a,i,s=Ot(n);function n(t,e,a,i){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),r=s.call(this,i,e,a,Dt.SHAKA),!shaka)throw new Error("`shaka` lib is not installed (must be loaded before analytics module)");return r.shakaPlayer=t,r.playerSoftwareName=Dt.SHAKA,r.registerShakaEvents(),r}return e=n,(a=[{key:"getPlayerVersion",value:function(){return shaka.Player.version}},{key:"isLive",value:function(){return!!this.shakaPlayer&&this.shakaPlayer.isLive()}},{key:"getMIMEType",value:function(){return At}},{key:"getStreamURL",value:function(){return this.shakaPlayer?this.shakaPlayer.getAssetUri():null}},{key:"registerShakaEvents",value:function(){var t=this,e=this.shakaPlayer;if(!e)throw new Error("Shaka player object is not defined");e.addEventListener("error",(function(e){t.onGumletShakaError(e,t.eventCallback,t.mediaEl)}))}},{key:"onGumletShakaError",value:function(t,e,a){var i=0;if(a&&(i=this.mediaEl.currentTime),t.detail){var s=t.detail,n=[];t.detail.data&&t.detail.data.forEach((function(t){n.push(t)})),e(et.ERROR,{currentTime:i,code:s.code,message:JSON.stringify({category:null==s?void 0:s.v,code:null==s?void 0:s.code,severity:null==s?void 0:s.severity,handled:null==s?void 0:s.handled,timestamp:null==t?void 0:t.timestamp,extra_data:n})})}else eventCallback(et.ERROR,{currentTime:i,code:"not_set_by_shaka",message:"{}"})}},{key:"getCurrentQualityLevelInfo",value:function(){var t=this.shakaPlayer.getVariantTracks().filter((function(t){return t.active})).filter((function(t){return t.videoCodec||void 0!==t.videoId}))[0];return t?{bitrate:t.videoBandwidth||t.bandwidth,width:t.width,height:t.height,videoCodec:t.videoCodec,audioCodec:t.audioCodec}:null}}])&&kt(e.prototype,a),i&&kt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(It);function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}function Ht(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Kt(t,e){return Kt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Kt(t,e)}function Vt(t){var e=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(t){return!1}}();return function(){var a,i=Wt(t);if(e){var s=Wt(this).constructor;a=Reflect.construct(i,arguments,s)}else a=i.apply(this,arguments);return function(t,e){if(e&&("object"===wt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Bt(t)}(this,a)}}function Bt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}var jt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Kt(t,e)}(n,t);var e,a,i,s=Vt(n);function n(t,e,a){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),i=s.call(this,null,e,a,Dt.DASHJS);var r=null,o=!1;i.playerSoftwareName=Dt.DASHJS;try{r=t.getVideoElement()}catch(t){}return r?i._initialize(t,r):t.on(dashjs.MediaPlayer.events.CAN_PLAY,(function(){if(!o){r=t.getVideoElement(),o=!0,i._initialize(t,r);var e=r,a=e.duration,s=e.autoplay,n=e.videoWidth,l=e.videoHeight,c=e.muted,u=r.clientWidth,h=r.clientHeight,E={type:"html5",isLive:i.isLive(),version:i.getPlayerVersion()||"html5",streamType:i.getStreamType(),streamUrl:i.getStreamURL(),duration:a,autoplay:s,playerSoftware:i.playerSoftwareName,videoWindowWidth:parseInt(u),videoWindowHeight:parseInt(h),currentVideoData:{height:l,width:n,bitrate:i.analyticsBitrate_,audioCodec:i.audioCodec_,videoCodec:i.videoCodec_},muted:c};i.eventCallback(et.SOURCE_LOADED,E)}}),Bt(i)),i}return e=n,(a=[{key:"_initialize",value:function(t,e){this.mediaPlayer=t,this.setMediaElement(e)}},{key:"getPlayerVersion",value:function(){return this.mediaPlayer.getVersion()}},{key:"isLive",value:function(){return!1}},{key:"getMIMEType",value:function(){return At}},{key:"getStreamURL",value:function(){return this.mediaPlayer?this.mediaPlayer.getSource():null}},{key:"getCurrentQualityLevelInfo",value:function(){if(this.mediaPlayer){var t=this.mediaPlayer.getBitrateInfoListFor("video")[this.mediaPlayer.getQualityFor("video")],e=this.mediaPlayer.getCurrentTrackFor("video"),a=this.mediaPlayer.getCurrentTrackFor("audio"),i=t.width,s=t.height,n=t.bitrate,r=null,o=null;return e&&(o=e.codec.split('"').length>0?e.codec.split('"')[1]:e.codec),a&&(r=a.codec.split('"').length>0?a.codec.split('"')[1]:a.codec),{width:i,height:s,bitrate:n,audioCodec:r,videoCodec:o}}return null}}])&&Ht(e.prototype,a),i&&Ht(e,i),Object.defineProperty(e,"prototype",{writable:!1}),n}(It);function xt(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Qt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"getAdapter",value:function(t,e,a){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return tt.isBitmovinVersionPre7(t)?new it(t,e):tt.isBitmovinVersion7Plus(t)?new rt(t,e):tt.isVideoJs(t)?new ht(t,e,a):tt.isHlsjs(t)?new Rt(t,e,a):tt.isShaka(t)?new Mt(t,e,a,i):tt.isDashjs(t)?new jt(t,e,a):new It(t,e,a)}}],(a=null)&&xt(e.prototype,a),i&&xt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();var qt=a(595),Jt=a.n(qt);function $t(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Xt(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var zt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE"},this.createStateMachine()}var e,a,i;return e=t,i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],(a=[{key:"createStateMachine",value:function(){var e=this,a=[et.PLAY,et.PAUSE,et.SEEK,et.SEEKED,et.PLAYBACK_PLAYING,et.PLAYBACK_FINISHED,et.READY,et.SCREEN_RESIZE,et.END,et.ERROR,et.UN_MUTE,et.MUTE];this.stateMachine=Jt().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n,r){$.error(n)},events:[{name:et.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:et.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:et.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:et.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:et.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:et.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:et.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:et.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:et.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:et.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:et.END,from:this.States.PLAYING,to:this.States.END},{name:et.END,from:this.States.PAUSE,to:this.States.END},{name:et.SEEK,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.END,to:this.States.END},{name:et.TIMECHANGED,from:this.States.END,to:this.States.END},{name:et.END_BUFFERING,from:this.States.END,to:this.States.END},{name:et.START_BUFFERING,from:this.States.END,to:this.States.END},{name:et.END,from:this.States.END,to:this.States.END},{name:et.PLAY,from:this.States.END,to:this.States.PLAYING},{name:et.ERROR,from:[this.States.SETUP,this.States.STARTUP,this.States.READY,this.States.PLAYING,this.States.REBUFFERING,this.States.PAUSE,this.States.QUALITYCHANGE,this.States.PAUSED_SEEKING,this.States.PLAY_SEEKING,this.States.END_PLAY_SEEKING,this.States.QUALITYCHANGE_PAUSE,"FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE",this.States.END,this.States.ERROR],to:this.States.ERROR},{name:et.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.UNLOAD,from:[this.States.PLAYING,this.States.PAUSE],to:this.States.END},{name:et.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:et.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:et.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:et.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:et.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:et.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:et.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:et.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(i,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),i===et.SEEK&&s===e.States.PAUSE&&r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY?(e.stateMachine.PLAY_SEEK(r),!1):(i===et.SEEK&&clearTimeout(e.seekedTimeout),i===et.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):void 0)},onafterevent:function(i,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(i)&&(i===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),$.log(t.pad(r,20)+"EVENT: "+t.pad(i,20)+" from "+t.pad(s,14)+"-> "+t.pad(n,14)),n===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(r),n===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(r),n!==e.States.MUTING_READY&&n!==e.States.MUTING_PLAY&&n!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(r)},onenterstate:function(t,i,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),e.onEnterStateTimestamp=n||(new Date).getTime(),$.log("Entering State "+s+" with "+t),r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(r)},onleavestate:function(t,i,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),n){var o=n-e.onEnterStateTimestamp;$.log("State "+i+" was "+o+" ms event:"+t),r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeEndFromEvent(r);var l=i.toLowerCase();if(i===e.States.END_PLAY_SEEKING||i===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks[l](c,l,r),$.log("Seek was "+c+"ms")}else if(t===et.UNLOAD&&i===e.States.PLAYING)e.stateMachineCallbacks.playingAndBye(o,l,r);else if(i===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING)e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.stateMachineCallbacks.pause(o,l,r),e.stateMachineCallbacks.heartbeat(n,l,r);else{var u=e.stateMachineCallbacks[l];"function"==typeof u?u(o,l,r):$.error("Could not find callback function for "+l)}r&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(r),t===et.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===et.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===et.MUTE?($.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===et.UN_MUTE&&($.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=n.currentTime-e.customData.previousRecordTime;r>0&&r<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=s-e.onEnterStateTimestamp;o>59700&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),$.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):$.log("Ignored Event: "+t)}}])&&$t(e.prototype,a),i&&$t(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Zt(t){return function(t){if(Array.isArray(t))return te(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return te(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return te(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function ee(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function ae(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}Xt(zt,"PAUSE_SEEK_DELAY",60),Xt(zt,"SEEKED_PAUSE_DELAY",120);var ie=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.seekedFrom=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",AD:"AD",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING",SOURCE_CHANGING:"SOURCE_CHANGING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(Zt(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[et.PLAY,et.PAUSE,et.SEEK,et.SEEKED,et.PLAYBACK_PLAYING,et.PLAYBACK_FINISHED,et.READY,et.SCREEN_RESIZE,et.END,et.ERROR,et.UN_MUTE,et.MUTE];this.stateMachine=Jt().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){$.error("Error in statemachine: "+n)},events:[{name:et.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:et.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:et.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:et.END_BUFFERING,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:et.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:et.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:et.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:et.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:et.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.PLAY,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:et.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:et.END,from:this.States.PLAYING,to:this.States.END},{name:et.END,from:this.States.PAUSE,to:this.States.END},{name:et.SEEK,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.END,to:this.States.END},{name:et.TIMECHANGED,from:this.States.END,to:this.States.END},{name:et.END_BUFFERING,from:this.States.END,to:this.States.END},{name:et.START_BUFFERING,from:this.States.END,to:this.States.END},{name:et.END,from:this.States.END,to:this.States.END},{name:et.PLAY,from:this.States.END,to:this.States.PLAYING},{name:et.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:et.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:et.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:et.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:et.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:et.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:et.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:et.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:et.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:et.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:et.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:et.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:et.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:et.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:et.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:et.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:et.SEEK,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.SOURCE_UNLOADED,from:this.getAllStates(),to:this.States.SOURCE_CHANGING},{name:et.READY,from:this.States.SOURCE_CHANGING,to:this.States.READY},{name:et.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:et.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:et.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(a,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===et.SEEK&&s===e.States.PAUSE&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=r,r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(r),!1):(a===et.SEEK&&clearTimeout(e.seekedTimeout),a!==et.SOURCE_LOADED?a===et.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):(s!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(r,e.States.READY,o))},onafterevent:function(t,a,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),s===e.States.QUALITYCHANGE_PAUSE&&e.stateMachine.FINISH_QUALITYCHANGE_PAUSE(n),s===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),s===e.States.QUALITYCHANGE_REBUFFERING&&e.stateMachine.FINISH_QUALITYCHANGE_REBUFFERING(n),s!==e.States.MUTING_READY&&s!==e.States.MUTING_PLAY&&s!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onenterstate:function(t,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(r,e.States.SETUP,o):n===e.States.READY?(o.playerSoftware="Bitmovin",e.stateMachineCallbacks.ready(r,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(r,e.States.PLAY,o):"play"===t&&s===e.States.PAUSE?(e.stateMachineCallbacks.play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(r,e.States.PLAY,o)):"timechanged"===t&&s===e.States.STARTUP&&n===e.States.PLAYING?(e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):n===e.States.PAUSE&&s===e.States.PLAYING?(e.stateMachineCallbacks.pause(r,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(r,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(r,e.States.END,o),e.stateMachineCallbacks.heartbeat(r,e.States.END,o)):n===e.States.END?e.stateMachineCallbacks.mute(r,o):t===et.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(r,e.States.REBUFFERING,o):t===et.END_BUFFERING&&e.stateMachineCallbacks.end_rebuffer(r,e.States.REBUFFERING,o),"none"===s&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onleavestate:function(t,a,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),n){i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime);var o=n-e.onEnterStateTimestamp;if(r&&s!==e.States.PAUSED_SEEKING&&s!==e.States.PLAY_SEEKING&&s!==e.States.END_PLAY_SEEKING&&($.log("Setting video time end to "+r.currentTime+", going to "+s),e.stateMachineCallbacks.setVideoTimeEndFromEvent(r)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*r.currentTime,c,s),$.log("Seek was "+c+"ms")}else t===et.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,r):a===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===et.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===et.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===et.MUTE?($.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===et.UN_MUTE&&($.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s,n){e.customData.previousRecordTime=n.currentTime,e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=n.currentTime-e.customData.previousRecordTime;r>0&&r<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime);var o=s-e.onEnterStateTimestamp;o>{HEARTBEAT_THRESHOLD:h}&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),$.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(o,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n))},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):$.log("Ignored Event: "+t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&ee(e.prototype,a),i&&ee(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function se(t){return function(t){if(Array.isArray(t))return ne(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ne(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ne(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function re(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function oe(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}ae(ie,"PAUSE_SEEK_DELAY",200),ae(ie,"SEEKED_PAUSE_DELAY",300);var le=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedTimeout=0,this.onEnterStateTimestamp=0,this.lastPlayHeadDuration=0,this.autoPlay=!1,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",PLAY_SEEKING:"PLAY_SEEKING",END_PLAY_SEEKING:"END_PLAY_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(se(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_PLAY_SEEKING","PLAY_SEEK","FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var e=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[et.PLAY,et.PAUSE,et.SEEK,et.SEEKED,et.PLAYBACK_PLAYING,et.PLAYBACK_FINISHED,et.READY,et.SCREEN_RESIZE,et.END,et.ERROR,et.UN_MUTE,et.MUTE];this.stateMachine=Jt().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){$.error("Error in statemachine: "+n)},events:[{name:et.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:et.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:et.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:et.PLAY,from:this.States.SETUP,to:this.States.SETUP},{name:et.TIMECHANGED,from:this.States.READY,to:this.States.STARTUP},{name:et.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:et.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:et.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:et.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.SEEK,from:this.States.PLAYING,to:this.States.PLAY_SEEKING},{name:et.TIMECHANGED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:et.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:et.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:et.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:et.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:et.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:"PLAY_SEEK",from:this.States.PAUSE,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PAUSED_SEEKING,to:this.States.PLAY_SEEKING},{name:"PLAY_SEEK",from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEK,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:et.SEEKED,from:this.States.PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.START_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.END_BUFFERING,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.SEEKED,from:this.States.END_PLAY_SEEKING,to:this.States.END_PLAY_SEEKING},{name:et.TIMECHANGED,from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.END,from:this.States.PLAY_SEEKING,to:this.States.END},{name:et.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:et.END,from:this.States.PLAYING,to:this.States.END},{name:et.END,from:this.States.PAUSE,to:this.States.END},{name:et.SEEK,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.END,to:this.States.END},{name:et.TIMECHANGED,from:this.States.END,to:this.States.END},{name:et.END_BUFFERING,from:this.States.END,to:this.States.END},{name:et.START_BUFFERING,from:this.States.END,to:this.States.END},{name:et.END,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.PLAY,from:this.States.END,to:this.States.PLAYING},{name:et.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:et.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:et.SEEK,from:this.States.END_PLAY_SEEKING,to:this.States.PLAY_SEEKING},{name:"FINISH_PLAY_SEEKING",from:this.States.END_PLAY_SEEKING,to:this.States.PLAYING},{name:et.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:et.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:et.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:et.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:et.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:et.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:et.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:et.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:et.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:et.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:et.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:et.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:et.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:et.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:et.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:et.SEEK,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.SOURCE_LOADED,from:this.getAllStates(),to:this.States.SETUP},{name:et.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:et.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:et.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onpause:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),a===e.States.PLAYING&&(e.pausedTimestamp=s)},onbeforeevent:function(a,s,n,r,o){return e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(a)&&(a===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),a===et.PLAY&&s===e.States.SETUP&&n===e.States.SETUP&&(e.autoPlay=!0),a===et.SEEK&&(s===e.States.PAUSE||s===e.States.PLAYING)&&(e.seekedFrom=e.lastPlayHeadDuration,e.seekTimestamp=r,r-e.pausedTimestamp<t.PAUSE_SEEK_DELAY)?(e.stateMachine.PLAY_SEEK(r),!1):(a===et.SEEK&&clearTimeout(e.seekedTimeout),a!==et.SOURCE_LOADED?a===et.SEEKED&&s===e.States.PAUSED_SEEKING?(e.seekedTimestamp=r,e.seekedTimeout=setTimeout((function(){e.stateMachine.pause(r,o)}),t.SEEKED_PAUSE_DELAY),!1):(s!==e.States.REBUFFERING||n!==e.States.QUALITYCHANGE_REBUFFERING)&&void(o&&(e.lastPlayHeadDuration=1e3*o.currentTime)):void e.stateMachineCallbacks.loaded(r,e.States.READY,o))},onenterstate:function(t,s,n,r,o){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=o.currentTime),n===e.States.SETUP?e.stateMachineCallbacks.setup(r,e.States.SETUP,o):n===e.States.READY?(o.playerSoftware=Dt.VIDEOJS,e.stateMachineCallbacks.ready(r,e.States.READY,o)):"play"===t&&n===e.States.STARTUP?e.stateMachineCallbacks.first_play(r,e.States.PLAY,o):"timechanged"===t&&s===e.States.STARTUP&&n===e.States.PLAYING&&e.autoPlay?(e.stateMachineCallbacks.first_play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)):"play"===t&&s===e.States.PAUSE?(e.stateMachineCallbacks.play(r,e.States.PLAY,o),e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.heartbeat(r,e.States.PLAY,o)):"timechanged"!==t||s!==e.States.STARTUP||n!==e.States.PLAYING||e.autoPlay?n===e.States.PAUSE&&s===e.States.PLAYING?(e.stateMachineCallbacks.pause(r,e.States.PAUSE,o),e.stateMachineCallbacks.heartbeat(r,e.States.PAUSE,o)):n===e.States.END?(e.stateMachineCallbacks.end(r,e.States.END,o),e.stateMachineCallbacks.heartbeat(r,e.States.END,o)):n===e.States.END?e.stateMachineCallbacks.mute(r,o):t===et.START_BUFFERING?e.stateMachineCallbacks.start_rebuffer(r,e.States.REBUFFERING,o):"timechanged"===t&&s===e.States.REBUFFERING&&n===e.States.PLAYING&&e.stateMachineCallbacks.end_rebuffer(r,e.States.REBUFFERING,o):(e.stateMachineCallbacks.playing(r,e.States.PLAYING,o),e.stateMachineCallbacks.playback_started(o)),"none"===s&&a.starttime?e.onEnterStateTimestamp=a.starttime:e.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==e.States.PAUSED_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(o),"PLAY_SEEK"===t&&n===e.States.PLAY_SEEKING&&n!==e.States.PLAY_SEEKING&&n!==e.States.END_PLAY_SEEKING&&(e.seekTimestamp=e.onEnterStateTimestamp)},onafterevent:function(t,a,s,n,r){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),s===e.States.QUALITYCHANGE&&e.stateMachine.FINISH_QUALITYCHANGE(n),s!==e.States.MUTING_READY&&s!==e.States.MUTING_PLAY&&s!==e.States.MUTING_PAUSE||e.stateMachine.FINISH_MUTING(n)},onleavestate:function(t,a,s,n,r){if(e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),i.includes(t)&&(t===et.PLAYBACK_FINISHED&&(e.customData.previousRecordTime=0),e.customData.previousRecordTime=r.currentTime),e.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-e.onEnterStateTimestamp;if(r&&s!==e.States.PAUSED_SEEKING&&s!==e.States.PLAY_SEEKING&&s!==e.States.END_PLAY_SEEKING&&($.log("Setting video time end to "+r.currentTime+", going to "+s),e.stateMachineCallbacks.setVideoTimeEndFromEvent(r)),"PLAY_SEEK"===t&&a===e.States.PAUSE)return!0;var l=a.toLowerCase();if(a===e.States.END_PLAY_SEEKING||a===e.States.PAUSED_SEEKING){var c=e.seekedTimestamp-e.seekTimestamp;e.stateMachineCallbacks.playback_seeked(e.seekedFrom,1e3*r.currentTime,c,s),$.log("Seek was "+c+"ms")}else t===et.UNLOAD&&a===e.States.PLAYING?e.stateMachineCallbacks.playingAndBye(o,l,r):a===e.States.PAUSE&&s!==e.States.PAUSED_SEEKING&&e.stateMachineCallbacks.setVideoTimeStartFromEvent(t);t===et.VIDEO_CHANGE?e.stateMachineCallbacks.videoChange(r):t===et.AUDIO_CHANGE?e.stateMachineCallbacks.audioChange(r):t===et.MUTE?($.log("Setting sample to muted"),e.stateMachineCallbacks.mute()):t===et.UN_MUTE&&($.log("Setting sample to unmuted"),e.stateMachineCallbacks.unMute())}},onseek:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekTimestamp=s},onseeked:function(t,a,i,s){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime),e.seekedTimestamp=s},ontimechanged:function(t,a,i,s,n){e.stateMachineCallbacks.playbackWatchTime(e.customData.playbackWatchTime);var r=s-e.onEnterStateTimestamp,o=n.currentTime-e.customData.previousRecordTime;o>0&&o<5&&(e.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-e.customData.previousRecordTime)),e.customData.previousRecordTime=n.currentTime),r>h&&(e.stateMachineCallbacks.setVideoTimeEndFromEvent(n),$.log("Sending heartbeat"),e.stateMachineCallbacks.heartbeat(r,a.toLowerCase(),n),e.onEnterStateTimestamp=s,e.stateMachineCallbacks.setVideoTimeStartFromEvent(n),e.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(t,a,i,s,n){e.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):$.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&re(e.prototype,a),i&&re(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ce(t){return function(t){if(Array.isArray(t))return ue(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return ue(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return ue(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function he(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}oe(le,"PAUSE_SEEK_DELAY",200),oe(le,"SEEKED_PAUSE_DELAY",300);var Ee=function(){function t(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.stateMachineCallbacks=e,this.customData={previousRecordTime:0,playbackWatchTime:0},this.pausedTimestamp=null,this.onEnterStateTimestamp=0,this.seekStartedAt=null,this.seekTimestamp=0,this.seekedTimestamp=0,this.seekedFrom=0,this.lastPlayHeadDuration=0,this.playTimeStamp=null,this.States={SETUP:"SETUP",STARTUP:"STARTUP",READY:"READY",PLAYING:"PLAYING",REBUFFERING:"REBUFFERING",PAUSE:"PAUSE",QUALITYCHANGE:"QUALITYCHANGE",PAUSED_SEEKING:"PAUSED_SEEKING",QUALITYCHANGE_PAUSE:"QUALITYCHANGE_PAUSE",QUALITYCHANGE_REBUFFERING:"QUALITYCHANGE_REBUFFERING",END:"END",ERROR:"ERROR",MUTING_READY:"MUTING_READY",MUTING_PLAY:"MUTING_PLAY",MUTING_PAUSE:"MUTING_PAUSE",CASTING:"CASTING"},this.createStateMachine(a)}var e,a,i;return e=t,a=[{key:"getAllStates",value:function(){var t=this;return[].concat(ce(Object.keys(this.States).map((function(e){return t.States[e]}))),["FINISH_QUALITYCHANGE_PAUSE","FINISH_QUALITYCHANGE","FINISH_QUALITYCHANGE_REBUFFERING"])}},{key:"createStateMachine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=[et.PLAY,et.PAUSE,et.SEEK,et.SEEKED,et.PLAYBACK_PLAYING,et.PLAYBACK_FINISHED,et.READY,et.SCREEN_RESIZE,et.END,et.ERROR,et.UN_MUTE,et.MUTE];this.stateMachine=Jt().create({initial:this.States.SETUP,error:function(t,e,a,i,s,n){$.error("Error in statemachine: "+n)},events:[{name:et.TIMECHANGED,from:this.States.SETUP,to:this.States.SETUP},{name:et.READY,from:[this.States.SETUP,this.States.ERROR],to:this.States.READY},{name:et.PLAY,from:this.States.READY,to:this.States.STARTUP},{name:et.START_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.END_BUFFERING,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.VIDEO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.AUDIO_CHANGE,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.TIMECHANGED,from:this.States.STARTUP,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PAUSE,to:this.States.PAUSE},{name:et.SEEKED,from:this.States.PAUSE,to:this.States.PAUSE},{name:et.END_BUFFERING,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.START_BUFFERING,from:this.States.PLAYING,to:this.States.REBUFFERING},{name:et.START_BUFFERING,from:this.States.REBUFFERING,to:this.States.REBUFFERING},{name:et.PLAY,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.REBUFFERING,to:this.States.PLAYING},{name:et.SEEK,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.PLAY,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.PAUSE,from:this.States.PLAYING,to:this.States.PAUSE},{name:et.PAUSE,from:this.States.REBUFFERING,to:this.States.PAUSE},{name:et.PLAY,from:this.States.PAUSE,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.PAUSE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.PLAYING,to:this.States.QUALITYCHANGE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE,to:this.States.QUALITYCHANGE},{name:"FINISH_QUALITYCHANGE",from:this.States.QUALITYCHANGE,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_PAUSE,to:this.States.QUALITYCHANGE_PAUSE},{name:"FINISH_QUALITYCHANGE_PAUSE",from:this.States.QUALITYCHANGE_PAUSE,to:this.States.PAUSE},{name:et.SEEK,from:this.States.PAUSE,to:this.States.PAUSED_SEEKING},{name:et.SEEK,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.AUDIO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.VIDEO_CHANGE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.START_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.END_BUFFERING,from:this.States.PAUSED_SEEKING,to:this.States.PAUSED_SEEKING},{name:et.SEEKED,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:et.TIMECHANGED,from:this.States.PAUSED_SEEKING,to:this.States.PLAYING},{name:et.PAUSE,from:this.States.PAUSED_SEEKING,to:this.States.PAUSE},{name:et.END,from:this.States.PAUSED_SEEKING,to:this.States.END},{name:et.END,from:this.States.PLAYING,to:this.States.END},{name:et.END,from:this.States.PAUSE,to:this.States.END},{name:et.SEEK,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.END,to:this.States.END},{name:et.TIMECHANGED,from:this.States.END,to:this.States.END},{name:et.END_BUFFERING,from:this.States.END,to:this.States.END},{name:et.START_BUFFERING,from:this.States.END,to:this.States.END},{name:et.END,from:this.States.END,to:this.States.END},{name:et.SEEKED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.PLAY,from:this.States.END,to:this.States.PLAYING},{name:et.ERROR,from:this.getAllStates(),to:this.States.ERROR},{name:et.PAUSE,from:this.States.ERROR,to:this.States.ERROR},{name:et.PLAY,from:this.States.ERROR,to:this.States.PLAYING},{name:et.TIMECHANGED,from:this.States.ERROR,to:this.States.PLAYING},{name:et.UNLOAD,from:this.getAllStates(),to:this.States.END},{name:et.START_AD,from:this.States.PLAYING,to:this.States.AD},{name:et.END_AD,from:this.States.AD,to:this.States.PLAYING},{name:et.MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:et.UN_MUTE,from:this.States.READY,to:this.States.MUTING_READY},{name:"FINISH_MUTING",from:this.States.MUTING_READY,to:this.States.READY},{name:et.MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:et.UN_MUTE,from:this.States.PLAYING,to:this.States.MUTING_PLAY},{name:"FINISH_MUTING",from:this.States.MUTING_PLAY,to:this.States.PLAYING},{name:et.MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:et.UN_MUTE,from:this.States.PAUSE,to:this.States.MUTING_PAUSE},{name:"FINISH_MUTING",from:this.States.MUTING_PAUSE,to:this.States.PAUSE},{name:et.START_CAST,from:[this.States.READY,this.States.PAUSE],to:this.States.CASTING},{name:et.PAUSE,from:this.States.CASTING,to:this.States.CASTING},{name:et.PLAY,from:this.States.CASTING,to:this.States.CASTING},{name:et.TIMECHANGED,from:this.States.CASTING,to:this.States.CASTING},{name:et.MUTE,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEK,from:this.States.CASTING,to:this.States.CASTING},{name:et.SEEKED,from:this.States.CASTING,to:this.States.CASTING},{name:et.END_CAST,from:this.States.CASTING,to:this.States.READY},{name:et.SEEK,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.READY,to:this.States.READY},{name:et.SEEKED,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.SOURCE_LOADED,from:this.States.SETUP,to:this.States.SETUP},{name:et.SOURCE_LOADED,from:this.States.READY,to:this.States.READY},{name:et.SOURCE_LOADED,from:this.States.STARTUP,to:this.States.STARTUP},{name:et.SOURCE_LOADED,from:this.States.PLAYING,to:this.States.PLAYING},{name:et.VIDEO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.VIDEO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:et.AUDIO_CHANGE,from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.QUALITYCHANGE_REBUFFERING},{name:"FINISH_QUALITYCHANGE_REBUFFERING",from:this.States.QUALITYCHANGE_REBUFFERING,to:this.States.REBUFFERING}],callbacks:{onbeforeevent:function(e,i,s,n,r){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===et.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),e===et.SEEK&&i===t.States.PAUSE&&(t.seekedFrom=t.lastPlayHeadDuration),e!==et.SOURCE_LOADED)r&&(t.lastPlayHeadDuration=1e3*r.currentTime);else{var o=null;i===t.States.PLAYING&&(o=(new Date).getTime()-t.playTimeStamp.getTime()),t.stateMachineCallbacks.loaded(n,t.States.READY,r,o)}},onenterstate:function(i,s,n,r,o){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(i)&&(i===et.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=o.currentTime),n===t.States.SETUP&&"none"===s?t.stateMachineCallbacks.setup(r,t.States.SETUP,o):n===t.States.READY&&s===t.States.SETUP?t.stateMachineCallbacks.ready(r,t.States.READY,o):"play"===i&&n===t.States.STARTUP?(t.playTimeStamp=new Date,t.stateMachineCallbacks.first_play(r,t.States.PLAY,o)):"play"===i&&s===t.States.PAUSE?(t.stateMachineCallbacks.play(r,t.States.PLAY,o),t.stateMachineCallbacks.playing(r,t.States.PLAYING,o),t.stateMachineCallbacks.heartbeat(r,t.States.PLAY,o)):"timechanged"===i&&s===t.States.STARTUP&&n===t.States.PLAYING?(t.stateMachineCallbacks.playing(r,t.States.PLAYING,o),t.stateMachineCallbacks.playback_started(o)):"timechanged"===i&&s===t.States.PAUSE&&n===t.States.PLAYING?t.stateMachineCallbacks.playing(r,t.States.PLAYING,o):n===t.States.PAUSE&&s===t.States.PLAYING?(t.stateMachineCallbacks.pause(r,t.States.PAUSE,o),t.stateMachineCallbacks.heartbeat(r,t.States.PAUSE,o)):n===t.States.END?(t.stateMachineCallbacks.end(r,t.States.END,o),t.stateMachineCallbacks.heartbeat(r,t.States.END,o)):i===et.START_BUFFERING?t.stateMachineCallbacks.start_rebuffer(r,t.States.REBUFFERING,o):"timechanged"===i&&s===t.States.REBUFFERING&&n===t.States.PLAYING&&t.stateMachineCallbacks.end_rebuffer(r,t.States.REBUFFERING,o),"none"===s&&e.starttime?t.onEnterStateTimestamp=e.starttime:t.onEnterStateTimestamp=r||(new Date).getTime(),o&&n!==t.States.PAUSED_SEEKING&&t.stateMachineCallbacks.setVideoTimeStartFromEvent(o)},onafterevent:function(e,i,s,n,r){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===et.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),s===t.States.QUALITYCHANGE&&t.stateMachine.FINISH_QUALITYCHANGE(n),s!==t.States.MUTING_READY&&s!==t.States.MUTING_PLAY&&s!==t.States.MUTING_PAUSE||t.stateMachine.FINISH_MUTING(n)},onleavestate:function(e,i,s,n,r){if(t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),a.includes(e)&&(e===et.PLAYBACK_FINISHED&&(t.customData.previousRecordTime=0),t.customData.previousRecordTime=r.currentTime),t.stateMachineCallbacks.resetSessionExpiry(),n){var o=n-t.onEnterStateTimestamp;r&&s!==t.States.PAUSED_SEEKING&&($.log("Setting video time end to "+r.currentTime+", going to "+s),t.stateMachineCallbacks.setVideoTimeEndFromEvent(r));var l=i.toLowerCase();if(i===t.States.PAUSED_SEEKING){var c=n-t.seekStartedAt;t.seekStartedAt=null,t.stateMachineCallbacks.playback_seeked(t.seekedFrom,1e3*r.currentTime,c,s),$.log("Seek was "+c+"ms")}else e===et.UNLOAD&&i===t.States.PLAYING?t.stateMachineCallbacks.playingAndBye(o,l,r):i===t.States.PAUSE&&s!==t.States.PAUSED_SEEKING&&s!==t.States.PLAYING&&(t.stateMachineCallbacks.setVideoTimeStartFromEvent(e),t.stateMachineCallbacks.pause(o,l,r),t.stateMachineCallbacks.heartbeat(n,l,r));e===et.VIDEO_CHANGE?t.stateMachineCallbacks.videoChange(r):e===et.AUDIO_CHANGE?t.stateMachineCallbacks.audioChange(r):e===et.MUTE?($.log("Setting sample to muted"),t.stateMachineCallbacks.mute(n,r)):e===et.UN_MUTE&&($.log("Setting sample to unmuted"),t.stateMachineCallbacks.unMute(n,r))}},onseek:function(e,a,i,s,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekStartedAt=t.seekStartedAt||s},onseeked:function(e,a,i,s,n){t.customData.previousRecordTime=n.currentTime,t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime),t.seekedTimestamp=s},ontimechanged:function(e,a,i,s,n){t.stateMachineCallbacks.playbackWatchTime(t.customData.playbackWatchTime);var r=s-t.onEnterStateTimestamp,o=n.currentTime-t.customData.previousRecordTime;o>0&&o<5&&(t.customData.playbackWatchTime+=Math.round(1e3*(n.currentTime-t.customData.previousRecordTime)),t.customData.previousRecordTime=n.currentTime),r>h&&(t.stateMachineCallbacks.setVideoTimeEndFromEvent(n),$.log("Sending heartbeat"),t.stateMachineCallbacks.heartbeat(r,a.toLowerCase(),n),t.onEnterStateTimestamp=s,t.stateMachineCallbacks.setVideoTimeStartFromEvent(n),t.stateMachineCallbacks.resetSessionExpiry())},onplayerError:function(e,a,i,s,n){t.stateMachineCallbacks.error(n)}}})}},{key:"callEvent",value:function(t,e,a){var i=this.stateMachine[t];i?i.call(this.stateMachine,a,e):$.log("Ignored Event: "+t)}},{key:"updateMetadata",value:function(t){this.stateMachineCallbacks.updateSample(t)}}],i=[{key:"pad",value:function(t,e){return(t+new Array(e).join(" ")).slice(0,e)}}],a&&he(e.prototype,a),i&&he(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function me(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Se=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,i=[{key:"getAnalyticsStateMachine",value:function(t,e){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return tt.isBitmovinVersionPre7(t)?new zt(e,a):tt.isBitmovinVersion7Plus(t)?new ie(e,a):tt.isVideoJs(t)?new le(e,a):(tt.isHlsjs(t)||tt.isDashjs(t)||tt.isShaka(t),new Ee(e,a))}}],(a=null)&&me(e.prototype,a),i&&me(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function de(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const pe=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,(a=[{key:"setUp",value:function(){$.log("setting up cast session"),this.castSession=cast.framework.CastContext.getInstance().getCurrentSession(),this.addMessageListener()}},{key:"addMessageListener",value:function(){var t=this,e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(c)<0?$.log("No analytics on chrome cast receiver enabled!"):($.log("adding message listener"),this.castSession.addMessageListener(c,(function(e,a){$.log("Received: "+e+" "+a);try{var i=JSON.parse(a);t.handleReceiverMessage(i)}catch(t){$.error("Message parsing failed "+a)}})))}},{key:"handleReceiverMessage",value:function(t){$.log(t)}},{key:"sendMessage",value:function(t){var e=this.castSession.getApplicationMetadata();!e||e.namespaces.indexOf(c)<0?$.log("No analytics on chrome cast receiver enabled!"):($.log("Sending message: "+JSON.stringify(t)),this.castSession.sendMessage(c,t))}}])&&de(e.prototype,a),i&&de(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function fe(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}const Ae=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,a,i;return e=t,(a=[{key:"setUp",value:function(){var t=this,e=cast.receiver.CastReceiverManager.getInstance();this.messageBus=e.getCastMessageBus(c,cast.receiver.CastMessageBus.MessageType.JSON),$.log(this.messageBus),this.messageBus.onMessage=function(e){$.log("Received message from cast client: "+JSON.stringify(e));var a=e.data;t.handleClientMessage(a)}}},{key:"setCallback",value:function(t){this.callback=t}},{key:"handleClientMessage",value:function(t){this.callback(t)}},{key:"sendMessage",value:function(t){this.messageBus.broadcast(t)}}])&&fe(e.prototype,a),i&&fe(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();const ye={SETUP:"event_setup",PLAYER_READY:"event_player_ready",PLAYBACK_READY:"event_playback_ready",PLAYBACK_STARTED:"event_playback_started",PAUSE:"event_pause",PLAY:"event_play",PLAYING:"event_playing",PLAYBACK_UPDATE:"event_playback_update",END:"event_ended",MUTE:"event_muted",UNMUTE:"event_unmute",SEEKED:"event_seeked",START_REBUFFER:"event_rebuffer_start",END_REBUFFER:"event_rebuffer_end",ERROR:"event_error"};var _e=a(503),ve=a.n(_e);function Ne(t,e){for(var a=0;a<e.length;a++){var i=e[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Te(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var De=function(){function t(e){var a=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Te(this,"register",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,e),a.analyticsStateMachine;e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=Se.getAnalyticsStateMachine(t,a.stateMachineCallbacks,e),a.adapter=Qt.getAdapter(t,a.record,a.analyticsStateMachine,e.mediaElement),a.adapter||$.error("Could not detect player.")})),Te(this,"registerVideoJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new le(a.stateMachineCallbacks,e),a.adapter=new ht(t,a.record,a.analyticsStateMachine)})),Te(this,"registerHLSJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,e),a.adapter=new Rt(t,a.record,a.analyticsStateMachine)})),Te(this,"registerShakaPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,e),a.adapter=new Mt(t,a.record,a.analyticsStateMachine,e.mediaElement)})),Te(this,"registerHTML5Player",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,e),a.adapter=new It(t,a.record,a.analyticsStateMachine)})),Te(this,"customEventHandler",(function(t,e){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValues(t,{custom_event_data:a.customEventData})})),Te(this,"customEventHandlerAsync",(function(t,e){return new Promise((function(i,s){a.customEventData=JSON.stringify(e),a.sendAnalyticsRequestAndClearValuesAsync(t,{custom_event_data:a.customEventData}).then((function(t){i(t)})).catch((function(t){s(t)}))}))})),Te(this,"registerDashJSPlayer",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.starttime||(e.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,e),a.adapter=new jt(t,a.record,a.analyticsStateMachine)})),Te(this,"registerReactNativeVideoPlayer",(function(t){return t.starttime||(t.starttime=r.getCurrentTimestamp()),a.analyticsStateMachine=new Ee(a.stateMachineCallbacks,t),a.analyticsStateMachine})),Te(this,"getCurrentImpressionId",(function(){return a.sample.impressionId})),Te(this,"record",(function(t,e){e=e||{},a.analyticsStateMachine.callEvent(t,e,r.getCurrentTimestamp())})),Te(this,"setDroppedFrames",(function(t){})),this.config=e,this.analyticsCall=new C,this.sessionCreationCall=new F,this.playerInitCall=new x,this.castClient=new pe,this.castReceiver=new Ae,this.droppedSampleFrames=0,this.licensing="granted",this.startupTime=0,this.pageLoadType=t.PAGE_LOAD_TYPE.FOREGROUND,this.autoplay=void 0,this.isCastClient=!1,this.isCastReceiver=!1,this.isAllowedToSendSamples=!1,this.samplesQueue=[],this.previousState=void 0,this.previousStateTimeStamp=new Date,this.firstPlayTimestamp=0,this.isMuted=!1,this.isFullScreen=void 0,this.videoWidthPixels=void 0,this.videoHeightPixels=void 0,this.upscalePercentage=void 0,this.downscalePercentage=void 0,this.videoBitrate=void 0,this.audioCodec=void 0,this.videoCodec=void 0,this.currentTime=0;try{this.orientation=screen.orientation.type.match(/\w+/)[0],screen.orientation.onchange=function(){this.orientation=screen.orientation.type.match(/\w+/)[0]}}catch(t){this.orientation="undetected"}this.setConfigParameters(),this.init(),this.setupSample(),this.setupStateMachineCallbacks()}var e,a,i;return e=t,a=[{key:"init",value:function(){if(this.isCastReceiver||""!=this.config.property_id&&r.validString(this.config.property_id)){$.setLogging(this.config.debug||!1),this.propertyId=this.config.property_id,"undefined"!=typeof window&&void 0!==window.parent?this.pageURL=window.location!=window.parent.location?document.referrer:document.location.href:this.config.page_url?this.pageURL=this.config.page_url:this.pageURL=null;var t=!1;this.config.test&&(t=!0);var e=null;this.config.sessionID&&(e=this.config.sessionID);var a=!0;this.config.hasOwnProperty("sendSessionRequest")&&(a=this.config.sendSessionRequest);var i=null;this.config.userID&&(i=this.config.userID),this.setUserId(t,i),this.setSessionId(t,e,a),this.setPlayerInstanceId(),this.setPlaybackId()}else console.error("Invalid analytics property_id provided")}},{key:"setConfigParameters",value:function(){arguments.length>0&&void 0!==arguments[0]||this.sample;var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.config;this.customData1=r.getCustomDataString(t.customData1),this.customData2=r.getCustomDataString(t.customData2),this.customData3=r.getCustomDataString(t.customData3),this.customData4=r.getCustomDataString(t.customData4),this.customData5=r.getCustomDataString(t.customData5),this.customData6=r.getCustomDataString(t.customData6),this.customData7=r.getCustomDataString(t.customData7),this.customData8=r.getCustomDataString(t.customData8),this.customData9=r.getCustomDataString(t.customData9),this.customData10=r.getCustomDataString(t.customData10),this.customPlayerIntegrationVersion=r.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=r.getCustomDataString(t.customPlayerName),this.customPageType=r.getCustomDataString(t.customPageType),this.customUserId=r.getCustomDataString(t.userId),this.userName=r.getCustomDataString(t.userName),this.userEMail=r.getCustomDataString(t.userEMail),this.userPhone=r.getCustomDataString(t.userPhone),this.userProfileImage=r.getCustomDataString(t.userProfileImage),this.userAddressLine1=r.getCustomDataString(t.userAddressLine1),this.userAddressLine2=r.getCustomDataString(t.userAddressLine2),this.userCity=r.getCustomDataString(t.userCity),this.userState=r.getCustomDataString(t.userState),this.userCountry=r.getCustomDataString(t.userCountry),this.userZipcode=r.getCustomDataString(t.userZipcode),this.customContentType=r.getCustomDataString(t.customContentType),this.customVideoDurationMillis=r.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=r.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=r.getCustomDataString(t.customVideoLanguage),this.customVideoId=r.getCustomDataString(t.customVideoId),this.customVideoSeries=r.getCustomDataString(t.customVideoSeries),this.customVideoProducer=r.getCustomDataString(t.customVideoProducer),this.customVideoTitle=r.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=r.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=r.getCustomDataString(t.customVideoVariant),this.SDKVersion="1.0.0",this.experimentName=t.experimentName}},{key:"updateCustomUserData",value:function(t){this.customUserId=r.getCustomDataString(t.userId),this.userName=r.getCustomDataString(t.userName),this.userEMail=r.getCustomDataString(t.userEMail),this.userPhone=r.getCustomDataString(t.userPhone),this.userProfileImage=r.getCustomDataString(t.userProfileImage),this.userAddressLine1=r.getCustomDataString(t.userAddressLine1),this.userAddressLine2=r.getCustomDataString(t.userAddressLine2),this.userCity=r.getCustomDataString(t.userCity),this.userState=r.getCustomDataString(t.userState),this.userCountry=r.getCustomDataString(t.userCountry),this.userZipcode=r.getCustomDataString(t.userZipcode)}},{key:"updateCustomVideoData",value:function(t){this.customContentType=r.getCustomDataString(t.customContentType),this.customVideoDurationMillis=r.getCustomDataString(t.customVideoDurationMillis),this.customEncodingVariant=r.getCustomDataString(t.customEncodingVariant),this.customVideoLanguage=r.getCustomDataString(t.customVideoLanguage),this.customVideoId=r.getCustomDataString(t.customVideoId),this.customVideoSeries=r.getCustomDataString(t.customVideoSeries),this.customVideoProducer=r.getCustomDataString(t.customVideoProducer),this.customVideoTitle=r.getCustomDataString(t.customVideoTitle),this.customVideoVariantName=r.getCustomDataString(t.customVideoVariantName),this.customVideoVariant=r.getCustomDataString(t.customVideoVariant)}},{key:"updateCustomData",value:function(t){this.customData1=r.getCustomDataString(t.customData1),this.customData2=r.getCustomDataString(t.customData2),this.customData3=r.getCustomDataString(t.customData3),this.customData4=r.getCustomDataString(t.customData4),this.customData5=r.getCustomDataString(t.customData5),this.customData6=r.getCustomDataString(t.customData6),this.customData7=r.getCustomDataString(t.customData7),this.customData8=r.getCustomDataString(t.customData8),this.customData9=r.getCustomDataString(t.customData9),this.customData10=r.getCustomDataString(t.customData10)}},{key:"updateCustomPlayerData",value:function(t){this.customPlayerIntegrationVersion=r.getCustomDataString(t.customPlayerIntegrationVersion),this.customPlayerName=r.getCustomDataString(t.customPlayerName),this.customPageType=r.getCustomDataString(t.customPageType)}},{key:"setSessionData",value:function(){this.sessionData={session_id:this.sessionId,property_id:this.propertyId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,user_name:this.userName,user_email:this.userEMail,user_phone:this.userPhone,user_profile_image:this.userProfileImage,user_address_line1:this.userAddressLine1,user_address_line2:this.userAddressLine2,user_city:this.userCity,user_state:this.userState,user_country:this.userCountry,user_zipcode:this.userZipcode,viewer_client_version:this.SDKVersion,meta_browser:this.meta_browser,meta_device_manufacturer:this.meta_device_manufacturer,meta_operating_system_version:this.meta_operating_system_version,meta_operating_system:this.meta_operating_system,meta_device_name:this.meta_device_name,meta_browser_version:this.meta_browser_version,meta_device_category:this.meta_device_category,meta_device_architecture:this.meta_device_architecture,meta_device_display_width:this.meta_device_display_width,meta_device_display_height:this.meta_device_display_height,meta_device_is_touchscreen:this.meta_device_is_touchscreen,meta_device_display_dpr:this.meta_device_display_dpr,meta_browser_language:this.meta_browser_language},this.config.deviceData?(this.sessionData.meta_device_name=this.config.deviceData.meta_device_name,this.sessionData.meta_device_manufacturer=this.config.deviceData.meta_device_manufacturer,this.sessionData.meta_operating_system_version=this.config.deviceData.meta_operating_system_version,this.sessionData.meta_operating_system=this.config.deviceData.meta_operating_system,this.sessionData.meta_browser=this.config.deviceData.meta_browser,this.sessionData.meta_device_display_dpr=this.config.deviceData.meta_device_display_dpr,this.sessionData.meta_browser_version=this.config.deviceData.meta_browser_version,this.sessionData.meta_device_category=this.config.deviceData.meta_device_category,this.sessionData.meta_device_architecture=this.config.deviceData.meta_device_architecture,this.sessionData.meta_device_display_width=this.config.deviceData.meta_device_display_width,this.sessionData.meta_device_display_height=this.config.deviceData.meta_device_display_height,this.sessionData.meta_device_is_touchscreen=this.config.deviceData.meta_device_is_touchscreen,this.sessionData.meta_browser_language=this.config.deviceData.meta_browser_language):(this.sessionData.meta_device_name=ve().product,this.sessionData.meta_device_manufacturer=ve().manufacturer,this.sessionData.meta_operating_system_version=ve().os.version,this.sessionData.meta_operating_system=ve().os.family,this.sessionData.meta_browser=ve().name,this.sessionData.meta_browser_version=ve().version,this.sessionData.meta_device_category=Q(),this.sessionData.meta_device_architecture=ve().os.architecture,this.sessionData.meta_device_display_dpr=window.devicePixelRatio,this.sessionData.meta_device_display_width=window.screen.width,this.sessionData.meta_device_display_height=window.screen.height,this.sessionData.meta_device_display_dpr=parseInt(window.devicePixelRatio),this.sessionData.meta_browser_language=navigator?navigator.language||navigator.userLanguage:"","ontouchstart"in document.documentElement&&(this.sessionData.meta_device_is_touchscreen="true"))}},{key:"setPlayerData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.playerData={player_instance_id:this.playerInstanceId,property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,custom_user_id:this.customUserId,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,player_integration_version:this.customPlayerIntegrationVersion,meta_page_type:this.customPageType,meta_page_url:this.pageURL},this.config.deviceData&&(this.playerData.player_preload=this.config.playerData.player_preload,this.playerData.player_autoplay=this.config.playerData.player_autoplay,this.playerData.player_software_version=this.config.playerData.player_software_version,this.playerData.player_integration_version=this.config.playerData.player_integration_version,this.playerData.player_name=this.config.playerData.player_name,this.playerData.player_language_code=this.config.playerData.player_language_code,this.playerData.player_software=this.config.playerData.player_software,this.playerData.meta_page_url=this.config.playerData.meta_page_url,this.playerData.meta_page_type=this.config.playerData.meta_page_type,this.playerData.player_height_pixels=this.config.playerData.player_height_pixels,this.playerData.player_width_pixels=this.config.playerData.player_width_pixels),t&&r.validNumber(t.videoWindowHeight)&&(this.playerData.player_height_pixels=t.videoWindowHeight),t&&r.validNumber(t.videoWindowWidth)&&(this.playerData.player_width_pixels=t.videoWindowWidth),t&&r.validBoolean(t.autoplay)&&(this.playerData.player_autoplay=t.autoplay),t&&r.validBoolean(t.preload)&&(this.playerData.player_preload=t.preload),t&&r.validString(t.version)&&(this.playerData.player_software_version=t.version),t&&r.validString(t.audioLanguage)&&(this.playerData.player_language_code=t.audioLanguage),t&&r.validString(t.playerSoftware)&&(this.playerData.player_software=t.playerSoftware)}},{key:"setUserId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)this.userId=e;else if(t)this.userId=r.uuidv4();else{var a=r.getCookie("gumlet_user_id");this.userId=a&&""!==a?a:r.setCookie("gumlet_user_id",43200)}}},{key:"setPlayerInstanceId",value:function(){this.config.getUUID?this.playerInstanceId=this.config.getUUID():this.playerInstanceId=r.uuidv4(),this.setPlayerData()}},{key:"setPlaybackId",value:function(){this.config.getUUID?this.playbackId=this.config.getUUID():this.playbackId=r.uuidv4()}},{key:"setSessionId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e)return this.sessionId=e,this.setSessionData(),void(a&&this.sessionCreationCall.sendRequest(this.sessionData,r.noOp));if(t)this.sessionId=r.uuidv4();else{var i=r.getCookie("gumlet_session_id");i&&""!==i?(this.sessionId=i,this.setSessionData()):(this.sessionId=r.setCookie("gumlet_session_id",30),this.setSessionData(),this.sessionCreationCall.sendRequest(this.sessionData,r.noOp))}}},{key:"sendAnalyticsSetupCall",value:function(){this.sendAnalyticsRequestAndClearValues(ye.SETUP,{millis_from_previous_event:0}),this.setState(ye.SETUP)}},{key:"getMillisFromPreviousState",value:function(){return(new Date).getTime()-this.previousStateTimeStamp.getTime()}},{key:"getPlaybackWatchTime",value:function(){return this.playbackWatchTime}},{key:"setPlaybackWatchTime",value:function(t){this.playbackWatchTime=t}},{key:"setVideoData",value:function(t){t&&r.validNumber(t.duration)&&(this.videoDuration=r.calculateTime(t.duration)),t&&r.validString(t.streamType)&&(this.videoSourceType=t.streamType,"dash"===t.streamType&&r.validString(t.mpdUrl)?(this.videoSourceUrl=t.mpdUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&r.validString(t.m3u8Url)?(this.videoSourceUrl=t.m3u8Url,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"hls"===t.streamType&&r.validString(t.streamUrl)?(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):"progressive"===t.streamType&&r.validString(t.progUrl)?(this.videoSourceUrl=t.progUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname):t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl,this.videoSourceHostname=new URL(this.videoSourceUrl).hostname)),t&&t.streamUrl&&(this.videoSourceUrl=t.streamUrl),t&&t.sourceHostName&&(this.videoSourceHostname=t.sourceHostName),t&&t.hasOwnProperty("muted")&&(this.isMuted=t.muted),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.height)&&t.currentVideoData.height>0&&(this.videoHeightPixels=t.currentVideoData.height),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.width)&&t.currentVideoData.width>0&&(this.videoWidthPixels=t.currentVideoData.width),t&&t.currentVideoData&&r.validNumber(t.currentVideoData.bitrate)&&t.currentVideoData.bitrate>-1&&(this.videoBitrate=t.currentVideoData.bitrate/1e6),t&&t.currentVideoData&&r.validString(t.currentVideoData.audioCodec)&&t.currentVideoData.audioCodec.length>0&&(this.audioCodec=t.currentVideoData.audioCodec),t&&t.currentVideoData&&r.validString(t.currentVideoData.videoCodec)&&t.currentVideoData.videoCodec.length>0&&(this.videoCodec=t.currentVideoData.videoCodec);var e=0;if(!(this.videoHeightPixels&&this.playerData.player_height_pixels&&this.sessionData.meta_device_display_dpr))return this.upscalePercentage=void 0,void(this.downscalePercentage=void 0);(e=this.playerData.player_height_pixels*this.sessionData.meta_device_display_dpr/this.videoHeightPixels-1)>0?(this.upscalePercentage=100*e,this.downscalePercentage=0):e<0?(this.upscalePercentage=0,this.downscalePercentage=100*e*-1):(this.upscalePercentage=0,this.downscalePercentage=0);var a=new URL(this.videoSourceUrl);"video.gumlet.io"!==a.hostname||this.customVideoId||(this.customVideoId=a.pathname.split("/")[2])}},{key:"setupStateMachineCallbacks",value:function(){var e=this;this.stateMachineCallbacks={setup:function(t,a,i){$.log("Setup Gumlet analytics "+e.analyticsVersion),e.setDuration(t),e.setVideoData(i),e.sendAnalyticsRequestAndClearValues(ye.SETUP,{millis_from_previous_event:0}),e.setState(ye.SETUP)},ready:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PLAYER_READY),e.setState(ye.PLAYER_READY),e.setPlayerData(i),e.playerInitCall.sendRequest(e.playerData,r.noOp)},loaded:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var n={};null!==s&&(n={millis_from_previous_event:s,previous_event:ye.PLAYER_READY}),e.sendAnalyticsRequestAndClearValues(ye.PLAYBACK_READY,n),null===s&&e.setState(ye.PLAYBACK_READY)},startup:function(t,a){e.setDuration(t)},first_play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PLAY),e.setState(ye.PLAY),e.firstPlayTimestamp=new Date},play:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PLAY),e.setState(ye.PLAY)},updateSample:function(t){e.setPlaybackSettingsFromLoadedEvent(t)},playing:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PLAYING),e.setState(ye.PLAYING)},playback_started:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i);var s=(new Date).getTime()-e.firstPlayTimestamp.getTime();e.sendAnalyticsRequestAndClearValues(ye.PLAYBACK_STARTED,{millis_from_previous_event:s}),e.setState(ye.PLAYBACK_STARTED)},playingAndBye:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i),e.sendUnloadRequest()},heartbeat:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PLAYBACK_UPDATE),e.setState(ye.PLAYBACK_UPDATE)},playbackWatchTime:function(t){e.setPlaybackWatchTime(t)},qualitychange:function(t,a){e.setDuration(t)},qualitychange_pause:function(t,a){e.setDuration(t)},qualitychange_rebuffering:function(t,a){e.setDuration(t)},videoChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.setPlaybackSettingsFromLoadedEvent(t)},audioChange:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t)},pause:function(t,a,i){e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),e.sendAnalyticsRequestAndClearValues(ye.PAUSE),e.setState(ye.PAUSE)},start_rebuffer:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),s||e.sendAnalyticsRequestAndClearValues(ye.START_REBUFFER),e.setState(ye.START_REBUFFER)},end_rebuffer:function(t,a,i){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.setDuration(t),e.setVideoData(i),e.setPlaybackSettingsFromLoadedEvent(i),s)return e.getSample(ye.END_REBUFFER);e.sendAnalyticsRequestAndClearValues(ye.END_REBUFFER),e.setState(ye.END_REBUFFER)},playback_seeked:function(t,a,i,s){e.sendAnalyticsRequestAndClearValues(ye.SEEKED,{from:t,to:a}),e.setState(ye.SEEKED),e.setupSample(),"PAUSE"===s?(e.sendAnalyticsRequestAndClearValues(ye.PAUSE,{millis_from_previous_event:i}),e.setState(ye.PAUSE)):"PLAYING"===s&&(e.sendAnalyticsRequestAndClearValues(ye.PLAYING,{millis_from_previous_event:i}),e.setState(ye.PLAYING))},paused_seeking:function(t,a,i){e.setDuration(t)},play_seeking:r.noOp,end_play_seeking:function(t,a,i){e.setDuration(t)},rebuffering:function(t,a,i){e.setDuration(t)},error:function(t){e.stateMachineCallbacks.setVideoTimeEndFromEvent(t),e.stateMachineCallbacks.setVideoTimeStartFromEvent(t),e.sendAnalyticsRequestAndClearValues(ye.ERROR,{error_code:t.code,error:t.message}),e.setState(ye.ERROR),e.setupSample()},end:function(t,a,i){e.setPlaybackId(),e.setDuration(t),e.sendAnalyticsRequestAndClearValues(ye.END),e.setState(ye.END)},ad:function(t,a,i){e.setDuration(t),e.setDroppedFrames(i)},mute:function(t,a){e.isMuted=!0,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(ye.MUTE)},unMute:function(t,a){e.isMuted=!1,e.setPlaybackSettingsFromLoadedEvent(a),e.sendAnalyticsRequestAndClearValues(ye.UNMUTE)},muting_ready:r.noOp,muting_play:r.noOp,muting_pause:r.noOp,setVideoTimeEndFromEvent:function(t){},setVideoTimeStartFromEvent:function(t){},startCasting:function(a,i){if(i&&i.resuming)return e.isAllowedToSendSamples=!1,void $.warning("Player started casting but a session is already casting!");e.isCastClient=!0,e.isAllowedToSendSamples=!1;var s=e.sample,n=s.domain,r=s.path,o=s.language,l=s.userAgent,c=s.userId,u=s.impressionId,h={type:t.CAST_RECEIVER_CONFIG_MESSAGE,data:{config:e.config,userId:c,domain:n,path:r,language:o,userAgent:l,impressionId:u}};e.castClient.setUp(),e.castClient.sendMessage(h)},casting:function(){e.isCastClient=!1,e.samplesQueue=[],e.isAllowedToSendSamples=!0},source_changing:function(){},resetSessionExpiry:function(){e.config.test||e.config.sessionID||(r.setCookie("gumlet_session_id",30,e.sessionId),r.setCookie("gumlet_user_id",43200,e.userId))}}}},{key:"setDuration",value:function(t){}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;t&&(this.previousState=t,this.previousStateTimeStamp=new Date)}},{key:"setPlaybackSettingsFromLoadedEvent",value:function(t){t&&r.validNumber(t.currentTime)&&(this.currentTime=r.calculateTime(t.currentTime)),t&&r.validBoolean(t.isFullScreen)&&(this.isFullScreen=t.isFullScreen),t&&r.validBoolean(t.isCasting)&&(this.isCasting=t.isCasting)}},{key:"setupSample",value:function(){this.sample={property_id:this.propertyId,session_id:this.sessionId,user_id:this.userId,player_instance_id:this.playerInstanceId,playback_id:this.playbackId,from:void 0,to:void 0,playback_time_instant_millis:void 0,bitrate_mbps:this.videoBitrate,error_code:void 0,error:void 0,error_text:void 0,video_cover:void 0,video_cover_reference:void 0,player_remote_played:void 0,video_total_duration_millis:this.videoDuration,video_width_pixels:void 0,video_height_pixels:void 0,video_source_url:void 0,video_source_hostname:void 0,video_source_type:void 0,custom_content_type:this.customContentType,custom_video_duration_millis:this.customVideoDurationMillis,custom_encoding_variant:this.customEncodingVariant,custom_video_language:this.customVideoLanguage,custom_video_id:this.customVideoId,custom_video_series:this.customVideoSeries,custom_video_producer:this.customVideoProducer,custom_video_title:this.customVideoTitle,custom_video_variant_name:this.customVideoVariantName,custom_video_variant:this.customVideoVariant,muted:this.isMuted,casting:void 0,fullscreen:this.isFullScreen,video_downscale_percentage:void 0,video_upscale_percentage:void 0,orientation:void 0,orientation_from:void 0,quality:void 0,quality_from:void 0,previous_event:void 0,millis_from_previous_event:void 0,video_codec:void 0,audio_codec:void 0,custom_data_1:this.customData1,custom_data_2:this.customData2,custom_data_3:this.customData3,custom_data_4:this.customData4,custom_data_5:this.customData5,custom_data_6:this.customData6,custom_data_7:this.customData7,custom_data_8:this.customData8,custom_data_9:this.customData9,custom_data_10:this.customData10,custom_event_data:void 0,playback_watch_time:void 0}}},{key:"getSample",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=this.sample;if(a.event=t,this.config.getUUID?a.event_id=this.config.getUUID():a.event_id=r.uuidv4(),a.custom_data_1=this.customData1,a.custom_data_2=this.customData2,a.custom_data_3=this.customData3,a.custom_data_4=this.customData4,a.custom_data_5=this.customData5,a.custom_data_6=this.customData6,a.custom_data_7=this.customData7,a.custom_data_8=this.customData8,a.custom_data_9=this.customData9,a.custom_data_10=this.customData1,a.custom_content_type=this.customContentType,a.custom_video_duration_millis=this.customVideoDurationMillis,a.custom_encoding_variant=this.customEncodingVariant,a.custom_video_language=this.customVideoLanguage,a.custom_video_id=this.customVideoId,a.custom_video_series=this.customVideoSeries,a.custom_video_producer=this.customVideoProducer,a.custom_video_title=this.customVideoTitle,a.custom_video_variant_name=this.customVideoVariantName,a.custom_video_variant=this.customVideoVariant,a.millis_from_previous_event=this.getMillisFromPreviousState(),a.previous_event=this.previousState,a.fullscreen=this.isFullScreen,a.muted=this.isMuted,a.video_width_pixels=this.videoWidthPixels,a.video_height_pixels=this.videoHeightPixels,a.video_total_duration_millis=this.videoDuration,a.bitrate=this.videoBitrate,a.audio_codec=this.audioCodec,a.video_codec=this.videoCodec,a.orientation=this.orientation,a.playback_time_instant_millis=this.currentTime,a.video_source_type=this.videoSourceType,a.video_source_url=this.videoSourceUrl,a.video_upscale_percentage=this.upscalePercentage,a.video_downscale_percentage=this.downscalePercentage,a.video_source_hostname=this.videoSourceHostname,a.custom_event_data=void 0,a.playback_watch_time=this.playbackWatchTime,Object.keys(e).forEach((function(t){a[t]=e[t]})),"undefined"!=typeof window&&void 0!==window.parent&&window.navigator)try{"function"==typeof window.navigator.getBattery&&window.navigator.getBattery().then((function(t){t&&(a.battery_level_percentage=100*t.level,a.battery_charging=t.charging)}))}catch(t){}return a}},{key:"sendAnalyticsRequest",value:function(t,e){var a=this.getSample(t,e);this.analyticsCall.sendRequest(a,r.noOp)}},{key:"sendAnalyticsRequestAsync",value:function(t,e){var a=this;return new Promise((function(i,s){var n=a.getSample(t,e);a.analyticsCall.sendRequestAsync(n).then((function(t){i(t)})).catch((function(t){s(t)}))}))}},{key:"sendAnalyticsRequestAndClearValues",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return $.log("event null passed not hitting the injestion API"),False;this.sendAnalyticsRequest(t,e)}},{key:"sendAnalyticsRequestAndClearValuesAsync",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(i,s){e||($.log("event null passed not hitting the injestion API"),s("event null passed not hitting the injestion API")),t.sendAnalyticsRequestAsync(e,a).then((function(t){i(t)})).catch((function(t){s(t)}))}))}},{key:"sendUnloadRequest",value:function(){var t=this;"denied"!==this.licensing&&(void 0===navigator.sendBeacon?this.sendAnalyticsRequestSynchronous():fetch(this.analyticsCall.getAnalyticsServerUrl(),{method:"POST",body:JSON.stringify(this.sample),headers:{"Content-Type":"application/json"}}).then((function(e){e.ok||t.sendAnalyticsRequestSynchronous()})).catch((function(e){t.sendAnalyticsRequestSynchronous()})))}},{key:"sendAnalyticsRequestSynchronous",value:function(){"denied"!==this.licensing&&this.analyticsCall.sendRequestSynchronous(this.sample,r.noOp)}},{key:"clearValues",value:function(){this.sample.ad=0,this.sample.paused=0,this.sample.played=0,this.sample.seeked=0,this.sample.buffered=0,this.sample.playerStartupTime=0,this.sample.videoStartupTime=0,this.sample.startupTime=0,this.sample.duration=0,this.sample.droppedFrames=0,this.sample.pageLoadType=0}},{key:"getDroppedFrames",value:function(t){if(null!=t&&0!=t){var e=t-this.droppedSampleFrames;return this.droppedSampleFrames=t,e}return 0}}],a&&Ne(e.prototype,a),i&&Ne(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();Te(De,"PAGE_LOAD_TYPE",{FOREGROUND:1,BACKGROUND:2}),Te(De,"LICENSE_CALL_PENDING_TIMEOUT",200),Te(De,"PAGE_LOAD_TYPE_TIMEOUT",200),Te(De,"CAST_RECEIVER_CONFIG_MESSAGE","CAST_RECEIVER_CONFIG_MESSAGE");const ge=De;const Ie={CLOUDFLARE:"cloudflare",AKAMAI:"akamai",FASTLY:"fastly",MAXCDN:"maxcdn",CLOUDFRONT:"cloudfront",CHINACACHE:"chinacache",BITGRAVITY:"bitgravity"};var be,Ce=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.register(t,e)},Pe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerVideoJSPlayer(t,e)},Ue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerDashJSPlayer(t,e)},Ge=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerHLSJSPlayer(t,e)},Re=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerShakaPlayer(t,e)},Le=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerHTML5Player(t,e)},ke=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be.registerReactNativeVideoPlayer(t,e)},Ye=function(){return be.getCurrentImpressionId()},Oe=function(){return be.analyticsStateMachine},Fe=function(t){return be.updateCustomData(t)},Me=function(t){return be.updateCustomVideoData(t)},we=function(t){return be.updateCustomUserData(t)},He=function(t){return be.updateCustomPlayerData(t)},Ke=function(t,e){return be.customEventHandler(t,e)},Ve=function(t,e){return new Promise((function(a,i){be.customEventHandlerAsync(t,e).then((function(t){a(t)})).catch((function(t){i(t)}))}))},Be=function(t){return be=new ge(t),{register:Ce,registerVideoJSPlayer:Pe,registerDashJSPlayer:Ue,registerHLSJSPlayer:Ge,registerShakaPlayer:Re,registerHTML5Player:Le,registerReactNativeVideoPlayer:ke,getCurrentImpressionId:Ye,stateMachine:Oe,updateCustomData:Fe,updateCustomVideoData:Me,updateCustomUserData:we,updateCustomPlayerData:He,setCustomData:be.setCustomData,setCustomDataOnce:be.setCustomDataOnce,customEventHandler:Ke,customEventHandlerAsync:Ve}};Be.Players=Dt,Be.CdnProviders=Ie,Be.gumletInsightsEvents=et,Be.gumletSupportedPlayers=Dt,"undefined"!=typeof window&&(window.gumlet=window.gumlet||{},window.gumlet.insights=Be,window.gumletInsightsEvents=et,window.gumletSupportedPlayers=Dt);const We={insights:Be,gumletInsightsEvents,gumletSupportedPlayers}})(),i})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@gumlet/insights-js-core","version":"1.1.
|
|
1
|
+
{"name":"@gumlet/insights-js-core","version":"1.1.40","description":"Gumlet Insights allows you to collect data from Video playback.","license":"MIT","repository":{"type":"git","url":"https://gitlab.com/gumlet/insights-js-core.git"},"main":"gumlet-insights.min.js","readme":"Please visit: https://docs.gumlet.com/docs/insights-getting-started","author":"Gumlet Pte. Ltd.","homepage":"https://docs.gumlet.com/docs/insights-getting-started","bugs":{"url":"https://www.gumlet.com/contact/"},"maintainers":[{"name":"Gumlet Team","email":"support@gumlet.com"}]}
|