1var appInitTime=(new Date).getTime(),omniInitTime=appInitTime,UA=navigator.userAgent.toLowerCase(),INIT=!0,COMSCORE_PREFIX=null,appLoc=location.toString(),packageLoaderBasePath=window.IMG_CDN_AND_BUILD+"/s=4.0.1385/js/",supportsPassive=!1;try{let e=Object.defineProperty({},"passive",{get:function(){supportsPassive=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(e){}var APP_VERSION="4.0.1385";APP_VERSION.indexOf("@build_number")>-1&&(APP_VERSION="0.0.1");var APP_DID="@DID@";function generateUniqueID(){let e,t=new Array(32);for(e=0;e<32;e++)t[t.length]=Math.floor(15*Math.random()).toString(15)+(8==e||12==e||16==e||20==e?"-":"");return t.join("")}function loadCssDynamically(e,t,i){if($(`link#${t}`)[0])return;const s=function(){let a=document.createElement("link");a.rel="stylesheet",a.href=e,a.id=t,a.type="text/css",i&&Object.keys(i).forEach((e=>{i[e]?a[e]=i[e]:delete a[e]})),document.getElementsByTagName("head")[0].appendChild(a);try{window.addEventListener?window.removeListener(s):window.detachEvent(s)}catch(e){}};try{let e=requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame;e?e(s):window.addEventListener("load",s)}catch(e){window.addEventListener?window.addEventListener("load",s):window.attachEvent("onload",s)}}function encodeToHex(e){let t,i="",s=e.length,a=0;for(;a<s;){for(t=e.charCodeAt(a++).toString(16);t.length<3;)t="0"+t;i+=t}return i}function decodeFromHex(e){let t="",i=e.length,s=e.length-3;for(;i>0;)s=i-3>=0?i-3:0,t=String.fromCharCode("0x"+e.substring(s,i))+t,i=s;return t}function formatSecondsAsTime(e,t){let i,s=Math.floor(e/3600),a=Math.floor((e-3600*s)/60),n=Math.floor(e-3600*s-60*a);if(s<10&&(s="0"+s),a<10&&(a="0"+a),n<10&&(n="0"+n),"string"==typeof t){if("podcast"==t){let e=["PT"];return s>0&&e.push(`${s}H`),a&&e.push(`${a}M`),n&&e.push(`${n}S`),formatPTtime(e.join(""))}i=t.replace("hh:","00"!=s?`${s}:`:"").replace("hh",1*s).replace("h","00"!=s?1*s+":":"").replace("mm",a).replace("m",1*a+"").replace("ss",n).replace("s",1*n+"")}else{let e=[a,n];Number(s)&&e.unshift(s),i=e.join(":")}return"0"==i.charAt(0)&&(i=i.replace("0","")),i}function shuffleArray(e,t,i){const s=e.length;if(s<=1)return e;let a,n,o=e.concat?e:new Array(e.length),r=0,l=s-1;for(r=0;r<s;r++)a=parseInt(Math.random()*l+1,10),n=o[r]&&void 0!==o[r]?o[r]:e[r],o[r]=o[a]&&void 0!==o[a]?o[a]:e[a],o[a]=n;return o}function formatPTtime(e,t,i){let s,a=[],n=0;return s=e.match(/P([\d\.]+D)?T([\d\.]+H)?([\d\.]+M)?([\d\.]+S)?/),s.forEac
1h(((e,i)=>{const o=parseFloat(e);if(o&&i>0)switch(i){case 1:a.push(`${parseInt(o)}days`),n+=24*o*3600;break;case 2:a.push(`${parseInt(o)}hr`),n+=3600*o;break;case 3:a.push(`${parseInt(o)}min`),n+=60*o;break;case 4:if(n+=parseInt(o),t||0==a.length)a.push(`${Math.round(o)}sec`);else if(s[3]&&o>=30){let e=parseInt(a.pop());a.push(++e+"min")}}})),i?formatSecondsAsTime(n,i):a.join(" ")}(APP_DID.indexOf("@DID")>-1||APP_DID.indexOf("BUILD_DID")>-1)&&(APP_DID="LXL00x"),"undefined"==typeof PARTNER&&(PARTNER="@PARTNER@"),window.findCurrentViewInHistory=function(){const e=history?.state?.guid||-1;let t=0,i=APP.history.length;for(t=0;t<i;t++)if(APP.history[t]?.__guid==e)return[APP.history[t],t];return[null,-1]},window.encodeParamsForSlackerService=function(e){return com.slacker.util.encoding.B64.encode64($.param(e).trim()).trim().replace(/\|/gi,".")},window.makeSeoName=function(e){return e?e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9\-_]/g,"").toLowerCase():""},window.ajaxHistoryHandler=function(e){const t=e.state;let i,s,a=function(e){let t;if(t="/"+e.seoName,"/"===t)APP.goHome();else{if(e){if(e.bIsHistory=!0,e.params)return e.params.bIsHistory=!0,void APP.goToPage(e.viewType,e.params);if(e.seoName)return void APP.goToPageBySeoData(e.seoName,e)}e.hash?location.href="/"+e.hash:location.href="/"}};if(APP.MESSAGING.modal().beaconId)t?.guid&&(APP.MESSAGING.loading()||("slacker-external-service-prompt"==APP.MESSAGING.modal().msg&&(APP.USER.externalWindowSrc=null),APP.MESSAGING.setModal()));else if(APP.MESSAGING.isUnwindingExternalServiceHistory);else if(t?.modal)"slacker-external-service"==t.modal&&(APP.USER.externalWindowSrc=t.externalWindowSrc),APP.MESSAGING.prompt(t.modal,t.replace,t.actions,t.bindingData);else if(t&&APP.history.length>0){const n=findCurrentViewInHistory();if(i=n[0],s=n[1],i)i.active()||(setTimeout((e=>
1{i.setActive.bind(i)(!0),i=null}),100),APP.history.splice(0,s).forEach((e=>e.dispose())));else if(window.history.isActiveHistoryAction=!0,APP.history.splice(0,APP.history.length-1).forEach((e=>e.dispose())),t&&"/"!=t.seoName&&"./"!=t.seoName){let i=[];for(s in e)i.push(s),i.push(e[s]);CONSOLE.warn("No matching view found in history for pushed state: ",i),0!=APP.history.length||"/"!=t.seoName&&"./"!=t.seoName?a(t):APP.goHome()}else APP.goHome()}else window.history.isActiveHistoryAction=!0,a(t);state=s=null},window.addEventListener("popstate",window.ajaxHistoryHandler);var dateFormat=function(){const e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,i=/[^-+\dA-Z]/g,s=function(e,t){for(e=String(e),t=t||2;e.length<t;)e="0"+e;return e};return function(a,n,o){let r=dateFormat,l=a;1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||/\d/.test(a)||(n=a,a=void 0),a=a?new Date(a):new Date,isNaN(a)&&(a=new Date(l.constructor().replace(" +0000 "," "))),"UTC:"==(n=String(r.masks[n]||n||r.masks.default)).slice(0,4)&&(n=n.slice(4),o=!0);const c=o?"getUTC":"get",d=a[c+"Date"](),u=a[c+"Day"](),h=a[c+"Month"](),p=a[c+"FullYear"](),m=a[c+"Hours"](),g=a[c+"Minutes"](),P=a[c+"Seconds"](),y=a[c+"Milliseconds"](),f=o?0:a.getTimezoneOffset(),A={d,dd:s(d),ddd:r.i18n.dayNames[u],dddd:r.i18n.dayNames[u+7],m:h+1,mm:s(h+1),mmm:r.i18n.monthNames[h],mmmm:r.i18n.monthNames[h+12],yy:String(p).slice(2),yyyy:p,h:m%12||12,hh:s(m%12||12),H:m,HH:s(m),M:g,MM:s(g),s:P,ss:s(P),l:s(y,3),L:s(y>99?Math.round(y/10):y),t:m<12?"a":"p",tt:m<12?"am":"pm",T:m<12?"A":"P",TT:m<12?"AM":"PM",Z:o?"UTC":(String(a).match(t)||[""]).pop().replace(i,""),o:(f>0?"-":"+")+s(100*Math.floor(Math.abs(f)/60)+Math.abs(f)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return n.replace(e,(function(e){return e in A?A[e]:e.slice(1,e.length-1)}))}}();function Swipe(e,t){var i=this;this.elem=e,this.callback=t,this.listener=function(e){i.touchHandler(e)},this.elem&&(this.elem.addEventListener("touchstart",this.listener,!supportsPassive||{passive:!0}),this.elem.addEventListener("touchmove",this.listener,!supportsPassive||{passive:!0}),this.elem.addEventListener("touchend",this.listener,!supportsPassive||{passive:!0}))}dateFormat.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},String.prototype.capitalizeFirst=function(){return this.replace(/^\w/,(function(e){return e.toUpperCase()}))},Date.prototype.format=function(e,t){return dateFormat(this,e,t)},Swipe.prototype.touches={touchstart:{x:-1,y:-1},touchmove:{x:-1,y:-1},touchend:!1,direction:"undetermined"},Swipe.prototype.dispose=function(){this.elem.removeEventListener("touchstart",this.listener,!supportsPassive||{passive:!0}),this.elem.removeEventListener("touchmove",this.listener,!supportsPassive||{passive:!0}),this.elem.removeEventListener("touchend",this.listener,!supportsPassive||{passive:!0})},Swipe.prototype.touchHandler=function(e){var t;if(void 0!==e&&void 0!==e.touches)switch(t=e.touches[0],e.type){case"touchstart":case"touchmove":if(this.touches[e.type].x=t.pageX,this.touches[e.type].y=t.pageY,"touchmove"==e.type)(i=this.touches.touchstart.x-this.touches.touchmove.x)<0&&(i/=-1),(s=this.touches.touchstart.y-this.touches.touchmove.y)<0&&(s/=-1),this.touches.direction=i>s?this.touches.touchstart.x<this.touches.touchmove.x?"right":"left":this.touches.touchstart.y<this.touches.touchmove.y?"down":"up",this.callback(e,this.touches.direction);break;case"touchend":var i,s;this.touches[e.type]=!0,(i=this.touches.touchstart.x-this.touches.touchmove.x)<0&&(i/=-1),(s=this.touches.touchstart.y-this.touches.touchmove.y)<0&&(s/=-1),this.touches.direction=i>s?this.touches.touchstart.x<this.touches.touchmove.x?"right":"left":this.touches.touchstart.y<this.touches.touchmove.y?"down":"up",this.callback(e,this.touches.direction)}},"function"!=typeof[].includes&&(Array.prototype.includes=function(e,t){for(t||(t=0);t<this.length;t++)if(this[t]===e)return!0;return!1}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),s=1;s<arguments.length;s++){var a=arguments[s];if(null!=a)for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(i[n]=a[n])}return i},writable:!0,configurable:!0}),window.com={},packageLoaderModules={},readyPackageLoaderModules={},waitingLibraries={},packageLoaderVersion="4.0.1385",wait=function(e,t){waitingLibraries[e]=Delegate.create(window,t)},now=function(e){waitingLibraries[e](),waitingLibraries[e]=null},window.getPackageName=function(e){return void 0===e.__inheritance?"":e.__inheritance.length>=1?e.__inheritance[0].path:""}
1,window.getLocalClassName=function(e){return void 0===e.__inheritance?"":e.__inheritance.length>=1?e.__inheritance[0].name:""},window.getClassReference=function(e){return void 0===e.__inheritance?null:e.__inheritance.length>=1?e.__inheritance[0].reference:null},window.is=function(e){return{a:function(t){if("function"==typeof t){if(void 0===e.__inheritance)return!1;for(var i=!1,s=0;s<e.__inheritance.length;s++){if(e.__inheritance[s].reference==t){i=!0;break}}return i}for(i=!1,s=0;s<e.__inheritance.length;s++){if(e.__inheritance[s].path==t){i=!0;break}}return i}}},String.prototype.contains=function(e,t){var i=t?this.toString().toLowerCase():this.toString();return t&&(e=e.toLowerCase()),-1!==i.indexOf(e)},String.prototype.equals=function(e,t){var i=t?this.toString().toLowerCase():this.toString();return t&&(e=e.toLowerCase()),i===e},Array.prototype.swap=function(e,t){var i=this[e];this[e]=this[t],this[t]=i},getPackageVersion=function(e){var t,i=e.version||e;return t=i?i.replace(/\$(\w+)\: ([^\s]+) (\$)?/,"$2"):0,Number(t)},extendClass=function(e,t){if(void 0===e.__inheritance&&(e.__inheritance=[]),void 0!==t.__inheritance)for(var i=0;i<t.__inheritance.length;i++)e.__inheritance.push(t.__inheritance[i]);for(var s in t.$super&&(void 0===e.$super&&(e.$super={}),e.$super.$super=t.$super),t)if(t[s]&&t[s].constructor&&t[s].constructor===Object)e[s]=e[s]||{},t[s]!=e&&arguments.callee(e[s],t[s]);else{var a=void 0!==e[s],n=void 0!==e.$super;s.length>=2&&"_"==s[0]&&s[1];n||(e.$super={}),a?e.$super[s]=t[s]:e[s]=t[s]}return e},inheritFromClass=function(e,t){for(var i in e.implements=t,t)e.hasOwnProperty(i)||0==i.indexOf("__")||(e[i]=t[i])},require=lxlrequire=function(s_moduleName,expires){let temp;if(null!=readyPackageLoaderModules[s_moduleName]){var moduleToRun=readyPackageLoaderModules[s_moduleName];moduleToRun(),readyPackageLoaderModules[s_moduleName]=null}if(!window.suppressLoading){try{temp=eval(s_moduleName)}catch(e){temp=void 0}finally{if(!temp){packageLoaderModules[s_moduleName]={isLoaded:!1,expires,expAction:expires?window.setTimeout((function(){require("com.slacker.util.Console").debug("Expiring "+s_moduleName),expireModule(s_moduleName)}),60*expires*1e3):null};var pkg=new ClassLoader(s_moduleName);pkg.load();try{temp=eval(s_moduleName)}catch(e){temp=void 0}}}return temp}},getLoadedModules=function(){var e=[];for(var t in packageLoaderModules)e.push(t.toString());return e},bjork=function(e,t){readyPackageLoaderModules[e]=t},expireModule=function(e,t){packageLoaderModules[e].isLoaded=!1,packageLoaderModules[e].expires||(packageLoaderModules[e].expires=1440),clearTimeout(packageLoaderModules[e].expAction),t||require(e,packageLoaderModules[e].expires)},ClassLoader=function(e){this.id=(new Date).getTime(),this.packageName=e,this.basePath=packageLoaderBasePath,0===location.toString().indexOf("http")?this.cacheBuster=packageLoaderModules[this.packageName].expires?"s="+(new Date).getTime()+"/":"s=4.0.1385/":this.cacheBuster="/"},ClassLoader.prototype.load=function(){let packageName=this.packageName,url="";if("undefined"!=typeof DEPENDENCIES&&DEPENDENCIES[this.packageName]&&getAllDependenciesNotYetLoaded(this.packageName).length>0){const e=getAllDependenciesNotYetLoaded(this.packageName),t=packageLoaderModules[this.packageName].expires;e.forEach((e=>{packageLoaderModules[e]={isLoaded:!1,isLoaded:!1,expires:t,expAction:t?window.setTimeout((function(){require("com.slacker.util.Console").debug("Expiring "+e),expireModule(e)}),60*t*1e3):null}})),url=this.basePath+generateConcatURL(this.packageName),url=replaceAll(url,"/js?","/jsc?"),url=replaceAll(url,"/s=4.0.1385/js/?","/jsc/?")}else url=this.basePath+packageName.split(".").join("/")+".js";eval(),com.slacker.io.HttpRequest.createRequest({url,async:!1,bypassDr:!0,callback:function(rId){let data=com.slacker.io.HttpRequest.getRequest(rId).http;try{eval(data.responseText)}catch(e){if(window&&window.suppressPackageLoaderErrors)return;{let t="ERROR LOADING MODULE:\n"+packageName+"\n"+url+"\n"+e.toString();throw appendScriptToHead(url),console&&console.log&&console.log(t),e}}}})},appendClassToHead=function(e){var t=packageLoaderBasePath+e.split(".").join("/")+".js";appendScriptToHead(t)},appendScriptToHead=function(e){if(document.getElementsByTagName("head")&&document.getElementsByTagName("head")[0]){var t=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.src=e,t.appendChild(i)}},verifyNamespace=function(ns){let p=window;return ns.split(".").forEach((e=>{p[e]||(p[e]={id:e}),p=p[e]})),eval(ns)},registerClass=function($package,$reference,$prototype){var afterLast=function(e,t){if(null==e)return"";var i=e.lastIndexOf(t);return-1==i?"":(i+=t.length,e.substr(i))},shortName=$package;-1!=$package.indexOf(".")&&(shortName=afterLast($package,"."));var inheritanceItem={name:shortName,path:$package,reference:$reference};if(void 0===$prototype.__inheritance)$prototype.__inheritance=[inheritanceItem];else{for(var foundIt=!1,i=0;i<$prototype.__inheritance.length;i++){var iInheritanceItem=$prototype.__inheritance[i];if(iInheritanceItem.reference==$reference){foundIt=!0;break}}foundIt||$prototype.__inheritance.unshift(inheritanceItem)}$reference.prototype=$prototype,registerPackage($package),eval($package+"=$reference;"),$reference.prototype&&void 0!==$reference.prototype.__constants&&$reference.prototype.__constants()},instantiateClass=function(e,t){void 0!==e.__constants&&e.__constants(),void 0!==e.__properties&&e.__properties(),void 0!==e.__constructor&&e.__constructor.apply(e,t)},registerPackage=function(e){try{const t=verifyNamespace(e);if(t){packageLoaderModules[e]=t;packageLoaderModules["com.slacker.util.Console"]&&com.slacker.util.Console.log&&com.slacker.util.Console.warn(e+" loaded")}}catch(e){}},function(){try{console}catch(e){console=null}registerPackage("com.slacker.util.Console"),com.slacker.util.Console=new class{constructor(e){this.version="$LastChangedRevision: 1323 $",this.msgs=[],this.logLevel=0,this.supportsColors=!1,this.levels={off:0,error:1,warn:2,info:3,debug:4},this.syntaxColor={error:"red",warn:"orange",info:"white",debug:"#5C5F6E"},this.scrollBackCount=1e3,this.consoleGui=e;let t="off";try{t=Q_STRING&&Q_STRING.get("debug")?"debug":"off"}catch(e){}this.logLevel=this.setLogLevel(t),Object.keys(this.levels).filter((e=>
1"off"!=e)).forEach((e=>{this[e]=(t,i)=>this.log(e,t,i)})),this.logFilterPattern=null}println(e,t){let i,s;try{this.msgWin?(i=this.msgWin.document.getElementById("output"),s=this.msgWin.document.createElement("li"),s.setAttribute("level",t),s.innerHTML=e.replace(/\n/g,"<br>"),i.insertBefore(s,i.firstChild)):setTimeout((()=>this._dumpMsgs()),1e3)}catch(e){setTimeout((()=>this._dumpMsgs()),1e3)}finally{i=null,s=null}}setConsoleGui(e){this.consoleGui=e}log(e,t,i){if(!(this.logFilterPattern&&t&&"string"==typeof t&&t.toLowerCase().match(this.logFilterPattern)||t&&t.indexOf("BBIPlayer:")>-1&&t.indexOf("getPercentLoaded")>-1)){!e||t||i||(t=e,e="info");var s=this,a=this.getTimestamp();setTimeout((function(){if(s.levels[e]&&s.levels[e]<=s.logLevel){i&&i.StackTrace?t+=i.StackTrace.toString():i&&(t+=i.message+"\n"+i.line+"\n"+i.file);var n=a+" - ["+e+"] "+t;if(s.msgs.unshift(n),s.println(n,e),s._trimScrollbackBuffer(),console&&console[e]){if(console[e](a+" - "+t,i||""),"undefined"!=typeof SlackerAndroid)try{SlackerAndroid.onLogReceived("["+e+"] "+t)}catch(e){}if(void 0!==window.webkit)try{window.webkit.messageHandlers.onLogReceived.postMessage("["+e+"] "+t)}catch(e){}"error"==e&&console.trace&&console.trace()}n=null}s=null,t=null,i=null,a=null}),10)}}setScrollBack(e){if(this.scrollBackCount=e,this.log("debug","scrollback cache set: "+e),this.msgs.length>this.scrollBackCount){var t=this.msgWin.document.getElementById("output");this.msgs.pop(),t.removeChild(t.lastChild),t=null}}setLogLevel(e){"string"==typeof e?this.levels[e]>=0?this.logLevel=this.levels[e]:(alert("Invalid logging level: "+e),this.logLevel=0):isNaN(e)?this.logLevel=0:this.logLevel=e}hide(){this.msgWin.close()}show(){try{if(!this.msgWin)try{this.msgWin=JaxConsole,this.msgWin.document.getElementById("output").innerHTML.split("</li>").forEach((e=>{this.msgs.push(e.replace(/<li([^>]+)?>/,""))}))}catch(e){}this.msgWin.document.body.innerHTML}catch(e){if(this.consoleGui){this.msgWin=window.open(this.consoleGui,"JaxConsole","resizable=yes,scrollbars=false,toolbar=false"),window;try{JaxConsole=this.msgWin}catch(e){}}else alert("Console GUI file not set. Can't show console.")}}clear(){this.msgs=[],this.msgWin.document.body.innerHTML=""}getLog(e){this._trimScrollbackBuffer();var t=this.msgs;return e&&t.slice(0,e),t}_dumpMsgs(e){try{this._trimScrollbackBuffer();let t=this.msgs.map(((e,t)=>(e.indexOf("[error]")>-1?level="error":e.indexOf("[warn]")>-1?level="warn":e.indexOf("[info]")>-1?level="info":level="debug","<li level='"+level+"'>"+e+"</li>")));e?e.innerHTML=t.join("\n"):this.msgWin&&(this.msgWin.document.getElementById("output").innerHTML=t.join("\n"))}catch(e){}}_trimScrollbackBuffer(){var e=this.scrollBackCount;if(this.msgs.length>e){this.msgs=this.msgs.slice(0,e);try{if(this.msgWin){var t=this.msgWin.document.getElementById("output");t.removeChild(t.lastChild),t=null}}catch(e){}}}getTimestamp(){var e=new Date,t=e.toString(),i=e.getMilliseconds();return i=this.leftZeroFill(i,4),t=t.replace(/ GMT/,"."+i+" GMT")}leftZeroFill(e,t){var i,s="";if(t>(e=e.toString()).length)for(i=0;i<t-e.length;i++)s+="0";return s+e.toString()}}}(),function(){var e={trials:0,cumm:0,avg:0,last:0};function t(t,i,s){var n;parseInt(t,10)&&i&&s&&200==s.status&&(e.trials++,n=Math.round(parseInt(t,10)/128/(i/1e3)),e.last=n,e.cumm=e.cumm+n,a.debug("Calc connection speed: "+[t,i,n]))}function i(){this.version="$LastChangedRevision: 1323 $",this.requests={},this.urlToRequestId={},this.keepAliveCache={},this.noConnectionHandler,this.drHandler,this.outageHandler,this.DR_MODE_ENABLED=!1,this._seqId=0,this.stale=3e5,this.cleanerThread=setInterval((function(){com.slacker.io.HttpRequest.__requestCleaner()}),this.stale)}function s(e,t,i){this.startTime,this.id=e,this.url=i.url,this.method=i.method||"GET",this.postData=i.postData||"",this.http=t,this.async=i.async,this.headers=i.headers,this.bypassDr=i.bypassDr,this.contentLength,this.status=0,this.isCacheable=!1,this.callback}i.prototype={setNoConnectionHandler:function(e){this.noConnectionHandler=e},getNoConnectionHandler:function(){return this.noConnectionHandler},setOutageHandler:function(e){this.outageHandler=e},getOutageHandler:function(){return this.outageHandler},setDrHandler:function(e){this.drHandler=e},getDrHandler:function(){return this.drHandler},createRequest:function(e){var i=this;if(0!=e.url.indexOf("http")||!i.noConnectionHandler||navigator.onLine){var s,n,o;s=e.method||"GET",n=e.async||!1,e.username=e.username||"",e.password=e.password||"",e.postData=e.postData||null;var r=this.getHttpRequestObj(e);r.callback=e.callback;var l=e.url,c="";if(l.indexOf("password=")>-1?c="password=":l.indexOf("pw=")>-1&&(c="pw="),c){var d=l.indexOf(c)+c.length,u=l.substring(0,d),h=l.substring(d);h.indexOf("&");h=h.substring(d),l=u+"******"+h}e.url.indexOf("undefined")>-1&&(a.debug("Malformed URL contains the word undefined: "+l),e.url=e.url.replace(/undefined/g,""));try{if(r.http.open(s,e.url,n,e.username,e.password),navigator.userAgent.indexOf("MSIE")>-1||navigator.userAgent.indexOf("Trident")>-1)try{r.http.responseType="msxml-document"}catch(e){}}catch(e){a.error("Malformed URL: "+[l,e])}if(n&&e.callback&&"function"==typeof e.callback&&(window.ActiveXObject?r.http.onreadystatechange=function(){if(4==r.http.readyState)try{r.requestTime=o=new Date-r.startTime,r.contentLength=r.http?r.http.getResponseHeader("Content-Length"):0,a.info("Async "+s+" request returning ("+r.http.status+" - "+o+"ms / "+r.contentLength+"): "+l),e.httpStatus=r.http.status,setTimeout((function(){t(r.contentLength,o,r.http)}),10),i.handleRequestCallback(e,r)}catch(t){a.warn("HTTP request callback may have failed: "+[t,l,e.callback])}}:(r.http.onload=function(n){try{r.requestTime=o=new Date-r.startTime,r.contentLength=r.http?r.http.getResponseHeader("Content-Length"):0,a.info("Async "+s+" request returning ("+r.http.status+" - "+o+"ms / "+r.contentLength+"): "+l),e.httpStatus=r.http.status,setTimeout((function(){t(r.contentLength,o,r.http)}),10)}catch(e){}e.callback?i.handleRequestCallback(e,r):a.warn("Async HTTP request called without a callback: "+l)},r.http.onerror=function(t){var s=null;try{s=t.target.status}catch(e){s=500}try{r.requestTime=o=new Date-r.startTime,a.error("httprequest error - "+s+" ("+o+"ms): "+l),com.slacker.io.HttpRequest.cancelRequest(r.id)}catch(e){a.error("Failed to cancel request",e)}if(e.async&&(!s||s>=500))if(void 0===e.retryCount?e.retryCount=0:e.retryCount++,e.retryCount>2)try{a.warn("Request retry limit exceeded. Cancelling request: "+l),e.callback&&i.handleRequestCallback(e,r)}catch(e){}else{try{a.warn("Retry ("+e.retryCount+") request after error ("+s+"): "+l)}catch(e){}setTimeout((function(){com.slacker.io.HttpRequest.createRequest(e)}),5e3*e.retryCount)}else{try{a.warn("return null http on failed request")}catch(e){}i.handleRequestCallback(null,r)}})),e.headers){var p;for(p in e.headers)if(e.headers.hasOwnProperty(p))try{r.http.setRequestHeader(p,e.headers[p])}catch(t){a.error("HttpRequest.createRequest() error setting header "+p+" - "+e.headers[p]+": "+t)}!e.headers["BBI-AUTHORIZATION"]&&e.url.match(/(slacker|live(one|xlive))\.com/)&&a.warn("BBI-AUTH header is missing!")}try{r.http.setProperty&&r.http.setProperty("SelectionLanguage","XPath")}catch(e){}try{r.startTime=new Date,r.http.send(e.postData),a.debug("Requesting (async:"+n+"): "+s+" "+l)}catch(e){try{var m=e.message||e;a.error(m+" requesting (async:"+n+"): "+s+" "+l)}catch(e){}}if(e.timeout){var g=e.timeout.msec,P=e.timeout.ontimeout;setTimeout((function(){try{var t=com.slacker.io.HttpRequest.getRequest
1(r.id);if(t&&t.http&&t.http.readyState<3){com.slacker.io.HttpRequest.cancelRequest(r.id);try{a.warn("httpRequest: Request timed out: "+e.url)}catch(e){}"function"==typeof P&&P.apply(r.http,[r.id,e])}}catch(e){}}),g)}if(0==n&&"function"==typeof e.callback){try{r.requestTime=o=new Date-r.startTime,r.contentLength=r.http?r.http.getResponseHeader("Content-Length"):0,a.info("Returning sync request ("+r.http.status+": "+o+"ms / "+r.contentLength+") with callback: "+l),setTimeout((function(){t(r.contentLength,o,r.http)}),10)}catch(e){}return i.handleRequestCallback(e,r)}if(0==n||!e.callback){var y=e.callback?"sync":"async fire and forget";try{r.requestTime=o=new Date-r.startTime,r.contentLength=r.http?r.http.getResponseHeader("Content-Length"):0,a.info("Returning "+y+" request ("+r.http.status+": "+o+"ms / "+r.contentLength+") : "+l),1!=n&&setTimeout((function(){t(r.contentLength,o,r.http)}),10)}catch(e){}}return r.id}i.noConnectionHandler.apply(this,[e])},handleRequestCallback:function(e,t){var i=t.http.getResponseHeader("X-Slacker-Degraded");if(this.drHandler&&i&&!t.bypassDr)this.DR_MODE_ENABLED=!0,this.drHandler.apply(t.http,[!0,t,e]);else if(this.DR_MODE_ENABLED&&!t.bypassDr)this.DR_MODE_ENABLED=!1,this.drHandler.apply(null,[!1,t,e]);else if(e&&e.callback)return t.bypassDr||(this.DR_MODE_ENABLED=i),e.callback.apply(t?t.http:null,[t?t.id:null])},finalize:function(e,t){var i=this.requests[e];if(t=!0,i){var s=this.getRequestDomain(i.url),n=!1;try{n=i.http.getResponseHeader("Keep-Alive")}catch(e){t=!0,a.error(e,e)}if(!t&&n&&i.http.status<400)a.debug("Connection Keep-Alive available. Push to connection cache ("+i.id+")."),this.keepAliveCache[s]||(this.keepAliveCache[s]=[]),this.keepAliveCache[s].push(i);else if(t||!i.isCacheable){if(a.debug("finalize connection ("+i.id+")."),window.ActiveXObject)try{i.http.onreadystatechange=null}catch(e){}else try{i.http.onload=null}catch(e){}delete this.urlToRequestId[i.url],delete this.requests[e],i.http.abort(),i.http=null,i=null}}},__requestCleaner:function(){var e=new Date,t=0;for(var i in a.info("Stale request cleaner running."),this.requests){var s=this.requests[i];if(e-s.startTime>=this.stale){t++,a.debug("Cleaning stale request object: "+i+" - "+s.url);var n=this.keepAliveCache[this.getRequestDomain(s.url)];if(n)for(var o=0;o<n.length;o++)n[o].id==s.id&&(n[o]=null);this.finalize(i,!0)}}a.info("Stale request cleaner cleaned "+t+" stale requests")},getRequest:function(e){return this.requests[e]},getRequestDomain:function(e){var t=e.substring(appLoc.indexOf("//")+2);return t.indexOf("/")>-1?t=t.substring(0,t.indexOf("/")):t.indexOf("?")>-1&&(t=t.substring(0,t.indexOf("?"))),t},getHttpRequestObj:function(e){var t=this.getRequestDomain(e.url);if(this.keepAliveCache[t]&&this.keepAliveCache[t].length>0){for(var i=null;!i&&this.keepAliveCache[t].length>0;)i=this.keepAliveCache[t].shift();return i?(i.url=e.url,i.method=e.method||"GET",i.postData=e.postData||"",i.async=e.async,i.headers=e.headers,i.bypassDr=e.bypassDr,i.isCacheable=e.isCacheable,i.status=0,e.withCredentials?o.withCredentials=e.withCredentials:o.withCredentials=null,a.debug("Re-using connection from keepaliveCache: "+i.id+i.url),i):getHttpRequestObj(e)}var n=!1;window.XDomainRequest&&(n=!0);var o=n&&e.withCredentials?new XDomainRequest:new XMLHttpRequest,r=++this._seqId;return!n&&e.withCredentials&&(o.withCredentials=e.withCredentials),this.requests[r]=new s(this._seqId++,o,e),this.urlToRequestId[e.url]=r,this.requests[r]},getResponseHeaders:function(e){var t,i,s={},a=e.getAllResponseHeaders(),n=a.split("\n");for(i=0;i<n.length;i++)s[(t=n[i].split(": "))[0]]=t[1];return n=a=t=null,s},cancelRequest:function(e){var t=this.requests[e];t&&(t.isCacheable=!1,this.finalize(e,!0))},getConnSpeed:function(){return e.avg=e.cumm/e.trials,e.avg}};try{netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead")}catch(e){}registerPackage("com.slacker.io.HttpRequest"),com.slacker.io.HttpRequest=new i;var a=require("com.slacker.util.Console");try{a=com.slacker.util.Console}catch(e){}}(),bjork("com.slacker.event.EventNotifier",(function(){!function(){const e=require("com.slacker.util.Console");registerClass("com.slacker.event.EventNotifier",(function(){instantiateClass(this,arguments)}),{__properties:function(){this.events={},this.eventMap={},this.handlerMap={},this.count=0},__constructor:function(e){this.context=e||this},countReferences:function(){var t=function(e){var t=0;for(var i in e)t++;return t};e.info(`Reference Counts:\n\t\t\t\t\tevents: ${t(events)}\n\t\t\t\t\teventMap: ${eventMap}\n\t\t\t\t\thandlerMap: ${t(handlerMap)}`)},attachEvent:function(t,i,s){this.events[t]||(this.events[t]={});const a=this.getNextId();return this.eventMap[a]={evt:t,handler:i,synced:s||!1,fire:t=>setTimeout((()=>
1{if(this.eventMap[a])try{this.eventMap[a].handler.apply(this.context,t)}catch(t){e.error(["EventNotifier::attachEvent Error calling listener.",this.eventMap[a].handler].toString(),t)}}),10)},this.events[t][a]=i,a},addEventListener:function(t,i,s){if(null==t||""===t)throw new Error("Cannot addEventListener for event type of undefined, null, or empty string");if("string"!=typeof t&&(t=t.toString()),null==s||i.isDelegate||(i=i.bind(s)),this.handlerMap[t]&&this.handlerMap[t][i])e.debug("Ignoring duplicate addEventListener to same eventType and callBack: "+t+": "+i);else{var a=this.attachEvent(t,i);void 0===this.handlerMap[t]&&(this.handlerMap[t]={count:0}),this.handlerMap[t][i]=a,this.handlerMap[t].count++}},removeEventListener:function(t,i){if(null==t||""===t)throw new Error("Cannot removeEventListener for event type of undefined, null, or empty string");if("string"!=typeof t&&(t=t.toString()),this.handlerMap[t]&&this.handlerMap[t][i]){const s=this.handlerMap[t][i];s?this.detachEvent(s):e.warn("EventNotifier::removeEventListener - Could not find listener id to remove: "+s),delete this.handlerMap[t][i],this.handlerMap[t].count<=1?delete this.handlerMap[t]:this.handlerMap[t].count--}},dispatch:function(e){null==e.target&&(e.target=this),this.notify(e.type,[e])},dispatchEvent:function(e){null==e.target&&(e.target=this),this.notify(e.type,[e])},notify:function(e,t,i){var s=null;if(t=t||[],this.events[e]){var a,n=this.events[e];for(a in n)if(n.hasOwnProperty(a)){"undefined"!=typeof LOGEVENTS&&LOGEVENTS&&"info";var o=t;try{o.toString()}catch(e){o.toString=function(){return"Object"}}this.context.eventId=a;try{this.eventMap[a].synced||i?s=n[a].apply(this.context,t):this.eventMap[a].fire(t)}catch(t){try{console.log("ERROR - Event notification failed ("+e+"):"+(t.message||t))}catch(e){}}}}if(s)return s},detachEvent:function(t){var i=this.eventMap[t];i?(delete this.events[i.evt][t],delete this.eventMap[t],e.info("Event id detached: "+[i.evt,t])):e.warn("No event for id: "+[t])},getNextId:function(){return++this.count}})}()})),bjork("com.slacker.io.XmlUtils",(function(){!function(e,t,i){function s(){this.version="$LastChangedRevision: 1308 $",this.tempDom=this.createDom("root")}s.prototype={encode:function(e,t){return e?(e=(e=(e=e.toString().replace(/\&/g,"&")).replace(/\</g,"<")).replace(/\>/g,">"),e=(e=t?e.replace(/\'/g,"'"):e.replace(/\'/g,"'")).replace(/\"/g,""")):e="",e},decode:function(e,t){return e=e?(e=(e=(e=(e=t?e.toString().replace(/\'/g,"'"):e.toString().replace(/\'/g,"'")).replace(/\"/g,'"')).replace(/\</g,"<")).replace(/\>/g,">")).replace(/\&/g,"&"):""},parseFromUrl:function(i){e("com.slacker.io.HttpRequest");var s=t.slacker.io.HttpRequest.createRequest({method:"GET",url:i,async:!1}),a=null;try{(a=t.slacker.io.HttpRequest.getRequest(s).http.responseXML).setProperty("SelectionLanguage","XPath")}catch(e){}finally{t.slacker.io.HttpRequest.finalize(s)}return a||null},parseFromString:function(e){if(!e)return null;var i=null;e.indexOf("<?xml ")>-1&&(e=e.replace(/\<\?xml([^\>]+)>/,"")),e.trim&&(e=e.trim());try{i=new ActiveXObject("Microsoft.XMLDOM")}catch(e){}if(i)(i=new ActiveXObject("Microsoft.XMLDOM")).async="false",i.loadXML(e),i.setProperty("SelectionLanguage","XPath"),i.xml||(t.slacker.util&&t.slacker.util.Console&&t.slacker.util.Console.warn("XML parse failed.\n"+e+"\n"+(i.parseError?i.parseError.reason:"")),i=null);else if(window.DOMParser){(i=(new DOMParser).parseFromString(e,"text/xml")).mimeType&&t.slacker.util.Console.info("dom.mimeType reports as: "+i.mimeType),i.toString().toLowerCase().indexOf("htmldocument")>-1&&(i=null)}if(!i)try{if(!i){var s="data:text/xml;charset=utf-8,"+encodeURIComponent("<?xml version='1.0'?>"+e),a=new XMLHttpRequest;a.open("GET",s),a.send(null),i=a.responseXML,t.slacker.util.Console.info("Trying XML parse using XHR")}}catch(i){t.slacker.util&&t.slacker.util.Console&&t.slacker.util.Console.error("XML parse failed.\n"+e+"\n"+i.toString())}return i},createDom:function(e,t){var i="<"+(e=e||"root")+">"+(t=t||"")+"</"+e+">";return this.parseFromString(i)},serialize:function(e){var i="";if(!e)return i;try{i=(new XMLSerializer).serializeToString(e)}catch(s){try{i=window.ActiveXObject||e.xml?e.xml:e.toString()}catch(e){t.slacker.util&&t.slacker.util.Console&&t.slacker.util.Console.warn("XML serialize failed",e)}}return i},serializeToHtml:function(e){return this.encode(this.serialize(e))},selectNodes:function(e,t){if(!e||!t)return[];
1if(t=t.replace(/\\('|")/g,"$1"),9!=e.nodeType&&10!=e.nodeType)try{return e.selectNodes(t)}catch(t){e=this.parseFromString(this.serialize(e))}e.mimeType&&(e.mimeType.toLowerCase().indexOf("html document")>-1||e.mimeType.toLowerCase().indexOf("xml file")>-1)&&(e=this.parseFromString(this.serialize(e)));try{try{return e.setProperty("SelectionLanguage","XPath"),e.selectNodes(t)}catch(i){if(!window.ActiveXObject)return(e=this.parseFromString(this.serialize(e))).selectNodes(t);if(!e.xml)return null}}catch(l){var i=[];try{for(var s=e.createNSResolver(null==e.ownerDocument?e.documentElement:e.ownerDocument.documentElement),a=e.evaluate(t,e,s,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),n=a.iterateNext();n;)i.push(n),n=a.iterateNext()}catch(s){if(e&&e.querySelector)for(var o=t.replace(/\/\//g,"/").replace("/","").split("/"),r=0;r<o.length;r++)r==o.length-1?i=e.querySelectorAll(o[r]):e=e.querySelector(o[r])}return i}},selectSingleNode:function(e,t){if(!e||!t)return null;if(t=t.replace(/\\('|")/g,"$1"),9!=e.nodeType&&10!=e.nodeType)try{return e.selectSingleNode(t)}catch(t){e=this.parseFromString(this.serialize(e))}e.mimeType&&(e.mimeType.toLowerCase().indexOf("html document")>-1||e.mimeType.toLowerCase().indexOf("xml file")>-1)&&(e=this.parseFromString(this.serialize(e)));try{try{return e.setProperty("SelectionLanguage","XPath"),e.selectSingleNode(t)}catch(i){if(!window.ActiveXObject)return(e=this.parseFromString(this.serialize(e))).selectNodes(t);if(!e.xml)return null}}catch(o){var i;try{var s=e.createNSResolver(null==e.ownerDocument?e.documentElement:e.ownerDocument.documentElement);return 0==t.indexOf("count")?e.evaluate(t,e,s,XPathResult.ANY_TYPE,null).numberValue:e.evaluate(t,e,s,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(s){try{if(e&&e.querySelector){for(var a=t.replace(/\/\//g,"/").replace("/","").split("/"),n=0;n<a.length;n++)n==a.length-1?i=e.querySelector(a[n]):e=e.querySelector(a[n]);return i}}catch(e){return s.message}}}},getRootNode:function(e){var t=e;if(!t.firstChild)return t;for(t=e.firstChild;"xml"==t.nodeName||"xml-stylesheet"==t.nodeName;)t=t.nextSibling;return t}},i("com.slacker.io.XmlUtils"),t.slacker.io.XmlUtils=new s}(require,com,registerPackage)})),bjork("com.slacker.io.pokepull.Factory",(function(){!function(){const e=require("com.slacker.io.pokepull.Poke");let t={};registerPackage("com.slacker.io.pokepull.Factory"),com.slacker.io.pokepull.Factory=new class{constructor(){}getPoker(i,s){if(s){const t=new e(null,null,1e3);i=this.addPoker(t)}return t[i]}getPokers(){return t}addPoker(e){return t[e.id]=e,e.id}removePoker(e){if(t[e]){t[e].disconnect(),t[e]=null}}}}()})),bjork("com.slacker.io.pokepull.Poke",(function(){!function(){const e=require("com.slacker.util.Console");registerPackage("com.slacker.io.pokepull.Poke"),com.slacker.io.pokepull.Poke=class{constructor(e,t,i){this.id=(new Date).getTime(),this.url=e,this.onPush=t,this.freq=i,this.currentPoke=null,this.pollAction=null,this.connected=null,this.noOpCount=0}setUrl(e){this.url=e}getPollFreq(){return this.freq}setOnPush(e){this.onPush=e}connect(){return e.log("info","Connect poker - ID: "+this.id),this.url&&this.onPush?(this.connected=!0,this._doPollAction(),!0):(e.log("error","Attempt to connect Poke without url or push reciever."),!1)}_doPollAction(){this.pollAction=setTimeout((()=>{if(this.currentPoke)e.log("info","Poke still in progress.");else{let e=this.url+"?rnd="+(new Date).getTime(),t=0==this.noOpCount;this.currentPoke=APP.NETWORKING.do(e,((e,t,i)=>{304==i.status?this.noOpCount++:this.noOpCount=0,this.onPush.apply(this,[e,t,i,this]),this.currentPoke=null,this.connected&&setTimeout((()=>this._doPollAction.apply(this,[])),500)}),"GET","text/xml",null,null,t)}}),this.getPollFreq())}disconnect(){e.log("info","Disconnect poker - ID: "+this.id),this.pollAction&&(clearTimeout(this.pollAction),this.pollAction=0),this.connected=!1,this.currentPoke&&(this.currentPoke.abort(),this.currentPoke=null)}isConnected(){return this.connected}}}()})),bjork("com.slacker.player.AbstractPlayer",(function(){!function(){const e=require("com.slacker.util.Console"),t=require("com.slacker.event.EventNotifier"),i=require("com.slacker.util.browser.Browser"),s=require("com.slacker.util.behavior.VzwAudience");function a(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties()}a.prototype={__constants:function(){this.LIVE_STALL_RECONNECT_TIMEOUT=2e4,this.COMSCORE_SHORT_THRESH=1800,this.BLANK_MP3=`${IMG_CDN_AND_BUILD}/helper/1sec.mp3`,this.EVENT={EMBEDSUCCESS:"onEmbedSuccess",EMBEDFAILURE:"onEmbed
1Failure",DISPLAYERROR:"onDisplayError",ONFULLSCREENTOGGLE:"onFullScreenToggle",ONFULLSCREENCHANGE:"onFullScreenChange",NOCONTENT:"error_no_content_url",AUTOPLAY_DISABLED:"autoplay-disabled",VIDEOCONTAINERREADY:"onVideoContainerReady",ADNETWORKCONTAINERREADY:"onAdNetworkContainerReady",ADNETWORKLOADING:"onAdNetworkLoading",ADNETWORKREADY:"onAdNetworkReady",VIDEOADNOTREADY:"onVideoAdNotReady",DBK:"adblock",VIDEOADSTARTED:"onVideoAdStarted",VIDEOADENDED:"onVideoAdEnded",NOVIDEOAD:"onNoVideoAd",ADACTION:"onAdAction",AD:{PLAYBACK:{REQUESTED:"ad_playback_requested",STARTED:"ad_playback_started",COMPLETED:"ad_playback_completed",CLICKED:"ad_clicked",NOAD:"ad_playback_no_ad"}},PLAYBACK:{COMPLETED:"playback_completed",STARTED:"playback_started",PAUSE:"playback_pause",RESUME:"playback_resume",ERROR:"playback_error",DURATIONCHANGE:"playback_durationchange",WAITING:"playback_waiting",TIMEUPDATE:"playback_timeupdate",WAITING:"playback_waiting-stalled",MUTE:"playback_mute",UNMUTE:"playback_unmute"}}},__properties:function(){this.adNetworkId=1,this.size=["100%","100%"],this.hasVideoAdQueued=!1,this.isRequestingAds=!1,this.imaOptions={id:null,autoPlayAdBreaks:!1,adLabel:"",disableFlashAds:!0,contribAdsSettings:{timeout:5e3,prerollTimeout:1e4},adTagUrl:""},this.overrideNative=!1,this.canRetryNonNative=!0,this.retryData=null,this.wasPaused=!1,this.needsRestartOnResume=!1,this.currentPlayerObj=null,this.currentVideoObj=null,this.currentContainer=null,this.startOffset=0,this.isMobileStartupHack=!1,this.defaultFullScreen=!1,this.pingbacks=null,this.playbackEventStartTime=0,this.stalledActionTimer=0,this.stalledTime=0,this.isReconnectStart=!1,this.pingPOST={specVersion:"1.3",context:{embeddedOn:null,screen:window.innerWidth+"x"+window.innerHeight},autoplay:!1},this.COMSCORE_V},storeCurrentVideoState:function(t,i,s){let a=APP.SERVICE.isCached("videoStates"),n=a?JSON.parse(a):{};try{if(!s&&("lxl"!==this.currentVideoObj.source||i&&i%10!=0))return;null===i?delete n[t]:["live","replay"].includes(this.pingPOST.streamType)?n.live={seoName:t,ts:(new Date).getTime()}:n[t]=i}catch(t){e.warn("AbstractPlayer::storeCurrentVideoState - failed to store state ",t)}finally{APP.SERVICE.cache("videoStates",JSON.stringify(n))}},getLastVideoState:function(e){const t=APP?.SERVICE?.isCached("videoStates"),i=t?JSON.parse(t):{};return i[e]?i[e]:null},embed:function(e,t,i){},stop:function(e){},cleanUp:function(e){},initPingbackData:function(e){this.pingPOST.context.embeddedOn=APP.embedCampaign(),this.pingPOST.playerTech=e,this.pingPOST.requestId=null,this.pingPOST.startTime=null,this.pingPOST.underrunCount=0,this.pingPOST.framesDropped=0,this.isReconnectStart&&this._videoStarted||(this.pingPOST.elapsed=0,this.pingPOST.requestSpanId=null),this.pingPOST.timeOffset=0,s.init(APP_ENV)},unwrapContentUrl:function(t,i){e.info(["AbstractPlayer:: Unwrapping secured content URL: ",t]);var s=this;this.pingPOST.contentUrl=t,APP.NETWORKING.do(t,(function(e,t,a){if(e&&e.href){if(s._processPingbacks(e),"video/youtube"==e.mimeType&&(s.currentVideoObj.source="youtube",s.currentVideoObj.disablePreroll=!0),e.streamType&&(s.currentVideoObj.streamType=e.streamType),e.captionUrls?s.currentVideoObj.captionUrls=e.captionUrls:"live"==e.streamType&&(s.currentVideoObj.captionUrls=[{href:"/helper/live.vtt",language:"en",label:"English"}]),e.monetization&&Object.keys(e.monetization).forEach((t=>{s.currentVideoObj[t]=e.monetization[t]})),!s.currentVideoObj.disableMidroll&&!s.currentVideoObj.adBreaks){let t=null;if(e?.adBreaks?.length){let i=s.startOffset?1e3*s.startOffset:0;t=e.adBreaks.filter((e=>0!=e.offset&&e.offset>i&&!s.currentVideoObj?.playedRemoteBreaks?.[e.offset]))}s.currentVideoObj.adBreaks=t}i(e.href,e.mimeType)}else if(401==a.statusCode().status);else{let e="Invalid content URL";403==a.statusCode().status&&s.currentVideoObj.subTypes&&s.currentVideoObj.subTypes.includes("ticketing")?e="no_ticket":a.responseJSON&&(e=a.responseJSON.code||a.responseJSON.message,s.currentVideoObj.messages=[a.responseJSON.message]),s.onVideoPlayerEvent({type:s.EVENT.PLAYBACK.ERROR,error:e,player:s.player,video:s.currentVideoObj})}}),"GET")},_parsePTtime:function(e){const t=e.match(/PT([\d\.]+?D)?([\d\.]+?H)?([\d\.]+?M)?([\d\.]+?S)?/);let i,s,a,n;return t.length?(i=t[1]?parseFloat(t[1]):0,s=t[2]?parseFloat(t[2]):0,a=t[3]?parseFloat(t[3]):0,n=t[4]?parseFloat(t[4]):0,n+60*a+3600*s+3600*i*24):0},_processPingbacks:function(t,i){if(this.pingbacks=null,this.pingbacks={quartiles:{start:["START","ga"],firstQuartile:["ga"],midpoint:["ga"],thirdQuartile:["ga"],complete:["ga"]},event:null,frequency:null},(!i||this.pingPOST.requestId&&t.requestId!=this.pingPOST.requestId)&&(this.pingPOST.requestId=t.requestId,this.pingPOST.contentId=t.contentId,this.pingPOST.mediaUrl=t.mediaUrl,this.pingPOST.streamFormat=t.streamFormat,this.pingPOST.streamType=t.streamType),this.pingPOST.requestSpanId||(this.pingPOST.requestSpanId=this.pingPOST.requestId),this.pingPOST.bitrate=0,t.pingbackUrls&&t.pingbackUrls.length){const i=t.pingbackUrls.length;let a,n,o,r=0;for(r=0;r<i;r++){if(a=t.pingbackUrls[r],"event"==a.type&&(n=a.value,this.pingbacks.event||(this.pingbacks.event={}),this.pingbacks.event[n]||(this.pingbacks.event[n]=[]),e.debug(["AbstractPlayer:: Adding event beacon",n]),this.pingbacks.event[n].push(a)),"elapsed"==a.type){if(n=a.value,a.name.indexOf("start")>
1-1&&this.isReconnectStart&&!this._wasPlayingVideoAd){e.warn(`AbstractPlayer:: Ignore beacon (${a.name}) on reconnect to stream`);continue}o=this._parsePTtime(a.value),this.pingbacks.elapsed||(this.pingbacks.elapsed={}),this.pingbacks.elapsed[o]||(this.pingbacks.elapsed[o]=[]),e.debug(["AbstractPlayer:: Adding elapsed beacon",n]),this.pingbacks.elapsed[o].push(a)}"quartile"==a.type?(n=a.value,this.pingbacks.quartiles||(this.pingbacks.quartiles={}),this.pingbacks.quartiles[n]||(this.pingbacks.quartiles[n]=[]),e.debug(["AbstractPlayer:: Adding quartile beacon",n]),this.pingbacks.quartiles[n].push(a)):"frequency"==a.type&&0==a.value.indexOf("PT")&&(this.pingbacks.frequency||(this.pingbacks.frequency={}),o=this._parsePTtime(a.value),this.pingbacks.frequency[o]||(this.pingbacks.frequency[o]=[]),e.debug(["AbstractPlayer:: Adding frequency beacon",o]),this.pingbacks.frequency[o].push(a))}this.currentVideoObj&&!this.currentVideoObj.pingbackUrls&&(this.currentVideoObj.pingbackUrls=t.pingbackUrls),this.COMSCORE_V_METADATA={ns_st_ci:this.pingPOST.contentId,ns_st_cl:"0",ns_st_pu:"LXL",ns_st_pr:this.currentVideoObj.title+" "+this.currentVideoObj.subtitle,ns_st_ia:"*null",ns_st_ce:"*null",ns_st_ddt:"*null",ns_st_tdt:"*null",c3:this.currentVideoObj.streamStatus?this.currentVideoObj.streamStatus:this.currentVideoObj.subTypes[0],c4:"*null",c6:"*null"};var s="";"embedded"===APP.appImplementationModule.type||(s=APP.currentView.seoName?APP.currentView.seoName.split("/"):APP.currentView.historyData.seoName.split("/"),APP.history.length>1&&("video"==s[0]||"post"==s[0])&&("channel"!=(s=APP.history[1].historyData.seoName.split("/"))[0]&&"genre"!=s[0]||(this.COMSCORE_V_METADATA.c4=s[0],this.COMSCORE_V_METADATA.c6=s[1],"genre"==s[0]&&(this.COMSCORE_V_METADATA.ns_st_ge=s[1])))),"*null"==this.COMSCORE_V_METADATA.c4&&"live"==this.COMSCORE_V_METADATA.c3&&(this.COMSCORE_V_METADATA.c4="festival")}},__play:function(e,t,i,s){},mute:function(){},unmute:function(){},setVolume:function(e){},onPingBackAction:function(t,a){const n=this;let o,r,l,c=null,d=this.pingPOST;if(d.requestId)if(this.pingbacks&&this.pingbacks[t]&&(c=this.pingbacks[t][a]),c){e.info(["AbstractPlayer:: Firing Pingback Beacon",t,a]);try{"quartiles"==t&&delete this.pingbacks[t][a],c.forEach((u=>{if("POST"===u.method){o="elapsed"==t?u.name:"frequency"==t?"foregroundPingback":a;let i=(new Date).getTime(),h=n.player?"youtube"===n.type?n.player.getVolume():100*n.player.volume():0,p={sentTime:i,events:[{eventName:o,eventType:"playback",version:d.specVersion,eventNumber:BEACON.count++,data:{requestSpanId:d.requestSpanId,requestId:d.requestId,eventTime:i,playbackState:n.wasPaused?"paused":"playing",volume:"tv"==APP.implementationSuperType()?-1:parseInt(h),muted:"tv"==APP.implementationSuperType()?-1:this.wasMuted?1:0,context:{playerType:d.playerTech,embeddedOn:d.context.embeddedOn,screen:`${window.innerWidth}x${window.innerHeight}`},delivery:{contentUrl:d.contentUrl,mediaUrl:d.mediaUrl,streamFormat:d.streamFormat,mimeType:d.mimeType,startLatency:d.startLatency,framesDropped:d.framesDropped,currentBitrate:d.bitrate},duration:{startTime:d.startTime,buffering:d.bufferingTime,elapsed:1e3*d.elapsed,offset:1e3*d.timeOffset},metadata:{contentId:d.contentId,streamType:d.streamType,duration:d.duration,autoplay:d.autoplay}}}]};APP.slackerAcct()&&(p.events[0].data.context.slackerAccountId=APP.slackerAcct()),this.currentVideoObj.disableping||BEACON._doBeaconAction(u.href,p,"POST",BEACON.ingnoreResponseHandler),s._doBeaconAction(p.events[0],i),d.bufferingTime&&(d.bufferingTime=0),u?.backoff?.length&&(r=u.backoff[0],r.elapsed&&(l=this._parsePTtime(r.elapsed),d.elapsed>=l&&(l=this._parsePTtime(r.frequency),e.warn(["AbstractPlayer: Changing frequency pingback",a,"->",l]),c.value=r.frequency,this.pingbacks[t][l]=c,delete this.pingbacks[t][a],u.backoff.shift())))}else if("quartiles"==t)switch(u){case"ga":let e,t={video_current_time:this.getPlayerTime(),video_duration:d.duration||0,video_percent:isNaN(d.duration)?0:parseInt(1e3*this.getPlayerTime()/d.duration*100),video_provider:"livexlive",item_title:`${this.currentVideoObj?.title}`,video_url:this.currentVideoObj?.seoName,visible:i._visible,video_bitrate:d.bitrate,user_elapsed:d.elapsed,startLatency:d.startLatency};switch(a){case"start":e="video_start";break;case"complete":e="video_complete";break;default:e="video_progress"}e&&BEACON.tagEvent({name:e,params:t});break;case"START":let s=this.isReconnectStart&&this._wasPlayingVideoAd,n="live"==d.streamType&&1==d.timeOffset;!this.isReconnectStart||s||n?(this._wasPlayingVideoAd=!1,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.STARTED,player:this.player,video:this.currentVideoObj}),d.requestId==d.requestSpanId?this.onPingBackAction.bind(this)("event","start"):this.onPingBackAction.bind(this)("event","resume"),this.isReconnectStart&&(this.isReconnectStart=!1)):(this.isReconnectStart=!1,this.onPingBackAction.bind(this)("event","resume"),APP.notifyPostMessageListeners('{"state":"reconnect"}'),BEACON.tagEvent({name:"video",params:{value:"reconnect",label:this.currentVideoObj.objectId||this.currentVideoObj.festivalId}}))}else this.currentVideoObj.disableping||BEACON._doBeaconUrl(u.href)}))}catch(t){e.error("Error attempting to send ping",t)}"frequency"==t&&(this.pingPOST.framesDropped=0)}
1else"event"==t&&e.warn(["Unknown pingback",t,a]);else e.debug("No request ID - Pingback ("+t+") isn't valid for this content.")},onVideoPlayerEvent:function(t){"playback_timeupdate"!==t.type&&e.warn("onVideoPlayerEvent::"+t.type);const s=this,a=(new Date).getTime();switch(t.type){case"onEmbedFailure":this.dispatch({type:this.EVENT.ONEMBEDFAILURE,adNetworkID:t.adNetworkID||this.adNetworkId,reason:t.reason});break;case"onFullScreenToggle":this.dispatch({type:this.EVENT.ONFULLSCREENTOGGLE,player:t.player});break;case"onFullScreenChange":this.currentFullscreenState!=t.player.isFullscreen_&&(this.currentFullscreenState=t.player.isFullscreen_,this.dispatch({type:this.EVENT.ONFULLSCREENCHANGE,player:t.player}),APP.notifyPostMessageListeners('{"state":"fullscreen","value":"'+t.player.isFullscreen_+'"}'),BEACON.tagEvent({name:"fullscreen",params:{value:"state",label:t.player.isFullscreen_}}));break;case"playback_started":this._videoStarted=!0,this.dispatch({type:this.EVENT.PLAYBACK.STARTED,player:t.player,video:t.video});try{this.COMSCORE_V&&(this.COMSCORE_V_METADATA.ns_st_cl="live"===s.pingPOST.streamType?"0":new String(Math.round(s.pingPOST.duration)),this.COMSCORE_V_CONTENTTYPE="live"===s.pingPOST.streamType?ns_.ReducedRequirementsStreamingAnalytics.ContentType.Live:s.pingPOST.duration>this.COMSCORE_SHORT_THRESH?ns_.ReducedRequirementsStreamingAnalytics.ContentType.LongFormOnDemand:ns_.ReducedRequirementsStreamingAnalytics.ContentType.ShortFormOnDemand,this.COMSCORE_V.playVideoContentPart(this.COMSCORE_V_METADATA,this.COMSCORE_V_CONTENTTYPE))}catch(t){e.warn("ComScore API not loaded")}APP.notifyPostMessageListeners('{"state":"start","video":"'+(t.video.objectId||t.video.festivalId)+'"}');break;case"playback_completed":if(this._wasPlayingVideoAd||this.isRequestingAds){e.warn("After pre/mid-roll bad state catch (recieved full content end).");const i=this.player.ima.controller.getCurrentAd().getAdPodInfo();if(i&&i.getAdPosition()<i.getTotalAds())return;if("live"!=this.pingPOST.streamType)try{this.startOffset=this.getLastVideoState(this.currentVideoObj.objectId)}catch(t){e.warn("Failed to get last position for video coming out of bad ad break state")}return void this.reconnectToStream(!0)}this.onPingBackAction.bind(s)("event","end"),this.onPingBackAction.bind(s)("quartiles","complete"),this.wasPaused=!1,this._videoEnded=!0,this.dispatch({type:this.EVENT.PLAYBACK.COMPLETED,player:t.player,isError:t.isError,video:t.video});try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}t.isError||APP.notifyPostMessageListeners('{"state":"complete","video":"'+(t.video.objectId||t.video.festivalId)+'"}');break;case"playback_pause":this.stalledActionTimer&&(clearTimeout(this.stalledActionTimer),this.stalledActionTimer=0),"tizentv"==APP.appImplementationModule.type&&"live"!=this.pingPOST.streamType&&APP.appImplementationModule._doTTSactionWithTimecode("paused at",t.player.currentTime()),this.dispatch({type:this.EVENT.PLAYBACK.PAUSE,player:t.player,video:t.video});try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}["live","replay"].includes(this.pingPOST.streamType)||this.storeCurrentVideoState(t.video.objectId,parseInt(t.player.currentTime()),!0),APP.notifyPostMessageListeners('{"state":"pause","video":"'+(t.video.objectId||t.video.festivalId)+'"}');break;case"playback_resume":try{this.COMSCORE_V&&this.COMSCORE_V.playVideoContentPart(this.COMSCORE_V_METADATA,this.COMSCORE_V_CONTENTTYPE)}catch(t){e.warn("ComScore API not loaded")}["live","replay"].includes(this.pingPOST.streamType)||this.storeCurrentVideoState(t.video.objectId,parseInt(t.player.currentTime()),!0),this.dispatch({type:this.EVENT.PLAYBACK.RESUME,player:t.player,video:t.video}),APP.notifyPostMessageListeners('{"state":"play"}');break;case"playback_timeupdate":let r=t.duration,l=t.elapsed;this.pingbacks.debounce=l,this.wasPaused&&(this.onPingBackAction.bind(this)("event","resume"),this.wasPaused=!1,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.RESUME,player:t.player,video:t.currentVideoObj})),s.pingPOST.streamType||(s.pingPOST.streamType="live"==t.video.streamType?"live":"recorded"),this.stalledTime&&(this.stalledActionTimer&&(clearTimeout(this.stalledActionTimer),this.stalledActionTimer=0),this.pingPOST.bufferingTime=(new Date).getTime()-this.stalledTime,this.stalledTime=0),s.pingPOST.duration=1e3*r,s.pingPOST.timeOffset=l,s.pingPOST.elapsed++,r&&!isNaN(r)&&(p=r!==1/0?l/r:1,quartile=Math.ceil(parseInt(100*p,10)),100==quartile&&this.pingbacks.quartiles.start&&this.pingbacks.quartiles.start.length&&(quartile=0),this.pingPOST.elapsed>
10&&(quartile<25||r===1/0)?quartileName="start":quartile>25&&quartile<50?quartileName="firstQuartile":quartile>50&&quartile<75?quartileName="midpoint":quartile>75&&quartile<100&&(quartileName="thirdQuartile"),this.onPingBackAction.bind(s)("quartiles",quartileName),this.onPingBackAction.bind(s)("elapsed",s.pingPOST.elapsed),this.pingbacks&&Object.keys(this.pingbacks.frequency||{}).filter((e=>s.pingPOST.elapsed%e==0)).forEach((e=>this.onPingBackAction.bind(this)("frequency",e)))),["live","replay"].includes(this.pingPOST.streamType)?"livexlivesite"==CONFIG.client&&this.currentVideoObj&&!this.currentVideoObj.preview&&(this.currentVideoObj.source="lxl",this.storeCurrentVideoState(this.currentVideoObj.seoName,0)):r-l<10?this.storeCurrentVideoState(t.video.objectId,null,!0):this.storeCurrentVideoState(t.video.objectId,l),this.dispatch({type:this.EVENT.PLAYBACK.TIMEUPDATE,player:t.player,video:t.video,data:{duration:s.pingPOST.duration,offset:s.pingPOST.timeOffset,elapsed:s.pingPOST.elapsed}});try{if(!document.querySelector(".ticketHolderData")){let e=APP.herostreamaction.videoplayer.currentPlayerObj,t=document.createElement("div"),i=document.createElement("p");t.appendChild(i),t.className="ticketHolderData",i.innerHTML=this.pingPOST.requestId,e.parentElement.insertBefore(t,e)}}catch(t){}break;case"playback_durationchange":this.dispatch({type:this.EVENT.PLAYBACK.DURATIONCHANGE,player:t.player,video:t.video});break;case"playback_error":this.dispatch({type:this.EVENT.PLAYBACK.ERROR,player:t.player,error:t.error,video:t.video}),APP.notifyPostMessageListeners('{"state":"error","video":"'+(t.video.objectId||t.video.festivalId)+'"}');break;case"playback_mute":this.dispatch({type:this.EVENT.PLAYBACK.MUTE,player:t.player}),APP.notifyPostMessageListeners('{"state":"mute"}');break;case"playback_unmute":this.dispatch({type:this.EVENT.PLAYBACK.UNMUTE,player:t.player}),APP.notifyPostMessageListeners('{"state":"unmute"}');break;case"playback_waiting-stalled":this.dispatch({type:this.EVENT.PLAYBACK.WAITING,which:t.which,player:t.player}),e.warn("AbstractPlayer::Wait-Stall type - "+t.which),this.stalledTime||"waiting"!=t.which||this.wasPaused||this._videoAdStarted||(this.stalledTime=a,this.pingPOST.startTime&&(this.onPingBackAction.bind(this)("event","stall"),this.stalledActionTimer=setTimeout((function(){s._videoAdStarted||!s.player||document.hidden||document.webkitHidden||("live"===s.pingPOST.streamType||"live"===s.currentVideoObj.streamType?(e.warn("AbstractPlayer::Live stream reconnecting after stalled too long."),s.needsRestartOnResume=!0,s.reconnectToStream()):s.wasPaused||s._videoAdStarted||(e.warn("AbstractPlayer::Normal stream appears dead."),s.dispatch({type:s.EVENT.PLAYBACK.ERROR,player:t.player,error:"Unknown error with content"}),s.stop(!0)))}),this.LIVE_STALL_RECONNECT_TIMEOUT)));break;case"onVideoContainerReady":this.dispatch({type:this.EVENT.VIDEOCONTAINERREADY,video:t.video});break;case"onAdNetworkContainerReady":this.dispatch({type:this.EVENT.ADNETWORKCONTAINERREADY,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"onAdNetworkLoading":this.dispatch({type:this.EVENT.ADNETWORKLOADING,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"onAdNetworkReady":this.player=t.player,t.player?this.dispatch({type:this.EVENT.ADNETWORKREADY,adNetworkID:t.adNetworkID||this.adNetworkId,wrapper:t.wrapper}):this.dispatch({type:this.EVENT.EMBEDFAILURE,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"ad_playback_requested":this.isRequestingAds=!0,this.dispatch({type:t.type,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"ad_playback_started":BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"start",label:t.video.objectId}}),this.dispatch({type:this.EVENT.VIDEOADSTARTED,trigger:this.currentAdTrigger,video:t.video}),this._videoStarted&&this.onPingBackAction("event","pause");var n,o=null;try{o=new String(Math.round(1e3*this.player.ima.controller.adUi.adPlayheadTracker.duration))}catch(t){}finally{isNaN(o)&&(o="0")}try{this.COMSCORE_V&&(n="live"==this.currentVideoObj.subTypes[0]?ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearLive:"preroll"==this.currentAdTrigger?ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearOnDemandPreRoll:ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearOnDemandMidRoll,this.COMSCORE_V.playVideoAdvertisement({ns_st_cl:o},n))}catch(t){e.warn("ComScore API not loaded")}this.isRequestingAds=!1,this._videoAdStarted=!0,this._wasPlayingVideoAd=!0;break;case"ad_playback_ping":break;case"ad_playback_no_ad":"skipped"!=t.reason&&!this.isReconnectStart&&this.imaOptions.adTagUrl&&BEACON.tagEvent({name:this.currentAdTrigger,params:{value:t.reason,label:t.video.objectId,reason:t.reason}}),this.SCTEStatus&&(e.warn("videoAd - onVideoPlayerEvent(ad_playback_no_ad) SCTE break active. Kill break status on no ad respose."),this.SCTEStatus=null),this.dispatch({type:this.EVENT.NOVIDEOAD,payload:t.payload,reason:t.reason});break;case"ad_playback_completed":e.warn("videoAd - onVideoPlayerEvent(ad_playback_completed) received"),BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"complete",label:t.video.objectId}}),this.dispatch({type:this.EVENT.VIDEOADENDED,trigger:this.currentAdTrigger,video:t.video});try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}this._videoAdStarted=!1,!this.SCTEStatus&&i.isMobileDevice()&&i.isSafari()?(e.warn("iOS Safari after pre-roll bad state catch (recieved ad_end). Force complete reconnect to stream."),this.reconnectToStream(!0)):this._videoStarted&&this.onPingBackAction("event","resume");break;case"bad_ad":e.warn("videoAd - Bad Ad Detected");break;case"ad_potentially_stuck_or_bad":e.warn("videoAd - Potentially bad ad...will continue to check");break;case"ad_clicked":e.warn("videoAd - onVideoPlayerEvent(ad_click) received"),this.dispatch({type:this.EVENT.ADACTION,action:"click",payload:t.payload})}}},registerPackage("com.slacker.player.AbstractPlayer"),com.slacker.player.AbstractPlayer=a}()})),bjork("com.slacker.player.SamsungVR",(function(){!function(){var e=require("com.slacker.util.Console"),t=require("com.slacker.player.AbstractPlayer"),i=require("com.slacker.util.browser.Browser");function s(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties(),this.__constructor(e,i)}s.prototype={__constants:function(){},__properties:function(){this.type="samsungvr",this.isApiReady=!1,this.isAdPlaying=!1,this.ssvrContainerObj=null,this.isPlaying=!1,this.isSamsungVRCapableDevice=!1,this.ssVideoId,this.postMessageDomain,this.postMessageWindow},__constructor:function(e,t){this.size[t],this.apiLoaded(!0),(i.uaCheck("SM-G8")||i.uaCheck("SM-G9"))&&(this.isSamsungVRCapableDevice=!0),this.samsungVRMessageListener=this.onSamsungEventMessage.bind(this)},embed:function(e,t,i){(function(){this.initPingbackData(this.type),$(e).addClass("video-js").parent().addClass("external-embed").addClass("loading");var i=document.createElement("iframe");i.id="ssvr-"+(new Date).getTime(),i.height="100%;",i.width="100%;",$(i).attr("allowfullscreen",!0),t.autoplay&&$(i).attr("allow","autoplay"),e.appendChild(i),this.ssvrContainerObj=i,this.currentContainer=e,this.currentVideoObj=t,this.__play(t.contentUrl,t.mimeType)}).bind(this)()},restart:function(e){try{this.player&&(this.pause(),this.cleanUp())}catch(e){}finally{this.embed(e,this.currentVideoObj)}},stop:function(t){e.warn(["SamsungVR.stop::","hard stop","bIsError",t]),this.isPlaying&&(this.pause(),this.onPingBackAction.bind(this)("event","stop"),this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.COMPLETED,player:null,isError:t,video:this.currentVideoObj})),this.cleanUp()},cleanUp:function(){if(this.player){this.player.isFullscreen_&&APP.appImplementationModule.onVideoFullScreenRequest&&APP.appImplementationModule.onVideoFullScreenRequest(this.player);
1var e=$(this.currentContainer);e.removeClass("video-js"),e.empty(),this.currentContainer=null,this.player=null,this.isPlaying=!1,this.currentPlayerObj=null,window.removeEventListener("message",this.samsungVRMessageListener,!1)}},parseSSVRUrl:function(e){var t={videoId:null},i=e.match(/^.*(watch\/)([^#\&\?]*).*/);return i&&i[2].length>5&&(t.videoId=i[2]),t},__play:function(t,i){var s=[];t.indexOf("video/videos")>-1||t.indexOf("/video/posts/")>-1?this.unwrapContentUrl(t,function(e,t){this.__play(e,t)}.bind(this)):(this.pingPOST.requestId||this._processPingbacks(this.currentVideoObj),this.onVideoPlayerEvent({type:this.EVENT.VIDEOCONTAINERREADY}),this.currentVideoObj.playOnLoad&&(this.currentVideoObj.playOnLoad=!1),this.ssVideoId=this.parseSSVRUrl(t).videoId,this.playbackEventStartTime=(new Date).getTime(),e.debug(["Video:: Requesting video: ",t,i]),this.pingPOST.mimeType=i,this.errorNumber=null,(this.currentVideoObj.autoplay||this.currentVideoObj.playOnLoad)&&s.push("autoplay=true"),this.startOffset&&s.push("st="+this.startOffset),this.player=this.ssvrContainerObj,this.ssvrContainerObj.src=t+"?"+s.join("&"),this.postMessageWindow=this.ssvrContainerObj.contentWindow,this.postMessageDomain=t.split("/watch")[0],window.addEventListener("message",this.samsungVRMessageListener,!1),this.currentVideoObj.defaultFullScreen&&APP.appImplementationModule.onVideoFullScreenRequest&&APP.appImplementationModule.onVideoFullScreenRequest(this.player))},mute:function(){},unmute:function(){},setVolume:function(e){},resume:function(){this.wasPaused&&this.player&&this.__sendSamsungVRMessage("samsungvr_message_play")},pause:function(){try{!this.wasPaused&&this.player&&this.__sendSamsungVRMessage("samsungvr_message_pause")}catch(t){e.error("Unable to pause SamsungVR player ",t)}},getPlayerTime:function(){return 0},seekTo:function(e){},__sendSamsungVRMessage:function(t){var i=[this.ssVideoId,t];e.info(["Sending SamsungVR Message",i.join(":"),this.postMessageDomain]),this.postMessageWindow.postMessage(i.join(":"),this.postMessageDomain)},apiLoaded:function(e){},onLocalEventHandler:function(t){e.warn("SamsungVR::"+t.type+"::"+(t.adNetworkID||this.adNetworkId))},onSamsungEventMessage:function(t){var i=this;t.data&&"string"==typeof t.data&&-1==t.data.indexOf("samsungvr_")||(e.debug("SS VR Message Handler: "+t.data),t&&"samsungvr_message_ended"===t.data&&(e.debug(t.data+" received"),i.isPlaying&&!i.isAdPlaying&&(i.onPingBackAction.bind(i)("event","end"),i.onPingBackAction.bind(i)("quartiles","complete"),i.isPlaying=!1,i.onVideoPlayerEvent({type:i.EVENT.PLAYBACK.COMPLETED,player:i.player,video:i.currentVideoObj}),i._processPingbacks(i.currentVideoObj,!0),this.player&&this.cleanUp(),$(".external-embed").removeClass("external-embed"))),t&&"samsungvr_message_playing"===t.data&&(e.debug(t.data+" received"),i.isPlaying||i.wasPaused||i.onVideoPlayerEvent({type:i.EVENT.PLAYBACK.STARTED,player:i.player,video:i.currentVideoObj}),i.isAdPlaying=!1,i.isPlaying=!0,$(".external-embed").removeClass("loading"),i.wasPaused&&(i.onPingBackAction.bind(i)("event","resume"),i.wasPaused=!1,i.onVideoPlayerEvent({type:i.EVENT.PLAYBACK.RESUME,player:i.player,video:i.currentVideoObj}))),t&&"samsungvr_message_paused"===t.data&&(e.debug(t.data+" received"),i.wasPaused||(i.onPingBackAction.bind(i)("event","pause"),i.wasPaused=!0,i.onVideoPlayerEvent({type:i.EVENT.PLAYBACK.PAUSE,player:i.player,video:i.currentVideoObj}))),t&&"samsungvr_message_video_ready"===t.data&&($(i.currentContainer).addClass("video-js").parent().addClass("detail-video-player"),i.onVideoPlayerEvent({type:i.EVENT.PLAYBACK.DURATIONCHANGE,player:i.player,video:i.currentVideoObj})))}},registerPackage("com.slacker.player.SamsungVR"),com.slacker.player.SamsungVR=s}()})),bjork("com.slacker.player.VideoJS",(function(){!function(){const e=require("com.slacker.util.Console"),t=require("com.slacker.player.AbstractPlayer"),i=require("com.slacker.util.browser.Browser"),s=require("com.slacker.sads.SAds");function a(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties(),this.__constructor(e,i)}a.prototype={__constants:function(){},__properties:function(){this.type="video.js",this._unwrappedUrl=null,this.availableQualities=[],this.castSessionListener=this.__sessionContextListener.bind(this),this.remoteEventListener=this.__remotePlayerEvents.bind(this)},__constructor:function(e,t){this.size[t],this.attachEvent(this.EVENT.VIDEOADENDED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.NOVIDEOAD,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.COMPLETED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.ERROR,this.onLocalEventHandler.bind(this))}
1,embed:function(t,s,a,n){if(!t||!t.parentNode)return e.error(["VideoJS embed failed: Invalid container DOM element",t]),void this.__sendAbstractPlayerEvent(this.EVENT.ONEMBEDFAILURE,{reason:"Invalid container DOM"});const o=this,r=(new Date).getTime(),l=$(t);let c,d,u=a||this.currentContainer&&this.currentContainer==t.id;if(this.currentVideoObj=s,l.addClass("video-js"),!this._unwrappedUrl&&s.contentUrl.indexOf("/video")>-1&&s.contentUrl.indexOf("/content")>-1)return this.initPingbackData(this.type),void this.unwrapContentUrl(s.contentUrl,function(e,i){this._unwrappedUrl={src:e,type:i},this.currentVideoObj.mimeType=i,this.embed(t,this.currentVideoObj,a,!0)}.bind(this));n||(this._unwrappedUrl=null),!s.mimeType&&s.contentUrl.indexOf(".m3u8")>-1&&(i.isMobileDevice()?s.mimeType="application/vnd.apple.mpegurl":(i.isTV(),s.mimeType="application/x-mpegURL")),this.retryData&&this.retryData?.isRetry||(this.retryData={containerDom:t,contentUrl:s.contentUrl,type:s.mimeType},this.COMSCORE_V=new ns_.ReducedRequirementsStreamingAnalytics({publisherId:CONFIG.beaconConfig.comscore})),this.defaultFullScreen=s.defaultFullScreen,s.overrideNative?(this.overrideNative=!0,s.canRetryNonNative=!1):this.overrideNative=!1,void 0!==s.canRetryNonNative?this.canRetryNonNative=s.canRetryNonNative:this.canRetryNonNative=!0,s.autoPlay?this.pingPOST.autoplay=s.autoPlay:this.pingPOST.autoplay=!1,n||this.initPingbackData(this.type);try{d=cast.framework.CastContext.getInstance().getCurrentSession()}catch(e){}if(u&&this.player&&!d)e.info("VideoJS:: Requesting re-use of current container "+["",t,s.contentUrl,s.mimeType].join("\n - ")),this.isMobileStartupHack=!1,this.retryData=null,o.__play(s.contentUrl,s.mimeType,null,u);else{if(e.info("VideoJS:: Create new player "+["",t,s.contentUrl,s.mimeType].join("\n - ")),this.currentPlayerObj=document.createElement("video"),this.currentPlayerObj.id="videojs_player",this.currentPlayerObj.setAttribute("class","video-js vjs-default-skin"),this.currentPlayerObj.setAttribute("controls",""),this.currentPlayerObj.setAttribute("playsinline",""),this.currentPlayerObj.setAttribute("preload","auto"),this.currentPlayerObj.setAttribute("width",o.size[0]||"100%"),this.currentPlayerObj.setAttribute("height",o.size[1]||"100%"),this._unwrappedUrl?this.currentPlayerObj.src=this._unwrappedUrl.src:this.currentPlayerObj.src=this.BLANK_MP3,0==s.defaultVolume&&(this.wasMuted=!0,this.currentPlayerObj.setAttribute("muted","")),s.autoPlay&&this.currentPlayerObj.setAttribute("autoplay",""),this.currentPlayerObj.id=r,this.containerID=this.currentPlayerObj.id,t.appendChild(this.currentPlayerObj),"in-place"==s.type&&l.append('<button aria-hidden="true" alt="Close" class="defaultX" onclick="event.stopPropagation(); APP.currentView.detailPlayer.stop()"><svg role="presentation" viewbox="0 0 40 40"><path d="M 10,10 L 30,30 M 30,10 L 10,30" fill="black" stroke-width="4"/></svg></button>'),0==s.defaultVolume&&$(t).addClass("muted"),t.id||t.setAttribute("id",r),this.currentContainer=t.id,!s.preview&&d&&d.getSessionState()===cast.framework.SessionState.SESSION_STARTED)return void this.__castNow(!0);try{this.isMobileStartupHack=!1,this.overrideNative&&e.warn("VideoJS:: OVERRIDING NATIVE HLS HANDLING"),c={html5:{nativeControlsForTouch:"tv"!=APP.implementationSuperType()&&i.isSafari()&&!s.video_startup,hls:{enableLowInitialPlaylist:!0,smoothQualityChange:!0,useCueTags:!0,overrideNative:this.overrideNative,nativeAudioTracks:!this.overrideNative,nativeVideoTracks:!this.overrideNative,withCredentials:!0}},techOrder:["html5"],autoplay:!i.isIOS()||"slackerios"==APP.embedCampaign(),bigPlayButton:!0,controlBar:{liveDisplay:!0},poster:s.posterImgUrl||null,textTrackSettings:!0,persistTextTrackSettings:!0},"tv"==APP.implementationSuperType()&&(c.html5.nativeTextTracks=!1),Object.keys(e.levels).filter((t=>e.levels[t]===e.logLevel)).forEach((e=>{videojs.log.level(e)})),videojs(this.currentPlayerObj,c,(function(){let t,i;e.info("VideoJS:: Player embed success"),o.player=this,void 0!==s.defaultVolume&&this.volume(s.defaultVolume),o._unwrappedUrl?(t=o._unwrappedUrl.src,i=o._unwrappedUrl.type):(t=s.contentUrl,i=s.mimeType),"undefined"!=typeof playerjs&&new playerjs.VideoJSAdapter(this).ready(),o.__play(t,i,null,u)}))}catch(e){this.__sendAbstractPlayerEvent(this.EVENT.ONEMBEDFAILURE,{reason:e.message})}}},restart:function(){this.currentPlayerObj?(e.warn(["VideoJS.restart::","restart current video",this.currentPlayerObj.src]),this.currentVideoObj.autoPlay=!0):e.warn(["VideoJS.restart::","restart called without a current video"]),this.embed(this.currentContainer,this.currentVideoObj,!0)},stop:function(t){e.warn(["VideoJS.stop::","hard stop","bIsError",t]);let i=!this.currentVideoObj?.preview;if(this.needsRestartOnResume||(this.wasPaused=!1,this.onPingBackAction("event","stop")),this.player&&(this.needsRestartOnResume||this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.COMPLETED,{isError:t}),this.cleanUp(this.needsRestartOnResume)),this.needsRestartOnResume=!1,i)try{cast.framework.CastContext.getInstance().getCurrentSession().endSession(!0)}catch(t){e.warn(["VideoJS::VIDEO::stop","Unable to end cast session"],t)}},cleanUp:function(t){if(this.player){this.player.isFullscreen_&&this.__sendAbstractPlayerEvent(this.EVENT.ONFULLSCREENTOGGLE);try{"function"==typeof this.player.isInPictureInPicture&&this.player.isInPictureInPicture()&&this.player.exitPictureInPicture().catch((()=>{}))}catch(t){e.warn("VideoJS::cleanUp - exitPictureInPicture failed",t)}if(this.currentVideoObj&&"function"==typeof this.currentVideoObj.isPlaying&&this.currentVideoObj.isPlaying(!1),this.currentVideoObj=null,this?.player?.tech?.().off("usage"),this?.player?.dispose?.(),this.player=null,this.currentContainer){const e=$(`#${this.currentContainer}`);e.removeClass("video-js"),e.empty(),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle")}this.currentContainer=null,this.currentPlayerObj=null,this.isMobileStartupHack=!1,this._videoAdStarted=!1,t||(this.retryData=null,this.castData=null)}},reconnectToStream:function(t){e.warn(["Reconnecting to stream after interrupt"]);var i=$("#"+this.currentContainer)[0],s=this.currentVideoObj,a=!!this.player&&this.player.muted();this.stalledActionTimer&&clearTimeout(this.stalledActionTimer),s&&s.noReconnect?this.stop():(this.needsRestartOnResume||(this.needsRestartOnResume=t),this.stop(),(!t||t&&"preroll"!=this.currentAdTrigger)&&this.onPingBackAction("event","stop"),this._unwrappedUrl=null,s.disablePreroll=!0,s.preview||(a?s.defaultVolume=0:APP.SERVICE.isCached("v")?s.defaultVolume=APP.SERVICE.isCached("v"):delete s.defaultVolume),this.cleanUp(!0),this.isReconnectStart=!0,this.embed(i,s))},__createQualitySelectorUi:function(){const e=this;$(".vjs-fullscreen-control").before('<div class="quality_setting vjs-menu-button vjs-menu-button-popup vjs-control vjs-button">\n\t\t\t\t\t\t\t<button class="vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-l
1ive="polite" aria-disabled="false" title="Quality" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t\t\t\t<span aria-hidden="true" class="vjs-icon-cog"></span>\n\t\t\t\t\t\t\t<span class="vjs-control-text">Quality</span></button>\n\t\t\t\t\t\t\t<div class="vjs-menu"><ul class="quality_ul vjs-menu-content" role="menu"></ul></div></div>'),$("body").on("mouseover",".vjs-control-bar .quality_setting",(function(){const t=e.player.qualityLevels();$(".quality_setting .vjs-menu").show(),"dev"==APP_ENV&&($(".quality_ul li span.current").removeClass("current"),$(`.quality_ul li[data-streamid='${t.levels_[t.selectedIndex].label}'] span`).addClass("current"))})),$("body").on("mouseout",".vjs-control-bar .quality_setting",(()=>$(".quality_setting .vjs-menu").hide())),$("body").on("click",".quality_ul li",(function(){const t=$(".quality_ul li"),i=$(this);let s=i.attr("data-bitrate"),a=i.attr("data-streamid"),n=e.player.qualityLevels();t.removeClass("vjs-selected"),t.prop("aria-checked","false"),i.addClass("vjs-selected"),i.prop("aria-checked","true"),$(".quality_setting .vjs-menu").hide(),n.levels_.forEach((e=>{e.enabled="auto"===s||(a?e.id.toString()===a:e.height.toString()===s)}))}))},__setQualitySelector:function(e){const t=$(".quality_ul");e=e||this.player.qualityLevels(),this.availableQualities=[],"web"!==APP.implementationSuperType()||i.isMobileDevice()||(t.length?t.empty():this.__createQualitySelectorUi.bind(this)()),e.levels_.forEach((e=>{"dev"==APP_ENV?null!=e.height&&this.availableQualities.push(e):null!=e.height&&-1===$.inArray(e.height,this.availableQualities)&&this.availableQualities.push(e.height)})),this.availableQualities.sort(((e,t)=>{const i=parseInt(e.height||e),s=parseInt(t.height||t);return i>s?-1:i<s?1:0}));let s=0,a='<li class="vjs-menu-item" tabindex="__IDX__" role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false" __STREAMID__>\n\t\t\t\t\t\t\t<span class="vjs-menu-item-text" title="__TITLE__">__DISPLAY__</span>\n\t\t\t\t\t\t</li>';$.each(this.availableQualities,(function(e,t){"dev"==APP_ENV?$(".quality_ul").append(a.replace("__IDX__",e).replace("__STREAMID__",`data-streamid="${t.id}"`).replace("__TITLE__",t.id).replace("__DISPLAY__",`${t.bitrate} - ${t.height}p`)):$(".quality_ul").append(a.replace("__IDX__",e).replace("__STREAMID__",`data-bitrate="${t}"`).replace("__TITLE__",t).replace("__DISPLAY__",`${t}p`)),s=e})),$(".quality_ul").append(a.replace("__IDX__",s+1).replace("__STREAMID__",'data-bitrate="auto"').replace("__TITLE__","Auto").replace("__DISPLAY__","Auto"))},__setupCast:function(t){let i=5e3;if(window.castAvailable)this.__createCastUi(),e.info(["player.VideoJS::__setupCast","Cast framework is available"]);else{if(!function(){const e=navigator.userAgent.toLowerCase();return e.includes("chrome")||e.includes("chromium")}())return void e.info(["player.VideoJS::__setupCast","Chrome Cast not supported in this browser"]);window.castRetryTimer?e.info(["player.VideoJS::__setupCast","Cast retry timer already set"]):window.castRetryTimer=setInterval((()=>{e.info(["player.VideoJS::__setupCast","Cast availability retry check"]),window.castAvailable?(e.info(["player.VideoJS::__setupCast","Cast framework is available"]),clearInterval(window.castRetryTimer),window.castRetryTimer=null,this.__createCastUi()):(i=Math.min(2*i,6e4),clearInterval(window.castRetryTimer),window.castRetryTimer=setInterval(this.__setupCast.bind(this,t),i),e.info(["player.VideoJS::__setupCast",`Retrying in ${i/1e3} seconds`]))}),i)}},__initializeCastApi:function(e){let t=cast.framework.CastContext.getInstance();t&&t.getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE||(cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:"E44FC04D",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),t=cast.framework.CastContext.getInstance()),t?.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.castSessionListener)},__sessionContextListener:function(e){let t=cast.framework.CastContext.getInstance().getCurrentSession();switch(e.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.__castNow();break;case cast.framework.SessionState.SESSION_RESUMED:break;case cast.framework.SessionState.SESSION_ENDED:$(".casting").removeClass("casting");const e=cast.framework.CastContext.getInstance();if(this.castPlayer&&this.castPlayer.castController&&this.castPlayer.castController.removeEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.remoteEventListener),e.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.castSessionListener),t.getMediaSession()){this.pingPOST.playerTech="video.js";const e=this.castData?.currentVideoObj;let t=$(`#${this.castData.currentContainer}`),i=this.castData.castCurrentTime;t.empty(),this.cleanUp(!0),e&&("live"!==e.streamType?e?.castEnded?this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.COMPLETED):(this.embed(t[0],e),setTimeout((()=>{this.seekTo(i)}),1e3)):setTimeout((()=>{this.embed(t[0],e)}),1e3))}this.castData=null;case cast.framework.SessionState.SESSION_START_FAILED:}},__createCastUi:function(e){if(i.isMobileDevice()||this.currentVideoObj.preview)return;if($(".cast_settings").length)return;$(".vjs-fullscreen-control").before('<button class="cast_settings vjs-menu-button vjs-menu-button-popup vjs-button" type="button" aria-l
1ive="polite" aria-disabled="false" title="Cast" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t<google-cast-launcher></google-cast-launcher>\n\t\t\t\t\t\t\t\t<span class="vjs-control-text">Cast</span></button>\n\t\t\t\t\t\t\t\t<div class="vjs-menu">'),this.__initializeCastApi.bind(this)()},__castNow:function(e){this.currentVideoObj.bypassVideoJs=e,this.castPlayer={},this.unwrapContentUrl(this.currentVideoObj.contentUrl,function(e,t){this._unwrappedUrl={src:e,type:t},this.currentVideoObj.mimeType=t,this.__castContent(e,t)}.bind(this))},__castContent:function(e,t){const i=cast.framework.CastContext.getInstance().getCurrentSession(),a=this.currentVideoObj,n=APP.USER.slackerUser();let o=!!n?.policy?.capabilities&&n.policy.capabilities.features.ad_free.enabled,r=this?.player?.cache_?.currentTime,l=new chrome.cast.media.MediaInfo(e,t);if(l.metadata=new chrome.cast.media.GenericMediaMetadata,l.metadata.metadataType=chrome.cast.media.MetadataType.GENERIC,l.metadata.title=this.currentVideoObj.title,l.metadata.subtitle=this.currentVideoObj.subtitle,!a.disableAds){l.breakClips=[],l.breaks=[];let e={chromecast:!0,isEmbedPlayer:!1,bIsLive:"live"===this.pingPOST.streamType,breakLen:this.SCTEStatus?this.SCTEStatus.breakLength:0,video:this.currentVideoObj};if(!a.disablePreroll&&s.isVideoAdElegible()){const t=new chrome.cast.media.BreakClip(generateUniqueID());t.vastAdsRequest=new chrome.cast.media.VastAdsRequest,t.vastAdsRequest.adTagUrl=s.getDFPVideoRequestUrl("preroll",e),t.duration=30,l.breakClips.push(t),l.breaks.push(new chrome.cast.media.Break(generateUniqueID(),[t.id],0))}o||(a.playedRemoteBreaks={})}let c=new chrome.cast.media.LoadRequest(l),d=i.getCastDevice();i.loadMedia(c).then((()=>{this.pingbacks.debounce=0;let e=this.currentContainer;this.pingPOST.playerTech="chromecast";const t=$(`#${e}`);t.find("div").remove(),t.addClass("casting"),this.castData={currentContainer:e,currentVideoObj:this.currentVideoObj},this.cleanUp(!0),this.player={type:"chromecast",volume:()=>0,duration:()=>0,src:()=>""},this.currentVideoObj=this.castData.currentVideoObj,this.currentContainer=e;let i=$("<div>").html(d?.friendlyName).html();t.append(`\n\t\t\t\t\t<div class="cast-display-container">\n\t\t\t\t\t\t<h1>Casting to: <span>${i}</span></h1>\n\t\t\t\t\t\t<div class="cast-container-btn">\n\t\t\t\t\t\t\t<google-cast-launcher></google-cast-launcher>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>`),this.castPlayer.castPlayer=new cast.framework.RemotePlayer,this.castPlayer.castController=new cast.framework.RemotePlayerController(this.castPlayer.castPlayer),void 0!==r&&(this.castPlayer.castPlayer.currentTime=r,this.castPlayer.castController.seek()),APP.slackerPlayerSession()?.radioPlayer?.castPlayer?.castController&&APP.slackerPlayerSession()?.radioPlayer?.castPlayer?.castPlayer&&APP.slackerPlayerSession().radioPlayer.castPlayer.castController.removeEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,APP.slackerPlayerSession()?.radioPlayer?.remoteEventListener),this.castPlayer.castController.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.remoteEventListener)}),(function(e){}))},__remotePlayerEvents(t){const i=cast.framework.CastContext.getInstance().getCurrentSession();let s=null;if(!i)return;let a=i.getMediaSession();if(a?.media){this.castData||(this.castData={}),s=null!==a.media.duration?a.media.duration:0;let i=0;if("currentTime"==t.field&&(i=t.value,this.castData.castCurrentTime=parseInt(i),e.debug(["VideoJS::VIDEO::__remotePlayerEvents","currentTime",i]),this.player&&(this.player.volume=()=>a?.volume?.level||0,this.player.duration=()=>a?.media?.duration||0,i>1&&this.pingbacks.debounce!=parseInt(i)&&(-1===s&&(s=1/0),this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.TIMEUPDATE,{elapsed:parseInt(i),duration:s})),this?.currentVideoObj?.adBreaks?.length))){let t=this.currentVideoObj.adBreaks[0];1e3*i>=t.offset&&(e.debug(["VideoJS::VIDEO::__remotePlayerEvents","removing remote ad break from local player",t.offset]),t=this.currentVideoObj.adBreaks.shift(),this.currentVideoObj.playedRemoteBreaks[t.offset]=t)}}else{cast.framework.CastContext.getInstance().getSessionState()===cast.framework.SessionState.SESSION_STARTED&&"mediaInfo"===t.field&&null===t.value&&(this.currentVideoObj.castEnded=!0,"live"!==this.currentVideoObj.streamType?this?.currentVideoObj?.castEnded&&this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.COMPLETED):setTimeout((()=>{this.embed(container[0],this.castData.currentVideoObj)}),1e3))}},__hookVideoJsPlayerEvents:function(t){console.log("__hookVideoJsPlayerEvents");const a=this;e.warn(["Video.__hookVideoJsPlayerEvents"]),t.on("play",(function(){a.startOffset&&(a.seekTo(a.startOffset),a.startOffset=0,a.onPingBackAction.bind(a)("quartiles","start")),i.isIOS()&&(a.player.controlBar.volumePanel.show(),a.player.controlBar.volumePanel.muteToggle.show())})),t.on("loadedmetadata",(function(){e.info("VideoJS - Loaded Metada");const t=a.player,i=a.currentVideoObj;let s=APP.SERVICE.isCached("cc_state");i.preview||(a.__setQualitySelector.bind(a)(),a.__setupCast.bind(a)(),t.hasCaptionTrack=!1,i.captionUrls&&APP.supportsClosedCaptions&&i.captionUrls.forEac
1h(((i,a)=>{if(i.href&&i.language&&i.label){!s&&APP.appImplementationModule.isCCEnabled&&(APP.SERVICE.cache("cc_state",i.language),s=i.language);try{const a={kind:"captions",src:i.href,srclang:i.language,label:i.label,default:s&&i.language&&i.language==s};a.default&&(a.mode="showing"),t.addRemoteTextTrack(a,!1).addEventListener("load",(i=>{if(e.info(["VideoJS:: Caption track loaded",i.target.srclang,i.target.src]),!t.hasCaptionTrack){t.hasCaptionTrack=!0,t.controlBar.subsCapsButton.show();const e=APP.appImplementationModule;e._handleControlerKeyInput&&t.textTrackSettings.on("keydown",(t=>{e._handleControlerKeyInput.bind(e)(t)}))}}))}catch(t){e.error(["Failed to add Caption file",i.href],t)}}}))),$('button[class^="vjs-"]').each((function(){$(this).attr("tabindex",APP.getTabIndexByName("videoplayer"))}))})),t.on("loadeddata",(function(){parseInt(this.currentTime())})),t.on("ended",(function(){a._wasPlayingVideoAd||a.isRequestingAds||a.storeCurrentVideoState(a.currentVideoObj.objectId,null,!0),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.COMPLETED,player:a.player,video:a.currentVideoObj}),a._wasPlayingVideoAd||a.isRequestingAds||a._processPingbacks(a.currentVideoObj,!0)})),t.on("pause",(function(){a.player.ads&&"function"==typeof a.player.ads.isInAdMode&&a.player.ads.isInAdMode()||(a.onPingBackAction.bind(a)("event","pause"),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.PAUSE,player:a.player,video:a.currentVideoObj}),a.wasPaused=!0)})),t.on("volumechange",(function(){var e=a.player.volume();!a.wasMuted&&a.player.muted()?(a.wasMuted=!0,$("#"+a.currentContainer).addClass("muted"),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.MUTE,player:a.player,video:a.currentVideoObj})):e>0&&($("#"+a.currentContainer).removeClass("muted"),a.wasMuted&&(a.wasMuted=!1,a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.UNMUTE,player:a.player,video:a.currentVideoObj})),a.lastVolumeBeforeMute=e,APP.SERVICE.cache("v",e),APP.notifyPostMessageListeners('{"volume":"'+100*e+'"}'))})),t.on("error",(function(e){a.needsRestartOnResume?a.reconnectToStream():(setTimeout((function(){a._videoAdStarted&&a.player&&"function"!=typeof a.player.ima&&a.player.ima.pauseAd()}),200),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.ERROR,error:a.player.error_,player:a.player,video:a.currentVideoObj}))})),t.on("stalled",(function(e){a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.WAITING,which:"stalled",player:a.player})})),t.on("fullscreenchange",(function(){a.onVideoPlayerEvent({type:a.EVENT.ONFULLSCREENCHANGE,player:
1a.player})})),t.on("waiting",(function(){this.addClass("vjs-waiting"),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.WAITING,which:"waiting",player:a.player})})),t.on("durationchange",(function(){const e=a.currentVideoObj;if(a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.DURATIONCHANGE,player:a.player,video:e}),e?.adBreaks?.length){const t=this.duration(),i=$(`#${this.el_.id} .vjs-progress-control.vjs-control .vjs-progress-holder`)[0];i&&($(".vjs-ad-cue-marker").remove(),e.adBreaks.forEach(((e,s)=>{let a=document.createElement("div");a.className="vjs-ad-cue-marker",a.id=`break-${e.offset}`,a.style.left=e.offset/1e3/t*100+"%",i.appendChild(a)})))}})),t.on("timeupdate",(function(){if(a._videoAdStarted||a.isRequestingAds||this.paused())return;if(this._unwrappedUrl&&(this._unwrappedUrl=null),a.needsRestartOnResume)return void a.reconnectToStream();const t=this.currentTime(),i=parseInt(1e3*t),n=parseInt(t),o=this.duration();if(a.pingPOST.startTime||(a.pingPOST.startTime=(new Date).getTime(),a.pingPOST.startLatency=a.pingPOST.startTime-a.playbackEventStartTime),t>1&&a.pingbacks&&a.pingbacks.debounce!=n&&(this.removeClass("vjs-waiting"),a.playPromiseDetection&&(e.debug("VideoJS:: Clearing playPromise detection."),clearTimeout(a.playPromiseDetection),a.playPromiseDetection=0),o!==1/0&&"live"===a.currentVideoObj.streamType&&($(this.el_).addClass("vjs-live"),this.controlBar.liveDisplay.show()),a.player&&a.player.qualityLevels()&&a.player.qualityLevels().levels_&&a.player.qualityLevels().levels_[a.player.qualityLevels().selectedIndex_]&&(a.pingPOST.bitrate=a.player.qualityLevels().levels_[a.player.qualityLevels().selectedIndex_].bitrate),a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.TIMEUPDATE,elapsed:n,duration:o,player:a.player,video:a.currentVideoObj})),"live"!=a.pingPOST.streamType&&a?.currentVideoObj?.adBreaks?.length){let t=a.currentVideoObj.adBreaks.shift();t&&i>=t.offset?(e.info(["VOD MIDROLL hit marked break","break data:",t.offset,t.duration]),s.lastVideoAdTime=0,s.isVideoAdElegible()&&(e.warn(["VOD MIDROLL BREAK","player elapsed:",i,"break data:",t.offset,t.duration]),a.SCTEStatus={markerEnd:0,diff:0,localEnd:now+t.duration,breakLength:t.duration},i-t.offset>300&&(e.warn(["VOD MIDROLL BREAK","player seeked past break:",i," Set player to break pos",t.offset]),this.currentTime(t.offset/1e3)),$(`.vjs-ad-cue-marker#break-${t.offset}`).remove(),a.connectSads("midroll"))):t&&a.currentVideoObj.adBreaks.unshift(t)}})),t.tech().on("usage",(t=>{if(e.warn(`VideoJS::VHS HLS ${t.name}`),"retryplaylist"===t.name)a.onVideoPlayerEvent({type:a.EVENT.PLAYBACK.WAITING,which:"waiting",player:a.player})})),t.on("contentupdate",(function(){e.debug("VideoAd content is ready");const t=a.currentVideoObj;a.onVideoPlayerEvent({type:a.EVENT.ADNETWORKLOADING,video:t}),"preroll"==a.currentAdTrigger&&(t.disablePreroll||t.disableAds)?(a.player.ads.skipLinearAdMode(),$(".ima-ad-container").hide()):setTimeout((function(){!a._videoAdStarted&&a.player&&a.player.play()}),200)})),t.on("readyforpreroll",(function(){e.debug("VideoAd readyforpreroll");const t=a.currentVideoObj;!com.slacker.sads.SAds.isVideoAdElegible()||t.disableAds||"preroll"==a.currentAdTrigger&&t.disablePreroll||"midroll"==a.currentAdTrigger&&t.disableMidroll?this.ads.skipLinearAdMode():this.ima.playAdBreak()})),t.on("adstart",(function(){e.debug("adstart"),a.isRequestingAds=!1,a.playPromiseDetection&&(e.debug("VideoJS:: Clearing playPromise detection."),clearTimeout(a.playPromiseDetection),a.playPromiseDetection=0),$(`#${a.containerID}_ima-ad-container`).css({width:"100%",height:"100%"}),$(`#${a.containerID}_ima-ad-container > div`).css({width:"100%",height:"100%"}),$(`#${a.containerID}_ima-ad-container video`).css({left:0,width:"100%",height:"100%"}),$(`#${a.containerID}_ima-ad-container iframe`).css({width:"100%",height:"100%"}),s.lastVideoAdTime=(new Date).getTime();const t=this.ima;if(!this.ima.isBound){this.ima.isBound=!0;const i=google.ima.AdEvent.Type,s=[i.STARTED,i.COMPLETE,i.ALL_ADS_COMPLETED,i.CLICK],n=function(o){switch(o.type){case i.STARTED:try{const i=t.podInfo=this.getCurrentAd().getAdPodInfo();e.warn(`VideoJS::adstart::ima.controller Playing Ad type:${a.currentAdTrigger} ${i.getAdPosition()} of ${i.getTotalAds()}`)}catch(t){e.warn(`VideoJS::adstart::ima.controller Playing Ad type:${a.currentAdTrigger}`)}break;case i.CLICK:return e.warn("VideoJS::adstart::ima.controller ad click"),setTimeout((()=>a.player.ima.controller.resumeAd()),100);case i.COMPLETE:break;case i.ALL_ADS_COMPLETED:s.forEach((e=>this.removeEventListener(e,n))),t.isBound=!1}}.bind(this.ima.controller.getAdsManager());
1s.forEach((e=>this.ima.addEventListener(e,n)))}a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.STARTED,video:a.currentVideoObj})})),t.on("adend",(function(){e.debug("adend"),$(".ima-ad-container").hide(),a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.COMPLETED,video:a.currentVideoObj})})),t.on("adskip",(function(){e.debug("adskip"),a.isRequestingAds=!1,a.needsRestartOnResume="preroll"!=a.currentAdTrigger&&("live"===a.pingPOST.streamType||"live"===a.currentVideoObj.streamType),a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.NOAD,video:a.currentVideoObj,reason:"skipped"})})),t.on("adtimeout",(function(){e.debug("adtimeout"),a.isRequestingAds=!1,a.needsRestartOnResume="preroll"!=a.currentAdTrigger&&("live"===a.pingPOST.streamType||"live"===a.currentVideoObj.streamType),a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.NOAD,video:a.currentVideoObj,reason:"timeout"})})),t.on("adserror",(function(t){let i=t.error?t.error.j:t.data.AdError.l;e.debug("adserror: "+i),a.isRequestingAds=!1,a.needsRestartOnResume="preroll"!=a.currentAdTrigger&&("live"===a.pingPOST.streamType||"live"===a.currentVideoObj.streamType),a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.NOAD,video:a.currentVideoObj,reason:i})})),t.on("adsloadererror",(function(t){e.debug("adsloadererror: "+t.error.j);var i=!t.error.j||t.error.j.indexOf("empty")>-1;a.isRequestingAds=!1,a.needsRestartOnResume="preroll"!=a.currentAdTrigger&&("live"===a.pingPOST.streamType||"live"===a.currentVideoObj.streamType),a.onVideoPlayerEvent({type:a.EVENT.AD.PLAYBACK.NOAD,payload:{isEmpty:i},reason:t.error.j,video:a.currentVideoObj})})),t.on("adclicked",(function(t){e.debug("adclicked: "+t.target),a.player.ads.endLinearAdMode(),a.onVideoPlayerEvent({type:a.EVENT.AD.CLICKED,payload:t,video:a.currentVideoObj})}));const n=APP.appImplementationModule;n._handleControlerKeyInput&&Object.keys(t.controlBar).forEach((e=>{"function"==typeof t.controlBar[e].on&&t.controlBar[e].on("keydown",(e=>{n._handleControlerKeyInput.bind(n)(e)}))}))},__sendAbstractPlayerEvent(t,i={}){let s=this?.castData?.currentVideoObj||this.currentVideoObj;s?this.onVideoPlayerEvent({type:t,player:this.player,video:Object.assign({},s),...i}):e.warn(["VideoJS::VIDEO::__sendAbstractPlayerEvent",t,"Called without current video"])},__play:function(t,a,n,o){const r=this,l=(new Date).getTime();if(!this.player)return e.warn("VideoJS:: Video player not loaded."),-1;if(this.pingPOST.mimeType=a,this.__sendAbstractPlayerEvent(r.EVENT.VIDEOCONTAINERREADY),this.player.eventsHooked||(this.player.eventsHooked=!0,this.__hookVideoJsPlayerEvents(this.player)),t.indexOf("/video")>-1&&t.indexOf("/content")>-1)this.unwrapContentUrl(t,((e,t)=>this.__play(e,t,n,o)));else{this.pingPOST.requestId||r._processPingbacks(r.currentVideoObj),this.playbackEventStartTime=l,e.debug(["VideoJS:: Requesting video: ",t,a]);try{this.player&&"function"==typeof this.player.loop&&this.player.loop(!!this.currentVideoObj.loop)}catch(t){e.warn("VideoJS:: Unable to set loop property:",t)}if(this.player.src({src:t,type:a}),this.connectSads("preroll"),this.player.textTracks().on("addtrack",(t=>{const i=t.track;"captions"!==i.kind||i.src||r.player.textTracks().removeTrack(i),"hidden"===i.mode&&"captions"!==i.kind&&(e.info(["VideoJS:: Cue track loaded",i.label,"cues:",i.cues&&i.cues.cues_?i.cues.cues_.length:0]),i.addEventListener("cuechange",(t=>{i.activeCues.cues_.forEach((t=>{const a=(new Date).getTime();"ad-cues"==i.label&&t.adStartTime?t.adStartTime&&(this.SCTEStatus?(e.info(["VideoJS:: SCTE marker recieved - !Currently in Break!","cue length:",t.text,"local start offset:",t.adStartTime,"local end offset:",t.adEndTime]),Number(t.adEndTime)<this.SCTEStatus.markerEnd&&(this.SCTEStatus.diff=1e3*(Number(t.adEndTime)-this.SCTEStatus.markerEnd),this.SCTEStatus.markerEnd=Number(t.adEndTime),this.SCTEStatus.localEnd+this.SCTEStatus.diff>=a?(this.SCTEStatus=null,this._videoAdStarted&&(e.warn(["VideoJS:: SCTE BREAK TRUNCATED. ABORT CURRENT AD."]),this.ads.endLinearAdMode())):(this.SCTEStatus.localEnd=this.SCTEStatus.localEnd+this.SCTEStatus.diff,this.SCTEStatus.breakLength=this.SCTEStatus.localEnd-a))):(s.lastVideoAdTime=0,s.isVideoAdElegible()&&(e.info(["VideoJS:: SCTE marker recieved - !Start new Break! - ","cue length:",t.text,"local start offset:",t.adStartTime,"local end offset:",t.adEndTime]),this.SCTEStatus={markerEnd:Number(t.adEndTime),diff:0,breakLength:1e3*Number(t.text)},this.SCTEStatus.localEnd=a+this.SCTEStatus.breakLength,this.connectSads("midroll")))):this.SCTEStatus&&Number(t.startTime)>=this.SCTEStatus.markerEnd&&(this.SCTEStatus=null,this._videoAdStarted&&(e.warn(["VideoJS:: SCTE BREAK TRUNCATED. ABORT CURRENT AD."]),this.ads.endLinearAdMode()))}))})))})),!o&&APP.appImplementationModule.onVideoFullScreenRequest){const e=$(`#${this.currentContainer} .vjs-fullscreen-control`),t=e.clone();e.replaceWith(t),t.on("click",(()=>{const e=(new Date).getTime();this.fullScreenRequestTstamp||(this.fullScreenRequestTstamp=0),e-this.fullScreenRequestTstamp>999&&(this.fullScreenRequestTstamp=e,this.__sendAbstractPlayerEvent(this.EVENT.ONFULLSCREENTOGGLE))})),this.defaultFullScreen&&t.click()}
1this.playPromiseDetection=setTimeout((function(){if(r.player){r.player.changingSrc_=!1;const t=r.player.play();void 0!==t&&t.then((()=>{e.info("VideoJS:: Play Promise success!")})).catch((t=>{e.info("VideoJS:: Play Promise FAILED!"),(i.isSafari()||i.isFirefox())&&r.dispatch({type:r.EVENT.AUTOPLAY_DISABLED})}))}}),2e4)}},mute:function(){this.lastVolumeBeforeMute=this.player.volume(),this.player.muted(!0)},unmute:function(){this.player.muted()&&(this.player.muted(!1),this.setVolume(this.lastVolumeBeforeMute||50),this.lastVolumeBeforeMute=null)},setVolume:function(e){e>1&&(e/=100),this.player.muted()&&this.player.muted(!1),this.player.volume(e),APP.SERVICE.cache("v",e),APP.notifyPostMessageListeners('{"volume":"'+100*e+'"}')},resume:function(){this.player&&this.player.paused()&&this.player.play()},pause:function(){try{this.player&&!this.player.paused()&&this.player.pause()}catch(t){e.error("Unable to pause VideoJS player ",t)}},getPlayerTime:function(){return this.player&&"chromecast"===this.player.type?this.castData&&this.castData.castCurrentTime?this.castData.castCurrentTime:0:this.player.currentTime()},seekTo:function(e){this.player.currentTime(e),this.wasPaused=this.player.paused()},connectSads:function(t,i,a){if(!this.currentVideoObj||this.currentVideoObj.disableAds)return;(new Date).getTime();const n=this.currentVideoObj,o="embedded"===APP.appImplementationModule.type,r="lxlsite"===APP.embedCampaign();let l=!0,c=Object.assign({},this.imaOptions);if(this.currentAdTrigger=t,"undefined"==typeof google)"function"==typeof this.player.ads&&this.player.ads();else{if(e.debug("VideoJS:: Connecting Google IMA SDK for ads."),c.id=this.containerID,c.vpaidMode="web"===APP.implementationSuperType()?"ENABLED":"DISABLED",t&&"preroll"!=t?"midroll"==t&&(l=!n.disableMidroll):(l=!n.disablePreroll,this.pingPOST.autoplay&&(c.adWillAutoPlay=!0)),c.adWillPlayMuted=0==this.player.volume(),e.debug("VideoJS:: Connecting Google IMA SDK for ads."),l){c.adsResponse=null;try{"function"==typeof this.player.ima&&(e.warn("VideoJS::connectSads - Initializing IMA SDK."),this.player.ima(c))}catch(t){e.error("VideoJS::connectSads - Failed to initialize IMA SDK.",t)}let a={isEmbedPlayer:o&&!r,bIsLive:"live"===this.pingPOST.streamType,breakLen:this.SCTEStatus?this.SCTEStatus.breakLength:0,video:n,video_startup:n.video_startup||!1};c.adTagUrl=i||s.getDFPVideoRequestUrl(t,a),this.__sendAbstractPlayerEvent(this.EVENT.AD.PLAYBACK.REQUESTED,{trigger:t})}else c.adTagUrl=null,c.adsResponse='<VAST version="3.0"></VAST>';try{this.isReconnectStart||("function"==typeof this.player.ima?(e.warn("VideoJS::connectSads - Initializing IMA SDK."),this.player.ima(c)):(this.player.ima.changeAdTag(c.adTagUrl),this.player.ima.requestAds()))}catch(t){e.error("VideoJS::connectSads - IMA SDK connection failed! ",t),this.isRequestingAds=!1}}},onLocalEventHandler:function(t){switch(e.warn("VideoJS::"+t.type+"::"+(t.adNetworkID||this.adNetworkId)),t.type){case this.EVENT.PLAYBACK.COMPLETED:this.player&&this.player.src()&&this.cleanUp();break;case this.EVENT.PLAYBACK.ERROR:if(t.error){e.warn(["VideoJS error",t.error.code]);var i={};if(t.player)for(var s in t.player)i[s]=t.player[s];switch(t.error.code){case 2:case 3:this.cleanUp(!0),this.dispatch({type:this.EVENT.DISPLAYERROR,player:i,video:t.video});break;case 4:!this.retryData?.isRetry&&this.canRetryNonNative?(e.warn(["Attempt non-native retry once"]),this.retryData||(this.retryData={containerDom:document.getElementById(this.currentContainer),contentUrl:t.video.contentUrl,type:t.video.mimeType}),this.retryData.isRetry=!0,this.overrideNative=!0,this.currentContainer=null,this.cleanUp(!0),this.embed(this.retryData.containerDom,t.video,!0)):(this.cleanUp(!0),this.dispatch({type:this.EVENT.DISPLAYERROR,player:i,video:t.video}))}}break;case this.EVENT.NOVIDEOAD:case this.EVENT.VIDEOADENDED:this.needsRestartOnResume?this.reconnectToStream(!0):this.player&&this.player.play()}}},registerPackage("com.slacker.player.VideoJS"),com.slacker.player.VideoJS=a}()})),bjork("com.slacker.player.YouTube",(function(){!function(){const e=require("com.slacker.util.Console"),t=require("com.slacker.player.AbstractPlayer");function i(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties(),this.__constructor(e,i)}i.prototype={__constants:function(){},__properties:function(){this.isApiReady=!1,this.type="youtube",this.ytContainerObj=null,this.isPlaying=!1,this.ytPlayerOptions={controls:1,modestbranding:1,rel:0,showinfo:0,loop:0}},__constructor:function(e,t){this.size[t],this.loadScript("https://www.youtube.com/iframe_api",this.apiLoaded.bind(this))},loadScript:function(e,t){let i="youtube-iframe-api",s=!!document.getElementById(i);if(s)return;let a=document.createElement("script");a.id=i;let n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n),a.onload=function(){s||(s=!0,t())},a.onreadystatechange=function(){s||"complete"!==this.readyState&&"loaded"!==this.readyState||(s=!0,t())},a.src=e},embed:function(e,t,i){this.initPingbackData(this.type),"undefined"!=typeof YT&&YT.ready((()=>{$(e).addClass("video-js").parent().addClass("external-embed");const i=document.createElement("div");i.id="yt-"+(new Date).getTime(),i.height="100%;",i.width="100%;",e.appendChild(i),this.ytContainerObj=i,this.currentContainer=e,this.currentVideoObj=t,t.autoplay||t.playOnLoad?this.ytPlayerOptions.autoplay=1:this.ytPlayerOptions.autoplay=0,this.__play(t.contentUrl,t.mimeType)}))},restart:function(e){try{this.player&&this.player.stopVideo()}catch(e){}finally{this.embed(e,this.currentVideoObj)}},stop:function(t){e.warn(["YouTube.stop::","hard stop","bIsError",t]),this._setYtPlayerPoller(!0),this.isPlaying&&(this.player.stopVideo(),this.onPingBackAction.bind(this)("event","stop"),this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.COMPLETED,player:null,isError:t,video:this.currentVideoObj})),this.cleanUp()},cleanUp:function(){if(this.player){const e=$(this.currentContainer);e&&(e.removeClass("video-js"),e.empty(),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle")),this.currentContainer=null,this.player=null,this.currentPlayerObj=null}}
1,parseYtUrl:function(e){let t={videoId:null};let i=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);i&&11===i[2].length&&(t.videoId=i[2]);return i=e.match(/[?&]list=([^#\&\?]+)/),i&&i[1]&&(t.listId=i[1]),t},_setYtPlayerPoller:function(e){this._poller&&(clearInterval(this._poller),this._poller=0),e||(this._poller=setInterval(this.__ytPlayerState.bind(this),500))},__ytPlayerState:function(){const e=this;let t;if(this.player.getPlayerState)switch(t=this.player.getPlayerState(),t){case-1:case 0:break;case 1:this.isPlaying=!0;let t=this.player.getCurrentTime(),i=parseInt(t),s=this.player.getDuration();e.pingPOST.startTime||(e.pingPOST.startTime=(new Date).getTime(),e.pingPOST.startLatency=e.pingPOST.startTime-e.playbackEventStartTime),t>1&&e.pingbacks&&e.pingbacks.debounce!=i&&e.onVideoPlayerEvent({type:e.EVENT.PLAYBACK.TIMEUPDATE,elapsed:i,duration:s,player:e.player,video:e.currentVideoObj})}},__play:function(t,i){const s=this;let a;if(!(t.indexOf("video/videos")>-1||t.indexOf("/video/posts/")>-1))return this.pingPOST.requestId||this._processPingbacks(this.currentVideoObj),a=this.parseYtUrl(t),a?(this.playbackEventStartTime=(new Date).getTime(),e.debug(["Video:: Requesting video: ",t,i]),this.pingPOST.mimeType=i,this.errorNumber=null,this.player=new YT.Player(this.ytContainerObj.id,{videoId:a.videoId,playerVars:this.ytPlayerOptions,events:{onReady:function(e){this.onVideoPlayerEvent({type:this.EVENT.VIDEOCONTAINERREADY}),this.currentVideoObj.playOnLoad&&(this.currentVideoObj.playOnLoad=!1)}.bind(this),onPlaybackQualityChange:function(e){this.pingPOST.bitrate=e.data}.bind(this),onPlaybackRateChange:function(){}.bind(this),onStateChange:function(t){let i=t.data;if(i!==this.lastState&&!this.errorNumber)switch(this.lastState=i,e.debug(["YouTube.YT.Player.onStateChange::",i]),i){case-1:this.startOffset&&(this.seekTo(this.startOffset),this.startOffset=0),this._setYtPlayerPoller(),this.currentVideoObj.autoPlay||BEACON.tagEvent({name:"video_start",params:{video_title:this.currentVideoObj?.title,video_url:this.currentVideoObj?.seoName}}),void 0!==this.currentVideoObj.defaultVolume&&this.player&&this.player.setVolume&&this.player.setVolume(100*this.currentVideoObj.defaultVolume),this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.DURATIONCHANGE,player:this.player,video:this.currentVideoObj});break;case YT.PlayerState.ENDED:this.isPlaying&&(this._setYtPlayerPoller(!0),this.onPingBackAction.bind(this)("event","end"),this.onPingBackAction.bind(this)("quartiles","complete"),this.currentVideoObj.loop?this.player.playVideo():(this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.COMPLETED,player:this.player,video:this.currentVideoObj}),this._processPingbacks(this.currentVideoObj,!0)));break;case YT.PlayerState.PLAYING:this._poller||(this._setYtPlayerPoller(),void 0!==this.currentVideoObj.defaultVolume&&this.player&&this.player.setVolume&&this.player.setVolume(100*this.currentVideoObj.defaultVolume)),this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.DURATIONCHANGE,player:this.player,video:this.currentVideoObj}),this.wasPaused&&(this.onPingBackAction.bind(s)("event","resume"),this.wasPaused=!1,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.RESUME,player:this.player,video:this.currentVideoObj}));break;case YT.PlayerState.PAUSED:this.onPingBackAction.bind(this)("event","pause"),this.wasPaused=!0,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.PAUSE,player:this.player,video:this.currentVideoObj});case YT.PlayerState.BUFFERING:}}.bind(this),onVolumeChange:function(e){let t=e.data.volume;e.data.muted?this.wasMuted||(this.wasMuted=!0,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.MUTE,player:this.player,video:this.currentVideoObj})):(this.wasMuted&&(this.wasMuted=!1,this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.UNMUTE,player:this.player,video:this.currentVideoObj})),this.lastVolumeBeforeMute=t,APP.SERVICE.cache("v",t/100))}.bind(this),onError:function(e){this.errorNumber=e.data;let t="Unknown Error";switch(this.errorNumber){case 5:t="Error while trying to play the video";break;case 2:case 100:t="Unable to find the video";break;case 101:case 150:t="Playback on other Websites has been disabled by the video owner."}this.onVideoPlayerEvent({type:this.EVENT.PLAYBACK.ERROR,error:t,player:this.player,video:this.currentVideoObj})}.bind(this)}}),this.player):(e.warn("YouTube:: Video player not loaded."),this.onVideoPlayerEvent({type:this.EVENT.ONEMBEDFAILURE,reason:"Invalid link format"}),-1);this.unwrapContentUrl(t,((e,t)=>
1this.__play(e,t)))},mute:function(){this.lastVolumeBeforeMute=this.player.getVolume(),this.player.mute()},unmute:function(){this.player.unMute(),this.setVolume(this.lastVolumeBeforeMute),this.lastVolumeBeforeMute=null},setVolume:function(e){e<1&&(e*=100);try{this.player.unMute()}catch(e){}this.player.setVolume(e),APP.SERVICE.cache("v",e/100),APP.notifyPostMessageListeners('{"volume":"'+e+'"}')},resume:function(){this.wasPaused&&this.player.playVideo()},pause:function(){try{1==this.player.getPlayerState()&&this.player.pauseVideo()}catch(t){e.error("Unable to pause YouTube player ",t)}},getPlayerTime:function(){return this.player.getCurrentTime()},seekTo:function(e){this.player.seekTo(e)},apiLoaded:function(){this.isApiReady=!0,this.attachEvent(this.EVENT.VIDEOADENDED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.COMPLETED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.ERROR,this.onLocalEventHandler.bind(this))},onLocalEventHandler:function(t){e.warn("YouTube::"+t.type+"::"+(t.adNetworkID||this.adNetworkId))}},registerPackage("com.slacker.player.YouTube"),com.slacker.player.YouTube=i}()})),bjork("com.slacker.player.radio.AbstractPlayer",(function(){!function(){var e=require("com.slacker.util.Console"),t=require("com.slacker.event.EventNotifier"),i=require("com.slacker.util.browser.Browser");function s(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties()}s.prototype={__constants:function(){this.LIVE_STALL_RECONNECT_TIMEOUT=2e4,this.COMSCORE_SHORT_THRESH=1800,this.BLANK_MP3=`${IMG_CDN_AND_BUILD}/helper/1sec.mp3`,this.EVENT={EMBEDSUCCESS:"onEmbedSuccess",EMBEDFAILURE:"onEmbedFailure",DISPLAYERROR:"onDisplayError",ONFULLSCREENTOGGLE:"onFullScreenToggle",ONFULLSCREENCHANGE:"onFullScreenChange",NOCONTENT:"error_no_content_url",ONSEEKDISALLOWED:"seek_disallowed",AUTOPLAY_DISABLED:"autoplay-disabled",VIDEOCONTAINERREADY:"onVideoContainerReady",ADNETWORKCONTAINERREADY:"onAdNetworkContainerReady",ADNETWORKLOADING:"onAdNetworkLoading",ADNETWORKREADY:"onAdNetworkReady",VIDEOADNOTREADY:"onVideoAdNotReady",DBK:"adblock",VIDEOADSTARTED:"onVideoAdStarted",VIDEOADENDED:"onVideoAdEnded",NOVIDEOAD:"onNoVideoAd",ADACTION:"onAdAction",AD:{PLAYBACK:{REQUESTED:"ad_playback_requested",STARTED:"ad_playback_started",COMPLETED:"ad_playback_completed",CLICKED:"ad_clicked",NOAD:"ad_playback_no_ad"}},PLAYBACK:{COMPLETED:"playback_completed",STARTED:"playback_started",PAUSE:"playback_pause",RESUME:"playback_resume",ERROR:"playback_error",DURATIONCHANGE:"playback_durationchange",WAITING:"playback_waiting",TIMEUPDATE:"playback_timeupdate",WAITING:"playback_waiting-stalled",MUTE:"playback_mute",UNMUTE:"playback_unmute"}}},__properties:function(){this.adNetworkId=1,this.size=["100%","100%"],this.hasVideoAdQueued=!1,this.imaOptions={id:null,adLabel:"",disableFlashAds:!0,contribAdsSettings:{timeout:5e3,prerollTimeout:1e4},adTagUrl:""},this.overrideNative=!1,this.noNotifyOnPlayPause=!1,this.canRetryNonNative=!0,this.retryData=null,this.wasPaused=!1,this.needsRestartOnResume=!1,this.currentPlayerObj=null,this.currentTrackObj=null,this.currentContainer=null,this.startOffset=0,this.isMobileStartupHack=!1,this.defaultFullScreen=!1,this.pingbacks=null,this.playbackEventStartTime=0,this.stalledActionTimer=0,this.stalledTime=0,this.isReconnectStart=!1,this.pingPOST={specVersion:"1.3",context:{embeddedOn:null,screen:window.innerWidth+"x"+window.innerHeight},autoplay:!1},this.COMSCORE_V},storeCurrentRadioState:function(e,t){if("live"!==this.pingPOST.streamType||null===t){var i=APP.SERVICE.isCached("radioStates"),s=i?JSON.parse(i):{};try{null===t?delete s[e]:s[e]=t}catch(e){}finally{APP.SERVICE.cache("radioStates",JSON.stringify(s))}}},getLastRadioState:function(e){var t=APP.SERVICE.isCached("radioStates"),i=t?JSON.parse(t):{};return i[e]?i[e]:null},embed:function(e,t,i){},stop:function(e,t){},cleanUp:function(e){},initPingbackData:function(e){this.pingPOST.context.embeddedOn=APP.embedCampaign(),this.pingPOST.playerTech=e,this.pingPOST.requestId=null,this.pingPOST.startTime=null,this.pingPOST.underrunCount=0,this.pingPOST.framesDropped=0,this.isReconnectStart||(this.pingPOST.elapsed=0,this.pingPOST.requestSpanId=null),this.pingPOST.timeOffset=0},unwrapContentUrl:function(t,i){e.info(["AbstractPlayer:: Unwrapping secured content URL: ",t]);var s=this;this.pingPOST.contentUrl=t,APP.NETWORKING.do(t,(function(e,t,a){if(e&&e.href)["contentId","pingbackUrls","playOffset","requestId","mediaUrl","href","streamFormat"].forEach((t=>{e.hasOwnProperty(t)&&(s.currentTrackObj[t]=e[t])})),e.playOffset&&(s.startOffset=s._parsePTtime(e.playOffset)),s._processPingbacks(s.currentTrackObj),e.monetization&&Object.keys(e.monetization).forEac
1h((t=>{s.currentTrackObj[t]=e.monetization[t]})),i(e.href,e.mimeType);else if(401==a.statusCode().status);else{let e="Invalid content URL";a.responseJSON&&a.responseJSON.message&&(e=a.responseJSON.code?a.responseJSON.code:a.responseJSON.message,s.currentTrackObj.messages=[a.responseJSON.message]),s.onRadioPlayerEvent({type:s.EVENT.PLAYBACK.ERROR,error:e,player:s.player,track:s.currentTrackObj})}}),"GET")},_parsePTtime:function(e){var t,i,s,a;return(t=e.match(/PT([\d\.]+?D)?([\d\.]+?H)?([\d\.]+?M)?([\d\.]+?S)?/)).length?(i=t[1]?parseFloat(t[1]):0,s=t[2]?parseFloat(t[2]):0,a=t[3]?parseFloat(t[3]):0,(t[4]?parseFloat(t[4]):0)+60*a+3600*s+3600*i*24):0},_processPingbacks:function(t,i){if(this.pingbacks=null,this.pingbacks={quartiles:{start:["START","ga"],firstQuartile:["ga"],midpoint:["ga"],thirdQuartile:["ga"],complete:["ga"]},event:{},frequency:null},(!i||this.pingPOST.requestId&&t.requestId!=this.pingPOST.requestId)&&(this.pingPOST.requestId=t.requestId,this.pingPOST.contentId=t.contentId||t.fid,this.pingPOST.mediaUrl=t.mediaUrl||t.URL,this.pingPOST.streamFormat=t.streamFormat||t.format,this.pingPOST.streamType="stream"==t.type?"live":"recorded"),this.pingPOST.requestSpanId||(this.pingPOST.requestSpanId=this.pingPOST.requestId),this.pingPOST.bitrate=0,t.quartileTracking)for(var s in t.quartileTracking)if(this.pingbacks.quartiles[s]||(this.pingbacks.quartiles[s]=[]),"object"==typeof t.quartileTracking[s]){var a=t.quartileTracking[s];a.map((e=>({href:e.trim()}))),this.pingbacks.quartiles[s]=this.pingbacks.quartiles[s].concat(a)}else this.pingbacks.quartiles[s].push({href:t.quartileTracking[s].trim()});if(t.impTracking&&(this.pingbacks.event.start=[],t.impTracking.forEach((e=>{let t=e.trim();t&&this.pingbacks.event.start.push({href:t})}))),t.pingbackUrls&&t.pingbackUrls.length){var n,o,r=t.pingbackUrls.length,l=0;for(l=0;l<r;l++)"event"==(n=t.pingbackUrls[l]).type&&(s=n.value,this.pingbacks.event||(this.pingbacks.event={}),this.pingbacks.event[s]||(this.pingbacks.event[s]=[]),e.debug(["AbstractPlayer:: Adding event beacon",s]),this.pingbacks.event[s].push(n)),"elapsed"==n.type&&(s=n.value,o=this._parsePTtime(n.value),this.pingbacks.elapsed||(this.pingbacks.elapsed={}),this.pingbacks.elapsed[o]||(this.pingbacks.elapsed[o]=[]),e.debug(["AbstractPlayer:: Adding elapsed beacon",s]),this.pingbacks.elapsed[o].push(n)),"quartile"==n.type?(s=n.value,this.pingbacks.quartiles||(this.pingbacks.quartiles={}),this.pingbacks.quartiles[s]||(this.pingbacks.quartiles[s]=[]),e.debug(["AbstractPlayer:: Adding quartile beacon",s]),this.pingbacks.quartiles[s].push(n)):"frequency"==n.type&&0==n.value.indexOf("PT")&&(this.pingbacks.frequency||(this.pingbacks.frequency={}),o=this._parsePTtime(n.value),this.pingbacks.frequency[o]||(this.pingbacks.frequency[o]=[]),e.debug(["AbstractPlayer:: Adding frequency beacon",o]),this.pingbacks.frequency[o].push(n));this.currentTrackObj.pingbackUrls||(this.currentTrackObj.pingbackUrls=t.pingbackUrls),this.COMSCORE_V_METADATA={ns_st_ci:this.pingPOST.contentId,ns_st_cl:"0",ns_st_pu:"LXL",ns_st_pr:this.currentTrackObj.title+" "+this.currentTrackObj.subtitle,ns_st_ia:"*null",ns_st_ce:"*null",ns_st_ddt:"*null",ns_st_tdt:"*null",c3:this.currentTrackObj.streamStatus?this.currentTrackObj.streamStatus:this.currentTrackObj.subTypes[0],c4:"*null",c6:"*null"};var c="";"embedded"===APP.appImplementationModule.type||(c=APP.currentView.seoName?APP.currentView.seoName.split("/"):APP.currentView.historyData.seoName.split("/"),APP.history.length>1&&("track"==c[0]||"post"==c[0])&&("channel"!=(c=APP.history[1].historyData.seoName.split("/"))[0]&&"genre"!=c[0]||(this.COMSCORE_V_METADATA.c4=c[0],this.COMSCORE_V_METADATA.c6=c[1],"genre"==c[0]&&(this.COMSCORE_V_METADATA.ns_st_ge=c[1])))),"*null"==this.COMSCORE_V_METADATA.c4&&"live"==this.COMSCORE_V_METADATA.c3&&(this.COMSCORE_V_METADATA.c4="festival")}},__play:function(e,t,i,s){},mute:function(){},unmute:function(){},setVolume:function(e){},onPingBackAction:function(t,s){var a,n,o,r=null,l=this;let c=this.pingPOST;if(this.pingbacks&&this.pingbacks[t]&&this.pingbacks[t][s]&&(r=this.pingbacks[t][s]),r){e.info(["AbstractPlayer:: Firing Pingback Beacon",t,s]);try{"quartiles"==t&&delete this.pingbacks[t][s],r.forEach((d=>
1{if("POST"===d.method){a="elapsed"==t?d.name:"frequency"==t?"foregroundPingback":s;var u=(new Date).getTime(),h="youtube"===l.type?l.player?l.player.getVolume():0:l.player?100*l.player.volume():0,p={sentTime:u,events:[{eventName:a,eventType:"playback",version:c.specVersion,eventNumber:BEACON.count++,data:{requestSpanId:c.requestSpanId,requestId:c.requestId,eventTime:u,playbackState:l.wasPaused?"paused":"playing",volume:"tv"==APP.implementationSuperType()?-1:parseInt(h),muted:"tv"==APP.implementationSuperType()?-1:this.wasMuted?1:0,context:{playerType:c.playerTech,embeddedOn:c.context.embeddedOn,screen:window.innerWidth+"x"+window.innerHeight},delivery:{contentUrl:c.contentUrl,mediaUrl:c.mediaUrl,streamFormat:c.streamFormat,mimeType:c.mimeType,startLatency:c.startLatency,framesDropped:c.framesDropped,currentBitrate:c.bitrate},duration:{startTime:c.startTime,buffering:c.bufferingTime,elapsed:1e3*c.elapsed,offset:1e3*c.timeOffset},metadata:{contentId:c.contentId,streamType:c.streamType,duration:c.duration,autoplay:c.autoplay}}}]};APP.slackerAcct()&&(p.events[0].data.context.slackerAccountId=APP.slackerAcct()),BEACON._doBeaconAction(d.href,p,"POST",BEACON.ingnoreResponseHandler),c.bufferingTime&&(c.bufferingTime=0),d.backoff&&d.backoff.length&&(n=d.backoff[0]).elapsed&&(o=this._parsePTtime(n.elapsed),c.elapsed>=o&&(o=this._parsePTtime(n.frequency),e.warn(["AbstractPlayer: Changing frequency pingback",s,"->",o]),r.value=n.frequency,this.pingbacks[t][o]=r,delete this.pingbacks[t][s],d.backoff.shift()))}else if("quartiles"==t)switch(d){case"ga":let e,t={radio_current_time:this.getPlayerTime(),radio_duration:c.duration||0,radio_percent:isNaN(c.duration)?0:parseInt(1e3*this.getPlayerTime()/c.duration*100),radio_provider:this.currentTrackObj?.songtype,item_title:`${this.currentTrackObj?.title} by ${this.currentTrackObj?.artist}`,radio_url:APP.slackerPlayerSession().currentPlayableItem()?.id,visible:i._visible,radio_bitrate:c.bitrate,user_elapsed:c.elapsed,startLatency:c.startLatency};switch(s){case"start":e="radio_start";break;case"complete":e="radio_complete";break;default:e="radio_progress"}e&&BEACON.tagEvent({name:e,params:t});break;case"START":!this.isReconnectStart||this.isReconnectStart&&this._wasPlayingVideoAd||"live"==c.streamType&&1==c.timeOffset?(this._wasPlayingVideoAd=!1,this.onRadioPlayerEvent({type:this.EVENT.PLAYBACK.STARTED,player:this.player,track:this.currentTrackObj}),this.onPingBackAction.bind(this)("event","start"),this.isReconnectStart&&(this.isReconnectStart=!1)):this.isReconnectStart=!1;break;default:"string"==typeof d&&d.match(/^https?/)&&BEACON._doBeaconUrl(d)}else BEACON._doBeaconUrl(d.href?d.href:d)}))}catch(t){e.error("Error attempting to send ping",t)}"frequency"==t&&(c.framesDropped=0)}else"event"==t&&e.warn(["Unknown pingback",t,s])},onRadioPlayerEvent:function(t){"playback_timeupdate"!==t.type&&e.warn("onRadioPlayerEvent::"+t.type);const s=this;switch(t.type){case"onEmbedFailure":this.dispatch({type:this.EVENT.ONEMBEDFAILURE,adNetworkID:t.adNetworkID||this.adNetworkId,reason:t.reason});break;case"onFullScreenToggle":this.dispatch({type:this.EVENT.ONFULLSCREENTOGGLE,player:t.player});break;case"onFullScreenChange":this.dispatch({type:this.EVENT.ONFULLSCREENCHANGE,player:t.player}),APP.notifyPostMessageListeners('{"state":"fullscreen","value":"'+t.player.isFullscreen_+'"}');break;case"playback_started":this._radioStarted=!0,this.dispatch({type:this.EVENT.PLAYBACK.STARTED,player:t.player,track:t.track});try{this.COMSCORE_V&&(this.COMSCORE_V_METADATA.ns_st_cl="live"===s.pingPOST.streamType?"0":new String(Math.round(s.pingPOST.duration)),this.COMSCORE_V_CONTENTTYPE="live"===s.pingPOST.streamType?ns_.ReducedRequirementsStreamingAnalytics.ContentType.Live:s.pingPOST.duration>this.COMSCORE_SHORT_THRESH?ns_.ReducedRequirementsStreamingAnalytics.ContentType.LongFormOnDemand:ns_.ReducedRequirementsStreamingAnalytics.ContentType.ShortFormOnDemand,this.COMSCORE_V.playVideoContentPart(this.COMSCORE_V_METADATA,this.COMSCORE_V_CONTENTTYPE))}catch(t){e.warn("ComScore API not loaded")}APP.notifyPostMessageListeners('{"state":"start","track":"'+t.track.tid+'"}');break;case"playback_completed":this._videoEnded=!0,!t.isError&&t.track&&t.track.quartileTracking&&t.track.quartileTracking.end&&this.onPingBackAction.bind(s)("quartiles","end"),this.dispatch({type:this.EVENT.PLAYBACK.COMPLETED,player:t.player,isError:t.isError,track:t.track});try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}t.isError||APP.notifyPostMessageListeners('{"state":"complete","video":"'+t.track.tid+'"}');break;case"playback_pause":if(this.stalledActionTimer&&(clearTimeout(this.stalledActionTimer),this.stalledActionTimer=0),this.noNotifyOnPlayPause)this.noNotifyOnPlayPause=!1;else{try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}this.dispatch({type:this.EVENT.PLAYBACK.PAUSE,player:t.player,track:t.track,hasRadioStarted:this.hasRadioStarted}),this.hasRadioStarted&&APP.notifyPostMessageListeners('{"state":"pause","video":"'+t.track.tid+'"}')}break;case"playback_resume":if(this.noNotifyOnPlayPause)this.noNotifyOnPlayPause=!1;else if(this.castPlayer||!t.player.paused()){try{this.COMSCORE_V&&this.COMSCORE_V.playVideoContentPart(this.COMSCORE_V_METADATA,this.COMSCORE_V_CONTENTTYPE)}catch(t){e.warn("ComScore API not loaded")}this.dispatch({type:this.EVENT.PLAYBACK.RESUME,player:t.player,track:t.track}),APP.notifyPostMessageListeners('{"state":"play"}')}break;case"playback_timeupdate":let r=t.duration,l=t.elapsed;if(this.pingbacks.debounce=l,this.wasPaused){if(!this.castPlayer&&t.player.paused())return;this.onPingBackAction.bind(this)("event","resume"),this.wasPaused=!1,this.onRadioPlayerEvent({type:this.EVENT.PLAYBACK.RESUME,player:t.player,track:t.currentTrackObj})}if(s.pingPOST.streamType||(s.pingPOST.streamType="stream"==t.track.type?"live":"recorded"),this.stalledTime&&(this.stalledActionTimer&&(clearTimeout(this.stalledActionTimer),this.stalledActionTimer=0),this.pingPOST.bufferingTime+=(new Date).getTime()-this.stalledTime,this.stalledTime=0),s.pingPOST.duration=1e3*r,s.pingPOST.timeOffset=l,s.pingPOST.elapsed++,r&&!isNaN(r)&&(p=r!==1/0?l/r:1,quartile=Math.ceil(parseInt(100*p,10)),100==quartile&&this.pingbacks.quartiles.start&&this.pingbacks.quartiles.start.length&&(quartile=0),this.pingPOST.elapsed>
10&&(quartile<25||r===1/0)?quartileName="start":quartile>25&&quartile<50?quartileName="firstQuartile":quartile>50&&quartile<75?quartileName="midpoint":quartile>75&&quartile<100&&(quartileName="thirdQuartile"),this.onPingBackAction.bind(s)("quartiles",quartileName),this.onPingBackAction.bind(s)("elapsed",s.pingPOST.elapsed),this.pingbacks&&this.pingbacks.frequency))for(var a in this.pingbacks.frequency)eMod=l%a,0==eMod&&this.onPingBackAction.bind(this)("frequency",a);this.dispatch(Object.assign({type:this.EVENT.PLAYBACK.TIMEUPDATE,atomicTime:s.pingPOST.elapsed},t));break;case"playback_durationchange":this.dispatch({type:this.EVENT.PLAYBACK.DURATIONCHANGE,player:t.player,track:t.track});break;case"playback_error":this.dispatch({type:this.EVENT.PLAYBACK.ERROR,player:t.player,error:t.error,track:t.track}),APP.notifyPostMessageListeners('{"state":"error","video":"'+t.track.tid+'"}');break;case"playback_mute":this.dispatch({type:this.EVENT.PLAYBACK.MUTE,player:t.player}),BEACON.tagEvent({name:"volume",params:{value:"mute",label:this.pingPOST.contentId}}),APP.notifyPostMessageListeners('{"state":"mute"}');break;case"playback_unmute":this.dispatch({type:this.EVENT.PLAYBACK.UNMUTE,player:t.player}),BEACON.tagEvent({name:"volume",params:{value:"unMute",label:this.pingPOST.contentId}}),APP.notifyPostMessageListeners('{"state":"unmute"}');break;case"playback_waiting-stalled":this.dispatch({type:this.EVENT.PLAYBACK.WAITING,which:t.which,player:t.player}),e.warn("AbstractPlayer::Wait-Stall type - "+t.which),this.stalledTime||"waiting"!=t.which||this.wasPaused||this._videoAdStarted||this.pingPOST.startTime&&(this.onPingBackAction.bind(this)("event","stall"),this.pingPOST.elapsed&&(this.stalledTime=(new Date).getTime(),this.pingPOST.underrunCount++));break;case"onVideoContainerReady":this.dispatch({type:this.EVENT.VIDEOCONTAINERREADY});break;case"onAdNetworkContainerReady":this.dispatch({type:this.EVENT.ADNETWORKCONTAINERREADY,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"onAdNetworkLoading":this.dispatch({type:this.EVENT.ADNETWORKLOADING,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"onAdNetworkReady":this.player=t.player,t.player?this.dispatch({type:this.EVENT.ADNETWORKREADY,adNetworkID:t.adNetworkID||this.adNetworkId,wrapper:t.wrapper}):this.dispatch({type:this.EVENT.EMBEDFAILURE,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"ad_playback_requested":this.dispatch({type:t.type,adNetworkID:t.adNetworkID||this.adNetworkId});break;case"ad_playback_started":t.playable?BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"start",label:t.playable.name}}):BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"start",label:t.track.tid}}),this.dispatch({type:this.EVENT.VIDEOADSTARTED,trigger:this.currentAdTrigger,track:t.track,playable:t.playable});var n,o=null;try{o=new String(Math.round(1e3*this.player.ima.controller.adUi.adPlayheadTracker.duration))}catch(t){}finally{isNaN(o)&&(o="0")}try{this.COMSCORE_V&&(n="stream"==this.currentTrackObj.type?ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearLive:"preroll"==this.currentAdTrigger?ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearOnDemandPreRoll:ns_.ReducedRequirementsStreamingAnalytics.AdType.LinearOnDemandMidRoll,this.COMSCORE_V.playVideoAdvertisement({ns_st_cl:o},n))}catch(t){e.warn("ComScore API not loaded")}this._videoAdStarted=!0,this._wasPlayingVideoAd=!0;break;case"ad_playback_ping":break;case"ad_playback_no_ad":"skipped"!=t.reason&&this.imaOptions.adTagUrl&&BEACON.tagEvent({name:this.currentAdTrigger,params:{value:t.reason,label:t.track.tid,reason:t.reason}}),this.dispatch({type:this.EVENT.NOVIDEOAD,payload:t.payload,reason:t.reason});break;case"ad_playback_completed":const c=this.player.currentTime();e.warn("videoAd - onRadioPlayerEvent(ad_playback_completed) received"),t.playable?BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"complete",label:t.playable.name}}):BEACON.tagEvent({name:this.currentAdTrigger,params:{value:"complete",label:t.track.tid}}),this.dispatch({type:this.EVENT.VIDEOADENDED,trigger:this.currentAdTrigger,track:t.track,playable:t.playable});try{this.COMSCORE_V&&this.COMSCORE_V.stop()}catch(t){e.warn("ComScore API not loaded")}if(this._videoAdStarted=!1,this._wasPlayingVideoAd&&this.castingSelected){this._wasPlayingVideoAd=!1;const t=this.castPlayer&&this.castPlayer.nextTrack?this.castPlayer.nextTrack:APP.slackerPlayerSession().currentTrack();e.info(["AbstractPlayer:: Video ad ended while casting selected - handing the track to the cast device"]),t&&this.changeTrack(t,!0)}else i.isMobileDevice()&&i.isSafari()?setTimeout((()=>
1{if(!this.hasRadioStarted||c==this.player.currentTime()){try{this.player.play()}catch(t){e.error("radio:AbstractPlayer::Safari mobile failed to restart player"),this.restart()}setTimeout((()=>{this.hasRadioStarted&&c!=this.player.currentTime()||this.restart()}),5e3)}}),2e3):this.needsRestartOnResume&&this.reconnectToStream(!0);break;case"bad_ad":e.warn("videoAd - Bad Ad Detected");break;case"ad_potentially_stuck_or_bad":e.warn("videoAd - Potentially bad ad...will continue to check");break;case"ad_clicked":e.warn("videoAd - onRadioPlayerEvent(ad_click) received"),this.dispatch({type:this.EVENT.ADACTION,action:"click",payload:t.payload})}}},registerPackage("com.slacker.player.radio.AbstractPlayer"),com.slacker.player.radio.AbstractPlayer=s}()})),bjork("com.slacker.player.radio.VideoJS",(function(){!function(){const e=require("com.slacker.util.Console"),t=require("com.slacker.player.radio.AbstractPlayer"),i=require("com.slacker.util.browser.Browser"),s=require("com.slacker.sads.SAds");function a(e,i){extendClass(this,new t(this)),this.__constants(),this.__properties(),this.__constructor(e,i)}a.prototype={__constants:function(){},__properties:function(){const t=this;this.type="video.js",this.seekability,this.hlsPlaylistRetry={count:0,max:5},this.availableQualities=[],this.castSessionListener=this.__sessionContextListener.bind(this),this.remoteEventListener=this.__remotePlayerEvents.bind(this),this.playerEventHandlers={play:function(){t.startOffset&&(t.seekTo(t.startOffset),t.startOffset=0),(i.isIOS()||i.isMobileDevice())&&(t.player.controlBar.volumePanel.show(),t.player.controlBar.volumePanel.muteToggle.show())},loadedmetadata:function(){e.info("radio.VideoJS - LoadedMetada"),t.__setupCast.bind(t)()},loadeddata:function(){parseInt(this.currentTime())},ended:function(){t.storeCurrentRadioState(t.currentTrackObj.tid,null),t.onPingBackAction.bind(t)("event","end"),t.onPingBackAction.bind(t)("quartiles","complete"),t.wasPaused=!1,t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.COMPLETED)},pause:function(){if(t.player.ads&&"function"==typeof t.player.ads.isInAdMode&&t.player.ads.isInAdMode())return;if(t.player.scrubbing()||t.player.seeking())return void t.player.play();this.currentTime()!=this.duration()?(t.hasRadioStarted&&t.onPingBackAction.bind(t)("event","pause"),t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.PAUSE),i.isIOS()||(t.needsRestartOnResume="live"===t.pingPOST.streamType||"stream"===t.currentTrackObj.stype),t.needsRestartOnResume||(t.wasPaused=!0)):e.info(["VideoJS:: Ignoring internal pause on natural track end."])},volumechange:function(){var e=t.player.volume();!t.wasMuted&&t.player.muted()?(APP.slackerPlayerSession().isCasting&&t.castPlayer&&t.castPlayer.castController&&t.castPlayer.castController.muteOrUnmute(),t.wasMuted=!0,t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.MUTE)):e>0&&(APP.slackerPlayerSession().isCasting&&t.castPlayer&&t.castPlayer.castController&&(t.wasMuted?t.castPlayer.castController.muteOrUnmute():(t.castPlayer.castPlayer.volumeLevel=e,t.castPlayer.castController.setVolumeLevel())),t.wasMuted&&(t.wasMuted=!1,t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.UNMUTE)),t.lastVolumeBeforeMute=e,APP.SERVICE.cache("v",e))},error:function(e){t.needsRestartOnResume?t.reconnectToStream():(setTimeout((function(){t._videoAdStarted&&t.player&&"function"!=typeof t.player.ima&&t.player.ima.pauseAd()}),200),t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.ERROR,{error:t.player.error_}))},stalled:function(e){t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.WAITING,{which:"stalled"})},fullscreenchange:function(){t.__sendAbstractPlayerEvent(t.EVENT.ONFULLSCREENCHANGE)},waiting:function(){t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.WAITING,{which:"waiting"})},durationchange:function(){t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.DURATIONCHANGE)},timeupdate:function(){if(t.hasRadioStarted||(t.hasRadioStarted=!0,"stream"===t.currentTrackObj.type&&t.dispatch({type:t.EVENT.PLAYBACK.STARTED,player:t.player,track:t.currentTrackObj}
1)),t.playPromiseDetection&&(clearTimeout(t.playPromiseDetection),t.playPromiseDetection=0,setTimeout((()=>{t.player&&t.player.muted()&&!t.player.hasStarted_&&t.player.play()}),500)),t._videoAdStarted||!t.player)return;if(t.needsRestartOnResume)return void t.reconnectToStream();const e=this.currentTime(),i=parseInt(e),s=this.duration();t.pingPOST.startTime||(t.pingPOST.startTime=(new Date).getTime(),t.pingPOST.startLatency=t.pingPOST.startTime-t.playbackEventStartTime),e>1&&t.pingbacks&&t.pingbacks.debounce!=i&&(s!==1/0&&"stream"===t.currentTrackObj.type&&($(this.el_).addClass("vjs-live"),this.controlBar.liveDisplay.show()),t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.TIMEUPDATE,{elapsed:i,duration:s}))},"tech:retryplaylist":function(i){const s=parseInt(this.duration()-this.currentTime());let a=t.hlsPlaylistRetry.tRemain!=s;t.hlsPlaylistRetry.count<t.hlsPlaylistRetry.max||a?(t.hlsPlaylistRetry.tRemain=s,e.warn("VideoJS::HLS-CONTRIB hls-retryplaylist retrying "+[t.hlsPlaylistRetry.count++,t.hlsPlaylistRetry.max,t.hlsPlaylistRetry.tRemain,a]),t.__sendAbstractPlayerEvent(t.EVENT.PLAYBACK.WAITING,{which:"waiting"})):(e.warn("VideoJS::HLS-CONTRIB hls-retryplaylist retry count exceeded. Moving on."),this.trigger("ended"))},"tech:vhs-video-underflow":function(){e.warn("VideoJS::HLS-CONTRIB hls-video-underflow"),t.pingPOST.underrunCount++},"tech:vhs-gap-skip":function(){t.pingPOST.framesDropped++,e.warn("VideoJS::HLS-CONTRIB hls-gap-skip")},"tech:vhs-live-resync":function(){e.warn("VideoJS::HLS-CONTRIB hls-live-resync")},"tech:vhs-unknown-waiting":function(){e.warn("VideoJS::HLS-CONTRIB hls-unknown-waiting")},"vhs-error-reload":function(t){e.warn("VideoJS:HLS-CONTRIB: hls-error-reload")},contentupdate:function(){e.debug("VideoAd content is ready"),t.__sendAbstractPlayerEvent(t.EVENT.ADNETWORKLOADING),"preroll"==t.currentAdTrigger&&(t.currentTrackObj.disableVideoPreroll||t.currentTrackObj.disableVideoAds)?(t.player.ads.skipLinearAdMode(),$(".ima-ad-container").hide()):setTimeout((function(){t._videoAdStarted||!t.player||t.castingSelected||t.player.play()}),200)},readyforpreroll:function(){e.debug("VideoAd readyforpreroll"),"preroll"==t.currentAdTrigger&&(t.currentTrackObj.disableVideoPreroll||t.currentTrackObj.disableVideoAds)&&this.ads.skipLinearAdMode()},adstart:function(){e.debug("adstart");const a=t.currentTrackObj;$(`#${t.containerID}_ima-ad-container`).css({width:"100%",height:"100%"}),$(`#${t.containerID}_ima-ad-container > div`).css({width:"100%",height:"100%"}),$(`#${t.containerID}_ima-ad-container video`).css({left:0,width:"100%",height:"100%"}),$(`#${t.containerID}_ima-ad-container iframe`).css({width:"100%",height:"100%"}),s.lastVideoAdTime=(new Date).getTime(),t.needsRestartOnResume="live"===t.pingPOST.streamType||"stream"===a.type,t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.STARTED),i.isMobileDevice()&&i.isSafari()&&(t.badVideoAdRecoveryTimer=setTimeout((()=>{e.error("radio:VideoJS::Video ad in bad state and frozen...kick."),this.ads.endLinearAdMode()}),3e4))},adend:function(){e.debug("adend"),$(".ima-ad-container").hide(),t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.COMPLETED)},adskip:function(){e.debug("adskip"),t.needsRestartOnResume="preroll"!=t.currentAdTrigger&&("live"===t.pingPOST.streamType||"stream"===t.currentTrackObj.type),t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.NOAD,{reason:"skipped"})},adtimeout:function(){e.debug("adtimeout"),t.needsRestartOnResume="preroll"!=t.currentAdTrigger&&("live"===t.pingPOST.streamType||"stream"===t.currentTrackObj.type),t.currentTrackObj.disableVideoPreroll||t.currentTrackObj.disableVideoAds||t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.NOAD,{reason:"timeout"})},adserror:function(i){let s=i.error?i.error.j:i.data.AdError.l;e.debug("adserror: "+s),t.needsRestartOnResume="preroll"!=t.currentAdTrigger&&("live"===t.pingPOST.streamType||"stream"===t.currentTrackObj.stype),t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.NOAD,{reason:s})},adsloadererror:function(i){e.debug("adsloadererror: "+i.error.j);const s=!i.error.j||i.error.j.indexOf("empty")>-1;t.needsRestartOnResume="preroll"!=t.currentAdTrigger&&("live"===t.pingPOST.streamType||"stream"===t.currentTrackObj.stype),t.__sendAbstractPlayerEvent(t.EVENT.AD.PLAYBACK.NOAD,{payload:{isEmpty:s},reason:i.error.j})},adclicked:function(i){e.debug("adclicked: "+i.target),t.player.ads.endLinearAdMode(),t.__sendAbstractPlayerEvent(t.EVENT.AD.CLICKED,{payload:i})},seeked:function(i){if(e.debug(["VideoJS::onSeeked handler","userActive",this.userActive(),"currentTime",this.currentTime()]),this.userActive()&&APP.slackerPlayerSession().isCasting){if(t._suppressCastSeek||t._castAdState||t._castAdHold||!t.castPlayer||!t.castPlayer.castController)return;t.castPlayer.castPlayer.currentTime=this.currentTime(),t.castPlayer.castController.seek()}}}},__constructor:function(e,t){this.size[t],this.attachEvent(this.EVENT.VIDEOADENDED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.NOVIDEOAD,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.COMPLETED,this.onLocalEventHandler.bind(this)),this.attachEvent(this.EVENT.PLAYBACK.ERROR,this.onLocalEventHandler.bind(this))},embed:function(t,s,a){var n=this,o=a||this.currentContainer&&this.currentContainer==t.id;APP.appImplementationModule.type;
1if(s||(s={URL:"",defaultVolume:1,disableVideoAds:!0}),s.contentUrl&&!s.URL)return this.currentTrackObj=s,this.initPingbackData(this.type),void this.unwrapContentUrl(s.contentUrl,((e,i)=>{s.URL=e,s.mimeType=i,this.embed(t,s,a)}));!s.container&&s.URL.indexOf(".m3u8")>-1||"HLS"==s.container?i.isMobileDevice()?s.mimeType="application/vnd.apple.mpegurl":(i.isTV(),s.mimeType="application/x-mpegURL"):s.mimeType="audio/mpeg",s.URL._cdata&&(s.URL=s.URL._cdata),"string"==typeof t&&(t=$(t)[0]),this.retryData&&this.retryData.isRetry||(this.retryData={containerDom:t,contentUrl:s.URL,type:s.mimeType}),s.overrideNative?(this.overrideNative=!0,s.canRetryNonNative=!1):this.overrideNative=!1,void 0!==s.canRetryNonNative?this.canRetryNonNative=s.canRetryNonNative:this.canRetryNonNative=!0,this.pingPOST.autoplay=!1,this.needsRestartOnResume=!1,this.initPingbackData(this.type),this.pingPOST.bufferingTime=0,e.info("radio.VideoJS:: Create new player "+["",t,s.URL,s.mimeType].join("\n - ")),this.currentPlayerObj=$(t).find("video")[0];var r=!1;this.currentPlayerObj||(r=!0,this.currentPlayerObj=document.createElement("video"),this.currentPlayerObj.id="videojs_radio_player",this.currentPlayerObj.setAttribute("controls",""),this.currentPlayerObj.setAttribute("playsinline",""),this.currentPlayerObj.setAttribute("preload","auto"),this.currentPlayerObj.setAttribute("autoplay",""),this.currentPlayerObj.setAttribute("width","100%"),this.currentPlayerObj.setAttribute("height","100%"),this.currentPlayerObj.src=this.BLANK_MP3),0==s.defaultVolume?(this.wasMuted=!0,this.currentPlayerObj.setAttribute("muted","")):s.defaultVolume=APP.SERVICE.isCached("v"),s.defaultVolume||(s.defaultVolume=.5),r&&t.appendChild(this.currentPlayerObj),t.id||t.setAttribute("id",(new Date).getTime()),this.containerID=this.currentPlayerObj.id,this.currentContainer=t.id,this.currentTrackObj=s;try{const t="audiobook"!==s?.type;this.isMobileStartupHack=!1,this.seekability=null,this.overrideNative&&e.warn("VideoJS:: OVERRIDING NATIVE HLS HANDLING"),Object.keys(e.levels).filter((t=>e.levels[t]===e.logLevel)).forEach((e=>{videojs.log.level(e)}));let i=["html5"];videojs(this.currentPlayerObj,{html5:{hls:{enableLowInitialPlaylist:!0,smoothQualityChange:!0,useCueTags:!0,overrideNative:this.overrideNative,nativeAudioTracks:!this.overrideNative,nativeVideoTracks:!this.overrideNative,withCredentials:t}},techOrder:i,autoplay:!0,bigPlayButton:!1,controlBar:{liveDisplay:!0,volumePanel:{inline:!1}},poster:s.albumCoverArt?s.albumCoverArt.host+s.albumCoverArt.path:null},(function(){var t,i;e.info("radio.VideoJS:: Player embed success"),n.player=this,setTimeout((function(){e.debug("MOBILE VOLUME DEBUG: Calling custom volume control with delay"),n.__setupMobileVolumeToggle(),n._initA11yVolume()}),500),n.toggleSeekability(!1),void 0!==s.defaultVolume&&this.volume(s.defaultVolume),"undefined"!=typeof playerjs&&new playerjs.VideoJSAdapter(this).ready(),s.URL?(t=s.URL,i=s.mimeType,n.__play(t,i,null,o)):s&&s.disableVideoAds||n.connectSads("preroll",null,!0)}))}catch(e){this.__sendAbstractPlayerEvent(this.EVENT.ONEMBEDFAILURE,{reason:e.message})}},_initA11yVolume:function(){let e=this.player;const t=e.controlBar?.volumePanel?.muteToggle;if(!t)return;const i=t.el();i.setAttribute("tabindex","22"),i.setAttribute("role","button"),i.setAttribute("aria-label","Mute");const s=()=>i.setAttribute("aria-pressed",String(e.muted()));e.on("volumechange",s),s();const a=()=>{e.controlBar.volumePanel.removeClass("vjs-hover")},n=t=>{const i=t.key,s=e.controlBar.volumePanel.el().className.indexOf("vjs-hover")>=0;if("Enter"!==i&&" "!==i){if(s){if("ArrowUp"===i){t.preventDefault();const i=.05,s=Math.min(1,e.volume()+i);return e.volume(s),void(s>0&&e.muted()&&e.muted(!1))}if("ArrowDown"===i){t.preventDefault();const i=.05,s=Math.max(0,e.volume()-i);return e.volume(s),void(0===s&&e.muted(!0))}}}else{t.preventDefault();const i=e.controlBar.volumePanel.el().className.replace(" vjs-hover","");e.controlBar.volumePanel.el().className=i+(s?"":" vjs-hover")}};t.on("keydown",n),t.on("blur",a),e.on("dispose",(function(){t.removeListener("keydown",n),t.removeListener("keydown",a)}))},toggleSeekability:function(e){var t=this,i=this.player;this.seekability!=e&&(this.seekability=e),i&&(e?(i.controlBar.progressControl.seekBar.on("mousedown",i.controlBar.progressControl.seekBar.handleMouseDown),i.controlBar.progressControl.seekBar.on("mouseup",i.controlBar.progressControl.seekBar.handleMouseUp),i.controlBar.progressControl.seekBar.on("touchstart",i.controlBar.progressControl.seekBar.handleMouseDown),i.controlBar.progressControl.seekBar.on("touchend",i.controlBar.progressControl.seekBar.handleMouseUp),i.controlBar.progressControl.seekBar.off("click"),i.controlBar.progressControl.seekBar.on("click",i.controlBar.progressControl.seekBar.handleClick),i.controlBar.progressControl.on("mousedown",i.controlBar.progressControl.handleMouseDown),i.controlBar.progressControl.on("mouseup",i.controlBar.progressControl.handleMouseUp),i.controlBar.progressControl.on("touchstart",i.controlBar.progressControl.handleMouseDown),i.controlBar.progressControl.on("touchend",i.controlBar.progressControl.handleMouseUp)):(i.controlBar.progressControl.seekBar.off("mousedown"),i.controlBar.progressControl.seekBar.off("mouseup"),i.controlBar.progressControl.seekBar.off("touchstart"),i.controlBar.progressControl.seekBar.off("touchend"),i.controlBar.progressControl.seekBar.off("click"),i.controlBar.progressControl.seekBar.on("click",(function(){t.dispatch({type:t.EVENT.ONSEEKDISALLOWED})})),i.controlBar.progressControl.off("mousedown"),i.controlBar.progressControl.off("mouseup"),i.controlBar.progressControl.off("touchstart"),i.controlBar.progressControl.off("touchend")))},changeTrack:function(e){const t="tizentv"==APP.appImplementationModule.type;let s=1;if(this.castPlayer&&(this.castPlayer.nextTrack=e),void 0===e.href&&(this.initPingbackData(this.type),this._processPingbacks(e)),e?.contentUrl&&!e.URL)return this.currentTrackObj=e,console.log("track.contentUrl -> ",e.contentUrl),void this.unwrapContentUrl(e.contentUrl,((e,t)=>
1{this.currentTrackObj.URL=e,this.currentTrackObj.mimeType=t,this.changeTrack(this.currentTrackObj)}));!e.container&&e.URL.indexOf(".m3u8")>-1||"HLS"==e.container?i.isMobileDevice()?e.mimeType="application/vnd.apple.mpegurl":(i.isTV(),e.mimeType="application/x-mpegURL"):e.mimeType="audio/mpeg",e.URL._cdata&&(e.URL=e.URL._cdata),this.retryData||(this.retryData={}),this.retryData.contentUrl=e.URL,this.retryData.type=e.mimeType,this.currentTrackObj=e,this.pingPOST.bufferingTime=0,this.needsRestartOnResume=!1,t&&(e.disableVideoPreroll=!0,e.disableVideoAds=!0),this.castingSelected?this.__castNow(!1,e):s=this.__play(e.URL,e.mimeType,null,!0),-1==s&&(this.cleanUp(),this.embed($("#radio-player")[0],this.currentTrackObj,!1))},restart:function(){this.currentTrackObj?this.currentPlayerObj?(e.warn(["VideoJS.restart::","restart current track",this.currentPlayerObj.src]),this.currentTrackObj.autoPlay=!1,this.currentTrackObj.disableVideoPreroll=!1,this.__play(this.currentTrackObj.url,this.currentTrackObj.mimeType,null,!0)):this.embed(this.retryData.containerDom,this.currentTrackObj,!0):e.error("Restart attempt with null track object")},stop:function(t=!1,i=!1){e.warn(["VideoJS.stop::","hard stop","bIsError",t]),this.needsRestartOnResume||(this.wasPaused=!1,this.onPingBackAction("event","stop"),i||BEACON.tagEvent({name:"radio",params:{value:"stop",label:t?"error":"stop"}})),this.player&&this.cleanUp()},cleanUp:function(){const e=APP.slackerPlayerSession();this.player&&(this.player.isFullscreen_&&this.__sendAbstractPlayerEvent(this.EVENT.ONFULLSCREENTOGGLE),this.__UNhookVideoJsPlayerEvents(this.player),this.player.dispose(),this.needsRestartOnResume=!1,this.player=null,this.currentPlayerObj=null,this.currentContainer=null,this.isMobileStartupHack=!1,this._videoAdStarted=!1,this.retryData=null),e.isCasting=!1,e.radioPlayer.castingSelected=!1,e.radioPlayer.wasPaused=!1,e.radioPlayer.castingDeviceName="",this.__endCastAd("cleanup",!1),this.__releaseCastAdUI(),this._lastCastMediaSessionId=null,this._castLoadInFlight=null;try{const e=cast.framework.CastContext.getInstance(),t=e.getCurrentSession();"IDLE"!==t.playerState&&t.getMediaSession().stop(new chrome.cast.media.StopRequest),e.getCurrentSession().endSession(!0),e.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.castSessionListener)}catch(e){}},reconnectToStream:function(t){e.warn(["Reconnecting to live stream after interrupt"]);let i=this.currentTrackObj,s=Object.assign({},this.retryData);this.currentPlayerObj.src&&0==this.currentPlayerObj.src.indexOf("http")&&(i.URL||(i.URL=this.currentPlayerObj.src),s.contentUrl||(s.contentUrl=this.currentPlayerObj.src)),this.stop(),this.retryData=s,(!t||t&&"preroll"!=this.currentAdTrigger)&&this.onPingBackAction("event","stop"),i.disableVideoPreroll=!0,this.restart()},__setupMobileVolumeToggle:function(){const t=this;if(e.debug("MOBILE VOLUME DEBUG: Creating custom mobile volume control"),!i.isMobileDevice())return void e.debug("MOBILE VOLUME DEBUG: Not a mobile device, skipping custom volume control");if(!t.player)return void e.error("MOBILE VOLUME DEBUG: Player not available");const s="custom-volume-control-"+(new Date).getTime(),a=document.createElement("div");a.id=s,a.className="custom-mobile-volume-control",a.style.position="absolute",a.style.zIndex="9999",a.style.display="none",a.style.backgroundColor="rgba(43, 51, 63, 0.9)",a.style.border="1px solid rgba(255, 255, 255, 0.2)",a.style.borderRadius="4px",a.style.boxShadow="0 2px 5px rgba(0, 0, 0, 0.3)",a.style.padding="10px",a.style.width="40px",a.style.height="120px";const n=document.createElement("input");n.type="range",n.min="0",n.max="1",n.step="0.1",n.value=t.player.volume(),n.setAttribute("orient","vertical"),n.style.width="24px",n.style.height="100px",n.style.position="absolute",n.style.top="50%",n.style.left="50%",n.style.margin="0",n.style.transform="translate(-50%, -50%)",n.style.WebkitAppearance="slider-vertical",n.style.appearance="slider-vertical",n.style.MozAppearance="slider-vertical",n.style.writingMode="bt-lr",n.style.msWritingMode="bt-lr",n.style.background="transparent",n.style.cursor="pointer",n.addEventListener("input",(function(){e.debug("MOBILE VOLUME DEBUG: Slider value changed to "+this.value),t.player.volume(parseFloat(this.value))})),n.addEventListener("click",(e=>e.stopPropagation())),n.addEventListener("mousedown",(e=>e.stopPropagation())),n.addEventListener("touchstart",(e=>e.stopPropagation())),a.appendChild(n);const o=document.getElementById(t.containerID).parentNode;o.appendChild(a),e.debug("MOBILE VOLUME DEBUG: Added custom volume control to DOM");const r=t.player.controlBar.volumePanel.muteToggle.el();t.player.controlBar.volumePanel.volumeControl&&t.player.controlBar.volumePanel.volumeControl.hide();let l=!1;function c(){try{const t=r.getBoundingClientRect(),i=o.getBoundingClientRect(),s=t.left-i.left+t.width/2,n=i.height-t.top+i.top+1;a.style.left=s+"px",a.style.bottom=n+"px",a.style.transform="translateX(-50%)",e.debug("MOBILE VOLUME DEBUG: Positioned control at left "+s+", bottom "+n)}catch(t){e.error("MOBILE VOLUME DEBUG: Error positioning control",t)}}const d=function(i){return e.debug("MOBILE VOLUME DEBUG: Mute button clicked (capture phase)"),i.stopPropagation(),i.preventDefault(),l?(a.style.display="none",l=!1,e.debug("MOBILE VOLUME DEBUG: Hiding custom volume control")):(n.value=t.player.volume(),c(),a.style.display="block",l=!0,e.debug("MOBILE VOLUME DEBUG: Showing custom volume control")),!1};r.addEventListener("click",d,!0),r.addEventListener("touchstart",d,!0);const u=function(t){l&&t.target!==n&&t.target!==r&&(a.style.display="none",l=!1,e.debug("MOBILE VOLUME DEBUG: Hiding custom volume control (outside click)"))};document.addEventListener("click",u),document.addEventListener("touchstart",u);const h=function(){l&&c()};window.addEventListener("resize",h),t.player.on("dispose",(function(){o.contains(a)&&o.removeChild(a),r.removeEventListener("click",d,!0),r.removeEventListener("touchstart",d,!0),document.removeEventListener("click",u),document.removeEventListener("touchstart",u),window.removeEventListener("resize",h),e.debug("MOBILE VOLUME DEBUG: Cleaned up custom volume control")})),e.debug("MOBILE VOLUME DEBUG: Custom mobile volume control setup completed")},__setupCast:function(t){if(console.log("APP.implementationSuperType() -> ",APP.implementationSuperType()),"tv"==APP.implementationSuperType())return;let i=5e3;if(window.castAvailable)this.currentTrackObj.isLive||this.__createCastUi(),e.info(["radio.VideoJS::__setupCast","Cast framework is available"]);else{if(!function(){const e=navigator.userAgent.toLowerCase();return e.includes("chrome")||e.includes("chromium")}())return void e.info(["radio.VideoJS::__setupCast","Chrome Cast not supported in this browser"]);window.castRetryTimer?e.info(["radio.VideoJS::__setupCast","Cast retry timer already set"]):window.castRetryTimer=setInterval((()=>{e.info(["radio.VideoJS::__setupCast","Cast availability retry check"]),window.castAvailable?(e.info(["radio.VideoJS::__setupCast","Cast framework is available"]),clearInterval(window.castRetryTimer),window.castRetryTimer=null,this.currentTrackObj.isLive||this.__createCastUi(),context=cast.framework.CastContext.getInstance()):(i=Math.min(2*i,6e4),clearInterval(window.castRetryTimer),window.castRetryTimer=setInterval(this.__setupCast.bind(this,t),i),e.info(["radio.VideoJS::__setupCast",`Retrying in ${i/1e3} seconds`]))}),i)}}
1,__createCastUi:function(e){if(i.isMobileDevice())return;const t=APP.slackerPlayerSession(),s=t.currentPlayableItem();t.canShowCastBtn(!0);const a=`<li class="radio-cast-container">\n\t\t\t\t\t\t<google-cast-launcher tabindex="${APP.getTabIndexByName?APP.getTabIndexByName("radioplayer",3):0}" role="button" aria-label="Cast to a device"></google-cast-launcher>\n\t\t\t\t\t</li>`;$(".radio-cast-container").length||($(".shuffle").before(a),$(".radio-cast-container google-cast-launcher").on("keydown",(function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.click())})));APP.implementationSuperType&&"web"===APP.implementationSuperType()||$(".radio-cast-container-mobile").length||$(".bar .tuning").before('<div class="radio-cast-container-mobile">\n\t\t\t\t\t\t\t\t<google-cast-launcher></google-cast-launcher>\n\t\t\t\t\t\t\t</div>'),"station"===s?.type||"podcast"===s?.type?$(".radio-cast-container").css({position:"absolute",right:"15em"}):$(".radio-cast-container").css({position:"absolute",right:"17em"}),e||this.__initializeCastApi.bind(this)()},__initializeCastApi:function(t){let i=cast.framework.CastContext.getInstance();if(!i||i.getCastState()===cast.framework.CastState.NO_DEVICES_AVAILABLE)try{cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:"E44FC04D",autoJoinPolicy:chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),i=cast.framework.CastContext.getInstance()}catch(t){e.error(["VideoJS::__initializeCastApi","Failed to initalize Cast Session"],t)}if(i?.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.castSessionListener),!this._castVisibilitySynced)try{i?.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,(()=>this.__syncCastContainerVisibility())),i&&(this._castVisibilitySynced=!0,this.__syncCastContainerVisibility())}catch(t){e.warn(["VideoJS::__initializeCastApi","cast visibility sync unavailable"],t)}},__syncCastContainerVisibility:function(){if(this._castAdState)return;let e=!0;try{e=cast.framework.CastContext.getInstance().getCastState()!==cast.framework.CastState.NO_DEVICES_AVAILABLE}catch(e){}$(".radio-cast-container")[e?"show":"hide"](),$(".radio-cast-container-mobile")[e?"show":"hide"]()},__sessionContextListener:function(t){e.warn(["VideoJS::__sessionContextListener","Cast Session Event",JSON.stringify(t)]);const i=APP.slackerPlayerSession(),s=i.currentTrack(),a=cast.framework.CastContext.getInstance(),n=a.getCurrentSession(),o=i.currentTrack();switch(trackIsSkippable=!("ad"==s?.type||s?.adtype?.indexOf("dstm")>-1)&&i.radioPlayerStateManager().canSkip(),t.sessionState){case cast.framework.SessionState.SESSION_STARTED:if(e.info(["radio.VideoJS::__sessionContextListener","Cast session has started","| videoAdStarted:",this._videoAdStarted,"| trackIsSkippable:",trackIsSkippable]),this.castingSelected=!0,this.toggleSeekability(!0),"podcast"===i.currentPlayableItem().type)this.unwrapContentUrl(this.currentTrackObj.contentUrl,((e,t)=>{this.__castNow(!0,{URL:e,mimeType:t})}));else if(this._videoAdStarted){e.info(["radio.VideoJS::__sessionContextListener","Cast started mid-ad - resolving the device ad before ending the local one"]);const t={chromecast:!0,isEmbedPlayer:!1,bIsLive:!1,breakLen:0,video:null,audio:this.currentTrackObj},s=this.__buildDeviceAdTag("preroll",t);this.__resolveVastCreative(s,3).then((t=>{if(this.castingSelected&&this._videoAdStarted)if(t){e.info(["radio.VideoJS::__sessionContextListener","Device ad creative ready - moving the ad to the device"]),this._videoAdStarted=!1,this._wasPlayingVideoAd=!1,this._preresolvedCastAd=t,this._forceCastVideoAd=!0,this.__holdCastAdUI(),this._suppressCastSeek=!0,setTimeout((()=>{this._suppressCastSeek=!1}),4e3);try{this.player&&this.player.ads&&"function"==typeof this.player.ads.isInAdMode&&this.player.ads.isInAdMode()&&this.player.ads.endLinearAdMode()}catch(t){e.error(["radio.VideoJS::__sessionContextListener","endLinearAdMode failed"],t)}this.currentTrackObj?this.changeTrack(this.currentTrackObj):i.skipCurrentTrack()}else e.info(["radio.VideoJS::__sessionContextListener","No device ad creative - the local ad f
1inishes, then the cast starts"])}))}else trackIsSkippable?i.skipCurrentTrack():this.currentTrackObj.isLive?this.__castNow(!0,{URL:this.currentTrackObj.URL,mimeType:this.currentTrackObj.mimeType}):(setTimeout((()=>this.player.play()),100),APP.MESSAGING.prompt("delayedCastStart"));break;case cast.framework.SessionState.SESSION_RESUMED:break;case cast.framework.SessionState.SESSION_ENDED:e.info(["radio.VideoJS::__setupCast","Cast session disconnected!"]);const t=i.isCasting,s=this.player&&t;if(i.isCasting=!1,this.castingSelected=!1,this.wasPaused=!1,this.castingDeviceName="",this.__endCastAd("cast-session-ended",!1),this.__releaseCastAdUI(),this._lastCastMediaSessionId=null,this._castLoadInFlight=null,trackIsSkippable=!("ad"==i.currentTrack()?.type||i.currentTrack()?.adtype?.indexOf("dstm")>-1)&&i.radioPlayerStateManager().canSkip(),i._setSessionPlayerStyle(),t&&(this.cleanUp(),this.castPlayer.castController.removeEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.remoteEventListener),a.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,this.castSessionListener)),s&&n.getMediaSession()){this.castPlayer.castCurrentTime;this.toggleSeekability(!0),trackIsSkippable?i.skipCurrentTrack():"stream"==o.type?($("#radio-player").removeClass("dashCast"),i.getNextRadioTrack("","STATIONCHANGE")):i._stopSlackerPlayerServerSession("CastEnd",null,!0)}this.castData=null;case cast.framework.SessionState.SESSION_START_FAILED:}},__castNow:function(e,t){setTimeout((()=>this.__createCastUi(!0)),1e3);const i=cast.framework.CastContext.getInstance().getCurrentSession();this.player.pause(),this.player.autoplay(!1),this.player.src=this.BLANK_MP3,this.castPlayer={type:"chromecast",volume:()=>0,duration:()=>0,src:()=>""},this.player.off("timeupdate",this.playerEventHandlers.timeupdate),this.player.off("ended",this.playerEventHandlers.ended),this.__castContent(i,t,e)},__updateMediaInfo:function(e){const t=APP.slackerPlayerSession();cast.framework.CastContext.getInstance().getCurrentSession(),t.currentTrack();t.isCasting,setTimeout((()=>{this.__createCastUi()}),5e3)},__castContent:function(t,i,a){const n=APP.slackerPlayerSession(),o=com.slacker.app.modules.UrlModule;let r=this.startOffset||this.pingPOST.timeOffset,l=new chrome.cast.media.MediaInfo(i.URL,i.mimeType),c=t.getCastDevice();if(l.metadata=new chrome.cast.media.MusicTrackMediaMetadata,l.textTrackStyle=new chrome.cast.media.TextTrackStyle,l.textTrackStyle.backgroundColor="#00000000",l.textTrackStyle.edgeColor="#00000016",l.textTrackStyle.edgeType="DROP_SHADOW",l.textTrackStyle.fontFamily="CASUAL",l.textTrackStyle.fontScale=1,l.textTrackStyle.foregroundColor="#FFFFFF","podcast"===n.currentPlayableItem().type){l.metadata.title=this.currentTrackObj.title,l.metadata.albumName=this.currentTrackObj.podcastId;let e=this.currentTrackObj.albumCoverArt.host.replace("dev.sd","");l.metadata.images=[new chrome.cast.Image(e)]}else if(this.currentTrackObj.isLive){l.metadata.title=this.currentTrackObj.title,l.metadata.artist=this.currentTrackObj.artist;let e=n.currentPlayableItem().itemImage.replace("dev.sd","");l.metadata.images=[new chrome.cast.Image(e)]}else{const e=(i.albumCoverArt.host+i.albumCoverArt.path).replace("dev.sd",""),t=o.get(o.SERVICE.SLACKER.DATA.IMAGESERVICE,{id:i.artistid,type:"artist",extra:"/top/5,0/800.jpg"}).replace("dev.sd","");l.metadata.songName=i.title,l.metadata.title=i.title,l.metadata.artist=i.artist,l.metadata.albumName=i.album,l.metadata.releaseDate=i.year,l.metadata.images=[new chrome.cast.Image(e),new chrome.cast.Image(t)]}this?.castPlayer?.castController?.playOrPause();let d=new chrome.cast.media.LoadRequest(l);const u=c.capabilities.includes("video_out"),h=!i.disableVideoAds,p=s.isVideoAdElegible(),m=!!this._forceCastVideoAd||this.__forceVideoAdEnabled();this._forceCastVideoAd=!1;let g=null;if(u&&(h||m)&&(p||m)){const t="STATIONCHANGE"==n.nextRadioTrackAction.adTriggerReason||"dstm"==n.nextRadioTrackAction.adTriggerReason?"preroll":"midroll",s={chromecast:!0,isEmbedPlayer:!1,bIsLive:!1,breakLen:0,video:null,audio:i};g=this.__buildDeviceAdTag(t,s),e.info(["radio.VideoJS::__castContent","Device ad w
1anted - resolving VAST on the sender","| forced:",m,"| tag:",g])}this.toggleSeekability(!0),this.castPlayer.isPlaying=!1;const P=!!this._castAdState;this.__endCastAd("superseded",!1),(P||this._castAdHold)&&this.__holdCastAdUI();const y=this._castLoadGen=(this._castLoadGen||0)+1;this._castLoadInFlight=y;(g?this.__buildDeviceAdRequest(d,g,t,y):Promise.resolve(d)).then((i=>{y===this._castLoadGen?t.loadMedia(i).then((()=>{y===this._castLoadGen&&(this._castLoadInFlight===y&&(this._castLoadInFlight=null),this.__releaseCastAdUI(),this.__onDeviceMediaLoaded(t,n,c,r))})).catch((t=>{e.error(["radio.VideoJS::__castContent","Failed to cast media"],t),y===this._castLoadGen&&(this._castLoadInFlight===y&&(this._castLoadInFlight=null),this.__releaseCastAdUI(),this._castAdState&&!this._castAdState.adPlaying&&this.__endCastAd("ad-load-failed",!0))})):e.info(["radio.VideoJS::__castContent","Superseded cast load - skipping loadMedia"])}))},__forceVideoAdEnabled:function(){return!window.FORCE_VIDEO_AD&&window.localStorage&&"true"===localStorage.getItem("FORCE_VIDEO_AD")&&(window.FORCE_VIDEO_AD=!0),!!window.FORCE_VIDEO_AD},__buildDeviceAdTag:function(e,t){let i=s.getDFPVideoRequestUrl(e,t).replace(/^http:/,"https:");return this.__forceVideoAdEnabled()&&(i=i.replace("/home/slacker/chromecast/","/web/livexlive/site/")),i},__onDeviceMediaLoaded:function(t,i,s,a){e.info(["radio.VideoJS::__onDeviceMediaLoaded","Device media loaded"]);const n=new cast.framework.RemotePlayer,o=new cast.framework.RemotePlayerController(n),r=i.currentTrack();this.playbackEventStartTime=(new Date).getTime(),this._suppressCastSeek=!0,setTimeout((()=>{this._suppressCastSeek=!1}),1500),this.player.currentTime(0),this.castingDeviceName=$("<div>").html(s?.friendlyName).html(),i.isCasting=!0,i.isInCastVideoBreak&&i._setSessionPlayerStyle(),n.canControlVolume,$("#radio-player").removeClass("castVolume"),"stream"==r?.type?(i.currentTrack.valueHasMutated(),i._setSessionPlayerStyle(),$("#radio-player").addClass("dashCast")):$("#radio-player").removeClass("dashCast"),this.castPlayer.castPlayer=n,this.castPlayer.castController=o,this.wasPaused=!1,this.castPlayer.paused=e=>("boolean"==typeof e&&(this._paused=e),this._paused),"podcast"===i.currentPlayableItem()?.type&&a>0?this.startOffset=a:this.startOffset=0,this.castPlayer.castController.removeEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.remoteEventListener),this.castPlayer.castController.addEventListener(cast.framework.RemotePlayerEventType.ANY_CHANGE,this.remoteEventListener)},__buildDeviceAdRequest:function(t,i,s,a){const n=this._preresolvedCastAd;return this._preresolvedCastAd=null,(n?Promise.resolve(n):this.__resolveVastCreative(i,3)).then((i=>{if(a!==this._castLoadGen)return t;if(!i)return e.info(["radio.VideoJS::__buildDeviceAdRequest","No playable ad creative (no fill / VAST error) - loading music without an ad"]),t;const n=i.url;e.info(["radio.VideoJS::__buildDeviceAdRequest","Loading device ad alone; music held until it ends","| creative:",n,"| type:",i.type]);const o=new chrome.cast.media.MediaInfo(n,i.type||"video/mp4");o.metadata=new chrome.cast.media.GenericMediaMetadata,o.metadata.metadataType=chrome.cast.media.MetadataType.GENERIC,o.metadata.title="Advertisement",this.__beginCastAd(s,t,n,a);const r=new chrome.cast.media.LoadRequest(o);return r.autoplay=!0,r})).catch((i=>(e.error(["radio.VideoJS::__buildDeviceAdRequest","VAST resolve failed - loading music without an ad"],i),t)))},__beginCastAd:function(t,i,s,a){this.__endCastAd("superseded",!1);const n=APP.slackerPlayerSession(),o="function"==typeof n.currentTrack?n.currentTrack():null;this._castAdState={gen:a,castSession:t,musicRequest:i,adContentId:s,adPlaying:!1,lockedTrack:o,lastType:o?o.type:null,lastSkipVal:o?o.skip:null,timer:null},o&&(o.type="ad",o.skip="no"),n.isInCastVideoBreak=!0,$(".radio-cast-container").hide(),e.info(["radio.VideoJS::__beginCastAd","Device ad lock ON"]),this.__releaseCastAdUI(),this._castAdState.timer=setTimeout((()=>this.__endCastAd("watchdog",!0)),45e3)},__endCastAd:function(t,i){const s=this._castAdState;if(!s)return;this._castAdState=null,s.timer&&clearTimeout(s.timer),s.lockedTrack&&(s.lockedTrack.type=s.lastType,s.lockedTrack.skip=s.lastSkipVal);const a=APP.slackerPlayerSession();a.isInCastVideoBreak=!1,this.__syncCastContainerVisibility(),e.info(["radio.VideoJS::__endCastAd","Device ad lock OFF","| reason:",t]),a._setSessionPlayerStyle(),i&&s.gen===this._castLoadGen&&(e.info(["radio.VideoJS::__endCastAd","Loa
1ding the held music now"]),s.castSession.loadMedia(s.musicRequest).then((()=>{this.__onDeviceMediaLoaded(s.castSession,APP.slackerPlayerSession(),"function"==typeof s.castSession.getCastDevice?s.castSession.getCastDevice():null,0)}),(t=>e.error(["radio.VideoJS::__endCastAd","Music load after device ad failed"],t))))},__holdCastAdUI:function(){this._castAdHold=!0,this._castAdHoldTimer&&clearTimeout(this._castAdHoldTimer),this._castAdHoldTimer=setTimeout((()=>this.__releaseCastAdUI()),1e4),APP.slackerPlayerSession()._setSessionPlayerStyle()},__releaseCastAdUI:function(){this._castAdHoldTimer&&(clearTimeout(this._castAdHoldTimer),this._castAdHoldTimer=null),this._castAdHold&&(this._castAdHold=!1,APP.slackerPlayerSession()._setSessionPlayerStyle())},__resolveVastCreative:function(t,i){const s=(t,i)=>(e=>fetch(e,{credentials:"include"}).catch((()=>fetch(e,{credentials:"omit"}))))(t).then((e=>e.text())).then((t=>{const a=(new DOMParser).parseFromString(t,"text/xml"),n=Array.from(a.getElementsByTagName("MediaFile")),o=e=>n.find((t=>e((t.getAttribute("type")||"").toLowerCase())&&t.textContent.trim())),r=o((e=>e.indexOf("mp4")>-1))||o((e=>0===e.indexOf("video/")))||o((e=>e.indexOf("mpegurl")>-1))||o((e=>e.indexOf("dash+xml")>-1));if(r)return{url:r.textContent.trim().replace(/^http:/,"https:"),type:r.getAttribute("type")||"video/mp4"};const l=a.documentElement&&"Playlist"===a.documentElement.nodeName,c=a.getElementsByTagName("VASTAdTagURI")[0]||a.getElementsByTagName("vmap:AdTagURI")[0]||a.getElementsByTagName("AdTagURI")[0]||(l?Array.from(a.getElementsByTagName("Ad")).find((e=>/^https?:\/\//.test(e.textContent.trim()))):null);return c&&c.textContent.trim()&&i>0?(e.info(["radio.VideoJS::__resolveVastCreative","Following",c.nodeName,"redirect"]),s(c.textContent.trim().replace(/^http:/,"https:"),i-1)):(e.info(["radio.VideoJS::__resolveVastCreative","No playable MediaFile or redirect","| root:",a.documentElement?a.documentElement.nodeName:"none","| mediaFiles:",n.length,"| types:",n.map((e=>e.getAttribute("type"))).join(",")||"n/a"]),null)}));return Promise.race([s(t,i).catch((t=>(e.error(["radio.VideoJS::__resolveVastCreative","VAST resolve failed","|",t&&t.message]),null))),new Promise((e=>setTimeout((()=>e(null)),8e3)))])},__remotePlayerEvents(t){e.info(["radio.VideoJS::__remotePlayerEvents",JSON.stringify(t)]);const i=cast.framework.CastContext.getInstance().getCurrentSession(),s=this.castPlayer.castPlayer,a=this.castPlayer.castController,n=cast.framework.CastContext.getInstance();let o=null;if(!i)return;const r=i.getMediaSession(),l=this._castAdState;if(l){const e=r&&r.media&&r.media.contentId===l.adContentId;e&&"PLAYING"===r.playerState&&(l.adPlaying=!0),l.adPlaying&&(!r||"IDLE"===r.playerState||r.media&&!e)?this.__endCastAd("ad-ended",!0):!l.adPlaying&&e&&"IDLE"===r.playerState&&this.__endCastAd("ad-never-played",!0)}if("mediaInfo"===t.field&&t?.value?.breakClips?.length>=1?(e.info([`radio.VideoJS::__remotePlayerEvents User viewing (${t?.value?.breakClips?.length}) AD(s) currently`]),$(".radio-cast-container").hide(),$(".radio-cast-container-mobile").hide()):"mediaInfo"===t.field&&0===t?.value?.breakClips?.length&&this.__syncCastContainerVisibility(),"currentTime"==t.field){currTime=t.value,this.castPlayer.castCurrentTime=parseInt(currTime);const e=i.getMediaSession();if(!e||this._castAdState||this._castAdHold)return;null!==e?.media?.duration&&(o=e.media.duration),currTime>0&&(this.castPlayer.isPlaying||this._castLoadInFlight||(this.castPlayer.isPlaying="PLAYING"==e.playerState,this.startOffset&&(s.currentTime=this.startOffset,setTimeout((e=>a.seek()),200),this.startOffset=0)));const n=this.pingPOST.timeOffset,r=parseInt(Math.abs(currTime-n)),l=e.mediaSessionId!==this._lastCastMediaSessionId;l&&(this._lastCastMediaSessionId=e.mediaSessionId,this.pingPOST.timeOffset=parseInt(currTime)||0),this.castPlayer.volume=()=>e?.volume?.level||0,null===o&&(o=0),this.castPlayer.duration=()=>o||0,"PLAYING"===e.playerState&&(!l&&!this.seekability&&r>2?(s.currentTime=n,a.seek(),r>5&&this.dispatch({type:this.EVENT.ONSEEKDISALLOWED})):(this?.player.duration(parseInt(o)),this?.player.paused(!1),this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.TIMEUPDATE,{elapsed:parseInt(currTime),duration:o})))}else"playerState"===t.field&&("PAUSED"===t.value?(this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.PAUSE),this.wasPaused=!0):"IDLE"===t.value&&this.castPlayer.isPlaying&&(this.castPlayer.isPlaying=!1,!this.player||this._castLoadInFlight||this._castAdState||n.getSessionState()!==cast.framework.SessionState.SESSION_STARTED||(this.__sendAbstractPlayerEvent(this.EVENT.PLAYBACK.COMPLETED),this.castPlayer.isPlaying=!1)))},__hookVideoJsPlayerEvents:function(t){if(t){e.warn(["radio.VideoJS.__hookVideoJsPlayerEvents"]),Object.keys(this.playerEventHandlers).forEac
1h((e=>{let i=e.split("tech:");2==i.length?t.tech().on(i[1],this.playerEventHandlers[e]):t.on(e,this.playerEventHandlers[e])}));const i=APP.appImplementationModule;i._handleControlerKeyInput&&Object.keys(t.controlBar).forEach((e=>{"function"==typeof t.controlBar[e].on&&(t.controlBar[e].on("keydown",(e=>{i._handleControlerKeyInput.bind(i)(e)})),"progressControl"===e&&t.controlBar[e].children_.forEach((e=>{e.on("keydown",(e=>{i._handleControlerKeyInput.bind(i)(e)}))})))})),t.eventsHooked=!0}else e.warn(["radio.VideoJS.__hookVideoJsPlayerEvents NO PLAYER OBJECT"])},__UNhookVideoJsPlayerEvents:function(t){t?(e.warn(["radio.VideoJS.__UNhookVideoJsPlayerEvents"]),Object.keys(this.playerEventHandlers).forEach((e=>{let i=e.split("tech:");2==i.length?t.tech().off(i[1],this.playerEventHandlers[e]):t.off(e,this.playerEventHandlers[e])})),t.eventsHooked=!1):e.warn(["radio.VideoJS.__UNhookVideoJsPlayerEvents NO PLAYER OBJECT"])},__sendAbstractPlayerEvent(e,t={}){let i=this?.castData?.currentTrackObj||this.currentTrackObj;this.onRadioPlayerEvent({type:e,player:this.player,track:Object.assign({},i),playable:APP.slackerPlayerSession().currentPlayableItem(),...t})},__play:function(t,i,a,n){const o=this,r=APP.slackerPlayerSession();let l;if(this.playPromiseDetection&&(clearTimeout(this.playPromiseDetection),this.playPromiseDetection=0),!this.player)return e.warn("VideoJS:: Radio player not loaded."),-1;{this.wasPaused=!1,this.hasRadioStarted=!1,this.pingPOST.mimeType=i,n||this.__sendAbstractPlayerEvent(this.EVENT.VIDEOCONTAINERREADY),this.pingPOST.requestId||this._processPingbacks(this.currentTrackObj),this.playbackEventStartTime=(new Date).getTime(),e.debug(["VideoJS:: Requesting audio: ",t,i]),this.player.eventsHooked||(this.player.eventsHooked=!0,this.__hookVideoJsPlayerEvents(this.player));const a=this.__forceVideoAdEnabled();(a||!this.currentTrackObj.disableVideoAds&&s.isVideoAdElegible())&&(a&&(e.warn(["radio.VideoJS::__play","FORCE_VIDEO_AD test flag active - forcing a video ad request"]),this.currentTrackObj.disableVideoAds=!1,this.currentTrackObj.disableVideoPreroll=!1),l="STATIONCHANGE"==r.nextRadioTrackAction.adTriggerReason||"dstm"==r.nextRadioTrackAction.adTriggerReason?"preroll":"midroll",this.connectSads(l)),this.hlsPlaylistRetry.count=0,this.hlsPlaylistRetry.tRemain=-1,this.player.loop(!!this.currentTrackObj.loop),this.player.src({src:t,type:i}),this.playPromiseDetection=setTimeout((function(){o.player&&(o.player.changingSrc_=!1),o.player?.play?.()?.then((function(){e.info("VideoJS:: Play Promise success!")})).catch((function(t){e.info("VideoJS:: Play Promise FAILED!"),o.dispatch({type:o.EVENT.AUTOPLAY_DISABLED})}))}),2e3)}},mute:function(){this.lastVolumeBeforeMute=this.player.volume(),this.player.muted(!0)},unmute:function(){this.player.muted(!1),this.setVolume(this.lastVolumeBeforeMute),this.lastVolumeBeforeMute=null},setVolume:function(e){e>1&&(e/=100),this.player.muted()&&this.player.muted(!1),this.player.volume(e),APP.SERVICE.cache("v",e),APP.notifyPostMessageListeners('{"volume":"'+100*e+'"}')},resume:function(e){this.player?this.wasPaused&&(this.noNotifyOnPlayPause=e,this.player.play()):this.restart()},pause:function(t){try{this.player&&!this.player.wasPaused&&(this.noNotifyOnPlayPause=t,this.player.pause())}catch(t){e.error("Unable to pause VideoJS player ",t)}},getPlayerTime:function(){return this.player.currentTime()},seekTo:function(e){this.player.currentTime(e)},connectSads:function(t,i,s,a){(new Date).getTime();const n=this.currentTrackObj;let o=Object.assign({},this.imaOptions);if(this.currentAdTrigger=t,"undefined"==typeof google)"function"==typeof this.player.ads&&this.player.ads();else{if(o.id=this.containerID,o.vpaidMode="website"===APP.appImplementationModule.type||"embedded"===APP.appImplementationModule.type?"ENABLED":"DISABLED",o.adTagUrl=null,s||n.disableVideoPreroll&&(!t||"preroll"==t))return e.warn("VideoJS::connectSads - Initializing IMA SDK."),void this.player.ima(o);t&&"preroll"!=t||n.disableVideoPreroll||this.pingPOST.autoplay&&(o.adWillAutoPlay=!0),o.adWillPlayMuted=0==this.player.volume(),this.__forceVideoAdEnabled()&&(o.adWillAutoPlay=!0,o.adWillPlayMuted=!0);try{"function"==typeof this.player.ima&&(e.warn("VideoJS::connectSads - Initializing IMA SDK."),this.player.ima(o))}catch(t){e.error("VideoJS::connectSads - Failed to initialize IMA SDK.",t)}let a={isEmbedPlayer:!1,bIsLive:!1,breakLen:0,video:null,audio:n};n.dstm&&(a.dstm=!0,a.adTargets=n.dstm,this.currentAdTrigger=t="preroll"),o.adTagUrl=i||com.slacker.sads.SAds.getDFPVideoRequestUrl(t,a);try{this.__sendAbstractPlayerEvent(this.EVENT.AD.PLAYBACK.REQUESTED,{trigger:t}),e.debug("VideoJS:: Connecting Google IMA SDK for ads."),this.player.ima.changeAdTag(o.adTagUrl),this.player.ima.requestAds()}catch(t){e.error("VideoJS::Radio::connectSads - IMA SDK connection failed! ",t)}}},onLocalEventHandler:function(t){switch(e.warn("VideoJS::"+t.type+"::"+(t.adNetworkID||this.adNetworkId)),t.type){case this.EVENT.PLAYBACK.COMPLETED:break;case this.EVENT.PLAYBACK.ERROR:if(t.error){e.warn(["VideoJS error",t.error.code]);var i={};if(t.player)for(var s in t.player)i[s]=t.player[s];switch(t.error.code){case 2:this.cleanUp(!0),this.dispatch({type:this.EVENT.DISPLAYERROR,player:i,track:t.video});break;case 4:!this.retryData.isRetry&&this.canRetryNonNative?(e.warn(["Attempt non-native retry once"]),this.retryData.isRetry=!0,this.overrideNative=!0,this.currentContainer=null,this.cleanUp(!0),this.embed(this.retryData.containerDom,this.currentTrackObj,!0)):(this.cleanUp(!0),this.dispatch({type:this.EVENT.DISPLAYERROR,player:i,track:t.video}))}}break;case this.EVENT.NOVIDEOAD:case this.EVENT.VIDEOADENDED:return}}},registerPackage("com.slacker.player.radio.VideoJS"),com.slacker.player.radio.VideoJS=a}()})),bjork("com.slacker.sads.SAds",(function(){!function(){require("com.slacker.util.Console"),require("com.slacker.event.EventNotifier");const e=require("com.slacker.util.browser.Browser"),t=com.slacker.util.Console,i=1,s={1:"sad-normal",2:"sad-promo",3:"sad-free"};function a(){this.spots={},this.partner="slacker",this.rotateAll,this.triggerEvents={REFRESH:"refresh",TIMER:"timer",SYNCED:"synced"},this.dfpConfig=null,this.dfpSizes={leaderboard:{desktop:{wide:[[970,250],[970,90],[728,90]],small:[[728,90]]},mobile:[[300,250],[320,50]]},billboard:{desktop:[[970,250]],mobile:[[320,50]]},festivalChat:{desktop:[[300,250]],mobile:[[320,50],[300,50]]},skyscraper:[[300,600],[300,250]],medrect:[[300,250]],native:"fluid"},this.interactiveEvents="init,scroll,preroll,STATIONCHANGE,BANSKIP,BANLISTEN,SKIP",this._isAdBlockTechEnabled=!1,this._adBlockSources={},this.extraTargets=null,this.events=new com.slacker.event.EventNotifier,this.videoLockoutInterval=9e5,this.lastVideoAdTime=0,this.videoAdElegible=!0}a.prototype={getSpot:function(e){return this.spots[e]},resetAll:function(){let e;for(e in this.spots)delete this.spots[e];this.getDFPConfig(!0)},getAdMode:function(e){return i},getAdModeClass:function(e){return s[e]},shouldShowShowAdBlockNag:function(){return this._isAdBlockTechEnabled&&!APP.suppressDisplayAds&&APP.useAdblockNag},resetSpotLockout:function(){const e=com.slacker.sads.SAds.getDFPConfig();e.tstamp=null,e.pending=null,e.lockout=0},forceSpotLockout:function(e){com.slacker.sads.SAds.getDFPConfig().tstamp=new Date((new Date).getTime()+e)},isVideoAdElegible:function(){const e=(new Date).getTime(),t=APP.USER.slackerUser();return!(!!t?.policy?.capabilities&&t.policy.capabilities.features.ad_free.enabled)&&e-this.lastVideoAdTime>=this.videoLockoutInterval&&this.videoAdElegible},create3rdPartyFrame:function(e,t){const i=$("<iframe/>",e);return $(t).empty().append(i),i},getDebugData:function(e){var t,i,s=[],a=this.getDFPConfig(),n=APP.slackerPlayerSession(),o=n?n.playlist():null;for(t in s.push(""),a.slots)i=a.slots[t],s.push("Slot: "+t),s.push(" size: "+i.size),s.push(" displayed: "+i.displayed),"300x250"==i.size&&s.push(" lastInView: "+!(!this.getSpot("medrect")||0!=i.slackerId.indexOf(this.getSpot("medrect").container[0].id))),s.push(" targeting: "+i.s);return o&&o[0]&&"ad"==o[0].type&&(s.push("Slot: audio"),s.push(" trackId: "+o[0].trackId),s.push(" fileId: "+o[0].fileId)),s.join("\n")},getDFPInstance:function(){const e=this;return"undefined"!=typeof googletag&&document.getElementById("googletagscript")||(googletag={cmd:[]},this.__embedDFP(),this.getDFPConfig(),googletag.cmd.push((function(){googletag.pubads().disableInitialLoad(),googletag.pubads().enableAsyncRendering(),googletag.pubads().enableVideoAds(),googletag.pubads().addEventListener("slotRenderEnded",e.__dfpEventListner.slotRenderEnded.bind(e))}))),googletag},setDFPGlobalTargeting:function(){const e=APP.USER.slackerUser();
1let t={ul:"0",el:"1",promoid:"0",ab:"n_a",ag:"n_a",agrp:"n_a",gnd:"n_a",uage:"n_a",buildv:"4.0.1385"};if(e&&e.id)return t.ul=e.actualTier,t.el=e.explicit?"1":"0",e.policy&&(t.promoid=e.policy.promoid||"0",t.ab=e.policy.ab||"n_a",t.ag=e.policy.ag?e.policy.ag:"n_a",t.agrp=e.policy.agrp?e.policy.agrp:"n_a",t.gnd=e.policy.gnd?e.policy.gnd.toLowerCase():"n_a",t.uage=e.policy.uage+""),t;{let e=APP.USER.user();t.ul=e.isAnon?"0":"1",t.el=e.get("explicit")?"1":"0",t.promoid=e.get("promoid")?e.get("promoid"):"0",t.ag=e.get("ag")?e.get("ag"):"n_a",t.agrp=e.get("agrp")?e.get("agrp"):"n_a",t.gnd=e.get("gnd")?e.get("gnd").toLowerCase():"n_a",t.uage=e.get("uage")+""}return t},setDFPSpecificTargeting:function(i,s,a,n){let o=APP.USER.slackerUser(),r=(o&&o.username||APP.USER.user(),o.policy?o.policy:null),l=APP.currentView,c=null;if(l){const e=l.historyData?.seoName,t=window.location?.pathname?.replace(/^\//,"").split("?")[0];c=(e||t||"").split("/")}let d=(()=>{try{return APP.currentView.data()[0].content()[0]()}catch(e){return null}})();n&&n.forceVideoType&&(c=["video"]);let u=this.setDFPGlobalTargeting();if(a&&a.targets&&a.targets.forEach((e=>{u[e.name]=e.value})),u.channel="n_a",u.subchannel="n_a",u.channelartist="n_a",u.tab="n_a",(l||n&&n.forceVideoType)&&(u.channel=c.slice(0)[0].toLowerCase(),u.channel?(u.channeldetail=c.pop(),"video"==u.channel||n&&n.forceVideoType?(u.subchannel="vod",u.videoid=u.channeldetail):"live-events"==u.channel?c.length&&(u.subchannel=c.pop()):"station"==u.channel?d&&(d.showName?u.subchannel=makeSeoName(d.showName):d.genreNames?u.subchannel=makeSeoName(d.genreNames[0]):(d.custom||"playlist"==d.nodeType)&&(u.subchannel="custom",d.sid?u.channeldetail=d.sid.replace("stations/","").replace("/","-"):"playlist"==d.nodeType&&(u.channeldetail=d.id.replace("playlists/","").replace("/","-")))):"album"==u.channel||"song"==u.channel?u.channelartist=c.pop():"artist"==u.channel&&(u.channelartist=u.channeldetail)):u.channel="home"),APP.herostreamaction&&APP.herostreamaction.videoplayer&&APP.herostreamaction.videoplayer.currentVideoObj&&(APP.herostreamaction.videoplayer.currentVideoObj.festivalId?u.channeldetail=u.videoid=APP.herostreamaction.videoplayer.currentVideoObj.festivalId:u.channeldetail=u.videoid=APP.herostreamaction.videoplayer.currentVideoObj.objectId),l&&l.detailPlayer&&l.detailPlayer.currentVideoObj&&(u.videoid=l.detailPlayer.currentVideoObj.objectId.replace("video-","")),"embedded"===APP.appImplementationModule.type&&(u.channel="widget",APP.herostreamaction.currentVideo()&&(APP.herostreamaction.currentVideo().festivalId?(u.subchannel="festival",u.channeldetail=u.videoid=APP.herostreamaction.currentVideo().festivalId):(u.subchannel="vod",u.channeldetail=u.videoid=APP.herostreamaction.currentVideo().objectId.replace("video-",""))),u.embed=APP.embedCampaign()),APP.slackerPlayerSession()){let e=APP.slackerPlayerSession().currentTrack(),t=APP.slackerPlayerSession().currentPlayableItem();"fullscreen"==APP.slackerPlayerSession().playerSize&&(u.channel="radio",u.subchannel=t.mainCategoryName||t.type),t&&(u.gstn=t.coreMapId||"0",u.stationid=t.coreId||"0","station"==t.itemMatchType?t.coreId==t.coreMapId?u.stype="slacker":u.stype="user":u.stype=t.itemMatchType),e&&t&&"podcast"!=t.type&&(u.channelartist=makeSeoName(e.artist),u.tid=e.tid,u.pid=e.pid,u.arid=e.artistid,u.alid=e.albumid)}u.int=this.interactiveEvents.indexOf(s)>-1?"1":"0",u.vis=e.isVisible()?"1":"0",u.optout=window.GPC&&window.GPC.optOut&&window.GPC.optOut("any")?1:"0";const h=r?.account?.partners;if(h){let e=h.partner;if(e){Array.isArray(e)||(e=[e]);const t=e.reduce(((e,t)=>(parseInt(t.priority,10)||999)<(parseInt(e.priority,10)||999)?t:e),e[0]);t?.adtarget&&(u.ptr_account=t.adtarget)}}if(window.GPC&&window.GPC.optOut&&window.GPC.optOut("any")){let e=["ab","ul","promoid","buildv","int","vis","optout","embed","ptr_account"];Object.keys(u).filter((t=>!e.includes(t))).forEach((e=>u[e]="optout"))}if(!i||"video"==i)return u;t.info("SAds.setDFPTargetingForAction::sending to GAM - "+JSON.stringify({ids:i,action:s,adUnit:this.getBannerAdUnit(),targeting:u})),this.setDFPTargeting(i,u,!0)},getDFPConfig:function(e){return this.dfpConfig&&!e||(this.dfpConfig={site:CONFIG.dfpSite,slots:{},loadAttempts:{},hasLoaded:!1,defineSlots:{}}),this.dfpConfig.domain=APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.DATA.ROOT),this.dfpConfig},getBannerAdUnit:function(){const e=APP.USER.simpleSettings,i=e?.ads?.banner?.networks,s=i?.network?.ad_unit;return s?(t.info("SAds.getBannerAdUnit::using simpleSettings ad_unit: "+s),s):(e?i&&"object"==typeof i?t.warn("SAds.getBannerAdUnit::ad_unit not found in banner.networks.network ("+JSON.stringify(i.network)+"), using CONFIG.dfpSite: "+CONFIG.dfpSite):t.warn("SAds.getBannerAdUnit::banner.networks not found or not an object ("+JSON.stringify(i)+"), using CONFIG.dfpSite: "+CONFIG.dfpSite):t.warn("SAds.getBannerAdUnit::simpleSettings not available, using CONFIG.dfpSite: "+CONFIG.dfpSite),CONFIG.dfpSite)},defineDFPSlot:function(e,i,s,a){const n=this.getDFPInstance(),o=this.getDFPConfig(),r=this;return o.defineSlots[s]={site:e,size:i},this._isAdBlockTechEnabled?(this.events.notify("onAdServerResponse",[null,"adblock"]),!1):(n.cmd.push((function(){Object.keys(o.defineSlots).forEac
1h((e=>{const i=`${e}_${(new Date).getTime()}`,s=o.defineSlots[e],a=$(`#${e}`),l=(new Date).getTime();let c,d=null;"fluid"==s.size&&(s.size=[[a.width(),a.height()]],d=n.sizeMapping().addSize([0,0],["fluid"]).build()),c=n.defineSlot(s.site,s.size,i),d&&c.defineSizeMapping(d),c&&a&&a.length?(a.append($("<div/>",{id:i})),a.addClass("pending"),c.isPrimaryViewable=!0,c.slackerId=i,c.container=a[0],c.containerSize=s.size,c.maxWidth=s.size?s.size[0][0]:300,c.maxHeight=s.size?s.size[0][1]:250,c.lastUse=l,r.getDFPConfig().slots[e]=c,c.addService(n.pubads()),c.addService(n.companionAds()),t.info("SAds.defineDFPSlot::Defined new GPT slot: "+[e,s.size.join("-")])):t.warn(["SAds.defineDFPSlot::","G.defineSlot failed",i,s.size]),delete o.defineSlots[e]}))})),o.loadAttempts[s]=setTimeout((()=>{googletag&&void 0!==googletag.apiReady?this._isAdBlockTechEnabled&&this.events.notify("onAdServerResponse",[null,"adblock"]):this.markAdBlockDetected("googletag-timeout")}),5e3),!0)},setDFPTargeting:function(e,t,i){const s=this.getDFPInstance(),a=this;const n=function(e,t,i){s.cmd.push((function(){Object.keys(t).forEach((s=>{i&&e.clearTargeting(s),t[s]&&e.setTargeting(s,t[s])}))}))};e?e.forEach((e=>{const s=a.getDFPConfig().slots[e];if(s&&s.container){i&&s.clearTargeting(),t?delete t.position:t={},s.container&&(t.position=s.container.getAttribute("data-adpos"));try{const e=$(s.container).parent().parent().parent().parent();e[0]&&e.hasClass("tabpane")&&(t.tab=decodeURIComponent(e.attr("data-reporting-tab")).toLowerCase().replace(/\W/g,"-"))}catch(e){}n(s,t)}})):n(s.pubads(),t,!0)},displayDFPSlots:function(e){const i=this.getDFPInstance(),s=this.getDFPConfig().slots,a=APP.USER.slackerUser();a&&a.policy&&a.policy;i.cmd.push((function(){let a=!1;e||(e=[],Object.keys(s).forEach((t=>{s[t].displayed||e.push(t)}))),e.forEach((e=>{if(e&&s[e]){let n=s[e];n.displayed||(t.debug("SAds.displayDFPSlots::Display GPT slot: "+[e,n.containerSize.join("-")]),s[e].displayed=!0,a=!0,i.display(n.slackerId))}})),a&&i.enableServices()}))},refreshDFPSlots:function(e,i,s){const a=this,n=this.getDFPInstance(),o=this.getDFPConfig(),r=(new Date).getTime(),l=APP.USER.slackerUser();l.policy&&l.policy;let c=[];this.getDFPConfig().hasLoaded||(t.info("SAds.refreshDFPSlots::Enabling GPT services."),o.hasLoaded=!0,n.cmd.push((function(){n.pubads().enableSingleRequest(),n.enableServices()}))),e.forEach((function(e){const t=a.getDFPConfig().slots[e];t&&(t.lastUse=r),c.push(e)})),this.displayDFPSlots(c),o.action=i,c&&1!=c.length||(o.pending=!0,o.tstamp=new Date,o.lockout=2e4),setTimeout((function(){let e=s;n.cmd.push((function(){a.setDFPSpecificTargeting(c,i)})),n.cmd.push((function(){a.setDFPTargeting(c,e),n.pubads().setPrivacySettings({restrictDataProcessing:!(!window.GPC||!window.GPC.optOut)&&window.GPC.optOut("any")})})),n.cmd.push((function(){(new Date).getTime();let t=null,i=com.slacker.sads.SAds.getDFPConfig();e=function(e){const t=com.slacker.sads.SAds.getDFPConfig().slots[e];let i,s;try{if(t)for(i in t)if(t[i]&&t[i].toString().indexOf("scp=")>-1)return s=new com.slacker.util.ParamHash(t[i].split("?")[1]),decodeURIComponent(s.get("scp"))}catch(e){}return"UNKNOWN"}(c[0]?c[0]:"leaderboard"),c&&(t=c.map((e=>i.slots[e]))),t?n.pubads().refresh(t):n.pubads().refresh()}))}),100)},getDFPVideoRequestUrl:function(t,i){console.log("seoPath :: getDFPVideoRequestUrl :: ",t,i);const s=this.getDFPConfig(),a=(new Date).getTime(),n=(APP.USER.slackerUser(),e.isMobileDevice()&&!i.video_startup?"480x320":"640x480"),o=this.setDFPSpecificTargeting("video",t,i.adTargets,i.video),r=i.bIsLive?"live/":"",l=i.video&&i.video.seoName?`https://${document.domain}/${i.video.seoName}`:"",c=Object.keys(o).map((e=>`${e}=${o[e]}`));let d,u=i.bIsLive?"0":"1",h=s.site,p=[];if((i.breakLen||"midroll"==t)&&(u=0,!i.chromecast&&i.breakLen&&(p.push(""),p.push("pmnd=0"),p.push(`pmxd=${i.breakLen}`))),i.isEmbedPlayer&&(h=h.replace("site","embed")),i.chromecast&&(h=h.replace("web/livexlive/site","home/slacker/chromecast")),i.audio)d=i.dstm?`${h}/video-dstm`:`${h}/video-radio`;else if(i.video_startup){const e=APP.USER.simpleSettings;if(e&&e.ads&&e.ads.video_startup&&e.ads.video_startup.networks&&e.ads.video_startup.networks.network){const t=e.ads.video_startup.networks.network.ad_unit;d=t||`${h}/video-startup`}else d=`${h}/video-live`}else d=i.bIsLive?`${h}/video-live`:`${h}/video-vod`;return`http://pubads.g.doubleclick.net/gampad/${r}ads?env=vp&gdfp_req=1&impl=s&output=xml_vast2${p.join("&")}&iu=${d}&sz=${n}&unviewed_position_start=1&us_privacy=${window.GPC&&window.GPC.getUspString?window.GPC.getUspString():""}&ad_rule=${u}&vpos=${t}&url=http://${s.domain}&ciu_szs=&description_url=${l}&cust_params=${encodeURIComponent(c.join("&"))}&correlator=${a}`},getDFPSlotContents:function(e){const t=this.getDFPConfig().slots[e];if(t)return window.frames["google_ads_iframe_"+t.b.a].document.childNodes[0].innerHTML},destroyDFPSlots:function(e){const i=this.getDFPInstance(),s=this.getDFPConfig().slots;let a=null,n=0;const o=function(e){i.cmd.push((function(){s[e]&&(t.debug("SAds.destroyDFPSlots::Removing ad slot "+[e,s[e]]),i.destroySlots([s[e]]),$(s[e].slackerId)&&($(s[e].slackerId).remove(),$("#"+e).empty()),s[e].container=null),s[e]=null,delete s[e]}))};if(e)for(n=0;n<e.length;n++)o(e[n]);else for(a in s)o(a)},__embedDFP:function(){googletag=googletag||{},googletag.cmd=googletag.cmd||[],(()=>{let e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.id="googletagscript",e.type="text/javascript",e.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",t.parentNode.insertBefore(e,t)})()},__dfpEventListner:{slotRenderEnded:function(e){const i=this.getDFPConfig();let s=e.slot;s.size=e.size&&e.size.length>
10?e.size[0]+"x"+e.size[1]:"",$(s.container).removeClass("pending"),t.info("SAds.slotRenderEnded::GAM response - "+JSON.stringify({slotId:s.slackerId,adUnitPath:"function"==typeof e.slot?.getAdUnitPath?e.slot.getAdUnitPath():"companion",isEmpty:e.isEmpty,size:s.size||"null",action:i.action,lineItemId:e.lineItemId,creativeId:e.creativeId})),e.isCompanionAction?this.events.notify("onAdServerResponse",[s,"companion",e.isEmpty,e]):this.events.notify("onAdServerResponse",[s,i.action,e.isEmpty,e])}}},registerPackage("com.slacker.sads.SAds"),com.slacker.sads.SAds=new a,(()=>{const e=e=>{if(com.slacker.sads.SAds._adBlockSources[e]=!0,com.slacker.sads.SAds._isAdBlockTechEnabled)return;com.slacker.sads.SAds._isAdBlockTechEnabled=!0;const t=()=>com.slacker.sads.SAds.events.notify("onAdBlockDetected",[e]),i=()=>"undefined"!=typeof BEACON&&BEACON.isLoadingComplete;if(i())t();else{const e=Date.now()+6e4,s=setInterval((()=>{i()?(clearInterval(s),t()):Date.now()>e&&clearInterval(s)}),500)}};com.slacker.sads.SAds.markAdBlockDetected=e;const t=()=>new Promise((e=>{let t=document.createElement("div");t.className="ad-banner adsbox ad-placement carbon-ad",t.style.cssText="position:absolute;top:-10px;left:-10px;width:1px;height:1px;overflow:hidden;",t.innerHTML=" ";const i=()=>document.body.appendChild(t);document.body?i():document.addEventListener("DOMContentLoaded",i),setTimeout((()=>{let i=!t||null===t.offsetParent||0===t.offsetHeight||0===t.offsetWidth||"none"===window.getComputedStyle(t).display||"hidden"===window.getComputedStyle(t).visibility||!document.body.contains(t);t&&t.parentNode&&t.parentNode.removeChild(t),e(i)}),300)})),i=()=>fetch("https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{method:"HEAD",mode:"no-cors",cache:"no-store"}).then((()=>!1),(()=>!0)),s=()=>new Promise((e=>{const t=new Image;let i=!1;const s=t=>{i||(i=!0,e(t))};t.onload=()=>s(!1),t.onerror=()=>s(!0),t.src="https://www.google-analytics.com/__utm.gif?v=1&tid=UA-0-0&cid=adblockprobe&t=event&ec=probe&ea=init",setTimeout((()=>s(!1)),3e3)}));let a=document.createElement("script"),n=document.getElementsByTagName("script")[0];a.async=!0,a.type="text/javascript",a.src="https://imasdk.googleapis.com/js/sdkloader/ima3.js",a.onerror=()=>{e("ima")},n.parentNode.insertBefore(a,n),t().then((t=>{t&&e("bait")})),i().then((t=>{t&&e("network")})),s().then((t=>{t&&e("image-pixel")})),com.slacker.sads.SAds.audioAdBlockThreshold=1,com.slacker.sads.SAds.emptySlotBlockThreshold=5,com.slacker.sads.SAds._consecutiveEmptySlots=0,com.slacker.sads.SAds.reportAudioAdError=(e,t)=>{const i=com.slacker.sads.SAds;if(i._isAdBlockTechEnabled&&(null==e||2===e||4===e)){if(t&&"undefined"!=typeof performance&&performance.getEntriesByType){const e=performance.getEntriesByType("resource").filter((e=>e.name===t)),i=e[e.length-1];if(!(!i||0===i.transferSize&&0===i.encodedBodySize&&0===i.decodedBodySize))return}i._adBlockSources["ad-error"]=!0,i._audioAdErrorCount=(i._audioAdErrorCount||0)+1,i._audioAdErrorCount>=i.audioAdBlockThreshold&&(i._hardBlockActive=!0,i.events.notify("onAdBlockAudioBlocked",[]))}},com.slacker.sads.SAds.reportAudioAdSuccess=()=>{com.slacker.sads.SAds._audioAdErrorCount=0},com.slacker.sads.SAds.reportEmptySlot=()=>{const t=com.slacker.sads.SAds;if(t._isAdBlockTechEnabled)return;if(t._hasEverFilledSlot)return;const i="undefined"!=typeof APP&&APP.USER&&APP.USER.slackerUser?APP.USER.slackerUser():null;i&&10==i.actualTier||(t._consecutiveEmptySlots=(t._consecutiveEmptySlots||0)+1,t._consecutiveEmptySlots>=t.emptySlotBlockThreshold&&e("empty-slots"))},com.slacker.sads.SAds.reportFilledSlot=()=>{com.slacker.sads.SAds._consecutiveEmptySlots=0,com.slacker.sads.SAds._hasEverFilledSlot=!0};let o=0;com.slacker.sads.SAds.recheckAdBlockState=()=>{const e=com.slacker.sads.SAds;if(!e._isAdBlockTechEnabled)return;const a=Date.now();if(a-o<6e4)return;const n=e._adBlockSources||{},r=[];n.bait&&r.push(t()),n.network&&r.push(i()),n["image-pixel"]&&r.push(s()),r.length&&(o=a,Promise.all(r).then((e=>{e.every((e=>!e))&&com.slacker.sads.SAds._isAdBlockTechEnabled&&(com.slacker.sads.SAds._isAdBlockTechEnabled=!1,com.slacker.sads.SAds._adBlockSources={},com.slacker.sads.SAds.events.notify("onAdBlockCleared",[]))})))}})()}()})),bjork("com.slacker.sads.VSAds",(function(){!function(){const e=require("com.slacker.player.VideoJS");function t(){this.suppressInit=!1,this.abortTimeoutOverride=null,this._activeSponsorHandle=null}t.prototype={initializeVideoAd:function(){return new Promise((e=>{this._startVideoAdInitialization(e)}))},_startVideoAdInitialization:function(e,t){console.log("VSAds:: initializeVideoAd: Starting initialization of video ad.");const i=this._getVideoAdConfig(),s=this._createAdState(e);
1s.config=i,s.isSponsored=this._isCostcoSponsoredUser(),this._startAdInitializationTimeout(s,i);const a=APP.USER.simpleSettings;if(console.log("VSAds:: initializeVideoAd: Retrieved simpleSettings:",a),this._resetAdTimerIfRequested(),this.suppressInit)return console.log("VSAds:: initializeVideoAd: Suppress init flag set, skipping"),this._resolveOnce(s);if(!this._isVideoAdEnabled(a))return console.log("VSAds:: initializeVideoAd: Video ads not enabled"),this._resolveOnce(s);if(this._isAdRecentlyPlayed(i))return console.log("VSAds:: initializeVideoAd: Ad played recently, skipping"),this._resolveOnce(s);console.log("VSAds:: initializeVideoAd: Video ads are enabled and not played in last 24 hours. Proceeding with initialization."),APP.pauseCurrentPlayback(),this._cleanupExistingAdContainer(),s.containerDom=this._createAdContainer(i,s.isSponsored);const n=this._buildVideoPayload();if(this._cleanupExistingAdPlayer(),s.adVideoPlayer=this._createAdPlayer(s.containerDom,n),!s.adVideoPlayer)return console.log("VSAds:: initializeVideoAd: Failed to create video player instance."),this._resolveOnce(s);this._attachNoVideoAdHandler(s,i),this._proxyVideoPlayerEvents(s,i),this._checkPlayerReady(s,i)},_getAbortTimeout:function(e=5e3){return"#forceAdAbort"===window.location.hash?100:null!==this.abortTimeoutOverride?this.abortTimeoutOverride:e},_getVideoAdConfig:function(){const e="#forceMidPlayStall"===window.location.hash;return{AD_COOLDOWN_HOURS:24,PLAYER_CHECK_INTERVAL:100,CLEANUP_DELAY:200,CONTAINER_Z_INDEX:1e5,ABORT_TIMEOUT:this._getAbortTimeout(),SUPPRESS_INIT_TIMEOUT:1e3,STALL_TICK_MS:1e3,STALL_BUFFERING_MS:e?1e3:1e4,STALL_SILENT_MS:e?1500:12e3,MAX_AD_MS:e?2500:9e4,SPONSOR_BAND_PX:64}},_createAdState:function(e){return{id:URL.createObjectURL(new Blob).substr(-36),resolve:e,resolved:!1,finished:!1,adStarted:!1,adAborted:!1,adPlayed:!1,adRequested:!1,iosCleanupTriggered:!1,containerDom:null,adVideoPlayer:null,isSponsored:!1,sponsorMounted:!1,sponsorHandle:null,sponsorBand:null,lastProgressAt:0,adStartedAt:0,adBuffering:!1,adPaused:!1,stallTimer:null,heartbeatAttached:!1}},_resolveOnce:function(e){e.resolved||(e.resolved=!0,e.resolve())},_shouldIgnoreHandler:function(e){return e.finished},_shouldIgnorePlayback:function(e){return e.adAborted||e.finished},_markNoAdAvailable:function(e){e.adRequested=!0,e.adPlayed=!1},_finishAdFlow:function(e,t){e.finished||(e.finished=!0,e.stallTimer&&(clearInterval(e.stallTimer),e.stallTimer=null),this._unmountSponsorNotice(e),t&&t.resumePlayback&&APP.resumeRegularPlayback(),t&&void 0!==t.cleanupDelay?this._removeContainer(e.containerDom,t.cleanupDelay,t.logMessage):this._removeContainer(e.containerDom,void 0,t&&t.logMessage),this._resolveOnce(e))},_finishAfterDelay:function(e,t,i){setTimeout((()=>{this._finishAdFlow(e,i)}),t.CLEANUP_DELAY)},_startAdInitializationTimeout:function(e,t){setTimeout((()=>{e.adStarted||this._onInitializationTimeout(e,t)}),t.ABORT_TIMEOUT)},_onInitializationTimeout:function(e,t){e.resolved||(e.adAborted=!0,this.suppressInit=!0,setTimeout((()=>{this.suppressInit=!1}),t.SUPPRESS_INIT_TIMEOUT),console.warn("VSAds:: Ad initialization timed out, skipping ad"),e.adVideoPlayer&&this._cleanupAdPlayerInstance(e.adVideoPlayer),this._finishAdFlow(e,{cleanupDelay:0}))},_startMidPlayStallWatchdog:function(e){const t=e.config||this._getVideoAdConfig();this._attachAdProgressHeartbeat(e,e.adVideoPlayer&&e.adVideoPlayer.player),e.heartbeatAttached&&(e.adStartedAt=e.adStartedAt||Date.now(),e.lastProgressAt=Date.now(),e.stallTimer&&clearInterval(e.stallTimer),e.stallTimer=setInterval((()=>{if(e.finished||e.adAborted||!e.adStarted||e.adPaused)return;if(document.hidden||document.webkitHidden)return void(e.lastProgressAt=Date.now());const i=Date.now(),s=i-e.lastProgressAt,a=i-e.adStartedAt,n=e.heartbeatAttached&&e.adBuffering&&s>=t.STALL_BUFFERING_MS,o=e.heartbeatAttached&&s>=t.STALL_SILENT_MS,r=e.heartbeatAttached&&a>=t.MAX_AD_MS;(n||o||r)&&(console.warn("VSAds:: Mid-play ad stall detected (bufferStall="+n+" silentStall="+o+" hardCap="+r+", stalledFor="+s+"ms) - forcing recovery"),this._onMidPlayStall(e))}),t.STALL_TICK_MS))},_onMidPlayStall:function(e){if(e.finished||e.adAborted)return;e.adAborted=!0,e.stallTimer&&(clearInterval(e.stallTimer),e.stallTimer=null);const t=!(!APP.adVideoPlayer||APP.adVideoPlayer!==e.adVideoPlayer);this._finishAdFlow(e,{resumePlayback:t,cleanupDelay:0,logMessage:"Video ad container removed (mid-play stall recovery)"});try{const t=e.adVideoPlayer&&e.adVideoPlayer.player&&e.adVideoPlayer.player.ima,i=t&&"function"==typeof t.getAdsManager&&t.getAdsManager();if(i){try{i.stop()}catch(e){}try{i.destroy()}catch(e){}}}catch(e){console.log("VSAds:: Mid-play stall: best-effort IMA teardown threw",e)}t&&e.adVideoPlayer&&this._cleanupAdPlayerInstance(e.adVideoPlayer)},_attachAdProgressHeartbeat:function(e,t){if(!e.heartbeatAttached)try{if(!window.google||!google.ima)return;const i=t&&t.ima&&"function"==typeof t.ima.getAdsManager&&t.ima.getAdsManager();if(!i)return;const s=google.ima.AdEvent.Type,a=()=>{e.lastProgressAt=Date.now(),e.adBuffering=!1,e.adPaused=!1},n=(e,t)=>{try{e&&i.addEventListener(e,t)}catch(e){}};n(s.AD_PROGRESS,a),n(s.FIRST_QUARTILE,a),n(s.MIDPOINT,a),n(s.THIRD_QUARTILE,a),n(s.AD_CAN_PLAY,a),n(s.STARTED,(()=>{e.adStartedAt=Date.now(),a()})),n(s.AD_BUFFERING,(()=>{e.adBuffering=!0})),n(s.PAUSED,(()=>{e.adPaused=!0})),n(s.CLICK,(()=>{e.adPaused=!0})),n(s.RESUMED,(()=>{e.adPaused=!1,e.lastProgressAt=Date.now()})),e.heartbeatAttached=!0}catch(e){console.log("VSAds:: Failed to attach ad-progress heartbeat",e)}},_setAbortTimeoutOverride:function(e){this.abortTimeoutOverride=e,console.log(`VSAds:: Easter egg activated: abortTimeoutOverride has been set to ${e}ms`)},_resetAdTimer:function(){localStorage.removeItem("lastVideoAdPlayedTime"),console.log("VSAds:: Easter egg activated: lastVideoAdPlayedTime has been reset.")},_resetAdTimerIfRequested:function(){"#resetAdTimer"===window.location.hash&&(this._resetAdTimer(),window.location.hash="")},_isVideoAdEnabled:function(e){return!0===e?.ads?.video_startup?.enabled||"true"===e?.ads?.video_startup?.enabled},_isAdRecentlyPlayed:function(e){const t=localStorage.getItem("lastVideoAdPlayedTime");if(!t)return console.log("VSAds:: initializeVideoAd: No record of previous video ad play. Proceeding with initialization."),!1;const i=Date.now(),s=60*e.AD_COOLDOWN_HOURS*60*1e3,a=new Date(parseInt(t,10)),n=new Date(a.getTime()+s),o=n.getTime()-i;console.log(`VSAds:: initializeVideoAd: Last video ad played on: ${a.toLocaleStr
1ing()}`),console.log(`VSAds:: initializeVideoAd: Next possible play time: ${n.toLocaleString()}`),console.log(`VSAds:: initializeVideoAd: Time until next possible play: ${this._formatDuration(o)}`);return i-parseInt(t,10)<s},_formatDuration:function(e){const t=Math.floor(e/1e3),i=Math.floor(t/60),s=Math.floor(i/60);return`${Math.floor(s/24)} days, ${s%24} hours, ${i%60} minutes, ${t%60} seconds`},_cleanupExistingAdContainer:function(){let e=document.getElementById("videoAdContainer");if(!e)return;console.log("VSAds:: initializeVideoAd: Cleaning up existing video ad container");const t=e.querySelector(".video-js");if(t&&"undefined"!=typeof videojs){const e=t.id;if(videojs.players[e])try{videojs.players[e].dispose(),console.log("VSAds:: initializeVideoAd: Disposed existing VideoJS player")}catch(e){console.warn("VSAds:: initializeVideoAd: Error disposing existing player:",e)}}e.parentNode&&e.parentNode.removeChild(e)},_createAdContainer:function(e,t){const i=(new Date).getTime();let s=document.createElement("div");s.id=`videoAdContainer_${i}`,s.className="video-ad-container";const a=t?e.SPONSOR_BAND_PX:0;return Object.assign(s.style,{position:"fixed",top:a+"px",left:"0",width:"100vw",height:a?`calc(100vh - ${a}px)`:"100vh",zIndex:e.CONTAINER_Z_INDEX.toString(),backgroundColor:"rgba(0, 0, 0, 0.7)",display:"none",justifyContent:"center",alignItems:"center"}),document.body.appendChild(s),console.log("VSAds:: initializeVideoAd: Created hidden containerDom:",s),s},_buildVideoPayload:function(){return{source:"lxl",contentUrl:`${IMG_CDN_AND_BUILD}/helper/1sec.mp3`,autoplay:!0,defaultVolume:.5,forceVideoType:!0,video_startup:!0}},_cleanupExistingAdPlayer:function(){APP.adVideoPlayer&&APP.adVideoPlayer.player&&this._cleanupAdPlayerInstance(APP.adVideoPlayer)},_cleanupAdPlayerInstance:function(e){if(e&&e.player){if(console.log("VSAds:: initializeVideoAd: Cleaning up existing video ad player"),e.player.ima&&e.player.ima.controller)try{e.player.ima.controller.sdkImpl.adBreakReadyListener=void 0,console.log("VSAds:: initializeVideoAd: Fixed IMA SDK adBreakReadyListener state corruption")}catch(e){console.log("VSAds:: initializeVideoAd: Could not fix IMA SDK state:",e)}e.cleanUp()}},_createAdPlayer:function(t,i){return APP.adVideoPlayer=new e,APP.adVideoPlayer?(APP.adVideoPlayer.USER={simpleSettings:APP.USER.simpleSettings},APP.adVideoPlayer.APP=APP,console.log("VSAds:: initializeVideoAd: Creating fresh video ad player"),APP.adVideoPlayer.embed(t,i),APP.adVideoPlayer):null},_attachNoVideoAdHandler:function(e,t){const i=e.adVideoPlayer;i.attachEvent(i.EVENT.NOVIDEOAD,(()=>{this._onNoVideoAd(e,t)}))},_proxyVideoPlayerEvents:function(e,t){const i=e.adVideoPlayer,s=i.onVideoPlayerEvent;i.onVideoPlayerEvent=new Proxy(s,{apply:(i,s,a)=>this._onVideoPlayerEventIntercept(e,t,i,s,a)})},_playAllVideoJsPlayers:function(){if("undefined"==typeof videojs)return void console.log("VSAds:: Video.js is not loaded on this page.");const e=Object.values(videojs.players);if(0===e.length)return void console.log("VSAds:: No Video.js players found on this page.");let t=0;e.forEach((e=>{try{if(!e||e.isDisposed())return;const i=e.id?e.id():"unknown";if("videojs_radio_player"===i)return void console.log("VSAds:: Skipping radio player with id: videojs_radio_player");e.paused&&e.paused()&&e.play().then((()=>{t++,console.log(`VSAds:: Played Video.js player with id: ${i}`)})).catch((e=>{console.error(`Failed to play Video.js player with id: ${i}. Error:`,e)}))}catch(e){console.log("VSAds:: Error in playAllVideoJsPlayers:",e)}})),0===t?console.log("VSAds:: No Video.js players were paused."):console.log(`VSAds:: Total Video.js players played: ${t}`)},_playImaAdVideos:function(){const e=document.querySelectorAll('[id*="_ima-ad-container"], .ima-ad-container');if(0===e.length)return void console.log("VSAds:: No IMA ad containers found on this page.");let t=0;e.forEach((e=>{const i=e.querySelector("video");i&&i.paused&&i.play().then((()=>{t++,console.log(`VSAds:: Played ad video within container with id: ${e.id||"unknown"}`)})).catch((t=>
1{console.error(`Failed to play ad video within container with id: ${e.id||"unknown"}. Error:`,t)}))})),0===t?console.log("VSAds:: No ad videos were paused within IMA ad containers."):console.log(`VSAds:: Total ad videos played within IMA ad containers: ${t}`)},_checkPlayerReady:function(e,t){const i=e.adVideoPlayer;if(i.player){console.log("VSAds:: initializeVideoAd: Video player is initialized.");const s=i.player;return this._configurePlayerForAds(s,e.containerDom),void this._attachPlayerEventHandlers(e,t,s)}setTimeout((()=>{this._checkPlayerReady(e,t)}),t.PLAYER_CHECK_INTERVAL)},_configurePlayerForAds:function(e,t){e.fluid(!0),"function"==typeof e.usingNativeControls&&e.usingNativeControls()&&e.usingNativeControls(!1);const i=t.querySelector(".video-js");i&&Object.assign(i.style,{position:"absolute",width:"100%",height:"100%",top:"0",left:"0","padding-top":"unset !important"})},_attachPlayerEventHandlers:function(e,t,i){i.on("adend",(()=>{this._onAdEnd(e,t)})),i.on("error",(i=>{this._onPlayerError(e,t,i)})),i.on("adsready",(()=>{this._onAdsReady(e,t,i)})),i.on("adstart",(()=>{this._onAdStart(e)})),i.on("nopreroll",(()=>{this._onNoPreroll(e)})),i.on("adsmanager",(()=>{this._onAdsManagerLoaded(e)})),i.on("ad_playback_no_ad",(()=>{this._onAdPlaybackNoAd(e,t)})),i.on("ads-ad-started",(()=>{this._onAdsAdStarted(e)})),i.on("ads-request-error",(i=>{this._onAdsRequestError(e,t,i)})),i.on("adserror",(i=>{this._onAdsError(e,t,i)})),i.on("adtimeout",(()=>{this._onAdTimeout(e,t)}))},_onNoVideoAd:function(e,t){this._shouldIgnoreHandler(e)||(console.log("VSAds:: No ads available after adsready - cleaning up overlay (NOVIDEOAD event)"),this._finishAdFlow(e,{cleanupDelay:t.CLEANUP_DELAY,logMessage:"Video ad container removed (no ads available - NOVIDEOAD)"}))},_onVideoPlayerEventIntercept:function(e,t,i,s,a){if(this._shouldIgnorePlayback(e))return;const n=a[0];if(console.log("VSAds:: Video startup ad event intercepted:",n.type,n),"ad_playback_completed"===n.type&&n.video?.video_startup&&!e.iosCleanupTriggered){console.log("VSAds:: Video startup ad pod completed - updating localStorage"),e.iosCleanupTriggered=!0;const i=(new Date).getTime();return localStorage.setItem("lastVideoAdPlayedTime",i.toString()),console.log(`VSAds:: Video startup ad completed at ${new Date(i).toLocaleString()}`),void this._finishAdFlow(e,{cleanupDelay:t.CLEANUP_DELAY,logMessage:"Video startup ad container removed"})}if("playback_completed"!==n.type||!n.video?.video_startup)return e.adStarted&&n.type&&"playback_waiting-stalled"!==n.type&&(e.lastProgressAt=Date.now()),Reflect.apply(i,s,a);console.log("VSAds:: Ignoring playback_completed for video_startup to prevent reconnect")},_onAdEnd:function(e,t){if(!this._shouldIgnoreHandler(e)){if(console.log("VSAds:: Video ad ended."),e.adPlayed){const e=(new Date).getTime();localStorage.setItem("lastVideoAdPlayedTime",e.toString()),console.log(`VSAds:: initializeVideoAd: Video ad completed at ${new Date(e).toLocaleString()}`)}else console.log("VSAds:: initializeVideoAd: No video ad played, not updating lastVideoAdPlayedTime");this._finishAdFlow(e,{cleanupDelay:t.CLEANUP_DELAY})}},_onPlayerError:function(e,t,i){this._shouldIgnoreHandler(e)||(console.log("VSAds:: Video player error:",i),this._finishAfterDelay(e,t,{resumePlayback:!0}))},_onAdsReady:function(e,t,i){if(this._shouldIgnorePlayback(e))return;console.log("VSAds:: Ad is ready to play."),e.adRequested=!0,console.log("VSAds:: initializeVideoAd: Ads system ready, but waiting for actual ad before showing overlay");const s=i.el().querySelector("video");if(s&&(s.setAttribute("playsinline","true"),console.log("VSAds:: Video element attributes set to muted and playsinline.")),i.ima&&i.ima.setAdBreakReadyListener)try{i.ima.setAdBreakReadyListener((()=>{console.log("VSAds:: initializeVideoAd: Ad break ready listener triggered - playing ad break"),i.ima.playAdBreak()})),console.log("VSAds:: initializeVideoAd: setAdBreakReadyListener configured successfully")}catch(e){console.log("VSAds:: initializeVideoAd: Could not set ad break ready listener:",e)}i.play().then((()=>{console.log("VSAds:: Ad video is playing automatically.")})).catch((e=>{console.log("VSAds:: Failed to autoplay the ad video:",e)})),this._playAllVideoJsPlayers(),this._playImaAdVideos()},_onAdStart:function(e){if(this._shouldIgnoreHandler(e))return;const t=(new Date).getTime();
1console.log(`VSAds:: Ad started at: ${new Date(t).toLocaleString()}`),e.adPlayed=!0,e.adStarted=!0,this._startMidPlayStallWatchdog(e),e.containerDom&&e.adRequested&&(e.containerDom.style.display="flex",console.log("VSAds:: initializeVideoAd: Showing overlay - ad is actually playing"),this._mountSponsorNotice(e))},_onNoPreroll:function(e){this._shouldIgnoreHandler(e)||(console.log("VSAds:: No preroll ads available"),this._markNoAdAvailable(e))},_onAdsManagerLoaded:function(e){this._shouldIgnoreHandler(e)||(console.log("VSAds:: Ads manager loaded - ads were returned from server"),e.adRequested=!0)},_onAdPlaybackNoAd:function(e,t){this._shouldIgnoreHandler(e)||(console.log("VSAds:: No ads available after adsready - cleaning up overlay"),this._markNoAdAvailable(e),this._finishAdFlow(e,{cleanupDelay:t.CLEANUP_DELAY,logMessage:"Video ad container removed (no ads available)"}))},_onAdsAdStarted:function(e){this._shouldIgnoreHandler(e)||(console.log("VSAds:: IMA SDK: Ad started playing"),e.adPlayed=!0,e.adStarted=!0,this._startMidPlayStallWatchdog(e),e.containerDom&&e.adRequested&&"none"===e.containerDom.style.display&&(e.containerDom.style.display="flex",console.log("VSAds:: initializeVideoAd: Showing overlay via ads-ad-started event")),this._mountSponsorNotice(e))},_onAdsRequestError:function(e,t,i){this._shouldIgnoreHandler(e)||(console.log("VSAds:: Ad request error - no ads returned:",i),this._markNoAdAvailable(e),this._finishAfterDelay(e,t,{resumePlayback:!0}))},_onAdsError:function(e,t,i){this._shouldIgnoreHandler(e)||(console.log("VSAds:: Ad error occurred:",i),this._finishAfterDelay(e,t,{resumePlayback:!0}))},_onAdTimeout:function(e,t){this._shouldIgnoreHandler(e)||(console.log("VSAds:: Video ad adtimeout - no ad played."),console.log("VSAds:: initializeVideoAd: Ad timed out, not updating lastVideoAdPlayedTime"),this._finishAfterDelay(e,t,{resumePlayback:!0}))},_isCostcoSponsoredUser:function(){try{if(!APP||!APP.USER||"function"!=typeof APP.USER.getPartnerConfig)return!1;const e=APP.USER.getPartnerConfig("costco");return!(!e||"executive"!==e.membershipTier)}catch(e){return console.log("VSAds:: Could not resolve Costco partner config:",e),!1}},_mountSponsorNotice:function(e){if(!e.isSponsored||e.sponsorMounted)return;if(this._activeSponsorHandle)return;const t="undefined"!=typeof com&&com.slacker&&com.slacker.app&&com.slacker.app.components&&com.slacker.app.components.ReactWrapper||null;if(!t||"function"!=typeof t.mount)return void console.log("VSAds:: Costco notice: React unavailable in this context, skipping overlay");const i=e.config||this._getVideoAdConfig(),s=document.createElement("div");s.className="cvsad-band",Object.assign(s.style,{position:"fixed",top:"0",left:"0",right:"0",height:i.SPONSOR_BAND_PX+"px",zIndex:(i.CONTAINER_Z_INDEX+1).toString()}),document.body.appendChild(s);const a=t.mount("CostcoAdNotice",void 0,s);if(!a)return s.parentNode&&s.parentNode.removeChild(s),void console.log("VSAds:: Costco notice: mount failed, removing band");e.sponsorBand=s,e.sponsorMounted=!0,e.sponsorHandle=a,this._activeSponsorHandle=a},_unmountSponsorNotice:function(e){e.sponsorHandle&&(e.sponsorHandle.unmount(),this._activeSponsorHandle===e.sponsorHandle&&(this._activeSponsorHandle=null),e.sponsorHandle=null,e.sponsorMounted=!1),e.sponsorBand&&e.sponsorBand.parentNode&&e.sponsorBand.parentNode.removeChild(e.sponsorBand),e.sponsorBand=null},_removeContainer:function(e,t,i){setTimeout((()=>{e&&e.parentNode&&(e.parentNode.removeChild(e),i&&console.log(i))}),"number"==typeof t?t:200)}},registerPackage("com.slacker.sads.VSAds"),com.slacker.sads.VSAds=new t}()})),bjork("com.slacker.util.CookieJar",(function(){!function(e,t,i,s){const a=e("com.slacker.util.Console");i("com.slacker.util.CookieJar"),t.slacker.util.CookieJar=new class{constructor(){this.version="$LastChangedRevision: 1320 $",this.shadowCookiePrefix=""}composeCookieName(e){return this.shadowCookiePrefix?this.shadowCookiePrefix+"_"+e:e}getCookie(t,i){const a=e("com.slacker.util.encoding.B64");var n=this.composeCookieName(t);i||(i=s);var o="; "+n+"=",r=i.cookie.indexOf(o),l=0,c=0;if(r>-1)l=r+o.length;else{if(n!=i.cookie.substring(0,n.length))return null;l=n.length+1}-1==(c=i.cookie.indexOf(";",l))&&(c=i.cookie.length);var d=i.cookie.substring(l,c);return d.indexOf("<<::")>-1&&(d=a.decode64(d.substring(d.indexOf("<<::")+4,d.length))),d}getCompoundCookie(e,t){var i=this.composeCookieName(e),s=(this.getCookie(i)||"").split(t),a={};if(s.length>1)for(;s.length>0;)a[s.shift()]=s.shift();return a}setCompoundCookie(e,t,i,s,a,n,o,r){var l,c=this.composeCookieName(e),d=[];for(l in t)d.push(l),d.push(t[l]);this.setCookie(c,d.join(i),s,a,n,o,r)}setCookie(i,n,o,r,l,c,d){e("com.slacker.util.encoding.B64");var u,h=this.composeCookieName(i),p=new Date;p.setTime(p.getTime()),o&&(o=1e3*o*60);var m=new Date(p.getTime()+o);d&&(n="<<::"+t.slacker.util.encoding.B64.encode64(n)),u=h+"="+n+(o?";expires="+m.toGMTString():"")+(r?";path="+r:"")+(l?";domain="+l:"")+(c?";secure":""),a.debug("Set Cookie: "+u),s.cookie=u}deleteCookie(e,t,i,n,o){var r=this.composeCookieName(e)+"="+t+";expires=Fri, 31 Dec 1999 23:59:59 GMT"+(i?";path="+i:"")+(n?";domain="+n:"")+(o?";secure":"");
1a.debug("Delete Cookie: "+r),s.cookie=r}}}(require,com,registerPackage,document)})),bjork("com.slacker.util.ParamHash",(function(){{class e{constructor(e,t,i){this.qStr=e,this.pairDelimiter=t||"&",this.namValDelimiter=i||"=",this.hash={},this.qStr.split(this.pairDelimiter).forEach((e=>{let t=e.split(this.namValDelimiter);"debug"==t[0]?this.hash[t[0]]="false"==t[1]?0:t[1]:this.hash[t[0]]=t[1]}))}get(e){return this.hash[e]}set(e,t){this.hash[e]=t}getQueryString(){return this.qStr}}registerPackage("com.slacker.util.ParamHash"),com.slacker.util.ParamHash=e}})),bjork("com.slacker.util.behavior.Beacon",(function(){!function(){const e=require("com.slacker.util.Console");"undefined"==typeof Q_STRING&&(Q_STRING={get:()=>""});registerPackage("com.slacker.util.behavior.Beacon"),com.slacker.util.behavior.Beacon=new class{constructor(){this.RAW_LANDING=location.href,this.EVT_QUEUE=new Array,this.IS_PROCESSING=!1,this.HAS_POST_SPLASH=!1,this.ENV_NAMES={dev:"slackerdev",stg:"slackerdev",prd:"slackerprod","":"slackerprod"},this.count=0,this.isLoadingComplete=!1,this.comScoreCheckCounter=0,this.partnerLogging={},this.elapsedInterval=null,this.appStartElapsedTime=null,window.addEventListener("message",this._handleEmbeddedAppBeacon,!1)}init(e){this.initTime=this.partnerLogging.initTime||(new Date).getTime(),this.partnerLogging.enableGA&&this.partnerLogging.gaConfig.ua&&this._setUpGA(this.partnerLogging.gaConfig.dimensions),this.partnerLogging.comscore&&this._setUpComscore()}addQueueEvent(e,t){this.EVT_QUEUE.push({t:e,o:t})}processQueueEvents(){if(this.IS_PROCESSING)return;this.IS_PROCESSING=!0;const t=this.EVT_QUEUE.shift();if(t)try{switch(e.debug("Process beacon: "+t.t),t.t){case"view":this._doTagView(t.o);break;case"event":this._doTagEvent(t.o);break;default:e.warn("Unknown beacon type: "+t.t)}}catch(i){e.error("Error processing beacon type: "+t.t+": ",i)}this.IS_PROCESSING=!1,this.EVT_QUEUE.length>0&&this.processQueueEvents()}appendConfig(e,t){for(let i in t)e[i]=t[i];return t["evt-start-time"]&&(e["event-load-time"]=(new Date).getTime()-t["evt-start-time"]),e}tagView(t){t.name?(this.addQueueEvent("view",t),setTimeout((()=>this.processQueueEvents()),10)):e.warn("Beacon.tagView called without view name")}_doTagView(t){t.params||(t.params={}),t.params.client=this.partnerLogging.client,t.params.cid=APP.embedCampaign&&APP.embedCampaign(),this._doSlackerBeacon("page",t),Object.keys(this.partnerLogging).forEach((i=>{let s;try{switch(i){case"enableGA":s="_doGA";break;case"comscore":s="_doComscore"}s&&this[s]("page",t)}catch(i){e.error(["Could not fire event",s,t.name," "],i)}}))}tagEvent(t){t.name?(t.params||(t.params={}),t.params.client=this.partnerLogging.client,t.params.cid=APP.embedCampaign&&APP.embedCampaign(),this.addQueueEvent("event",t),setTimeout((()=>this.processQueueEvents()),10)):e.warn("Beacon.tagEvent called without event name")}ingnoreResponseHandler(t,i,s){s?e.debug("Ignored beacon response: "+s.status):e.debug("Ignored beacon response: "+i)}_doTagEvent(t){this._doSlackerBeacon("event",t),Object.keys(this.partnerLogging).forEach((i=>{let s;try{if("enableGA"===i)s="_doGA";s&&this[s]("event",t)}catch(s){e.error(["Could not fire event",i,t.name," "],s)}}))}_doSlackerBeacon(e,t){const i=(new Date).getTime();let s=APP.SERVICE.URLMODULE.SERVICE.API.EVENTBEACON,a="POST",n=[],o={eventType:"beacon",eventName:null,version:"1.3",data:{eventTime:i,context:{screen:`${window.innerWidth}x${window.innerHeight}`}}};if(this.partnerLogging.slackerIgnore.events&&(n=n.concat(this.partnerLogging.slackerIgnore.events)),APP.slackerAcct()&&(o.data.context.slackerAccountId=APP.slackerAcct()),t.params.cid&&(o.data.context.embeddedOn=t.params.cid),"page"!=e||this.isLoadingComplete){if("appStart"!=o.eventName&&(o.eventNumber=this.count++),"page"==e)o.eventName="pageView","home"==t.name&&(t.name="/"),o.data.page=t.name;else if(!n.includes(t.name)){if(o.eventName=t.name,"appStart"==o.eventName){let e=Date.now();this.elapsedInterval=setInterval((()=>{this.appStartElapsedTime=Date.now()-e}),100),a="GET",s=APP.SERVICE.URLMODULE.SERVICE.API.APPSTARTBEACON+"?version=1.2",APP.slackerAcct()&&(s+="&slackerAccountId="+APP.slackerAcct())}switch("loadingComplete"==t.name&&(this.isLoadingComplete=!0),t.name){case"loadingComplete":clearInterval(this.elapsedInterval),o.data.elapsed=this.appStartElapsedTime,o.data.page=t.params.page||"/";break;case"playStart":o.data.objectId=t.params.video||t.params.station;break;case"preroll":case"midroll":o.data.state=t.params.value,o.data.contentId=t.params.label;break;
1case"showPrompt":o.data.name=t.params.value;["contentType","missingRights","accountTier"].forEach((e=>{void 0!==t.params[e]&&(o.data[e]=t.params[e])}));break;case"hidePrompt":o.data.name=t.params.value,o.data.button=t.params.label;break;case"volume":o.eventName=t.params.value,o.data.contentId=t.params.label;break;case"register":if("complete"!=t.params.value)return;o.data.registerType=t.params.label;break;case"login":if("ok"==t.params.value&&"normal"==t.params.label)o.data.loginType=APP.USER.user().loginType;else{if("accountKit"!=t.params.value)return;"sms"==t.params.label||"email"==t.params.label?(o.eventName="loginRequest",o.data.method=t.params.label):(o.eventName="loginResponse",o.data.value=t.params.label),o.data.type=t.params.value}break;default:t.params&&(t.params.value&&(o.data.method=t.params.value),t.params.label&&(o.data.value=t.params.label))}}o.eventName&&s&&this._doBeaconAction(APP.SERVICE.URLMODULE.get(s),{sentTime:i,events:[o]},a)}}_doGA(t,i){const s=APP.USER.slackerUser(),a=this.partnerLogging.gaConfig;let n=null,o={},r={traffic_type:"prd"==APP_ENV?"exernal":"internal",user_level:s.actualTier||s.tier||0,embed_cid:APP.embedCampaign()};if(this.RAW_LANDING&&this.RAW_LANDING.indexOf("?")>-1?r.query_string=this.RAW_LANDING.substring(this.RAW_LANDING.indexOf("?")+1):location.search&&(r.query_string=location.search.substring(1)),"event"==t){if("appStart"==i.name||"loadingComplete"==i.name||"*"!==a.events&&a.events&&!a.events[i.name])return void e.debug("Disregarding GA event: "+i.name);e.debug("Allow GA event: "+i.name),o={name:i.name,value:i.value,label:i.type},i.params&&Object.keys(i.params).filter((e=>"name"!==e&&o.hasOwnProperty(e))).forEach((e=>o[e]=i.params[e]));const t={dataLayer:{event:i.name,category:o.name,action:o.name,value:o.value,label:o.label,...i.params,...r}};window.self!==window.top&&window.top.origin===window.location.origin?window.parent.postMessage(JSON.stringify(t),window.location.origin):"undefined"!=typeof gtmDataLayer&>mDataLayer.push(t.dataLayer)}else if(a.pageview)if(this.RAW_LANDING)this.RAW_LANDING=null;else{n=location.pathname.indexOf("index.html")>-1?i.name:location.pathname;const e={dataLayer:{page:n,event:"navigate",...r}};gtag("set","page_path",n),window.self!==window.top&&window.top.origin===window.location.origin?window.parent.postMessage(JSON.stringify(e),window.location.origin):"undefined"!=typeof gtmDataLayer&>mDataLayer.push(e.dataLayer)}}_doBeaconAction(t,i,s,a,n){e.debug(["Sending beacon"]);let o={"Content-Type":"application/vnd.lxl.pingback+json;version=1"};if(n)for(let e in n)o[e]=n[e];APP.NETWORKING.do(t,a,s,"","POST"==s?JSON.stringify(i):null,o)}_doBeaconUrl(t,i){let s=new Image;t=t.replace(/&&/g,"&");const a={TIMESTAMP:()=>encodeURIComponent((new Date).toISOString()),CACHEBUSTING:()=>String(Math.floor(1e10*Math.random())),CACHEBUSTER:()=>String(Math.floor(1e10*Math.random())),DEVICEUA:()=>encodeURIComponent(navigator.userAgent),CLIENTUA:()=>encodeURIComponent("LiveOne Web Player"),PLAYERSIZE:()=>encodeURIComponent(window.innerWidth+","+window.innerHeight),PLAYERSTATE:()=>encodeURIComponent(document.hidden?"backgrounded":document.fullscreenElement?"fullscreen":"normal"),ERRORCODE:()=>"",DEVICEIP:()=>"",ADPLAYHEAD:()=>"",MEDIAPLAYHEAD:()=>"",CONTENTPLAYHEAD:()=>"",INVENTORYSTATE:()=>"",ASSETURI:()=>"",CLICKPOS:()=>""};let n=t,o=[];Object.keys(a).forEach((e=>{let i=new RegExp("\\["+e+"\\]","gi"),s=new RegExp("%5B"+e+"%5D","gi");if(!i.test(t)&&!s.test(t))return;let n=a[e]();t=(t=t.replace(i,n)).replace(s,n),o.push("["+e+"]"+(""===n?" (empty)":""))}));let r=[];if(t=t.replace(/(\[[A-Z_]+\]|%5B[A-Z_]+%5D)/g,(e=>(r.push(e.replace(/%5B/g,"[").replace(/%5D/g,"]")),""))),o.length>0||r.length>0){let i=[];o.length>0&&i.push("Replaced: "+o.join(", ")),r.length>0&&i.push("Unknown (emptied): "+r.join(", ")),e.info("Beacon::_doBeaconUrl VAST macro replacement\n "+i.join(" | ")+"\n before: "+n+"\n after: "+t)}s.onload=()=>{e.debug("beacon() success! URL:\n"+t),s=null},void 0!==i&&(s.onerror=()=>{i.apply(null,[t]),s=null}),e.debug("beacon() firing URL:\n"+t),s.src=t}_doComscore(t,i){if("undefined"==typeof COMSCORE)e.warn("Waiting for comscore API."),this.comScoreCheckCounter<10?(this.comScoreCheckCounter++,setTimeout((()=>this._doComscore(t,i)),1e3)):e.warn("Comscore API failed to load. Giving up.");else{let e=location.protocol+"//"+location.hostname,t=i.name.split("/")[0],s="";switch(i.name){case"home":e+="/";break;case"blog":e+="/the-daily";break;default:e+="/"+i.name}switch(t){case"genre":case"channel":case"live-events":s=i.name.split("/")[1],s||(s="")}location.search&&(e+=location.search),COMSCORE.beacon({c1:"2",c2:this.partnerLogging.comscore,c4:e,c5:s,c6:t,cs_ucfr:"0"})}}_handleEmbeddedAppBeacon(e){if([window.location.origin,window.location.origin.replace("www","account"),window.location.origin.replace("www","store")].includes(e.origin))try{let t=JSON.parse(e.data);t.dataLayer&>mDataLayer.push(t.dataLayer)}catch(e){}}_setUpGA(t){let i=this.partnerLogging.gaConfig,s="*";!function(){const e=document.createElement("script"),t=document.getElementsByTagName("script")[0];
1e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${i.ga4}`,t.parentNode.insertBefore(e,t)}(),window.gtmDataLayer=window.gtmDataLayer||[],window.gtag=function(){gtmDataLayer.push(arguments)},gtag("js",new Date);let a={anonymize_ip:!0,send_page_view:!1,cookie_flags:"SameSite=None;Secure",linker:{domains:["slacker.com","livexlive.com","liveone.com"]}};i.events&&"string"!=typeof i.events&&(s={},i.events.forEach((t=>{e.debug("Setting GA event allowed: "+t),s[t]=1}))),i.events=s,t&&(a.custom_map=Object.keys(t).reduce(((e,i)=>(e[i]=t[i].name,t[i].value&&(e[t[i].name]=t[i].value),e)),{})),gtag("config",i.ga4,a)}_setUpComscore(){var t,i;e.warn("Loading Comscore API."),t=document.createElement("script"),i=document.getElementsByTagName("script")[0],t.async=!0,t.src=("https:"==document.location.protocol?"https://sb":"http://b")+".scorecardresearch.com/beacon.js",i.parentNode.insertBefore(t,i)}}}()})),bjork("com.slacker.util.behavior.VzwAudience",(function(){registerPackage("com.slacker.util.behavior.VzwAudience"),com.slacker.util.behavior.VzwAudience=new class{constructor(){this.urlBase="https://ethapps.dltdemo.io:10101/api/audiencemeasure/v1",this.enabled=!1}init(e){this.enabled=!1}_doBeaconAction(e,t){if(this.enabled){let i=e.data.metadata;delete i.duration,i.viewTime=t,i.userId=APP.USER.user().accountId,BEACON._doBeaconAction(this.urlBase+"/update/count",{userData:i},"POST",BEACON.ingnoreResponseHandler,{"Content-Type":"application/json"})}}}})),bjork("com.slacker.util.browser.Browser",(function(){registerPackage("com.slacker.util.browser.Browser"),com.slacker.util.browser.Browser=new class{constructor(){if(this.UA=window.navigator.userAgent||navigator.vendor||window.opera,this.utils,this.version,this._visible=!1,this.isChrome()){let e=/Chrome\/(\d+(\.\d+)?(\.\d+)?(\.\d+)?)/.exec(navigator.appVersion);this.version=e?e[1]:0}else if(this.isIE()){let e=/MSIE(\d+\.\d+)/.exec(navigator.appVersion);this.version=e?e[1]:0}}uaCheck(e){return this.UA.toLowerCase().indexOf(e.toLowerCase())>-1}isVisible(){return this._visible}isIE(){return this.uaCheck("MSIE")||this.uaCheck("Trident/")}isIE7(){return this.uaCheck("MSIE 7")&&!this.uaCheck("Trident/4.0")}isIE8(){return this.uaCheck("MSIE 8")||this.isIE8CompatibilityView()}isIE8CompatibilityView(){return this.uaCheck("MSIE 7")&&this.uaCheck("Trident/4.0")}isIE9(){return this.uaCheck("trident/5.0")||this.uaCheck("MSIE 9")}isIE10(){return this.uaCheck("trident/6.0")}isMsEdge(){return this.uaCheck("Win")&&this.uaCheck("Edge")}isMSHostApp(){return this.uaCheck("MSAppHost")}isMSDesktopHostApp(){return this.isMSHostApp()&&this.uaCheck("Windows NT")}isMSMobileHostApp(){return this.isMSHostApp()&&this.uaCheck("Windows Phone")}isMSXboxHostApp(){return this.isMSHostApp()&&this.uaCheck("Xbox One")}isIEPinnable(){return this.isWindows7()&&this.isIE9()}isOSPinnable(){return this.isWindows7()}isSitePinned(){return!!(this.isIE()&&window.external&&"msIsSiteMode"in window.external&&window.external.msIsSiteMode())}isMac(){return this.uaCheck("Mac")&&!this.isIOS()}isMacMojave(){return this.isMac()&&this.uaCheck("OS X 10_14")}isWindows(){return this.uaCheck("Windows")}isWindows7(){return this.uaCheck("Windows NT 7.")||this.uaCheck("Windows NT 6.1")}isVista(){return this.uaCheck("Windows NT 6.0")}isXp(){return this.uaCheck("Windows NT 5.1")}isChrome(){return this.uaCheck("Chrome/")}isFirefox(){return this.uaCheck("Firefox/")}isSafari(){return this.uaCheck("Safari/")&&!this.uaCheck("Chrome/")&&!this.uaCheck("Tizen")&&!this.isAutomotive()&&!this.isTV()}isCorsSupported(){return!this.isIE7()}canUseHtml5AudioMimeType(){return!this.isMobileDevice()&&!this.isTV()}supportsHTML5MediaSource(){var e,t=this.UA.match(/OMI\/(\d+\.\d+\.\d+\.\d+)/),i=this.uaCheck("OPR/")&&t?t[1]:null;return i?!((e=i.split("."))[0]<4||4==e[0]&&e[1]<8||4==e[0]&&8==e[1]&&e[0]<2):"undefined"!=typeof fetch&&"undefined"!=typeof MediaSource&&void 0!==MediaSource.isTypeSupported}supportsMediaSourceFormat(e){if(!this.supportsHTML5MediaSource())return!1;switch(e){case"mp3":return MediaSource.isTypeSupported("audio/mpeg");
1case"aac":return MediaSource.isTypeSupported('video/mp4;codecs="mp4a.40.5"');default:return!1}}isMobileDevice(){if(this.isTV())return!1;if(this.isAndroidPhone()||this.isAndroidTablet()||this.isPhone()||this.UA.match(/Chrome\/[.0-9]* Mobile/i)||this.isIOS())return!0;var e,t=!1;return e=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|(android \d\.)|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=!0),t}getPhoneModelInfo(){return this.uaCheck("phone")||this.UA.match(/Chrome\/[.0-9]* Mobile/i)||this.UA.match(/(galaxy)?\s?nexus ([3|4|5|6])?/i)||this.UA.match(/(GT-I9)|(SM-N9)|(SGH-)/i)||this.UA.match(/; HTC/i)||this.isAndroidPhone()}isPhone(){return 0!=this.getPhoneModelInfo()}isAndroidTablet(){return this.uaCheck("android")&&!this.uaCheck("mobile")}isAndroidPhone(){return this.uaCheck("android")&&this.uaCheck("mobile")||this.uaCheck("SGH-")}isIOS(){return this.uaCheck("iphone")||this.uaCheck("ipod")||this.uaCheck("ipad")}isDesktop(){return!(this.isMSHostApp()||this.uaCheck("xbox")||this.isTV()||this.isMobileDevice()&&void 0!==window.orientation)}isTV(){const e=this.UA.match(/OMI\/(\d+\.\d+\.\d+\.\d+)/);return this.UA.match(/(-)?TV/)||this.uaCheck("Google TV")||this.uaCheck("Xbox")||this.uaCheck("xbox")||this.uaCheck("Large Screen")||this.uaCheck("SonyCEBrowser")||this.uaCheck("BRAVIA")||this.uaCheck("AmazonWebAppPlatform")||this.uaCheck("OPR/")&&e||this.uaCheck("Silk/")&&this.uaCheck("AFTT")||this.uaCheck("Tizen")||this.uaCheck("SmartTV")||this.uaCheck("smarttv")}
1isAutomotive(){return this.uaCheck("QtCarBrowser")||this.uaCheck("Tesla")}keyEventHasCapsLock(e){var t="caps_lock_on",i="caps_lock_off",s="caps_lock_undetermined";if(!e)return!1;var a=e.which,n=String.fromCharCode(a),o=n.toUpperCase(),r=n.toLowerCase(),l=e.shiftKey;return(o!==r?n!==o||l?n!==r||l?n===r&&l?t:n!==o||!l||-1===navigator.platform.toLowerCase().indexOf("win")&&-1===navigator.platform.toLowerCase().indexOf("mac")?s:i:i:t:s)===t}onWindowVisibilityChange(e){var t="visible",i="hidden",s={focus:t,focusin:t,pageshow:t,blur:i,focusout:i,pagehide:i};(e=e||window.event).type in s?com.slacker.util.browser.Browser._visible=s[e.type]==t:com.slacker.util.browser.Browser._visible=0==this.hidden||this.hidden==t}versionComparison(e,t){const i=e=>e.split(".").map((e=>Number(e))),s=(e,t,i)=>e.length===t.length?"pass"===e.reduce(((s,a,n)=>"equal"===s?i(e[n],t[n])?"pass":e[n]===t[n]?"equal":"fail":"pass"===s?"pass":"fail"===s?"fail":void 0),"equal"):(console.log("Invalid versionComparison arg! Returning false."),!1),a=i(this.version),n=i(e),o=(e,t)=>e<t,r=(e,t)=>e>t,l=e===this.version;switch(t){case"GT":return s(a,n,r);case"GTE":return s(a,n,r)||l;case"LT":return s(a,n,o);case"LTE":return s(a,n,o)||l;case"EQ":return l;default:return console.log("No versionComparison operator provided! Using equality."),l}}versionInRange(e,t){return this.versionComparison(e,"GTE")&&this.versionComparison(t,"LTE")}},"hidden"in document?document.addEventListener("visibilitychange",com.slacker.util.browser.Browser.onWindowVisibilityChange):"mozHidden"in document?document.addEventListener("mozvisibilitychange",com.slacker.util.browser.Browser.onWindowVisibilityChange):"webkitHidden"in document?document.addEventListener("webkitvisibilitychange",com.slacker.util.browser.Browser.onWindowVisibilityChange):"msHidden"in document?document.addEventListener("msvisibilitychange",com.slacker.util.browser.Browser.onWindowVisibilityChange):"onfocusin"in document?document.onfocusin=document.onfocusout=com.slacker.util.browser.Browser.onWindowVisibilityChange:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=com.slacker.util.browser.Browser.onWindowVisibilityChange,void 0!==document.hidden&&com.slacker.util.browser.Browser.onWindowVisibilityChange({type:document.hidden?"blur":"focus"})})),bjork("com.slacker.util.encoding.B64",(function(){!function(){function e(){this.oCopy="This code was written by Tyler Akins and has been placed in thepublic domain. It would be nice if you left this header intact.Base64 code from Tyler Akins -- http://rumkin.com2007 - Slacker, Inc. DB - modified to fit into 'Jax' framework.",this.version="$LastChangedRevision: 1322 $",this.keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}e.prototype={encode64:function(e){var t,i,s,a,n,o,r,l=[],c=0;"string"!=typeof e&&(e=e.toString?e.toString():new String(e));do{a=(t=e.charCodeAt(c++))>>2,n=(3&t)<<4|(i=e.charCodeAt(c++))>>4,o=(15&i)<<2|(s=e.charCodeAt(c++))>>6,r=63&s,isNaN(i)?o=r=64:isNaN(s)&&(r=64),l[l.length]=this.keyStr.charAt(a),l[l.length]=this.keyStr.charAt(n),l[l.length]=this.keyStr.charAt(o),l[l.length]=this.keyStr.charAt(r)}while(c<e.length);return l.join("")},decode64:function(e){var t,i,s,a,n,o,r=[],l=0;if(!e)return"";(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4!=0&&(e+="=".repeat(4-e.length%4));do{t=this.keyStr.indexOf(e.charAt(l++))<<2|(a=this.keyStr.indexOf(e.charAt(l++)))>>4,i=(15&a)<<4|(n=this.keyStr.indexOf(e.charAt(l++)))>>2,s=(3&n)<<6|(o=this.keyStr.indexOf(e.charAt(l++))),r[r.length]=String.fromCharCode(t),64!=n&&(r[r.length]=String.fromCharCode(i)),64!=o&&(r[r.length]=String.fromCharCode(s))}while(l<e.length);return r.join("")}},registerPackage("com.slacker.util.encoding.B64"),com.slacker.util.encoding.B64=new e}()})),bjork("com.slacker.util.encoding.MD5",(function(){!function(){var e=0,t="",i=8;function s(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var i=1732584193,s=-271733879,a=-1732584194,c=271733878,u=0;u<e.length;u+=16){var h=i,p=s,m=a,g=c;i=n(i,s,a,c,e[u+0],7,-680876936),c=n(c,i,s,a,e[u+1],12,-389564586),a=n(a,c,i,s,e[u+2],17,606105819),s=n(s,a,c,i,e[u+3],22,-1044525330),i=n(i,s,a,c,e[u+4],7,-176418897),c=n(c,i,s,a,e[u+5],12,1200080426),a=n(a,c,i,s,e[u+6],17,-1473231341),s=n(s,a,c,i,e[u+7],22,-45705983),i=n(i,s,a,c,e[u+8],7,1770035416),c=n(c,i,s,a,e[u+9],12,-1958414417),a=n(a,c,i,s,e[u+10],17,-42063),s=n(s,a,c,i,e[u+11],22,-1990404162),i=n(i,s,a,c,e[u+12],7,1804603682),c=n(c,i,s,a,e[u+13],12,-40341101),a=n(a,c,i,s,e[u+14],17,-1502002290),i=o(i,s=n(s,a,c,i,e[u+15],22,1236535329),a,c,e[u+1],5,-165796510),c=o(c,i,s,a,e[u+6],9,-1069501632),a=o(a,c,i,s,e[u+11],14,643717713),s=o(s,a,c,i,e[u+0],20,-373897302),i=o(i,s,a,c,e[u+5],5,-701558691),c=o(c,i,s,a,e[u+10],9,38016083),a=o(a,c,i,s,e[u+15],14,-660478335),s=o(s,a,c,i,e[u+4],20,-405537848),i=o(i,s,a,c,e[u+9],5,568446438),c=o(c,i,s,a,e[u+14],9,-1019803690),a=o(a,c,i,s,e[u+3],14,-187363961),s=o(s,a,c,i,e[u+8],20,1163531501),i=o(i,s,a,c,e[u+13],5,-1444681467),c=o(c,i,s,a,e[u+2],9,-51403784),a=o(a,c,i,s,e[u+7],14,1735328473),i=r(i,s=o(s,a,c,i,e[u+12],20,-1926607734),a,c,e[u+5],4,-378558),c=r(c,i,s,a,e[u+8],11,-2022574463),a=r(a,c,i,s,e[u+11],16,1839030562),s=r(s,a,c,i,e[u+14],23,-35309556),i=r(i,s,a,c,e[u+1],4,-1530992060),c=r(c,i,s,a,e[u+4],11,1272893353),a=r(a,c,i,s,e[u+7],16,-155497632),s=r(s,a,c,i,e[u+10],23,-1094730640),i=r(i,s,a,c,e[u+13],4,681279174),c=r(c,i,s,a,e[u+0],11,-358537222),a=r(a,c,i,s,e[u+3],16,-722521979),s=r(s,a,c,i,e[u+6],23,76029189),i=r(i,s,a,c,e[u+9],4,-640364487),c=r(c,i,s,a,e[u+12],11,-421815835),a=r(a,c,i,s,e[u+15],16,530742520),i=l(i,s=r(s,a,c,i,e[u+2],23,-995338651),a,c,e[u+0],6,-198630844),c=l(c,i,s,a,e[u+7],10,1126891415),a=l(a,c,i,s,e[u+14],15,-1416354905),s=l(s,a,c,i,e[u+5],21,-57434055),i=l(i,s,a,c,e[u+12],6,1700485571),c=l(c,i,s,a,e[u+3],10,-1894986606),a=l(a,c,i,s,e[u+10],15,-1051523),s=l(s,a,c,i,e[u+1],21,-2054922799),i=l(i,s,a,c,e[u+8],6,1873313359),c=l(c,i,s,a,e[u+15],10,-30611744),a=l(a,c,i,s,e[u+6],15,-1560198380),s=l(s,a,c,i,e[u+13],21,1309151649),i=l(i,s,a,c,e[u+4],6,-145523070),c=l(c,i,s,a,e[u+11],10,-1120210379),a=l(a,c,i,s,e[u+2],15,718787259),s=l(s,a,c,i,e[u+9],21,-343485551),i=d(i,h),s=d(s,p),a=d(a,m),c=d(c,g)}return Array(i,s,a,c)}function a(e,t,i,s,a,n){return d((o=d(d(t,e),d(s,n)))<<(r=a)|o>>>32-r,i);var o,r}function n(e,t,i,s,n,o,r){return a(t&i|~t&s,e,t,n,o,r)}function o(e,t,i,s,n,o,r){return a(t&s|i&~s,e,t,n,o,r)}function r(e,t,i,s,n,o,r){return a(t^i^s,e,t,n,o,r)}function l(e,t,i,s,n,o,r){return a(i^(t|~s),e,t,n,o,r)}function c(e,t){var a=u(e);a.length>16&&(a=s(a,e.length*i));for(var n=Array(16),o=Array(16),r=0;r<16;r++)n[r]=909522486^a[r],o[r]=1549556828^a[r];var l=s(n.concat(u(t)),512+t.length*i);return s(o.concat(l),640)}function d(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function u(e){for(var t=Array(),s=(1<<i)-1,a=0;a<e.length*i;a+=i)t[a>>5]|=(e.charCodeAt(a/i)&s)<<a%32;return t}function h(e){for(var t="",s=(1<<i)-1,a=0;a<32*e.length;a+=i)t+=String.fromCharCode(e[a>>5]>>>a%32&s);return t}function p(t){for(var i=e?"0123456789ABCDEF":"0123456789abcdef",s="",a=0;a<4*t.length;a++)s+=i.charAt(t[a>>2]>>a%4*8+4&15)+i.charAt(t[a>>2]>>a%4*8&15);return s}function m(e){for(var i="",s=0;s<4*e.length;s+=3)for(var a=(e[s>>2]>>s%4*8&255)<<16|(e[s+1>>2]>>(s+1)%4*8&255)<<8|e[s+2>>2]>>(s+2)%4*8&255,n=0;n<4;n++)8*s+6*n>
132*e.length?i+=t:i+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(a>>6*(3-n)&63);return i}registerPackage("com.slacker.util.encoding.MD5"),com.slacker.util.encoding.MD5=new function(){this.hex_md5=function(e){return p(s(u(e),e.length*i))},this.b64_md5=function(e){return m(s(u(e),e.length*i))},this.str_md5=function(e){return h(s(u(e),e.length*i))},this.hex_hmac_md5=function(e,t){return p(c(e,t))},this.b64_hmac_md5=function(e,t){return m(c(e,t))},this.str_hmac_md5=function(e,t){return h(c(e,t))}}}()})),bjork("com.slacker.util.encoding.SHA1",(function(){{var e=8;function t(){}function i(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var i=Array(80),n=1732584193,l=-271733879,c=-1732584194,d=271733878,u=-1009589776,h=0;h<e.length;h+=16){for(var p=n,m=l,g=c,P=d,y=u,f=0;f<80;f++){i[f]=f<16?e[h+f]:r(i[f-3]^i[f-8]^i[f-14]^i[f-16],1);var A=o(o(r(n,5),s(f,l,c,d)),o(o(u,i[f]),a(f)));u=d,d=c,c=r(l,30),l=n,n=A}n=o(n,p),l=o(l,m),c=o(c,g),d=o(d,P),u=o(u,y)}return Array(n,l,c,d,u)}function s(e,t,i,s){return e<20?t&i|~t&s:e<40?t^i^s:e<60?t&i|t&s|i&s:t^i^s}function a(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function n(t,s){var a=l(t);a.length>16&&(a=i(a,t.length*e));for(var n=Array(16),o=Array(16),r=0;r<16;r++)n[r]=909522486^a[r],o[r]=1549556828^a[r];var c=i(n.concat(l(s)),512+s.length*e);return i(o.concat(c),672)}function o(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function r(e,t){return e<<t|e>>>32-t}function l(t){for(var i=Array(),s=(1<<e)-1,a=0;a<t.length*e;a+=e)i[a>>5]|=(t.charCodeAt(a/e)&s)<<24-a%32;return i}function c(t){for(var i="",s=(1<<e)-1,a=0;a<32*t.length;a+=e)i+=String.fromCharCode(t[a>>5]>>>24-a%32&s);return i}function d(e){for(var t="0123456789abcdef",i="",s=0;s<4*e.length;s++)i+=t.charAt(e[s>>2]>>8*(3-s%4)+4&15)+t.charAt(e[s>>2]>>8*(3-s%4)&15);return i}function u(e){for(var t="",i=0;i<4*e.length;i+=3)for(var s=(e[i>>2]>>8*(3-i%4)&255)<<16|(e[i+1>>2]>>8*(3-(i+1)%4)&255)<<8|e[i+2>>2]>>8*(3-(i+2)%4)&255,a=0;a<4;a++)8*i+6*a>32*e.length?t+="=":t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(s>>6*(3-a)&63);return t}t.prototype={hex_sha1:function(t){return d(i(l(t),t.length*e))},b64_sha1:function(t){return u(i(l(t),t.length*e))},str_sha1:function(t){return c(i(l(t),t.length*e))},hex_hmac_sha1:function(e,t){return d(n(e,t))},b64_hmac_sha1:function(e,t){return u(n(e,t))},str_hmac_sha1:function(e,t){return c(n(e,t))}},registerPackage("com.slacker.util.encoding.SHA1"),com.slacker.util.encoding.SHA1=new t}})),bjork("com.slacker.util.encoding.SignatureVerifier",(function(){{const e=require("com.slacker.util.encoding.SHA1"),t=require("com.slacker.util.encoding.B64"),i=require("com.slacker.util.Console");class s{constructor(){this.salt="http://www.slacker.com/wsv1/sdplayer/station/definitions/",this.saltNumber=16935270,this.defaultPublicKey="MIIBuDCCASwGByqGSM44BAEwggEfAoGBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAhUAl2BQjxUjC8yykrmCouuEC/BYHPUCgYEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoDgYUAAoGBAMm2Z9JJaFiZK9UHsXRUbfbqkvAYOYnSBah3rylo3C/tv+1YV22PGb1YdIuPHhI0Dug7IRPhT5P03oLOt1FBeN92+TwModsu+U18qrAndWvLWzRw+4rV7hdd7hPjvfForg9pHln5Drvw2P6cmOnh9pdGPrNsI58SBaPxWUnKknk6"}verifySimple(s,a){let n=s.substring(2),o=[];o.push(this.salt),o.push(t.decode64(this.defaultPublicKey)),o.push(a),o.push(""+this.saltNumber);let r=o.join(""),l=(new Date).getTime(),c=e.b64_sha1(r),d=(new Date).getTime()-l;return i.debug("SHA1 took "+d+" ms"),n.length==c.length&&n==c}}registerPackage("com.slacker.util.encoding.SignatureVerifier"),com.slacker.util.encoding.SignatureVerifier=new s}})),bjork("com.slacker.util.ko.AsyncUtils",(function(){!function(){"use strict";var e=function(e,t,i){var s,a=e.observable(i);a.inProgress=e.observable(!1),a.getter=t;var n=function(){s&&s(),a.inProgress(!0);var e=function(){var e=t();if(null!=e&&e.then)return e;throw new Error("Computed must return Promise or be async function")}();new Promise((function(t,i){s=i,e.then((function(e){return t(e)})),e.catch((function(e){return i(e)}))})).then((function(e){a.inProgress(!1),a(e),s=null})).catch((function(e){s=null}))};n();var o=t.subscribe((function(e){return n()}));return a.dispose=function(){o.dispose(),null==s||s(),t.dispose()},a},t=function(t){return function(i,s){return e(t,i,s)}};registerPackage("com.slacker.util.ko.AsyncUtils"),com.slacker.util.ko.AsyncUtils={computedPromise:e,createExtender:t,registerAsyncComputed:function(e){e.extenders.async=t(e)},asyncComputed:function(t,i){return e(ko,ko.computed((function(){return t()})),i)}}}()})),bjork("com.slacker.util.social.Share",(function(){!function(){require("com.slacker.util.Console");const e=com.slacker.util.Console,t=function(){this.currentShare={},this.PARTNER_SERVICE_IDS={twitter:"@liveone",appname:"LiveOne"},this.SHARE_TEMPLATE={embed:{},email:{},facebook:{window:{w:626,h:436,url:"https://www.facebook.com/sharer/sharer.php?u=<url>"}},twitter:{window:{w:527,h:433,url:"https://twitter.com/intent/tweet?original_referer=<referrer>&text=<description>&tw_p=tweetbutton&url=<url>&via=<twitter-id>"}}},this.MSG_TEMPLATES={station:{twitter:{msg:"I'm listening to {{name}} on {{twitter-id}}. You should too."},pintrest:{msg:"I'm listening to {{name}} on {{app-name}}. You should too."},tumblr:{msg:"I'm listening to {{name}}. You should too.",source:'<a href="{{url}}">Listen on {{app-name}}</a>'}},playlist:{twitter:{msg:"I'm listening to the custom playlist {{name}} on {{twitter-id}}. You should too."},pintrest:{msg:"My custom {{name}} playlist on {{app-name}}."},tumblr:{msg:"My custom {{name}} playlist on {{app-name}}. Start listening or make your own!",source:'<a href="{{url}}">Listen on {{app-name}}</a>'}},artist:{twitter:{msg:"I'm listening to {{name}} on {{twitter-id}}. You should too."},pintrest:{msg:"{{firstSentence}} Start Listening on {{app-name}}."},tumblr:{msg:"{{firstSentence}} Start Listening on {{app-name}}.",source:'<a href="{{url}}">Listen on {{app-name}}</a>'}},album:{twitter:{msg:"I'm listening to {{name}}. You should too."},pintrest:{msg:"{{firstSentence}} Start Listening on {{app-name}}."},tumblr:{msg:"{{firstSentence}} Start Listening on {{app-name}}.",source:'<a href="{{url}}">Listen on {{app-name}}</a>'}},song:{twitter:{msg:"I'm listening to {{name}} on {{twitter-id}}. You should too."},pintrest:{msg:"I'm listening to {{name}} on {{app-name}}. You should too."},tumblr:{msg:"I'm listening to {{name}}. You should too.",source:'<a href="{{url}}">Listen on {{app-name}}</a>'}}},this.init()};t.prototype={init:function(){this.currentShare={itemType:[],itemName:[],url:[],rawurl:[],img:[],description:[]}},appendShare:function(e,t,i,s,a){if(e&&this.currentShare.itemType.push(e),i&&this.currentShare.itemName.push(i),a&&this.currentShare.img.push(a),s&&this.currentShare.description.push(s),t){t.indexOf("?")>-1?t+="&sharedby="+WS.getUser().get("id")+"&sharedon="+Math.round((new Date).getTime()/1e3):t+="?sharedby="+WS.getUser().get("id")+"&sharedon="+Math.round((new Date).getTime()/1e3),
10==t.indexOf("http:")&&(t=t.replace("http:","https:")),this.currentShare.rawurl.push(t),this.currentShare.url.push(t);let e=this.currentShare.url.length-1;this.__getShortUrlForShare(t,e)}},__getShortUrlForShare:function(t,i){const s=this;WS.getUrlAlias([t],PARTNER,(function(a){if(a){let n=com.slacker.io.HttpRequest.getRequest(a).http,o=n.responseXML;if(200==n.status){let t=com.slacker.io.XmlUtils.selectSingleNode(o,"//url[@id='1']"),a=t.getAttribute("status");200==a?s.currentShare.url[i]=t.textContent||t.text:e.warn("URL alias 1 request returned unexpected response: "+a)}else 401==n.status&&handleTokenFetch("com.slacker.util.social.Share.__getShortUrlForShare",[t,i])}a&&com.slacker.io.HttpRequest.finalize(a)}))},share:function(t,i){const s=this.SHARE_TEMPLATE[t],a="aol"==PARTNER?PARTNER:"slacker";if(s){let n=s.window;if(this.currentShare.itemType[i]){let e=this.currentShare.itemType[i],s=this.currentShare.itemName[i],o=this.currentShare.url[i],r=this.currentShare.img[i];if("embed"==t)o=this.currentShare.rawurl[i].replace("https://www.slacker.com/",""),APP.slackerVM.showStaticPage("widget",null,o);else if("email"==t){let t=document.createElement("DIV");t.textContent=o,document.body.appendChild(t),function(e){if(document.selection){let t=document.body.createTextRange();t.moveToElementText(e),t.select()}else if(window.getSelection){let t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}}(t),document.execCommand("copy"),t.remove(),APP.slackerVM.actionsMenu.close(),APP_EVENTS.notify("onNagUser",["share-link-copy"]),com.slacker.util.behavior.Beacon.tagEvent({evt:39,linkTrackEvents:"event40",type:e,name:s,"click-location":"email"})}else{-1==r.indexOf("http")&&(r=WS.HTTP+WS.DOMAIN+"/"+r);let l=this.getShareMessage(t,e,s,o,r,this.currentShare.description[i]),c=n.url.replace("<referrer>",encodeURIComponent("http://www.liveone.com")).replace(/<url>/g,encodeURIComponent(o)).replace("<g-action-url>",encodeURIComponent(o+"?play=true")).replace("<description>",encodeURIComponent(l)).replace("<img>",encodeURIComponent(r)).replace("<twitter-id>",this.PARTNER_SERVICE_IDS.twitter[a].substring(1)).replace("<g-clientid>",this.PARTNER_SERVICE_IDS.google[a]).replace("<app-name>",this.PARTNER_SERVICE_IDS.appname[a].replace(" ","+")).replace("<referrer>",location.toString());window.open(c,"SlackerShare","height="+n.h+",width="+n.w+",location=no,status=no,toolbar=no,",!1)}com.slacker.util.behavior.Beacon.tagEvent({evt:39,linkTrackEvents:"event40",type:e,name:s,"click-location":t})}else e.warn("Share item index out of bounds: "+i)}else e.warn("Unknown share provider: "+t)},getShareMessage:function(e,t,i,s,a,n){if(this.MSG_TEMPLATES[t]&&this.MSG_TEMPLATES[t][e]){let o=this.MSG_TEMPLATES[t][e].msg,r="aol"==PARTNER?PARTNER:"slacker";if(o=o.replace("{{twitter-id}}",this.PARTNER_SERVICE_IDS.twitter[r]).replace("{{app-name}}",this.PARTNER_SERVICE_IDS.appname[r]).replace("{{url}}",s).replace("{{name}}",i).replace("{{img}}",a),"artist"==t||"album"==t){let e;n&&(e=n.substring(0,n.indexOf(".")+1)),o=o.replace("{{firstSentence}}",e||"")}return o}return""}},registerPackage("com.slacker.util.social.Share"),com.slacker.util.social.Share=new t}()})),bjork("com.slacker.app.actions.AbstractAction",(function(){!function(){function e(){this.__constants(),this.__properties(),this.__constructor()}e.prototype={__constants:function(){this.ENC_URLFORM="application/x-www-form-urlencoded",this.VOID_SUBMIT=function(){return!1}},__properties:function(){this.type="",this.validation_rules=[],this.formData={},this.validator,this.onValidation,this.errors=ko.observable(null),this.isSubmitting=ko.observable(!1),this.form},__constructor:function(){},processForm:function(e,t,i,s){if(!e)throw Exception("No Form");for(o in this.form=e,t.enctype||("json"==t.dataType?e.enctype="application/json":e.enctype=t.dataType||this.ENC_URLFORM),t.onsubmit||(e.onsubmit=this.VOID_SUBMIT),t.method&&e.method!=t.method&&(e.method=t.method),e.method||(e.method="POST"),t)"secure"!==o&&("action"===o&&t.secure&&-1==t[o].indexOf("https:")?e[o]="https:"+t[o]:e[o]=t[o]);e.callback=s,this.validate(e,i)},validate:function(e,t){this.form||(this.form=e),this.errors(null),this.onValidation=Delegate.create(this,this._onValidation),this.validator=new FormValidator(e,t,this.onValidation).validate()},_submitAjax:function(e){var t,i={},s=this.form.dataType||this.ENC_URLFORM;
1if(this.validation_rules.forEach((s=>{t=s.name,i[t]=e[t]?e[t].value:""})),"json"==s)i=JSON.stringify(i);else if(e.enctype){var a=new FormData;for(var n in i)e[n].files?$.each(e[n].files,((e,t)=>{a.append(n,t)})):a.append(n,i[n]);s=e.enctype,i=a}APP.NETWORKING.do(this.form.action,this.form.callback,this.form.getAttribute("method"),s,i,e.headers)},_onValidation:function(e,t){var i,s={};if("function"==typeof this.onValidationComplete&&this.onValidationComplete.apply(this,[!e||0==e.length]),e&&0!=e.length){for(;e.length>0;)s[(i=e.pop()).name]=i.message;this.errors(s)}else{if(this.errors(null),this.form.callback)return this._submitAjax(this.form),t&&t.preventDefault?t.preventDefault():event&&(event.returnValue=!1),!1;this.form.submit()}return!1}},registerPackage("com.slacker.app.actions.AbstractAction"),e.prototype.__constants(),com.slacker.app.actions.AbstractAction=e}()})),bjork("com.slacker.app.actions.GetAppAction",(function(){!function(){var e=require("com.slacker.app.actions.AbstractAction"),t=require("com.slacker.util.browser.Browser");function i(){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor()}i.prototype={__constants:function(){},__properties:function(){this.androidPackage="com.blender.radio",this.appData={android:{androidPackage:"com.livexlive.android",storelink:"https://play.google.com/store/apps/details?id=com.livexlive.android"},android_tv:{storelink:"https://www.android.com/tv/"},ios:{id:"id1281908379",name:"livexlive",storelink:"https://itunes.apple.com/us/app/livexlive/id1281908379?mt=8"},slacker_android:{androidPackage:"com.slacker.radio",storelink:"https://play.google.com/store/apps/details?id=com.slacker.radio"},slacker_ios:{id:"id298307011",name:"livexlive",storelink:"https://itunes.apple.com/us/app/livexlive/id298307011?mt=8"},tvos:{id:"id1281908379",name:"livexlive",storelink:"https://apps.apple.com/us/app/liveone-music/id298307011"},roku:{id:"225011",name:"livexlive",storelink:"https://channelstore.roku.com/details/5bef76066bc9a3897cc0ff066f98df01:6a07daa91c009218b5a6bd19b03a14ea/liveone"},firetv:{asin:"B07BGDK5Y3",name:"LiveOne",storelink:"https://www.amazon.com/gp/product/B07BGDK5Y3/ref=LiveOne"},samsung:{id:"G18261011883",name:"LiveOne",storelink:"https://www.samsung.com/us/appstore/app/G18261011883"},tcl:{storelink:"https://us.tcl.com/blogs/partnerships/liveone"}}},__constructor:function(){},getMobileAppDownloadPackage:function(){return t.isAndroidPhone()||t.isAndroidTablet()?APP.supportsSlacker?this.appData.slacker_android:this.appData.android:!!t.isIOS()&&(APP.supportsSlacker?this.appData.slacker_ios:this.appData.ios)},getAppDownload:function(e,t){switch(BEACON.tagEvent({name:"getApp",params:{from:t,label:e}}),null===e&&(e=(e=this.getMobileAppDownloadPackage()).storelink.indexOf("google")>-1?"google":"ios"),e){case"google":case"android":this.getAndroid(t);break;default:var i=!APP.supportsSlacker||"ios"!=e&&"android"!=e?this.appData[e].storelink:this.appData["slacker_"+e].storelink;window.open(i)}},getAndroid:function(e){var i=APP.supportsSlacker?this.appData.slacker_android:this.appData.android,s=navigator.userAgent.match(/Chrome\/(\d+)\./);(e||(e="www.livexlive.com"),APP.sessionBounty&&(e+=`/b/${APP.sessionBounty}`),APP.supportsSlacker&&(e=e.replace("livexlive","slacker")),t.isAndroidPhone()||t.isAndroidTablet())?s&&parseInt(s[1],10)>=25&&(bUseAndroidDefault=!1,setTimeout((function(){location.href=`intent://${e.replace("www.","")}#Intent;scheme=http;package=${i.androidPackage};end;`}),200)):window.open(`https://play.google.com/store/apps/details?id=${i.androidPackage}&hl=en`)}},registerPackage("com.slacker.app.actions.GetAppAction"),com.slacker.app.actions.GetAppAction=i}()})),bjork("com.slacker.app.actions.LaunchVideoStreamAction",(function(){!function(){const e=require("com.slacker.app.actions.AbstractAction"),t=require("com.slacker.player.VideoJS"),i=require("com.slacker.player.YouTube"),s=require("com.slacker.player.SamsungVR"),a=require("com.slacker.event.EventNotifier"),n=require("com.slacker.util.browser.Browser");function o(t){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor(t)}o.prototype={__constants:function(){},__properties:function(){this.videoJs_=new t("100%","100%"),this.videoYouTube_=new i("100%","100%"),this.videoSamsungVR_=new s("100%","100%"),this.videoplayer=this.videoJs_,this.eventMapper=new a(this),this.isVideoPlayerActive=ko.observable(!1),this.currentVideo=ko.observable(),this.queue=null,this.queuePos=-1,this.queueContainer=null,this.banner=ko.observable(),this.currentDuration=null},__constructor:function(e){const t=this._onVideoPlayerEvent.bind(this),i=[this.videoJs_,this.videoYouTube_,this.videoSamsungVR_];
1this.type=e,i.forEach((e=>{["EMBEDFAILURE","VIDEOCONTAINERREADY","DISPLAYERROR","ONFULLSCREENTOGGLE","AUTOPLAY_DISABLED","ADNETWORKCONTAINERREADY","ADNETWORKREADY","ADNETWORKLOADING","VIDEOADNOTREADY","VIDEOADSTARTED","VIDEOADENDED","NOVIDEOAD","ADACTION"].forEach((i=>e.attachEvent(e.EVENT[i],t))),["COMPLETED","STARTED","DURATIONCHANGE","ERROR"].forEach((i=>e.attachEvent(e.EVENT.PLAYBACK[i],t)))}))},setQueue:function(e){this.queue=e,this.queuePos=0,e?!this.queueContainer&&this.videoplayer.currentContainer&&(this.queueContainer=$(`#${this.videoplayer.currentContainer}`)[0]):(this.queuePos=-1,this.queueContainer=null)},playStream:function(e,t,i){if(this.currentDuration=null,t.contentUrl)if(this?.videoplayer?.currentVideoObj?.contentUrl==t.contentUrl)CONSOLE.warn("LaunchVideoStreamAction.playStream:: "+["video already loaded...just press play."]),this.videoplayer.restart(e);else{"youtube"==t.source?this.videoplayer=this.videoYouTube_:"samsungvr"==t.source?this.videoplayer=this.videoSamsungVR_:this.videoplayer=this.videoJs_;let s=i||"embedded"===APP.appImplementationModule.type||"live"===t?.data?.streamStatus||"live"===this.currentVideo()?.streamStatus?null:this.videoplayer.getLastVideoState(t.objectId);s?APP.MESSAGING.prompt("startVideoFromPreviousPosition",{},[{label:"Start Over",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"startVideoFromPreviousPosition",label:"Start Over"}}),APP.MESSAGING.setModal(void 0,null,!0);let i=APP.SERVICE.isCached("videoStates"),s=i?JSON.parse(i):{};delete s[t.objectId.replace("video-","")],APP.SERVICE.cache("videoStates",JSON.stringify(s));try{this.videoplayer.embed(e,t)}catch(e){CONSOLE.error("Unable to start video over ",e)}}.bind(this)},{label:"Resume",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"startVideoFromPreviousPosition",label:"Resume"}}),APP.MESSAGING.setModal(void 0,null,!0);try{this.videoplayer.startOffset=s,this.videoplayer.embed(e,t)}catch(e){CONSOLE.error("Unable to resume video ",e)}}.bind(this)}]):this.videoplayer.embed(e,t)}else this.videoplayer.dispatch({type:this.videoplayer.EVENT.NOCONTENT,actionType:this.type})},_doQueuedPlaybackAction:function(e){const t=APP.appImplementationModule;if(e||(e=this.queue[this.queuePos++]),e){if("function"==typeof e&&(e=e()),!APP.checkPaywallVideo(e,!1,(()=>this._doQueuedPlaybackAction(e)),!0))return this._doQueuedPlaybackAction();t.adtlVideoAnnotations&&Object.keys(t.adtlVideoAnnotations).forEach((i=>{e[i]=t.adtlVideoAnnotations[i]})),void 0===e.defaultVolume&&(e.defaultVolume=APP.SERVICE.isCached("v")||.5),CONSOLE.info(["LaunchVideoStreamAction::_doQueuedPlaybackAction","playing next item in queue",e.title,e.objectId]),this.playStream(this.queueContainer,e,!0)}else try{let e=cast.framework.CastContext.getInstance();e&&e.getCurrentSession().endSession(!0)}catch(e){}},_onVideoPlayerEvent:function(e){const t=this.videoplayer.EVENT;switch(e.video?CONSOLE.debug("LaunchVideoStreamAction._onVideoPlayerEvent:: "+[e.type,e.player,e.video.videoId,e.video.title]):CONSOLE.debug("LaunchVideoStreamAction._onVideoPlayerEvent:: "+[e.type,e.player]),this.eventMapper.dispatch(e),e.type){case t.VIDEOCONTAINERREADY:this.isVideoPlayerActive(!0);break;case t.EMBEDFAILURE:e.adNetworkID,e.reason&&e.reason.indexOf("google is not defined");break;case t.ONFULLSCREENTOGGLE:break;case t.AUTOPLAY_DISABLED:APP.MESSAGING.prompt("html5AutoplayVideoDisabled");break;case t.DISPLAYERROR:this.setQueue(null),this.isVideoPlayerActive(!1);case t.PLAYBACK.ERROR:this.currentDuration=null;break;case t.PLAYBACK.DURATIONCHANGE:case t.PLAYBACK.STARTED:var i,s=$("body");APP.viewIsPlaying()||APP.viewIsPlaying(APP.currentView),this.queue&&this.queue.length&&(this.queueContainer=$(`#${this.videoplayer.currentContainer}`)[0],"website"==APP.appImplementationModule.type&&this.queuePos&&e.type==t.PLAYBACK.STARTED&&window.history.replaceState(APP.currentView.historyData,`${e.video.title} - LiveOne - Music, Podcasts and more`,`/${e.video.seoName}`)),e.player&&(i="youtube"==this.videoplayer.type?"function"==typeof e.player.getDuration?e.player.getDuration():1/0:"dailymotion"==this.videoplayer.type?e.player.duration:"samsungvr"==this.videoplayer.type?1/0:e.player.duration(),"live"===e.video.streamType?(this.currentDuration=1/0,n.isIOS()&&n.isSafari()||s.hasClass("live")||s.addClass("live"),e.video.isLive=!0):(this.currentDuration=i,s.removeClass("live"),e.video.isLive=!1),CONSOLE.debug(["Launc
1hVideoStreamAction._onVideoPlayerEvent::",e.type," - ",i,"isLive",e.video.isLive]),e.video.banner?this.banner(e.video.banner):this.banner(""),this.currentVideo()!==e.video&&("function"==typeof e.video.isPlaying&&e.video.isPlaying(!0),this.currentVideo(e.video),this.currentVideo.valueHasMutated()),e.video.channelChange&&APP.currentView.channels&&APP.currentView.channels.forEach((t=>t.active(t.channelId==e.video.channelChange))));break;case t.PLAYBACK.COMPLETED:this.isVideoPlayerActive(!1),APP.viewIsPlaying(null),e.video&&"function"==typeof e.video.isPlaying&&e.video.isPlaying(!1),e.video&&"in-place"==e.video.type?this.videoplayer&&this.videoplayer.player.src()&&this.videoplayer.cleanUp():this.queue&&(this.queuePos<this.queue.length?this._doQueuedPlaybackAction():this.queue&&(CONSOLE.info(["LaunchVideoStreamAction::_doQueuedPlaybackAction","Queue empty. Stop"]),this.queue=this.queueContainer=null,APP.appImplementationModule.detailstreamaction==this&&APP.currentView&&APP.currentView.data()[0]&&APP.currentView.data()[0].playable&&this.eventMapper.dispatch({type:this.videoplayer.EVENT.PLAYBACK.DURATIONCHANGE,video:APP.currentView.data()[0].playable})));break;case t.ADNETWORKCONTAINERREADY:case t.ADNETWORKLOADING:case t.ADNETWORKREADY:case t.VIDEOADSTARTED:case t.VIDEOADNOTREADY:case t.VIDEOADENDED:case t.NOVIDEOAD:break;case t.ADACTION:e.action}}},registerPackage("com.slacker.app.actions.LaunchVideoStreamAction"),com.slacker.app.actions.LaunchVideoStreamAction=o}()})),bjork("com.slacker.app.actions.MenuAction",(function(){!function(){const e=require("com.slacker.util.browser.Browser");function t(e,t,i,s){this.__constants(),this.__properties(),this.__constructor(e,t,i,s)}t.prototype={__constants:function(){},__properties:function(){const e=this;this.id=null,this.link=null,this.subNavAutoDismissTime=100,this.label=ko.observable(""),this.ariaLabel=null,this.defaultClass=ko.observable(""),this.seoName=ko.observable(""),this.href=ko.observable(""),this.isHamburgerOnly=ko.observable(!1),this.collapsed=ko.observable(!0),this.subNavOpen=ko.observable(!1),this.isSeparator=ko.observable(!1),this.closedByClick=!1,this._subNavDelegated=!1,this.subnav=ko.observableArray(),this.slider=null,this.action,this.context;const t={HOME:"home",SEARCH:"search",LIVE_EVENTS:"live-events",VIDEO:"video",PODCASTS:"podcasts",MUSIC:"music",AUDIOBOOKS:"genre/audiobooks",MY_LIBRARY:"mylibrary"},i={HOME_VIEW:"HomeView",AUDIOBOOKS:"audiobooks",STATIONS:"stations"};this.isActive=ko.computed((function(){const s=(APP,APP.activeTab()),a=e.href(),n=APP.currentView;let o=null;if(e.seoName()===t.MY_LIBRARY)return s===t.MY_LIBRARY||s?.endsWith("/mylibrary");if(e.seoName()===t.AUDIOBOOKS||e.seoName()===i.AUDIOBOOKS)return function(e){return e===t.AUDIOBOOKS||e===i.AUDIOBOOKS}(s);if(e.subnav().forEach(((i,a)=>{i[0]?i.forEach(((i,a)=>{i.isActive()&&(s===t.AUDIOBOOKS&&e.seoName()===t.MUSIC||(o=!0))})):i.isActive()&&(s===t.AUDIOBOOKS&&e.seoName()===t.MUSIC||(o=!0))})),o)return o;if(a){if(e.seoName()===t.HOME)return s===i.HOME_VIEW;if(e.seoName()===t.SEARCH)return s===a;if(s?.match(/(\/mixer\/live-events\/|video\/festivals)/))return e.seoName()==t.LIVE_EVENTS;if(s?.indexOf("/mixer/video/home")>-1)return e.seoName()==t.VIDEO;if((s?.indexOf("/mixer/podcasts/")>-1||s?.indexOf("podcast/")>-1)&&(!e.type||"next"!=e.type&&"prev"!=e.type&&-1==e.type.indexOf("page-")))return e.seoName()==t.PODCASTS;if(s?.match(/\/(video|channel|hub)\//))return[t.VIDEO,"channels"].includes(e.seoName())||a==s||s.indexOf(e.link?._links?.genre?.href)>-1||s.indexOf(e.link?._links?.channel?.href)>-1;if(function(e){return e?.match(/(genre|\/music\/home)\//)||[i.STATIONS,t.MUSIC].includes(e)}(s)){if(s.includes("audiobook"))return!1;let i,o;if(e.seoParent==t.MUSIC&&n?.historyData.params){if(i=a?a.match(/categories\/\d\/(\d+)\?/):null,o=a?a.match(/stations\/\d\/(\d+)\?/):null,i?.[1])try{i=i[1]==(n.historyData.params.categoryId||n.historyData.params.id)}catch(e){}if(o?.[1])try{o=new String(n.historyData.params.id).indexOf(o[1])>-1}catch(e){}}return e.seoName()===t.MUSIC&&!s.includes("audiobook")||i||o}{let t=APP.currentView;if(e.context&&e.context!=APP&&(t=e.context),t?.dataSource==a)return!0;var r=a.replace("/features","").replace("/details","");return s?.split(r).length>1||s===e.seoName()}}return!1})),this.classNames=ko.computed((function(){const t=e.isActive(),i=e.collapsed()?" collapsed":"";e.label();let s=[e.defaultClass()],a="";return t&&s.push("active"),e.subNavOpen()&&s.push("subnavopen"),e.link&&e.link._links&&e.link._links.nav&&s.push("link"),a=s.join(" ")+i,e.isSeparator(a.indexOf("separator")>-1),a}))},__constructor:function(e,t,i,s){let a=[];!s&&(APP,1)&&(s=APP),this.id=(new Date).getTime(),this.link=e,e.type&&(this.t
1ype=e.type,a.push(e.type)),i&&a.push(i),e&&e.subTypes&&e.subTypes.length&&(a=a.concat(e.subTypes)),e&&(e.subnav||e._embedded)&&(this.subnav(e.subnav?e.subnav:[]),a.push("subparent")),this.action=t,this.context=s,this.slider=e.slider,this.label(e.title),this.ariaLabel=e.ariaLabel||e.title,this.seoName(e.seoName||""),e._links&&(e._links.nav?this.href(e._links.nav.href):e._links.self&&this.href(e._links.self.href)),this.defaultClass(a.join(" ")),enquire.register("screen and (min-width : 1060px)",this._responsiveRenderingHelper.bind(this)).register("screen and (max-width : 1059px)",this._responsiveRenderingHelper.bind(this))},doSliderNag:function(e,t,i){let s;e.set(t.optionIndex),s=Object.assign({},APP.MESSAGING.messages.sliderSetting),s.beaconId=i.id,s.msg=i.msg,s.actions[0].action=()=>{APP.MESSAGING.setModal(),APP.onRequestUpgrade(i.level,i.id)},APP.MESSAGING.prompt(s)},_updateVideoEventsNavigation:function(e,t){if(!t?._links?.nav?.href||"string"!=typeof t._links.nav.href||!t._links.nav.href.includes("videos-and-events"))return!1;t._links.nav.href=t._links.nav.href.replace("videos-and-events","live-events"),e.historyData.viewType="mixersectionedpage";const i=e.historyData.params;return i.links=i.links||{},i.links.content={rel:"content",href:t._links.nav.href,templated:!0},i.viewType="mixersectionedpage",["_links","type","subTypes","title"].forEach((e=>{e in i&&delete i[e]})),!0},_onClick:function(e,t,i){const s=this,a=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");let n,o,r="action";if(this._updateVideoEventsNavigation(this.context,this.link)&&console.log("_updateVideoEventsNavigation :: URL & historyData updated ::",this.link._links.nav.href,this.context.historyData),"settings"!==this.link?.seoName||"tesla"!==APP.currentView.seoName||APP.currentView.HISTORY.tesla.staticData.upgraded()){if(this.type.indexOf("login")>-1&&this.type.indexOf("init")>-1&&-1==a.bookmarkCount)return a.execute("init",(function(){o=APP.USER.navBarMenuItem(),s._onClick.bind(o[0])(o[0],t)})),!0;if(this.action){if(this.link?.subTypes)if(this.link.subTypes.includes("radioStation")){const e=this.link._links.self.href.match(/stations\/\d+\/(\d+)[^\d]/);if(e&&e[1])return t&&APP.EVENTS.dispatch({type:"menu-item",payload:{value:"nav-menu",label:this.link.subTypes.join(" ")+" - "+this.link.title}}),APP.cleanMainNav(),void APP.goToPage("slackeritemdetail",{type:"station",title:this.link.title,id:e[1]})}else if(this.link.subTypes.includes("radioCategory")){const e=this.link._links.self.href.match(/categories\/\d+\/(\d+)[^\d]/);if(e&&e[1])return t&&APP.EVENTS.dispatch({type:"menu-item",payload:{value:"nav-menu",label:this.link.subTypes.join(" ")+" - "+this.link.title}}),APP.cleanMainNav(),void APP.goToPage("radiocategories",{categoryId:e[1],title:this.link.title,name:this.link.title,seoName:this.link.seoName})}else this.link.subTypes.includes("podcast")&&APP.goToPage("slackeritemdetail",{type:"podcast",id:this.link.seoName.split("/")[1],title:this.link.title,name:this.link.title});if(this.link?._links?.nav){const e=this.link._links.nav.href.match(/categories\/\d+\/(\d+)\//);let i="stations";if(e&&e[1])return 1901==e[1]&&(i="originals"),t&&APP.EVENTS.dispatch({type:"menu-item",payload:{value:"nav-menu",label:"radioCategory - "+this.link.title}}),APP.cleanMainNav(),void APP.goToPage("radiocategories",{categoryId:e[1],seoName:i})}this.link.seoName&&"NO_BEACON"!==this.link.seoName&&(n=this.link.seoName,"nav"==this.link.type?r="nav-menu":0==this.link.seoName.indexOf("context-menu")&&(r="context-menu",n=this.link.seoName.split("context-menu-")[1]),t&&APP.EVENTS.dispatch({type:"menu-item",payload:{value:r,label:n}})),"settings"==n&&"action"==r?this.action.apply(this.context,[]):this.action.apply(this.context,[this,i])}else(this.isHamburgerOnly()||window.innerWidth<1059)&&this.subnav().length&&this._onSubNavToggle(e,t,!0);return"contextfinal"!=this.type&&this.type&&-1!=this.type.indexOf("context")||APP.MESSAGING.closeContextMenu(),"contextslider"==this.type}},_onSubNavToggle:function(e,t,i){if(APP.canNavigate()){if(e&&!i)try{$(".hamburger input")[0].checked&&$(".hamburger input").click()}catch(e){}if(this.subnav().length){var s=!1===this.collapsed();s!==this.collapsed()&&(this.subNavOpen(!1===s),t&&"click"==t.type&&APP.checkAcessibilityTTSAction("Sub Menu: "+(!1===s?"open":"closed"),null,!0),e&&this.collapsed()&&!1===s&&(APP.EVENTS.dispatch({type:"menu-item",payload:{value:"toggle-open",label:this.seoName()}}),APP.MESSAGING.closeContextMenu()),this.collapsed(s),this.subNavOpen()&&this.subNavTimeout&&(clearTimeout(this.subNavTimeout),this.subNavTimeout=0),this.collapsed()&&t&&"click"==t.type&&(this.closedByClick=!0),t&&$(t.currentTarget).hasClass("burger-subparent")&&(this.closedByClick=!1))}return!1}},_onSubNavMouse:function(t,i,s){var a,n=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");if(!e.isMobileDevice()&&!this.isHamburgerOnly()){if(i&&"mouseover"==i.type&&!s&&!$("div.subnav:not(.collapsed)")[0])return this._hoverDelay&&(clearTimeout(this._hoverDelay),this._hoverDelay=0),void(this._hoverDelay=setTimeout((()=>{this._onSubNavMouse(t,i,!0)}),500));
1if(this.type.indexOf("login")>-1&&this.type.indexOf("init")>-1&&-1==n.bookmarkCount&&n.execute("init",(()=>{(a=APP.USER.navBarMenuItem())[0]&&a[0].collapsed()&&a[0]._onSubNavToggle(a[0])})),i&&"mouseover"==i.type&&!this._hoverDelay&&this._onFocus(),this.subnav().length&&!this.isHamburgerOnly()){if(i)switch(i.type){case"mouseover":if(APP.cleanMainNav(null,this),this.subNavTimeout&&(clearTimeout(this.subNavTimeout),this.subNavTimeout=0),this.subnav().length&&!0===this.collapsed()&&this._onSubNavToggle(t),this.subNavOpen()&&!this._subNavDelegated){this._subNavDelegated=!0;const e=`#subnav-${this.id}`;$(document).on("mouseenter.subnav-"+this.id,e,(()=>{this.subNavTimeout&&(clearTimeout(this.subNavTimeout),this.subNavTimeout=0)})),$(document).on("mouseleave.subnav-"+this.id,e,(()=>{this.subNavTimeout&&(clearTimeout(this.subNavTimeout),this.subNavTimeout=0),this.subNavTimeout=setTimeout((()=>{if(this.subNavOpen()){var e=document.getElementById("subnav-"+this.id);if(e&&e.matches(":hover"))return void(this.subNavTimeout=0);this._onSubNavToggle()}}),this.subNavAutoDismissTime)}))}break;case"mouseleave":this._hoverDelay&&(clearTimeout(this._hoverDelay),this._hoverDelay=0),this.subNavOpen()&&(this.subNavTimeout=setTimeout((()=>{if(this.subNavTimeout&&this.subNavOpen()){var e=document.getElementById("subnav-"+this.id);if(e&&e.matches(":hover"))return void(this.subNavTimeout=0);this._onSubNavToggle()}}),500))}}else if(!this.isHamburgerOnly()&&i&&"mouseover"===i.type)APP.cleanMainNav();return!1}},_onFocus:function(){APP.checkAcessibilityTTSAction(this.ariaLabel)},_responsiveRenderingHelper:function(){this.isHamburgerOnly(-1==this.defaultClass().indexOf("main-nav-dup")||window.innerWidth<1060)}},registerPackage("com.slacker.app.actions.MenuAction"),com.slacker.app.actions.MenuAction=t,com.slacker.app.actions.MenuAction.helper={onSliderTypeActionRender:function(e,t){var i,s,a,n=t.link&&t.link.sliderDef?t.link.sliderDef:null,o=APP.USER.slackerUser().effectiveTier;if("contextslider"==t.type)if(t.slider=$(e[1]).find(".slider"),t.slider[0]){let e={snap:!0,behaviour:"tap-drag"};for(let i in t.link.sliderDef.noUiSliderConfig)e[i]=t.link.sliderDef.noUiSliderConfig[i];if(noUiSlider.create(t.slider[0],e),t.slider[0].noUiSlider.on("change",t.link.uislider.onChange.bind(t)),n&&(i=n.sliderNagDefs[n.sliderType]))for(var r in s=$(t.slider[0]).find(".noUi-pips .noUi-marker-normal"),i)if(r==o)for(var l in i[r])(a=s[n.getOptionIndexByValue(l)])&&-1==a.className.indexOf("restricted")&&(a.className+=" restricted")}else CONSOLE.warn("Attempting to create context slider without slider container: "+e.label())}}}()})),bjork("com.slacker.app.actions.NewsletterSignupAction",(function(){!function(){var e=require("com.slacker.app.actions.AbstractAction");function t(t,i){extendClass(this,new e),this.__constants(t),this.__properties(),this.__constructor(t,i)}t.prototype={__constants:function(e){this.PATH=e,this.VALIDATOR=FOO=new FormValidator(null,[])},__properties:function(){this.type="newsletter-signup",this.email=ko.observable(),this.name=ko.observable(),this.subscribedEmail=null,this.bIsOk=!1,this.callback=null,this.validation_rules=[{name:"email",display:"Email Address",rules:"required|valid_email"},{name:"name",display:"Name",rules:"required"},{name:"newsletter",display:"Action"}]},__constructor:function(e,t){var i=this;this.callback=t,this.emailOk=ko.computed((function(){return i.VALIDATOR._hooks.valid_email({value:i.email()})})),this.nameOk=ko.computed((function(){return i.VALIDATOR._hooks.required({value:i.name()})})),this.onValidationComplete=function(e){e||this.isSubmitting(!1)}},submit:function(e){e.length>0&&(e=e[0]),this.name(e.name.value),this.email(e.email.value),this.isSubmitting(!0),this.processForm(e,{method:"POST",action:this.PATH,dataType:"json",secure:!0},this.validation_rules,this._onSubmitResponse.bind(this))},_onSubmitResponse:function(e,t,i){if(this.isSubmitting(!1),i.responseJSON){t=i.statusCode().status;switch(BEACON.tagEvent({name:"optin",params:{value:i.responseJSON.code,label:"newsletter"}}),i.statusCode().status){case 200:case 202:this.bIsOk=!0,this.email(""),this.name(""),this.subscribedEmail=i.responseJSON.email,APP.MESSAGING.prompt("newsletterOptInConfirm",{email:i.responseJSON.email});break;default:if(i.responseJSON.errors&&i.responseJSON.errors.length){var s={};s[i.responseJSON.errors[0].field]="Invalid Value",this.errors(s)}else APP.MESSAGING.prompt("ticklerError",{reason:i.responseJSON.message})}}else"error"!=t?(this.bIsOk=!0,BEACON.tagEvent({name:"optin",params:{value:!0,label:"newsletter"}}),APP.MESSAGING.prompt("newsletterOptInConfirm",{email:""})):(BEACON.tagEvent({name:"optin",params:{value:!1,label:"newsletter"}}),APP.MESSAGING.prompt("ticklerError",{reason:"Unknown"}));this.callback&&this.callback(this,e)}},registerPackage("com.slacker.app.actions.NewsletterSignupAction"),com.slacker.app.actions.NewsletterSignupAction=t}()})),bjork("com.slacker.app.actions.NewsletterUnsubscribeAction",(function(){!function(){var e=require("com.slacker.app.actions.AbstractAction");function t(t,i){extendClass(this,new e),this.__constants(t),this.__properties(),this.__constructor(t,i)}t.prototype={__constants:function(e){this.PATH=e,this.VALIDATOR=FOO=new FormValidator(null,[])},__properties:function(){this.type="newsletter-unsubscribe",this.email=ko.observable(),this.bIsOk=!1,this.callback=null,this.subscribedEmail=null,this.validation_rules=[{name:"email",display:"Email Address",rules:"required|valid_email"},{name:"newsletter",display:"Action"},{name:"subscriptionToken",display:"Token"}]},__constructor:function(e,t){var i=this;this.callback=t,this.emailOk=ko.computed((function(){return i.VALIDATOR._hooks.valid_email({value:i.email()})})),this.onValidationComplete=function(e){e||this.isSubmitting(!1)}},submit:function(e){e.length>0&&(e=e[0]),this.email(e.email.value),this.isSubmitting(!0),this.processForm(e,{method:"PATCH",action:this.PATH,dataType:"json",secure:!0},this.validation_rules,this._onSubmitResponse.bind(this))},_onSubmitResponse:function(e,t,i){if(this.isSubmitting(!1),i.responseJSON){t=i.statusCode().status;switch(BEACON.tagEvent({name:"optout",params:{value:i.responseJSON.c
1ode,label:"newsletter"}}),i.statusCode().status){case 200:case 202:this.bIsOk=!0,this.email(""),APP.USER.user().newsletteremail=null,APP.USER.user.valueHasMutated(),this.subscribedEmail=i.responseJSON.email,APP.MESSAGING.prompt("newsletterOptOutConfirm",{email:i.responseJSON.email});break;default:if(i.responseJSON.errors&&i.responseJSON.errors.length){var s={};s[i.responseJSON.errors[0].field]="Invalid Value",this.errors(s)}else APP.MESSAGING.prompt("ticklerError",{reason:i.responseJSON.message})}}else"error"!=t?(this.bIsOk=!0,BEACON.tagEvent({name:"optout",params:{value:!0,label:"newsletter"}}),APP.USER.user().newsletteremail=null,APP.USER.user.valueHasMutated(),APP.MESSAGING.prompt("newsletterOptOutConfirm",{email:""})):(BEACON.tagEvent({name:"optout",params:{value:!1,label:"newsletter"}}),APP.MESSAGING.prompt("ticklerError",{reason:"Unknown"}));this.callback&&this.callback(this,e)}},registerPackage("com.slacker.app.actions.NewsletterUnsubscribeAction"),com.slacker.app.actions.NewsletterUnsubscribeAction=t}()})),bjork("com.slacker.app.actions.UserUpdateAction",(function(){!function(){var e=require("com.slacker.app.actions.AbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.app.modules.NetworkModule");function s(){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor()}s.prototype={__constants:function(){this.VALIDATOR=FOO=new FormValidator(null,[])},__properties:function(){this.values={},this.isLoaded=!1,this.isProfileSetupRequired=ko.observable(!0)},__constructor:function(){var e=this;this.getValueObservable=function(e){return"function"!=typeof this.values[e]&&(this.values[e]=ko.observable()),this.values[e]},this.getValue=function(e){return this.values[e]()},this.setValue=function(e,t){this.getValueObservable(e)(t),this.values["_"+e]=t},this.isNameValid=ko.computed((function(){var t,i=e.getValueObservable("name")();return void 0!==i&&((t=i.trim().length>1)&&e.errors()&&e.errors().name&&(e.errors().name=null,e.errors.valueHasMutated()),t)})),this.isEmailValid=ko.computed((function(){var t,i=e.getValueObservable("email")();return void 0!==i&&((t=e.VALIDATOR._hooks.valid_email({value:i}))&&e.errors()&&e.errors().email&&(e.errors().email=null,e.errors.valueHasMutated()),t)})),this.isFormValid=ko.computed((function(){return e.isProfileSetupRequired()?e.isNameValid()&&e.isEmailValid():e.isNameValid()||e.isEmailValid()})),this.isUpdateFormChanged=ko.computed((function(){return!e.isProfileSetupRequired()&&(e.getValueObservable("email")()!=e.values._email||e.getValueObservable("name")()!=e.values._name)}))},setCallback:function(e){this.callback=e},setData:function(e,t){var i=this.isFormValid(),s={callback:t,source:APP.SERVICE.urls.API.ACCOUNTS+"/"+APP.USER.user().accountId,method:"PATCH",type:"json",data:JSON.stringify(e)};this.errors(null),this.isProfileSetupRequired()?i=this.isFormValid():this.isUpdateFormChanged()&&(this.errors({}),this.values._name&&!this.isNameValid()&&(i=!1,this.errors().name="Please enter your name"),void 0===e.marketingOptIn&&(this.values._email&&!this.isEmailValid()&&(i=!1),this.errors().email="Please enter a valid email")),e&&null===e.marketingOptIn&&delete e.marketingOptIn,Boolean(e.marketingOptIn)&&!this.isEmailValid()&&(this.errors({}),i=!1,this.errors().email="Please enter a valid email"),i?(this.errors(null),this._doRequest(s)):this.errors.valueHasMutated()},getCurrentData:function(e){var t={callback:e,source:APP.SERVICE.urls.API.ACCOUNTS+"/"+APP.USER.user().accountId,method:"GET",type:"json"};this._doRequest(t)},removeUser:function(e,t){params={callback:t,source:e.links.ANONYMIZE,method:"POST",type:"json"},this._doRequest(params)},_onMarketingOptinToggle:function(){var e="marketingOptIn",t=APP.USER.UPDATE.getValueObservable(e)();APP.USER.UPDATE.getValueObservable(e)(!t)},_doRequest:function(e){var s=this;return APP.SERVICE.isForceUpgradeRequired?(CONSOLE.warn("UserUpdateAction:: Killing pending request due to force upgrade required"),void APP.onForceUpdate()):t.SERVICE.API.TOKEN?void i.do(e.source,e.callback,e.method,e.type,e.data):(CONSOLE.warn("UserUpdateAction::_doRequest - Waiting for API Discovery"),void setTimeout((function(){s._doRequest(e)}),1e3))}},registerPackage("com.slacker.app.actions.UserUpdateAction"),com.slacker.app.actions.UserUpdateAction=s}()})),bjork("com.slacker.app.actions.auth.AccountKitAction",(function(){!function(){var e=require("com.slacker.app.actions.AbstractAction");require("com.slacker.app.modules.UrlModule"),require("com.slacker.app.modules.NetworkModule");function t(){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor()}t.prototype={__constants:function(){},__properties:function(){},__constructor:function(){},loginCallback:function(e){if(BEACON.tagEvent({name:"login",params:{value:"accountKit",label:e.status}}),"PARTIALLY_AUTHENTICATED"===e.status){e.state;APP.USER.user().loginType="accountKit",APP.USER.useAccountKitCode(e.code)}else"NOT_AUTHENTICATED"===e.status?(APP.queuedLoadTitle(null),APP.MESSAGING.prompt("modalErrorFree",{reason:"We are unable to authorize your account with the information provided."})):"BAD_PARAMS"===e.status&&(APP.queuedLoadTitle(null),APP.MESSAGING.prompt("modalErrorFree",{reason:"There is a problem with your phone number. Please check your entry and try again."}))},smsLogin:function(){APP.queuedLoadTitle("Login"),BEACON.tagEvent({name:"login",params:{value:"accountKit",label:"sms"}});AccountKit.login("PHONE",{countryCode:"",phoneNumber:""},this.loginCallback.bind(this))},emailLogin:function(){var e=document.getElementById("email").value;AccountKit.login("EMAIL",{emailAddress:e},this.loginCallback.bind(this))}},registerPackage("com.slacker.app.actions.auth.AccountKitAction"),com.slacker.app.actions.auth.AccountKitAction=t}()})),bjork("com.slacker.app.actions.auth.AuthAction",(function(){!function(){const e=require("com.slacker.app.actions.AbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.app.modules.NetworkModule");function s(){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor()}s.prototype={__constants:function(){},__properties:function(){this.grants={credential:"grant_type=client_credentials",anonymous:"grant_type=anonymous&loginToken={loginToken}&accountId={accountId}",refresh:"grant_type=refresh_token&refresh_token={refreshtoken}"},this.oAuthAction},__constructor:function(){},getClientCredentials:function(e){const t={callback:e,method:"POST",type:"json",data:this.grants.credential};this._doRequest(t)},getAccount:function(e){const t={source:APP.SERVICE.urls.API.ACCOUNTS,callback:e,method:"POST",type:"json",data:'{"registrationType": "anonymous"}'};this._doRequest(t)},useAccountKitCode:function(e,t){const i={source:APP.SERVICE.urls.API.ACCOUNTS+"/"+APP.USER.user().accountId,callback:t,method:"POST",type:"json",data:JSON.stringify({registrationType:"facebookAccountKit",authorizationCode:e})};this._doRequest(i)},getAccountCredentials:function(e,t,i){const s={callback:i,method:"POST",type:"json",data:this.grants.anonymous.replace("{loginToken}",t).replace("{accountId}",e)};this._doRequest(s)},useRefreshToken:function(e,t){const i={callback:t,method:"POST",type:"json",data:this.grants.refresh.replace("{refreshtoken}",e)};this._doRequest(i)},getOauthRedirectAction:function(e){const i={callback:e,source:t.get(t.SERVICE.API.ROOT+"/auth/authorize"),method:"POST",type:"json",data:this.oAuthAction,headers:{"Content-Type":"application/x-www-form-urlencoded"}};i.data.redirect_uri=decodeURIComponent(i.data.redirect_uri),this._doRequest(i)},_doRequest:function(e){if(APP.requiresAuth)return APP.SERVICE.isForceUpgradeRequired?(CONSOLE.warn("AuthAction:: Killing pending request due to force upgrade required"),void APP.onForceUpdate()):void APP.SERVICE.lxlDiscoveryPromise.then((()=>{console.log("UrlModule.SERVICE.API.TOKEN",t.SERVICE.API.TOKEN),i.do(e.source||t.SERVICE.API.TOKEN,e.callback,e.method,e.type,e.data,e.headers||null)}));CONSOLE.warn("AuthAction:: App does not use Auth. Bail.")}},registerPackage("com.slacker.app.actions.auth.AuthAction"),com.slacker.app.actions.auth.AuthAction=s}()})),bjork("com.slacker.app.actions.slacker.CheckOfferCodeAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(t){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor(t)}i.prototype={__constants:function(){this.PATH_CODE_CHECK="store/rest/pops/offerCodes/{code}"},__properties:function(){this.error=ko.observable(),this.code=ko.observable()},__constructor:function(e){this.callback=e},execute:function(e){this.actionUrl=t.get(`${t.SLACKER_ROOTS.STORE}${this.PATH_CODE_CHECK}`,{code:(e+"").trim()}),CONSOLE.info("Sending code validation request"),this._doRequest({source:this.actionUrl,callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})},onActionResponse:function(e,t,i){let s=!1,a=null;if(200==i.status)a={},s=e&&e.active,s?e.eventMetadata&&(a=e.eventMetadata):a=null;else if(data&&data.statusMessage)this.error(data.statusMessage);else switch(i.status){case 403:this.error("This offer has already been redeemed.");break;
1case 404:this.error("Offer code is not valid. Please check your code and try again.");break;case 409:this.error("This offer code can no longer be redeemed.");break;case 410:this.error("This offer is no longer available.");break;case 503:this.error("The system is currently unavailable, please try again in a few minutes.");break;default:this.error("An unexpected error has occurred. Please try again later.")}this.callback(s,a)}},registerPackage("com.slacker.app.actions.slacker.CheckOfferCodeAction"),com.slacker.app.actions.slacker.CheckOfferCodeAction=i}()})),bjork("com.slacker.app.actions.slacker.HandleSearchCommandAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction");function t(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}t.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e,t){const i=e.split("slacker:"),s=APP.USER.slackerUser(),a=APP.SERVICE.URLMODULE;let n,o;if(i.length>1){n=i[1].split(":");try{switch(n[0]){case"setLastVideoAdTimer":if(cmd=n[0],n=e.split(cmd+":"),n[1]&&t){const e=Number(n[1]);if(e>0){const t=Date.now(),i=t-(864e5-e);localStorage.setItem("lastVideoAdPlayedTime",i.toString());const s=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4),n=Math.floor(e%6e4/1e3);let o="";s>0&&(o+=`${s} hour(s), `),o+=`${a} minute(s), and ${n} second(s)`,alert(["lastVideoAdPlayedTime set",`Next ad will play in ${o}`]),console.log(`lastVideoAdPlayedTime set to: ${new Date(i).toLocaleString()}`),console.log(`Next ad will play in ${o}`),console.log(`Exact milliseconds until next ad: ${e}`)}else alert(["Cannot set negative value for lastVideoAdPlayedTime"])}return!0;default:return console.warn(`Unknown command: ${n[1]}`),!1;case"removeLastVideoAd":return localStorage.removeItem("lastVideoAdPlayedTime"),console.warn("Easter egg activated: lastVideoAdPlayedTime has been reset."),alert("lastVideoAdPlayedTime Has been removed your your browser localStorage"),!0;case"wopr":return t&&APP.MESSAGING.prompt("wopr",null,null,APP.wopr||{}),!0;case"uploadLog":return t&&(o=require("com.slacker.app.actions.slacker.user.SlackerFeedbackAction"),(new o).execute({emailContent:"internal log upload",email:s&&s.username?s.username:"[email protected]"})),!0;case"setDebug":return t&&(CONSOLE.setLogLevel("debug"),CONSOLE.setScrollBack(1e3),alert("DEBUG mode enabled")),!0;case"setLogLevel":return cmd=n[0],n=e.split(cmd+":"),n[1]&&t&&(CONSOLE.setLogLevel(n[1]),alert("LogLevel set: "+n[1])),!0;case"whereami":return t&&APP.NETWORKING.do(a.get(a.SERVICE.SLACKER.SESSION.WHEREAMI),(function(e,t,i){i?APP.currentView.debugDump(i.responseText.replace(/\n/g,"<br/>")):alert("Error: "+i.status)})),!0;case"userFlags":let i,r,l;if(t){const e=e=>{try{return JSON.parse(JSON.stringify(e,((e,t)=>e&&e.toLowerCase().indexOf("token")>-1?"[hidden]":"function"!=typeof t?t:void 0)))}catch(t){return String(e)}},t=t=>t&&"object"==typeof t?JSON.stringify(e(t)):t,a={LXL:{},SLACKER:{}};for(l in i=[],r=APP.USER.user(),a["APP TYPE"]=`${APP.implementationSuperType()}:${APP.appImplementationModule.type}`,i.push(`APP TYPE - ${a["APP TYPE"]}`),i.push("LXL"),r)r.hasOwnProperty(l)&&-1==l.indexOf("token")&&"function"!=typeof r[l]&&(i.push(l+" - "+t(r[l])),a.LXL[l]=r[l]);for(l in i.push(""),i.push("SLACKER"),s)s.hasOwnProperty(l)&&"policy"!==l&&-1==l.indexOf("token")&&"function"!=typeof s[l]&&(i.push(l+" - "+t(s[l])),a.SLACKER[l]=s[l]);if(s.policy){for(l in a["USER POLICY"]=s.policy,i.push(""),i.push("USER POLICY"),s.policy)if(s.policy.hasOwnProperty(l))if("capabilities"==l){i.push(l.toUpperCase());for(let e in s.policy.capabilities.features)s.policy.capabilities.features[e].enabled&&i.push(" "+e)}else i.push(l+" - "+t(s.policy[l]))}else a["USER POLICY"]="USER IS NOT AUTHED AGAINST SLKACCT",i.push("USER IS NOT AUTHED AGAINST SLKACCT");APP.currentView.debugDump(i.join("<br/>"),e(a))}return!0;case"goToStation":case"goToArtist":case"goToAlbum":case"goToPlaylist":return cmd=n[0],n=e.split(cmd+":"),n[1]&&t&&(o=require("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction"),(new o).execute({id:n[1].trim(),type:cmd.substring(4).toLowerCase()},((e,t,i)=>{e?(e.links&&e.links.length&&(e.links=APP.halifyLinks(e.links)),APP.goToPage("slackeritemdetail",{id:e.albumId||e.id||e.artistId,type:e.nodeType||e.type,title:e.albumName||e.name||e.artistName,seoName:e.link||e.links.share.href.split(".com/")[1]})):alert("Not Found")}))),!0;case"playUrl":const c=APP.slackerPlayerSession();return cmd=n[0],n=e.split(cmd+":"),c||(APP.slackerPlayerSession(require("com.slacker.app.modules.SlackerPlayerSessionModule")),APP.slackerPlayerSession().init()),n[1]&&t&&(c._stopAllVideoPlayers(),c.startPlaylist("SlackerCommandTest",{id:"SlackerCommandTest",name:"Slacker Command Test",autoConvertToStation:!1,songs:{song:[{title:"TEST",name:"TEST",URL:n[1],olicensed:1}]}},null,!0)),!0;case"setTokenTimeout":if(cmd=n[0],n=e.split(cmd+":"),n[1]&&t){let e=Number(n[1]);e>=0&&e<=7200?(APP.setShortToken=Number(e),APP.USER.getSlackerToken((()=>{e?alert(["Token timeout set",e]):alert(["Token timeout set","default"])}))):alert(["Cannot exceed MAX allowed value from server in seconds"])}return!0;case"setAYSL":const d=APP.USER.simpleSettings.session,u=s&&void 0!==s.actualTier?s.actualTier:0,h={0:"anon",1:"basic",5:"plus",10:"premium"};let p,m;return cmd=n[0],n=e.split(cmd+":"),n[1]&&t&&(p=d.aysl[h[u]],m=Number(n[1])/3600,m<p?(d.aysl[u]=1e3*Number(n[1]),alert(["AYSL for user changed","tier",h[u],`${n[1]} secs`])):alert(["Cannot exceed MAX allowed value from server in seconds"])),!0}}catch(e){CONSOLE.error("Failed to execute Slacker command",e)}}return!1},onActionResponse:function(e,t,i){}},registerPackage("com.slacker.app.actions.slacker.HandleSearchCommandAction"),com.slacker.app.actions.slacker.HandleSearchCommandAction=t}()})),bjork("com.slacker.app.actions.slacker.ParseVastAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=(require("com.slacker.app.modules.UrlModule"),require("com.slacker.io.XmlUtils"));function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e,t){const i=this._parseXml(e);
1if(i&&i.length){for(let e in i[0].audio)t[e]=i[0].audio[e];i[0].display&&(t.companion=i[0].display)}return t},_parseXml:function(e){const i=new Array;let s=t.selectSingleNode(e,"//AdTitle"),a=t.selectSingleNode(e,"//AdSystem"),n=t.selectNodes(e,"//Creatives//Creative"),o=t.selectNodes(e,"//Impression"),r=t.selectNodes(e,"//TrackingEvents//Tracking"),l=t.selectNodes(e,"//CustomTracking//Tracking"),c=t.selectNodes(e,"//AdParameters"),d=[],u=null,h=-1;d=d.concat(o),s=s&&(s.textContent||s.text)&&a&&"GDFP"==(a.textContent||a.text)?(s.textContent||s.text).trim():null,s||(s="Advertisement");for(let e=0;e<n.length;e++){n[e].getAttribute("sequence")?h=Number(n[e].getAttribute("sequence"))-1:-1==h&&h++,i[h]||(i[h]=new Object);const a=t.selectNodes(n[e],"//VideoClicks//ClickThrough[@id='GDFP']");let o=n[e].getElementsByTagName("Companion[IFrameResource or HTMLResource or StaticResource]"),p=n[e].getElementsByTagName("MediaFile[@type='audio/mpeg']");if(0==p.length&&0==o.length&&(p=t.selectNodes(n[e],"//MediaFiles//MediaFile[@type='audio/mpeg']"),o=t.selectNodes(n[e],"//CompanionAds//Companion[IFrameResource or HTMLResource or StaticResource]")),p.length>0){if(i[h].audio=null,r&&r.length>0){let e,t,i=null,s=null;for(let a=0;a<r.length;a++)if(s=r[a].textContent||r[a].text,s){switch(e=r[a].getAttribute("event"),t=s.trim(),i=null,e){case"complete":i="end";break;case"start":case"firstQuartile":case"midpoint":case"thirdQuartile":i=e}null!==i&&(u||(u={}),u[i]||(u[i]=[]),u[i].push(t))}}if(i[h].audio={type:"ad",songType:"vastaudio",title:s,artist:"Advertisement",impTracking:[],audioOnlyImpTracking:[],quartileTracking:u,skip:"no"},d.forEach((e=>{i[h].audio.impTracking.push((e.textContent||e.text).trim())})),l&&l.length>0&&l.forEach((e=>{i[h].audio.impTracking.push((e.textContent||e.text).trim())})),i[h].audio.audioOnlyImpTracking=[].concat(i[h].audio.impTracking),c&&c[0]&&(c[0].textContent||c[0].text)){let e,t,s,n,o,r=(c[0].textContent||c[0].text).trim().split(","),l={};for(o=0;o<r.length;o++)e=r[o].split("="),l[e[0]]=e[1];l.action&&("upgrade"==l.page?n="APP.onRequestUpgrade('"+l.type+"', '"+l.src+"')":"register"==l.page?n="APP.USER.doSlackerLogin()":l.sid?(t=l.sid,s="station"):l.plid?(t=l.plid,s="playlist"):l.aid?(t=l.aid,s="artist"):l.alid?(t=l.alid,s="album"):l.tid?(t=l.tid,s="track"):l.songid&&(t=l.songid,s="song"),t&&s&&(n=("play"==l.action?"AUTOLAUNCH=true;":"")+"APP.goToPage('slackeritemdetail', {type:'"+s+"',title:'',seoName:'',id:'"+t+"'});")),n&&(i[h].audio.clickAction=n,a&&a.length>0&&(i[h].audio.clickTracking=(a[0].textContent||a[0].text).trim()))}else a&&a.length>0&&(i[h].audio.clickAction=(a[0].textContent||a[0].text).trim());i[h].audio.URL=(p[0].textContent||p[0].text).trim(),CONSOLE.info("Adding stream URL from VAST: "+i[h].audio.URL);const o=t.selectSingleNode(n[e],"//Duration");if(o){const e=(o.textContent||o.text).trim().split(":"),t=3600*parseInt(e[0])+60*parseInt(e[1])+Math.ceil(e[2]);i[h].audio.tlen=t}}else if(o){i[h].display||(i[h].display={});for(let e=0;e<o.length;e++){const t=o[e],s=[t.getAttribute("width"),t.getAttribute("height")],a=t.getElementsByTagName("IFrameResource")[0]||t.getElementsByTagName("HTMLResource")[0]||t.getElementsByTagName("StaticResource")[0],n=a.nodeName,r=(a.textContent||a.text).trim();if(r&&(300==s[0]&&s[1]>=250&&s[1]<=600||s[0]>=728&&s[0]<=970&&90==s[1]||s[0]==s[1])){let e=s[0]==s[1]?"square":300==s[0]?"medrect":"leaderboard",a=r,o={};switch(n){case"StaticResource":const r=t.getElementsByTagName("Tracking"),l=t.getElementsByTagName("CompanionClickThrough"),c=t.getElementsByTagName("AltText");if((300==s[0]&&250==s[1]||"square"==e)&&(i[h].audio&&!i[h].audio.albumCoverArt||i[h].audio&&"square"==i[h].audio.albumCoverArt.size)&&(CONSOLE.info("Setting player square img companion: "+[n,e,s.join("x")]),i[h].audio.albumCoverArt={host:a,size:e,path:""},l.length>0&&!i[h].audio.clickAction&&(i[h].audio.clickAction=(l[0].textContent||l[0].text).trim()),r.length>0)){let e=new Array;const t=i[h].audio?i[h].audio.audioOnlyImpTracking:null;t&&(e=e.concat(t));for(let t=0;t<r.length;t++)"creativeView"==r[t].getAttribute("event")&&e.push((r[t].textContent||r[t].text).trim());CONSOLE.info("Appending StaticResource AlbumArt tracking to display track."),i[h].audio.impTracking=e}if("square"==e||i[h].display[e])a=null;else if(o={type:"img",spotSize:e,width:s[0],height:s[1],data:a,click:l.length>0?function(){window.open((l[0].textContent||l[0].text).trim())}.bind(this):null,altText:c.length>0?(c[0].textContent||c[0].text).trim():null,clickTracking:null,impTracking:[]},r.length>0)for(let e=0;e<r.length;e++)"creativeView"==r[e].getAttribute("event")&&o.impTracking.push((r[e].textContent||r[e].text).trim());break;case"HTMLResource":i[h].display[e]&&"IframeResource"==i[h].type||(o={type:"html",spotSize:e,width:s[0],height:s[1],data:a,click:null,altText:null,clickTracking:null,impTracking:[]});break;case"IFrameResource":o={type:"iframe",spotSize:e,width:s[0],height:s[1],data:a,click:null,altText:null,clickTracking:null,impTracking:[]}}i[h].type=n,a&&o.type&&(CONSOLE.info("Adding VAST companion: "+[n,e,s.join("x")]),i[h].display[e]||(i[h].display[e]={}),i[h].display[e]=o)}}}}return i}},registerPackage("com.slacker.app.actions.slacker.ParseVastAction"),com.slacker.app.actions.slacker.ParseVastAction=new i}()})),bjork("com.slacker.app.actions.slacker.ResolveSlackerSeoUrlAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(t){extendClass(this,new e),this.__beforeConstructor(t),this.__constructor(t)}s.prototype={__beforeConstructor:function(){},__constructor:function(e){this.retryCount=0,e&&Object.keys(e).forEach((t=>this[t]=e[t]))},execute:function(e,i){CONSOLE.debug("Resolving SEO url: "+e),this.isFetching=!0;const s=/\/(artist|audiobook|station|album|song|genre|host|podcast|user)\/([^\/]*)\/?(.*)?/.exec(e);let a,n,o="xml",r={"Content-Type":"text/xml; charset=UTF-8"};s&&s.length>=3&&s[1]&&s[2]?(a=s[2]+(s[3]?"/"+s[3]:""),"genre"==s[1]?(r=null,o="json","newstalk"==s[2]?(o="json",n=t.get(APP.SERVICE.urls.SLACKER.API.CATEGORYBYREFERENCE,{linktype:"templated",categoryId:1902})):n=t.get(APP.SERVICE.urls.SLACKER.API.RESOLVEBYSEONAME,{linktype:"templated",seoName:`genre/${s[2]}`}).replace("/LIVEXLIVE/","/SLACKER/")):(o="json",n=t.get(APP.SERVICE.urls.SLACKER.API.RESOLVEBYSEONAME,{linktype:"templated",seoName:`${s[1]}/${a}`}).replace("/LIVEXLIVE/","/SLACKER/")),this.callback=i,this._doRequest({source:n,callback:this.onActionResponse.bind(this),method:"GET",type:o,data:null,headers:r,noretry:this.noRetry}
1)):CONSOLE.warn("SEO URL not valid: "+e)},onActionResponse:function(e,t,s){let a,n;if(s.responseJSON&&e==s.responseJSON)a=e;else{e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}}switch(this.isFetching=!1,CONSOLE.debug("WS server response: "+[t,s.status,a]),s.status){case 200:n=a&&a.results?a.results:a;break;case 401:break;default:n=a}401!=s.status&&this.callback&&this.callback(s.status,n)}},registerPackage("com.slacker.app.actions.slacker.ResolveSlackerSeoUrlAction"),com.slacker.app.actions.slacker.ResolveSlackerSeoUrlAction=s}()})),bjork("com.slacker.app.actions.slacker.SendServiceReportAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");require("com.slacker.io.XmlUtils");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e){this.actionUrl=t.get(APP.SERVICE.urls.SLACKER.SESSION.REPORT,{}),this._doRequest({source:this.actionUrl,callback:this.onActionResponse.bind(this),method:"POST",type:"json",data:JSON.stringify(e)})},onActionResponse:function(e,t,i){CONSOLE.debug("SendServiceReportAction server response: "+[t,i.status]),i.status}},registerPackage("com.slacker.app.actions.slacker.SendServiceReportAction"),com.slacker.app.actions.slacker.SendServiceReportAction=i}()})),bjork("com.slacker.app.actions.slacker.SlackerAbstractAction",(function(){!function(){var e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.modules.NetworkModule");function i(){extendClass(this,new e(this)),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.x2js=new X2JS,this.actionUrl=null,this.callback=null,this.isFetching=!1},__constructor:function(){},execute:function(e){},_doRequest:function(e){return APP.SERVICE.isForceUpgradeRequired?(CONSOLE.warn("SlackerAbstractAction:: Killing pending request due to force upgrade required"),void APP.onForceUpdate()):t.do(e.source,e.callback,e.method,e.type,e.data,e.headers,e.noretry)},halifyLinks:function(e){e&&e.forEach((t=>{e[t.rel]=t}))},onActionResponse:function(){}},registerPackage("com.slacker.app.actions.slacker.SlackerAbstractAction"),com.slacker.app.actions.slacker.SlackerAbstractAction=i}()})),bjork("com.slacker.app.actions.slacker.WebBeaconAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");require("com.slacker.io.XmlUtils");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.PARAMS={trackEnd:"endType={end}&output={output-engine}&numBufferingEvents={numBufferingEvents}&totalBufferingTime={totalBufferingTime}&mediaType={mediaType}&startTime={startTime}",mediaPlayerError:"trackId={track-id}&fileId={file-id}&performanceId={performance-id}&sid={station-id}&plid={pl-id}&medialURL={medial-url}&elapsed={elapsed}&mediaType={media-type}&errorType={error-type}&detail={detail}"}},__constructor:function(){this.retryCount=0,this.beaconCount=0,this.beaconSession=(new Date).getTime()},execute:function(e,i){var s,a,n,o=(new Date).getTime();const r=APP.slackerPlayerSession().currentPlayableItem();if(e){a=t.get(APP.SERVICE.urls.SLACKER.EVENT.BEACON,{event:e}),(s=this.PARAMS[e])&&i?(i.statistics||(i.statistics={}),n={end:i.end,"output-engine":"html5","station-id":i.sid},i.track&&"trackEnd"==e?(n.mediaType=i.track.format,i.statistics&&(n["output-engine"]=i.statistics.playerTech||"html5",n.numBufferingEvents=null!=i.statistics.underrunCount?i.statistics.underrunCount:0,n.totalBufferingTime=null!=i.statistics.bufferingTime?i.statistics.bufferingTime:0,n.startTime=null!=i.statistics.startLatency?i.statistics.startLatency:0)):i.track&&"mediaPlayerError"==e&&(n["medial-url"]=i.track.URL||"",n.elapsed=i.statistics.elapsed||0,n["media-type"]=i.track.format||"",n["error-type"]="playError",n.detail=null!=i.reason_data?i.reason_data.message:"Unable to play media",n["track-id"]=i.track.tid||"",n["file-id"]=i.track.fid||"",n["performance-id"]=i.track.pid||"",n["pl-id"]=("playlist"==r.type?r.id:"")||"",n["station-id"]=r.coreId||""),a+="?"+t.get(s,n)):!s&&i?a=t.get(a,i):"3rdparty"==e?a=i:a+="?";var l=new Image;l.onload=function(){CONSOLE.debug("beacon() success! URL:\n"+a),l=null},l.src="3rdparty"==e?a:[a,"&n="+this.beaconCount++,"&e="+(o-this.beaconSession)].join("")}else CONSOLE.warn(["WebBeaconAction::execute - unknown event.",e])},onActionResponse:function(e,t,i){CONSOLE.debug("WebBeaconAction server response: "+[t,i.status])}},registerPackage("com.slacker.app.actions.slacker.WebBeaconAction"),com.slacker.app.actions.slacker.WebBeaconAction=i}()})),bjork("com.slacker.app.actions.slacker.options.AbstractOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.slackerPlayerSession=APP.slackerPlayerSession,this.supportsHTML5Copy=!0},__constructor:function(){},execute:function(e,t){},getShareOptions:function(e,t,i){var s=[],a=((new Date).getTime(),APP.USER.slackerUser()),n=function(t,i){switch(t){case"facebook":this._onSocialShareRequest({w:626,h:436,url:"https://www.facebook.com/sharer/sharer.php?u=<url>",shareUrl:i});break;case"twitter":this._onSocialShareRequest({w:527,h:433,url:"https://twitter.com/intent/tweet?original_referer="+encodeURIComponent(location.href)+"&text=&tw_p=tweetbutton&url=<url>&via=liveone",shareUrl:i});break;case"embedVideo":e.indexOf("/festival/");var s=i.split("/"),n=["<script>"];n.push("var TYPE=\"video\",H='100%',W='100%',ID=\""+s[s.length-1]+"\",CID='"+com.slacker.util.encoding.B64.encode64((a&&a.id?a.id:"share")+"-"+(new Date).getTime())+"';"),n.push("document.write(String.fromCharCode(60,115,99,114,105,112,116,62,119,105,110,
1100,111,119,46,108,120,108,119,105,100,103,101,116,61,123,108,101,97,118,101,98,101,104,105,110,100,58,116,114,117,101,125,60,47,115,99,114,105,112,116,62,60,115,99,114,105,112,116,32,115,114,99,61,39,104,116,116,112,115,58,47,47,119,119,119,46,108,105,118,101,120,108,105,118,101,46,99,111,109,47,101,109,98,101,100,47,101,109,98,101,100,46,106,115,39,62,60,47,115,99,114,105,112,116,62));"),n.push("</script>"),APP.MESSAGING.prompt("share-embed",{code:n.join("\n")});break;case"email":this._onShareRequest(i)}}.bind(this);i?n(i,e):(s.push(APP.MESSAGING.buildMenuItem({title:"Facebook",type:"contextfinal",seoName:"context-menu-shareto-facebook"},function(){n("facebook",e)}.bind(this),"context share facebook")),s.push(APP.MESSAGING.buildMenuItem({title:"X",type:"contextfinal",seoName:"context-menu-shareto-twitter"},function(){n("twitter",e)}.bind(this),"context share twitter")),CONFIG.allowEmbedShare&&(e.indexOf("festival/")>-1||e.indexOf("video/")>-1)&&s.push(APP.MESSAGING.buildMenuItem({title:"Embed",type:"contextfinal",seoName:"context-menu-shareto-embed"},function(){n("embedVideo",e)}.bind(this),"context share embed")),s.push(APP.MESSAGING.buildMenuItem({title:"Share Link",type:"contextfinal",seoName:"context-menu-shareto-email"},function(){n("email",e)}.bind(this),"context share email")),APP.MESSAGING.contextMenu()&&APP.MESSAGING.contextMenu().length>0?(APP.MESSAGING.contextMenu(s),setTimeout((()=>{$("#contextmenu").find("li")[0].focus()}))):APP.MESSAGING.showContextMenu(s,t))},getShortUrlForShare:function(e,i){var s=[];s.push("<urlaliasrequest>\n"),s.push('<url id="1" site="slacker">'),s.push(e.replace(/(\&)/g,"&")),s.push("</url>\n"),s.push("\n</urlaliasrequest>"),this._doRequest({source:t.get(t.SERVICE.SLACKER.SESSION.URLALIAS),callback:function(e,t,i){}.bind(this),method:"POST",type:"xml",data:s.join(""),headers:{"Content-Type":"text/xml; charset=UTF-8"}})},_onSocialShareRequest:function(e){const i=(new Date).getTime(),s=APP.USER.slackerUser(),a=0==e.shareUrl.indexOf("http")?e.shareUrl:`${t.get(t.SERVICE.DATA.ROOT)}/${e.shareUrl}
1`,n=e.finalShare?e.finalShare:a+"?sharedOn="+i+"&sharedBy="+(s&&s.id?s.id:"");window.open(e.url.replace("<url>",n),"LXLShare","height="+e.h+",width="+e.w+",location=no,status=no,toolbar=no,",!1)},_onShareRequest:function(e){const i=(new Date).getTime(),s=APP.USER.slackerUser();let a;if(a=0==e.indexOf("http")?e:`${t.get(t.SERVICE.DATA.ROOT)}/${e}`,this.supportsHTML5Copy){var n=document.createElement("DIV");n.textContent=a+"?sharedOn="+i+"&sharedBy="+(s&&s.id?s.id:""),document.body.appendChild(n),function(e){if(document.selection)(t=document.body.createTextRange()).moveToElementText(e),t.select();else if(window.getSelection){var t;(t=document.createRange()).selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}}(n),document.execCommand("copy"),n.remove(),APP.MESSAGING.prompt("ticklerFree",{msg:"Share link copied to clipboard. Go ahead and paste it into your favorite social network, blog post, email, or text message."})}}},registerPackage("com.slacker.app.actions.slacker.options.AbstractOptionsAction"),com.slacker.app.actions.slacker.options.AbstractOptionsAction=i}()})),bjork("com.slacker.app.actions.slacker.options.AlbumOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction"),t=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,i){var s=[],a=APP.USER.slackerUser().policy.capabilities.features;e.olicensed>0&&!APP.basicRadioOnly()&&s.push(APP.MESSAGING.buildMenuItem({title:"Add To Playlist",type:"contexfinal",seoName:"context-menu-album-add-to-playlist"},(function(){a.ondemand.enabled?APP.MESSAGING.prompt("create-playlist",null,null,e):APP.MESSAGING.prompt("on-demand-playlist")}),"context create")),(e.albumlink||e.link)&&s.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(e.albumlink||e.link,i)}.bind(this),"context share")),s.push(APP.MESSAGING.buildMenuItem({title:t.bookmarks.album[e.id]?"Un-Bookmark":"Bookmark",type:"contextfinal",seoName:"context-menu-album-bookmark-toggle"},function(){t.bookmarks.album[e.id]?t.execute({remove:[{type:"album",id:e.id}]}):t.getBookmarkSid("album",e.id,(function(i){i&&(e.sid=i,t.execute({add:[{type:"album",item:e}]}))}))}.bind(this),"context bookmark")),APP.MESSAGING.showContextMenu(s,i)}},registerPackage("com.slacker.app.actions.slacker.options.AlbumOptionsAction"),com.slacker.app.actions.slacker.options.AlbumOptionsAction=i}()})),bjork("com.slacker.app.actions.slacker.options.ArtistOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction"),t=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,i){var s=[];APP.supportsSlacker&&-1==t.bookmarkCount?t.execute("init",(()=>{this.execute(e,i)})):e.rights?("scheduledEvent"!=e.type&&s.push(APP.MESSAGING.buildMenuItem({title:"Add To Station",type:"contexfinal",seoName:"context-menu-artist-add-to-station"},(function(){APP.MESSAGING.prompt("create-station",null,null,{name:e.name||e.artistName,id:e.id||e.artistId,artistId:e.artistId||e.id,imgPath:e.imgPath||e.imagePath})}),"context create")),(e.artistlink||e.link)&&"scheduledEvent"!=e.type&&s.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(e.albumlink||e.link,i)}.bind(this),"context share")),"scheduledEvent"==e.type&&(e.possibleTicketTabs&&s.push(APP.MESSAGING.buildMenuItem({title:"Buy Ticket",type:"contexfinal",seoName:"context-menu-artist-buy-ticket"},(function(){"string"==typeof e.possibleTicketTabs?(e.storeUrl=e.possibleTicketTabs,APP.onPurchaseTicketsClick(e)):APP.currentView.data()[0].sections.changeTab(e.possibleTicketTabs)}),"context create")),s.push(APP.MESSAGING.buildMenuItem({title:"Go to Artist Page",type:"contexfinal",seoName:"context-menu-go-to-artist"},(function(){APP.goToPage("slackeritemdetail",{type:"artist",title:e.name,seoName:e.link,id:e.artistId})}),"context nav")),e.basicradio>0&&s.push(APP.MESSAGING.buildMenuItem({title:"Play Artist Radio",type:"contexfinal",seoName:"context-menu-play-artist-radio"},(function(){let t=Object.assign({},e);t.basicradio=1,APP.onPlaySlackerRadioItem(t,i)}),"context play"))),s.push(APP.MESSAGING.buildMenuItem({title:t.bookmarks.artist[e.id]?"scheduledEvent"==e.type?"Remove Artist from Favorites":"Un-Bookmark":"scheduledEvent"==e.type?"Add Artist to Favorites":"Bookmark",type:"contextfinal",seoName:"context-menu-artist-toggle-bookmark"},function(){t.bookmarks.artist[e.id]?t.execute({remove:[{type:"artist",id:e.id}]}):t.getBookmarkSid("artist",e.id,(function(i){i&&(e.sid=i,t.execute({add:[{t
1ype:"artist",item:e}]}))}))}.bind(this),"context bookmark")),APP.MESSAGING.showContextMenu(s,i)):this._doRequest({source:APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.SLACKER.DATA.ARTIST,{linktype:"templated",type:"artist",id:e.artistId||e.id}),callback:function(t,s,a){"scheduledEvent"==e.type&&(t.type="scheduledEvent",t.possibleTicketTabs=e.possibleTicketTabs),t.id=t.artistId,t.nodeType="artist",this.execute(t,i)}.bind(this),method:"GET",type:"json",data:null})}},registerPackage("com.slacker.app.actions.slacker.options.ArtistOptionsAction"),com.slacker.app.actions.slacker.options.ArtistOptionsAction=i}()})),bjork("com.slacker.app.actions.slacker.options.PlayerSongOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction");function t(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(),this.previousEvent={},this.currentMenuItem=null}t.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,t){this.currentMenuItem=e,t?this.previousEvent=t:t=this.previousEvent;const i=APP.USER.slackerUser(),s={track:e,event:t,options:[],pSess:this.slackerPlayerSession(),cpi:this.slackerPlayerSession().currentPlayableItem(),slackerUser:i,features:i.policy.capabilities.features};"intro"!==e.type&&"outtro"!==e.type&&"ad"!==e.type&&(e.podcastLink?this._buildPodcastMenu(s,this):e.audiobookLink?this._buildAudiobookMenu(s,this):this._buildDefaultMenu(s,this),e.artistlink&&e.artistid>0&&this._buildArtistMenu(s,this)),APP.MESSAGING.showContextMenu(s.options,s.event)},hasMenuItems:function(e,t,i){return!(!e||"intro"===e.type||"outtro"===e.type||"ad"===e.type)&&(!!(e.artistlink&&e.artistid>0)||(!(!e.podcastLink&&!e.audiobookLink)||(!(!e.songlink&&!e.link)||e.olicensed>0&&(!i&&!!t&&"audiobook"!==t.type||!(!t||"station"!==t.type||"true"!==e.cantrackrate)))))},_buildDefaultMenu:function(e,t){const{options:i,track:s,cpi:a,pSess:n,slackerUser:o,features:r,slider:l,tmp:c}=e;(s.olicensed>0||s.songlink||s.link)&&(i.push(APP.MESSAGING.buildMenuItem({title:"Song",type:"context",seoName:""},null,"context separator")),"station"===a.type&&"ad"!==s.type&&"true"===s.cantrackrate&&(-100===s.trate?i.push(APP.MESSAGING.buildMenuItem({title:"Un-Ban",type:"contextfinal",seoName:"context-menu-player-song-unban"},function(){n.rateTrack(s,0)}.bind(t),"context rate heart")):(i.push(APP.MESSAGING.buildMenuItem({title:100==s.trate?"Un-Favorite":"Favorite",type:"contextfinal",seoName:100==s.trate?"context-menu-player-song-unrate":"context-menu-player-song-rate"},function(){n.rateTrack(s,100==s.trate?0:100)}.bind(t),"context rate heart")),i.push(APP.MESSAGING.buildMenuItem({title:"Ban",type:"contextfinal",seoName:"context-menu-player-song-unban"},function(){n.rateTrack(s,-100)}.bind(t),"context rate ban")))),(s.songlink||s.link)&&i.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(s.songlink||s.link,event)}.bind(t),"context share")),s.olicensed>0&&!APP.basicRadioOnly()&&"audiobook"!==a.type&&i.push(APP.MESSAGING.buildMenuItem({title:"Add To Playlist",type:"contexfinal",seoName:"context-menu-player-song-add-to-playlist"},(function(){r.ondemand.enabled?APP.MESSAGING.prompt("create-playlist",null,null,s):APP.MESSAGING.prompt("on-demand-playlist")}),"context create")))},_buildPodcastMenu:function(e,t){const{options:i,track:s,event:a}=e;i.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:""},null,"context separator")),i.push(APP.MESSAGING.buildMenuItem({title:"Share Episode",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(s.link,a)}.bind(t),"context share")),i.push(APP.MESSAGING.buildMenuItem({title:"Share Podcast",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(s.podcastLink,a)}.bind(t),"context share"))},_buildAudiobookMenu:function(e,t){const{options:i,track:s,event:a}=e;i.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:""},null,"context separator")),i.push(APP.MESSAGING.buildMenuItem({title:"Share Audiobook",type:"context",seoName:"NO_BEACON"}
1,function(){this.getShareOptions(s.link,a)}.bind(t),"context share"))},_buildArtistMenu(e,t){const{options:i,track:s,event:a,cpi:n,pSess:o}=e;i.push(APP.MESSAGING.buildMenuItem({title:"Artist",type:"context",seoName:""},null,"context separator")),"station"===n.type&&"ad"!==s.type&&"true"===s.canartistrate&&i.push(APP.MESSAGING.buildMenuItem({title:-100==s.arate?"Un-Ban":"Ban",type:"contextfinal",seoName:-100==s.arate?"context-menu-player-artist-unban":"context-menu-player-artist-ban"},function(){o.rateCurrentTrack(-100==s.arate?"0":"-100",null,"artist",s)}.bind(t),"context rate heart")),i.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(s.artistlink,a)}.bind(t),"context share")),i.push(APP.MESSAGING.buildMenuItem({title:"Add To Station",type:"contexfinal",seoName:"context-menu-player-artist-add-to-station"},(function(){APP.MESSAGING.prompt("create-station",null,null,{name:s.artist,id:s.artistid})}),"context create"))}},registerPackage("com.slacker.app.actions.slacker.options.PlayerSongOptionsAction"),com.slacker.app.actions.slacker.options.PlayerSongOptionsAction=t}()})),bjork("com.slacker.app.actions.slacker.options.PlaylistSongOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction");function t(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}t.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,t,i){var s=[],a=APP.currentView.playlistDef,n=require("com.slacker.app.modules.SlackerCreatorModule");s.push(APP.MESSAGING.buildMenuItem({title:"Move to Beginning",type:"contexfinal",seoName:"context-menu-playlist-song-move-0"},(function(){var t=e.rootIndex;n.reorderPlaylist(t,0,a,(function(e,t){200!=e&&APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}),"context")),s.push(APP.MESSAGING.buildMenuItem({title:"Move Up 5",type:"contexfinal",seoName:"context-menu-playlist-song-move-up5"},(function(){var t=e.rootIndex,i=Math.max(0,e.rootIndex-6);n.reorderPlaylist(t,i,a,(function(e,t){200!=e&&APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}),"context")),s.push(APP.MESSAGING.buildMenuItem({title:"Move Down 5",type:"contexfinal",seoName:"context-menu-playlist-song-move-dn5"},(function(){var t=e.rootIndex,i=Math.min(a.songs.song.length,e.rootIndex+6);n.reorderPlaylist(t,i,a,(function(e,t){200!=e&&APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}),"context")),s.push(APP.MESSAGING.buildMenuItem({title:"Move To End",type:"contexfinal",seoName:"context-menu-playlist-song-move-end"},(function(){var t=e.rootIndex;to=a.songs.song.length,n.reorderPlaylist(t,to,a,(function(e,t){200!=e&&APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}),"context")),s.push(APP.MESSAGING.buildMenuItem({title:e.removed()?"Undo Remove":"Remove",type:"contexfinal",seoName:"context-menu-playlist-song-toggle-remove"},(function(){const t=e.removed();let s=i.playlistLen(),a=i.content().length,n=0;e.removed(!t),n=i.content().filter((e=>e().removed())).length,n==a?(e.removed(!1),APP.MESSAGING.prompt("customPlaylistMinSongCount")):(i.isEditDirty(n&&n!=i.data.length),APP.currentView.isEditDirty(i.isEditDirty()),s=t?s+Number(e.tlen):s-Number(e.tlen),i.playlistLen(s))}),"context")),APP.MESSAGING.showContextMenu(s,t)}},registerPackage("com.slacker.app.actions.slacker.options.PlaylistSongOptionsAction"),com.slacker.app.actions.slacker.options.PlaylistSongOptionsAction=t}()})),bjork("com.slacker.app.actions.slacker.options.SongOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction");function t(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}t.prototype={__beforeConstructor:function(){},__constructor:function(){this.view=null},execute:function(e,t){var i=this,s=[],a=APP.USER.slackerUser().policy.capabilities.features;(e.olicensed>0||e.songlink||e.link)&&((e.songlink||e.link)&&s.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},function(){this.getShareOptions(e.songlink||e.link,t)}.bind(this),"context share")),e.olicensed>0&&!APP.basicRadioOnly()&&s.push(APP.MESSAGING.buildMenuItem({title:"Add To Playlist",type:"contexfinal",seoName:"context-menu-song-add-to-playlist"},(function(){a.ondemand.enabled?APP.MESSAGING.prompt("create-playlist",null,null,e):APP.MESSAGING.prompt("on-demand-playlist")}),"context create"))),this.view&&"MylibraryView"==this.view.type&&s.push(APP.MESSAGING.buildMenuItem({title:"Remove",type:"contexfinal",seoName:"context-menu-song-remove-favorite"},(function(){i.view._onUnrateStationItem("song",e.pid,null,e.sectionItemIndex)}),"context remove")),s.length>0&&APP.MESSAGING.showContextMenu(s,t)}},registerPackage("com.slacker.app.actions.slacker.options.SongOptionsAction"),com.slacker.app.actions.slacker.options.SongOptionsAction=t}()})),bjork("com.slacker.app.actions.slacker.options.StationOptionsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.options.AbstractOptionsAction"),t=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction"),i=require("com.slacker.app.modules.SlackerCreatorModule");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,i){let s=[];(e.link||"playlist"==e.nodeType)&&s.push(APP.MESSAGING.buildMenuItem({title:"Share",type:"context",seoName:"NO_BEACON"},(()=>this.getShareOptions(e.link,i)),"context share")),e.isOwner&&(e.artistMix||"playlist"==e.nodeType)&&s.push(APP.MESSAGING.buildMenuItem({title:"Delete",type:"contextfinal",seoName:"context-menu-station-delete"},(()=>this._onDeleteRequest(e)),"context bookmark")),!e.myorder&&(e.isOwner&&e.artistMix||"playlist"==e.nodeType)||s.push(APP.MESSAGING.buildMenuItem({title:e.bookmarked||t.bookmarks.station[e.sid]?"Un-Bookmark":"Bookmark",type:"contextfinal",seoName:"context-menu-station-toggle-bookmark"},(()=>{e.links&&e.links.bookmark?t.execute({type:e.type,id:e.id,state:e.bookmarked,api:e.links.bookmark.href}):t.bookmarks.station[e.sid]?t.execute({remove:[{type:"station",id:e.sid}]}
1):t.execute({add:[{type:"station",item:e}]})}),"context bookmark")),APP.MESSAGING.showContextMenu(s,i)},_onDeleteRequest:function(e){const t=APP.slackerPlayerSession(),s=e.nodeType||e.type;APP.MESSAGING.prompt("removeSlackerItem",{name:e.title},[{label:"NO",styles:"std",action:null},{label:"YES",styles:"std secondary",action:()=>{const a=e.sid||e.id,n="playlist"==s?"deletePlaylist":"deleteStation";APP._setNavigating(!0),BEACON.tagEvent({name:"hidePrompt",params:{value:"removeSlackerItem",label:"yes"}}),APP.MESSAGING.setModal(),i[n](a,(function(e){APP._setNavigating(!1),200==e?t&&t.currentPlayableItem()&&a==t.currentPlayableItem().id&&(t.radioPlayer.pause(!0),t.currentPlayableItem().stop("delete")):APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}}])}},registerPackage("com.slacker.app.actions.slacker.options.StationOptionsAction"),com.slacker.app.actions.slacker.options.StationOptionsAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.BookmarkItemAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree"),s=require("com.slacker.app.actions.slacker.radio.CreateStationAction"),a=require("com.slacker.app.modules.UrlModule");function n(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}n.prototype={__beforeConstructor:function(){this.EVENT={UPDATED:"bookmarks-updated"},this.bookmarks={artist:{},album:{},station:{}},this.bookmarkCount=-1,this.data},__constructor:function(){this.retryCount=0,this.callback=[],this.createStation=new s},execute:function(e,s,n){const o=APP.USER.slackerUser(),r="init"===e;let l,c,d,u,h="GET";this.isFetching?s&&!n&&this.callback.push(s):e&&APP.requireSlackerServicesPromise().then((()=>
1{if(this.isFetching)s&&!n&&this.callback.push(s);else{if(this.isFetching=!0,this.bookmarkCount<0||r){const i=e;return CONSOLE.warn(["BookmarkItemAction::execute - init bookmark status. bookmarkCount:",this.bookmarkCount,"bIsInit:",r]),void t.execute(((e,t,a)=>{for(this._onBookmarksLoaded(e,t,a),this.isFetching=!1;this.callback.length;)this.callback.pop()();r?s&&s():this.execute(i,s)}))}this.data=e,"podcast"==e.type?(l=e.api?e.api:a.get(APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.BOOKMARKSBYTYPE,{linktype:"templated",type:"podcast"})+`&paged=true&page=0&size=${e.maxPageSize||20}`,c=null,d="json",e.api&&(h=e.state?"DELETE":"PUT"),u={},l.indexOf("/1?")>-1&&o.id>1&&(l=l.replace("/1?",`/${o.id}?`))):(l=a.get(APP.SERVICE.urls.SLACKER.EDIT.BOOKMARK),CONSOLE.warn(["BookmarkItemAction::execute - serialize with bookmarkCount:",this.bookmarkCount,"add:",JSON.stringify(e.add),"remove:",JSON.stringify(e.remove)]),c=this.serialize(e.remove,e.add,i=this.bookmarkCount),h="POST",d="xml",u={"Content-Type":"text/xml; charset=UTF-8"}),s&&this.callback.push(s),this._doRequest({source:l,callback:this.onActionResponse.bind(this),method:h,type:d,data:c,headers:u})}}))},serialize:function(e,t,i){let s=["<StationOrder>"];return e&&e.forEach((e=>{const t=e.nodeType||e.type,i="station"==t&&e.sid||e.id;this.bookmarks[t][i]?s.push(`<Order id='-1' sid='${this.bookmarks[t][i].sid}'/>`):CONSOLE.warn(["Attempt to remove unknown bookmark",t,e.sid||e.id])})),t&&t.forEach((function(e){s.push(`<Order id='${++i}' sid='${e.item.sid}'/>`)})),s.push("</StationOrder>"),s.join("/n")},getBookmarkSid:function(e,t,i){this.createStation.execute(e,{id:t},!1,((e,t,s)=>{e&&e.response&&e.response.sid?i(e.response.sid,t):i(null,t)}))},onActionResponse:function(e,i,s){CONSOLE.debug("BookmarkItemAction server response: "+[i,s.status]);let a=Object.assign(this.data);for(200==s.status&&("podcast"==a.type&&a.id&&(a.state=!a.state),this.data.remove&&this.data.remove.forEach((e=>{const t=e.nodeType||e.type,i="station"==t&&e.sid||e.id;this.bookmarks[t]&&this.bookmarks[t][i]&&(delete this.bookmarks[t][i],this.bookmarkCount--,CONSOLE.warn(["BookmarkItemAction::onActionResponse - removed bookmark, count now:",this.bookmarkCount,"type:",t,"id:",i]))})),this.data.add&&this.data.add.forEach((e=>{const t=e.nodeType||e.type;this.bookmarks[t]||(this.bookmarks[t]={}),"station"==e.type?this.bookmarks[t][e.item.sid]=e.item:this.bookmarks[t][e.item.id]=e.item,this.bookmarkCount++,CONSOLE.warn(["BookmarkItemAction::onActionResponse - added bookmark, count now:",this.bookmarkCount,"type:",t,"sid:",e.item.sid||e.item.id])}))),this.isFetching=!1,this.data=null;this.callback.length;)this.callback.pop()(e,i,s);200==s.status&&(("podcast"!=a.type||"podcast"==a.type&&a.id)&&this.dispatch({type:this.EVENT.UPDATED,bookmarks:this.bookmarks,bookmark:a}),"podcast"!=a.type&&t.clearSessionCache())},_onBookmarksLoaded:function(e,t,i){const s=this,a=this.bookmarkCount;this.bookmarks={artist:{},album:{},station:{}},this.bookmarkCount=0,this.lastLoadFailed=!e||!e.myTree,e&&e.myTree&&e.myTree.Category?(e.myTree.Category.length||(e.myTree.Category=[e.myTree.Category]),e.myTree.Category.forEach((function(e){e.sid.indexOf("bookmarked")>-1&&(e.Station.length||(e.Station=[e.Station]),e.Station.forEach((function(e){var t,i;"artistMix"!=e.type&&(e.type&&"stream"!=e.type&&e.type.indexOf(":")>-1?(t=e.type.split(":")[0],(i=e.type.split(":")[1]).indexOf("album")>-1?(t="album",i=i.split("/")[1]):("favs"==t||"perf"==t||"uri"==t||t.indexOf("playlist")>-1)&&(t="station",i=e.sid)):(t="station",i=e.sid),s.bookmarkCount++,s.bookmarks[t][i]=e)})))}))):CONSOLE.warn(["BookmarkItemAction::_onBookmarksLoaded","No data returned",t,i?i.status:0]),CONSOLE.warn(["BookmarkItemAction::_onBookmarksLoaded - count reset from",a,"to",this.bookmarkCount,"stations:",Object.keys(this.bookmarks.station).length,"artists:",Object.keys(this.bookmarks.artist).length,"albums:",Object.keys(this.bookmarks.album).length])}},registerPackage("com.slacker.app.actions.slacker.radio.BookmarkItemAction"),com.slacker.app.actions.slacker.radio.BookmarkItemAction=new n}()})),bjork("com.slacker.app.actions.slacker.radio.CreateStationAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){this.TYPE_ARGS={artist:"artistid=<id>",song:"songid=<id>&pid=<perf-id>",track:"songid=<id>&pid=<perf-id>",album:"albumid=<id>",playlist:"pl=<id>",favs:"favs=true"}},__constructor:function(){},execute:function(e,i,s,a){let n;this.TYPE_ARGS[e]?(CONSOLE.warn(["CreateStationAction::execute - Requesting station",e,i,this.TYPE_ARGS[e]]),n=t.get(APP.SERVICE.urls.SLACKER.CREATE.STATION,{"type-arg":this.TYPE_ARGS[e]}).replace(/\</g,"{").replace(/\>/g,"}"),this.isFetching=!0,this.callback=a,s&&(n+="&forcecreate=true"),this._doRequest({source:t.get(n,i),callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null})):CONSOLE.warn("CreateStationAction::execute - Unknown station builder type - "+e)},onActionResponse:function(e,t,s){var a;APP.USER.slackerUser(),e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}this.isFetching=!1,CONSOLE.debug("Stationbuilder service response: "+[t,s.status]),this.callback&&this.callback(a,t,s)}},registerPackage("com.slacker.app.actions.slacker.radio.CreateStationAction"),com.slacker.app.actions.slacker.radio.CreateStationAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.EditPlaylistAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.callback=null},execute:function(e,s,a){const n="delete"==e?"GET":"POST";let o=t.get(APP.SERVICE.urls.SLACKER.EDIT.PLAYLIST,{id:s.id}),r=[];this.callback=a,"delete"==e?(r=null,o=t.get(APP.SERVICE.urls.SLACKER.API.WS)+s.id+"?delete=true"):(r.push("<Playlist playlistid='"+s.id+"'"),void 0!==s.edit.name?r.push(" name='"+i.encode(s.edit.name)+"'"):r.push(" name='"+i.encode(s.def.name)+"'"),void 0!==s.edit.image?(r.push(" image='"+(s.edit.image||"")+"'"),r.push(" lmtime='"+(new Date).format("ddd, dd mmm yyyy HH:MM:ss",!0)+" GMT'")):(r.push(" image='"+(s.def.image||"")+"'"),r.push(" lmtime='"+(new Date).format("ddd, dd mmm yyyy HH:MM:ss",!0)+" GMT'")),r.push(">"),void 0!==s.edit.description?r.push(this.serialize("description",s.edit)):r.push(this.serialize("description",s.def)),void 0!==s.edit.song?r.push(this.serialize("tracks",s.edit)):r.push(this.serialize("tracks",s.def.songs)),r.push("</Playlist>")),this._doRequest({source:o,callback:this.onActionResponse.bind(this),method:n,type:"xml",data:"delete"==e?null:r.join(""),headers:{"Content-Type":"text/xml; charset=UTF-8"}})},serialize:function(e,t){let i=[],s=null;try{s="_serialize"+e.charAt(0).toUpperCase()+e.substring(1),i.push(this[s](t))}catch(t){CONSOLE.warn("Serialize method not found for type: "+e)}return i.join("/n")},onActionResponse:function(e,t,s){if(CONSOLE.debug("EditPlaylistAction server response: "+[t,s.status]),s&&s.responseText){e=i.parseFromString(s.responseText);try{(e=APP.SERVICE._beanify(this.x2js.xml2json(e))).Playlist&&(e=e.Playlist)}catch(e){}}this.callback&&this.callback(e,t,s)},_serializeTracks:function(e){let t=[];return t.push("<songs>"),e.song.forEach((function(e){e&&("track"==e.nodeType?t.push("<song id='"+(e.song&&e.song[0]?e.song[0].id:e.songid||-1)+"' pid='"+(e.performanceId||e.pid||"")+"' tid='"+(e.id||e.tid||"")+"'></song>"):t.push("<song id='"+e.id+"' pid='"+(e.pid||e.perfId||"")+"' tid='"+(e.tid||e.trackId||"")+"'></song>"))})),t.push("</songs>"),t.join("\n")},_serializeDescription:function(e){return["<description>",i.encode(e.description),"</description>"].join("")}},registerPackage("com.slacker.app.actions.slacker.radio.EditPlaylistAction"),com.slacker.app.actions.slacker.radio.EditPlaylistAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.EditStationAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.callback=null},execute:function(e,i,s){const a="delete"==e?null:this.serialize(e,i.edit),n="delete"==e?"GET":"POST";let o=t.get(APP.SERVICE.urls.SLACKER.EDIT.STATION,{"station-id":i.sid}),r=[];this.callback=s,"delete"==e?(r=null,o=t.get(APP.SERVICE.urls.SLACKER.API.WS)+i.sid+"?delete=true"):(r.push("<Station sid='"+i.sid+"'>"),r.push(a),r.push("</Station>")),this._doRequest({source:o,callback:this.onActionResponse.bind(this),method:n,type:"xml",data:"delete"==e?null:r.join("/n"),headers:{"Content-Type":"text/xml; charset=UTF-8"}})},serialize:function(e,t){let i=[];return e.forEach((e=>{const s=`_serialize${e.charAt(0).toUpperCase()}${e.substring(1)}`;try{i.push(this[s](t))}catch(t){CONSOLE.warn("Serialize method not found for type: "+e)}})),i.join("/n")},onActionResponse:function(e,t,i){CONSOLE.debug("EditStationAction server response: "+[t,i.status]),this.callback&&this.callback(e,t,i)},_serializeArtists:function(e){let t=["<Artists>"];return e.add&&(t=t.concat(e.add.map((e=>`<Artist id='${e.id}
1' core='1'></Artist>`)))),e.remove&&(t=t.concat(e.remove.map((e=>`<Artist id='${e.id}' remove='1' core='1'></Artist>`)))),t.push("</Artists>"),t.join("\n")},_serializeSliders:function(e){let t=[];return e.sliders.length>0&&(t.push("<Sliders>"),t=t.concat(e.sliders.filter((e=>e.value)).map((e=>`<Slider id='${e.id}' type='${e.type}' value='${e.value}'/>`))),t.push("</Sliders>")),t.join("\n")},_serializeName:function(e){return"<Rename name='"+i.encode(e.name)+"'/>"},_serializeDescription:function(e){return["<Description>",i.encode(e.description),"</Description>"].join("")},_serializeImage:function(e){return["<StationImage>",e.image,"</StationImage>"].join("")}},registerPackage("com.slacker.app.actions.slacker.radio.EditStationAction"),com.slacker.app.actions.slacker.radio.EditStationAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.FinetuneSlider",(function(){!function(){function e(e){this.__beforeConstructor(),this.__constructor(e)}e.prototype={__beforeConstructor:function(){this.sliderFriendlyNames={DJs:"Hosts",dj:"Hosts",news:"News",sports:"Sports",age:"Newer Songs",artistrelativeage:"Newer Artists",popularity:"Popular Songs",artistrelativepop:"Popular Artists",favorites:"Favorite Songs","artist discovery":"Related Artists","audio quality":"Audio Quality","playback rate":"Playback Rate"},this.sliderTypeDefs={DJs:["Off","On"],dj:["Off","On"],news:["Off","On"],sports:["Off","On"],age:["Classic","Older","Auto","Recent","Current"],artistrelativeage:["Classic","Older","Auto","Recent","Current"],popularity:["Fringe","Unfamiliar","Auto","Familiar","Hits"],artistrelativepop:["Fringe","Unfamiliar","Auto","Familiar","Hits"],favorites:["Minimum","Auto","More","Maximum"],"artist discovery":["Minimum","Some","More","Maximum"],"audio quality":["med","hi"],"playback rate":["1","1.5","2","2.5"]},this.sliderNagDefs={"artist discovery":{0:{Minimum:{id:"upgradeForDiscoveryOff",level:"premium",msg:"Upgrade to <strong>Premium</strong> to have only the artists you select play on your stations."},Some:{id:"upgradeForDiscoverySome",level:"plus",msg:"Upgrade to <strong>Plus</strong> to set the Related Artists slider here."}},1:{Minimum:{id:"upgradeForDiscoveryOff",level:"premium",msg:"Upgrade to <strong>Premium</strong> to have only the artists you select play on your stations."},Some:{id:"upgradeForDiscoverySome",level:"plus",msg:"Upgrade to <strong>Plus</strong> to set the Related Artists slider here."}},5:{Minimum:{id:"upgradeForDiscoveryOff",level:"premium",msg:"Upgrade to <strong>Premium</strong> to have only the artists you select play on your stations."}}},favorites:{0:{Maximum:{id:"upgradeForMaxFavorites",level:"plus",msg:'Upgrade to <strong>Plus</strong> to access the maximum "Favorites" setting'}},1:{Maximum:{id:"upgradeForMaxFavorites",level:"plus",msg:'Upgrade to <strong>Plus</strong> to access the maximum "Favorites" setting'}}},news:{0:{On:{id:"upgradeForHeadlineNews",level:"plus",msg:"To get Headline News updates, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}},1:{On:{id:"upgradeForHeadlineNews",level:"plus",msg:"To get Headline News updates, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}}},sports:{0:{On:{id:"upgradeForHeadlineSports",level:"plus",msg:"To get Sports updates, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}},1:{On:{id:"upgradeForHeadlineSports",level:"plus",msg:"To get Sports updates, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}}},"audio quality":{0:{hi:{id:"upgradeForHQAudio",level:"plus",msg:"To get high quality audio, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}},1:{hi:{id:"upgradeForHQAudio",level:"plus",msg:"To get high quality audio, you need a subscription. By upgrading your account, you will also get: Ad-free listening and much more."}}}}},__constructor:function(e){var t,i,s,a=function(e,t){this.id=e,this.value=t};if(this.id=e.id,this.name=e.name,this.displayName=this.sliderFriendlyNames[e.type],this.sliderType=e.type,this.value=e.value,this.optionIndex=0,this.origIndex=0,this.options=[],this.sliderTypeDefs[this.sliderType])for(i=(t=this.sliderTypeDefs[this.sliderType]).length,s=0;s<i;s++)this.options.push(new a(this.sliderType,t[s])),t[s]==this.value&&(this.optionIndex=s,this.origIndex=s);this.isBinary=2==this.options.length,this.noUiSliderConfig={range:{min:[0],max:[this.options.length-1]},start:[this.optionIndex],pips:{mode:"steps",density:parseInt(100/(this.options.length-1)),filter:()=>0}};for(var n=this.noUiSliderConfig.pips.density,o=1;n>0&&n<99;)this.noUiSliderConfig.range[n+"%"]=[o++],n+=this.noUiSliderConfig.pips.density},__bindKoComputeds:function(){this.xml=ko.computed((()=>`<Slider id='${this.id()}' type='${this.sliderType()}' value='${this.value()}'/>`))},reset:function(){this.setValue(this.origIndex)},updateResetData:function(){this.origIndex=this.optionIndex},hasNagForValue:function(e,t){return!!this.sliderNagDefs[this.sliderType]&&(this.sliderNagDefs[this.sliderType][e]&&this.sliderNagDefs[this.sliderType][e][t])},setValue:function(e,t,i){var s=this.options[e].value,a=!1;if((!e||this.options[e])&&e!=this.optionIndex){try{if(a=this.hasNagForValue(i,s))return a}catch(e){CONSOLE.error(["Error checking nag for slider",this.sliderType,i,s],e)}return this.optionIndex=e,this.value=s,null}},incrementValue:function(){this.setValue(this.optionIndex+1)},decrementValue:function(){this.setValue(this.optionIndex-1)},getOptionIndexByValue:function(e){var t,i=this.options.length;for(t=0;t<i;t++)if(this.options[t].value==e)return t;return-1}},registerPackage("com.slacker.app.actions.slacker.radio.FinetuneSlider"),com.slacker.app.actions.slacker.radio.FinetuneSlider=e}()})),bjork("com.slacker.app.actions.slacker.radio.GetNextRadioTrackAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.util.browser.Browser"),s=require("com.slacker.io.XmlUtils"),a=require("com.slacker.sads.SAds");function n(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}n.prototype={__beforeConstructor:function(){this.setAudioMediaType()},__constructor:function(){this.retryCount=0,this.adTriggerReason="",i.isSafari()&&this.setAudioMediaType("html5Safari")},setAudioMediaType(e="html5+"){let t=CONFIG.slackerConfig.mediaTypes[e];t?(this.fmtHint=e,this.mediaType=t):CONSOLE.warn(["Unknown audio mediaType",e])},execute:function(e,s,n,o,r,l){const c=APP.slackerPlayerSession();if(this.isFetching)return void CONSOLE.warn("GetNextRadioTrackAction::execute - Request already in process. Ignore redundant request.");this.isFetching=!0;
1let d,u,h,p,m=APP.SERVICE.isCached("aq")||"med",g={"Content-Type":"text/xml; charset=UTF-8",Accept:`text/xml,${this.mediaType}`},P=null;"hi"==m&&APP.USER.slackerUser().effectiveTier<5&&(m="med",APP.SERVICE.cache("aq",m)),this.adTriggerReason=l||(s?s.toUpperCase():"SKIP"),n?(h={"track-id":n.tid,"file-id":n.fid,len:n.tlen,elapsed:o},P=c.radioPlayer.pingPOST):h={"track-id":"","file-id":"",len:"",elapsed:""},h.site="slacker",h["station-id"]=e,h.event=s||"",h["stream-quality"]=m;try{window._slk_dax&&window._slk_dax.data&&(g["x-lxl-nielsen"]=window._slk_dax.data.user.uid,h.nlsuid=`&nlsuid=${window._slk_dax.data.user.uid}`)}catch(e){CONSOLE.warn("Nielsen id not present, or unsupported for user ",e)}"function"==typeof com_adswizz_synchro_getListenerId?g["x-lxl-adswizz"]=com_adswizz_synchro_getListenerId():CONSOLE.warn("AdsWizz id not present, or unsupported for user"),P?(h.ur="&ur="+(null!=P.underrunCount?P.underrunCount:0),h.urtime="&urtime="+(null!=P.bufferingTime?P.bufferingTime:0),h.itt="&itt="+(null!=P.startLatency?P.startLatency:0),h.tkbps="&tkbps=-1",h.urend="&urend=-1"):(h.ur="&ur=-1",h.urtime="&urtime=-1",h.itt="&itt=-1",h.tkbps="&tkbps=-1",h.urend="&urend=-1"),c.isCasting||"sharedSession"==c.itemMatchType||"tv"==APP.implementationSuperType()||i.isMobileDevice()||(h.dstm="&dstmok=true"),a._isAdBlockTechEnabled&&(h.abp="&abp=1",a.events.notify("onAdServerResponse",[null,"adblock"]),a.recheckAdBlockState()),"cast"==this.fmtHint&&(h["station-tree-partner"]="chromecast"),d=t.get(APP.SERVICE.urls.SLACKER.SESSION.NEXT,h).split("?"),p=APP.SERVICE.signSlackerRequest(d[1]),u=`${d[0]}?${p}`,this.callback=r,this._doRequest({source:u,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:g,noretry:!1})},onActionResponse:function(e,t,i){let a,n,o;e=i&&i.responseText?s.parseFromString(i.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}if(this.isFetching=!1,CONSOLE.debug("WSNext server response: "+[t,i.status,a]),200===i.status)n=a?a.Response.NextTrack:null,o=s.selectSingleNode(e,"//Next//VAST");else n=a?a.Response:null;401!=i.status&&this.callback&&this.callback(i.status,n,o),this.callback=null}},registerPackage("com.slacker.app.actions.slacker.radio.GetNextRadioTrackAction"),com.slacker.app.actions.slacker.radio.GetNextRadioTrackAction=n}()})),bjork("com.slacker.app.actions.slacker.radio.GetOnDemandTrackAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.radio.GetNextRadioTrackAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={execute:function(e,i,s,a,n,o){if(this.isFetching)return void CONSOLE.warn("GetOnDemandTrackAction::execute - Request already in process. Ignore redundant request.");this.isFetching=!0;let r,l,c,d,u=null,h=APP.SERVICE.isCached("aq")||"med";"hi"==h&&APP.USER.slackerUser().effectiveTier<5&&(h="med",APP.SERVICE.cached("aq",h)),a?(c={"track-id":a.tid,"file-id":a.fid,len:a.tlen,elapsed:n},u=APP.slackerPlayerSession().radioPlayer.pingPOST):c={"track-id":"","file-id":"",len:"",elapsed:""},c.plid=s,c.site="slacker",c.event=i||"",c["stream-quality"]=h,u?(c.ur="&ur="+(null!=u.underrunCount?u.underrunCount:0),c.urtime="&urtime="+(null!=u.bufferingTime?u.bufferingTime:0),c.itt="&itt="+(null!=u.startLatency?u.startLatency:0),c.tkbps="&tkbps=-1",c.urend="&urend=-1"):(c.ur="&ur=-1",c.urtime="&urtime=-1",c.itt="&itt=-1",c.tkbps="&tkbps=-1",c.urend="&urend=-1"),(e.tid||e.trackId)&&(c["odtrack-1"]="tid="+(e.tid||e.trackId)),(e.pid||e.performanceId)&&(c["odtrack-2"]="pid="+(e.pid||e.performanceId)),(e.songId||e.id)&&(c["odtrack-3"]="songid="+(e.songId||e.id)),"cast"==this.fmtHint&&(c["station-tree-partner"]="chromecast"),r=t.get(APP.SERVICE.urls.SLACKER.SESSION.ODMEDIA,c).replace(/&&/,"&").split("?"),d=APP.SERVICE.signSlackerRequest(r[1]),l=r[0]+"?"+d,this.callback=o,this._doRequest({source:l,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8",Accept:`text/xml,${this.mediaType}`}})},onActionResponse:function(e,t,s){let a,n;e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}if(this.isFetching=!1,CONSOLE.debug("WSODMedia server response: "+[t,s.status,a]),200===s.status)n=a?a.Response.GetMedia:null;else n=a?a.Response:null;401!=s.status&&this.callback&&this.callback(s.status,n),this.callback=null}},registerPackage("com.slacker.app.actions.slacker.radio.GetOnDemandTrackAction"),com.slacker.app.actions.slacker.radio.GetOnDemandTrackAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.GetSearchResultsAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.categoriesLink=null,this.callback=[]},__constructor:function(){this.QUICK_CONFIG={"max-results":6,"search-for":"station,artist,album,song,video,festival,podcast,podcastEpisode","include-filter":"basic,ondemand,paywall","search-mode":"grouped","station-tree-partner":"slacker"},this.FULL_CONFIG={"max-results":50,"search-for":"artist,song,station,album,video,festival,podcast,podcastEpisode","include-filter":"basic,ondemand,paywall","search-mode":"","station-tree-partner":"slacker"}},execute:function(e,i,s,a={}){let n="quick"==i?t.SERVICE.SLACKER.SEARCH.QUICK:t.SERVICE.SLACKER.SEARCH.FULL,o="quick"==i?Object.assign({},this.QUICK_CONFIG):Object.assign({},this.FULL_CONFIG);APP.USER.slackerUser().audioAllowed||(o["search-for"]="video,festival"),"tesladash"==APP.appImplementationModule.type?o["search-for"]="video,festival":"tv"==APP.implementationSuperType()&&(o["include-filter"]=o["include-filter"].replace(",paywall","")),o.query=encodeURIComponent(e),Object.keys(a).forEac
1h((e=>o[e]=a[e])),this.currentRequest&&this.currentRequest.abort(),this.currentRequest=this._doRequest({source:t.get(n,o),callback:s,method:"GET",type:"quick"==i?"json":"xml",data:null})}},registerPackage("com.slacker.app.actions.slacker.radio.GetSearchResultsAction"),com.slacker.app.actions.slacker.radio.GetSearchResultsAction=new i}()})),bjork("com.slacker.app.actions.slacker.radio.GetSimpleSettingsAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils"),s=require("com.slacker.util.browser.Browser"),a=require("com.slacker.util.encoding.SignatureVerifier");function n(){extendClass(this,new e),this.__constants(),this.__constructor()}n.prototype={__constants:function(){this.dTimer=300,this.delay=0,this.maxDelay=2e3,this.OS_TYPE,this.DEVICE_MANUFACTURER,this.MODEL,this.DEFAULTS={session:{aysl:{anon:"4",basic:"1000",plus:"8",premium:"8"}},ads:{video:{present:"1",showOn:"S1,S3,S10,S11",minDisplayInterval:"1800",maxDisplayInterval:"0",minOpportunityInterval:"0",minDisplayIntervalAfterAudio:"300",autoDismissTime:"30",minRequestInterval:"",networks:"yume",tier:"0,1,4",trackDelay:"0",minTrackInterval:"1"},audio:{present:"1",showOn:"S1,S2,S3,S10,S11",tier:"1,4",trackDelay:"0",minDisplayInterval:"900",minDisplayIntervalAfterVideo:"300",breakLength:"2"},banner:{present:"1",showOn:"S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S12,S13,S14",minDisplayInterval:"15",networks:"",tier:"0,1,4",trackDelay:"0",minTrackInterval:"1",minRequestInterval:"30",minDismissLockout:"10",minDismissGracePeriod:"15"}}},-1!==window.navigator.platform.toLowerCase().indexOf("mac")?(this.OS_TYPE="mac",this.DEVICE_MANUFACTURER="apple"):-1!==window.navigator.platform.toLowerCase().indexOf("win")?(this.OS_TYPE="windows",this.DEVICE_MANUFACTURER="microsoft"):-1!==window.navigator.platform.toLowerCase().indexOf("linux")?(this.OS_TYPE="linux",this.DEVICE_MANUFACTURER="linux"):(this.OS_TYPE="other",this.DEVICE_MANUFACTURER="other"),s.isIE()?this.MODEL="msie":s.isMsEdge()?this.MODEL="edge":s.isFirefox()?this.MODEL="firefox":s.isSafari?this.MODEL="safari":s.isChrome?this.MODEL="chrome":s.uaCheck("OPR/")?this.MODEL="opera":this.MODEL="other"},__constructor:function(){this.onComplete=null},execute:function(e){const i=t.get(APP.SERVICE.urls.SLACKER.SESSION.SIMPLESETTINGS);this.onComplete=e,APP.appImplementationModule.usesSimpleSettings?this._doRequest({source:i,callback:this.onActionResponse.bind(this),method:"POST",type:"text",data:`<Request>\n\t\t\t\t\t\t\t\t\t\t<deviceprofile>\n\t\t\t\t\t\t\t\t\t\t\t<carrier></carrier>\n\t\t\t\t\t\t\t\t\t\t\t<did>${APP_DID}</did>\n\t\t\t\t\t\t\t\t\t\t\t<clientstr>${CONFIG.client}</clientstr>\n\t\t\t\t\t\t\t\t\t\t\t<apptype>player</apptype>\n\t\t\t\t\t\t\t\t\t\t\t<appver>${APP_VERSION}</appver>\t\n\t\t\t\t\t\t\t\t\t\t\t<os>${this.OS_TYPE}</os>\n\t\t\t\t\t\t\t\t\t\t\t<osver></osver>\n\t\t\t\t\t\t\t\t\t\t\t<devicetype>${CONFIG.slackerConfig.simpleSettingsDevice}</devicetype>\n\t\t\t\t\t\t\t\t\t\t\t<manufacturer>${this.DEVICE_MANUFACTURER}</manufacturer>\n\t\t\t\t\t\t\t\t\t\t\t<model>${this.MODEL}</model>\n\t\t\t\t\t\t\t\t\t\t\t<deviceid>${CONFIG.deviceId}</deviceid>\n\t\t\t\t\t\t\t\t\t\t\t<accountid>${APP.USER.slackerUser().id}</accountid>\n\t\t\t\t\t\t\t\t\t\t</deviceprofile>\n\t\t\t\t\t\t\t\t\t</Request>`,headers:{"Content-Type":"text/xml; charset=UTF-8"}}):(respJson=this.__parseSimpleSettings({Settings:this.DEFAULTS}),this.onComplete.apply(this,[respJson.Settings]))},onActionResponse:function(e,t,s){if(200===s.status){const e=s.responseText.split("\n"),t=e.shift(),n=e.join(""),o=i.parseFromString(n);let r;if(!a.verifySimple(t,n))return CONSOLE.warn("SimpleSettings sig failed! Do not use settings file!"),void(this.onComplete&&this.onComplete.apply(this,[null]));{let e=this.x2js.xml2json(o),t=null;try{e.Settings&&e.Settings.ads&&e.Settings.ads.banner&&e.Settings.ads.banner.networks&&"object"==typeof e.Settings.ads.banner.networks&&(t=JSON.parse(JSON.stringify(e.Settings.ads.banner.networks)))}catch(e){}r=this.__parseSimpleSettings(APP.SERVICE._beanify(e));try{t&&r.Settings&&r.Settings.ads&&r.Settings.ads.banner&&(r.Settings.ads.banner.networks=APP.SERVICE._beanify(t))}catch(e){}this.onComplete.apply(this,[r.Settings])}}else CONSOLE.error(`SimpleSettings fetch failed (${s.status})!`),500==s.status&&this.delay<this.maxDelay?(this.delay+=this.dTimer,CONSOLE.warn(`Retrying SimpleSettings in (${this.delay}ms)`),window.setTimeout((()=>this.execute()),this.delay)):(CONSOLE.warn("Using default SimpleSettings values on fail"),this.onComplete.apply(this,[this.DEFAULTS]))},__parseSimpleSettings:function(e){if(e.Settings&&e.Settings.session&&e.Settings.session.aysl)for(let t in e.Settings.session.aysl){const i=36e5*e.Settings.session.aysl[t];switch(t){case"anon":e.Settings.session.aysl[0]=i;break;case"basic":e.Settings.session.aysl[1]=i;break;case"plus":e.Settings.session.aysl[5]=i;break;case"premium":e.Settings.session.aysl[10]=i}}return e}},n.prototype.__constants(),registerPackage("com.slacker.app.actions.slacker.radio.GetSimpleSettingsAction"),com.slacker.app.actions.slacker.radio.GetSimpleSettingsAction=new n}()})),bjork("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.bIsPlaylist=!1},execute:function(e,i){const s=APP.USER.slackerUser();let a,n={id:e.id,"station-id":e.sid,site:"slacker"},o=e.type.toUpperCase();if(this.isFetching=!0,n["max-related"]||(n["max-related"]=10),"station"!=e.type&&"artistMix"!=e.type||n["station-id"]||(e.type="station",e.id.toString().indexOf("stations")>-1?n["station-id"]=n.id:n["station-id"]=["stations",s.id,e.id].join("/")),n["station-id"]&&n["station-id"].indexOf("/1/")>-1&&s.id>1&&(n["station-id"]=n["station-id"].replace("/1/","/"+s.id+"/")),"song"==e.type&&("object"==typeof e.id?Object.keys(e.id).forEac
1h((t=>n[t]=e.id[t])):(e.id||(n.id=-1),n["perf-id"]=-1,n["track-id"]=e.trackId||"")),this.bIsPlaylist="playlist"==e.type,e._links&&(e._links.self||e._links.full)?e._links.full?(a=e._links.full.href,delete n.id,delete n["station-id"],"PODCAST"===o&&(a+=-1==a.indexOf("?")?"?page={page}&size={size}":"&page={page}&size={size}",n.page=e.pageNumber||0,n.size=e.pageSize||50)):(a=e._links.self.href,a.indexOf("/mixer/")>-1&&-1==a.indexOf("/full?")&&"PODCASTEPISODE"!=o&&"AUDIOBOOK"!=o&&(a=a.replace("?","/full?"))):("PLAYLIST"!=o&&"PODCASTEPISODE"!=o&&(o=`${o}FULL`.replace("ARTISTMIX","STATION")),o.indexOf("PODCAST")>-1&&(delete n["track-id"],delete n["station-id"]),a=APP.SERVICE.urls.SLACKER.DATA[o]),!a)throw new Error("GetSlackerItemDetailAction called with unknown type: "+e.type);return"podcast"===e.type&&void 0!==e.pageSize&&void 0!==e.pageNumber&&(a+=-1==a.indexOf("?")?"?page={page}&size={size}":"&page={page}&size={size}",n.page=e.pageNumber,n.size=e.pageSize),e.extra&&Object.assign(n,e.extra),a.match(/\{\?|\{\&/)&&(n.linktype="templated",n.type=e.type),this.callback=i,this._doRequest({source:t.get(a,n),callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null,headers:{}})},onActionResponse:function(e,t,s){if(this.isFetching=!1,CONSOLE.debug("Slacker Data service response: "+[t,s.status]),this.bIsPlaylist){this.bIsPlaylist=!1,e=s&&s.responseText?i.parseFromString(s.responseText):e;try{(e=APP.SERVICE._beanify(this.x2js.xml2json(e)).Playlist)&&(e.contains=function(e,t){return!!this.songs&&this.songs.song.filter((i=>i[e]==t)).length>0}.bind(e))}catch(e){}}this.callback(e,t,s.status)}},registerPackage("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction"),com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.GetSlackerPlaylistAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=(require("com.slacker.util.browser.Browser"),require("com.slacker.io.XmlUtils"));function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e,i,s){var a={id:e,site:"slacker"};this.isFetching=!0,e?(urlBase=APP.SERVICE.urls.SLACKER.DATA.PLAYLIST,this.callback=i,this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.DATA.PLAYLIST,a),callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})):CONSOLE.warn("Playlist request attempted without id.")},onActionResponse:function(e,t,s){var a,n;e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}if(this.isFetching=!1,CONSOLE.debug("WSPlaylist server response: "+[t,s.status,a]),200===s.status)n=a?a.Playlist:null;else n=a;401!=s.status&&this.callback&&this.callback(s.status,n)}},registerPackage("com.slacker.app.actions.slacker.radio.GetSlackerPlaylistAction"),com.slacker.app.actions.slacker.radio.GetSlackerPlaylistAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");let s=null;function a(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}a.prototype={__beforeConstructor:function(){this.callback=[],this.recentlyPlayedCallback=[]},__constructor:function(){},execute:function(e,i){const a=this,n=APP.USER.slackerUser();if(this.isFetching)return CONSOLE.warn("GetSlackerProfileTree::execute - Request already in process. Ignore redundant request."),void(e&&(CONSOLE.info("GetSlackerProfileTree::execute - Storing callback for chained response."),this.callback.push(e)));if(this.isFetching=!0,!n||!n.token)return CONSOLE.warn("GetSlackerProfileTree::execute - Waiting for slacker user auth"),void setTimeout((function(){a.isFetching=!1,a.execute(e,i)}),1e3);if(this.callback.push(e),s||(i=!0),!i&&s){this.isFetching=!1;let e=JSON.parse(JSON.stringify(s));for(;this.callback.length;)this.callback.pop()(e,"success",{status:200,isCached:!0})}else this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.DATA.MY_CONTENT,{site:"slacker"}),callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null})},executeRecentlyPlayed:function(e){const i=this,s=APP.USER.slackerUser();return this.isFetchingRecentlyPlayed?(CONSOLE.warn("GetSlackerProfileTree::executeRecentlyPlayed - Request already in process. Ignore redundant request."),void(e&&(CONSOLE.info("GetSlackerProfileTree::executeRecentlyPlayed - Storing callback for chained response."),this.recentlyPlayedCallback.push(e)))):(this.isFetchingRecentlyPlayed=!0,s&&s.token?(this.recentlyPlayedCallback.push(e),void(this.isLinkUpdated()?this._doRequest({source:t.get(APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.RECENTLYPLAYED),callback:i.onRecentlyPlayedResponse.bind(i),method:"GET",type:"json",data:null}):this._pollForUpdatedUrl(e))):(CONSOLE.warn("GetSlackerProfileTree::executeRecentlyPlayed - Waiting for slacker user auth"),void setTimeout((function(){i.isFetchingRecentlyPlayed=!1,i.executeRecentlyPlayed(e)}),1e3)))},_pollForUpdatedUrl:function(e){const i=this;console.log("RECENT :: Polling for updated URL...");let s=0,a=1e3;!function n(){if(i.isLinkUpdated())i._doRequest({source:t.get(APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.RECENTLYPLAYED),callback:i.onRecentlyPlayedResponse.bind(i),method:"GET",type:"json",data:null});else{if(s++,s>=10){console.log("RECENT :: Failed to get the correct URL after multiple retries."),i.isFetchingRecentlyPlayed=!1;const t=document.getElementById("recentlyplayed-spinner"),s=document.getElementById("recentlyplayed-text");return t&&s&&(t.style.display="none",s.style.display="block"),void(e&&this.recentlyPlayedCallback.pop()(null,"error",null))}console.log(`RECENT :: Account ID mismatch. Retry ${s}/10. Retrying in ${a/1e3} seconds...`),setTimeout(n,a),a=Math.min(2*a,3e4)}}()},isLinkUpdated:function(){const e=APP.slackerAcct(),i=t.get(APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.RECENTLYPLAYED).match(/\/(\d+)\?/),s=i?i[1]:null;return e&&s&&e===s},clearSessionCache:function(){s=null},updateSessionCache:function(e,t){s&&s.myTree&&s.myTree.Category&&s.myTree.Category.forEac
1h((i=>{["Station","Playlist"].forEach((s=>{i[s]&&i[s].length&&i[s].forEach((i=>{i.id!=e&&i.sid!=e||(i.name=t)}))}))}))},onActionResponse:function(e,t,a){this.isFetching=!1,CONSOLE.debug("GetSlackerProfileTree service response: "+[t,a.status]),e=a&&a.responseText?i.parseFromString(a.responseText):e;try{(e=APP.SERVICE._beanify(this.x2js.xml2json(e))).myTree&&e.myTree.Category&&(s=JSON.parse(JSON.stringify(e))),t=200}catch(i){e=null,t=i}for(;this.callback.length;)this.callback.pop()(e,t,a)},onRecentlyPlayedResponse:function(e,t,i){this.isFetchingRecentlyPlayed=!1;const s="undefined"!=typeof APP?APP.currentView:null;if(s&&"MylibraryView"===s.type&&s.sections&&s.sections.recentlyplayed&&"function"==typeof s.sections.recentlyplayed.visibleDescription){(s.sections.recentlyplayed.classNames||"").indexOf("empty")>-1&&s.sections.recentlyplayed.visibleDescription('<div id="recentlyplayed-text">Listen to a station or show and they will be saved to your Recently Played for easy access.</div>')}if("error"!==t)try{if(e&&e.content)for(;this.recentlyPlayedCallback.length;)this.recentlyPlayedCallback.pop()(e.content,"success",i)}catch(e){for(;this.recentlyPlayedCallback.length;)this.recentlyPlayedCallback.pop()(null,"error",e);CONSOLE.error("Parsing recently played data failed:",e)}else{for(;this.recentlyPlayedCallback.length;)this.recentlyPlayedCallback.pop()(null,"error",i);CONSOLE.error("Error fetching recently played data:",i)}}},registerPackage("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree"),com.slacker.app.actions.slacker.radio.GetSlackerProfileTree=new a}()})),bjork("com.slacker.app.actions.slacker.radio.GetSlackerStationAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.bSlidersOnly=!1},execute:function(e,i,s){const a=e.toString().split("/"),n=APP.USER.slackerUser();1==a.length&&(e=`stations/${n.id}/${e}`);let o={"station-id":e,id:e.split("/")[2]};this.isFetching=!0,this.bSlidersOnly?urlBase=APP.SERVICE.urls.SLACKER.DATA.STATIONSLIDERS:s?urlBase=APP.SERVICE.urls.SLACKER.DATA.STATIONFULL:(urlBase=APP.SERVICE.urls.SLACKER.DATA.STATION,o.type="station",o.linktype="templated"),this.callback=i,this._doRequest({source:t.get(urlBase,o),callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})},onActionResponse:function(e,t,i){this.isFetching=!1,CONSOLE.debug("Mixer service response: "+[t,i.status]),e&&(e.bSlidersOnly=this.bSlidersOnly),this.callback(i.status,e)}},registerPackage("com.slacker.app.actions.slacker.radio.GetSlackerStationAction"),com.slacker.app.actions.slacker.radio.GetSlackerStationAction=i}()})),bjork("com.slacker.app.actions.slacker.radio.GetSlackerStationTreeAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){this.categoriesLink=null,this.glueResponse=null,this.callback=[]},__constructor:function(){},execute:function(e,i,s){const a=this,n=APP.USER.slackerUser();let o=APP.SERVICE.urls.SLACKER.API.CATEGORYBYREFERENCE;return this.isFetching?(CONSOLE.warn("GetSlackerStationTreeAction::execute - Request already in process. Ignore redundant request."),void(e&&(CONSOLE.info("GetSlackerStationTreeAction::execute - Storing callback for chained response."),this.callback.push(e)))):(this.isFetching=!0,n&&n.token?(e&&this.callback.push(e),this.categoriesLink?(o=this.categoriesLink,this.categoriesLink=null):i?._links?.nav?o=i._links.nav.href:(i.linktype="templated",i.categoryId||(i.categoryId=i.id),o=1900==i.categoryId?t.get(APP.SERVICE.urls.SLACKER.DATA.STATIONSALL):t.get(o,i)),void this._doRequest({source:o,callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})):(CONSOLE.warn("GetSlackerStationTreeAction::execute - Waiting for slacker user auth"),void setTimeout((function(){a.isFetching=!1,a.execute(e,i)}),1e3)))},onActionResponse:function(e,t,s){const a=APP.halifyLinks(e.links);if(this.isFetching=!1,CONSOLE.debug("GetSlackerStationTreeAction service response: "+[t,s.status]),"parsererror"==t&&200==s.status){e=s&&s.responseText?i.parseFromString(s.responseText):e;try{e=APP.SERVICE._beanify(this.x2js.xml2json(e)),t=200}catch(e){}}if(1900==e?.categoryId)e.links.map((e=>{"content"==e.rel&&(this.isFetching=!1,this.categoriesLink=e.href,this.execute())}
1));else if(a.sections)this.isFetching=!1,this.glueResponse=e,this.categoriesLink=a.sections.href,this.execute();else{if(this.glueResponse){let t=this.glueResponse;t.sections=e.sections||[e],e=t,this.glueResponse=null}for(;this.callback.length;)this.callback.pop()(e,t,s)}}},registerPackage("com.slacker.app.actions.slacker.radio.GetSlackerStationTreeAction"),com.slacker.app.actions.slacker.radio.GetSlackerStationTreeAction=new s}()})),bjork("com.slacker.app.actions.slacker.radio.LiveStreamHeartbeatAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=(require("com.slacker.util.browser.Browser"),require("com.slacker.io.XmlUtils"));function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e,i){if(this.isFetching)CONSOLE.warn("LiveStreamHeartbeatAction::execute - Request already in process. Ignore redundant request.");else{this.isFetching=!0;var s,a,n,o,r=APP.slackerPlayerSession().currentTrack();n={"station-id":APP.slackerPlayerSession().currentPlayableItem().id,elapsed:e,url:encodeURIComponent(r.URL),"track-type":r.type},s=t.get(APP.SERVICE.urls.SLACKER.SESSION.PING,n).split("?"),o=APP.SERVICE.signSlackerRequest(s[1]),a=s[0]+"?"+o,this.callback=i,this._doRequest({source:a,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8",Accept:this.mediaType}})}},onActionResponse:function(e,t,s){var a,n;APP.USER.slackerUser(),e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}this.isFetching=!1,CONSOLE.debug("WSPing server response: "+[t,s.status,a]),s.status,n=a?a.Response:null,401!=s.status&&this.callback&&this.callback(s.status,n),this.callback=null}},registerPackage("com.slacker.app.actions.slacker.radio.LiveStreamHeartbeatAction"),com.slacker.app.actions.slacker.radio.LiveStreamHeartbeatAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.PlayerSettingsAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.actions.slacker.radio.FinetuneSlider"),i=require("com.slacker.app.components.ReactWrapper"),s=require("com.slacker.app.actions.slacker.user.UpdateAccountSettingAction");let a=null,n=null,o=null,r=null,l=null,c=null;function d(){if(r&&(window.clearTimeout(r),r=null),n&&(document.removeEventListener("mousedown",n,!0),window.removeEventListener("resize",d),document.removeEventListener("keyup",u,!0),n=null),l&&a&&a.node&&a.node.removeEventListener("keydown",l,!0),l=null,a){try{a.unmount()}catch(e){}a=null}if(o=null,c&&"function"==typeof c.focus)try{c.focus()}catch(e){}c=null}function u(e){"Escape"!==e.key&&27!==e.keyCode||d()}function h(e){if(!e||!APP.MESSAGING||!APP.MESSAGING.prompt)return;d();const t=Object.assign({},APP.MESSAGING.messages.sliderSetting);t.beaconId=e.id,t.msg=e.msg,t.actions[0].action=function(){APP.MESSAGING.setModal(),APP.onRequestUpgrade(e.level,e.id)},APP.MESSAGING.prompt(t)}function p(e,t){const i=e.sliderNagDefs&&e.sliderNagDefs[e.sliderType],s=[];
1return i?(Object.keys(i).forEach((function(a){a==t&&Object.keys(i[a]).forEach((function(t){const i=e.getOptionIndexByValue(t);i>=0&&-1===s.indexOf(i)&&s.push(i)}))})),s):s}function m(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}m.prototype={__beforeConstructor:function(){},__constructor:function(){},execute:function(e,m,g){if(!g&&m&&m.preventDefault&&(g=m,m=e,e=APP.slackerPlayerSession()),g&&(g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation()),a){const e=!(!a.node||!document.body.contains(a.node));if(d(),e)return}const P=e||APP.slackerPlayerSession(),y=APP.USER.slackerUser(),f=P.currentPlayableItem(),A=APP.SERVICE.isCached("aq")||"med",S=APP.basicRadioOnly();if(!f)return void CONSOLE.debug("PlayerSettingsAction: No current playable item - Fine Tune not available");const b=[];if(f&&f.sliders&&f.sliders.length&&f.sliders.forEach((function(e){const i=new t(e),s=i.sliderType;if("DJs"===s||"dj"===s||"news"===s||"sports"===s)return;const a=!i.sliderNagDefs[s]||!S;if(0!=i.id&&!i.isBinary&&a){if("artist discovery"===s&&"Minimum"==i.value){for(;i.hasNagForValue(y.tier,i.value);)i.optionIndex++,i.value=i.options[i.optionIndex].value;i.optionIndex!=i.origIndex&&(i.origIndex=i.optionIndex,i.noUiSliderConfig.start=[i.optionIndex])}b.push({key:"ft-"+i.id,sliderDef:i,section:"Fine Tune Station",restricted:p(i,y.effectiveTier),onChange:function(e){if(e==i.optionIndex)return null;const t=i.setValue(e,!0,y.effectiveTier);return t?(h(t),t):(P.doFinetuneAction(i.id,i.value),null)}})}})),"podcast"==f.type){if(P&&P.radioPlayer&&P.radioPlayer.player){const e=new t({id:"playbackRate",name:"Playback Rate",type:"playback rate",value:P.radioPlayer.player.playbackRate()});e.noUiSliderConfig.pips.filter=()=>2,e.noUiSliderConfig.pips.format={to:t=>e.sliderTypeDefs[e.sliderType][t],from:e=>Number(e)},b.push({key:"ft-playbackRate",sliderDef:e,section:"Playback Rate",restricted:[],onChange:function(t){return t==e.optionIndex||(e.setValue(t),P.radioPlayer.player.playbackRate(e.value)),null}})}}else if(!S){const e=new t({id:"hq",name:"Audio Quality",type:"audio quality",value:A});b.push({key:"ft-hq",sliderDef:e,section:"Audio Quality",restricted:p(e,APP.USER.slackerUser().effectiveTier),onChange:function(t){if(t==e.optionIndex)return null;const i=e.setValue(t,!0,APP.USER.slackerUser().effectiveTier);return i?(h(i),i):(APP.SERVICE.cache("aq",e.value),null)}})}const E=y.accountSettings||{},k={items:[{id:"globalDJ",label:"Hosts",on:"on"===E.globalDJ},{id:"headlinenews",label:"News",on:"on"===E.headlinenews},{id:"headlinesports",label:"Sports",on:"on"===E.headlinesports}],onToggle:function(e,t,i){new s(i).execute(e,t?"on":"off")}};APP.MESSAGING&&APP.MESSAGING.closeContextMenu&&APP.MESSAGING.closeContextMenu(),a=i.mount("FineTunePopup",{talk:k,sliders:b}),a?(o=g&&(g.currentTarget||g.target),c=o||document.activeElement,function(e,t){if(!e)return;e.style.position="fixed",e.style.zIndex=1e4,e.style.visibility="hidden";let i=0;const s=function(){const a=e.firstChild;if(!a&&i++<30)return void window.requestAnimationFrame(s);if(!a)return void(e.style.visibility="visible");const n=t&&t.getBoundingClientRect?t.getBoundingClientRect():{top:window.innerHeight,left:20,width:0,height:0},o=a.offsetWidth||320,r=a.offsetHeight||200;let l=n.left+n.width/2-o/2,c=n.top-r-10;l=Math.max(8,Math.min(l,window.innerWidth-o-8)),e.style.left=l+"px",e.style.top=Math.max(8,c)+"px",e.style.visibility="visible",a.setAttribute("tabindex","-1"),a.style.outline="none";try{a.focus()}catch(e){}};window.requestAnimationFrame(s)}(a.node,o),r=window.setTimeout((function(){r=null,a&&(n=function(e){o&&o.contains(e.target)||a&&a.node&&!a.node.contains(e.target)&&d()},document.addEventListener("mousedown",n,!0),document.addEventListener("keyup",u,!0),window.addEventListener("resize",d),l=function(e){!function(e,t){if("Tab"!==t.key)return;const i=e.querySelectorAll('button:not([disabled]), [tabindex="0"]');if(!i.length)return;const s=i[0],a=i[i.length-1],n=document.activeElement;if(-1===Array.prototype.indexOf.call(i,n))return t.preventDefault(),void(t.shiftKey?a:s).focus();t.shiftKey&&n===s?(t.preventDefault(),a.focus()):t.shiftKey||n!==a||(t.preventDefault(),s.focus())}(a.node,e)},a.node.addEventListener("keydown",l,!0))}),0)):CONSOLE.warn("PlayerSettingsAction: FineTunePopup failed to mount")}},registerPackage("com.slacker.app.actions.slacker.radio.PlayerSettingsAction"),com.slacker.app.actions.slacker.radio.PlayerSettingsAction=m}()})),bjork("com.slacker.app.actions.slacker.radio.RatingAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.rating,this.sid,this.itemId,this.type},execute:function(e,i,s,a,n){var o=APP.USER.slackerUser(),r="GET",l=(new Date).getTime(),c=null;this.isFetching?CONSOLE.warn("RatingAction::execute - Request already in process. Ignore redundant request."):(this.isFetching=!0,e&&i&&void 0!==s&&a&&(this.t
1ype=e,this.sid=a,this.itemId=i,this.rating=s,r="POST",(c=[]).push("<Request acct='"+o.id+"'>"),"track"==e||"song"==e?c.push("<TrackRating pid='"+i+"' rating='"+s+"' sid='"+a+"' ctime='"+l+"'/>"):c.push("<ArtistRating artistid='"+i+"' rating='"+s+"' sid='"+a+"' ctime='"+l+"'/>"),c.push("</Request>")),this.callback=n,this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.SESSION.RATINGS,{"rating-id":o.id}),callback:this.onActionResponse.bind(this),method:r,type:"xml",data:c?c.join("/n"):null,headers:{"Content-Type":"text/xml; charset=UTF-8"}}))},onActionResponse:function(e,t,s){var a;e=s&&s.responseText?i.parseFromString(s.responseText):e;try{a=APP.SERVICE._beanify(this.x2js.xml2json(e)).Response}catch(e){}this.isFetching=!1,CONSOLE.debug("WS server response: "+[t,s.status]),200==s.status&&window.APP&&window.APP.LIBRARY_SYNC&&window.APP.LIBRARY_SYNC.invalidateTree(),this.callback&&this.callback(s.status,200==s.status?this:null,a)}},registerPackage("com.slacker.app.actions.slacker.radio.RatingAction"),com.slacker.app.actions.slacker.radio.RatingAction=s}()})),bjork("com.slacker.app.actions.slacker.radio.SlackerBaseStationCacheAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}s.prototype={__beforeConstructor:function(){this._sMap=null,this._cMap=null},__constructor:function(){this.retryCount=0},execute:function(e,i){this.isFetching=!0;const s=t.get(APP.SERVICE.urls.SLACKER.DATA.STATIONSALL);this.callback=i,this._doRequest({source:s,callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})},getStation:function(e){let t=null;return e&&"number"!=typeof e&&3==e.split("/").length&&(e=Number(e.split("/")[2])),this._sMap||(this._sMap=JSON.parse(APP.SERVICE.isCached("stationMap"))),this?._sMap?.[e]&&(t=this._sMap[e]),t},getStationMainCategory:function(e){const t=this.getStation(e);return t&&t.mainCategoryId?this?._cMap?.[t.mainCategoryId]:null},getStationFromCategory:function(e,t){let i=this.getStation(t);return i?.mainCategoryId&&i.mainCategoryId==e?i:null},getFuzzyCategoryByName:function(e){if(!this._cMap&&(this._cMap=JSON.parse(APP.SERVICE.isCached("categoryMap")),!this._cMap))return null;for(let t in this._cMap)if(t&&(this?._cMap[t]?.name.toLowerCase()==e.toLowerCase()||this?._cMap[t]?.name.toLowerCase().indexOf(e.toLowerCase())>-1))return this._cMap[t];return null},updateStationMaps:function(e,t,s){const a=["id","name","type","link","imagePath","tagline","mainCategory","rights","features","offer","episode","showName","showLink","episodeNumber","episodeName"];this._sMap||(this._sMap=JSON.parse(APP.SERVICE.isCached("stationMap")),this._sMap||(this._sMap={})),e&&t&&(this._sMap[e]||(this._sMap[e]={id:e}),t.links&&!t.linksMap&&t.links.filter((e=>"share"==e.rel)).forEach((e=>t.link=e.href.split(".com/")[1])),t.linksMap&&delete t.linksMap,Object.keys(t).filter((e=>a.includes(e))).forEach((s=>{this._sMap[e][s]=["name","showName"].includes(s)?i.decode(t[s]):t[s]}))),s||APP.SERVICE.cache("stationMap",JSON.stringify(this._sMap))},onActionResponse:function(e,t,i){this.isFetching=!1,CONSOLE.debug("Station cache service response: "+[t,i.status]);let s={},a={};e.content?(e.content.forEach((t=>{let i=APP.halifyLinks(t.links);if("category"!=t.type||t?.subTypes?.includes("playableShow")){let i=null;t.genreNames&&(i=Object.keys(this._cMap).filter((e=>this._cMap[e].name==t.genreNames[0]))[0]),e.content.filter((e=>"category"!=e.type)).forEach((e=>{e.station&&(e=e.station);let t=e.sid.split("/")[2],a=APP.halifyLinks(e.links);s[t]={id:t,name:e.name,type:e.type||e.nodeType,link:a?.share?.href?.split(".com/")[1],imagePath:e.imagePath||e.imgPath,tagline:e.tagline||e.featuredDescription,genreNames:e.genreNames,mainCategoryId:i,rights:e.rights,features:e.features,offer:e.offer,episode:e.episode,showName:e.showName,showLink:e.showLink,episodeNumber:e.episodeNumber,episodeName:e.episodeName},this._cMap[i]?.stations.push(t)}))}else i?.sections?.href&&(a[t.categoryId]||(a[t.categoryId]={id:t.categoryId,name:t.name,stations:[]}),setTimeout((e=>{this._doRequest({source:i.sections.href,callback:this.onActionResponse.bind(this),method:"GET",type:"json",data:null})}),10))})),Object.keys(s).length>0&&(this._sMap={...this._sMap,...s},APP.SERVICE.cache("stationMap",JSON.stringify(this._sMap))),Object.keys(a).length>0&&(this._cMap={...this._cMap,...a}
1,APP.SERVICE.cache("categoryMap",JSON.stringify(this._cMap)))):CONSOLE.warn("Slacker Base Tree is corrupt or not present.")}},registerPackage("com.slacker.app.actions.slacker.radio.SlackerBaseStationCacheAction"),com.slacker.app.actions.slacker.radio.SlackerBaseStationCacheAction=new s}()})),bjork("com.slacker.app.actions.slacker.radio.StopSlackerServerSessionAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");require("com.slacker.io.XmlUtils");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0},execute:function(e,i,s,a,n){if(this.isFetching)CONSOLE.warn("StopSlackerServerSessionAction::execute - Request already in process. Ignore redundant request.");else{this.isFetching=!0;var o,r,l,c,d;APP.USER.slackerUser();i?(c={"track-id":i.tid,"file-id":i.fid,len:i.tlen,elapsed:a},o=APP.slackerPlayerSession().radioPlayer.pingPOST):c={"track-id":"","file-id":"",len:"",elapsed:""},c["station-id"]=e?e.id:"",c.event=s||"stop";try{window._slk_dax&&window._slk_dax.data&&(c.nlsuid=`&nlsuid=${window._slk_dax.data.user.uid}`)}catch(e){CONSOLE.error("Failed to add Nielsen id to request ",e)}o?(c.ur="&ur="+(null!=o.underrunCount?o.underrunCount:0),c.urtime="&urtime="+(null!=o.bufferingTime?o.bufferingTime:0),c.itt="&itt="+(null!=o.startLatency?o.startLatency:0),c.tkbps="&tkbps=-1",c.urend="&urend=-1"):(c.ur="&ur=-1",c.urtime="&urtime=-1",c.itt="&itt=-1",c.tkbps="&tkbps=-1",c.urend="&urend=-1"),r=t.get(APP.SERVICE.urls.SLACKER.SESSION.STOP,c).split("?"),d=APP.SERVICE.signSlackerRequest(r[1]),l=r[0]+"?"+d,this.callback=n,this._doRequest({source:l,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8",Accept:this.mediaType}})}},onActionResponse:function(e,t,i){this.isFetching=!1,CONSOLE.debug("WS server response: "+[t,i.status]),401!=i.status&&this.callback&&this.callback(i.status,null)}},registerPackage("com.slacker.app.actions.slacker.radio.StopSlackerServerSessionAction"),com.slacker.app.actions.slacker.radio.StopSlackerServerSessionAction=i}()})),bjork("com.slacker.app.actions.slacker.radio.WSEventAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");require("com.slacker.io.XmlUtils");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.PARAMS={trackEnd:"endType={end}&output={output-engine}&numBufferingEvents={numBufferingEvents}&totalBufferingTime={totalBufferingTime}&mediaType={mediaType}&startTime={startTime}",pause:"aid={account-id}&sid={station-id}",resume:"aid={account-id}&sid={station-id}"}},__constructor:function(){this.retryCount=0},execute:function(e,i){var s,a,n;void 0!==this.PARAMS[e]?(a=t.get(APP.SERVICE.urls.SLACKER.EVENT.WSV1,{event:e}),(s=this.PARAMS[e])&&i&&(i.statistics||(i.statistics={}),n={end:i.end,"output-engine":"html5","station-id":i.sid},i.track&&(n.mediaType=i.track.format,i.statistics&&(n["output-engine"]=i.statistics.playerTech||"html5",n.numBufferingEvents=null!=i.statistics.underrunCount?i.statistics.underrunCount:0,n.totalBufferingTime=null!=i.statistics.bufferingTime?i.statistics.bufferingTime:0,n.startTime=null!=i.statistics.startLatency?i.statistics.startLatency:0)),a+="?"+APP.SERVICE.signSlackerRequest(t.get(s,n))),this._doRequest({source:a,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8"}})):CONSOLE.warn(["WSEventAction::execute - unknown event.",e])},onActionResponse:function(e,t,i){CONSOLE.debug("WSEventAction server response: "+[t,i.status])}},registerPackage("com.slacker.app.actions.slacker.radio.WSEventAction"),com.slacker.app.actions.slacker.radio.WSEventAction=i}()})),bjork("com.slacker.app.actions.slacker.user.ActivateDeviceAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(t,i){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t,i)}i.prototype={__beforeConstructor:function(){this.ACTION={GET_CODE:1,USE_CODE:2,USE_AUTH:3},this.requestGuid,this.currentRequest,this.polling,this.pollFrequency,this.pollLocation,this.serverCode},__constructor:function(e=2,t){this.action=e,this.callback=t,this.co
1de=ko.observable(),this.qrImgSrc=ko.observable(),this.instructions=ko.observable(),this.error=ko.observable(),this.username=ko.observable(""),this.password=ko.observable(""),this.isActivated=ko.observable(!1),this.codeSubmitWatcher=(e,t)=>{13===t.keyCode&&(APP.USER.user().isAnon?this.redeem():this.activate())},e==this.ACTION.GET_CODE?APP.USER.user().isAnon?this.refreshCode():this.isActivated(!0):e==this.ACTION.USE_AUTH?this.instructions("Activate your TV with your LiveOne account to access all of your personalized stations and settings.\n\t\t\t\t\t \t\t\t\t<br/><br/>\n\t\t\t\t\t Sign in to your LiveOne account."):APP.USER.user().isAnon?this.instructions("Enter the code from your device below."):this.instructions(`Enter the code from your device below to link it with the account registered to ${APP.USER.slackerUser().username}.`)},execute:function(e){const i=this;let s,a;if(this.isFetching)CONSOLE.warn("ActivateDeviceAction::execute - Request already in process. Ignore redundant request.");else{if(this.error(null),this.isFetching=!0,!APP.SERVICE.urls.SLACKER.API.DEVICELINK)return CONSOLE.warn("ActivateDeviceAction::execute - Waiting for API Discovery"),void setTimeout((function(){i.isFetching=!1,i.execute(e,data)}),1e3);if(this.action==this.ACTION.USE_AUTH){if(!this.username().trim()||!this.password().trim())return this.isFetching=!1,void this.error("Please enter an email address and password to sign in.");setTimeout((()=>APP._setNavigating(!0)),10),this.error(null),e="POST",a=t.get(APP.SERVICE.urls.SLACKER.API.LOGIN).replace("slacker","liveone").replace("sapi","slacker"),this.currentRequest={username:this.username().trim(),password:this.password().trim(),site:"slacker"}}else a=t.get(APP.SERVICE.urls.SLACKER.API.DEVICELINK);s={source:a,callback:this.onActionResponse.bind(this),method:e,type:"json",data:this.currentRequest?JSON.stringify(this.currentRequest):null},s.noretry=["activate","redeem"].includes(this.currentRequest.type)||this.action==this.ACTION.USE_AUTH,this._doRequest(s)}},stopPolling:function(){this.polling&&(clearTimeout(this.polling),this.polling=0)},refreshCode:function(){this.polling&&(clearTimeout(this.polling),this.polling=0),this.requestGuid=generateUniqueID(),this.currentRequest={clientCode:this.requestGuid,clientId:CONFIG.client,deviceId:CONFIG.deviceId,siteName:"slacker",type:"initiate"},this.execute("POST")},activate:function(){const e=this.code?.()?.trim();e&&(this.currentRequest={shortCode:e.toUpperCase(),siteName:"slacker",type:"activate"},this.execute("POST"))},redeem:function(){const e=this.code?.()?.trim();e&&(this.currentRequest={shortCode:e.toUpperCase(),siteName:"slacker",type:"redeem"},this.execute("POST"))},checkLinkStatus:function(){this.currentRequest={serverCode:this.serverCode,shortCode:this.code(),type:"link"},this.execute("POST")},onActionResponse:function(e,t,i){switch(this.status=i.status,e&&this.halifyLinks(e.links),i.status){case 200:case 201:if(this.currentRequest){if(this.action==this.ACTION.USE_AUTH&&e.loginToken){let e="Signing you in to your account...";APP.checkAcessibilityTTSAction(e),this.instructions(e),this.currentRequest.type="link"}switch(this.currentRequest.type){case"initiate":this.instructions(`Activate your TV with your LiveOne account to access all of your personalized stations and settings.\n\t\t\t\t\t\t\t\t\t \t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t\t\t On your computer or phone, go to:<br/>\n\t\t\t\t\t\t\t\t\t <span class="bold link">${e.activateUrl}</span>\n\t\t\t\t\t\t\t\t\t <br/><br/>\n\t\t\t\t\t\t\t\t\t When activation is complete, this screen should automatically update.`),this.code(e.shortCode),e.links.qrCode&&this.qrImgSrc(e.links.qrCode.href),this.serverCode=e.serverCode,this.pollLocation=e.links[0].href,this.pollFrequency=e.interval?1e3*e.interval:1e4,this.pollLocation&&(this.polling=setTimeout(this.checkLinkStatus.bind(this),this.pollFrequency));break;case"link":e.loginToken&&(APP.noHomeOnUserLogin=!0,APP.USER.onSlackerNonUserCredentialAction(i.status,e,(function(){"tesladash"!=APP.appImplementationModule.type?APP.goToPage("mylibrary"):APP.appImplementationModule._handleRemoteBackButton()})));break;case"activate":this.isActivated(!0),this.instructions("Code accepted. Your device will be activated shortly.");break;case"redeem":e.loginToken&&APP.USER.doForceSlackerCreate("activate","activate",{loginToken:e.loginToken,accountId:e.accountId,code:this.code},!1,"activate")}}break;case 204:"redeem"===this.currentRequest.type?APP.USER.doForceSlackerCreate("activate","activate",{code:this.code},!1,"activate"):this.polling=setTimeout(this.checkLinkStatus.bind(this),this.pollFrequency);break;case 404:if(this.currentRequest){let e;switch(this.currentRequest.type){case"link":this.refreshCode();break;case"activate":case"redeem":e=`The code you entered appears to be invalid. Please check your code and try again later. (${i.status})`,APP.checkAcessibilityTTSAction(e),this.error(e)}}break;default:if(this.currentRequest)if(this.action=this.ACTION.USE_AUTH){let e;switch(setTimeout((()=>APP._setNavigating(!1)),10),i.status){case 400:case 401:e="Please check your username and/or password and try again.";break;case 403:e="Your account has been locked. Please try again later.";break;case 405:e="Unable to process service login data. Please try again.";break;default:e=`An unexpected error has occured (${i.status}). Please try again later.`}APP.checkAcessibilityTTSAction(e),this.error(e)}else if("link"===this.currentRequest.type)if(i.status){let e=`The code you entered appears to be invalid. Please check your code and try again later. (${i.status})`;APP.checkAcessibilityTTSAction(msg),APP.MESSAGING.prompt("modalErrorFree",{reason:e})}else this.refreshCode()}this.callback&&(this.callback(),this.callback=null),this.isFetching=!1}},registerPackage("com.slacker.app.actions.slacker.user.ActivateDeviceAction"),com.slacker.app.actions.slacker.user.ActivateDeviceAction=i}()})),bjork("com.slacker.app.actions.slacker.user.AnonCredentialAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.util.CookieJar");function s(t){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t)}s.prototype={__beforeConstructor:function(){this.aid="",this.status=0,this.isReturningUser=!1,this.doAutoLogin=!0,this.passThrough=null,this.isCredential=!0},__constructor:function(e){this.passThrough=e},execute:function(e){this.isFetching?CONSOLE.warn("AnonCredentialAction::execute - Request already in process. Ignore redundant request."):(this.isFetching=!0,APP.SERVICE.discoverSlackerAPI().then((()=>{this.callback=e,this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.API.CREATEACCOUNT),callback:this.onActionResponse.bind(this),method:"POST",type:"json",data:null,headers:{bOverrideUserToken:!0}})})))},onActionResponse:function(e,t,i){switch(this.status=i.status,i.status){case 200:case 201:this._updateCookiesFromResponse(e)}this.callback?this.callback(i.status,e,this.passThrough):this.passThrough&&this.passThrough(i.status,e),this.isFetching=!1},_updateCookiesFromResponse:function(e){const t=com.slacker.util.encoding.B64.encode64(new String(e.accountId)),s=APP.SERVICE.urls.SLACKER.DOMAIN.replace("www","*");this.aid=e.accountId,CONSOLE.warn("Setting Slacker A cookie with anon aid: "+e.accountId+" cvalue="+t),i.setCookie("A",t,null,"/",s,!1,!1)}},registerPackage("com.slacker.app.actions.slacker.user.AnonCredentialAction"),com.slacker.app.actions.slacker.user.AnonCredentialAction=s}()}
1)),bjork("com.slacker.app.actions.slacker.user.ArtistPickerSelectionsAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction");function t(t,i){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t,i)}t.prototype={__beforeConstructor:function(){},__constructor:function(e,t){this.callback=t,this.apiUrl=e,this.method="GET"},execute:function(e){let t;this.isFetching?CONSOLE.warn("ArtistPickerSelectionsAction::execute - Request already in process. Ignore redundant request."):(this.isFetching=!0,this.method=e?"POST":"GET",t={source:this.apiUrl,callback:this.onActionResponse.bind(this),method:this.method,type:"json",data:e?JSON.stringify(e):null,noretry:"GET"==this.method},e?CONSOLE.warn(["ArtistPickerSelectionsAction:execute","Submitting contest entry",e]):CONSOLE.warn(["ArtistPickerSelectionsAction:execute","Fetching current selectiong"]),this._doRequest(t))},onActionResponse:function(e,t,i){switch(this.status=i.status,i.status){case 200:case 202:case 404:this.callback?.(this.status,e,this);break;default:let t=this.status;i?.responseJSON?.message&&(t=i.responseJSON.message),APP.MESSAGING.prompt("modalError",{reason:`There was an error processing your selections (${t}).`}),this.callback?.("error",e,this)}this.isFetching=!1}},registerPackage("com.slacker.app.actions.slacker.user.ArtistPickerSelectionsAction"),com.slacker.app.actions.slacker.user.ArtistPickerSelectionsAction=t}()})),bjork("com.slacker.app.actions.slacker.user.CaptchaAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}i.prototype={__beforeConstructor:function(){this.captchaId="",this.captchaGuess="",this.error=""},__constructor:function(){},displayRoadblock:function(e){this.getNewCaptcha(null,function(t){APP.MESSAGING.prompt({title:"Halt! Who Goes There?",severe:!0,beaconId:"captcha",disableClose:!0,msg:'We\'ll start the music back up once you go through this security check.<form id="captcha-form" name="captcha-form" onsubmit="APP.slackerPlayerSession().captchaManager.execute($(\'#captcha-input\').val());return false;"><ul>\t<li><img id="captchaImage" src="{image-url}" alt="CAPTCHA security code image - enter the characters shown" /></li>\t<li><img src="/s=4.0.1385/images/icons/refresh-icon.png" alt="get a new token" title="get a new token" class="link" onclick="APP.slackerPlayerSession().captchaManager.refreshCaptchaToken($(\'#captchaImage\')[0])"/></li></ul><p>Enter letters below</p><div>'+(this.error?' <label for="captcha" class="error">'+this.error+"</label>":'\t<label for="captcha">security code</label>')+'\t<input id="captcha-input" tabindex="100" name="captcha" type="text"/></div></form>',actions:[{label:"CONTINUE",styles:"std",action:function(){APP.slackerPlayerSession().captchaManager.execute($("#captcha-input").val())}}]},{"image-url":this.setCaptchaImage(t,null),error:this.error}),e&&(this.callback=e)}.bind(this));try{"play"==APP.slackerPlayerSession().radioPlayerStateManager().buttonstyle&&APP.slackerPlayerSession().radioPlayerStateManager().playPause(!0)}catch(e){}},refreshCaptchaToken:function(e){this.getNewCaptcha(null,(t=>this.setCaptchaImage(t,e)))},setCaptchaImage:function(e,i){const s=t.get(APP.SERVICE.urls.SLACKER.CAPTCHA.GETIMAGE,{"captcha-id":e});return i&&(i.src=s),s},getNewCaptcha:function(e,i){this.isFetching?CONSOLE.warn("CAPTCHA request in process. Ignore redundant request (getNewCaptcha)"):(this.isFetching=!0,this.callback=i,this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.CAPTCHA.GETID),callback:(t,s,a)=>{if(this.isFetching=!1,200===a.status)this.captchaId=a.responseText.replace("<!DOCTYPE html>","").trim(),e&&this.setCaptchaImage(this.captchaId,e),i&&i(this.captchaId,e);else i&&i(null,e)},method:"GET",type:"text",data:null,headers:{"Content-Type":"text/plain; charset=UTF-8",Authorization:null,"BBI-AUTHORIZATION":APP.USER.slackerUser().token}}))},execute:function(e){this.isFetching?CONSOLE.warn("CAPTCHA request in process. Ignore redundant request (execute)"):e&&e.trim()?(this.isFetching=!0,APP.MESSAGING.setModal(null,null,!0),this.error="",this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.CAPTCHA.SUBMIT,{"captcha-id":this.captchaId,"captcha-guess":e.trim()}),callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8"}})):CONSOLE.warn("CAPTCHA submit with empty guess. Bail.")},onActionResponse:function(e,t,i){if(this.isFetching=!1,200===i.status)CONSOLE.info(["CaptchaAction::Slacker CAPTCHA SUCCESS"]),appInitTime?location.reload():(APP.MESSAGING.setModal(null,null,!0),this.callback());else this.error="Please check your entry and try again",this.displayRoadblock()}},registerPackage("com.slacker.app.actions.slacker.user.CaptchaAction"),com.slacker.app.actions.slacker.user.CaptchaAction=new i}()})),bjork("com.slacker.app.actions.slacker.user.DeviceUpgradeAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(t){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t)}i.prototype={__beforeConstructor:function(){this.requestGuid,this.currentRequest,this.polling,this.pollFrequency,this.pollLocation,this.serverCode},__constructor:function(e,t){this.deviceName=e,this.callback=t,this.co
1de=ko.observable(),this.qrImgSrc=ko.observable(),this.instructions=ko.observable(),this.error=ko.observable(),this.username=ko.observable(""),this.password=ko.observable(""),this.isActivated=ko.observable(!1),this.codeSubmitWatcher=(e,t)=>{13===t.keyCode&&this.associate()},this.instructions("Enter the code from your device below to start your upgrade.")},execute:function(e){const i=this;let s,a;if(this.isFetching)CONSOLE.warn("DeviceUpgradeAction::execute - Request already in process. Ignore redundant request.");else{if(this.error(null),this.isFetching=!0,!APP.SERVICE.urls.SLACKER.API.DEVICEUPGRADE)return CONSOLE.warn("DeviceUpgradeAction::execute - Waiting for API Discovery"),void setTimeout((function(){i.isFetching=!1,i.execute(e,data)}),1e3);a=t.get(APP.SERVICE.urls.SLACKER.API.DEVICEUPGRADE),s={source:a,callback:this.onActionResponse.bind(this),method:e,type:"json",data:this.currentRequest?JSON.stringify(this.currentRequest):null},s.noretry=!0,this._doRequest(s)}},associate:function(){const e=this.code?.()?.trim();e&&(this.currentRequest={shortCode:e.toUpperCase(),siteName:"slacker",type:"associate"},this.execute("POST"))},onRequestDeviceUpgrade:function({loginToken:e,userAgent:t,accountId:i,queryString:s}){const a=APP.SERVICE.urls.SLACKER.CREATEACCOUNT,n=this._getParamObject(s),o=n.level&&parseInt(n.level);if("HIL000"===n.did){const e={plus:"NMEpl7",premium:"NMEpr7"};n.device=n.did,void 0!==o&&o<=1&&(n.did=e[n.entryPage]||n.did)}if("false"!==APP.USER.slackerUser().audioAllowed||"plus"!==n.entryPage&&"premium"!==n.entryPage){const t={ref:"lxl",id:i,accountId:i,loginToken:e},s={return:"lxl",token:window.encodeParamsForSlackerService(t),...n,code:this.code().toUpperCase()};let o=`${a}?done=upgrade&${$.param(s)}`;APP.USER.doSlackerLogin(o,null,!0)}else APP.MESSAGING.prompt("geofence")},onActionResponse:function(e,t,i){switch(this.status=i.status,e&&this.halifyLinks(e.links),i.status){case 200:case 201:if(this.currentRequest&&"associate"===this.currentRequest.type)if(e.loginToken){const{accountId:t}=e,i=this._getParamObject(e.queryString),s=i.level&&parseInt(i.level),a=!APP.USER.user().isAnon&&APP.USER.slackerUser().id!==t.toString();if(a&&0===s){let e="You are currently logged in on this device with an existing account. If this is your account, please return to the TV app and Sign In before continuing with your purchase.";APP.MESSAGING.prompt("accountConflictAnonDevice",{reason:e})}else if(a){let e=`In order to upgrade the account connected to your ${this.deviceName?this.deviceName+" ":""}device, please sign out of the account that's currently signed in on the LiveOne website.`;APP.MESSAGING.prompt("accountConflict",{reason:e})}else this.onRequestDeviceUpgrade(e)}break;case 204:this.polling=setTimeout(this.checkLinkStatus.bind(this),this.pollFrequency);break;case 404:if(this.currentRequest){let e;if("associate"===this.currentRequest.type)e=`The code you entered appears to be invalid, or has expired. Please check your code and try again later. (${i.status})`,APP.checkAcessibilityTTSAction(e),this.error(e)}break;default:if(this.currentRequest&&"associate"===this.currentRequest.type)if(i.status){let e=`The code you entered appears to be invalid, or has expired. Please check your code and try again later. (${i.status})`;APP.checkAcessibilityTTSAction(e),APP.MESSAGING.prompt("modalErrorFree",{reason:e})}else this.refreshCode()}this.callback&&(this.callback(),this.callback=null),this.isFetching=!1},_getParamObject:function(e){const t=e.split("&"),i={};for(let e=0;e<t.length;e++){let s=t[e].split("=");s[0]&&s[1]&&(i[s[0]]=s[1])}return i}},registerPackage("com.slacker.app.actions.slacker.user.DeviceUpgradeAction"),com.slacker.app.actions.slacker.user.DeviceUpgradeAction=i}()})),bjork("com.slacker.app.actions.slacker.user.GetAccountSettingsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils");function s(t){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor(t)}s.prototype={__constants:function(){},__properties:function(){this.onComplete=null},__constructor:function(e){this.onComplete=e||null},execute:function(){this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.API.WSV1SETTINGS),callback:this._onResponse.bind(this),method:"GET",type:"xml",n
1oretry:!0,headers:{"Content-Type":"text/xml; charset=UTF-8"}})},_onResponse:function(e,t,s){var a=s&&s.responseText?i.parseFromString(s.responseText):e,n=APP.SERVICE._beanify(this.x2js.xml2json(a)),o=n&&n.Account,r=APP.USER.slackerUser(),l=!(!s||200!==s.status||!o);l&&r?(r.accountSettings={globalDJ:o.globalDJ||"off",headlinenews:o.headlinenews,headlinesports:o.headlinesports,musicnews:o.musicnews},APP.USER.slackerUser.valueHasMutated()):CONSOLE.warn(["GetAccountSettingsAction: could not read account settings",t,s&&s.status]),this.onComplete&&this.onComplete(l,o)}},registerPackage("com.slacker.app.actions.slacker.user.GetAccountSettingsAction"),com.slacker.app.actions.slacker.user.GetAccountSettingsAction=s}()})),bjork("com.slacker.app.actions.slacker.user.GetUserPolicyAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils"),s=require("com.slacker.app.actions.slacker.user.GetAccountSettingsAction");function a(){extendClass(this,new e),this.__constants(),this.__constructor()}a.prototype={__constants:function(){this.dTimer=300,this.delay=0,this.maxDelay=2e3,this.defaults={newsTrial:!0,newsTrialStarted:!1,hasPlayed:!1,loginSource:null,hasG2:!1,hasOtherMobile:!1,hqMedia:!1,serverconfig:{},capabilities:{features:{ad_free:{enabled:!1,products:{}},offline:{enabled:!1,products:{}},ondemand:{enabled:!1,products:{}},scrubbing:{enabled:!1,products:{}},unlimited_skips:{enabled:!1,products:{}}}},privacy:{"personalized-ads":{enabled:!0}},welcomeMsg:null,bannerAds:{showOn:"S1,S2,S3,S5,S6,S7,S8,S9,S10,S12,S13,S14,refresh,",requestInterval:300,displayInterval:60,trackDelay:0},videoAds:{showOn:"",present:"1"},init:!0}},__constructor:function(){this.actionURL=APP.SERVICE.urls.SLACKER.API.USERPOLICY,this.user=null,this.forceAction,this.transport=null,this.onComplete=null},execute:function(e){const i=t.get(this.actionURL),s=t.get(APP.SERVICE.urls.SLACKER.API.USER);CONSOLE.info("GetUserPolicyAction::execute ",{userPolicyURL:i,userURL:s}),this.onComplete=e,this._doRequest({source:i,callback:this._handlePolicyResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8"}})},_handlePolicyResponse:function(e,t,s){try{const a=s&&s.responseText?i.parseFromString(s.responseText):e,n=this.onActionResponse(a,t,s);if(200===s.status){try{this.reconcileAccountSettings()}catch(e){CONSOLE.error("GetUserPolicyAction - reconcileAccountSettings failed",e)}this._canFetchUserData()?(CONSOLE.info("GetUserPolicyAction - Policy processed, fetching user data"),this._fetchUserData()):(CONSOLE.info("GetUserPolicyAction - Policy processed, user data not needed"),this.onComplete&&n&&this.onComplete(APP.USER.slackerUser().policy))}}catch(e){CONSOLE.error("GetUserPolicyAction - Policy processing error",e),this.onComplete&&this.onComplete()}},reconcileAccountSettings:function(){var e=this,i=APP.USER.slackerUser(),a=i&&i.policy&&i.policy.serverconfig||{},n=["force_globaldj","force_headlinenews","force_headlinesports","force_musicnews"].map((function(e){return a[e]})).filter((function(e){return e&&(""+e).trim()})),o=function(){var e=APP.USER.slackerUser();e&&e.id&&(new s).execute()};if(n.length){var r=n.length,l=[],c=!1,d=window.setTimeout((function(){c||o()}),8e3);n.forEach((function(i,s){e._doRequest({source:t.get(i),method:"GET",type:"xml",callback:function(){l[s]||(l[s]=!0,--r<=0&&!c&&(c=!0,window.clearTimeout(d),o()))}})}))}else o()},_canFetchUserData:function(){const e=APP.USER.slackerUser();return e&&e.access_token},_fetchUserData:function(){const e=t.get(APP.SERVICE.urls.SLACKER.API.USER),i=APP.USER.slackerUser();this._doRequest({source:e,callback:this._handleUserResponse.bind(this),method:"GET",type:"json",data:null,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest",Authorization:`Bearer ${i.access_token}`,"BBI-AUTHORIZATION":i.token},noretry:!0})},_handleUserResponse:function(e,t,i){try{if(200===i.status&&i.responseText){const e=JSON.parse(i.responseText);this._updateUserData(e),CONSOLE.info("GetUserPolicyAction - User data processed successfully"),this.onComplete&&this.onComplete(APP.USER.slackerUser().policy)}else CONSOLE.warn("GetUserPolicyAction - Invalid user data response:",i.status),this._clearUserData(),this.onComplete&&this.onComplete(APP.USER.slackerUser().policy)}catch(e){CONSOLE.error("GetUserPolicyAction - User data processing error",e),this._clearUserData(),this.onComplete&&this.onComplete(APP.USER.slackerUser().policy)}},_clearUserData:function(){const e=APP.USER.slackerUser();delete e.userData,delete e.hooplaUser,CONSOLE.info("GetUserPolicyAction - User Data Cleared");try{const e=JSON.parse(APP.SERVICE.isCached("slackerUser"));delete e.userData,delete e.hooplaUser,APP.SERVICE.cache("slackerUser",JSON.stringify(e))}catch(e){CONSOLE.error("GetUserPolicyAction - Cache update failed while clearing user data",e)}try{APP.SERVICE.isCached("hooplaData")&&(APP.SERVICE.uncache("hooplaData"),CONSOLE.info("Cleared hooplaData backup cache"))}catch(e){CONSOLE.error("Error clearing hooplaData backup cache",e)}APP.USER.slackerUser.valueHasMutated()},_updateUserData:function(e){const t=APP.USER.slackerUser();t.userData=e,t.hooplaUser="HPL000"===e.did||2031===e.partnerId,CONSOLE.info("GetUserPolicyAction - User Data Updated",{accountId:e.accountId,isHooplaUser:t.hooplaUser}),this._updateUserCache(e,t.hooplaUser),APP.USER.slackerUser.valueHasMutated()},_updateUserCache:function(e,t){try{const i=JSON.parse(APP.SERVICE.isCached("slackerUser"));if(i.userData=e,i.hooplaUser=t,APP.SERVICE.cache("slackerUser",JSON.stringify(i)),!0===t){const t={isHooplaUser:!0,accountId:e.accountId,did:e.did||"HPL000",partnerId:e.partnerId||2031,location:APP.USER.slackerUser()?.policy?.accountLoc||"US",timestamp:(new Date).getTime()};APP.SERVICE.cache("hooplaData",JSON.stringify(t)),CONSOLE.info("Created backup Hoopla data cache:",t)}}catch(e){CONSOLE.error("GetUserPolicyAction - Cache update failed",e)}},onActionResponse:function(e,t,s){let a=APP.USER.slackerUser();if(e=s&&s.responseText?i.parseFromString(s.responseText):e,200===s.status){a||(a={id:0,loginToken:null},APP.USER.slackerUser(a));let t=a.policy?a.policy.accountLoc:"US";return this.__parseUserPolicy(e),a.policy.isTerritoryChanged=t!=a.policy.accountLoc,!0}return 0!=s.status||a.policy?500==s.status&&this.delay<this.maxDelay?(this.delay+=this.dTimer,window.setTimeout((()=>this.execute()),this.delay),!1):(APP.MESSAGING.prompt("apiLoadFail"),!1):(a.policy=this.defaults,!0)},__parseUserPolicy:function(e){const t={facebook:"fb",googleplus:"gp"};let i=APP.SERVICE._beanify(this.x2js.xml2json(e)).userpolicy,s=APP.USER.slackerUser(),a=JSON.parse(APP.SERVICE.isCached("slackerUser")),n="US",o=null;s.policy={serverconfig:{}},s.id||(s.id=i.aid),s.audioAllowed=!i.audioAllowed||"true"===i.audioAllowed,s.effectiveTier=i.effectiveTier,s.actualTier=i.actualTier,s.tier=i.effectiveTier,s.policy.ads=i.ads,s.policy.ab=i.ab,
1s.policy.promo=i.account&&i.account.level&&i.account.level.promo,i.account&&i.account.partners&&(s.policy.account={partners:i.account.partners});try{if(s.policy.promo){let e=s.policy.promo.promoTier||s.effectiveTier;s.policy.promo.promoTierText=10==e?"Premium":5==e?"Plus":"Basic",s.policy.promo.messages.message.length||(s.policy.promo.messages.message=[s.policy.promo.messages.message])}}catch(e){s.policy.promo=null,CONSOLE.error("Failed to parse promo node. ",e)}if(i.socialnetworking&&Object.keys(t).filter((e=>i.socialnetworking[e]&&i.socialnetworking[e].site==CONFIG.slackerConfig.site)).forEach((e=>{const a=t[e],n=i.socialnetworking[e];s.policy[`${a}uid`]=n.uid,s.policy[`${a}status`]=200,"true"===n.refreshtoken&&(s.policy[`refresh${a}token`]=!0)})),i.news){let e=i.news.type.toLowerCase();"expired"==e?s.policy.newsTrial=!1:"trialstarted"==e&&(s.policy.newsTrialStarted=!0)}(i.accountsettings&&i.accountsettings.setting.length>0&&i.accountsettings.setting.forEach((e=>{s.policy.settings[e.name]=e._text})),i.configuration&&i.configuration.param)&&(Array.isArray(i.configuration.param)?i.configuration.param:[i.configuration.param]).forEach((e=>{s.policy.serverconfig[e.name]=e._text}));if(i.location){n=i.location.calculated;try{o=i.location.geo;let e=o.match(/\d+\.\d+\.\d+\.\d+/);o=o&&e?e[0]:null}catch(e){}finally{s.policy.geoip=o}i.location.adtarget&&(s.policy.adtarget=i.location.adtarget)}if(s.policy.accountLoc=n,i.a2xsync&&(BEACON,1)&&BEACON._doBeaconUrl(i.a2xsync),i.user){let e=i.user,t=s.username;t&&"undefined"!==t||(s.username=e)}if(s.name=i.name?i.name:null,s.policy.settings={},i.name){let e=s.name;(!e||"undefined"===e||e===s.username&&i.name!==e)&&(s.name=i.name)}if(i.image){let e=s.profileImgUrl;e&&"undefined"!==e&&i.image===e||(s.profileImgUrl=i.image)}["ab","ag","agrp","gnd","explicit","promoid"].filter((e=>i[e])).forEach((e=>{s.policy[e]=i[e]})),s.explicit="true"==s.policy.explicit,i.promoid||(s.promoid=null),null!=i.tier&&void 0!==i.tier?(uage=Number(i.dayscreated),s.policy.hu=i.hu?i.hu:0,s.policy.cid=i.cid?i.cid:0,s.policy.tgid=i.tgid?i.tgid:0,s.policy.demo1=i.demo1?i.demo1:0,s.policy.demo2=i.demo2?i.demo2:0,s.policy.uage=isNaN(uage)?0:uage):CONSOLE.warn("UserPolicy failed to load!"),i.capabilities&&(s.policy.capabilities={features:{}},i.capabilities.features.feature[0]||(i.capabilities.features.feature=[i.capabilities.features.feature]),i.capabilities.features.feature.forEach((e=>{e.products&&!e.products.product[0]&&(e.products.product=[e.products.product]),s.policy.capabilities.features[e.name]={enabled:"true"==e.enabled,products:[],bestProduct:e.products?e.products.product[0].key:null}})),i.capabilities.products.product[0]||(i.capabilities.products.product=[i.capabilities.products.product]),i.capabilities.products.product.filter((e=>e.features)).forEach((e=>{e.features.feature[0]||(e.features.feature=[e.features.feature]),e.features.feature.forEach((t=>{let i,a=null;try{a=s.policy.capabilities.features[t.name].bestProduct}catch(e){}try{s.policy.capabilities.features[t.name].enabled||(i=e.key==a?"unshift":"push",s.policy.capabilities.features[t.name].products[i]((({key:e,type:t,name:i,offerCode:s,ecomKey:a,shortName:n})=>({key:e,type:t,name:i,offerCode:s,ecomKey:a,shortName:n}))(e)))}catch(e){CONSOLE.error(["Failed to set products for unknown feature: ",t.name])}}))}))),s.policy.privacy=this.defaults.privacy,i.privacy&&i.privacy.feature&&(i.privacy.feature.length||(i.privacy.feature=[i.privacy.feature]),i.privacy.feature.forEach((e=>{s.policy.privacy[e.name]={enabled:"true"==e.enabled}})),window?.GPC?.setInternalOptOut(!s.policy.privacy["personalized-ads"].enabled)),APP.USER.slackerUser.valueHasMutated(),a.policy={accountLoc:n},APP.SERVICE.cache("slackerUser",JSON.stringify(a))}},a.prototype.__constants(),registerPackage("com.slacker.app.actions.slacker.user.GetUserPolicyAction"),com.slacker.app.actions.slacker.user.GetUserPolicyAction=a}()})),bjork("com.slacker.app.actions.slacker.user.GetUserRatingsAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.io.XmlUtils"),s=null;function a(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}a.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.isFavSongsRequest=!1},execute:function(e,i){APP.USER.slackerUser();var a=null;this.isFetching?CONSOLE.warn("GetUserRatingsAction::execute - Request already in process. Ignore redundant request."):(this.isFetching=!0,e?a=t.get(APP.SERVICE.urls.SLACKER.SESSION.RATINGS,{"rating-id":e.replace("stations/","")}):(s&&s.length&&i&&(CONSOLE.debug("GetUserRatingsAction::Sending c
1allback cached favorite songs data."),i(200,s,this)),this.isFavSongsRequest=!0,a=t.get(APP.SERVICE.urls.SLACKER.EDIT.FAVORITES)),this.callback=i,this._doRequest({source:a,callback:this.onActionResponse.bind(this),method:"GET",type:"xml",data:null,headers:{"Content-Type":"text/xml; charset=UTF-8"}}))},onActionResponse:function(e,t,a){var n;e=a&&a.responseText?i.parseFromString(a.responseText):e;try{(n=APP.SERVICE._beanify(this.x2js.xml2json(e))).Ratings?n=n.Ratings:n.Favorites&&(n=n.Favorites),this.isFavSongsRequest&&(this.isFavSongsRequest=!1,(s=n.add?n.add.song:null)&&!s.length&&(s=[s]),s&&s.sort((function(e,t){return e.title<t.title?-1:1})),n=s)}catch(e){}this.isFetching=!1,CONSOLE.debug("GetUserRatingsAction:: server response: "+[t,a.status]),this.callback&&this.callback(a.status,n,this)}},registerPackage("com.slacker.app.actions.slacker.user.GetUserRatingsAction"),com.slacker.app.actions.slacker.user.GetUserRatingsAction=a}()})),bjork("com.slacker.app.actions.slacker.user.NotificationSubscriptionAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction");function t(t){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t)}t.prototype={__beforeConstructor:function(){},__constructor:function(e){this.notificationsKey=e,this.user=null,this.error=ko.observable(),this.status=ko.observable(null),this.buttonLabel=ko.computed(function(){switch(this.status()){case"fetching":return"...";case"deleted":case"none":return"Set Reminder";case"active":return"Reminder on"}}.bind(this)),this.method="GET",this.URLS={GET:null,POST:null,DELETE:null}},execute:function(){const e=this;if(this.isFetching)return;if(this.user=APP.USER.slackerUser(),!this.URLS[this.method])return void CONSOLE.warn(["NotificationSubscriptionAction::execute called with unknown method ",this.method]);if(0==this.user.actualTier)return void("GET"==this.method?this.status("none"):APP.MESSAGING.prompt("account-required-for-notifications",null,[{label:"SIGN UP FREE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"account-required-for-notifications",label:"SIGN UP FREE"}}),APP.MESSAGING.setModal(),APP.USER.doForceSlackerCreate((()=>{e.isFetching=!1,e.execute()}),"event-notification-subscription")}}]));this.error(null),this.isFetching=!0,this.status("fetching");let t=null;"POST"==this.method&&(t=JSON.stringify({accountId:this.user.id,notificationsKey:this.notificationsKey}));let i={source:this.URLS[this.method],callback:this.onActionResponse.bind(this),method:this.method,type:"json",data:t,headers:{"Content-Type":"application/json; charset=UTF-8"}};this._doRequest(i)},onActionResponse:function(e,t,i){const s=APP.USER.slackerUser();if(this.requestStatus=i.status,this.isFetching=!1,this.status("none"),200===i.status)switch(this.method){case"GET":this._onEventSubscriptionsCheck(e);break;case"POST":this._onEventSubscriptionsCheck({content:[e]}),s.username?APP.MESSAGING.prompt("ticklerFree",{msg:"You're all set. We'll keep you updated on this event."}):APP.MESSAGING.prompt("add-email-notify");break;case"DELETE":this.status("deleted"),this.URLS.DELETE=null,APP.MESSAGING.prompt("ticklerFree",{msg:"You're all set. We've unsubscribed you from updates on this event."})}else APP.MESSAGING.prompt("ticklerFree",{msg:`An unknown error has occurred (${i.status}).`})},_onEventSubscriptionsCheck:function(e){let t=null;e.content&&e.content.length&&(t=e.content.filter((e=>e.notificationsKey==this.notificationsKey))[0]),t?(this.URLS.DELETE=APP.halifyLinks(t.links).self.href,this.status("active")):this.status("none")}},registerPackage("com.slacker.app.actions.slacker.user.NotificationSubscriptionAction"),com.slacker.app.actions.slacker.user.NotificationSubscriptionAction=t}()})),bjork("com.slacker.app.actions.slacker.user.PurchaseQueueAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction");const t=require("com.slacker.app.modules.PubnubModule");var i=require("com.slacker.app.modules.UrlModule");require("com.slacker.util.CookieJar");const s=require("com.slacker.app.modules.NetworkModule");function a(t,i,s){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t,i)}a.prototype={__beforeConstructor:function(){this.ACTION={ENTER:1,CHECK:2,LEAVE:3},this.action=1},__constructor:function(e,t,i){this.scopes=t?[t]:null,this.obj=e,this.source=i,this.active=!1,this.noneShallPass=!0,this.reentryToken=null,this.userUrl=null,this.placeCheck=null,this.isLeaving=!1,this.waitTime=ko.observable(0),this.ticketQueueAuthKeyLink=null,this.heroSectionMsg="You are now in line. Thank y
1ou for your patience. DO NOT LEAVE THIS PAGE.",this.ticketSectionMsg="You are now in line. Thank you for your patience. DO NOT LEAVE THIS PAGE.",APP.purchaseQueue=this},execute:function(){let e;if(CONSOLE.info("PurchaseQueueAction::execute called",{action:this.action,hasUserUrl:!!this.userUrl,userUrl:this.userUrl,hasReentryToken:!!this.reentryToken,reentryToken:this.reentryToken}),this.isFetching)CONSOLE.warn("PurchaseQueueAction::execute - Request already in process. Ignore redundant request.");else if(this.isFetching=!0,this.clearQueueCheckTimer(),!APP.SERVICE.urls.SLACKER.API.TICKETQUEUE||this.obj.subTypes&&this.obj.subTypes.includes("recorded"))this.onActionResponse(null,"success",{status:200});else{let t=1==this.action?"POST":2==this.action?"GET":"DELETE",s=null;1==this.action&&this.reentryToken&&(s={reentryToken:this.reentryToken});const a=this.userUrl||i.get(APP.SERVICE.urls.SLACKER.API.TICKETQUEUE);CONSOLE.info("PurchaseQueueAction::execute - Making request",{method:t,url:a,hasData:!!s,data:s}),e={source:a,callback:this.onActionResponse.bind(this),method:t,type:"json",data:s?JSON.stringify(s):null},e.noretry=1==this.action,this._doRequest(e)}},reset:function(e,t,i){this.scopes=t?[t]:null,this.obj=e,this.source=i,this.active=!1,this.noneShallPass=!0,this.userUrl=null,this.action=1,this.ticketQueueAuthKeyLink=null},initPubnub:function(e){if(e.links){let t=null;Array.isArray(e.links)?t=e.links.find((e=>"create-auth-key"===e.rel)):e.links["create-auth-key"]&&(t=e.links["create-auth-key"]),t&&(this.ticketQueueAuthKeyLink=t.href||t)}new t([e],"ticketQueue",this)},fetchTicketQueueAuthKey:function(){return new Promise(((e,t)=>{if(!this.ticketQueueAuthKeyLink)return CONSOLE.error("PurchaseQueueAction::fetchTicketQueueAuthKey - Missing auth key endpoint!"),void t(new Error("Missing ticket queue auth key endpoint"));const i=this.reentryToken?{reentryToken:this.reentryToken}:{};s.do(this.ticketQueueAuthKeyLink,((i,s,a)=>{a.status>=200&&a.status<300?e(i):t({jqXHR:a,data:i})}),"POST","json",Object.keys(i).length?JSON.stringify(i):null,{Authorization:"Bearer "+APP.USER.slackerUser().access_token})}))},socialMessaging:function(e){this._pubnub=e},queryPlace:function(){CONSOLE.info("PurchaseQueueAction::queryPlace called",{hasUserUrl:!!this.userUrl,userUrl:this.userUrl,active:this.active,action:this.action}),this.userUrl?(this.waitTime("CHECKING..."),this.placeCheck=setTimeout((()=>{CONSOLE.info("PurchaseQueueAction::queryPlace timeout - Setting action to 2 and calling execute",{userUrl:this.userUrl,action:this.action}),this.action=2,this.execute()}),2e3)):this.active&&(CONSOLE.info("PurchaseQueueAction::queryPlace - No userUrl but active, unlocking"),this.onQueueStatus({locked:!1}))},leaveQueue:function(e){CONSOLE.info("PurchaseQueueAction::leaveQueue called",{isFinal:e,hasUserUrl:!!this.userUrl,userUrl:this.userUrl,active:this.active,noneShallPass:this.noneShallPass,stack:(new Error).stack});const t=APP.MESSAGING.tickler();this.isLeaving=e,this.clearQueueCheckTimer(),this.userUrl&&(CONSOLE.info("PurchaseQueueAction::leaveQueue - Setting action to 3 and calling execute"),this.action=3,this.execute(),BEACON.tagEvent({name:"purchaseQueue",params:{value:"leave",label:this.obj.storeUrl||this.obj.seoName}})),t&&"purchaseQueue"==t.beaconId&&APP.MESSAGING.setTickler(),this.noneShallPass=!0,this.awaitAccept=!1,this.ticketQueueAuthKeyLink=null;try{this._pubnub.teardown()}catch(e){}finally{this._pubnub=null}e&&(APP.purchaseQueue=null)},goToQueueItem:function(){const e=APP.MESSAGING.tickler();e&&"purchaseQueue"==e.beaconId&&APP.MESSAGING.setTickler(),APP.goToPage("item",this.obj.data)},setWaitingRoomStateOnDetailPage:function(e){e&&(this.scopes||(this.scopes=[]),this.scopes=this.scopes.concat(e)),this.scopes.forEach((e=>{if(e.isTicketWaitingRoomActive&&e.isTicketWaitingRoomActive()!=this.active){e.isTicketWaitingRoomActive(this.active);let t=e.data()[0],i=this.ticketSectionMsg,s=null;t.hasTicketSection&&(t.sections.forEach((e=>{e.id==t.hasTicketSection.id&&(s=e)})),s&&(this.active?(s.tmpContent=s.content(),s.content([]),s.visibleDescription(i)):(s.content(s.tmpContent),s.visibleDescription(s.description))))}}))},clearQueueCheckTimer:function(){this.placeCheck&&(clearTimeout(this.placeCheck),this.placeCheck=0)},doQueuedPurchase:function(){CONSOLE.info("PurchaseQueueAction::doQueuedPurchase called - Re-triggering onPurchaseTicketsClick",{obj:this.obj,source:this.source,noneShallPass:this.noneShallPass,stack:(new Error).stack}),APP.onPurchaseTicketsClick(this.obj,!1,this.source)},onUserEvicted:function(){this.noneShallPass=!0,this.reentryToken=null,this.awaitAccept=!1,this.active?this.onQueueStatus({locked:!1},!0):this.clearQueueCheckTimer();try{this._pubnub.teardown()}catch(e){}finally{this._pubnub=null}BEACON.tagEvent({name:"purchaseQueue",params:{value:"evicted",label:this.obj.storeUrl||this.obj.seoName}}),APP.MESSAGING.setTickler({beaconId:"purchaseQueue",title:"We've been calling.",msg:"Since you haven't responded, your place in line has been given to the next person.",showClose:!0})},onTicketQueueMessage:function(e){const t=APP.MESSAGING.tickler();if(this.isLeaving)return void(t&&"purchaseQueue"==t.beaconId&&APP.MESSAGING.setTickler());let i=null;if(e)switch(e.message){case"enterPurchaseFlow":this.active&&this.onQueueStatus({locked:!1});break;case"enterPurchaseFlowReminder":i="We might have to give your place away if you don't respond. Choose your Ticket option below and click BUY TICKET.";break;case"evictedFromQueue":this.onUserEvicted()}i&&APP.MESSAGING.setTickler({beaconId:"purchaseQueue",title:"Are you there? ",msg:i})},onWaitTimeCount:function(){let e=this.waitTime();e>1?(this.placeCheck=setTimeout((()=>this.onWaitTimeCount()),1e3),this.waitTime(--e)):this.queryPlace()},onQueueStatus:function(e,t){if(!e.locked)if(this.noneShallPass=!1,this.active){this.awaitAccept=!0;this.clearQueueCheckTimer(),t?APP.purchaseQueue=null:(APP.MESSAGING.setTickler({beaconId:"purchaseQueue",title:"",msg:"You made it! Choose your Ticket option below and click BUY TICKET.",showClose:!0},2e4),window.APP&&window.APP.LIBRARY_SYNC&&window.APP.LIBRARY_SYNC.armTicketPurchase(),BEACON.tagEvent({name:"purchaseQueue",params:{value:"admitted",label:this.obj.storeUrl||this.obj.seoName}})),this.active=!1,this.setWaitingRoomStateOnDetailPage()}else this.doQueuedPurchase()},onActionResponse:function(e,t,i){let s=this.waitTime()>0;if(CONSOLE.info("PurchaseQueueAction::onActionResponse called",{hasResponse:!!e,status:t,jqXHRStatus:i?.status,jqXHR:i,response:e}),this.status=i.status,this.isFetching=!1,e){if(this.halifyLinks(e.links),e.links&&e.links["create-auth-key"]){const t=e.links["create-auth-key"];this.ticketQueueAuthKeyLink=t.href||t}else CONSOLE.warn("PurchaseQueueAction::onActionResponse - No create-auth-key link in response!",e.links);e.reentryToken&&(this.reentryToken=e.reentryToken),e.projectedWaitTime&&(e.links&&e.links.self?(this.userUrl=e.links.self.href,CONSOLE.info("PurchaseQueueAction::onActionResponse - Set userUrl:",this.userUrl)):CONSOLE.warn("PurchaseQueueAction::onActionResponse - No self link after halifyLinks!",e.links),this.clearQueueCheckTimer(),this.waitTime(e.projectedWaitTime),s||this.onWaitTimeCount())}switch(i.status){case 200:switch(this.action){case 1:this.onQueueStatus({locked:!1});break;case 2:e&&e.projectedWaitTime||this.onQueueStatus({locked:!1});break;case 3:this.active&&(this.isLeaving||this.onQueueStatus({locked:!1}),this.userUrl=null)}break;case 202:this.active||(BEACON.tagEvent({name:"purchaseQueue",params:{value:"enter",label:this.obj.storeUrl||this.obj.seoName}}),this.active=!0,this.scopes.length&&(window.scrollTo(0,0),this.setWaitingRoomStateOnDetailPage()),e.pubNubChannel?(CONSOLE.info("PurchaseQueueAction::onActionResponse - Initializing PubNub with channel:",e.pubNubChannel),this.initPubnub(e.pubNubChannel)):CONSOLE.warn("PurchaseQueueAction::onActionResponse - No pubNubChannel in response!"));break;default:CONSOLE.warn(`PurchaseQueueAction::onActionResponse - Unknown queue error ${i.status}. Unlock user as safety.`),3!=this.action&&this.onQueueStatus({locked:!1})}}},registerPackage("com.slacker.app.actions.slacker.user.PurchaseQueueAction"),com.slacker.app.actions.slacker.user.PurchaseQueueAction=a}()})),bjork("com.slacker.app.actions.slacker.user.SalesOptoutAction",(function(){(function(){var SlackerAbstractAction=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),NetworkModule=require("com.slacker.app.modules.NetworkModule"),UrlModule=require("com.slacker.app.modules.UrlModule"),XmlUtils=require("com.slacker.io.XmlUtils");function SalesOptoutAction(e,t){extendClass(this,new SlackerAbstractAction),this.__constants(),this.__properties(),this.__constructor(e,t)}SalesOptoutAction.prototype={__constants:function(){this.PATH_UPLOAD=null,this.getEndpointData=e=>({href:{status:"APP.SERVICE.urls.SLACKER.API.WSV1SETTINGS",submit:"APP.SERVICE.urls.SLACKER.ACCOUNTS.FLAGS"},setting:e}),this.ENDPOINTS={CA:this.getEndpointData("ccpaOptOut"),VA:this.getEndpointData("vcdpaOptOut"),CO:this.getEndpointData("c
1oOptOut"),CT:this.getEndpointData("ctOptOut"),UT:this.getEndpointData("utOptOut"),DE:this.getEndpointData("deOptOut"),IA:this.getEndpointData("iaOptOut"),NJ:this.getEndpointData("njOptOut"),NH:this.getEndpointData("nhOptOut"),NE:this.getEndpointData("neOptOut")}},__properties:function(){this.targetState=null,this.userToken=null,this.userId=null,this._status=!0,this.errors=ko.observable(null),this.fatalError=ko.observable(null),this.fetching=ko.observable(!1),this.status=ko.observable(!1),this.tokenUser=ko.observable(null),this.requested=ko.observable(!1),this.invalidState=ko.observable(!1),this.selectedState=ko.observable(!1),this.isSlackerAnon=ko.observable(!0),this.nonSelectedStateMatch=ko.observable(!1),this.apiEndpoint=null,this.gpcOptOut=window.GPC.optOut("gpc_only")},__constructor:function(e,t){this.reset(),this.targetStates=e,this.onComplete=t},loginToAccount:function(){this.errors(null),APP.USER.doForceSlackerLogin((()=>{this.isSlackerAnon(!1),this._updateStateAfterLogin()}))},execute:function(){var _headers={"Content-Type":"application/x-www-form-urlencoded"},urlBase=UrlModule.get(eval(this._getApi().href.status)),formData={},params={};formData[this._getApi().setting]=this._status,this.userToken&&this.userId&&(_headers.Authorization=`Bearer ${this.userToken}`,_headers.bOverrideUserToken=!0,params["account-id"]=this.userId),this.fetching(!0),this.errors(null),this._doRequest({source:UrlModule.get(eval(this._getApi().href.status),params),callback:this._onServerResponse.bind(this),method:"POST",type:"xml",data:formData,headers:_headers})},getStatus:function(selectedState){let self=this;var _headers={"Content-Type":"text/xml; charset=UTF-8"},params={};this.userToken&&this.userId&&(_headers.Authorization=`Bearer ${this.userToken}`,_headers.bOverrideUserToken=!0,params["account-id"]=this.userId),this.fetching(!0),this._doRequest({source:UrlModule.get(eval(this._getApi(selectedState).href.status),params),callback:(e,t,i)=>{e=i&&i.responseText?XmlUtils.parseFromString(i.responseText):e;var s=APP.SERVICE._beanify(this.x2js.xml2json(e));if(s&&s.Account){const e=Object.keys(this.ENDPOINTS).map((e=>({...this.ENDPOINTS[e],state:e}))),t=!!e.find((e=>"true"===s.Account[this._getApi(e.state).setting]));this.nonSelectedStateMatch(!!e.find((e=>"true"===s.Account[e.setting]&&e.state!==selectedState))),this.status(t),this.isSlackerAnon(!this.userId&&"0"===s.Account.level),this.tokenUser(s.Account.id),this.selectedState(selectedState)}else"error"===t?(this.errors("An unexpected error has occurred. Please try again later."),this.fatalError(!0),this.tokenUser("INVALID")):(this.errors("An unexpected error has occurred. Please try again later."),this.fatalError(!0));this.fetching(!1)},method:"GET",type:"xml",data:null,headers:_headers})},selectState:function(e,t){this.errors(null),this.selectedState(null),this.invalidState(!this.targetStates.includes(t.target.value)),this.invalidState()?this.selectedState(!1):this.getStatus(t.target.value)},reset:function(){this.errors(null),this.fatalError(null),this.fetching(!1),this.status(!1),this.tokenUser(null),this.requested(!1),this.invalidState(!1)},_updateStateAfterLogin:function(){this.requested(!1),this.invalidState(!1),this.status(!1),this.fetching(!1),this.fatalError(null),this.errors(null)},_getApi:function(e){return this.ENDPOINTS[e||this.selectedState()]},_onServerResponse:function(e,t,i){if(this.fetching(!1),200===i.status){this.status(this._status);var s=!this._status;APP.USER.slackerUser().policy.privacy["personalized-ads"].enabled=s,window.GPC.setInternalOptOut(!s),APP.USER.setGoogleRemarketingStatus(!window.GPC.optOut("any")),this.requested(this.selectedState())}else if(401!=i.status){CONSOLE.error(["SalesOptoutAction::User update FAILED",t,i.status]);var a="An unexpected error has occurred ("+i.status+").";this.userToken&&(this.fatalError(!0),a="An unexpected error has occurred. Please try again later."),this.errors(a)}}},registerPackage("com.slacker.app.actions.slacker.user.SalesOptoutAction"),com.slacker.app.actions.slacker.user.SalesOptoutAction=SalesOptoutAction})()})),bjork("com.slacker.app.actions.slacker.user.SlackerFeedbackAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction"),i=require("com.slacker.app.modules.UrlModule"),s=require("com.slacker.util.browser.Browser");require("com.slacker.io.XmlUtils");function a(){extendClass(this,new e),this.__beforeConstructor(),this.__constructor()}a.prototype={__beforeConstructor:function(){},__constructor:function(){this.retryCount=0,this.logData=null},execute:function(e){var i=this,s=APP.USER.slackerUser();this.isFetching?CONSOLE.warn("SlackerFeedbackAction::execute - Request already in process. Ignore redundant request."):s&&s.id?(this.isFetching=!0,this.logData=e,this._doLogUpload(e)):t.execute("init",(function(){i.execute(e)}))},_doLogUpload:function(e){const t=[],a=[],n=APP.USER.slackerUser(),o=APP.slackerPlayerSession(),r=o?o.playlist():null,l=CONSOLE.getLog().join("\n"),c="AaB03x",d="\r\n--"+c+"\r\n",u={"Content-Type":"multipart/form-data; boundary="+c},h=videojs&&videojs.log?videojs.log.history():null;let p;t.push("*** USER DESCRIPTION ***"),t.push(e.emailContent+"\n"),t.push("*** DATA ***"),t.push("App Version: 4.0.1385 - @DID@"),t.pu
1sh("Client ID: "+CONFIG.client),t.push("Brand: slacker_lxl"),t.push("Device Model: "+APP.appImplementationModule.type),t.push("User Agent: "+s.UA),t.push("Browser Version: "+s.version),t.push("Connection Speed: "+com.slacker.io.HttpRequest.getConnSpeed()),t.push(" "),t.push("--------------------------------"),t.push(" "),t.push("User Id: "+n.id),t.push("User Name: "+n.username),t.push("Reply Email: "+e.email),t.push("User Account Level: "+n.actualTier),t.push("UserPolicy Enabled Features: "),n.policy&&n.policy.capabilities&&n.policy.capabilities.features&&Object.keys(n.policy.capabilities.features).filter((e=>n.policy.capabilities.features[e].enabled)).forEach((e=>t.push(`---- ${e}`))),t.push(" "),t.push("--------------------------------"),t.push(" "),t.push("Last Track Played: "+(r&&r[0]?[r[0].title,r[0].artist,r[0].album]:"NONE")),t.push("Advertisements in Use: "+com.slacker.sads.SAds.getDebugData().replace(/ /g,"----")),p=t.join("\n")+"\n",a.push(d),a.push('Content-Disposition: form-data; name="userInfo"\r\n\r\n'),a.push(p),a.push(d),a.push('Content-Disposition: form-data; name="deviceType"\r\n\r\n'),a.push("webplayer"),a.push(d),a.push('Content-Disposition: form-data; name="deviceId"\r\n\r\n'),a.push(n.id),a.push(d),a.push('Content-Disposition: form-data; name="deviceLog"; filename="device.log"\r\n'),a.push("Content-Type: application/octet-stream\r\n\r\n"),a.push(p),a.push("*** SLACKER LOG ***\r\n"),a.push(l),h&&(a.push("\r\n\r\n*** VIDEOJS LOG ***\r\n"),a.push(h.join("\n"))),a.push("\r\n--"+c+"--"),this.logData.feedbackData=p+l,e.sendEmailOnly?this._doSendEmail(this.logData):this._doRequest({source:i.get(APP.SERVICE.urls.SLACKER.SESSION.LOGUPLOAD),callback:this.onActionResponse.bind(this),method:"POST",type:"xml",data:a.join(""),headers:u})},_doSendEmail:function(e){const t="content="+e.feedbackData+"&subject=Feedback+from+site&email="+e.email+"&sendto="+e.sendTo,s=i.get(APP.SERVICE.URLMODULE.SLACKER_ROOTS.ROOT+"sendMail");this._doRequest({source:s,callback:null,method:"POST",type:"xml",data:t,headers:null})},onActionResponse:function(e,t,i){this.isFetching=!1,CONSOLE.debug("WS server response: "+[t,i.status]),APP.MESSAGING.setModal(),200==i.status?(APP.MESSAGING.prompt("feedback-submit"),this.logData.sendTo&&this._doSendEmail(this.logData)):APP.MESSAGING.prompt("modalErrorFree",{reason:i.status})}},registerPackage("com.slacker.app.actions.slacker.user.SlackerFeedbackAction"),com.slacker.app.actions.slacker.user.SlackerFeedbackAction=a}()})),bjork("com.slacker.app.actions.slacker.user.SlackerTokenAction",(function(){(function(){const SlackerAbstractAction=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),UrlModule=require("com.slacker.app.modules.UrlModule"),XmlUtils=require("com.slacker.io.XmlUtils"),Base64=require("com.slacker.util.encoding.B64"),USE_TOKEN_BRIDGE="true"!==Q_STRING.get("disableTokenBridge");function SlackerTokenAction(){extendClass(this,new SlackerAbstractAction),this.__beforeConstructor(),this.__constructor()}SlackerTokenAction.prototype={__beforeConstructor:function(){this.x2js=new X2JS,this.grants={credential:"grant_type=client_credentials",anonymous:"grant_type=login_token&loginToken={loginToken}&accountId={accountId}",refresh:"grant_type=refresh_token&refresh_token={refreshtoken}"}},__constructor:function(){this.retryCount=0,this.tokenTimeout=null,this.onReauthAction=null,this.chainedAction=[],this.slackerUser=null},execute:function(onReauthAction,chainedAction){const self=this;if(!this.signingKey&&CONFIG.slackerConfig.OAUTH_K&&eval(decodeFromHex(CONFIG.slackerConfig.OAUTH_K).replace("function decodeFromHex(str) ","this.signingKey=function decodeFromHex(str)")),this.slackerUser=APP.USER.slackerUser(),this.isFetching)return CONSOLE.warn("SlackerTokenAction::execute - Token request already in process. Ignore redundant request."),void(chainedAction&&(CONSOLE.warn("SlackerTokenAction::execute - Storing chained action for redunant request."),"function"==typeof chainedAction?this.chainedAction.push(chainedAction):this.chainedAction=this.chainedAction.concat(chainedAction)));let method="GET",type="xml",headers={},myParams,signedParams;if(this.isFetching=!0,this.slackerUser.loginToken||this.slackerUser.refresh_token){if(!APP.SERVICE.urls.SLACKER.API.TOKEN)return CONSOLE.warn("SlackerTokenAction::execute - Waiting for API Discovery"),void setTimeout((function(){self.isFetching=!1,self.execute(onReauthAction,chainedAction)}),1e3);method="POST",type="json",this.actionUrl=UrlModule.get(APP.SERVICE.urls.SLACKER.API.TOKEN),this.slackerUser.loginToken?data=this.grants.anonymous.replace("{loginToken}",this.slackerUser.loginToken).replace("{accountId}",this.slackerUser.id):data=this.grants.refresh.replace("{refreshtoken}",this.slackerUser.refresh_token),headers.Authorization="Basic "+Base64.encode64(CONFIG.slackerConfig.oauthClient+":"+APP.SERVICE.signSlackerRequest
1(this.signingKey(),{k:"|",v:":"}).replace("sh:","")),headers["Content-Type"]="application/x-www-form-urlencoded"}else data=null,myParams=$.param({client:CONFIG.slackerConfig.client,site:CONFIG.slackerConfig.site,aid:this.slackerUser.id,ti:this.tokenTimeout?this.tokenTimeout:""}),signedParams=APP.SERVICE.signSlackerRequest(myParams),this.actionUrl=UrlModule.get(APP.SERVICE.urls.SLACKER.API.WSTOKEN,signedParams),this.tokenTimeout&&(this.tokenTimeout=null),headers["Content-Type"]="text/xml; charset=UTF-8";onReauthAction&&(this.onReauthAction=onReauthAction),chainedAction&&("function"==typeof chainedAction?this.chainedAction.push(chainedAction):this.chainedAction=this.chainedAction.concat(chainedAction)),this._doRequest({source:this.actionUrl,callback:this.onActionResponse.bind(this),method,type,data,headers})},onActionResponse:function(e,t,i){const s=APP.USER.slackerUser();let a,n={},o=null;if(e&&e.token_type)o=e;else{e=i&&i.responseText?XmlUtils.parseFromString(i.responseText):e;try{o=APP.SERVICE._beanify(this.x2js.xml2json(e))}catch(e){}}switch(CONSOLE.debug("WSToken server response: "+[t,i.status,o]),i.status){case 200:let r=e&&e.token_type?o:o?o.Response:null;for(a in e&&e.token_type?(n.id=e.accountId.toString(),n.username=s.username,n.access_token=e.access_token,n.refresh_token=e.refresh_token,n.loginToken=null,n.requiresBridge=USE_TOKEN_BRIDGE):(n.username=r.username,n.id=r.aid),APP.
1SERVICE.cache("slackerUser",JSON.stringify(n)),r.WSToken&&(s.token=r.WSToken),n)s[a]=n[a];if(APP.USER.slackerUser(s),s.requiresBridge){let e=APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.SLACKER.API.TOKENBRIDGE);APP.setShortToken&&(e+=`?ti=${APP.setShortToken}`),this._doRequest({source:e,callback:this.onSlackerTokenBridgeResponse.bind(this),method:"POST",type:"xml",data:null,headers:{Authorization:"Bearer "+s.access_token,"Content-Type":"application/x-www-form-urlencoded"}})}else this.isFetching=!1,s.token="oauth",APP.USER.slackerUser(s),this.onReauthAction&&this.onReauthAction(i.status,this.chainedAction);break;case 401:i.responseJSON&&"clock_drift"==i.responseJSON.error?(this.isFetching=!1,i.responseJSON.stime=i.responseJSON.current_time,CONSOLE.info("WSToken server time mismatch: "+[APP.SERVICE.slackerServerTimeSkew]),APP.SERVICE.setSlackerServerTimeSkew(i.responseJSON),this.execute()):(this.isFetching=!1,this.chainedAction=[],this.onReauthAction&&this.onReauthAction(i.status));break;case 400:this.slackerUser.loginToken&&(i.status="invalid_token"),this.isFetching=!1,APP.USER._onUserAuthError(i.status,t,i);break;case 409:CONSOLE.warn("Key revoked. Client must update."),this.isFetching=!1,this.onReauthAction=null,this.chainedAction=[];break;case 412:bOk=!1,this.isFetching=!1,CONSOLE.info("WSToken server time mismatch: "+[APP.SERVICE.slackerServerTimeSkew]),APP.SERVICE.setSlackerServerTimeSkew(o?o.Response:{}),this.execute();break;default:this.isFetching=!1,APP.USER._onUserAuthError(i.status,t,i)}},onSlackerTokenBridgeResponse:function(e,t,i){CONSOLE.debug("WSTokenBridge server response: "+[t,i.status]),CONSOLE.debug("WSTokenBridge responseText available: "+!(!i||!i.responseText)+", length: "+(i&&i.responseText?i.responseText.length:0));const s=APP.USER.slackerUser();let a=null;e=i&&i.responseText?XmlUtils.parseFromString(i.responseText):e,CONSOLE.debug("WSTokenBridge XML parse result: "+(e?"valid DOM":"null"));try{a=APP.SERVICE._beanify(this.x2js.xml2json(e)),CONSOLE.debug("WSTokenBridge JSON conversion result: "+JSON.stringify(a))}catch(e){CONSOLE.warn("WSTokenBridge JSON conversion failed: "+e.message)}if(s.requiresBridge=!1,200!==i.status)return CONSOLE.error("WSTokenBridge: Non-200 status from server: "+i.status),this.isFetching=!1,void APP.USER._onUserAuthError(i.status,t,i);{let n=e&&e.token_type?a:a?a.Response:null;if(!n||!n.WSToken)return CONSOLE.error("WSTokenBridge: Failed to parse WSToken from response - r="+JSON.stringify(n)+", respJson="+JSON.stringify(a)+", hasResponseText="+!(!i||!i.responseText)),this.isFetching=!1,void APP.USER._onUserAuthError(i.status,t,i);CONSOLE.info("WSTokenBridge: WSToken obtained successfully"),s.token=n.WSToken,APP.USER.slackerUser(s)}this.isFetching=!1,this.onReauthAction&&this.onReauthAction(i.status,this.chainedAction)}},registerPackage("com.slacker.app.actions.slacker.user.SlackerTokenAction"),com.slacker.app.actions.slacker.user.SlackerTokenAction=new SlackerTokenAction})()})),bjork("com.slacker.app.actions.slacker.user.SubmitContestEntryAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");require("com.slacker.util.CookieJar");function i(t,i){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t,i)}i.prototype={__beforeConstructor:function(){},__constructor:function(e){this.callback=e},execute:function(e){var i;this.isFetching?CONSOLE.warn("SubmitContestEntryAction::execute - Request already in process. Ignore redundant request."):(this.isFetching=!0,this.contestId=e,i={source:t.get(APP.SERVICE.urls.SLACKER.CONTEST.ENTRY),callback:this.onActionResponse.bind(this),method:"POST",type:"json",data:JSON.stringify({contestId:this.contestId})},CONSOLE.warn(["SubmitContestEntryAction:execute","Submitting contest entry",this.contestId]),this._doRequest(i))},onActionResponse:function(e,t,i){switch(this.status=i.status,i.status){case 200:case 202:delete APP.USER.slackerUser().contest,APP.MESSAGING.setTickler({title:"",msg:`Your contest entry has been recieved. Good Luck! (<a style="color:white" href="/contestrules/${this.contestId}">Official Rules</a>)`},1e4);break;default:let e=i.status;i.responseJSON&&i.responseJSON.message&&(e=i.responseJSON.message),APP.MESSAGING.prompt("modalError",{reason:`There was an error processing your contest entry (${e}
1). If your entry was not accepted, and you feel you are eligible for this contest, please email [email protected] and include your account username.`})}this.isFetching=!1}},registerPackage("com.slacker.app.actions.slacker.user.SubmitContestEntryAction"),com.slacker.app.actions.slacker.user.SubmitContestEntryAction=i}()})),bjork("com.slacker.app.actions.slacker.user.UpdateAccountSettingAction",(function(){!function(){var e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(t){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor(t)}i.prototype={__constants:function(){},__properties:function(){this.onComplete=null,this.field=null,this.value=null},__constructor:function(e){this.onComplete=e||null},execute:function(e,i){this.field=e,this.value=i,this._doRequest({source:t.get(APP.SERVICE.urls.SLACKER.API.WSV1SETTINGS)+"?"+e+"="+encodeURIComponent(i),callback:this._onResponse.bind(this),method:"GET",type:"xml",headers:{"Content-Type":"text/xml; charset=UTF-8"}})},_onResponse:function(e,t,i){var s=!(!i||200!==i.status),a=APP.USER.slackerUser();s&&a?(a.accountSettings=a.accountSettings||{},a.accountSettings[this.field]=this.value,APP.USER.slackerUser.valueHasMutated()):s||CONSOLE.error(["UpdateAccountSettingAction: failed to set "+this.field,t,i&&i.status]),this.onComplete&&this.onComplete(s,this.field,this.value)}},registerPackage("com.slacker.app.actions.slacker.user.UpdateAccountSettingAction"),com.slacker.app.actions.slacker.user.UpdateAccountSettingAction=i}()})),bjork("com.slacker.app.actions.slacker.user.UpdateUserProfileAction",(function(){!function(){const e=require("com.slacker.app.actions.AbstractAction"),t=require("com.slacker.app.modules.NetworkModule");function i(t,i){extendClass(this,new e),this.__constants(),this.__properties(),this.__constructor(t,i)}i.prototype={__constants:function(){this.PATH_UPLOAD=null},__properties:function(){this.channelsDataApi=null,this.isFullProfileEdit=!1,this.uploadFile=ko.observable(null),this.resetData={handle:null,name:null,bio:null},this.deletedFields=[],this.editable=["handle","name","bio"],this.emptyIsDelete=["name","bio"],this.editable.forEach((e=>{this[e]=ko.observable()})),this.isUploading=ko.observable(!1),this.uploadProgress=ko.observable(0),this.stationImageUpload=ko.observable(null),this.isDefaultImage=!APP.USER.getProfileImage(),this.hasAttachedImage=ko.computed(function(){return this.stationImageUpload()&&0==this.stationImageUpload().indexOf("data:")}.bind(this)),this.canSubmit=ko.computed(function(){const e=this.editable.reduce(((e,t)=>{const i=this[t]&&this[t]()&&this[t]().trim();return e||(e=(this.emptyIsDelete.includes(t)||i)&&i!=this.resetData[t]),e}),!1);return this.hasAttachedImage()||e}.bind(this))},__constructor:function(e,t){APP.requireSlackerServicesPromise().then((()=>{this.onComplete=t,this.form=e,this.cancel(),this.discoverEndpoints()}))},execute:function(){this.deletedFields=[];const e=APP.USER.slackerUser(),t=this.editable.filter((e=>{const t=this[e]&&this[e]()&&this[e]().trim();if(this.emptyIsDelete.includes(e)){let i=t!=this.resetData[e];return i&&!t&&this.deletedFields.push(e),i}return!t&&this[e]&&this[e](this.resetData[e]),t&&t!=this.resetData[e]}));let i={},s={};if(this.isUploading())return;let a=new FormData;this.form.avatar.files[0]&&a.append("avatar",this.form.avatar.files[0]),t&&t.length&&(t.forEach((e=>{s[e]=this[e]().trim()||null})),a.append("message",new Blob([JSON.stringify(s)],{type:"application/json"}))),e&&(i.Authorization="Bearer "+e.access_token),APP.NETWORKING.do(this.channelsDataApi.profile,this._onServerResponse.bind(this),"PATCH","multipart/form-data",a,i)},submitProfileUpdate:function(){return this.canSubmit()&&this.execute(),!1},onUserSelectedImage:function(e,t){const i=new FileReader;let s,a=null;if(e=this,this.errors(null),t.target.files.length){if(a=t.target.files[0],s=(a.size/1024/1024).toFixed(1),-1==a.type.indexOf("image/"))return void this.errors("This file is not a recognized image type. Please choose a valid image");if(s>1)return void this.errors("Image is too large ("+s+"MB). Images must be 1MB or less");i.onload=function(i){let s=new Image;s.onload=function(t){let i,n,o=100,r=s.width,l=s.height;r>l?r>o&&(l*=o/r,r=o):l>o&&(r*=o/l,l=o),n=document.createElement("canvas"),n.width=r,n.height=l,n.getContext("2d").drawImage(s,0,0,r,l),i="image/jpeg"==a.type?n.toDataURL("image/jpeg",1):n.toDataURL("image/png"),e.stationImageUpload(i)},s.src=i.target.result,e.uploadFile(t.target.files)},i.readAsDataURL(a)}},cancel:function(){this.form&&this.form.reset(),this.uploadFile(null)},discoverEndpoints:function(){let e=APP.SERVICE.URLMODULE.SERVICE.SLACKER.API["MESSAGE-CHANNELS"];APP.USER.slackerUser().id?(CONSOLE.debug("UpdateUserProfileAction::discoverEndpoints"),e=e.replace("http://","https://"),APP.NETWORKING.do(e,this._onChannelsDataApi.bind(this),"GET")):(CONSOLE.warn("UpdateUserProfileAction::discoverEndpoints::Waiting for Slacker User hydration for API requests."),setTimeout(this.discoverEndpoints.bind(this),1e3))},onValidationComplete:function(e,t){e?(this.uploadProgress(0),this.isUploading(!0)):this.isUploading(!1)},_onServerResponse:function(e,t,i){if(this.isUploading(!1),200===i.status)"parsererror"===t&&(e=JSON.parse(i.responseText)),this.onComplete&&this.onComplete(e,this.deletedFields);else if(401!=i.status){CONSOLE.error(["UpdateUserProfileAction::User update FAILED",t,i.status]);let e="An unexpected error has occurred ("+i.status+").";switch(i.status){case 400:try{const t=i.responseJSON.errors[0];switch(t.field){case"handle":case"name":switch(t.message){case"ERROR_LENGTH":e="Please choose a display name that is between 3 and 30 characters.";break;case"ERROR_ILLEGAL_CHARACTERS":e="Please choose a display name that contains only letters, numbers, underscores and periods.";break;case"ERROR_ILLEGAL_PREFIX":case"ERROR_ILLEGAL_SUFFIX":e="Display name must start with a letter and end with a letter or number.";break;default:e="This display name is not available. Please choose a different one."}break;case"bio":switch(t.message){case"ERROR_LENGTH":e="Your bio must be 256 characters or less.";break;case"ERROR_ILLEGAL_CHARACTERS":e="Your bio can only contain letters, numbers, underscores and periods.";break;default:e="There is a problem with the bio you are trying to submit."}break;case"avatar":switch(t.message){case"ERROR_AVATAR_SIZE":e="Image is too large. Images must be 1MB or less";break;case"ERROR_AVATAR_CONTENT_TYPE":e="This file is not a recognized image type. Please choose a valid image."}}}catch(e){CONSOLE.error(["UpdateUserProfileAction::User handle error processing FAILED "],e)}break;case 409:e="This display name is not available. Please choose a different one."}this.errors(e)}},_onChannelsDataApi:function(e,i){const s=this,a=APP.USER.slackerUser();let n;if(CONSOLE.debug("UpdateUserProfileAction::_onChannelsDataApi "+e),e&&e.links)n={},e.links.forEach((e=>{-1==e.href.indexOf(a.id)&&(e.href=e.href.replace("/1","/"+a.id)),n[e.rel]=e.href})),this.channelsDataApi=n,t.do(n.profile,function(e,t,i){e&&e.handle&&e.pubnubId&&(CONSOLE.info("UploadUserProfileAction::User profile fetched."),this.editable.forEach((t=>{this[t](e[t]),this.resetData[t]=e[t]})),e.images&&this.stationImageUpload(e.images.avatar.urls.medium))}.bind(this),"GET",null,null,{Authorization:"Bearer "+a.access_token},!0),"function"==typeof i&&i();else{CONSOLE.warn("UpdateUserProfileAction::_onChannelsDataApi NO ENDPOINTS! Try again.");const e="function"==typeof i?i:null;setTimeout((()=>s.discoverEndpoints(e)),200)}}},registerPackage("com.slacker.app.actions.slacker.user.UpdateUserProfileAction"),com.slacker.app.actions.slacker.user.UpdateUserProfileAction=i}()})),bjork("com.slacker.app.actions.slacker.user.VerifyLinkCodeAction",(function(){!function(){const e=require("com.slacker.app.actions.slacker.SlackerAbstractAction"),t=require("com.slacker.app.modules.UrlModule");function i(t,i){extendClass(this,new e),this.__beforeConstructor(),this.__constructor(t,i)}i.prototype={__beforeConstructor:function(){},__constructor:function(e,t){this.PATHS={verify:"/verify",request:{code:"/verify/resend/email",auth:"/auth/resend/email"}}
1,this.callback=t,this.code=e,this.requestType="verify",this.error=ko.observable()},execute:function(){if(this.isFetching)return void CONSOLE.warn("VerifyLinkCodeAction::execute - Request already in process. Ignore redundant request.");this.error(null),this.isFetching=!0;const e="request"==this.requestType?"auth"==this.code?this.PATHS[this.requestType].auth:this.PATHS[this.requestType].code:this.PATHS[this.requestType],i="auth"==this.code||e.indexOf("verify/resend")>-1?{site:"slacker",code:this.code}:{code:this.code};let s={source:t.get(`${t.SLACKER_ROOTS.SAPI}linkcode${e}`),callback:this.onActionResponse.bind(this),method:"POST",type:"json",noretry:!0,data:this.code?JSON.stringify(i):null,headers:{"Content-Type":"application/json; charset=UTF-8"}};this._doRequest(s)},onActionResponse:function(e,t,i){switch(this.status=i.status,this.isFetching=!1,i.status){case 200:break;case 404:this.error("The code is not valid.");break;case 409:this.error("The account you are trying to verify has no email address.");break;case 410:this.error("The code has expired.");break;default:this.error(`An unknown error has occurred (${i.status}). Please check your verification link and try again.`)}this.callback&&this.callback(this)}},registerPackage("com.slacker.app.actions.slacker.user.VerifyLinkCodeAction"),com.slacker.app.actions.slacker.user.VerifyLinkCodeAction=i}()})),bjork("com.slacker.app.components.ReactWrapper",(function(){!function(){function e(){this.__constructor.apply(this)}e.prototype={__constructor:function(){ko.components.isRegistered("react-wrapper")||ko.components.register("react-wrapper",{viewModel:function(e){const t=Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,8);this.id="react-wrapper-"+t;const i="function"==typeof e.props?e.props():e.props;let s=null;const a=()=>{s=window.APP_LIB.react.utils.createRoot(document.getElementById(this.id))},n=()=>{s?.render(window.APP_LIB.react.components[e.name](i))};this.koDescendantsComplete=()=>{a(),n()},this.dispose=()=>{try{s?.unmount()}catch(e){}s=null};const o=e.subscriptionMap||[],r=(e,t)=>"function"==typeof e?e():e,l=(e,t,i)=>{const s=(t,i)=>
1{"object"==typeof i?Object.keys(i).forEach((e=>{!!r(t)&&l(r(t)[e],i[e],e)})):((e,t)=>{e&&"function"==typeof e.subscribe&&e.subscribe((()=>{n()}))})(e)};Array.isArray(e)?e.forEach((e=>{s(e,t)})):s(e,t)};l(i,o)},template:'<div style="height: 100%" data-bind="attr: { id: id }" class="react-wrapper-inner"></div>'})},mount:function(e,t,i){const s=window.APP_LIB&&window.APP_LIB.react,a=s&&s.utils&&s.utils.createRoot,n=s&&s.components&&s.components[e];if("function"!=typeof a||"function"!=typeof n)return console.log("ReactWrapper:: mount("+e+"): React bundle/component unavailable"),null;const o=i||document.body,r=document.createElement("div");o.appendChild(r);let l=null;try{l=a(r),l.render(n(t))}catch(t){return console.log("ReactWrapper:: mount("+e+") failed",t),r.parentNode&&r.parentNode.removeChild(r),null}return{node:r,unmount:function(){try{l&&l.unmount()}catch(e){}l=null,r.parentNode&&r.parentNode.removeChild(r)}}}},registerPackage("com.slacker.app.components.ReactWrapper"),com.slacker.app.components.ReactWrapper=new e}()})),bjork("com.slacker.app.components.planCard.PlanCardData",(function(){registerPackage("com.slacker.app.components.planCard.PlanCardData"),com.slacker.app.components.planCard.PlanCardData=new class{constructor(){const e=this;this.plans=[{level:"Basic",levelId:1,price:"FREE",term:"MONTH",checkGeo:!1,description:"Personalize your experience",bottomBenefitIndex:0,topBenefitIndex:3,buttonText:"CREATE ACCOUNT",specialOffers:[]},{level:"Plus",levelId:5,price:"3.99",term:"MONTH",checkGeo:!0,description:"Personalized experience with no interruptions",bottomBenefitIndex:4,topBenefitIndex:6,buttonText:"GET PLUS",specialOffers:[{title:"ANNUAL PLAN",buttonText:"FOR MORE",id:"annual-plan"}].map((e=>({...e,onClick:null})))},{level:"Premium",levelId:10,price:"10.99",term:"MONTH",checkGeo:!0,description:"The ultimate music experience",bottomBenefitIndex:7,topBenefitIndex:8,buttonText:"GET PREMIUM",specialOffers:[]}].map((e=>({...e,onClick:null}))),this.benefits=[{id:"concert-festival-livestreams",label:"Concert & Festival Livestreams"},{id:"handcrafted-audio-stations",label:"Handcrafted Audio Stations"},{id:"personalized-recommendations",label:"Personalized Recommendations"},{id:"original-shows-podcasts",label:"Original Shows & Podcasts"},{id:"no-ads",label:"No Ads"},{id:"unlimited-skips",label:"Unlimited Skips"},{id:"max-audio-quality",label:"Max Audio Quality"},{id:"listen-offline",label:"Listen Offline"},{id:"play-on-demand",label:"Play on demand"}],this.benefitsByLevelName=t=>this.benefits.filter(((i,s)=>{const a=e.plans.find((e=>e.level.toLowerCase()===t.toLowerCase()));return s>=a.bottomBenefitIndex&&s<=a.topBenefitIndex}))}}})),bjork("com.slacker.app.globals",(function(){(new Date).getTime(),navigator.userAgent.toLowerCase(),location.toString(),window.IMG_CDN_AND_BUILD;var e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}var t="4.0.1385";t.indexOf("@build_number")>-1&&(t="0.0.1");var i="@DID@";(i.indexOf("@DID")>-1||i.indexOf("BUILD_DID")>-1)&&(i="LXL00x"),"undefined"==typeof PARTNER&&(PARTNER="@PARTNER@"),window.findCurrentViewInHistory=function(){const e=history?.state?.guid||-1;let t=0,i=APP.history.length;for(t=0;t<i;t++)if(APP.history[t]?.__guid==e)return[APP.history[t],t];return[null,-1]},window.encodeParamsForSlackerService=function(e){return com.slacker.util.encoding.B64.encode64($.param(e).trim()).trim().replace(/\|/gi,".")},window.makeSeoName=function(e){return e?e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9\-_]/g,"").toLowerCase():""},window.ajaxHistoryHandler=function(e){const t=e.state;let i,s,a=function(e){let t;if(t="/"+e.seoName,"/"===t)APP.goHome();else{if(e){if(e.bIsHistory=!0,e.params)return e.params.bIsHistory=!0,void APP.goToPage(e.viewType,e.params);if(e.seoName)return void APP.goToPageBySeoData(e.seoName,e)}e.hash?location.href="/"+e.hash:location.href="/"}};if(APP.MESSAGING.modal().beaconId)t?.guid&&(APP.MESSAGING.loading()||("slacker-external-service-prompt"==APP.MESSAGING.modal().msg&&(APP.USER.externalWindowSrc=null),APP.MESSAGING.setModal()));else if(APP.MESSAGING.isUnwindingExternalServiceHistory);else if(t?.modal)"slacker-external-service"==t.modal&&(APP.USER.externalWindowSrc=t.externalWindowSrc),APP.MESSAGING.prompt(t.modal,t.replace,t.actions,t.bindingData);else if(t&&APP.history.length>0){const n=findCurrentViewInHistory();if(i=n[0],s=n[1],i)i.active()||(setTimeout((e=>
1{i.setActive.bind(i)(!0),i=null}),100),APP.history.splice(0,s).forEach((e=>e.dispose())));else if(window.history.isActiveHistoryAction=!0,APP.history.splice(0,APP.history.length-1).forEach((e=>e.dispose())),t&&"/"!=t.seoName&&"./"!=t.seoName){let i=[];for(s in e)i.push(s),i.push(e[s]);CONSOLE.warn("No matching view found in history for pushed state: ",i),0!=APP.history.length||"/"!=t.seoName&&"./"!=t.seoName?a(t):APP.goHome()}else APP.goHome()}else window.history.isActiveHistoryAction=!0,a(t);state=s=null},window.addEventListener("popstate",window.ajaxHistoryHandler);var s=function(){const e=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,t=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,i=/[^-+\dA-Z]/g,a=function(e,t){for(e=String(e),t=t||2;e.length<t;)e="0"+e;return e};return function(n,o,r){let l=s,c=n;1!=arguments.length||"[object String]"!=Object.prototype.toString.call(n)||/\d/.test(n)||(o=n,n=void 0),n=n?new Date(n):new Date,isNaN(n)&&(n=new Date(c.constructor().replace(" +0000 "," "))),"UTC:"==(o=String(l.masks[o]||o||l.masks.default)).slice(0,4)&&(o=o.slice(4),r=!0);const d=r?"getUTC":"get",u=n[d+"Date"](),h=n[d+"Day"](),p=n[d+"Month"](),m=n[d+"FullYear"](),g=n[d+"Hours"](),P=n[d+"Minutes"](),y=n[d+"Seconds"](),f=n[d+"Milliseconds"](),A=r?0:n.getTimezoneOffset(),S={d:u,dd:a(u),ddd:l.i18n.dayNames[h],dddd:l.i18n.dayNames[h+7],m:p+1,mm:a(p+1),mmm:l.i18n.monthNames[p],mmmm:l.i18n.monthNames[p+12],yy:String(m).slice(2),yyyy:m,h:g%12||12,hh:a(g%12||12),H:g,HH:a(g),M:P,MM:a(P),s:y,ss:a(y),l:a(f,3),L:a(f>99?Math.round(f/10):f),t:g<12?"a":"p",tt:g<12?"am":"pm",T:g<12?"A":"P",TT:g<12?"AM":"PM",Z:r?"UTC":(String(n).match(t)||[""]).pop().replace(i,""),o:(A>0?"-":"+")+a(100*Math.floor(Math.abs(A)/60)+Math.abs(A)%60,4),S:["th","st","nd","rd"][u%10>3?0:(u%100-u%10!=10)*u%10]};return o.replace(e,(function(e){return e in S?S[e]:e.slice(1,e.length-1)}))}}();function a(t,i){var s=this;this.elem=t,this.callback=i,this.listener=function(e){s.touchHandler(e)},this.elem&&(this.elem.addEventListener("touchstart",this.listener,!e||{passive:!0}),this.elem.addEventListener("touchmove",this.listener,!e||{passive:!0}),this.elem.addEventListener("touchend",this.listener,!e||{passive:!0}))}s.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},s.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},String.prototype.capitalizeFirst=function(){return this.replace(/^\w/,(function(e){return e.toUpperCase()}))},Date.prototype.format=function(e,t){return s(this,e,t)},a.prototype.touches={touchstart:{x:-1,y:-1},touchmove:{x:-1,y:-1},touchend:!1,direction:"undetermined"},a.prototype.dispose=function(){this.elem.removeEventListener("touchstart",this.listener,!e||{passive:!0}),this.elem.removeEventListener("touchmove",this.listener,!e||{passive:!0}),this.elem.removeEventListener("touchend",this.listener,!e||{passive:!0})},a.prototype.touchHandler=function(e){var t;if(void 0!==e&&void 0!==e.touches)switch(t=e.touches[0],e.type){case"touchstart":case"touchmove":if(this.touches[e.type].x=t.pageX,this.touches[e.type].y=t.pageY,"touchmove"==e.type)(i=this.touches.touchstart.x-this.touches.touchmove.x)<0&&(i/=-1),(s=this.touches.touchstart.y-this.touches.touchmove.y)<0&&(s/=-1),this.touches.direction=i>s?this.touches.touchstart.x<this.touches.touchmove.x?"right":"left":this.touches.touchstart.y<this.touches.touchmove.y?"down":"up",this.callback(e,this.touches.direction);break;case"touchend":var i,s;this.touches[e.type]=!0,(i=this.touches.touchstart.x-this.touches.touchmove.x)<0&&(i/=-1),(s=this.touches.touchstart.y-this.touches.touchmove.y)<0&&(s/=-1),this.touches.direction=i>s?this.touches.touchstart.x<this.touches.touchmove.x?"right":"left":this.touches.touchstart.y<this.touches.touchmove.y?"down":"up",this.callback(e,this.touches.direction)}},"function"!=typeof[].includes&&(Array.prototype.includes=function(e,t){for(t||(t=0);t<this.length;t++)if(this[t]===e)return!0;return!1}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),s=1;s<arguments.length;s++){var a=arguments[s];if(null!=a)for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(i[n]=a[n])}return i},writable:!0,configurable:!0})}
1)),bjork("com.slacker.app.modules.AppModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.modules.NetworkModule"),i=require("com.slacker.app.modules.ServiceModule"),s=require("com.slacker.app.modules.UserModule"),a=require("com.slacker.util.browser.Browser"),n=require("com.slacker.sads.SAds"),o=require("com.slacker.sads.VSAds"),r=require("com.slacker.app.modules.MessagingModule"),l=require("com.slacker.app.actions.GetAppAction"),c=require("com.slacker.app.actions.LaunchVideoStreamAction"),d=require("com.slacker.app.actions.slacker.radio.GetSimpleSettingsAction");require("com.slacker.app.components.ReactWrapper");require("com.slacker.util.ko.AsyncUtils");const u=window.speechSynthesis?window.speechSynthesis:null,h=window.top!=this;function p(){this.__constants(),this.__properties(),this.__constructor()}p.prototype={__constants:function(){this.EVENTS=new e,this.TOS_FOOTER_VERSION=com.slacker.util.encoding.B64.encode64("1-2020"),this.MARKETING_PAGES=["upgrade","tesla","walmart","partners/costco","partners/costcoupgrade","groove"],this.NO_UPSELL_PAGES=["walmartActivate"],this.EVENT={APPLOADED:"event_app_loaded",VIEWACTIVE:"event_view_active",VIEWRELOAD:"event_view_reload",VIEWDISPOSE:"event_view_dispose",VIEWFAILED:"event_view_failed",VIEWOBSCURED:"event_view_obscured",SPOTLIGHTROTATE:"event_spotlight_rotate",SYSTEM:{PAUSE:"event_system_pause",PLAY:"event_system_play",STOP:"event_system_stop"}}},__properties:function(){this.herostreamaction=new c("hero"),this.downloadApps=new l,this.viewNames=["Home","MusicHome","VideoHome","LiveEventsHome","MixerSectionedPage","Podcasts","Featured","Blog","Video","Item","Hub","RadioCategories","RadioCategory","SlackerItemDetail","Mylibrary","Profile","Search","Static","Eoywrapup"],this.views={},this.viewsByDomName={},this.frameworkInclude=`${IMG_CDN_AND_BUILD}/includes/site-framework.jsp`,this.currentView=null,this.appImplementationModule=null,this.phrasesToSpeak=[],this.suppressDisplayAds=!0,this.supportsPlatformUpgrade=!1,this.supportsClosedCaptions=!0,this.canShowSlackerStationLink=!0,this.postMessageListeners={},this.useAysl=!0,this.appVersion=ko.observable(APP_VERSION),this.mustShowTosFooter=ko.observable(!1),this.implementationSuperType=ko.observable("web"),this.requiresAuth=!0,this.supportsSlacker=!1,this.canUseRadio=!1,this.usesSlackerServices=!1,this.basicRadioOnly=ko.observable(!0),this.supportsLazyImg=!1,this.supportsSocialMessaging=!1,this.useAdblockNag=!1,this.isFromMobileApp=ko.observable(!1),this.mobileUserToken=ko.observable(null),this.mobileUserId=ko.observable(null),this.embedCampaign=ko.observable(""),this.heroEmbedData=ko.observable(null),this.slackerAcct=ko.observable(null),this.slackerPlayerSession=ko.observable(),this.herorelated=ko.observable([]),this.hamburgerIsOpen=ko.observable(!1),this.queuedLoadTitle=ko.observable(null),this.adMode=ko.observable(n.getAdMode()),this.mainNav=ko.observableArray([]),this.burgerNav=ko.observableArray([]),this.viewIsPlaying=ko.observable(null),this.activeTab=ko.observable(""),this.heroSideNav=ko.observable(null),this.topUpsellNag=ko.observable([]),this.noUpsell=ko.observable(!1),this.noUpsell.subscribe((function(e){e?$("body").addClass("no-upsell"):$("body").removeClass("no-upsell")})),this.studentBeans=ko.observable(!1),this.studentBeansLoaded=ko.observable(!1),this.remoteSession=ko.observable(null),this.supportsNewProfile=ko.observable("prd"!==APP_ENV&&"pubstg"!==APP_ENV),this.history=[],this.heroRelatedFocusTimer=0,this.slackerServiceDiscoveryAttemptCounter=0,this.stationsNav=null,this.isAppLoaded=!1,this.canNavigate=ko.computed((()=>null===this.queuedLoadTitle())),this.featureFlag=ko.observable(null),this.prevFocus=ko.observable(null),this.shiftDown=!1,this.isCostcoIabToBt=ko.observable(!1),this.adModeClass=ko.computed((()=>{const e=this.adMode();return n.getAdModeClass(e)})),this._lastLazyImgRun={tStamp:0,target:null},this.animationFrame=requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame||(e=>setTimeout(e,100)),this.disableFloatingPlayerOnInit=!0,this.ptg_subscriptionMap={items:{removed:!0,streamStateBadge:!0,headerImage:!0,userHasTicket:!0,itemStateBadge:!0,contentTypeBadge:!0,paywallBadgeType:!0,isVod:!0,spotlightBgImageUrl:!0,playable:!0,countdown:!0},section:{sectionData:{bookmark:!0,artistNav:!0}},APP:{implementationSuperType:!0,slackerPlayerSession:{radioPlayerStateManager:!0}}},this.navitem_subscriptionMap={APP:{USER:{slackerUser:!0,user:!0},burgerNav:!0,mainNav:!0,hamburgerIsOpen:!0,topUpsellNag:!0,implementationSuperType:!0}},this.nav_subscriptionMap={APP:{USER:{slackerUser:!0,user:!0,navBarMenuItem:!0},burgerNav:!0,mainNav:!0,hamburgerIsOpen:!0,topUpsellNag:!0,implementationSuperType:!0}},this.preloadImagePaths=["/s=4.0.1385/images/icons/svg-scroll-right-highlight.svg","/s=4.0.1385/images/icons/svg-scroll-right-white.svg"].map((e=>IMG_CDN_AND_BUILD+e)),this.preloadedImageRefs=[]},__constructor:function(){APP=this,this._createKOCustomBindings();i18nextko.init({"en-US":{translation:{testTranslation:"Test translation",testWithData:"Test with {{ name: name }} data"}},de:{translation:{testTranslation:"Test-Ãbersetzung",testWithData:"asdfkh alsdfkj {{ name: name }} asldfkjd"}}},"en-US",ko),i18nextko.setLanguage("de"),this.NETWORKING=t,this.USER=new s,this.MESSAGING=new r,this.VSADS=o,com.slacker.app.view={}
1,this.viewNames.forEach((e=>{const t=e.toLowerCase(),i=`${e}View`;this.views[t]="RadioCategoryView"==i?"com.slacker.app.view.RadioCategoriesView":`com.slacker.app.view.${i}`,this.viewsByDomName[i]=this.views[t]})),this.views.search="com.slacker.app.view.SearchReactView",this.viewsByDomName.SearchView=this.views.search,this.EVENTS.attachEvent(this.EVENT.APPLOADED,this.onAppLoaded.bind(this)),this.EVENTS.attachEvent(this.EVENT.VIEWACTIVE,this.onActiveVew.bind(this)),this.EVENTS.attachEvent(this.EVENT.VIEWDISPOSE,this.onDisposeView.bind(this)),this.EVENTS.attachEvent(this.EVENT.VIEWFAILED,this.onFailedVew.bind(this)),this.NETWORKING.EVENTS.attachEvent(this.NETWORKING.EVENT.CONNECTION.LOST,this.onNetworkConnectionEvent.bind(this)),this.NETWORKING.EVENTS.attachEvent(this.NETWORKING.EVENT.CONNECTION.GONE,this.onNetworkConnectionEvent.bind(this)),this.EVENTS.attachEvent(this.USER.EVENT.USERLOGIN,this.onUserEvent.bind(this)),this.EVENTS.attachEvent(this.USER.EVENT.USERLOGOUT,this.onUserEvent.bind(this));let e=this._onHeroStreamActionEvent.bind(this),i=this.herostreamaction.videoplayer;["VIDEOCONTAINERREADY","DISPLAYERROR","ONFULLSCREENTOGGLE","ONFULLSCREENCHANGE"].forEach((t=>{i.attachEvent(i.EVENT[t],e)})),["COMPLETED","STARTED","ERROR"].forEach((t=>{i.attachEvent(i.EVENT.PLAYBACK[t],e)})),this._preloadImages(this.preloadImagePaths),a.isIOS()&&$("body").addClass("ios"),window.addEventListener("resize",(function(){const e=setTimeout((()=>{APP.initTabMgmt(),clearTimeout(e)}),1e3)})),this._addGlobalKeyboardListeners()},init:function(){const e=navigator.userAgent,t=void 0!==window.defaultParams?window.defaultParams:null;let i;this.MESSAGING.init($(".user-prompts")[0]),i=e.match(/AmazonWebAppPlatform/i)?require("com.slacker.app.modules.implementation.FireOsModule"):e.match(/Tizen/i)&&("undefined"!=typeof tizen||e.match(/TizenDEV/i))?require("com.slacker.app.modules.implementation.TizenModule"):"undefined"!=typeof WIDGET?require("com.slacker.app.modules.implementation.WidgetModule"):e.match(/Tesla/)?require("com.slacker.app.modules.implementation.TeslaModule"):require("com.slacker.app.modules.implementation.SiteModule"),this.appImplementationModule=new i(t)},goHome:function(e,t){if(APP.canNavigate()&&("click"!==t?.type||!["tesla","walmart","partners/costco"].includes(APP.currentView.seoName)))if("HomeView"==APP?.currentView?.type)APP.currentView.init(null,!0);else if("tv"==APP.implementationSuperType()&&APP.history.length>0){let e=APP.history.pop();APP.history=[],APP._setNavigating(!0),setTimeout((t=>{e.setActive.bind(e)(!0),e=null}),10)}else if(APP?.goToPage("home"),arguments.length){let e=arguments[1].target.getAttribute("data-beacon-value")||arguments[1].target.className,t="home";APP.EVENTS.dispatch({type:"menu-item",payload:{value:e,label:t}})}},launchMeetAndGreet:function(e=""){const t=`https://${location.hostname.replace("www","meet")}`,i=APP.USER.slackerUser();user={accountId:i.id,username:i.username,refresh_token:i.refresh_token},0==i.actualTier?location.href=`${APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.SLACKER.LOGIN)}?done=meetandgreet&event=${e}`:location.href=`${t}?event=${e}&user=${com.slacker.util.encoding.B64.encode64($.param(user))}`},isMarketingPage:function(e){return APP.MARKETING_PAGES.includes(e)},isMarketingPageRequiringAdSuppression:function(e){return APP.isMarketingPage(e)},isPageRequiringNoUpsell:function(e){return APP.NO_UPSELL_PAGES.includes(e)},isPageWithoutUpsellNag:function(e){return APP.isMarketingPage(e)||APP.isPageRequiringNoUpsell(e)},refreshNoUpsell:function(){const e=APP.USER&&APP.USER.slackerUser?APP.USER.slackerUser():null,t=APP.currentView,i=t?.seoName||t?.historyData?.seoName||"";APP.noUpsell(!(!e||!e.hooplaUser)||APP.isPageRequiringNoUpsell(i))},shouldSuppressAdsForUserTier:function(){if(APP.appImplementationModule.displayAdOverride)return APP.appImplementationModule.displayAdOverride();const e=APP.USER.slackerUser();return!!(e&&e.policy&&e.policy.capabilities&&e.policy.capabilities.features&&e.policy.capabilities.features.ad_free)&&e.policy.capabilities.features.ad_free.enabled},goToPageBySeoData:function(e,t){"home"==e?APP.goHome():0==e.indexOf("the-daily")||0==e.indexOf("blog")?APP.goToPage("blog",t):0==e.match(/(channel|genre|hub)\//)?.index?APP.goToPage("hub",t):"music"==e?APP.goToPage("musichome",t):"video"==e||"channels"==e?APP.goToPage("videohome",t):"live-events"==e?APP.goToPage("liveeventshome",t):"podcasts"==e?APP.goToPage("podcasts",t):"mylibrary"==e?APP.goToPage("mylibrary"):APP.goToPage(e,t)},handleSlackerProtocolLink:function(e,t){let i,s=e.split("slacker://")[1].split("?"),a=s[0],n=s[1];if(n)try{n=new com.slacker.util.ParamHash(n).hash,i=Object.keys(n).filter((e=>"type"!=e&&"page"!=e)).reduce(((e,t)=>(e[t]=n[t],e)),{})}catch(e){i={},CONSOLE.error("Failed to parse nag bar params for extra data",e)}if("nav"===a)switch(n.page){case"ticket":APP.onRequestUpgrade(n.page,t,i);break;case"upgrade":n.type?APP.onRequestUpgrade(n.type,t,i):APP.goToPage("upgrade");break;case"register":APP.USER.doForceSlackerCreate(null,n.source||t)}else APP.goToEventByUrl(`www.liveone.com/${a}`)},goToEventByUrl:function(e,t){if(e&&"null"!==e&&void 0!==e){const i=decodeURIComponent(e).split(".com/")[1].split("/");let s,a={};switch(a.seoName=i.join("/"),i[0]){case"live-events":s="item",a.objectId=`event-${i[2]}`;break;case"station":case"artist":case"album":case"song":s="slackeritemdetail",a.type=i[0],a.title=null}if(s){if(t)return new this.views[s](a);this.goToPage(s,a)}}},goToPage:function(e,t,i){if(CONSOLE.info("APP.goToPage:: Initiating navigation to page: "+e,{params:t,overrideUnsaved:i,currentView:APP.currentView?.seoName}),APP.USER.getPartnerConfig("costco")&&"upgrade"===e)return void(window.location.href="/partners/costcoupgrade");const s=t?.seoName||e;this.isMarketingPageRequiringAdSuppression(s)?APP.suppressDisplayAds=!0:APP.suppressDisplayAds=this.shouldSuppressAdsF
1orUserTier(),"hoopla"!==APP.currentView?.seoName&&"premium"!==APP.currentView?.seoName||"hoopla"===e||($("#hoopla, #offers-landing-base, #upgrade").remove(),$("body").removeClass("hoopla"));var a,n=APP.slackerPlayerSession();if(t&&t.e&&"click"===t.e.type&&(delete t.e,BEACON.tagEvent({name:"tile-click",params:{value:t.type,label:t.title,location:t.reportingId,type:t.type,item_title:t.title,item_url:t.seoName||t.link}}),CONSOLE.debug("APP.goToPage:: Tagged click event for navigation")),!APP.canNavigate())return CONSOLE.warn("APP.goToPage:: Navigation currently disallowed",{networkStatus:this.appImplementationModule.networkStatus,isNavigating:APP._isNavigating()}),this.appImplementationModule.networkStatus||this.NETWORKING.EVENTS.notify(this.NETWORKING.EVENT.CONNECTION.GONE,[this.NETWORKING.EVENT.CONNECTION.GONE,arguments]),void(APP._isNavigating()&&this.checkAcessibilityTTSAction("Loading icon is present",null,!1));if(APP.currentView&&APP.currentView.seoName){if(t&&t.seoName&&APP.currentView.seoName===e&&APP.currentView.seoName!==t.seoName)CONSOLE.warn("APP.goToPage:: SEO name conflict detected",{currentSeoName:APP.currentView.seoName,requestedName:e,paramsSeoName:t.seoName});else if(APP.currentView.seoName===e||APP.currentView.seoName===(t?t.seoName:void 0)){let i=!1;if(t&&t._links&&t._links.nav){const e=APP.currentView?.historyData?.link,s=t._links.nav.href;e!==s&&(CONSOLE.info("APP.goToPage:: Different navigation link detected",{current:e,new:s}),i=!0)}if(!i)return CONSOLE.warn("APP.goToPage:: Already on requested view - checking refresh conditions",{viewType:APP.currentView.type,seoName:APP.currentView.seoName,currentParams:APP.currentView.historyData,newParams:t,hasPaging:!!APP.currentView.pagingData,pagingData:APP.currentView.pagingData?APP.currentView.pagingData():null}),window.scrollTo(0,0),void("tesla"===e&&(t?.upgraded&&APP.currentView.HISTORY.tesla.staticData.setUpgraded(t.upgraded),t?.nonCred&&APP.currentView.HISTORY.tesla.staticData.setNonCred(t.nonCred),t?.prevUpgrade&&APP.currentView.HISTORY.tesla.staticData.setPrevUpgrade(t.prevUpgrade),t?.prevLink&&APP.currentView.HISTORY.tesla.staticData.setPrevLink(t.prevLink),t?.variant&&APP.currentView.HISTORY.tesla.staticData.setVariant(t.variant),t?.finalPrice&&APP.currentView.HISTORY.tesla.staticData.setFinalPrice(t.finalPrice)))}}else CONSOLE.info("APP.goToPage:: No current view or invalid view state - proceeding with navigation");if(APP.purchaseQueue&&(APP.purchaseQueue.active||APP.purchaseQueue.awaitAccept))return CONSOLE.info("APP.goToPage:: Purchase queue active - prompting user"),void APP.MESSAGING.prompt("confirmPurchaseQueueExit",null,[{label:"STAY IN LINE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"confirmPurchaseQueueExit",label:"stay_in_line"}}),APP._setNavigating(!1),APP.MESSAGING.setModal()}},{label:"Yes, Leave",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"confirmPurchaseQueueExit",label:"yes_leave"}}),APP.MESSAGING.setModal(),APP.purchaseQueue.leaveQueue(!0),APP.MESSAGING.setTickler(),this.goToPage(e,t,!0)}.bind(this)}]);if(APP.currentView&&!i&&APP.currentView.isEditDirty())return CONSOLE.info("APP.goToPage:: Unsaved changes detected - prompting user"),APP._setNavigating(!1),void APP.MESSAGING.prompt("discardUnsavedChanges",null,[{label:"Cancel",styles:"std",action:null},{label:"Discard",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"discardUnsavedChanges",label:"discard"}}),APP.MESSAGING.setModal();try{APP.currentView&&"function"==typeof APP.currentView.discardEdits&&APP.currentView.discardEdits()}catch(e){CONSOLE.warn(["APP.goToPage:: discardEdits failed",e])}this.goToPage(e,t,!0)}.bind(this)}]);CONSOLE.info("APP.goToPage:: Processing navigation request",{name:e,params:t}),Q_STRING.get("page")&&Q_STRING.set("page",0),this.hamburgerIsOpen()&&$(".hamburger input").click(),this.checkAcessibilityTTSAction("Loading",null,!0),setTimeout((function(){APP._setNavigating(!0)}),10),n&&n.playerSize===APP.PLAYER_FULL&&n.setPlayerSize(APP.PLAYER_DEFAULT);
1try{if("home"===e)"string"==typeof this.viewsByDomName.HomeView&&(this.viewsByDomName.HomeView=require(this.viewsByDomName.HomeView),CONSOLE.debug("APP.goToPage:: Loaded HomeView component")),a=new this.viewsByDomName.HomeView;else if(this.views[e]){if(!(!this.views[e].action||this.views[e].link&&this.views[e].link.actionOverride))return CONSOLE.debug("APP.goToPage:: Executing view action",{name:e}),void this.views[e]._onClick(null,null,t);t&&t.seoName&&0===t.seoName.indexOf("the-daily")&&(e="blog",t._links.nav||(t._links.nav={href:APP.SERVICE.URLMODULE.SERVICE.DATA.BLOG}),CONSOLE.debug("APP.goToPage:: Redirecting to blog view")),"string"==typeof this.views[e]&&(this.views[e]=require(this.views[e]),CONSOLE.debug("APP.goToPage:: Loaded view component",{name:e})),a=new this.views[e](t)}else{CONSOLE.debug("APP.goToPage:: Creating StaticView",{name:e}),a=new(require("com.slacker.app.view.StaticView"))(e,t)}}catch(i){return void CONSOLE.error("APP.goToPage:: Error initializing view",{error:i,name:e,params:t})}this.queuedLoadTitle(a.title),!a.hideTvGlobalNav||"tv"!==APP.implementationSuperType()||t&&t.isPageNav||(APP.history.unshift(APP.currentView),CONSOLE.debug("APP.goToPage:: Updated TV navigation history"));try{a.init(),CONSOLE.info("APP.goToPage:: Successfully initialized new view",{name:a.name,type:a.type,title:a.title})}catch(e){CONSOLE.error("APP.goToPage:: Error initializing new view",{error:e,viewObj:a})}},onBurgerNavChange:function(){const e=$("body"),t=$(window).scrollTop(),i=$(".burger-nav-container.hamburger-open")[0],s=$(".header-nav-bar.upsell .upsell").height()||0;i&&(APP.cleanMainNav(i[0]),e.hasClass("scrolling")?e.find(".capUnit.topmost").each(((e,a)=>{const n=$(a),o=[250,90,50];n.hasClass("empty")?i.style.top=`${0+s}px`:o.forEach((e=>{n.hasClass("h"+e)&&(i.style.top=t<e?`${e+s}px`:`${0+s}px`)}))})):e.hasClass("sad-free")?i.style.top="0px":e.find(".capUnit.topmost").each(((e,a)=>{const n=$(a),o=[250,90,50];n.hasClass("empty")?i.style.top=`${0+s}px`:o.forEach((e=>{n.hasClass("h"+e)&&(i.style.top=`${e-t+s}px`)}))})))},cleanMainNav:function(e,t){const i=APP.USER.navBarMenuItem()[0];APP.mainNav().forEach((e=>{e&&e!==t&&!e.collapsed()&&(e._onSubNavToggle(),e.closedByClick=!1)})),APP.burgerNav().forEach((e=>{e&&e!==t&&!e.collapsed()&&e._onSubNavToggle()})),i&&i!==t&&!i.collapsed()&&(i._onSubNavToggle(),i.closedByClick=!1)},halifyLinks:function(e,t,i){let s={};return i||(i={}),e&&e.filter((e=>!i[e.rel])).forEach((e=>{t?t[e.rel]=e:s[e.rel]=e})),s},onTileClick:function(e){CONSOLE.warn(["APP:: Handling tile click",e.contentUrl,e.mimeType]),APP.appImplementationModule.onBeforeHeroVideoStart?APP.appImplementationModule.onBeforeHeroVideoStart(e):APP.herostreamaction.playStream($("#hero-player #hero-video-container")[0],e)},onPurchaseTicketsClick:function(e,t,i=""){const s=APP.USER.slackerUser().policy?APP.USER.slackerUser().policy.capabilities.features:null,n=APP.SERVICE.URLMODULE.get(APP.SERVICE.URLMODULE.SLACKER_ROOTS.ACCOUNT);let o="boolean"==typeof t&&t,r=!1,l=e.eventUrl||e.storeUrl;if(APP.purchaseQueue&&APP.purchaseQueue.active)APP.purchaseQueue.queryPlace();else if((e.offerCode||e.userHasTicket)&&(r=s&&s[e.offerCode]&&s[e.offerCode].enabled,!r&&e.userHasTicket&&e.userHasTicket()&&(CONSOLE.warn(['User has a ticket for access to event permission, but not "this" ticket.',e.offerCode,e.rights.permissions.ondemand]),r=!0)),!e.offerCode||e.eventUrl||e.isSpotlight)if(o||r||!e.offerCode){if(l)if(l.match(/live(xlive|one)\.com/)&&-1==l.indexOf("shop."))if(0==l.indexOf(n)){let e=[`${l}&token=${window.encodeParamsForSlackerService(APP.USER.getCompactSlackerUser())}`];i&&!Q_STRING.get("source")&&e.push(`&source=client_web_${encodeURIComponent(i)}`),APP.USER.doSlackerLogin(e.join(""))}else APP.goToEventByUrl(l);else window.open(l)}else{if(!(a.isSafari()||APP.purchaseQueue&&!APP.purchaseQueue.noneShallPass))return void APP.enterEcomPurchaseQueue(e,i);APP.onRequestUpgrade("ticket",i,{offerCode:e.offerCode}),APP.purchaseQueue&&APP.purchaseQueue.leaveQueue()}else{CONSOLE.warn(["Item has offer code, but no eventUrl. Attempting resolution...."]),require("com.slacker.app.actions.slacker.CheckOfferCodeAction");let s=new com.slacker.app.actions.slacker.CheckOfferCodeAction(((a,n)=>{if(n&&n.events){let s=Object.assign({},e);s.eventUrl=n.events[0].eventUrl,APP.onPurchaseTicketsClick(s,t,i)}else s.error()?APP.MESSAGING.prompt("modalError",{reason:s.error()}):APP.MESSAGING.prompt("itemNotAvailable")}));s.execute(e.offerCode)}},enterEcomPurchaseQueue:function(e,t){const i=require("com.slacker.app.actions.slacker.user.PurchaseQueueAction");APP.purchaseQueue?(APP.purchaseQueue.reset(e,APP.currentView,t),APP.purchaseQueue.execute()):new i(e,APP.currentView,t).execute()},checkPaywallVideo:function(e,t,i=(()=>{}),s){let a,n,o="LiveOne ";const r="function"==typeof e.isPaywallVideo?e.isPaywallVideo():null;if(r)try{if(!APP.requireSlackerServicesOld(i))return;if(n=APP.USER.slackerUser().policy?APP.USER.slackerUser().policy.
1capabilities.features:null,!n)return setTimeout(i,500),!1;const l=n[r];if(!l?.enabled){const i=l&&l.products[0],n=APP.getPaywallUpgradeActionFromFeature(r,"get access",{},!1,e);let c=null;if(t||s)return CONSOLE.warn(["AppModule::checkPaywallVideo","User lacks permissions to play video. No prompt check.",r,e.seoName]),t&&i&&"register"==i.type;if(CONSOLE.warn(["AppModule::checkPaywallVideo","User lacks permissions to play video.",r,e.seoName]),"register"==i?.type)c="tv"==APP.implementationSuperType()?"registrationRequiredVideo_TV":"registrationRequiredVideo";else if(l?(c="ticketing"==i.type?"purchaseEventTicket":"subscriptionRequiredVideo",o="plus"!=i.ecomKey?`${i.shortName} `:""):(CONSOLE.warn(["Paywall access request for feature that is unavailable: ",r]),c="itemNotAvailable"),"ticketing"==i?.type&&"itemNotAvailable"!=c&&"tv"!=APP.implementationSuperType()){if(n)return n(),!1;CONSOLE.warn(["Paywall access request for ticket that is unavailable: ",r]),c="itemNotAvailable"}return c&&(a=Object.assign({},APP.MESSAGING.messages[c]),APP.currentPaywallItemTrigger=e.data||e,APP.MESSAGING.prompt(a,{"sub-tier-copy":o,feature:r})),!1}}catch(e){CONSOLE.error(["AppModule::checkPaywallVideo","Failed to read video rights. Assume user is allowed."],e)}return!0},getPaywallUpgradeActionFromFeature(e,t,i={},s,a){const n=APP.USER.slackerUser();
1if(e&&n&&n.policy&&n.policy.capabilities){const o=n.policy.capabilities.features[e]?n.policy.capabilities.features[e].products[0]:null;if(o&&o.offerCode&&(i.offerCode=o.offerCode),o)return s?o:function(){if(a&&"ticketing"==a.paywallBadgeType()){if(a.subTypes.includes("recorded")){if(o.offerCode)a.offerCode=o.offerCode;else if(!(a.storeUrl||APP.currentView&&APP.currentView.seoName==a.seoName))return void APP.onTileClick(a);APP.MESSAGING.setModal(),APP.onPurchaseTicketsClick(a,null,t)}else if(a.sections)a.hasTicketSection&&(a.sections.changeTab(a.hasTicketSection),setTimeout((()=>{$(".tab-item.active").animate({opacity:.5},200).animate({opacity:1},200).animate({opacity:.5},200).animate({opacity:1},200)}),100),APP.scrollItemIntoView(".tabs-container"));else if(a.isSpotlight){let e=a.shareUrl;!e&&a.seoName&&(e=`.com/${a.seoName}`),APP.goToEventByUrl(e)}}else APP.MESSAGING.setModal(),APP.onRequestUpgrade(this.ecomKey,t,i)}.bind(o)}return null},onPlaySlackerRadioItem:function(e,t){APP.initializeVideoAd().then((()=>{const i=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");if(slackerUser=APP.USER.slackerUser(),features=slackerUser.policy?slackerUser.policy.capabilities.features:null,radioPlayerSession=APP.slackerPlayerSession(),jqTarget=t&&t.target?$(t.target):null,APP._mobileSafariPlayHackery(),APP.supportsSlacker&&-1==i.bookmarkCount)i.execute("init",(function(){APP.onPlaySlackerRadioItem(e,t)}));else{if(CONSOLE.warn(["APP::onPlaySlackerRadioItem Handling Slacker detail item play request",e.sectionReportingId,e.slackerUrl]),e.isPlaying?.())return radioPlayerSession.radioPlayerStateManager().playPause(),void("tv"==APP.implementationSuperType()&&(radioPlayerSession.setPlayerSize(radioPlayerSession.PLAYER_FULL),setTimeout((()=>APP.appImplementationModule._handleRemoteBackButton(!1,!0)),100)));if((APP.supportsSlacker||e.podcastId)&&e.nodeType){if(e.basicRadio&&!e.basicradio&&(e.basicradio=e.basicRadio),!e.basicradio&&!e.olicensed)return void(t&&t.target&&!$(t.target).hasClass("playable")||APP.MESSAGING.prompt("itemNotPlayable",null,null,null,{contentType:e.nodeType,missingRights:"basicradio,olicensed",accountTier:parseInt(APP.USER.slackerUser().tier)}));if("artist"==e.nodeType&&!e.basicradio)return void APP.MESSAGING.prompt("stationNotPlayable",null,null,null,{contentType:e.nodeType,missingRights:"basicradio",accountTier:parseInt(APP.USER.slackerUser().tier)});if("podcast"==e.nodeType)BEACON.tagEvent({name:"playStart",params:{type:"podcast",value:e.link,label:e.sectionReportingId,station:e.link}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting podcast",e.link]),radioPlayerSession.startPodcast(e.id,e);else if("podcastEpisode"==e.nodeType)BEACON.tagEvent({name:"playStart",params:{type:"podcastEpisode",value:e.link,label:e.sectionReportingId,station:e.link}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting podcast episode",e.link]),radioPlayerSession.startPodcast(e.id,null,e);else if("audiobook"==e.nodeType)BEACON.tagEvent({name:"playStart",params:{type:"audiobook",value:e.link,label:e.sectionReportingId,station:e.link}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting audiobook",e.link]),radioPlayerSession.startAudiobook(e.id,e);else if("station"!=e.nodeType&&"foreign"!=e.nodeType&&"artistMix"!=e.nodeType||!e.sid)if(features.ondemand.enabled&&"playlist"==e.nodeType)BEACON.tagEvent({name:"playStart",params:{type:"playlist",value:e.id,label:e.sectionReportingId,station:e.id}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting playlist",e.id]),radioPlayerSession.startPlaylist(e.id);else if(features.ondemand.enabled&&"album"==e.nodeType&&e.olicensed>0)BEACON.tagEvent({name:"playStart",params:{type:"album",value:e.link,label:e.sectionReportingId,station:e.link}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting album",e.id]),radioPlayerSession.startPlaylist("albumplaylists/"+e.id);else if(features.ondemand.enabled&&e.olicensed>0&&("song"==e.nodeType||"track"==e.nodeType))if(BEACON.tagEvent({name:"playStart",params:{type:"song",value:e.link,label:e.sectionReportingId,station:e.link}}),e.playlistid){CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting playlist from track position",e.playlistid,e.rootIndex]);const t=APP.currentView.playlistDef&&APP.currentView.playlistDef.playlistid==e.playlistid?APP.currentView.playlistDef:null;radioPlayerSession.startPlaylist(e.playlistid,t,null,!1,e.rootIndex)}else e.trackNumber&&e.album?(CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting album from track position",e.id,e.playIndex]),radioPlayerSession.startPlaylist("albumplaylists/"+e.album.id,null,null,!1,e.playIndex)):(CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting song",e.id]),radioPlayerSession.startPlaylist(e.id.toString(),{id:e.id.toString(),name:e.title||e.name,songs:{song:[Object.assign({},e)]}},null,e.basicradio>0||e.basicRadio>0));else{let t,i,s="artist"!=e.nodeType&&APP.supportsPlatformUpgrade;if(jqTarget?.hasClass("restricted")&&("song"!=e.nodeType&&"track"!=e.nodeType&&"album"!=e.nodeType||(s=APP.supportsPlatformUpgrade,e.olicensed=1)),"track"===e.n
1odeType?e.song&&e.song.length?(t={id:e.song[0].id,"perf-id":e.performanceId},i="perf:"+e.performanceId):e.performanceId&&(t={"perf-id":e.performanceId},i="perf:"+e.performanceId):(t={id:e.id},i=e.id),BEACON.tagEvent({name:"playStart",params:{type:e.nodeType,value:e.nodeType+"-station-"+i,label:e.sectionReportingId,station:e.nodeType+"-station-"+i}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting station",e.nodeType,e.id]),s&&!features.ondemand.enabled&&e.olicensed>0&&e.basicradio>0)APP.MESSAGING.prompt("on-demand-radio-upgrade",{title:e.name||e.title||e.reportingtitle,feature:"ondemand"});else if(!features.ondemand.enabled&&!e.basicradio)return void APP.MESSAGING.prompt("itemNotPlayable",null,null,null,{contentType:e.nodeType,missingRights:"basicradio",accountTier:parseInt(APP.USER.slackerUser().tier)});radioPlayerSession.startRadioStationFromId(e.nodeType,t,e.name||e.title||e.reportingtitle,s)}else["/undefined/","/1/"].forEach((t=>{e.sid.indexOf(t)>-1&&(e.sid=e.id=e.sid.replace(t,"/"+slackerUser.id+"/"))})),BEACON.tagEvent({name:"playStart",params:{type:"station",value:e.link||e.sid,label:e.sectionReportingId,station:e.link||e.sid}}),CONSOLE.warn(["APP::onPlaySlackerRadioItem - starting station",e.sid]),radioPlayerSession.startRadioStation(e.sid,null,null,e.leadoffdata)}else APP.supportsSlacker&&APP.usesSlackerServices?(BEACON.tagEvent({name:"playStart",params:{type:"station",value:e.slackerUrl,label:"listen",station:e.slackerUrl}}),e.slackerUrl.indexOf("?")>-1&&(e.slackerUrl=e.slackerUrl.split("?")[0]),radioPlayerSession.resolveSlackerSeoUrl(e.slackerUrl,((e,t)=>
1{let i=t.sid?t.sid:t.station?t.station.id:null;i?radioPlayerSession.startRadioStation(i):t.type&&(i=t[`${t.type}Id`],radioPlayerSession.startRadioStationFromId(t.type,{id:i},t[`${t.type}Name`]))}))):APP.MESSAGING.prompt("geofence")}}))},toggleHeroPlayerFloat:function(){const e=$("body"),t=this.heroEmbedData();APP.animationFrame.call(window,(()=>{(APP.herostreamaction.isVideoPlayerActive()||t)&&(e.toggleClass("hero-player-floating"),e.hasClass("hero-player-floating")?(e.removeClass("hero-embed"),APP.EVENTS.notify(APP.EVENT.VIEWOBSCURED,[APP.currentView,!1]),BEACON.tagEvent({name:"videoPlayerSize",params:{value:"min",label:"state"}})):(APP.MESSAGING.closeContextMenu(),e.addClass("hero-embed"),t&&window.embedPlayer.herostreamaction.videoplayer.unmute(),APP.EVENTS.notify(APP.EVENT.VIEWOBSCURED,[APP.currentView,!0]),BEACON.tagEvent({name:"videoPlayerSize",params:{value:"max",label:"state"}})))}))},acceptTosFooter:function(){this.mustShowTosFooter(!1),APP.SERVICE.cache("tosfooter",this.TOS_FOOTER_VERSION)},notifyPostMessageListeners:function(e){const t=this.heroEmbedData()&&$("#hero-embed-player iframe");for(let t in APP.postMessageListeners){CONSOLE.debug("Notifying postMessage origin - "+t);try{APP.postMessageListeners[t].postMessage(e,t)}catch(e){CONSOLE.error("Error notifying postMessage subscriber ",e)}}if(t&&t[0]&&(CONSOLE.debug("Notifying event player"),t[0].contentWindow.postMessage(e,origin)),"undefined"!=typeof SlackerAndroid)try{SlackerAndroid.status(e)}catch(e){CONSOLE.error("Error notifying postMessage subscriber ",e)}},showHeroPlayerScheduleOverlay:function(e,t){const i=$("#hero-player");APP.appImplementationModule.festivalSchedule.displayTimer&&(clearTimeout(APP.appImplementationModule.festivalSchedule.displayTimer),APP.appImplementationModule.festivalSchedule.displayTimer=0),e?i.addClass("hover"):t?i.removeClass("hover"):i.toggleClass("hover"),i.hasClass("hover")&&(APP.appImplementationModule.festivalSchedule.displayTimer=setTimeout((function(){i.hasClass("hover")&&i.toggleClass("hover")}),4e3))},requireSlackerServicesOld:function(e,t){const i=APP.SERVICE.isCached("slackerUser"),s=APP.slackerPlayerSession();return APP.SERVICE.urls.SLACKER.API.REGISTRATION?APP.USER.slackerUser().token?(s||(APP.slackerPlayerSession(require("com.slacker.app.modules.SlackerPlayerSessionModule")),APP.slackerPlayerSession().init()),t&&e&&e(),!0):(APP.noHomeOnUserLogin=!0,CONSOLE.warn("Requiring Slacker AUTH...loading User"),APP.USER.slackerUser().id||i?APP.USER.slackerUser().error?(CONSOLE.warn("Requiring Slacker AUTH...Slacker user in error state. Cancel requireSlackerServices request."),t&&e&&e()):setTimeout((()=>this.requireSlackerServicesOld(e,!0)),500):(APP.usesSlackerServices=!0,setTimeout((()=>{APP.USER.slackerUser().id?e&&e():APP.USER.doSlackerAnon((()=>this.requireSlackerServicesOld(e,!0)))}),750)),!1):(this.slackerServiceDiscoveryAttemptCounter>10?(this.slackerServiceDiscoveryAttemptCounter=0,APP.USER._onUserAuthError("Unable to reach Slacker API services","error",{statusCode:()=>500})):(APP.usesSlackerServices=!0,APP.SERVICE.isDiscoveringSlacker?(this.slackerServiceDiscoveryAttemptCounter++,CONSOLE.warn(`APP:requireSlackerServices - LOADING API - Attempt ${this.slackerServiceDiscoveryAttemptCounter}`),setTimeout((()=>{this.requireSlackerServicesOld(e,!0)}),1e3)):(CONSOLE.warn(`APP:requireSlackerServices - WAITING for API - Attempt ${this.slackerServiceDiscoveryAttemptCounter}`),setTimeout((()=>{APP.SERVICE.discoverSlackerAPI((()=>this.requireSlackerServicesOld(e,!0)))}),1e3))),!1)},requireSlackerServicesPromise:function(e,t){const i=APP.SERVICE.isCached("slackerUser"),s=APP.slackerPlayerSession();console.log("requireSlackerServicesPromise"),console.log("callback",e);const a=(e,t)=>{if(!(e=>!!APP.USER.slackerUser().token&&(e(),!0))(e)){APP.noHomeOnUserLogin=!0,CONSOLE.warn("Requiring Slacker AUTH...loading User");if(!APP.USER.slackerUser().id&&!i){APP.usesSlackerServices=!0;let i=setTimeout((()=>{APP.USER.slackerUser().id?(clearTimeout(i),e()):APP.USER.doSlackerAnon((()=>a(e,t)))}),750)}else APP.USER.slackerUser().error?(CONSOLE.warn("Requiring Slacker AUTH...Slacker user in error state. Cancel requireSlackerServices request."),t()):setTimeout((()=>a(e,t)),500)}};return console.log("AppModule.requireSlackerServicesPromise.requireAll() discoverSlackerAPI call"),APP.SERVICE.discoverSlackerAPI().then((()=>(APP.usesSlackerServices=!0,new Promise(((e,t)=>{a(e,t)})).then((()=>{s||(APP.slackerPlayerSession(require("com.slacker.app.modules.SlackerPlayerSessionModule")),APP.slackerPlayerSession().init()),t&&e()})).catch((()=>{t&&e()})))))},closeEmbedHeroPlayer:function(){const e=$("body"),t=arguments.length>0,i=APP.currentView;let s=this.heroEmbedData(),a=e.hasClass("hero-player-floating"),n=APP.SERVICE.isCached("videoStates")?JSON.parse(APP.SERVICE.isCached("videoStates")):{};if(s){if("eventId"==s.itemParam)try{delete n.live}catch(e){}finally{APP.SERVICE.cache("videoStates",JSON.stringify(n))}e.removeClass("hero-embed"),BEACON.tagEvent({name:"videoPlayerSize",params:{value:"closed",label:a?"floating":"full"}});try{window.embedPlayer.onUnload.bind(window.embedPlayer)()}catch(e){CONSOLE.warn("Shut down of embedded hero player was not clean - ",e)}setTimeout((()=>{this.heroEmbedData(null),window.embedPlayer=null,i&&(i._doCapitalisticThings(!0),t&&i?.doCheckOnStatusChange?.(),a||APP.EVENTS.notify(APP.EVENT.VIEWOBSCURED,[i,!1])),s=null}),1e3)}},getKeyDownHandler:function(e,t,i=[13,32]){return function(s,a){if("Tab"===a.key)return!0;return i.find((function(e){return e===a.which}))?(a.preventDefault(),a.stopPropagation(),e?e(s,a):t(!t()),!1):void 0}},scrollItemIntoView:function(e){$([document.documentElement,document.body]).animate({scrollTop:$(e).offset().top-80},500)},getTabIndexByName:function(e,t=0){return({"hero-embed-player":0,contextmenu:1,header:1,search:10,hero:20,upgrade:20,videoplayer:20,radioplayer:20,mylibrary:30,footer:1e4}[e]||0)+t},getSectionTabIndex:function(e=0,t=0){return 100*(1+e)+t},handleOptionsFocusTrap:function(e,t){const i=APP.shiftDown?$(t.target.parentElement.previousElementSibling).find("[tabindex]"):$(t.target).next(".options");!APP.shiftDown&&i.css("display","block"),i.focus()},_addGlobalKeyboardListeners:function(){document.addEventListener("keydown",(e=>{"Shift"===e.key&&(this.shiftDown=!0)})),document.addEventListener("keyup",(e=>{"Shift"===e.key&&(this.shiftDown=!1)}))},_mobileSafariPlayHackery:function(e){const t=this.slackerPlayerSession();e||a.isMobileDevice()&&a.isSafari()?(CONSOLE.info("Safari or forced to do mobile HTML5 play hackery..."),t.radioPlayer.player?t.radioPlayer.player.src()||(t.radioPlayer.player.src({src:IMG_CDN_AND_BUILD+"/helper/1sec.mp3",type:"application/vnd.apple.mpegurl"}),t.radioPlayer.player.play()):t.radioPlayer.embed($("#radio-player")[0],{URL:IMG_CDN_AND_BUILD+"/helper/1sec.mp3",disableVideoAds:!0})):CONSOLE.debug("Not Safari or not not forced to do mobile HTML5 play hackery")},_setNavigating:function(e){e?$("body").addClass("navigating"):$("body").removeClass("navigating")},_isNavigating:function(){return $("body").hasClass("navigating")},goLive:function(e,t){const i=require("com.slacker.app.modules.RemoteSessionModule");e||0!=APP.USER.slackerUser().actualTier?(APP.closeEmbedHeroPlayer(),new i(e,(e=>{e?.currentSession?(this.remoteSession(e),e.__viewRoomIfNeeded()):e.startNewRemoteSession(t,null,null,(e=>{this.remoteSession(e)}))}))):APP.MESSAGING.prompt("account-required")},getFormattedHtmlFromString:function(e,t){let i,s,a,n,o,r=null,l=!1,c=!1,d=[],u=null,h=null,p=[];if(e&&"object"==typeof e&&e.msg){if(n=e.msg,n=e.msg,e.links&&e.links.length>0)u=e.links;else if(e.links&&"object"==typeof e.links){u=[];let t={};for(let i in e.links)t[i]=e.links[i],u.push(t)}}else n=e&&"string"==typeof e?e:"";t||(t=function(e,t,i){switch(e){case"em":return"strong";case"link":return t?'a href="'+i+'"':"a"}});const m=function(e){if(e){if("object"==typeof e&&e.action&&(e=e.action),e.indexOf("/my-music")>-1)return'javascript:void(0);APP.goToPage("profile")';if(e.indexOf("slacker:")>-1){const n=$.deparam(e.substr(e.indexOf("?")+1));if(e.indexOf("nav?")>-1&&(n.page||n.data&&n.data.page&&n.data.type)){var t=n.data&&n.data.page?n.data.page:n.page,i=n.data&&n.data.type?n.data.type:n.type,s=n.data&&n.data.bp?n.data.bp:n.bp;if(t&&"upgrade"===t){var a={};return s&&(a.bp=s),`javascript:void(0);window.popUpgradeModal('offer', 'page', '${i}',${JSON.stringify(a).replace(/\"/g,"'")})" data-bind="function(){window.popUpgradeModal('offer', 'page', '${i}',${JSON.stringify(a).replace(/\"/g,"'")})}`}}}}else CONSOLE.error("No URL?")};if(n)for(i=n.length,s=0;s<i;s++)if(o=null,"{"==n.charAt(s))l=!0,r="",s++;else if(l)if(" "==n.charAt(s)||":"==n.charAt(s))if(l=!1,":"==n.charAt(s)){for(p=[],s++;" "!=n.charAt(s);)p.push(n.charAt(s)),s++;h=p.join("")}else d.push(n.charAt(s));else r+=n.charAt(s);else if(null===r||c)c&&"}"==n.charAt(s)?(d.push("</"+t(r)+">"),r=null,c=!1):d.push(n.charAt(s));else{if(c=!0,h){if("link"===r)for(u||(CONSOLE.error("Missing links array"),u=[]),a=0;a<u.length;a++){try{for(let e in u[a])e==h&&(o=m(u[a][e]))}catch(e){}!o&&u[a].action&&(o=m(u[a].action))}else CONSOLE.error("Unhandled _deco type: "+r);h=null}d.push("<"+t(r,!0,o)+">"),d.push(n.charAt(s))}return d.join("")},onImplementationConstructed:function(e){CONSOLE.info(["App Implementation Type constructed",e.type]),void 0===e.supportsPlaybackSpeedOption&&(e.supportsPlaybackSpeedOption=!1),this.appImplementationModule=e,this.SERVICE=i.init(this,e),void 0===e.networkStatus&&(e.networkStatus=!0),this.checkAcessibilityTTSAction=e.checkAcessibilityTTSAction?e.checkAcessibilityTTSAction.bind(e):()=>{},this.checkAcessibilityTTSAction("Loading LiveOne"),APP.mustShowTosFooter()&&APP.mustShowTosFooter(APP.SERVICE.isCached("tosfooter")!==this.TOS_FOOTER_VERSION),$("body").addClass(e.type).addClass(APP.implementationSuperType()),Q_STRING.get("token")&&"unsubscribe"!=Q_STRING.get("action")&&APP.NETWORKING.setRefreshToken(Q_STRING.get("token")),Q_STRING.get("userToken")&&this.mobileUserToken(Q_STRING.get("userToken")),Q_STRING.get("accountId")&&this.mobileUserId(Q_STRING.get("accountId")),APP.isFromMobileApp("mobile"===Q_STRING.get("referrer")),APP.supportsNFTs=Q_STRING.get("nfts"),this.USER.init(this.EVENTS),this.USER.evt_listener.attachEvent(this.USER.EVENT.USERLOGIN,((e,t)=>{d.execute((e=>{this.USER.simpleSettings=e}))}))},onAppLoaded:function(e,t){if(this.isAppLoaded)return;this.isAppLoaded=!0;new Date;const i=this,s=(this.viewNames.length,Q_STRING.get("action")),a=$("body");let n,o="";
1n=this.appImplementationModule.init(),n&&(o=n.type),this.frameworkInclude?$("#site-framework").load(`${this.frameworkInclude}?loaded=${o}`,(function(){const e=APP.SERVICE.isCached("videoStates");e&&JSON.parse(e);if($(".server-generated").remove(),APP.suppressDisplayAds&&a.removeClass("sad-normal").addClass("sad-free"),Q_STRING.get("embed")&&a.addClass("embed"),Q_STRING.get("feature")&&APP.featureFlag(Q_STRING.get("feature")),s&&"activate"==s)n&&n.active(!1),"string"==typeof APP.viewsByDomName.StaticView&&(APP.viewsByDomName.StaticView=require(APP.viewsByDomName.StaticView)),n=new APP.viewsByDomName.StaticView("activate",{});else if(Q_STRING.get("eventUrl"))try{n=APP.goToEventByUrl(Q_STRING.get("eventUrl"),!0)}catch(e){CONSOLE.error(["Failed to return view object for eventUrl",Q_STRING.get("eventUrl")],e)}else"true"===Q_STRING.get("forceLogout")&&APP.USER.logout();t?i.onActiveVew(null,!1):n?n.init():i.onActiveVew(null,!1)})):($(".server-generated").remove(),APP.suppressDisplayAds&&a.removeClass("sad-normal").addClass("sad-free"),Q_STRING.get("embed")&&a.addClass("embed"),t?i.onActiveVew(null,!1):n&&n.init())},onRequestUpgrade:function(e,t,i){if("false"!=APP.USER.slackerUser().audioAllowed||"plus"!=e&&"premium"!=e){const s=APP.USER.getCompactSlackerUser(),a=["source","utm_campaign","utm_source","utm_medium","utm_content"];let n=i||{},o="upgrade",r=!!n.forceNav,l=s.level>0?APP.SERVICE.urls.SLACKER.LOGIN:APP.SERVICE.urls.SLACKER.CREATEACCOUNT;n.forceNav&&delete n.forceNav,APP.sessionBounty&&(n.bp=APP.sessionBounty),APP.USER.slackerUser().hooplaUser&&(n.isHoopla="true"),n["nag-name"]=encodeURIComponent(t);try{n.source||(n.source=encodeURIComponent(APP.currentView.historyData.params["upgrade-source"]||t))}catch(e){n.source=encodeURIComponent(t)}n.source="client_web_"+n.source,n.entryPage=e||"",n.return="lxl",n.token=window.encodeParamsForSlackerService(s),["nag-name","source"].forEach((e=>{"undefined"===n[e]&&delete n[e]})),a.forEach((e=>{Q_STRING.get(e)&&n.hasOwnProperty(e)&&delete n[e]}));let c=`${l}?done=${o}&${$.param(n)}`;APP.USER.doSlackerLogin(c,null,r)}else APP.MESSAGING.prompt("geofence")},onRequestStudentOffer:function(e=!0){APP.USER.doSlackerSettings({getStudentOffer:!0,forceNav:e})},initializeVideoAd:function(){return o.initializeVideoAd()},pauseCurrentPlayback:function(){console.log("pauseCurrentPlayback: Attempting to pause current playback.");try{const e=APP.slackerPlayerSession&&APP.slackerPlayerSession();if(e&&e.radioPlayer&&e.radioPlayer.player&&"function"==typeof e.radioPlayer.player.pause)return e.radioPlayer.player.pause(),void console.log("pauseCurrentPlayback: Playback paused successfully using radioPlayer.player.pause()");if(APP.radioPlayerStateManager&&"function"==typeof APP.radioPlayerStateManager.pause)return APP.radioPlayerStateManager.pause(),void console.log("pauseCurrentPlayback: Playback paused using fallback APP.radioPlayerStateManager.pause()");console.warn("pauseCurrentPlayback: Unable to pause current playback. No valid player found.")}catch(e){console.error("pauseCurrentPlayback: Error while attempting to pause:",e)}},resumeRegularPlayback:function(){try{if(com.slacker.sads.SAds._hardBlockActive){try{APP.MESSAGING?.prompt?.("audioAdBlocked")}catch(e){}return}}catch(e){}console.log("resumeRegularPlayback: Attempting to resume regular playback.");try{const e=APP.slackerPlayerSession&&APP.slackerPlayerSession();if(e&&e.radioPlayer&&e.radioPlayer.player&&"function"==typeof e.radioPlayer.player.play)return e.radioPlayer.player.play(),void console.log("resumeRegularPlayback: Playback resumed successfully using radioPlayer.player.play()");if(APP.radioPlayerStateManager&&"function"==typeof APP.radioPlayerStateManager.resume)return APP.radioPlayerStateManager.resume(),void console.log("resumeRegularPlayback: Playback resumed using fallback APP.radioPlayerStateManager.resume()");console.warn("resumeRegularPlayback: Unable to resume regular playback. No valid player found.")}catch(e){console.error("resumeRegularPlayback: Error while attempting to resume:",e)}},onActiveVew:function(e,t){const i=$("body"),s=new Date,o=this.USER.slackerUser();if(CONSOLE.info(["APP::onActiveView",e?e.title:null,"bIsHistory",t]),this.currentView?.active()&&APP.currentView.active(!1),APP.currentView=e,e){e.active(!0);const t=e?.seoName||e?.historyData?.seoName;t&&this.isMarketingPageRequiringAdSuppression(t)?APP.suppressDisplayAds=!0:APP.suppressDisplayAds=this.shouldSuppressAdsF
1orUserTier(),e?.historyData?.params?.bountyPartner&&(APP.sessionBounty=e.historyData.params.bountyPartner),APP.refreshNoUpsell()}if(i.hasClass("loading")&&(i.removeClass("loading"),i.addClass("loaded")),e&&("HomeView"==e.type?APP.activeTab("HomeView"):APP.activeTab(e.link)),appInitTime){if(BEACON.tagEvent({name:"loadingComplete",params:{page:e?e.seoName:"/",t:s.getTime()-appInitTime}}),appInitTime=null,o?.contest){(new(require("com.slacker.app.actions.slacker.user.SubmitContestEntryAction"))).execute(o.contest.replace(/\W/g,""))}Q_STRING.get("session")||APP.SERVICE.isCached("remoteSession")?this.goLive(Q_STRING.get("session")||APP.SERVICE.isCached("remoteSession")):"website"!=APP.appImplementationModule.type||a.isTV()||n.shouldShowShowAdBlockNag()||"tv"==APP.implementationSuperType()||h||i.hasClass("hero-embed")||a.isMobileDevice()||e?.disableFloatingPlayerOnInit||APP.disableFloatingPlayerOnInit||!e||setTimeout((()=>{e.onEventWatchNow({seoName:"live-events/festival/livexlive-tv",floating:!0,label:"LiveOne TV"},null,!1,!0)}),1e3)}const r=setTimeout((()=>{this.initTabMgmt(),clearTimeout(r)}),1e3);e?.afterRender&&setTimeout(e.afterRender.bind(e),1e3),e||APP?.goToPage("home"),setTimeout((()=>APP._setNavigating(!1)),10),APP.queuedLoadTitle(null)},initTabMgmt:function(){console.log("AppModule :: initTabMgmt");$(".tile-container").each((function(){const e=$(this),t=e.closest(".scroll-container");if(!t.length)return;const i=t.offset();if(!i)return;if(t[0].scrollWidth<=t[0].clientWidth+1)return void e.removeAttr("inert");const s=t.innerWidth(),a=i.left,n=e.offset().left-a,o=e.outerWidth();n<0||n>s-o+5?e.attr("inert",""):e.removeAttr("inert")}))},onFailedVew:function(e,t,i){const s=$("body");s.hasClass("loading")&&(s.addClass("loaded"),s.removeClass("loading")),setTimeout((function(){APP._setNavigating(!1)}),10),APP.cleanMainNav(),APP.queuedLoadTitle(null),this.MESSAGING.prompt("modalErrorViewFailed",{reason:i?" ("+i.statusCode().status+")":""})},onPostMessageReceived:function(e){APP.appImplementationModule&&APP.appImplementationModule.onPostMessageReceived&&APP.appImplementationModule.onPostMessageReceived(e)},doEmailContact:function(e){location.href="mailto:"+e},onForceUpdate:function(){APP.MESSAGING.prompt("siteForceUpdate")},onUserEvent:function(e,t){const i=$("body");switch(CONSOLE.debug(["APP.onUserEvent::",e,t]),APP.refreshNoUpsell(),e){case APP.USER.EVENT.USERLOGIN:APP.USER.slackerUser();APP.adMode(n.getAdMode(APP.USER.user())),i.addClass(APP.adModeClass());const e=APP.currentView?.seoName||APP.currentView?.historyData?.seoName;APP.isMarketingPageRequiringAdSuppression(e)?(APP.suppressDisplayAds=!0,CONSOLE.debug("AppModule :: Maintaining ad suppression for marketing page: "+e)):APP.appImplementationModule.displayAdOverride?(APP.suppressDisplayAds=APP.appImplementationModule.displayAdOverride(),CONSOLE.debug("AppModule :: Using displayAdOverride for suppressDisplayAds: "+APP.suppressDisplayAds)):APP.USER.slackerUser()&&APP.USER.slackerUser().policy&&APP.USER.slackerUser().policy.capabilities&&APP.USER.slackerUser().policy.capabilities.features&&APP.USER.slackerUser().policy.capabilities.features.ad_free?(APP.suppressDisplayAds=APP.USER.slackerUser().policy.capabilities.features.ad_free.enabled,CONSOLE.debug("AppModule :: Policy data complete, setting suppressDisplayAds: "+APP.suppressDisplayAds)):APP.USER.getUserPolicyPromise().then((()=>{APP.onUserEvent(APP.USER.EVENT.USERLOGIN,t)})),APP.suppressDisplayAds?(i.removeClass("sad-normal").addClass("sad-free"),$(".capUnit.topmost").addClass("empty"),$(".header-nav-bar, .burger-nav-container, .capUnit").removeClass("h50 h90 h250"),console.log("APP.suppressDisplayAds :: H50 H90 H250 REMOVED")):i.removeClass("sad-free").addClass("sad-normal"),t&&t().isAppLoaded&&(this.EVENTS.notify(this.EVENT.APPLOADED),delete t().isAppLoaded);break;case APP.USER.EVENT.USERLOGOUT:APP.adMode(n.getAdMode(APP.USER.user())),i.addClass(APP.adModeClass()),APP.suppressDisplayAds=APP.shouldSuppressAdsForUserTier(),APP.suppressDisplayAds?(i.removeClass("sad-normal").addClass("sad-free"),$(".capUnit.topmost").addClass("empty")):i.removeClass("sad-free").addClass("sad-normal"),APP.notifyPostMessageListeners('{"status":"logout"}')}},onNetworkConnectionEvent:function(e,t){switch(e){case this.NETWORKING.EVENT.CONNECTION.LOST:setTimeout((function(){APP._setNavigating(!1)}),10),this.MESSAGING.prompt("ticklerErrorFree",{reason:"Your internet connection appears to be unstable and video playback might experience issues."});break;case this.NETWORKING.EVENT.CONNECTION.GONE:setTimeout((function(){APP._setNavigating(!1)}),10),this.MESSAGING.prompt("ticklerErrorFree",{reason:"We can't connect to the internet. Please check your connection and try again."})}},getBasePath:function(){const e=window.location.pathname.split("/").filter((e=>!!e));return e.length?e[0]:""}
1,_onHeroStreamActionEvent:function(e){CONSOLE.debug("APP._onHeroStreamActionEvent::"+e.type);const t=this.herostreamaction.videoplayer.EVENT;switch(e.type){case t.VIDEOCONTAINERREADY:$("body").addClass("hero-video");break;case t.ONFULLSCREENCHANGE:e.player.isFullscreen()?$("#hero-player").addClass("fullscreen"):$("#hero-player").removeClass("fullscreen");break;case t.ONFULLSCREENTOGGLE:APP.onVideoFullScreenRequest(e.player);break;case t.PLAYBACK.STARTED:APP.currentView&&(APP.currentView.heroPlayer=APP.herostreamaction.videoplayer),BEACON.tagEvent({name:"video",params:{value:"start",label:e.video.objectId||e.video.festivalId}});break;case t.PLAYBACK.COMPLETED:$("body").removeClass("hero-video").removeClass("hero-player-floating"),APP.currentView&&(APP.currentView.heroPlayer=null),e.isError||BEACON.tagEvent({name:"video",params:{value:e.player?"complete":"end",label:e.video.objectId||e.video.festivalId}});break;case t.DISPLAYERROR:!e.error&&e.player&&(e.error=e.player.error_),e.error||(e.error={message:"Unknown player error"}),BEACON.tagEvent({name:"video",params:{value:"error",label:e.video.objectId||e.video.festivalId}});case t.PLAYBACK.ERROR:}},_doTTS:function(e,t,i,s){if(APP._isNavigating()&&(CONSOLE.log("_doTTS override, currently loading"),i=!0,e="Loading icon is present"),(e||i)&&(u?.speaking&&(i||!t&&!u.forceFinish)&&(u.cancel(),this.phrasesToSpeak=[]),e&&("string"==typeof e?e=[{text:e,forceFinish:s}]:e.forEach((e=>{e={text:e,forceFinish:s}})),this.phrasesToSpeak=this.phrasesToSpeak.concat(e))),u){if(this.phrasesToSpeak.length){const e=this.phrasesToSpeak.shift(),t=new SpeechSynthesisUtterance(e.text);t.onend=function(){CONSOLE.debug(["AppModule::_doTTS - Utterance.onend","phrasesToSpeak.length",APP.phrasesToSpeak.length]),APP.phrasesToSpeak.length>0&&APP._doTTS(),this.forceFinish&&(u.forceFinish=!1)}.bind(t),e.forceFinish&&(t.forceFinish=!0,u.forceFinish=!0),u.speak(t)}}else this.phrasesToSpeak=[]},_createKOCustomBindings:function(){const e=e=>{let t={};return t.days=parseInt(e/864e5),t.days>0&&(e-=864e5*t.days),t.days<10&&(t.days="0"+t.days),t.hours=parseInt(e/36e5),t.hours>0&&(e-=36e5*t.hours),t.hours<10&&(t.hours="0"+t.hours),t.mins=parseInt(e/6e4),t.mins>0&&(e-=6e4*t.mins),t.mins<10&&(t.mins="0"+t.mins),t.secs=parseInt(e/1e3),t.secs<10&&(t.secs="0"+t.secs),t};ko.bindingHandlers.countdownclock={init:function(t,i,s,a){const n=ko.unwrap(i()),o=n-(new Date).getTime(),r=a;APP.currentView&&!r.viewPointer&&(r.viewPointer=APP.currentView),parsed=e(o),r._clock?clearInterval(a._clock.timer):r._clock={timer:0,days:ko.observable(0),hours:ko.observable(0),minutes:ko.observable(0),seconds:ko.observable(0),longdate:ko.observable(null),countdownProgress:ko.observable(0)},r._clock.countUntil=n,r._clock.days(parsed.days),r._clock.hours(parsed.hours),r._clock.minutes(parsed.mins),r._clock.seconds(parsed.secs),r._clock.longdate(dateFormat(n,"mmmm dd, hh:MM:sstt Z"))},update:function(t,i,s,a){if(a._clock.timer&&clearInterval(a._clock.timer),a._clock.countUntil=ko.unwrap(i()),"number"==typeof a._clock.countUntil){const t=function(e,t){let i=0,s=this._clock.countdownProgress?this._clock.countdownProgress():0;if(this.countdownStartTime){i=1-(t/1e3/((this._clock.countUntil-this.countdownStartTime())/1e3)).toFixed(2)}this._clock.days(e.days),this._clock.hours(e.hours),this._clock.minutes(e.mins),this._clock.seconds(e.secs),s!=i&&this._clock.countdownProgress(i)};a._clock.timer=setInterval(function(){const s=this._clock.countUntil-(new Date).getTime();t.apply(this,[e(s),s]),s<1e3?(clearInterval(this._clock.timer),i()(0)):!this.isCounting||this.isCounting()||isNaN(parsed.secs)||this.isCounting(!0)}.bind(a),1e3)}}}},_preloadImages:function(e){e.forEach((e=>{var t=new Image;t.src=e,this.preloadedImageRefs.push(t)}))},onDisposeView:function(){},onVideoFullScreenRequest:function(e){},_onSpotlightNavDotFocus:function(e,t){},_onTileFocus:function(e,t){},_onItemDetailActionFocus:function(e,t){},_onTileBlur:function(e,t){},_onHeaderNavFocus:function(e,t){},_onTabFocus:function(){},_onHeroRelatedFocus:function(e,t,i){},_onMultiStageTileRender:function(e,t){}},registerPackage("com.slacker.app.modules.AppModule"),com.slacker.app.modules.AppModule=new p}()})),bjork("com.slacker.app.modules.ArtistPickerModule",(function(){!function(){const e=require("com.slacker.app.view.MixerSectionedPageView"),t=require("com.slacker.app.view.SlackerItemDetailVie
1w"),i=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction"),s=require("com.slacker.app.actions.slacker.user.ArtistPickerSelectionsAction"),a=require("com.slacker.app.actions.slacker.radio.GetSearchResultsAction"),n=require("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction"),o=require("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree");function r(){extendClass(this,new e("ArtistPickerModule")),this.__constants(),this.__properties(),this.__constructor()}r.prototype={__constants:function(e){this.INIT_BOX_VAL="Search",this.getArtistDetails=new n},__properties:function(e){this.lazyImageScope="",this.box=null,this.lastQuickQuery=null,this.currentRequest=null,this.relatedArtistsRequest=null,this.minSelectionsRequired=3,this.isEmptyProfile=ko.observable(!1),this.queryType=ko.observable(null),this.query=ko.observable(this.INIT_BOX_VAL),this.selectedArtists=ko.observableArray([]),this.personalizedMessages=ko.observable(!1),this.isSearching=ko.observable(!1)},__constructor:function(e={}){this.data([]),this.domContainerId=""},init:function(e){this.lazyImageScope=e,this.showLoader(!0),-1!=i.bookmarkCount?this.getData():i.execute("init",(t=>{this.init(e)}))},getData:function(){this.isFetchingData?CONSOLE.warn(["Data fetch already in progress. Ingnore redundant request"]):(this.isFetchingData=!0,APP.SERVICE.fetch({source:"APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.COLDSTART",callback:this._onData.bind(this)}))},getSearchData:function(e,t){const i=this.data()[0],s=i.activeTab(),n=i.filter((e=>e.id==s.id))[0];APP.checkAcessibilityTTSAction(`Searching: ${e}`),$(`${this.domContainerId} .tabs-container`).hide(),n.content([]),this.isSearching(!0),a.execute(e,t,this._onSearchData.bind(this),{"search-for":"artist","include-filter":"data"})},capitalism:function(e,t){},getRelatedArtists:function(e,i){CONSOLE.info(["ArtistPickerModule::getRelatedArtists","Data: ",e," section: ",i]);const s=new t({seoName:"tmp"}).__constructSectionItem.bind(this),a=this.selectedArtists(),n=i.content().map((e=>e().objectId)),o=a.map((e=>e.objectId)),r=n.concat(o);this?.relatedArtistsRequest?.abort(),this.relatedArtistsRequest=this.getArtistDetails.execute(e,((t,a,n)=>{if(!this.relatedArtistsRequest)return;if(t?.relatedArtists){let a=0;for(_i=0,_len=t.relatedArtists.length;a<4&&_i<_len;){let n=t.relatedArtists[_i],o=`artist:${n.artistId}`;if(!r.includes(o)){n.subTypes=["artist"],n.objectId=o;let t=s(n,i)();t.editable=!0,t.uiItemId=n.objectId.replace(":","-"),t.sectionReportingId="related",t.related=e.objectId,i.content.splice(e.sectionItemIndex+1,0,ko.observable(t)),a++}_i++}i.content().forEach(((e,t)=>e().sectionItemIndex=t))}setTimeout((e=>{this._doLazyImageLoading(!0,this.lazyImageScope),this._markSelectedArtists()}),500),this.relatedArtistsRequest=null}))},_markSelectedArtists:function(){$(`${this.lazyImageScope} .tile-container.selected`).removeClass("selected"),this.selectedArtists().forEac
1h((e=>{$(`${this.lazyImageScope} #tile-${e.objectId.replace(":","-")}`).addClass("selected")})),this._doLazyImageLoading(!0,this.lazyImageScope)},initSearchBox:function(){let e=!1;if(arguments.length>0&&"boolean"==typeof arguments[0]&&(e=arguments[0]),(e||this.box&&this.box.val()==this.INIT_BOX_VAL)&&(e||this.box.val("")),this.box&&this.box.hasClass("init")){let e=this.box.val();e&&(this.lastQuickQuery=e),this._onBoxInit(this.box),this.box.removeClass("init")}return!0},onUserSubmit:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"artistPicker",label:"LETS GO"}}),this.showLoader(!0),this._lastSubmittedCount=this.selectedArtists().length,this.selectionAction.execute(this.selectedArtists().map((e=>e.objectId)))},onNotNow:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"artistPicker",label:"NOT NOW"}}),APP.MESSAGING.setModal(void 0,null,!0),"mylibrary"!==APP.activeTab()&&APP.goHome()},onSelectionsAction:function(e,t,s){const a=APP.currentView;if("error"!=e){if("POST"==s.method){if(this.personalizedMessages(!0),"MylibraryView"!==a.type)return APP.MESSAGING.setModal(null,null,!0),void APP.goHome();const e=a.sections.bookmarkedartists,t=(e&&Array.isArray(e.data)?e.data.length:(e?.content?.()||[]).length)+(this._lastSubmittedCount||0),s=[0,500,1e3,2e3,4e3,8e3,12e3];let n=0,r=!1,l=null;const c=()=>{if(!r){r=!0,APP._setNavigating(!1),l&&(clearTimeout(l),l=null),APP.MESSAGING.setModal(null,null,!0);try{i.execute("init")}catch(e){}}},d=()=>{r||o.execute((i=>{if(r)return;const a=i?.myTree?.Category,o=(Array.isArray(a)?a:a?[a]:[]).find((e=>"bookmarkedartists"===e?.sid));if(o?.Station){const t=Array.isArray(o.Station)?o.Station:[o.Station];t.forEach((e=>{e.type&&(e.id=e.type.split(":")[1],e.nodeType=e.type="artist")})),t.sort(((e,t)=>e.name<t.name?-1:1)),e.data=t,e.maxRowCount=t.length,e.currentPage=0,e._doPagination("init"),t.length>0&&("tv"!=APP.implementationSuperType()&&e.visibleDescription('<div class="artist-picker-btn-container"><button class="std explore" onclick="APP.MESSAGING.prompt(\'artistPicker\',null, null, {})">ADD MORE ARTISTS</button></div>'),e.classNames=e.classNames.replace(/empty/g,"").replace(/\s+/g," ").trim(),$(`#${e.id}`).removeClass("empty"))}(e&&Array.isArray(e.data)?e.data.length:0)>=t?c():(n++,n>=s.length?c():setTimeout((()=>{r||d()}),s[n]))}),!0)};return l=setTimeout(c,3e4),APP._setNavigating(!0),void setTimeout((()=>{r||d()}),s[0])}this._markSelectedArtists(),t?.selections?.length>0?this.minSelectionsRequired=1:this.isEmptyProfile(!0)}this.showLoader(!1),setTimeout((e=>{this.box=$(`${this.lazyImageScope} input#query`)}),200)},onSelectArtist:function(e,t){CONSOLE.info(["ArtistPickerModule::onSelectArtist","Data: ",e," section: ",t]);const i=$(this.lazyImageScope),s=this.selectedArtists(),a=t.content().map((e=>e().objectId)),n=s.map((e=>e.objectId)),o=(a.concat(n),{objectId:e.objectId,imgPath:e.imgPath,name:e.name});if("related"!=e.sectionReportingId&&i.find("section.related").remove(),n.includes(o.objectId)){for(let t in s)if(s[t].objectId==e.objectId){this.selectedArtists.splice(t,1);break}}else this.selectedArtists.push(o);setTimeout((e=>{this._doLazyImageLoading(!0,this.lazyImageScope),this._markSelectedArtists()}),500)},onWindowScroll:function(){this._doLazyImageLoading(!0,this.lazyImageScope)},_onData:function(e,t,i){if(CONSOLE.info(["ArtistPickerModule::_onData",this.viewName,"status",t]),"error"===t)this.setFailed(null,i);else{if(e.links){let t=APP.halifyLinks(e.links);this.selectionAction=new s(t.selections.href,this.onSelectionsAction.bind(this))}if(this.parseResponse(e)){const e=this,t=this.data(),i=[];t.forEach((e=>{e.content();e.classNames=e.classNames.replace("genre","editable"),e.sectionData.editable={type:"picker",rename:!1,playType:"STATION",sid:"",title:"",remove:null,addToStation:null,addToPlaylist:null,redescription:null},e.dataPreview.forEach((e=>{let t=e();t.editable=!0,t.uiItemId=t.objectId.replace(":","-")})),e.content(e.dataPreview),i.push({title:e.title,id:e.id,sectionName:e.title,classNames:e.classNames}),e.title=null})),t.activeTab=ko.observable({id:-1}),t.tabs=ko.observableArray(i),t.changeTab=function(t){t.id!=this.activeTab().id&&(this.forEach((e=>e.hasAds=!1)),this.activeTab(t),setTimeout((()=>{e._markSelectedArtists(),e._doLazyImageLoading(!0,e.lazyImageScope)}),500))}.bind(t),this.data([t]),t.changeTab(i[0]),this.selectionAction.execute()}}this.isFetchingData=!1},_onSearchData:function(e,i,s){if(CONSOLE.info(["SearchView::_onData","
1status",i]),"abort"!=i){if("error"===i);else if(e?.results?.artists?.length){const i=new t({seoName:"tmp"}).__constructSectionItem.bind(this),s=this.data()[0],a=s.activeTab(),n=s.filter((e=>e.id==a.id))[0];let o=e.results.artists.map((e=>{e.type="artist",e.objectId=`artist:${e.id}`,e.subTypes=["artist"];let t=i(e,n);return t().editable=!0,t().uiItemId=e.objectId.replace(":","-"),t}));this.box[0].focus(),n.hasMore(!1),n.content(o),setTimeout((()=>{this._markSelectedArtists(),this._doLazyImageLoading(!0,this.lazyImageScope)}),500)}this.isSearching(!1),this.isFetchingData=!1}},_onBoxInit:function(e){e.on("keyup",(function(e){13==e.which&&e.preventDefault()})),this.searchCompleteTrack=ko.computed((()=>{const e=this.query().trim(),t=this.data()[0],i=t.activeTab(),s=t.filter((e=>e.id==i.id))[0];this.box&&(e&&e!=this.INIT_BOX_VAL&&e!=this.lastQuickQuery?(CONSOLE.debug("Run quick search with "+e),this.lastQuickQuery=e,APP.checkAcessibilityTTSAction(`Searching: ${e}`),this.getSearchData(e,"quick")):e||($(`${this.domContainerId} .tabs-container`).show(),s.content(s.dataPreview),setTimeout((()=>{this._markSelectedArtists(),this._doLazyImageLoading(!0,this.lazyImageScope)}),500)))})).extend({rateLimit:200})}},registerPackage("com.slacker.app.modules.ArtistPickerModule"),com.slacker.app.modules.ArtistPickerModule=r}()})),bjork("com.slacker.app.modules.BrazeModule",(function(){!function(){const e=require("com.slacker.util.Console");var t={dev:{key:"43a1ab45-9322-4bb1-92c0-ff839335bade",endpoint:"sdk.iad-01.braze.com"},stg:{key:"726ede30-b418-4aa8-8b5f-6fa1eccba8cd",endpoint:"sdk.iad-01.braze.com"},pubstg:{key:"726ede30-b418-4aa8-8b5f-6fa1eccba8cd",endpoint:"sdk.iad-01.braze.com"},prd:{key:"a45bf78b-5852-4c0f-9373-aa1fcaa11684",endpoint:"sdk.iad-01.braze.com"}};function i(){this.__constants(),this.__properties(),this.__constructor()}i.prototype={__constants:function(){},__properties:function(){this._active=!1,this._initialized=!1,this._initAttempted=!1,this._queue=[],this._lxlInit=!1},__constructor:function(){},init:function(){var i=t[APP_ENV];i?(this._active=!0,this._loadSDK(i)):e.log("info","Braze - No config for env: "+APP_ENV)},isActive:function(){return this._active},onUserLogin:function(){if(this._ensureInit(),this._active&&(!APP||!APP.implementationSuperType||"tv"!=APP.implementationSuperType())){var t=this,i=0,s=function(){var a=APP.USER.slackerUser();if(!a||!a.id||!a.policy||void 0===a.actualTier)return++i>=10?void e.log("warn","Braze - User not ready after 10 attempts, giving up"):void setTimeout(s,500);t._whenReady((function(){window.braze.changeUser(a.id),window.braze.getUser()?e.log("info",["Braze - User is set",a.id]):e.log("warn","Braze - Braze user is NULL!"),t._lxlInit||(t._lxlInit=!0,window.braze.setLogger((function(t){e.log("debug",t)})),window.braze.subscribeToInAppMessage(t._handleInAppMessage.bind(t)),e.log("warn","Braze - IAM ready.")),window.braze.openSession(),e.log("warn","Braze - Session opened.")}))};s()}},onLogout:function(){if(this._ensureInit(),this._active){var i=t[APP_ENV];this._lxlInit=!1,this._whenReady((function(){e.log("info","Braze - Cleaning up for return to anon"),window.braze.enableSDK(),window.braze.initialize(i.key,{baseUrl:i.endpoint})}))}},logEvent:function(e){this._ensureInit(),this._active&&this._whenReady((function(){window.braze.logCustomEvent(e)}))},disableTracking:function(){this._ensureInit(),void 0!==window.braze&&window.braze.disableSDK()},_ensureInit:function(){this._initAttempted||(this._initAttempted=!0,this.init())},_loadSDK:function(t){var i=this,s=document.createElement("script");s.type="text/javascript",s.async=!0,s.src="https://js.appboycdn.com/web-sdk/6.6/braze.min.js",s.onload=function(){window.braze.initialize(t.key,{baseUrl:t.endpoint,enableLogging:"prd"!==APP_ENV}),i._initialized=!0;var s=window.braze.version||window.braze.SDK_VERSION||"6.6";e.log("warn","Braze - init complete, SDK v"+s);for(var a=0;a<i._queue.length;a++)i._queue[a]();i._queue=[]},s.onerror=function(){e.log("warn","Braze - Failed to load SDK from CDN"),i._active=!1},document.head.appendChild(s)},_whenReady:function(e){this._initialized?e():this._queue.push(e)},_handleInAppMessage:function(e){var t=this;APP&&APP.isAppLoaded?(e.buttons&&e.buttons.length&&e.buttons.forEach((function(e){e.subscribeToClickedEvent(function(){if(this.uri){var e=this.uri.split("//")[1].split("?"),i=e[1]?$.deparam(e[1]):{},s=e[0];i.seoName=this.uri,"true"==i.play?s="play":"play"!=s&&(s="nav"),t._handleAction(s,i)}}.bind(e))})),window.braze.showInAppMessage(e)):setTimeout((function(){t._handleInAppMessage(e)}),1e3)},_handleAction:function(e,t){var i=this;if(APP&&APP.isAppLoaded){var s=APP.USER.slackerUser(),a=t.sid||t.id,n=t.aid,o=t.alid,r={};switch(a&&a.toString().indexOf("prog:")>-1?a="stations/1/"+a.split(":")[1]:a&&-1==a.toString().indexOf("stations")&&(a="stations/1/"+a),e){case"play":r=a?{nodeType:"station",basicradio:1,sid:a}:n?{nodeType:"artist",basicradio:1,id:n}:o?{nodeType:"album",basicradio:1,id:o}:{basicradio:1,slackerUrl:t.seoName},APP.onPlaySlackerRadioItem(r);break;case"nav":switch(t.page){case"newsletter-opt-in":var l="https://store."+("prd"==APP_ENV?"":APP_ENV+".sd")+"livexlive.com/acctmgmt/api/user/"+s.id+"?state=null";0==s.actualTier?APP.USER.doForceSlackerCreate(null,"braze",{receiveNewsLetter:!0}):APP.NETWORKING.do(l,(function(e,t,i){e&&e.response&&"OK"==e.response.status?APP.MESSAGING.prompt("newsletterOptInConfirm"):APP.MESSAGING.prompt("modalErrorFree",{reason:i.status})}),"PUT","json",JSON.stringify({wstoken:s.token,continueOnError:!0,receiveNewsletter:!0}));break;case"upgrade":var c={};for(var d in t)"page"!=d&&"type"!=d&&(c[d]=t[d]);APP.onRequestUpgrade(t.type,"braze",c);break;case"register":APP.USER.doForceSlackerCreate(null,"braze");break;case"search":APP.goToPage("search",{query:t.query});break;default:if(r=a?{type:"station",id:a}:n?{type:"artist",id:n}:o?{type:"album",id:o}:null)APP.goToPage("slackeritemdetail",r);else if(t.seoName.indexOf("live-events")>-1)APP.appImplementationModule.onTileClick({type:"festival",objectId:"event-"+t.seoName.split("//")[1].split("/")[2]});else if(t.seoName.indexOf("video")>-1)APP.appImplementationModule.onTileClick({type:"video",objectId:"video-"+t.seoName.split("//")[1].split("/")[2]});else{(new(require("com.slacker.app.actions.slacker.ResolveSlackerSeoUrlAction"))).execute(t.seoName,(function(e,t){t.sid?t.id=t.sid.split("/")[2]:t.albumId?t.id=t.albumId:t.songId?t.id=t.songId:t.artistId?t.id=t.artistId:t.episodeId&&t.podcastId?t.id=t.episodeId:t.podcastId&&(t.id=t.podcastId),APP.goToPage("slackeritemdetail",t)}))}}}}else setTimeout((function(){i._handleAction(e,t)}),1e3)}};var s=new i;registerPackage("com.slacker.app.modules.BrazeModule"),com.slacker.app.modules.BrazeModule=s}()})),bjork("com.slacker.app.modules.ConfigurationModule",(function(){!function(){require("com.slacker.util.browser.Browser");function e(){this.__constants(),this.__properties(),this.__constructor()}e.prototype={__constants:function(){},__properties:function(){const e=`8.${APP_VERSION}`;this.appEnv=APP_ENV,this.client="livexlivesite",this.xscid=`00_livexlivesite_en_${APP_VERSION}`,this.deviceId=null,this.dfpSite=`/72597942/${this.appEnv}/web/livexlive/site`,this.partner="livexlive",this.androidPackage="com.slacker.purple",this.androidIntentPrefix=null,this.mobileLaunchPrefix=null,this.beaconConfig={initTime:(new Date).getTime(),enableGA:!0,
1comscore:"27647105",client:"livexlivesite",slackerIgnore:{events:["menu/click","video","maestro","getApp","optin","optout","userInteract","removeUser","video_start","video_progress","video_complete","radio_start","radio_progress","radio_complete"]},gaConfig:{ua:"",pageview:!1,events:"*"}},this.appStoreUrls={android:{phone:`https://play.google.com/store/apps/details?id=${this.androidPackage}`,tablet:null},iOS:{phone:null,tablet:null,watch:null}},this.slackerConfig={client:`webplayer_en_${e}_lxl`,oauthClient:"slackersite",xscid:`00_webplayer_en_${e}_site:slacker,partner:lxl`,site:"LIVEXLIVE",simpleSettingsDevice:"webplayer",stationtree:"SLACKER",adpartner:"slacker",tokenClientId:45,K:"06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003606503003206203003606203003503803003303603003503503003603203003303903003403903003403503003703903003403903003303303003603603003503403003406402203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07407202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",OAUTH_K:"06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003503703003703103003303303003406403003403703003706103003606503003503303003503603003603303003606403003406403003703503003403203003303403003603703003403403003706103003303703003406102203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07407202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",mediaTypes:{cast:"audio/mp3",html5:"audio/mp3",html5Ie:"audio/mp3,audio/m4a;container=hds;v=2,audio/m4a;container=hds;v=1","html5+":"audio/mp3,audio/m4a;container=hls;v=2,audio/m4a;container=hls;v=1",html5Safari:"audio/m4a;container=hls;v=2,audio/m4a;container=hls;v=1",html5EDGE:"audio/m4a;container=hls;v=2,audio/m4a;container=hls;v=1",default:"audio/mp3"}},this.ecomUserAgent=["##","webplayer","carrier","osversion","webplayer","en",e,"SLK000"].join("_")},__constructor:function(){}},registerPackage("com.slacker.app.modules.ConfigurationModule"),e.prototype.__constants(),com.slacker.app.modules.ConfigurationModule=e}()})),bjork("com.slacker.app.modules.Ecom",(function(){!function(){function e(){}e.prototype={getNewNonce:async function(e){const t=`https://store.${this._getEnvSubdomain()}liveone.com/store/rest/pops/offer/${e}/nonce`,i=await fetch(t,{credentials:"include"}),s=await i.blob();return await s.text()},getActiveSubscription:async function(e){const t=await this.getNewNonce(e),i=`https://store.${this._getEnvSubdomain()}liveone.com/store/rest/pops/accounts/${e}/activeSubscription?nonce=${t}`,s=await fetch(i,{credentials:"include"}),a=await s.blob(),n=await a.text(),o=JSON.parse(n);return console.log("getActiveSubscription data:",o),o},getOffers:async function(e){const t=await this.getNewNonce(e),i=`https://store.${this._getEnvSubdomain()}liveone.com/store/rest/pops/offer/${e}`,s=APP.USER.slackerUser().level,a="SLK000",n={accountId:e.toString(),includeBraintree:!0,client:"webplayer",did:a,nonce:t,site:"slacker",source:"",userAgent:`##_webplayer_carrier_osversion_webplayer_en_${APP_VERSION}_${a}`,level:s},o=await fetch(i,{method:"POST",credentials:"include",body:JSON.stringify(n),headers:{"Content-Type":"application/json; charset=ISO-8859-1","x-user-agent":n.userAgent}}),r=await o.blob(),l=await r.text(),c=JSON.parse(l);return console.log("getOffers data: ",c),c},_getEnvSubdomain:function(){return["dev","stg","pubstg"].includes(APP_ENV)?`${APP_ENV}.sd`:""}},registerPackage("com.slacker.app.modules.Ecom"),com.slacker.app.modules.Ecom=new e}()})),bjork("com.slacker.app.modules.MessagingModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.util.browser.Browser"),i=require("com.slacker.app.actions.MenuAction"),s=require("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction"),a=require("com.slacker.app.actions.slacker.user.UpdateUserProfileAction"),n=require("com.slacker.app.components.planCard.PlanCardData");function o(){this.__constants(),this.__properties(),this.__constructor()}o.prototype={__constants:function(){this.EVENTS=new e},__properties:function(){this.tickler=ko.observable({}),this.modal=ko.observable({}),this.contextMenu=ko.observableArray(),this.bindingContext=null,this.loading=ko.observable(!1),this.ticklerTimer=0,this.modalTimer=0,this.isVideoJsOptionsOpen=!1,this.isUnwindingExternalServiceHistory=!1,this._onResizeCloseContextMenu=()=>{this.closeContextMenu()},this.getAyslPrompt=(e,t=(APP.USER.user().isAnon?"anon":"default"))=>{const i={anon:{title:"Are You Still Listening?",msg:"tv"==APP.implementationSuperType()?"Just checking in to make sure you're still listening. Sign in to your account to reduce these interruptions.":"Just checking in to make sure you're still listening. You can reduce these interruptions by creating a free LiveOne account.",actions:[]},default:{title:"Are You Still Listening?",msg:"Just checking in to make sure you're still listening. Click the button to let us know you're here.",actions:[]}};let s=JSON.parse(JSON.stringify(i[t]));if(APP.USER.user().isAnon){const t="tv"==APP.implementationSuperType()?"Sign In":"Create Account";s.actions.push({label:t,styles:"std",action:()=>{const t=APP.slackerPlayerSession();APP.USER.resetAysl(),APP.MESSAGING.setModal(),"tv"==APP.implementationSuperType()?(e&&e(),APP.history.unshift(APP.currentView),APP.goToPage("activate")):(t.currentPlayableItem().stop("IdleUser",null,!0),APP.USER.doForceSlackerCreate(null,"aysl"))}})}
1const a="anon"==t?"Maybe Later":"Keep Listening";s.actions.push({label:a,styles:"anon"==t?"std secondary":"std",action:()=>{APP.USER.resetAysl(),APP.MESSAGING.setModal(),e&&e()}}),this.prompt(s)},this.isFlyout=ko.computed(function(){const e=this.modal();return"slacker-external-service-prompt"===e?.msg&&APP.USER.externalWindowSrc&&-1!==APP.USER.externalWindowSrc.indexOf("entryPage=ticket")}.bind(this)),this.topNagBarMessages=[],this.messages={ticklerError:new o.messageObject({type:"tickler",timeout:7e3,title:"Attention:",severe:!0,msg:"An error occurred ({reason}). Please try again",actions:[{label:"OK",action:null}]}),ticklerFree:new o.messageObject({type:"tickler",timeout:3e3,title:"",severe:!1,msg:"{msg}",actions:[{label:"OK",action:null}]}),ticklerFreePersist:new o.messageObject({type:"tickler",title:"",severe:!1,msg:"{msg}",actions:[{label:"OK",action:null}]}),ticklerErrorFree:new o.messageObject({type:"tickler",timeout:7e3,title:"Attention:",severe:!1,msg:"{reason}",actions:[{label:"OK",action:null}]}),modalErrorFree:new o.messageObject({title:"Attention:",severe:!0,beaconId:"modalErrorFree",msg:"An error occurred ({reason}). Please try again later.",actions:[{label:"OK",styles:"std",action:null}]}),modalPageMessage:new o.messageObject({title:"Attention:",severe:!1,beaconId:"modalPageMessage",msg:"{reason}.",actions:[{label:"OK",styles:"std",action:null}]}),modalError:new o.messageObject({title:"Attention:",severe:!0,beaconId:"modalError",msg:"{reason}",actions:[{label:"OK",styles:"std",action:null}]}),closedCaptions:new o.messageObject({title:"Closed Captions",severe:!1,disableClose:!0,beaconId:"closedCaptions",msg:"{reason}",actions:[]}),modalErrorRdrLogin:new o.messageObject({title:"Oops",beaconId:"modalErrorRdrLogin",severe:!0,disableClose:!0,msg:"An error occurred with your request ({reason}.) Please check your link and try again.",actions:[{label:"OK",styles:"std",action:null}]}),modalErrorViewFailed:new o.messageObject({title:"Oops",beaconId:"modalErrorViewFailed",severe:!0,disableClose:!0,msg:"Well, that wasn't supposed to happen. Something went wrong trying to load the requested page{reason}.<br/><br/>If this keeps happening contact Customer Support.",actions:[{label:"OK",styles:"std",action:()=>{APP.MESSAGING.setModal(),APP.currentView.setActive(!0,!0)}}]}),appConfirmExit:new o.messageObject({title:"Are You Sure?",beaconId:"appConfirmExit",severe:!0,disableClose:!0,msg:"Are you sure you want to exit the app?"}),appForceUpdate:new o.messageObject({title:"UPDATE REQUIRED",beaconId:"appForceUpdate",severe:!0,disableClose:!0,msg:"To continue using LiveOne please download the latest version of the application."}),siteForceUpdate:new o.messageObject({title:"UPDATE REQUIRED",beaconId:"siteForceUpdate",severe:!0,disableClose:!0,msg:"To continue using LiveOne please refresh your browser."}),modalNote:new o.messageObject({title:"",beaconId:"modalNote",severe:!1,msg:'<h2>NOTE</h2><div class="bio">{msg}</div>'}),favsRadioDisabled:new o.messageObject({title:"My Favorites Radio",beaconId:"favsRadioDisabled",severe:!1,msg:'Once you\'ve "hearted" at least one song we\'ll use it to create a new station just for you. The more you "heart", the more this station will reflect your incredibly good taste.',actions:[{label:"OK",styles:"std",action:null}]}),newsletterOptInConfirm:new o.messageObject({title:"Nailed it!",severe:!1,beaconId:"newsletterOptInConfirm",disableClose:!0,msg:"You're now signed up! Keep an eye on your inbox for the latest LiveOne news and exclusive offers.",actions:[{label:"OK",styles:"std",action:null}]}),newsletterOptOutConfirm:new o.messageObject({title:"Aww...",severe:!1,beaconId:"newsletterOptOutConfirm",disableClose:!0,msg:"We're sad to see you go, but we get it. You can re-subscribe any time at www.liveone.com.",actions:[{label:"OK",styles:"std",action:null}]}),logoutConfirm:new o.messageObject({title:"Are You Sure?",beaconId:"logoutConfirm",severe:!1,disableClose:!0,msg:"You're about to log out of LiveOne. You'll need to sign in again to play your stations and playlists.",actions:[{label:"NO",styles:"std",action:null},{label:"YES",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"logoutConfirm",label:"yes"}}),APP.MESSAGING.setModal(),APP.USER.logout()}}]}),accountConflict:new o.messageObject({title:"Looks like you might have two accounts!",severe:!0,beaconId:"accountConflict",msg:"{reason}",actions:[{label:"OK",styles:"std",action:null}]}),accountConflictAnonDevice:new o.messageObject({title:"Looks like you may already have an account?",severe:!0,beaconId:"accountConflictAnonDevice",msg:"{reason}",actions:[{label:"OK",styles:"std",action:null}]}),removeUserConfirm:new o.messageObject({title:"This action is permanent!",beaconId:"removeUserConfirm",severe:!1,disableClose:!0,msg:"<strong>You will no longer be able to log in to this account.</strong><br/><br/>All personal information will be removed from LiveOne and you will be unsubscribed from any notifications. You may continue to use available LiveOne services as an anonymous user or create a new account.",actions:[{label:"Cancel",styles:"std",action:null},{label:"Continue",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"removeUserConfirm",label:"continue"}}),APP.MESSAGING.setModal(),APP.USER.user().removalAuth=APP.USER.user().hash(),APP.USER.doRemoveUser()}}]}),confirmPurchaseQueueExit:new o.messageObject({title:"You are in line",beaconId:"confirmPurchaseQueueExit",severe:!1,disableClose:!0,msg:"Are you sure you want to leave, and lose your place in line?",actions:null}),discardUnsavedChanges:new o.messageObject({title:"You have unsaved changes.",beaconId:"discardUnsavedChanges",severe:!1,disableClose:!0,msg:"Do you want to discard your unsaved changes and leave this page?",actions:null}),libraryDiscardUnsavedChanges:new o.messageObject({title:"You have unsaved changes.",beaconId:"libraryDiscardUnsavedChanges",severe:!1,disableClose:!0,msg:"Do you want to discard your unsaved changes{leavePage}?",actions:null}),apiLoadFail:new o.messageObject({title:"Unable To Load",beaconId:"apiLoadFail",severe:!0,disableClose:!0,msg:"We are unable to connect to the LiveOne service. Please check your connection and restart the application.",actions:[{label:"CLOSE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"apiLoadFail",label:"CLOSE"}}),APP.MESSAGING.setModal(),APP.appImplementationModule.closeApp&&APP.appImplementationModule.closeApp()}}]}),slackerApiLoadFail:new o.messageObject({title:"Unable To Load",beaconId:"slackerApiLoadFail",severe:!0,disableClose:!0,msg:"LiveOne Radio services are unavailable at this time. Please try again later.",actions:[{label:"CLOSE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"slackerApiLoadFail",label:"CLOSE"}}),APP.MESSAGING.setModal()}}]}),startVideoFromPreviousPosition:new o.messageObject({title:"Resume Watching?",beaconId:"startFromLastPosition",severe:!0,disableClose:!0,mustAnswer:!0,msg:"Would you like to resume this video from where you left off or start over from the beginning?",actions:[]}),"mobile-device-rotate":new o.messageObject({title:"Attention",beaconId:"mobile-device-rotate",severe:!1,disableClose:!0,msg:"Please rotate your device back to portrait orientation to view this page.<br/></br/>For the best experience, download the LiveOne App!",actions:[{label:"Get the App",styles:"std",action:function(){APP.downloadApps.getAppDownload(null,"mobile-device-rotate")}}]}),"share-embed":new o.messageObject({title:"Here's Your Code",beaconId:"share-embed",severe:!1,disableClose:!1,msg:'Copy and paste this code to your website or blog where you want this video to appear.<br/><br/><textarea style="width: 100%;min-height: 13em;">{code}</textarea>',actions:[]}),notFoundGeneric:new o.messageObject({title:"Not Found",beaconId:"notFoundGeneric",severe:!1,msg:"Well this is strange. We can't seem to find the page you are trying to reach. It may have been removed.",actions:[{label:"OK",styles:"std",action:null}]}),genericItemNotFound:new o.messageObject({title:"Not Found",beaconId:"genericItemNotFound",severe:!1,msg:"We would have sworn that {type} was right here. We can't find it, or maybe it's been deleted.",actions:[{label:"OK",styles:"std",action:null}]}
1),playbackError:new o.messageObject({title:"Playback Error",beaconId:"playbackError",severe:!1,msg:"We couldn't play this right now. The audio may be temporarily unavailable. Please try again later or pick something else.",actions:[{label:"OK",styles:"std",action:null}]}),favsRadioEmpty:new o.messageObject({title:"Favorites Radio",beaconId:"favsRadioEmpty",severe:!1,msg:"Like a song to enable Favorites Radio, or try again in a moment.",actions:[{label:"OK",styles:"std",action:null}]}),stationExhausted:new o.messageObject({title:"Sorry",beaconId:"stationExhausted",severe:!1,msg:"Due to a licensing restriction, this station has to stop playing. Please check out another station, and you can revisit this station later.",actions:[{label:"OK",styles:"std",action:null}]}),stationNotPlayable:new o.messageObject({title:"Sorry",beaconId:"stationNotPlayable",severe:!1,msg:"Due to licensing restrictions, a station based on this artist cannot be played. Please check out another station.",actions:[{label:"OK",styles:"std",action:null}]}),delayedCastStart:new o.messageObject({title:"Almost There",beaconId:"delayedCastStart",severe:!1,msg:"We need to wait for the next track to start your cast session.",actions:[{label:"OK",styles:"std",action:null}]}),itemNotPlayable:new o.messageObject({title:"Sorry",beaconId:"itemNotPlayable",severe:!1,msg:"Due to licensing restrictions, we can't play this for you.",actions:[{label:"OK",styles:"std",action:null}]}),playlistNotPlayable:new o.messageObject({title:"Sorry",beaconId:"playlistNotPlayable",severe:!0,msg:"Due to licensing restrictions, this playlist cannot play.",actions:[{label:"OK",styles:"std",action:null}]}),audioAdBlocked:new o.messageObject({title:"Please disable your ad blocker",beaconId:"audioAdBlocked",severe:!0,disableClose:!0,msg:"Your ad blocker is preventing audio ads from playing, which is how we keep LiveOne free. Please disable your ad blocker or upgrade to Plus to continue listening.",actions:[{label:"UPGRADE TO PLUS",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"audioAdBlocked",label:"upgrade"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","audioAdBlocked")}},{label:"RELOAD AFTER DISABLING",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"audioAdBlocked",label:"reload"}}),location.reload()}}]}),adblockDetected:new o.messageObject({title:"Looks like you're using an ad blocker.",beaconId:"adblockDetected",severe:!0,disableClose:!0,msg:"We've detected an ad blocker. You'll hear more audio ads as a result. Turn off your ad blocker to get fewer ads, or upgrade to Plus.",actions:[{label:"UPGRADE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"adblockDetected",label:"upgrade"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","adblockDetected")}},{label:"OK",styles:"std secondary",action:null}]}),"upgrade-success":new o.messageObject({title:!1,timeout:null,beaconId:"upgrade-success",severe:!1,msg:"upgrade-success-prompt",mustAnswer:!0,actions:[{label:"ENJOY",styles:"std",action:function(){APP.MESSAGING.setModal(null,null,!0),APP.isCostcoIabToBt(!1)}}]}),"purchase-success":{type:"tickler",timeout:7e3,title:"SWEET! - ",beaconId:"purchase-success",severe:!1,msg:"Your purchase is complete and will be active shortly.",actions:null},"gift-code-success":{type:"tickler",timeout:7e3,title:"SWEET! - ",beaconId:"gift-code-success",severe:!1,msg:"Your code redemption is complete and will be active shortly.",actions:null},"feedback-submit":{type:"tickler",timeout:3e3,title:"Thank You - ",beaconId:"feedback-submit",severe:!1,msg:"We received your feedback and appreciate your assistance in making us better.",actions:[{label:"OK",styles:"std",action:null}]},"auto-convert-song-to-radio":new o.messageObject({title:"Check it out",beaconId:"auto-convert-song-to-radio",severe:!1,msg:'A station based on the song "{title}" is now playing.',actions:[{label:"OK",styles:"std",action:null}]}),"radio-by-type":new o.messageObject({title:"Check it out",beaconId:"radio-by-type",severe:!1,msg:'A station based on the {type} "{title}" is now starting.',actions:[{label:"OK",styles:"std",action:null}]}),removeSlackerItem:new o.messageObject({title:"Are You Sure?",beaconId:"removeSlackerItem",severe:!1,disableClose:!0,msg:'Delete "{name}"? This action cannot be undone',actions:null}),libraryRemoveItem:new o.messageObject({title:"Are You Sure?",beaconId:"libraryRemoveItem",severe:!1,disableClose:!0,msg:'Delete "{name}"? This action cannot be undone',actions:null}),presetsMaxed:new o.messageObject({title:"Youâve Maxed Out Your Presets",beaconId:"presetsMaxed",severe:!1,disableClose:!0,msg:"Donât worry â you can free up a spot anytime by removing an existing preset.",actions:null}),"create-station":new o.messageObject({title:null,beaconId:"create-station",severe:!1,msg:"create-station-prompt",actions:null}),"create-playlist":new o.messageObject({title:null,beaconId:"create-playlist",severe:!1,msg:"create-playlist-prompt",actions:null}),"user-feedback":new o.messageObject({title:null,beaconId:"user-feedback-form",severe:!1,msg:"user-feedback-prompt",actions:null}),"slacker-external-service":new o.messageObject({title:null,historyTitle:"LiveOne Accounts",beaconId:"slacker-external-service",severe:!1,msg:"slacker-external-service-prompt",actions:null,useLoader:!0}),"upload-profile-img":new o.messageObject({title:null,beaconId:"upload-profile-img",severe:!1,msg:"upload-profile-img-prompt",actions:null}),wopr:new o.messageObject({title:null,historyTitle:"Slacker Music Assistant",beaconId:"wopr",severe:!1,msg:"wopr-prompt",actions:null}),artistPicker:new o.messageObject({title:null,historyTitle:"Personalization Assistant",beaconId:"artistPicker",severe:!1,msg:"artistPicker-prompt",actions:null,mustAnswer:!0}),userBump:new o.messageObject({title:"Woah!",beaconId:"userBump",severe:!1,disableClose:!0,msg:"You are in two places at once? Do you want to continue playing here?",actions:[{label:"CONTINUE",styles:"std",action:function(){APP.MESSAGING.setModal(),APP.USER.getSlackerToken((function(){CONSOLE.info(["NetworkModule::Slacker reauth SUCCESS"]),APP.slackerPlayerSession().restartLastAttempted("reauth")}))}}]}),freeTrackLimit:{title:"Enjoying the Music?",beaconId:"freeTrackLimit",severe:!1,msg:"To keep listening, you'll need to register for a free Slacker account. Register now and your personalized content could follow you from the web, to your smartphone, to your car!",actions:[{label:"Create Account",styles:"std",action:function(){APP.MESSAGING.setModal(),APP.USER.doForceSlackerCreate(null,"freeTrackLimit")}}]},geofence:{title:"Unavailable",beaconId:"geofence",severe:!1,msg:"We're sorry, this service is currently unavailable in your area.",actions:null},itemNotAvailable:{title:"Unavailable",beaconId:"itemNotAvailable",severe:!1,msg:"We're sorry, this item is currently unavailable.",actions:[{label:"OK",styles:"std",action:null}]},slackerMaintenance:{title:"Excuse the Dust",beaconId:"slackerMaintenance",severe:!1,msg:"You caught us in the middle of some maintenance. Please try back in 1 hour.",actions:null},html5AutoplayDisabled:{title:"OOPS",beaconId:"html5AutoplayDisabled",severe:!0,msg:"Your browser appears to be disabling audio from playing automatically.<br/><br/>"+(t.isMobileDevice()&&APP.downloadApps.getMobileAppDownloadPackage()?"Please use a different browser or download the LiveOne app for the best experience.":"Please update your browser settings to allow us to play audio in the browser."),actions:t.isMobileDevice()?APP.downloadApps.getMobileAppDownloadPackage()?[{label:"Get the App",styles:"std",action:function(){APP.MESSAGING.setModal(),APP.downloadApps.getAppDownload(null,"html5AutoplayVideoDisabled")}}]:[]:t.isFirefox()?[{label:"Firefox Help",styles:"std",action:function(){APP.MESSAGING.setModal(),window.open("https://support.mozilla.org/en-US/kb/block-autoplay")}}]:t.isSafari()?[{label:"Safari Help",styles:"std",action:function(){APP.MESSAGING.setModal(),window.open("https://support.apple.com/guide/safari/customize-browsing-settings-per-website-ibrw7f78f7fe")}}]:[]},html5AutoplayVideoDisabled:{title:"OOPS",beaconId:"html5AutoplayVideoDisabled",severe:!0,msg:"Your browser appears to be preventing us from automatically starting videos for you.<br/><br/>"+(t.isMobileDevice()&&APP.downloadApps.getMobileAppDownloadPackage()?"Please use a different browser or download the LiveOne app for the best experience.":"Please use a different browser or update your browser settings to allow us to play videos for you automatically."),actions:t.isMobileDevice()?APP.downloadApps.getMobileAppDownloadPackage()?[{label:"Get the App",styles:"std",action:function(){APP.MESSAGING.setModal(),APP.downloadApps.getAppDownload(null,"html5AutoplayVideoDisabled")}}]:[]:t.isFirefox()?[{label:"Firefox Help",styles:"std",action:function(){APP.MESSAGING.setModal(),window.open("https://support.mozilla.org/en-US/kb/block-autoplay")}}]:t.isSafari()?[{label:"Safari Help",styles:"std",action:function(){APP.MESSAGING.setModal(),window.open("https://support.apple.com/guide/safari/customize-browsing-settings-per-website-ibrw7f78f7fe")}}]:[]},stationErrorGeneric:{title:"Unknown Error",severe:!1,beaconId:"stationErrorGeneric",disableClose:!1,msg:"Sometimes bad things happen to good stations ({error}). An error has occurred and it can't be played right now. Choose another station and try this one again later.",actions:[{label:"OK",styles:"std",action:null}]},customStationMinArtistCount:new o.messageObject({title:"OOPS",beaconId:"customStationMinArtistCount",severe:!1,msg:"A custom station needs at least one artist to play. If you no longer like this station you can delete it.",actions:[{label:"OK",styles:"std",action:null}]}),customPlaylistMinSongCount:new o.messageObject({title:"OOPS",beaconId:"customPlaylistMinSongCount",severe:!1,msg:"A custom playlist needs at least one song to play. If you no longer like this playlist you can delete it.",actions:[{label:"OK",styles:"std",action:null}]}),genericNoAccess:new o.messageObject({title:"Unavailable",beaconId:"genericNoAccess",severe:!1,disableClose:!0,msg:"You do not currently have access to this item.",actions:[{label:"OK",styles:"std",action:null}]}),subscriptionRequiredNonPlatform:new o.messageObject({title:"Upgrade Required",beaconId:"subscriptionRequired",severe:!1,disableClose:!0,msg:"To access this content, you must be a {sub-tier-copy} subscriber.",actions:[{label:"OK",styles:"std",action:null}]}),"noupsell-subscriptionRequiredNonPlatform":new o.messageObject({title:"Feature Unavailable on Current Plan",beaconId:"subscriptionRequired",severe:!1,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]}),ticketRequiredNonPlatform:new o.messageObject({title:"Ticket Required",beaconId:"ticketRequiredNonPlatform",severe:!1,disableClose:!0,msg:"Visit www.liveone.com from your computer or mobile device to purchase a ticket for this event.",actions:[{label:"OK",styles:"std",action:null}]}),subscriptionRequired:new o.messageObject({title:"Upgrade Required",beaconId:"subscriptionRequired",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"To access this content, you must be a {sub-tier-copy} subscriber.",actions:[{label:"UPGRADE",styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"subscriptionRequiredVideo",label:"UPGRADE"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","sub-required")}},{label:"Maybe Later",styles:"std secondary",action:null}]}),"noupsell-subscriptionRequired":new o.messageObject({title:"Feature Unavailable on Current Plan",beaconId:"subscriptionRequired",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]}),subscriptionRequiredVideo:new o.messageObject({title:"Upgrade Required",beaconId:"subscriptionRequiredVideo",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"To access this content, you must be a {sub-tier-copy} subscriber.",actions:[{label:"UPGRADE",styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"subscriptionRequiredVideo",label:"UPGRADE"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","subscriptionRequiredVideo")}},{label:"Maybe Later",styles:"std secondary",action:null}]}),"noupsell-subscriptionRequiredVideo":new o.messageObject({title:"Feature Unavailable on Current Plan",beaconId:"subscriptionRequiredVideo",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]}),purchaseEventTicket:new o.messageObject({title:"Ready for the best seat in the house? ",beaconId:"purchaseEventTicket",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"Get your ticket to {sub-tier-copy} now.",actions:[{label:"PURCHASE",styles:"std",type:"upgrade",action:function(){}},{label:"Maybe Later",styles:"std secondary",action:null}]}),accessNotAllowed:new o.messageObject({title:"Access Restricted",beaconId:"accessNotAllowed",severe:!1,platformUpgrade:!1,disableClose:!1,msg:"You do not have access to this content.",actions:null}),registrationRequiredVideo:new o.messageObject({title:"Registration Required",beaconId:"registrationRequiredVideo",severe:!1,msg:"You'll need to log in to your account to watch that. Don't have an account? No problem! Create one for FREE.",actions:[{label:"SIGN UP FREE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"registrationRequiredVideo",label:"SIGN UP FREE"}}),APP.MESSAGING.setModal(),APP.USER.doForceSlackerCreate(null,"registrationRequiredVideo")}},{label:"LOG IN",styles:"std secondary",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"registrationRequiredVideo",label:"LOG IN"}}),APP.MESSAGING.setModal(),APP.USER.doForceSlackerLogin(null,"registrationRequiredVideo")}}]}),registrationRequiredVideo_TV:new o.messageObject({title:"Registration Required",beaconId:"registrationRequiredVideo",severe:!1,msg:"You'll need to log in to your account to watch that.",actions:[{label:"LOG IN",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"registrationRequiredVideo",label:"LOG IN"}}),APP.MESSAGING.setModal(),APP.history.unshift(APP.currentView),APP.goToPage("activate")}},{label:"NOT NOW",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"registrationRequiredVideo",label:"NOT NOW"}}),APP.MESSAGING.setModal()}}]}),teslaUpgradeFail:new o.messageObject({title:"OOPS",beaconId:"teslaUpgradeFail",severe:!1,disableClose:!0,msg:'We were unable to find your vehicle account and apply your discount. If you believe this was in error, please contact <a href="mailto:[email protected]">[email protected]</a>',actions:[{label:"OK",styles:"std",action:null}]}),teslaMergeFail:new o.messageObject({title:"OOPS",beaconId:"teslaMergeFail",severe:!1,disableClose:!0,msg:'Oops, we were unable to find your vehicle account. Try scanning the QR code in your vehicle again. Please contact <a href="mailto:[email protected]">[email protected]</a> if you need further assistance.',actions:[{label:"OK",styles:"std",action:null}]}),"ad-free":{title:"Upgrade to Plus",beaconId:"ad-free",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"Had it with the ads? Get ad free listening, unlimited song skips and way more with a
1LiveOne subscription.",actions:[{label:"Upgrade Now",styles:"std",type:"upgrade",action:function(){APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","ad-free")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"skip-limit":{title:"Skip Limit Reached",beaconId:"skip-limit",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"Uh-oh, you've run out of skips! Upgrade to <strong>LiveOne PLUS</strong> and skip as many songs as you want.",actions:[{label:"Upgrade Now",styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"skip-limit",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","skip-limit")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-ad-free":{title:"Feature Unavailable on Current Plan",beaconId:"ad-free",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"LIVEONE PLUS IS REQUIRED TO LISTEN TO MUSIC AD-FREE",actions:[{label:"OK",styles:"std",action:null}]},"noupsell-skip-limit":{title:"Feature Unavailable on Current Plan",beaconId:"skip-limit",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"LIVEONE PLUS IS REQUIRED UNLIMITED SKIPS",actions:[{label:"OK",styles:"std",action:null}]},scrubbing:{title:"Premium Feature",beaconId:"scrubbing",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"Upgrade to <strong>Premium</strong> so you can fast forward through songs",actions:[{label:"Upgrade Now",
1styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"scrubbing",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("premium","scrubbing")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-scrubbing":{title:"Feature Unavailable on Current Plan",beaconId:"scrubbing",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]},"skip-not-allowed":{title:"Oops",beaconId:"skip-not-allowed",severe:!1,platformUpgrade:!1,disableClose:!0,msg:"Oops. This track is a special and can't be skipped.",actions:null},"track-options-unavailable":{title:"No Options Available",beaconId:"track-options-unavailable",severe:!1,platformUpgrade:!1,msg:"We're sorry, this track isn't available on demand, so there are no options to show for it.",actions:[{label:"OK",styles:"std",action:null}]},"skip-replay":{title:"Premium Feature",beaconId:"skip-replay",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"UPGRADE TO <strong>PREMIUM</strong> TO PLAY PREVIOUS TRACKS ON DEMAND",actions:[{label:"Upgrade Now",
1styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"skip-replay",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("premium","skip-replay")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-skip-replay":{title:"Feature Unavailable on Current Plan",beaconId:"skip-replay",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]},"on-demand-playlist":{title:"Premium Feature",beaconId:"on-demand-playlist",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"UPGRADE TO <strong>PREMIUM</strong> TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"Upgrade Now",styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"on-demand-playlist",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("premium","on-demand-playlist")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-on-demand-playlist":{title:"Feature Unavailable on Current Plan",beaconId:"on-demand-playlist",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]},"on-demand-radio-upgrade":{title:"Premium Feature",beaconId:"on-demand-radio-upgrade",severe:!1,platformUpgrade:!0,disableClose:!0,msg:'A station based on "{title}" is now playing. Upgrade to <strong>PREMIUM</strong> to play playlists, songs & albums on demand',actions:[{label:"Upgrade Now",
1styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"on-demand-radio-upgrade",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("premium","on-demand-radio-upgrade")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-on-demand-radio-upgrade":{title:"Feature Unavailable on Current Plan",beaconId:"on-demand-radio-upgrade",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]},"noupsell-upgradeForDiscoveryOff":{title:"Feature Unavailable on Current Plan",beaconId:"on-demand-radio-upgrade",severe:!1,platformUpgrade:!0,disableClose:!0,forceActions:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",actions:[{label:"OK",styles:"std",action:null}]},"hq-media":{title:"High Quality Streaming",beaconId:"hq-media",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"This is a subscription feature of <strong>LiveOne PLUS</strong> which allows you to stream LiveOne at 320Kbps.",actions:[{label:"Upgrade Now",
1styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"hq-media",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("plus","hq-media")}},{label:"Maybe Later",styles:"std secondary",action:null}]},sliderSetting:{title:"Upgrade Required",beaconId:"{sliderSettingNag}",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"{sliderSettingNagText}",actions:[{label:"Upgrade Now",styles:"std",type:"upgrade",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"{sliderSettingNag}",label:"Upgrade Now"}}),APP.MESSAGING.setModal(),APP.onRequestUpgrade("{level}","{sliderSettingNag}")}},{label:"Maybe Later",styles:"std secondary",action:null}]},"noupsell-sliderSetting":{title:"Feature Unavailable on Current Plan",beaconId:"{sliderSettingNag}",severe:!1,platformUpgrade:!0,disableClose:!0,msg:"LIVEONE PREMIUM IS REQUIRED TO PLAY PLAYLISTS, SONGS & ALBUMS ON DEMAND",forceActions:!0,actions:[{label:"OK",styles:"std",action:null}]},"account-required-for-notifications":{title:"Account Required",beaconId:"account-required-for-notifications",severe:!1,platformUpgrade:!1,disableClose:!1,msg:"Sign up for a free account or login to set reminders for this event.",actions:null},"add-email-notify":{title:"Complete Your Account",beaconId:"add-email",severe:!1,platformUpgrade:!1,disableClose:!1,msg:"Please add an email address to your account to ensure you get your notifications.",actions:[{label:"Add Email",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"add-email-notify",label:"Add Email"}}),APP.MESSAGING.setModal(),APP.USER.doSlackerSettings.bind(APP.USER)()}}]},"account-required-to-chat":{title:"Account Required",beaconId:"account-required-to-chat",severe:!1,platformUpgrade:!1,disableClose:!0,msg:"You'll need a free LiveOne account to join the party.",actions:[{label:"SIGN UP FREE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"account-required-to-chat",label:"SIGN UP FREE"}}),APP.MESSAGING.setModal(),APP.requireSlackerServicesPromise((function(){APP.USER.doForceSlackerCreate(null,"account-required-to-chat")}),!0)}},{label:"Keep Lurking",styles:"std secondary",action:null}]},"account-required":{title:"Account Required",beaconId:"account-required",severe:!1,platformUpgrade:!1,disableClose:!0,msg:"You'll need a free LiveOne account to do that.",actions:[{label:"SIGN UP FREE",styles:"std",action:function(){BEACON.tagEvent({name:"hidePrompt",params:{value:"account-required",label:"SIGN UP FREE"}}),APP.MESSAGING.setModal(),APP.requireSlackerServicesPromise((function(){APP.USER.doForceSlackerCreate(null,"account-required")}),!0)}},{label:"Not Now",styles:"std secondary",action:null}]},costcoOnlyContent:new o.messageObject({title:"Content Restricted",beaconId:"costcoOnlyContent",severe:!1,disableClose:!0,msg:"{msg}",actions:[{label:"OK",styles:"std",action:null}]})}},__constructor:function(){this._initializeExternalServiceListener()},init:function(e){var t=$("#contextmenu"),i=this;
1this.isClosing=!1,e&&(ko.applyBindings(this,e),ko.bindingHandlers.afterPromptBodyRender={update:this.afterPromptBodyRender.bind(this)}),t[0]&&ko.applyBindings(this,t[0]),$(document).off("mousedown.contextMenu click.contextMenu"),$("#contextmenu").off("mousedown.contextMenu"),$(document).on("mousedown.contextMenu",(function(e){var t=$(e.target),s=t.closest("#contextmenu").length>0,a=t.closest(".playersettings, .playeroptions, #detail-editactions-share").length>0;!$("#contextmenu").hasClass("active")||s||a||i.closeContextMenu()})),$("#contextmenu").on("mousedown.contextMenu",(function(e){e.stopPropagation()}))},closeContextMenu:function(){const e=$("#contextmenu"),t=e.hasClass("active");e.css({top:"unset",left:"unset"}),e.removeClass("active"),e[0].removeEventListener("keyup",this.contextKeyUpHandler),window.removeEventListener("resize",this._onResizeCloseContextMenu),this.contextMenu([]),t&&APP.prevFocus()&&$(APP.prevFocus()).focus()},getTopbarNag:function(){let e=[];try{APP.USER.slackerUser().actualTier<=1&&this.topNagBarMessages.length&&(e=this.topNagBarMessages)}catch(e){CONSOLE.warn(["Failed to get top bar nag"],e)}finally{return e}},buildMenuItem:function(e,t,s){return new i(e,t,s||"")},showContextMenu:function(e,i,s){if(this.isClosing)return;const a=$("#contextmenu").hasClass("active"),n=this.contextMenu()&&this.contextMenu().length>0;if(a||n)return void this.closeContextMenu();const o=$(window),r=$("#contextmenu");let l=null;APP.animationFrame.call(window,(()=>{APP.MESSAGING.contextMenu(e),r.addClass("active").removeClass("above")})),i||(i=window.event),l=$(i.target||i.srcElement),l&&APP.animationFrame.call(window,(()=>{let e,i,s,a,n,c,d=0,u=0;e=l.offset(),n=r.width(),l.hasClass("playeroptions")?n+=12:l.hasClass("more")&&(n-=12),u=t.isFirefox()||t.isIE()?l.width():l[0].offsetWidth,!u&&l?u=l.width():u||(u=0),r.css({top:e.top+l.height()+10,left:e.left-n/2+u}),a=r.width()/2-u/2,s=r.width(),i=r.height(),c=t.isMobileDevice()?window.outerHeight+window.scrollY:window.innerHeight+window.scrollY,r.offset().top+i>c&&(e.top=e.top-i-10,r.css({top:e.top}).addClass("above")),r.offset().top<0&&r.css({top:0}),r.offset().left<0?(a=r.width()-(r.width()+r.offset().left)+u/2,r.css({left:0})):r.offset().left+s>o.width()&&(d=o.width()-(e.left+s),e.left+=d,r.css({left:e.left}),a=r.width()-(r.width()- -1*d)+u/2),$(".contextmenupointer").css({left:a}),APP.prevFocus(document.activeElement);const h=r.find("li");r[0].addEventListener("keyup",this.contextKeyUpHandler),window.removeEventListener("resize",this._onResizeCloseContextMenu),window.addEventListener("resize",this._onResizeCloseContextMenu,{once:!0}),h[0].focus()}))},prompt:function(e,t,i,s,a={}){let n=null;const r=APP.USER.slackerUser()?.hooplaUser||!1;let l="string"==typeof e?e:e?.beaconId;if(APP.prevFocus(APP.prevFocus()||document.activeElement),"purchase-success"===l)try{const t=APP.USER.slackerUser();t&&("true"===t.redeemCode||t.giftCode)&&this.messages["gift-code-success"]&&(CONSOLE.info(["MessagingModule::prompt - Detected gift code redemption, using gift-code-success message instead"]),e="gift-code-success",l="gift-code-success")}catch(e){CONSOLE.warn(["MessagingModule::prompt - Error checking gift code redemption flag:",e])}if((r||APP.noUpsell())&&l&&this.messages[`noupsell-${l}`]){const e=`noupsell-${l}`;n=Object.assign({},this.messages[e]),r&&(n.title="LiveOne Plus Binge Pass in Use"),CONSOLE.info(["MessagingModule::prompt - Using Hoopla message:",{messageKey:e,config:n}])}else"string"==typeof e?this.messages[e]?(n=Object.assign({},this.messages[e]),CONSOLE.info(["MessagingModule::prompt - Using standard string message:",{messageKey:e,config:n}])):(n={title:"",msg:e},CONSOLE.info(["MessagingModule::prompt - No message configuration found, using direct message:",n])):e?.msg&&(n=e,CONSOLE.info(["MessagingModule::prompt - Using provided object message"],e));if(n.platformUpgrade&&!APP.supportsPlatformUpgrade&&(t||(t={}),t["sub-tier-copy"]||(t["sub-tier-copy"]=""),!APP.supportsPlatformUpgrade)){if("firetv"==APP.appImplementationModule.type)return this.prompt("genericNoAccess",t,null,s);if(t&&t.feature){let e,i={};if(t.bp&&(i.bp=t.bp),e=APP.getPaywallUpgradeActionFromFeature(t.feature,n.beaconId,i,!0),e&&"ticketing"==e.type)return this.prompt("ticketRequiredNonPlatform",t,null,s)}return this.prompt("subscriptionRequiredNonPlatform",t,null,s)}if(n){if(t&&Object.keys(t).forEach((e=>{let i=`{${e}}`;for(;n.msg.indexOf(i)>-1;)n.msg=n.msg.replace(i,t[e])})),i&&!0!==n?.forceActions&&(n.actions=i),n.actions&&n.actions.forEach((e=>{if(e.styles||(e.styles="std"),"upgrade"==e.type&&t&&t.feature){let i,s={};t.bp&&(s.bp=t.bp),i=APP.getPaywallUpgradeActionFromFeature(t.feature,n.beaconId,s),i&&(e.action=i)}})),t&&t.disableClose&&(n.disableClose=!0),void 0===n.disableClose&&(n.disableClose=!1),void 0===n.mustAnswer&&(n.mustAnswer=!1),t&&t.beaconId&&(n.beaconId=t.beaconId),s||o[n.beaconId]){const t="string"==typeof e;this.bindingContext={promptId:t?e:n.beaconId,data:s||{}}}else this.bindingContext=s;if("tickler"===n.type)this.setTickler(n,n.timeout);else if(this.setModal(n,n.timeout),BEACON.tagEvent({name:"showPrompt",params:{value:n.beaconId||e,label:t&&t.error?t.error:n.msg,...a}}),"slacker-external-service"==e){let a={...n};history.state&&history.state.modal||(a.modal=e,a.replace=t,a.actions=i,a.bindingData=s,a.length=history.length,a.externalWindowSrc=APP.USER.externalWindowSrc,a.viewGuid=history.state&&history.state.guid,window.history.pushState(a,n.historyTitle,null))}}},setTickler:function(e,t){this.ticklerTimer&&(clearTimeout(this.ticklerTimer),this.ticklerTimer=0),this.tickler()&&this.tickler({}
1),e?(e.showClose||(e.showClose=!1),APP.checkAcessibilityTTSAction(`${e.title}, ${e.msg}`,null,!1,{forceFinish:!0}),APP.animationFrame.call(window,(()=>this.tickler(e))),t&&(this.ticklerTimer=setTimeout((()=>{APP.animationFrame.call(window,(()=>this.setTickler(null)))}),t))):this.tickler({})},setModal:function(e,t,i){const s=this.modal();this.modalTimer&&(clearTimeout(this.modalTimer),this.modalTimer=0),(i||!s||!s.mustAnswer&&"captcha"!==s.beaconId)&&(e?(s&&(this._unmountReactPrompt(),this.modal({})),e.actions||(e.actions=[]),APP.checkAcessibilityTTSAction(`${e.title}, ${e.msg}`,null,!1,{forceFinish:!0}),APP.animationFrame.call(window,(()=>this.modal(e))),e.useLoader&&this.loading(!0),setTimeout((()=>{const t="create-station"==e.beaconId||"create-playlist"==e.beaconId;let i;if(t&&this._bindCreatePromptInteractions(),"tv"==APP.implementationSuperType()?i=$(".modal button.std:not(.secondary), .modal .button.std:not(.secondary)"):t?i=$("#create-prompt-title"):(i=$(".modal .modal-actions button.std:not(.secondary)"),i.length||(i=$(".modal .modal-actions button")),i.length||(i=$("#modal-action-top"))),i[0])if(t){const e=i[0].closest(".content-container"),t=e&&e.querySelector(".create-prompt-scroll");t&&(t.scrollTop=0);try{i[0].focus({preventScroll:!0})}catch(e){i[0].focus()}t&&(t.scrollTop=0)}else i[0].focus()}),200),t&&(this.modalTimer=setTimeout((()=>{APP.animationFrame.call(window,(()=>{e.fireOnAutoDismiss&&e.actions?e.actions.filter((t=>t.label===e.fireOnAutoDismiss)).forEach((e=>e.action(!0))):this.setModal()}))}),t)),$("body").addClass("noscroll")):(this._unmountReactPrompt(),void 0!==e&&BEACON.tagEvent({name:"hidePrompt",params:{value:this.modal().beaconId,label:"defaultClose"}}),this.modal({}),APP.checkAcessibilityTTSAction(),$("body").removeClass("noscroll"),this._handleFocus(),APP.appImplementationModule._handleRemoteBackButton&&APP.appImplementationModule._handleRemoteBackButton(!1,!0)))},unwindExternalServiceHistory:function(){const e=window.history.state,t=e&&e.viewGuid;if(!e||!e.modal||e.guid)return;let i=0,s=0;const a=()=>{const e=window.history.state;return!(!e||!e.guid)},n=()=>{clearTimeout(s),s=0,window.removeEventListener("popstate",l),this.isUnwindingExternalServiceHistory=!1},o=()=>{n(),"slacker-external-service-prompt"==this.modal().msg&&(APP.USER.externalWindowSrc=null),this.setModal()},r=()=>{if(clearTimeout(s),this.isUnwindingExternalServiceHistory)if(!a()||t&&window.history.state.guid!=t){if(i>=25)return CONSOLE.warn(["MessagingModule::unwindExternalServiceHistory - Gave up short of the calling view."]),void n();if(!a()&&!(()=>{const e=window.history.state;return!(!e||!e.modal||e.guid)})())return t?(i++,s=setTimeout(r,500),void window.history.forward()):void o();i++,s=setTimeout(r,500),a()?window.history.forward():window.history.back()}else n()},l=()=>setTimeout(r,0);this.isUnwindingExternalServiceHistory=!0,window.addEventListener("popstate",l);const c=t&&"number"==typeof e.length?Math.max(1,window.history.length-e.length):1;s=setTimeout(r,500),window.history.go(-1*c)},handleContextListItemFocus:function(e){event.preventDefault();const t=$("#contextmenu").find("li");t["first"===e?0:t.length-1].focus()},handleContextStartFocusTrap:function(){APP.shiftDown?this.handleContextListItemFocus("last"):this.handleContextListItemFocus("first")},handleContextEndFocusTrap:function(){APP.shiftDown?this.handleContextListItemFocus("last"):this.handleContextListItemFocus("first")},contextKeyUpHandler:function(e){"Escape"===e.key&&(console.log("Escape key was pressed!"),APP.MESSAGING.closeContextMenu())},_handleFocus:function(){let e=null;const t=()=>{let e=null;return $("[tabindex]").each((function(){if(-1!==$(this).attr("tabindex"))return e=$(this),!1})),e};if(APP.prevFocus())try{e=APP.prevFocus()}catch{e=t()}else e=t();e?.focus()},_initializeExternalServiceListener:function(){window.addEventListener("message",(e=>{const t=!!window.location.hostname.match(/^.*dev|stg|pubstg\.sdliveone\.com/),i=["https://account.liveone.com","https://store.liveone.com"];if("slacker-external-service"===e.data.sender){if(!t&&!i.find((t=>t===e.origin)))return;if("LOADING"===e.data.status)this.loading(!0);else if("LOADED"===e.data.status&&!0===this.loading())this.modal()&&this.loading(!1);else if("AUTH_SUCCESS"===e.data.status)APP.slackerPlayerSession()&&"play"===APP.slackerPlayerSession().radioPlayerStateManager().state&&APP.slackerPlayerSession().radioPlayerStateManager().playPause();else if("SETTINGS_CHANGED"===e.data.status){const t=e.data.field,i=e.data.value;if("hqMedia"===t)APP.SERVICE.cache("aq","on"==i?"hi":"med");else if(t){const e=APP.USER.slackerUser();e&&e.id&&(e.accountSettings=e.accountSettings||{},e.accountSettings[t]=i,APP.USER.slackerUser.valueHasMutated())}}}}),!1)},afterPromptBodyRender:function(e,t,i){if(this.bindingContext){const t=o[this.bindingContext.promptId];e.className=this.bindingContext.promptId,t?t.apply(this,[e]):CONSOLE.warn(["Me
1ssagingModule::afterPromptBodyRender - Unknown afterRender promptId",this.bindingContext.promptId])}},_bindCreatePromptInteractions:function(){this._unbindCreatePromptInteractions();const e=document.querySelector(".modal.in");if(!e)return;const t=function(){const e=APP.MESSAGING.modal();return e&&("create-station"==e.beaconId||"create-playlist"==e.beaconId)};this._createPromptKeyboardHandler=function(i){if(!t())return;if("Escape"===i.key)return i.preventDefault(),void APP.MESSAGING.setModal(null,null,!0);if("Tab"!==i.key)return;const s=Array.prototype.filter.call(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),(function(e){return e.offsetWidth||e.offsetHeight||e.getClientRects().length}));if(!s.length)return;const a=s[0],n=s[s.length-1];i.shiftKey&&document.activeElement===a?(i.preventDefault(),n.focus()):i.shiftKey||document.activeElement!==n||(i.preventDefault(),a.focus())},this._createPromptKeyboardNode=e,e.addEventListener("keydown",this._createPromptKeyboardHandler),this._createPromptBackdropHandler=function(i){t()&&i.target===e&&(i.preventDefault(),APP.MESSAGING.setModal(null,null,!0))},e.addEventListener("click",this._createPromptBackdropHandler)},_unbindCreatePromptInteractions:function(){this._createPromptKeyboardNode&&this._createPromptKeyboardHandler&&this._createPromptKeyboardNode.removeEventListener("keydown",this._createPromptKeyboardHandler),this._createPromptKeyboardNode&&this._createPromptBackdropHandler&&this._createPromptKeyboardNode.removeEventListener("click",this._createPromptBackdropHandler),this._createPromptKeyboardNode=null,this._createPromptKeyboardHandler=null,this._createPromptBackdropHandler=null},_unmountReactPrompt:function(){this._unbindCreatePromptInteractions(),this._createPromptReactHandle&&(this._createPromptReactHandle.unmount(),this._createPromptReactHandle=null)}},o.artistPicker=function(e){const t=require("com.slacker.app.modules.ArtistPickerModule"),i=$(e),s=this.bindingContext,a=$(".user-prompts .content-container p.artistPicker");s.data=new t,e.innerHTML=$("#artistPicker-prompt").html(),ko.applyBindings(s.data,i.find("#artistPicker-prompt-body")[0]),s.data.init(".user-prompts"),a.off("scroll"),a.on("scroll",s.data.onWindowScroll.bind(s.data))},o["upgrade-success"]=function(e){const t=$(e),i=this.bindingContext,s=APP.USER.slackerUser().actualTier,a={5:"plus",10:"premium"}[s]||"basic",o=a.toUpperCase(),r={default:{title:`You've upgraded to ${o}!`,subtitle:"Take advantage of these features",note:{visible:!1,text:""}},"costco-iab-to-bt":{title:"Success!",subtitle:`Your new discounted LiveOne ${o} subscription is now active.`,note:{visible:!0,text:'Reminder: if your previous subscription was billed through Google Play or the App Store, it wonât cancel automatically. Please cancel it there to avoid being charged twice.<br /><br />Contact <a href="mailto:[email protected]">[email protected]</a> with questions.'}}}[APP.isCostcoIabToBt()?"costco-iab-to-bt":"default"];i.data={title:r.title,subtitle:r.subtitle,note:r.note,benefits:n.benefitsByLevelName(a).concat("premium"===a?[{id:"plus-sign",label:"All of plus"}]:[]),plans:n.plans};[0,1,5,10].forEach((e=>{$("div.modal").removeClass("user-tier-"+e)})),$("div.modal").addClass("user-tier-"+s),e.innerHTML=$("#upgrade-success-prompt").html(),ko.applyBindings(i.data,t.find("#upgrade-success-body")[0])},o.wopr=function(e){const t=require("com.slacker.app.modules.WoprModule"),i=$(e);let s=this.bindingContext;s.data.brain||(APP.wopr=s.data=new t),e.innerHTML=$("#wopr-prompt").html(),ko.applyBindings(s.data,i.find("#wopr-body")[0]),s.data.show()},o["upload-profile-img"]=function(e){let t=this.bindingContext;const i=$(e),s=JSON.parse(JSON.stringify(t.data)),n=t.data.callback,o=s.image;e.innerHTML=$("#upload-profile-img-prompt").html(),t=new a(i.find("#upload-form")[0],n),t.isFullProfileEdit=s.isFullProfileEdit,o&&t.onUserSelectedImage(this,{target:{files:[o]}}),t.editable.forEach((e=>{s[e]&&t[e](s[e])})),ko.applyBindings(t,i.find("#img-upload-container")[0])},o["slacker-external-service"]=e=>{const t=$(e);window.location.hash&&(window.location.hash=""),e.innerHTML=$("#slacker-external-service-prompt").html(),ko.applyBindings(APP,t.find("#slacker-external-service-body")[0]);t.find("iframe")[0].focus()},o["user-feedback"]=function(e){const t=$(e),i=/^(.+)@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]+$/;let s=this.bindingContext;e.innerHTML=$("#user-feedback-prompt").html(),s.comments=ko.observable(""),s.email=ko.observable(""),s._errorClear=ko.computed(function(){this.email()&&i.test(this.email()
1)&&(this.errors().email=null,this.errors.valueHasMutated()),this.comments().trim()&&(this.errors().comments=null,this.errors.valueHasMutated())}.bind(s)),s.errors=ko.observable({}),s.submitFeedback=function(){this.errors({});const e=require("com.slacker.app.actions.slacker.user.SlackerFeedbackAction"),t=APP.USER.slackerUser(),s=t&&t.username?t.username:this.email().trim()?this.email().trim():null,a=s&&s.trim()&&i.test(s);a&&this.comments().trim()?(BEACON.tagEvent({name:"hidePrompt",params:{value:"user-feedback-form",label:"SEND"}}),(new e).execute({emailContent:this.comments(),email:s})):(errors={},a||(errors.email={message:"Please enter a valid email"}),this.comments().trim()||(errors.comments={message:"Please enter a comment"}),this.errors(errors))}.bind(s),ko.applyBindings(s,t.find("#user-feedback-form-body")[0])},o._mountCreateContentPrompt=function(e,t){const i=require("com.slacker.app.components.ReactWrapper"),a=require("com.slacker.app.modules.SlackerCreatorModule"),n="station"==t?"create-station-prompt":"create-playlist-prompt";this._unmountReactPrompt(),e.innerHTML=$("#"+n).html();const o=$(e).find(".create-prompt-react-mount")[0]||e;this._createPromptReactHandle=i.mount("CreateContentPrompt",{APP,item:this.bindingContext.data,promptType:t,creator:a,GetSlackerItemDetailAction:s},o)},o["create-station"]=function(e){o._mountCreateContentPrompt.call(this,e,"station")},o["create-playlist"]=function(e){o._mountCreateContentPrompt.call(this,e,"playlist")},o.messageObject=function(e){Object.assign(this,e)},registerPackage("com.slacker.app.modules.MessagingModule"),com.slacker.app.modules.MessagingModule=o}()})),bjork("com.slacker.app.modules.NetworkModule",(function(){(function(){const CONSOLE=require("com.slacker.util.Console"),EventNotifier=require("com.slacker.event.EventNotifier"),UrlModule=require("com.slacker.app.modules.UrlModule"),Base64=require("com.slacker.util.encoding.B64");function NetworkModule(){this.__constants(),this.__properties(),this.__constructor()}NetworkModule.prototype={__constants:function(){this.EVENTS=new EventNotifier,this.EVENT={CONNECTION:{LOST:"onLostConnection",GONE:"onConnectionGone"}},this.MAX_RETRY=5,this.RETRY_DECAY=3},__properties:function(){this.requestRetryTracking={},this.authCounter={lxl:0,slacker:0},this.bearerToken,this.refreshToken},__constructor:function(){},do:function(url,callback,method,dataType,data,headers,noretry){return!this.signingKey&&CONFIG.K&&eval(decodeFromHex(CONFIG.K).replace("function decodeFromHex(str) ","this.signingKey=function decodeFromHex(str)")),CONSOLE.info(["NetworkingModule::do ->",url]),url=url.replace("{token}",this.bearerToken),navigator.onLine||CONSOLE.warn(["navigator.onLine is reporting FALSE for request: ",url]),this._doGet(url,callback,method,dataType,data,headers,noretry)},setBearerToken:function(e){this.bearerToken=e},setRefreshToken:function(e){this.refreshToken=e,APP.SERVICE.cache("refresh_token",e)},_handleHooplaExpiredPass:function(e,t,i){if(-1===e.indexOf("auth/oauth/token")||400!==t&&401!==t)return!1;const s=APP.USER.slackerUser();if(s&&!0===s.hooplaUser)return CONSOLE.info("Hoopla user identified from slackerUser object - showing expiration dialog"),this._showHooplaExpiredDialog(),!0;try{const e=APP.SERVICE.isCached("hooplaData");if(e){const t=JSON.parse(e);if(!0===t.isHooplaUser)return CONSOLE.info("Hoopla user identified from backup cache - showing expiration dialog"),s&&(s.hooplaUser=!0,APP.USER.slackerUser.valueHasMutated()),this._showHooplaExpiredDialog(t.location),!0}}catch(e){CONSOLE.warn("Error checking hooplaData cache:",e)}return!1},_showHooplaExpiredDialog:function(e){const t=APP.slackerPlayerSession();if(t&&t.radioPlayer&&t.radioPlayer.player){const e=t.radioPlayer.player;if("function"==typeof e.pause)try{e.pause(),CONSOLE.info("Successfully paused player on expired pass response")}catch(e){CONSOLE.warn("Failed to pause player:",e)}}let i;try{const t=e||APP.USER.slackerUser()?.policy?.accountLoc||"US";i="CA"===t?"/ca/plusHOOPLA7d":"/us/plusHOOPLA7d"}catch(e){i="/us/plusHOOPLA7d",CONSOLE.warn("Could not determine user location, defaulting to US path",e)}if(window.history&&window.history.replaceState){const e=document.createElement("script");e.textContent="\n\t\t\t\t\t // When we return via back button, this will run and reload the page\
1n\t\t\t\t\t\twindow.addEventListener('pageshow', function(event) {\n\t\t\t\t\t\t\tif (event.persisted) {\n\t\t\t\t\t\t\t // Page is loaded from back/forward cache\n\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t",document.head.appendChild(e)}const s={title:"LiveOne Plus BingePass Expired",beaconId:"hoopla-binge-pass-expired",severe:!1,disableClose:!0,msg:"Your Hoopla BingePass has expired. To continue enjoying LiveOne Plus using Hoopla, you'll need to get a new BingePass.",actions:[{label:"OK",styles:"std",action:function(){APP.MESSAGING.setModal(),CONSOLE.info("Navigating to Hoopla renewal page:",i),window.location.href=i}}]};APP.MESSAGING.prompt(s)},_doGet:function(e,t,i,s,a,n,o){let r=!1;const l=this,c={method:i||"GET",data:a,url:e,dataType:s||"",xhrFields:{withCredentials:-1==e.indexOf(".com/pages/")},crossDomain:!0,beforeSend:function(t,i){const s=APP.USER.slackerUser();let a=!1;if(e.indexOf("pages/viewparts/")>-1&&-1!=location.href.indexOf("file://"))return!0;if(n){n.bOverrideUserToken&&(o=!0,a=!0,delete n.bOverrideUserToken);for(let e in n)t.setRequestHeader(e,n[e])}const c=["slacker.com","/wsv1/","/mixer/","/xslte/"].filter((t=>e.indexOf(t)>-1)).length>0;return!c&&!n?.["BBI-AUTHORIZATION"]&&s?.token&&"oauth"!=s.token&&/live(one|xlive)\.com/.test(e)&&t.setRequestHeader("BBI-AUTHORIZATION",s.token),c?(n||(n={}),s&&(s.token&&"oauth"!=s.token&&(t.setRequestHeader("BBI-AUTHORIZATION",s.token),n.Authorization&&0==n.Authorization.indexOf("Bearer")&&-1==n.Authorization.indexOf(s.access_token)&&!a&&(n.Authorization=`Bearer ${s.access_token}`,t.setRequestHeader("Authorization",n.Authorization))),!n.Authorization&&s.access_token?-1==e.indexOf("/data/")?(n.Authorization=`Bearer ${s.access_token}`,t.setRequestHeader("Authorization",n.Authorization)):n.Authorization=null:e.indexOf("/data/")>-1&&(n.Authorization=null)),t.setRequestHeader("x-scid",CONFIG.slackerConfig.xscid)):t.setRequestHeader("x-scid",CONFIG.xscid),e===UrlModule.SERVICE.API.TOKEN&&l.signingKey?t.setRequestHeader("Authorization","Basic "+Base64.encode64(CONFIG.client+":"+l.signingKey())):l.bearerToken&&(a||n&&void 0!==n.Authorization||(-1==e.indexOf(APP.SERVICE.URLMODULE.SERVICE.API.ACCOUNTS)&&-1==e.indexOf(`${APP.SERVICE.URLMODULE.SERVICE.API.ROOT}/auth/`)&&!e.match(/live(xlive|one)\.com\/newsletter/)&&s&&s.access_token?(CONSOLE.debug("Slacker Auth in Use for LXL!"),t.setRequestHeader("Authorization",`Bearer ${s.access_token}`)):t.setRequestHeader("Authorization",`Bearer ${l.bearerToken}`)),r||n&&n["Content-Type"]||t.setRequestHeader("Content-Type","application/json")),t.setRequestHeader("x-lxl-client-guid",CONFIG.deviceId),!0},success:t,error:function(r,c,d){let u=!1,h=r.statusCode().status,p=r.statusCode().responseJSON;if(h<300?CONSOLE.warn("NetworkModule::_doGet non-200 status "+h):CONSOLE.error("NetworkModule::_doGet failed with status "+h),e.indexOf("auth/wstoken2")>-1)t(d,c,r);else switch(h){case 400:if(l._handleHooplaExpiredPass(e,h,p))return;e===APP.SERVICE.urls.API.TOKEN||e===APP.SERVICE.urls.SLACKER.API.TOKEN?APP.USER._onUserAuthError(p.error,c,r,t):t&&t(null,c,r);break;case 401:if(l._handleHooplaExpiredPass(e,h,p))return;p&&"clock_drift"===p.error&&(r.responseJSON.stime=r.responseJSON.current_time,CONSOLE.info("WSToken server time mismatch: "+[APP.SERVICE.slackerServerTimeSkew]),APP.SERVICE.setSlackerServerTimeSkew(r.responseJSON),u=!0),APP.USER.slackerUser().id&&!APP.usesSlackerServices&&(APP.usesSlackerServices=!0);let d=APP.usesSlackerServices&&-1==e.indexOf(APP.SERVICE.URLMODULE.SERVICE.API.ACCOUNTS)?"slacker":"lxl";if(e===APP.SERVICE.urls.API.TOKEN||e===APP.SERVICE.urls.SLACKER.API.TOKEN)e===APP.SERVICE.urls.API.TOKEN&&APP.SERVICE.uncache("refresh_token"),APP.USER._onUserAuthError(p.error,c,r,t);else if(o)t&&t(null,c,r);else{if(appInitTime&&e.indexOf("/pingback/")>-1)return;if(l.authCounter[d]>5)return l.authCounter[d]=0,CONSOLE.warn(["NetworkModule::re-auth tries exceeded."]),void APP.USER._onUserAuthError(500,"auth",{statusCode:()=>500});l.authCounter[d]++,CONSOLE.warn(["NetworkModule::error","token expired - attempt reauth.","Auth attempt",d,l.authCounter[d]]),APP.usesSlackerServices&&-1==e.indexOf(APP.SERVICE.URLMODULE.SERVICE.API.ACCOUNTS
1)?APP.USER.getSlackerToken((function(){CONSOLE.info(["NetworkModule::Slacker reauth SUCCESS"]),l.authCounter.slacker=0,l._doGet(e,t,i,s,a,n)}),u):APP.USER.AUTH.useRefreshToken(l.refreshToken,(function(o,c,d){if(APP.USER._onTokenResponse(o,c,d,!0))CONSOLE.info(["NetworkModule::reauth SUCCESS"]),l.authCounter.lxl=0,l._doGet(e,t,i,s,a,n);else{let e=o?o.error:"unknown";CONSOLE.error(["NetworkModule::reauth FAILED - "+e]),APP.USER._onUserAuthError(e,c,r,t)}}))}break;case 403:-1==e.indexOf("message-channels/auth-keys")&&-1==e.indexOf("/profile/profiles")&&(e.indexOf("slacker.com")>-1||e.indexOf("/wsv1/")>-1)?APP.slackerPlayerSession()?APP.slackerPlayerSession().captchaManager&&APP.slackerPlayerSession().captchaManager.isFetching?APP.slackerPlayerSession().captchaManager.onActionResponse(null,c,r):APP.slackerPlayerSession().captchaManager.displayRoadblock((function(){CONSOLE.info(["NetworkModule::CAPTCHA SUCCESS"]),l._doGet(e,t,i,s,a,n)})):(APP.SERVICE.uncache("slackerUser"),APP.USER._onUserAuthError(p?p.error:null,c,r,t)):t&&t(null,c,r);break;case 404:case 500:e===APP.SERVICE.urls.API.TOKEN?APP.USER._onUserAuthError(p?p.error:null,c,r,t):o&&500!=h?t&&t(null,c,r):l.doRetryIfPossible(e,t,i,s,a,n,c,r);break;default:t&&t(null,c,r)}}};return"multipart/form-data"==s&&(delete c.dataType,c.enctype="multipart/form-data",c.processData=!1,c.contentType=!1,r=!0),CONSOLE.debug(["NetworkModule::_doGet",e,t,i,s,a,n].join("\n -")),$.ajax(c)},doRetryIfPossible:function(e,t,i,s,a,n,o,r){const l=this;let c,d=this.requestRetryTracking[e];d||(this.requestRetryTracking[e]={count:0,params:Array.apply(null,arguments).splice(0,6)},d=this.requestRetryTracking[e]),this.requestRetryTracking[e].count++,d.count<this.MAX_RETRY?(c=d.count*this.RETRY_DECAY,CONSOLE.warn(["NetworkModule::doRetryIfPossible","retrying in "+c+" sec",e]),setTimeout(function(){CONSOLE.warn(["NetworkModule::doRetryIfPossible","retry ",this.params[0]]),l._doGet.apply(l,this.params)}.bind(d),1e3*c)):t&&t(null,o,r)}},registerPackage("com.slacker.app.modules.NetworkModule"),com.slacker.app.modules.NetworkModule=new NetworkModule})()})),bjork("com.slacker.app.modules.PubnubModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.util.Console"),i=require("com.slacker.app.modules.NetworkModule");let s,a,n,o=!1,r=!1,l={},c=!1,d={};function u(e,t,i){if(!(this instanceof u))return new u(e,t,i);this.__constants(),this.__properties(),this.__constructor(e,t,i)}u.prototype={__constants:function(){this.SDK="https://cdn.pubnub.com/sdk/javascript/pubnub.4.33.0.min.js",this.PUBNUB=null,this.EVENTS=new e,this.MAX_CHAT_HISTORY=500,this.EVENT={PUBNUB:{SUBSCRIBED:"pubnub-sub",UNSUBSCRIBED:"pubnub-unsub",STATUS:"pubnub-status"},MESSAGE:{PUBLISHED:"pubnub-published",RECEIVED:"pubnub-received"}},this.HEARTBEAT_INTERVAL=60,this.HEARTBEAT_TIMEOUT=30},__properties:function(){this.connectionState={isConnected:!1,lastHeartbeat:null,reconnectAttempts:0,maxReconnectAttempts:5}},__constructor:function(e,t,i){this.moduleId="PNModule-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),this.apiReady=!1,this.isEmbedding=!1,this.pauseChatUpdate=!1,this.socialFeaturesAvailable=!1,this.scope=i,this.messageChannels=e||[],this.channels=e||[],this.chatMessages=ko.observableArray(),this.chatIsLocked=ko.observable(!1),this.chatDisplayMessageQueue=[],this.chatDeleteQueue=[],this.chatDeleteQueueTimer=null,this.currentFlyout=ko.observable(),this.channelsByType={},this.chatHistoryTime=0,this.sendWelcomeMsg=!0,this.slackerApiDiscoverCount=0,this.channelsDataApi=null,this.pubNubUser=ko.observable(),this.viewPointer=null,this.isNewUserCreated=!1,this.authKeyString=t,this.viewListeners=[],this.tokenRefreshTimer=null,this.needsResubscribeAfter403=!1,this.sharedToken=null,this.sharedTokenExpiry=0,this.authToken=null,this.authTokenExpiry=0,this.isFetchingAuthToken=!1,this.userMashingStatus={count:0,batchCount:0,ts:null,lastMash:0,lastDisplay:0,cleaner:null,processor:null,hpsData:{}},this.pubKey=null,this.subKey=null,this.pubNubListeners={signal:this._onPubNubSignal.bind(this),status:this._onPubNubStatus.bind(this),message:this._onPubNubMessage.bind(this)},this.init(e)},init:function(e){return console.trace("PubnubModule::init Invoked with channels:",e),console.log("PubnubModule:: apiReady:",this.apiReady,"isEmbedding:",this.isEmbedding,"PubNub Defined:","undefined"!=typeof PubNub),APP.requireSlackerServicesPromise().then((()=>this._embed().then((()=>(this.apiReady=!0,this.channels=e,console.log("PubnubModule::SDK Loaded."),this.discoverEndpoints(),this)))))},discoverEndpoints:function(e){const a=APP.USER.slackerUser();let n=APP.SERVICE.URLMODULE.SERVICE.SLACKER.API["MESSAGE-CHANNELS"];return o?(t.debug(["PubNubModule::discoverEndpoints discovery in progress. Waiting...",this.scope]),void setTimeout((()=>this.discoverEndpoints(e)),1e3)):(o=!0,s&&-1!=n.indexOf(a.id)?(t.debug(["PubNubModule::discoverEndpoints Using cached MessageChannelsAPI."]),this.channelsDataApi||(this.channelsDataApi=s),o=!1,void("function"==typeof e?e(s):this._onChannelsDataApi.bind(this)(s))):(t.warn(["PubNubModule::discoverEndpoints Cached MessageChannelsAPI is stale or null."]),s=null,void(a&&a.id?(t.debug("PubNubModule::discoverEndpoints"),-1==n.indexOf(a.id)&&(t.warn("PubNubModule::discoverEndpoints - user ID changed. Fixing Mixer API URL."),APP.SERVICE.URLMODULE.SERVICE.SLACKER.API["MESSAGE-CHANNELS"]=n=n.replace(/(\/)(\d+)(\?)/,"$1"+a.id+"$3")),n=n.replace("http://","https://"),i.do(n,e||this._onChannelsDataApi.bind(this),"GET")):(t.warn("PubNubModule::discoverEndpoints::Waiting for Slacker User hydration for API requests."),setTimeout((()=>{o=!1,this.discoverEndpoints(e)}),200)))))},setUpPubNub:function(){const e=APP.USER.slackerUser();let t=[],i=!1;const s=this.authKeyString||"default";if(d[s]){const e=d[s];e.removeAllListeners(),e.unsubscribeAll(),e.stop(),delete d[s]}const a={publishKey:this.pubKey,subscribeKey:this.subKey,keepAlive:!0,autoNetworkDetection:!0,listenToBrowserNetworkEvents:!0,heartbeatInterval:this.HEARTBEAT_INTERVAL,presenceTimeout:this.HEARTBEAT_TIMEOUT,suppressLeaveEvents:!0,restore:!1,uuid:e?.id||"anonymous"};d[s]=new PubNub(a),d[s].addListener(this.pubNubListeners),this.PUBNUB=d[s],this._callMethodOnScope("socialMessaging",[this]),this.channels.forEac
1h((e=>{switch(e.messageType){case"chat":e.handler=e=>this._onChatMessageBroadcast(e,e.subscribedChannel===this.channelsByType.chat.moderator);break;case"emote":e.handler=this._onMashingMessageBroadcast.bind(this),e.emoticons=ko.observableArray(),e.emoticonsByName={},e.getEmoticonByName=t=>e.emoticons()[e.emoticonsByName[t]],e.setCurrentEmoticon=function(e){let t=this.emoticons();t.forEach(((t,i)=>{t.active=i==e})),this.emoticons(t)}.bind(e),e.currentEmoticon=ko.computed(function(){const e=this.emoticons();return ko.utils.arrayFilter(e,((e,t)=>{if(e.index=t,e.active&&"real-default-heart"!=e.name)return e}))}.bind(e)),e.selectableEmoticons=ko.computed(function(){const e=this.emoticons();return ko.utils.arrayFilter(e,(e=>{if(e.selectable&&!e.active&&("real-default-heart"!=e.name||this.currentEmoticon().length))return e}))}.bind(e)),e.emoteIcons&&(e.emoteIcons.forEach(((t,i)=>{0==i&&(t.active=!0),e.emoticonsByName[t.name]=i})),e.emoticons(e.emoteIcons));break;case"ticketQueue":e.handler=e=>this._callMethodOnScope("onTicketQueueMessage",[e.message]);break;
1case"status":e.handler=this._onStatusMessageBroadcast.bind(this);break;case"flyout":e.handler=this._onFlyoutMessageBroadcast.bind(this)}this.channelsByType[e.messageType]=e,e&&"active"===e.status&&("chat"===e.messageType||"emote"===e.messageType?i=!0:"emote"!==e.messageType&&t.push(e))})),e&&e.id&&e.actualTier>0?(this.getUserCredentials((()=>{t.length>0&&this.subscribe(t),this._callMethodOnScope("onFestivalSocialAvailable",[i])})),this.getUserProfile()):(this.ensurePubNubUserShell(),this.getUserCredentials((()=>{t.length>0&&this.subscribe(t),this._callMethodOnScope("onFestivalSocialAvailable",[i])})))},getPubNubCredentials:function(){if(!c)return n?(this.pubKey=n.publishKey,this.subKey=n.subscribeKey,void this.setUpPubNub()):void this._doChannelApiRequest("pubnub","GET",function(e,i,s){e&&(t.info("PubnubModule::PubNub Credentials Set!"),this.pubKey=e.publishKey,this.subKey=e.subscribeKey,n=e,c=!1,this.setUpPubNub())}.bind(this));setTimeout((()=>this.getPubNubCredentials()),200)},getUserCredentials:function(e){const i=Date.now(),s=APP.USER.slackerUser(),a=0==s.actualTier,n=this.authKeyString||"default";if(l[n])return void(e&&"function"==typeof e&&setTimeout((()=>this.getUserCredentials(e)),100));const o=s=>{const{authKey:n,token:o,expiresIn:r}=s||{},l=n||o,c=this.ensurePubNubUserShell(),d=!!c.revoked;if(!l||!r)throw new Error("PubNub token payload missing");d||(c.revoked=!1),c.authKey=l,c.authKeyExpiry=i+1e3*r,this.sharedToken=l,this.sharedTokenExpiry=i+1e3*r,this.PUBNUB.setToken(this.sharedToken),this.scheduleTokenRefresh(r),a||this._callMethodOnScope("onSocialMessagingUserProfileActive",[]),this.isNewUserCreated&&this.unsubscribe([this.channelsByType.chat,this.channelsByType.emote]),setTimeout((()=>{if(this.pubNubUser(c),e&&e(),this.isNewUserCreated&&(this.isNewUserCreated=!1,this.subscribe([this.channelsByType.chat,this.channelsByType.emote])),this.needsResubscribeAfter403){this.needsResubscribeAfter403=!1;const e=[];Object.keys(this.channelsByType).forEach((t=>{const i=this.channelsByType[t];i&&"active"===i.status&&e.push(i)})),e.length>0&&(t.info(["PubnubModule::Resubscribing to active channels after 403 recovery",e.map((e=>e.name))]),this.subscribe(e))}}),1e3),d&&this._onUserChatSubmit("Your ability to chat has been restored.",!0,!0)},r=e=>{const t=this.ensurePubNubUserShell();this.PUBNUB.setToken(null),this.tokenRefreshTimer&&(clearTimeout(this.tokenRefreshTimer),this.tokenRefreshTimer=null),t.authKey=null,t.authKeyExpiry=0,e&&403===e.status?(t.revoked=!0,this.pubNubUser(t),this._onUserChatSubmit("You have been suspended from chatting.",!0,!0,"ATTENTION")):this.pubNubUser(t)},c={browseMode:!0,festivalId:this.authKeyString,accountId:s.id};if("ticketQueue"===this.authKeyString){const e=this.scope?.fetchTicketQueueAuthKey;return"function"!=typeof e?void t.error("PubnubModule::getUserCredentials ticketQueue auth helper missing"):(l[n]=!0,void e.call(this.scope).then(o).catch((e=>{t.error("PubnubModule::getUserCredentials ticketQueue auth error",e),r(e?.jqXHR)})).finally((()=>{l[n]=!1})))}l[n]=!0,this._doChannelApiRequest("create-auth-key","POST",((e,i,s)=>{try{o(e)}catch(e){t.error("PubnubModule::getUserCredentials invalid payload",e),r(s)}l[n]=!1}),"json",JSON.stringify(c))},getAuthToken:function(e){const i=Date.now(),s=APP.USER.slackerUser();if(this.authToken&&this.authTokenExpiry>i)return void(e&&"function"==typeof e&&e());if(this.isFetchingAuthToken)return void setTimeout((()=>this.getAuthToken(e)),100);this.isFetchingAuthToken=!0;const a=t=>{const{authKey:s,token:a,expiresIn:n}=t||{},o=s||a;if(!o||!n)throw new Error("PubNub auth token payload missing");this.authToken=o,this.authTokenExpiry=i+1e3*n,e&&"function"==typeof e&&e()},n=e=>{if(t.error("PubnubModule::getAuthToken failed:",e?.status,e?.statusText),this.authToken=null,this.authTokenExpiry=0,e&&403===e.status){const e=this.ensurePubNubUserShell();e.revoked=!0,this.pubNubUser(e),this._onUserChatSubmit("You have been suspended from chatting.",!0,!0,"ATTENTION")}},o=this.messageChannels.filter((e=>e&&e.name)).map((e=>e.name)),r={accountId:s.id,festivalId:this.authKeyString,channels:o};this._doChannelApiRequest("create-auth-key","POST",((e,i,s)=>{try{a(e)}catch(e){t.error("PubnubModule::getAuthToken invalid payload",e),n(s)}finally{this.isFetchingAuthToken=!1}}),"json",JSON.stringify(r))},getUserProfile:function(){t.info("PubnubModule::getUserProfile"),this._doChannelApiRequest("profile","GET",((e,i,s)=>{try{e&&e.handle&&e.pubnubId?(t.info("PubnubModule::User profile fetched."),this.PUBNUB.setUUID(e.pubnubId),this.pubNubUuid=e.pubnubId,this._onUserProfileUpdate(e),a=e,e.pubnubAccountRevoked||this.getUserCredentials()):404==s.status?this.createUserProfile():(t.error(["Error getting user PubNub profile",s.status]),403==s.status&&this.teardown())}finally{r=!1}}),null,null,!0)},createUserProfile:function(){t.info("PubnubModule::createUserProfile::User profile does not exist - creating."),this._doChannelApiRequest("create-profile","POST",((e,i,s)=>{e&&e.handle&&e.pubnubId?(t.info("PubnubModule::User profile created!"),this.PUBNUB.setUUID(e.pubnubId),this.pubNubUuid=e.pubnubId,this.pubNubUser(e),a=e,this.getUserCredentials()):t.log("error",["Error creating user PubNub profile",s.status])}),"json",JSON.stringify({accountId:APP.USER.slackerUser().id}))},setUserHandle:function(e){APP.MESSAGING.prompt("upload-profile-img",{},[],{handle:e,callback:this._onUserProfileUpdate.bind(this)})},handleProfileImageAction:function(e){const t=APP.USER.slackerUser();if(!t||!t.id||0==t.actualTier)return this.channelsDataApi=null,void APP.MESSAGING.prompt("account-required-to-chat");this.pubNubUuid==e.publisher?APP.MESSAGING.prompt("upload-profile-img",{},[],{callback:this._onUserProfileUpdate.bind(this)}):APP.supportsNewProfile()&&("livexlivesite"==CONFIG.beaconConfig.client&&parent?(parent.APP.toggleHeroPlayerFloat(),parent.APP.goToPage("profile",{handle:e.message.handle})):location.href=`/user/${e.message.handle}`)},userMashAction:function(e,i){const s=(new Date).getTime(),a=APP.USER.slackerUser(),n=this.channelsByType.emote.currentEmoticon()[0];let o,r;this.pubNubUser()||a.id&&0!=a.actualTier||t.warn(["PubnubModule::userMashAction","Creating anon pubNubUser shell"]);let l=this.ensurePubNubUserShell();if(this.userMashingStatus.ts&&!i||(o=e&&s-this.userMashingStatus.lastMash>2e3,this.userMashingStatus.ts=s+5e3,this.userMashingStatus.firstMash=s),s-this.userMashingStatus.lastMash<1500&&this.userMashingStatus.ts&&!this.userMashingStatus.delayed&&(t.warn(["PubnubModule::userMashAction","Delaying mash publish due to rapid activity."]),this.userMashingStatus.delayed=!0,this.userMashingStatus.ts+=1e4),this.userMashingStatus.lastMash=s,!i&&e&&this.userMashingStatus.count++,s>=this.userMashingStatus.ts||o){if(l.authKeyExpiry&&l.authKeyExpiry<s)return l.revoked&&t.warn(["PubnubModule::userMashAction","User revoked...suspending publishing."]),!l.revoked&&this.getUserCredentials((()=>this.userMashAction(e,!0)));if(r=Object.assign({},this.userMashingStatus),this.userMashingStatus.count=0,this.userMashingStatus.delayed=!1,o||(this.userMashingStatus.ts=null),r.count){if(_payload={elapsed:s-r.firstMash,count:r.count,messageType:"mash",publisher:l.pubnubId,messageId:`${l.pubnubId}-${s}`},n&&(_payload.emoteIconName=n.name),this.userMashingStatus.batchCount+=r.count,t.debug(["PubnubModule::userMashAction","Sending data to service:",_payload.elapsed,_payload.count,_payload.emoteIconName]),!this.sharedToken||this.sharedTokenExpiry<=Date.now())return t.warn("PubnubModule::userMashAction shared token expired, refreshing..."),void this.getUserCredentials((()=>this.userMashAction(e,!0)));this.PUBNUB.setToken(this.sharedToken),this.PUBNUB.publish({channel:this.channelsByType.emote.name,message:_payload},((e,i)=>{e.error&&t.error("PubnubModule::userMashAction publish error:",e)}))}}else e&&(this.userMashingStatus.cleaner&&(clearTimeout(this.userMashingStatus.cleaner),this.userMashingStatus.cleaner=null),this.userMashingStatus.cleaner=setTimeout((()=>{this.userMashingStatus.ts=(new Date).getTime(),this.userMashAction(null)}),5010))},subscribe:function(e){let i=[];e&&e.forEach((function(e){e&&"active"===e.status&&(i.push(e.name),e.moderator&&i.push(e.moderator))})),i.length?this.PUBNUB.subscribe({channels:i,withPresence:!1,timetoken:0}):t.warn("PubnubModule:: NO ACTIVE CHANNELS to subscribe")},unsubscribe:function(e){let i=[];e.forEach((e=>{e&&(i.push(e.name),"chat"===e.messageType&&(this.isNewUserCreated||this._callMethodOnScope("onChatRemoved",[!1])),"emote"===e.messageType&&(this.userMashingStatus.hpsData={},this.userMashingStatus.cleaner&&(clearTimeout(this.userMashingStatus.cleaner),this.userMashingStatus.cleaner=null),this.userMashingStatus.processor&&(clearInterval(this.userMashingStatus.processor),this.userMashingStatus.processor=null)))})),t.warn("PubnubModule::Unsub from channels "+i),this.PUBNUB.unsubscribe({channels:i})},teardown:function(e){this._callMethodOnScope("onChatRemoved",[!1]),this.PUBNUB&&(this.PUBNUB.removeListener(this.pubNubListeners),this.PUBNUB.unsubscribeAll(),this.connectionState.isConnected=!1),this.userMashingStatus.cleaner&&(clearTimeout(this.userMashingStatus.cleaner),this.userMashingStatus.cleaner=null),this.userMashingStatus.processor&&(clearInterval(this.userMashingStatus.processor),this.userMashingStatus.processor=null),this.currentFlyout(null),this.pubNubUser(null),this.tokenRefreshTimer&&(clearTimeout(this.tokenRefreshTimer),this.tokenRefreshTimer=null),this.sharedToken=null,this.sharedTokenExpiry=0,this.authToken=null,this.authTokenExpiry=0,this.isFetchingAuthToken=!1,e||this._callMethodOnScope("socialMessaging",[null]),this.scope=null,this.chatHistoryTime=0,this.viewListeners.forEac
1h((e=>APP.EVENTS.detachEvent(e))),this.viewListeners=[]},_callMethodOnScope:function(e,i){t.debug(["PubNubModule::_callMethodOnScope",e,i]),this.scope&&this.scope[e]&&(t.debug(["PubNubModule::_callMethodOnScope","Calling available method",e]),this.scope[e].apply(this.scope,i))},_embed:function(e){const t=this;return new Promise(((i,s)=>{if("undefined"!=typeof PubNub)i();else{var a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=t.SDK,a.onload=function(){e&&e(),i()},a.onerror=function(){s(new Error("Script loading error for "+t.SDK))},$("head")[0].appendChild(a)}}))},_doChannelApiRequest:function(e,s,n,o,l,c){const d=APP.USER.slackerUser();let u;if(!this.channelsDataApi||!this.channelsDataApi[e])return t.warn("PubnubModule::waiting for channels data API - "+e),void setTimeout((()=>this._doChannelApiRequest(e,s,n)),200);if("profile"===e){if(r)return void setTimeout((()=>this._doChannelApiRequest(e,s,n,o,l,c)),500);if(a)return void n(a,"success",{});r=!0}u=this.channelsDataApi[e];const h={};d.access_token&&(h.Authorization="Bearer "+d.access_token),i.do(u,((i,s,a)=>{a.status>=400&&t.error("PubnubModule::_doChannelApiRequest failed:",{endpoint:e,status:a.status,statusText:s,hasAccessToken:!!APP.USER.slackerUser().access_token}),n(i,s,a)}),s,o,l,h,c)},ensurePubNubUserShell:function(){let e=this.pubNubUser();return e||(e={pubnubId:this.PUBNUB.getUUID(),handle:"Guest",revoked:!1,authKey:null,authKeyExpiry:0},this.pubNubUser(e)),e},scheduleTokenRefresh:function(e){if(this.tokenRefreshTimer&&clearTimeout(this.tokenRefreshTimer),!e)return void(this.tokenRefreshTimer=null);const t=Math.max(1e3*(e-60),1e3);this.tokenRefreshTimer=setTimeout((()=>this.getUserCredentials()),t)},_onViewPointerActiveDispose:function(e,i,s){e.__guid==this.viewPointer&&(s||e.isDisposed&&!i?(t.debug(["PubnubModule::_onViewPointerActiveDispose","DISCONNECT",this.authKeyString,s]),this.PUBNUB.disconnect()):(t.debug(["PubnubModule::_onViewPointerActiveDispose","RECONNECT",this.authKeyString]),this.PUBNUB.reconnect()))},_onPubNubStatus:function(e){const i=this,s=this.pubNubUser();switch(!this.viewPointer&&APP.currentView&&"ticketQueue"!=this.authKeyString&&(this.viewPointer=APP.currentView.__guid,this.viewListeners.push(APP.EVENTS.attachEvent(APP.EVENT.VIEWOBSCURED,((e,t)=>{this._onViewPointerActiveDispose.bind(this)(e,null,t)}))),this.viewListeners.push(APP.EVENTS.attachEvent(APP.EVENT.VIEWACTIVE,this._onViewPointerActiveDispose.bind(this))),this.viewListeners.push(APP.EVENTS.attachEvent(APP.EVENT.VIEWDISPOSE,this._onViewPointerActiveDispose.bind(this))),this.viewListeners.push(APP.EVENTS.attachEvent(APP.EVENT.VIEWRELOAD,(e=>{e.__guid==this.viewPointer&&this.teardown(!0)})))),t.debug(["PubnubModule::Received PubNub status event",e.category,e.operation]),e.category){case"PNNetworkUpCategory":break;case"PNReconnectedCategory":case"PNNetworkDownCategory":t.warn(["PubnubModule::PubNub network status report",e.category]);break;case"PNConnectedCategory":if("PNSubscribeOperation"===e.operation){let a,n={channel:null,count:0,stringifiedTimeToken:!0};e.affectedChannels&&e.affectedChannels.length&&e.affectedChannels.forEach((function(e){if(t.info(["PubnubModule::Subscribed to channel:",e]),i.channelsByType.emote&&e==i.channelsByType.emote.name&&(i.userMashingStatus.processor=setInterval(i._processMashingData.bind(i),1e3),i._callMethodOnScope("onEmoteStatusChange",[])),i.channelsByType.chat&&e==i.channelsByType.chat.name){n.channel=e,n.count=20;let t=[];i.PUBNUB.history(n,(function(o,r){r&&r.messages&&r.messages.length&&r.messages.forEach((function(i){let s={};a||(a=i.timetoken),s.subscribedChannel=e,s.publisher=0,s.isHistory=!0,s.message=i.entry,s.timetoken=i.timetoken,t.push(s)}));let l=["Everyone's invited to join this conversation, so please keep it cool and kind. Enjoy the show!","","Tip: Update your user name and profile picture by clicking on your profile icon below."],c="Hello <user>!";c=s?c.replace("<user>",s.handle):c.replace(" <user>",""),i.channelsByType.chat.moderator?(n.channel=i.channelsByType.chat.moderator,n.start=a,n.reverse=!0,delete n.count,i.PUBNUB.history(n,(function(e,s){s&&s.messages&&s.messages.length&&s.messages.forEac
1h((function(e){var s={};s.subscribedChannel=i.channelsByType.chat.moderator,s.publisher=0,s.message=e.entry,s.isHistory=!0,s.timetoken=e.timetoken,t.push(s)})),t.sort((function(e,t){return e.timetoken<t.timetoken?-1:e.timetoken>t.timetoken?1:0})),t.forEach((function(e){i._onPubNubMessage(e)})),i.sendWelcomeMsg&&i._onUserChatSubmit(l.join("\n"),!0,!0,c)}))):(t.forEach((function(e){i._onPubNubMessage(e)})),i._onUserChatSubmit(l.join(" "),!0,!0,c))})),i._callMethodOnScope("onChatEnabled",[])}}))}break;default:if("PNAccessDeniedCategory"===e.category||403===e.error?.statusCode){if(!s?.revoked){const i=this.authKeyString||"default";l[i]?t.debug(["PubnubModule::Access denied but credential fetch already in progress"]):(t.warn(["PubnubModule::Access denied â refreshing credentials",e.category]),this.needsResubscribeAfter403=!0,this.getUserCredentials())}break}switch(e.operation){case"PNSubscribeOperation":if("PNAccessDeniedCategory"==e.category)try{let t=e.errorData.payload.channels;t&&1==t.length&&t.join("").indexOf("chat")&&APP.MESSAGING.prompt("modalError",{reason:"Unexpected error connecting to chat."})}catch(e){}break;case"PNUnsubscribeOperation":e.affectedChannels&&e.affectedChannels.length&&e.affectedChannels.forEach((e=>{}))}}this.EVENTS.dispatch({type:this.EVENT.PUBNUB.STATUS,data:e})},_onPubNubMessage:function(e){t.debug(["PubnubModule::Received PubNub message event",e.subscribedChannel,e.publisher]);for(let t in this.channelsByType){const i=this.channelsByType[t];if(i.name==e.subscribedChannel||i.moderator==e.subscribedChannel)return void i.handler(e)}},_onPubNubSignal:function(e){const t=this.channelsByType.status,i=e.message;if(e.channel==t.name)try{i.overlayStreamId&&this._callMethodOnScope("onAntiPiracyRequest")}catch(e){console.error(`Unable process signal ${JSON.stringify(i)}`)}},_onChatMessageBroadcast:function(e,i,s){const n=this,o=this.pubNubUser();if(e.message)switch(e.message.messageType){case"post":(s||this.pubNubUuid!=e.publisher)&&(e.message.avatar&&e.message.avatar.trim()||(e.message.avatar=null),e.message.imageKey&&this.channelsDataApi["image-router"]&&(e.message.avatar&&e.message.avatar==APP.USER.getProfileImage()||(e.message.avatar=this.channelsDataApi["image-router"].replace("{imageKey}",e.message.imageKey).replace("{size}","small"))),e.message.handle||(e.message.handle="Guest"),e.message.notice||(e.message.notice=!1),e.publisher||(e.publisher=e.message.publisher),e.message.message||(e.message.message="NO MESSAGE"),e.message.moderator=i,i||s||e.isHistory?this.scope&&this._callMethodOnScope("onChatMessageRecieved",[e,s]):(e.timetoken&&e.timetoken>this.chatHistoryTime&&(this.chatHistoryTime=e.timetoken),this.chatDisplayMessageQueue.push([e,s]),this.chatDisplayMessageQueue.length>240&&(t.warn(["PubnubModule:: Dropping chat message due to message rate"]),this.chatDisplayMessageQueue.shift()))),this.meteredChatMessageDisplay||(this.meteredChatMessageDisplay=setInterval((()=>{let e=this.chatDisplayMessageQueue.length;if(this.isDeleteQueueRunning&&this.chatDisplayMessageQueue.length>239)t.warn(["PubnubModule:: Suspending message display due to delete operation..."]);else{for(;this.MAX_CHAT_HISTORY<this.chatMessages().length+1;)this.chatMessages.shift();if(e&&!this.pauseChatUpdate){const e=this.chatDisplayMessageQueue.shift(),t=e[0],i=e[1];this._callMethodOnScope("onChatMessageRecieved",[t,i])}this.pauseChatUpdate&&e>40&&(t.debug(["PubnubModule:: Dropping queued message due to paused display and queue size.",e]),this.chatDisplayMessageQueue.splice(e-40,e))}}),250));break;case"delete":const r=!e.message.targetMessageId;let l=this.chatMessages(),c=!1;l.forEach((function(t,i){let s=!1;s=r?t.message.publisher==e.message.targetPublisher:t.message.publisher==e.message.targetPublisher&&t.message.messageId==e.message.targetMessageId,s&&(t.isHistory?(l.splice(i,1),c=!0):r?n.chatDeleteQueue.push({publisher:e.message.targetPublisher}):n.chatDeleteQueue.push({message:e.message.targetMessageId}))})),c&&(this.chatMessages([]),this.chatMessages(l)),r&&o&&o.pubnubId==e.message.targetPublisher&&(t.warn(["PubnubModule::Delete-all message received for current user - checking ban status","pubnubId:",o.pubnubId]),a=null,this.getUserProfile()),this._onChatMessageDeleted();break;case"edit":this.chatMessages(ko.utils.arrayFilter(this.chatMessages(),(t=>{t.message.publisher==e.message.targetPublisher&&t.message.messageId==e.message.targetMessageId&&(t.message.message=e.message.message)}))),this.chatDisplayMessageQueue.forEach(((t,i)=>{const s=t[0];t[1];s.message.publisher==e.message.targetPublisher&&s.message.messageId==e.message.targetMessageId&&(s.message.message=e.message.message,t[0]=s)}));break;default:t.warn(["PubnubModule:: Msg recieved on Chat channel with unknown msg type - ",e.message.messageType])}else t.warn(["PubnubModule:: Msg recieved on Chat channel without payload"])},_onChatMessageDeleted:function(){this.chatDeleteQueueTimer||(this.chatDeleteQueueTimer=setTimeout((()=>{this.isDeleteQueueRunning=!0,t.warn(["PubnubModule:: Msg deleti
1on request processing.","Removal queue:",this.chatDeleteQueue.length]);const e=this.chatDeleteQueue.shift(),i=this.chatMessages();let s=!1;e&&(i.forEach(((t,a)=>{e.publisher!=t.message.publisher&&e.message!=t.message.messageId||(i.splice(a,1),s=!0)})),this.chatDisplayMessageQueue.forEach(((t,i)=>{const s=t[0];e.publisher!=s.message.publisher&&e.message!=s.message.messageId||this.chatDisplayMessageQueue.splice(i,1)})),s&&(this.chatMessages([]),this.chatMessages(i))),this.isDeleteQueueRunning=!1,this.chatDeleteQueue.length?this._onChatMessageDeleted():this.chatDeleteQueueTimer=0}),1e3))},_onMashingMessageBroadcast:function(e){if(!e.message||"emote"!==e.message.messageType&&"mash"!==e.message.messageType)return void t.warn(["PubnubModule:: Msg recieved on Emote channel without payload or proper msg type - ",e.message?e.message.messageType:null]);const i=this.pubNubUser(),s=(new Date).getTime(),a=e.message.count,n=e.message.emoteIconName,o="real-default-heart"!=n&&this.channelsByType.emote.getEmoticonByName(n),r=Math.max(1,e.message.elapsed/1e3),l=Math.ceil(a/r);i&&e.publisher==i.pubnubId||(t.debug(["PubnubModule::_onMashingMessageBroadcast recieved mashing data.",e.message.publisher,a,r,l,n]),this.userMashingStatus.hpsData.elapsed?(this.userMashingStatus.hpsData.elapsed+=r,this.userMashingStatus.hpsData.hearts+=a,this.userMashingStatus.hpsData.events++):(this.userMashingStatus.hpsData.elapsed=r,this.userMashingStatus.hpsData.hearts=a,this.userMashingStatus.hpsData.events=1),e.message.details||(e.message.details={emoteIcons:[]},o&&e.message.details.emoteIcons.push({name:n,count:a})),"mash-batch-function"==e.message.publisher&&(this.userMashingStatus.isBatch=!0,this.userMashingStatus.batchCount&&(this.userMashingStatus.hpsData.hearts-=this.userMashingStatus.batchCount,t.debug(["PubnubModule::_onMashingMessageBroadcast","Decreasing batch for local user count",this.userMashingStatus.batchCount]),this.userMashingStatus.hpsData.hearts<0&&(this.userMashingStatus.hpsData.hearts=0),this.userMashingStatus.batchCount=0)),e.message.details&&e.message.details.emoteIcons&&(this.userMashingStatus.hpsData.custom||(this.userMashingStatus.hpsData.custom={}),e.message.details.emoteIcons.forEach((e=>{"real-default-heart"!=e.emoteIconName&&this.channelsByType.emote.getEmoticonByName(e.name)?this.userMashingStatus.hpsData.custom[e.name]?this.userMashingStatus.hpsData.custom[e.name]+=e.count:this.userMashingStatus.hpsData.custom[e.name]=e.count:t.debug(["PubnubModule::_onMashingMessageBroadcast","Invalid emoteIcon",e.name])})))),(!this.userMashingStatus.lastDisplay||s-this.userMashingStatus.lastDisplay>5e3)&&this._processMashingData()},_onStatusMessageBroadcast:function(e){if(t.debug(["PubnubModule::_onStatusMessageBroadcast recieved",e.message.type]),e.message||e.message.message)switch(e.message?.message.type){case"festivalMessageChannelStatusChange":let i=e.message.message;if(i.messageChannelName){switch(t.info(["PubnubModule::_onStatusMessageBroadcast",i.messageChannelName,i.to]),this.channelsByType[i.messageChannelType]&&(this.channelsByType[i.messageChannelType].status=i.to),i.to){case"active":this.subscribe([this.channelsByType[i.messageChannelType]]),"chat"==i.messageChannelType&&(this.chatMessages([]),this._callMethodOnScope("onChatEnabled",[])),"chat"!=i.messageChannelType&&"emote"!=i.messageChannelType||this._callMethodOnScope("onFestivalSocialAvailable",[!0]);break;case"inactive":"chat"==i.messageChannelType&&this.scope&&(this._callMethodOnScope("onChatRemoved",[!0]),this.meteredChatMessageDisplay||(clearInterval(this.meteredChatMessageDisplay),this.meteredChatMessageDisplay=0)),this.unsubscribe([{name:i.messageChannelName}]),"active"!==this.channelsByType.emote.status&&"active"!==this.channelsByType.chat.status&&this._callMethodOnScope("onFestivalSocialAvailable",[!0])}"emote"==i.messageChannelType&&this._callMethodOnScope("onEmoteStatusChange",[])}break;case"festivalStatusChange":t.info(["PubnubModule::_onStatusMessageBroadcast festivalStatusChange",e.message.message]),this._callMethodOnScope("onFestivalStatusChange",[e.message.message]);break;default:t.warn(["PubnubModule:: Msg recieved on Status channel with unknown type - ",e.message.message.type])}else t.warn(["PubnubModule:: Msg recieved on Status channel without payload"])},_onFlyoutMessageBroadcast:function(e){let i=[];t.debug(["PubnubModule::_onFlyoutMessageBroadcast recieved",e.message]),e.message&&"flyout"===e.message.messageType?(["title","message","imageUrl","clickthroughUrl","clickthroughAction"].forEach((function(t){e.message[t]||(e.message[t]=null)})),i.push("active"),i.push(e.message.flyoutType),e.message.clickthroughAction&&i.push("with-action"),e.message.style=i.join(" "),this.currentFlyout(e.message),this._callMethodOnScope("onFlyoutMessage",[this.currentFlyout()])):t.warn(["PubnubModule:: Msg recieved on Flyout channel without payload or proper msg type - ",e.message?e.message.messageType:null])},_processChatCommand:function(e){if(0==e.indexOf("/")){let t=e.substring(1).split(" ");switch(t[0]){case"nick":case"name":return t.shift(),this.setUserHandle(t.join(" ")),!0;case"avatar":return t.shift(),this.handleProfileImageAction({publisher:this.pubNubUuid}),!0;case"heart":t.shift();
1let e=Math.max(1,Number(t.join("")));for(isNaN(e)&&(e=1);e;)this._callMethodOnScope("onHeartMashRecieved",[1,!0]),e--;return this.userMashAction(!0,!0),!0;default:return this._onUserChatSubmit(['"'+t[0]+'"',"is not a recognized command"].join(" "),!0,!0),!0}}return!1},_onUserChatSubmit:function(e,i,s,a){const n=this.pubNubUser(),o=(new Date).getTime();let r=null;if(!(i||n&&(n.authKey||n.revoked)))return t.warn("PubnubModule::Waiting for PubNub user setup"),void setTimeout((()=>this._onUserChatSubmit(e,i,s)),200);if(n?.revoked&&(e="You have been suspended from chatting.",i=s=!0),!this._processChatCommand(e)){if(!i&&n.authKeyExpiry&&n.authKeyExpiry<o)return t.warn("PubnubModule::User AuthKey Expired. Renewing..."),!n.revoked&&this.getUserCredentials((()=>this._onUserChatSubmit(e,i,s)));r={handle:i?a||"ATTENTION":n.handle,moderator:!1,notice:!(!i||!s),avatar:s?null:n.images?n.images.avatar.urls.small:APP.USER.getProfileImage(),imageKey:i?null:n.images?n.images.avatar.imageKey:null,messageType:"post",message:e,publisher:i?o:n.pubnubId,messageId:i?o:n.pubnubId+"-"+o},this._onChatMessageBroadcast({actualChannel:null,channel:i?o:this.channelsByType.chat.name,publisher:i?o:n.pubnubId,subscribedChannel:i?o:this.channelsByType.chat.name,subscription:void 0,timetoken:o,message:r},null,!0),i||this.getAuthToken((()=>{this.PUBNUB.setToken(this.authToken),this.PUBNUB.publish({channel:this.channelsByType.chat.name,message:r},((e,t)=>{this.sharedToken&&this.sharedTokenExpiry>Date.now()?this.PUBNUB.setToken(this.sharedToken):this.getUserCredentials(),this._onPubNubPublishResponse(e,t)}))}))}},_processMashingData:function(){const e=this.userMashingStatus.isBatch,i=e?10:5;let s,a,n,o=Object.assign({},this.userMashingStatus.hpsData);if(this.userMashingStatus.hpsData={},this.userMashingStatus.lastDisplay=(new Date).getTime(),e&&(this.userMashingStatus.isBatch=!1),o.hearts&&!(o.hearts<0)){if(e&&(o.events=1),s=Math.ceil(o.hearts/o.elapsed),n=Math.ceil(o.hearts/o.events),o.custom)for(let e in o.custom)o.custom[e]=o.custom[e]/o.hearts;if(s<1&&(s=1),a=Math.ceil(n/s),a>10&&(a=10),!isNaN(s)&&!isNaN(a))for(t.debug(["PubnubModule::userMashingStatus.processor","events",o.events,"hearts",o.hearts,"hpe:",n,"hps:",s,"Displaying:",Math.min(i,s),a]);a;)setTimeout((()=>this._callMethodOnScope("onHeartMashRecieved",[Math.min(i,s),!1,o.custom])),1e3*a),--a}},_onSlackerUserCreated:function(){t.info("PubnubModule::_onSlackerUserCreated"),s=null,a=null,setTimeout((()=>{this.discoverEndpoints((e=>{this.isNewUserCreated=!0,this._onChannelsDataApi(e,this.getUserProfile.bind(this))}))}),500)},_onChannelsDataApi:function(e,i){let a;if(t.debug("PubnubModule::_onChannelsDataApi "+e),e&&e.links)a={},e.links.forEach((e=>a[e.rel]=e.href)),s=e,this.channelsDataApi=a,o=!1,"function"==typeof i?i():this.getPubNubCredentials();else{t.warn("PubnubModule::_onChannelsDataApi NO ENDPOINTS! Try again.");var n="function"==typeof i?i:null;setTimeout((()=>this.discoverEndpoints(n)),200)}},_onPubNubPublishResponse:function(e,i){if(e.error)switch(t.error(["PubnubModule::_onPubNubPublishResponse","Error publishing",JSON.stringify(e)]),e.statusCode){case 400:case 403:this.authToken=null,this.authTokenExpiry=0;const e=this.pubNubUser();e?.revoked||this.getUserCredentials()}},_onUserProfileUpdate:function(e,i){t.info(["PubnubModule::User profile update response"]);const s=APP.MESSAGING.modal(),a=this.pubNubUser()||{};if(e){if(e.isExternalUpdate&&(a.accountId!=e.accountId||a.lastModified==e.lastModified))return void t.warn(["PubnubModule::Ignoring external user profile update.",e]);if(a&&e.handle!=a.handle&&(a.handle=e.handle,!i&&this.sendWelcomeMsg&&this._onUserChatSubmit(`You are now known as "${e.handle}" in the chat.`,!0,!0)),Object.keys(e).forEach((t=>{a[t]=e[t]})),void 0!==e.pubnubAccountRevoked){const i=!a.revoked&&e.pubnubAccountRevoked;a.revoked=e.pubnubAccountRevoked,i&&(t.warn(["PubnubModule::User banned detected via profile sync","accountId:",e.accountId,"pubnubId:",e.pubnubId,"revokedOn:",e.pubnubAccountRevokedOn]),this._onUserChatSubmit("You have been suspended from chatting.",!0,!0,"ATTENTION"))}this.pubNubUser(a),e.isExternalUpdate||APP.notifyPostMessageListeners(JSON.stringify({command:"profile",value:e}))}this.scope&&!this.scope.uiItemId&&s&&!s.severe&&APP.MESSAGING.setModal()}},registerPackage("com.slacker.app.modules.PubnubModule"),com.slacker.app.modules.PubnubModule=u}()})),bjork("com.slacker.app.modules.RemoteSessionModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction"),i=require("com.slacker.io.XmlUtils"),s=require("com.slacker.io.pokepull.Factory");require("com.slacker.sads.SAds");function a(t,i){extendClass(this,new e(this)),this.__constants(),this.__constructor(t,i)}a.prototype={__constants:function(){this.x2js=new X2JS,this.EVENT_JOIN_SUCCESS="join-success",this.EVENT_SESSION_WAITING="session-waiting",this.EVENT_SESSION_CREATE_SUCCESS="session-create-success",this.EVENT_SESSION_ENDED="session-ended",this.EVENT_SESSION_NOT_FOUND="session-not-found",this.EVENT_SESSION_CHATMSG="session-chat-msg",this.EVENT_SESSION_TRACK="session-track",this.EVENT_DJ_CHANGE="dj-change",this.EVENT_GUEST_LEAVE="session-guest-leave",this.EVENT_DJ_BOUNCED="dj-bounced",this.TYPE_SENDER="sender",this.TYPE_RECEIVER="receiver",this.SESSION_MODE_SHARED="shared",this.SESSION_MODE_DJ="dj",this.POKE_FREQ=2e3},__constructor:function(e,t){return this.type=0,this.pokeSeq=0,this.pokeObj=null,this.currentSlackerUser=null,this.sessionRootURI=null,this.sessionName=null,this.sessionOwner=null,this.sessionDescription=null,this.sessionStation=null,this.shareLink=null,this.sessionMode=this.SESSION_MODE_DJ,this.isOwner=!1,this.currentDJ=[],this.lastHostPlayable=null,this.roomGuests={},this.myDjName=ko.observable(),this.playlist=ko.observableArray().extend({rateLimit:500}),this.chatHistory=ko.observableArray([]).extend({rateLimit:500}),this.observableGuestList=ko.observableArray().extend({rateLimit:500}),this.me=ko.observable(null),this.loading=ko.observable(!0),this.waiting=ko.observable(!1),this.isAwaitingJoin=ko.observable(!0),this.currentSession=null,this.attachEvent(this.EVENT_SESSION_CREATE_SUCCESS,this.onSessionCreate.bind(this)),this.attachEvent(this.EVENT_SESSION_WAITING,this.onSessionWaiting.bind(this)),this.attachEvent(this.EVENT_JOIN_SUCCESS,this.onSessionJoin.bind(this)),this.attachEvent(this.EVENT_SESSION_ENDED,this.onSessionEnded.bind(this)),this.attachEvent(this.EVENT_SESSION_NOT_FOUND,this.onSessionNotFound.bind(this)),this.attachEvent(this.EVENT_SESSION_CHATMSG,this.onSessionChatMsg.bind(this)),this.attachEvent(this.EVENT_GUEST_LEAVE,this.onSessionGuestLeave.bind(this)),this.attachEvent(this.EVENT_DJ_BOUNCED,this.onSessionDjBounced.bind(this)),this.attachEvent(this.EVENT_DJ_CHANGE,this.onDjChange.bind(this)),this.attachEvent(this.EVENT_SESSION_TRACK,this.onSessionTrack.bind(this)),setTimeout((()=>this.getCurrentSession(e,t)),10),this},setSessionType:function(e){this.currentSession&&(this.isOwner=this.currentSession.split("/")[1]==this.currentSlackerUser,this.type=e||(this.isOwner?this.TYPE_SENDER:this.TYPE_RECEIVER))},getSessionType:function(){return this.type},assertSessionType:function(e){return this.type===e},isLurking:function(){return!this.isOwner&&null==this.roomGuests[this.currentSlackerUser]},getGuestMe:function(){let e=this.roomGuests[this.currentSlackerUser];return e||(e=this.getSessionOwnerGuest()),this.currentDJ[0]==e.id&&(e.isDj=!0),e},getSessionOwnerGuest:function(){const e=this.currentSession;if(e){let t=new n(e.split("/")[1],this.sessionOwner);return t.isOwner=!0,t}return null},getCurrentSession:function(e,i){if(-1==t.bookmarkCount)return void t.execute("init",(()=>{APP.remoteSession(null),this.getCurrentSession(e,i)}));this.currentSlackerUser=APP.USER.slackerUser().id,this.sessionRootURI=`sessions/${this.currentSlackerUser}`;const s=APP.slackerPlayerSession().radioPlayer,a=this._onRadioPlayerEvent.bind(this);["COMPLETED","STARTED","PAUSE","RESUME"].forEach((e=>{s.attachEvent(s.EVENT.PLAYBACK[e],a)})),e&&(this.currentSession=e,this.isOwner=-1!=e.indexOf(this.currentSlackerUser)),this.isAwaitingJoin(!this.isOwner),APP.remoteSession(this),e?this.sendSessionMessage(null,null,(e=>{this.currentSession=e?.uri,i?.apply(null,[this]),this.isOwner&&this.loading(!1)})):i?.apply(null,[this])},joinSession:function(e,t){this.currentSession&&(this.loading(!0),"function"!=typeof t&&(t=()=>this.__startPolling()),"string"!=typeof e&&(e=this.myDjName()),this.me()?(this.onSessionJoin(),e.trim()&&e!==this.me().alias&&(this.me().alias=e,this.me.valueHasMutated(),setTimeout((t=>this.changeDjAlias(e)),2e3))):this.sendSessionMessage(null,`<Event type='Join' dj='${this.currentSlackerUser}' alias='${i.encode(e||"Anonymous")}'/>`,t))},togglePlayPause:function(e){e&&this.assertSessionType(this.TYPE_SENDER)&&this.sendSessionMessage(null,`<Event type='${e}' dj='${this.currentSlackerUser}'/>`)},leaveSession:function(e){this.currentSession&&(this.isLurking()?this.onSessionGuestLeave(null):this.isOwner&&this.sessionMode==this.SESSION_MODE_DJ?this.endCurrentSession():this.sendSessionMessage(null,"<Event type='Leave'/>",e))},ejectUser:function(e){if(this.isOwner){const t=this.roomGuests[e];APP.MESSAGING.prompt({title:"",msg:`Are you sure you want to ban ${t.alias} from the room?`},null,[{label:"NO",styles:"std",action:()=>{APP.MESSAGING.setModal()}},{label:"YES",styles:"std secondary",action:()=>{APP.MESSAGING.setModal(),this.sendSessionMessage(null,`<Event type='Bounce' dj='${e}'/>`)}}])}},reAdmitUser:function(e){this.isOwner&&this.sendSessionMessage(null,`<Event type='ReAdmit' dj='${e}'/>`)},startNewRemoteSession:function(e,t,s,a){this.justCreated=!0,this.isOwner=!0,APP.remoteSession(null),this.loading(!0),e=e||"Remote Session",t=t||APP.USER.slackerUser()?.basicProfile?.handle||"Slacker User",s=s||`Remote Session ${new Date}`;let n=`<SharedSession name='${i.encode(e)}' djAlias='${i.encode(t)}'>\n\t\t\t\t\t\t\t<Description>${i.encode(s)}</Description>\n\t\t\t\t\t\t</SharedSession>`;this.sendSessionMessage(null,n,(i=>{i&&(this.sessionName=e,this.sessionOwner=t,this.sessionDescription=s,this.currentSession=i.uri,this.shareLink=`https://${document.location.hostname}?session=${this.currentSession}`),a&&a.apply(null,[this])}
1))},invite:function(){let e=document.createElement("DIV");e.textContent=this.shareLink,document.body.appendChild(e),(e=>{if(document.selection){let t=document.body.createTextRange();t.moveToElementText(e),t.select()}else if(window.getSelection){var t=document.createRange();t.selectNode(e),window.getSelection().removeAllRanges(),window.getSelection().addRange(t)}})(e),document.execCommand("copy"),e.remove(),APP.MESSAGING.prompt("ticklerFree",{msg:"Share link copied to clipboard. Go ahead and paste it into your favorite social network, blog post, email, or text message."})},changeHost:function(e,t){const i=APP.slackerPlayerSession();this.currentDJ[0]==e?t&&t.apply(this,[304]):this.isOwner||this.assertSessionType(this.TYPE_SENDER)?(this.assertSessionType(this.TYPE_SENDER)&&"play"!=i.radioPlayerStateManager().buttonstyle&&this.togglePlayPause("pause"),e?this.sendSessionMessage(null,"<Event type='ChangeDJ' dj='"+e+"' />",t):this.isOwner?this.sendSessionMessage(null,"<Event type='ChangeDJ' dj='"+this.currentSlackerUser+"' />",t):this.sendSessionMessage(null,"<Event type='Message' message='::RECLAIMDJ::' />",t)):CONSOLE.log("warn","Attempted DJ change by unauthorized guest: "+["isOwner",this.isOwner,"isSender",this.assertSessionType(this.TYPE_SENDER)])},changeDjAlias:function(e,t){this.sendSessionMessage("ChangeAlias",`<Event type='ChangeAlias' alias='${i.encode(e)}' />`,t)},endCurrentSession:function(e){this.currentSession&&this.isOwner&&(this.pokeObj.disconnect(),this.sendSessionMessage("shutdown",this.currentSession,(t=>{e?.apply(this,[t])})))},toggleGuestView:function(e){var t=$(".lounge-guest-list"),i=$(".lounge-chat-body");switch(e){case"chat":i.css("display","block"),t.css("display","none");break;case"guests":i.css("display","none"),t.css("display","block")}},sendChat:function(e){var t=this.getGuestMe()||this.isOwner,s=$("#lounge-chat-input");e&&"string"==typeof e||(e=s.val(),s.val("")),t&&e&&this.sendSessionMessage(null,`<Event type='Message' message="${i.encode(e)}" />`)},checkForChatMsg:function(e,t){return!t||13!=t.keyCode&&"click"!=t.type&&"input"!=t.type||(this.sendChat(),!1)},setGuestList(){let e=Object.keys(this.roomGuests).filter((e=>e!=this.currentSlackerUser)).map((e=>this.roomGuests[e]));this.isOwner||e.unshift(this.getSessionOwnerGuest()),this.observableGuestList(e)},sendSessionMessage:function(e,t,s){const a=this.currentSession?this.currentSession:this.sessionRootURI,n="shutdown"==e?"DELETE":"string"==typeof t?"POST":"GET";APP.NETWORKING.do(APP.SERVICE.URLMODULE.get(`${APP.SERVICE.URLMODULE.SLACKER_ROOTS.WS}${a}`),((a,n,o)=>{let r=o.status,l=o&&o.responseText?i.parseFromString(o.responseText):a;"error"!==n?"shutdown"==e?(this.notify(this.EVENT_SESSION_ENDED,[!0]),s&&s.apply(this,[!0])):this.onSessionMessageRecieved.apply(this,[APP.SERVICE._beanify(this.x2js.xml2json(l)).Response,s]):(CONSOLE.log("warn","RemoteSessionModule::sendSessionMessage http error: "+r),404==r||405==r&&(e||t)?this.notify(this.EVENT_SESSION_ENDED,[!0]):this.onSessionMessageRecieved.apply(this,[null,s]))}),n,"text/xml",t,null,!1)},getSessionStationDef:function(){return{name:`Social Radio - ${this.sessionName}`,id:this.currentSession,itemMatchId:this.currentSession,type:"station",subtype:"station",drawerType:"HISTORY",itemMatchType:"sharedSession",isLive:!1,rights:{tierToPlay:0},features:{finetuneAllowed:!1,skippingAllowed:!1},stop:()=>{const e=APP.slackerPlayerSession();APP.MESSAGING.closeContextMenu(),e.radioPlayer&&e.radioPlayer.stop(),$("body").removeClass("radio-bar-active"),e.currentTrack(null),e.currentPlayableItem(null)}}},cleanupOnClose:function(e){const t=APP.slackerPlayerSession();try{this.pokeObj.disconnect()}catch(e){}t.currentPlayableItem()?.id==this.currentSession?t.currentPlayableItem().stop(e,null,!0):this.__viewRoomIfNeeded(),APP.remoteSession(null),APP.SERVICE.uncache("remoteSession"),this.type=0,this.pokeSeq=0,this.pokeObj=null,this.sessionName=null,this.sessionOwner=null,this.sessionDescription=null,this.sessionStation=null,this.isOwner=!1,this.roomGuests={},this.chatHistory([]),this.currentSession=null},__startPolling:function(e){if(this.pokeObj)return;const t=this;this.pokeObj=s.getPoker(null,!0),this.pokeObj.freq=this.POKE_FREQ,this.pokeObj.setUrl(APP.SERVICE.URLMODULE.get(`${APP.SERVICE.URLMODULE.SLACKER_ROOTS.WS}${this.currentSession}/${this.pokeSeq}`)),this.pokeObj.setOnPush(((s,a,n,o)=>{let r=n.status;const l=APP.slackerPlayerSession();if(CONSOLE.log("debug","Push data: "+[r,s,typeof s]),s||(s=i.parseFromString(n.responseText)),304==r&&0==t.pokeSeq)t.notify(t.EVENT_SESSION_WAITING,[]);else if(200==r&&s){t.pokeSeq=t.onSessionMessageRecieved.apply(this,[APP.SERVICE._beanify(this.x2js.xml2json(s)).Response,e]),e&&(e=null);let i=o.url.lastIndexOf("/");o.setUrl(o.url.substring(0,i)+"/"+t.pokeSeq)}else 404==r?(this.pokeObj.disconnect(),t.pokeSeq>0?t.notify(t.EVENT_SESSION_ENDED,[]):t.notify(t.EVENT_SESSION_NOT_FOUND,[])):10==t.pokeObj?.noOpCount&&t.assertSessionType(this.TYPE_SENDER)&&(t.pokeObj.noOpCount=0,newmsg=["<Event type='Message' message='::PING::DATA::"],l.currentTrack()&&(newmsg.push(i.encode(`&trackPos=${l.radioPlayer.pingPOST.elapsed}`)),"play"==l.radioPlayerStateManager().buttonstyle&&newmsg.push(i.encode("&state=paused"))),newmsg.push("' />"),t.sendSessionMessage(null,newmsg.join("")))})),this.pokeObj.connect()},__playSessionTrack:function(e){const t=APP.slackerPlayerSession();if(t?.currentPlayableItem()?.id===this.currentSession&&t.radioPlayer?.player)t.getNextRadioTrack("","END");else{let i=this.getSessionStationDef();startOffset=new Date-e?.offset,startOffset/1e3<60?(i.startOffset=startOffset,t.radioPlayer?.player||t.currentPlayableItem(null),t.startRadioStation(this.currentSession,i)):(t.currentPlayableItem(i),["copyright","artistlink","albumlink"].forEach((t=>{void 0===e[t]&&(e[t]=null)})),e.active=ko.observable(!1),e.albumCoverArt={host:t._generateSlackerImageUrl("album",e.albumid),path:""},t.playlist.unshift(e),this.notify(this.EVENT_SESSION_WAITING,[])),this.__viewRoomIfNeeded(),this.toggleGuest
1View("guests")}},__viewRoomIfNeeded:function(){APP.currentView&&"socialradio"==APP.currentView.beaconName||APP.goToPage("socialradio")},_onRadioPlayerEvent:function(e){const t=APP.slackerPlayerSession().radioPlayer;switch(e.type){case t.EVENT.PLAYBACK.COMPLETED:break;case t.EVENT.PLAYBACK.STARTED:this.__startPolling(),this.waiting(!1);break;case t.EVENT.PLAYBACK.PAUSE:case t.EVENT.PLAYBACK.RESUME:this.togglePlayPause(e.type==t.EVENT.PLAYBACK.PAUSE?"pause":"resume")}},onSessionEnded:function(){let e=this.isOwner?this.sessionName?`${this.sessionName} is now closed. Your friends are sad.`:"Your Social Radio room expired due to lack of activity.":`${this.sessionName} is now closed. Sad Panda :O(`;APP.MESSAGING.prompt({title:"",type:"tickler",msg:e,showClose:!0}),this.cleanupOnClose("SessionEnd")},onSessionWaiting:function(){APP.remoteSession()||(APP.remoteSession(this),this.__viewRoomIfNeeded()),this.isOwner?(this.loading(!1),APP.MESSAGING.prompt({title:"You Are LIVE!",type:"tickler",msg:"Start playing some music to recover your live session or end the session",showClose:!0})):(this.loading(!1),this.waiting(!0),this.__startPolling())},onSessionJoin:function(e){let t=e?e+" has joined the room.":"Welcome to "+this.sessionName+". Say hi to "+this.sessionOwner;APP.MESSAGING.prompt("ticklerFree",{msg:t}),this.pokeObj||(this.__startPolling(),this.toggleGuestView("guests"))},onSessionCreate:function(e){const t=APP.slackerPlayerSession(),i=e>0?t.currentPlayableItem()?"Your guests will hear what you choose to play for them.":"Your guests won't hear anything until you start playing some music.":t.currentPlayableItem()?"One is the loneliest number. Invite some friends to hang out and listen together.":"Start playing some music and invite some friends to hang out and listen together";this.justCreated=!1,APP.SERVICE.cache("remoteSession",this.currentSession),this.setSessionType(),this.__startPolling(),APP.remoteSession(this),0==e&&this.__viewRoomIfNeeded(),i&&APP.MESSAGING.prompt({title:"You Are LIVE!",type:"tickler",msg:i,showClose:!0})},onSessionNotFound:function(){this.justCreated?APP.MESSAGING.prompt({title:"",type:"tickler",msg:"Your live session cannot start unless you start playing some music.",showClose:!0}):(APP.MESSAGING.prompt({title:"Uh Oh",type:"tickler",msg:"It looks like this room is no longer open. Sad Panda :O(",showClose:!0}),this.cleanupOnClose("NotFound"))},onSessionDjBounced:function(e,t){let i=!!e&&e.id==this.currentSlackerUser;i||t?APP.MESSAGING.prompt({title:"You're outta here!",type:"tickler",msg:"You've been banned from this room by the owner.",showClose:!0}):APP.MESSAGING.prompt("ticklerFree",{msg:(e?e.alias:"A guest")+" has been banned from this room."}),e&&e.isDj&&this.onSessionGuestLeave(e,!0),(i||t)&&this.cleanupOnClose("SessionDjBounced")},onSessionGuestLeave:function(e,t){const i=this;let s=!!e&&e.id==this.currentSlackerUser;if(s&&APP.remoteSession(null),!e||s||t||APP.MESSAGING.prompt("ticklerFree",{msg:`${e.alias} has left the room.`}),e&&e.isDj)if(CONSOLE.log("info","Current DJ just left. Check session type for next action: "+this.sessionMode),this.sessionMode===this.SESSION_MODE_SHARED)this.roomGuests.size()>0?(CONSOLE.log("info","Shared session - pass control to next available guest."),this.changeHost(this.roomGuests.getItemByIndex(0).id)):CONSOLE.log("info","Shared session has no more guests.");else!s&&i.isOwner&&(CONSOLE.log("info","Passing DJ control back from guest to owner."),this.changeHost());s&&this.cleanupOnClose("SessionLeave")},onSessionChatMsg:function(e,t){const i=$(".lounge-chat-body"),s=i.scrollTop()==i[0]?.scrollHeight-i[0]?.offsetHeight;this.chatHistory.push(e),s&&i.scrollTop(i[0]?.scrollHeight)},onSessionTrack:function(e){this.__playSessionTrack(e)},onDjChange:function(e,t){if(!this.currentSession||!this.getGuestMe())return;const i=APP.slackerPlayerSession(),s=this.getGuestMe();let a=this.roomGuests[e],n=this.roomGuests[t];n||(n=this.isOwner?s:this.getSessionOwnerGuest()),a||(a=this.isOwner?s:this.getSessionOwnerGuest()),n.isDj=!1,a.isDj=!0,e!=s.id?s.isDj=!1:(s.isDj=!0,this.setSessionType(this.TYPE_SENDER),this.isOwner&&(i.currentPlayableItem(this.lastHostPlayable),i.skipCurrentTrack())),n.id==s.id&&(this.setSessionType(this.TYPE_RECEIVER),this.isOwner&&(this.lastHostPlayable=i.currentPlayableItem(),i.currentPlayableItem(this.getSessionStationDef()))),this.me(s),this.setGuestList(),this.sessionMode==this.SESSION_MODE_DJ&&(e==s.id?APP.MESSAGING.prompt("ticklerFree",{msg:"Hey there! You are now the DJ. Pick something for the room to hear!"}):APP.MESSAGING.prompt("ticklerFree",{msg:`${a.alias} is now in charge of the funky fresh beats.`}))},onSessionMessageRecieved:function(e,t){const s=this,a=APP.slackerPlayerSession(),r=APP.USER.slackerUser();let l,c,d,u,h=e?e.SharedSession:null,p=[],m=!1;if(t&&t.apply(null,[h]),!e||this.currentSession){if(h){if(h&&!h.Members.DJ.length&&(h.Members.DJ=[h.Members.DJ]),h&&h.Bounced&&!h.Bounced.DJ.length&&(h.Bounced.DJ=[h.Bounced.DJ]),h.Events&&(p=h.Events.Event.length?h.Events.Event:[h.Events.Event]),c=this.currentDJ[0],m=this.userIsJoining||!this.me()&&!this.isOwner,u=this.currentSession.split("/")[1],this.currentDJ=[h.dj,h.djAlias],this.sessionName||(this.sessionName=h.name,this.sessionOwner=h.djAlias,this.sessionDescription=h.Description,this.currentSession=h.uri,this.shareLink=`https://${document.location.hostname}?session=${this.currentSession}`,p.length>0&&this.isOwner&&this.notify(this.EVENT_SESSION_CREATE_SUCCESS,[0])),m&&s.setSessionType(),m&&!this.isOwner){if(h.Bounced){if(h.Bounced.DJ.filter((e=>
1e.id==r.id)))return this.cleanupOnClose("SessionDjBounced"),this.notify(this.EVENT_DJ_BOUNCED,[null,!0]),void(t&&t.apply(null,[null]))}if(h.Members.DJ.forEach((e=>{d=new n(e.id,e.alias),d.isDj=this.currentDJ[0]==e.id,e.id==r.id&&(this.me(d),!m||this.isDirtyShutdownRejoin||this.userIsJoining?(this.userIsJoining=this.isDirtyShutdownRejoin=!1,this.isAwaitingJoin(!1)):(this.isDirtyShutdownRejoin=!0,this.myDjName(e.alias),this.isAwaitingJoin(!0))),e.id!=u&&(this.roomGuests[e.id]=d)})),this.setGuestList(),this.isAwaitingJoin()){this.isOwner||(this.notify(this.EVENT_SESSION_WAITING,[]),r?.basicProfile?.handle&&this.myDjName(r.basicProfile.handle));try{this.pokeSeq=Number(p[p.length-1].seq)+1}catch(e){this.pokeSeq=1}return this.pokeSeq}}else this.isOwner&&(!p||p.length<1)&&this.me(new n(r.id,this.sessionOwner));if(this.isAwaitingJoin()&&(m=!this.isOwner&&!this.pokeSeq),p.forEach((e=>{let t=e.type.toLowerCase(),u=(e.seq,e.message),p=e.dj,g=e.alias,P=p==r.id,y=!0;switch(this.pokeSeq++,t){case"end":case"skip":if(p==s.currentDJ[0]||m)if(e.Track){if("00"!==e.Track.artistid&&(l=e.Track,l.offset=new Date(Number(e.timestamp)),this.playlist.unshift(e.Track),!m&&!P)){this.notify(this.EVENT_SESSION_TRACK,[e.Track]);let t=new o(p,g," is playing "+e.Track.title);this.notify(this.EVENT_SESSION_CHATMSG,[t,e.Track]),this.loading(!1),this.waiting(!1)}}else CONSOLE.log("error","Failed to parse track in push data.");else CONSOLE.log("warn","Play event from non DJ guest! - "+p+", "+g);break;case"pause":if(!m){if(this.assertSessionType(this.TYPE_RECEIVER)){let t=new o(p,g," has paused the audio.");this.notify(this.EVENT_SESSION_CHATMSG,[t,e.Track])}a.radioPlayerStateManager().playPause()}break;case"resume":m||a.radioPlayerStateManager().playPause();break;case"join":m||this.roomGuests[p]||(d=new n(p,e.alias),d.isDj=this.currentDJ[0]==p,this.roomGuests[p]=d,P?(this.notify(s.EVENT_JOIN_SUCCESS,[]),this.me(d)):this.notify(s.EVENT_JOIN_SUCCESS,[e.alias]),this.setGuestList());break;case"leave":m||(d=this.roomGuests[p],delete this.roomGuests[p],this.notify(this.EVENT_GUEST_LEAVE,[d]),this.setGuestList());break;case"bounce":m||h.Bounced.DJ.filter((e=>this.roomGuests[e.id])).forEach((e=>{d=this.roomGuests[e.id],d&&(delete this.roomGuests[e.id],this.setGuestList(),this.notify(this.EVENT_DJ_BOUNCED,[d]))}));break;case"readmit":break;case"changealias":let r=null,E=null;d=this.roomGuests[p],!m&&d&&(r=d.alias,E=new o(p,r,r+" is now known as "+e.alias),this.notify(this.EVENT_SESSION_CHATMSG,[E])),d.alias=e.alias,this.setGuestList();break;case"changedj":d=this.roomGuests[h.dj],m||(d&&(d.isDj=!0),this.notify(this.EVENT_DJ_CHANGE,[h.dj,c]));break;case"message":if(u.indexOf("::PING::")>-1){const e=new com.slacker.util.ParamHash(i.decode(u.substr(u.indexOf("DATA::")+1)));if(e&&e.get("trackPos")&&this.assertSessionType(this.TYPE_RECEIVER)&&a?.currentTrack()){let t=Number(e.get("trackPos"))-a.radioPlayer.player.currentTime();if(CONSOLE.log("debug",["Source Player Pos",e.get("trackPos"),"Local Player Pos",a.radioPlayer.player.currentTime(),e.get("state")]),"paused"==e.get("state")){if(!a.radioPlayer.player.paused()){a.radioPlayer.pause();let e=new o(p,g," has paused the audio.");this.notify(this.EVENT_SESSION_CHATMSG,[e])}}else a.radioPlayer.player.paused()&&a.radioPlayer.resume(),Math.abs(t)>5&&(CONSOLE.log("warn","Session guest player significantly off source player. Jump: "+t),a.radioPlayer.seekTo(Number(e.get("trackPos"))+1))}}else if(u.indexOf("::RATE::")>-1);else if(u.indexOf("::VOTE::")>-1);else if(u.indexOf("::RECLAIMDJ::")>-1)s.isOwner&&s.changeHost();else{var f,A=null;if(m||0!=u.indexOf("<track"))f=i.encode(u);else try{var S=i.selectSingleNode(i.parseFromString(u),"//track");(A=new com.slacker.model.Track).buildFromMeta(S);var b=[];b.push("type='song'"),b.push("itemid='"+A.get("id")+"'"),b.push("name='"+i.encode(A.get("title"))+"'"),b.push("artist='"+A.get("artistName")+"'"),b.push("artistId='"+A.get("artistId")+"'"),b.push("album='"+i.encode(A.get("album"))+"'"),b.push("albumId='"+A.get("albumId")+"'"),b.push("olicensed='"+A.get("olicensed")+"'"),f=P?"Request sent: <a href='Javascript:void(0)' onclick='showPlayableItemInfo(this)' "+b.join(" ")+">"+A.get("title")+"</a> by "+A.get("artistName"):g+" wants to hear <a href='Javascript:void(0)' onclick='showPlayableItemInfo(this)' "+b.join(" ")+">"+A.get("title")+"</a> by "+A.get("artistName"),p=1,g=null}catch(e){CONSOLE.log("error","Failed to parse requested track: "+u,e)}if(f){let e=new o(p,g,f);this.notify(this.EVENT_SESSION_CHATMSG,[e,A])}}break;default:y=!1,CONSOLE.log("warn","Unsupported event: "+t)}})),0==this.pokeSeq&&this.isOwner)this.notify(this.EVENT_SESSION_CREATE_SUCCESS,[0]);else if(m)if(this.isOwner)this.notify(this.EVENT_SESSION_CREATE_SUCCESS,[Object.keys(this.roomGuests).length]);else if(l){this.playlist().length>
11&&this.playlist.slice(1).forEach((e=>{["copyright","artistlink","albumlink"].forEach((t=>{void 0===e[t]&&(e[t]=null)})),e.active=ko.observable(!1),e.albumCoverArt={host:a._generateSlackerImageUrl("album",e.albumid),path:""},a.playlist.push(e)})),this.notify(this.EVENT_SESSION_TRACK,[l])}}else if("Join"==e.Event.type){let t=new n(e.Event.dj,e.Event.alias);this.userIsJoining=t.id==r.id}return h&&this.isAwaitingJoin()&&this.isAwaitingJoin(!1),this.pokeSeq}}};class n{constructor(e,t){this.id=e,this.alias=t,this.rating=0,this.isDj=!1,this.isOwner=!1,this.getAttribute=function(e){return this[e]},this.toString=function(){return this.id+"-"+this.alias}}}class o{constructor(e,t,i,s){this.tstamp=s?new Date(s):new Date,this.sender=e,this.alias=t,this.msg=i,this.isMe=e==APP.USER.slackerUser().id}getMsgTime(){var e=this.tstamp.getHours(),t=e>11?"PM":"AM",i=e>12?e-12:0==e?"12":e,s=this.tstamp.getMinutes();s<10&&(s="0"+s);var a=this.tstamp.getSeconds();return a<10&&(a="0"+a),i+":"+s+":"+a+" "+t}}registerPackage("com.slacker.app.modules.RemoteSessionModule"),com.slacker.app.modules.RemoteSessionModule=a}()})),bjork("com.slacker.app.modules.ServiceModule",(function(){(function(){const CONSOLE=require("com.slacker.util.Console"),UrlModule=require("com.slacker.app.modules.UrlModule"),MD5=require("com.slacker.util.encoding.MD5"),SHA1=require("com.slacker.util.encoding.SHA1");function ServiceModule(){this.__constants(),this.__properties(),this.__constructor()}ServiceModule.prototype={__constants:function(){this.EVENT={ON:{DATA:"event_on_data",ERROR:"event_on_error"}},this.SOURCE={STATIC:"source_static"},this.URLMODULE=UrlModule},__properties:function(){this.appRef=null,this.deviceId="",this.isForceUpgradeRequired=!1,this.slackerServerTimeSkew=null,this.discoveryRetryTimer=null,this.slackerDiscoveryPromise=null,this.lxlDiscoveryPromise=null,this.invokeCount=0,this.lastInvokeTime=0,this.retryCount=0,this.isDiscoveringSlacker=!1},__constructor:function(){"undefined"!=typeof localStorage&&localStorage.getItem||(localStorage={setItem:function(e,t){this[e]=JSON.stringify(t)},getItem:function(e){return this[e]},removeItem:function(e){delete this[e]}}),CONFIG.deviceId=this.isCached("deviceId")||generateUniqueID(),this.cache("deviceId",CONFIG.deviceId),this.uncache("mystations"),this.urls=UrlModule.SERVICE},init:function(e,t){CONSOLE.warn("ServiceModule::init Initializing application service"),this.appRef=e,this.envOverride=this.isCached("envOverride");var i=UrlModule.get(UrlModule.SERVICE.API.ROOT);return UrlModule.SERVICE.API.ROOT=i,this.isCached("slackerUser")&&this.appRef.canUseRadio&&(this.appRef.usesSlackerServices=!0),this.lxlDiscoveryPromise=new Promise(((e,t)=>{this.appRef.NETWORKING.do(i,((i,s,a)=>this._onLXLApiDiscovery.apply(this,[i,s,a,e,t])))})),this},cache:function(e,t){try{localStorage.setItem(e,t)}catch(i){CONSOLE.error(["LocalStorage setItem failed",e,t],i)}},uncache:function(e){try{localStorage.removeItem(e)}catch(t){CONSOLE.error(["LocalStorage removeItem failed",e],t)}},isCached:function(e){try{return localStorage.getItem(e)}catch(t){return CONSOLE.error(["LocalStorage getItem failed",e],t),null}},isApiUnique:function(){const e=this.URLMODULE?.SERVICE?.SLACKER?.API?.HOME;return-1==e?.indexOf("US/1?_rc")&&APP.USER?.slackerUser?.()?.policy},fetch:function(params){const self=this,slackerUser=APP.USER.slackerUser();let src=params.source,url;if(this.isForceUpgradeRequired)return CONSOLE.warn("ServiceModule::fetch: Killing pending request due to force upgrade required - "+params.source),void APP.onForceUpdate();self.lxlDiscoveryPromise.then((()=>
1{if(params.source===this.SOURCE.STATIC)url=UrlModule.get(UrlModule.SERVICE.DATA.STATIC,params.formatParams),APP.NETWORKING.do(url,params.callback,"GET","html");else{if(0==params.source.indexOf("APP.SERVICE")){let sourceValue;try{sourceValue=eval(params.source)}catch(e){sourceValue=void 0}if(!sourceValue)return void self._waitForSource(params.source,50).then((e=>{url=UrlModule.get(e,params.formatParams),self._makeNetworkRequest(url,params,slackerUser)})).catch((e=>{console.error(e)}));url=UrlModule.get(sourceValue,params.formatParams)}else url=UrlModule.get(params.source,params.formatParams);if(!url)return void console.warn("URL is not defined, cannot proceed with fetch");self._makeNetworkRequest(url,params,slackerUser)}})).catch((()=>{console.warn("lxlDiscoveryPromise failed, proceeding without it")}))},_makeNetworkRequest:function(e,t,i){e.indexOf("/mixer/")>-1&&e.indexOf("/1?_")>-1&&i&&i.id&&(e=e.replace("/1?_",`/${i.id}?_`)),e?APP.NETWORKING.do(e,t.callback,t.method,t.dataType,t.data,t.headers,t.noretry):console.warn("URL is not defined, cannot proceed with fetch")},_waitForSource:function(sourceExpression,maxRetries){return new Promise(((resolve,reject)=>{let retries=0;const interval=setInterval((()=>{let sourceValue;try{sourceValue=eval(sourceExpression)}catch(e){sourceValue=void 0}sourceValue?(clearInterval(interval),resolve(sourceValue)):(retries++,retries>=maxRetries&&(clearInterval(interval),reject(new Error(`Source "${sourceExpression}" not resolved after ${maxRetries} retries`))))}),200)}))},discoverSlackerAPI:function(e){const t=this;console.log("discoverSlackerAPI State:",this.slackerDiscoveryPromise),this.invokeCount||(this.invokeCount=0),this.lastInvokeTime||(this.lastInvokeTime=performance.now());let i=performance.now();return i-this.lastInvokeTime<1e3?(this.invokeCount++,this.invokeCount>5&&console.error("Potential Infinite Loop Detected")):this.invokeCount=0,this.lastInvokeTime=i,this.slackerDiscoveryPromise&&!e?(console.log("discoverSlackerAPI :: Returning existing discoveryPromise"),this.slackerDiscoveryPromise):this.retryCount>=50?(console.error("Maximum retry limit reached"),this.retryCount=0,Promise.reject("Maximum retry limit reached")):(this.slackerDiscoveryPromise=new Promise(((e,i)=>{this.isDiscoveringSlacker=!0;const s=JSON.parse(this.isCached("slackerUser")||"{}");s&&s.id&&!APP.USER.slackerUser().id&&(s.basicProfile=null,console.log("setting slackerUser to:",JSON.stringify(s)),APP.USER.slackerUser(s));let a=`${UrlModule.SERVICE.SLACKER.API.ROOT}?site={site}&territory={territory}&timeZone={tz}&accountId={account-id}&platform=`;const n=UrlModule.get(a,null);this.appRef.NETWORKING.do(n,function(s,a,n){0==n.status||n.status>300?(t.appRef.MESSAGING.prompt("apiLoadFail"),i("apiLoadFail")):t._onSlackerApiDiscovery(s,a,n,e,i)}.bind(t))})),this.slackerDiscoveryPromise.catch((()=>{this.retryCount++})),this.slackerDiscoveryPromise)},signSlackerRequest:function(qString,sep={k:"&",v:"="}){var clientKeyId=CONFIG.slackerConfig.tokenClientId,k=CONFIG.slackerConfig.K,signingAlgo=1,sTime=parseInt((new Date).getTime()/1e3,10);this.slackerServerTimeSkew&&(sTime+=parseInt(this.slackerServerTimeSkew,10)),CONSOLE.debug("Sign this: "+qString),CONSOLE.debug("stime: "+sTime);var newQ=`${qString}${sep.k}ki${sep.v}${clientKeyId}${sep.k}si${sep.v}${signingAlgo}${sep.k}ts${sep.v}${sTime}`;CONSOLE.debug("Signing data: "+newQ),this.signingKey||eval(decodeFromHex(k).replace("function decodeFromHex(str) ","this.signingKey=function decodeFromHex(str)"));var sig=SHA1.hex_sha1(this.signingKey()+newQ);return CONSOLE.debug("Sig: "+sig),`${newQ}${sep.k}sh${sep.v}${sig}`},checkSlackerSimpleSig:function(qString){var bits=$.deparam(qString),checkStr,sig;if(bits.sh){if(checkStr=qString.replace("&sh="+bits.sh,""),this.signingKey||eval(decodeFromHex(k).replace("function decodeFromHex(str) ","this.signingKey=function decodeFromHex(str)")),sig=MD5.hex_md5(this.signingKey()+checkStr),sig===bits.sh)return qString;throw new Error("Invalid Signature")}throw new Error("Invalid Signature")},setSlackerServerTimeSkew:function(e){e.stime&&(CONSOLE.debug("Server Time:"+e.stime),this.slackerServerTimeSkew=parseInt((new Date(1e3*e.stime)-new Date)/1e3,10),CONSOLE.debug("serverTimeSkew:"+this.slackerServerTimeSkew))},getGlobalNav:function(){this.fetch({source:UrlModule.SERVICE.API.NAV,callback:this.appRef.appImplementationModule.onServiceNavLinkData.bind(this.appRef.appImplementationModule),formatParams:{territory:APP.USER.slackerUser?.()?.policy?.accountLoc||"US"}})},_onLXLApiDiscovery:function(e,t,i,s,a){if(CONSOLE.info(["ServiceModule::_onLXLApiDiscovery","status",t]),"error"===t)this.appRef.MESSAGING.prompt("apiLoadFail"),a("apiLoadFail");else{if("settings"===e.type){let t=Object.keys(e).filter((e=>"type"!==e)).reduce(((t,i)=>(t[i.toUpperCase()]=e[i],t)),{});e.audioAllowed?APP.canUseRadio=e.audioAllowed:0==e.audioAllowed&&(APP.canShowSlackerStationLink=!1),UrlModule.SERVICE.DATA.SETTINGS=t}
1else e._links&&(Object.keys(e._links).forEach((t=>{UrlModule.SERVICE.API[t.toUpperCase()]=e._links[t].href})),BEACON.tagEvent({name:"appStart"}),!e._links.nav&&e._links.update&&(CONSOLE.warn("ServiceModule::_onLXLApiDiscovery: FORCE UPDATE REQUIRED"),this.isForceUpgradeRequired=!0));e._links&&e._links.settings?APP.NETWORKING.do(UrlModule.get(e._links.settings.href),((e,t,i)=>this._onLXLApiDiscovery.apply(APP.SERVICE,[e,t,i,s,a]))):s()}},_onSlackerApiDiscovery:function(e,t,i,s,a){CONSOLE.info(["ServiceModule::_onSlackerApiDiscovery","status",t]);var n=this;"error"===t?(this.isDiscoveringSlacker=!1,n.appRef.appImplementationModule.onSlackerServiceAPI&&n.appRef.appImplementationModule.onSlackerServiceAPI(!1),a()):(e.links&&e.links.map(((e,t)=>{"accountManagement"!=e.rel||UrlModule.SERVICE.SLACKER.API.CREATEACCOUNT?(e.href.indexOf("www.")>-1&&(e.href=e.href.replace("slacker","livexlive").replace("www","slacker")),"documentation"==e.rel&&(UrlModule.SERVICE.SLACKER.mixerSessionParams=e.href.split("?")[1]),"resolveByTypeAndId"==e.rel&&["ARTIST","ALBUM","SONG","STATION","PODCAST","PODCASTEPISODE"].forEach((t=>APP.SERVICE.urls.SLACKER.DATA[t]=e.href)),UrlModule.SERVICE.SLACKER.API[e.rel.toUpperCase()]=e.href):n.appRef.NETWORKING.do(e.href,((e,t,i)=>n._onSlackerApiDiscovery.apply(n,[e,t,i,s,a])),null,null,null,{bOverrideUserToken:!0})})),UrlModule.SERVICE.SLACKER.API.CREATEACCOUNT&&UrlModule.SERVICE.SLACKER.API.TOKEN&&(this.isDiscoveringSlacker=!1,console.log("onSlackerAPIDiscovery: UrlModule.SERVICE.SLACKER.API.TOKEN",UrlModule.SERVICE.SLACKER.API.TOKEN),s(),n.appRef.appImplementationModule.onSlackerServiceAPI&&(console.log("self.appRef.appImplementationModule.onSlackerServiceAPI(true);"),n.appRef.appImplementationModule.onSlackerServiceAPI(!0))))},_beanify:function(e){for(var t in e)"object"==typeof e[t]?e[t]=this._beanify(e[t]):0==t.indexOf("_")&&(e[t.slice(1)]=e[t],delete e[t]);return e}},registerPackage("com.slacker.app.modules.ServiceModule"),com.slacker.app.modules.ServiceModule=new ServiceModule})()})),bjork("com.slacker.app.modules.SlackerCreatorModule",(function(){!function(){require("com.slacker.util.Console");const e=require("com.slacker.event.EventNotifier"),t=(require("com.slacker.app.actions.MenuAction"),require("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree")),i=(require("com.slacker.app.actions.slacker.radio.GetSlackerPlaylistAction"),require("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction")),s=require("com.slacker.app.actions.slacker.radio.EditStationAction"),a=require("com.slacker.app.actions.slacker.radio.EditPlaylistAction"),n=require("com.slacker.app.actions.slacker.radio.CreateStationAction");function o(){extendClass(this,new e(this)),this.__constants(),this.__properties(),this.__constructor()}o.prototype={__constants:function(){this.EVENT={STATION_CREATED:"station-created",STATION_RENAMED:"station-renamed",STATION_DESCRIPTION_CHANGED:"station-description-changed",STATION_REMOVED:"station-removed",ARTIST_ADDED:"artist-added",ARTIST_REMOVED:"artist-removed",PLAYLIST_CREATED:"playlist-created",PLAYLIST_RENAMED:"playlist-renamed",PLAYLIST_DESCRIPTION_CHANGED:"playlist-description-changed",PLAYLIST_REMOVED:"playlist-removed",PLAYLIST_UPDATED:"playlist-updated"}},__properties:function(){this.createStation=new n},__constructor:function(){},init:function(){},getCustomStationsAndPlaylists:function(e,i,s){t.execute((function(t,i,a){let n=[];t.myTree&&t.myTree.Category&&(t.myTree.Category.length||(t.myTree.Category=[t.myTree.Category]),t.myTree.Category.forEach((e=>{s?"customplaylists"==e.sid&&(e.Station&&!e.Station.length&&(e.Station=[e.Station]),n=n.concat(e.Station.filter((e=>-1==e.id.indexOf("/999999"))).map((e=>(e.checked=ko.observable(!1),e))))):"customstations"==e.sid&&(e.Station&&!e.Station.length&&(e.Station=[e.Station]),n=n.concat(e.Station.filter((e=>"artistMix"==e.type)).map((e=>(e.checked=ko.observable(!1),e)))))}))),n.length&&n.sort(((e,t)=>e.name<t.name)),e&&e(n)}),i)},createRadioStation:function(e,i,s,a){this.createStation.execute(e,i,s,((e,i,n)=>{this._onCreateStationActionResponse(e,i,n,(i=>{i?s?this.renameStation(e.response.sid,s,(e=>{a&&a(e,i),200==e&&(t.clearSessionCache(),this.dispatch({type:this.EVENT.STATION_CREATED,station:i}))})):a&&a(n.status,i):a&&a(n&&n.status,null)}))}))},addArtistToStation:function(e,t,i){e&&t&&t.length&&t.forEach((t=>{(new s).execute(["artists"],{sid:t.sid,edit:{add:e}},((s,a,n)=>{200==n.status&&this.dispatch({type:this.EVENT.ARTIST_ADDED,sid:t.sid,artist:e}),i&&i(s,a,n)}))}))},removeArtistFromStation:function(e,t,i){(new s).execute(["artists"],{sid:t,edit:{remove:e}},((s,a,n)=>{200==n.status&&this.dispatch({type:this.EVENT.ARTIST_REMOVED,sid:t,artist:e}),i&&i(s,a,n)}))},renameStation:function(e,i,a){(new s).execute(["name"],{sid:e,edit:{name:i}},((s,n,o)=>{a&&a(o.status),200==o.status&&(t.updateSessionCache(e,i),this.dispatch({type:this.EVENT.STATION_RENAMED,sid:e,name:i}))}))},changeStationDescription:function(e,t,i){(new s).execute(["description"],{sid:e,edit:{description:t}},((s,a,n)=>{i&&i(n.status),200==n.status&&this.dispatch({type:this.EVENT.STATION_DESCRIPTION_CHANGED,sid:e,description:t})}))},deleteStation:function(e,i){(new s).execute("delete",{sid:e},((s,a,n)=>{i&&i(n.status),200==n.status&&(t.clearSessionCache(),this.dispatch({type:this.EVENT.STATION_REMOVED,sid:e}))}))},createPlaylist:function(e,i,s){const n=["playlists",APP.USER.slackerUser().id,(new Date).getTime()].join("/"),o={name:i,image:null,description:null,song:e};(new a).execute("create",{id:n,edit:o},((e,a,o)=>{s&&s(o.status,e),200==o.status&&(t.clearSessionCache(),this.dispatch({type:this.EVENT.PLAYLIST_CREATED,id:n,name:i,playlist:e}))}))},addTracksToPlaylist:function(e,t,s,n){t.forEach((t=>{let o=[];
1!t.id||t.playlistid?(t.songs||(t.songs={song:[]}),t.songs.song&&!Array.isArray(t.songs.song)&&(t.songs.song=[t.songs.song]),o=o.concat(t.songs.song||[]),e.forEach((e=>{const i=e.track?e.track[0].id:e.trackId||e.tid;e.nodeType||(!e.tid&&!e.trackId||e.id?e.nodeType="song":(e.nodeType="track",e.id=e.tid||e.trackId)),"song"==e.nodeType?t.contains("tid",i)||o.push(e):"track"==e.nodeType&&(t.contains("tid",e.id)||o.push(e))})),(new a).execute("add",{id:t.playlistid,edit:{song:o},def:t},((e,i,a)=>{s&&s(a.status,e),200!=a.status||n||this.dispatch({type:this.EVENT.PLAYLIST_UPDATED,action:"add",id:t.playlistid,playlist:e})}))):(new i).execute({id:t.id,type:"playlist"},((t,i,a)=>{t?this.addTracksToPlaylist((new Array).concat(e),[t],s,n):"function"==typeof s&&s(0)}))}))},reorderPlaylist:function(e,t,i,s){let a=i.songs.song.splice(e,1)[0];t>e&&t--,i.songs.song.splice(t,0,a),this.addTracksToPlaylist([],[i],((a,n)=>{s&&s(a,n),200==a&&this.dispatch({type:this.EVENT.PLAYLIST_UPDATED,id:i.playlistid,action:"reorder",playlist:n,from:e,to:t})}),!0)},savePlaylistTracks:function(e,t,i,s){const a=i.songs.song,n=t||[];i.songs.song=e,this.addTracksToPlaylist([],[i],((e,t)=>{200!=e&&(i.songs.song=a),s&&s(e,t),200==e&&(n.length?this.dispatch({type:this.EVENT.PLAYLIST_UPDATED,id:i.playlistid,action:"remove",playlist:i,newPlaylist:t,removed:n}):this.dispatch({type:this.EVENT.PLAYLIST_UPDATED,id:i.playlistid,action:"reorder",playlist:t,from:0,to:0}))}),!0)},renamePlaylist:function(e,i,s){(new a).execute(["name"],{id:e.playlistid,edit:{name:i},def:e},((a,n,o)=>{s&&s(o.status),200==o.status&&(t.updateSessionCache(e.playlistid,i),this.dispatch({type:this.EVENT.PLAYLIST_RENAMED,id:e.playlistid,name:i}))}))},changePlaylistDescription:function(e,t,i){(new a).execute(["description"],{id:e.playlistid,edit:{description:t},def:e},((s,a,n)=>{i&&i(n.status),200==n.status&&this.dispatch({type:this.EVENT.PLAYLIST_DESCRIPTION_CHANGED,id:e.playlistid,description:t})}))},deletePlaylist:function(e,i){(new a).execute("delete",{id:e},((s,a,n)=>{i&&i(n.status),200==n.status&&(t.clearSessionCache(),this.dispatch({type:this.EVENT.PLAYLIST_REMOVED,id:e}))}))},removeTracksFromPlaylist:function(e,t,s,n){let o;if(t.id&&!t.playlistid)return void(new i).execute({id:t.id,type:"playlist"},((t,i,a)=>{t&&this.removeTracksFromPlaylist(e,t,s,n)}));o=[].concat(t.songs.song);let r=0;e.sort(),e.forEach((e=>{let t=e-r;o.splice(t,1),r++})),(new a).execute("remove",{id:t.playlistid,edit:{song:o},def:t},((i,a,o)=>{s&&s(o.status,i),200!=o.status||n||this.dispatch({type:this.EVENT.PLAYLIST_UPDATED,action:"remove",id:t.playlistid,playlist:t,newPlaylist:i,removed:e})}))},_onCreateStationActionResponse:function(e,t,i,s){if(e&&e.response&&e.response.sid){let t=e.response.Station?e.response.Station:e.response;(t.minPlayTier||t.minViewTier)&&(t.rights={tierToPlay:t.minPlayTier||0,tierToView:t.minViewTier||0}),s&&s(t)}else s&&s(null)}},registerPackage("com.slacker.app.modules.SlackerCreatorModule"),com.slacker.app.modules.SlackerCreatorModule=new o}()})),bjork("com.slacker.app.modules.SlackerPlayerSessionModule",(function(){(function(){const CONSOLE=require("com.slacker.util.Console"),EventNotifier=require("com.slacker.event.EventNotifier"),Browser=require("com.slacker.util.browser.Browser"),UrlModule=com.slacker.app.modules.UrlModule,NetworkModule=require("com.slacker.app.modules.NetworkModule"),RadioPlayer=require("com.slacker.player.radio.VideoJS"),GetSlackerProfileTree=require("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree"),GetSlackerStationAction=require("com.slacker.app.actions.slacker.radio.GetSlackerStationAction"),SlackerBaseStationCacheAction=require("com.slacker.app.actions.slacker.radio.SlackerBaseStationCacheAction"),GetSlackerStationTreeAction=require("com.slacker.app.actions.slacker.radio.GetSlackerStationTreeAction"),GetSlackerPlaylistAction=require("com.slacker.app.actions.slacker.radio.GetSlackerPlaylistAction"),GetSlackerItemDetailAction=require("com.slacker.app.actions.slacker.radio.GetSlackerItemDetailAction"),ResolveSlackerSeoUrlAction=require("com.slacker.app.actions.slacker.ResolveSlackerSeoUrlAction"),SendServiceReportAction=require("com.slacker.app.actions.slacker.SendServiceReportAction"),WebBeaconAction=require("com.slacker.app.actions.slacker.WebBeaconAction"),LiveStreamHeartbeatAction=require("com.slacker.app.actions.slacker.radio.LiveStreamHeartbeatAction"),WSEventAction=require("com.slacker.app.actions.slacker.radio.WSEventAction"),RatingAction=require("com.slacker.app.actions.slacker.radio.RatingAction"),GetNextRadioTrackAction=require("com.slacker.app.actions.slacker.radio.GetNextRadioTrackAction"),GetOnDemandTrackAction=require("com.slacker.app.actions.slacker.radio.GetOnDemandTrackAction"),StopSlackerServerSessionAction=require("com.slacker.app.actions.slacker.radio.StopSlackerServerSessionAction"),ParseVastAction=require("com.slacker.app.actions.slacker.ParseVastAction"),PlayerSettingsAction=require("com.slacker.app.actions.slacker.radio.PlayerSettingsAction"),EditStationAction=require("com.slacker.app.actions.slacker.radio.EditStationAction"),CreatorModule=require("com.slacker.app.modules.SlackerCreatorModule"),PlayerSongOptionsAction=require("com.slacker.app.actions.slacker.options.PlayerSongOptionsAction"),CaptchaAction=require("com.slacker.app.actions.slacker.user.CaptchaAction"),FAVS_STATION_NAMES=["favorites radio","my favorites radio","my radio"];function SlackerPlayerSessionModule(){extendClass(this,new EventNotifier(this)),this.__constants(),this.__properties(),this.__constructor()}SlackerPlayerSessionModule.prototype={__constants:function(){this.TYPE_PLAYLIST="playlist",this.TYPE_PODCAST="podcast",this.TYPE_AUDIOBOOK="audiobook",this.TYPE_STATION="station",this.PLAYER_DEFAULT="default",this.PLAYER_FULL="fullscreen",this.PLAYER_MINI="mini",this.PLAYER_FLOAT="floating",this.MODE_RADIO="radio",this.MODE_ODS="ods",this.RATING_BAN=-100,this.RATNG_HEART=100,this.EVENT={RATING:"onPlayerRating",STATIONSTARTED:"onStationStarted",STATIONSTOPPED:"onStationStopped"},this.PLAYBACK_RATES=["1","1.5","2","2.5"],this.MAX_OD_LOAD_ATTEMPTS=5},__properties:function(){this.playlist=ko.observableArray().extend({rateLimit:500}),this.currentPlayableItem=ko.observable(),this.activeDrawerTab=ko.observable("history"),this.currentTrack=ko.observable(),this.onDeckTrack=ko.observable(),this.canShowCastBtn=ko.observable(),this.lastPlayedPlayableItem=null,this.favsRadioSid=null,this.radioPlayer=new RadioPlayer,this.playerSize="default",this.radioPlayerStateManager=ko.observable(),this.captchaManager=CaptchaAction,this._playerSettingsAction=new PlayerSettingsAction,this.playerSettings=this._playerSettingsAction.execute.bind(this._playerSettingsAction,this),this.songOptions=new PlayerSongOptionsAction,this.videoAdTriggers={},this.isCasting=!1,this.currentDstm,this.bIsSkipping,this.wasBumped,this.podcastDef=null,this.drawerExpanded=ko.observable(!1),this._qa={getStation:SlackerBaseStationCacheAction.getStation.bind(SlackerBaseStationCacheAction),getStationTree:GetSlackerStationTreeAction.execute.bind(GetSlackerStationTreeAction)}},__constructor:function(){this.nextRadioTrackAction=new GetNextRadioTrackAction,this.nextODTrackAction=new GetOnDemandTrackAction,this.wsEvent=new WSEventAction,this.beaconEvent=new WebBeaconAction,this.stopSessionAction=new StopSlackerServerSessionAction},init:function(){const e=this._onRadioPlayerEvent.bind(this),t=this.radioPlayer,i=APP.USER.slackerUser();try{this.lastPlayedPlayableItem=JSON.parse(APP.SERVICE.isCached("lastSlackerPlayed")),this.lastPlayedPlayableItem&&(delete this.lastPlayedPlayableItem.odLoadAttempts,delete this.lastPlayedPlayableItem.gaveUp,delete this.lastPlayedPlayableItem.hasPlayed)}catch(e){APP.SERVICE.uncache("lastSlackerPlayed"),CONSOLE.warn("Stored last playable empty OR corrupt. Ignoring and cleaning.")}if(["EMBEDFAILURE","VIDEOCONTAINERREADY","DISPLAYERROR","ONFULLSCREENTOGGLE","ONSEEKDISALLOWED","AUTOPLAY_DISABLED","VIDEOCONTAINERREADY","ADNETWORKCONTAINERREADY","ADNETWORKREADY","ADNETWORKLOADING","DBK","VIDEOADNOTREADY","VIDEOADSTARTED","VIDEOADENDED","NOVIDEOAD","ADACTION"].forEach((i=>{t.attachEvent(t.EVENT[i],e)})),["COMPLETED","STARTED","PAUSE","RESUME","DURATIONCHANGE","TIMEUPDATE","ERROR","DISPLAYERROR"].forEach((i=>{t.attachEvent(t.EVENT.PLAYBACK[i],e)})),["STATION_RENAMED","STATION_REMOVED","PLAYLIST_RENAMED","PLAYLIST_UPDATED","PLAYLIST_REMOVED"].forEach((e=>{CreatorModule.attachEvent(CreatorModule.EVENT[e],this._onCreatorModuleEvent.bind(this))})),APP.appImplementationModule._onRadioEventListener&&!APP.appImplementationModule.radioEventsBound&&(APP.appImplementationModule.radioEventsBound=!0,_impListener=APP.appImplementationModule._onRadioEventListener.bind(APP.appImplementationModule),["COMPLETED","STARTED","PAUSE","RESUME","DURATIONCHANGE","TIMEUPDATE","ERROR","DISPLAYERROR"].forEach((e=>{t.attachEvent(t.EVENT.PLAYBACK[e],_impListener)})),["STATIONSTARTED","STATIONSTOPPED","RATING"].forEach((e=>{this.attachEvent(this.EVENT[e],_impListener)}))),this.radioPlayerStateManager({state:"stop",isPlayableChanged:!1,playerStyle:`video-js ${this.MODE_RADIO} ${this.PLAYER_DEFAULT}`,buttonstyle:"stop",lastTrackIsTied:!1,skipsRemaining:0,canShowSkipCount:!1,isStarting:!1,dstmClock:ko.observable(null),countdownStartTime:ko.observable(null),canSkip:()=>this.skipsRemaining>0,canSkipBack:()=>!1,playPause:e=>{const t=this.radioPlayer,i=this.currentPlayableItem(),s=this.radioPlayerStateManager();if(s.isStarting)CONSOLE.warn("Resume in process. Ignore transport request while state is in flux.");else if(t.currentTrackObj)t.needsRestartOnResume?(s.isStarting=!0,this.radioPlayerStateManager(s),APP.checkAcessibilityTTSAction("reconnecting to live stream"),t.reconnectToStream()):t.wasPaused?(this.isCasting?this.radioPlayer?.castPlayer?.castController?.playOrPause():(s.isStarting=!0,this.radioPlayerStateManager(s),t.resume(e)),APP?.currentView?.currentYtPlayer?.getPlayerState?.()==YT.PlayerState.PLAYING&&APP.currentView.currentYtPlayer.pauseVideo()):this.isCasting?this.radioPlayer?.castPlayer?.castController?.playOrPause():t.pause(e);else if(i){let e=i.id;switch(i.id=null,i.subtype){case"station":this.startRadioStation(e);break;case"album":e||(e=`albumplaylists/${i.itemMatchId}`);case"playlist":this.startPlaylist(e,null,null,null,i.nextIdx);break;case"podcast":{const e=this.currentTrack();this.startPodcast(i.itemMatchId,null,e&&e.episodeId?{episodeId:e.episodeId}:null);break}case"audiobook":this.startAudiobook(e)}}}}),i?.policy)try{if(i.policy?.ads?.dstmUntil){if(APP.SERVICE.slackerServerTimeSkew){let e=parseInt(APP.SERVICE.slackerServerTimeSkew,10);i.policy.ads.dstmUntil+=e,i.policy.ads.dstmStart+=e}let e=this.radioPlayerStateManager();e.countdownStartTime(1e3*i.policy.ads.dstmStart),e.dstmClock(1e3*i.policy.ads.dstmUntil)}}catch(e){CONSOLE.warn("Unable to process dstmUntil from UserPolicy")}this.playlist.extend({rateLimit:200}),setTimeout((()=>{this?.lastPlayedPlayableItem?.id?.indexOf("stations/")>-1?this.stopSessionAction.execute(this?.lastPlayedPlayableItem,null,"SessionStart",0,(()=>
1{CONSOLE.info("SlackerPlayerSessionModule::SessionStart stopped possible orphaned station."),this.initLastPlayed()})):this.initLastPlayed();try{ko.applyBindings(APP,$("#radio")[0]),setTimeout((()=>this.radioPlayer.embed($("#radio-player")[0])),500)}catch(e){}}),10)},restartLastAttempted:function(e){const t=APP.slackerPlayerSession().currentPlayableItem();return t.mode==this.MODE_ODS?this.getNextODTrack(e,this.playlist()[t.nextIdx]):this.getNextRadioTrack(e,"skip")},initLastPlayed:function(e=null){"web"!=APP.implementationSuperType()?CONSOLE.warn(["SlackerPlayerSessionModule::initLastPlayed","Ignoring for non WEB application type."]):this.lastPlayedPlayableItem&&(this.lastPlayedPlayableItem.isShuffle=()=>!1,this.lastPlayedPlayableItem.stop=(e,t,i)=>{this.currentPlayableItem(null),t?.()},this.lastPlayedPlayableItem.isPreload=!0,this.currentPlayableItem(this.lastPlayedPlayableItem),this.currentTrack({title:"Press play to start",artist:null,album:null,olicensed:1,basicradio:1,songlink:null,artistlink:null,albumlink:null,clickAction:null,subTypes:[this.lastPlayedPlayableItem.subtype],scrub:"no",type:this.lastPlayedPlayableItem.mode,skip:"yes",canShowOptions:!1,copyright:null,albumCoverArt:{host:`${this.lastPlayedPlayableItem.itemImage}`,path:""},URL:"",format:"MP3",link:null,observableRating:()=>0,active:()=>!1,isShuffle:()=>!1}))},isFavsStationPlaying:function(e){const t=e||this.currentPlayableItem();if(!t)return!1;if("favs"===t.itemMatchType)return!0;const i=function(e){return"string"==typeof e&&e?e.split("/").pop():null},s=t.coreId||i(t.id);if(s){const e=APP.currentView,t=[this.favsRadioSid,e&&"function"==typeof e.favsRadioSid?e.favsRadioSid():null];for(let e=0;e<t.length;e++)if(t[e]&&i(t[e])===String(s))return!0}return"station"===t.type&&FAVS_STATION_NAMES.indexOf(String(t.name||"").trim().toLowerCase())>-1},checkFavsRadioPlayable:function(e){const t=require("com.slacker.app.actions.slacker.user.GetUserRatingsAction"),i=require("com.slacker.app.actions.slacker.radio.BookmarkItemAction");(new t).execute(null,((t,s)=>{200==t&&s&&s.length?e(!0):i.execute("init",(()=>{const s=i.bookmarks&&i.bookmarks.artist;s&&Object.keys(s).length?e(!0):e(!(200==t&&!i.lastLoadFailed)&&null)}))}))},startRadioStationFromId:function(e,t,i,s){"artistmix"==e&&t&&t.id?this.startRadioStation(t.id):CreatorModule.createRadioStation(e,t,null,((t,a)=>{a?(("force"===s||"artist"!=e&&!s)&&APP.MESSAGING.prompt("radio-by-type",{type:e,title:i}),"favs"===e&&a.sid&&(this.favsRadioSid=a.sid),this.startRadioStation(a.sid)):"favs"===e&&APP.MESSAGING.prompt("favsRadioEmpty")}))},startPodcast:function(e,t,i,s){const a=new GetSlackerItemDetailAction,n=this.currentTrack(),o=this.radioPlayerStateManager();let r={},l=[];this.podcastDef=t;const c=this._extractEpisodesView(),d=!!c&&c.pagingData(),u={pageSize:d?d.page.size:50,pageNumber:d?d.page.number:0},h=function(e,i){let s={title:e.title,artist:null,album:t.subtitle,podcastId:e.podcastId,episodeId:e.episodeId,podcastLink:t.link,olicensed:1,basicradio:1,songlink:null,artistlink:null,albumlink:null,subTypes:["podcast"],scrub:"yes",itemPosition:i,type:"ods",skip:"yes",canShowOptions:!0,albumCoverArt:{host:`${t.imageUrl||t.imagePath}`,path:""},URL:"",format:"MP3",contentUrl:e.contentUrl};return s.active=ko.pureComputed({read:function(){const e=APP.slackerPlayerSession().currentTrack();return this._active||e&&e.episodeId==this.episodeId},write:function(e){this._active=e},owner:s}),e.links&&!e.links.share&&(e.links.forEach((t=>{e.links[t.rel]=t.href})),s.link=e.links.share),s};if(APP.USER.resetAysl(),!e&&i&&(e=i.podcastId),t&&t.episodes)if(i||(i=t.episodes[0]),i.contentUrl){if(n&&n.episodeId&&i.episodeId==n.episodeId){const e="function"==typeof this.radioPlayerStateManager?this.radioPlayerStateManager():null;if(!e||"pause"===e.buttonstyle||this.radioPlayer&&this.radioPlayer.currentTrackObj)return void CONSOLE.warn("Redundant podcast request. Podcast already playing.")}if(t.links&&!t.links.share&&(t.links.forEach((e=>{t.links[e.rel]=e.href})),t.link=t.links.share),!this._doRightsCheck(t)&&!this._doStopOnChangeSource(s||"ChangeStation","StationChange",this.startPodcast,[e,t,i,s])){if(r={type:this.TYPE_PODCAST,mode:this.MODE_ODS,nextIdx:i?-2:-1,initPlaylist:!0,isStarting:!0,isS
1huffle:ko.observable(!1),id:e,name:t.title,finetuneable:!1,skippingAllowed:!0,drawerType:"EPISODES",subtype:"podcast",itemMatchType:"podcast",itemMatchId:t.podcastId,itemImage:t.imageUrl,isLive:!1,stop:(e,t)=>{const i=APP.slackerPlayerSession();APP.MESSAGING.closeContextMenu(),i.radioPlayer&&(i.isCasting?i.radioPlayer.onPingBackAction("event","stop"):i.radioPlayer.stop()),(!t||"ChangeStation"!==e&&"OndemandTrack"!==e)&&i.setPlayerSize(i.PLAYER_DEFAULT),$("body").removeClass("radio-bar-active"),i.currentTrack(null),i.currentPlayableItem(null),t&&t()}},o.lastTrackIsTied=!1,o.skipsRemaining=1e3,o.canShowSkipCount=!1,o.canSkipBack=()=>!0,o.canSkip=()=>!0,o.isPlayableChanged=!0,this.radioPlayerStateManager.valueHasMutated(),t.episodes.forEach(((e,t)=>{l.push(h(e,t)),i&&i.episodeId==e.episodeId&&(r.nextIdx=t-1)})),-2==r.nextIdx&&i){let e=l.length;l.push(h(i,e)),r.nextIdx=e-1}this.currentPlayableItem(r),this.currentTrack(null),this.playlist(l),APP.SERVICE.cache("lastSlackerPlayed",JSON.stringify(r)),CONSOLE.info("SlackerPlayerSessionModule::startPodcast - Starting "+e),$("#radio-player")[0]?this._onPlayerTrackEnded("PodcastStart"):(this.currentPlayableItem(null),setTimeout((()=>
1this.startPodcast(e,t,s)),500))}}else a.execute({id:i.episodeId,type:"podcastEpisode"},((i,a,n)=>{i?this.startPodcast(e,t,i,s):(this._setSessionPlayerStyle(),APP.MESSAGING.prompt("genericItemNotFound",{type:"episode",beaconId:"episodeNotFound"}))}));else a.execute({id:e,type:"podcast",...u},((t,a,n)=>{t?this.startPodcast(e,t,i,s):(this._setSessionPlayerStyle(),APP.MESSAGING.prompt("genericItemNotFound",{type:"podcast",beaconId:"podcastNotFound"}))}))},startAudiobook:function(e,t,i){new GetSlackerItemDetailAction;const s=this.currentTrack(),a=this.radioPlayerStateManager();let n={},o=[];this.audiobookDef=t;const r=(e,t)=>{let i={title:e.title,artist:null,album:null,audiobookId:e.id||e.audiobookId,audiobookLink:e.link,olicensed:1,basicradio:1,songlink:null,artistlink:null,albumlink:null,subTypes:["audiobook"],scrub:"yes",itemPosition:t,type:"ods",skip:"no",canShowOptions:!0,albumCoverArt:{host:`${e.imageUrl||e.imagePath}`,path:""},URL:"",format:"MP3",contentUrl:e.contentUrl};return i.active=ko.pureComputed({read:function(){const e=APP.slackerPlayerSession().currentTrack();return this._active||e&&e.episodeId==this.episodeId},write:function(e){this._active=e},owner:i}),e.links&&!e.links.share&&(e.links.forEach((t=>{e.links[t.rel]=t.href})),i.link=e.links.share),i};if(APP.USER.resetAysl(),s&&s.episodeId&&t.episodeId==s.episodeId)CONSOLE.warn("Redundant audiobook request. Audiobook already playing.");else{if(t?.links&&!t.links.share&&(t.links.forEach((e=>{t.links[e.rel]=e.href})),t.link=t.links.share),!t){return NetworkModule.do(UrlModule.get(APP.SERVICE.URLMODULE.SERVICE.SLACKER.DATA.AUDIOBOOKFULL,{id:e}),function(t){this.startAudiobook(e,{...t,albumCoverArt:{host:t.imgUrl,path:""},olicensed:1,basicradio:1})}.bind(this),"GET","json",null)}this._doStopOnChangeSource(i||"ChangeStation","StationChange",this.startAudiobook,[e,t,i])||(n={trackArt:t.featureImgUrl,itemMatchId:t.audiobookId,objectId:t.objectId,isbn:t.isbn,title:t.title,author:t.author,publisher:t.publisher,nodeType:"audiobook",stationimage:t.stationimage,imgUrl:t.imgUrl,contentUrl:t.contentUrl,links:t.links,type:this.TYPE_AUDIOBOOK,mode:this.MODE_ODS,nextIdx:0,initPlaylist:!0,isStarting:!0,isShuffle:ko.observable(!1),id:e,name:t.title,finetuneable:!1,skippingAllowed:!0,drawerType:"EPISODES",subtype:"audiobook",itemMatchType:"audiobook",itemImage:t.featureImgUrl,isLive:!1,stop:(e,t)=>{const i=APP.slackerPlayerSession();APP.MESSAGING.closeContextMenu(),i.radioPlayer&&(i.isCasting?i.radioPlayer.onPingBackAction("event","stop"):i.radioPlayer.stop()),(!t||"ChangeStation"!==e&&"OndemandTrack"!==e)&&i.setPlayerSize(i.PLAYER_DEFAULT),$("body").removeClass("radio-bar-active"),i.currentTrack(null),i.currentPlayableItem(null),t&&t()}},a.lastTrackIsTied=!1,a.skipsRemaining=1e3,a.canShowSkipCount=!1,a.canSkipBack=()=>!0,a.canSkip=()=>!0,a.isPlayableChanged=!0,this.radioPlayerStateManager.valueHasMutated(),t&&o.push(r(t,0)),this.currentPlayableItem(n),this.currentTrack(null),this.playlist(o),APP.SERVICE.cache("lastSlackerPlayed",JSON.stringify(n)),CONSOLE.info("SlackerPlayerSessionModule::startAudiobook - Starting "+e),$("#radio-player")[0]?(this.onDeckTrack(null),this.radioPlayer.stop(!1,!0),this._onNextSlackerServiceTrack(200,{Next:{Track:t}})):(this.currentPlayableItem(null),setTimeout((()=>this.startAudiobook(e,t,i)),500)))}},startRadioStation:function(e,t,i,s){try{if(com.slacker.sads.SAds._hardBlockActive){try{APP.MESSAGING?.prompt?.("audioAdBlocked")}catch(e){}return}}catch(e){}const a=APP.USER.slackerUser(),n=this.currentPlayableItem();let o={},r="string"==typeof e?e.split("/"):[];if(APP.USER.resetAysl(),"number"==typeof e||3!=r.length?(r=["stations",a.id,e],(e=r.join("/")).split("/")[2]||(CONSOLE.warn("startRadioStation - Passed id is invalid."),e=null)):e&&(e.indexOf("/0/")>-1||e.indexOf("/1/")>-1)?e=e.replace("/0/","/"+a.id+"/").replace("/1/","/"+a.id+"/"):!e&&t&&(e=t.sid||t.id),n&&n.id==e){const e="function"==typeof this.radioPlayerStateManager?this.radioPlayerStateManager():null;if(!e||"pause"===e.buttonstyle)return void CONSOLE.warn("Redundant start station request. Station already playing.")}if(!e&&!t)return CONSOLE.warn("startRadioStation called without id and/or def"),void APP.MESSAGING.prompt("genericItemNotFound",{type:"station",beaconId:"stationNotFound"});if(!t){let n=SlackerBaseStationCacheAction.getStation(r[2]);if(!n||!n.features)return CONSOLE.info("Fetching station from server: "+e),void(new GetSlackerStationAction).execute(e,((e,t)=>
1this._onFullStationDefFetchForPlay(e,t,i,s)),3==r.length&&-1==new String(e).indexOf(`/${a.id}/`));CONSOLE.debug("Cached station def found: "+e),t=n}if(!this._doRightsCheck(t)&&!this._doStopOnChangeSource(i||"ChangeStation","StationChange",this.startRadioStation,[e,t,i,s])){if(CONSOLE.info("SlackerPlayerSessionModule::startRadioStation - Starting "+e),o={type:this.TYPE_STATION,mode:this.MODE_RADIO,isShuffle:ko.observable(!1),id:e,leadoff:s,coreId:r[2],coreMapId:t.coreStationMapping?t.coreStationMapping.sid.split("/")[2]:r[2]||0,itemImage:t.imgPath,name:t.name,finetuneable:!0,sliders:t.slider,drawerType:"HISTORY",subtype:"station",itemMatchType:"station",itemMatchId:t.sid,isLive:"stream"===t.stationType,stop:this._stopSlackerPlayerServerSession.bind(this)},t.stationType&&t.stationType.indexOf(":")>-1){const e=t.stationType.split(":");o.itemMatchType=e[0],o.itemMatchId=e[1]}if(t.features?(o.finetune=t.features.finetuneAllowed,o.skippingAllowed=t.features.skippingAllowed):(o.finetune=!1,o.skippingAllowed=!0),"uri"==o.itemMatchType&&(o.itemMatchId.indexOf("album")>-1?o.itemMatchType="album":o.itemMatchId.indexOf("playlist")>-1&&(o.itemMatchType="playlist"),o.itemMatchId=o.itemMatchId.split("/")[1]),0==e.indexOf("sessions/")&&(o.itemMatchType="sharedSession",o.name=t.name,o.startOffset=t.startOffset/1e3,APP.remoteSession()?.__startPolling()),this.currentPlayableItem(o),this.currentTrack(null),"sharedSession"!=o.itemMatchType&&APP.SERVICE.cache("lastSlackerPlayed",JSON.stringify(o)),this.getNextRadioTrack("","STATIONCHANGE"),!t.slider&&o.finetune){const t=new GetSlackerStationAction;t.bSlidersOnly=!0,t.execute(e,this._onFullStationDefFetchForPlay.bind(this),!0)}}},startPlaylist:function(e,t,i,s,a){const n=this,o=APP.USER.slackerUser().policy.capabilities.features,r=new GetSlackerPlaylistAction,l=new GetSlackerItemDetailAction,c=this.currentPlayableItem();let d={},u=e.split("/");if(APP.USER.resetAysl(),o.ondemand.enabled||"SlackerCommandTest"==e){if(c?.id==e&&void 0===a){if("stop"!==this.radioPlayerStateManager().state)return void CONSOLE.warn("Redundant start playlist request. Playlist already playing.");c.id=null}if(!s&&void 0!==a&&c&&this.playlist().length&&("album"==c.itemMatchType&&u[0]&&u[1]==c.itemMatchId||"playlist"==c.itemMatchType&&e==c.itemMatchId&&this.playlist()&&this.playlist().length))return c.nextIdx=a,c.id||(c.id=e),void this.onDemandPlayPause(this.playlist()[a]);t||c&&c.id==e?this._doStopOnChangeSource(i||"OndemandTrack","ODStart",this.startPlaylist,[e,t,i,s,a])||(t&&(this._preparePlaylistTracks(t),this.playlist(t.songs.song)),this.currentTrack(null),this.onDeckTrack(null),CONSOLE.info("SlackerPlayerSessionModule::startPlaylist - Starting "+e),d={type:this.TYPE_PLAYLIST,mode:this.MODE_ODS,id:e,name:t.name,drawerType:"TRACKS",nextIdx:isNaN(a)?-1:a-1,initPlaylist:!0,finetuneable:!0,finetune:!1,isShuffle:ko.observable(!1),autoConvertToStation:s,isLive:!1,skippingAllowed:!0,itemImage:t.imgPath||t.image,stop:this._stopSlackerPlayerServerSession.bind(this)},e.indexOf("album")>-1?(d.subtype="album",d.itemMatchType="album",d.itemMatchId=u[1]):(d.subtype="playlist",d.itemMatchType="playlist",d.itemMatchId=e),c&&d.id==c.id?d.id!=c.id&&c.isShuffle()&&this.togglePlaylistShuffleMode(!0,a):(c?.isShuffle?.()&&this.togglePlaylistShuffleMode(!1),this.currentPlayableItem(d),(isNaN(Number(d.itemMatchId))||"playlist"!=d.itemMatchType)&&APP.SERVICE.cache("lastSlackerPlayed",JSON.stringify(d))),this._onPlayerTrackEnded("OndemandTrack")):e.indexOf("album")>-1?l.execute({id:u[1],type:"album"},(function(t,o,r){t?(t.id="albumplaylists/"+(t.id||t.albumId),t.albumName&&(t.name=t.albumName),(t.tracks||t.track).map((function(e){return APP.currentView&&e.links&&e.links.length&&(e.links=APP.halifyLinks(e.links),!e.link&&e.links.share&&(t.link=e.links.share.href.split(".com/")[1]),!e.artistLink&&e.links.artistShare&&(t.artistLink=e.links.artistShare.href.split(".com/")[1]),!e.artistName&&e.artist&&(e.artistName=e.artist.artistName,t.artist=e.artist)),e.artistlink||(e.artistlink=t.artistLink,e.artistid=t.artistId),"_"==e.artistName&&(e.artist=t.artist,e.artistName=t.artistName),e.albumLink||(e.albumlink=t.link),e})),t.songs={song:t.tracks||t.track},n.startPlaylist(e,t,i,s,a)):(n._setSessionPlayerStyle(),APP.MESSAGING.prompt("genericItemNotFound",{type:"album",beaconId:"albumNotFound"}))})):r.execute(e,(function(t,o){o?n.startPlaylist(e,o,i,s,a):(n._setSessionPlayerStyle(),APP.MESSAGING.prompt("genericItemNotFound",{type:"playlist",beaconId:"playlistNotFound"}))}))}else APP.MESSAGING.prompt("on-demand-playlist")},getNextRadioTrack:function(e,t){let i=this.currentPlayableItem();if(requestSid=i.id,!APP.useAysl||e&&"end"!=e||!APP.USER.isAyslTimeout())if(this.radioPlayer.pingPOST&&1==this.radioPlayer.pingPOST.elapsed&&CONSOLE.warn("Get next radio track reporting current track had elapsed time of 1"),i||(i=this.lastPlayedPlayableItem,this.currentPlayableItem(i)),i){if(i.mode==this.MODE_ODS)return void(i.nextIdx>0&&(i.nextIdx--,this.getNextODTrack("OndemandTrack")));i.leadoff&&(requestSid=i.leadoff,i.leadoff=null),this.isCasting?this.nextRadioTrackAction.setAudioMediaType("cast"):this.nextRadioTrackAction.setAudioMediaType(),this.nextRadioTrackAction.execute(requestSid,e,this.currentTrack(),this.radioPlayer.pingPOST.elapsed,this._onNextSlackerServiceTrack.bind(this),t)}else CONSOLE.warn("Get next radio track called without a currently playable container.");else APP.MESSAGING.getAyslPrompt((()=>{this.getNextRadioTrack(e,t)}))},onDemandPlayPause:function(e){const t=this.currentPlayableItem(),i=this.playlist(),s=APP.USER.slackerUser().policy.
1capabilities.features;if(e.active()&&this.radioPlayer&&this.radioPlayer.currentTrackObj)this.radioPlayerStateManager().playPause();else if(s.ondemand.enabled||this.isPodcast()){if(this.isStation()&&t.mode!=this.MODE_ODS&&(t.mode=this.MODE_ODS,i.map(((e,t)=>(e.itemPosition=t,e.active(!1),e))),this.currentPlayableItem.valueHasMutated(),this.playlist.valueHasMutated()),this.isPodcast())return t.nextIdx=e.itemPosition,void this._onNextSlackerServiceTrack(200,{Next:{Track:e}},null);void 0!==e.itemPosition&&(t.nextIdx=e.itemPosition),t&&(t.odLoadAttempts=0,t.gaveUp=!1),this.getNextODTrack("OndemandTrack",e)}else APP.MESSAGING.prompt("on-demand-playlist")},getNextODTrack:function(e,t){const i=this.currentPlayableItem();if(i&&!this.nextODTrackAction.isFetching&&(i.odLoadAttempts=(i.odLoadAttempts||0)+1,i.odLoadAttempts>this.MAX_OD_LOAD_ATTEMPTS))this._stopUnplayableItem(i,"on-demand load attempt limit reached");else if(!APP.useAysl||e&&"end"!=e||!APP.USER.isAyslTimeout())if(this.radioPlayer.pingPOST&&1==this.radioPlayer.pingPOST.elapsed&&CONSOLE.warn("Get next OD track reporting current track had elapsed time of 1"),t||(t=this.playlist()[i.nextIdx]),t)if("SlackerCommandTest"==i.id)this._onNextSlackerServiceTrack(200,{Next:{Track:Object.assign({},t)}},null);else{if(isNaN(Number(i.itemMatchId))||"playlist"!=i.itemMatchType){const e=Object.assign({},i);delete e.odLoadAttempts,delete e.gaveUp,delete e.hasPlayed,APP.SERVICE.cache("lastSlackerPlayed",JSON.stringify(e))}this.isCasting?this.nextODTrackAction.setAudioMediaType("cast"):this.nextODTrackAction.setAudioMediaType(),this.nextODTrackAction.execute(t,e,i.id,this.currentTrack(),this.radioPlayer.pingPOST.elapsed,this._onNextSlackerServiceTrack.bind(this))}else CONSOLE.warn("getNextODTrack called without a track to get.");else APP.MESSAGING.getAyslPrompt((()=>{this.getNextRadioTrack(e,adTriggerReason)}))},skipCurrentTrack:function(e){const t=this.currentTrack(),i=this.currentPlayableItem();features=APP.USER.slackerUser().policy.capabilities.features,skipsLeft=this.radioPlayerStateManager().skipsRemaining,videoTriggers=this.videoAdTriggers&&this.videoAdTriggers.showon||"",i&&(i.odLoadAttempts=0,i.gaveUp=!1),"boolean"!=typeof e&&(e=!1),i.isLive||(i.skippingAllowed&&("yes"===t?.skip||features.unlimited_skips.enabled)?this._onPlayerTrackEnded(e?"ban":"skip",e?"BANSKIP":"SKIP"):"ad"!==t.type||features.ad_free.enabled||APP.basicRadioOnly()?features.unlimited_skips.enabled||(e?videoTriggers.indexOf("BANLISTEN")>-1&&this.radioPlayer.connectSads("ban"):i.skippingAllowed&&0==skipsLeft&&!APP.basicRadioOnly()&&APP.MESSAGING.prompt("skip-limit")):APP.MESSAGING.prompt("ad-free"))},seekBy:function(e){if(!this.radioPlayer||!this.radioPlayer.player||null==this.radioPlayer.currentTrackObj)return;const t=this.radioPlayer.player.currentTime()+e;"stop"!=this.radioPlayerStateManager().state&&(this.radioPlayer.seekability?(APP.appImplementationModule._doTTSactionWithTimecode&&APP.appImplementationModule._doTTSactionWithTimecode(e>0?"Fast Forward to":"Rewind to",t),this.radioPlayer.seekTo(t)):this.radioPlayer.dispatch({type:this.radioPlayer.EVENT.ONSEEKDISALLOWED}))},skipBack:function(){if(!this.radioPlayer||!this.radioPlayer.player||null==this.radioPlayer.currentTrackObj)return;const e=this.currentPlayableItem(),t=this.currentTrack(),i=APP.USER.slackerUser().policy.capabilities.features;e.isLive||(i.ondemand.enabled||"podcast"==e.type?e.type==this.TYPE_STATION?t.olicensed>0&&this.radioPlayer.seekTo(0):this.radioPlayer.seekTo(0):APP.basicRadioOnly()||APP.MESSAGING.prompt("skip-replay"))},handleDstmChoice:function(){const e=this.currentTrack(),t=e.AdInfo.dstmAcceptType;let i="skip";BEACON.tagEvent({name:"radio",params:{value:"dstm",label:t}}),"optout"==t?this.currentDstm=null:(this.currentDstm={targets:e.AdTargets.target,info:e.AdInfo},i=e.adtype),this.getNextRadioTrack("skip",i)},playerItemClick:function(item,type){const tracking=new WebBeaconAction,session=APP.slackerPlayerSession();if(APP.remoteSession())APP.remoteSession().__viewRoomIfNeeded();else if(item.clickTracking&&tracking.execute("3rdparty",item.clickTracking),item.clickAction)if(0==item.clickAction.indexOf("http"))window.open(item.clickAction);else try{CONSOLE.warn("Attempting custom click action from track: "+item.clickAction),eval(item.clickAction)}catch(e){CONSOLE.error("Custom click action failed ",e)}else if(type&&"string"==typeof type)switch(type){case"artist":session.visitPlayerItem(type,item.artistid,item.artistlink,item.artist);break;case"album":session.visitPlayerItem(type,item.albumid,item.albumlink,item.album);break;case"song":session.visitPlayerItem(type,item.songid,item.songlink,item.title)}else session.setPlayerSize(session.PLAYER_FULL)},visitPlayerItem:function(e,t,i,s){this.setPlayerSize(this.PLAYER_DEFAULT),APP.goToPage("slackeritemdetail",{type:e,title:s,seoName:i,id:t})},setPlayerSize:function(e){const t=this.currentTrack(),i=$(".playlist-drawer"),s=t?t.albumCoverArt.host+t.albumCoverArt.path:"/s=4.0.1385/images/pixel.gif";"mini"==e&&this.playerSize==this.PLAYER_FULL&&(e="default"),this.playerSize!=e&&(this.playerSize=e,this._setSessionPlayerStyle(),BEACON.tagEvent({name:"radioPlayerSize",params:{value:e,label:"state"}}),e==this.PLAYER_FULL?($("body").css("overflow-y","hidden"),this.setFullScreenPlayerBg(s),Browser.isMobileDevice()||this.togglePlaylistDrawer(),"web"!==APP.implementationSuperType()&&($(".current-track-imgContainer")[0].style.backgroundImage=`url("${this._getPlayerAlbumArtUrl()}")`),setTimeout((function(){APP.currentView._doLazyImageLoading()}),200)):($("body").css("overflow-y","auto"),this.setFullScreenPlayerBg(null,!0),"web"!==APP.implementationSuperType()&&($(".current-track-imgContainer")[0].style.backgroundImage=`url("${this._getPlayerAlbumArtUrl()}")`),i.hasClass("active")&&this.togglePlaylistDrawer()))},playerBarTitleClick:function(){const e=this.currentPlayableItem();let t=e.type,i=e.id;this.setPlayerSize(this.PLAYER_DEFAULT),"station"!=t&&(t=e.subtype||e.itemMatchType,"album"==t&&(i=e.itemMatchId),"playlist"==t&&(e.itemMatchId.indexOf("playlist")>-1||i.indexOf("playlist")>-1?i=i||e.itemMatchId:(t="song",i=e.itemMatchId))),APP.goToPage("slackeritemdetail",{type:t,title:e.name,seoName:null,id:i}
1)},handleDrawerFocusCatch:function(){const e=$("#radio-player").find(".title-container .title");e?.[0].focus()},togglePlaylistDrawer:function(){const e=$(".playlist-drawer"),t=$("#radio-player"),i=APP.USER.slackerUser().policy.capabilities.features;SADS=com.slacker.sads.SAds,APP.MESSAGING.closeContextMenu(),this.drawerExpanded(!this.drawerExpanded()),"web"!==APP.implementationSuperType()&&(e.toggleClass("active"),t.toggleClass("playlist-drawer-open")),APP.suppressDisplayAds||$(".playlist-drawer .capUnit").each((function(e,t){$(t).empty().addClass("lazy"),SADS.destroyDFPSlots([t.id])})),"web"!==APP.implementationSuperType()&&e.hasClass("active")?(APP.suppressDisplayAds||i&&i.ad_free&&i.ad_free.enabled?e.find(".track-list").removeClass("capitalism"):e.find(".track-list").addClass("capitalism"),e.find(".track-list").on("scroll",APP.currentView._doLazyImageLoading.bind(APP.currentView)),setTimeout((function(){APP.currentView._doLazyImageLoading(),APP.suppressDisplayAds||i.ad_free.enabled||APP.currentView._doCapitalisticThings(!0)}),200)):e.find(".track-list").off("scroll")},setFullScreenPlayerBg:function(e,t=!1){if(window.APP&&APP.implementationSuperType&&"web"===APP.implementationSuperType())return;const i=this.currentTrack(),s=i?.trackArt;e=s||e;const a=$("#radio-player .bar .full-bg"),n=a.css("background-image");console.log("setFullScreenPlayerBg called | img:",e,"| closingFullScreenPlayer:",t,"| currentTrack:",i,"| trackArt:",s,"| currentBg:",n),!t&&e?n&&-1!=n.indexOf(e)||(i&&"imaging"!==i.type?e=this._generateSlackerImageUrl("album",i.albumid):"string"==typeof e&&e.indexOf("/isv1/")>-1&&-1===e.indexOf("/web/")&&(e+="/web/3/fit/1000x1000.jpg"),a.css("background-image","url("+e+")")):a.css("background-image","none")},resolveSlackerSeoUrl:function(e,t){(new ResolveSlackerSeoUrlAction).execute(e,t)},getLeadoffTrackData:function(e){const t=$.deparam(e.substr(e.indexOf("?")+1));let i,s,a=/\/(artist|station|album|song|host|series|genre)\/([^\/]*)\/?(.*)?/.exec(e);return t.lead&&(s=decodeURIComponent(t.lead).split("/"),a=[e,"station",s[2],s[2]]),a&&a[3]&&"station"==a[1]&&"custom"!=a[2]?i=Q_STRING.get("lead")||t.lead?Q_STRING.get("lead")||t.lead:`stations/${APP.USER.slackerUser().id}/${a[3]}`:t.lead&&(i=Q_STRING.get("lead")),i},rateTrack:function(e,t){return this.rateCurrentTrack(t,null,"track",e)},rateCurrentTrack:function(e,t,i="track",s){const a=this,n=this.currentPlayableItem(),o=s||this.currentTrack(),r="true"===o.cantrackrate,l="true"===o.canartistrate;this.songOptions;let c,d;if(r||l){if(c=i||(r?"track":"artist"),d="track"==c?o.pid:o.artistid,"track"==c&&!r||"artist"==c&&!l)return;(new RatingAction).execute(c,d,e,n.id,((t,i,s)=>{const n=this.currentTrack;i&&("artist"==c?(o.arate=i.rating,this.updateRatingAndRebuildMenu("artist",o,i)):(o.trate=i.rating,this.updateRatingAndRebuildMenu("track",o,i)),i.rating==this.RATING_BAN?o.observableRating(Number(o.trate)):o.observableRating(Number(i.rating)),n().pid==o.pid&&(n.valueHasMutated(),i.rating==this.RATING_BAN&&this.skipCurrentTrack(!0)),this.playlist().map((function(e){e.pid==o.pid&&e.observableRating(o.observableRating())})),this.dispatch({type:a.EVENT.RATING,ratingType:c,track:o,rating:e}))}))}},updateRatingAndRebuildMenu:function(e,t,i){const s=this.playlist().find((e=>e.tid===t.tid));if(s){"artist"===e?(t.arate=i.rating,s.arate=i.rating):(t.trate=i.rating,s.trate=i.rating);const a=this.songOptions.currentMenuItem;0!==APP.MESSAGING.contextMenu().length&&t.tid===a.tid&&this.songOptions.execute(t)}},doFinetuneAction:function(e,t){const i=this.currentPlayableItem(),s=i.sliders;for(let i=0;i<s.length;i++)if(e==s[i].id){CONSOLE.info(["Settings slider",s[i].type,t]),s[i].value=t;break}const a=s.filter((e=>-1===["DJs","dj","news","sports"].indexOf(e.type)));(new EditStationAction).execute(["sliders"],{sid:i.id,edit:{sliders:a}})},togglePlaylistShuffleMode:function(e,t){const i=this.currentPlayableItem(),s=this.playlist();let a,n,o,r=!i.isShuffle(),l=s.length-1;if(e&&"boolean"==typeof e&&(r=e),i.isShuffle(r),APP.checkAcessibilityTTSAction("Shuffle: "+(r?"ON":"OFF"),null,!0),r){n=new Array(l),isNaN(Number(t))||s[t].active(!0);for(let e=0;e<l;e++)a=Math.floor(Math.random()*l+1),a>=n.length||s[e].active()||s[a].active()||(void 0===n[e]&&(n[e]=s[e].itemPosition),void 0===n[a]&&(n[a]=s[a].itemPosition),o=n[e],n[e]=n[a],n[a]=o);i.nextShuffleIndex=n}else i.nextShuffleIndex=null},isPodcast:function(){return this.currentPlayableItem()?.type===this.TYPE_PODCAST},isPlaylist:function(){return this.currentPlayableItem()?.type===this.TYPE_PLAYLIST},isStation:function(){return this.currentPlayableItem()?.type===this.TYPE_STATION},promptPlaybackSpeed:function(){const e=this.radioPlayer?.player?.playbackRate()||1,t={title:"Set Playback Rate",beaconId:"playback-speed",severe:!1,msg:"Set the playback rate for the currently playing item.",actions:this.PLAYBACK_RATES.map((t=>({label:`${t}x`,styles:t==e.toString()?"std":"std secondary",action:()=>{this.radioPlayer.player.playbackRate(Number(t)),APP.MESSAGING.setModal(),setTimeout((()=>$(".bar a.tunning-playback-speed").focus()),1e3)}})))};APP.MESSAGING.prompt(t)}
1,_doRightsCheck:function(e){const t=APP.USER.slackerUser();if(e.rights&&e.rights.tierToPlay>t.effectiveTier){if(this._setSessionPlayerStyle(),!APP.basicRadioOnly()){let t={source:"station-play"},i=e.rights.tierToPlay>5?"premium":"plus";e.offer&&e.offer.links&&(e.offer.linksMap={},e.offer.links.forEach((t=>{e.offer.linksMap[t.rel]=t.href})),e.offer.linksMap.action&&e.offer.linksMap.action.indexOf("upgrade")>-1&&e.offer.linksMap.action.split("?").forEach((e=>{e.split("&").forEach((e=>{"type"==(e=e.split("="))[0]&&(i=e[1]),"bp"==e[0]&&(t.bp=e[1])}))})));const s={"sub-tier-copy":e.rights.tierToPlay>5?"Premium ":""},a=[{label:"UPGRADE",styles:"std",action:function(){APP.MESSAGING.setModal(),APP.onRequestUpgrade(i,"subscriptionRequired",t)}},{label:"Maybe Later",styles:"std secondary",action:null}];APP.MESSAGING.prompt("subscriptionRequired",s,a)}return!0}return!1},_doStopOnChangeSource:function(e,t,i,s){const a=this.currentPlayableItem();return this._stopAllVideoPlayers(),this._setSessionPlayerStyle("changing"),a&&(this.radioPlayer&&!this.radioPlayer.wasPaused&&this.radioPlayer.pause(!0),t&&"podcast"!=a.type&&this.beaconEvent.execute("trackEnd",{end:t,track:Object.assign({},this.currentTrack()),statistics:this.radioPlayer.pingPOST}),a.stop)?(a.stop(e||"ChangeStation",(()=>{this.playlist.removeAll(),this.currentTrack(null),this.onDeckTrack(null),i.apply(this,s)})),!0):(this.playlist.removeAll(),this.currentTrack(null),this.onDeckTrack(null),!1)},_preparePlaylistTracks:function(e){const t=this;e.songs.song&&!e.songs.song.length&&(e.songs.song=[e.songs.song]),e.songs.song.map(((i,s)=>{if(i.albumCoverArt||(i.albumId?i.albumCoverArt={host:t._generateSlackerImageUrl("album",i.albumId),path:""}:e.imagePath||e.image?i.albumCoverArt={host:e.imagePath||e.image,path:""}:i.track&&i.track[0]&&i.track[0].album&&i.track[0].album[0]?i.albumCoverArt={host:t._generateSlackerImageUrl("album",i.track[0].album[0].id),path:""}:i.albumCoverArt={host:`${IMG_CDN_AND_BUILD}/images/pixel.gif`,path:""}),i.rights&&void 0===i.basicRadio)for(var a in i.rights)i[a.toLowerCase()]=i.rights[a],"onDemand"==a&&(i.olicensed=i.rights[a]);return i.itemPosition=s,i.type="ods",i.skip="yes",i.canShowOptions=!0,i.active=ko.pureComputed({read:function(){let e=t.currentTrack();return void 0!==this.itemPosition?e&&e.tid==(this.tid||this.trackId)&&e.itemPosition==this.itemPosition:this._active||e&&e.tid==(this.tid||this.trackId)},write:function(e){this._active=e},owner:i}),i.observableRating=ko.observable(0),i.isBanned=ko.observable(!1),i.title||(i.title=i.name||i.trackName),i.artist?"string"!=typeof i.artist&&(i.artist.length||(i.artist=[i.artist]),i.artist[0]&&(i.artistlink||(i.artistlink=i.artist[0].link),i.artistid||(i.artistid=i.artist[0].id||i.artist[0].artistId)),i.artist=i.artist.map((function(e){return e.name||e.artistName})).join(", ")):"_"!==i.artistName?i.artist=i.artistName:"album"==e.nodeType?i.artist=e.artistName:i.artist="",i.album||("album"==e.nodeType?i.album=e.name:i.album=i.albumName),i.artistlink||(i.artistlink=null),i.albumlink||(i.albumlink=null),i.songlink||(i.songlink=null),i.track&&delete i.track,i}))},_stopAllVideoPlayers:function(){APP.currentView?.detailPlayer&&APP.currentView.detailPlayer.stop(),APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.stop(),APP.heroEmbedData()&&APP.closeEmbedHeroPlayer()},_generateSlackerImageUrl:function(e,t,i){return UrlModule.get(UrlModule.SERVICE.SLACKER.DATA.IMAGESERVICE,{id:t,type:e,extra:i||""})},_getPlayerAlbumArtUrl:function(){const e=this.currentTrack(),t=e?.trackArt;let i=e.albumCoverArt.host+e.albumCoverArt.path;if("string"==typeof t?i=t:t&&"object"==typeof t&&t.host&&(i=t.host+(t.path||"")),this.playerSize!=this.PLAYER_FULL||t?"ad"!==e?.type&&"imaging"!==e?.type&&e?.albumId?i=this._generateSlackerImageUrl("album",e.albumid):"imaging"===e?.type&&"string"==typeof i&&i.indexOf("/isv1/")>-1&&-1===i.indexOf("/web/")&&(i+="/web/3/fit/1000x1000.jpg"):i=e.imagePath||`${i}/web/3/fit/1000x1000.jpg`,com.slacker.sads.SAds?._isAdBlockTechEnabled&&"ad"===e?.type&&i){this._adImageLoadCache||(this._adImageLoadCache={});const e=this._adImageLoadCache[i];if("failed"===e)return`/s=${APP_VERSION}/images/upgrade/support_us_dark_LiveOne-logo.png`;void 0===e&&(this._adImageLoadCache[i]="pending",this._verifyAdImageLoad(i))}return i},_verifyAdImageLoad:function(e){if(!e)return;const t=new Image,i=this;t.onload=()=>{i._adImageLoadCache[e]="ok"},t.onerror=()=>{i._adImageLoadCache[e]="failed",i.currentTrack&&"function"==typeof i.currentTrack.valueHasMutated&&i.currentTrack.valueHasMutated();const t=`/s=${APP_VERSION}/images/upgrade/support_us_dark_LiveOne-logo.png`;document.querySelectorAll(".current-track-imgContainer").forEach((e=>{e.style.backgroundImage=`url("${t}")`}))},t.src=e},_stopSlackerPlayerServerSession:function(e,t,i){CONSOLE.info("SlackerPlayerSessionModule::stopRadioStation - Stopping "+this.id
1);const s=this.currentPlayableItem();APP.MESSAGING.closeContextMenu(),i&&this.radioPlayer&&this.radioPlayer.stop(!1,!0),$("body").removeClass("radio-bar-active"),this.stopSessionAction.execute(s,this.currentTrack(),e,this.radioPlayer.pingPOST.elapsed,(()=>{this.currentPlayableItem(null),this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:s,reason:e,chainedAction:t})}))},_setSessionPlayerStyle:function(e){const t=this.currentPlayableItem(),i=this.currentTrack();let s=["video-js"];t?(s.push(t.mode),s.push(t.type),(t.isLive||i&&(i.isLive||"stream"==i.type))&&s.push("vjs-live")):(s.push(this.MODE_RADIO),s.push(this.PLAYER_DEFAULT)),this.isCasting&&s.push("casting"),this.canShowCastBtn&&s.push("castAvailable"),e&&s.push(...e.split(" ")),(this.radioPlayer&&(this.radioPlayer._videoAdStarted||this.radioPlayer._castAdHold)||this.isInCastVideoBreak)&&-1===s.indexOf("videoad")&&s.push("videoad"),i?.companion?.medrect&&s.push("companion"),s.push(this.playerSize),"default"==this.playerSize?$("body").addClass("radio-bar-active"):$("body").removeClass("radio-bar-active"),this.radioPlayerStateManager().playerStyle=s.join(" "),this.radioPlayerStateManager.valueHasMutated()},_onFullStationDefFetchForPlay:function(e,t,i,s){const a=this.currentPlayableItem();if(200==e){if(!t)return void CONSOLE.warn("Station def returned 200 but has no data.");if(t.bSlidersOnly)t.content&&t.content.length&&(a.sliders=t.content.splice(0),a.sliders.map((e=>(e.type=e.sliderType,e.id=e.sliderId,e))));else if(t.custom||SlackerBaseStationCacheAction.updateStationMaps(t.sid.split("/")[2],t),t.stationType&&t.stationType.indexOf(":")>-1&&-1==t.stationType.indexOf("fav")&&(t.name+=" Radio"),a&&t.sid==a.id){if(a.name=t.name,a.itemImage=a.itemImage||t.imgPath,t.features?(a.finetune=t.features.finetuneAllowed,a.skippingAllowed=t.features.skippingAllowed):(a.finetune=!1,a.skippingAllowed=!0),a.sliders=t.slider,t.stationType&&t.stationType.indexOf(":")>-1){const e=t.stationType.split(":");a.itemMatchType=e[0],a.itemMatchId=e[1]}t.coreStationMapping&&(a.coreMap=t.coreStationMapping.sid.split("/")[2]),this.currentPlayableItem(a)}else this.startRadioStation(t.sid,t,i,s)}else this._setSessionPlayerStyle(),APP.MESSAGING.prompt("genericItemNotFound",{type:"station",beaconId:"stationNotFound"})},_onHeartbeatPing:function(e,t){const i=this.currentPlayableItem(),s=this.currentTrack(),a=APP.USER.slackerUser().policy.capabilities.features;let n=!1,o=Object.assign({},s);if(t&&t.nowplaying&&(i.isLive&&this.radioPlayer.__updateMediaInfo(t),t.nowplaying.artist&&s.artist!=t.nowplaying.artist.name&&(n=!0,o.artistid=t.nowplaying.artist.id,o.artist=t.nowplaying.artist.name),t.nowplaying.album&&s.album!=t.nowplaying.album.name&&(n=!0,o.albumid=t.nowplaying.album.id,o.album=t.nowplaying.album.name),t.nowplaying.albumCoverArt?(n=!0,o.imagePath=t.nowplaying.albumCoverArt._cdata,o.albumCoverArt={host:t.nowplaying.albumCoverArt._cdata,path:""}):o.albumCoverArt&&o.albumCoverArt.host||(n=!0,o.albumCoverArt={host:i.itemImage,path:""}),t.nowplaying.track&&s.title!=t.nowplaying.track.name&&(n=!0,o.title=t.nowplaying.track.name,o.tid=t.nowplaying.track.id,t.nowplaying.albumCoverArt||(o.albumCoverArt={host:i.itemImage,path:""}),s.active(!1),o.active=ko.observable(!0),this.playlist.unshift(o),!a.ad_free.enabled&&APP.currentView.renderAudioCompanions&&APP.currentView.renderAudioCompanions(t.nowplaying.track)),n)){if(this.currentTrack(o),"mediaSession"in navigator){let e={title:o.title,artist:o.artist,album:o.album,artwork:[]};o.albumCoverArt&&(e.artwork=[{src:`${o.albumCoverArt.host}${o.albumCoverArt.path}`,sizes:"384x384",type:"image/jpg"}]),navigator.mediaSession.metadata=new MediaMetadata(e)}this.playerSize==this.PLAYER_FULL&&this.setFullScreenPlayerBg(o.albumCoverArt.host+o.albumCoverArt.path),setTimeout(APP.currentView._doLazyImageLoading,200)}},_onNextSlackerServiceTrack:function(e,t,i){CONSOLE.warn(["SlackerPlayerSessionModule::_onNextSlackerServiceTrack",e,t]);const s=this.currentPlayableItem();if(s&&s.gaveUp)return void CONSOLE.warn(["SlackerPlayerSessionModule::_onNextSlackerServiceTrack","dropping late track for a given-up playable",s.id]);const a=this,n=new Date,o=this.currentPlayableItem(),r=APP.USER.slackerUser().policy.
1capabilities.features,l=this.nextRadioTrackAction.adTriggerReason;if(void 0===o.isStarting&&(o.isStarting="STATIONCHANGE"===l||0==o.nextIdx),this.radioPlayerStateManager().isPlayableChanged=o.isStarting,200===e){let e=t.Next?Object.assign({},t.Next.Track):Object.assign({},t.Track),s=null;this._setSessionPlayerStyle(),"sharedSession"==o.itemMatchType?this.radioPlayerStateManager().dstmClock(null):void 0!==t.dstmUntil&&t.dstmUntil&&(APP.SERVICE.slackerServerTimeSkew&&(t.dstmUntil+=parseInt(APP.SERVICE.slackerServerTimeSkew,10),t.dstmStart+=parseInt(APP.SERVICE.slackerServerTimeSkew,10)),this.radioPlayerStateManager().dstmClock(1e3*t.dstmUntil),this.radioPlayerStateManager().countdownStartTime(1e3*t.dstmStart)),this.playlist().map((function(e){return e.active(!1),e})),this.onDeckTrack(),"object"==typeof e.URL&&(e.URL[0]?(e.URL[0].format&&(e.format=e.URL[0].format),e.URL[0].container&&(e.container=e.URL[0].container),e.URL=e.URL[0]._cdata||e.URL[0]._text):(e.URL.format&&(e.format=e.URL.format),e.URL.container&&(e.container=e.URL.container),e.URL=e.URL._cdata||e.URL._text)),e.albumCoverArt||(e.trackArt&&void 0!==e.trackArt.host?e.albumCoverArt=e.trackArt:e.trackArt?e.albumCoverArt={host:e.trackArt,path:""}:e.posterImgUrl?e.albumCoverArt={host:e.posterImgUrl,path:""}:e.albumCoverArt={host:`${IMG_CDN_AND_BUILD}`,path:"/s=4.0.1385/images/skeleton-grey.png"}),e.title||(e.title=e.name),e.artist||(e.artist=e.artistName),e.album||(e.album=e.albumName),e.canShowOptions=e.link||e.artistlink&&e.artistid>0||e.albumlink||e.songlink,e.scrub||"ad"==e.type||(r.ondemand.enabled?e.scrub=e.olicensed>0?"yes":"no":e.scrub="no"),["copyright","artistlink","albumlink"].forEach((t=>{void 0===e[t]&&(e[t]=null)})),e.AdInfo=t.Next?t.Next.AdInfo:null,e.AdTargets=e.AdInfo?e.AdInfo.AdTargets:null,e.AdTargets&&(e.AdTargets.target.length||(e.AdTargets.target=[e.AdTargets.target])),t.OnDeck&&(s=Object.assign({},t.OnDeck.Track),s.albumCoverArt||("ad"==s.type?s.albumCoverArt={host:this._generateSlackerImageUrl("album",e.albumid),path:""}:s.trackArt&&void 0!==s.trackArt.host?s.albumCoverArt=s.trackArt:s.albumCoverArt={host:`${IMG_CDN_AND_BUILD}`,path:"/s=4.0.1385/images/skeleton-grey.png"}),s.title||(s.title=s.name),s.artist||(s.artist=s.artistName),s.album||(s.album=s.albumName)),"ad"===e.type&&CONSOLE.info(["SlackerPlayerSessionModule::_onNextSlackerServiceTrack","Audio ad received","title:",e.title,"hasVAST:",!!i]),i&&(t.Next.Track=ParseVastAction.execute(i,e),e.companion&&e.companion.medrect&&"img"==e.companion.medrect.type&&(CONSOLE.info(["SlackerPlayerSessionModule::_onNextSlackerServiceTrack","Using medrect companion"]),e.albumCoverArt={host:e.companion.medrect.data,path:""},e.impTracking&&0!=e.impTracking.length||(e.impTracking=e.companion.medrect.impTracking)),CONSOLE.info(["SlackerPlayerSessionModule::_onNextSlackerServiceTrack","VAST parsed","impTracking:",e.impTracking?e.impTracking.length:0,"quartileTracking:",e.quartileTracking?Object.keys(e.quartileTracking).join(","):"none"])),this.nextRadioTrackAction.adTriggerReason.indexOf("dstm")>-1?(this.videoAdTriggers={reqid:this.currentDstm&&this.currentDstm.info&&this.currentDstm.info.reqid?this.currentDstm.info.reqid:1,expires:new Date(n.getTime()+3e4),showon:this.nextRadioTrackAction.adTriggerReason,blocksize:1},com.slacker.sads.SAds.lastVideoAdTime=0,e.dstm=this.currentDstm||{}):t.Ads&&t.Ads.Video&&(this.videoAdTriggers={reqid:t.Ads.Video.reqid,expires:new Date(1e3*t.Ads.Video.expires),showon:t.Ads.Video.showon,blocksize:t.Ads.Video.blocksize},CONSOLE.debug("New video triggers recieved: "+JSON.stringify(t.Ads.Video).replace("{","").replace("}",""))),this.videoAdTriggers.reqid?n>this.videoAdTriggers.expires?(CONSOLE.info("Current video triggers have expired - no pre-roll for this track."),this.videoAdTriggers={},e.disableVideoAds=!0):"ad"==e.type||"outtro"==e.type||this.radioPlayerStateManager().lastTrackIsTied?(CONSOLE.info("Track is not eligible for pre-roll no mater what triggers say: "+[e.type,"lastTrackIsTied",this.radioPlayerStateManager().lastTrackIsTied]),e.disableVideoAds=!0):-1==this.videoAdTriggers.showon.indexOf(l)?(CONSOLE.info("Current video triggers do not allow pre-roll for action: "+l),e.disableVideoAds=!0):CONSOLE.debug("Next track is eligible for pre-roll: "+l):e.disableVideoAds=!0,e.clickAction||(e.clickAction=null),e.observableRating=ko.observable(Number(e.trate)),e.isBanned=ko.pureComputed(function(){return this.observableRating()==a.RATING_BAN}.bind(e)),o.mode==this.MODE_ODS?(e=Object.assign(this.playlist()[o.nextIdx],e),this.isStation()&&e.active(!0)):e.active=ko.observable(),void 0===o.skippingAllowed&&(o.skippingAllowed="no"!=e.ski
1p),this.radioPlayerStateManager().lastTrackIsTied="imaging"==e.type||"intro"==e.type,this.radioPlayerStateManager().skipsRemaining=r.unlimited_skips.enabled?1e3:t.skips,this.radioPlayerStateManager().canShowSkipCount=o.skippingAllowed&&!r.unlimited_skips.enabled&&"livestream"!==e.songtype,this.radioPlayerStateManager().canSkipBack=function(){return"podcast"==o.type||!o.isLive&&o.skippingAllowed&&r.ondemand.enabled&&e.olicensed>0},this.radioPlayerStateManager().canSkip=function(){return!o.isLive&&o.skippingAllowed&&("yes"==e.skip||this.skipsRemaining>0)},this.radioPlayerStateManager.valueHasMutated(),this.currentTrack(e),s&&"sharedSession"!=o.itemMatchType&&(s.upNextArt=ko.pureComputed((()=>{const e=APP.USER.slackerUser();return e.effectiveTier<5?`${IMG_CDN_AND_BUILD}/images/skeleton-grey.png`:5==e.effectiveTier?this._generateSlackerImageUrl("artist",s.artistid,"/fill/50x50.jpg"):s.albumCoverArt.host+s.albumCoverArt.path+"/fill/50x50.jpg"})),this.onDeckTrack(s)),o.isStarting&&(o.isStarting=!1,GetSlackerProfileTree.clearSessionCache(),this.dispatch({type:this.EVENT.STATIONSTARTED,playable:o})),o.startOffset&&(e.disableVideoAds=!0,this.radioPlayer.startOffset=o.startOffset,delete o.startOffset),this.radioPlayer.player&&!this.radioPlayer.player.muted()?this.radioPlayer.changeTrack(e):this.radioPlayer.embed($("#radio-player")[0],e,!1),this.playerSize==this.PLAYER_FULL&&(this.setFullScreenPlayerBg(e.albumCoverArt.host+e.albumCoverArt.path),setTimeout((()=>APP.currentView._doLazyImageLoading()),200),"web"===APP.implementationSuperType()||r&&r.ad_free&&r.ad_free.enabled||$(".playlist-drawer").find(".track-list").addClass("capitalism"))}else this._handleSlackerServiceStatusCode(e,t)},_handleSlackerServiceStatusCode:function(e,t){const i=this.currentPlayableItem();let s=!1,a=!0;switch(e){case 302:case 304:bIsSkipping=!1,s=!0,APP.MESSAGING.prompt("slackerMaintenance");break;case 400:bIsSkipping=!1,SESSION.set({lastTrack:null}),APP.MESSAGING.prompt("geofence");break;case 404:s=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("stationExhausted",null,null,null,{contentType:i?.type,accountTier:parseInt(APP.USER.slackerUser().tier)});break;case 405:if(CONSOLE.warn("405 Method Not Allowed error encountered."),"playlist"===i.type){if(CONSOLE.info(`Track encountered 405 error. Attempting to skip to next track.\n Current Playable Item Info:\n - PlaylistName: ${i.name}\n - ID: ${i.id}\n - Current Index: ${i.nextIdx}\n - Total Tracks: ${this.playlist().length}\n - Mode: ${i.mode}\n - Subtype: ${i.subtype}\n `),i.failedTrackIndices||(i.failedTrackIndices=[]),i.failedTrackIndices.push(i.nextIdx),i.failedTrackIndices.length>=this.playlist().length){CONSOLE.warn("All tracks in playlist have failed due to 405 errors."),s=!0,a=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("stationExhausted",null,null,null,{contentType:i?.type,accountTier:parseInt(APP.USER.slackerUser().tier)});break}s=!1,a=!1;let t=i.nextIdx;do{if(i.nextIdx++,i.nextIdx>=this.playlist().length&&(i.nextIdx=0),i.nextIdx===t){CONSOLE.warn("No playable tracks found in playlist."),s=!0,a=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("stationExhausted",null,null,null,{contentType:i?.type,accountTier:parseInt(APP.USER.slackerUser().tier)});break}}while(i.failedTrackIndices.includes(i.nextIdx));i.failedTrackIndices.length<this.playlist().length&&APP.USER.getSlackerToken((()=>{CONSOLE.info(["NetworkModule::Slacker reauth SUCCESS"]),this.restartLastAttempted("reauth")}));break}if(i.mode==this.MODE_ODS){bIsSkipping=!1,this.skipCurrentTrack(!1);break}case 444:a=!1,s=!0,this.wasBumped=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("userBump");break;case 445:case 446:s=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("freeTrackLimit");break;case 447:case 450:bIsSkipping=!1,s=!0;const n=t&&t.nag,o=t&&t.msg;n&&o&&APP.MESSAGING.messages[n]?APP.MESSAGING.prompt(n,{msg:o}):APP.basicRadioOnly()||(n&&!APP.MESSAGING.messages[n]&&CONSOLE.warn(["SlackerPlayerSessionModule: Unknown nag type from server:",n]),APP.MESSAGING.prompt("subscriptionRequired",{"sub-tier-copy":""}));break;case 0:CONSOLE.warn(["SlackerPlayerSessionModule::_handleSlackerServiceStatusCode - Network error (status 0), retrying in 3s..."]),s=!1,a=!1,setTimeout((()=>{this.currentPlayableItem()&&(CONSOLE.info(["SlackerPlayerSessionModule::Retrying getNextRadioTrack after network error"]),this.getNextRadioTrack("",this.nextRadioTrackAction.adTriggerReason||"TRANSITION"))}),3e3);break;default:s=!0,this.dispatch({type:this.EVENT.STATIONSTOPPED,playable:i,reason:e}),APP.MESSAGING.prompt("stationErrorGeneric",{error:e})}a&&this.currentPlayableItem(null),s&&(this.bIsSkipping=!1,this.currentTrack(null),this.onDeckTrack(null))},_onCreatorModuleEvent:function(e){const t=this.currentPlayableItem(),i=this.currentTrack();switch(CONSOLE.debug(["SlackerPlayerSessionModule::_onCreatorModuleEvent",e.type,e.sid||e.id]),e.type){case CreatorModule.EVENT.STATION_RENAMED:t&&t.id==e.sid&&(t.name=e.name,this.currentPlayableItem.valueHasMutated());break;case CreatorModule.EVENT.STATION_REMOVED:t&&t.id==e.sid&&t.stop();break;case CreatorModule.EVENT.PLAYLIST_RENAMED:t&&t.id==e.id&&(t.name=e.name,this.currentPlayableItem.valueHasMutated());break;case CreatorModule.EVENT.PLAYLIST_REMOVED:t&&t.id==e.id&&t.stop();break;case CreatorModule.EVENT.PLAYLIST_UPDATED:const s=e.playlist;let a=!1;if(t&&t.id==s.playlistid)if(s.songs&&s.songs.song&&0!=s.songs.song.length)switch(e.action){case"add":this._preparePlaylistTracks(s),this.playlist(s.songs.song);break;case"remove":const n=this.playlist();e.removed.forEach((e=>{n.splice(e,1)[0].active()&&(a=!0)})),this._preparePlaylistTracks(e.newPlaylist),this.playlist(e.newPlaylist.songs.song),a?(t.
1nextIdx--,this.currentPlayableItem.valueHasMutated(),this.skipCurrentTrack("delete")):this.playlist().filter((e=>e.tid==i.tid)).forEach((e=>{["copyright","clickAction","songlink"].forEach((t=>e[t]=i[t])),e.active(!0),this.currentTrack(e),t.nextIdx=e.itemPosition}));break;case"reorder":const o=e.from,r=e.to;o!=r&&(this._preparePlaylistTracks(s),this.playlist(s.songs.song),i.itemPosition==o?t.nextIdx=i.itemPosition=r:r<=i.itemPosition?(i.itemPosition++,t.nextIdx=i.itemPosition):o<i.itemPosition&&(i.itemPosition--,t.nextIdx=i.itemPosition),i.active(!0),this.currentTrack(i),t.isShuffle()&&this.togglePlaylistShuffleMode(!0),this.currentPlayableItem.valueHasMutated())}else t.stop()}},_onRadioPlayerEvent:function(e){const t=this.radioPlayerStateManager(),i=this.currentTrack(),s=this.currentPlayableItem();switch(e.type!=this.radioPlayer.EVENT.PLAYBACK.TIMEUPDATE&&(e.track?CONSOLE.debug("SlackerPlayerSessionModule._onRadioPlayerEvent:: "+[e.type,e.player,e.track.tid]):CONSOLE.debug("SlackerPlayerSessionModule._onRadioPlayerEvent:: "+[e.type,e.player])),e.type){case this.radioPlayer.EVENT.VIDEOCONTAINERREADY:break;case this.radioPlayer.EVENT.EMBEDFAILURE:e.adNetworkID,e.reason&&e.reason.indexOf("google is not defined");break;case this.radioPlayer.EVENT.ONSEEKDISALLOWED:const a=APP.USER.slackerUser().policy.capabilities.features;i?.isLive||"sharedSession"==s?.itemMatchType?CONSOLE.info(["SlackerPlayerSessionModule._onRadioPlayerEvent::",e.type,"can't scrub item or session type",s?.itemMatchType]):!i||a.ondemand.enabled||APP.basicRadioOnly()||APP.MESSAGING.prompt("scrubbing");break;case this.radioPlayer.EVENT.AUTOPLAY_DISABLED:APP.MESSAGING.prompt("html5AutoplayDisabled"),setTimeout((()=>{this.radioPlayer.wasPaused=!0,t.buttonstyle="play",this.radioPlayerStateManager(t)}),1e3);break;case this.radioPlayer.EVENT.DISPLAYERROR:case this.radioPlayer.EVENT.PLAYBACK.ERROR:this._isOwnContentForegroundError(s,i,e)?this._holdOnTerminalError():this._onPlayerTrackEnded("error",null,e.error);break;case this.radioPlayer.EVENT.PLAYBACK.PAUSE:t.buttonstyle="play",this.radioPlayerStateManager(t),e.hasRadioStarted&&"podcast"!=this.currentPlayableItem().type&&this.wsEvent.execute("pause",{sid:this.currentPlayableItem().id});break;case this.radioPlayer.EVENT.PLAYBACK.RESUME:t.isStarting=!1,t.buttonstyle="pause",this.radioPlayerStateManager(t),"podcast"!=this.currentPlayableItem().type&&this.wsEvent.execute("resume",{sid:this.currentPlayableItem().id});break;case this.radioPlayer.EVENT.PLAYBACK.DURATIONCHANGE:case this.radioPlayer.EVENT.PLAYBACK.STARTED:if(e.type!==this.radioPlayer.EVENT.PLAYBACK.STARTED||!e.track||"ad"===e.track.type||!s||this.radioPlayer.player&&this.radioPlayer.player.changingSrc_||(s.hasPlayed=!0,s.odLoadAttempts=0,s.gaveUp=!1),s&&s.gaveUp)break;const n=new LiveStreamHeartbeatAction,o=this.radioPlayerStateManager();let r;if("live"===e.track.streamType||"livestream"==e.track.songtype?(e.track.isLive=!0,s?.isLive||(s.isLive=!0,s?.valueHasMutated())):(e.track.isLive=!1,s?.isLive&&(s.isLive=!1,s?.valueHasMutated())),e.type==this.radioPlayer.EVENT.PLAYBACK.DURATIONCHANGE){if(e.player&&e.player.duration()>3600?$(".vjs-control-bar").addClass("overhour"):$(".vjs-control-bar").removeClass("overhour"),s&&s.isLive&&("live"===e.track.streamType||"livestream"==e.track.songtype))return void this._setSessionPlayerStyle()}else o.isPlayableChanged&&(o.isPlayableChanged=!1,BEACON.tagEvent({name:"radio",params:{value:"start",label:s.id,title:this.currentPlayableItem()?.name}})),o.isStarting=!1;if(null!=e.player&&null!=e.track.active&&(CONSOLE.debug(["SlackerPlayerSessionModule._onRadioPlayerEvent::",e.type," - ",r,"isLive",e.track.isLive]),this.isStation()&&s.mode!=this.MODE_ODS&&"intro"!=e.track.type&&"outtro"!=e.track.type&&"imaging"!=e.track.type&&(!this.playlist()[0]||this.playlist()[0]&&this.playlist()[0].tid!=e.track.tid)&&(e.track.active(!0),s.isLive||this.playlist.unshift(e.track),"ad"==e.track.type&&e.track.adtype.indexOf("dstm")>-1&&(this.radioPlayerStateManager().dstmClock(0),"optout"==e.track.AdInfo.dstmAcceptType&&(this.currentDstm={targets:e.track.AdTargets.target,info:e.track.AdInfo})),setTimeout(APP.currentView._doLazyImageLoading,200)),this.radioPlayer.toggleSeekability("yes"===e.track.scrub&&"sharedSession"!=s.itemMatchType),e.type===this.radioPlayer.EVENT.PLAYBACK.STARTED&&APP.currentView.slotRenderingHelper.renderAudioCompanions(e.track),this.currentTrack.valueHasMutated()),t.state="play",t.buttonstyle="pause",this.radioPlayerStateManager(t),"stream"==e.track?.type&&(CONSOLE.debug("LIVESTREAM ping action"),n.execute(e.atomicTime,this._onHeartbeatPing.bind(this)),s.isLive||(s.isLive=!0,this.currentPlayableItem.valueHasMutated())),"mediaSession"in navigator){let i={title:e.track.title,artist:e.track.artist,album:e.track.album,artwork:[]};if(e.track.albumCoverArt&&(i.artwork=[{src:`${e.track.albumCoverArt.host}${e.track.albumCoverArt.path}`,sizes:"384x384",type:"image/jpg"}
1]),navigator.mediaSession.metadata=new MediaMetadata(i),"stream"==e.track.type)navigator.mediaSession.setActionHandler("nexttrack",null),navigator.mediaSession.setActionHandler("previoustrack",null),navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null);else if(t.canSkip()?navigator.mediaSession.setActionHandler("nexttrack",(()=>{this.skipCurrentTrack()})):navigator.mediaSession.setActionHandler("nexttrack",null),t.canSkipBack()?navigator.mediaSession.setActionHandler("previoustrack",(()=>{this.skipBack()})):navigator.mediaSession.setActionHandler("previoustrack",null),this.radioPlayer.seekability){let e=5;navigator.mediaSession.setActionHandler("seekbackward",(t=>{const i=t.seekOffset||e;this.seekBy(-1*i)})),navigator.mediaSession.setActionHandler("seekforward",(t=>{const i=t.seekOffset||e;this.seekBy(i)}))}else navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null)}-1==this.radioPlayerStateManager().playerStyle.indexOf("videoad")&&this._setSessionPlayerStyle();break;case this.radioPlayer.EVENT.PLAYBACK.TIMEUPDATE:e.track&&"podcast"!=this.currentPlayableItem().type&&("stream"==e.track.type?e.atomicTime%10==0&&(CONSOLE.debug("LIVESTREAM ping action"),(new LiveStreamHeartbeatAction).execute(e.atomicTime,this._onHeartbeatPing.bind(this))):e.atomicTime%300==0&&e.atomicTime>0&&(CONSOLE.debug("Long track ping action"),(new LiveStreamHeartbeatAction).execute(e.atomicTime,this._onHeartbeatPing.bind(this))));break;case this.radioPlayer.EVENT.PLAYBACK.COMPLETED:this._onPlayerTrackEnded("end","TRANSITION");break;case this.radioPlayer.EVENT.ADNETWORKCONTAINERREADY:e.adNetworkID;break;case this.radioPlayer.EVENT.ADNETWORKLOADING:this._setSessionPlayerStyle("videoadloading");break;case this.radioPlayer.EVENT.ADNETWORKREADY:e.adNetworkID;break;case this.radioPlayer.EVENT.DBK:break;case this.radioPlayer.EVENT.VIDEOADSTARTED:this._setSessionPlayerStyle("videoadloading videoad"),this.videoAdTriggers.starttime=new Date;break;case this.radioPlayer.EVENT.VIDEOADENDED:const l=new SendServiceReportAction,c=(new Date).getTime();let d={videoReport:[{reqid:this.videoAdTriggers.reqid,startTime:parseInt(this.videoAdTriggers.starttime.getTime()/1e3),flag:this.nextRadioTrackAction.adTriggerReason,position:1}]};l.execute(d),this.videoAdTriggers={played:new Date},this.currentDstm&&(this.currentDstm.info&&this.currentDstm.info.dstmAdFreeDuration&&(this.radioPlayerStateManager().countdownStartTime(c),this.radioPlayerStateManager().dstmClock(c+1e3*this.currentDstm.info.dstmAdFreeDuration)),this.currentDstm=null);case this.radioPlayer.EVENT.VIDEOADNOTREADY:case this.radioPlayer.EVENT.NOVIDEOAD:this._setSessionPlayerStyle(),this.radioPlayer.player.badVideoAdRecoveryTimer&&(clearTimeout(this.radioPlayer.player.badVideoAdRecoveryTimer),this.radioPlayer.player.badVideoAdRecoveryTimer=0),$(".vjs-control-bar.vjs-hidden").removeClass("vjs-hidden");break;case this.radioPlayer.EVENT.ADACTION:e.action}},_extractEpisodesView:function(e){let t=e||APP.currentView.data();return Array.isArray(t)?t.map((e=>{if(Array.isArray(e))return this._extractEpisodesView(e);return!!(e.reportingId&&e.reportingId.match(/\/episodes$/))&&e})).find((e=>!!e)):null},_isOwnContentForegroundError:function(e,t,i){if("web"!==APP.implementationSuperType())return!1;if(!e||e.type!==this.TYPE_PODCAST&&e.type!==this.TYPE_AUDIOBOOK)return!1;if(this.isCasting)return!1;const s=this.radioPlayer;if(!s)return!1;if(s._videoAdStarted||s._wasPlayingVideoAd)return!1;const a=this.radioPlayerStateManager();if(a&&a.playerStyle&&a.playerStyle.indexOf("videoad")>-1)return!1;if("undefined"!=typeof document&&document.querySelector(".video-ad-container"))return!1;const n=i&&(i.track||i.video)||t;if(!n||"ad"===n.type)return!1;if(s.currentTrackObj&&"ad"===s.currentTrackObj.type)return!1;const o=APP.MESSAGING&&"function"==typeof APP.MESSAGING.modal?APP.MESSAGING.modal():null;return!o||!o.severe&&!o.disableClose},_holdOnTerminalError:function(){const e=this.radioPlayer;if(!e||null==e.currentTrackObj)return;e.onPingBackAction("event","stop"),e.currentTrackObj=null;const t=this.radioPlayerStateManager();t.isStarting=!1,t.state="stop",t.buttonstyle="play",this.radioPlayerStateManager(t),this.radioPlayerStateManager.valueHasMutated(),this.currentTrack.valueHasMutated(),APP.MESSAGING.prompt("playbackError")},_stopUnplayableItem:function(e,t){if(e&&e.gaveUp)return;e&&(e.gaveUp=!0),CONSOLE.warn(["SlackerPlayerSessionModule::_stopUnplayableItem",t,e&&e.id]),this.radioPlayer&&(this.radioPlayer.currentTrackObj=null),this.bIsSkipping=!1,this.onDeckTrack(null);const i=this.radioPlayerStateManager();i.isStarting=!1,i.state="stop",i.buttonstyle="play",this.radioPlayerStateManager(i),this.radioPlayerStateManager.valueHasMutated(),this.currentTrack.valueHasMutated();const s=APP.MESSAGING&&"function"==typeof APP.MESSAGING.modal?APP.MESSAGING.modal():null;s&&(s.severe||s.disableClose)||APP.MESSAGING.prompt("playbackError")},_onPlayerTrackEnded:function(e,t,i=null){const s=this.currentPlayableItem(),a=this.currentTrack(),n=this.playlist();if(a){if("audiobook"===s.type){this.currentPlayableItem(null),this.onDeckTrack(null),this.radioPlayer.onPingBackAction("event","stop"),this.radioPlayer.stop(!1,!0);const e=this.radioPlayerStateManager();return e.state="stop",e.buttonstyle="play",this.radioPlayerStateManager(e),this.radioPlayerStateManager.valueHasMutated(),void $("body").removeClass("radio-bar-active")}s.type===this.TYPE_PODCAST?this.radioPlayer&&this.radioPlayer.onPingBackAction("event","stop"):(this.beaconEvent.execute("trackEnd",{end:e,track:Object.assign({},a),statistics:this.radioPlayer.pingPOST}),"error"!=e||null==i||2!=i.code&&4!=i.code||this.beaconEvent.execute("mediaPlayerError",{end:e,track:Object.assign({},this.currentTrack()),statistics:this.radioPlayer.pingPOST,reason_data:i}),"error"===e&&"ad"===a.type&&"audio"===a.adtype&&(this.radioPlayer.pingPOST?.elapsed??0)<2&&com.slacker.sads.SAds.reportAudioAdError(i?.code,this.radioPlayer.pingPOST?.mediaUrl||a.URL),"error"!==e&&"ad"===a.type&&"audio"===a.adtype&&com.slacker.sads.SAds.reportAudioAdSuccess()),a.adtype&&a.adtype.indexOf("dstm")>-1&&this.currentDstm&&(t=a.adtype)}if(!(s.id&&APP.remoteSession()?.currentSession==s.id||com.slacker.sads.SAds._hardBlockActive))if(s.type===this.TYPE_STATION&&s.mode===this.MODE_RADIO)this.getNextRadioTrack(e,t);else{if(s.autoConvertToStation&&s.nextIdx>-1&&("error"!==e||s.hasPlayed))return CONSOLE.warn("Single song playback complete. Convert to station based on song."),void("SlackerCommandTest"===s.id?s.stop():"string"==typeof s.autoConvertToStation?this.startRadioStation(s.autoConvertToStation,null,"ChangeStation",null):(APP.MESSAGING.prompt("auto-convert-song-to-radio",{title:this.currentTrack().title}),this.startRadioStationFromId("song",{id:n[s.nextIdx].id,"perf-id":n[s.nextIdx].pid},null,!0)));if(s.type===this.TYPE_STATION){if(s.nextIdx--,-1===s.nextIdx)return CONSOLE.warn("END of OnDemand Radio History. Back to normal Radio play."),s.mode=this.MODE_RADIO,this.currentPlayableItem.valueHasMutated(),void this.getNextRadioTrack(e,t)}else if(s.type!==this.TYPE_PODCAST||s.initPlaylist)s.isShuffle()?(s.nextShuffleIndex.length||this.togglePlaylistShuffleMode(!0),s.nextIdx=s.nextShuffleIndex.pop()):s.nextIdx++;else if(s.nextIdx--,s.nextIdx<0)return void s.stop();
1if(n[s.nextIdx]){if(0==n[s.nextIdx].olicensed)return CONSOLE.warn("Requested OD track is not licensed for OD. Try next item"),void this._onPlayerTrackEnded(e,t)}else{if(this.isPodcast()){const{size:e,totalElements:t,totalPages:i,number:a}=this.podcastDef&&this.podcastDef.page,n=a===i-1,o=n?t-a*e:(a+1)*e-1,r=this._extractEpisodesView(),{links:l}=this.podcastDef;if(s.nextIdx>o){const e=l.next;s.nextIdx;s.nextIdx=0,n||r&&APP.currentView.getPage(e.href(),r,(()=>this.startPodcast(s.id)))}}if(s.initPlaylist)return this.bIsSkipping=!1,this.currentTrack(null),this.onDeckTrack(null),void APP.MESSAGING.prompt("playlistNotPlayable",null,null,null,{contentType:s.type,accountTier:parseInt(APP.USER.slackerUser().tier)});s.nextIdx=0}s.initPlaylist=!1,s.type!=this.TYPE_STATION&&this.onDeckTrack(null),n[s.nextIdx]?s.type==this.TYPE_PODCAST?this._onNextSlackerServiceTrack(200,{Next:{Track:n[s.nextIdx]}}):this.getNextODTrack(e,n[s.nextIdx]):s.stop()}}},registerPackage("com.slacker.app.modules.SlackerPlayerSessionModule"),com.slacker.app.modules.SlackerPlayerSessionModule=new SlackerPlayerSessionModule})()})),bjork("com.slacker.app.modules.UrlModule",(function(){!function(){const e=require("com.slacker.util.encoding.B64"),t="slacker.{ENV}liveone.com";function i(){this.__constants(),this.__properties(),this.__constructor()}i.prototype={__constants:function(){if("object"==typeof Intl)try{this.TIMEZONE_STRING=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}finally{if(!this.TIMEZONE_STRING){let e=new Date,t=dateFormat(e,"Z"),i=e.getTimezoneOffset()/60;t.indexOf("DT")>-1?this.TIMEZONE_STRING=t.replace("DT","ST")+(i+1)+t:this.TIMEZONE_STRING=t}}this.SLACKER_ROOTS={ROOT:`https://${t}/`,MIXER:`https://${t}/mixer/`,IAPI:"http://iapi.{ENV}slacker.com/",SAPI:"https://sapi.{ENV}slacker.com/",ISV:"https://images.{ENV}slacker.com/isv1/",WS:`https://${t}/wsv1/`,ACCOUNT:"https://account.{ENV}liveone.com/",STORE:"https://store.{ENV}liveone.com/"},this.SERVICE={API:{ROOT:"https://api.{ENV}liveone.com",SETTINGS:null,APPSTARTBEACON:"https://api.{ENV}liveone.com/pingback/appStart",EVENTBEACON:"https://api.{ENV}liveone.com/pingback/events"},DATA:{ROOT:"https://www.{ENV}liveone.com",STATIC:"/pages/viewparts/{viewName}Body.jsp",BLOGROOT:"https://cms.{ENV}liveone.com",BLOG:"https://cms.{ENV}liveone.com/category/blog/feed/atom/",CAREERS:"https://cms.{ENV}liveone.com/category/careers/feed/atom?rnd={rnd}",LOGIN:"login",MORE:{ABOUT:"about",CONTACT:"contact",APPS:"apps",ACTIVATE:"activate",ACCESSIBILITY:"accessibility"},SETTINGS:null},SLACKER:{DOMAIN:this.get(this.SLACKER_ROOTS.ROOT).split("//")[1].replace("/",""),API:{ROOT:this.SLACKER_ROOTS.MIXER,WS:this.SLACKER_ROOTS.WS,USERPOLICY:this.SLACKER_ROOTS.WS+"userpolicy",USER:"https://slacker.{ENV}liveone.com/slacker-account-service/users",WSV1SETTINGS:this.SLACKER_ROOTS.WS+"account/{account-id}",WSTOKEN:this.SLACKER_ROOTS.WS+"auth/wstoken2",TOKEN:this.SLACKER_ROOTS.SAPI+"auth/oauth/token",TOKENBRIDGE:this.SLACKER_ROOTS.WS+"auth/wstokenbridge"},SESSION:{STOP:this.SLACKER_ROOTS.WS+"session/stop?aid={account-id}&client={client-id}&ul={user-level}&sid={station-id}&last={track-id}&fid={file-id}&end={event}&len={len}&elapsed={elapsed}&site={site}&partner={station-tree-partner}{ur}{urtime}{itt}{urend}{nlsuid}",NEXT:this.SLACKER_ROOTS.WS+"session/next2?aid={account-id}&client={client-id}&ul={user-level}&sid={station-id}&quality={stream-quality}&last={track-id}&fid={file-id}&end={event}&len={len}&elapsed={elapsed}&site={site}&partner={station-tree-partner}{ur}{urtime}{itt}{urend}{nlsuid}{dstm}{abp}",peek:this.SLACKER_ROOTS.WS+"session/peek?aid={account-id}&client={client-id}&ul={user-level}&sid={station-id}&format={format}&site={site}&partner={station-tree-partner}",ODMEDIA:this.SLACKER_ROOTS.WS+"getodmedia?client={client-id}&quality={stream-quality}&last={track-id}&fid={file-id}&end={event}&len={len}&elapsed={elapsed}&plid={plid}&{odtrack-1}&{odtrack-2}&{odtrack-3}&site={site}&partner={station-tree-partner}{ur}{urtime}{itt}{urend}",createParty:this.SLACKER_ROOTS.WS+"sessions/{account-id}",partyAction:this.SLACKER_ROOTS.WS+"{party-uri}",PING:this.SLACKER_ROOTS.WS+"session/ping?aid={account-id}&sid={station-id}&elapsed={elapsed}&url={url}&partner={station-tree-partner}&trackType={track-type}",REPORT:this.SLACKER_ROOTS.WS+"session/contentReport?aid={account-id}",RATINGS:this.SLACKER_ROOTS.WS+"ratings/{rating-id}",WHEREAMI:this.SLACKER_ROOTS.WS+"whereami",LOGUPLOAD:this.SLACKER_ROOTS.WS+"metova/logupload",URLALIAS:this.SLACKER_ROOTS.WS+"geturlalias/{account-id}",SIMPLESETTINGS:`${this.SLACKER_ROOTS.WS}player/simplesettings`},DATA:{CATEGORYROOT:null,STATIONSALL:`${this.SLACKER_ROOTS.MIXER}stationtree/LIVEXLIVE/US/categories/1/1900/categories`,MY_CONTENT:`${this.SLACKER_ROOTS.ROOT}xslte/myContentTree?client={client-id}&acctId={account-id}&territory={territory}&explicit={explicit}&partner={station-tree-partner}&site={site}&domain=www.{ENV}slacker.com&rnd={rnd}`,PLAYLIST:this.SLACKER_ROOTS.WS+"{id}?territory={territory}&explicit={explicit}&partner={station-tree-partner}&site={site}&maxRelatedStations={max-related}&rnd={rnd}",IMAGESERVICE:this.SLACKER_ROOTS.ISV+"{type}/v{cache-bust}/{id}/web/3{extra}",STATIONSLIDERS:`${this.SLACKER_ROOTS.MIXER}stationtree/{station-tree-partner}/{territory}/{station-id}/sliders?{mixerSessionParams}&rnd={rnd}`,STATIONFULL:`${this.SLACKER_ROOTS.MIXER}stationtree/{station-tree-partner}/{territory}/{station-id}/full?maxDepth={max-related}&{mixerSessionParams}&rnd={rnd}`,ARTISTFULL:`${this.SLACKER_ROOTS.MIXER}catalog/{station-tree-partner}/{territory}/{account-id}/artists/{id}/full?maxDepth={max-related}&{mixerSessionParams}&rnd={rnd}`,ALBUMFULL:`${this.SLACKER_ROOTS.MIXER}catalog/{station-tree-partner}/{territory}/{account-id}/albums/{id}/full?{mixerSessionParams}&rnd={rnd}`,SONGFULL:`${this.SLACKER_ROOTS.MIXER}catalog/{station-tree-partner}/{territory}/{account-id}/songs/{id}/full?trackId={track-id}&{mixerSessionParams}&rnd={rnd}`,PODCASTFULL:`${this.SLACKER_ROOTS.MIXER}catalog/{station-tree-partner}/{territory}/{account-id}/podcasts/{id}/full?trackId={track-id}&{mixerSessionParams}&rnd={rnd}`,AUDIOBOOKFULL:`${this.SLACKER_ROOTS.MIXER}catalog/{station-tree-partner}/{territory}/{account-id}/audiobooks/{id}?{mixerSessionParams}&rnd={rnd}`,PRESETS:`${this.SLACKER_ROOTS.MIXER}presets/{site}/{territory}/{account-id}/default`},CREATE:{STATION:`${this.SLACKER_ROOTS.WS}stationbuilder?{type-arg}&site={site}`},CONTEST:{ENTRY:`${this.SLACKER_ROOTS.SAPI}contest/entries`},EDIT:{STATION:this.SLACKER_ROOTS.WS+"edit/{station-id}",PLAYLIST:this.SLACKER_ROOTS.WS+"{id}",FAVORITES:this.SLACKER_ROOTS.WS+"favorites/{account-id}",BOOKMARK:this.SLACKER_ROOTS.WS+"stationordering/{account-id}"},SEARCH:{VIEW:"search",SEO:`${this.SLACKER_ROOTS.ROOT}search/seo.do?searchFor={search-for}&query={query}&includeFilter=data&newsearch=1&site={site}&explicit={explicit}&territory={territory}`,FULL:`${this.SLACKER_ROOTS.ROOT}search/search.do?maxResults={max-results}&searchFor={search-for}&query={query}&includeFilter={include-filter}&searchMode={search-mode}&newsearch=1&site={station-tree-partner}&partner={u_partner}&explicit={explicit}&territory={territory}`,QUICK:`${this.SLACKER_ROOTS.ROOT}search/quicksearch?maxResults={max-results}&searchFor={search-for}&query={query}&includeFilter={include-filter}&searchMode={search-mode}&newsearch=1&site={station-tree-partner}&partner={u_partner}&explicit={explicit}&territory={territory}`},EVENT:{WSV1:this.SLACKER_ROOTS.WS+"event/{event}",BEACON:this.SLACKER_ROOTS.ROOT+"beacon/event/{event}"},CAPTCHA:{GETID:"https://www.{ENV}liveone.com/captcha/get?a={a-cookie}&rnd={rnd}",GETIMAGE:`${this.SLACKER_ROOTS.STORE}register/Captcha.do?id={captcha-id}&rnd={rnd}`,SUBMIT:`${this.SLACKER_ROOTS.WS}auth/captchacheck?captchaId={captcha-id}&captchaGuess={captcha-guess}`},LOGIN:`${this.SLACKER_ROOTS.ACCOUNT}login`,CREATEACCOUNT:`${this.SLACKER_ROOTS.ACCOUNT}createAccount`,SETTINGS:`${this.SLACKER_ROOTS.ACCOUNT}settings/`,ACCOUNTS:{FLAGS:`${this.SLACKER_ROOTS.IAPI}accounts/flags/{account-id}`}}}},__properties:function(){},__constructor:function(){"prd"==APP_ENV&&(this.SLACKER_ROOTS.ISV="https://i.slkimg.com/isv1/",this.SERVICE.SLACKER.DATA.IMAGESERVICE=this.SLACKER_ROOTS.ISV+"{type}/v{cache-bust}/{id}/web/3{extra}")},get:function(t,i){const s="undefined"!=typeof APP?APP.USER.slackerUser():null,a=-1!=location.href.indexOf("file://"),n=APP_ENV;let o=t;if(a&&0!=o.indexOf("http")&&o==this.SERVICE.DATA.STATIC&&(o=o.replace("/","./").replace(".jsp",".html")),"templated"==i?.linktype){const e=t.match(/\{([\?|\&][^\}]+)\}/);let i,s=[];e&&(i=0==e[1].indexOf("?")||0==e[1].indexOf("&"),i&&(i=e[1].substring(0,1),e[1]=e[1].substring(1),e[1].split(",").forEach((e=>{s.push(`${e}={${e}}`)})),o=t.replace(e[0],`${i}${s.join("&")}`).replace("http:","https:")))}if("prd"===n||""===n?(o=o.replace(/\{ENV\}/g,""),o.indexOf("blog")>-1&&(o=o.replace("://wp.","://cms."))):o=o.replace(/\{ENV\}/g,n+".sd"),o=o.replace("{cache-bust}
1",APP_VERSION),o=this.SERVICE?.SLACKER?.mixerSessionParams?o.replace("{mixerSessionParams}",this.SERVICE.SLACKER.mixerSessionParams):o.replace("{mixerSessionParams}",""),o?.indexOf("{")>-1){i&&(o=Object.keys(i).reduce(((e,t)=>e.replace(`{${t}}`,i[t])),o));const t={"{client-id}":CONFIG.slackerConfig.client,"{site}":CONFIG.slackerConfig.site,"{station-tree-partner}":CONFIG.slackerConfig.stationtree,"{tz}":encodeURIComponent(this.TIMEZONE_STRING),"{rnd}":(new Date).getTime(),"{account-id}":s?.id||1,"{accountId}":s?.id||1,"{aid}":s?.id||1,"{user-level}":s?.tier||0,"{ul}":s?.tier||0,"{explicit}":s?.explicit?1:0,"{territory}":s?.policy?.accountLoc||"","{a-cookie}":s?.id?encodeURIComponent(e.encode64(s.id).replace(/=/g,"|")):""};o=Object.keys(t).reduce(((e,i)=>e.replace(i,t[i])),o),o=o.replace(/\{[^}]+\}/g,"")}else o&&i&&(o+="string"==typeof i?`${o.indexOf("?")>-1?"&":"?"}${i}`:`${o.indexOf("?")>-1?"&":"?"}${$.param(i)}`);return o},getRawParams:function(){const e=window.location.search.slice(1).split("&"),t={};for(let i=0;i<e.length;i++){const s=e[i].match(/^([^=]+)=(.*)$/),a=s?.length>1?s[1]:null,n=s?.length>2?s[2]:null;a&&n&&(t[a]=n)}return t}},registerPackage("com.slacker.app.modules.UrlModule"),com.slacker.app.modules.UrlModule=new i}()})),bjork("com.slacker.app.modules.UserModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.actions.auth.AuthAction"),i=require("com.slacker.app.actions.auth.AccountKitAction"),s=require("com.slacker.app.actions.UserUpdateAction"),a=require("com.slacker.app.actions.slacker.user.AnonCredentialAction"),n=require("com.slacker.app.actions.slacker.user.SlackerTokenAction"),o=require("com.slacker.app.actions.slacker.user.GetUserPolicyAction"),r=require("com.slacker.app.actions.slacker.radio.GetSimpleSettingsAction"),l=require("com.slacker.app.actions.slacker.radio.GetSlackerProfileTree"),c=require("com.slacker.util.browser.Browser"),d=require("com.slacker.app.actions.MenuAction"),u=require("com.slacker.app.modules.BrazeModule");let h=null;function p(){this.__constants(),this.__properties(),this.__constructor()}p.prototype={__constants:function(){this.EVENTS=new e,this.EVENT={USERLOGIN:"event-user-login",USERLOGOUT:"event-user-logout",USERREG:"event-user-reg",USERERROR:"event-user-error"},this.AUTH=new t,this.UPDATE=new s,this.ANONCREDENTIAL=new a,this.AK=new i},__properties:function(){const e=this;this.slackerUser=ko.observable({profileImgUrl:null,actualTier:0,username:null,policy:null,basicProfile:null}),this.user=ko.observable({accountId:0,username:"",name:"",email:"",isAnon:!0,removalAuth:null,loginType:null,regType:null,links:{},ayslTstamp:0,reset:function(){this.accountId=0,this.username="",this.name="",this.email="",this.phone="",this.isAnon=!0,this.removalAuth=null},get:function(e){if(this.hasOwnProperty(e))return this[e]},hash:function(){let e=Object.keys(this).map((e=>this[e]));return com.slacker.util.encoding.B64.encode64(e.join(","))}}),this.slackerUser.subscribe((()=>{const t=e.slackerUser();console.log("slackerUser changed:",{id:t.id,username:t.username,tier:t.actualTier,hasPolicy:!!t.policy})})),this.getProfileImage=ko.computed((function(){const t=e.slackerUser();return t&&t.profileImgUrl?t.profileImgUrl:null})),this.userTierText=ko.computed((function(){const t=e.slackerUser(),i=t.policy&&t.policy.promo?"effectiveTier":"actualTier";switch(Number(t[i])){case 15:return"Platinum";case 10:return"Premium";case 5:return"Plus";case 1:return"Basic"}return"Anonymous"})),this.userTierStyles=ko.computed((function(){const t=e.slackerUser();let i=[];if(t.policy&&t.policy.promo){const e=t.policy.promo,s=new Date,a=new Date(Number(e.endDate));Math.floor((a-s)/1e3/3600/24);e.uiMessage=null,i.push("promo"),i.push(e.type),e.messages.message.filter((e=>"default"==e.showon)).forEach((t=>{e.uiMessage=APP.getFormattedHtmlFromString({msg:t._cdata,links:t.linksMap||[]})}))}return`${e.userTierText()} ${i.join(" ")}`})),this.updateableFields=["name","email","username","marketingOptIn"],this.actions={newsletter:ko.observable()},this.doAfterLogin=null,this.isActionPending=ko.observable(!1),this.isPendingRegistrationEvent=ko.observable(!1),this.isPendingLogoutEvent=!1,this.suspendReauthActions=!1,this.evt_listener,this.onTokenResponse=this._onTokenResponse.bind(this),this.navBarMenuItem=ko.observable([]),this.userPolicyProm
1ise=null,this.resolveUserPolicyPromise=null,this.loadedUserPolicy=null,this.resetAysl=()=>{if(this.user().ayslTstamp=(new Date).getTime(),!this.simpleSettings)return;const e=this.slackerUser(),t=e&&void 0!==e.actualTier?e.actualTier:0;let i=3600*this.simpleSettings.session.aysl[{0:"anon",1:"basic",5:"plus",10:"premium"}[t]]*1e3;this.simpleSettings.session.aysl[t]>i&&(CONSOLE.warn("AYSL Timeout for user is beyond max allowed by service. Reset to service value."),this.simpleSettings.session.aysl[t]=i)},this.isAyslTimeout=()=>{const e=this.slackerUser(),t=e&&void 0!==e.actualTier?e.actualTier:0,i=(new Date).getTime();try{if(this.simpleSettings.session.aysl[t])return i-this.user().ayslTstamp>this.simpleSettings.session.aysl[t]}catch(e){CONSOLE.error("Failed to read AYSL data - ",e)}return!1},this.simpleSettings=null},__constructor:function(){this.EVENTS.attachEvent(this.EVENT.USERLOGIN,this._onUserLogin.bind(this)),this.EVENTS.attachEvent(this.EVENT.USERLOGOUT,this._onUserLogout.bind(this)),this.EVENTS.attachEvent(this.EVENT.USERREG,this._onUserRegister.bind(this))},init:function(e){e&&(this.evt_listener=e);const t=APP.SERVICE.isCached("refresh_token");let i;this.resetAysl(),t&&t.trim()?this.AUTH.useRefreshToken(t,this.onTokenResponse):(this.user().regType="anonymous",this.AUTH.getClientCredentials(this.onTokenResponse));const s=()=>{const e=Q_STRING.get("action");let i=!1;try{i=!!(JSON.parse(APP.SERVICE.isCached("slackerUser"))||{}).id}catch(e){}i&&t&&t.trim()&&"true"!==Q_STRING.get("forceLogout")&&("purchase"===e||"upgrade"===e)&&(this.doAfterLogin=function(){const t=APP.MESSAGING.messages[`${e}-success`];t&&APP.MESSAGING.prompt(t),APP.purchaseQueue&&APP.purchaseQueue.leaveQueue(!0)})},a=e=>{e&&e.hqMedia&&APP.SERVICE.cache("aq","on"==e.hqMedia?"hi":"med")};let n=null;if(Q_STRING.get("slackeruser")){const e=decodeURIComponent(Q_STRING.get("slackeruser"));let i=null,o=null;try{i=$.deparam(com.slacker.util.encoding.B64.decode64(e.replace(/\./gi,"=")))}catch(e){}try{o=(JSON.parse(APP.SERVICE.isCached("slackerUser"))||{}).id}catch(e){}const r=i&&i.id,l=!(!r||!o||String(r)!==String(o)),c=!(!i||!i.loginToken);if(t&&t.trim()&&l&&!c)n="same-account-ignore",a(i),s();else{n="login",APP.SERVICE.uncache("slackerUser");const t="true"!==Q_STRING.get("forceLogout")?Q_STRING.get("action"):null;this.onSlackerLoginUpdate(e,t)}}else if(Q_STRING.get("settings")){const e=decodeURIComponent(Q_STRING.get("settings"));let t=null;try{t=$.deparam(com.slacker.util.encoding.B64.decode64(e.replace(/\./gi,"=")))}catch(e){}if(a(t),t&&t.loginToken){n="settings-login",APP.SERVICE.uncache("slackerUser");const t="true"!==Q_STRING.get("forceLogout")?Q_STRING.get("action"):null;this.onSlackerLoginUpdate(e,t)}else n="settings-ignore",s()}n&&CONSOLE.info(["UserModule::init Safari hand-back",n,{refreshToken:!(!t||!t.trim()),action:Q_STRING.get("action"),aq:APP.SERVICE.isCached("aq")}]),"true"===Q_STRING.get("isCostcoIabToBt")&&APP.isCostcoIabToBt(!0),i=new d({title:"",type:"login avatar init",seoName:"settings",subnav:[]},null,""),i.subnav.push(new d({title:"",type:"loader centered",seoName:""},null)),this.navBarMenuItem([i])},doSlackerAnon:function(e){this.ANONCREDENTIAL.isFetching?(CONSOLE.warn("Anon user credential action in process...just forward passthrough"),e&&e()):(this.ANONCREDENTIAL.passThrough=e,this.ANONCREDENTIAL.execute(this.onSlackerNonUserCredentialAction.bind(this)))},doForceSlackerLogin:function(e,t,i,s="lxllogin"){if(c.isTV())APP.goToPage("activate");else{let a=`${APP.SERVICE.urls.SLACKER.LOGIN}?done=${s}`;t&&!Q_STRING.get("source")&&(a+=`&source=client_web_${t}`),this.doSlackerLogin(a,e,i)}},doForceSlackerCreate:function(e,t,i,s,a="lxllogin"){let n=[`${APP.SERVICE.urls.SLACKER.CREATEACCOUNT}?done=${a}`],o=this.slackerUser(),r={};if(t&&!Q_STRING.get("source")&&n.push(`&source=client_web_${t}`),i){o||(o={});for(let e in i)o[e]&&(r[e]=o[e]),o[e]=i[e];console.log("setting slackerUser to: ",JSON.stringify(o)),this.slackerUser(o)}const l={loginToken:o.loginToken,code:o.code?o.code():null,id:o.accountId},c=Object.keys(l).reduce(((e,t)=>({...e,...l[t]?{[t]:l[t]}:{}})),{}),d={...this.getCompactSlackerUser(),...c};if(n.push(`&token=${window.encodeParamsForSlackerService(d)}`),i)for(let e in i)r[e]?o[e]=r[e]:delete o[e],this.slackerUser(o);this.doSlackerLogin(n.join(""),e,s)},doSlackerLogin:function(e,t,i,s="lxllogin",a={}){const n=this.getCompactSlackerUser();let o=location.host.split("."),r="login";this.resetAysl(),APP.currentView&&APP.currentView.isEditDirty()?APP.MESSAGING.prompt("discardUnsavedChanges",null,[{label:"Cancel",styles:"std",action:null},{label:"Discard",styles:"std secondary",action:()=>{BEACON.tagEvent({name:"hidePrompt",params:{value:"discardUnsavedChanges",label:"discard"}}),APP.MESSAGING.setModal(),APP.currentView.isEditDirty(!1),this.doSlackerLogin(e,t,i,s)}}]):(e&&"string"==typeof e||(this.slackerUser()&&0!=this.slackerUser().actualTier?e=`${APP.SERVICE.urls.SLACKER.LOGIN}?done=${s}`:(e=`${APP.SERVICE.urls.SLACKER.CREATEACCOUNT}?done=${s}`,e+="&token="+window.encodeParamsForSlackerService(n),r="createAccount")),o[0].indexOf("-local")>-1&&(e=e.replace("account",o[0]+"-login")),t&&(this.doAfterLogin=t),["source","utm_campaign","utm_source","utm_medium","utm_content"].forEach((t=>{Q_STRING.get(t)&&(e+=`&${t}=${Q_STRING.get(t)}`)}
1)),APP.purchaseQueue&&APP.purchaseQueue.reentryToken&&(e+=`&queueToken=${APP.purchaseQueue.reentryToken}`),this._attemptCloseLoginWindow(),i||c.isSafari()?location.href=APP.SERVICE.URLMODULE.get(e):c.isSafari()?setTimeout((()=>{APP.USER.slackerLoginWindow=window.open(APP.SERVICE.URLMODULE.get(e),"_blank")})):(APP.USER.externalWindowSrc=APP.SERVICE.URLMODULE.get(e),APP.MESSAGING.prompt("slacker-external-service",{beaconId:r},null,{}),this._handleChromeIframeBug()))},doSlackerSettings:function(e={}){let t=e&&e.forceNav,i=APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.SLACKER.SETTINGS),s={token:window.encodeParamsForSlackerService(this.getCompactSlackerUser())};if(APP.USER.slackerUser().hooplaUser&&(s.isHoopla="true"),Object.keys(e).forEach((t=>{"forceNav"!==t&&(s[t]=e[t])})),CONSOLE.debug("Calling settings with user token: "+s.token),this._attemptCloseLoginWindow(),t||c.isSafari()){const t=APP.USER.slackerUser();let a=t&&t.id||e&&e.getStudentOffer?s:null;CONSOLE.info(["UserModule::doSlackerSettings","Safari auth/settings redirect; tokenCarried:",!!a]),location.href=APP.SERVICE.URLMODULE.get(i,a)}else c.isSafari()?APP.USER.slackerLoginWindow=window.open(APP.SERVICE.URLMODULE.get(i,s)):(APP.USER.externalWindowSrc=APP.SERVICE.URLMODULE.get(i,s),APP.MESSAGING.prompt("slacker-external-service",{beaconId:"settings"},null,{}),this._handleChromeIframeBug())},login:function(e,t){this.resetAysl(),e||t||this.getAccount()},logout:function(){APP.canUseRadio=!1,APP.checkAcessibilityTTSAction("Signing out. Please wait..."),BEACON.tagEvent({name:"logout"}
1),u.onLogout(),this.user().reset(),APP.SERVICE.uncache("refresh_token"),APP.SERVICE.uncache("lastSlackerPlayed");(new o)._clearUserData(),this.isPendingLogoutEvent=!0,this.isActionPending(!0),APP.purchaseQueue&&APP.purchaseQueue.leaveQueue(!0),this.login()},getAccount:function(){this.AUTH.getAccount(this.onTokenResponse)},getAccountCredentials:function(e,t){this.AUTH.getAccountCredentials(e,t,this.onTokenResponse)},getSlackerToken:function(e,t){if(this.suspendReauthActions)return CONSOLE.warn("User state has suspended token actions. Waiting for new user state."),void setTimeout((()=>this.getSlackerToken(e,t)),1e3);this.user().accountId||t?(this.slackerUser().error=null,t&&(n.isFetching=!1),n.execute(this.onSlackerToken.bind(this),e)):(console.trace(),CONSOLE.info("Waiting for LXL user before completing Slacker user."),setTimeout((()=>this.getSlackerToken(e,t)),1e3))},isSlackerTokenActionInProcess:function(){return n.isFetching},getCompactSlackerUser:function(){const e=this.slackerUser();let t={ref:"lxl",accountId:e.id,id:e.id,level:e.actualTier,username:e.username,wstoken:e.token,receiveNewsLetter:e.receiveNewsLetter,promoid:e.promoid?e.promoid:null,hqMedia:"hi"==APP.SERVICE.isCached("aq")?"on":"off"};return e.actualTier>0&&(t.oauth=e.access_token),APP.noUpsell()&&(t.noupsell=!0),t},useAccountKitCode:function(e){this.isPendingRegistrationEvent(!0),this.isActionPending(!0),this.user().regType="basic",this.AUTH.useAccountKitCode(e,this.onTokenResponse)},removeUserRequest:function(){APP.MESSAGING.prompt("removeUserConfirm")},doRemoveUser:function(){var e=this.user().removalAuth;this.user().removalAuth=null,this.user().hash()==e&&this.user().links.ANONYMIZE?($("body").removeClass("loaded").addClass("loading"),this.UPDATE.removeUser(this.user(),function(e,t,i){"error"===t?(BEACON.tagEvent({name:"removeUser",params:{value:"error"}}),$("body").removeClass("loading").addClass("loaded"),i.responseJSON?APP.MESSAGING.prompt("modalErrorFree",{reason:i.responseJSON.message}):APP.MESSAGING.prompt("modalErrorViewFailed",{reason:" ("+i.statusCode().status+")"})):(BEACON.tagEvent({name:"removeUser",params:{value:"ok"}}),this.logout())}.bind(this))):APP.MESSAGING.prompt("modalErrorFree",{reason:"Please go back to the settings page and retry your request."})},setGoogleRemarketingStatus:function(e){try{void 0===window.gtag&&(!function(){const e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.id="gtag",e.src="https://www.googletagmanager.com/gtag/js?id=AW-1058422864",t.parentNode.insertBefore(e,t)}(),window.gtmDataLayer=window.gtmDataLayer||[],window.gtag=function(){gtmDataLayer.push(arguments)},gtag("js",new Date)),gtag("set","allow_ad_personalization_signals",e),gtag("config","AW-1058422864"),gtag("config","AW-461159094"),e||(void 0!==window._slk_dax&&(window._slk_dax.data=null),"undefined"!=typeof com_adswizz_synchro_getListenerId&&(com_adswizz_synchro_getListenerId=null),void 0!==u&&u.disableTracking())}catch(e){CONSOLE.warn("Error setting remarketing status: ",e)}},setData:function(e,t){var i,s=!1;if(this.UPDATE.isLoaded){if(this.UPDATE.errors(null),e){e.length&&(e=e[0]),t={};for(var a=0;a<this.updateableFields.length;a++)e[i=this.updateableFields[a]]&&this.UPDATE.values[i]!=e[i].value&&(s=!0,t[i]=e[i].value||null)}else s=!0;t&&s&&this.UPDATE.setData(t,e&&e.registration?this._onUserRegisterComplete.bind(this):this._onUserUpdateResponse.bind(this))}},setRedirectLogin:function(){var e=this.user().email||this.user().name||this.slackerUser().username;return this.AUTH.oAuthAction={response_type:Q_STRING.get("response_type"),client_id:Q_STRING.get("client_id"),redirect_uri:Q_STRING.get("redirect_uri"),state:Q_STRING.get("state")},!(!this.user().isAnon&&e)||(this.doRedirectLogin(),!1)},doRedirectLogin:function(){this.AUTH.getOauthRedirectAction(this._onOauthRedirectResponse.bind(this)),this.AUTH.oAuthAction=null},getNavbarMenuItem:function(){const e=this.slackerUser();let t={title:"Your Account",type:"login avatar",seoName:"settings",hideTvGlobalNav:!0,actionType:"button",subnav:[]},i=null,s=e&&e.actualTier>0?e.name||e.username:this.user().name||this.user().username;return s||(s="PROFILE"),e&&e.actualTier>0&&(t.title="tv"==APP.implementationSuperType()?`Settings: ${s}`:s,"tv"==APP.implementationSuperType()?i=()=>{APP.history.unshift(APP.currentView),APP.goToPage("settings")}:(t.subnav.push(new d({title:"My Account",type:"button std secondary",seoName:"settings"},this.doSlackerSettings.bind(this))),!0!==e.hooplaUser&&t.subnav.push(new d({title:"Log Out",type:"button std secondary",seoName:"logout"},(function(){APP.SERVICE.urls.SLACKER.API.CREATEACCOUNT||APP.SERVICE.discoverSlackerAPI(),APP.MESSAGING.prompt("logoutConfirm")}))))),[new d(t,i,"")]},getBasicProfile:function(e,t,i){const s=this.slackerUser();h?s&&-1==h.profile.href.indexOf(s.id)?(h=null,this.getBasicProfile(e,t,i)):APP.SERVICE.fetch({source:h.profile.href,noretry:!0,callback:(a,n,o)=>{a&&a.handle?e(n,a,o):h.profile.href.indexOf(s.id)>-1?s.actualTier&&0!=Number(s.actualTier)?this.createBasicProfile(s.id,((t,i,s)=>e(i,t,s))):t||(APP._setNavigating(!1),APP.MESSAGING.prompt("account-required-to-chat")):e&&e(n,a,o),i&&i()}}):this.__discoverProfileAPI((()=>{this.getBasicProfile(e,t,i)}))},createBasicProfile:function(e,t){h?APP.SERVICE.fetch({method:"POST",source:h["create-profile"].href,dataType:"json",data:JSON.stringify({accountId:e}),callback:(e,i,s)=>{t(e,i,s)}}):this.__discoverProfileAPI((()=>this.createBasicProfile(e,t)))},onSecureSettingsUpdate:function(e){const t=this,i=e?com.slacker.util.encoding.B64.decode64(e.replace(/\./gi,"=")):null,s=$.deparam(i),a=this.slackerUser();if(s){let e=["explicit"],i=["name","profileImgUrl"];for(let n in s){if(i.includes(n))continue;CONSOLE.debug(["UserModule::onSecureSettingsUpdate",n,s[n]]);let o=s[n];if(e.includes(n)&&"string"==typeof s[n]&&s[n],"id"==n||"level"==n||s.loginToken){if(o="level"==n?"actualTier":n,s.loginToken){a.refresh_token=a.access_token=null;let e=JSON.parse(APP.SERVICE.isCached("slackerUser"));e&&(e.username=null,e.id=null,e.loginToken=null,e.access_token=null,e.refresh_token=null,APP.SERVICE.cache("slackerUser",JSON.stringify(e)))}if(s[n]!=a[o]||s.loginToken||s.passwordChange){if(s.passwordChange)return t.logout();setTimeout((function(){t.onSlackerLoginUpdate(null,null,s,(function(){APP.history=[],APP.goToPage("mylibrary")}))}),500);break}}else"hqMedia"==n?APP.SERVICE.cache("aq","on"==s[n]?"hi":"med"):("null"===s[n]&&(s[n]=a[n]),"username"==n&&s[n]&&(s[n]=s[n].trim().replace(/ /g,"+")),void 0!==a[n]&&s[n]!=a[n]&&(a[n]=s[n]))}}if(!s.loginToken){if(s.showUpgradeMatrix&&s.showUpgradeMatrix.trim())return this.slackerLoginWindow?this._attemptCloseLoginWindow():this.externalWindowSrc&&(APP.MESSAGING.setModal(),this.externalWindowSrc=null),delete s.showUpgradeMatrix,delete a.showUpgradeMatrix,void this.get
1SlackerToken((()=>{this.slackerUser.valueHasMutated(),this.navBarMenuItem(this.getNavbarMenuItem()),APP.goToPage("upgrade",{source:"settings-matrix"})}));this.getSlackerToken((()=>{this.slackerUser.valueHasMutated(),this.navBarMenuItem(this.getNavbarMenuItem())})),this.slackerLoginWindow?this._attemptCloseLoginWindow():this.externalWindowSrc&&(APP.MESSAGING.setModal(),this.externalWindowSrc=null)}},onSlackerLoginUpdate:function(e,t,i,s){const a=this.slackerUser();let n=e?com.slacker.util.encoding.B64.decode64(e.replace(/\./gi,"=")):null,o=!1,r=t?APP.MESSAGING.messages[`${t}-success`]:null;if(i=i||(n?$.deparam(n):null),APP.usesSlackerServices=!0,this.AUTH.oAuthAction)return BEACON.tagEvent({name:"login",params:{value:"ok",label:"doOauth"}}),void this.doRedirectLogin();if(this.slackerLoginWindow)this._attemptCloseLoginWindow();else if(this.externalWindowSrc){const e=()=>{APP.MESSAGING.setModal(),this.externalWindowSrc=null};"function"==typeof s&&(s=[s,e]),s||(s=[e])}if(this.doAfterLogin&&(s=this.doAfterLogin,this.doAfterLogin=null),r&&("function"==typeof s&&(s=[s]),s||(s=[]),s.push((()=>APP.MESSAGING.prompt(r))),APP.purchaseQueue&&APP.purchaseQueue.leaveQueue(!0)),"deviceUpgrade"!=t)if(i){if(i.loginToken?(this.suspendReauthActions=!1,APP.SERVICE.uncache("stationMap"),APP.SERVICE.uncache("categoryMap"),APP.SERVICE.uncache("lastSlackerPlayed"),l.clearSessionCache(),i.addEmailRequested||(this.slackerUser().policy=null,BEACON.tagEvent({name:"login",params:{value:"ok",label:"slacker"}}),u.onUserLogin())):i.refresh_token&&(BEACON.tagEvent({name:"login",params:{value:"ok",label:"slacker_auto"}}),u.onUserLogin()),"purchase"!=t&&"upgrade"!=t||i.loginToken||(this.slackerUser().policy=null),o=i&&a&&i.accountTier&&i.accountTier!=a.actualTier,!o&&i.actualTier||(i.actualTier=i.accountTier),i.username?i.username=i.username.replace(/ /g,"+"):i.username=null,i.loginToken||i.refresh_token)i.basicProfile=null,this.slackerUser(i);else{for(let e in i)a[e]=i[e];this.slackerUser(a)}APP.currentView?.activateDeviceAction&&i.code&&"activate"==s&&(s=[s]).push((()=>{APP.currentView.activateDeviceAction.code(i.code),APP.currentView.activateDeviceAction.activate()})),this.getSlackerToken(s)}else APP.currentView||0!=APP.history.length||APP.goHome();else window.location=["//"+window.location.hostname+"/DeviceUpgrade?code="+i.code]},getUserPolicyPromise:function(){return this.userPolicyPromise||(this.userPolicyPromise=new Promise((e=>{this.loadedUserPolicy?(e(this.loadedUserPolicy),this.loadedUserPolicy=null):this.resolveUserPolicyPromise=e}))),this.userPolicyPromise},_resolveUserPolicy:function(e){e?.capabilities&&(this.resolveUserPolicyPromise?(this.resolveUserPolicyPromise(e),this.resolveUserPolicyPromise=null):this.loadedUserPolicy=e)},onSlackerToken:function(e,t=[]){const i=this;switch(APP.doEmbedRefreshOnUserChange&&t.push(APP.doEmbedRefreshOnUserChange),e){case 200:const e=this.slackerUser(),s=new o,a=e.policy,n=()=>{for(;t.length;){let e=t.pop();"function"==typeof e&&e()}};this._resolveUserPolicy(a);let l=!APP.isAppLoaded||!a||APP.slackerAcct()&&e.id!=APP.slackerAcct();if(APP.slackerAcct(e.id),!e.refresh_token)return void this._onUserAuthError("invalid_token","error",{statusCode:()=>400},t);!l&&a&&a.settings?n():s.execute((e=>{const s=this.slackerUser(),a=e&&e.isTerritoryChanged;a&&(e.isTerritoryChanged=!1),s.policy.privacy&&(window?.GPC?.setInternalOptOut(!s.policy.privacy["personalized-ads"].enabled),APP.USER.setGoogleRemarketingStatus(!window?.GPC?.optOut("any"))),s.username&&0==s.actualTier&&(s.actualTier=1);try{s.policy.capabilities.features.ad_free.enabled&&APP.slackerPlayerSession()&&APP.slackerPlayerSession().radioPlayerStateManager().dstmClock(0)}catch(e){}this.user().isAnon=0==s.actualTier,this.user.valueHasMutated(),i.user().isAnon&&(s.username=null),!APP.canUseRadio&&s.audioAllowed?(APP.canUseRadio=!0,APP.usesSlackerServices=!0,l=!0):APP.canUseRadio&&!s.audioAllowed&&(APP.canUseRadio=!1,APP.canShowSlackerStationLink=!1),i.user().isAppLoaded||(i.user().isAppLoaded=!0),l&&(APP.SERVICE.discoverSlackerAPI.apply(APP.SERVICE,[!0]),l=!1),APP.supportsSlacker&&APP.canUseRadio&&!APP.slackerPlayerSession()&&(APP.slackerPlayerSession(require("com.slacker.app.modules.SlackerPlayerSessionModule")),APP.slackerPlayerSession().init()),this.slackerUser.valueHasMutated(),APP.supportsSlacker&&("boolean"!=typeof l||a)||(Q_STRING.get("slackeruser")&&(Q_STRING.set({slackeruser:null}),APP.noHomeOnUserLogin=!0),this.evt_listener.notify(this.EVENT.USERLOGIN,[this.EVENT.USERLOGIN,this.user])),this.navBarMenuItem(this.getNavbarMenuItem()),t.length&&(CONSOLE.info("Retrying chained action(s) after token refresh."),l||a?(a&&"tv"==APP.implementationSuperType()&&(t||(t=[]),t.push((()=>APP.SERVICE.getGlobalNav()))),APP.SERVICE.discoverSlackerAPI().then(n)):n(),APP.SERVICE.getGlobalNav()),l&&r.execute((e=>{this.simpleSettings=e})),this.getBasicProfile(((e,t,i)=>{t.images&&t.images.avatar&&(s.profileImgUrl=t.images.avatar.urls.small),t.name&&(s.name=t.name),t.stats={followerCount:"213",followingCount:"2,471"},t.init=!0,s.basicProfile=t,this.slackerUser(s),APP.currentView&&APP.currentView._onUserProfileUpdate(t)}),!0,(()=>{this.slackerUser(s),this._resolveUserPolicy(e)}))}));break;case 401:let c=JSON.parse(APP.SERVICE.isCached("slackerUser"));this.slackerUser().username&&APP.MESSAGING.prompt("modalErrorFree",{reason:"Something strange happened. You have been logged out of your account. Please re-login."}),c.username=null,c.id=null,c.loginToken=null,c.access_token=null,c.refresh_token=null,APP.SERVICE.cache("slackerUser",JSON.stringify(c)),this.user().regType="error-reload",this.logout()}},onSlackerNonUserCredentialAction:function(e,t,i){let s=this.slackerUser()||null;switch(e){case 200:case 201:s.id=t.accountId,s.loginToken=t.loginToken,s.basicProfile=null,this.slackerUser(s),BEACON.tagEvent({name:"login",params:{value:"ok",label:"slacker_anon"}}
1),u.onUserLogin(),this.getSlackerToken(i)}},getPartnerConfig:function(e){const t=this.slackerUser().policy?.account?.partners;if(Array.isArray(t)){const e=t.find((e=>e?.name===e));return e}{const i=t?.partner;return e&&i?.name===e?i:null}},_handleChromeIframeBug:function(){c.isChrome()&&c.versionInRange("87.0.4280.66","87.0.4280.140")&&setTimeout((()=>{const e=$("iframe#external-service");e.off(),e.on("load",(()=>{e.hide(),setTimeout((()=>e.show()),200)}))}),200)},_onUserLogin:function(){if(this.isPendingRegistrationEvent())BEACON.tagEvent({name:"login",params:{value:"ok",label:"doRegister"}}),u.onUserLogin(),this._onUserRegister();else if(this.AUTH.oAuthAction)BEACON.tagEvent({name:"login",params:{value:"ok",label:"doOauth"}}),u.onUserLogin(),this.doRedirectLogin();else if(!this.isPendingLogoutEvent){let e=APP.SERVICE.isCached("slackerUser");if((!this.slackerUser()||!this.slackerUser().id)&&e&&JSON.parse(e).id)return void this.onSlackerLoginUpdate(null,"autologin",JSON.parse(e));this.slackerUser.policy=(new o).defaults,this._resolveUserPolicy(this.slackerUser().policy),this.user().isAppLoaded=!0,this.evt_listener.notify(this.EVENT.USERLOGIN,[this.EVENT.USERLOGIN,this.user])}},_onUserLogout:function(){const e=this;let t=this.slackerUser();if(this.isPendingLogoutEvent=!1,this.isActionPending(!1),t&&(t.profileImgUrl=null,t.actualTier)){try{APP.slackerPlayerSession().currentPlayableItem().stop("Logout",null,!0)}catch(e){}APP.SERVICE.uncache("slackerUser"),APP.SERVICE.uncache("lastSlackerPlayed"),l.clearSessionCache()}APP.history=[],APP.SERVICE.urls.SLACKER.API.HOME=null,t.username=null,t.accountTier=0,t.actualTier=0,t.policy=null,APP.closeEmbedHeroPlayer(),this.doSlackerAnon((()=>{e.navBarMenuItem(e.getNavbarMenuItem()),this.evt_listener.notify(this.EVENT.USERLOGOUT,[this.EVENT.USERLOGOUT,this.user])}))},_onUserAuthError:function(e,t,i,s){CONSOLE.error(["UserModule::error",e]);let a=this.slackerUser();if(BEACON.tagEvent({name:"login",params:{value:"error",label:e||i.statusCode().status}}),a.error=i.statusCode().status,APP._setNavigating(!1),500==i.statusCode().status)CONSOLE.warn(["UserModule::_onUserAuthError","token 500 - attempt total fresh start."]),APP.MESSAGING.prompt("modalErrorFree",{reason:"Unknown issue authorizing account."});else if(!APP.usesSlackerServices||400!=i.statusCode().status&&"invalid_token"!=e)s&&s(null,t,i),this.evt_listener.notify(this.EVENT.USERERROR,[this.EVENT.USERERROR,this.user]);else{let e={},t=APP.SERVICE.urls.SLACKER.LOGIN,i=JSON.parse(APP.SERVICE.isCached("slackerUser"));e.token=window.encodeParamsForSlackerService(this.getCompactSlackerUser()),APP.history=[],n.chainedAction=[],n.isFetching=!1,a&&a.loginToken?(APP.SERVICE.uncache("slackerUser"),APP.USER.slackerUser({profileImgUrl:null,actualTier:0,username:null,policy:null,basicProfile:null})):i&&(i.id=null,i.username=null,i.loginToken=null,i.access_token=null,i.refresh_token=null,APP.SERVICE.cache("slackerUser",JSON.stringify(i))),"tv"==APP.implementationSuperType()?(this.slackerUser().username&&APP.MESSAGING.prompt("modalError",{reason:"Something strange happened. You have been logged out of your account. Please re-login."}),this.user().regType="error-reload",this.logout()):(this.suspendReauthActions=!0,this.doSlackerLogin(t+"?done=lxllogin&"+$.param(e)))}},_onTokenResponse:function(e,t,i,s){if("error"===t)this.evt_listener.notify(this.EVENT.USERERROR,[this.EVENT.USERERROR]);else{if(e.loginToken&&e.accountId)return this.user().accountId=e.accountId,void this.getAccountCredentials(e.accountId,e.loginToken);if("bearer"===e.token_type&&(APP.NETWORKING.setBearerToken(e.access_token),!APP.NETWORKING.refreshToken&&!e.refresh_token))return void this.getAccount();if(e.refresh_token&&(APP.NETWORKING.setRefreshToken(e.refresh_token),this.user().accountId=e.accountId,this.user().isAnon=e.anonymous,!s&&e.anonymous&&this.user().regType&&("error-reload"==this.user().regType&&this.EVENTS.notify(this.EVENT.USERLOGIN),this.user().regType=null),this.user.valueHasMutated()),this.user.valueHasMutated(),s)return e.refresh_token;this.isPendingLogoutEvent?this.EVENTS.notify(this.EVENT.USERLOGOUT):this.UPDATE.getCurrentData(this._onUserData.bind(this))}},_onUserRegister:function(){"login"!=APP.currentView.seoName&&(APP.queuedLoadTitle(null),APP.goToPage("login")),this.user().isAnon=!1,this.user.valueHasMutated(),APP.USER.isActionPending(!1),setTimeout((function(){$('form#userRegComplete input[name="name"]').focus(),APP.queuedLoadTitle("Register")}),100)},_onUserRegisterComplete:function(e,t,i){if(APP.queuedLoadTitle(null),"error"===t)if(i.responseJSON)if(i.responseJSON.errors&&i.responseJSON.errors.length){let e={};e[i.responseJSON.errors[0].field]="Invalid Value",this.UPDATE.errors(e)}else APP.MESSAGING.prompt("modalErrorFree",{reason:i.responseJSON.message});else APP.MESSAGING.prompt("modalErrorFree",{reason:i.statusCode().status});else this.UPDATE.isProfileSetupRequired(!1),this.AUTH.oAuthAction?this.doRedirectLogin():(e&&(this._onUserData(e,t,i,!1,!0),this.user().regType=null),this.evt_listener.notify(this.EVENT.USERREG,[this.EVENT.USERREG,this.user]))},_onUserData:function(e,t,i,s,a){let n=this.user();if(e){if(e.links)for(let t in e.links)e.links[t].rel&&(n.links[e.links[t].rel.toUpperCase()]=e.links[t].href);if(this.updateableFields.forEach((t=>{n.hasOwnProperty(t)&&(n[t]=e[t]||"",this.UPDATE.setValue(t,e[t]||""))})),e.registrations&&e.registrations[0]&&(n.phone=e.registrations[0].phoneNumber),this.user.valueHasMutated(),this.UPDATE.isLoaded=!0,a)return;this.isPendingRegistrationEvent()?n.email||n.name?(BEACON.tagEvent({name:"login",params:{value:"ok",label:"normal"}}),u.onUserLogin(),this._onUserRegisterComplete()):this.EVENTS.notify(this.EVENT.USERLOGIN):s?this.navBarMenuItem(this.getNavbarMenuItem()):(this.UPDATE.isProfileSetupRequired(!1),this.EVENTS.notify(this.EVENT.USERLOGIN))}},_onUserUpdateResponse:function(e,t,i){if("error"===t)if(i.responseJSON)if(i.responseJSON.errors&&i.responseJSON.errors.length){let e={};e[i.responseJSON.errors[0].field]="Invalid Value",this.UPDATE.errors(e)}else APP.MESSAGING.prompt("modalErrorFree",{reason:i.responseJSON.message});else APP.MESSAGING.prompt("modalErrorFree",{reason:i.statusCode().status});else this._onUserData(e,t,i,!0),APP.MESSAGING.prompt("ticklerFree",{msg:"Information updated."})},_onOauthRedirectResponse:function(e,t,i){"error"!==t&&e&&e.redirectUri?location.href=e.redirectUri:i.responseJSON?i.responseJSON.errors&&i.responseJSON.errors.length?APP.MESSAGING.prompt("modalErrorRdrLogin",{reason:i.responseJSON.errors[0].field+" Invalid Value"}):APP.MESSAGING.prompt("modalErrorRdrLogin",{reason:i.responseJSON.error_description||i.responseJSON.message}):APP.MESSAGING.prompt("modalErrorRdrLogin",{reason:i.statusCode().status})},_attemptCloseLoginWindow:function(){APP.USER.slackerLoginWindow&&setTimeout((()=>{APP.USER.slackerLoginWindow.close(),APP.USER.slackerLoginWindow=null}))},__discoverProfileAPI:function(e){APP.SERVICE.fetch({source:"APP.SERVICE.URLMODULE.SERVICE.SLACKER.API.PROFILEMANAGEMENT",callback:(t,i,s)=>{h=APP.halifyLinks(t.links),e()}})}},registerPackage("com.slacker.app.modules.UserModule"),com.slacker.app.modules.UserModule=p}()})),bjork("com.slacker.app.modules.implementation.GenericTvModule",(function(){!function(){const e=require("com.slacker.app.actions.LaunchVideoStreamA
1ction"),t=require("com.slacker.app.modules.implementation.TenFootModule");function i(){extendClass(this,new t),this.__constants(),this.__properties(),this.__constructor()}i.prototype={__constants:function(){this.VJS_CAPTION_STYLE_DEFAULT={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",fontFamily:"proportionalSansSerif",textOpacity:"1",windowColor:"#000",windowOpacity:"0"}},__properties:function(){this.type="generictv",this.isInitalAppView=!0,this.detailstreamaction=new e("detail"),this.adtlVideoAnnotations={defaultFullScreen:!0,canRetryNonNative:!1,disableAds:!1},this.displayAdOverride=ko.pureComputed((function(){return!0}))},__constructor:function(){$('meta[name="viewport"]')[0].content=`user-scalable=yes, width=device-width, initial-scale=${1/window.devicePixelRatio}, maximum-scale=2.0`,this.$super.constructor(),this.$super.adtlVideoAnnotations=this.adtlVideoAnnotations,APP.suppressDisplayAds=!0,APP.supportsClosedCaptions=!0,APP.onTileClick=this.onTileClick.bind(this),APP.implementationSuperType("tv");const e=this._onVideoPlayEvent.bind(this),t=APP.herostreamaction.videoplayer;["COMPLETED","STARTED"].forEach((i=>t.attachEvent(t.EVENT.PLAYBACK[i],e)));const i=this._onDetailVideoPlayEvent.bind(this),s=this.detailstreamaction;["VIDEOCONTAINERREADY","DISPLAYERROR"].forEach((e=>s.eventMapper.attachEvent(s.videoplayer.EVENT[e],i))),["COMPLETED","STARTED","ERROR","DURATIONCHANGE"].forEach((e=>s.eventMapper.attachEvent(s.videoplayer.EVENT.PLAYBACK[e],i))),$((function(){document.addEventListener("click",APP.USER.resetAysl,!0),$(window).scroll((function(){APP.USER.resetAysl(),APP.currentView&&APP.currentView.onWindowScroll&&APP.currentView.onWindowScroll()}))})),APP.onVideoFullScreenRequest=this.onVideoFullScreenRequest.bind(this),APP.onForceUpdate=this.onForceUpdate.bind(APP),document.addEventListener("keydown",this._handleControlerKeyInput.bind(this),!1),window.removeEventListener("popstate",window.ajaxHistoryHandler),window.addEventListener("popstate",(()=>{setTimeout(this._handleRemoteBackButton.bind(this),10)}),!1),$("body").on("focus","*[tabindex != '-1']:in-viewport:visible",this._handleAccessibleUiItemFocus),$("body").on("change","select",this._handleAccessibleUiItemFocus),$("body").on("focus",".focus-catch",this._handleFocusCatchFocus.bind(this)),CONFIG.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003406203003603103003506103003403403003503103003303503003603603003603403003403403003403703003303403003406503003603203003406603003303603003303303003603103003603803003603803003303002203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",CONFIG.beaconConfig.gaConfig.ua="UA-77390823-9",CONFIG.xscid+="_site:tv",BEACON.partnerLogging=CONFIG.beaconConfig,BEACON.init(),APP.onImplementationConstructed.bind(APP)(this)},init:function(){CONSOLE.warn("Initializing Generic TV Module"),loadCssDynamically("css/tenfoot.css","tv-style");{const e=document.createElement("style");e.textContent="html * {pointer-events: unset !important};",document.head.append(e)}$("body").addClass("tenfoot"),APP.frameworkInclude="/includes/site-framework.jsp",APP.viewNames.push("Settings");try{ko.applyBindings(APP,$(".header-nav-bar")[0])}catch(e){}try{ko.applyBindings(APP,$("#hero-player")[0])}catch(e){}try{ko.applyBindings(APP,$(".page-loading")[0])}catch(e){}try{ko.applyBindings(APP,$("footer")[0])}catch(e){}return APP.EVENTS.attachEvent(APP.EVENT.VIEWACTIVE,this.onActiveVew.bind(this)),window.history.pushState("exit-catch",null,null),new APP.viewsByDomName.HomeView},onForceUpdate:function(){APP.MESSAGING.prompt("appForceUpdate",{},[{label:"CLOSE",action:APP.appImplementationModule.closeApp,styles:"std app-close-btn"}]),setTimeout((function(){$(".app-close-btn").focus()}),200)},onActiveVew:function(e,t){!t&&e&&this.isInitalAppView&&(this.isInitalAppView=!1)},_onSystemVisibilityChange:function(){var e=APP.herostreamaction.videoplayer,t=e?e.currentVideoObj:null,i=t?e.getLastVideoState(t.objectId):null;t&&(document.hidden||document.webkitHidden?APP.herostreamaction.isVideoPlayerActive()&&(e.pause(),e.needsRestartOnResume=!0):APP.herostreamaction.isVideoPlayerActive()&&(e.needsRestartOnResume=!0,"live"!=e.currentVideoObj.streamType&&(e.startOffset=i),this._onSystemPause()))}},registerPackage("com.slacker.app.modules.implementation.GenericTvModule"),com.slacker.app.modules.implementation.GenericTvModule=i}()})),bjork("com.slacker.app.modules.implementation.SiteModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.modules.UrlModule"),i=require("com.slacker.util.browser.Browser"),s=require("com.slacker.sads.SAds"),a=require("com.slacker.app.actions.MenuAction"),n=require("com.slacker.app.actions.LaunchVideoStreamA
1ction");function o(){this.__constants(),this.__properties(),this.__constructor()}o.prototype={__constants:function(){this.EVENTS=new e,this.BROWSER_CSS={edge:"/css/browser/edge.css",firefox:"/css/browser/firefox.css"},this.ALLOWED_PERSIST_QPARAM={amzn_debug_mode:1,source:1,utm_campaign:1,utm_source:1,utm_medium:1,utm_content:1,redeem_online:1}},__properties:function(){this.type="website",this.usesSimpleSettings=!0,this.isVoiceGuideEnabled=!1,this.detailstreamaction=new n("detail"),this.adtlVideoAnnotations={},this.zingtouch},__constructor:function(){CONFIG.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003406203003603103003506103003403403003503103003303503003603603003603403003403403003403703003303403003406503003603203003406603003303603003303303003603103003603803003603803003303002203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",CONFIG.beaconConfig.gaConfig.ua="UA-77390823-1",CONFIG.beaconConfig.gaConfig.ga4="G-G319G56MMQ",CONFIG.beaconConfig.gaConfig.dimensions={dimension1:{name:"User Level"},dimension2:{name:"QueryString"},dimension3:{name:"CampaignId"}},BEACON.partnerLogging=CONFIG.beaconConfig,BEACON.init(),APP.useAdblockNag=!0,APP.supportsSocialMessaging=!0,APP.supportsClosedCaptions=!0,APP.supportsPlatformUpgrade=!0,APP.suppressDisplayAds=!0,APP.onTileClick=this.onTileClick.bind(this),APP._onTileFocus=this._onTileFocus,APP.onUnload=this.onAppUnload,["USERLOGIN","USERLOGOUT","USERREG","USERERROR"].forEach((e=>{APP.EVENTS.attachEvent(APP.USER.EVENT[e],this.onUserEvent.bind(this))}));const e=this._onVideoPlayEvent.bind(this);["VIDEOCONTAINERREADY","DISPLAYERROR","ONFULLSCREENTOGGLE","ONFULLSCREENCHANGE","VIDEOADSTARTED","VIDEOADENDED","NOVIDEOAD"].forEach((t=>{const i=this.detailstreamaction;i.eventMapper.attachEvent(i.videoplayer.EVENT[t],e)})),["COMPLETED","STARTED","ERROR","DURATIONCHANGE"].forEach((t=>{const i=this.detailstreamaction;i.eventMapper.attachEvent(i.videoplayer.EVENT.PLAYBACK[t],e)})),s.events.attachEvent("onAdServerResponse",this.onAdServerResponse.bind(this)),s.events.attachEvent("onAdBlockDetected",this.onAdBlockDetected.bind(this)),s.events.attachEvent("onAdBlockCleared",this.onAdBlockCleared.bind(this)),s.events.attachEvent("onAdBlockAudioBlocked",this.onAdBlockAudioBlocked.bind(this)),document.addEventListener("visibilitychange",(()=>{const e=i.isVisible()&&APP.currentView;e&&(e._doCapitalisticThings(!0),e._doLazyImageLoading(!0))})),$((function(){const e=$("body"),t=$(".header-nav-bar");document.addEventListener("click",APP.USER.resetAysl,!0),$(window).scroll((function(){APP.USER.resetAysl();const i=$(window).scrollTop(),s=$(".hamburger input")[0];let a=0;if(i>0)if(APP.suppressDisplayAds?(t.addClass("fixed"),e.addClass("scrolling")):(e.find(".capUnit.topmost:not(.empty)").each(((s,n)=>{let o=$(n);[50,90,96,250,280].forEach((e=>{o.hasClass(`h${e}`)&&(a=e)})),i<a?(t.removeClass("fixed"),e.removeClass("scrolling"),o.show()):(t.addClass("fixed"),e.addClass("scrolling"),o.hide())})),e.find(".capUnit.topmost.empty").each(((i,s)=>{t.addClass("fixed"),e.addClass("scrolling")}))),i>500+a){const t=e.find("section.schedule.carousel:visible");let s=i-500-a+172;t.length>0&&t[0].offsetHeight>750&&t.find(".carousel-nav").css("top",`${Math.min(s,t.offset().top+t[0].offsetHeight-i/2)}px`)}else e.find("section.schedule.carousel .carousel-nav").css("top","10.75em");else 0==i&&(t.removeClass("fixed"),e.removeClass("scrolling"),APP.currentView&&(APP.currentView.slotRenderingHelper.ids.push($(".topmost.capUnit")[0].id),APP.currentView._doCapitalisticThings(!0)));APP.currentView?.onWindowScroll(),APP.MESSAGING.closeContextMenu();try{s.checked&&s.click()}catch(e){}}))}
1)),i.isMsEdge()&&loadCssDynamically(this.BROWSER_CSS.edge,"edge"),i.isFirefox()&&loadCssDynamically(this.BROWSER_CSS.firefox,"firefox"),APP.mustShowTosFooter(!0),APP.onImplementationConstructed(this)},init:function(){let e=void 0!==window.defaultParams?window.defaultParams:null,t=null;return CONSOLE.warn("Initializing LXL Site"),ko.options.deferUpdates=!0,i.isMobileDevice()&&$("body").addClass("mobile"),Q_STRING.get("lead")&&(e.leadoffdata=Q_STRING.get("lead")),Q_STRING.get("embed")&&e&&e.playOnInit&&(e.playOnInit=!1),APP.EVENTS.attachEvent(APP.EVENT.VIEWACTIVE,this.onActiveVew.bind(this)),APP.EVENTS.attachEvent(APP.EVENT.VIEWFAILED,this.onFailedView.bind(this)),APP.EVENTS.attachEvent(APP.EVENT.VIEWDISPOSE,this.onDisposeView.bind(this)),[".header-nav-bar","#hero-player",".page-loading","#radio","footer"].forEach((e=>{try{ko.applyBindings(APP,$(e)[0])}catch(t){CONSOLE.warn(["SiteModule::init","DOM item KO binding failed. Ignoring.",e])}})),$('*[data-type="static"]').each(((e,t)=>{const i=t.id.split("View");APP.viewNames.push(i[0])})),APP.viewNames.forEach((i=>{if("Static"===i)return;const s=`${i}View`,a=$(`#${s}`)[0];a&&("static"===a.getAttribute("data-type")?(APP.viewsByDomName.StaticView=require(APP.viewsByDomName.StaticView),t=new APP.viewsByDomName.StaticView(i.toLowerCase(),e)):(APP.viewsByDomName[s]=require(APP.viewsByDomName[s]),t=new APP.viewsByDomName[s](e)))})),t},onAppUnload:function(){BEACON.tagEvent({name:"appShutdown"}),this.detailstreamaction.isVideoPlayerActive()&&this.detailstreamaction.videoplayer.stop(),APP.heroEmbedData()&&APP.closeEmbedHeroPlayer(!0),APP.currentView&&APP.currentView.socialMessaging&&APP.currentView.socialMessaging.teardown()},checkAcessibilityTTSAction:function(e,t,i){var s=[],a=APP.MESSAGING.modal();if(this.isVoiceGuideEnabled){if(a&&(a.title||a.msg)&&!_evt)return;t&&(e&&s.push(e),t.ariaLabel?s.push(t.ariaLabel):["title","subtitle","description"].forEach((e=>{t[e]&&s.push(t[e])})),e=s.join(", ")),e?(e=e.replace(/[\r\n]+/g,"").trim(),CONSOLE.debug(["TizenModule::checkAcessibilityTTSAction - speaking",e]),APP._doTTS(e,i)):i||APP._doTTS(null,!1,!0)}},onPostMessageReceived:function(e){CONSOLE.info(["SiteModule::PostMessage Received: ",e.origin,e.data]);try{data=JSON.parse(e.data)}catch(e){data={}}data.command},_onTileFocus:function(e,t){var i=$(t.currentTarget||t.target).parent().find(".title")[0];i&&i.offsetWidth<i.scrollWidth&&$(i).addClass("marquee")},onAdBlockDetected:function(e){BEACON.tagEvent({name:"adblockDetected",params:{value:"detected",label:e||"unknown"}}),this.onAdServerResponse(null,"adblock")},onAdBlockCleared:function(){BEACON.tagEvent({name:"adblockDetected",params:{value:"cleared"}}),document.body.classList.remove("ad-block-detected"),this._lastAdBlockNagAt=0,"adblockDetected"===APP.MESSAGING.modal()?.beaconId&&APP.MESSAGING.setModal()},onAdBlockAudioBlocked:function(){BEACON.tagEvent({name:"adblockDetected",params:{value:"audio-blocked"}});const e=APP.slackerPlayerSession&&APP.slackerPlayerSession();e?.radioPlayer?.stop&&e.radioPlayer.stop(),"adblockDetected"===APP.MESSAGING.modal()?.beaconId&&APP.MESSAGING.setModal(),APP.MESSAGING.prompt("audioAdBlocked")},onAdServerResponse:function(e,t,i,a){const n=APP.MESSAGING.modal(),o=APP.currentView,r=o&&o.data()[0]&&o.data()[0].subTypes&&o.data()[0].subTypes.includes("ticketing");if("adblock"===t&&s.shouldShowShowAdBlockNag()){if(this._lastAdBlockNagAt)return;r||n&&(n.severe||"slacker-external-service-prompt"===n.msg)?CONSOLE.warn(["SiteModule:: onAdServerResponse - adblock - User is in critical flow.",r?"ticketing page":n.beaconId,"Not showing nag."]):(this._lastAdBlockNagAt=Date.now(),document.body.classList.add("ad-block-detected"),APP.MESSAGING.prompt("adblockDetected"))}else if(e&&e.container){const t=$(`#${e.container.id}`);t[0]&&t[0].className.split(" ").filter((e=>e&&"h"==e.charAt(0))).forEach((e=>{t.removeClass(e)})),i?(CONSOLE.debug(["SiteModule:: onAdServerResponse - GPT SlotRenderEnded - EMPTY AD",e.container.getAttribute("data-slotsize")]),t.removeClass("filled").addClass("empty").height("auto"),s.reportEmptySlot(),t.off("click.adblockPlaceholder").on("click.adblockPlaceholder",(e=>{document.body.classList.contains("ad-block-detected")&&(e.preventDefault(),e.stopPropagation(),BEACON.tagEvent({name:"adblockDetected",params:{value:"placeholder-click",label:"upgrade"}}),APP.onRequestUpgrade("plus","adblockPlaceholder"))})),t.hasClass("festivalChat")&&$(".hero .chat-pannel").removeClass("with-banner")):(CONSOLE.debug(["SiteModule:: onAdServerResponse - GPT SlotRenderEnded - FILLED",a.size]),t.removeClass("empty").removeClass((function(e,t){return(t.match(/\bh\d+\b/g)||[]).join(" ")})).addClass("filled").addClass(`h${a.size[1]}`).height(a.size[1]),s.reportFilledSlot(),t.hasClass("festivalChat")&&$(".hero .chat-pannel").addClass("with-banner"))}},onBlogEntryRender:function(e,t){},onTileClick:function(e,t,i,s){if(CONSOLE.warn(["SiteModule:: Handling tile click",e.contentUrl,e.mimeType]),"artistPicker"==APP.MESSAGING?.modal?.()?.beaconId)return;const a=t?$(t.currentTarget||t.target):null;if(isVideoOrFest="video"==e.nodeType||"video"==e.type||e.subTypes&&e.subTypes.join(" ").toLowerCase().indexOf("recorded")>-1||"festival"==e.type,APP.MESSAGING.closeContextMenu(),a&&a.hasClass("detail-video-player"))return!0;
1if(APP.EVENTS.dispatch({type:"tile-click",payload:{obj:e,event:t,bForceNav:i,containerObj:s}}),isVideoOrFest)if(e.isExternal)CONSOLE.warn(["Sending user to external contentUrl",e.contentUrl]),BEACON.tagEvent({name:"openSite",params:{value:e.contentUrl,video:e.objectId,label:e.sectionReportingId||""}}),window.open(e.contentUrl);else if("in-place"==e.type)if(e.contentUrl){const t=$(".lxl-widget iframe")[0];t&&t.contentWindow.postMessage('{"command": "pause"}',t.src),this.onBeforeHeroVideoStart(e,null,null,s)}else e.contentTypeBadge()&&e.contentTypeBadge().doOffsite?e.contentTypeBadge().doOffsite():APP.goToPage("video",e);else e.playOnLoad=a&&(a.hasClass("play")||a.parent().hasClass("play")),e.playOnLoad&&APP.currentView.data()[0]&&void 0!==APP.currentView.data()[0].setSpotlightAutoRotate&&APP.currentView.data()[0].setSpotlightAutoRotate(!0),"festival"!=e.type&&e.subTypes&&-1!=e.subTypes.join(" ").toLowerCase().indexOf("recorded")?e.isPlaying()||APP.goToPage("video",e):i||!e.playOnLoad||!e.festivalId||"live"!=e.streamStatus&&"replay"!=e.streamStatus?APP.goToPage("item",e):APP.currentView.onEventWatchNow(e);else if(e._links?.external)CONSOLE.warn(["Sending user to external site",e._links.external.href]),BEACON.tagEvent({name:"openSite",params:{value:e._links.external.href,video:e.objectId,label:e.sectionReportingId||""}}),window.open(e._links.external.href);else if("channel"==e.type)APP.goToPage("hub",e);else if("storeItem"==e.type){if(!(!e.ticketId||e.userHasTicket&&e.userHasTicket()))return!1;e.storeUrl&&(e.storeUrl.match(/live(xlive|one)\.com/)?APP.onPurchaseTicketsClick(e):window.open(e.storeUrl))}else if(this._isCategoryDirectNav(e)||"category"!=e.type&&"host"!=e.type)if(this._isCategoryDirectNav(e)){const t={video:"videohome"};APP.goToPage(t[e.link]||e.link,e)}else if(e.nodeType&&"festival"!=e.nodeType||"station"==e.type||e.artistId){if("podcast"===e.type?delete e.sid:"audiobook"===e.type&&(e.id=e.audiobookId),e.sid&&"audiobook"!==e.type&&"podcast"!==e.type&&e.sid.indexOf("undefined")>-1)return;e.artistId&&!e.nodeType&&(e.nodeType="artist",e.id=e.artistId),APP.queuedLoadTitle(e.name||e.title),APP._setNavigating(!0),APP.requireSlackerServicesPromise().then((()=>{APP.queuedLoadTitle(null),"station"==e.nodeType||"foreign"==e.nodeType?APP.goToPage("slackeritemdetail",{type:"station",title:e.navTitle||e.name||e.title,seoName:e.link,id:e.sid,leadoffdata:e.leadoffdata}):APP.goToPage("slackeritemdetail",{type:e.nodeType,_links:e.links,title:e.navTitle||e.name||e.title,seoName:e.link,id:e.id,leadoffdata:e.leadoffdata})}))}else(e.nodeType||e.type)&&(e.playOnLoad=!1,APP.goToPage("item",e));else APP.goToPage("radiocategories",e)},onUserEvent:function(e,t){CONSOLE.debug(["SiteModule.onUserEvent",e]);const i=$("body");switch(e){case APP.USER.EVENT.USERERROR:appInitTime?(CONSOLE.debug(["SiteModule.onUserEvent","Retoken user as anon."]),APP.USER.init()):APP.USER.doSlackerLogin();break;case APP.USER.EVENT.USERLOGIN:APP.SERVICE.isForceUpgradeRequired||(APP.SERVICE.getGlobalNav(),APP.isAppLoaded&&(APP.noHomeOnUserLogin||APP.goHome(),APP.noHomeOnUserLogin&&(APP.noHomeOnUserLogin=null)));break;case APP.USER.EVENT.USERREG:APP.goHome(),APP.USER.isActionPending(!1),APP.USER.isPendingRegistrationEvent(!1),APP.adMode(s.getAdMode(APP.USER.user())),i.addClass(APP.adModeClass());break;case APP.USER.EVENT.USERLOGOUT:APP.goHome()}},onActiveVew:function(e,i){const s=window.findCurrentViewInHistory(),a=APP.MESSAGING.getTopbarNag();let n=[e.historyData.title],o=e.historyData.seoName,r=!1,l=!1;if(APP.supportsSlacker&&!APP.noUpsell()&&a&&!APP.isPageWithoutUpsellNag(APP.currentView.seoName)?APP.topUpsellNag(a):APP.topUpsellNag([]),i&&!s[0]&&(i=!1),r=!1,l=e.seoName.match(/live-events\/([^\/]+)\/([^\/]+)/),i&&s[0]||APP.history.unshift(e),l&&(n.unshift("Stream"),n.push("Live")),"LiveOne"==e.title?n.push("- Music, Podcasts and more"):n.push("- LiveOne - Music, Podcasts and more"),APP_ENV&&"prd"!==APP_ENV&&n.unshift(APP_ENV+" -"),!i&&e){if(e.pagingData()&&e.pagingData().page&&e.pagingData().page.number>0&&("HubView"==e.type&&(o=o.replace("genre","hub")),o+="?page="+e.pagingData().page.number),e.historyData.viewType||(e.historyData.viewType=e.historyData.seoName),Q_STRING.hash){var c=[];for(var d in Q_STRING.hash)this.ALLOWED_PERSIST_QPARAM[d]&&c.push(`${d}=${Q_STRING.get(d)}`);c.length&&(-1==o.indexOf("?")&&(o+="?"),o+=c.join("&"))}let i={},s=`/${o}`;if(["guid","link","params","seoName","title","viewType"].filter((t=>
1e.historyData[t])).forEach((t=>{"params"==t?(i[t]={},Object.keys(e.historyData[t]).filter((i=>"function"!=typeof e.historyData[t][i])).forEach((s=>i[t][s]=e.historyData[t][s]))):i[t]=e.historyData[t]})),"tesla"===APP.currentView.seoName){const e=["username","password","variant","upgraded","nonCred","prevUpgrade","prevLink","finalPrice","initFailed"],i=new t.getRawParams,a=e.filter((e=>i[e])).map((e=>`${e}=${i[e]}`)).join("&");s+=a.length?"?"+a:""}const a="string"==typeof s?s.indexOf("?"):-1,r=a>=0?s.substring(0,a):s,l=a>=0?s.substring(a+1):"",u=(location.search||"").replace(/^\?/,"");!("string"==typeof s&&r&&0==location.pathname.indexOf(r)&&l===u)||window.history.state&&window.history.state.link!==i.link?(window.history.pushState?.(i,n.join(" "),s),document.title=n.join(" ")):(document.title=n.join(" "),window.history.replaceState?.(i,n.join(" "),s))}i&&e&&(document.title=n.join(" ")),"login"==e.seoName?$("body").addClass("login"):$("body").removeClass("login"),APP.cleanMainNav(),e.headerImages&&e.headerImages.length>0&&(e.headerImages.interval=setInterval((function(){var t=e.headerImageIdx();e.active()?t<e.headerImages.length?e.headerImageIdx(++t):e.headerImageIdx(0):(clearInterval(e.headerImages.interval),e.headerImages.interval=0)}),1e4))},onFailedView:function(e){0==APP.history.length?APP.goHome():e&&e.active()&&history.go(-1)},onDisposeView:function(e){},onBeforeHeroVideoStart:function(e,t,s,a){CONSOLE.debug(["SiteModule::onBeforeHeroVideoStart"]);const o=$("body"),r=APP.currentView,l=o.hasClass("hero-player-floating"),c=r.domContainerId,d=e.contentTypeBadge&&e.contentTypeBadge()&&"vote"==e.contentTypeBadge().type;if(APP.checkPaywallVideo(e,e.preview||s,(()=>{this.onBeforeHeroVideoStart(e,t,s,a)}))){if(!e.preview&&APP.currentView.detailPlayer&&(r.detailPlayer.stop(),r.detailPlayer=null),!s&&!e.preview&&APP?.slackerPlayerSession?.()?.currentPlayableItem?.())try{return void APP.slackerPlayerSession().currentPlayableItem().stop("Video",(()=>{this.onBeforeHeroVideoStart(e,t,s,a)}),!0)}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}if(!r.detailPlayer||e.preview||e.objectId!=r.detailPlayer.currentVideoObj.objectId){if(APP.heroEmbedData()){if(e.preview&&!l)return;APP.closeEmbedHeroPlayer()}if(this.adtlVideoAnnotations&&Object.keys(this.adtlVideoAnnotations).forEach((t=>{e[t]=this.adtlVideoAnnotations[t]})),s||e.preview?(e.defaultVolume=0,e.disablePreroll=!0,e.disableAds=!0,e.autoPlay=!0):i.isMobileDevice()?e.defaultVolume=e.autoplay?0:1:void 0===e.defaultVolume&&(e.defaultVolume=APP.SERVICE.isCached("v")||.5),APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.stop(),e.autoPlay||"youtube"==e.source||BEACON.tagEvent({name:"select_content",params:{content_type:"video",item_id:e.objectId,play_location:e.sectionReportingId}}),a||(a="in-place"==e.type?$(`${c} #tile-${e.uiItemId} .tile .overlay, ${c} #${e.objectId} .tile .overlay`)[0]:$(`${c} .hero .tile .overlay,${c} .tile-container .tile .overlay`)[0]))if(e.preview){if(e.isPaywallVideo()&&-1==e.isPaywallVideo().indexOf("registered"))return void CONSOLE.warn("SiteModule::onBeforeHeroVideoStart - Abort video preview action for paywalled content.");r.heroPreview=new n("preview"),r.heroPreview.localListener=function(e){switch(e.type){case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.STARTED:$(a).parent().addClass("detail-video-player").addClass("detail-preview-player"),$(a).parent().parent().addClass("detail-video-player");break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.COMPLETED:case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR:$(a).parent().removeClass("detail-video-player").removeClass("detail-preview-player"),$(a).parent().parent().removeClass("detail-video-player"),this.eventMapper.detachEvent(this.videoplayer.EVENT.PLAYBACK.COMPLETED,this.localListener),this.eventMapper.detachEvent(this.videoplayer.EVENT.PLAYBACK.STARTED,this.localListener),this.eventMapper.detachEvent(this.videoplayer.EVENT.PLAYBACK.ERROR,this.localListener),APP.currentView.heroPreview=null}},r.heroPreview.eventMapper.attachEvent(r.heroPreview.videoplayer.EVENT.PLAYBACK.COMPLETED,r.heroPreview.localListener),r.heroPreview.eventMapper.attachEvent(r.heroPreview.videoplayer.EVENT.PLAYBACK.STARTED,r.heroPreview.localListener),r.heroPreview.eventMapper.attachEvent(r.heroPreview.videoplayer.EVENT.PLAYBACK.ERROR,r.heroPreview.localListener),r.heroPreview.playStream(a,e,d)}else APP.appImplementationModule.detailstreamaction.playStream(a,e,d);else CONSOLE.warn(["SiteModule::onBeforeHeroVideoStart - ","Request to play video with
1no valid container",e.type,e.objectId])}else this.detailstreamaction.videoplayer.currentPlayerObj&&(CONSOLE.warn(["Requested video is already playing."]),this.detailstreamaction.videoplayer.restart())}},_onRadioEventListener:function(e){const t=APP.slackerPlayerSession();if(e.type===t.EVENT.STATIONSTOPPED)e.playable&&BEACON.tagEvent({name:"radio",params:{value:"stop",label:e.reason||"ChangeStation"}}),e.chainedAction?.()},_onVideoPlayEvent:function(e){CONSOLE.debug("SiteModule._onVideoPlayEvent::"+e.type+"::"+e.player);var t=e.video&&e.video.dazzlePreview;switch(e.type){case APP.herostreamaction.videoplayer.EVENT.VIDEOCONTAINERREADY:t||$(".tile .video-js").parent().parent().addClass("detail-video-player"),APP.currentView&&!APP.currentView.detailPlayer&&(APP.currentView.detailPlayer=this.detailstreamaction.videoplayer);break;case APP.herostreamaction.videoplayer.EVENT.ONFULLSCREENCHANGE:break;case APP.herostreamaction.videoplayer.EVENT.ONFULLSCREENTOGGLE:APP.onVideoFullScreenRequest(e.player);break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.DURATIONCHANGE:APP.currentView&&!APP.currentView.detailPlayer&&(APP.currentView.detailPlayer=this.detailstreamaction.videoplayer);break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.STARTED:if(APP.currentView&&!t&&(BEACON.tagEvent({name:"video",params:{value:"start",label:e.video.objectId}}),"mediaSession"in navigator&&e.video)){let t={title:e.video.title||"",artist:e.video.subtitle||"",album:"",artwork:[]};e.video.posterImgUrl&&(t.artwork=[{src:e.video.posterImgUrl,sizes:"384x384",type:"image/jpg"}]),navigator.mediaSession.metadata=new MediaMetadata(t)}t&&$(`#${APP.currentView.detailPlayer.currentContainer}`).parent().addClass("dazzle").addClass("detail-video-player"),"function"==typeof e.player.muted&&e.player.muted()&&($(".vjs-volume-panel").removeClass("vjs-hidden"),$(".vjs-volume-panel button").removeClass("vjs-hidden")),APP.currentView&&(APP.currentView.detailPlayer||(APP.currentView.detailPlayer=this.detailstreamaction.videoplayer));break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.COMPLETED:APP.currentView&&!e.video.preview&&(APP.currentView.detailPlayer=null,e.isError||t||BEACON.tagEvent({name:"video",params:{value:"complete",label:e.video.objectId}})),APP.currentView&&APP.currentView.autoJoinChatOnLoad;break;case APP.herostreamaction.videoplayer.EVENT.DISPLAYERROR:!e.error&&e.player&&(e.error=e.player.error_),e.error||(e.error={message:"Unknown player error"}),APP.MESSAGING.prompt("ticklerErrorFree",{reason:e.error.message}),BEACON.tagEvent({name:"video",params:{value:"error",label:e.video.objectId}});break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR:$("body").removeClass("hero-video").removeClass("hero-player-floating");break;case APP.herostreamaction.videoplayer.EVENT.VIDEOADSTARTED:$(".hero.detail-video-player").addClass("with-ad");break;case APP.herostreamaction.videoplayer.EVENT.VIDEOADENDED:case APP.herostreamaction.videoplayer.EVENT.NOVIDEOAD:$(".hero.detail-video-player").removeClass("with-ad")}},_isCategoryDirectNav:function(e){return"category"===e.type&&e.subTypes?.includes("nav")},onServiceNavLinkData:function(e,i,s){const n=APP.USER.slackerUser().hooplaUser;let o=new Array,r=new Array;const l=function(e,t,i){let s=[],n=[],o=0,c=!1;return e.content.filter((e=>"nagbar"!=e.type)).forEach(((e,d,u)=>{CONSOLE.debug("SiteModule.onServiceNavLinkData::adding menu item - "+e.seoName),i&&(e.subTypes&&(e.subTypes.includes("header")||e.subTypes.includes("separator")&&"Series"==e.title)?d>0?(o=0,c=e.subTypes.includes("header"),s.push(n.splice(0)),n=[]):c=!0:(c&&o>=13||!c&&o>=12)&&(o=0,c=!1,s.push(n.splice(0)),n=[])),"music"==e.seoName&&(APP.basicRadioOnly(!1),e._links={nav:{href:"APP.SERVICE.urls.SLACKER.API.MUSICHOME"}}),"audiobooks"===e.seoName&&(e.seoName="genre/audiobooks",e.actionOverride=!0,e.link="audiobooks"),["channels","hubs"].includes(e.seoName)&&(e.seoName="video",e.actionOverride=!0,e._links={nav:{href:"APP.SERVICE.urls.SLACKER.API.VIDEOHOME"}}),e.seoName&&["channels","hubs","video"].includes(i)&&(e.seoName=e.seoName.replace(/genre|channel/,"hub"),e._links.genre&&e._links.nav&&(e._links.nav.href=e._links.nav.href.replace("/genres/","/channels/"))),"podcasts"==e.seoName&&(e.actionOverride=!0,e._links={nav:{href:"APP.SERVICE.urls.SLACKER.API.PODCASTS"}});let h=new a(e,e._links?(e,t)=>{if("genre/audiobooks"===e.link.seoName)APP.goToPage("genre/audiobooks");else{let i={...e.link};t&&(i={...e.link,...t}),APP.goToPageBySeoData(e.link.seoName,i)}}:null,"main-nav-dup");i&&(h.seoParent=i),e.actionOverride||(APP.views[e.seoName]=h),e._links&&e._links.nav&&!APP.SERVICE.urls.DATA[e.seoName]&&(APP.SERVICE.urls.DATA[e.seoName]=e._links.nav.href),void 0!==t&&(r.splice(t,0,h),t++),e._embedded&&h.subnav(l(e._embedded,void 0,e.seoName)),"home"===e.seoName&&(APP.SERVICE.urls.API.HOME=e._links.nav.href),n.push(h),o++})),i?(s.push(n.splice(0)),s):n};if("error"===i)APP.MESSAGING.prompt("ticklerErrorFree",{reason:"NAV links discovery failed."});
1else{APP.MESSAGING.topNagBarMessages=[];let i=0;e._embedded&&e._embedded.content&&(e._embedded.content.filter((e=>"nagbar"==e.type)).forEach((e=>{for(let t in e){const i=Object.assign({},e[t]);CONSOLE.info(["Have nagbar object in nav",t,i.url]),i.url&&APP.MESSAGING.topNagBarMessages.push({msg:i.text,className:t,action:function(){BEACON.tagEvent({name:"upsellBar",params:{value:"click",label:t}}),this.url.indexOf("slacker://")>-1?APP.handleSlackerProtocolLink(this.url,`upsellBar-${t}`):window.open(this.url)}.bind(i)})}APP.currentView&&!APP.noUpsell()&&APP.supportsSlacker&&e&&!APP.isPageWithoutUpsellNag(APP.currentView.seoName)&&APP.topUpsellNag(APP.MESSAGING.getTopbarNag()||[])})),o=l(e._embedded,i),i=o.length);const s={title:"My Library",type:"mylibrary",seoName:"mylibrary"},d=new a(s,(()=>APP.goToPage("mylibrary",s)),"main-nav-dup");o.push(d),r.splice(i,0,d),i++;const u=(e,t=0)=>{const i=document.getElementById(e);if(i){const e=i.getBoundingClientRect().top+window.scrollY;window.scrollTo({top:e-t,behavior:"smooth"})}else window.location=(""+window.location).replace(/#[A-Za-z0-9_-]*$/,"")+"#"+e},h={tesla:{seoName:"tesla",items:[{title:"Support",type:"support",anchor:"questions"},{title:"Download",type:"download",anchor:"devices"},{title:"Link Accounts",type:"link-accounts",anchor:"link-accounts"}]},costcopilot:{seoName:"partners/costco",items:[{title:"Testimonials",type:"testimonials",anchor:"testimonials",offset:150},{title:"Support",type:"support",anchor:"questions",offset:150},{title:"JOIN THE PILOT",type:"join-pilot",anchor:"join-pilot",offset:220}]},costcoupgrade:{seoName:"partners/costcoupgrade",items:[{title:"Support",type:"support",anchor:"questions",offset:150},{title:"Download",type:"download",anchor:"testimonials-download",offset:150}].filter((e=>!e.hide))}}[(()=>{const e=window.location.pathname;return e.includes("/partners/costcoupgrade")?"costcoupgrade":e.includes("/partners/costco")?"costcopilot":e.includes("/tesla")?"tesla":""})()],p=h?.items.map((e=>({seoName:h.seoName,menuAction:new a({title:e.title,type:e.type,seoName:"/"+h.seoName},e.anchor?()=>u(e.anchor,e.offset||0):e.onClick,"partner-nav-item")})));p?.forEach((e=>{o.push(e.menuAction),r.splice(i,0,e.menuAction),i++})),r.splice(i,0,new a({title:"Investors",type:"investors",seoName:"https://ir.livexlive.com/corporate-profile/default.aspx"},(()=>window.open("https://ir.livexlive.com/corporate-profile/default.aspx")))),i++;var c={title:"More",type:"more",seoName:"more",subnav:[new a({title:"About",type:"about",seoName:"about",_links:{nav:{href:t.SERVICE.DATA.MORE.ABOUT}}},(()=>APP.goToPage("about"))),new a({title:"Contact",type:"contact",seoName:"contact",_links:{nav:{href:t.SERVICE.DATA.MORE.CONTACT}}},(()=>APP.goToPage("contact"))),new a({title:"Careers",type:"careers",seoName:"careers",_links:{nav:{href:t.SERVICE.DATA.CAREERS}}},(()=>APP.goToPage("careers"))),new a({title:"Accessibility",type:"accessibility",seoName:"accessibility",_links:{nav:{href:t.SERVICE.DATA.MORE.ACCESSIBILITY}}},(()=>APP.goToPage("accessibility"))),new a({title:"Press Releases",type:"press",seoName:"https://ir.livexlive.com/news/all/default.aspx"},(()=>window.open("https://ir.livexlive.com/news/all/default.aspx")))]};if(r.splice(i,0,new a(c,null)),i++,n||r.push(new a({title:"Submit Feedback",type:"feedback",seoName:"submit-feedback"},(()=>APP.MESSAGING.prompt("user-feedback",null,null,{})))),APP.USER.slackerUser().actualTier<10){const e=" "+(5===Number(APP.USER.slackerUser().actualTier)?"plus-user":"free-user");r.push(new a({title:"UPGRADE",type:`button std upgrade${e}`,seoName:"upgrade"},(()=>APP.goToPage("upgrade"))))}r.push(new a({title:" the mobile app",type:"mobile-download-menu-item"+(10==APP.USER.slackerUser().actualTier?" premium-user":""),seoName:"apps",_links:{nav:{href:t.SERVICE.DATA.MORE.APPS}},hasCustomIcon:!0},(()=>APP.goToPage("apps")))),APP.mainNav(o),APP.burgerNav(r),setTimeout((()=>$(".server-generated").remove()),500),APP.canUseRadio&&(APP.supportsSlacker=!0,APP.basicRadioOnly(!1))}},onSlackerServiceAPI:function(e){const t=APP.SERVICE.isCached("slackerUser");e&&(APP.USER.slackerUser()&&APP.USER.slackerUser().id?APP.USER.slackerUser().token||APP.USER.getSlackerToken():t?APP.USER.onSlackerLoginUpdate(null,"autologin",JSON.parse(t)):APP.supportsSlacker&&(APP.noHomeOnUserLogin=!0,APP.USER.doSlackerAnon()))}},registerPackage("com.slacker.app.modules.implementation.SiteModule"),o.prototype.__constants(),com.slacker.app.modules.implementation.SiteModule=o}()})),bjork("com.slacker.app.modules.implementation.TenFootModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.app.modules.PubnubModule"),i=require("com.slacker.app.modules.UrlModule"),s=require("com.slacker.app.actions.MenuAction"),a=require("com.slacker.app.view.VideoView"),n=require("com.slacker.app.view.ItemView"),o=window.speechSynthesis?window.speechSynthesis:null;function r(e){this.__constants(),this.__properties(e),this.__constructor()}r.prototype={__constants:function(){this.EVENTS},__properties:function(e="tenfoot"){const t=this;this.type=e,this.isFullScreen=!1,this.headerNavDelay=null,this.supportsPlaybackSpeedOption=!1,this.usesSimpleSettings=!0,this.networkStatus=!0,this.detailstreamaction=null,this.adtlVideoAnnotations={defaultFullScreen:!0},this.exitAppOnBack=!1,this.eggsequence=[],this.isVoiceGuideEnabled=0,this.isCCEnabled=0,this.captionFontsOverride="https://fonts.googleapis.com/css?family=__CAPTION_FONT_FAMILIES__&display=swap",this.isRadioPlaying=ko.observable(!1),this.sideTabsSupported=ko.observableArray(),this.shopData=ko.observable(null),this.festivalSchedule=ko.observable(null),this.socialMessaging=ko.observable(null),this.isFestivalSocialAvailable=ko.observable(!1),this.tabCounterStyle=ko.pureComputed((function(){return"size-"+t.sideTabsSupported().length})).extend({throtle:500})},__constructor:function(){APP.supportsNewProfile(!1),APP.EVENTS.attachEvent(APP.EVENT.VIEWACTIVE,this.onActiveVew.bind(this)),APP.EVENTS.attachEvent(APP.EVENT.VIEWDISPOSE,this.onDisposeView.bind(this)),APP.EVENTS.attachEvent(APP.EVENT.SPOTLIGHTROTATE,this._onSpotlightItemRotate.bind(this));const e=this._onVideoPlayEvent.bind(this),t=APP.herostreamaction.videoplayer;["VIDEOCONTAINERREADY","DISPLAYERROR","NOCONTENT"].forEach((i=>t.attachEvent(t.EVENT[i],e))),["COMPLETED","STARTED","ERROR"].forEach((i=>t.attachEvent(t.EVENT.PLAYBACK[i],e)));const i=this.onUserEvent.bind(this);["USERLOGIN","USERLOGOUT","USERREG","USERERROR"].forEach((e=>APP.EVENTS.attachEvent(APP.USER.EVENT[e],i))),APP.onVideoFullScreenRequest=this.onVideoFullScreenRequest.bind(this),APP.onForceUpdate=this.onForceUpdate.bind(APP),APP.doEmailContact=e=>null,APP._onTileFocus=this._onTileFocus,APP._onTileBlur=this._onTileBlur,APP._onItemDetailActionFocus=this._onItemDetailActionFocus,APP._onSpotlightNavDotFocus=this._onSpotlightNavDotFocus.bind(APP),APP._onHeaderNavFocus=this._onHeaderNavFocus.bind(APP),APP._onTabFocus=this._onTabFocus.bind(APP),APP._onHeroRelatedFocus=this._onHeroRelatedFocus.bind(APP),APP.startHeroVideo=APP.changeStage=this.changeStage.bind(this),APP.viewsByDomName.HomeView=require(APP.viewsByDomName.HomeView)},init:function(){CONSOLE.warn("Initializing Ten Foot Module"),loadCssDynamically("css/tenfoot.css","tv-style"),$("body").addClass("tenfoot"),location.href.match(/live(xlive|one)\.com/)&&(APP.frameworkInclude="/includes/site-framework.jsp"),this.EVENTS=new e;try{ko.applyBindings(APP,$(".header-nav-bar")[0])}catch(e){}try{ko.applyBindings(APP,$("#hero-player")[0])}catch(e){}try{ko.applyBindings(APP,$(".page-loading")[0])}catch(e){}try{ko.applyBindings(APP,$("footer")[0])}catch(e){}return window.history.pushState("exit-catch",null,null),new APP.viewsByDomName.HomeView},closeApp:function(){let e=APP.slackerPlayerSession();BEACON.tagEvent({name:"appShutdown",params:{}}),APP._doTTS(null,!1,!0);try{e.currentPlayableItem().stop("Shutdown",null,!0)}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}window.open("","_self").close()},_doDeeplinkAction:function(e){e&&(CONSOLE.info(["TenFootModule::Firing deeplink action",e.objectId,e.seoName]),e.contentUrl?setTimeout((()=>this.onTileClick(e,null)),1e3):(APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.stop(),this.onTileClick(e,null,!0)))}
1,onUserEvent:function(e,t){CONSOLE.debug(["TenFootModule.onUserEvent",e]);const i=$("li.tv-activate");switch(e){case APP.USER.EVENT.USERERROR:APP.MESSAGING.prompt("modalErrorFree",{reason:"An unexpected error occurred. Please restart the application.",disableClose:!0}),appInitTime||APP.EVENTS.notify(APP.EVENT.APPLOADED,[null,!0]);break;case APP.USER.EVENT.USERLOGIN:t().isAnon?i.show():i.hide(),APP.SERVICE.isForceUpgradeRequired||(APP.SERVICE.getGlobalNav(),APP.isAppLoaded&&(APP.noHomeOnUserLogin?APP.noHomeOnUserLogin=null:APP.goHome()));break;case APP.USER.EVENT.USERREG:APP.goHome(),APP.USER.isActionPending(!1),APP.USER.isPendingRegistrationEvent(!1);break;case APP.USER.EVENT.USERLOGOUT:i.show(),APP.appImplementationModule._handleRemoteBackButton(!0),APP.goHome()}},onActiveVew:function(e,t){const i=APP.currentView.data(),s=$("li.tv-activate");let a;if(CONSOLE.debug(["TenFootModule.onActiveVew",e,t]),APP.USER.user().isAnon?s.show():s.hide(),e){APP._setNavigating(!1),e.active(!0);try{void 0!==i?.[0].setSpotlightAutoRotate&&i[0].setSpotlightAutoRotate(!0)}catch(e){}$(".header-nav-bar ul.main-nav li.mylibrary").removeClass("active"),e.hideTvGlobalNav?(window.history.pushState("exit-catch",null,null),"tesladash"===APP.appImplementationModule.type&&$(".header-nav-back").show(),$(".header-nav-bar").hide(),setTimeout((i=>{if(a=t&&e.lastFocusedItem?$(`#${e.lastFocusedItem}`)[0]:[].concat($("section.hero .metadata .button.play.std:visible").toArray()).concat($("#item-detail-section-top").toArray())[0],a){if(e.lastFocusedItem=a.id,a.className?.indexOf("button play")>-1||a.id.indexOf("detail-editactions")>-1){let t=$(`#${$(`#${e.data()[0].id} .tile`).attr("aria-labelledby")}`);APP.checkAcessibilityTTSAction(t.attr("aria-label"),null,!1,{forceFinish:!0})}else"SlackerItemDetailView"==e.type&&($(e.domContainerId).addClass("browsing"),a.scrollIntoView({block:"center"}));a.focus(),e._doLazyImageLoading(!0)}else window.scrollTo(0,0)}),500)):t||($(".header-nav-bar").show(),$(".header-nav-back").hide(),setTimeout((()=>{const e=APP.MESSAGING.modal();let t=$(".header-nav-bar li.active a");t.length&&$("*:focus").length||(t=$(".header-nav-bar li.nav.home a")),e&&(e.title||e.msg)||(t.focus(),i[0]?.spotlightItem&&i[0].spotlightItem().item&&APP.checkAcessibilityTTSAction("Featured item",i[0].spotlightItem().item,!0))}),200))}},_doTTSactionWithTimecode:function(e,t){const i=Math.floor(t/3600),s=Math.floor((t-3600*i)/60),a=Math.floor(t-3600*i-60*s);let n=[e];i>0&&n.push(`${i} hours`),s>0&&n.push(`${s} minutes`),a>0&&n.push(`${a} seconds`),APP.checkAcessibilityTTSAction(n.join(", "))},checkAcessibilityTTSAction:function(e,t,i,s){let a=[],n=["title","ariaTitle","subtitle","description"],o=APP.MESSAGING.modal(),r=s&&s.forceFinish;if(s&&r&&(s=null),o&&"BUTTON"==s?.target?.nodeName&&"BUTTON"!==s?.relatedTarget?.nodeName&&(i=!0),this.isVoiceGuideEnabled){if(o&&(o.title||o.msg)&&!s)return;if(t){if(e&&a.push(e),"scheduleDate"==t.type&&a.push(`Date, ${t.day}, ${t.date}`),"scheduledEvent"==t.type&&a.push(`${t.time?t.time+", ":""}${t.name}`),t.ariaLabel)a.push(t.ariaLabel);else if("song"==t.type&&t.artistName)a.push(`${t.title} by ${t.artistName}`);else{if("podcastEpisode"==t.type){let e=new Date(t.publishDate).toDateString().split(" ").slice(1).join(" ");a.push(e),a.push(formatPTtime(t.duration))}n.forEach((e=>{t[e]&&("ariaTitle"!=e||"ariaTitle"==e&&!t.title)&&a.push(t[e])}))}e=a.join(", ")}e?(e=e.replace(/[\r\n]+/g,"").trim(),CONSOLE.debug(["TenFootModule::checkAcessibilityTTSAction - speaking",e]),APP._doTTS(e,i,!1,r)):i||APP._doTTS(null,!1,!0)}},onDisposeView:function(e){},onServiceNavLinkData:function(e,t,a){let n=new Array,o=new Array;"error"===t?APP.MESSAGING.prompt("ticklerErrorFree",{reason:"NAV links discovery failed."}):(e.content&&(e.content.forEach((e=>{e._links=APP.halifyLinks(e.links),e.links=null})),e._embedded={content:e.content.slice(0)},e.content=null),e._embedded&&e._embedded.content&&(n=e._embedded.content.map((function(e,t,i){e.subTypes&&"home"===e.subTypes[0]&&(e._links.nav.href=e._links.nav.href.replace("slacker","liveone").replace("www","slacker"),APP.SERVICE.urls.API.HOME=e._links.nav.href),e.actionType="button","mylibrary"===e.seoName&&(e.seoName="mylibrary",e.type="mylibrary",e.hideTvGlobalNav=!0),e._links||(e._links={nav:{href:e.seoName}}
1),["video","channels","hubs","mylibrary","podcasts"].includes(e.seoName)&&(e.actionOverride=!0);const a=new s(e,(function(t,i){let s={...t.link};i&&(s={...t.link,...i}),e.subTypes&&"home"===e.subTypes[0]&&(e.seoName="home"),APP.goToPageBySeoData(e.seoName,s)}));return e.actionOverride||(APP.views[e.seoName]=a),e._links&&e._links.nav&&!APP.SERVICE.urls.DATA[e.seoName]&&(APP.SERVICE.urls.DATA[e.seoName]=e._links.nav.href),"home"===e.seoName&&(APP.SERVICE.urls.API.HOME=e._links.nav.href),a})),"generictv"==this.type&&n.push(new s({title:"My Library",type:"mylibrary",hideTvGlobalNav:!0,actionType:"button",seoName:"mylibrary",_links:{}},(function(){APP.goToPage("mylibrary")}))),n.push(new s({title:"Player",type:"tv-radio-mini",ariaLabel:"Player",hideTvGlobalNav:!0,actionType:"button",seoName:"",_links:{nav:{href:i.SERVICE.DATA.MORE.ACTIVATE}}},function(){APP.slackerPlayerSession().setPlayerSize(radioPlayerSession.PLAYER_FULL),setTimeout((()=>this._handleRemoteBackButton(!1,!0)),100)}.bind(this))),n.push(new s({title:"Search",type:"search",hideTvGlobalNav:!0,actionType:"button",seoName:"search",_links:{}},(function(){APP.goToPage("search")}))),APP.USER.user().isAnon&&(n=n.filter((e=>"mylibrary"!=e.link.seoName)),n.push(new s({title:"Sign In",type:"tv-activate",actionType:"button",hideTvGlobalNav:!0,seoName:"activate",_links:{nav:{href:i.SERVICE.DATA.MORE.ACTIVATE}}},(function(){APP.history.unshift(APP.currentView),APP.goToPage("activate")})))),i.SERVICE.API.SETTINGS&&n.push(new s({title:"Settings",type:"settings",ariaLabel:"Settings",actionType:"button",hideTvGlobalNav:!0,seoName:"settings",_links:{nav:{href:i.SERVICE.API.SETTINGS}}},(function(){APP.history.unshift(APP.currentView),APP.goToPage("settings")}))),APP.canUseRadio&&(APP.supportsSlacker=!0,APP.basicRadioOnly(!1))),APP.mainNav(n),APP.burgerNav(o),setTimeout((()=>$(".server-generated").remove()),500))},onSlackerServiceAPI:function(e){const t=APP.SERVICE.isCached("slackerUser");e&&(APP.USER.slackerUser()&&APP.USER.slackerUser().id?APP.USER.slackerUser().token||APP.USER.getSlackerToken():t?APP.USER.onSlackerLoginUpdate(null,"autologin",JSON.parse(t)):APP.USER.doSlackerAnon())},onVideoFullScreenRequest:function(e){const t=$("#hero-player"),i=$("body");let s;e&&(s=e.isFullscreen()),CONSOLE.debug(["TenFootModule:: onVideoFullScreenRequest","player.isFullscreen",e?s:"error"]),!e||t.hasClass("fullscreen")?(t.removeClass("fullscreen"),i.removeClass("noscroll").removeClass("fullscreen"),$(APP.currentView.domContainerId).show(),e&&(e.isFullscreen_=!1),!APP.currentView.lastFocusedItem||APP.MESSAGING.modal()||APP.herostreamaction.videoplayer&&APP.herostreamaction.videoplayer.isPlaying||setTimeout((function(){$(`#${APP.currentView.lastFocusedItem}`).focus(),APP.currentView.lastFocusedItem=null}),500)):(t.addClass("fullscreen"),e.isFullscreen_=!0,i.addClass("noscroll").addClass("fullscreen"),$(APP.currentView.domContainerId).hide()),this.isFullScreen=!!e&&e.isFullscreen_},onForceUpdate:function(){APP.MESSAGING.prompt("appForceUpdate")},onTileClick:function(e,t,i,s){CONSOLE.warn(["TenFootModule:: Handling tile click",e.contentUrl,e.mimeType]);let n="video"==e.nodeType||"video"==e.type?e.contentUrl:("festival"==e.nodeType||"festival"==e.type)&&(e.contentUrl&&t&&$(t.target).hasClass("button"));if(i||APP.EVENTS.dispatch({type:"tile-click",payload:{obj:e,event:t,bForceNav:i,containerObj:s}}),!e.isPaywallVideo?.()||!e.festivalId||t&&$(t.target).hasClass("button")||(n=!1,i=!0),!i&&n)this.onBeforeHeroVideoStart(e);else if(window.scrollTo(0,0),e.uiItemId&&(APP.currentView.lastFocusedItem=`tile-${e.uiItemId}`),e._links?.doSearchMore){const t=e.link.split("/")[1];APP.currentView.dataReset=APP.currentView.data(),APP.goToPage("fullsearch",{title:"Search Results",type:"full",query:APP.currentView.query(),queryType:t.substring(0,t.length-1)})}else if("category"==e.type)"stationCategory:2220"==e.objectId?APP.goToPage("podcasts"):APP.goToPage("radiocategories",e);else if("channel"==e.type)APP.goToPage("hub",e);else if("video"==e.nodeType){new a(e).init((e=>{if(e){let s=new APP.currentView._abstractDisplayableItem(e);this.onTileClick(s.data||s,t,i)}else APP.MESSAGING.prompt("modalErrorFree",{reason:"Content is unavailable at this time."})}),!0)}else e.nodeType&&"festival"!=e.nodeType?(APP.queuedLoadTitle(e.name||e.title),APP._setNavigating(!0),APP.requireSlackerServicesPromise().then((()=>
1{if(["host","category"].includes(e.type))APP.goToPage("radiocategories",e);else{if(["podcast","station","artist","album","playlist"].includes(e.nodeType))$("#SlackerItemDetailView").removeClass("browsing"),APP.queuedLoadTitle(null),"station"==e.nodeType||"foreign"==e.nodeType?APP.goToPage("slackeritemdetail",{type:"station",title:e.navTitle||e.name||e.title,seoName:e.link,id:e.sid,leadoffdata:e.leadoffdata}):APP.goToPage("slackeritemdetail",{type:e.nodeType,_links:e.links,title:e.navTitle||e.name||e.title,seoName:e.link,id:e.id,leadoffdata:e.leadoffdata});else if(APP.queuedLoadTitle(null),APP._setNavigating(!1),e.isPlaying()){let e=APP.slackerPlayerSession();e.setPlayerSize(e.PLAYER_FULL),"SlackerItemDetailView"==APP.currentView.type&&e.radioPlayerStateManager().playPause(),setTimeout((()=>this._handleRemoteBackButton(!1,!0)),100)}else{if("artist"==e.nodeType&&!e.basicradio)return void APP.MESSAGING.prompt("stationNotPlayable",null,null,null,{contentType:e.nodeType,missingRights:"basicradio",accountTier:parseInt(APP.USER.slackerUser().tier)});APP._doTTS(null,!1,!0),APP.checkAcessibilityTTSAction(`Playing ${e.nodeType}. ${e.title}`),APP.onPlaySlackerRadioItem(e,t)}}}))):APP.goToPage("item",e)},_onHeaderNavFocus:function(e,t){CONSOLE.debug(["Headernav menu item focused",e.href(),"isActive",e.isActive()]);var i=$(t.currentTarget||t.target);this.headerNavDelay&&(clearTimeout(this.headerNavDelay),this.headerNavDelay=0),e&&e.hideTvGlobalNav||(APP.currentView.lastFocusedItem=i[0]),e.link&&"button"==e.link.actionType||(!e.isActive()&&APP.canNavigate()&&APP.appImplementationModule.networkStatus?this.headerNavDelay=setTimeout((function(){i.click()}),500):APP.appImplementationModule.networkStatus||APP.NETWORKING.EVENTS.notify(APP.NETWORKING.EVENT.CONNECTION.GONE,[APP.NETWORKING.EVENT.CONNECTION.GONE,arguments])),window.scrollTo(0,0)},_onTabFocus:function(e,t){const i=$(t.currentTarget||t.target),s=$(window),a=i.offset().top-s.scrollTop()-80;if((a<0||a>i.height())&&($("html,body").animate({scrollTop:i.offset().top-window.innerHeight/3},200),APP.currentView._doLazyImageLoading(!0,`#${e.id}`)),e.classNames.indexOf("empty")>-1&&$(i).hasClass("active")){const t=$(`#${e.id} .description`)[0].innerText.split("\n");APP.checkAcessibilityTTSAction(t.join(" "),null,!0)}},_onSpotlightNavDotFocus:function(e,t){const i=$(t.currentTarget||t.target);i.hasClass("nav-dot")&&!i.hasClass("active")&&i.trigger("click"),t.target.className.indexOf("nav-dot")>-1?APP.currentView.lastFocusedItem=i.attr("id"):APP.currentView.lastFocusedItem=t.target.id,window.scrollTo(0,0)},_handleFocusCatchFocus:function(e){const t=APP.currentView.domContainerId,i=e.target||e.currentTarget,s=i.id,a=$(`${t} section.spotlight, ${t} section.hero`),n=a.length>0,o=a.find(".spotlight-nav .nav-dot:visible"),r=a.find(".spotlight-nav .nav-dot.active"),l=a.find(".tile-container:not(.left):not(.right) .button:visible"),c=e?.relatedTarget?.className;let d,u,h,p=$(".header-nav-bar ul.main-nav li.active a");switch(CONSOLE.debug(["_handleFocusCatchFocus",s]),s){case"tabs-top":if(d=$(".page:visible"),c.indexOf("tab-item")>-1){if("MylibraryView"==APP.currentView.type){const t=$("section.recentlyplayed .tile")[0];return t&&(_koOb=ko.dataFor(t)),"EMPTY"===_koOb.type?(e.target=t,e.keyCode=38,e.preventDefault||(e.preventDefault=()=>{}),this.lastKeyNavTstamp=-1,this._onKeyboardNavEvent(e)):t.focus()}return"HubView"==APP.currentView.type?$("section.spotlight:visible .tile")[0].focus():(e.target=$("#item-detail-actions-bottom")[0],this._handleFocusCatchFocus(e))}$(i).find("+ .section-tabs .tab-item")[0].focus(),"ItemView"!=APP.currentView.type||d.hasClass("browsing")||APP._onItemDetailActionFocus();break;case"sub-tabs-top":c.indexOf("sub-tab-item")>-1?$("#tabs-top:visible").find("+ .section-tabs .tab-item")[0].focus():$(i).find("+ .section-tabs .tab-item")[0].focus();break;case"modal-action-top":case"modal-action-bottom":$(".modal button.std:first-of-type").focus();break;case"top-nav-focus":c.indexOf("navlink")>-1?n?l.length>0?l[0].focus():o.length>0?r.focus():$(".section:not(.spotlight) .tile")[0].focus():"settings"==APP.currentView.link?p.focus():$(".section .tile")[0].focus():p.focus();break;case"item-detail-actions-bottom":d=$(".page:visible"),h=d.find(".detail-actions button.std:visible:not(.secondary), .edit-actions button.std:visible ,section.hero .button.play.radio");let s=["tile","tabs-top","tab-item"],a=d.find(".tabs-container .tab-item:visible"),m=d.find("section .tile");s.filter((e=>c.indexOf(e)>
1-1)).length?h.length?("SlackerItemDetailView"==d[0].id&&d.removeClass("browsing"),h[0].focus()):(e.key="up",e.target=$("#item-detail-section-top")[0],this._handleFocusCatchFocus(e)):(d.hasClass("browsing")||APP._onItemDetailActionFocus(),a.length?a[0].focus():m?.[0].focus());break;case"item-detail-section-top":d=$(".page:visible"),"down"===e.key&&(u=$(`${t} .tile:in-viewport:visible`)[0],h=d.find(".detail-actions button.std:visible:not(.secondary), .edit-actions button.std:visible, section.hero .metadata .button.play.radio")),"SlackerItemDetailView"==d[0].id?"down"==e.key?(e.target=$("#item-detail-actions-bottom")[0],this._handleFocusCatchFocus(e)):(window.scrollTo(0,0),d.removeClass("browsing"),"up"==e.key?this._handleGlobalNavRefocus():h?.[0].focus()):u||h?(APP._onItemDetailActionFocus(),h.length?h[0].focus():u.focus()):"focusin"!=e.type&&this._handleGlobalNavRefocus();break;case"spotlight-catch-top":if(["button","nav-dot","tile"].filter((e=>c.indexOf(e)>-1)).length)window.scrollTo(0,0),$(".header-nav-bar:visible")[0]?p[0]?p.focus():$(".header-nav-bar ul.main-nav li a")[0].focus():this._handleGlobalNavRefocus();else if($(".header-nav-bar:visible")[0]&&APP.currentView.hideTvGlobalNav&&$(".header-nav-bar").hide(),l.length>0)l[0].focus();else if(o.length>0)r.focus();else{let i=$(`${t} button.bookmark`)[0];i?i.focus():(e.target=$(`${t} #section-top.focus-catch`)[0],this._handleFocusCatchFocus(e))}break;case"spotlight-play-catch":c.indexOf("button")>-1?o.length>0?r.focus():$("#section-top.focus-catch").focus():l.length>0?l[0].focus():p.focus();break;case"section-top":const g=$(i).parent().hasClass("followSpotlight");c.indexOf("tile")>-1?g&&(o.length>0?r.focus():l.length>0?l[0].focus():p.focus()):(d=$(".page:visible"),setTimeout((()=>{const t=$(i).parent("section"),s=t.parent().parent().prev().find(".tab-item")[0],a=t.find(".tile, .section-list:not(.header) .section-list-item .column.button")[0];let n;s?(d.addClass("browsing"),s.focus()):a&&(n=ko.dataFor(a),"EMPTY"===n.type?(e.target=a,e.keyCode=40,e.preventDefault||(e.preventDefault=()=>{}),this.lastKeyNavTstamp=-1,this._onKeyboardNavEvent(e)):a.focus())}),100));break;case"paging-top":if(c.indexOf("button")>-1&&-1==c.indexOf("column")){const t=ko.contextFor(e.relatedTarget).section;let s,a;return void(t.content().length?(t.content.listType?(s=$(`#${t.id}`).find(".column.button.play"),a=s.length-1):(s=$(`#${t.id}`).find(".tile"),a=s.length%4==0?s.length-4:s.length-s.length%4),s[a].focus()):(e.target=i,this._onKeyboardNavEvent(e)))}case"paging-bottom":APP.currentView.lastFocusedItem=null;const P=$(`${t} section.pagination button:not(.disabled):not(.jumpto)`);P[0]?(APP._doTTS(null,!1,!0),P[0].focus()):(e.relatedTarget.focus(),APP.checkAcessibilityTTSAction("END",null,!1));break;case"hero-related":APP?.herostreamaction?.currentVideo()&&APP.herostreamaction.isVideoPlayerActive()&&setTimeout((e=>APP._onHeroRelatedFocus()),100)}},_onSpotlightItemRotate:function(e){$(APP.currentView.domContainerId+" section.spotlight .spotlight-nav .nav-dot:focus").length&&(CONSOLE.debug("TenFootModule._onSpotlightRotate:: Setting focus for current item "+e.index),$(APP.currentView.domContainerId+" section.spotlight .spotlight-nav .nav-dot:nth-of-type("+(e.index+1)+")").focus())},_onItemDetailActionFocus:function(e,t,i){"tesladash"!=APP.appImplementationModule.type&&($(".header-nav-bar").hide(),t&&t.target&&-1!=t.target.id.indexOf("detail-editactions")||$(".page:visible").addClass("browsing"),APP.currentView._doLazyImageLoading(!0))},_onTileFocus:function(e,t){APP?.herorelated?.();const i=$(t.currentTarget||t.target),s=i.parent(),a=s.find(".title"),n=s.find(".subtitle"),o=s.find(".description"),r=$(window);let l=i.parent().parent().parent(),c=l[0]?.scrollWidth||0,d=0,u=0,h=i.offset().top-r.scrollTop()-80;if("tesladash"!==APP.appImplementationModule.type)if(CONSOLE.debug(["TenFootModule::_onTileFocus",e.type,i[0].id]),s.hasClass("section-list-item")&&$(".section-list-item.with-focus").removeClass("with-focus"),i.hasClass("scheduleItem"),s.addClass("with-focus").removeClass("scrolled"),i.hasClass("scheduleItem")&&s.parent().parent().addClass("with-section-focus"),s?.attr?.("data-spotlightItem"))d=s.attr("data-spotlightItem"),isNaN(d)||this.setCurrentSpotlightItem(d,!0);else{if(CONSOLE.debug(["_onTilePlayButtonFocus::testing height","offset",h,i.height()]),(h<0||h>i.height())&&$("html,body").animate({scrollTop:i.offset().top-window.innerHeight/3},200,(()=>APP.currentView._doLazyImageLoading(!0))),u=l.hasClass("hero-related")?l[0].offsetWidth-.1*l[0].offsetWidth:l[0].offsetWidth,APP.currentView.lastFocusedItem=i.attr("id"),u<c){const e=i.offset().left,t=l.scrollLeft();let a=l.offset()?l.offset().left:0,n=i.offset().left,o=0;
1if(CONSOLE.debug(["TenFootModule::_onTileFocus - tile idx",s.index(),"Left:",e,"New Left",n-a]),l.hasClass("hero-related")){let e=Math.max(0,s.index()/2);l=l.find(".tile-group"),a=s.width()+17.2656,o=a*e,c=l[0].scrollWidth,l.scrollLeft(o)}else o=t+(n-a),l.scrollLeft(o);setTimeout((e=>{c-l.scrollLeft()!=u&&s.addClass("scrolled")}),10)}[a,n,o].forEach((e=>{e[0]?.offsetWidth<e[0]?.scrollWidth&&e.addClass("marquee")}))}"scheduledEvent"==e.type?APP.appImplementationModule._handleAccessibleUiItemFocus.bind(i[0])():APP.heroRelatedFocusTimer&&this._onHeroRelatedFocus(e,t)},_onTileBlur:function(e,t){$(t.currentTarget||t.target).parent().removeClass("with-focus").removeClass("with-section-focus")},_onHeroRelatedFocus:function(e,t,i,s){CONSOLE.debug(["TenFootModule::_onHeroRelatedFocus",e,t,"bForceOff",i]);const a=APP.herorelated(),n=APP.herostreamaction.videoplayer.player,r=$("*:focus,*.with-focus");APP.heroRelatedFocusTimer&&(clearTimeout(APP.heroRelatedFocusTimer),APP.heroRelatedFocusTimer=0),"boolean"==typeof i&&i?($(".with-focus").removeClass("with-focus"),$(".related-content .scroll-container").removeClass("active"),$(".vjs-default-skin").removeClass("lxl-user-active").addClass("vjs-user-inactive"),$("#hero-player.fullscreen .masthead.hero h2").hide(),$("#hero-related-focus-target").focus()):($(".vjs-default-skin").removeClass("vjs-user-inactive").addClass("lxl-user-active"),$("#hero-player.fullscreen .masthead.hero h2").show(),s||(a.length?r.hasClass("tile-container")||n.paused()||(a.title&&APP.checkAcessibilityTTSAction(a.title,null,!0,{forceFinish:!0}),$(".tile-container.offline").removeClass("offline"),$(".related-content .scroll-container").addClass("active"),$(".scroll-container.hero-related .tile")[0].focus()):r.hasClass("vjs-button")||$(".vjs-control-bar button:visible")[0].focus()),(s||e||!a.length)&&(this.heroRelatedFocusTimer=setTimeout((()=>{if(!n)return;if(o?.speaking||n.paused())return APP._onHeroRelatedFocus(null,null,!1,!0);const e=APP.MESSAGING.isVideoJsOptionsOpen||APP?.MESSAGING?.modal?.()?.msg;$("*:focus,*.with-focus");this.heroRelatedFocusTimer=null,$(".with-focus").removeClass("with-focus"),$(".related-content .scroll-container").removeClass("active"),$(".vjs-default-skin").addClass("vjs-user-inactive").removeClass("lxl-user-active"),$("#hero-player.fullscreen .masthead.hero h2").hide(),e||$("#hero-related-focus-target").focus()}),5e3)))},_onKeyboardNavEvent:function(e,t){const i=(new Date).getTime(),s=APP.currentView.domContainerId,a=APP.slackerPlayerSession(),n=$(`${s} section.spotlight .tile-container:not(.left):not(.right) .button:visible, ${s} section.myaccount button.play:visible`);let o,r,l,c,d,u,h,p,m=$(e.target),g=[],P=!1;if(t||(t=APP.MESSAGING.isVideoJsOptionsOpen?".vjs-modal-dialog-content":APP.MESSAGING?.modal?.()?.actions?".user-prompts ":""),!APP.currentView.hideTvGlobalNav||t||this.isFullScreen||a&&a.playerSize==a.PLAYER_FULL||(t=s),39==e.keyCode||37==e.keyCode){if(this.eggsequence.push(39==e.keyCode?1:-1),this.eggsequence.length>8&&this.eggsequence.shift(),"1-111-11-1-1"===this.eggsequence.join(""))return APP.usesSlackerServices=!0,APP.slackerPlayerSession()||(APP.slackerPlayerSession(require("com.slacker.app.modules.SlackerPlayerSessionModule")),APP.slackerPlayerSession().init()),void APP.MESSAGING.prompt("user-feedback",null,null,{});CONSOLE.debug(["EGG SEQUENCE",this.eggsequence.join("")])}if(this.lastKeyNavTstamp&&i-this.lastKeyNavTstamp<200)return CONSOLE.warn("Ignoring rapid fire keyboard nav event"),!1;switch(CONSOLE.debug(["TenFootModule::_onKeyboardNavEvent",e.keyCode,t]),e.keyCode){case 27:return setTimeout(this._handleRemoteBackButton.bind(this),10),!0;case 39:case 37:p=ko.contextFor(m[0]);let i="",o=$(".vjs-control-bar button:visible")[0];if(39==e.keyCode?(d="right",u=1):(d="left",u=-1),o)c=$(".vjs-control-bar button:visible, .scroll-container.hero-related .tile");else if(!t&&a&&a.playerSize==a.PLAYER_FULL){if(m.hasClass("vjs-progress-holder"))return void this._onSystemTransport(39==e.keyCode?1:-1,e);{let e=$(".bar .transport .playpause").hasClass("pause")?"play":"pause";c=$(`.transport *[tabindex!='-1'][tabindex]:visible:not(.${e}), .tuning *[tabindex!='-1'][tabindex]:visible`)}}else if(m.hasClass("navlink"))c=$(".nav-container li:visible a");else if(m.hasClass("tab-item"))c=m.parent().children();else if(m.hasClass("pagination-button"))c=$(".pagination-button:not(.disabled):not(.jumpto)");else if(m.hasClass("scheduleItem")||m.hasClass("scheduleDate"))c=$(`${t} .tile.scheduleDate`),m.hasClass("scheduleItem")&&(m=m.parent().parent());
1else if(m.hasClass("tile")&&37==e.keyCode&&0==m.parent().parent().find(".tile").index(m))break;c||(p&&p.section&&(i=`#${p.section.id}`),c=$(`${t} ${i} *[tabindex!='-1'][tabindex]:in-viewport:visible`)),m&&m.parent()&&m.parent().hasClass("with-focus")&&m.parent().removeClass("with-focus");break;case 38:if(d="up",u=-1,"scroll"===m.attr("data-ondpad")&&0!=m.scrollTop())return e.preventDefault(),m[0].scrollBy(0,-20);if(m.hasClass("navlink"))return void APP.checkAcessibilityTTSAction("END",null,!1);if(!t&&APP.heroRelatedFocusTimer)c=$(".vjs-control-bar button:visible");else if(!t&&this.isRadioPlaying()&&a.playerSize==a.PLAYER_FULL){if(m.hasClass("vjs-progress-holder")||!a.radioPlayer.seekability)break;c=$(".vjs-progress-holder")}else if(!m.hasClass("button")&&!m.is("button")||t&&!m.hasClass("pagination-button"))if(m.hasClass("tab-item"))c=m.hasClass("sub-tab-item")?m.parent().parent().parent().parent().prev().find(".tab-item.active"):$(".focus-catch:visible.tabs-top");else if(m.hasClass("nav-dot"))c=n.length>0?[n[0]]:$("header *[tabindex!='-1'][tabindex]:in-viewport:visible");else if(m.hasClass("tile")||m.hasClass("column")||m.hasClass("sectionFilterInput")){const e=APP.currentView.seoName;let t=m.parent().parent().parent().parent(),i=t.find(".tile, .section-list:not(.header) .section-list-item .column.button").index(m);if(_koSec=ko.dataFor(t[0]),_koContent=_koSec.content,prevS=null,("list"===_koContent?.type&&0==i||"list"!==_koContent?.type&&(!t.hasClass("grid")||i<4))&&(_koSec.isSpotlight||_koSec.hasFilterData?.()&&null!==_koSec.filter?.()?prevS=null:(prevS=t.prev(),0!=e.indexOf("album/")&&0!=e.indexOf("playlist/")||(t=$(`#${_koSec.id}`),prevS=null)),prevS?.hasClass("paging-bottom")?prevS.prev().find("button").length?(c=$("#paging-top"),prevS=null):(prevS=prevS.prev().prev().prev(),i=prevS.find(".tile").length-(4-i)):prevS&&(prevS.hasClass("title")||prevS.hasClass("offer")||prevS.hasClass("focus-catch"))&&(prevS=prevS.prev())),"double-high"==_koSec.content?.layout){let e=m.parent().parent();e.hasClass("bottom-row")&&(i=e.find(".tile").index(m),prevS=e.prev())}if(prevS&&prevS.get(0)&&(prevS.hasClass("double-high")||"SECTION"==prevS.get(0).nodeName||prevS.hasClass("tabs-container")))if(_koSec=ko.dataFor(prevS.get(0)),APP._doTTS(null,!1,!0),prevS.hasClass("spotlight")||prevS.hasClass("myaccount"))c=prevS.find(".spotlight-nav .nav-dot:visible").length>0?[prevS.find(".spotlight-nav .nav-dot")[0]]:n.length?[n[0]]:$("header *[tabindex!='-1'][tabindex]:in-viewport:visible, #spotlight-catch-top:visible");else if(prevS.hasClass("tabs")||prevS.hasClass("tabs-container"))c=prevS.find(".tab-item.active");else if(APP.checkAcessibilityTTSAction(_koSec.title,null,!1,{forceFinish:!0}),_koSec.content&&"list"===_koSec.content.type)r=prevS.find(".section-list:not(.header) .section-list-item .column.button").eq(-1);else{const e=prevS.hasClass("double-high")?i:prevS?.attr("data-focusIndexOnUp")||0;c=[prevS.find(".tile")[e]]}else t.hasClass("grid")&&i>3?c=[t.find(".tile").get(i-4)]:"list"===_koSec.content?.type&&(null!==_koSec.filter()&&_koSec.hasFilterData()&&0==i?c=[t.find(".sectionFilterInput")[0]]:i-1>-1&&(c=[t.find(".section-list:not(.header) .section-list-item .column.button").get(i-1)])),!c&&t.parent().hasClass("tabpane")&&(null!==_koSec.filter?.()&&_koSec.hasFilterData?.()&&0==i?c=[t.find(".sectionFilterInput")[0]]:(c=t.parent().parent().prev().find(".tab-item.active[tabindex!='-1'][tabindex]"),c[0]||(c=[t.parent().parent().prev().find(".tabs-top")[0]],m=t.parent().parent().prev().find(".tab-item.active")))),m.hasClass("sectionFilterInput")&&(c=m.parent().parent().parent().parent().prev().find(".tab-item.active[tabindex!='-1'][tabindex]")),c||(c=$(".search-header input, .header-nav-bar ul.main-nav li.active a"))}else t&&(c="#StaticView"==t&&APP.currentView.activateDeviceAction?$(`${t} input:in-viewport:visible, ${t} button:visible`):"#MylibraryView"==t&&m.is("button")?$(".header-nav-bar ul.main-nav li.active a"):"#SlackerItemDetailView"==t&&(m.hasClass("button")||m.is("button"))?m.hasClass("bookmark")?$(".header-nav-bar ul.main-nav li a"):$(`${t} #spotlight-catch-top`):$(`${t} .item-detail-section-top, ${t} *[tabindex!='-1'][tabindex]:in-viewport:visible, .header-nav-bar ul.main-nav li a`));else if(m.hasClass("pagination-button")){const e=ko.dataFor(m.parent().prev().prev()[0]);let t,i;e.content.listType?(t=$(`#${e.id}
1`).find(".column.button.play"),i=t.length-1):(t=$(`#${e.id}`).find(".tile"),i=t.length%4==0?t.length-4:t.length-t.length%4),c=[t[i]]}else if("#MylibraryView"==s){if(m.hasClass("column"))return this._onKeyboardNavEvent(e,s);c=$(".header-nav-bar ul.main-nav li.active a")}else c=$(`.focus-catch:visible.item-detail-section-top, ${s} button:not(.pagination-button):visible, .header-nav-bar ul.main-nav li.active a`);P||h||c&&0!=c.length&&c[0]||(h=document.elementFromPoint(m.offset().left+m.width()/2,m.offset().top-m.height()-window.pageYOffset),P=!0);break;case 40:if(d="down",u=1,"scroll"===m.attr("data-ondpad"))return e.preventDefault(),m[0].scrollBy(0,20);if(!t&&APP.heroRelatedFocusTimer)c=$(".scroll-container.hero-related .tile");else if(!t&&this.isRadioPlaying()&&a.playerSize==a.PLAYER_FULL){if(t=".transport",!m.hasClass("vjs-progress-holder"))break;c=$(".bar .transport .playpause").hasClass("pause")?$(".transport a.pause"):$(".transport a.play")}else if(m.hasClass("navlink")||!t&&(m.hasClass("button")||m.is("button")))c=$(s+" section *[tabindex!='-1'][tabindex]:in-viewport:visible");else if(m.hasClass("tab-item")||m.hasClass("sub-tab-item"))p=ko.contextFor(m[0]),_subtabs=m.parent().parent().parent().next().find(".tab-item"),_subtabs[0]?c=_subtabs:p.$data.classNames.indexOf("description")>-1&&p.tabbedSection[p.$index()]?.visibleDescription()?(c=$(`#${p.tabbedSection.activeTab().id}`),c.attr("tabindex",1),c.attr("data-ondpad","scroll")):c=$(`#${p.tabbedSection.activeTab().id} *[tabindex!='-1'][tabindex]:in-viewport:visible`);else if(m.hasClass("nav-dot")||m.hasClass("focus-catch")&&m.hasClass("item-detail-section-top")){const e=m.parent().parent().parent().next(),t=e.length?ko.dataFor(e.get(0)):null;c=$(s+" section:not(.spotlight) *[tabindex!='-1'][tabindex]:in-viewport:visible"),t&&(APP._doTTS(null,!1,!0),APP.checkAcessibilityTTSAction(t.title,null,!1,{forceFinish:!0}))}else if(m.hasClass("scheduleDate"))c=m.find(".scheduleItem");else if(m.hasClass("tile")||m.hasClass("column")||m.hasClass("sectionFilterInput")){const e=m.hasClass("sectionFilterInput"),t=APP.currentView.seoName;let i=e?m.parent().parent():m.parent().parent().parent().parent(),s=ko.dataFor(i[0]);if(targetIndex=i.find(".tile, .section-list:not(.header) .section-list-item .column.button").index(m),nextS=i.next(),nextIsPaging=!1,0!=t.indexOf("album/")&&0!=t.indexOf("playlist/")||(i=$(`#${s.id}`)),(nextS.hasClass("title")||nextS.hasClass("offer")||nextS.hasClass("focus-catch"))&&(nextS=nextS.next()),nextS.hasClass("pagination")&&s&&s.content&&(!s.data||s.maxRowCount<s.data.length)&&("list"===s.content.type?nextIsPaging=targetIndex>=s.content().length-1:nextIsPaging=targetIndex+4>=s.content().length-1),!e&&nextS[0]&&nextIsPaging)c=$("#paging-top"),nextS=null;else if(i.hasClass("grid")){c=i.find(".tile").get(targetIndex+4);let e=i.find(".more.bottom:visible");if(!c&&nextS.hasClass("paging-top"))if(nextS.next().hasClass("pagination"))try{"SECTION"===nextS.next().next().next().get(0).nodeName&&(nextS=nextS.next().next().next(),targetIndex%=4)}catch(e){nextS=null}else nextS=null;else c=!c&&e.length?[e.get(0)]:[c],nextS=null}else if("double-high"==s.content.layout){let e=m.parent().parent();e.hasClass("bottom-row")||(nextS=e.next())}else if("list"===s.content.type){const t=ko.dataFor(m.parent().parent()[0]),a=s.content(),n="album-tracks"==s.content.listType?a[t.discNum]().tracks:a;if(void 0!==t.discNum&&0!=t.discNum)for(_discNum=t.discNum-1;_discNum>-1;)targetIndex-=a[_discNum]().tracks.length,_discNum--;if(targetIndex<n.length-1){const a="album-tracks"==s.content.listType?$(i.find("ul.section-list.album-tracks:not(.header)").get(t.discNum)).find(".column.button"):i.find(".section-list:not(.header) .section-list-item .column.button");c=e?[a[0]]:[a[targetIndex+1]],nextS=null}else if(s.hasMore()||s.hasLess())c=[i.find(".more.bottom:visible")[0]],nextS=null;else if("album-tracks"==s.content.listType&&s.content().length){const e=t.discNum+1,i=$("ul.section-list.album-tracks:not(.header)").get(e);i&&(c=[$(i).find(".section-list-item .column.button")[0]],nextS=null)}}if(nextS&&(nextS.hasClass("tabs-container")||nextS.hasClass("double-high")||nextS.get(0)&&"SECTION"==nextS.get(0).nodeName))if(s=ko.dataFor(nextS.get(0)),APP._doTTS(null,!1,!0),nextS.prev().hasClass("title")&&APP.checkAcessibilityTTSAction(nextS.prev().find("h2").text(),null,!1,{forceFinish:!0}),nextS.prev().hasClass("offer")&&APP.checkAcessibilityTTSAction(nextS.prev().find(".description").text(),null,!0,{forceFinish:!0}),APP.checkAcessibilityTTSAction(s.title,null,!0,{forceFinish:!0}),s.content&&"list"===s.content.type)c=[nextS.find(".section-list:not(.header) .section-list-item .column.button")[0]];else if(nextS.hasClass("tabs-container"))p=ko.contextFor(nextS.find(".tab-item")[0]),c=nextS.find(`#tab-${p.tabbedSection.activeTab().id}[tabindex!='-1'][tabindex]`),c[0]||(c=[nextS.next().find(".tile")[0]]);else{const e=nextS.hasClass("double-high")?targetIndex:nextS?.attr("data-focusIndexOnUp")||0;c=[nextS.find(".tile")[e]],i.attr("data-focusIndexOnUp",targetIndex)}}else if(m.hasClass("hero-focus")&&m.hasClass("top"))c=[$(".hero-related .tile, .vjs-control-bar button:visible")[0]];else if(m.hasClass("pagination-button")){let e=m.parent().next().next();e.get(0)&&"SECTION"==e.get(0).nodeName&&(_koSec=ko.dataFor(e.get(0)),c=[e.find(".tile")[0]],_koSec.title&&APP.checkAcessibilityTTSAction(_koSec.title,null,!0,{forceFinish:!0}))}else t&&(c="#StaticView"==t&&APP.currentView.activateDeviceAction?$(`${t} input:in-viewport:visible, ${t}
1 button:visible`):"#SlackerItemDetailView"==t&&m.hasClass("button")&&m.hasClass("play")?$(`${t} *[tabindex!='-1'][tabindex]:not('button'):in-viewport:visible`):$(`${t} *[tabindex!='-1'][tabindex]:in-viewport:visible`));if(!(h||c&&0!=c.length&&c[0])){if(h=document.elementFromPoint(m.offset().left+m.width()/2,m.offset().top+2*m.height()-window.pageYOffset),!h||_koSec&&_koSec.id&&h.id==_koSec.id){h=null;break}P=!0}}if(P&&h&&(h.getAttribute("tabindex")||h.parentElement&&"main-nav"==h.parentElement.getAttribute("class")?c=[h]:$(h).hasClass("overlay")&&!ko.dataFor(h).isSpotlight?c=[h.parentNode]:CONSOLE.debug(["::_onKeyboardNavEvent","No focusable element in direction requested",d])),c&&1!=c.length&&(c.map((function(e,t){var i="object"==typeof t.className?t.className.baseVal:t.className;(t.getAttribute&&t.getAttribute("tabindex")||i&&i.indexOf("button")>-1||"INPUT"===t.nodeName||"BUTTON"===t.nodeName||"RADIO"===t.nodeName||"CHECKBOX"===t.nodeName||"SELECT"===t.nodeName||"TEXTAREA"===t.nodeName)&&g.push(t)})),l=$(g)),c&&1==c.length?r=$(c[0]):l&&l.length&&(o=l.index(m),r=l.eq(o+u)),r&&r.is(":focus")&&(r=null),e.preventDefault(),!d||!r||!r.length&&!r.nodeName)return CONSOLE.debug(["TenFootModule::_onKeyboardNavEvent","No focusable item for direction",d]),m.focus(),APP.checkAcessibilityTTSAction("END",null,!1),!0;if(CONSOLE.debug(["TenFootModule::_onKeyboardNavEvent",m[0].nodeName,m[0].id,d,r[0]?r[0].nodeName:r.nodeName,r[0]?r[0].id:r.id]),$(".with-focus").removeClass("with-focus"),r.hasClass("focus-catch"))e.relatedTarget=d,e.target=r[0],setTimeout((()=>{this._handleFocusCatchFocus({target:r[0],relatedTarget:m[0],key:d})}),100);else{const e=r.length>0?r[0]:r;if(e.focus(),e.className.indexOf("description")>-1){const t=ko.dataFor(e);t.visibleDescription?.()?.split(".").forEach((e=>APP.checkAcessibilityTTSAction(e,null,!0)))}!$(".header-nav-bar:visible")[0]&&e.className.indexOf("navlink")>-1&&this._handleGlobalNavRefocus()}this.lastKeyNavTstamp=i},onBeforeHeroVideoStart:function(e,t,i){const s=APP.slackerPlayerSession();if(APP.checkPaywallVideo(e,e.preview||i,(()=>{this.onBeforeHeroVideoStart(e,t,i)}))){if(APP.herorelated([]),CONSOLE.debug(["TenFootModule.onBeforeHeroVideoStart","state",window.history.state]),"player-fullscreen"===window.history.state&&history.back(),s?.currentPlayableItem()){this.isRadioPlaying(!1);try{s.currentPlayableItem().stop("Video",null,!0)}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}}if(this.adtlVideoAnnotations)for(let t in this.adtlVideoAnnotations)e[t]=this.adtlVideoAnnotations[t];if(i?(e.defaultVolume=0,e.disablePreroll=!0):e.defaultVolume=1,APP.herostreamaction.isVideoPlayerActive())return APP.herostreamaction.videoplayer.stop(),void setTimeout((function(){APP.appImplementationModule.onBeforeHeroVideoStart(e,t,i)}),1e3);if(APP.currentView.detailPlayer)try{APP.currentView.detailPlayer.stop()}catch(e){}i?this.detailstreamaction&&(this.detailstreamaction.playStream($(APP.currentView.domContainerId+" #video-"+e.objectId+".tile .overlay")[0],e),$(APP.currentView.domContainerId+" #video-"+e.objectId+".tile").addClass("dazzle")):("function"==typeof APP?.currentView?.data?.()?.[0]?.setSpotlightAutoRotate&&APP.currentView.data()[0].setSpotlightAutoRotate(!0),this?.festivalSchedule(null),e.contentUrl?(BEACON.tagEvent({name:"playStart",params:{type:"video",value:e.objectId,video:e.objectId}}),"tesladash"==APP.appImplementationModule.type?APP.currentView.onEventWatchNow(e):(e.banner=[e.title,e.subtitle?`<span>${e.subtitle}</span>`:""].join(""),APP.herostreamaction.playStream($("#hero-player #hero-video-container")[0],e))):this.onTileClick(e,null,!0))}},initSocialMessaging:function(e,i){this.socialMessaging()?this.onFestivalSocialAvailable(!0):new t(e.filter((e=>"status"==e.messageType)),i,this)},onFestivalSocialAvailable:function(e){this.isFestivalSocialAvailable(e)},onSocialMessagingUserProfileActive:function(){},onChatEnabled:function(){},onFlyoutMessage:function(e){this.flyoutDismissTimer&&(clearTimeout(this.flyoutDismissTimer),this.flyoutDismissTimer=0),e?.duration&&(this.flyoutDismissTimer=setTimeout((e=>{this.dismissFlyout()}),1e3*e.duration))}
1,dismissFlyout:function(){this.flyoutDismissTimer&&(clearTimeout(this.flyoutDismissTimer),this.flyoutDismissTimer=0);try{let e=this.socialMessaging().currentFlyout;e().style="dismiss",e.valueHasMutated(),setTimeout((t=>{e(null),e=null}),200)}catch(e){}arguments?.length>1&&"BUTTON"!=arguments[1].target.nodeName&&BEACON.tagEvent({name:"flyout",params:{value:"userAction",label:"dismiss"}})},toggleEmojiSelector:function(e){},onChatRemoved:function(e,t,i){},onEmoteStatusChange:function(){},onChatMessageRecieved:function(e){},onUserHeartAction:function(){},onHeartMashRecieved:function(e,t){},onSidepanelTabClick:function(e,t){},onAntiPiracyRequest:function(){const e=(new Date).getTime(),t=document.querySelector(".ticketHolderData");if(t){const i=["a","b","c","d"],s="block"!=t.style.display?"block":"none";let a=i[Math.floor(4*Math.random())];t.style.display=s,e%3==0&&(a+=" wm"),t.className=`ticketHolderData ${a}`,"block"==s&&setTimeout((()=>t.style.display="none"),1e4),-1==a.indexOf("wm")&&setTimeout((()=>{t.className=`ticketHolderData ${a} go`}),1e3)}},onFestivalStatusChange:function(e){if(e.from&&e.to&&this.streamStatus!=e.to&&"offline"===e.to)this.onEndStreamRequest()},onEndStreamRequest:function(){APP.herostreamaction?.videoplayer?.stop?.(),this.socialMessaging?.().teardown()},_handleGlobalNavRefocus:function(){window.scrollTo(0,0),$(".page:visible").removeClass("browsing"),$(".header-nav-bar").show(100,(e=>{$(".header-nav-bar ul.main-nav li a")[0].focus()}))},_handleAccessibleUiItemFocus:function(e){const t=this.getAttribute("aria-labelledby");let i,s=ko.dataFor(this),a="BUTTON"===this.nodeName||this.className.indexOf("button")>-1&&-1==this.className.indexOf("column")||"button"==this.getAttribute("role"),n=!1,o=this.getAttribute("aria-label"),r=$(this);if(!this.className||-1==this.className.indexOf("page browsing"))if(e&&e.stopPropagation(),t&&(r=$(`#${t.split(" ").join(", #")}`)),o)"SELECT"==this.nodeName&&(o=`${o}. SELECTED. ${this.options[this.selectedIndex].text}`),APP.checkAcessibilityTTSAction(o,null,n);else if(s&&!s.validation_rules)if(a)"BUTTON"!==r[0]&&(r.children().attr("aria-labelledby")&&(r=$(`#${r.children().attr("aria-labelledby")}`)),i=r.children().attr("aria-label")),i||(i=r.text()),APP.checkAcessibilityTTSAction(i,null,n,e);else{let t=null;r[0]?.className.indexOf("tab-item")>-1&&(s.ariaLabel=s.title),"function"==typeof s?.active&&(t=s.active()?`Now Playing: ${s.title}`:"offline"==s.streamStatus?`Off Line: ${s.title}`:s.title,s=null),APP.checkAcessibilityTTSAction(t,s,n,e)}else i=r.text(),"SELECT"==this.nodeName&&(i=`${i}. SELECTED. ${this.options[this.selectedIndex].text}`),APP.checkAcessibilityTTSAction(i,null,n,e)},_onVideoPlayEvent:function(e){switch(CONSOLE.debug("TenFootModule._onVideoPlayEvent::"+e.type+"::"+e.player),e.type){case APP.herostreamaction.videoplayer.EVENT.VIDEOCONTAINERREADY:APP.herostreamaction.isVideoPlayerActive(!0),APP.checkAcessibilityTTSAction("Connecting");const t=$("button.vjs-subs-caps-button").clone();if(t.on("click",(()=>this._handleControlerKeyInput({keyCode:10221}))),$("button.vjs-subs-caps-button").parent().html(t[0]),"tenfoot"!=this.type){let t=e?.video?._links?.details||e?.video?._links?.self;e.video?.playerRelatedList?.length?APP.herorelated(this.processMultiStageData(e.video.playerRelatedList,e.video)):(!t&&e.video.objectId&&(t={href:`${APP.SERVICE.urls.API.VIDEO}/videos/${e.video.objectId}/details`}),this.getPlayerRelated(t?.href,APP.herorelated))}e?.video?.messageChannels&&this.initSocialMessaging(e.video.messageChannels,e.video.festivalId);break;case APP.herostreamaction.videoplayer.EVENT.NOCONTENT:APP.MESSAGING.prompt("modalErrorFree",{reason:"Content is unavailable at this time."});break;case APP.herostreamaction.videoplayer.EVENT.DISPLAYERROR:APP.onVideoFullScreenRequest(null),APP.herostreamaction.isVideoPlayerActive(!1),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle"),APP.MESSAGING.prompt("modalErrorFree",{reason:"An unexpected error occurred playing this video. Please try again later"});break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.STARTED:$("#hero-related-focus-target").focus(),$(".vjs-progress-control").attr("tabindex",APP.getTabIndexByName("radioplayer")),this.isChangingStages=!1;break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.COMPLETED:APP.herostreamaction.isVideoPlayerActive(!1),APP._onHeroRelatedFocus(null,null,!0),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle"),setTimeout((function(){const e=APP.currentView.lastFocusedItem;if(e){const t=$(`#${e}:not(:focus)`).find(`#${e.replace("tile-","video-")}`);t.length?t.focus():$(`#${e}:not(:focus)`).focus()}}),500);break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR:if(APP.herorelated([]),e.video&&e.video.messages){let t="too_many_devices"==e.error?"modalError":"modalErrorFree";for(let i in e.video.messages){APP.MESSAGING.prompt(t,{reason:e.video.messages[i]});break}}else"no_ticket"==e.error&&APP.MESSAGING.prompt("accessNotAllowed");APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.isVideoPlayerActive(!1)}},_onDetailVideoPlayEvent:function(e){switch(CONSOLE.debug("TizenModule._onVideoPlayEvent::"+e.type+"::"+e.player),e.type){case APP.herostreamaction.videoplayer.EVENT.VIDEOCONTAINERREADY:$(".tile .video-js").parent().parent().addClass("detail-video-player");break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.DURATIONCHANGE:APP.currentView&&!APP.currentView.detailPlayer&&(APP.currentView.detailPlayer=this.detailstreamaction.videoplayer);break;case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.COMPLETED:APP.currentView&&(APP.currentView.detailPlayer=null),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle");break;case APP.herostreamaction.videoplayer.EVENT.DISPLAYERROR:case APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR:$("body").removeClass("hero-video").removeClass("hero-player-floating"),$(".detail-video-player").removeClass("detail-video-player").removeClass("dazzle")}},_onRadioEventListener:function(e){const t=APP.slackerPlayerSession(),i=APP.MESSAGING.modal(),s=t.radioPlayer,a='<span>Player</span><svg role="presentation" alt="play animation" class="lds-equalizer" width="100%" height="50px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewB
1ox="0 0 100 100" preserveAspectRatio="xMidYMid">\n\t\t\t\t\t\t\t\t<g transform="rotate(180 50 50)">\n\t\t\t\t\t\t\t\t<rect y="22" height="10.2138" fill="#ce1c35" x="28.333333333333336" width="10">\n\t\t\t\t\t\t\t\t <animate attributeName="height" calcMode="spline" values="40;60;8;40" times="0;0.33;0.66;1" keySplines="0.5 0 0.5 1;0.5 0 0.5 1;0.5 0 0.5 1" repeatCount="indefinite" begin="-0.15s" dur="1.2">\n\t\t\t\t\t\t\t\t</animate></rect><rect y="22" height="39.9159" fill="#ce1a35" x="39.44444444444444" width="10">\n\t\t\t\t\t\t\t\t <animate attributeName="height" calcMode="spline" values="40;60;8;40" times="0;0.33;0.66;1" keySplines="0.5 0 0.5 1;0.5 0 0.5 1;0.5 0 0.5 1" repeatCount="indefinite" begin="-0.44999999999999996s" dur="1.2">\n\t\t\t\t\t\t\t\t</animate></rect><rect y="22" height="59.5041" fill="#ce1c35" x="50.55555555555556" width="10">\n\t\t\t\t\t\t\t\t <animate attributeName="height" calcMode="spline" values="40;60;8;40" times="0;0.33;0.66;1" keySplines="0.5 0 0.5 1;0.5 0 0.5 1;0.5 0 0.5 1" repeatCount="indefinite" begin="-0.8999999999999999s" dur="1.2">\n\t\t\t\t\t\t\t\t</animate></rect><rect y="22" height="56.9548" fill="#ce1c35" x="61.66666666666667" width="10">\n\t\t\t\t\t\t\t\t <animate attributeName="height" calcMode="spline" values="40;60;8;40" times="0;0.33;0.66;1" keySplines="0.5 0 0.5 1;0.5 0 0.5 1;0.5 0 0.5 1" repeatCount="indefinite" begin="-0.75s" dur="1.2">\n\t\t\t\t\t\t\t\t</animate></rect><rect y="22" height="29.0576" fill="#ce1c35" x="72.77777777777777" width="10">\n\t\t\t\t\t\t\t\t <animate attributeName="height" calcMode="spline" values="40;60;8;40" times="0;0.33;0.66;1" keySplines="0.5 0 0.5 1;0.5 0 0.5 1;0.5 0 0.5 1" repeatCount="indefinite" begin="-0.3s" dur="1.2">\n\t\t\t\t\t\t\t\t</animate>\n\t\t\t\t\t\t\t\t</rect>\n\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t</svg>';switch(e.type){case t.EVENT.STATIONSTARTED:i&&i.actions||setTimeout((()=>this._handleRemoteBackButton(!1,!0)),100);break;case t.EVENT.STATIONSTOPPED:this.isRadioPlaying(!1),$(".tv-radio-mini a").html(""),$(".header-nav-bar").removeClass("radio-play"),t.setPlayerSize(t.PLAYER_DEFAULT),t.radioPlayer?.stop(),e.chainedAction?.();break;case t.EVENT.RATING:let n="track"==e.ratingType?`Song ${e.track.title}`:`Artist ${e.track.artist}`,o=100==e.rating?"Favorited":-100==e.rating?"Banned":"Unrated";APP.checkAcessibilityTTSAction(`${n} ${o}`);break;case s.EVENT.PLAYBACK.STARTED:this.isRadioPlaying()||(this.isRadioPlaying(!0),$(".header-nav-bar").addClass("radio-play"),t.setPlayerSize(t.PLAYER_FULL),setTimeout((e=>this._handleRemoteBackButton(null,!0)),100)),i&&i.actions||$(".transport .playpause a.pause").focus(),$(".tv-radio-mini a").html(a);break;case s.EVENT.PLAYBACK.PAUSE:e.track.isLive?APP.checkAcessibilityTTSAction("live stream stopped"):this._doTTSactionWithTimecode("paused at",e.player.currentTime()),$(".tv-radio-mini a").html('<span>Player</span><svg role="presentation" alt="pause animation" class="lds-equalizer" width="100%" height="50px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="background: none; padding: 0; margin: 0;">\n\t\t\t\t\t\t\t\t\t<g transform="rotate(180 50 50)">\n\t\t\t\t\t\t\t\t\t<rect y="22" height="10.1976" fill="#ce1c35" x="28.333333333333336" width="10"></rect>\n\t\t\t\t\t\t\t\t\t<rect y="22" height="39.9224" fill="#ce1a35" x="39.44444444444444" width="10"></rect>\n\t\t\t\t\t\t\t\t\t<rect y="22" height="59.496" fill="#ce1c35" x="50.55555555555556" width="10"></rect>\n\t\t\t\t\t\t\t\t\t<rect y="22" height="57.0259" fill="#ce1c35" x="61.66666666666667" width="10"></rect>\n\t\t\t\t\t\t\t\t\t<rect y="22" height="29.1516" fill="#ce1c35" x="72.77777777777777" \twidth="10"></rect>\n\t\t\t\t\t\t\t\t</g></svg>'),t.playerSize==t.PLAYER_FULL&&$(".transport .playpause a.play").focus();break;case s.EVENT.PLAYBACK.RESUME:this._doTTSactionWithTimecode("resumed at",e.player.currentTime()),$(".tv-radio-mini a").html(a),t.playerSize==t.PLAYER_FULL&&$(".transport .playpause a.pause").focus();break;case s.EVENT.PLAYBACK.DISPLAYERROR:this.isRadioPlaying(!1),$(".tv-radio-mini a").html(""),$(".header-nav-bar").removeClass("radio-play")}},_onSystemPlay:function(){const e=APP.slackerPlayerSession(),t=APP.herostreamaction;
1if(this.isRadioPlaying())e.radioPlayer.wasPaused&&e.radioPlayerStateManager().playPause();else if(t.isVideoPlayerActive()){if(!this.networkStatus)return void APP.NETWORKING.EVENTS.notify(APP.NETWORKING.EVENT.CONNECTION.GONE,[APP.NETWORKING.EVENT.CONNECTION.GONE,arguments]);t.videoplayer.player.paused()&&(this._doTTSactionWithTimecode("resumed at",t.videoplayer.player.currentTime()),t.videoplayer.player.play())}},_onSystemPause:function(){const e=APP.slackerPlayerSession(),t=APP.herostreamaction,i=(new Date).getTime(),s=APP.herostreamaction.videoplayer,a=s?s.currentVideoObj:null,n=a?s.getLastVideoState(a.objectId):null,o=!this.onSleepTstamp||i-this.onSleepTstamp<6e4;if(this.onSleepTstamp&&(s&&t.isVideoPlayerActive()&&("live"!=s.currentVideoObj.streamType&&(s.startOffset=n),s.needsRestartOnResume=!0,a.disablePreroll=!0),o?CONSOLE.info("TenFootModule::_onSystemPause - Attempting restart after system event interruption."):CONSOLE.warn("TenFootModule::_onSystemPause - Restart after system event interruption is stale."),this.onSleepTstamp=0),this.isRadioPlaying())if(o)e.radioPlayerStateManager().playPause();else{this.isRadioPlaying(!1);try{e.currentPlayableItem().stop("Shutdown",null,!0)}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}}else if(t.isVideoPlayerActive()){if(!this.networkStatus)return void APP.NETWORKING.EVENTS.notify(APP.NETWORKING.EVENT.CONNECTION.GONE,[APP.NETWORKING.EVENT.CONNECTION.GONE,arguments]);s.needsRestartOnResume?(t.currentVideo().isLive?APP.checkAcessibilityTTSAction("Resuming Live Stream"):this._doTTSactionWithTimecode("Resuming at",s.player.currentTime()),s.reconnectToStream()):t.currentVideo().isLive||(s.player.paused()?(this._doTTSactionWithTimecode("Resuming at",s.player.currentTime()),t.videoplayer.resume()):(this._doTTSactionWithTimecode("paused at",s.player.currentTime()),s.pause()))}},_onSystemTransport:function(e,t){const i=APP.slackerPlayerSession(),s=APP.herostreamaction;let a,n;if(this.isRadioPlaying()&&i.playerSize==i.PLAYER_FULL)i.seekBy(5*e);else if(APP.herostreamaction.isVideoPlayerActive()){if(!this.networkStatus)return void APP.NETWORKING.EVENTS.notify(APP.NETWORKING.EVENT.CONNECTION.GONE,[APP.NETWORKING.EVENT.CONNECTION.GONE,arguments]);s.currentVideo()&&!s.currentVideo().isLive?(a=s.videoplayer.player.currentTime(),n=a+5*e,1!=Math.abs(e)&&(n=e),this._doTTSactionWithTimecode(1==e?"Fast Forward to":"Rewind to",n),s.videoplayer.seekTo(n)):CONSOLE.debug(["TenFootModule._onSystemTransport - LIVE video is not seekable or no video yet."])}else this._onKeyboardNavEvent(t)},_onSystemStop:function(){APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.cleanUp()},_onSystemVisibilityChange:function(){document.hidden||document.webkitHidden},_handleControlerKeyInput:function(e,t){const i=(new Date).getTime();if(this.lastControllerKeyTstamp&&i-this.lastControllerKeyTstamp<200)return CONSOLE.warn("Ignoring rapid fire controller key event"),!1;this.lastControllerKeyTstamp=i,e.originalEvent&&(e=e.originalEvent),CONSOLE.debug("Controller key shortcut: "+e.keyCode);const s=APP.MESSAGING.isVideoJsOptionsOpen||APP?.MESSAGING?.modal?.()?.msg,a=APP.herostreamaction,n=APP.slackerPlayerSession(),o=APP.currentView,r=n?n.currentTrack():null,l=$(e.target);switch(e.keyCode){case 13:return l.hasClass("focus-catch")?(e.preventDefault(),!0):"SELECT"==e.target.nodeName||"firetv"==this.type&&!document.location.href.match(/live(xlive|one)\.com/)||(e.preventDefault(),l[0].click(),!1);case 39:return APP.heroRelatedFocusTimer||s||this.isRadioPlaying()&&n.playerSize==n.PLAYER_FULL?this._onKeyboardNavEvent(e):void this._onSystemTransport(1,e);case 37:return APP.heroRelatedFocusTimer||s||this.isRadioPlaying()&&n.playerSize==n.PLAYER_FULL?this._onKeyboardNavEvent(e):void this._onSystemTransport(-1,e);case 38:return a.isVideoPlayerActive()&&!s?(APP.heroRelatedFocusTimer?this._onKeyboardNavEvent(e):$("#hero-related-focus-target").focus(),!0):this._onKeyboardNavEvent(e);case 40:return a.isVideoPlayerActive()&&!s?APP.heroRelatedFocusTimer?this._onKeyboardNavEvent(e):($("#hero-related").focus(),!0):this._onKeyboardNavEvent(e);case 229:if(APP.MESSAGING.modal()&&APP.MESSAGING.modal().actions);else if("INPUT"==e.target.nodeName){if("SearchView"==o.type){let e=o.query().trim();o._handleSlackerCommand(e)&&o._handleSlackerCommand(e,!0)}else $(e.target).hasClass("sectionFilterInput")&&!e.key&&ko.contextFor($(".sectionFilterInput")[0]).section._doPagination(null,!0);setTimeout((()=>{o._doLazyImageLoading(!0)}),200)}break;case 403:if(this.isRadioPlaying()&&"true"===r.cantrackrate)return n.rateCurrentTrack(-100==r.trate?0:-100,null,"track"),!0;break;case 404:this.isRadioPlaying()&&"true"===r.cantrackrate&&n.rateCurrentTrack(100==r.trate?0:100);break;case 10009:case 166:case 27:if(APP.checkAcessibilityTTSAction("Return"),"firetv"!=this.type)return setTimeout(this._handleRemoteBackButton.bind(this),10),!0;break;case 8:case 10221:let t=null,i=null;if(a.isVideoPlayerActive()&&(t=a.videoplayer.currentVideoObj.captionUrls,i=a.videoplayer,i.player.textTrackSettings.options_.persistTextTrackSettings=!0),t){let e=i.player.controlBar.subsCapsButton.menu,t=[],s=null,n="Current Setting: {_s}";e.children_.forEach((function(e){let o={label:e.options_.label,action:()=>{e.track.language?APP.SERVICE.cache("cc_state",e.track.language):(APP.SERVICE.uncache("cc_state"),APP.appImplementationModule.isCCEnabled=0),e.trigger("click"),APP.MESSAGING.setModal()},styles:"std"+e.controlText_.replace("selected","secondary").replace(/,/g,"")};!s&&e.track.language&&(s=o),"captions settings"==e.options_.label.toLowerCase().trim()&&(o.label="Caption Styles",o.action=()=>{APP.MESSAGING.setModal(),a.videoplayer.player.paused()&&a.videoplayer.player.play(),APP._onHeroRelatedFocus(null,null,!0),APP.SERVICE.isCached("cc_state")||(APP.SERVICE.cache("cc_state",e.track.language),s.action()),APP.checkAcessibilityTTSAction("Caption Style Settings Options"),i.player.player().getChild("textTrackSettings").open(),APP.MESSAGING.isVideoJsOptionsOpen=!0,setTimeout((()=>{$(".vjs-modal-dialog .vjs-done-button").on("click",(()=>{APP.MESSAGING.isVideoJsOptionsOpen=!1,APP.checkAcessibilityTTSAction("Caption Style Settings Saved")})),$(".vjs-modal-dialog .vjs-default-button").focus().on("click",(()=>{APP.checkAcessibilityTTSAction("Caption Style Settings Reset")})),$(".vjs-modal-dialog select").attr("data-native-menu","true").attr("tabindex","100"),$(".vjs-modal-dialog .vjs-track-settings-controls button").addClass("std").addClass("secondary").attr("tabindex","100").focus()}),200)}),t.push(o),e.controlText_.indexOf("selected")>-1&&(n=n.replace("{_s}",e.options_.label))})),APP.MESSAGING.prompt("closedCaptions",{reason:n,disableClose:!0},t)}else a.isVideoPlayerActive()&&!t&&APP.MESSAGING.prompt("closedCaptions",{reason:"No captions avaliable for current video."},[]);break;case 413:if(this.isRadioPlaying()&&n.currentPlayableItem())try{return n.currentPlayableItem().stop("stop",null,!0),!0}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}else if(this.isFullScreen)return APP.checkAcessibilityTTSAction("Stop"),setTimeout(this._handleRemoteBackButton.bind(this),10),!0;return!1;case 415:(a.isVideoPlayerActive()&&a.videoplayer.player.paused()||this.isRadioPlaying()&&n.radioPlayer.wasPau
1sed)&&this._onSystemPlay();break;case 19:a.isVideoPlayerActive()?a.videoplayer.player.paused()||this._onSystemPause():this.isRadioPlaying()&&(n.radioPlayer.wasPaused||this._onSystemPause());break;case 179:case 10252:this._onSystemPause();break;case 227:case 412:this._onSystemTransport(-1);break;case 228:case 417:this._onSystemTransport(1);break;case 10232:this.isRadioPlaying()&&n.skipBack();break;case 10233:this.isRadioPlaying()&&n.skipCurrentTrack(!1)}},_handleRemoteBackButton:function(e,t){CONSOLE.info("Handling BACK button action");const i=$(".header-nav-bar ul.main-nav li.active a"),s=APP.slackerPlayerSession(),a=APP.herostreamaction;let n=null;if(APP.MESSAGING.isVideoJsOptionsOpen)return $(".vjs-modal-dialog .vjs-done-button").click(),APP.MESSAGING.isVideoJsOptionsOpen=!1,!1;if("boolean"!=typeof e&&(e=null),"boolean"!=typeof t&&(t=null),APP._setNavigating(!1),t)this.isRadioPlaying()&&s.playerSize==s.PLAYER_FULL?APP.MESSAGING.modal()?.actions||($(".bar .transport .playpause").hasClass("pause")?$(".transport .playpause a.pause").focus():$(".transport .playpause a.play").focus()):!this.isFullScreen&&APP.currentView?n=APP.currentView.lastFocusedItem:this.isFullScreen&&(a.videoplayer.player.paused()?$(".vjs-control-bar button:visible")[0].focus():$("#hero-related-focus-target").focus());else{if(!e&&APP.MESSAGING.modal()?.actions){if(APP.MESSAGING.setModal(null),APP.MESSAGING.modal()?.mustAnswer)return void window.history.pushState("exit-catch",null,null);if(this.isRadioPlaying()&&s.playerSize==s.PLAYER_FULL)return this._handleRemoteBackButton(!1,!0);APP.currentView.lastFocusedItem&&(n=APP.currentView.lastFocusedItem)}else if(this.isRadioPlaying()&&s.playerSize==s.PLAYER_FULL)n=APP.currentView.lastFocusedItem,s.setPlayerSize(s.PLAYER_DEFAULT);else if(a.isVideoPlayerActive())APP.herorelated([]),n=APP.currentView.lastFocusedItem,a.videoplayer._wasPlayingVideoAd=!1,a.videoplayer.isRequestingAds=!1,a.videoplayer.stop();else if(APP.history.length>0||e){$(APP.currentView.domContainerId).removeClass("browsing");const e=APP.history.shift();e&&(APP._setNavigating(!0),this.checkAcessibilityTTSAction("Loading icon is present"),n=e.lastFocusedItem,setTimeout((()=>{CONSOLE.info(["_handleRemoteBackButton","Setting view from history active",e.type]),e.setActive.bind(e)(!0),e._doLazyImageLoading(!0)}),10)),e&&e.hideTvGlobalNav||($(".header-nav-bar").show(),$(".header-nav-back").hide())}else{if(i.is(":focus"))return APP.currentView.lastFocusedItem=null,this.exitAppOnBack?void APP.appImplementationModule.closeApp():(window.history.pushState("exit-catch",null,null),void APP.MESSAGING.prompt("appConfirmExit",{},[{label:"NO",styles:"std",action:function(){APP.MESSAGING.setModal(),$(".header-nav-bar ul.main-nav li.active a").focus()}},{label:"YES",styles:"std secondary",action:APP.appImplementationModule.closeApp}]));i.focus()}window.history.pushState("exit-catch",null,null)}n&&"tesladash"!=APP.appImplementationModule.type&&setTimeout((()=>{if(n){const e=ko.dataFor(document.getElementById(APP.currentView.lastFocusedItem));if(e?.isSpotlight&&!APP.currentView.hideTvGlobalNav&&(n=i),"object"==typeof n)n.focus();else{APP.currentView.lastFocusedItem=n;const e=$(`#${n}:not(:focus)`).find(`#${n.replace("tile-","video-")}`);e.length?e.focus():$(`#${n}`).focus()}}APP.currentView._doLazyImageLoading(!0)}),500)},getPlayerRelated:function(e,t){t&&e&&APP.NETWORKING.do(e,((i,s,o)=>{const r=i?.data?.subTypes?.includes?.("recorded")?new a(i):new n({objectId:"dummy"});let l;i?(l=r.parseResponse(i,!0),l?.playerRelatedList?.length&&(t(this.processMultiStageData(l.playerRelatedList,APP.herostreamaction.currentVideo())),APP._onHeroRelatedFocus(null,null,!0))):CONSOLE.warn("No content for player related: "+e)}),"GET")},processMultiStageData:function(e=[],t){let i=e.map((e=>{"function"==typeof e&&(e=e());const i={id:generateUniqueID(),objectId:e.id,uiItemId:e.id,streamStatus:"live"};
1return Object.keys(i).forEach((t=>{e[t]||(e[t]=i[t])})),e.active=ko.observable(!1),e.active(t?.seoName==e.seoName),e}));return i.title=e?.subTypes?.join(" ")||"",i.title&&(i.title=i.title[0].toUpperCase()+i.title.slice(1)),i},changeStage:function(e,t){e.active()?APP.herostreamaction.videoplayer.player.paused()||APP._onHeroRelatedFocus(null,null,!0):e._links.details?APP.NETWORKING.do(i.get(e._links.details.href,{linktype:"templated"}),((i,s,a)=>{if(!i)return void CONSOLE.warn("No content for selected stage: "+e._links.details.href);const o=new n({objectId:"dummy"});let r,l=i.data?i.data:i;l&&(this.isChangingStages=!0,r=o.parseResponse(i,!0),APP.checkPaywallVideo(r,!1,(()=>this.changeStage(l,t)))?l.contentUrl?(CONSOLE.info("Selected stage online. Load new content in player."),BEACON.tagEvent({name:"changeStage",params:{value:e.objectId,label:"tile"}}),APP._onHeroRelatedFocus(null,null,!0),this.onBeforeHeroVideoStart(r)):(APP.herorelated().forEach(((e,t)=>{e.festivalId==l.festivalId&&($(".related-content .tile-container").get(t).className+=" offline")})),APP.checkAcessibilityTTSAction("Off Line"),APP.herostreamaction.videoplayer.player.paused()||(clearTimeout(APP.heroRelatedFocusTimer),APP.heroRelatedFocusTimer=setTimeout((e=>APP._onHeroRelatedFocus(null,null,!0)),2e3)),CONSOLE.info("Selected stage appears to be offline.")):(APP._onHeroRelatedFocus(null,null,!0),CONSOLE.warn("Attempt to CHANGE stage to ticketed event and user has no ticket")))}),"GET"):CONSOLE.warn("Selected stage has no details link!")}},registerPackage("com.slacker.app.modules.implementation.TenFootModule"),com.slacker.app.modules.implementation.TenFootModule=r}()})),bjork("com.slacker.app.modules.implementation.TeslaModule",(function(){!function(){const e=require("com.slacker.app.actions.LaunchVideoStreamAction"),t=require("com.slacker.app.modules.implementation.TenFootModule");function i(){extendClass(this,new t),this.__constants(),this.__properties(),this.__constructor()}i.prototype={__constants:function(){this.VJS_CAPTION_STYLE_DEFAULT={backgroundColor:"#000",backgroundOpacity:"1",color:"#FFF",fontFamily:"proportionalSansSerif",textOpacity:"1",windowColor:"#000",windowOpacity:"0"}},__properties:function(){this.type="tesladash",this.isInitalAppView=!0,this.detailstreamaction=new e("detail"),this.adtlVideoAnnotations={defaultFullScreen:!0,canRetryNonNative:!1,disableAds:!1},this.displayAdOverride=ko.pureComputed((function(){return!0}))},__constructor:function(){localStorage.getItem("refresh_token")&&!localStorage.getItem("tesla")&&(localStorage.removeItem("slackerUser"),localStorage.removeItem("refresh_token"),localStorage.setItem("tesla",!0)),this.$super.constructor(),this.$super.adtlVideoAnnotations=this.adtlVideoAnnotations,APP.suppressDisplayAds=!0,APP.supportsClosedCaptions=!0,APP.canShowSlackerStationLink=!1,APP.onTileClick=this.onTileClick.bind(this),APP.implementationSuperType("tv");const e=this._onVideoPlayEvent.bind(this),t=APP.herostreamaction.videoplayer;["COMPLETED","STARTED"].forEach((i=>t.attachEvent(t.EVENT.PLAYBACK[i],e)));const i=this._onDetailVideoPlayEvent.bind(this),s=this.detailstreamaction;["VIDEOCONTAINERREADY","DISPLAYERROR"].forEach((e=>s.eventMapper.attachEvent(s.videoplayer.EVENT[e],i))),["COMPLETED","STARTED","ERROR","DURATIONCHANGE"].forEach((e=>s.eventMapper.attachEvent(s.videoplayer.EVENT.PLAYBACK[e],i))),window.removeEventListener("popstate",window.ajaxHistoryHandler),window.addEventListener("popstate",this._handleRemoteBackButton.bind(this),!1),$((function(){document.addEventListener("click",APP.USER.resetAysl,!0),$(window).scroll((function(){APP.USER.resetAysl(),APP.currentView&&APP.currentView.onWindowScroll&&APP.currentView.onWindowScroll()}))})),APP.onVideoFullScreenRequest=this.onVideoFullScreenRequest.bind(this),APP.onForceUpdate=this.onForceUpdate.bind(APP),CONFIG.client="livexliveteslavideo",CONFIG.xscid=`00_livexliveteslavideo_en_${APP_VERSION}_site:slacker`,CONFIG.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003606403003706103003406503003703503003703903003403203003403803003503703003606303003303403003503103003603503003406203003606303003603603003303003003403503003703803003303303003603702203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202
1003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",CONFIG.beaconConfig.comscore=null,CONFIG.beaconConfig.client="livexliveteslavideo",CONFIG.beaconConfig.gaConfig.ua="UA-77390823-9",CONFIG.slackerConfig.client=`${CONFIG.client}_en_${APP_VERSION}`,CONFIG.slackerConfig.xscid=CONFIG.xscid,CONFIG.slackerConfig.oauthClient="livexliveteslavideo",CONFIG.slackerConfig.tokenClientId=1283,CONFIG.slackerConfig.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003503003003603503003503903003206203003703303003503703003403903003503203003606203003406303003303103003703503003406303003303503003703703003703102203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",CONFIG.slackerConfig.OAUTH_K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003606403003706103003406503003703503003703903003403203003403803003503703003606303003303403003503103003603503003406203003606303003603603003303003003403503003703803003303303003603702203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",BEACON.partnerLogging=CONFIG.beaconConfig,BEACON.init(),APP.onImplementationConstructed.bind(APP)(this)},init:function(){CONSOLE.warn("Initializing Tesla Module"),loadCssDynamically("css/tenfoot.css",`${this.type}-style`);{const e=document.createElement("style");e.textContent="html * {pointer-events: unset !important};",document.head.append(e)}$("body").addClass("tenfoot"),APP.frameworkInclude="/includes/site-framework.jsp",APP.viewNames.push("Settings");try{ko.applyBindings(APP,$(".header-nav-bar")[0])}catch(e){}try{ko.applyBindings(APP,$("#hero-player")[0])}catch(e){}try{ko.applyBindings(APP,$(".page-loading")[0])}catch(e){}try{ko.applyBindings(APP,$("footer")[0])}catch(e){}return APP.EVENTS.attachEvent(APP.EVENT.VIEWACTIVE,this.onActiveVew.bind(this)),window.history.pushState("exit-catch",null,null),new APP.viewsByDomName.HomeView},onForceUpdate:function(){APP.MESSAGING.prompt("appForceUpdate",{},[{label:"CLOSE",action:APP.appImplementationModule.closeApp,styles:"std app-close-btn"}]),setTimeout((function(){$(".app-close-btn").focus()}),200)},onActiveVew:function(e,t){!t&&e&&this.isInitalAppView&&(this.isInitalAppView=!1)},_onSystemVisibilityChange:function(){var e=APP.herostreamaction.videoplayer,t=e?e.currentVideoObj:null,i=t?e.getLastVideoState(t.objectId):null;t&&(document.hidden||document.webkitHidden?APP.herostreamaction.isVideoPlayerActive()&&(e.pause(),e.needsRestartOnResume=!0):APP.herostreamaction.isVideoPlayerActive()&&(e.needsRestartOnResume=!0,"live"!=e.currentVideoObj.streamType&&(e.startOffset=i),this._onSystemPause()))}},registerPackage("com.slacker.app.modules.implementation.TeslaModule"),com.slacker.app.modules.implementation.TeslaModule=i}()})),bjork("com.slacker.app.modules.implementation.WidgetModule",(function(){!function(){const e=require("com.slacker.event.EventNotifier"),t=require("com.slacker.player.YouTube"),i=require("com.slacker.app.modules.UrlModule"),s=require("com.slacker.app.modules.PubnubModule"),a=require("com.slacker.sads.SAds"),n=require("com.slacker.util.browser.Browser"),o=require("com.slacker.app.view.AbstractView"),r=require("com.slacker.app.actions.LaunchVideoStreamA
1ction");function l(){this.__constants(),this.__properties(),this.__constructor()}l.prototype={__constants:function(){this.EVENTS=new e,this.YT_PLAYER=new t,this.BROWSER_CSS={edge:"/css/browser/edge.css",firefox:"/css/browser/firefox.css"}},__properties:function(){let e=Q_STRING.get("volume")?Q_STRING.get("volume"):0;this.type="embedded",this.localEmbedTest=["lxlsite","floating"],this.isLocalEmbed=!1,this.usesSimpleSettings=!1,this.hasUserInteraction=!1,this.playStartTime=0,this.streamStatus="offline",this.requireNewStatus=!1,this.isChanging=!1,this.isAutomotive=n.isAutomotive(),this.mobileRotateStates={},this.currentVideoData=null,this.displaySadsRefreshInterval=null,this.displaySadsRefreshMinTime=3e4,this.sideTabsSupported=ko.observableArray(),e>0&&(e/=100),this.adtlVideoAnnotations={defaultVolume:e,autoPlay:void 0===Q_STRING.get("autoplay")||"false"!=Q_STRING.get("autoplay"),disablePreroll:!1,disableDisplay:!1,loop:Q_STRING.get("loop")},this.displayAdOverride=ko.pureComputed((function(){const e=APP.embedCampaign(),t=APP.USER.slackerUser();return"slackerandroid"==e||"slackerios"==e||!(!t||!t.policy)&&t.policy.capabilities.features.ad_free.enabled})),this.shopData=ko.observableArray(null),this.festivalSchedule=ko.observable(null),this.socialMessaging=ko.observable(null),this.isFestivalSocialAvailable=ko.observable(!1),this.isFestivalChatAvailable=ko.observable(!1),this.displayContext=ko.observable(Q_STRING.get("context")?.split(",")),this.tabCounterStyle=ko.pureComputed((()=>`size-${this.sideTabsSupported().length}`)).extend({throtle:500}),this.isMinifiedStart=!1},__constructor:function(){window.innerWidth;const e=window.innerHeight,t=window.opener||window.parent;APP.embedCampaign(Q_STRING.get("cid")||document.referrer),APP.slackerAcct(Q_STRING.get("slackeracct")),Q_STRING.get("origin")&&(window.opener||window.parent)&&(APP.postMessageListeners[decodeURIComponent(Q_STRING.get("origin"))]=window.opener||window.parent),APP.useAysl=!1,APP.onUnload=this.onAppUnload,APP.canShowSlackerStationLink=!1,APP.supportsSocialMessaging=!0,APP.supportsClosedCaptions=!0,APP.startHeroVideo=APP.changeStage=this.changeStage.bind(this),APP._onMultiStageTileRender=this._onMultiStageTileRender.bind(this),CONFIG.beaconConfig.formats={page:null,event:null},this.isLocalEmbed=this.localEmbedTest.includes(APP.embedCampaign()),this.isLocalEmbed?t?(t.embedPlayer=APP,CONSOLE=t.CONSOLE,APP.MESSAGING=t.APP.MESSAGING,APP.USER.slackerUser=t.APP.USER.slackerUser,APP.USER.doSlackerLogin=t.APP.USER.doSlackerLogin,CONFIG=JSON.parse(JSON.stringify(t.CONFIG)),CONFIG.beaconConfig.slackerIgnore.events=CONFIG.beaconConfig.slackerIgnore.events.concat(["appStart","loadingComplete","register","login","menu/click"]),CONFIG.beaconConfig.gaConfig.events=["video","video_start","video_progress","video_complete","preroll","midroll","playerSideNav","changeStage","flyout"]):(CONFIG.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003406203003603103003506103003403403003503103003303503003603603003603403003403403003403703003303403003406503003603203003406603003303603003303303003603103003603803003603803003303002203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",CONFIG.beaconConfig.gaConfig.ua="UA-77390823-1",CONFIG.beaconConfig.gaConfig.ga4="G-G319G56MMQ"):(CONFIG.xscid="00_livexliveembed_en_"+APP_VERSION,CONFIG.K="06607506e06307406906f06e02006406506306f06406504607206f06d04806507802807307407202902007b07606107202007307407202002002002003d02002203003406203003603103003506103003403403003503103003303503003603603003603403003403403003403703003303403003406503003603203003406603003303603003303303003603103003603803003603803003303002203b07606107202007206507407507206e05606106c02003d02002202203b07606107202006c06506e02003d02007307407202e06c06506e06707406803b07606107202006306e07406507202
1003d02007307407202e06c06506e06707406802002d02003303b07706806906c06502806c06506e02003e02003002907b06306e07407202003d02002806c06506e02002d02003302902003e03d02003002003f02006c06506e02002d02003302003a02003003b07206507407507206e05606106c02003d02005307407206906e06702e06607206f06d04306806107204306f06406502802203007802202002b02007307407202e07307506207307407206906e06702806306e07407202002c02006c06506e02902902002b02007206507407507206e05606106c03b06c06506e02003d02006306e07407203b07d07206507407507206e02007206507407507206e05606106c03b07d",APP.embedCampaign()&&(CONFIG.xscid+=`_site:${APP.embedCampaign()}`),CONFIG.beaconConfig.client="livexliveembed",CONFIG.dfpSite=CONFIG.dfpSite.replace("site","embed"),CONFIG.beaconConfig.gaConfig.ua="UA-77390823-7",CONFIG.beaconConfig.gaConfig.ga4="G-G319G56MMQ",CONFIG.beaconConfig.gaConfig.events=["video","video_start","video_progress","video_complete","preroll","midroll","playerSideNav","changeStage","flyout"],CONFIG.beaconConfig.gaConfig.dimensions={dimension1:{name:"CampaignId",value:APP.embedCampaign()},dimension2:{name:"QueryString"}}),BEACON.partnerLogging=CONFIG.beaconConfig,BEACON.init();const i=this._onVideoPlayEvent.bind(this),s=APP.herostreamaction.videoplayer;["VIDEOCONTAINERREADY","VIDEOADSTARTED","VIDEOADENDED","DISPLAYERROR","ONFULLSCREENCHANGE"].forEach((e=>{s.attachEvent(s.EVENT[e],i)})),["COMPLETED","RESUME","STARTED","ERROR","MUTE","UNMUTE","TIMEUPDATE"].forEach((e=>{s.attachEvent(s.EVENT.PLAYBACK[e],i)}));try{enquire.register("screen and (max-width : 700px)",(()=>this._responsiveRenderingHelper(null,!0))).register("screen and (min-width : 701px)",(()=>this._responsiveRenderingHelper(null,!0))).register("screen and (min-height : 459px)",(()=>this._responsiveRenderingHelper(null,!0)))}catch(e){}if(window.addEventListener("orientationchange",this.onBlockOrientationChange.bind(this),!0),["USERLOGIN","USERERROR"].forEach((e=>{APP.EVENTS.attachEvent(APP.USER.EVENT[e],this.onUserEvent.bind(this))})),a.events.attachEvent("onAdServerResponse",this.onAdServerResponse.bind(this)),this.isMinifiedStart=e<=460,n.isMsEdge(
1)&&loadCssDynamically(this.BROWSER_CSS.edge,"edge"),n.isFirefox()&&loadCssDynamically(this.BROWSER_CSS.firefox,"firefox"),APP.onImplementationConstructed(this),this.isLocalEmbed)try{APP.USER.simpleSettings=(window.opener||window.parent).APP.USER.simpleSettings}catch(e){}},init:function(){CONSOLE.warn("Initializing LXL Embeddable Widget");const e=$("body"),t=new Date;if(e.removeClass("hero-player-floating").addClass(APP.embedCampaign()),n.isMobileDevice()&&$("body").addClass("mobile"),this.isAutomotive&&($("body").addClass("automotive"),APP.suppressDisplayAds=!0),["#hero-player",".page-loading",".playback-complete",".play-button-container"].forEach((e=>{try{ko.applyBindings(APP,$(e)[0])}catch(t){CONSOLE.warn(["WidgetModule::init","DOM item KO binding failed. Ignoring.",e])}})),"undefined"!=typeof PAGE_BEACON&&PAGE_BEACON?(PAGE_BEACON.event&&BEACON.tagEvent(PAGE_BEACON.event),PAGE_BEACON.page&&BEACON.tagView(PAGE_BEACON.page),PAGE_BEACON=null):BEACON.tagView({name:"embed"}),"undefined"!=typeof SlackerAndroid)try{window.fromMobileWebView=this.onPostMessageReceived.bind(this),SlackerAndroid.storeLxlToken(APP.SERVICE.isCached("refresh_token"))}catch(e){CONSOLE.error("Error storing token with client: ",e)}if(void 0!==window.webkit)try{window.fromMobileWebView=this.onPostMessageReceived.bind(this),window.webkit.messageHandlers.storeLxlToken.postMessage(APP.SERVICE.isCached("refresh_token"))}catch(e){CONSOLE.error("Error storing token with client: ",e)}return appInitTime&&(APP.notifyPostMessageListeners('{"status":"loadingComplete"}'),BEACON.tagEvent({name:"loadingComplete",params:{page:"/",t:t.getTime()-appInitTime}})),this._doEmbedAction(),this.isInitialized=!0,window.addEventListener("message",this.onPostMessageReceived.bind(this),!1),null},goToLxL:function(){const e=this.appImplementationModule?this.appImplementationModule:this,t=window.jsonData||e.currentVideoData;let i=[`${location.protocol}//${location.hostname}/`];CONSOLE.warn("Handling user action to go to LXL site"),i.push(t?.data?.seoName||t.seoName),window.top===window?location.replace(i.join("")):window.open(i.join(""))},onAppUnload:function(){this.isShutdown=!0,APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.stop(),this.appImplementationModule.socialMessaging()&&this.appImplementationModule.socialMessaging().teardown(!0),this.isShutdown||BEACON.tagEvent({name:"appShutdown"})},initSocialMessaging:function(e,t){const i=this.socialMessaging();if(i){const a=i.authKeyString!==t,n=((e,t)=>{if(!e||!e.messageChannels)return!0;if(e.messageChannels.length!==t.length)return!0;const i=e.messageChannels.map((e=>e.name)).sort(),s=t.map((e=>e.name)).sort();return i.join(",")!==s.join(",")})(i,e);(a||n)&&(i.teardown(),new s(e,t,this))}else new s(e,t,this)},onFestivalStatusChange:function(e){const t=APP.herostreamaction.videoplayer,i=$("body.embedded");let s=!1;if(e.from&&e.to&&this.streamStatus!=e.to)switch(this.requireNewStatus=!0,e.to){case"live":case"replay":i.hasClass("complete")&&(this.isChanging=!0,s=!0);break;case"offline":if(this.isChanging=!1,!i.hasClass("complete")){"trailer"==e.to?(this.isChanging=!0,s=!0):(this.streamStatus=e.to,this.partialTeardown=!0);try{t._wasPlayingVideoAd?(this._onVideoPlayEvent({type:APP.herostreamaction.videoplayer.EVENT.PLAYBACK.COMPLETED,player:null}),APP.notifyPostMessageListeners('{"state":"complete","forceClose"
1:true,"video":"'+(t.currentVideoObj.objectId||t.currentVideoObj.festivalId)+'"}')):t.stop()}catch(e){}}}s&&(this.socialMessaging().teardown(),this.refetchCurrentItemData())},onFestivalSocialAvailable:function(e){const t=this.socialMessaging(),i="active"==t?.channelsByType?.chat?.status,s=this.displayContext();let n=this.sideTabsSupported();if(CONSOLE.info(["Setting festivalSocialAvailable for view:",e]),this.isFestivalChatAvailable(i),this.isFestivalSocialAvailable(e),$(".capUnit").each(((e,t)=>{$(t).empty().addClass("lazy"),a.destroyDFPSlots([t.id])})),!e||"live"!=this.streamStatus&&"replay"!=this.streamStatus)t&&t.unsubscribe([t.channelsByType.chat,t.channelsByType.emote]);else{let e=[t.channelsByType.chat,t.channelsByType.emote,t.channelsByType.status];s&&(t.sendWelcomeMsg=!1,APP.suppressDisplayAds=!0,e=s.map((e=>t.channelsByType[e])),e.push(t.channelsByType.status)),t.subscribe(e),i?n.includes("chat")||(this.sideTabsSupported.push("chat"),this.onSidepanelTabClick("chat")):this.onChatRemoved(!0,!0)}n.includes("chat")||this._initSidenavState()},onSocialMessagingUserProfileActive:function(){const e=$(".chat-pannel"),t=$(".capUnit");APP.embedCampaign.valueHasMutated(),APP.suppressDisplayAds?(e.removeClass("with-banner"),t.each(((e,t)=>{$(t).empty().addClass("lazy").addClass("empty"),a.destroyDFPSlots([t.id])}))):this._doCapitalisticThings(!0)},onChatEnabled:function(){const e=this,t=$("#chatbox");$("body").hasClass("chat-open");try{this.socialMessaging().chatMessages([])}catch(e){CONSOLE.warn("Unable to clear chat messages onChatEnabled")}
1n.isMobileDevice()?$(".emoji-send").hide():$(".send-icon").hide(),t.off("keyup"),t.on("keyup",(function(t){const i=$(".chat-pannel .messages"),s=e.socialMessaging();e.toggleEmojiSelector(!1),13==t.which&&this?.value?.trim()&&(t.preventDefault(),s.chatIsLocked()||(s._onUserChatSubmit(this.value),this.value="",s.chatIsLocked(!0),setTimeout((()=>{s.chatIsLocked(!1)}),3e3)),e._doCapitalisticThings(!0),APP.animationFrame.call(window,(()=>{i[0].scrollTop=i[0].scrollHeight})))})),t.off("focus"),t.on("focus",(function(i){const s=APP.USER.slackerUser();if(s&&s.id&&0!=s.actualTier){const e=t[0].value.length;t[0].selectionStart=e,t[0].selectionEnd=e,t[0].focus()}else e.socialMessaging().channelsDataApi=null,APP.MESSAGING.prompt("account-required-to-chat"),t[0].blur()})),t.removeClass("disabled");const i=$(".chat-pannel .messages");APP.animationFrame.call(window,(()=>{i[0].scrollTop=i[0].scrollHeight})),this.onEmoteStatusChange()},onFlyoutMessage:function(e){this.flyoutDismissTimer&&(clearTimeout(this.flyoutDismissTimer),this.flyoutDismissTimer=0),e&&e.duration&&(this.flyoutDismissTimer=setTimeout(this.dismissFlyout.bind(this),1e3*e.duration))},dismissFlyout:function(){let e=null;this.flyoutDismissTimer&&(clearTimeout(this.flyoutDismissTimer),this.flyoutDismissTimer=0);try{e=this.socialMessaging().currentFlyout,e().style="dismiss",e.valueHasMutated(),setTimeout((()=>{e(null),e=null}),200)}catch(e){}"BUTTON"!=arguments?.[1].target.nodeName&&BEACON.tagEvent({name:"flyout",params:{value:"userAction",label:"dismiss"}})},toggleEmojiSelector:function(e){const t=APP.USER.slackerUser(),i=$(".emoji-key-list"),s=$("#chatbox");let a=null;"boolean"==typeof e&&(a=e),null!==a||t&&t.id&&0!=t.actualTier?"boolean"==typeof a?a?i.addClass("active"):i.removeClass("active"):i.toggleClass("active"):APP.MESSAGING.prompt("account-required-to-chat"),i.off("click"),i.hasClass("active")&&i.on("click","B",(e=>{e.preventDefault(),s[0].value+=e.target.innerText;const t=s[0].value.length;s[0].selectionStart=t,s[0].selectionEnd=t,s[0].focus(),this.toggleEmojiSelector(!1)}))},onChatRemoved:function(e,t,i){const s=this.socialMessaging(),n=$("#chatbox"),o=$(".chat-pannel .messages"),r=$(".emoji-key-list");CONSOLE.warn(["onChatRemoved",e,t,i]),e&&(s&&(s.chatMessages([]),s._onUserChatSubmit(i?"Your chat permissions have been revoked.":"Chat is currently not enabled",!0,!0)),t||APP.suppressDisplayAds||($(".capUnit").each(((e,t)=>{$(t).empty().addClass("lazy"),a.destroyDFPSlots([t.id])})),this._doCapitalisticThings(!0))),o.addClass("scrolling"),o.off("scroll"),r.off("click"),n.off("keyup"),n.addClass("disabled")},onEmoteStatusChange:function(){this.socialMessaging.valueHasMutated();try{"active"===this.socialMessaging().channelsByType.emote.status&&this.isFestivalSocialAvailable(!0)}catch(e){}},onChatMessageRecieved:function(e,t){const i=$(".chat-pannel .messages"),s=APP.USER.slackerUser(),a=this.socialMessaging();s?.effectiveTier>0?i.removeClass("anon"):i.addClass("anon"),(t||e?.isHistory)&&i.addClass("scrolling"),t&&(i.off("scroll"),i.on("scroll",$.debounce((function(e){const t=this.scrollTop+this.offsetHeight;this.scrollHeight-t<50?(i.addClass("scrolling"),a.pauseChatUpdate=!1):(i.removeClass("scrolling"),a.pauseChatUpdate=!0)}),50))),a.chatMessages.push(e),i.hasClass("scrolling")&&APP.animationFrame.call(window,(()=>{i[0].scrollTop=i[0].scrollHeight}))},onAntiPiracyRequest:function(){const e=(new Date).getTime(),t=document.querySelector(".ticketHolderData");if(t){const i=["a","b","c","d"],s="block"!=t.style.display?"block":"none";let a=i[Math.floor(4*Math.random())];t.style.display=s,e%3==0&&(a+=" wm"),t.className=`ticketHolderData ${a}`,"block"==s&&setTimeout((()=>t.style.display="none"),1e4),-1==a.indexOf("wm")&&setTimeout((()=>{t.className=`ticketHolderData ${a} go`}),1e3)}},onEndStreamRequest:function(){APP.herostreamaction?.videoplayer?.stop?.()},onSelectEmoticonToggle:function(){const e=this.socialMessaging(),t=$(".mash.selectable");t.length&&(t.toggleClass("open"),t.hasClass("open")&&t.addClass(`size-${e.channelsByType.emote.selectableEmoticons().length}`))},onSelectNewEmoticon:function(e){this.socialMessaging().channelsByType.emote.setCurrentEmoticon(e.index),this.onSelectEmoticonToggle(
1)},onUserHeartAction:function(){this.onHeartMashRecieved(1,!0)},onHeartMashRecieved:function(e,t,i){CONSOLE.debug(["WidgetModule::onHeartMashRecieved",e,i]);let s,a,n=0;const o=this.displayContext(),r=this.socialMessaging().channelsByType.emote,l=$(".heart-mashing-display"),c=this.socialMessaging().channelsByType.emote.currentEmoticon()[0],d='<div class="heart move __animate__ customIcon" style="background-image:url(__IMGURL__)"></div>',u=function(e,t,i){const s=e+parseInt(1e3*Math.random());setTimeout((function(){let e='<svg role="presentation" alt="floating heart" class="heart move __animate__" viewBox="0 0 240 218" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t\t\t\t\t\t\t<g stroke="black" stroke-width="4" fill="none" fill-rule="evenodd">\n\t\t\t\t\t\t\t\t\t\t<path d="M119.981697,218 C-114.115394,88.3818632 55.2196159,-72.7915946 119.981697,35.763431 C184.795464,-72.7915946 354.130474,88.3818632 119.981697,218 Z" id="Fill-1" fill="#FFFFFF"></path>\n\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t</svg>',s=animateFn=Math.floor(6*Math.random())+1,a=o?["","a"][Math.floor(2*Math.random())]:"";animateFn>3&&(animateFn=Math.floor(3*Math.random())+1),animateFn=`${animateFn}${a} color${s}`,t&&(animateFn+=" mine",c&&(i=c.imageUrl)),i&&(e=d.replace("__IMGURL__",i)),APP.animationFrame.call(window,(()=>{l.append(e.replace("__animate__",`ani${animateFn}`))})),setTimeout(function(){APP.animationFrame.call(window,(()=>{let e=this.children()[0];e.parentNode.removeChild(e),e=null}))}.bind(l),3500)}),s)};if(t)e=1,this.socialMessaging().userMashAction(!0);else if(!e)return;s=e,n=t?0:e/5*10;let h=[];
1for(i&&(h=new Array(s),a=s,Object.keys(i).forEach((e=>{let t=Math.floor(Math.max(1,parseInt(s*i[e])));for(;t>0;)t--,a--,h[a]=r.getEmoticonByName(e).imageUrl})));s>0;)s--,u(n+20*s,t,h[s])},onSidepanelTabClick:function(e,t){if(t&&(e=t.currentTarget.getAttribute("data-name")),!e||e!=APP.heroSideNav()){if(APP.heroSideNav(e),"stages"===e)$(".related-content").addClass("active"),$(".side-bar .tab-pane").hide();else $(".related-content").removeClass("active"),APP.heroSideNav()&&$(".side-bar .tab-pane").show(),APP.appImplementationModule._doCapitalisticThings(!0);t&&BEACON.tagEvent({name:"playerSideNav",params:{value:e,label:"tab"}})}},_responsiveRenderingHelper:function(e,t){const i=$(".capUnit"),s=this.currentVideoData,n=-90==window.orientation||90==window.orientation;let o,r=this.socialMessaging();if(!e)return this.responsiveChangeDebounce&&(clearTimeout(this.responsiveChangeDebounce),this.responsiveChangeDebounce=0),void(this.responsiveChangeDebounce=setTimeout((()=>this._responsiveRenderingHelper(!0,t)),200));if(APP.isAppLoaded)if(this.sideTabsSupported([]),!n&&window.innerHeight>459&&(this.isMinifiedStart||t))if(i.each(((e,t)=>{$(t).empty().addClass("lazy").addClass("empty"),a.destroyDFPSlots([t.id])})),this._doCapitalisticThings(!0),this.isFestivalChatAvailable()&&this.sideTabsSupported.push("chat"),this.festivalSchedule()&&this.sideTabsSupported.push("schedule"),this.shopData()&&this.shopData().length&&this.shopData().forEach((()=>{this.sideTabsSupported.push("shop")})),APP.herorelated()&&APP.herorelated().length>0&&this.sideTabsSupported.unshift("related"),this.isMinifiedStart)this.isMinifiedStart=!1,s.data?(o=s.data,this.getPlayerSchedule(this.currentVideoData)):o=s,o._links&&o._links.details&&this.getPlayerRelated(o._links.details.href,APP.herorelated);else{if(window.innerWidth>700&&APP.herorelated()&&APP.herorelated().length>1&&this.sideTabsSupported.shift(),this.isFestivalChatAvailable()){if(this.onSidepanelTabClick("chat"),window.innerWidth<700){const e=$(".chat-pannel .messages");e.hasClass("scrolling")&&APP.animationFrame.call(window,(()=>{e[0].scrollTop=e[0].scrollHeight}))}}else if(this.festivalSchedule())this.onSidepanelTabClick("schedule");else{let e=this.sideTabsSupported().map((e=>"related"==e?"stages":e));"shop"==e[0]&&(e[0]=this.shopData()[0].id),this.onSidepanelTabClick(e[0])}APP.herorelated()&&APP.herorelated().length||(o=s.data?s.data:s,o._links&&o._links.details&&this.getPlayerRelated(o._links.details.href,APP.herorelated))}else APP.heroSideNav(null),APP.appImplementationModule.clearHeroRelated(),r&&r.unsubscribe([r.channelsByType.chat,r.channelsByType.emote]),this.shopData([]),this.sideTabsSupported([])},_doCapitalisticThings:function(e){const t=e?"scroll":a.triggerEvents.REFRESH,i=this.currentVideoData.data||this.currentVideoData;let s=[];APP.suppressDisplayAds||i&&i.monetization&&i.monetization.disableDisplay?$(".capUnit").addClass("empty"):(this.displaySadsRefreshInterval&&(clearTimeout(this.displaySadsRefreshInterval),this.displaySadsRefreshInterval=0),$(".capUnit").each(((e,t)=>{let i,n=t.id,o=$(t),r=o.attr("data-slotsize"),l=a.dfpSizes[r];l=window.innerWidth<701?l.mobile:l.desktop,o.attr("id")||(o.attr("id",generateUniqueID()),n=o.attr("id")),i=a.getDFPConfig().slots[n],i||a.defineDFPSlot(a.getBannerAdUnit(),l,n),s.push(n)})),a.refreshDFPSlots(s,t),this.displaySadsRefreshMinTime&&(this.displaySadsRefreshInterval=setTimeout((()=>this._doCapitalisticThings()),this.displaySadsRefreshMinTime)))},_doEmbedAction:function(){const e=this.displayContext();e&&$("#hero-player").addClass("contextOnly").addClass(e.join(" ")),Q_STRING.get("media")?(tmp=decodeURIComponent(Q_STRING.get("media")),isYT=this.YT_PLAYER.parseYtUrl(tmp),this.onVideoGet({contentUrl:tmp,mimeType:isYT.videoId?"video/youtube":null,source:isYT.videoId?"youtube":"lxl",objectId:(new Date).getTime()+""},200,{})):window.jsonData?this.onVideoGet(window.jsonData):this._onVideoPlayEvent({type:APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR,player:null})},_initSidenavState:function(){window.innerWidth<701?APP.herorelated()?this.onSidepanelTabClick("stages"):this.festivalSchedule()?this.onSidepanelTabClick("schedule"):this.shopData()&&this.shopData().length?this.onSidepanelTabClick(this.shopData()[0].id):this.onSidepanelTabClick(null):this.festivalSchedule()?this.onSidepanelTabClick("schedule"):this.shopData()&&this.shopData().length&&this.onSidepanelTabClick(this.shopData()[0].id)},onPostMessageReceived:function(e){const t=Q_STRING.get("origin")?decode
1URIComponent(Q_STRING.get("origin")):APP.SERVICE.URLMODULE.get(APP.SERVICE.URLMODULE.SERVICE.DATA.ROOT).split("//")[1],i=APP.herostreamaction.videoplayer,s=this.socialMessaging(),a=s&&s.pubNubUser();let n;if(e.origin.indexOf(t)>-1){CONSOLE.info(["PostMessage Received: ",e.origin,e.data]);try{n=JSON.parse(e.data)}catch(e){n={}}switch(n.command){case"register":APP.postMessageListeners[e.origin]=e.source,APP.notifyPostMessageListeners('{"registration":"complete"}');break;case"unregister":APP.notifyPostMessageListeners('{"registration":"unregistered"}'),delete APP.postMessageListeners[e.origin];break;case"mute":i.mute();break;case"volume":void 0!==n.value&&(0==Number(n.value)?i.mute():i.setVolume(parseFloat(n.value)));break;case"restart":$("body.embedded").removeClass("complete").removeClass("showPlayButton"),i.player?i.restart():this._doEmbedAction();break;case"pause":i.pause();break;case"resume":$("body.embedded").removeClass("complete"),i.player?i.resume():this._doEmbedAction();break;case"stop":i.stop();break;case"profile":a&&n.value&&(n.value.isExternalUpdate=!0,s._onUserProfileUpdate(n.value))}}},onUserEvent:function(e,t){CONSOLE.debug(["WidgetModule.onUserEvent",e]);var i=APP.USER.EVENT;switch(e){case i.USERERROR:this.isInitialized||this.init();break;case i.USERLOGIN:this.socialMessaging()&&APP.USER.slackerUser().username&&this.socialMessaging()._onSlackerUserCreated()}},onVideoGet:function(e,t,i){if(this.sideTabsSupported([]),this.shopData([]),this.festivalSchedule(null),this.currentVideoData=e,e.data&&(this.isMinifiedStart||this.getPlayerSchedule(this.currentVideoData),e=e.data),e?.rights?.permissions&&(new o).setPaywallObservables(e),e.streamStatus){if(this.requireNewStatus&&this.streamStatus==e.streamStatus)return CONSOLE.warn("Data refresh requires status change, but got same status from server..."),void this.refetchCurrentItemData();this.streamStatus=e.streamStatus,this.requireNewStatus=!1}this.isLocalEmbed||APP.checkPaywallVideo(e,!1,(()=>this.onVideoGet(e,t,i)))||(CONSOLE.warn("User lacks permissions or no user hydrated yet."),!APP.USER.slackerUser().policy||this.isLocalEmbed)?e?.contentUrl?(e.mimeType||(e.mimeType="application/x-mpegURL"),this.onBeforeHeroVideoStart(e)):e&&!e.contentUrl&&(this._onVideoPlayEvent({type:APP.herostreamaction.videoplayer.EVENT.PLAYBACK.ERROR,video:e}),e.messageChannels&&this.initSocialMessaging(e.messageChannels,e.festivalId),e.isPaywallVideo()&&APP.USER.slackerUser().policy&&setTimeout((e=>APP.MESSAGING.prompt("modalPageMessage",{reason:"This item has not yet started or is no longer available"})),1e3)):APP.doEmbedRefreshOnUserChange=()=>this.onVideoGet.bind(this)(e,t,i)},refetchCurrentItemData:function(){const e=$("body");this.clearHeroRelated(),this.sideTabsSupported([]),window?.jsonData?._links?.self&&(e.removeClass("loaded"),e.addClass("loading"),setTimeout((()=>{CONSOLE.warn("Refreshing data from server"),APP.NETWORKING.do(i.get(window.jsonData._links.self.href,{linktype:"templated"}),((e,t,i)=>{this.onVideoGet(e,t,i)}),"GET")}),5e3))},doPlayFromBigButton:function(){let e=APP.herostreamaction.currentVideo();APP.herostreamaction.playStream($("#hero-player #hero-video-container")[0],e)},onBeforeHeroVideoStart:function(e){CONSOLE.debug(["WidgetModule.onBeforeHeroVideoStart"]);const t=$("body"),i=APP.embedCampaign(),s=Q_STRING.get("disablePreroll"),a=Q_STRING.get("origin"),n=this.displayContext();let o=this.isChanging,r=null;if(t.hasClass("loading")&&(t.addClass("loaded"),t.removeClass("loading")),n&&!n.includes("video"))return e.posterImgUrl&&n.includes("bg")&&$("body.embedded").css("background-image",`url("${e.posterImgUrl}")`),void(e._links&&e._links.details&&this.getPlayerRelated(e._links.details.href,APP.herorelated,o));i?.toLowerCase().indexOf("srax")>-1&&(this.adtlVideoAnnotations.disablePreroll=!0),this.adtlVideoAnnotations&&Object.keys(this.adtlVideoAnnotations).forEach((t=>e[t]=this.adtlVideoAnnotations[t])),s&&"true"===s&&a?.match(/live(xlive|one)\.com/)&&(e.disablePreroll=s),APP.herostreamaction.isVideoPlayerActive()&&APP.herostreamaction.videoplayer.stop(),0!=e.defaultVolume&&e.autoPlay||(r=e.posterImgUrl,e.posterImgUrl=`${IMG_CDN_AND_BUILD}/images/pixel.gif`),APP.herostreamaction.currentVideo(e),e.autoPlay?setTimeout((()=>{APP.herostreamaction.playStream($("#hero-player #hero-video-container")[0],e),e._links&&e._links.details&&this.getPlayerRelated(e._links.details.href,APP.herorelated,o)}),200):($("body.embedded").css("background-image",`url("${r}")`),$("body.embedded").addClass("showPlayButton")),r&&APP.herostreamaction.videoplayer.currentVideoObj&&setTimeout((()=>{APP.herostreamaction.videoplayer.currentVideoObj.posterImgUrl=r}),200)},getPlayerSchedule:function(e){const t=this._processFestivalScheduleForOverlay(e);t.length&&(this.sideTabsSupported.push("schedule"),this.festivalSchedule(t))},getPlayerRelated:function(e,t,s){APP.NETWORKING.do(i.get(e,{linktype:"templated"}),((i,a,n)=>{if(i){if(window.innerHeight<=460&&!this.isMinifiedStart)return this.shopData([]),void this.sideTabsSupported([]);if(i?._embedded?.content?.length){let e=this.sideTabsSupported();e.length&&(this.shopData([]),e=e.filter((e=>-1==e.indexOf("shop"))),this.sideTabsSupported(e)),i._embedded.content.forEach(((e,i)=>{e.subTypes&&(e.subTypes.includes("video")&&!APP.herostreamaction.queue&&e._embedded&&e._embedded.content&&e._embedded.content.length&&APP.herostreamaction.setQueue(e._embedded.content),this.isMinifiedStart||(e.subTypes.includes("stages")&&(s?window.innerWidth<701&&this.sideTabsSupported.unshift("related"):t(this.processMultiStageData(e))),e._embedded&&e._embedded.content&&e._embedded.content.length&&(e._embedded.content.shopIconStyle=ko.observable(null)),e.icon&&e._embedded.content.shopIconStyle(e.icon.imageUrl),e.subTypes.includes("store")&&e._embedded&&e._embedded.content&&e._embedded.content.length&&(e._embedded.content.map((e=>(["name","price","storeUrl","description","imgUrl"].forEach((t=>{e[t]||(e[t]=null,"imgUrl"===t&&(e[t]=`${IMG_CDN_AND_BUILD}/images/pixel.gif`))})),e))),e._embedded.content.title=e.title,e._embedded.content.id=`shop-${i}`,e.icon||"tickets"!=e.title.toLowerCase()||e._embedded.content.shopIconStyle("ticketing"),this.sideTabsSupported.push(e._embedded.content.id),this.shopData.push(e._embedded.content))))}))}this.isMinifiedStart||(i?.data?.messageChannels?this.initSocialMessaging(i.data.messageChannels,i.data.festivalId):this._initSidenavState())}else CONSOLE.warn("No content for player related: "+e)}),"GET")},doShopAction:function(e){if(e?.storeUrl){window.open(e.storeUrl),BEACON.tagEvent({name:"playerSideNav",params:{value:"shop",label:e.storeUrl}});try{e.location="playerSideNav",parent.APP.EVENTS.dispatch({type:"tile-click",payload:{obj:e}})}catch(e){}}},doFlyoutAction:function(e){e?.clickthroughUrl&&(0==e.clickthroughUrl.indexOf("slacker://")?APP.handleSlackerProtocolLink(e.clickthroughUrl,"flyout"):window.open(e.clickthroughUrl),BEACON.tagEvent({name:"flyout",params:{value:"userAction",label:"click"}})),this.dismissFlyout()},processMultiStageData:function(e){let t=null;if(e?._embedded){t=(e._embedded.liveList||e._embedded.content||[]).map((e=>("function"==typeof e&&(e=e()),e.id||(e.id=generateUniqueID()),e.objectId||(e.objectId=e.id),e.uiItemId||(e.uiItemId=e.id),e.active=ko.observable(!1),APP.herostreamaction.currentVideo()&&e.active(APP.herostreamaction.currentVideo().seoName==e.seoName),e)))}return t.length&&(t.title&&(t.title=t.title[0].toUpperCase()+t.title.slice(1)),APP.herostreamaction.currentVideo()||t[0].active(!0),window.innerWidth<701&&this.sideTabsSupported.unshift("related")),t},changeStage:function(e,t){const s=$(t.currentTarget).parent().parent(),a=new o;e.active()||($("body").removeClass("complete"),$(".related-content").removeClass("hover"),s&&s.removeClass("offline"),e._links.details?APP.NETWORKING.do(i.get(e._links.details.href,{linktype:"templated"}),((i,n,o)=>
1{if(!i)return void CONSOLE.warn("No content for selected stage: "+e._links.details.href);let r=i.data?i.data:i;if(r){let l=this.socialMessaging();a.setPaywallObservables(r),r.rights&&r.rights.permissions&&r.isPaywallVideo(r.rights.permissions.ondemand),APP.checkPaywallVideo(r,!1,(()=>this.changeStage(e,t)))?r.contentUrl?(CONSOLE.info("Selected stage online. Load new content in player."),this.sideTabsSupported([]),this.isFestivalSocialAvailable(!1),l&&(this.socialMessaging(null),l.teardown(!0)),BEACON.tagEvent({name:"changeStage",params:{value:e.objectId,label:"tile"}}),this.isChanging=!0,APP.notifyPostMessageListeners('{"state":"changing"}'),this.onVideoGet(i,n,o),APP.herorelated().map((t=>{t.active(e.id==t.id)}))):(CONSOLE.info("Selected stage appears to be offline."),s&&s.addClass("offline")):CONSOLE.warn("Attempt to CHANGE stage to ticketed event and user has no ticket")}}),"GET"):CONSOLE.warn("Selected stage has no details link!"))},onBlockOrientationChange:function(e){const t=-90==window.orientation||90==window.orientation;"boolean"!=typeof e&&(e=null),!e&&t&&(this.didOrientationChange=!0,this.mobileRotateStates={sideNav:APP.heroSideNav(),related:APP.herorelated()},APP.heroSideNav(null),this.clearHeroRelated()),!e&&t||(this.isMinifiedStart=!0,APP.heroSideNav(this.mobileRotateStates.sideNav),APP.herorelated(this.mobileRotateStates.related)),this._responsiveRenderingHelper(!0)},onAdServerResponse:function(e,t,i,s){if("adblock"===t)return CONSOLE.warn(["WidgetModule:: onAdServerResponse - adblock"]),void a.shouldShowShowAdBlockNag();if(e.container){const t=$("#"+e.container.id),a=$(".chat-pannel .messages");i?(CONSOLE.debug(["WidgetModule:: onAdServerResponse - GPT SlotRenderEnded - EMPTY AD",e.container.getAttribute("data-slotsize")]),t.removeClass("h50").removeClass("h90").removeClass("h96").removeClass("h250").removeClass("h280").removeClass("h600").removeClass("h1050").addClass("empty"),t.hasClass("festivalChat")&&$(".hero .chat-pannel").removeClass("with-banner")):(CONSOLE.debug(["WidgetModule:: onAdServerResponse - GPT SlotRenderEnded - FILLED",s.size]),t.removeClass("h50").removeClass("h90").removeClass("h96").removeClass("h250").removeClass("h280").removeClass("h600").removeClass("h1050").removeClass("empty").addClass("h"+s.size[1]),t.hasClass("festivalChat")&&$(".hero .chat-pannel").addClass("with-banner")),APP.animationFrame.call(window,(()=>{a[0]&&(a[0].scrollTop=a[0].scrollHeight)})),e.container.getAttribute("data-slotsize")}},clearHeroRelated:function(){$(".related-content").find(".button.play").off("mouseenter").off("mouseleave"),APP.herorelated([])},_onMultiStageTileRender:function(e,t){n.isMobileDevice()||$(e[1]).find(".button.play").on("mouseenter",function(){const e=$(arguments[0].currentTarget).parent();clearTimeout(this.previewDelay),this.previewDelay=0,this.previewDelay=setTimeout((()=>{const t=this,s=APP.appImplementationModule,a=e.parent();!a.hasClass("preview")&&!a.hasClass("active")&&t._links&&t._links.details&&(a.addClass("preview"),APP.NETWORKING.do(i.get(t._links.details.href,{linktype:"templated"}),(function(i,n,l){if(!t.previewDelay||s.isChanging)return;let c=i&&i.data?i.data:i,d=APP.appImplementationModule._processFestivalScheduleForOverlay(i),u=new o;c.contentUrl?(d.length?a[0].title=d[0].name:a[0].title="",u.setPaywallObservables(c),c.type="in-place",c.disablePreroll=!0,c.disableAds=!0,c.disableping=!0,c.preview=!0,c.defaultVolume=0,c.autoPlay=!0,c.rights&&c.rights.permissions&&c.isPaywallVideo(c.rights.permissions.ondemand),APP.checkPaywallVideo(c,!1,null,!0)?(APP.stagePreview=new r("preview"),APP.stagePreview.playStream(e.find(".overlay")[0],c)):CONSOLE.warn("Attempt to PREVIEW stage to ticketed event and user has no ticket")):(t.contentUrl=null,a.addClass("offline"))})))}),200)}.bind(t)).on("mouseleave",function(){const e=$(arguments[0].currentTarget).parent().parent(),t=e.find(".vjs-tech")[0];clearTimeout(this.previewDelay),this.previewDelay=0,e.removeClass("preview").removeClass("offline"),e.find(".video-js").removeClass("video-js").empty(),e[0].title="",videojs.getAllPlayers().forEac
1h((e=>{try{e.tech_.el_.id==t.id&&e.dispose()}catch(e){}}))}.bind(t))},_processFestivalScheduleForOverlay:function(e){const t=new Date;let s,a,n=[];if(this.reloadFestivalSchedule&&(clearTimeout(this.reloadFestivalSchedule),this.reloadFestivalSchedule=0),(e._embedded?e._embedded.contentSectionList||e._embedded.content:[]).forEach((e=>{let i={date:null,header:"",name:null,isLive:!1,type:"dayHeader",acts:[]};e.subTypes&&(s=e.subTypes.join(" "),a=s.indexOf("schedule")>-1?e._embedded.genericTypedResourceList||e._embedded.content:null,a?.length&&a.forEach(((e,s)=>{const a=new Date(e.date);a!=i.date&&(i.acts.length&&(0==n.length&&(i.isLive=!0),n.push(Object.assign({},i))),i.date=a,i.isLive=!1,i.header=`${e.day} ${e.date}`,i.acts=[],CONSOLE.debug(["ADDING player overlay day section",i.header])),e._embedded.content.forEach(((s,a)=>{const n=e._embedded.content[a+1];s.performanceTime=[],s.performanceTime[0]=new Date(s.startTime),s.performanceTime[0].getDay(),i.date.getDay(),n?n.startTime?s.performanceTime[1]=new Date(n.startTime):s.performanceTime[1]=new Date(`${e.date} ${n.time} ${s.timeZone}`):s.performanceTime[1]=new Date(s.performanceTime[0].getTime()+36e5),s.artistId||(s.artistId=null),t<s.performanceTime[1]?(s.isLive=s.performanceTime[0]<=t&&t<s.performanceTime[1],i.acts.push(s),CONSOLE.debug(["ADDING player overlay schedule item",s.name,e.date,s.time])):CONSOLE.debug(["IGNORING schedule item for overlay",s.name,e.date,s.time])}))})),i.acts.length&&(0==n.length&&(i.isLive=!0),n.push(Object.assign({},i))))})),n.length&&n?.[0].acts[1]){const t=(new Date).getTime(),s=864e4;let a=n[0].acts[0].isLive?n[0].acts[1].performanceTime[0]-t:n[0].acts[0].performanceTime[0]-t;a>s&&(a=s),CONSOLE.warn(["Setting schedule reload for",new Date(t+a)]),this.reloadFestivalSchedule=setTimeout((function(){const t=e._links.details||e._links.self;let s;t?APP.NETWORKING.do(i.get(t.href,{linktype:"templated"}),(function(e,t,i){if(APP.appImplementationModule.festivalSchedule(null),e){const t=APP.appImplementationModule._processFestivalScheduleForOverlay(e);t.length&&APP.appImplementationModule.festivalSchedule(t)}})):(s=APP.appImplementationModule._processFestivalScheduleForOverlay(e),s.length||(s=null),APP.appImplementationModule.festivalSchedule&&APP.appImplementationModule.festivalSchedule(s))}),a+10)}return n},_onVideoPlayEvent:function(e){CONSOLE.debug("WidgetModule._onVideoPlayEvent::"+e.type+"::"+e.player);const t=APP.herostreamaction.videoplayer.EVENT,i=this.socialMessaging();switch(e.type){case t.VIDEOCONTAINERREADY:this.isChanging=!1,$("body.embedded").removeClass("loading").removeClass("showPlayButton").addClass("loaded");break;case t.VIDEOADSTARTED:APP.notifyPostMessageListeners(`{"state":"changing","video":"${e.video.videoId||e.video.festivalId}"}`),this.isChanging=!0,$("body.embedded").removeClass("complete").addClass("vjs-ad-playing");break;case t.VIDEOADENDED:$("body.embedded").removeClass("vjs-ad-playing");break;case t.PLAYBACK.MUTE:this.adtlVideoAnnotations.defaultVolume=0;break;case t.PLAYBACK.UNMUTE:this.adtlVideoAnnotations.defaultVolume=void 0;break;case t.PLAYBACK.STARTED:if($("body.embedded").removeClass("complete").removeClass("showPlayButton").removeClass("vjs-ad-playing").removeClass("loading").addClass("loaded"),$(".ima-ad-container").hide(),this.playStartTime=(new Date).getTime(),Q_STRING.get("disablePreroll")&&(delete Q_STRING.hash.disablePreroll,e.video&&(e.video.disablePreroll=!1)),"mediaSession"in navigator&&e.video){let t={title:e.video.title||"",artist:e.video.subtitle||"",album:"",artwork:[]};e.video.posterImgUrl&&(t.artwork=[{src:e.video.posterImgUrl,sizes:"384x384",type:"image/jpg"}]),navigator.mediaSession.metadata=new MediaMetadata(t)}break;case t.PLAYBACK.TIMEUPDATE:APP.notifyPostMessageListeners(`{"state":"timeupdate","video": "${e.video.videoId||e.video.festivalId}}","data": ${JSON.stringify(e.data)}}`);break;case t.PLAYBACK.RESUME:$("body.embedded").removeClass("complete").removeClass("vjs-ad-playing"),this._doCapitalisticThings(!0);break;case t.PLAYBACK.COMPLETED:if(this.isChanging)return $("body.embedded").removeClass("loaded").addClass("loading"),APP.heroSideNav(null),void(i&&(this.partialTeardown?(this.partialTeardown=!1,i.unsubscribe([sm.channelsByType.chat,sm.channelsByType.emote])):(this.isFestivalSocialAvailable(!1),i.teardown())));case t.PLAYBACK.ERROR:let s=null;const a="too_many_devices"==e.error?"modalError":"modalErrorFree",n=this.isLocalEmbed?[{label:"OK",styles:"std",action:()=>{const e=window.opener||window.parent||window;i&&i.teardown(),e.APP.MESSAGING.setModal(),e.APP.closeEmbedHeroPlayer()}}]:null;if(i&&(this.partialTeardown?(this.partialTeardown=!1,i.unsubscribe([i.channelsByType.chat,i.channelsByType.emote])):i.teardown()),t.PLAYBACK.COMPLETED==e.type&&APP.herostreamaction.queue&&APP.herostreamaction.queuePos<APP.herostreamaction.queue.length?$("body.embedded").removeClass("loaded").addClass("loading"):$("body.embedded").addClass("complete").removeClass("loading").addClass("loaded"),e.video&&e.video.featureImgUrl?s=e.video.featureImgUrl:this.currentVideoData&&(s=this.currentVideoData.featureImgUrl||this.currentVideoData.posterImgUrl),s?$("body.embedded").css("background-image",`url("${s}")`):$("body.embedded").css({"background-image":`url("${IMG_CDN_AND_BUILD}/images/logos/lxl-logo-splash.png")`,"background-size":"90%"}),this.isLocalEmbed)if(e.video&&e.video.messages)for(let t in e.video.messages){APP.MESSAGING.prompt(a,{reason:e.video.messages[t],disableClose:!0},n);break}else"no_ticket"==e.error&&APP.MESSAGING.prompt("accessNotAllowed",{disableClose:!0},n);APP.heroSideNav(null),APP.herorelated([]);break;case t.ONFULLSCREENCHANGE:e.player&&(e.player.isFullscreen_?i&&i.unsubscribe([sm.channelsByType.chat,sm.channelsByType.emote]):i&&i.subscribe([sm.channelsByType.chat,sm.channelsByType.emote]))}},onSlackerServiceAPI:function(e){const t=APP.SERVICE.isCached("slackerUser");e&&(APP.USER.slackerUser()&&APP.USER.slackerUser().id?APP.USER.slackerUser().token||APP.USER.getSlackerToken():t?APP.USER.onSlackerLoginUpdate(null,"autologin",JSON.parse(t)):APP.USER.doSlackerAnon())}},registerPackage("com.slacker.app.modules.implementation.WidgetModule"),com.slacker.app.modules.implementation.WidgetModule=l}()})),$(document).ready((function(){if(window.PHASH=require("com.slacker.util.ParamHash"),window.CONSOLE=require("com.slacker.util.Console"),window.BEACON=require("com.slacker.util.behavior.Beacon"),window.CFG_MODULE=require("com.slacker.app.modules.ConfigurationModule"),window.Q_STRING=new PHASH(location.search.substring(1),"&","="),window.CONFIG=new CFG_MODULE,"dev"===APP_ENV||Q_STRING.get("debug")?(CONSOLE.setLogLevel("debug"),CONSOLE.setScrollBack(3e3)):(CONSOLE.setLogLevel("info"),CONSOLE.setScrollBack(1e3)),window.CONFIG.allowEmbedShare=Q_STRING.get("embedShare"),BEACON.partnerLogging=CONFIG.beaconConfig,BEACON.init(),ko.options.deferUpdates=!0,window.APP=require("com.slacker.app.modules.AppModule"),window.APP_OVERRIDES)for(var e in window.APP_OVERRIDES)window.APP[e]=window.APP_OVERRIDES[e];window.APP.init(),window.Toasts={getInstance:function(){return{showToast:function(e){if("createAccount"===e)APP.USER.doSlackerLogin()}}}},window.popUpgradeModal=function(e,t,i,s){APP.onRequestUpgrade(i,e,s)},window.openCreateAccountWindow=function(){APP.USER.doSlackerLogin()},window.popRendevousPairing=function(e){APP.USER.doSlackerLogin(`${APP.SERVICE.urls.SLACKER.LOGIN}?done=${e}`,null,!0)},window.APP.getItemById=function(e,t,i){APP.goToPage("slackeritemdetail",{type:e,title:i,seoName:"",id:t})},window.APP_EVENTS={notify:function(e,t){if("onChangeStationRequest"===e)APP.slackerPlayerSession().startRadioStation(t[0])}},window.WS={beacon:BEACON._doBeaconUrl}})),function(){const MenuAction=require("com.slacker.app.actions.MenuAction"),NewsletterSignupAction=require("com.slacker.app.actions.NewsletterSignupAction"),PubnubModule=require("com.slacker.app.modules.PubnubModule"),Browser=require("com.slacker.util.browser.Browser"),SADS=require("com.slacker.sads.SAds"),SlackerBaseStationCacheAction=require("com.slacker.app.actions.slacker.radio.SlackerBaseStationCacheAction"),ShareOptions=require("com.slacker.app.actions.slacker.options.StationOptionsAction");let AbstractViewBuilder=null;function AbstractView(e){this.__constants(),this.__properties(),this.__constructor(e)}if(AbstractView.prototype={__constants:function(){this.SCROLL_DEBOUNCE_DELAY=50,this.AD_FILL_TIMEOUT=4e3,this.AD_FILL_RETRIES=3,this.SLACKER_TILE_SIZE="360x360",this.SLACKER_ARTIST_TILE_SIZE="275x275",this.SLACKER_DETAIL_HEADER_SIZE="500x500",this.SLACKER_ARTIST_TILE_IMG_FMT="/web/3/top/5,0/"+this.SLACKER_ARTIST_TILE_SIZE+".jpg",this.SLACKER_TILE_IMG_FMT="/web/3/fill/5,0/"+this.SLACKER_TILE_SIZE+".jpg",this.SLACKER_DETAIL_IMG_FMT="/web/3/fill/5,0/"+this.SLACKER_DETAIL_HEADER_SIZE+".jpg",this.SLACKER_SPOTLIGHT_IMG_FMT="/web/3/fit/5,0/1900x800.jpg"},__properties:function(){const e=this;this.type="",this.domContainerId="",this.link="",this.beaconName="",this.dataSource=null,this.bodyStyle=null,this.dataReset=[],this.adSlots=[],this.__guid=generateUniqueID(),this.data=ko.observable(),this.isEditDirty=ko.observable(!1),this.isTicketWaitingRoomActive=ko.observable(!1),this.slidesInitialized=!1,this.forceDirection=null,this.debugDump=t=>{let i=this.data(),s=t&&new e._abstractSection("DEBUG",t),a=!1;i||(i=[]),i?.[0]?.classNames.indexOf("debug")>-1&&(i.shift(),a=!0),(t||a)&&(s&&(s.classNames+=" debug",i.unshift(s)),e.data(i))},this.active=ko.observable(!1),this.socialMessaging=null,this.isFestivalSocialAvailable=ko.observable(!1),this.bookmarkAction=null,this.lastFocusedItem=null,this.heroPlayer=null,this.isBound=!1,this.isFetchingData=!1,this.refreshDataOnActive=!1,this.dataOnly=!1,this.callback=null,this.lastScrollPos=0,this.pagingData=ko.observable(null),this.linksData=ko.observable(null),this.classNames=ko.observable(""),this.showLoader=ko.observable(!1),this.isMobileDevice=Browser.isMobileDevice.bind(Browser),this.hasMobileApp=ko.computed((function(){return!APP.canNavigate()||APP.downloadApps.getMobileAppDownloadPackage()})),this.share=function(e,t,i){const s=e&&e.seoName?e.seoName:APP.currentView.historyData.seoName;(new ShareOptions).getShareOptions(s,t,i)},this.historyData={seoName:"",title:"",guid:this.__guid}},__constructor:function(e){const t=this;this.SLACKER_SPOTLIGHT_IMG_FMT="tv"==APP.implementationSuperType()?"/web/3/fill/5,0/1280x720.jpg":"/web/3/fit/center/5,0/1900x800.jpg","tv"==APP.implementationSuperType()&&(this.SCROLL_DEBOUNCE_DELAY=1e3),e&&(this.t
1ype=e,this.domContainerId=`#${e}`),"undefined"!=typeof jsonData&&jsonData&&(this.addSectionTabIndices(jsonData),jsonData=null),this.slotRenderingHelper={ids:[],viewRef:t.type,maxLeaderWidth:760,minBillboardWidth:970,minChatPanelWidth:800,minSkyscraperWidth:1197,enquireOnQuerySlotChange:{deferSetup:!1,match:function(){const e=this.data(),t=$(".hamburger input")[0];this.active()&&($(".capUnit:not(.lazy)").addClass("lazy"),this._doCapitalisticThings(!0),"function"==typeof e?.forEach&&e.forEach((e=>{this.sectionRenderingHelpers(null,e)})),t&&t.checked&&t.click())}.bind(this),unmatch:function(){const e=this.data(),t=$(".hamburger input")[0];this.active()&&($(".capUnit:not(.lazy)").addClass("lazy"),this._doCapitalisticThings(!0),e&&e.length&&"string"!=typeof e&&e.forEach((e=>{this.sectionRenderingHelpers(null,e)})),t&&t.checked&&t.click())}.bind(this)},getDFPSmartSlotSize:function(e){var i=[];if(SADS.dfpSizes[e])switch(e){case"billboard":i=window.innerWidth<t.slotRenderingHelper.maxLeaderWidth?SADS.dfpSizes.billboard.mobile:window.innerWidth<t.slotRenderingHelper.minBillboardWidth?SADS.dfpSizes.leaderboard.desktop.small:SADS.dfpSizes.billboard.desktop;break;case"leaderboard":i=window.innerWidth<t.slotRenderingHelper.maxLeaderWidth?SADS.dfpSizes.leaderboard.mobile:window.innerWidth<t.slotRenderingHelper.minBillboardWidth?SADS.dfpSizes.leaderboard.desktop.small:SADS.dfpSizes.leaderboard.desktop.wide;break;case"skyscraper":i=window.innerWidth<t.slotRenderingHelper.minSkyscraperWidth?SADS.dfpSizes.medrect:SADS.dfpSizes.skyscraper;break;case"festivalChat":i=SADS.dfpSizes[e],i=window.innerWidth<t.slotRenderingHelper.minChatPanelWidth?i.mobile:i.desktop;break;default:(i=SADS.dfpSizes[e]).mobile&&window.innerWidth<t.slotRenderingHelper.maxLeaderWidth?i=i.mobile:i.desktop&&(i=i.desktop)}return i},renderAudioCompanions:function(e,t){const i=this,s=com.slacker.sads.SAds.getDFPConfig(),a=APP.USER.slackerUser().policy.capabilities.features,n=APP.slackerPlayerSession();if(e.companion&&(e.companion.leaderboard||e.companion.medrect))t||$(APP.currentView.domContainerId+" .capUnit:not(.lazy), #radio-player .capUnit").each(function(e,t){const s=i.getDFPSmartSlotSize(t.getAttribute("data-slotsize")),a=SADS.getDFPConfig().slots[t.id];SADS.__dfpEventListner.slotRenderEnded.apply(com.slacker.sads.SAds,[{isCompanionAction:!0,isEmpty:!0,slot:a||{},size:s[0]}])}.bind(this)),Object.keys(e.companion).filter((e=>!t||e==t)).forEach((t=>{const i=e.companion[t];CONSOLE.debug(["Checking for visible slots for companion type ",t,[i.width,i.height]]),Object.keys(s.slots).forEach((e=>{let a=s.slots[e];const n=$(a.container);if(n.hasClass("lazy"))CONSOLE.debug(["Container out of view ",a.id]),a=null;else if(300==i.width&&a.maxWidth>300)CONSOLE.debug(["Container not proper size for request ",i.width,a.maxWidth]),a=null;else if(i.width<=a.maxWidth&&i.height<=a.maxHeight)switch(CONSOLE.debug(["Container in view and companion fits",a.id]),i.type){case"html":case"iframe":n.html(i.data);break;default:const e=$("<img/>").attr({src:i.data,width:i.width,height:i.height,alt:i.altText,class:i.click?"link":""});i.click&&e.on("click",i.click),n.html(e),i.impTracking.forEach((e=>com.slacker.util.behavior.Beacon._doBeaconUrl(e)))}else a=null;a&&(CONSOLE.debug(["Rendering companion",t,a.id]),SADS.__dfpEventListner.slotRenderEnded.apply(com.slacker.sads.SAds,[{isCompanionAction:!0,slot:Object.assign({},a),size:[i.width,i.height]}]))}))}));else if(!("ad"==e.type||a&&a.ad_free&&a.ad_free.enabled)){const e=$(".playlist-drawer"),t=$(".topmost.capUnit:not(:hidden)");let s=!0;APP.suppressDisplayAds||(n.playerSize==n.PLAYER_FULL?e.hasClass("active")?$(".playlist-drawer .capUnit").each((function(e,t){$(t).empty().addClass("lazy"),SADS.destroyDFPSlots([t.id])})):("web"!==APP.implementationSuperType()&&n.togglePlaylistDrawer(),s=!1):(!t[0]||t.hasClass("lazy")&&!t.hasClass("empty")||(t.show(),i.ids.push(t[0].id)),$(APP.currentView.domContainerId+" .capUnit:not(.lazy)").each((function(e,t){$(t).empty().addClass("lazy"),SADS.destroyDFPSlots([t.id])})))),s&&setTimeout((function(){APP.currentView._doCapitalisticThings(!1,n.nextRadioTrackAction?n.nextRadioTrackAction.adTriggerReason:null)}),200)}},prepareVisibleSlots:function(){let e={refresh:[],render:[]};for(CONSOLE.debug("Preparing visible GPT slots.");this.ids.length;){const t=this.ids.shift(),i=$(`#${t}`),s=SADS.getDFPConfig().slots[t],a=i.attr("data-slotsize"),n=this.getDFPSmartSlotSize(a);now=(new Date).getTime(),lockout=15e3,i.hasClass("lazy")||i.is(":hidden")||(s?s.containerSize!=n&&"fluid"!=n?(CONSOLE.warn(["AdSlot size no longer appropriate for view. Changing size [",s.containerSize.join("|"),"] -> [",n.join("|"),"]"]),i.removeClass("h90").removeClass("h250").addClass("empty"),SADS.destroyDFPSlots([t]),SADS.defineDFPSlot(SADS.getBannerAdUnit(),n,t),e.render.push(t)):now-s.lastUse>lockout?e.refresh.push(t):CONSOLE.warn(["AdSlot refreshed to recently. Skipping",t]):(SADS.defineDFPSlot(SADS.getBannerAdUnit(),n,t),e.render.push(t)))}return e}},AbstractViewBuilder||(AbstractViewBuilder=this)},initSocialMessaging:function(e,t){APP.supportsSocialMessaging&&new PubnubModule(e,t,this)},socialMessaging:function(e){this._socialMessaging=e,e&&(this._socialMessaging.viewListeners.push(APP.EVENTS.attachEvent(APP.USER.EVENT.USERLOGIN,(()=>{this._socialMessaging.scope&&APP.USER.slackerUser().tier>0&&this._socialMessaging._onSlackerUserCreated()}))),this._socialMessaging.viewListeners.push(APP.EVENTS.attachEvent(APP.USER.EVENT.USERLOGOUT,(()=>{this._socialMessaging.teardown()}))))},setPaywallObservables:function(e,t){return e.paywallBadgeType=ko.observable(null),e.isPaywallVideo=ko.observable(!1),e.userHasTicket=ko.observable(!1),e.paywallVideoTypeText=ko.computed((function(){const e=APP.USER.slackerUser(),i=this.isPaywallVideo(),s=e.policy?.capabilities?e.policy.capabilities.features:null;if(this.subTypes||(this.subTypes=[]),i){let e="string"==typeof i?i:i[0],a=s&&s[e]?s[e].products[0]:null,n=null;if(this.subTypes.length?this.subTypes.includes("ticketing")&&(n="ticketing"):n="upgrade",this.paywallBadgeType(n),s?.[e]){let e=!1;if("string"==typeof i)e=s[i].enabled;else{e=!0;let t=0;for(;e&&t<i.length;)e=s[i[t]].enabled,t++}if(this.userHasTicket(e),e)return null}if(a&&!t){if("register"!=a.type&&this.paywallBadgeType(a.type),APP.checkPaywallVideo(this,!1,null,!0))return this.userHasTicket(!0),null;try{return"ticketing"==a.type?this.paywallBadgeType("ticketing"):"register"!=a.type&&this.paywallBadgeType("upgrade"),"register"==a.type?null:"ticketing"==a.type?"BUY TICKET":"GET ACCESS"}catch(e){}}else if(!this.userHasTicket()&&this.paywallBadgeType())return"ticketing"==this.paywallBadgeType()?"BUY TICKET":"GET ACCESS"}return null}),e).extend({rateLimit:200}),e?.rights?.permissions&&e.isPaywallVideo(e.rights.permissions.ondemand),e.isPaywallVideo()},parseResponse:function(e,t){const i=this;e._links&&this.linksData(e._links),e.page&&this.parsePageData(e);let s,a={},n=e.data?.seoName||e.seoName||e.data?.objectId||e.objectId,o=function(t){const s=new(require("com.slacker.app.view.SlackerItemDetailVie
1w"))({seoName:"tmp"});let a,o,r=[];return r.activeTab=ko.observable(null),r.tabs=ko.observableArray([]),r.changeTab=function(e){e.id!=this.activeTab().id&&(this.activeTab(e),APP.checkAcessibilityTTSAction(`Loading ${e.title}`,null,!1,{forceFinish:!0}),setTimeout((e=>{APP.checkAcessibilityTTSAction("Loaded",null,!0,{forceFinish:!0}),i._doLazyImageLoading(!0),i._doCapitalisticThings(!0)}),200))}.bind(r),t.forEach(((t,l)=>{let c=new this._abstractSection(t.title,t.description);if(c.position=l,o=["section",this.seoName],t.subTypes?(c.subTypes=t.subTypes,o=o.concat(t.subTypes),c.reportingId=`${n}/${t.subTypes.join("/")}`):(t.subTypes=[],c.reportingId=`${n}/${t.title}`),l>0&&r[l-1].isSpotlight&&o.push("followSpotlight"),c.classNames=o.join(" ").replace(/\//g," "),c.isSpotlight=c.classNames.indexOf("spotlight")>-1,c.links=t._links,c.sectionData.editable=null,c.isSpotlight||c.bemModifiers.push("main"),(c.classNames.indexOf("livestreamPicks")>-1||c.classNames.indexOf("schedule")>-1&&"tv"==APP.implementationSuperType())&&(o.push("carousel"),c.classNames=o.join(" ").replace(/\//g," ")),t._embedded){a=t._embedded.content||t._embedded.genericTypedResourceList||t._embedded.linkedHashMapList||t._embedded.videoList||t._embedded.stationList||t._embedded.liveList||t._embedded.lxlPodcastItemList||t._embedded.lxlPodcastEpisodeItemList,a?.length>0&&"station"==a[0].type?(o.push("stations"),o.push("radio"),void 0===i._onRequestStationOptions&&o.push("no-options"),o.push("no-tile-hover"),c.content.type="radio",c.classNames=o.join(" ").replace(/\//g," ")):c.classNames.indexOf("stations")>-1?(o.push("no-tile-hover"),o.push("radio"),c.content.type="radio",c.classNames=o.join(" ").replace(/\//g," ")):a?.length>0&&a[0].type?.indexOf("podcast")>-1?(o.push("podcasts"),"podcast"!=a[0].type?(o.push("songs"),c.content.type="list",c.content.listType="podcast-episodes"):c.content.type="radio",o.push("no-tile-hover"),c.classNames=o.join(" ").replace(/\//g," ")):a?.length>0&&a[0].type?.indexOf("audiobook")>-1&&(o.push("no-tile-hover"),c.classNames=o.join(" ").replace(/\//g," "));let n=0;if(a){let i=a[0].type?.indexOf("podcast")>-1;t._embedded.content=a.map((e=>{i&&(e.hasDetail=!0,e.id=e.podcastId,e.links=e._links);let t=e.nodeType||i?s.__constructSectionItem(e,c):this.__constructSectionItem(e,c);return t().sectionIndex=l,t().sectionItemIndex=n++,t})),t.subTypes.includes("stages")&&(r.playerRelatedList=[].concat(a),r.playerRelatedList.subTypes=t.subTypes),c.content(t._embedded.content),e.data?.subTypes?.includes("recorded")&&t?.subTypes?.includes("video")&&(r.playerRelatedList=[].concat(t._embedded.content),r.playerRelatedList.subTypes=["Related"])}}t._links&&t._links.nav&&c.hasMore(!0),c.hasForm()&&!c.description&&t.subtitle&&(c.description=t.subtitle),!c.description&&c.classNames.indexOf("schedule")>-1&&(c.description="Subject to change",c.visibleDescription(c.description)),r.push(c),c.isSpotlight&&(c.spotlightItem({index:0,item:c.content()[0]()}),c.spotlightLeftEnabled(!1),c.content().length>1&&c.spotlightRightEnabled(!0))})),this.addSectionTabIndices(r),r};try{return e._links&&e._links.self&&(this.link=e._links.self.href),isChannel=this.link.indexOf("channels/")>-1,isGenre=this.link.indexOf("genres/")>-1,s=isGenre||isChannel,(e.slackerUrl||e.data&&e.data.slackerUrl)&&(e.basicradio=1),a=s?e._embedded&&isChannel?o.bind(this)(e._embedded.content||e._embedded.contentSectionList):o.bind(this)([e]):e._embedded?o.bind(this)(e._embedded.content||e._embedded.contentSectionList):[],t?a:(this.data(a),!0)}catch(e){return CONSOLE.error("Parsing sectioned content failed ",e),this.setFailed(),!1}},parsePageData:function(e){let t,i,s,a,n,o=[],r=e._links||e.links,l=[{type:"prev",title:"prev",ariaLabel:"Previous Page"},{type:"next",title:"next",ariaLabel:"Next Page"}],c=this.pagingData(),d=!1;if(r.self||(r=APP.halifyLinks(r)),!r.prev&&e.page.number>0&&(this.dataSource||c)&&(r.prev={href:c&&"prev"==c.links[0].link.type&&c.links[0].link._links?c.links[0].link._links.nav.href:this.dataSource.replace(`page=${e.page.number}`,"page="+(e.page.number-1))}),r.self&&this.dataSource!=r.self.href&&(this.dataSource=r.self.href),1!=e.page.totalPages&&l.forEach(((e,t)=>{r[e.type]?o.push(new MenuAction({...e,_links:{nav:{href:r[e.type].href}}},(e=>APP.currentView.getPage(e.href(),this)),"",this)):o.push(new MenuAction({...e},null,"",this))})),e.page.totalPages&&e.page.totalPages>1)for(t=Math.max(e.page.number-3,0),i=t+3+1,s=e.page.totalPages>5,a=e.page.totalPages;a>0;){if(n=r.first.href.replace("page=0","page="+(a-1)),a>t&&a<=i&&o.splice(1,0,new MenuAction({title:a,ariaLabel:`Page ${a}`,type:"page-"+(a-1),_links:{nav:{href:n}}},(e=>APP.currentView.getPage(e.href(),this)),"",this)),a>i&&!d&&(d=!0,o.splice(1,0,new MenuAction({title:a,ariaLabel:`Page ${a}`,type:"page-"+(a-1),_links:{nav:{href:n}}},(e=>APP.currentView.getPage(e.href(),this)),"",this)),s&&o.splice(1,0,new MenuAction({title:"...",ariaLabel:null,type:"page-"+(a-1),_links:{nav:{href:n}}},null,"jumpto",this))),a==t){if(s&&o.splice(1,0,new MenuAction({title:"...",ariaLabel:null,type:"page-"+(a-1),_links:{nav:{href:n}}},null,"jumpto",this)),a>0){const e=r.first.href;o.splice(1,0,new MenuAction({title:"1",ariaLabel:"Page 1",type:"page-0",_links:{nav:{href:e}}},(e=>APP.currentView.getPage(e.href(),this)),"",this))}break}a--}this.pagingData({page:e.page,links:o})},setFailed:function(e,t){this.isBound=!1,APP.EVENTS.notify(APP.EVENT.VIEWFAILED,[this,e,t])}
1,setActive:function(bIsHistory,bNoSpeak){const self=this,body=$("body");let myData=this.data(),playOnLoad=!!myData&&myData.playOnLoad,liveWatchNow="true"===Q_STRING.get("watch"),tmpData,externalPlayerEmbedGo;if(this.refreshDataOnActive)return this.refreshDataOnActive=!1,this.init(null,!0),void self._doLazyImageLoading();liveWatchNow&&delete Q_STRING.hash.watch,$(".server-generated").remove(),$(".page").css("display","none");let bodyStyles=(this.bodyStyle||[]).slice();if((this.seoName||this.viewName)&&(bodyStyles.push((this.seoName||this.viewName).replace(/\//g,"_")),(this.seoName||this.viewName).indexOf("contestrules/")>-1&&bodyStyles.push("contestrules")),body.removeClass("no-hero dark-theme item-detail").addClass(bodyStyles.join(" ")),this.stylesheet&&APP.animationFrame.call(window,(()=>{this.stylesheet.forEach((e=>Object.keys(e).forEach((t=>loadCssDynamically(e[t],t)))))})),!bIsHistory&&this.historyData?.params?.bIsHistory&&(bIsHistory=!0),APP.currentView&&!APP.currentView.isDisposed&&APP.currentView.dispose.bind(APP.currentView)(!0),APP.heroEmbedData()&&body.hasClass("hero-embed")&&APP.toggleHeroPlayerFloat(),CONSOLE.info(["setActive:Setting active view",this.title]),this.historyData.link=this.link,this.historyData.title=this.title,bIsHistory&&(myData&&myData.length||!this.dataReset||(myData=this.dataReset,this.dataReset=null),this.data()!==myData&&(CONSOLE.info(["setActive: resetting VM data"]),this.data(myData),CONSOLE.info(["setActive: VM data reset"]))),!this.isBound){CONSOLE.info(["setActive: applying KO bindings",this.domContainerId]);try{ko.applyBindings(this,document.getElementById(this.domContainerId.substring(1))),CONSOLE.info(["setActive: KO bindings applied",this.domContainerId])}catch(e){CONSOLE.warn(`setActive: KO bindings failed on ${this.domContainerId}`,e)}setTimeout((()=>{let e=$(`${this.domContainerId} .static-content, ${this.domContainerId} .dynamic-content`);e.length&&(CONSOLE.debug(["setActive: applying static KO bindings"]),e.each((function(e,t){ko.cleanNode(t),ko.applyBindings(self,t)}))),e=null}),1e3),this.isBound=!0}if(!$(".topmost.capUnit").hasClass("lazy")||$(".topmost.capUnit").hasClass("empty")){let e=$(".topmost.capUnit");e.show(),e?.[0]?.id&&this.slotRenderingHelper.ids.push(e[0].id)}"function"==typeof myData.forEach&&(CONSOLE.debug(["setActive: checking data for spotlight treatments"]),myData.forEach((e=>{if(e.isSpotlight&&e.setSpotlightAutoRotate){if(e.setSpotlightAutoRotate(null,!0),this.spotlightImageHelper(e),e.content().length>1){const t=e&&e.streamStateBadge?e.streamStateBadge():null;"web"!==APP.implementationSuperType()&&"tesladash"!=APP.appImplementationModule.type||(e.swipe=new Swipe($(this.domContainerId+" section.spotlight")[0],function(e,t){if("touchmove"==e.type)switch(t){case"up":case"down":break;default:try{e.preventDefault()}catch(e){}}else{if(evtEl=$(e.srcElement),e.srcElement&&(evtEl.hasClass("play")||evtEl.hasClass("button")||"A"===e.srcElement.nodeName||"BUTTON"===e.srcElement.nodeName)||e.srcElement.onclick)return!0;switch(CONSOLE.debug(["Swipe detected",t]),t){case"left":this.spotlightRotate(1);break;case"right":this.spotlightRotate(-1)}try{e.preventDefault()}catch(e){}}}.bind(e))),"live"!=t&&"replay"!=t||(playOnLoad=!0)}}else!e.isSpotlight&&bIsHistory&&e.carouselLeftEnabled&&e.carouselLeftEnabled()&&e.carouselLeftEnabled(!1)}))),this?.link?.indexOf("APP.SERVICE")>-1&&(this.link=eval(this.link)),CONSOLE.debug(["setActive: Beacon view"]),this.noPageViewBeacon||("undefined"!=typeof PAGE_BEACON&&PAGE_BEACON?(PAGE_BEACON.event&&BEACON.tagEvent(PAGE_BEACON.event),PAGE_BEACON.page&&BEACON.tagView(PAGE_BEACON.page),PAGE_BEACON=null):BEACON.tagView({name:this.beaconName})),CONSOLE.debug(["setActive: END Beacon view"]),CONSOLE.debug(["setActive: Notifying viewActive listeners"]),APP.EVENTS.notify(APP.EVENT.VIEWACTIVE,[this,bIsHistory],!0),CONSOLE.debug(["setActive: Applying CSS media listeners"]),enquire.register(`screen and (max-width : ${this.slotRenderingHelper.minBillboardWidth}px)`,this.slotRenderingHelper.enquireOnQuerySlotChange).register(`screen and (max-width : ${this.slotRenderingHelper.maxLeaderWidth}px)`,this.slotRenderingHelper.enquireOnQuerySlotChange).register(`screen and (min-width : ${this.slotRenderingHelper.minSkyscraperWidth}px)`,this.slotRenderingHelper.enquireOnQuerySlotChange).register("screen and (min-width : 1236px)",this.slotRenderingHelper.enquireOnQuerySlotChange).register("screen and (max-width : 1235px)",this.slotRenderingHelper.enquireOnQuerySlotChange).register("screen and (min-width : 1050px)",this.spotlightImageHelper.bind(this)).register("screen and (min-width : 836px)",this.slotRenderingHelper.enquireOnQuerySlotChange).register("screen and (max-width : 835px)",this.slotRenderingHelper.enquireOnQuerySlotChange).register("screen and (min-width : 800px)",this.spotlightImageHelper.bind(this)).register("screen and (max-width : 801px)",this.spotlightImageHelper.bind(this)),CONSOLE.debug(["setActive: END Applying CSS media listeners"]),CONSOLE.debug(["setActive: Detecting autoplay items"]);let pData=this.data().length>0?this.data()[0]:this.data();bIsHistory&&(pData.autoplay&&(pData.autoplay=!1),"live"!=pData.streamStatus&&"replay"!=pData.streamStatus||(myData.playOnInit=!0)),externalPlayerEmbedGo="youtube"==pData?.source,pData?.contentUrl&&externalPlayerEmbedGo&&(!myData.playOnInit||Browser.isMobileDevice()
1)?(Browser.isMobileDevice()&&pData.playOnLoad&&(pData.playOnLoad=!1),APP.appImplementationModule.onBeforeHeroVideoStart(pData),playOnLoad&&"post-0"!=pData.objectId&&this.getData()):playOnLoad&&(pData=this.data().length>0?this.data()[0]:this.data(),pData.contentUrl||(pData=pData.content[0],pData.defaultVolume=0,pData.disablePreroll=!0),myData.playOnInit=!1,APP.appImplementationModule.onBeforeHeroVideoStart.bind(APP.appImplementationModule)(pData,!0),"post-0"!=pData.objectId&&this.getData()),myData&&(myData.playOnInit||liveWatchNow)&&(pData.playable&&(pData=pData.playable),myData.playOnInit=!1,pData.autoplay=!0,["live","replay"].includes(pData.streamStatus)?liveWatchNow?this.onEventWatchNow(null,null,null,!0):"tv"!=APP.implementationSuperType()&&(pData.preview=!0,APP.heroEmbedData()?APP.heroEmbedData().itemId==pData.objectId&&APP.toggleHeroPlayerFloat():APP.appImplementationModule.onBeforeHeroVideoStart(pData,!0)):APP.appImplementationModule.onBeforeHeroVideoStart(pData,!0)),CONSOLE.debug(["setActive: END Detecting autoplay items"]),CONSOLE.debug(["setActive: Fire async render clean ups."]),this.lastScrollPos?window.scrollTo(0,this.lastScrollPos):window.scrollTo(0,0),setTimeout((()=>{this._doLazyImageLoading(!1)}),100),setTimeout((()=>this._doCapitalisticThings(!0)),1e3),bNoSpeak||APP.checkAcessibilityTTSAction(`Loaded: ${this.title}`,null,!0),this.isDisposed=!1,this.onAfterActive()},generateSeoName:e=>e.toLowerCase().replace(/[^\s\w]/g,"").replace(/\s/g,"-"),getPage:function(e,t,i){let s=null,a=$.extend(!0,{},this.historyData.params);e&&(s=e),s&&(t.doSeeMore?t.getHasMoreFromMixerFullMethod(s)(i):(a._links&&a._links.nav||(a._links={nav:{href:""},self:{href:this.dataSource}}),a._links.nav.href=s,a.isPageNav=!0,APP.goToPage(this.historyData.viewType,a)))},dispose:function(e,t){const s=$("body"),a=document.getElementById(this.domContainerId.substring(1)),n=this.seoName||this.viewName,o=APP.appImplementationModule.detailstreamaction,r=$(".lxl-widget iframe")[0];t||(CONSOLE.info(["Disposing view",this.title]),APP.EVENTS.notify(APP.EVENT.VIEWDISPOSE,[this]));let l=this.data();try{r.contentWindow.postMessage('{"command": "pause"}',r.src)}catch(e){CONSOLE.warn("Unable to clean widget player on page",e)}this.activateDeviceAction&&this.activateDeviceAction.stopPolling(),n&&s.removeClass(n.replace(/\//g,"_")),o?.setQueue(null),this._onVideoPlayerEvent&&o?.videoplayer&&(o.eventMapper.detachEvent(o.videoplayer.EVENT.DISPLAYERROR,this._onVideoPlayerEvent.bind(this)),["COMPLETED","STARTED","DURATIONCHANGE","ERROR"].forEach((e=>{o.eventMapper.detachEvent(o.videoplayer.EVENT.PLAYBACK[e],this._onVideoPlayerEvent.bind(this))}))),this?.heroPreview?.videoplayer&&(this.heroPreview.videoplayer._wasPlayingVideoAd=this.heroPreview.videoplayer.isRequestingAds=this.heroPreview.videoplayer.needsRestartOnResume=!1,this.heroPreview.videoplayer.stop(),this.heroPreview=null),this?.detailPlayer?.currentVideoObj&&(this.detailPlayer._wasPlayingVideoAd=this.detailPlayer.isRequestingAds=this.detailPlayer.needsRestartOnResume=!1,this.detailPlayer.stop(),this.detailPlayer=null);try{l.length&&l.forEach((e=>{e.isSpotlight&&e.setCurrentSpotlightItem&&(e.setSpotlightAutoRotate(!0,!1,!0),this.spotlightImageHelper(e),e.swipe&&(e.swipe.callback=null,e.swipe.dispose(),e.swipe=null)),e.tabs().length&&e.forEach((e=>{e.contentFilterComputed&&(e.contentFilterComputed=null)}))})),e||this.data(this.dataReset),e&&$(".multi-stage > button").each((function(e,t){$(t).find("span").off("mouseenter").off("mouseleave")})),this.socialMessaging&&this.socialMessaging.teardown()}catch(e){}finally{t||this.active(!1)}this?.ytPlayerIds?.forEach((e=>{if("object"==typeof e){if(e.getPlayerState&&e.getPlayerState()==YT.PlayerState.PLAYING)try{e.stopVideo()}catch(e){}e.a&&this.ytPlayerIds.splice(i,1,e.a.getAttribute("id"))}})),this.adSlots.length>0&&(SADS.destroyDFPSlots([].concat(this.adSlots)),this.adSlots=[],this.slotRenderingHelper.ids=[]),["_lazyImgScrollDelay","_lazyCapScrollDelay"].forEach((e=>{this[e]&&(clearTimeout(this[e]),this[e]=0)})),this.isFestivalSocialAvailable(!1),a&&!t&&(CONSOLE.info(["dispose: cleaning KO bindings",this.domContainerId]),ko.cleanNode(a),this.isBound=!1,CONSOLE.info(["dispose: KO bindings cleaned",this.domContainerId]));try{enquire.unregister("screen and (max-width : "+this.slotRenderingHelper.minBillboardWidth+"px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (max-width : "+this.slotRenderingHelper.maxLeaderWidth+"px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (min-width : "+this.slotRenderingHelper.minSkyscraperWidth+"px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (min-width : 1236px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (max-width : 1235px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (min-width : 836px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (max-width : 835px)",this.slotRenderingHelper.enquireOnQuerySlotChange).unregister("screen and (min-width : 800px)",this.spotlightImageHelper.bind(this)).unregister("screen and (max-width : 801px)",this.spotlightImageHelper.bind(this))}catch(e){}t||(this.isBound=!1),this.isDisposed=!0},onAfterActive:function(){},capitalism:function(e,t){APP.suppressDisplayAds},sectionRenderingHelpers:function(e,t){const i=$(`#${t.id}`),s=i[0]?.className.indexOf("carousel")>-1?i.find(".scroll-container")[0]:null;if(s&&setTimeout((()=>{const e=i.width();t.carouselRightEnabled(Math.round(s.scrollWidth-s.scrollLeft)>e)}),500),e&&"playlist-tracks"==t?.content?.listType)try{$(e[4]).find(".section-list:not(.header)").sortable({axis:"y",cancel:".button.play, .link, .edit-move",curs
1or:"move",items:"> li",revert:!0,start:(e,t)=>{APP.MESSAGING.closeContextMenu()},beforeStop:(e,t)=>{t.item.css("margin-top",0)},update:function(e,i){const s=require("com.slacker.app.modules.SlackerCreatorModule"),a=i.item.context.getAttribute("data-position"),n=i.item.index();let o;o=t.content()[n]().rootIndex,a-o<=-1&&o++,s.reorderPlaylist(a,o,this.playlistDef,(function(e,t){200!=e&&APP.MESSAGING.prompt("modalErrorFree",{reason:e})}))}.bind(this)})}catch(e){CONSOLE.error(["Unable to bind sortable to playlist items"],e)}},spotlightImageHelper:function(e){const t=this.data();let i,s,a,n;if("string"==typeof t||(s=e||(t?t[0]:null),a="function"==typeof s?.content?s.content():null,n=a?s.spotlightItem():null),s?.isSpotlight)s.spotlightBgImageUrl?(i=s.imageMap||{},"tv"==APP.implementationSuperType()?(i.webHero=s.featureImgUrl||s.posterImgUrl,i.mobileWebHero=s.featureImgUrl||s.posterImgUrl):["webHero","mobileWebHero"].forEach((e=>{i[e]||(i[e]=s.featureImgUrl||s.posterImgUrl)})),window.innerWidth<825?s.spotlightBgImageUrl(i.mobileWebHero):s.spotlightBgImageUrl(i.webHero)):a&&a.forEach(((e,t)=>{try{const s="function"==typeof e?e():e;i=s.imageMap||{},"tv"==APP.implementationSuperType()?(i.webHero=s.featureImgUrl||s.posterImgUrl,i.mobileWebHero=s.featureImgUrl||s.posterImgUrl):["webHero","mobileWebHero"].forEach((e=>{i[e]||(i[e]=s.featureImgUrl||s.posterImgUrl)})),t!=n.index||n.disposed?s.spotlightBgImageUrl("/s=4.0.1385/images/pixel.gif"):window.innerWidth<825?s.spotlightBgImageUrl(i.mobileWebHero):s.spotlightBgImageUrl(i.webHero)}catch(e){CONSOLE.error("AbstractView::spotlightImageHelper - Failed to set spotlight image for item.",e)}}));else{let e=$(".spotlight");if(e.length){let t=e.eq(0).find(".tile-container .tile");s=ko.dataFor(e[0]),s?.imageMap?window.innerWidth<825?t.attr("lazySrc",s.imageMap.mobileWebHero):t.attr("lazySrc",s.imageMap.webHero):s=null}}s=null},_buildWPPostEntry:function(e,t){var i,s,a={title:e.find("title").text().trim(),subtitle:e.find("lxl\\:subtitle").text().trim(),description:e.find("summary").text().trim(),author:e.find("author").find("name").text().trim(),published:new Date(e.find("published").text().trim()).format("mmmm dd, yyyy"),thumbnail:e.find("lxl\\:featuredimage").attr("src-320"),content:e.find("content").text().trim(),summary:e.find("summary").text().trim(),slackerLink:e.find("lxl\\:slacker_url").text().trim(),seoName:t,navId:t.replace(/\//g,"-"),isActiveEntry:this.seoName==t},n=0;if(a.loadFullEntry=function(){APP.goToPage("blog",{title:"The Daily",type:"blog",seoName:this.seoNameRoot,_links:{nav:{href:APP.SERVICE.URLMODULE.SERVICE.DATA.BLOG}}})}.bind(a),a.summary&&(a.summary=a.summary.replace(/<a[^>]*>(.*?)<\/a>/g,"")),a.content.indexOf("<iframe")>-1||a.content.indexOf("<img")>-1){if(a.thumbnail=null,a.content.indexOf('src="https://www.youtube')>-1)for(i="yt-"+generateUniqueID(),a.content=a.content.replace(/(youtube\.com\/embed\/)([a-zA-Z0-9_.-]+)([^"]+)?(")/g,"$1$2?enablejsapi=1&$3$4 id='"+i+"'").replace("&?","&"),s=new RegExp(i+"'");a.content.match(s);)n++,a.content=a.content.replace(s,i+"-"+n+"'"),this.ytPlayerIds.push(i+"-"+n);a.content.indexOf("<img")>-1&&(a.content=a.content.replace(/img(.*?)width="(\d+)"/,"img$1").replace(/img(.*?)height="(\d+)"/,"img$1"))}return APP.canUseRadio||(a.slackerLink=null),a.slackerLink?(a.linkType="slacker",a.action=function(){BEACON.tagEvent({name:"playStart",params:{type:"station",value:this.slackerLink,label:"listen",station:this.slackerLink}}),APP.slackerPlayerSession().resolveSlackerSeoUrl(this.slackerLink,(function(e,t){APP.slackerPlayerSession().startRadioStation(t.sid)}))}.bind(a)):a.linkType="article",a},parseSinglePostResponse:function(e,t,i,s){var a=this,n=[],o=a.seoName,r=this.data();if($(e).find("entry").each((function(){var e,s=$(this),r=a.seoNameRoot+s.find('link[rel="alternate"]').attr("href").split(".com")[1];t&&i&&r.indexOf(i)>-1&&(o=r),o==r&&(e=a._buildWPPostEntry.bind(a)(s,r),(t||e.isActiveEntry)&&n.push(e))})),this.isAppendRequest=!1,0==n.length)CONSOLE.warn(["AbstractView::parseSinglePostResponse","Single entry lookup failed:",this.seoName]);else{if(t)return n;s?s.splice.apply(s,[0,0].concat(n)):this.data(n.concat(r))}return!0},parseWPFeedResponse:function(e,t,i){var s=this,a=[],n=this.data(),o=(APP.SERVICE.URLMODULE.get(APP.SERVICE.urls.DATA.ROOT),!this.isAppendRequest&&this.seoName!=this.seoNameRoot),r=!1;if($(e).find("entry").each((function(){var e,t=$(this),i=s.seoNameRoot+t.find('link[rel="alternate"]').attr("href").split(".com")[1];(!s.fetchSingle||s.fetchSingle&&s.seoName==i)&&((e=s._buildWPPostEntry.bind(s)(t,i)).isActiveEntry?o&&(a.unshift(e),r=!0):a.push(e))})),0==a.length?this.hasMoreArticles=!1:t||(this.nextPage++,i?i.splice.apply(i,[0,0].concat(a)):this.data(a.concat(n))),!t&&!this.isFetchingMore()&&o&&!r){CONSOLE.info(["AbstractView::parseWPFeedResponse","Single item requested not in main feed-by-day."]);var l=this.seoName.match(/(\/\d+\/\d+\/\d+\/)/)[0]+"feed/atom/";return this.fetchSingle=!0,this.isAppendRequest=!0,APP.SERVICE.fetch({source:APP.SERVICE.URLMODULE.SERVICE.DATA.BLOGROOT+l,callback:this._onData.bind(this)}),!1}return!0},getCountdownListener:function(e,t,i){return ko.computed(function(){let e=this.countdown();const i=()=>{let e=[this._links.self.href];e.push(-1==e.indexOf("?")?"?":"&"),e.push("rnd={rnd}"),APP.NETWORKING.do(APP.SERVICE.URLMODULE.get(e.join("")),((e,s,a)=>{let n=this.sectionIndex,o=this.sectionItemIndex,r=APP.currentView.data()[n],l=r.content()[o](),c=l.streamStateBadge();if(!e)return void CONSOLE.warn("Section refresh data is null");let d=t(e,r,!0)();d.countdown()||c!=d.streamStatus||["live","replay"].includes(c)&&l.contentUrl==d.c
1ontentUrl?(l.sectionIndex=n,l.sectionItemIndex=o,l.uiItemId=d.uiItemId,l.objectId=d.objectId,l.contentUrl=d.contentUrl,l.slackerUrl=d.slackerUrl,l.hasDetail=d.hasDetail,l.streamStatus=d.streamStatus,l.isCounting(d.isCounting()),["live","replay"].includes(d.streamStatus)||l.countdown(d.countdown()),l.streamStateBadge(d.streamStatus),r.content()[o](l),r.spotlightItem()&&r.spotlightItem().item.objectId==d.objectId?setTimeout((()=>{$(`#tile-${d.uiItemId}`).removeClass("left").removeClass("right"),setTimeout((()=>{$(`#${r.id} .tile-container:not(.left):not(.right) .metadata .button:visible`).each((function(e,t){0!=e&&$(t).addClass("secondary")}))}),200),d=null,APP.currentView._doLazyImageLoading(!0,"#"+r.id)}),200):d=null):++this.refreshRetryCounter<5?(CONSOLE.warn(`AbstractView::getCountdownListener - New status required, but got same status (${this.refreshRetryCounter}). Retry in ${2*this.refreshRetryCounter}s.`),setTimeout(i,2*this.refreshRetryCounter*1e3)):CONSOLE.warn("AbstractView::getCountdownListener - New status retry limit reached. Giving up.")}),"GET")};0===e&&this.viewPointer&&(this.refreshRetryCounter=0,this.viewPointer==APP.currentView?i():this.viewPointer.refreshDataOnActive=!0)}.bind(e))},_doLazyImageLoading:function(e,t){let i="",s=null,a="tv"==APP.implementationSuperType()?20:0;t=t?` ${t} `:" ",i=this.domContainerId+t+" .lazyImg, #radio-player .lazyImg, footer .lazyImg",e&&this._lazyImgScrollDelay&&(clearTimeout(this._lazyImgScrollDelay),this._lazyImgScrollDelay=0),e?this._lazyImgScrollDelay=setTimeout((()=>{this._doLazyImageLoading(!1,t),this._doCapitalisticThings(!1)}),this.SCROLL_DEBOUNCE_DELAY):!APP.currentView||".user-prompts"!=t.trim()&&APP.currentView.domContainerId!=this.domContainerId?CONSOLE.warn(["Ignoring lazy image request for DOMTarget out of scope",this.domContainerId]):(s=(new Date).getTime(),APP._lastLazyImgRun.tStamp&&s-APP._lastLazyImgRun.tStamp<500&&APP._lastLazyImgRun.target==i?CONSOLE.warn(["Ignoring rapid lazy image request for same DOMTarget",i,APP._lastLazyImgRun.tStamp]):(APP._lastLazyImgRun.target=i,APP._lastLazyImgRun.tStamp=s,CONSOLE.debug(["START Processing lazy images",i,APP._lastLazyImgRun.tStamp]),$(i).each(((e,t)=>{setTimeout(function(){let e=this.getAttribute("lazySrc"),t=this.getAttribute("lazyMobileSrc");if(e||t){const i=$(this);if($.inviewport(this,{threshold:a}))if(i.removeClass("lazyImg"),t&&window.innerWidth<801&&(e=t),"img"===this.nodeName.toLowerCase())this.src=e;else $(this).css("background-image",`url('${e}')`)}}.bind(t),Math.floor(Math.random()*Math.floor(100))+10)})),CONSOLE.debug("END Processing lazy images")))},discardEdits:function(){const e="function"==typeof this.data&&this.data()||[],t=e=>{if(!e||"function"!=typeof e.content)return;let i=0;(e.content()||[]).forEach((e=>{const t="function"==typeof e?e():e;t&&"function"==typeof t.removed&&t.removed()&&(t.removed(!1),i+=Number(t.tlen)||0)})),i&&"function"==typeof e.playlistLen&&e.playlistLen(e.playlistLen()+i),"function"==typeof e.isEditDirty&&e.isEditDirty(!1),"function"==typeof e.tabs&&e.tabs().length&&(Array.from(e)||[]).forEach(t)};e.forEach(t),"function"==typeof this.isEditDirty&&this.isEditDirty(!1)},_doCapitalisticThings:function(e,t){let i,s=0==this.adSlots.length,a=0;if(e&&this._lazyCapScrollDelay&&(clearTimeout(this._lazyCapScrollDelay),this._lazyCapScrollDelay=0),e)this._lazyCapScrollDelay=setTimeout(function(){this._doCapitalisticThings(!1)}.bind(this),this.SCROLL_DEBOUNCE_DELAY);else{try{if("premium"===APP.currentView?.seoName||APP.suppressDisplayAds||this.data()[0].monetization&&this.data()[0].monetization.disableDisplay)return void $(".topmost.capUnit").addClass("empty")}catch(e){CONSOLE.warn("Failed to read subTypes for current view. Assuming ads are allowed")}i=this.domContainerId+" .capUnit, #radio-player .capUnit, .topmost.capUnit",CONSOLE.debug("START Processing display capUnits: "+i),$(i).each(function(e,t){let i=t.id,n=$(t);a++,n.attr("id")||(n.attr("id",generateUniqueID()),i=n.attr("id")),n.attr("data-adpos")?"billboard"==n.attr("data-adpos")&&a--:n.attr("data-adpos",a),$.inviewport(t,{threshold:0})?n.hasClass("lazy")&&(n.removeClass("lazy"),i&&this.slotRenderingHelper.ids.push(i)):(n.removeClass("empty"),t.removeAttribute("data-ad-attempt"),n.hasClass("lazy")||n.addClass("lazy")),s&&this.adSlots.push(i)}.bind(this)),setTimeout(function(){var e=this.slotRenderingHelper.prepareVisibleSlots();now=(new Date).getTime(),e.render.length&&(CONSOLE.debug("Rendering new capUnits: "+e.render),SADS.refreshDFPSlots(e.render,t||"scroll")),e.refresh.length&&(CONSOLE.debug("Refreshing existing capUnits: "+e.refresh),SADS.refreshDFPSlots(e.refresh,t||"scroll")),this._watchAdFill(e.render.concat(e.refresh))}.bind(this),50),CONSOLE.debug("END Processing display capUnits: "+i)}},_watchAdFill:function(e){e&&e.length&&"function"==typeof $.inviewport&&(clearTimeout(this._adFillWatchdog),this._adFillWatchdog=setTimeout(function(){const t=[];e.forEach(function(e){const i=document.getElementById(e);if(!i)return;const s=$(i);if(s.hasClass("filled"))return void i.removeAttribute("data-ad-attempt");if(s.hasClass("lazy")||s.is(":hidden")||!$.inviewport(i,{threshold:0}))return;const a=parseInt(i.getAttribute("data-ad-attempt"),10)||0;if(a>=this.AD_FILL_RETRIES)return CONSOLE.warn(["Ad slot gave up after "+a+" retries",e]),void s.addClass("empty");i.setAttribute("data-ad-attempt",String(a+1)),void 0!==SADS&&SADS.destroyDFPSlots&&SADS.destroyDFPSlots([e]),s.empty().removeClass("empty").removeClass("filled").addClass("lazy"),t.push(e)}.bind(this)),t.length&&(CONSOLE.debug("Retrying unfilled capUnits: "+t),this._doCapitalisticThings(!1,"retry"))}.bind(this),this.AD_FILL_TIMEOUT))},_createAdSpot:function(e,t,i){const s=document.createElement("DIV");
1if(s.className="capUnit "+t+" lazy"+(i?" "+i:""),s.id=generateUniqueID(),s.setAttribute("data-slotsize",t),!e)return s;{let i=$(e);if(i.next().hasClass("capUnit"))return CONSOLE.warn(["AbstractView::_createAdSpot - Attempting to insert redundant ad position. Ignoring.",t,e.id]),s;i.after(s)}},_layoutAdRows:function(e,t,i,s){const a=300,n=Array.prototype.slice.call(e.children),o=n.filter((e=>!e.classList.contains("capUnit"))),r=n.filter((e=>e.classList.contains("capUnit"))),l="1"===e.getAttribute("data-ad-row-standalone");if(!o.length&&!l)return;const c=window.getComputedStyle(e),d=parseFloat(c.columnGap)||0,u=e.getBoundingClientRect().width;if(!u){const s=parseInt(e.getAttribute("data-ad-row-retry"),10)||0;return void(s<5&&(e.setAttribute("data-ad-row-retry",String(s+1)),setTimeout((()=>i._layoutAdRows(e,t,i)),120)))}e.removeAttribute("data-ad-row-retry");const h="grid"===c.display,p=h?(c.gridTemplateColumns||"").split(/\s+/).filter(Boolean).length:0;let m=o.length?o[0].getBoundingClientRect().width:0;if(!m&&l){const e=document.querySelector(".tile-group:not(.ad-row) > *:not(.capUnit)");m=e?e.getBoundingClientRect().width:0}m||(m=a);const g=h&&p?p:Math.floor((u+d)/(m+d));if(g<1)return;
1h&&p&&(m=(u-(g-1)*d)/g);const P=Math.max(1,Math.floor((u+d)/(a+d))),y=Math.ceil(o.length/g),f=Math.max(1,Math.min(t,y)),A=g*f,S=l?1:Math.floor(y/f),b=function(e){if(!e)return P;const t=u-(e*m+(e-1)*d);return Math.max(0,Math.floor(t/(a+d)))},E=[];let k=o.length;for(let e=0;e<S;e++){const e=Math.min(A,k);k-=e,E.push({tiles:e,ads:b(e%g)})}const v=E.reduce(((e,t)=>e+t.ads),0),T=r.slice();for(;T.length>v;){const e=T.pop();if(void 0!==SADS&&SADS.destroyDFPSlots&&e.id&&SADS.destroyDFPSlots([e.id]),i&&Array.isArray(i.adSlots)){const t=i.adSlots.indexOf(e.id);t>-1&&i.adSlots.splice(t,1)}e.parentNode&&e.parentNode.removeChild(e)}let C=0;for(;T.length<v;){const e=i._createAdSpot(null,"medrect","tile-container ad-row__unit");if(!e)break;T.push(e),C++}e.style.setProperty("--ad-row-count",String(P)),e.style.setProperty("--ad-row-gap",d+"px");const O=[];let N=0,_=0;for(E.forEach((e=>{for(let t=0;t<e.tiles&&N<o.length;t++)O.push(o[N++]);const t=e.tiles%g,i=t>0&&e.ads>0,s=i?a:0,n=i?t+1:1,r=i?g-t:g,l=e.ads?Math.floor(r/e.ads):0,c=e.ads?r%e.ads:0;let d=n;for(let t=0;t<e.ads;t++){const e=T[_+t];if(e){if(h&&p){const i=l+(t<c?1:0);e.style.gridColumn=d+" / span "+i,e.style.maxWidth="none",e.style.removeProperty("flex-basis"),d+=i}else i?(e.style.removeProperty("grid-column"),e.style.flexBasis=s+"px",e.style.maxWidth=s+"px"):(e.style.removeProperty("grid-column"),e.style.removeProperty("flex-basis"),e.style.removeProperty("max-width"));O.push(e)}}_+=e.ads}));N<o.length;)O.push(o[N++]);const w=[];O.forEach(((t,i)=>{e.children[i]!==t&&(e.insertBefore(t,e.children[i]||null),t.classList.contains("capUnit")&&w.push(t))})),w.forEach((e=>{$(e).empty().removeClass("empty").removeClass("filled").addClass("lazy"),void 0!==SADS&&SADS.destroyDFPSlots&&e.id&&SADS.destroyDFPSlots([e.id])})),(C||w.length)&&(clearTimeout(i._adRowRequest),i._adRowRequest=setTimeout((function(){i._doCapitalisticThings(!1,"ad-row")}),150)),s||(clearTimeout(e.__adRowSettle),e.__adRowSettle=setTimeout((function(){e.__adRowSettle=null,i._layoutAdRows(e,t,i,!0)}),400))},_reflowGridAds:function(e){const t=e?$(e):$(this.domContainerId),i=this;t.find(".tile-group").each((function(e,t){const s=Array.prototype.slice.call(t.children),a=parseInt(t.getAttribute("data-ad-rows"),10);if(a>0)return void i._layoutAdRows(t,a,i);if(!s.some((e=>e.classList.contains("capUnit"))))return;if("grid"===window.getComputedStyle(t).display)return;s.forEach(((e,t)=>{null===e.getAttribute("data-adflow")&&e.setAttribute("data-adflow",t)}));const n=s.slice().sort(((e,t)=>+e.getAttribute("data-adflow")-+t.getAttribute("data-adflow"))),o=n.filter((e=>!e.classList.contains("capUnit"))),r=n.filter((e=>e.classList.contains("capUnit")));if(!o.length||!r.length)return;const l=parseFloat(window.getComputedStyle(t).columnGap)||0,c=o[0].getBoundingClientRect().width;if(!c)return;const d=Math.floor((t.getBoundingClientRect().width+l)/(c+l));if(d<2)return;const u=Math.max(2,Math.floor(o.length/(r.length+1))),h=r.slice(),p=[];let m=0,g=0,P=-1;o.forEach(((e,t)=>{if(h.length&&g>=u){const e=(i=h[0],Math.max(1,Math.round((i.getBoundingClientRect().width+l)/(c+l)))),s=m+e<=d,a=m===P&&t<o.length-1;if(s&&!a){const t=h.shift();P=m,m=(m+e)%d,g=0,p.push(t)}}var i;m=(m+1)%d,g++,p.push(e)})),h.forEach((e=>p.push(e)));const y=[];p.forEach(((e,i)=>{t.children[i]!==e&&(t.insertBefore(e,t.children[i]||null),e.classList.contains("capUnit")&&y.push(e))})),y.forEach((e=>{$(e).empty().removeClass("empty").removeClass("filled").addClass("lazy"),void 0!==SADS&&SADS.destroyDFPSlots&&e.id&&SADS.destroyDFPSlots([e.id])}))}))},_abstractDisplayableItem:function(e,t,i){let s=this;if(e&&!e.subTypes&&(e.subTypes=[]),s.sectionReportingId=t?t.reportingId:null,s.type=null,s.objectId=generateUniqueID(),s.uiItemId=generateUniqueID(),s.isVideo=!1,s.isExternal=e&&e.isExternal,s.canShowOptions=t&&t.reportingId&&t.reportingId.indexOf("profile/")>-1,s.slackerUrl=null,s.title=null,s.ariaTitle=null,s.advisory=null,s.showName=null,s.subtitle=null,s.description=null,s.posterImgUrl=null,s.featureImgUrl=null,s.nodeType=null,s.artistLink=null,s.albumLink=null,s.songLink=null,s.showLink=null,s.iconPath=null,s.price=null,s.restricted=!1,s.hasDetail=!1,s.isS
1potlight=!1,s.isChannel=!1,s.playableShow=!1,s.episode=!1,s.show=!1,s.editable=!1,s.imageMap=null,s.playType="",s.basicradio=0,s.olicensed=0,s.sectionItemIndex=0,s.score=0,s.popularity=0,s.displayDuration=0,s.isTicketingStoreItem=e.subTypes.includes("ticketing")&&"storeItem"===e.type,s.bemModifiers=[],s.scorePercent=ko.observable("0%"),s.isVod=ko.observable(!1),s.removed=ko.observable(!1),s.isPlaying=ko.observable(!1),s.playable=ko.observable(!1),s.isCounting=ko.observable(!1),s.countdownMessage=ko.observable(null),s.streamStateBadge=ko.observable(this.streamStatus&&"trailer"!==this.streamStatus?this.streamStatus:"offline"),s.contentTypeBadge=ko.observable(null),s.spotlightBgImageUrl=ko.observable(""),s.initSocialMessaging=function(e,t){APP.supportsSocialMessaging&&new PubnubModule(e,t,this)},s.socialMessaging=function(e){this._socialMessaging=e,e&&(this._socialMessaging.viewListeners.push(APP.EVENTS.attachEvent(APP.USER.EVENT.USERLOGIN,(()=>{this._socialMessaging.scope&&APP.USER.slackerUser().tier>0&&this._socialMessaging._onSlackerUserCreated()}))),this._socialMessaging.viewListeners.push(APP.EVENTS.attachEvent(APP.USER.EVENT.USERLOGOUT,(()=>{this._socialMessaging.teardown()}))))},s.onFestivalStatusChange=e=>{if(e.from&&e.to&&this.streamStatus!=e.to){let t=1e3*(Math.floor(10*Math.random())+1);if(CONSOLE.warn(`Fetching new status in ${t}ms`),this.isCounting())setTimeout((e=>{this.viewPointer==APP.currentView?this.countdown(0):this.viewPointer&&(CONSOLE.warn("Item no longer in view. Ignoring item status change"),this.viewPointer.refreshDataOnActive=!0)}),t);else{let i=APP.currentView.data()[this.sectionIndex];i.isSpotlight?setTimeout((e=>{this.viewPointer==APP.currentView?this.monitorCountDown?this.countdown()||this.countdown(1):this.monitorCountDown=APP.currentView.getCountdownListener(this,APP.currentView.__constructSectionItem.bind(APP.currentView),i):this.viewPointer&&(CONSOLE.warn("Item no longer in view. Ignoring item status change"),this.viewPointer.refreshDataOnActive=!0)}),t):(this.streamStatus=e.to,this.streamStateBadge(e.to))}}},AbstractViewBuilder.setPaywallObservables(s,!0),e&&e.badge&&(e.badge.type.indexOf("original")>-1&&(e.badge.type="original"),e.badge.title||(e.badge.title=null),e.badge.subtitle||(e.badge.subtitle=null),s.contentTypeBadge({...e.badge})),s.isTicketingStoreItem){let i=e.price&&e.price.toString().indexOf("FREE")>-1,a={type:"ticketing",title:"DIGITAL TICKET",subtitle:null,showGotoEvent:!1,showOffsiteInfo:!1,isFree:i,noSale:!1};i&&e.subTypes.push("free"),t&&(t.subTypes||(t.subTypes=["section","store"]),t.subTypes.push("ticketing")),e.offerCodeId&&(s.offerCode=e.offerCodeId),e.permissions&&!e.rights&&(e.rights={permissions:{ondemand:e.permissions}}),e._links&&e._links.event&&(s.eventUrl=e._links.event.href),a.showGotoEvent=i,a.showOffsiteInfo=!(!s.offerCode||!s.offerCode.match(/monsta-x|monstaxlive/))&&"/announce/monstaxlive",a.noSale=!s.offerCode,s.contentTypeBadge(a)}if(s.classNames=function(e){let t=[],i=!1;try{this.isSpotlight&&APP.currentView&&(i=APP.currentView.data()[0].spotlightItem().item==this)}catch(e){}return t.push(this.type),this.isSpotlight&&(t.push("no-tile-hover"),0==e||i||t.push("right")),null!=this.nodeType&&t.push("radio"),this.subTypes&&this.subTypes.length&&(t=t.concat(this.subTypes)),this.source&&"lxl"!=this.source&&t.push(this.source),this.posterImgUrl&&!this.featureImgUrl&&t.push("alt-image-layout"),this.episode&&t.push("episode"),this.show&&(t.push("show"),this.playableShow&&t.push("playableShow")),this.isPlaying()&&t.push("playing"),this.isTicketingStoreItem&&t.push(this.userHasTicket()?"owner":"non-owner"),this.iconPath&&t.push("has-icon"),t.join(" ")}.bind(s),e&&(Object.assign(this,e),void 0!==e.playable&&(this.playable=ko.observable(e.playable)),this.title&&(this.ariaTitle=this.title),e.streamStatus&&(e?.subTypes.includes("meetandgreet")?s.streamStateBadge("meet & greet"):s.streamStateBadge(e.streamStatus)),!i&&t&&e.messageChannels&&APP.USER.slackerUser().policy&&e.messageChannels.forEach((t=>{"status"==t.messageType&&s.initSocialMessaging([t],e.festivalId)}))),s.subTypes||(s.subTypes=[]),"string"==typeof s.score&&(s.score=parseFloat(s.score)),"string"==typeof s.popularity&&(s.popularity=parseFloat(s.popularity)),s.duration&&(s.displayDuration="string"==typeof s.duration?formatPTtime(s.duration,!0,
1!0):formatSecondsAsTime(s.duration/1e3)),s.countdown||(s.countdown=ko.observable(0)),this.isVod(s.subTypes.includes("recorded")),e.rights)if(e.rights.permissions)s.isPaywallVideo(e.rights.permissions.ondemand);else for(var a in e.rights)s[a.toLowerCase]=e.rights[a],s.onDemand&&(s.olicensed=s.onDemand);s.playerRelatedList||(s.playerRelatedList=[]),s.bestTrackLink&&(s.songLink=s.bestTrackLink),"station"==s.type&&!s.sid&&s.objectId&&(s.nodeType="station",s.sid=s.objectId,s.basicradio=1,s.isPlaying=ko.computed(function(){var e=APP.slackerPlayerSession(),t=e?e.currentPlayableItem():null;return t&&t.id==this.sid}.bind(s)));[s.stationType,s.type,s.itemMatchType].some((function(e){return"string"==typeof e&&("favs"===e||0===e.indexOf("favs:"))}))&&(s.nodeType="station",s.basicradio=1,Array.isArray(s.subTypes)?-1===s.subTypes.indexOf("favorites")&&s.subTypes.push("favorites"):s.subTypes=["favorites"]),s.isSpotlight&&s.spotlightBgImageUrl(this.featureImgUrl),"storeItem"==s.type&&(s.title=s.name,s.posterImgUrl=s.imgUrl,s.featureImgUrl=s.imgUrl),this.isExternal=s.classNames(0).indexOf("external")>-1},__constructSectionItem:function(e,t,i){if(e.festival){const t=e.description,i=e.title,s=e.subtitle,a=e.featureImgUrl,n=e.posterImgUrl;(e=e.festival).description=t,e.title=i,e.subtitle=s,e.posterImgUrl=n,e.featureImgUrl=a}e.isSpotlight=t.isSpotlight;let s=new this._abstractDisplayableItem(e,t,i);if(s.videoId&&(s.objectId=s.videoId),"station"==s.type){!s.id&&s.sid&&(s.id=s.sid.split("/")[2]);let e=SlackerBaseStationCacheAction.getStation(s.id);e&&(s.link||(s.link=e.link),e.episode?(s.title=e.episodeName,s.description="Episode "+e.episodeNumber+" of "+e.showName):e.genreNames&&e.genreNames.length?s.description=e.genreNames[0]+" Station":s.subtitle=null),s.posterImgUrl&&(s.posterImgUrl+=this.SLACKER_TILE_IMG_FMT)}return s.isVideo=!0,APP.canShowSlackerStationLink?s.slackerUrl&&(s.basicradio=1):s.slackerUrl=null,s.isSpotlight=t.isSpotlight,s.hasDetail=t.isSpotlight&&("recorded"!==s.subTypes[0]||"tv"!=APP.implementationSuperType()),s.fields&&(t.classNames.indexOf("newsletter")>-1&&(s.action=new NewsletterSignupAction(s._links.submit.href,function(e){e.bIsOk&&(APP.currentView.data().splice(this.position,1),APP.currentView.data.valueHasMutated())}.bind(t))),t.hasForm(!0)),s.countdown&&s.countdown.timestamp-(new Date).getTime()>0?(s.countdownMessage(s.countdown.message),s.countdown=ko.observable(s.countdown.timestamp)):s.countdown=ko.observable(0),s.isSpotlight?(s.countdown()&&(s.monitorCountDown=this.getCountdownListener(s,this.__constructSectionItem.bind(this),t)),"offline"!==s?.streamStateBadge?.()&&(s.slackerUrl=null)):s?.description?.length>160&&(s.description=s.description.replace(/<([^>]*?)>/gi,"").substring(0,160)+"..."),ko.observable(s)},_abstractSection:function(e,t,i){const s=this;this.id="s-"+generateUniqueID(),this.reportingId=i,this.position=0,this.title=e||null,this.description=t,this.classNames="section",this.advisory=null,this.links=null,this.iconPath=null,this.isSpotlight=!1,this.hasHeroButtonActions=!0,this.subTypes=[],this.filter=ko.observable(null).extend({rateLimit:200}),this.hasFilterData=ko.observable(!1),this.isEditDirty=ko.observable(!1),this.isReordering=ko.observable(!1),this.playlistLen=ko.observable(!1),this.offer=null,this.tabs=ko.observableArray([]),this.activeTab=ko.observable(null),this.sectionData={artistMetaData:null,albumMetaData:null,songMetaData:null,collapseScrollY:null,editable:{type:null,remove:null,addToStation:null,addToPlaylist:null,rename:null,redescription:null},share:null,bookmark:null,artistNav:null},this.useSpotlightEditActions=!1,this.useSpotlightSectionData=!1,this.pagingData=ko.observable(null),this.content=ko.observableArray([]),this.contentMobile=ko.observableArray([]),this.content.type="video",this.content.listType=null,this.content.getListType=ko.pureComputed(function(){this();return this.listType}.bind(this.content)),this.content.getType=ko.pureComputed(function(){this();return this.type}.bind(this.content)),this.playerRelatedList=[],this.form={},this.spotlightRotateFrequency=1e4,this.spotlightItem=ko.observable({index:0,item:null}),this.hasMoreLabel=ko.observable(""),this.isLoadingMore=ko.observable(!1),this.hasMore=ko.observable(!1),this.hasLess=ko.observable(!1),this.hasForm=ko.observable(!1),this.canToggleDescription=ko.observable(0),this.spotlightLeftEnabled=ko.observable(!1),this.spotlightRightEnabled=ko.observable(!1),this.carouselRightEnabled=ko.observable(!1),this.carouselLeftEnabled=ko.observable(!1),this.visibleDescription=ko.observable(this.description),this.spotlightRotateTimer=null,this.saveDirtyEdit=function(){},this.bemModifiers=[],this.tabIndex=0,this.expandWithBemClasses=window.APP_LIB.util.expandWithBemClasses,this.changeTab=function(e){const t=this;
1e.id!=this.activeTab().id&&(APP.checkAcessibilityTTSAction(`Loading ${e.title}`,null,!1,{forceFinish:!0}),e.classNames.indexOf("schedule")?(this.content([]),APP.NETWORKING.do(e._links.details.href,(function(i,s,a){if(!i)return void CONSOLE.warn("No content for selected stage: "+e._links.details.href);const n=APP.currentView.parseResponse(i,!0);n&&n.sections.forEach((e=>{e.classNames.indexOf("schedule")>-1&&(t.visibleDescription(e.description),t.content(e.content()),setTimeout((e=>{APP.checkAcessibilityTTSAction("Loaded",null,!0,{forceFinish:!0}),APP.currentView._doCapitalisticThings(!0)}),200))})),t.activeTab(e)}),"GET")):(this.activeTab(e),setTimeout((e=>{APP.checkAcessibilityTTSAction("Loaded",null,!0,{forceFinish:!0})}),200)))}.bind(this),this.getHasMoreFromMixerFullMethod=(e,t,i)=>t=>{const s=require("com.slacker.app.modules.NetworkModule");this.isEditDirty(!1),APP.currentView.isEditDirty(!1),this.isLoadingMore(!0),s.do(`${e.replace(/(&)?rnd=([^&]+)/,"")}&rnd=${(new Date).getTime()}`,((e,s,a)=>{if(this.isLoadingMore(!1),e?.content.length)if(e.page){if(this.dataPreview=[],this.currentPage=0,this.hasAds=!1,this.doSeeMore(e.content),1==e.page.totalPages?(this.hasMore(!1),this.hasLess(!0)):(APP.currentView.parsePageData.bind(this)(e),this.hasMore(!1),this.hasLess(!1)),0==e.page.totalPages&&(this.hasLess(!1),e.links&&this.viewPointer)){APP.halifyLinks(e.links).next||0!=e.page.number||this.pagingData(null)}try{this.tabPaneId?APP.scrollItemIntoView($(`section#${this.tabPaneId}`)):APP.scrollItemIntoView($(`section#${this.id}`)),"tv"==APP.implementationSuperType()&&setTimeout((()=>{const e=this.content.listType?$(`#${this.id}`).find(".column.button.play")[1]:$(`#tile-${tmpItems[0]().uiItemId}`).find(".tile")[0];e&&e.focus()}),200)}catch(e){}}else{let t=e.content.splice(this.dataPreview.length);i&&t.sort(i),this.doSeeMore(t)}else CONSOLE.warn('No sections returned for section "more" request.');t&&t()}),"GET","json")},this.setHasMoreLess=function(e,t,i,s){const a=this;let n=this.sectionIndex,o=0;this.dataPreview=t?.content?t.content:t,this.dataFull=i,a.hasMoreLabel(e),this.doSeeMore=(e,t)=>{const i=APP.currentView;let o=0,r=e&&void 0===e.title?e:this.dataFull;if("function"==typeof r)return void r.bind(this)();this.hasMore(!1),this.hasLess(!0),this.sectionData.collapseScrollY=window.scrollY;let l=this.dataPreview.concat(r).map(((e,t)=>{let i,r,l=o++;return a.content.listType&&"playlist-tracks"==a.content.listType&&(e.nodeType||(e.nodeType="song"),e.playlistid=a.reportingId.split("/tracks")[0],e.sectionItemIndex=t),r=s?s(e,a):e,i=r(),i.sectionIndex=n,void 0===e.sectionItemIndex&&(i.sectionItemIndex=l),(e.score||e.popularity)&&i.scorePercent(Math.max(0,100*(e.score||e.popularity))+"%"),r}));a.content.listType&&a.content.listType.indexOf("-songs")>-1&&l.sort((function(e,t){return t().scorePercent-e().scorePercent})),this.content(l),i&&setTimeout((()=>{if(i.capitalism($(`#${this.id}`).toArray(),this),i._doLazyImageLoading(!0,`#${a.id}`),!t&&"tv"==APP.implementationSuperType())try{const e=this.content(),t=this.dataPreview.length?e[this.dataPreview.length-1]().uiItemId:e[0]().uiItemId;t&&$(`#video-${t}`).focus()}catch(e){CONSOLE.error(["Unable to set focus to item in current section after doSeeMore "],e)}}),200)},this.doSeeLess=()=>{const e=APP.currentView,t="tv"==APP.implementationSuperType(),i=this.dataPreview.length?this.dataPreview.length:a.content.listType&&a.content.listType.indexOf("-songs")>-1?5:e.dataPreviewCount||6;let s=this.content().splice(0,i);a.content.listType&&a.content.listType.indexOf("-songs")>-1&&s.sort((function(e,t){return t().scorePercent-e().scorePercent})),this.content(s);try{this.isEditDirty(s.filter((e=>e().removed())).length>0)}catch(e){this.isEditDirty(!1)}e.isEditDirty(this.isEditDirty()),this.hasMore(!0),this.hasLess(!1),isNaN(this.sectionData.collapseScrollY)||setTimeout(function(){window.scrollTo(0,this.sectionData.collapseScrollY),this.sectionData.collapseScrollY=null}.bind(this),100),e.capitalism($(`#${this.id}`).toArray(),this),e._doLazyImageLoading(!0,`#${a.id}`),t&&setTimeout((()=>{try{let e=this.content()[0]().uiItemId;e&&$(`#video-${e}`).focus()}catch(e){}}),200)},o=0,this.doSeeMore([],!0),this.hasMore(i.length>0),this.hasLess(!1)}.bind(this),this.toggleDescription=function(e){let t=this.visibleDescription();this.description&&(t.length<this.description.length||this.description.length<501?(this.description.length>500&&this.canToggleDescription(-1),this.sectionData.collapseScrollY=window.scrollY,this.visibleDescription(this.description.replace(/\n/g,"<br/><br/>"))):(this.canToggleDescription(1),this.visibleDescription(this.description.substring(0,500).replace(/\n/g,"<br/><br/>")+"..."),isNaN(this.sectionData.collapseScrollY)||setTimeout(function(){window.scrollTo(0,this.sectionData.collapseScrollY),this.sectionData.collapseScrollY=null}.bind(this),100)))}.bind(this),this.doSeeLess=function(){},this.doSeeMore=function(){var e,t,i,a,n,o,r=APP.mainNav(),l=r.length;if(s.links&&s.links.nav){for(i=0;i<l;i++){if(r[i].href()===s.links.nav.href)return void r[i]._onClick();if(r[i].subnav()&&r[i].subnav().length)for(e=r[i].subnav().length,a=0;a<e;a++)if(r[i].subnav()[a].length){for(t=r[i].subnav()[a].length,k=0;k<t;k++)if(r[i].subnav()[a][k].href()===s.links.nav.href)return void r[i].subnav()[a][k]._onClick()}else if(r[i].subnav()[a].href()===s.links.nav.href)return void r[i].subnav()[a]._onClick()}for(url in APP.SERVICE.urls.DATA)if(n===s.links.nav.href)return o={seoName:n,_links:s.links},void APP.goToPage(n.split("/")[0],o)}},this._doPagination=function(e,t){const i=this.viewPointer,s=APP.USER.slackerUser(),a="tv"==APP.implementationSuperType();let n,o,r,l=0,c=[];if("boolean"!=typeof t&&(t=!1),!i||!s||!s.policy&&"archive"!=i.seoName)return void CONSOLE.warn("Attempting to paginate section before view is complete or user is hydrated. Wait for view and user.");if(!this.hasFilterData()||this.contentFilterComputed||t||(this.contentFilterComputed=a?$(`${this.viewPointer.domContainerId}`).on("change",".sectionFilterInput",(()=>this._doPagination(null,!0))):ko.computed(function(){this.filter();this._doPagination(null,!0)}.bind(this)).extend({rateLimit:200})),a&&setTimeout((()=>APP._setNavigating(!0)),10),this.filter()){CONSOLE.warn("Filtering section data ("+this.id+"): count = "+this.data.length),t=!0;const e=["title","artist","artistName","album","albumName"],i=e.length,s=this.filter().toLowerCase();r=ko.utils.arrayFilter(this.data,function(t,a){let n;for(t.rootIndex=a,n=0;n<i;n++){const i=e[n];if(t[i]?.toLowerCase().indexOf(s)>-1)return CONSOLE.debug("Section filter: found match -> "+[i,s]),!0}}.bind(this)),APP.checkAcessibilityTTSAction(`${r.length} matching item${0==r.length||r.length>
11?"s":""}`)}else CONSOLE.warn("Displaying root section data ("+this.id+")."),r=this.data,this.currentPage<0&&(this.currentPage=0),t&&($(`#${this.id}`)[0]&&APP.checkAcessibilityTTSAction("Filter reset"),t=!1);let d=this.filter()?0:this.currentPage*this.maxRowCount,u=this.filter()?r.length:this.maxRowCount;for(r[l+d]||(this.currentPage--,d=this.currentPage*this.maxRowCount);r&&l<u&&r[l+d];)o=r[l+d],o.nodeType||(o.nodeType=o.type||"song"),o.sectionItemIndex=l,t||(o.rootIndex=l+d),i.playlistDef&&(o.playlistid=i.playlistDef.playlistid),n="function"==typeof o?o:i.__constructSectionItem(o,this),c.push(n),l++;this.hasAds=!1,this.content(c);let h=r?Math.ceil(r.length/this.maxRowCount):0,p={links:[]},m=function(e){let t;switch(e.label){case"NEXT":t=Math.max(this.currentPage+1,h-1);break;case"PREV":t=Math.max(this.currentPage-1,0);break;default:t=e.label-1}this.currentPage!=t&&(this.pagingData().links[this.currentPage]&&this.pagingData().links[this.currentPage].isActive(!1),this.pagingData().links[t]&&this.pagingData().links[t].isActive(!0),this.currentPage=t,this._doPagination(),this.pagingData.valueHasMutated());try{setTimeout((()=>{this.tabPaneId?window.scrollTo(0,$("section#"+this.tabPaneId).offset().top):window.scrollTo(0,$("section#"+this.id).offset().top)}),250)}catch(e){}}.bind(this),g=Math.max(this.currentPage-3,0),P=g+3+1,y=!1,f=h>5,A=0;if(h>1&&!this.filter())for(h>5&&(A=1,p.links.splice(A,0,{label:"PREV",ariaLabel:"Previous Page",action:!0,_onClick:function(){this.isActive()||m(this)},isActive:ko.observable(0==this.currentPage),classNames:ko.observable("")}),p.links.splice(A,0,{label:"NEXT",ariaLabel:"Next Page",action:!0,_onClick:function(){this.isActive()||m(this)},isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("")}));h>0;){if(h>g&&h<=P&&p.links.splice(A,0,{label:h,ariaLabel:`Page ${h}`,action:!0,_onClick:m,isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("")}),h>P&&!y&&(y=!0,p.links.splice(A,0,{label:h,ariaLabel:`Page ${h}`,action:!0,_onClick:m,isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("")}),f&&p.links.splice(A,0,{label:"...",ariaLabel:null,action:!1,_onClick:null,isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("jumpto")})),h==g){f&&p.links.splice(A,0,{label:"...",ariaLabel:null,action:!1,_onClick:null,isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("jumpto")}),h>0&&p.links.splice(A,0,{label:"1",ariaLabel:"Page 1",action:!0,_onClick:m,isActive:ko.observable(this.currentPage+1==h),classNames:ko.observable("")});break}h--}this.pagingData(p),a?(setTimeout((()=>APP._setNavigating(!1)),10),c.length&&("init"!==e&&"tesladash"!=APP.appImplementationModule.type?setTimeout((()=>{var e=this.content.listType?$(`#${this.id}`).find(".column.button.play")[1]:$(`#tile-${c[0]().uiItemId}`).find(".tile")[0];e&&e.focus()}),200):setTimeout((()=>this.viewPointer._doLazyImageLoading(!0)),2e3))):setTimeout((()=>APP.currentView.capitalism($(`#${this.id}`).toArray(),this)),200)}.bind(this),this.initializeCarouselSlides=function(){const e=this.content();if(e&&0!==e.length){CONSOLE.debug("Initializing carousel slides");for(let t=0;t<e.length;t++){const i=$(`#tile-${e[t]().uiItemId}`);i.removeClass("left").removeClass("right"),t!==this.spotlightItem().index&&i.addClass("right")}this.slidesInitialized=!0,CONSOLE.debug("Carousel initialization complete")}},this.setSpotlightAutoRotate=function(e,t,i){const s=this;this.spotlightRotateTimer&&(clearTimeout(this.spotlightRotateTimer),this.spotlightRotateTimer=0),e?(CONSOLE.debug("Auto-rotation cancelled"),s.isAutoRotating=!1):Browser._visible?(CONSOLE.debug(`Setting autorotate for section ${this.id}`),t&&!this.slidesInitialized&&this.initializeCarouselSlides(),s.content().length>1&&(this.spotlightRotateTimer=setTimeout((()=>{const e=s.spotlightItem();window.scrollY<500&&(s.isAutoRotating=!0,e.index+1<s.content().length?(s.forceDirection=1,s.setCurrentSpotlightItem(e.index+1)):(s.forceDirection=1,s.setCurrentSpotlightItem(0,!1,!0)),setTimeout((()=>{s.isAutoRotating=!1}),500)),s.setSpotlightAutoRotate()}
1),this.spotlightRotateFrequency))):(CONSOLE.debug(`Browser in BG. Skipping rotation for ${this.id}`),this.spotlightRotateTimer=setTimeout(s.setSpotlightAutoRotate.bind(s),this.spotlightRotateFrequency)),i&&(ci.item=null,ci.disposed=!0,this.spotlightItem(ci))},this.carouselRotate=function(e,t){const i=this,s=$(`#${this.id}`),a=s.find(".scroll-container")[0],n=$(a),o=n.children().find(".tile-container"),r=s.width();if(1==e&&!this.carouselRightEnabled()||-1==e&&!this.carouselLeftEnabled()||n.hasClass("isScrolling")||!a)return;APP.MESSAGING.closeContextMenu();const l=o.outerWidth(!0);let c=0;if(t)c=1==e?a.scrollWidth-r:0;else{const t=Math.floor(r/l);c=1==e?Math.min(a.scrollWidth-r,a.scrollLeft+t*l):Math.max(0,a.scrollLeft-t*l)}n.addClass("isScrolling"),n.animate({scrollLeft:c},500,"swing",(()=>{n.removeClass("isScrolling"),i.carouselRightEnabled(Math.round(a.scrollLeft+r)<Math.round(a.scrollWidth-5)),i.carouselLeftEnabled(a.scrollLeft>0),i.updateTabbableTiles(o,n),CONSOLE.debug(`Carousel scroll position: ${a.scrollLeft}/${a.scrollWidth}, right enabled: ${i.carouselRightEnabled()}, left enabled: ${i.carouselLeftEnabled()}`)}))},this.handleSpotlightTabMgmt=function(e,t){e||t?(e&&e.attr("inert",""),t&&t.removeAttr("inert")):$("section.spotlight").find(".tile-container").each((function(e,t){$slide=$(this),0===e?$slide.removeAttr("inert"):$slide.attr("inert","")}))},this.setCurrentSpotlightItem=function(e,t,i,a){const n=this.spotlightItem(),o=this.content();let r,l;if(this.setSpotlightAutoRotate&&("number"!=typeof e||n.index!==e)){if("number"==typeof e&&(e<0&&(e=0),e>=o.length&&(e=o.length-1)),!this.slidesInitialized&&!a){for(let e=0;e<o.length;e++){const t=$(`#tile-${o[e]().uiItemId}`);t.removeClass("left").removeClass("right"),0!==e&&t.addClass("right")}this.slidesInitialized=!0}if(null!==this.forceDirection?(l=this.forceDirection,this.forceDirection=null):"number"==typeof e&&void 0!==n.index?(l=e>n.index?1:-1,0===e&&n.index===o.length-1?l=1:e===o.length-1&&0===n.index&&(l=-1)):l=1,this.lastSpotlightDirection=l,CONSOLE.debug(`Transition: ${n.index} â ${e}, Direction: ${l}`),a)"number"!=typeof e&&n&&(e=n.index),"number"==typeof e&&"function"==typeof o[e]&&(r=o[e]());else{if(i){for(let t=0;t<o.length;t++){const i=$(`#tile-${o[t]().uiItemId}`);i.removeClass("left").removeClass("right"),t!==e&&i.addClass("right")}"number"==typeof e&&o[e]&&(r=o[e]()),s.handleSpotlightTabMgmt()}else if("number"==typeof e&&o[e]){r=o[e]();const t=`#tile-${r.uiItemId}`,i=$(t);if(n.item){const e=`#tile-${n.item.uiItemId}`,a=$(e);n.item.contentUrl&&APP.currentView.detailPlayer&&APP.currentView.detailPlayer.stop(),a.removeClass("left").removeClass("right"),i.removeClass("left").removeClass("right"),this._slideTimeout&&(clearTimeout(this._slideTimeout),this._slideTimeout=null),l>0?(i.addClass("right"),this._slideTimeout=setTimeout((()=>{a.addClass("left"),i.removeClass("right"),APP.currentView._doLazyImageLoading(!0,t),this._slideTimeout=null,s.handleSpotlightTabMgmt(a,i)}),20)):(i.addClass("left"),this._slideTimeout=setTimeout((()=>{a.addClass("right"),i.removeClass("left"),s.handleSpotlightTabMgmt(a,i),APP.currentView._doLazyImageLoading(!0,t),this._slideTimeout=null}),20))}else i.removeClass("left").removeClass("right"),s.handleSpotlightTabMgmt(null,i),APP.currentView._doLazyImageLoading(!0,t)}t?this.setSpotlightAutoRotate(!0):APP.EVENTS.notify(APP.EVENT.SPOTLIGHTROTATE,[this.spotlightItem()])}r&&(this.spotlightItem({index:Number(e),item:r,disposed:!1}),this.spotlightItem.valueHasMutated(),this.spotlightLeftEnabled(e-1>-1),this.spotlightRightEnabled(e+1<o.length),APP.currentView&&APP.currentView.spotlightImageHelper(this),a||APP.checkAcessibilityTTSAction(null,r)),setTimeout((()=>{$(`#${this.id} .tile-container:not(.left):not(.right) .metadata .button:visible, #${this.id} .tile-container:not(.left):not(.right) .metadata .edit-actions`).each(((e,t)=>{0!=e&&$(t).addClass("secondary")}))}),250)}},this.updateTabbableTiles=(e,t)=>{let i=e;if(!i&&!t)return;i||(i=t.find(".tile-container"));const s=t.innerWidth(),a=!!t[0]&&t[0].scrollWidth>t[0].clientWidth+1;i.each((function(){const e=$(this);(e=>{if(!a)return!0;const i=e.offset().left-t.offset().left,n=e.outerWidth();return i>=0&&i<=s-n+5})(e)?e.removeAttr("inert"):e.attr("inert","")}))},this.spotlightRotate=function(e){if(1==e&&!this.spotlightRightEnabled()||-1==e&&!this.spotlightLeftEnabled())return;const t=this.spotlightItem(),i=this.content();let s=t.index+e;s<0&&(s=i.length-1),s>=i.length&&(s=0),this.forceDirection=e,this.setCurrentSpotlightItem(s,!0)},this.generateOfferHtml=function(e){return e.detail?(e.linksMap&&!e.links||(e.linksMap={},e.links.forEach((t=>{e.linksMap[t.rel]=t.href}))),e.detail.indexOf("{@")>-1?APP.getFormattedHtmlFromString({msg:e.detail,links:e.linksMap}):e.detail):""}},onEventWatchNow:function(e,t,i,s){const a=$("body"),n=APP.USER.slackerUser()&&APP.USER.slackerUser().policy&&APP.USER.slackerUser().policy.
1capabilities?APP.USER.slackerUser().policy.capabilities.features:null,o=encodeURIComponent(`${location.protocol}//${location.host}`);let r,l,c,d,u,h;if("string"!=typeof t&&(t=null),n&&n.ad_free.enabled&&(i=!0),this.embedPostMessageListener&&(window.removeEventListener("message",this.embedPostMessageListener,!1),this.embedPostMessageListener=null),!e?.floating&&APP?.slackerPlayerSession?.()?.currentPlayableItem?.())try{APP.slackerPlayerSession().currentPlayableItem().stop("Video",null,!0)}catch(e){CONSOLE.warn("Error stopping current radio session: ",e)}try{ko.applyBindings(APP,$("#hero-embed-player")[0])}catch(e){}if(APP?.currentView?.heroPreview?.videoplayer?.stop?.(),APP?.currentView?.detailPlayer?.stop?.(),!t){if(e&&void 0!==e.seoName?r=e:(r=this.data().length>0?this.data()[0]:this.data(),r.contentUrl||(r=r.content[0])),!APP.checkPaywallVideo(r,!1,(()=>this.onEventWatchNow(e,t,i,s))))return;try{h=APP.SERVICE.isCached("v")?parseInt(100*APP.SERVICE.isCached("v")):50}catch(e){h=50}if((Browser.isMobileDevice()||e&&e.floating)&&(h=0),l=r.seoName.split("/"),c=l.shift(),"live-events"===c)l.shift(),d="eventId",u=l.shift();else d="videoId",u=l.shift();t=APP.SERVICE.URLMODULE.get(`${APP.SERVICE.URLMODULE.SERVICE.DATA.ROOT}/embed/?${d}=${u}&origin=${o}&cid=${e&&e.floating?"floating":"lxlsite"}&volume=${h}`),s||BEACON.tagEvent({name:"playStart",params:{type:"video",value:"watchNow",label:u,video:u}})}i&&(t+="&disablePreroll=true"),$(".capUnit.topmost.billboard").each((function(e,t){$(t).empty().addClass("empty").addClass("lazy").removeClass("h250"),SADS.destroyDFPSlots([t.id])})),this.embedPlayerChanging=!0,this.embedPostMessageListener=this.onPostMessageReceived.bind(this),window.addEventListener("message",this.embedPostMessageListener,!1),APP.animationFrame.call(window,(()=>{APP.heroEmbedData({embedUrl:t,itemParam:d,itemId:u,label:e&&e.label}),e&&e.floating?(a.addClass("hero-player-floating"),a.removeClass("hero-embed")):(a.addClass("hero-embed"),a.removeClass("hero-player-floating"),APP.EVENTS.notify(APP.EVENT.VIEWOBSCURED,[APP.currentView,!0]))}))},onPostMessageReceived:function(e){const t=APP.SERVICE.URLMODULE.get(APP.SERVICE.URLMODULE.SERVICE.DATA.ROOT).split("//")[1],i=APP.USER.slackerUser();let s;if(e.origin.indexOf(t)>-1){CONSOLE.info(["PostMessage Received: ",e.origin,e.data]);try{s=JSON.parse(e.data)}catch(e){s={}}switch(s.state){case"start":case"play":this.embedPlayerChanging=!1;break;case"changing":this.embedPlayerChanging=!0;case"end":case"complete":case"error":"error"==s.state&&APP.MESSAGING.prompt("modalError",{reason:"An unexpected error occured attempting to play the requested video."}),this.embedPlayerChanging&&"error"!=s.state&&!s.forceClose||(this.embedPostMessageListener&&(window.removeEventListener("message",this.embedPostMessageListener,!1),this.embedPostMessageListener=null),setTimeout((()=>APP.closeEmbedHeroPlayer()),1e3))}if("profile"===s.command)s.value&&(s.value.images&&i&&(i.profileImgUrl=s.value.images.avatar.urls.small,APP.USER.slackerUser(i)),this._onUserProfileUpdate&&(s.value.isExternalUpdate=!0,this._onUserProfileUpdate(s.value)))}},addSectionTabIndices:function(e,t){const i=(e=0)=>void 0!==t?t:e;Array.isArray(e)?(e.forEach(((e,t)=>{this.addSectionTabIndices(e,i(t))})),e.tabs&&(e.tabIndex=APP.getSectionTabIndex(i()))):"_abstractSection"===Object.getPrototypeOf(e).constructor?.name&&(e.tabIndex=APP.getSectionTabIndex(i()))},onWindowScroll:function(){this.lastScrollPos=$(window).scrollTop(),this._doLazyImageLoading(!0),$(".ui-sortable-helper").css("margin-top",this.lastScrollPos)},_onScheduleItemRender:function(e,t,i){if(t.startTime||"function"==typeof t.countdown&&t.countdown()){const i=`https://${location.hostname}/`+(t.time?this.seoName:t.seoName),s=t.startTime?new Date(t.startTime):new Date(t.countdown()),a={options:{class:"ouical"},providers:null,data:{title:t.time?t.name+" @ "+this.title:t.title,start:s,duration:30,description:t.time?`${this.title} live stream presented by LiveOne - ${i}`:`${t.title} live stream presented by LiveOne - ${i}`,address:i}};let n;try{if(e[1]&&e[1].className.indexOf("reminder")>-1?n=$(e[1]):e[1]&&$(e[1]).find(".reminder")?n=$(e[1]).find(".reminder"):e[0]&&$(e[0]).find(".reminder")&&(n=$(e[0]).find(".reminder")),!n||n.hasClass("with-cal"))return;n.append(createCalendar(a)),n.addClass("with-cal");const t=n.siblings("li").find("a[tabindex]").first().attr("tabindex")||"0",i=n.find("input.add-to-calendar-checkbox");i.attr("tabindex",t),i.on("keydown",(function(e){13===e.which&&(e.preventDefault(),this.click())}
1)),$(document).off("click.ouical keydown.ouical").on("click.ouical",(function(e){const t=$(e.target).closest(".reminder");$("input.add-to-calendar-checkbox:checked").not(t.find("input.add-to-calendar-checkbox")).prop("checked",!1)})).on("keydown.ouical",(function(e){27===e.which&&$("input.add-to-calendar-checkbox:checked").prop("checked",!1).first().focus()})),n.find("a").each(((e,i)=>{const s=i.href,a=i.target;s&&(i.setAttribute("data-href",s),i.removeAttribute("href"),i.removeAttribute("target"),i.setAttribute("role","link"),i.setAttribute("tabindex",t),i.getAttribute("download")&&window.navigator&&window.navigator.msSaveOrOpenBlob?$(i).click((function(){const e=decodeURIComponent($(this).attr("data-href").split(",")[1]),t=new ArrayBuffer(e.length);let s,a=new Uint8Array(t);for(var n=0;n<e.length;n++)a[n]=255&e.charCodeAt(n);try{s=new Blob([t],{type:"text/calendar;charset=utf-8"})}catch(e){const i=new(window.WebKitBlobBuilder||window.MozBlobBuilder);i.append(t),s=i.getBlob("text/calendar;charset=utf-8")}s.lastModifiedDate=new Date,s.name=i.getAttribute("download"),window.navigator.msSaveOrOpenBlob(s,s.name)})):"_blank"==a?$(i).click((function(){window.open($(this).attr("data-href"))})):$(i).click((function(){location.href=$(this).attr("data-href")})),$(i).on("keydown",(function(e){13!==e.which&&32!==e.which||(e.preventDefault(),$(this).trigger("click"))})))}))}catch(e){CONSOLE.warn("Error generating OuiCal reminder object. ",e)}}},_onUserProfileUpdate:function(e={},t=[]){CONSOLE.info(["AbstractView::User profile update response",e]);let i=APP.USER.slackerUser(),s=this.profileUser?.()||i.basicProfile;if(s){if(e.isExternalUpdate&&(s.accountId!=e.accountId||s.lastModified==e.lastModified))return CONSOLE.warn(["AbstractView::Ignoring external user profile update.",e]),s;s.isPrivate="PRIVATE"===e.accessLevel,s.editable=e.accountId===Number(i.id),Object.keys(e).forEach((t=>{s[t]=e[t],"images"==t&&(s.image=e.images.avatar.urls.small),"links"==t&&APP.halifyLinks(e.links,s._links)})),t.forEach((t=>{s[t]&&!e[t]&&(s[t]=null)})),"ProfileView"==this.type&&(this.title=s.handle,this.link=this.seoName=this.historyData.seoName=`user/${s.handle}`)}return e.isExternalUpdate||(APP.MESSAGING.modal().disableClose||APP.MESSAGING.setModal(),APP.notifyPostMessageListeners(JSON.stringify({command:"profile",value:e})),s&&(s.init?s.init=!1:APP.MESSAGING.prompt("ticklerErrorFree",{reason:"Success! You'll see your name and image when you chat during live events."}),this.profileUser&&this.profileUser(s))),i&&i.id==e.accountId&&(e.images?.avatar&&(i.profileImgUrl=e.images.avatar.urls.small),e.name&&(i.name=e.name),i.basicProfile=s,APP.USER.slackerUser(i)),s}},registerPackage("com.slacker.app.view.AbstractView"),AbstractView.prototype.__constants(),com.slacker.app.view.AbstractView=AbstractView,"undefined"!=typeof window){let e;window.addEventListener("resize",(function(){clearTimeout(e),e=setTimeout((function(){const e="undefined"!=typeof APP&&APP.currentView;if(e&&"function"==typeof e._reflowGridAds)try{e._reflowGridAds()}catch(e){CONSOLE.warn(["AbstractView:: ad reflow on resize failed",e])}if(e&&"function"==typeof e._doCapitalisticThings)try{e._doCapitalisticThings(!1,"resize")}catch(e){CONSOLE.warn(["AbstractView:: ad refresh on resize failed",e])}}),150)}))}}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.