text: $(function(){"use strict";var a=$("#install"),r=$(".alert");$(document).ajaxStart(function(){$("#loading").removeClass("d-none")}),$(document).ajaxStop(function(){$("#loading").addClass("d-none")}),a.on("click",function(){var a,e;!function(){try{r.removeClass("alert-danger").addClass("hidden"),$("input").closest(".form-group").removeClass("has-error");var s=!1;if($("input").each(function(a,e){$(e).val()||($(e).closest(".form-group").addClass("has-error"),s=!0)}),s)throw new Error("All the page fields are required.");if($("#password").val()!==$("#retype-password").val())throw $("#password").closest(".form-group").addClass("has-error"),$("#retype-password").closest(".form-group").addClass("has-error"),new Error("Passwords do not match!");if($("#password").val().length<7)throw $("#password").closest(".form-group").addClass("has-error"),$("#retype-password").closest(".form-group").addClass("has-error"),new Error("The password must be at least 7 characters long.");if(!GeneralFunctions.validateEmail($("#email").val()))throw $("#email").closest(".form-group").addClass("has-error"),new Error("The email address is invalid!");if(!GeneralFunctions.validateEmail($("#company-email").val()))throw $("#company-email").closest(".form-group").addClass("has-error"),new Error("The email address is invalid!");return!0}catch(a){return r.addClass("alert-danger").text(a.message).removeClass("hidden"),!1}}()||(a=GlobalVariables.baseUrl+"/index.php/installation/ajax_install",e={csrfToken:GlobalVariables.csrfToken,admin:{first_name:$("#first-name").val(),last_name:$("#last-name").val(),email:$("#email").val(),phone_number:$("#phone-number").val(),username:$("#username").val(),password:$("#password").val()},company:{company_name:$("#company-name").val(),company_email:$("#company-email").val(),company_link:$("#company-link").val()}},$.ajax({url:a,type:"POST",data:e,dataType:"json"}).done(function(a){r.text("Easy!Appointments has been successfully installed!").addClass("alert-success").removeClass("hidden"),setTimeout(function(){window.location.href=GlobalVariables.baseUrl+"/index.php/backend"},1e3)}))}),"/"===GlobalVariables.baseUrl.slice(-1)&&(GeneralFunctions.displayMessageBox("Misconfiguration Detected","Please remove any trailing slashes from your BASE_URL setting of the root config.php file and try again."),a.prop("disabled",!0).fadeTo("0.4"))});