jQuery(function ($) {
    let otpTimer = null
    // now you can use jQuery code here with $ shortcut formatting
    // this executes immediately - before the page is finished loading
    $("document").ready(function () {

        $("#current-domain").text(window.origin)
        //      events      //
        $("#logout-btn").click(() => {
            logout()
        })

        //      functions       //

        const logout = async () => {
            await $.post(ajax_object.ajax_url, {
                action: 'taamito_logout',
            })
                .done((data) => {
                    location.reload()
                })
                .catch((e) => {
                    $(".error-box").show()
                    $(".error-box-msg").text(e.responseJSON.data.error)
                })
        }
    })
});