'use strict';var lf=function(a){this.Lj="number"==typeof a?0<a?1:0>a?-1:null:null==a?null:a?-1:1};if("undefined"!=typeof angular){var mf=angular.module("chrome_18n",[]);chrome.runtime&&chrome.runtime.getManifest&&chrome.runtime.getManifest().default_locale&&mf.directive("angularMessage",function(){return{restrict:"E",replace:!0,controller:["$scope",function(a){var b=this;this.Re=this.ld=null;a.dirForText=function(a){b.ld||(b.ld=chrome.i18n.getMessage("@@bidi_dir")||"ltr");b.Re||(b.Re=new lf("rtl"==b.ld));var c=b.Re,e,f=e=0,g=!1;a=(a||"").split(Ze);for(var m=0;m<a.length;m++){var q=a[m];Xe.test(q)?
(e++,f++):Ye.test(q)?g=!0:We.test(q)?f++:$e.test(q)&&(g=!0)}e=0==f?g?1:0:.4<e/f?-1:1;return-1==(0==e?c.Lj:e)?"rtl":"ltr"}}],compile:function(a,b){b=b.key;var c=null,d=document.createElement("amr");b&&!b.match(/^\d+$/)&&(b=chrome.i18n.getMessage(b),null==b&&d.setAttribute("id","missing"));if(b){var e=chrome.i18n.getMessage(b+"_ph"),c=[];if(null!=e)for(c=e.split("\ue000"),e=0;e<c.length;++e)c[e]=c[e].replace(/^{{(.*)}}$/,'<amrp dir="{{dirForText($1)}}">{{$1}}</amrp>');c=chrome.i18n.getMessage(b,c)}else d.setAttribute("r",
"nokey");c?d.innerHTML=c:(d.setAttribute("tl","false"),d.innerHTML=a.html());a.replaceWith(d)}}})};var nf=/^[\w+/]+[=]{0,2}$/;var of=function(a,b,c){a.timeOfStartCall=(new Date).getTime();var d=c||na,e=d.document,f;a:{if((f=(d||na).document.querySelector("script[nonce]"))&&(f=f.nonce||f.getAttribute("nonce"))&&nf.test(f))break a;f=void 0}f&&(a.nonce=f);if("help"==a.flow){var g=oa("document.location.href",d);!a.helpCenterContext&&g&&(a.helpCenterContext=g.substring(0,1200));g=!0;if(b&&JSON&&JSON.stringify){var m=JSON.stringify(b);(g=1200>=m.length)&&(a.psdJson=m)}g||(b={invalidPsd:!0})}b=[a,b,c];d.GOOGLE_FEEDBACK_START_ARGUMENTS=
b;c=a.serverUri||"//www.google.com/tools/feedback";if(g=d.GOOGLE_FEEDBACK_START)g.apply(d,b);else{var d=c+"/load.js?",q;for(q in a)b=a[q],null!=b&&!ya(b)&&(d+=encodeURIComponent(q)+"="+encodeURIComponent(b)+"&");a=e.createElement("script");f&&a.setAttribute("nonce",f);a.src=d;e.body.appendChild(a)}};p("userfeedback.api.startFeedback",of);var pf=function(){this.f=this.b=this.l=this.modelName=this.g=this.a=this.me=""};var qf=chrome.i18n.getMessage("4163185390680253103"),rf=chrome.i18n.getMessage("492097680647953484"),sf=chrome.i18n.getMessage("2575016469622936324"),tf=chrome.i18n.getMessage("128276876460319075"),uf=chrome.i18n.getMessage("3326722026796849289"),vf=chrome.i18n.getMessage("1018984561488520517"),wf=chrome.i18n.getMessage("8205999658352447129"),xf=chrome.i18n.getMessage("5723583529370342957"),yf=chrome.i18n.getMessage("1550904064710828958"),zf=chrome.i18n.getMessage("5014364904504073524"),Af=chrome.i18n.getMessage("2194670894476780934"),
Bf=chrome.i18n.getMessage("6614468912728530636"),Cf=chrome.i18n.getMessage("5910595154486533449"),Df=chrome.i18n.getMessage("5363086287710390513"),Ef=chrome.i18n.getMessage("244647017322945605"),Ff=chrome.i18n.getMessage("5375576275991472719"),Gf=chrome.i18n.getMessage("4592127349908255218"),Hf=chrome.i18n.getMessage("843316808366399491"),If=chrome.i18n.getMessage("5699813974548050528"),Jf=chrome.i18n.getMessage("8515148417333877999"),Kf=chrome.i18n.getMessage("1636686747687494376"),Lf=chrome.i18n.getMessage("4148300086676792937"),
Mf=chrome.i18n.getMessage("3219866268410307919"),Nf=chrome.i18n.getMessage("9211708838274008657"),Of=chrome.i18n.getMessage("8706273405040403641"),Pf=chrome.i18n.getMessage("4756056595565370923"),Qf=chrome.i18n.getMessage("7876724262035435114"),Rf=chrome.i18n.getMessage("5485620192329479690"),Sf=chrome.i18n.getMessage("6963873398546068901"),Tf=chrome.i18n.getMessage("3567591856726172993"),Uf=chrome.i18n.getMessage("3239956785410157548");var Wf=function(a,b){var c=this;this.h=b;this.a=a;this.a.top=a;this.m=[];this.g=!1;this.b=new pf;this.a.videoSmoothnessRatings=this.If(Af,vf,wf,xf,yf,zf);this.a.videoQualityRatings=this.If(Af,Bf,Cf,Df,Ef,Ff);this.a.audioQualityRatings=this.If(Af,Gf,Hf,If,Jf,Kf);this.m=[{value:"Bug",desc:qf},{value:"FeatureRequest",desc:rf},{value:"MirroringQuality",desc:sf},{value:"Discovery",desc:tf},{value:"Other",desc:uf}];this.a.feedbackTypes=this.m;this.a.includeFineLogs=!0;this.a.feedbackType="Bug";this.a.sendFeedback=
this.ul.bind(this);this.a.cancel=this.Ij.bind(this);this.a.attachLogsClick=this.l.bind(this);this.a.viewLogs=this.o.bind(this);this.a.$watchGroup("videoSmoothness videoQuality audioQuality feedbackDescription comments feedbackType".split(" "),this.Kj.bind(this));this.a.sufficientFeedback=!1;this.a.$watch("attachLogs",this.l.bind(this));this.a.attachLogs=!0;this.w=Wa();this.a.userEmail="";chrome.identity.getProfileUserInfo(function(a){c.a.userEmail=a.email;Vf(c)});this.a.yourAnswerText=Uf;this.a.language=
chrome.i18n&&chrome.i18n.getUILanguage?chrome.i18n.getUILanguage():chrome.runtime.getManifest().default_locale;this.a.requestLogsInProgress=!1};h=Wf.prototype;h.If=function(a){for(var b=[],c=1;c<arguments.length;c++)b.push(new Xf(c,arguments[c]));b.push(new Xf(0,arguments[0]));return b};h.Ij=function(){this.a.feedbackDescription&&!confirm(Lf)||window.close()};
h.Kj=function(){var a=this.a.feedbackType;this.a.sufficientFeedback="MirroringQuality"==a?this.a.videoSmoothness||this.a.videoQuality||this.a.audioQuality||this.a.comments:"Discovery"==a?this.a.visibleInSetup||this.a.comments:!!this.a.feedbackDescription};
h.ul=function(){if(this.a.sufficientFeedback){var a=this.a.feedbackType,b="";"MirroringQuality"==a?(this.a.videoSmoothness&&(b+="\nVideo Smoothness: "+this.a.videoSmoothness),this.a.videoQuality&&(b+="\nVideo Quality: "+this.a.videoQuality),this.a.audioQuality&&(b+="\nAudio: "+this.a.audioQuality),this.a.projectedContentUrl&&(b+="\nProjected Content/URL: "+this.a.projectedContentUrl),this.a.comments&&(b+="\nComments: "+this.a.comments)):"Discovery"==a?(this.a.visibleInSetup&&(b+="\nChromecast Visible in Setup: "+
this.a.visibleInSetup),this.a.hasNetworkSoftware&&(b+="\nUsing VPN/proxy/firewall/NAS Software: "+this.a.hasNetworkSoftware),this.a.networkDescription&&(b+="\nNetwork Description: "+this.a.networkDescription),this.a.comments&&(b+="\nComments: "+this.a.comments)):b=this.a.feedbackDescription;a="Type: "+a+"\n\n"+b;this.a.sendDialogText=Mf;this.a.okButton=Tf;this.a.feedbackSent=!1;this.h.show({locals:{Yq:this.a.feedbackSent,hr:this.a.sendDialogText,jk:this.a.okButton},scope:this.a,preserveScope:!0,bindToController:!0,
template:'<md-dialog id="feedback-confirmation"><md-dialog-content><div id="send-feedback-text">{{sendDialogText}}</div><md-dialog-actions><md-button class="md-raised md-primary"ng-disabled="!feedbackSent" ng-click="closeWindow()">{{okButton}}</md-button></md-dialog-actions></md-dialog-content></md-dialog>',controller:this.f});this.Ih(a,Date.now())}};h.Ih=function(a,b){var c=Date.now();!this.a.requestLogsInProgress||5E3<c-b?Yf(this,a):setTimeout(this.Ih.bind(this),1E3,a,b)};
var Yf=function(a,b){var c=0,d=function(b,c,d){d?b(!0):(a.a.sendDialogText=Pf,Vf(a),c(Error("Failed to send")))},e=chrome.declarativeWebRequest?"MrTeamfood":"MRStable";Fe(new De(function(){c++;return new Promise(function(c,g){var f=a.a.userEmail,q=a.b;c=d.bind(null,c,g);g=chrome.runtime.getManifest();of({productId:85561,bucket:e,flow:"submit",serverUri:"https://www.google.com/tools/feedback",allowNonLoggedInFeedback:!0,locale:g.default_locale,enableAnonymousFeedback:!f,report:{description:b},callback:c},
{version:g.version,description:g.description,user_email:f||"NA",logs:q.me||"NA",external_logs:q.a||"NA",device_model:q.modelName||"NA",receiver_version:q.l||"NA",dash_report_url:q.g||"NA",cast_device_counts:q.b,dial_device_counts:q.f})})},1E4,4),2).start().then(function(){a.a.sendDialogText=Of;a.a.feedbackSent=!0;Vf(a)},function(){a.a.sendDialogText=Nf;a.a.feedbackSent=!0;Vf(a)})};
Wf.prototype.l=function(){var a=this;this.b=new pf;this.a.attachLogs&&(this.a.requestLogsInProgress=!0,chrome.runtime.sendMessage(new Ge(this.w,"retrieve_log_data"),function(b){a.a.requestLogsInProgress=!1;a.b.me=b.logs||"no extension";b.castStreamingLogs&&(a.b.g=b.castStreamingLogs);b.castDeviceCounts&&(a.b.b=b.castDeviceCounts);b.dialDeviceCounts&&(a.b.f=b.dialDeviceCounts);if(b=b.device)if(b.model&&(a.b.modelName=b.model),b.version&&(a.b.l=b.version),!a.g){var c=Wa();a.g=!0;a.b.a=Ie(b.ip,c,a.v.bind(a))}}))};
Wf.prototype.o=function(){this.a.logs=this.b.me;this.a.logsHeader=Qf;this.a.sendLogs=Rf;this.a.fineLogsWarning=Sf;this.a.okButton=Tf;this.h.show({locals:{Sq:this.a.attachLogs,me:this.a.logs,cr:this.a.includeFineLogs,fr:this.a.logsHeader,ir:this.a.sendLogs,ar:this.a.fineLogsWarning,jk:this.a.okButton},scope:this.a,preserveScope:!0,bindToController:!0,clickOutsideToClose:!0,template:'<md-dialog><md-dialog-content id="logs-dialog"><div class="subheading">{{logsHeader}}</div><div ng-show="includeFineLogs && attachLogs"id="feedback-fine-log-warning" class="informative">{{fineLogsWarning}}</div><pre>{{logs}}</pre><div class="send-logs"><md-checkbox type="checkbox" ng-model="attachLogs"ng-change="attachLogsClick()"><span>{{sendLogs}}</span></md-checkbox></div><md-dialog-actions><md-button class="md-raised md-primary"ng-click="closeDialog()">{{okButton}}</md-button></md-dialog-actions></md-dialog-content></md-dialog>',
controller:this.f})};Wf.prototype.v=function(a,b){this.g=!1;this.b.a="error"==a?"":b;this.a.attachLogs||(this.b.a="");Vf(this)};var Vf=function(a){a.a.$$phase||a.a.$apply()};Wf.prototype.f=function(a,b){a.closeWindow=function(){window.close()};a.closeDialog=function(){b.hide()}};Wf.prototype.f.$inject=["$scope","$mdDialog"];var Xf=function(a,b){this.id=a;this.desc=b;this.text=0==a?b:a+" ("+b+")"};
angular.module("feedbackApp","chrome_18n material.components.button material.components.checkbox material.components.dialog material.components.input material.components.radioButton".split(" ")).controller("FeedbackCtrl",["$scope","$mdDialog",Wf]);p("ng.safehtml.googSceHelper.isGoogHtmlType",function(a){return a&&a.ec?!0:!1});p("ng.safehtml.googSceHelper.isCOMPILED",function(){return!0});p("ng.safehtml.googSceHelper.unwrapAny",function(a){if(a instanceof bf)return cf(a);if(a instanceof hf)return jf(a);if(a instanceof ef)return ff(a);if(a instanceof Ue)return Ve(a);if(a instanceof Qe)return Re(a);throw Error();});
p("ng.safehtml.googSceHelper.unwrapGivenContext",function(a,b){if("html"==a)return jf(b);if("resourceUrl"==a||"templateUrl"==a)return cf(b);if("url"==a)return b instanceof bf?cf(b):ff(b);if("css"==a)return Ve(b);if("js"==a)return Re(b);throw Error();});
