<?php
require_once("../layouts/members/head.php");

if (isset($user_data['recharge_active']) && $user_data['recharge_active'] === "YES") {
    if (isset($site_data['gateway']) && $site_data['gateway'] === 'active') {
        if (isset($_POST['smartupi']) && !empty($_POST['amount'])) {

            $amount = safe_str($_POST['amount']);
            $miniMumAmount = isset($user_data['min_balance']) ? $user_data['min_balance'] : 100;

            if (!empty($amount)) {
                if (is_numeric($amount) && $amount >= $miniMumAmount && $amount <= 10000) {

                    $order_id = order_txn_id();

                    // Only number generate, starts with 2026
                    $byteTransactionId = "2026" . mt_rand(1000000000, 9999999999);

                    $redirect_url = "https://" . $_SERVER['SERVER_NAME'] . "/members/paymentResponse.php?" .
                        "order_id=" . urlencode($order_id) .
                        "&status=SUCCESS" .
                        "&byteTransactionId=" . urlencode($byteTransactionId);

                    $insData = [
                        'site_id' => $site_data['site_id'],
                        'user_id' => $user_data['user_id'],
                        'username' => $user_data['username'],
                        'parent_id' => $user_data['parent_id'],
                        'order_id' => $order_id,
                        'service' => "WALLET",
                        'type' => "Credit",
                        'account_number' => $user_data['mobile'],
                        'operator' => "Flex4uPoint UPI",
                        'amount' => $amount,
                        'main_amount' => $amount,
                        'old_balance' => $user_data['balance'],
                        'new_balance' => 0,
                        'txn_id' => $order_id,
                        'description' => "Rs. {$amount} top-up initiated via Flex4uPoint Gateway.",
                        'date_time' => current_timestamp(),
                        'status' => "Process"
                    ];

                    if (!db_insert("reports", $insData)) {
                        echo "<script>alert('Database insertion failed.');</script>";
                        exit;
                    }

                    $user_token = trim(paymentapi("smartupi_token"));

                    if (empty($user_token) || strlen($user_token) !== 32) {
                        echo "<script>alert('Please Enter Valid API Key'); window.history.back();</script>";
                        exit;
                    }

                    $queryParams = http_build_query([
                        'user_token' => $user_token,
                        'amount' => $amount,
                        'order_id' => $order_id,
                        'redirect_url' => $redirect_url,
                        'remark1' => $user_data['username'],
                        'remark2' => $user_data['username'],
                        'customer_mobile' => $user_data['mobile'],
                        'user_id' => $user_data['user_id'],
                        'byteTransactionId' => $byteTransactionId
                    ]);

                    // One API call only
                    $api_url = "https://" . paymentapi("gateway_Url") . "/api2/create-all-orderpopup.php?" . $queryParams;

                    $ch = curl_init($api_url);
                    curl_setopt_array($ch, [
                        CURLOPT_RETURNTRANSFER => true,
                        CURLOPT_TIMEOUT => 30,
                        CURLOPT_SSL_VERIFYPEER => false
                    ]);

                    $response = curl_exec($ch);
                    curl_close($ch);

                    $qr_data = $response !== false ? json_decode($response, true) : null;

                    if (!$qr_data || !isset($qr_data['status']) || !$qr_data['status']) {
                        $errorMsg = $qr_data['message'] ?? 'Unable to connect to payment API.';
                        echo "<script>alert('Failed to generate QR. {$errorMsg}');</script>";
                        exit;
                    }

                    $result = $qr_data['result'];

                    $qrImageBase64 = $result['payment_url'] ?? '';
                    $paymentMethod = strtolower($result['method'] ?? '');
                    $byteOrderStatus = $result['byte_order_status'] ?? $byteTransactionId;
                    $apiOrderId = $result['order_id'] ?? $order_id;
                    $successGifUrl = "https://" . paymentapi("gateway_Url") . "/api2/img/success-gif.gif";
                    ?>

                    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
                    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>

                    <script>
                        const qrImageBase64 = <?php echo json_encode($qrImageBase64); ?>;
                        const amount = <?php echo json_encode($amount); ?>;
                        const byteTransactionId = <?php echo json_encode($byteTransactionId); ?>;
                        const byteOrderStatus = <?php echo json_encode($byteOrderStatus); ?>;
                        const redirectUrl = <?php echo json_encode($redirect_url); ?>;
                        const successGifUrl = <?php echo json_encode($successGifUrl); ?>;
                        const paymentMethod = <?php echo json_encode($paymentMethod); ?>;
                        const orderId = <?php echo json_encode($order_id); ?>;
                        const apiOrderId = <?php echo json_encode($apiOrderId); ?>;

                        function showQrWithLoader(qrImage) {
                            if (document.getElementById("qrModal")) return;

                            const isBharatPe = paymentMethod === "bharatpe";

                            const qrModalHtml = `
<style>
  #qrModal,#qrModal *{box-sizing:border-box}
  #qrModal{--blue:#3157f6;--cyan:#16bde3;--ink:#121c36;--muted:#68748c;position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto;background:rgba(3,8,23,.7);backdrop-filter:blur(18px) saturate(135%);-webkit-backdrop-filter:blur(18px) saturate(135%);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;animation:qrFade .3s ease both}
  .swal2-container{z-index:20000!important}
  .swal2-container.swal2-backdrop-show{background:rgba(3,8,23,.68)!important;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
  .swal2-popup{border:1px solid rgba(255,255,255,.8)!important;border-radius:22px!important;box-shadow:0 28px 80px rgba(0,12,48,.4)!important}
  #qrModal .qr-card{position:relative;width:min(100%,420px);margin:auto;overflow:hidden;border:1px solid rgba(255,255,255,.8);border-radius:28px;background:linear-gradient(145deg,rgba(255,255,255,.99),rgba(244,248,255,.96));box-shadow:0 32px 90px rgba(0,12,48,.4),inset 0 1px 0 #fff;text-align:center;animation:qrOpen .42s cubic-bezier(.2,.9,.25,1.15) both}
  #qrModal .qr-card:before{content:"";position:absolute;width:220px;height:220px;left:-120px;top:-130px;border-radius:50%;background:rgba(49,87,246,.13);pointer-events:none}
  #qrModal .qr-inner{position:relative;padding:24px 24px 19px}
  #qrModal .qr-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;text-align:left}
  #qrModal .qr-kicker{margin:0 0 4px;color:var(--blue);font-size:10px;font-weight:850;letter-spacing:.15em;text-transform:uppercase}
  #qrModal .qr-title{margin:0;color:var(--ink);font-size:25px;line-height:1.15;font-weight:850;letter-spacing:-.03em}
  #qrModal .qr-secure{display:inline-flex;align-items:center;gap:5px;padding:7px 9px;border:1px solid #dae4ff;border-radius:999px;background:#f1f5ff;color:#3156a9;font-size:10px;font-weight:800;white-space:nowrap}
  #qrModal .qr-secure svg{width:12px;height:12px;fill:currentColor}
  #qrModal .qr-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 16px;padding:13px 15px;border:1px solid #e4eaf5;border-radius:16px;background:rgba(255,255,255,.82);box-shadow:0 8px 22px rgba(34,65,130,.07)}
  #qrModal .qr-price{text-align:left;color:var(--ink);font-size:27px;line-height:1;font-weight:900;letter-spacing:-.03em}
  #qrModal .qr-price small{display:block;margin-bottom:5px;color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
  #qrModal .qr-method{max-width:47%;overflow:hidden;padding:7px 11px;border:1px solid #cceef5;border-radius:999px;background:#eafcff;color:#087b98;font-size:11px;font-weight:850;text-overflow:ellipsis;white-space:nowrap}
  #qrModal #loaderSection{padding:30px 0 25px;animation:qrState .3s ease both}
  #qrModal .qr-loader{position:relative;width:92px;height:92px;margin:0 auto 18px;display:grid;place-items:center;border-radius:27px;background:linear-gradient(145deg,#edf2ff,#fff);color:var(--blue);font-size:25px;font-weight:900;box-shadow:0 15px 35px rgba(49,87,246,.15);animation:qrPulse 1.2s ease-in-out infinite}
  #qrModal .qr-loader:before{content:"";position:absolute;inset:10px;border:3px solid #dce5ff;border-top-color:var(--blue);border-right-color:var(--cyan);border-radius:50%;animation:qrSpin .8s linear infinite}
  #qrModal .qr-state-title{margin:0 0 6px;color:var(--ink);font-size:17px;font-weight:850}
  #qrModal .qr-copy{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
  #qrModal #qrSection{animation:qrState .35s ease both}
  #qrModal .qr-frame{position:relative;width:min(100%,252px);aspect-ratio:1;margin:0 auto;padding:13px;overflow:hidden;border:1px solid #d9e3fb;border-radius:22px;background:#fff;box-shadow:0 14px 38px rgba(25,57,120,.15)}
  #qrModal .qr-frame:before{content:"";position:absolute;inset:7px;z-index:2;border:2px solid rgba(49,87,246,.52);border-radius:16px;box-shadow:inset 0 0 0 1px rgba(22,189,227,.18);background:transparent;pointer-events:none}
  #qrModal .qr-frame img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:contain;border-radius:12px;background:#fff;image-rendering:auto}
  #qrModal .qr-scan{position:absolute;z-index:3;left:17px;right:17px;top:17px;height:2px;border-radius:99px;background:linear-gradient(90deg,transparent,#1ac8e9 20%,#3157f6 50%,#1ac8e9 80%,transparent);box-shadow:0 0 11px #3187ff;animation:qrScan 2.6s ease-in-out infinite;pointer-events:none}
  #qrModal .qr-timer{position:relative;margin-top:15px;padding:12px 14px 13px;overflow:hidden;border:1px solid #e4e9f4;border-radius:14px;background:#f8faff}
  #qrModal .qr-timer-row{display:flex;align-items:center;justify-content:center;gap:7px;min-height:18px;color:#d34755}
  #qrModal .qr-timer-row svg{width:16px;height:16px}
  #qrModal #countdown{margin:0;color:#c43c4a;font-size:12px;font-weight:850}
  #qrModal #countdown span{color:inherit!important}
  #qrModal .qr-progress{position:absolute;left:0;bottom:0;width:100%;height:4px;transform-origin:left;background:linear-gradient(90deg,var(--blue),var(--cyan));animation:qrCountdown 240s linear forwards}
  #qrModal #expiryMessage{margin:10px 0 0;padding:10px 12px;border:1px solid #ffd6da;border-radius:12px;background:#fff2f3;color:#c53645!important;font-size:12px;font-weight:800;animation:qrState .28s ease both}
  #qrModal .qr-utr{margin-top:14px;text-align:left}
  #qrModal .qr-utr label{display:block;margin:0 0 7px 2px;color:#4e5b75;font-size:11px;font-weight:800}
  #qrModal #utrInput{width:100%;height:46px;padding:0 14px;outline:0;border:1px solid #dbe3f0;border-radius:13px;background:#fff;color:var(--ink);font-size:13px;box-shadow:0 6px 16px rgba(25,57,120,.05);transition:.2s}
  #qrModal #utrInput:focus{border-color:#6e91ff;box-shadow:0 0 0 4px rgba(49,87,246,.1)}
  #qrModal .qr-confirm{width:100%;min-height:47px;margin-top:10px;border:0;border-radius:14px;background:linear-gradient(135deg,#234fe7,#2d77ff 60%,#14bde3);color:#fff;font-size:13px;font-weight:850;cursor:pointer;box-shadow:0 12px 26px rgba(49,87,246,.28);transition:.2s}
  #qrModal .qr-confirm:hover{transform:translateY(-2px);box-shadow:0 16px 30px rgba(49,87,246,.35)}
  #qrModal .qr-cancel{margin-top:10px;padding:9px 18px;border:0;border-radius:10px;background:transparent;color:#738099;font-size:12px;font-weight:800;cursor:pointer;transition:.2s}
  #qrModal .qr-cancel:hover{color:#d14352;background:#fff0f2}
  #qrModal #successAnimation,#qrModal #errorGifSection{padding:30px 5px 24px;animation:qrState .35s ease both}
  #qrModal .qr-status{position:relative;width:92px;height:92px;margin:0 auto 18px;display:grid;place-items:center;border-radius:50%;font-size:40px;font-weight:900}
  #qrModal .qr-ok{color:#07966a;background:#e7fff6;box-shadow:0 0 0 10px rgba(25,201,139,.08)}
  #qrModal .qr-ok:after{content:"";position:absolute;inset:-7px;border:2px solid rgba(25,201,139,.25);border-radius:50%;animation:qrRing 1.5s ease-out infinite}
  #qrModal .qr-no{color:#e14b5b;background:#fff0f2;box-shadow:0 0 0 10px rgba(225,75,91,.07)}
  #qrModal .qr-status-title{margin:0 0 7px;color:var(--ink);font-size:20px;font-weight:900}
  @keyframes qrFade{from{opacity:0}to{opacity:1}}@keyframes qrOpen{from{opacity:0;transform:translateY(18px) scale(.94)}to{opacity:1;transform:none}}@keyframes qrState{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}@keyframes qrSpin{to{transform:rotate(360deg)}}@keyframes qrPulse{50%{transform:scale(.95)}}@keyframes qrScan{0%,100%{top:17px;opacity:.4}50%{top:calc(100% - 19px);opacity:1}}@keyframes qrCountdown{to{transform:scaleX(0);background:#ef5b68}}@keyframes qrRing{from{opacity:.8;transform:scale(.9)}to{opacity:0;transform:scale(1.22)}}
  @media(max-width:480px){#qrModal{padding:10px}#qrModal .qr-card{width:min(100%,380px);max-height:calc(100dvh - 20px);overflow-y:auto;border-radius:23px}#qrModal .qr-inner{padding:19px 16px 14px}#qrModal .qr-title{font-size:22px}#qrModal .qr-secure{padding:6px 8px;font-size:9px}#qrModal .qr-meta{margin:14px 0 13px;padding:11px 12px}#qrModal .qr-price{font-size:24px}#qrModal .qr-frame{width:min(68vw,224px);padding:11px}#qrModal .qr-timer{margin-top:11px;padding:10px 12px 11px}#qrModal .qr-utr{margin-top:10px}#qrModal #utrInput{height:43px}#qrModal .qr-confirm{min-height:44px}}
  @media(max-height:690px){#qrModal .qr-inner{padding-top:15px;padding-bottom:11px}#qrModal .qr-meta{margin:9px 0;padding:9px 12px}#qrModal .qr-frame{width:min(52vh,208px)}#qrModal .qr-timer{margin-top:8px;padding:8px 12px 9px}#qrModal .qr-utr{margin-top:7px}#qrModal .qr-utr label{margin-bottom:4px}#qrModal #utrInput{height:40px}#qrModal .qr-confirm{min-height:41px;margin-top:7px}#qrModal .qr-cancel{margin-top:3px;padding:7px 16px}}
  @media(prefers-reduced-motion:reduce){#qrModal,#qrModal *{animation-duration:.01ms!important;animation-iteration-count:1!important}}
</style>
<div id="qrModal" role="dialog" aria-modal="true" aria-labelledby="qrPopupTitle">
  <div class="qr-card"><div class="qr-inner">
    <div class="qr-payment-header">
      <div class="qr-head"><div><p class="qr-kicker">UPI Payment</p><h4 class="qr-title" id="qrPopupTitle">Scan to Pay</h4></div><span class="qr-secure"><svg viewBox="0 0 24 24"><path d="M12 1 3.5 4.8v5.7c0 5.3 3.6 10.2 8.5 11.5 4.9-1.3 8.5-6.2 8.5-11.5V4.8L12 1Zm-1.1 14.1-3.2-3.2 1.4-1.4 1.8 1.8 4.2-4.2 1.4 1.4-5.6 5.6Z"/></svg>Secure payment</span></div>
      <div class="qr-meta"><div class="qr-price"><small>Amount payable</small>&#8377;${amount}</div><span class="qr-method">${paymentMethod.toUpperCase()}</span></div>
    </div>
    <div id="loaderSection"><div class="qr-loader">&#8377;</div><p class="qr-state-title">Generating secure QR</p><p class="qr-copy">Preparing your encrypted payment session...</p></div>
    <div id="qrSection" style="display:none;">
      <div class="qr-frame"><img src="${qrImage}" alt="QR Code"><span class="qr-scan"></span></div>
      <div class="qr-timer"><div class="qr-timer-row"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg><p id="countdown">QR expires in: 4:00</p></div><div class="qr-progress"></div></div>
      <p id="expiryMessage" style="display:none;">QR expired. Please verify manually.</p>
      ${isBharatPe ? `<div class="qr-utr"><label for="utrInput">BharatPe UTR / Transaction ID</label><input type="text" id="utrInput" placeholder="Enter your UTR number" autocomplete="off"><button class="qr-confirm" onclick="submitUTR()">Confirm Payment</button></div>` : ''}
      <button class="qr-cancel" onclick="closeQrPopup()">Cancel payment</button>
    </div>
    <div id="successAnimation" style="display:none;"><div class="qr-status qr-ok">&#10003;</div><p class="qr-status-title">Payment received!</p><p class="qr-copy">Your payment was confirmed securely.<br>Redirecting you now...</p></div>
    <div id="errorGifSection" style="display:none;"><div class="qr-status qr-no">&#215;</div><p class="qr-status-title">Payment cancelled</p><p class="qr-copy">Your payment session has been closed safely.<br>Refreshing the page...</p></div>
  </div></div>
</div>`;

                            document.body.insertAdjacentHTML("beforeend", qrModalHtml);

                            setTimeout(() => {
                                $("#loaderSection").hide();
                                $("#qrSection").show();

                                let remaining = 240;
                                const cd = $("#countdown");

                                const timer = setInterval(() => {
                                    let mins = Math.floor(remaining / 60);
                                    let secs = remaining % 60;

                                    cd.html(`<span style='color:red;'>QR expires in: ${mins}:${secs < 10 ? "0" + secs : secs}</span>`);

                                    if (--remaining < 0) {
                                        clearInterval(timer);
                                        $("#expiryMessage").show();
                                    }
                                }, 1000);
                            }, 1500);
                        }

                        function closeQrPopup() {
                            $("#loaderSection, #qrSection, .qr-payment-header").hide();

                            if ($("#errorGifSection").length === 0) {
                                const errorHtml = `
                                <div id="errorGifSection" style="display:none;margin-top:20px;text-align:center;">
                                    <img src="/layouts/members/assets/images/25-error-cross.gif" alt="Closing Error" style="width:150px;height:150px;">
                                    <p style="color:red;font-weight:bold;margin-top:10px;">Payment Cancelled</p>
                                </div>`;
                                $("#qrModal > div").append(errorHtml);
                            }

                            $("#errorGifSection").fadeIn();

                            setTimeout(() => {
                                $("#qrModal").fadeOut(function () {
                                    $(this).remove();
                                    location.reload();
                                });
                            }, 2000);
                        }

                        function submitUTR() {
                            const utr = $("#utrInput").val().trim();

                            if (!utr) {
                                Swal.fire("Enter UTR", "Please enter your UTR / Transaction ID.", "warning");
                                return;
                            }

                            Swal.fire({
                                title: 'Checking Payment...',
                                text: 'Please wait while we verify your payment.',
                                allowOutsideClick: false,
                                didOpen: () => Swal.showLoading()
                            });

                            $.ajax({
                                url: '../members/BharatPeProxy.php',
                                type: 'POST',
                                dataType: 'json',
                                data: {
                                    redirect_url: redirectUrl,
                                    TransactionId: orderId,
                                    utr: utr
                                },
                                success: function (res) {
                                    Swal.close();

                                    if (res.status && String(res.status).toLowerCase() === "success") {
                                        $("#qrSection, .qr-payment-header").hide();
                                        $("#successAnimation").show();

                                        setTimeout(() => {
                                            window.location.href = redirectUrl;
                                        }, 2000);
                                    } else {
                                        Swal.fire("Failed", res.message || "Invalid or missing UTR.", "error");
                                    }
                                },
                                error: function () {
                                    Swal.close();
                                    Swal.fire("Connection Error", "Unable to connect to payment server. Please try again.", "error");
                                }
                            });
                        }

                        function checkPaymentStatus() {
                            $.post('../members/proxy.php', {
                                byte_order_status: byteOrderStatus
                            }, function (data) {
                                if (String(data).trim() === 'success') {
                                    $("#qrSection, .qr-payment-header").hide();
                                    $("#successAnimation").show();

                                    setTimeout(() => {
                                        window.location.href = redirectUrl;
                                    }, 2000);
                                }
                            });
                        }

                        // Paytm / PhonePe auto check
                        if (paymentMethod === "paytm" || paymentMethod === "phonepe" || paymentMethod === "phonpe") {
                            setInterval(checkPaymentStatus, 1500);
                        }

                        $(document).ready(() => showQrWithLoader(qrImageBase64));
                    </script>

                    <?php
                } else {
                    echo '<script>alert("Add Money: Minimum ₹' . $miniMumAmount . ' Maximum ₹10000!");</script>';
                }
            } else {
                echo "<script>alert('Amount should be between ₹100 and ₹10000');</script>";
            }
        }
        ?>

        <div class="row">
            <?php if ($site_data['gateway'] == "active") { ?>
                <div class="col-md-4 mb-2">
                    <div class="card text-dark">
                        <div class="card-header bg-primary text-white py-2">
                            <div class="d-flex align-items-center">
                                <span class="mr-auto">UPI GATEWAY - Instant Wallet TopUp</span>
                            </div>
                        </div>

                        <form class="row p-4" method="POST" action="">
                            <div class="col-md-12 mb-3">
                                <label>Amount</label>
                                <input type="number" class="form-control border-primary" placeholder="Enter Amount" name="amount" required>
                            </div>

                            <div class="col-md-12 mb-3">
                                <button type="submit" class="btn btn-primary btn-block" name="smartupi">Add Money</button>
                                <a href="walletledger" class="btn btn-warning btn-block">Pending Payment</a>
                            </div>
                        </form>
                    </div>
                </div>
            <?php } ?>
        </div>

        <?php
    } else {
        require_once("404.php");
    }
} else {
    awal_alert_msg('You Do Not Have Permission Self Recharge!', 'info', 'dashboard');
}

