/*! * SmartWizard v4.3.1 * The awesome jQuery step wizard plugin with Bootstrap support * http://www.techlaboratory.net/smartwizard * * Created by Dipu Raj * http://dipuraj.me * * Licensed under the terms of the MIT License * https://github.com/techlab/SmartWizard/blob/master/LICENSE */ !function(t,s,e,n){"use strict";function i(s,e){this.options=t.extend(!0,{},o,e),this.main=t(s),this.nav=this.main.children("ul"),this.steps=t("li > a",this.nav),this.container=this.main.children("div"),this.pages=this.container.children("div"),this.current_index=null,this.options.toolbarSettings.toolbarButtonPosition="right"===this.options.toolbarSettings.toolbarButtonPosition?"end":this.options.toolbarSettings.toolbarButtonPosition,this.options.toolbarSettings.toolbarButtonPosition="left"===this.options.toolbarSettings.toolbarButtonPosition?"start":this.options.toolbarSettings.toolbarButtonPosition,this.options.theme=null===this.options.theme||""===this.options.theme?"default":this.options.theme,this.init()}var o={selected:0,keyNavigation:!0,autoAdjustHeight:!0,cycleSteps:!1,backButtonSupport:!0,useURLhash:!0,showStepURLhash:!0,lang:{next:"Next",previous:"Previous"},toolbarSettings:{toolbarPosition:"bottom",toolbarButtonPosition:"end",showNextButton:!0,showPreviousButton:!0,toolbarExtraButtons:[]},anchorSettings:{anchorClickable:!0,enableAllAnchors:!1,markDoneStep:!0,markAllPreviousStepsAsDone:!0,removeDoneStepOnNavigateBack:!1,enableAnchorOnDoneStep:!0},contentURL:null,contentCache:!0,ajaxSettings:{},disabledSteps:[],errorSteps:[],hiddenSteps:[],theme:"default",transitionEffect:"none",transitionSpeed:"400"};t.extend(i.prototype,{init:function(){this._setElements(),this._setToolbar(),this._setEvents();var e=this.options.selected;if(this.options.useURLhash){var n=s.location.hash;if(n&&n.length>0){var i=t("a[href*='"+n+"']",this.nav);if(i.length>0){var o=this.steps.index(i);e=o>=0?o:e}}}e>0&&this.options.anchorSettings.markDoneStep&&this.options.anchorSettings.markAllPreviousStepsAsDone&&this.steps.eq(e).parent("li").prevAll().addClass("done"),this._showStep(e)},_setElements:function(){this.main.addClass("sw-main sw-theme-"+this.options.theme),this.nav.addClass("nav nav-tabs step-anchor").children("li").addClass("nav-item").children("a").addClass("nav-link"),this.options.anchorSettings.enableAllAnchors!==!1&&this.options.anchorSettings.anchorClickable!==!1&&this.steps.parent("li").addClass("clickable"),this.container.addClass("sw-container tab-content"),this.pages.addClass("tab-pane step-content");var s=this;return this.options.disabledSteps&&this.options.disabledSteps.length>0&&t.each(this.options.disabledSteps,function(t,e){s.steps.eq(e).parent("li").addClass("disabled")}),this.options.errorSteps&&this.options.errorSteps.length>0&&t.each(this.options.errorSteps,function(t,e){s.steps.eq(e).parent("li").addClass("danger")}),this.options.hiddenSteps&&this.options.hiddenSteps.length>0&&t.each(this.options.hiddenSteps,function(t,e){s.steps.eq(e).parent("li").addClass("hidden")}),!0},_setToolbar:function(){if("none"===this.options.toolbarSettings.toolbarPosition)return!0;var s=this.options.toolbarSettings.showNextButton!==!1?t("").text(this.options.lang.next).addClass("btn btn-secondary sw-btn-next").attr("type","button"):null,e=this.options.toolbarSettings.showPreviousButton!==!1?t("").text(this.options.lang.previous).addClass("btn btn-secondary sw-btn-prev").attr("type","button"):null,n=t("
").addClass("btn-group mr-2 sw-btn-group").attr("role","group").append(e,s),i=null;this.options.toolbarSettings.toolbarExtraButtons&&this.options.toolbarSettings.toolbarExtraButtons.length>0&&(i=t("").addClass("btn-group mr-2 sw-btn-group-extra").attr("role","group"),t.each(this.options.toolbarSettings.toolbarExtraButtons,function(t,s){i.append(s.clone(!0))}));var o,a;switch(this.options.toolbarSettings.toolbarPosition){case"top":o=t("").addClass("btn-toolbar sw-toolbar sw-toolbar-top justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),o.append(n),"start"===this.options.toolbarSettings.toolbarButtonPosition?o.prepend(i):o.append(i),this.container.before(o);break;case"bottom":a=t("").addClass("btn-toolbar sw-toolbar sw-toolbar-bottom justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),a.append(n),"start"===this.options.toolbarSettings.toolbarButtonPosition?a.prepend(i):a.append(i),this.container.after(a);break;case"both":o=t("").addClass("btn-toolbar sw-toolbar sw-toolbar-top justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),o.append(n),"start"===this.options.toolbarSettings.toolbarButtonPosition?o.prepend(i):o.append(i),this.container.before(o),a=t("").addClass("btn-toolbar sw-toolbar sw-toolbar-bottom justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),a.append(n.clone(!0)),null!==i&&("start"===this.options.toolbarSettings.toolbarButtonPosition?a.prepend(i.clone(!0)):a.append(i.clone(!0))),this.container.after(a);break;default:a=t("").addClass("btn-toolbar sw-toolbar sw-toolbar-bottom justify-content-"+this.options.toolbarSettings.toolbarButtonPosition),a.append(n),this.options.toolbarSettings.toolbarButtonPosition,a.append(i),this.container.after(a)}return!0},_setEvents:function(){var n=this;return t(this.steps).on("click",function(t){if(t.preventDefault(),n.options.anchorSettings.anchorClickable===!1)return!0;var s=n.steps.index(this);if(n.options.anchorSettings.enableAnchorOnDoneStep===!1&&n.steps.eq(s).parent("li").hasClass("done"))return!0;s!==n.current_index&&(n.options.anchorSettings.enableAllAnchors!==!1&&n.options.anchorSettings.anchorClickable!==!1?n._showStep(s):n.steps.eq(s).parent("li").hasClass("done")&&n._showStep(s))}),t(".sw-btn-next",this.main).on("click",function(t){t.preventDefault(),n._showNext()}),t(".sw-btn-prev",this.main).on("click",function(t){t.preventDefault(),n._showPrevious()}),this.options.keyNavigation&&t(e).keyup(function(t){n._keyNav(t)}),this.options.backButtonSupport&&t(s).on("hashchange",function(e){if(!n.options.useURLhash)return!0;if(s.location.hash){var i=t("a[href*='"+s.location.hash+"']",n.nav);i&&i.length>0&&(e.preventDefault(),n._showStep(n.steps.index(i)))}}),!0},_showNext:function(){for(var t=this.current_index+1,s=t;s