text: // Class definition
  var KTWizardDemo = function () {
      // Base elements
      var wizardEl;
      var formEl;
      var validator;
      var wizard;
  
      // Private functions
      var initWizard = function () {
          // Initialize form wizard
          wizard = new KTWizard('kt_wizard_v2', {
              startStep: 1,
              clickableSteps: true //Enable/disable manually clicking step titles
          });
  
          // Validation before going to next page
          wizard.on('beforeNext', function(wizardObj) {
              if (validator.form() !== true) {
                  wizardObj.stop();  // don't go to the next step
              }
          });
  
          wizard.on('beforePrev', function(wizardObj) {
  			if (validator.form() !== true) {
  				wizardObj.stop();  // don't go to the next step
  			}
  		});
  
          // Change event
          wizard.on('change', function(wizard) {
              KTUtil.scrollTop();
          });
      }
  
      var initValidation = function() {
          validator = formEl.validate({
              // Validate only visible fields
              ignore: ":hidden",
  
              // Validation rules
              rules: {
                  //= Client Information(step 1)
                  username: {
                      required: true
                  },
                  email: {
                      required: true,
                      email: true
                  },
                  password: {
                      required: true,
                  },
  
                  //= Client Information(step 2)
                  // Profile Details
                  address1: {
                      required: true,
                  },
                  address2: {
                      required: true,
                  },
                  // Mailing Address
                  city: {
                      required: true,
                  },
                  zip: {
                      required: true,
                  },
                  state: {
                      required: true,
                  },
                  country: {
                      required: true,
                  },
  
                  //= Client Information(step 3)
                  // Company Details
                  company_name: {
                      required: true,
                  },
                  company_id: {
                      required: true,
                  },
                  company_email: {
                      required: true,
                  },
                  company_tel: {
                      required: true,
                  },
                  'account_communication[]': {
                      required: true
                  },
  
                  //= Client Information(step 4)
                  // Billing Information
                  billing_card_name: {
                      required: true
                  },
                  billing_card_number: {
                      required: true,
                      creditcard: true
                  },
                  billing_card_exp_month: {
                      required: true
                  },
                  billing_card_exp_year: {
                      required: true
                  },
                  billing_card_cvv: {
                      required: true,
                      minlength: 2,
                      maxlength: 3
                  },
  
                  //= Confirmation(step 5)
                  accept: {
                      required: true
                  }
              },
  
              // Validation messages
              messages: {
                  'account_communication[]': {
                      required: 'You must select at least one communication option'
                  },
                  accept: {
                      required: "You must accept the Terms and Conditions agreement!"
                  }
              },
  
              // Display error
              invalidHandler: function(event, validator) {
                  KTUtil.scrollTop();
  
                  swal.fire({
                      "title": "",
                      "text": "There are some errors in your submission. Please correct them.",
                      "type": "error",
                      "confirmButtonClass": "btn btn-secondary m-btn m-btn--wide"
                  });
              },
  
              // Submit valid form
              submitHandler: function (form) {
  
              }
          });
      }
  
      var initSubmit = function() {
          var btn = formEl.find('[data-ktwizard-action="action-submit"]');
  
          btn.on('click', function(e) {
              e.preventDefault();
  
              if (validator.form()) {
                  // See: src\js\framework\base\app.js
                  KTApp.progress(btn);
                  //KTApp.block(formEl);
  
                  // See: http://malsup.com/jquery/form/#ajaxSubmit
                  formEl.ajaxSubmit({
                      success: function() {
                          KTApp.unprogress(btn);
                          //KTApp.unblock(formEl);
  
                          swal.fire({
                              "title": "",
                              "text": "The application has been successfully submitted!",
                              "type": "success",
                              "confirmButtonClass": "btn btn-secondary"
                          });
                      }
                  });
              }
          });
      }
  
      return {
          // public functions
          init: function() {
              wizardEl = KTUtil.get('kt_wizard_v2');
              formEl = $('#kt_form');
  
              initWizard();
              initValidation();
              initSubmit();
          }
      };
  }();
  
  jQuery(document).ready(function() {
      KTWizardDemo.init();
  });
  