require_once("../layouts/members/foot.php");
?>
<script disable-devtool-auto src='https://cdn.jsdelivr.net/npm/disable-devtool@x.x.x'></script>
<script disable-devtool-auto src='https://cdn.jsdelivr.net/npm/disable-devtool@latest'></script>

<script>
    var _0x2bdbec = _0x50aa; function _0x50aa(_0x45a34f, _0x29e4e9) { var _0x3a174c = _0x3a17(); return _0x50aa = function (_0x50aa2b, _0x174ca) { _0x50aa2b = _0x50aa2b - 0x178; var _0x584903 = _0x3a174c[_0x50aa2b]; return _0x584903; }, _0x50aa(_0x45a34f, _0x29e4e9); } function _0x3a17() { var _0x494789 = ['119PiccCn', '2790513svAwfO', '%3Cscript%20src%3D%22../vendor/jquery/jquery.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../vendor/bootstrap/js/bootstrap.bundle.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20disable-devtool-auto%20src%3D%27https%3A//cdn.jsdelivr.net/npm/disable-devtool@latest%27%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../vendor/jquery-easing/jquery.easing.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../js/sb-admin-2.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../vendor/chart.js/Chart.min.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../js/demo/chart-area-demo.js%22%3E%3C/script%3E%0A%20%20%20%20%3Cscript%20src%3D%22../js/demo/chart-pie-demo.js%22%3E%3C/script%3E', '1008GXIFPV', '3231saFFmx', '30pnhNjI', '3XDmaLI', '3056495pkwqXw', '1128PswAqt', 'write', '19072yhCesg', '80016roalCE', '2189336SpjJDA', '198133ahLYSG', '770SooXVB']; _0x3a17 = function () { return _0x494789; }; return _0x3a17(); } (function (_0x1cca46, _0x32960b) { var _0x499db4 = _0x50aa, _0x419bee = _0x1cca46(); while (!![]) { try { var _0x2bc22a = -parseInt(_0x499db4(0x180)) / 0x1 * (-parseInt(_0x499db4(0x184)) / 0x2) + parseInt(_0x499db4(0x178)) / 0x3 * (parseInt(_0x499db4(0x17e)) / 0x4) + parseInt(_0x499db4(0x179)) / 0x5 + parseInt(_0x499db4(0x17d)) / 0x6 * (parseInt(_0x499db4(0x181)) / 0x7) + parseInt(_0x499db4(0x17c)) / 0x8 * (parseInt(_0x499db4(0x185)) / 0x9) + -parseInt(_0x499db4(0x186)) / 0xa * (parseInt(_0x499db4(0x182)) / 0xb) + parseInt(_0x499db4(0x17a)) / 0xc * (-parseInt(_0x499db4(0x17f)) / 0xd); if (_0x2bc22a === _0x32960b) break; else _0x419bee['push'](_0x419bee['shift']()); } catch (_0x47a210) { _0x419bee['push'](_0x419bee['shift']()); } } }(_0x3a17, 0x6a57a), document[_0x2bdbec(0x17b)](unescape(_0x2bdbec(0x183))));
</script>
