
    ݦi-                         d dl mZ g dZg dZdddddd	d
dZddddddZddddZ e       d   d   Zdj                  de      Z	dZ
dj                  de      Zy)    )	getConfig)zhotmail.comzaol.comz
icloud.comzmail.comzzoho.comz
yandex.comzgmx.comzfastmail.comztutanota.comzmail.ruzhushmail.comzairmail.netz	lycos.comznetcourrier.comz
zimbra.comzrediffmail.comzmailinator.comz	gmail.comz	yahoo.comzoutlook.comzprotonmail.com)zSoftware Development CompanyzHR ConsultancyzSoftware Product Company
EnterpriseOthersOfferedHoldRejected	InitiatedScreenedz	Test DoneInterviewed)OHRPSEIDraftReadyProcessHired)Dr   r   r   r   zScreening TestzCoding TestzInterview Test)r   r   r   DOMAIN	hirelinesz<!-- hirelines registration script -->
<!-- Script tag to be added under `<head></head>` tag -->
<script src="#hirelines_domain#/api/candidate-registration-cdn/#enc_jdid#/"></script>
z#hirelines_domain#z/* function to be added while posting candidate job application (under related .js or script tags) */
hirelinescanreg('#enc_jdid#');
aH  
        function hirelinescanreg(encjdid) {
    var inputs = document.querySelectorAll('input');

    var firstName = '';
    var lastName = '';
    var name = '';
    var email = '';
    var mobile = '';
    var source_code = '';
    var fileObj = null;   

    inputs.forEach(function(input) {
        var inputValue = input.value;
        var inputType = input.type;
        var inputName = input.name;
        var inputId = input.id;

        if (inputType === 'text' && (inputName && (inputName.toLowerCase().includes('first') || inputName.toLowerCase().includes('fname') || inputName.toLowerCase().includes('firstname')) || inputId && (inputId.toLowerCase().includes('first') || inputId.toLowerCase().includes('fname') || inputId.toLowerCase().includes('firstname')))) {
            firstName = inputValue;
        }
        if (inputType === 'text' && ( (inputName && (inputName.toLowerCase().includes('last') || inputName.toLowerCase().includes('lname') || inputName.toLowerCase().includes('lastname')) && !inputName.toLowerCase().includes('fullname')) || (inputId && (inputId.toLowerCase().includes('last') || inputId.toLowerCase().includes('lname') || inputId.toLowerCase().includes('lastname')) && !inputId.toLowerCase().includes('fullname')) )) {
            lastName = inputValue;
        }
        if (inputType === 'email' || (inputName && inputName.toLowerCase().includes('mail')) || (inputId && inputId.toLowerCase().includes('mail'))) {
            email = inputValue;
        }
        if (inputType === 'tel' || (inputType === 'text' && (inputName && (inputName.toLowerCase().includes('mobile') || inputName.toLowerCase().includes('contact') || inputName.toLowerCase().includes('phone')) || (inputId && (inputId.toLowerCase().includes('mobile') || inputId.toLowerCase().includes('contact') || inputId.toLowerCase().includes('phone')))))) {
            mobile = inputValue;
        }
        if (inputType === 'file') {
            fileObj = input.files[0];
        }
        if (
            inputType === "text" &&
            (
                (inputName && (
                    inputName.toLowerCase().includes("source") ||
                    inputName.toLowerCase().includes("referrer") ||
                    inputName.toLowerCase().includes("reference")
                )) ||
                (inputId && (
                    inputId.toLowerCase().includes("source") ||
                    inputId.toLowerCase().includes("referrer") ||
                    inputId.toLowerCase().includes("reference")
                ))
            )
        ) {
            source_code = inputValue;
        }

        if (firstName || lastName) {
            name = (firstName ? firstName : "") + (lastName ? lastName : "");
            
        } else {
            if (inputType === 'text' && (inputName && (inputName.toLowerCase().includes('candidatename') || inputName.toLowerCase().includes('applicantname') || inputName.toLowerCase().includes('name')) || (inputId && (inputId.toLowerCase().includes('candidatename') || inputId.toLowerCase().includes('applicantname') || inputId.toLowerCase().includes('name'))))) {
                name = inputValue;
                firstName = name;
                lastName = " ";
            }
        }
    });

    console.log("First Name:", firstName);
    console.log("Last Name:", lastName);
    console.log("Name:", name);
    console.log("Email:", email);
    console.log("Mobile:", mobile);
    console.log("source-code:", source_code);
    
    var payload = {
        "encjdid": encjdid,
        "firstname": firstName,
        "lastname": lastName,
        "email": email,
        "mobile": mobile,
        "source-code": source_code,
        "fileObj": fileObj 
    };
    return register_candidate(payload);
}

function register_candidate(register_details) {
    var fileObj = register_details.fileObj ||
                  document.querySelector('#resumeInput')?.files?.[0];

    var formData = new FormData();
    formData.append("encjdid", register_details.encjdid);
    formData.append("firstname", register_details.firstname);
    formData.append("lastname", register_details.lastname);
    formData.append("email", register_details.email);
    formData.append("mobile", register_details.mobile);
    formData.append("source-code", register_details["source-code"]);

    if (fileObj) {
        formData.append("attachment", fileObj); 
    }
    return fetch("#hirelines_domain#/api/candidate-profile", {
        method: "POST",
        // body: JSON.stringify(register_details),
        // headers: {
        //     "Content-Type": "application/json; charset=UTF-8"
        // }
        body: formData,        
        headers: {} 
    })
    .then(response => {
        if (!response.ok) {
            throw new Error('Network response was not ok');
        }
        return response.json();
    })
    .then(data => {
        
        if (data.statusCode == 0) {
            // applicationForm.reset()
            // alert('Application submitted successfully. Please check your email.');
        } else {
            // alert('Error while applying for this job. Please reach out to our company email');
            console.log('Error', data.error);
        }
        return data;
    })
    .catch(error => {
        // alert('Error while applying for this job. Please reach out to our company email');
        console.log('Error', error);
        return {error}
    });
}

N)hirelines.metadatar   public_email_domainscompany_typesconst_candidate_statusconst_profile_statusconst_paper_typeshirelines_domainreplacehirelines_integration_scripthirelines_integration_functionhirelines_registration_script     8/home/hirelines/hirelines/app_api/functions/constants.py<module>r(      s    ( 
 
						  
				  
		  ;x(5   G "23 
& B D G "23E r&   