"use strict";!function(){window.Helpers.initCustomOptionCheck();const e=document.querySelector(".flatpickr"),t=document.querySelector(".contact-number-mask"),o=$("#plCountry"),i=document.querySelector("#plFurnishingDetails");t&&new Cleave(t,{phone:!0,phoneRegionCode:"US"}),o&&(o.wrap('<div class="position-relative"></div>'),o.select2({placeholder:"Select country",dropdownParent:o.parent()})),e&&e.flatpickr();i&&new Tagify(i,{whitelist:["Fridge","TV","AC","WiFi","RO","Washing Machine","Sofa","Bed","Dining Table","Microwave","Cupboard"],maxTags:10,dropdown:{maxItems:20,classname:"tags-inline",enabled:0,closeOnSelect:!1}});const n=document.querySelector("#wizard-property-listing");if(n,null!==n){const u=n.querySelector("#wizard-property-listing-form");var a=u.querySelector("#personal-details"),r=u.querySelector("#property-details"),l=u.querySelector("#property-features"),s=u.querySelector("#property-area"),c=u.querySelector("#price-details");const p=[].slice.call(u.querySelectorAll(".btn-next")),d=[].slice.call(u.querySelectorAll(".btn-prev")),m=new Stepper(n,{linear:!0}),g=FormValidation.formValidation(a,{fields:{plFirstName:{validators:{notEmpty:{message:"Please enter your first name"}}},plLastName:{validators:{notEmpty:{message:"Please enter your first name"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-sm-6"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton},init:e=>{e.on("plugins.message.placed",function(e){e.element.parentElement.classList.contains("input-group")&&e.element.parentElement.insertAdjacentElement("afterend",e.messageElement)})}}).on("core.form.valid",function(){m.next()}),w=FormValidation.formValidation(r,{fields:{plPropertyType:{validators:{notEmpty:{message:"Please select property type"}}},plZipCode:{validators:{notEmpty:{message:"Please enter zip code"},stringLength:{min:4,max:10,message:"The zip code must be more than 4 and less than 10 characters long"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:function(e,t){return"plAddress"!==e?".col-sm-6":".col-lg-12"}}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){m.next()}),F=$("#plPropertyType"),f=(F.length&&(F.wrap('<div class="position-relative"></div>'),F.select2({placeholder:"Select property type",dropdownParent:F.parent()}).on("change.select2",function(){w.revalidateField("plPropertyType")})),FormValidation.formValidation(l,{fields:{},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-sm-6"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){m.next()})),y=FormValidation.formValidation(s,{fields:{},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-md-12"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){m.next()}),V=FormValidation.formValidation(c,{fields:{},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-md-12"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){alert("Submitted..!!")});p.forEach(e=>{e.addEventListener("click",e=>{switch(m._currentIndex){case 0:g.validate();break;case 1:w.validate();break;case 2:f.validate();break;case 3:y.validate();break;case 4:V.validate()}})}),d.forEach(e=>{e.addEventListener("click",e=>{switch(m._currentIndex){case 4:case 3:case 2:case 1:m.previous()}})})}}();