<?php // templates/backend_js.php ?>
<!--begin::Script-->
<script src="https://cdn.jsdelivr.net/npm/overlayscrollbars@2.11.0/browser/overlayscrollbars.browser.es6.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="/projects/kkv1/ehongmd/js/adminlte.js"></script>
<script>
  const SELECTOR_SIDEBAR_WRAPPER = '.sidebar-wrapper';
  const Default = {
    scrollbarTheme: 'os-theme-light',
    scrollbarAutoHide: 'leave',
    scrollbarClickScroll: true,
  };
  document.addEventListener('DOMContentLoaded', function () {
    const sidebarWrapper = document.querySelector(SELECTOR_SIDEBAR_WRAPPER);
    if (sidebarWrapper && OverlayScrollbarsGlobal?.OverlayScrollbars !== undefined) {
      OverlayScrollbarsGlobal.OverlayScrollbars(sidebarWrapper, {
        scrollbars: {
          theme: Default.scrollbarTheme,
          autoHide: Default.scrollbarAutoHide,
          clickScroll: Default.scrollbarClickScroll,
        },
      });
    }
  });
</script>
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0/Sortable.min.js" crossorigin="anonymous"></script>
<script>
  if (document.querySelector('.connectedSortable')) {
    new Sortable(document.querySelector('.connectedSortable'), {
      group: 'shared', handle: '.card-header',
    });
    document.querySelectorAll('.connectedSortable .card-header').forEach(h => h.style.cursor = 'move');
  }
</script>
<script src="https://cdn.jsdelivr.net/npm/apexcharts@3.37.1/dist/apexcharts.min.js" integrity="sha256-+vh8GkaU7C9/wbSLIcwq82tQ2wTf44aOHA8HlBMwRI8=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/js/jsvectormap.min.js" integrity="sha256-/t1nN2956BT869E6H4V1dnt0X5pAQHPytli+1nTZm2Y=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jsvectormap@1.5.3/dist/maps/world.js" integrity="sha256-XPpPaZlU8S/HWf7FZLAncLg2SAkP8ScUTII89x9D3lY=" crossorigin="anonymous"></script>
<script>
  if (document.querySelector('#world-map')) {
    new jsVectorMap({ selector: '#world-map', map: 'world' });
  }
  if (document.querySelector('#revenue-chart')) {
    const sales_chart = new ApexCharts(document.querySelector('#revenue-chart'), {
      series: [{ name:'Digital Goods', data:[28,48,40,19,86,27,90] },{ name:'Electronics', data:[65,59,80,81,56,55,40] }],
      chart: { height:210, type:'area', toolbar:{ show:false } },
      legend: { show:false }, colors:['#0d6efd','#20c997'],
      dataLabels: { enabled:false }, stroke: { curve:'smooth' },
      xaxis: { type:'datetime', categories:['2023-01-01','2023-02-01','2023-03-01','2023-04-01','2023-05-01','2023-06-01','2023-07-01','2023-08-01'] },
      tooltip: { x:{ format:'MMMM yyyy' } },
    });
    sales_chart.render();
  }
</script>
<!--end::Script-->
