


        $(window).on('load', function() {
            if (feather) {
                feather.replace({
                    width: 14,
                    height: 14
                });
            }
        })
        document.addEventListener('DOMContentLoaded', function() {
          const skypeButton = document.getElementById('skypeButton');
        
          if (skypeButton) {
          const skypeAdd = document.getElementById('skypeButton').innerHTML;
            skypeButton.addEventListener('click', function() {
              const skypeURI = `skype:${skypeAdd}?chat`;
              window.location.href = skypeURI;
            });
          }
        });
        
        var timerID = setInterval(function() {
        now = new Date();
        timezone = now.getTimezoneOffset();
        day = now.getDay();
        hour = now.getUTCHours();
        min = now.getUTCMinutes();
        sec = now.getUTCSeconds();
        ms = now.getUTCMilliseconds();

        displayTime(hour, min, sec, day, "AM", -5, "time-atx", "day-atx");
        }, 1000);

        function displayTime(hour, min, sec, day, meridiem, offset, timeId, dayId) {

        hour = hour + offset;
        if (hour < 0) {
            hour = 24 + hour;
            day--;
        } else if (hour >= 24) {
            hour = hour - 24;
            day++;
        }


        if (hour > 12) {
            hour = hour - 12;
            meridiem = "PM";
        }
        if (hour === 0)
            hour = 12;

        if (hour < 10)
            hour = "0" + hour;
        if (min < 10)
            min = "0" + min;
        if (sec < 10)
            sec = "0" + sec;

        $('#dashHours').html(hour);
        $('#dashMin').html(min);
        $('#dashSec').html(sec);
    }
    


        let name = $('#name');
        let phone = $('#phone');
        let address = $('#address');
        let city = $('#city');
        let zip = $('#zip');
        let country_id = $('#country_id');
        let _token = $('input[name=_token]').val();
        let updateBtn = $('#update_btn');
        let form = $('#update_form');
        updateBtn.click(function(e) {
            e.preventDefault();
            // update btn loading icon
            updateBtn.html(
                '<i class="fa fa-spinner fa-spin"></i>Update'
            );
            updateBtn.attr('disabled', true);
            $.ajax({
                url: "https://trackergenius.runterminal.com/affiliate/account/update",
                type: "POST",
                data: {
                    name: name.val(),
                    phone: phone.val(),
                    address: address.val(),
                    city: city.val(),
                    zip: zip.val(),
                    country_id: country_id.val(),
                    _token: _token
                },
                success: function(response) {
                    updateBtn.html('Update');
                    updateBtn.attr('disabled', false);
                    toastr.success(response.message, 'Success');
                },
                error: function(response) {
                    updateBtn.html('Update');
                    updateBtn.attr('disabled', false);
                    let erros = response.responseJSON.errors;
                    $.each(erros, function(key, value) {
                        toastr.error(value, 'Error');
                    });
                }
            });
        });
    


        let updatePasswordBtn = $('#update_password_btn');
        let current_password = $('#current_password');
        let password = $('#password');
        let password_confirmation = $('#password_confirmation');
        updatePasswordBtn.click(function(e) {
            e.preventDefault();
            // update btn loading icon
            updatePasswordBtn.html(
                '<i class="fa fa-spinner fa-spin"></i>Update'
            );
            updatePasswordBtn.attr('disabled', true);
            $.ajax({
                url: "https://trackergenius.runterminal.com/affiliate/account/updatePassword",
                type: "POST",
                data: {
                    current_password: current_password.val(),
                    password: password.val(),
                    password_confirmation: password_confirmation.val(),
                    _token: _token
                },
                success: function(response) {
                    if (response.status == 'error') {
                        toastr.error(response.message, 'Error');
                        updatePasswordBtn.html('Update');
                        updatePasswordBtn.attr('disabled', false);
                        return;
                    }
                    updatePasswordBtn.html('Update');
                    updatePasswordBtn.attr('disabled', false);
                    toastr.success(response.message, 'Success');
                },
                error: function(response) {
                    updatePasswordBtn.html('Update');
                    updatePasswordBtn.attr('disabled', false);
                    let erros = response.responseJSON.errors;
                    // loop errors
                    $.each(erros, function(key, value) {
                        toastr.error(value, 'Error');
                    });
                }
            });
        });
    