class TamiOrderDetail {

    constructor() {
        this.hide_empty_widgets();
    }

    hide_empty_widgets = function (){
        var tamiWidgetBox = document.getElementById("tami_woocommerce_order_widget");
        if(tamiWidgetBox!==null) {
            let tamiWidgetContentBox = tamiWidgetBox.querySelector('#tami-widget-content-box');
            if(
                tamiWidgetContentBox !== null &&
                typeof tamiWidgetContentBox.dataset === "object" &&
                typeof tamiWidgetContentBox.dataset.hidebox === "string" &&
                tamiWidgetContentBox.dataset.hidebox === "1"
            ) {
                tamiWidgetBox.parentNode.removeChild(tamiWidgetBox);
            }
        }
    }

}

window.addEventListener('load', function ()
{
    new TamiOrderDetail();
});