//DOM elements
var DOMstrings={stepsBtnClass:"multisteps-form__progress-btn",stepsBtns:document.querySelectorAll(".multisteps-form__progress-btn"),stepsBar:document.querySelector(".multisteps-form__progress"),stepsForm:document.querySelector(".multisteps-form__form"),stepsFormTextareas:document.querySelectorAll(".multisteps-form__textarea"),stepFormPanelClass:"multisteps-form__panel",stepFormPanels:document.querySelectorAll(".multisteps-form__panel"),stepPrevBtnClass:"js-btn-prev",stepNextBtnClass:"js-btn-next"},removeClasses=function(a,b){a.forEach(function(a){a.classList.remove(b)})},findParent=function(a,b){for(var c=a;!c.classList.contains(b);)c=c.parentNode;return c},getActiveStep=function(a){return Array.from(DOMstrings.stepsBtns).indexOf(a)},setActiveStep=function(a){removeClasses(DOMstrings.stepsBtns,"js-active");DOMstrings.stepsBtns.forEach(function(b,c){c<=a&&b.classList.add("js-active")})},getActivePanel=function(){var a;DOMstrings.stepFormPanels.forEach(function(b){b.classList.contains("js-active")&&(a=b)});return a},setActivePanel=function(a){removeClasses(DOMstrings.stepFormPanels,"js-active");DOMstrings.stepFormPanels.forEach(function(b,c){c===a&&(b.classList.add("js-active"),setFormHeight(b))})},formHeight=function(a){DOMstrings.stepsForm.style.height=a.offsetHeight+"px"},setFormHeight=function(){var a=getActivePanel();formHeight(a)};DOMstrings.stepsBar.addEventListener("click",function(a){a=a.target;a.classList.contains(""+DOMstrings.stepsBtnClass)&&(a=getActiveStep(a),setActiveStep(a),setActivePanel(a))});DOMstrings.stepsForm.addEventListener("click",function(a){a=a.target;if(a.classList.contains(""+DOMstrings.stepPrevBtnClass)||a.classList.contains(""+DOMstrings.stepNextBtnClass)){var b=findParent(a,""+DOMstrings.stepFormPanelClass),b=Array.from(DOMstrings.stepFormPanels).indexOf(b);a.classList.contains(""+DOMstrings.stepPrevBtnClass)?b--:b++;setActiveStep(b);setActivePanel(b)}});window.addEventListener("load",setFormHeight,!1);window.addEventListener("resize",setFormHeight,!1);var setAnimationType=function(a){DOMstrings.stepFormPanels.forEach(function(b){b.dataset.animation=a})},animationSelect=document.querySelector(".pick-animation__select");animationSelect.addEventListener("change",function(){setAnimationType(animationSelect.value)});