var __awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{s(n.next(t))}catch(t){o(t)}}function u(t){try{s(n["throw"](t))}catch(t){o(t)}}function s(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(a,u)}s((n=n.apply(t,e||[])).next())})};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return s([t,e])}}function s(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-e6381e49.system.js"],function(t){"use strict";var e,r,n;return{setters:[function(t){e=t.r;r=t.h;n=t.g}],execute:function(){var i=function(){function t(t){e(this,t);this.activeStep=0;this.inactiveSteps=[]}t.prototype.componentDidLoad=function(){var t=this;Array.from(this.host.querySelectorAll("materials-step")).forEach(function(e){if(!e.showButtons){e.showButtons=t.showButtons}});this.calcIndexes()};t.prototype.calcIndexes=function(){return __awaiter(this,void 0,void 0,function(){var t,e;var r=this;return __generator(this,function(n){t=Array.from(this.host.querySelectorAll("materials-step")).filter(function(t,e){return r.inactiveSteps.indexOf(e)<0});t.forEach(function(e,r){e.style.display="flex";e.index=r;e.active=r===0;if(e.index===t.length-1){e.isLast=true}});e=Array.from(this.host.querySelectorAll("materials-step")).filter(function(t,e){return r.inactiveSteps.indexOf(e)>-1});e.forEach(function(t){return t.style.display="none"});this.adjustHeight();return[2]})})};t.prototype.handleActiveStepUpdate=function(){return __awaiter(this,void 0,void 0,function(){var t;var e=this;return __generator(this,function(r){t=Array.from(this.host.querySelectorAll("materials-step")).filter(function(t,r){return e.inactiveSteps.indexOf(r)<0});t.forEach(function(t){if(t.index===e.activeStep){e.currentStep=t}t.active=t.index===e.activeStep});return[2]})})};t.prototype.switchStep=function(t){var e=this;var r=Array.from(this.host.querySelectorAll("materials-step")).filter(function(t,r){return e.inactiveSteps.indexOf(r)<0});var n=r.find(function(e){return!(e.status==="valid"||e.optional)&&e.index<t.detail});if(!n){this.activeStep=t.detail}};t.prototype.openStep=function(t){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(e){this.activeStep=t;return[2]})})};t.prototype.nextStep=function(){return __awaiter(this,void 0,void 0,function(){var t;var e=this;return __generator(this,function(r){t=Array.from(this.host.querySelectorAll("materials-step")).filter(function(t,r){return e.inactiveSteps.indexOf(r)<0});if(this.activeStep<t.length-1){this.activeStep++}return[2]})})};t.prototype.previousStep=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){if(this.activeStep>0){this.activeStep--}return[2]})})};t.prototype.adjustHeight=function(){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){t=Array.from(this.host.querySelectorAll("materials-step"));if(t){t.forEach(function(t){t.adjustHeight()})}return[2]})})};t.prototype.render=function(){return r("slot",null)};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:true,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{inactiveSteps:["calcIndexes"],activeStep:["handleActiveStepUpdate"]}},enumerable:true,configurable:true});Object.defineProperty(t,"style",{get:function(){return":host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:start;justify-content:flex-start;overflow:hidden}"},enumerable:true,configurable:true});return t}();t("materials_stepper",i)}}});