<?php $__env->startSection('app'); ?>
    <?php
        $policyPages = getContent('policy_pages.element', orderById: true);
        $signupBg = getContent('signup_bg.content', true);
    ?>

    <section class="account">
        <div class="account__left flex-align bg-img" data-background-image="<?php echo e(asset($activeTemplateTrue . 'images/thumbs/account-bg.png')); ?>">
            <div class="account__thumb">
                <img src="<?php echo e(getImage('assets/images/frontend/signup_bg/' . @$signupBg->data_values->image, '1920x1280')); ?>" alt="<?php echo app('translator')->get('image'); ?>">
            </div>
        </div>
        <div class="d-flex flex-wrap account__right flex-align">
            <div class="account__form">
                <div class="account-form pt-0 pb-0">
                    <a class="site-logo" href="<?php echo e(route('home')); ?>"><img src="<?php echo e(siteLogo('dark')); ?>" alt="<?php echo app('translator')->get('logo'); ?>"></a>
                    <div class="section-heading style-left">
                        <h6 class="section-heading__subtitle"><?php echo e(__(@$signupBg->data_values->heading)); ?></h6>
                        <h3 class="section-heading__title">
                            <?php echo e(__(@$signupBg->data_values->subheading)); ?>

                        </h3>
                    </div>
                    <form action="<?php echo e(route('user.register')); ?>" method="POST" class="verify-gcaptcha">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <?php if(session()->get('reference') != null && $general->modules->referral_system): ?>
                                <div class="form-group">
                                    <label for="referenceBy" class="form--label"><?php echo app('translator')->get('Referred by'); ?></label>
                                    <input type="text" name="referBy" id="referenceBy" class="form--control" value="<?php echo e(session()->get('reference')); ?>" readonly>
                                </div>
                            <?php endif; ?>
                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="f-name" class="form--label"><?php echo app('translator')->get('Username'); ?></label>
                                    <input type="text" class="form--control checkUser" name="username" value="<?php echo e(old('username')); ?>" id="f-name">
                                    <small class="text--danger usernameExist"></small>
                                </div>
                            </div>
                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="email" class="form--label"><?php echo app('translator')->get('Email Address'); ?></label>
                                    <input type="email" name="email" class="form--control checkUser" id="email" value="<?php echo e(old('email')); ?>" required>
                                </div>
                            </div>
                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="country" class="form--label"><?php echo app('translator')->get('Country'); ?></label>
                                    <?php
                                        $countryCode = @getIpInfo()['code'];
                                    ?>
                                    <select name="country" class="form--control">
                                        <?php $__currentLoopData = $countries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $country): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option data-mobile_code="<?php echo e($country->dial_code); ?>" value="<?php echo e($country->country); ?>" data-code="<?php echo e($key); ?>" <?php if($countryCode == $key): echo 'selected'; endif; ?>>
                                                <?php echo e(__($country->country)); ?>

                                            </option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            </div>

                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="phone" class="form--label"><?php echo app('translator')->get('Mobile'); ?></label>
                                    <div class="input-group custom-input-group">
                                        <span class="input-group-text mobile-code"></span>
                                        <input type="number" name="mobile" value="<?php echo e(old('mobile')); ?>" id="phone" class="form-control form--control checkUser" required>
                                    </div>
                                    <small class="text--danger mobileExist"></small>
                                    <input type="hidden" name="mobile_code">
                                    <input type="hidden" name="country_code">
                                </div>
                            </div>

                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="yourPassword" class="form--label"><?php echo app('translator')->get('Password'); ?></label>
                                    <input name="password" id="yourPassword" type="password" class="form--control <?php if($general->secure_password): ?> secure-password <?php endif; ?>" required>
                                </div>
                            </div>

                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="confirmPassword" class="form--label"><?php echo app('translator')->get('Confirm password'); ?></label>
                                    <input name="password_confirmation" id="confirmPassword" type="password" class="form--control" required>
                                </div>
                            </div>
                            <!-- Transfer Pin -->
                            <div class="col-sm-6 col-xsm-6">
                                <div class="form-group">
                                    <label for="transfer_pin" class="form--label"><?php echo app('translator')->get('Transfer Pin'); ?></label>
                                    <input name="transfer_pin" id="transfer_pin" type="password" class="form--control" required>
                                </div>
                            </div>
                            <!-- Transfer Pin -->

                            <?php if (isset($component)) { $__componentOriginalc0af13564821b3ac3d38dfa77d6cac9157db8243 = $component; } ?>
