function ResumeSource(){function u(){a(),f(),c(),p()}function a(){e="",t="",o.frameResponded=!1,o.sourcesResponseReturned=!1,o.speakerConnected=!1,o.updateStateAbleToReceiveNavigateRequest=!1,o.nowPlayingStateAbleToReceiveNavigateRequest=!1,o.sourceReady=!1,o.bmxSourceReady=!1,n=!1}function f(){$(funcObj.UIMain).on("mainUIDUpdated sourcesUpdated",h),$(funcObj.sources).one("sourcesResponseReturned",function(){g({sourcesResponseReturned:!0});var e=m();funcObj.sources.isMargeSource(e.source,e.account)||d("tunein","",!1)}),$(funcObj.sources).one("bmxSourceReady",function(){g({bmxSourceReady:!0}),funcObj.presets.requestPresetsFromMarge();var e=funcObj.play.getCurPlaySrc();srcObj&&srcObj[e]&&srcObj[e].getFeature("isBMXSource")&&(funcObj.play.cleanUp(),funcObj.devCon.sendMsg(funcObj.UIMain.getUID(),"nowPlaying"))})}function l(){$(funcObj.UIMain).off("mainUIDUpdated sourcesUpdated",h)}function c(){isBrowser&&(d("tunein","",!1),g({frameResponded:!0})),funcObj.appcomm.appSend({method:"getData",params:{name:"lastSelectedSource"},id:null},function(e){var t;e&&typeof e=="string"?t=JSON.parse(e):t=e,t!=undefined&&t.source&&t.source!="internet_radio"?d(t.source,t.account,!1):d("tunein","",!1),g({frameResponded:!0})})}function h(e,t){if(!n){var r=funcObj.UIMain.getUID();if(r&&r===t){var i=funcObj.devCon.getDevice(r);if(i){var s=m(),o=i.getSources();if(o.length>0){var u=i.getSources(s.account,s.source);u.length?u[0].status&&u[0].status.toUpperCase()==="READY"?g({sourceReady:!0}):g({sourceReady:!1}):(d("tunein","",!1),g({sourceReady:!0}))}else g({sourceReady:!1})}}}}function p(){r=setTimeout(function(){showDebug===2&&console.warn("VSS - Did not hear back from speaker"),funcObj.browsePlaceholder.updatePlaceholderHeader("hamburger",undefined),funcObj.browsePlaceholder.updatePlaceholderBody("systemOff")},i)}function d(n,r,i){n!=="add_service"&&n!=="settings"&&n!=="help"&&n!=="recents"&&(e=n,t=r,i&&(funcObj.appcomm.appSend({method:"setData",params:{name:"lastSelectedSource",value:JSON.stringify({source:n,account:r})},id:null}),showDebug===2&&console.log("Saved selected source to frame")))}function v(){s||(s=!0,clearTimeout(r))}function m(){return v(),e===""&&d("tunein","",!1),{source:e,account:t}}function g(e){if(funcObj.content.getCurSrc()[0]!=="")return;var t=!0;for(var r in e)o[r]=e[r];for(var i in o)if(o[i]==0){t=!1;break}showDebug===2&&(console.log("updateState",e),console.log("stateOfEcosystem",o)),t&&!n&&y()}function y(){var e=m();funcObj.content.openSource(e.source,e.account),n=!0,l()}function b(){var e=!0;for(var t in o)if(o[t]===!1){e=!1;break}return e}var e,t,n,r,i=1e4,s=!1,o={};this.setLastSelMusicSrc=d,this.getLastSelMusicSrc=m,this.updateState=g,this.clearSpeakerWakeTimeout=v,this.getEcoSystemState=b,u()};