;'use strict';const OFFLINE_TIMEOUT=30*1000;var FxaModuleUI={maxSteps:null,init:function(flow){HtmlHelper.importElements(this,'fxa-module-header','fxa-module-back','fxa-module-next','fxa-module-navigation','fxa-module-done','fxa-progress');this.fxaModuleHeader.addEventListener('action',function(){FxaModuleManager.close('DIALOG_CLOSED_BY_USER');});this.fxaModuleBack.addEventListener('mousedown',function(){FxaModuleNavigation.back();});this.fxaModuleNext.addEventListener('mousedown',function(){FxaModuleNavigation.next();});this.fxaModuleDone.addEventListener('click',function(){FxaModuleNavigation.done();});var offlineTimer;window.addEventListener('online',function onOnline(evt){clearTimeout(offlineTimer);FxaModule.hideErrorResponse();});window.addEventListener('offline',function onOffline(evt){if(offlineTimer){return;} offlineTimer=setTimeout(function onOfflineTimeout(){return FxaModule.showErrorResponse({error:'OFFLINE'});},OFFLINE_TIMEOUT);});FxaModuleNavigation.init(flow);},setMaxSteps:function(num){this.maxSteps=num;},increaseMaxStepsBy:function(inc){this.maxSteps=this.maxSteps+inc;},decreaseMaxStepsBy:function(dec){this.maxSteps=this.maxSteps-dec;},loadScreen:function(params){var currentScreen=document.querySelector('.current');var nextScreen=params.panel;this.fxaProgress.style.width=(100/this.maxSteps)+'%';LazyLoader.load(nextScreen,function(){var scripts=[].slice.call(nextScreen.querySelectorAll('script')).map(function(script){return script.getAttribute('src');});LazyLoader.load(scripts,function(){if(params.count>1&¶ms.count