(window.multistep_editor_jsonpFunction=window.multistep_editor_jsonpFunction||[]).push([[48],{958:function(e,t,n){"use strict";n.r(t),n.d(t,"AuWidgetSteps",function(){return d}),n.d(t,"widget",function(){return d});var s,r=n(0),a=n(2),i=n(160),c=n(1);!function(e){e[e.previous=0]="previous",e[e.visited=1]="visited",e[e.all=2]="all"}(s||(s={}));var o=n(15),u=n(46),l=n(76),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(r.d)(t,e),t.prototype.connectedCallback=function(){var t=this;e.prototype.connectedCallback.call(this),this.stepSubscription=this.observe(o.a.STEP_CHANGED).subscribe(function(e){return t._stepChangeCallback(e)})},t.prototype._stepChangeCallback=function(e){return Object(r.b)(this,void 0,void 0,function(){var t;return Object(r.e)(this,function(n){switch(n.label){case 0:if(t=e.data.step,!c.a.isNotNullOrUndefined(this.params)||!c.a.isNotNullOrUndefined(this.params.availabilityMode))return[3,7];switch(s[this.params.availabilityMode.toString()]){case s.previous:return[3,1];case s.visited:return[3,3];case s.all:return[3,5]}return[3,5];case 1:return[4,this.stepsManager.handleModePrevious(t)];case 2:return n.sent(),[3,6];case 3:return[4,this.stepsManager.handleModeVisited(t)];case 4:return n.sent(),[3,6];case 5:return[3,6];case 6:this.updateParams(this.params),n.label=7;case 7:return[2]}})})},t.prototype.updateParams=function(e){e.steps&&this.changeStepState(e.steps)},t.prototype.changeStepState=function(e){return Object(r.b)(this,void 0,void 0,function(){var t,n,s,a,i,c,o,u,l;return Object(r.e)(this,function(d){switch(d.label){case 0:t=this.stepsManager.steps,d.label=1;case 1:d.trys.push([1,6,7,8]),n=Object(r.k)(Object.entries(e)),s=n.next(),d.label=2;case 2:return s.done?[3,5]:(a=Object(r.h)(s.value,2),i=a[0],c=a[1],[4,this._applyConfig(t,i,c)]);case 3:d.sent(),d.label=4;case 4:return s=n.next(),[3,2];case 5:return[3,8];case 6:return o=d.sent(),u={error:o},[3,8];case 7:try{s&&!s.done&&(l=n.return)&&l.call(n)}finally{if(u)throw u.error}return[7];case 8:return this.stepsManager.update(),[2]}})})},t.prototype._applyConfig=function(e,t,n){return Object(r.b)(this,void 0,void 0,function(){var s,a;return Object(r.e)(this,function(r){return(s=c.a.isNum(t)?e[Number(t)]:e.find(function(e){return e.title===t||e.name===t}))&&(a=e.indexOf(s),c.a.isNotNullOrUndefined(n.enabled)&&this.stepsManager.toggleDisable(a,!n.enabled,!1),c.a.isNotNullOrUndefined(n.disabled)&&this.stepsManager.toggleDisable(a,n.disabled,!1),c.a.isNotNullOrUndefined(n.hidden)&&this.stepsManager.toggleHidden(a,n.hidden,!1)),[2]})})},Object(r.c)([Object(u.b)("StepsManager"),Object(r.g)("design:type",l.a)],t.prototype,"stepsManager",void 0),Object(r.c)([Object(a.c)(),Object(r.g)("design:type",Object)],t.prototype,"params",void 0),t=Object(r.c)([Object(a.a)("au-widget-steps")],t)}(i.a)}}]);