<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>YouTube Task</title>
    <script>
        function visitYouTube() {
            fetch("/youtube-link")
                .then(response => response.json())
                .then(data => {
                    if (data && data.url) {
                        window.open(data.url, "_blank");
                        setTimeout(() => {
                            fetch("/reward-user", {
                                method: "POST",
                                headers: {
                                    "X-CSRF-TOKEN": "<?php echo e(csrf_token()); ?>",
                                    "Content-Type": "application/json"
                                }
                            })
                            .then(response => response.json())
                            .then(result => {
                                if (result.success) {
                                    alert("20 Points Added! Your Balance: " + result.balance);
                                }
                            });
                        }, 60000);
                    } else {
                        alert("No YouTube link available!");
                    }
                });
        }
    </script>
</head>
<body>
 <!--   <button onclick="visitYouTube()">Visit YouTube & Earn</button>-->
</body>
</html>
<?php /**PATH /home/devsetup/progressive.devsetuphub.top/resources/views/task.blade.php ENDPATH**/ ?>