</div>

</div>
<div class="footer-wrapper">
    <div class="footer-section f-section-1">
        <p class="">Copyright © 2025 <?php echo $pageTitle ?>, All rights reserved.</p>
    </div>
    <div class="footer-section f-section-2">
        <p class=""><?php echo $pageTitle ?> </p>
    </div>
    
    
<!--Start of Livechat Script-->
 
 <?= $page['livechat'] ?>

<!--End of Livechat Script-->

</div>
</div>
<!--  END CONTENT AREA  -->


</div>
</div>
<!-- END MAIN CONTAINER -->

<!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
<!--<script src="../assets/js/libs/jquery-3.1.1.min.js"></script>-->
<script src="../bootstrap/js/popper.min.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<script src="../plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
<script src="../plugins/bootstrap-select/bootstrap-select.min.js"></script>
<script src="../plugins/file-upload/file-upload-with-preview.min.js"></script>
<script src="../assets/js/app.js"></script>
<script src="../assets/js/users/account-settings.js"></script>
<script src="../plugins/dropify/dropify.min.js"></script>
<script src="../plugins/blockui/jquery.blockUI.min.js"></script>

<script>
    $(document).ready(function() {
        App.init();
    });
</script>
<script src="../assets/js/custom.js"></script>
<script>
    var data = <?= @json_encode($data); ?>;
    console.log(data);
    function crypto_type(id){
        for(var i =0; i < data.length; i++){
            if(id == data[i].id){
                $("#wallet_address").val(data[i].wallet_address);
            }
        }
    }
    var firstUpload = new FileUploadWithPreview('myFirstImage')
</script>
<!-- END GLOBAL MANDATORY SCRIPTS -->


<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="../plugins/table/datatable/datatables.js"></script>
<script>
    $('#default-ordering').DataTable( {
        "dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
            "<'table-responsive'tr>" +
            "<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count  mb-sm-0 mb-3'i><'dt--pagination'p>>",
        "oLanguage": {
            "oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
            "sInfo": "Showing page _PAGE_ of _PAGES_",
            "sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
            "sSearchPlaceholder": "Search...",
            "sLengthMenu": "Results :  _MENU_",
        },
        //"order": [[ 3, "desc" ]],
        "stripeClasses": [],
        "lengthMenu": [7, 10, 20, 50],
        "pageLength": 7,
        drawCallback: function () { $('.dataTables_paginate > .pagination').addClass(' pagination-style-13 pagination-bordered'); }
    } );
</script>
<!-- END PAGE LEVEL SCRIPTS -->
<script type="text/javascript">
    function googleTranslateElementInit() {
        new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
    }
</script>

<script>
    // Get the Toast button
    var toastButton = document.getElementById("toast-btn");
    // Get the Toast element
    var toastElement = document.getElementsByClassName("toast")[0];

    toastButton.onclick = function() {
        $('.toast').toast('show');
    }


</script>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->

<script src="../plugins/apex/apexcharts.min.js"></script>
<script src="../assets/js/custom.js"></script>
<script src="../assets/js/dashboard/dash_1.js"></script>
<script src="../plugins/sweetalerts/sweetalert2.min.js"></script>
<script src="../plugins/sweetalerts/custom-sweetalert.js"></script>
<!-- BEGIN PAGE LEVEL PLUGINS/CUSTOM SCRIPTS -->



<script src="../plugins/notification/snackbar/snackbar.min.js"></script>
<script src="../assets/js/clipboard/clipboard.min.js"></script>
<script src="../assets/js/forms/custom-clipboard.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/imask/3.4.0/imask.min.js"></script>
<script src="../assets/js/card/card.js"></script>
<!-- END PAGE LEVEL PLUGINS -->

