'use strict';eb("mr.TestProvider");var oy,Kx,py=eb("mr.Init"),qy=function(a){void 0!==a.use_views_dialog&&py.info("Using the "+(a.use_views_dialog?"Views (Harmony)":"WebUI")+" dialog.");void 0!==a.enable_cast_sink_query&&py.info("Native Cast MRP is "+(a.enable_cast_sink_query?"disabled":"enabled")+".");void 0!==a.use_mirroring_service&&py.info("Native Mirroring Service is "+(a.use_mirroring_service?"enabled":"disabled")+".")};Tr().init();oy=new ub("MediaRouter.Provider.WakeDuration");Kx=new $x;
var ry=(new Promise(function(a,b){switch(window.location.host){case "enhhojjnijigcajfphajepfemndkmdlo":a();break;case "pkedcjkdefgpdelpbcmbmeomcjbeemfm":chrome.management.get("enhhojjnijigcajfphajepfemndkmdlo",function(c){chrome.runtime.lastError||!c.enabled?a():b(Error("Dev extension is enabled"))});break;default:b(Error("Unknown extension id"))}})).then(function(){return chrome.mojoPrivate&&chrome.mojoPrivate.requireAsync?new Promise(function(a){chrome.mojoPrivate.requireAsync("media_router_bindings").then(function(b){mojo=b.getMojoExports&&
b.getMojoExports();b.start().then(function(c){a({mrService:b,mrInstanceId:c.instance_id||c,mrConfig:c.config})})})}):Promise.reject(Error("No mojo service loaded"))}).then(function(a){if(!a.mrService)throw Error("Failed to get MR service");var b=a.mrInstanceId;if(!b)throw Error("Failed to get MR instance ID.");py.info("MR instance ID: "+b);qy(a.mrConfig);var c=a.mrService;if(!Kx)throw Error("providerManager not initialized.");c.setHandlers(Kx);xm(b)&&(oy.g="MediaRouter.Provider.FirstWakeDuration");
chrome.runtime.onSuspend.addListener(oy.end.bind(oy));Bm(b);Wr();b=Jx(!!a.mrConfig.enable_cast_sink_query);window.addEventListener("unhandledrejection",function(d){d=d.reason;d.stack||(d=Error(d));py.error("Unhandled promise rejection.",d)});cy(c,b,a.mrConfig)}).then(void 0,function(a){py.L(a.message);throw a;});[].concat(p([Ix(),Fx()].concat(p(Xp()),p([Xw()])))).forEach(function(a){vm(a)});Ix().addListener();Fx().addListener();chrome.runtime.onStartup.addListener(function(){});ry.then(void 0,function(){return window.close()});
