import * as Communication from "./communication";

export function injectBookingBtn(): void {
    jQuery(".flash_seat_map_box").remove();
    changeBookingBtnCSS();
    appendBookingBtnHTML();
}

export function showSeatmapBtnParent(): void {
    Communication.sendEventToParent("child_seatmap_ready");
}

function appendBookingBtnHTML(): void {
    jQuery("#flash_seat_map_box_id").append(`
    <div class="row_space"></div>
    <div class="row_space"></div>
    <div id="containerBookingBtn">
        <a class="continue" id="openSeatmap">
            <span>Saalplanbuchung</span>
        </a>
        <div id="dialogSeatmap" hidden="hidden"></div>
    </div>
    `);
}

function changeBookingBtnCSS(): void {
    jQuery('#flash_seat_map_box_id').css({
        "display": "block",
        "position": "relative",
        "width": "100%"
    });
}