export class PixelioCartAbandonRecoveryMorePopupVisibilityHandler {
    EXITPOPUPCURRENTLYSHOWING = "exit_popup_currently_showing";

    constructor(previewContainerClass) {
        this.previewContainerClass = previewContainerClass;
    }

    setToShown() {
        localStorage.setItem(this.EXITPOPUPCURRENTLYSHOWING, "1");
    }

    setToHide() {
        localStorage.setItem(this.EXITPOPUPCURRENTLYSHOWING, "0");
    }

    isPreviewContainerShown() {
        return localStorage.getItem(this.previewContainerClass) !== "0";
    }

    isPopupAllowedToShow() {
        return localStorage.getItem(this.EXITPOPUPCURRENTLYSHOWING) !== "0";
    }

    canShowPopup() {
        return this.isPreviewContainerShown() && this.isPopupAllowedToShow();
    }
}