<?php $__env->startSection('content'); ?>

    <body class="">
        <div id="app" data-v-app="">
            <div data-v-0ee0ae8d="" class="withdrawPage bg_00">
                <div data-v-0ee0ae8d="">
                    <div class="van-sticky">
                        <div data-v-0ee0ae8d="" class="van-nav-bar van-hairline--bottom">
                            <div class="van-nav-bar__content">
                                <div onclick="window.history.go(-1); return false;"
                                    class="van-nav-bar__left van-haptics-feedback"><i
                                        class="van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow"><!----><!----><!----></i>
                                </div>
                                <div class="van-nav-bar__title van-ellipsis">Withdraw</div>
                                <div onclick="window.location.href='<?php echo e(route('user.withdraw.history')); ?>';"
                                    class="van-nav-bar__right van-haptics-feedback"><span
                                        class="van-nav-bar__text">Record</span></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div data-v-0ee0ae8d="" class="main">
                    <div data-v-0ee0ae8d="" class="withdrawForm m5 p20">
                        <div data-v-0ee0ae8d="" class="basicInfor">
                            <ul data-v-0ee0ae8d="" class="cell">
                                <li data-v-0ee0ae8d="" class="display alignCenter">
                                    <div data-v-0ee0ae8d="" class="infoBar display alignCenter flex1">
                                        <div data-v-0ee0ae8d="" class="titleLabel flex1">
                                            <p data-v-0ee0ae8d="">Withdrawal</p><span data-v-0ee0ae8d=""></span>
                                        </div>
                                        <div data-v-0ee0ae8d="" class="contInfo">
                                            <h4 data-v-0ee0ae8d=""><em data-v-0ee0ae8d=""
                                                    class="currency">₦</em><?php echo e(number_format(auth()->user()->bonus_balance, 2)); ?>

                                            </h4>
                                        </div>
                                    </div>
                                </li>
                                <?php
                                    $card_number = auth()->user()->bankAccount->account_number; // Example card number
                                    $formatted_card_number = wordwrap($card_number, 4, ' ', true); // Format with spaces
                                ?>
                                <li data-v-0ee0ae8d="" class="display alignCenter">
                                    <div data-v-0ee0ae8d="" class="infoBar display alignCenter flex1">
                                        <div data-v-0ee0ae8d="" class="titleLabel flex1">
                                            <p data-v-0ee0ae8d="">Bank card</p><span data-v-0ee0ae8d=""></span>
                                        </div>
                                        <div data-v-0ee0ae8d="" class="contInfo tr"><span
                                                data-v-0ee0ae8d=""><?php echo e(auth()->user()->bankAccount->bank_name); ?></span>
                                            <h4 data-v-0ee0ae8d=""><?php echo e($formatted_card_number); ?></h4>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        <div data-v-0ee0ae8d="" class="dashedLine m_tb20"></div>
                        <div data-v-0ee0ae8d="" class="formBox">
                            <form action="<?php echo e(route('user.withdraw')); ?>" method="post" data-v-0ee0ae8d="" class="van-form">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="balance" value="2">
                                <input type="hidden" name="method_code" value="1">
                                <ul data-v-0ee0ae8d="">
                                    <li data-v-0ee0ae8d="" class="formLinear">
                                        <div data-v-0ee0ae8d="" class="inputArea l activate">
                                            <div data-v-0ee0ae8d="" class="formTitleBar display alignCenter">
                                                <div data-v-0ee0ae8d="" class="title flex1"><label data-v-0ee0ae8d=""
                                                        for="withdraw">Withdrawal amount</label></div>
                                            </div>
                                            <div data-v-0ee0ae8d="" class="trueInpt display alignCenter">
                                                <div data-v-0ee0ae8d="" class="icon"><i data-v-0ee0ae8d=""
                                                        class="ri-database-2-line"></i></div>
                                                <div data-v-0ee0ae8d="" class="van-cell van-field flex1">
                                                    <div class="van-cell__value van-field__value">
                                                        <div class="van-field__body">
                                                            <input type="text" inputmode="decimal" id="withdrawMoney"
                                                                name="amount" class="van-field__control" readonly=""
                                                                placeholder="Withdraw amount" autocomplete="off">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </li>
                                    <li data-v-0ee0ae8d="">
                                        <div data-v-0ee0ae8d="" class="actionBlock display alignCenter justifyEnd">
                                            <button data-v-0ee0ae8d="" type="button"
                                                class="van-button van-button--default van-button--normal van-button--round ruleBtn clickBtn"
                                                style="color: white; background: var(--b_1); border-color: var(--b_1);">
                                                <div class="van-button__content">
                                                    <span class ="van-button__text">
                                                        <div data-v-0ee0ae8d=""
                                                            class="display alignCenter justifyDetween">
                                                            <p data-v-0ee0ae8d="" class="flex1">Rule</p>
                                                            <i data-v-0ee0ae8d="" class="ri-question-mark"></i>
                                                        </div>
                                                    </span>
                                                </div>
                                            </button>
                                            <button data-v-0ee0ae8d="" type="submit"
                                                class="van-button van-button--primary van-button--normal van-button--round confirmBtn clickBtn"
                                                style="color: white; background: var(--bw0); border-color: var(--bw0);">
                                                <div class="van-button__content">
                                                    <span class="van-button__text">
                                                        <div data-v-0ee0ae8d=""
                                                            class="display alignCenter justifyDetween">
                                                            <p data-v-0ee0ae8d="" class="flex1">Confirm</p><i
                                                                data-v-0ee0ae8d="" class="ri-arrow-right-line"></i>
                                                        </div>
                                                    </span>
                                                </div>
                                            </button>
                                        </div>
                                    </li>
                                </ul>
                            </form>
                        </div>
                    </div>

                    <div class="van-number-keyboard custom_Keyboard p10">
                        <div class="van-number-keyboard__body">
                            <div class="van-number-keyboard__keys">
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">1</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">2</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">3</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">4</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">5</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">6</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">7</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">8</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">9</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">.</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key">0</div>
                                </div>
                                <div class="van-key__wrapper">
                                    <div role="button" tabindex="0" class="van-key van-key--delete"><svg
                                            class="van-key__delete-icon" viewBox="0 0 32 22">
                                            <path
                                                d="M28 0a4 4 0 0 1 4 4v14a4 4 0 0 1-4 4H10.4a2 2 0 0 1-1.4-.6L1 13.1c-.6-.5-.9-1.3-.9-2 0-1 .3-1.7.9-2.2L9 .6a2 2 0 0 1 1.4-.6zm0 2H10.4l-8.2 8.3a1 1 0 0 0-.3.7c0 .3.1.5.3.7l8.2 8.4H28a2 2 0 0 0 2-2V4c0-1.1-.9-2-2-2zm-5 4a1 1 0 0 1 .7.3 1 1 0 0 1 0 1.4L20.4 11l3.3 3.3c.2.2.3.5.3.7 0 .3-. 1.5.3a1 1 0 0 1-.7.3 1 1 0 0 1-.7-.3L19 12.4l-3.4 3.3a1 1 0 0 1-.6.3 1 1 0 0 1-.7-.3 1 1 0 0 1-.3-.7c0-.2.1-.5.3-.7l3.3-3.3-3.3-3.3A1 1 0 0 1 14 7c0-.3.1-.5.3-.7A1 1 0 0 1 15 6a1 1 0 0 1 .6.3L19 9.6l3.3-3.3A1 1 0 0 1 23 6z"
                                                fill="currentColor"></path>
                                        </svg></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <script>
            // Get elements
            const ruleButton = document.querySelector('.ruleBtn');
            const overlay = document.getElementById('overlay');
            const popup = document.getElementById('popup');

            // Function to show the popup
            ruleButton.addEventListener('click', function() {
                overlay.style.display = 'block'; // Show the overlay
                popup.style.display = 'block'; // Show the popup
            });

            // Function to hide the popup
            function hidePopup() {
                overlay.style.display = 'none'; // Hide the overlay
                popup.style.display = 'none'; // Hide the popup
            }

            // Event listener for the overlay to close the popup
            overlay.addEventListener('click', hidePopup);
        </script>

        <script>
            const inputField = document.getElementById('withdrawMoney');
            const keys = document.querySelectorAll('.van-key');

            keys.forEach(key => {
                key.addEventListener('click', () => {
                    const keyValue = key.textContent;
                    if (keyValue === 'Delete') {
                        inputField.value = inputField.value.slice(0, -1);
                    } else {
                        inputField.value += keyValue;
                    }
                });
            });
        </script>
    </body>

    <script>
        $('.money').keyup(function() {
            $(this)[0].value = $(this)[0].value.replace(/^(0+)|[^\d]+/g, '')
        })
        $('.all').click(function() {
            $('.money').val(<?php echo e(auth()->user()->bonus_balance); ?>)
        })
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.users', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/MAMP/htdocs/cryptoworld/core/resources/views/templates/basic/user/withdraw/methods.blade.php ENDPATH**/ ?>