<!--  BEGIN CUSTOM SCRIPTS FILE  -->
<script src="../assets/js/components/notification/custom-snackbar.js"></script>


 <script>
      const countryLangMap = {
      AF: 'fa', AL: 'sq', DZ: 'ar', AS: 'en', AD: 'ca', AO: 'pt', AI: 'en', AQ: 'en',
      AG: 'en', AR: 'es', AM: 'hy', AW: 'nl', AU: 'en', AT: 'de', AZ: 'az', BS: 'en',
      BH: 'ar', BD: 'bn', BB: 'en', BY: 'be', BE: 'nl', BZ: 'en', BJ: 'fr', BM: 'en',
      BT: 'dz', BO: 'es', BA: 'bs', BW: 'en', BR: 'pt', BN: 'ms', BG: 'bg', BF: 'fr',
      BI: 'fr', KH: 'km', CM: 'fr', CA: 'en', CV: 'pt', CF: 'fr', TD: 'fr', CL: 'es',
      CN: 'zh-CN', CO: 'es', KM: 'ar', CG: 'fr', CD: 'fr', CR: 'es', CI: 'fr', HR: 'hr',
      CU: 'es', CY: 'el', CZ: 'cs', DK: 'da', DJ: 'fr', DM: 'en', DO: 'es', EC: 'es',
      EG: 'ar', SV: 'es', GQ: 'es', ER: 'ti', EE: 'et', ET: 'am', FJ: 'en', FI: 'fi',
      FR: 'fr', GA: 'fr', GM: 'en', GE: 'ka', DE: 'de', GH: 'en', GR: 'el', GL: 'da',
      GD: 'en', GT: 'es', GN: 'fr', GW: 'pt', GY: 'en', HT: 'ht', HN: 'es', HU: 'hu',
      IS: 'is', IN: 'hi', ID: 'id', IR: 'fa', IQ: 'ar', IE: 'en', IL: 'he', IT: 'it',
      JM: 'en', JP: 'ja', JO: 'ar', KZ: 'kk', KE: 'en', KI: 'en', KP: 'ko', KR: 'ko',
      KW: 'ar', KG: 'ky', LA: 'lo', LV: 'lv', LB: 'ar', LS: 'en', LR: 'en', LY: 'ar',
      LI: 'de', LT: 'lt', LU: 'fr', MK: 'mk', MG: 'fr', MW: 'en', MY: 'ms', MV: 'dv',
      ML: 'fr', MT: 'mt', MH: 'en', MR: 'ar', MU: 'en', MX: 'es', FM: 'en', MD: 'ro',
      MC: 'fr', MN: 'mn', ME: 'sr', MA: 'ar', MZ: 'pt', MM: 'my', NA: 'en', NP: 'ne',
      NL: 'nl', NZ: 'en', NI: 'es', NE: 'fr', NG: 'en', NO: 'no', OM: 'ar', PK: 'ur',
      PW: 'en', PA: 'es', PG: 'en', PY: 'es', PE: 'es', PH: 'en', PL: 'pl', PT: 'pt',
      QA: 'ar', RO: 'ro', RU: 'ru', RW: 'rw', KN: 'en', LC: 'en', VC: 'en', WS: 'sm',
      SM: 'it', ST: 'pt', SA: 'ar', SN: 'fr', RS: 'sr', SC: 'fr', SL: 'en', SG: 'en',
      SK: 'sk', SI: 'sl', SB: 'en', SO: 'so', ZA: 'en', ES: 'es', LK: 'si', SD: 'ar',
      SR: 'nl', SZ: 'en', SE: 'sv', CH: 'de', SY: 'ar', TW: 'zh-TW', TJ: 'tg', TZ: 'sw',
      TH: 'th', TL: 'pt', TG: 'fr', TO: 'en', TT: 'en', TN: 'ar', TR: 'tr', TM: 'tk',
      UG: 'en', UA: 'uk', AE: 'ar', GB: 'en', US: 'en', UY: 'es', UZ: 'uz', VU: 'bi',
      VA: 'it', VE: 'es', VN: 'vi', YE: 'ar', ZM: 'en', ZW: 'en'
    // ... include all your countries here
  };

   let targetLang = 'en'; // Default fallback

  function googleTranslateElementInit() {
    new google.translate.TranslateElement({
      pageLanguage: 'en',
      autoDisplay: false
    }, 'google_translate_element');

    const interval = setInterval(() => {
      const select = document.querySelector('.goog-te-combo');
      if (select && select.options.length > 1) {
        if (targetLang !== 'en') {
          select.value = targetLang;
          select.dispatchEvent(new Event('change'));
        }
        clearInterval(interval);
      }
    }, 500);
  }

  // Detect country and language
  fetch('https://ipapi.co/json/')
    .then(res => res.json())
    .then(data => {
      const countryCode = data.country_code;
      const lang = countryLangMap[countryCode];
      console.log(`Detected country code: ${countryCode}, Language: ${lang}`);
      if (lang) targetLang = lang;
    })
    .catch(err => {
      console.warn('Language detection failed:', err);
    })
    .finally(() => {
      // Load the translate widget AFTER detecting language
      const script = document.createElement('script');
      script.src = "//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit";
      document.body.appendChild(script);
    });
</script>

</body>
</html>