/**
 * @package Evento Corp
 */

jQuery(document).ready(function ($) {
  $("#dashboard-changelog-button").click(function (e) {
    e.stopPropagation();
    $("#evento-corp-dashboard-offcanvas").addClass("open");
    $(".wrap").addClass("overlay");
  });

  $("#dialog-close").click(function (e) {
    e.stopPropagation();
    $("#evento-corp-dashboard-offcanvas").removeClass("open");
    $(".wrap").removeClass("overlay");
  });

  $(document).on("click", function (e) {
    if (
      !$("#evento-corp-dashboard-offcanvas").is(e.target) &&
      $("#evento-corp-dashboard-offcanvas").has(e.target).length === 0
    ) {
      $("#evento-corp-dashboard-offcanvas").removeClass("open");
      $(".wrap").removeClass("overlay");
    }
  });
});

jQuery(document).ready(function ($) {
  var evento_corp_adminUrl = eventocorpRedirectDemoPage.admin_url;

  var evento_corp_targetUrl = evento_corp_adminUrl + "themes.php?page=evento-corp";

  var evento_corp_currentPage = window.location.href;

  $(".dashboard-header-nav ul li").each(function () {
    var pageURL = $(this).find("a").attr("href");
    $;
    if (evento_corp_currentPage === pageURL) {
      $(this).addClass("active");
    }
  });

  if (evento_corp_currentPage === evento_corp_targetUrl) {
    $(".dashboard-header-nav ul li:first").addClass("active");
  }
});