<?php $component = App\View\Components\Captcha::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('captcha'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Captcha::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc0af13564821b3ac3d38dfa77d6cac9157db8243)): ?>
<?php $component = $__componentOriginalc0af13564821b3ac3d38dfa77d6cac9157db8243; ?>
<?php unset($__componentOriginalc0af13564821b3ac3d38dfa77d6cac9157db8243); ?>
<?php endif; ?>

                            <?php if($general->agree): ?>
                                <div class="col-12">
                                    <div class="form-group d-flex">
                                        <div class="form--check">
                                            <input class="form-check-input" type="checkbox" name="agree" <?php if(old('agree')): echo 'checked'; endif; ?> id="remember">
                                        </div>
                                        <div class="terms px-2">
                                            <label class="form-check-label" for="remember"><?php echo app('translator')->get('I agree with'); ?></label>
                                            <?php $__currentLoopData = $policyPages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $policy): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <a class="text--base footer-menu__link" href="<?php echo e(route('policy.pages', [slug($policy->data_values->title), $policy->id])); ?>" target="_blank"><?php echo e(__($policy->data_values->title)); ?></a>
                                                <?php if(!$loop->last): ?>
                                                    ,
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>

                            <div class="col-12">
                                <div class="form-group">
                                    <button type="submit" class="btn btn--base w-100"><?php echo app('translator')->get('Submit'); ?></button>
                                </div>
                            </div>

                            <div class="col-12">
                                <div class="have-account text-center">
                                    <p class="have-account__text"><?php echo app('translator')->get('Already Have An Account?'); ?>
                                        <a href="<?php echo e(route('user.login')); ?>" class="have-account__link text--base"><?php echo app('translator')->get('Login'); ?></a>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

    </section>

    <div class="modal fade" id="existModalCenter" tabindex="-1" role="dialog" aria-labelledby="existModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="existModalLongTitle"><?php echo app('translator')->get('You are with us'); ?></h5>
                    <span type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                        <i class="las la-times"></i>
                    </span>
                </div>
                <div class="modal-body">
                    <h6 class="text-center"><?php echo app('translator')->get('You already have an account please Login '); ?></h6>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-dark btn-sm" data-bs-dismiss="modal"><?php echo app('translator')->get('Close'); ?></button>
                    <a href="<?php echo e(route('user.login')); ?>" class="btn btn--base btn-sm"><?php echo app('translator')->get('Login'); ?></a>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php if($general->secure_password): ?>
    <?php $__env->startPush('script-lib'); ?>
        <script src="<?php echo e(asset('assets/global/js/secure_password.js')); ?>"></script>
    <?php $__env->stopPush(); ?>
<?php endif; ?>

<?php $__env->startPush('script'); ?>
    <script>
        "use strict";
        (function($) {
            $(document).ready(function() {
                $('select[name=country]').change();
            });

            $('select[name=country]').change(function() {
                $('input[name=mobile_code]').val($('select[name=country] :selected').data('mobile_code'));
                $('input[name=country_code]').val($('select[name=country] :selected').data('code'));
                $('.mobile-code').text('+' + $('select[name=country] :selected').data('mobile_code'));
            });

            $('input[name=mobile_code]').val($('select[name=country] :selected').data('mobile_code'));
            $('input[name=country_code]').val($('select[name=country] :selected').data('code'));
            $('.mobile-code').text('+' + $('select[name=country] :selected').data('mobile_code'));

            <?php if($mobileCode): ?>
                $(`option[data-code=<?php echo e($mobileCode); ?>]`).attr('selected', '');
            <?php endif; ?>

            $('.checkUser').on('focusout', function(e) {

                var url = '<?php echo e(route('user.checkUser')); ?>';
                var value = $(this).val();
                var token = '<?php echo e(csrf_token()); ?>';

                if ($(this).attr('name') == 'mobile') {
                    var mobile = `${$('.mobile-code').text().substr(1)}${value}`;
                    var data = {
                        mobile: mobile,
                        _token: token
                    };
                }

                if ($(this).attr('name') == 'email') {
                    var data = {
                        email: value,
                        _token: token
                    }
                }

                if ($(this).attr('name') == 'username') {
                    var data = {
                        username: value,
                        _token: token
                    }
                }

                $.post(url, data, function(response) {
                    if (response.data != false && response.type == 'email') {
                        $('#existModalCenter').modal('show');
                    } else if (response.data != false) {
                        $(`.${response.type}Exist`).text(`This ${response.type} is already exist`);
                    } else {
                        $(`.${response.type}Exist`).empty();
                    }
                });
            });


            $('select[name=country]').change();

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

<?php echo $__env->make($activeTemplate . 'layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/qsaytzgc/primeestones.com/core/resources/views/templates/crystal_sky/user/auth/register.blade.php ENDPATH**/ ?>