<?php $__env->startSection('content'); ?>
<div class="row justify-content-center mb-4">
    <div class="col-md-12">
        <ul class="nav nav-tabs" id="settingTab" role="tablist">
            <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('setting.setting.profile-setting') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('setting.setting.profile-setting')); ?>" role="tab" 
                    aria-selected="false"
                >
                    <?php echo app('translator')->get('Profile'); ?>
                </a>
            </li> 
            <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('setting.setting.change-password') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('setting.setting.change-password')); ?>" 
                    aria-selected="false" 
                >
                    <?php echo app('translator')->get('Change Password'); ?>
                </a>
            </li>
                        <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('twofactor.twofactor') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('twofactor.twofactor')); ?>" 
                    aria-selected="true" 
                >
                    <?php echo app('translator')->get('2FA Security'); ?>
                </a>
            </li>
            <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('setting.setting.api-key') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('setting.setting.api-key')); ?>" 
                    aria-selected="false"
                >
                    <?php echo app('translator')->get('Api Key'); ?> 
                </a>
            </li>
                         <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('setting.setting.ip-allow') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('setting.setting.ip-allow')); ?>" 
                    aria-selected="false"
                >
                   <?php echo app('translator')->get('IP Allow'); ?>
                </a>
            </li>
        <li class="nav-item" role="presentation">
                <a class="nav-link <?php echo e(request()->routeIs('setting.setting.help') ? 'active' : ''); ?>" 
                    href="<?php echo e(route('setting.setting.help')); ?>" role="tab" 
                    aria-selected="false"
                >
                    <?php echo app('translator')->get('Support Account'); ?>
                </a>
            </li>
        </ul>
    </div>
</div>

<style>
    .nav-tabs .nav-link{
        border: none !important;
        font-weight: 700;
        color: #7e7e7e;
    }
    .nav-tabs .nav-link.active{
        color: #002046;
    }
    .nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active{
        background: transparent;
    }
</style> 

<div class="row justify-content-center gy-4">

    <div class="col-12">
        <div class="page-heading mb-4">
            <h3 class="mb-2">2FA Security</h3>
            <p>
                <?php echo app('translator')->get('Add an extra layer of security to your account with our Google Authenticator page, allowing you to enable and manage two-factor authentication with ease. Protect your account and ensure that only you can access it, even in the event of a password breach.'); ?>
            </p>
        </div>
        <hr>
    </div>

    <?php if($user->ts == 'N'): ?>
        <div class="col-md-6">
            <div class="card custom--card style--two">
                <div class="card-header d-flex flex-wrap align-items-center justify-content-center">
                    <h5 class="card-title"><?php echo app('translator')->get('Add Your Account'); ?></h5>
                </div>

                <div class="card-body">
                    <h6 class="mb-3">
                        <?php echo app('translator')->get('Use the QR code or setup key on your Google Authenticator app to add your account. '); ?>
                    </h6>

                    <div class="form-group mx-auto text-center">
                        <img class="mx-auto" src="<?php echo e($qrCodeUrl); ?>">
                    </div>

                    <div class="form-group">
                        <label><?php echo app('translator')->get('Setup Key'); ?></label>
                        <div class="copy-link">
                            <input type="text" class="copyURL" name="key" id="key" value="<?php echo e($secret); ?>" readonly="">
                            <span class="copy" data-id="key">
                                <i class="las la-copy"></i> <strong class="copyText"><?php echo app('translator')->get('Copy'); ?></strong>
                            </span>
                        </div>
                    </div>

                    <label><i class="fa fa-info-circle"></i> <?php echo app('translator')->get('Help'); ?></label>
                    <p><?php echo app('translator')->get('Google Authenticator is a multifactor app for mobile devices. It generates timed codes used during the 2-step verification process. To use Google Authenticator, install the Google Authenticator application on your mobile device.'); ?> <a class="text--base" href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en" target="_blank"><?php echo app('translator')->get('Download'); ?></a></p>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <div class="col-md-6">
        <?php if($user->ts == 'Y'): ?>
            <div class="card style--two">
                <div class="card-header d-flex flex-wrap align-items-center justify-content-center">
                    <h5 class="card-title"><?php echo app('translator')->get('Disable 2FA Security'); ?></h5>
                </div>
                <form action="<?php echo e(route('twofactor.disable')); ?>" method="POST">
                    <div class="card-body">
                        <?php echo csrf_field(); ?>
                        <input type="hidden" name="key" value="<?php echo e($secret); ?>">
                        <div class="form-group">
                            <label class="form-label"><?php echo app('translator')->get('Google Authenticatior OTP'); ?></label>
                            <input type="text" class="form-control form--control" name="code" required>
                        </div>
                        <button type="submit" class="btn btn--base w-100"><?php echo app('translator')->get('Submit'); ?></button>
                    </div>
                </form>
            </div>
        <?php else: ?>
            <div class="card style--two">
                <div class="card-header d-flex flex-wrap align-items-center justify-content-center">
                    <h5 class="card-title"><?php echo app('translator')->get('Enable 2FA Security'); ?></h5>
                </div>
                <form action="<?php echo e(route('twofactor.enable')); ?>" method="POST">
                    <div class="card-body">
                        <?php echo csrf_field(); ?>
                        <input type="hidden" name="key" value="<?php echo e($secret); ?>">
                        <div class="form-group">
                            <label class="form-label"><?php echo app('translator')->get('Google Authenticatior OTP'); ?></label>
                            <input type="text" class="form-control form--control" name="code" required>
                        </div>
                        <button type="submit" class="btn btn--base w-100"><?php echo app('translator')->get('Submit'); ?></button>
                    </div>
                </form>
            </div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('style'); ?>
    <style>
        .copy-link {
            position: relative;
        }
        .copy-link input {
            width: 100%;
            padding: 5px;
            border: 1px solid #d7d7d7;
            border-radius: 4px;
            transition: all .3s;
            padding-right: 70px;
        }
        .copy-link span {
            text-align: center;
            position: absolute;
            top: 6px;
            right: 10px;
            cursor: pointer;
        }
        .form-check-input:focus{
            box-shadow: none;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startPush('script'); ?>
    <script>
        (function($){
            "use strict";

            $('.copy').on('click', function() {

                var copyText = document.getElementById($(this).data('id'));
                copyText.select();
                copyText.setSelectionRange(0, 99999);

                document.execCommand("copy");
                $(this).find('.copyText').text('Copied');

                setTimeout(() => {
                    $(this).find('.copyText').text('Copy');
                }, 2000);
            });

        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>


<?php echo $__env->make('layouts.main-app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/paysafebd23/ovimanager.store/resources/views/twofactor.blade.php ENDPATH**/ ?>