<div class="container">
    <div class="section-heading style-center">
        <h4 class="section-heading__title s-highlight" data-s-break="1" data-s-length="1"><?php echo e(__($content->heading)); ?></h4>
        <p class="section-heading__desc"><?php echo e(__($content->subheading)); ?></p>
    </div>

    <div class="pricing__tabs pb-2">
        <ul class="nav nav-pills custom--tab pricing-tabs" id="pricing-tab" role="tablist">
            <li class="nav-item-background"></li>
            <li class="nav-item" role="presentation">
                <button class="nav-link pricing__tabs-btn active" id="monthly-tab-btn" data-bs-toggle="pill"
                    data-bs-target="#monthlyTab" type="button" role="tab" aria-controls="monthlyTab"
                    aria-selected="true">
                   <?php echo app('translator')->get('Monthly'); ?>
                </button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link pricing__tabs-btn" id="yearly-tab-btn" data-bs-toggle="pill"
                    data-bs-target="#yearlyTab" type="button" role="tab" aria-controls="yearlyTab"
                    aria-selected="false">
                    <?php echo app('translator')->get('Yearly'); ?>
                </button>
            </li>
        </ul>
    </div>

    <div class="tab-content" id="pricing-tab-content">

        
        <div class="tab-pane fade show active" id="monthlyTab" role="tabpanel" aria-labelledby="monthly-tab-btn">
            <div class="row gy-4 justify-content-center">
                <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $price = $plan->monthly_price;
                        $userPlan = userActivePlan();
                        $isActive = $userPlan && activePlan($plan->id, $userPlan->plan_duration, 'monthly');
                        $isActiveMonthly = $isActive;
                        $isActiveYearly = $userPlan && activePlan($plan->id, $userPlan->plan_duration, 'yearly');
                    ?>
                    <div class="col-lg-4 col-md-6">
                        <div class="pricing__card">
                            <div class="pricing <?php echo e($plan->is_popular ? 'popular' : ''); ?>">
                                <div class="pricing__top">
                                    <span class="plan-name"><?php echo e($plan->name); ?></span>
                                    <h2 class="pricing__title">
                                        <?php echo e(gs('cur_sym') . showAmount($price, currencyFormat: false)); ?><span><sub>/
                                                <?php echo app('translator')->get('Monthly'); ?></sub></span>
                                    </h2>
                                </div>
                                <p class="text"><?php echo app('translator')->get('Save'); ?> <?php echo e(showAmount($plan->save_amount)); ?>

                                    <?php echo app('translator')->get('with yearly plan'); ?></p>

                                <div class="pricing__bottom">
                                    <ul>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Daily'); ?> <?php echo e($plan->daily_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Weekly'); ?> <?php echo e($plan->weekly_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Monthly'); ?> <?php echo e($plan->monthly_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                    </ul>

                                    <div class="pricing__button">
                                        <?php if(auth()->guard()->guest()): ?>
                                            <a class="btn btn--base"
                                                href="<?php echo e(route('user.login')); ?>"><?php echo app('translator')->get('Get Started'); ?></a>
                                        <?php else: ?>
                                            <div class="plan-action-buttons"
                                                data-active-monthly="<?php echo e($isActiveMonthly ? 'true' : 'false'); ?>"
                                                data-active-yearly="<?php echo e($isActiveYearly ? 'true' : 'false'); ?>">
                                                <form action="<?php echo e(route('user.plan.subscribe')); ?>" method="POST"
                                                    class="plan-form">
                                                    <?php echo csrf_field(); ?>
                                                    <input type="hidden" name="plan_id" value="<?php echo e($plan->id); ?>">
                                                    <input type="hidden" name="plan_type" value="monthly"
                                                        class="plan-type-input">
                                                    <button type="submit"
                                                        class="btn btn--base plan-purchase-btn"><?php echo app('translator')->get('Get Started'); ?></button>
                                                </form>
                                                <button class="btn btn--success plan-current-btn d-none"
                                                    disabled><?php echo e(__('Current Plan')); ?></button>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>

        
        <div class="tab-pane fade" id="yearlyTab" role="tabpanel" aria-labelledby="yearly-tab-btn">
            <div class="row gy-4 justify-content-center">
                <?php $__currentLoopData = $plans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $price = $plan->yearly_price;
                        $userPlan = userActivePlan();
                        $isActive = $userPlan && activePlan($plan->id, $userPlan->plan_duration, 'yearly');
                        $isActiveMonthly = $userPlan && activePlan($plan->id, $userPlan->plan_duration, 'monthly');
                        $isActiveYearly = $isActive;
                    ?>
                    <div class="col-lg-4 col-md-6">
                        <div class="pricing__card">
                            <div class="pricing <?php echo e($plan->is_popular ? 'popular' : ''); ?>">
                                <div class="pricing__top">
                                    <span class="plan-name"><?php echo e($plan->name); ?></span>
                                    <h2 class="pricing__title">
                                        <?php echo e(gs('cur_sym') . showAmount($price, currencyFormat: false)); ?><span><sub>/
                                                <?php echo app('translator')->get('Yearly'); ?></sub></span>
                                    </h2>
                                </div>
                                <p class="text"><?php echo app('translator')->get('Saving'); ?> <?php echo e(showAmount($plan->save_amount)); ?>

                                    <?php echo app('translator')->get('compared to monthly'); ?></p>

                                <div class="pricing__bottom">
                                    <ul>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Daily'); ?> <?php echo e($plan->daily_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Weekly'); ?> <?php echo e($plan->weekly_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                        <li><i class="las la-check"></i>
                                            <?php echo app('translator')->get('Monthly'); ?> <?php echo e($plan->monthly_limit); ?> <?php echo app('translator')->get('Item Downloads'); ?>
                                        </li>
                                    </ul>

                                    <div class="pricing__button">
                                        <?php if(auth()->guard()->guest()): ?>
                                            <a class="btn btn--base"
                                                href="<?php echo e(route('user.login')); ?>"><?php echo app('translator')->get('Get Started'); ?></a>
                                        <?php else: ?>
                                            <div class="plan-action-buttons"
                                                data-active-monthly="<?php echo e($isActiveMonthly ? 'true' : 'false'); ?>"
                                                data-active-yearly="<?php echo e($isActiveYearly ? 'true' : 'false'); ?>">
                                                <form action="<?php echo e(route('user.plan.subscribe')); ?>" method="POST"
                                                    class="plan-form">
                                                    <?php echo csrf_field(); ?>
                                                    <input type="hidden" name="plan_id" value="<?php echo e($plan->id); ?>">
                                                    <input type="hidden" name="plan_type" value="yearly"
                                                        class="plan-type-input">
                                                    <button type="submit"
                                                        class="btn btn--base plan-purchase-btn"><?php echo app('translator')->get('Get Started'); ?></button>
                                                </form>
                                                <button class="btn btn--success plan-current-btn d-none"
                                                    disabled><?php echo e(__('Current Plan')); ?></button>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    </div>

    
    <div class="col-12 pt-5">
        <div class="pricing_plan-more-info-block">
            <div class="pricing_plan-additional-plans-inner">
                <div class="pricing_plan-additional-title-2"><?php echo e(__($content->question)); ?></div>
                <div class="pricing_plan-basic-text"><?php echo e(__($content->content)); ?></div>
            </div>
            <a href="<?php echo e(route('contact')); ?>" class="btn btn--white btn--sm"><?php echo app('translator')->get('Contact Us'); ?></a>
        </div>
    </div>
</div>

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

            function moveTabHighlight() {
                var $activeBtn = $(".pricing-tabs .nav-link.active");
                var position = $activeBtn.parent().position();
                var width = $activeBtn.parent().outerWidth();

                $(".nav-item-background").css({
                    left: position.left,
                    width: width,
                });
            }

            function updateButtons(type) {
                $(".plan-action-buttons").each(function() {
                    var isActive = $(this).data("active-" + type) === true || $(this).data("active-" + type) ===
                        "true";
                    const $form = $(this).find("form");
                    const $submitBtn = $(this).find(".plan-purchase-btn");
                    const $currentBtn = $(this).find(".plan-current-btn");

                    $form.find(".plan-type-input").val(type);

                    if (isActive) {
                        $submitBtn.addClass("d-none");
                        $currentBtn.removeClass("d-none");
                    } else {
                        $submitBtn.removeClass("d-none");
                        $currentBtn.addClass("d-none");
                    }
                });
            }

            $(document).ready(function() {
                moveTabHighlight();
                updateButtons('monthly');
            });

            $(".pricing-tabs button").on("click", function() {
                setTimeout(() => {
                    moveTabHighlight();

                    const selectedTab = $(this).attr("data-bs-target");
                    const type = selectedTab.includes("yearly") ? "yearly" : "monthly";

                    updateButtons(type);
                }, 10);
            });

            $(window).on("resize", moveTabHighlight);
        })(jQuery);
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH D:\laragon\www\asdwf\core\resources\views/components/plan-card.blade.php ENDPATH**/ ?>