text: (function(){'use strict';function StepsAPI(){var constructor=function(elementID,stepColors){if(api.registerObjectId(elementID)){console.warn('Duplicated id used on instance. ID name: "'+elementID+'"')}
  var root=this;var elementID=elementID;var stepColors=stepColors;var isReady=!1;var stepsNavigation;function setElement(){stepsNavigation=angular.element(document.querySelector('#'+elementID+' .ws-steps'));if(stepColors){stepsNavigation.scope().vm.setEnabledColor(stepColors.enabledColor);stepsNavigation.scope().vm.setDisabledColor(stepColors.disabledColor);stepsNavigation.scope().vm.setEnabledIconColor(stepColors.enabledIconColor)}};function printNoReady(){console.warn('Component is not ready. Use onReady() event.')};this.getElement=function(){if(stepsNavigation&&isReady){return stepsNavigation}
  printNoReady()};this.getElementId=function(){if(stepsNavigation&&isReady){return stepsNavigation.scope().vm.getElementId()}
  printNoReady()}
  this.setStep=function(step){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.setStep(step)}else{printNoReady()}};this.getStep=function(){if(stepsNavigation&&isReady){return parseInt(stepsNavigation.scope().vm.step)}
  printNoReady()};this.getStepAttributes=function(step){if(stepsNavigation&&isReady){return stepsNavigation.scope().vm.getStepAttributes(step)}
  printNoReady()};this.getStepAcrossObject=function(step){if(stepsNavigation&&isReady){return stepsNavigation.scope().vm.getStepAcrossObject(step)}
  printNoReady()}
  this.getTotalSteps=function(){if(stepsNavigation&&isReady){return stepsNavigation.scope().vm.getTotalSteps()}
  printNoReady()};this.setEnabledStep=function(value){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.setEnabledStep(value)}else{printNoReady()}};this.getEnabledStep=function(){if(stepsNavigation&&isReady){return parseInt(stepsNavigation.scope().vm.enabledStep)}
  printNoReady()};this.setEnabledColor=function(color){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.setEnabledColor(color)}else{printNoReady()}};this.setDisabledColor=function(color){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.setDisabledColor(color)}else{printNoReady()}};this.setEnabledIconColor=function(color){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.setEnabledIconColor(color)}else{printNoReady()}};this.onReady=function(callback){var onReadyStepEvent=new StepEvent(elementID,api.events.typeEvent.READY,function(){isReady=!0;setElement();if(callback)callback()});api.addEvent(onReadyStepEvent)};this.onDestroy=function(callback){if(stepsNavigation&&isReady){stepsNavigation.scope().vm.onDestroyCallback=callback}else{printNoReady()}};this.update=function(){if(stepsNavigation&&isReady){root.setStep(root.getStep());root.setEnabledStep(root.getEnabledStep())}else{printNoReady()}}
  this.onStepChange=function(callback){var onStepChangeStepEvent=new StepEvent(elementID,api.events.typeEvent.STEP_CHANGE,function(){if(callback)callback()},!1);api.addEvent(onStepChangeStepEvent)};this.onEnabledStepChange=function(callback){var onEnabledStepChangeStepEvent=new StepEvent(elementID,api.events.typeEvent.ENABLED_STEP_CHANGE,function(){if(callback)callback()},!1);api.addEvent(onEnabledStepChangeStepEvent)};this.onStepChangeNotAllowed=function(callback){var onStepChangeNotAllowed=new StepEvent(elementID,api.events.typeEvent.STEP_CHANGE_NOT_ALLOWED,function(event){if(callback)callback('Step '+event.requestedStepPosition+' is not enabled for the element "'+elementID+'".')},!1);api.addEvent(onStepChangeNotAllowed)}};var StepEvent=function(elementID,type,callback,autoKill){if(autoKill==undefined)autoKill=!0;this.elementID=elementID;this.type=type;this.autoKill=autoKill;this.callback=callback};var eventsList=[];var createdObjectsId={};var createdElementId={};var api={init:constructor,events:{event:StepEvent,typeEvent:{READY:'onReadyEvent',STEP_CHANGE:'onStepChange',ENABLED_STEP_CHANGE:'onEnabledStepChange',STEP_CHANGE_NOT_ALLOWED:'onStepChangeNotAllowed'}},addEvent:function(stepEvent){eventsList.push(stepEvent)},removeEvent:function(stepEvent){var indexEventOnList=eventsList.indexOf(stepEvent);if(indexEventOnList!==-1){eventsList.splice(indexEventOnList,1)}},removeAllEvents:function(elementID){delete createdElementId[elementID];delete createdObjectsId[elementID];var eventsListCopy=eventsList;eventsListCopy.forEach(function(event){if(event.elementID===elementID){eventsList.splice(eventsList.indexOf(event),1)}})},dispatchEvent:function(elementID,typeEvent,params){var cloneEventsList
  cloneEventsList=eventsList;cloneEventsList.forEach(function(stepEvent){if(stepEvent.elementID===elementID&&stepEvent.type===typeEvent&&stepEvent.callback){stepEvent.callback(params);if(stepEvent.autoKill){api.removeEvent(stepEvent)}}})},registerObjectId:function(elementID){var alreadyRegistered=createdObjectsId[elementID];createdObjectsId[elementID]=!0;return alreadyRegistered},registerElementId:function(elementID){var alreadyRegistered=createdElementId[elementID];createdElementId[elementID]=!0;return alreadyRegistered}};return api};function StepColors(){function constructor(enabledColor,disabledColor,enabledIconColor){this.enabledColor=enabledColor;this.disabledColor=disabledColor;this.enabledIconColor=enabledIconColor}
  return constructor}
  function Steps(){return{restrict:'E',controllerAs:'vm',scope:{step:'@',enabledStep:'@',colors:'@'},controller:StepsController,transclude:!0,link:function(scope,element,attrs){if(!attrs.id){throw new Error('Attribute "id" is required on element.',element)}
  var stepsNavigationElement=angular.element(document.querySelector('#'+attrs.id+' .ws-steps'));stepsNavigationElement.scope().vm.setElement(stepsNavigationElement)},bindToController:!0,template:'<div class="ws-steps">'+'<nav class="ws-steps-transclude" ng-transclude>'+'</nav>'+'<div class="steps-line-disabled"></div>'+'</div>'}}
  function StepsController($scope,$attrs,StepsAPI){var vm=this;var stepsNavigation;var lastValidStep=0;if(StepsAPI.registerElementId($attrs.id)){throw new Error('Duplicate usage of an element id named: "'+$attrs.id+'"')}
  function updateStepsStyle(){var currentTotalSteps=getTotalSteps();stepsNavigation.querySelectorAll('.step').forEach(function(step,index){step.style.width='calc(100% / '+currentTotalSteps+')';var stepIndex=(index+1);updateStepStyle(angular.element(step),stepIndex)},this)}
  function updateStepStyle(currentStep,stepIndex){var step=parseInt(vm.step);var enabledStep=parseInt(vm.enabledStep);if(stepIndex<=step){currentStep.scope().vm.isComplete=!0}else{currentStep.scope().vm.isComplete=!1}
  if(stepIndex<=enabledStep){currentStep.attr('enabled','true');currentStep.scope().vm.buttonMode=!0}else{currentStep.attr('enabled','false');currentStep.scope().vm.buttonMode=!1}
  if(stepIndex===step){currentStep.attr('focused','true')}else{currentStep.attr('focused','false')}
  if(step>enabledStep){vm.setStep(enabledStep)}}
  function getTotalSteps(){var totalSteps=document.querySelector('#'+$attrs.id+' .ws-steps nav').children.length;if(totalSteps===0){totalSteps=1};return totalSteps}
  function getCompleteSteps(){return stepsNavigation.querySelectorAll('div.step > .step-line-enabled')}
  function updateCompleteStepsClass(){var completeSteps=getCompleteSteps();var totalSteps=getTotalSteps();completeSteps.forEach(function(completeStep){var stepWidth=parseInt(100/totalSteps);completeStep.style.width=stepWidth+'%';var marginLeft=parseInt(stepWidth)/2;completeStep.style['margin-left']='-'+marginLeft+'%'})};function hideAllContents(exception){vm.stepsChildList.forEach(function(content){if(content.reference!==null){if(content.reference!==exception){document.getElementById(content.reference).classList.add('ws-steps-content-hidden')}else{document.getElementById(content.reference).classList.remove('ws-steps-content-hidden')}}})}
  vm.getTotalSteps=getTotalSteps;vm.getElementId=function(){return $attrs.id}
  vm.setElement=function(element){vm.element=element;stepsNavigation=vm.element[0].querySelector('nav.ws-steps-transclude');if(vm.colors){var newColors=vm.colors.split(',');vm.setEnabledColor(newColors[0]);vm.setDisabledColor(newColors[1]);vm.setEnabledIconColor(newColors[2])}};vm.setEnabledColor=function(color){document.getElementById($attrs.id).style.setProperty('--ws-steps-enabled-color',color)};vm.setDisabledColor=function(color){document.getElementById($attrs.id).style.setProperty('--ws-steps-disabled-color',color)};vm.setEnabledIconColor=function(color){document.getElementById($attrs.id).style.setProperty('--ws-steps-enabled-icon-color',color)};vm.setStep=function(step){vm.step=step};vm.setEnabledStep=function(value){vm.enabledStep=value};vm.getStepAttributes=function(step){var attributes=null;if(step===0)step=1;if(vm.stepsChildList[(step-1)])attributes=vm.stepsChildList[(step-1)].attrs;return attributes};vm.getStepAcrossObject=function(step){var acrossObject=null;if(step===0)step=1;if(vm.stepsChildList[(step-1)])acrossObject=vm.stepsChildList[(step-1)].instance.across;return acrossObject};vm.onDestroyCallback=null;$scope.$on('$destroy',function(){StepsAPI.removeAllEvents($attrs.id)
  if(vm.onDestroyCallback)vm.onDestroyCallback()});vm.stepsChildList=[];function onStepChanged(activeStepPosition){if(activeStepPosition<=vm.enabledStep){updateStepsStyle();updateCompleteStepsClass();lastValidStep=activeStepPosition;var contentIndex=activeStepPosition-1;if(contentIndex<0){hideAllContents()}else{if(vm.stepsChildList[contentIndex])hideAllContents(vm.stepsChildList[contentIndex].reference)}
  StepsAPI.dispatchEvent($attrs.id,StepsAPI.events.typeEvent.STEP_CHANGE)}else{updateStepsStyle();console.warn('Step '+activeStepPosition+' is not enabled for the element "'+$attrs.id+'".');StepsAPI.dispatchEvent($attrs.id,StepsAPI.events.typeEvent.STEP_CHANGE_NOT_ALLOWED,{requestedStepPosition:activeStepPosition})}};function onEnabledStepChanged(enabledStepPosition){updateStepsStyle();StepsAPI.dispatchEvent($attrs.id,StepsAPI.events.typeEvent.ENABLED_STEP_CHANGE)};var onReadyEvent=new StepsAPI.events.event($attrs.id,StepsAPI.events.typeEvent.READY,function(){$scope.$watch('vm.step',onStepChanged);$scope.$watch('vm.enabledStep',onEnabledStepChanged)});StepsAPI.addEvent(onReadyEvent)};function Step(){return{restrict:'E',scope:{icon:'@',title:'@',across:'='},controller:StepController,bindToController:!0,controllerAs:'vm',template:'<div ng-class="{\'button-mode\': vm.buttonMode, \'complete\': vm.isComplete, \'incomplete\': !vm.isComplete}" class="step" ng-click="vm.showContent()">'+'<div class="step-line-enabled"></div>'+'<i class="step-icon material-icons md-18">{{vm.icon}}</i>'+'<span class="step-title">{{vm.title}}</span>'+'</div>'}};StepController.childrenFilter={};function StepController($scope,$attrs,StepsAPI){var vm=this;vm.buttonMode=!1;vm.isComplete=!1;var scopeAttrs={reference:null,instance:vm,attrs:$attrs};if($attrs.ref){document.getElementById($attrs.ref).classList.add('ws-steps-content-hidden');scopeAttrs.reference=$attrs.ref}
  $scope.$parent.$parent.vm.stepsChildList.push(scopeAttrs);var stepsNavigationScope=$scope.$parent.$parent.vm;if(!StepController.childrenFilter[stepsNavigationScope.getElementId()]){StepController.childrenFilter[stepsNavigationScope.getElementId()]=1}else{StepController.childrenFilter[stepsNavigationScope.getElementId()]++}
  var expectedSteps=stepsNavigationScope.getTotalSteps();var currentTotalSteps=StepController.childrenFilter[stepsNavigationScope.getElementId()];$attrs.$set('position',currentTotalSteps);if(expectedSteps===currentTotalSteps){delete StepController.childrenFilter[stepsNavigationScope.getElementId()];StepsAPI.dispatchEvent(stepsNavigationScope.getElementId(),StepsAPI.events.typeEvent.READY)}
  vm.showContent=function(){if($attrs.position<=stepsNavigationScope.enabledStep){stepsNavigationScope.setStep($attrs.position)}else{StepsAPI.dispatchEvent(stepsNavigationScope.getElementId(),StepsAPI.events.typeEvent.STEP_CHANGE_NOT_ALLOWED,{requestedStepPosition:$attrs.position})}}};function StepContent(){return{restrict:'E',link:function(scope,element,attrs){element.addClass('ws-steps-content-hidden')}}};angular.module('wsSteps',['ngMaterial']).factory('StepsAPI',StepsAPI).factory('StepColors',StepColors).directive('steps',Steps).directive('step',Step).directive('stepContent',StepContent)}())