<?php $__env->startSection('body_class', 'gamespage col-single'); ?>
<?php $__env->startSection('content'); ?>

<div class="master-main mainContent maincontent-design2 middlebackground background-design5">
    <div class="container">
        <div class="row multi">
            
            <div class="col-sm-3 main-sidebar">
                
            </div>
            
            <div class="col-xs-12 col-sm-9 tabbed main-content">
                <div class="content-inner-container games-content">
        
                    <div class="loader">
                        <img src="<?php echo e(asset('assets/images/loading.gif')); ?>" alt="loading">
                        
                        <a href="javascript:window.location.reload();">Click here if cannot load</a>
                    </div>
                    
                    <div id="divGame" style="margin: 0px;">
                        
                        
                        <?php if(request()->has('gg')): ?>
                            
                            
                            <iframe src="<?php echo e(route('account.gamelobby', ['gc' => request('gc'), 'gg' => request('gg')])); ?>" id="iframeGame" onload="LoadComplete()" scrolling="yes" frameborder="0" marginwidth="0" marginheight="0" style="display: block; padding: 0px; margin: 0px; width: 100%; height: 100%;"></iframe>
                        
                        <?php elseif(request()->has('gc')): ?>
                            
                            
                            <iframe src="<?php echo e(route('account.brand', ['gc' => request('gc')])); ?>" id="iframeGame" onload="LoadComplete()" scrolling="yes" frameborder="0" marginwidth="0" marginheight="0" style="display: block; padding: 0px; margin: 0px; width: 100%; height: 100%;"></iframe>
                        
                        <?php else: ?>
                            
                            
                            <iframe src="<?php echo e(route('account.brand', ['gc' => 'slot'])); ?>" id="iframeGame" onload="LoadComplete()" scrolling="yes" frameborder="0" marginwidth="0" marginheight="0" style="display: block; padding: 0px; margin: 0px; width: 100%; height: 100%;"></iframe>
                        
                        <?php endif; ?>
                        
                    </div>
            
                </div>
            </div>
            
        </div>
    </div>
</div>
<div id="popupCmsModal" class="modal fade popup-modal popup-modal-center" tabindex="-1">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <div class="modal-body" style="background: black; color: #ffffff; text-align: center;">
                
                <div style="padding-top: 15px;">
                    <h2 style="margin: 0px; font-size: 12pt; font-family: Arial, sans-serif; line-height: 1.6;">
                        <strong>
                            MIN DP : 10K &nbsp; MIN WD : 50K<br />
                            (BANK - E WALLET - PULSA - QRIS)
                        </strong>
                        <br /><br />
                        <strong>BERAPAPUN KEMENANGAN KAMI PROSES !!!</strong>
                        <br /><br />
                        <span style="color: #ff0000;">WASPADA PENIPUAN !!!</span>
                        <br /><br />
                        <strong>
                            <?php echo e(general()->brand); ?> TIDAK PERNAH MEMINTA<br />
                            MEMBER UNTUK MENGIRIM DANA<br />
                            SELAIN NOMOR REKENING DI FORMULIR DEPOSIT
                        </strong>
                    </h2>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('script'); ?>
<script type="text/javascript">
    $(document).ready(function () {
        // Mendapatkan parameter dari URL menggunakan URLSearchParams
        const urlParams = new URLSearchParams(window.location.search);
        
        // Mengecek apakah parameter showmenu bernilai 1
        if (urlParams.get('showmenu') === '1') {
            // Menampilkan modal secara otomatis
            $('#popupCmsModal').modal('show');
        }
    });
</script>
<script type="text/javascript">
    // Fungsi untuk menghilangkan loader saat iframe selesai dimuat
    function LoadComplete() {
        $('.loader').fadeOut(300);
    }

    $(function () {
        UpdateHeight();
        
        window.addEventListener("message", function (e) {
            try {
                var key = e.message ? 'message' : 'data';
                var data = e[key];
                
                if (data == "wallet") {
                    // Memanggil fungsi UpdateWallet yang ada di footer
                    if(typeof UpdateWallet === "function") UpdateWallet();
                } 
                else if (data == "reloadpage") {
                    location.reload();
                } 
                else if (data.indexOf("opengame") == 0) {
                    // Rata Kanan: Gunakan objek URL agar parameter tidak menumpuk (misal ?gc=slot?gc=casino)
                    var currentUrl = new URL(window.location.href);
                    currentUrl.searchParams.set("gc", data.substr(8));
                    location.href = currentUrl.toString();
                }
            } catch (e) {
                console.error("Iframe message error: ", e);
            }
        }, false);

        // Fallback: Hilangkan loader paksa jika macet lebih dari 15 detik
        setTimeout(function() {
            if ($('.loader').is(':visible')) {
                $('.loader').fadeOut(300);
            }
        }, 15000);
    });

    $(window).resize(function () {
        UpdateHeight();
    });

    function UpdateHeight(num) {
        let totalHeight = 0;
        let masterMainChildren = $(".master-main:not(.mainContent)");
        if (masterMainChildren.length > 0) {
            masterMainChildren.each(function () {
                totalHeight += $(this).outerHeight(true);
            });
        }
        // Kurangi sedikit ekstra margin agar tidak muncul double scrollbar
        $("#iframeGame").height($(window).height() - totalHeight - 5);
    }
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('frontend.desktop.pages.account.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/website/sewa/dragon158/resources/views/frontend/desktop/pages/account/pages/home.blade.php ENDPATH**/ ?>