const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./chunks/monsterinsights-SettingsTabGeneral-Lite-Bxui130_.js","./chunks/ajax-B_XS1gT5.js","./chunks/toastStore-CRCNwITM.js","./chunks/settings-DM9kkmj_.js","./chunks/SettingsBlock-DC9CU9Pg.js","./chunks/_plugin-vue_export-helper-1tPrXgE0.js","../css/main-monsterinsights-DCic6-mZ.css","./chunks/SettingsInputRadio-BbQ7Dhsq.js","./chunks/monsterinsights-Lite-uQE5cjXl.js","./chunks/TheAppHeader-DEdY-dez.js","./chunks/addons-CSVIjAyY.js","./chunks/useNotices-BpzNuZJ7.js","./chunks/Modal-B9mMTzc_.js","../css/main-monsterinsights-nGno5xCI.css","./chunks/license-Boh3_ZVs.js","../css/main-monsterinsights-UNEVlsO2.css","./chunks/monsterinsights-SettingsInputAuthenticate-Lite-B7bJaDZp.js","./chunks/auth-CC6F9_ZC.js","./chunks/SettingsInputCheckbox-DMSbcuhM.js","./chunks/SettingsInfoTooltip-05GT3kKT.js","./chunks/SettingsLiteUpsellLarge-lnF3P2B8.js","./chunks/LaunchWizardButton-D24aVnkm.js","./chunks/monsterinsights-SettingsTabEngagement-BDfymmEF.js","./chunks/SettingsInputText-DEkJNBzd.js","../css/main-monsterinsights-D0h0-uQX.css","./chunks/SettingsInputRepeater-DyYwxKfe.js","./chunks/SettingsAddonUpgrade-BDHiAret.js","./chunks/monsterinsights-SettingsTabEcommerce-Lite-BRADOhSj.js","./chunks/monsterinsights-SettingsTabPublisher-O55IN5Qb.js","./chunks/UniversallyPromo-NH8NC5TQ.js","./chunks/default-i18n-KrIlCc2E.js","../css/main-monsterinsights-RvD8Et7x.css","../css/main-monsterinsights-Cqq4LlhY.css","./chunks/monsterinsights-SettingsTabConversions-DsiayAA5.js","./chunks/SettingsAddonDisabled-T8OUEbF2.js","../css/main-monsterinsights-CsR3wNZX.css","./chunks/monsterinsights-SettingsTabAdvanced-DeBaqBu6.js","./chunks/SettingsInputSelect-CeXJ757T.js","./chunks/vue-multiselect.esm-DVzdjNub.js","../css/main-monsterinsights-BQCovfZ-.css","./chunks/SettingsInputNumber-WTq-M48c.js","../css/main-monsterinsights-BQlCMxYl.css","../css/main-monsterinsights-0QtwiYnh.css","./chunks/monsterinsights-SettingsTabSetupChecklist-CUn8CS7s.js","./chunks/SettingsGoogleAds-Lite-y0Dk70fr.js","../css/main-monsterinsights-CBX2MtVm.css","./chunks/PopularPostsShell-CpJtUL2Z.js","./chunks/PopularPostsInline-BRJljs_D.js","./chunks/PopularPostsVideoModal-DwXBhNEd.js","./chunks/popularPosts-YBcx2bWk.js","../css/main-monsterinsights-BfA9e5wT.css","./chunks/LoadingSpinnerInline-B4kX5NYb.js","../css/main-monsterinsights-CKJSBouy.css","./chunks/PopularPostsWidget-DtKGK2Vk.js","./chunks/Icon-Cz1-Vo-r.js","../css/main-monsterinsights-DdCOUrGJ.css","./chunks/monsterinsights-PopularPostsProducts-Lite-CATuR8dd.js","./chunks/PopularPostsSettings-BL5t_S0L.js","./chunks/AboutShell-CT3oTaKU.js","./chunks/monsterinsights-AboutTabAboutUs-CDzilzN5.js","./chunks/AboutBlock-BfOKyBy8.js","./chunks/monsterinsights-AboutTabGettingStarted-BfAJsOKi.js","./chunks/monsterinsights-AboutTabLiteVsPro-th2cOlRN.js","./chunks/SeoShell-DRFzh8yD.js","./chunks/seo-vgfHxltu.js","./chunks/WpconsentShell-Ckw7elwi.js","./chunks/UserFeedbackShell-BDMT1ODP.js","./chunks/RewardsWpShell-C8H1fux-.js","./chunks/ToolsLayout-dy8jgJtO.js","./chunks/monsterinsights-ToolsTabUrlBuilder-C4wFDF4s.js","./chunks/monsterinsights-ToolsTabImportExport-Boy4S9Na.js","../css/main-monsterinsights-DFCy1PHe.css","./chunks/monsterinsights-ToolsTabReportExport-DozgK2km.js","../css/main-monsterinsights-89q6pPXJ.css","./chunks/monsterinsights-ToolsPrettyLinksFlow-CNAVyqPd.js","./chunks/ToolsTabVerifiedBadge-D-DIi78Y.js","./chunks/ToolsTabEEACompliance-TWnb8cwi.js","./chunks/SiteNotesLayout-CfjVqUla.js","./chunks/SiteNotesList-b0Bwbmzb.js","./chunks/flatpickr-CNAtgokQ.js","../css/main-monsterinsights-CMSe2SYd.css","./chunks/siteNotes-CUK65xMh.js","./chunks/SiteNotesCategory-CeogqYt_.js","./chunks/SiteNotesExport-v7vJQ7wx.js","./chunks/SiteNotesIntegration-Dd6KHOh4.js","./chunks/AddonsPage-CiYjk7Ya.js","../css/main-monsterinsights-CGAGRmkt.css"])))=>i.map(i=>d[i]);
import { o as openBlock, E as createBlock, b as createVNode, D as withCtx, u as unref, c as createElementBlock, i as normalizeClass, a as createBaseVNode, t as toDisplayString, s as createCommentVNode, T as Transition, Q as Teleport, m as computed, j as ref, A as createTextVNode, B as withModifiers, r as resolveComponent, C as watch, y as onMounted, F as Fragment, d as createApp } from "./chunks/toastStore-CRCNwITM.js";
import { b as useRoute, e as _sfc_main$5, _ as _sfc_main$7, c as createRouter, a as createWebHashHistory } from "./chunks/TheAppHeader-DEdY-dez.js";
import { _ as _sfc_main$c, i as installOverlays } from "./chunks/AppOverlays-BGer0Qoo.js";
import { _ as __vitePreload, j as getMiGlobal, k as isPro, s as setupPinia } from "./chunks/ajax-B_XS1gT5.js";
import { v as vTooltip } from "./chunks/vTooltip-DWqiyUWL.js";
import { u as useAuth, _ as _sfc_main$6, a as _sfc_main$8, b as _sfc_main$9, c as _sfc_main$a } from "./chunks/monsterinsights-Lite-uQE5cjXl.js";
import { b as useSaveStatus, a as useToast, c as useAddonsStore, _ as _sfc_main$b } from "./chunks/addons-CSVIjAyY.js";
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper-1tPrXgE0.js";
import { u as useSettingsStore } from "./chunks/settings-DM9kkmj_.js";
import { u as useLicenseStore } from "./chunks/license-Boh3_ZVs.js";
import { a as authApi } from "./chunks/auth-CC6F9_ZC.js";
import "./chunks/useNotices-BpzNuZJ7.js";
import "./chunks/Modal-B9mMTzc_.js";
const { __ } = wp.i18n;
const SettingsTabGeneral = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabGeneral-Lite-Bxui130_.js"), true ? __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]) : void 0, import.meta.url);
const SettingsTabEngagement = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabEngagement-BDfymmEF.js"), true ? __vite__mapDeps([22,1,2,10,11,12,13,4,5,6,18,3,8,9,14,15,19,23,24,25,26]) : void 0, import.meta.url);
const SettingsTabEcommerce = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabEcommerce-Lite-BRADOhSj.js"), true ? __vite__mapDeps([27,1,2]) : void 0, import.meta.url);
const SettingsTabPublisher = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabPublisher-O55IN5Qb.js"), true ? __vite__mapDeps([28,1,2,3,10,11,12,13,4,5,6,25,8,9,14,15,19,26,18,7,29,30,31,32]) : void 0, import.meta.url);
const SettingsTabConversions = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabConversions-DsiayAA5.js"), true ? __vite__mapDeps([33,9,2,1,10,11,12,13,14,4,5,6,26,34,18,3,8,15,19,23,24,35]) : void 0, import.meta.url);
const SettingsTabAdvanced = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabAdvanced-DeBaqBu6.js"), true ? __vite__mapDeps([36,1,2,8,9,3,10,11,12,13,14,15,4,5,6,37,38,19,39,7,18,23,24,25,26,34,40,41,20,42]) : void 0, import.meta.url);
const SettingsTabSetupChecklist = () => __vitePreload(() => import("./chunks/monsterinsights-SettingsTabSetupChecklist-CUn8CS7s.js"), true ? __vite__mapDeps([43,2,1,10,11,12,13,14,4,5,6,21]) : void 0, import.meta.url);
const SettingsGoogleAds = () => __vitePreload(() => import("./chunks/SettingsGoogleAds-Lite-y0Dk70fr.js"), true ? __vite__mapDeps([44,2,12,13,5,45]) : void 0, import.meta.url);
const PopularPostsShell = () => __vitePreload(() => import("./chunks/PopularPostsShell-CpJtUL2Z.js"), true ? __vite__mapDeps([46,2]) : void 0, import.meta.url);
const PopularPostsInline = () => __vitePreload(() => import("./chunks/PopularPostsInline-BRJljs_D.js"), true ? __vite__mapDeps([47,3,2,1,48,49,10,11,12,13,23,8,9,14,15,19,5,24,38,37,39,50,4,6,7,40,41,51,30,52,18]) : void 0, import.meta.url);
const PopularPostsWidget = () => __vitePreload(() => import("./chunks/PopularPostsWidget-DtKGK2Vk.js"), true ? __vite__mapDeps([53,3,2,1,48,49,10,11,12,13,23,8,9,14,15,19,5,24,38,37,39,50,4,6,7,18,51,30,52,54,55]) : void 0, import.meta.url);
const PopularPostsProducts = () => __vitePreload(() => import("./chunks/monsterinsights-PopularPostsProducts-Lite-CATuR8dd.js"), true ? __vite__mapDeps([56,1,2]) : void 0, import.meta.url);
const PopularPostsSettings = () => __vitePreload(() => import("./chunks/PopularPostsSettings-BL5t_S0L.js"), true ? __vite__mapDeps([57,2,10,11,1,12,13,4,5,6,18,3,8,9,14,15,19,7,49]) : void 0, import.meta.url);
const AboutShell = () => __vitePreload(() => import("./chunks/AboutShell-CT3oTaKU.js"), true ? __vite__mapDeps([58,2]) : void 0, import.meta.url);
const AboutTabAboutUs = () => __vitePreload(() => import("./chunks/monsterinsights-AboutTabAboutUs-CDzilzN5.js"), true ? __vite__mapDeps([59,10,11,2,1,12,13,60,5,9,14]) : void 0, import.meta.url);
const AboutTabGettingStarted = () => __vitePreload(() => import("./chunks/monsterinsights-AboutTabGettingStarted-BfAJsOKi.js"), true ? __vite__mapDeps([61,14,2,1,11,60,5,21,10,12,13]) : void 0, import.meta.url);
const AboutTabLiteVsPro = () => __vitePreload(() => import("./chunks/monsterinsights-AboutTabLiteVsPro-th2cOlRN.js"), true ? __vite__mapDeps([62,1,2,60,5]) : void 0, import.meta.url);
const SeoShell = () => __vitePreload(() => import("./chunks/SeoShell-DRFzh8yD.js"), true ? __vite__mapDeps([63,2,10,11,1,12,13,64,5,14]) : void 0, import.meta.url);
const WpconsentShell = () => __vitePreload(() => import("./chunks/WpconsentShell-Ckw7elwi.js"), true ? __vite__mapDeps([65,2,9,1,10,11,12,13,5]) : void 0, import.meta.url);
const UserFeedbackShell = () => __vitePreload(() => import("./chunks/UserFeedbackShell-BDMT1ODP.js"), true ? __vite__mapDeps([66,2,10,11,1,12,13,5]) : void 0, import.meta.url);
const RewardsWpShell = () => __vitePreload(() => import("./chunks/RewardsWpShell-C8H1fux-.js"), true ? __vite__mapDeps([67,2,10,11,1,12,13,5]) : void 0, import.meta.url);
const ToolsLayout = () => __vitePreload(() => import("./chunks/ToolsLayout-dy8jgJtO.js"), true ? __vite__mapDeps([68,2]) : void 0, import.meta.url);
const ToolsTabUrlBuilder = () => __vitePreload(() => import("./chunks/monsterinsights-ToolsTabUrlBuilder-C4wFDF4s.js"), true ? __vite__mapDeps([69,2,4,5,6,19,1,20,10,11,12,13]) : void 0, import.meta.url);
const ToolsTabImportExport = () => __vitePreload(() => import("./chunks/monsterinsights-ToolsTabImportExport-Boy4S9Na.js"), true ? __vite__mapDeps([70,2,4,5,6,19,3,1,10,11,12,13,71]) : void 0, import.meta.url);
const ToolsTabReportExport = () => __vitePreload(() => import("./chunks/monsterinsights-ToolsTabReportExport-DozgK2km.js"), true ? __vite__mapDeps([72,2,4,5,6,51,30,52,1,10,11,12,13,73]) : void 0, import.meta.url);
const ToolsPrettyLinksFlow = () => __vitePreload(() => import("./chunks/monsterinsights-ToolsPrettyLinksFlow-CNAVyqPd.js"), true ? __vite__mapDeps([74,10,11,2,1,12,13]) : void 0, import.meta.url);
const ToolsTabVerifiedBadge = () => __vitePreload(() => import("./chunks/ToolsTabVerifiedBadge-D-DIi78Y.js"), true ? __vite__mapDeps([75,2,4,5,6,18,3,1,8,9,10,11,12,13,14,15,19,7]) : void 0, import.meta.url);
const ToolsTabEEACompliance = () => __vitePreload(() => import("./chunks/ToolsTabEEACompliance-TWnb8cwi.js"), true ? __vite__mapDeps([76,4,2,5,6,19,3,1,10,11,12,13]) : void 0, import.meta.url);
const SiteNotesLayout = () => __vitePreload(() => import("./chunks/SiteNotesLayout-CfjVqUla.js"), true ? __vite__mapDeps([77,2]) : void 0, import.meta.url);
const SiteNotesList = () => __vitePreload(() => import("./chunks/SiteNotesList-b0Bwbmzb.js"), true ? __vite__mapDeps([78,2,4,5,6,1,79,80,81,10,11,12,13]) : void 0, import.meta.url);
const SiteNotesCategory = () => __vitePreload(() => import("./chunks/SiteNotesCategory-CeogqYt_.js"), true ? __vite__mapDeps([82,2,4,5,6,81,1,10,11,12,13]) : void 0, import.meta.url);
const SiteNotesExport = () => __vitePreload(() => import("./chunks/SiteNotesExport-v7vJQ7wx.js"), true ? __vite__mapDeps([83,4,2,5,6]) : void 0, import.meta.url);
const SiteNotesIntegration = () => __vitePreload(() => import("./chunks/SiteNotesIntegration-Dd6KHOh4.js"), true ? __vite__mapDeps([84,2,10,11,1,12,13,14]) : void 0, import.meta.url);
const AddonsPage = () => __vitePreload(() => import("./chunks/AddonsPage-CiYjk7Ya.js"), true ? __vite__mapDeps([85,9,2,1,10,11,12,13,14,5,86]) : void 0, import.meta.url);
const routes = [
  {
    path: "/",
    name: "general",
    component: SettingsTabGeneral,
    meta: {
      title: __("General", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/engagement",
    name: "engagement",
    component: SettingsTabEngagement,
    meta: {
      title: __("Engagement", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/ecommerce",
    name: "ecommerce",
    component: SettingsTabEcommerce,
    meta: {
      title: __("eCommerce", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/publisher",
    name: "publisher",
    component: SettingsTabPublisher,
    meta: {
      title: __("Publisher", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/conversions",
    name: "conversions",
    component: SettingsTabConversions,
    meta: {
      title: __("Conversions", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/advanced",
    name: "advanced",
    component: SettingsTabAdvanced,
    meta: {
      title: __("Advanced", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/setup-checklist",
    name: "setup-checklist",
    component: SettingsTabSetupChecklist,
    meta: {
      title: __("Setup Checklist", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/google-ads",
    name: "google-ads",
    component: SettingsGoogleAds,
    meta: {
      title: __("Google Ads", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/popular-posts",
    component: PopularPostsShell,
    meta: {
      title: __("Popular Posts", "google-analytics-for-wordpress")
    },
    children: [
      { path: "", name: "popular-posts-inline", component: PopularPostsInline },
      { path: "widget", name: "popular-posts-widget", component: PopularPostsWidget },
      { path: "products", name: "popular-posts-products", component: PopularPostsProducts },
      { path: "settings", name: "popular-posts-settings", component: PopularPostsSettings }
    ]
  },
  {
    path: "/about",
    component: AboutShell,
    meta: {
      title: __("About Us", "google-analytics-for-wordpress")
    },
    children: [
      {
        path: "",
        name: "about-us",
        component: AboutTabAboutUs,
        meta: { title: __("About Us", "google-analytics-for-wordpress") }
      },
      {
        path: "getting-started",
        name: "about-getting-started",
        component: AboutTabGettingStarted,
        meta: { title: __("Getting Started", "google-analytics-for-wordpress") }
      },
      {
        path: "lite-vs-pro",
        name: "about-lite-vs-pro",
        component: AboutTabLiteVsPro,
        meta: { title: __("Lite vs Pro", "google-analytics-for-wordpress") }
      }
    ]
  },
  {
    path: "/seo",
    name: "seo",
    component: SeoShell,
    meta: {
      title: __("SEO", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/wpconsent",
    name: "wpconsent",
    component: WpconsentShell,
    meta: {
      title: __("Privacy Compliance", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/userfeedback",
    name: "userfeedback",
    component: UserFeedbackShell,
    meta: {
      title: __("UserFeedback", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/rewardswp",
    name: "rewardswp",
    component: RewardsWpShell,
    meta: {
      title: __("RewardsWP", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/tools",
    component: ToolsLayout,
    children: [
      {
        name: "tools-url-builder",
        path: "",
        component: ToolsTabUrlBuilder,
        meta: { title: __("URL Builder", "google-analytics-for-wordpress") }
      },
      {
        name: "tools-import-export",
        path: "import-export",
        component: ToolsTabImportExport,
        meta: { title: __("Import Export", "google-analytics-for-wordpress") }
      },
      {
        name: "tools-report-export",
        path: "report-export",
        component: ToolsTabReportExport,
        meta: { title: __("Report Export", "google-analytics-for-wordpress") }
      },
      {
        name: "tools-prettylinks-flow",
        path: "prettylinks-flow",
        component: ToolsPrettyLinksFlow,
        meta: { title: __("PrettyLinks Integration", "google-analytics-for-wordpress") }
      },
      {
        name: "tools-verified-badge",
        path: "verified-badge",
        component: ToolsTabVerifiedBadge,
        meta: { title: __("Website Badge", "google-analytics-for-wordpress") }
      },
      {
        name: "tools-eea-compliance",
        path: "eea-compliance",
        component: ToolsTabEEACompliance,
        meta: { title: __("EEA Compliance", "google-analytics-for-wordpress") }
      }
    ]
  },
  {
    path: "/addons",
    name: "addons",
    component: AddonsPage,
    meta: {
      title: __("Addons", "google-analytics-for-wordpress")
    }
  },
  {
    path: "/site-notes",
    component: SiteNotesLayout,
    children: [
      {
        name: "site-notes",
        path: "",
        component: SiteNotesList,
        meta: { title: __("Site Notes", "google-analytics-for-wordpress") }
      },
      {
        name: "site-notes-category",
        path: "category",
        component: SiteNotesCategory,
        meta: { title: __("Site Notes' Categories", "google-analytics-for-wordpress") }
      },
      {
        name: "site-notes-export",
        path: "export",
        component: SiteNotesExport,
        meta: { title: __("Export Site Notes", "google-analytics-for-wordpress") }
      },
      {
        name: "site-notes-integration",
        path: "integration",
        component: SiteNotesIntegration,
        meta: { title: __("Site Notes Integration", "google-analytics-for-wordpress") }
      }
    ]
  },
  // Catch-all redirect - MUST be last
  {
    path: "/:pathMatch(.*)*",
    redirect: "/"
  }
];
const _hoisted_1$3 = {
  class: "monsterinsights-save-status__icon",
  "aria-hidden": "true"
};
const _hoisted_2$2 = {
  key: 0,
  class: "monsterinsights-save-status__spinner"
};
const _hoisted_3$2 = {
  key: 1,
  viewBox: "0 0 20 20"
};
const _hoisted_4$2 = {
  key: 2,
  viewBox: "0 0 20 20"
};
const _hoisted_5$2 = { class: "monsterinsights-save-status__label" };
const _sfc_main$4 = {
  __name: "SettingsSaveStatus",
  setup(__props) {
    const { __: __2 } = wp.i18n;
    const { status } = useSaveStatus();
    const label = computed(() => {
      switch (status.value) {
        case "saving":
          return __2("Saving…", "google-analytics-for-wordpress");
        case "saved":
          return __2("All changes saved", "google-analytics-for-wordpress");
        case "error":
          return __2("Couldn’t save changes", "google-analytics-for-wordpress");
        default:
          return "";
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(Teleport, { to: "body" }, [
        createVNode(Transition, { name: "monsterinsights-save-status" }, {
          default: withCtx(() => [
            unref(status) !== "idle" ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(["monsterinsights-save-status", `monsterinsights-save-status--${unref(status)}`]),
              role: "status",
              "aria-live": "polite"
            }, [
              createBaseVNode("span", _hoisted_1$3, [
                unref(status) === "saving" ? (openBlock(), createElementBlock("span", _hoisted_2$2)) : unref(status) === "saved" ? (openBlock(), createElementBlock("svg", _hoisted_3$2, [..._cache[0] || (_cache[0] = [
                  createBaseVNode("path", { d: "M8 13.2 4.8 10l-1.2 1.2L8 15.6 17 6.6 15.8 5.4z" }, null, -1)
                ])])) : (openBlock(), createElementBlock("svg", _hoisted_4$2, [..._cache[1] || (_cache[1] = [
                  createBaseVNode("path", { d: "M1 18 10 2l9 16Zm10-3H9v2h2Zm0-6H9v4h2Z" }, null, -1)
                ])]))
              ]),
              createBaseVNode("span", _hoisted_5$2, toDisplayString(label.value), 1)
            ], 2)) : createCommentVNode("", true)
          ]),
          _: 1
        })
      ]);
    };
  }
};
const SettingsSaveStatus = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-ef4a5e50"]]);
const _hoisted_1$2 = {
  key: 0,
  class: "monsterinsights-first-time-notice monsterinsights-container"
};
const _hoisted_2$1 = { class: "monsterinsights-notice monsterinsights-notice-success" };
const _hoisted_3$1 = { class: "monsterinsights-notice-inner" };
const _hoisted_4$1 = ["innerHTML"];
const _hoisted_5$1 = { class: "notice-content__first-time-notice" };
const _hoisted_6$1 = ["innerHTML"];
const _hoisted_7$2 = ["textContent"];
const _hoisted_8$2 = {
  key: 1,
  class: "monsterinsights-notice-button"
};
const _hoisted_9$1 = ["href", "textContent"];
const _sfc_main$3 = {
  __name: "SettingsFirstTimeNotice",
  setup(__props) {
    const { __: __2, sprintf } = wp.i18n;
    const route = useRoute();
    const { isAuthed } = useAuth();
    const { loadingToast, closeToast } = useToast();
    const firstRunNotice = ref(getMiGlobal("first_run_notice", false));
    const reports_url = getMiGlobal("reports_url", "#");
    const notice_button = __2("View Reports", "google-analytics-for-wordpress");
    const text_notice_title = __2("Welcome to MonsterInsights", "google-analytics-for-wordpress");
    const text_notice_title_auth = __2("Congratulations!", "google-analytics-for-wordpress");
    const notice_content_noauth = sprintf(
      __2("MonsterInsights makes it easy to connect your website with Google Analytics and see all important website stats right inside your WordPress dashboard. In order to setup website analytics, please take a look at our %1$sGetting started video%2$s", "google-analytics-for-wordpress"),
      '<a href="https://www.youtube.com/watch?v=4Y8TGGkdcGY" target="_blank" id="monsterinsights-view-video">',
      "</a>"
    );
    const user_setup_wizard_text = __2("use our setup wizard", "google-analytics-for-wordpress");
    const or_text = __2("or", "google-analytics-for-wordpress");
    const text_onboarding_note = sprintf(
      __2("Note: You will be transfered to %1$s.com to complete the setup wizard.", "google-analytics-for-wordpress"),
      "MonsterInsights"
    );
    const noticeTitle = computed(() => {
      return isAuthed.value ? text_notice_title_auth : text_notice_title;
    });
    const showNotice = computed(() => {
      const allowed_routes = ["general", "engagement", "ecommerce", "publisher", "conversions", "advanced"];
      if (!allowed_routes.includes(route.name)) return false;
      if (!isAuthed.value) return true;
      return !firstRunNotice.value;
    });
    function removeNotice() {
      firstRunNotice.value = true;
      wp.ajax.post("monsterinsights_vue_dismiss_first_time_notice", {
        nonce: getMiGlobal("nonce")
      });
    }
    function launchSetupWizard() {
      const preGeneratedUrl = getMiGlobal("wizard_url");
      if (preGeneratedUrl && preGeneratedUrl !== "#") {
        window.location.href = preGeneratedUrl;
        return;
      }
      loadingToast(__2("Preparing setup wizard...", "google-analytics-for-wordpress"));
      wp.ajax.post("monsterinsights_generate_setup_wizard_url", {
        nonce: getMiGlobal("nonce")
      }).done((response) => {
        if (response && response.wizard_url) {
          window.location.href = response.wizard_url;
        }
      }).fail((error) => {
        console.error("Error launching wizard:", error);
        closeToast();
      });
    }
    return (_ctx, _cache) => {
      return showNotice.value ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
        createBaseVNode("div", _hoisted_2$1, [
          createBaseVNode("div", _hoisted_3$1, [
            unref(isAuthed) ? (openBlock(), createElementBlock("button", {
              key: 0,
              class: "dismiss-notice",
              onClick: _cache[0] || (_cache[0] = ($event) => removeNotice())
            }, [..._cache[3] || (_cache[3] = [
              createBaseVNode("i", { class: "monstericon-times" }, null, -1)
            ])])) : createCommentVNode("", true),
            createBaseVNode("h2", {
              class: "notice-title",
              innerHTML: noticeTitle.value
            }, null, 8, _hoisted_4$1),
            createBaseVNode("div", _hoisted_5$1, [
              createBaseVNode("span", { innerHTML: unref(notice_content_noauth) }, null, 8, _hoisted_6$1),
              createTextVNode(" " + toDisplayString(unref(or_text)) + " ", 1),
              createBaseVNode("a", {
                href: "#",
                onClick: _cache[1] || (_cache[1] = withModifiers(($event) => launchSetupWizard(), ["prevent"]))
              }, toDisplayString(unref(user_setup_wizard_text)), 1),
              createBaseVNode("p", {
                textContent: toDisplayString(unref(text_onboarding_note))
              }, null, 8, _hoisted_7$2)
            ]),
            unref(isAuthed) ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
              createBaseVNode("a", {
                class: "monsterinsights-button",
                href: unref(reports_url),
                onClick: _cache[2] || (_cache[2] = ($event) => removeNotice()),
                textContent: toDisplayString(unref(notice_button))
              }, null, 8, _hoisted_9$1)
            ])) : createCommentVNode("", true)
          ])
        ])
      ])) : createCommentVNode("", true);
    };
  }
};
const _hoisted_1$1 = { class: "monsterinsights-tools-navbar" };
const _sfc_main$2 = {
  __name: "ToolsNavigation",
  setup(__props) {
    const { __: __2 } = wp.i18n;
    const text_import = __2("Import Export", "google-analytics-for-wordpress");
    const text_url_builder = __2("URL Builder", "google-analytics-for-wordpress");
    const text_report_export = __2("Report Export", "google-analytics-for-wordpress");
    const text_verified_badge = __2("Website Badge", "google-analytics-for-wordpress");
    const text_eea_compliance = __2("EEA Compliance Check", "google-analytics-for-wordpress");
    return (_ctx, _cache) => {
      const _component_RouterLink = resolveComponent("RouterLink");
      return openBlock(), createElementBlock("div", _hoisted_1$1, [
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/tools",
          textContent: toDisplayString(unref(text_url_builder))
        }, null, 8, ["textContent"]),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/tools/import-export",
          textContent: toDisplayString(unref(text_import))
        }, null, 8, ["textContent"]),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/tools/report-export",
          textContent: toDisplayString(unref(text_report_export))
        }, null, 8, ["textContent"]),
        (openBlock(), createBlock(_component_RouterLink, {
          key: 0,
          class: "monsterinsights-navigation-tab-link",
          to: "/tools/verified-badge",
          textContent: toDisplayString(unref(text_verified_badge))
        }, null, 8, ["textContent"])),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/tools/eea-compliance",
          textContent: toDisplayString(unref(text_eea_compliance))
        }, null, 8, ["textContent"])
      ]);
    };
  }
};
const _hoisted_1 = { class: "monsterinsights-sitenotes-navbar" };
const _hoisted_2 = ["textContent"];
const _hoisted_3 = ["textContent"];
const _hoisted_4 = ["textContent"];
const _hoisted_5 = ["textContent"];
const _hoisted_6 = ["textContent"];
const _hoisted_7$1 = ["textContent"];
const _hoisted_8$1 = ["textContent"];
const _sfc_main$1 = {
  __name: "SiteNotesNavigation",
  setup(__props) {
    const { __: __2 } = wp.i18n;
    const pro = isPro();
    const text_site_notes = __2("Site Notes", "google-analytics-for-wordpress");
    const text_categories = __2("Categories", "google-analytics-for-wordpress");
    const text_export = __2("Export", "google-analytics-for-wordpress");
    const text_integration = __2("Integration", "google-analytics-for-wordpress");
    const text_integrations = __2("Integrations", "google-analytics-for-wordpress");
    const text_pro = __2("PRO", "google-analytics-for-wordpress");
    return (_ctx, _cache) => {
      const _component_RouterLink = resolveComponent("RouterLink");
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/site-notes"
        }, {
          default: withCtx(() => [
            createBaseVNode("span", {
              textContent: toDisplayString(unref(text_site_notes))
            }, null, 8, _hoisted_2)
          ]),
          _: 1
        }),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/site-notes/category"
        }, {
          default: withCtx(() => [
            createBaseVNode("span", {
              textContent: toDisplayString(unref(text_categories))
            }, null, 8, _hoisted_3),
            !unref(pro) ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "monsterinsights-pro-pill",
              textContent: toDisplayString(unref(text_pro))
            }, null, 8, _hoisted_4)) : createCommentVNode("", true)
          ]),
          _: 1
        }),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/site-notes/export"
        }, {
          default: withCtx(() => [
            createBaseVNode("span", {
              textContent: toDisplayString(unref(text_export))
            }, null, 8, _hoisted_5),
            !unref(pro) ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "monsterinsights-pro-pill",
              textContent: toDisplayString(unref(text_pro))
            }, null, 8, _hoisted_6)) : createCommentVNode("", true)
          ]),
          _: 1
        }),
        createVNode(_component_RouterLink, {
          class: "monsterinsights-navigation-tab-link",
          to: "/site-notes/integration"
        }, {
          default: withCtx(() => [
            createBaseVNode("span", {
              textContent: toDisplayString(unref(pro) ? unref(text_integration) : unref(text_integrations))
            }, null, 8, _hoisted_7$1),
            !unref(pro) ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: "monsterinsights-pro-pill",
              textContent: toDisplayString(unref(text_pro))
            }, null, 8, _hoisted_8$1)) : createCommentVNode("", true)
          ]),
          _: 1
        })
      ]);
    };
  }
};
const _hoisted_7 = {
  key: 1,
  class: "monsterinsights-navigation-bar"
};
const _hoisted_8 = { class: "monsterinsights-container" };
const _hoisted_9 = {
  key: 2,
  class: "monsterinsights-navigation-bar"
};
const _hoisted_10 = { class: "monsterinsights-container" };
const _hoisted_11 = {
  key: 3,
  class: "monsterinsights-navigation-bar"
};
const _hoisted_12 = { class: "monsterinsights-container" };
const _hoisted_13 = { class: "monsterinsights-navigation-bar" };
const _hoisted_14 = { class: "monsterinsights-container" };
const _hoisted_15 = { class: "monsterinsights-main-navigation" };
const _sfc_main = {
  __name: "App",
  setup(__props) {
    const route = useRoute();
    const settingsStore = useSettingsStore();
    useLicenseStore();
    const addonsStore = useAddonsStore();
    const { updateAuth } = useAuth();
    const routeClass = computed(() => {
      return "monsterinsights-admin-page monsterinsights-settings-panel monsterinsights-path-" + route.name;
    });
    const isToolsRoute = computed(() => {
      return typeof route.name === "string" && route.name.startsWith("tools-");
    });
    const isSiteNotesRoute = computed(() => {
      return typeof route.name === "string" && route.name.startsWith("site-notes");
    });
    const isAddonsRoute = computed(() => route.name === "addons");
    const showAppHeader = computed(() => {
      const hidden = ["google-ads", "seo", "wpconsent", "userfeedback"];
      return !hidden.includes(route.name);
    });
    const showNavigation = computed(() => {
      const hidden = ["google-ads", "seo", "wpconsent", "userfeedback"];
      if (isToolsRoute.value || isSiteNotesRoute.value || isAddonsRoute.value) return false;
      return !hidden.includes(route.name);
    });
    const showToolsNavigation = computed(() => {
      if (route.name === "tools-prettylinks-flow") return false;
      return isToolsRoute.value;
    });
    const showSiteNotesNavigation = computed(() => isSiteNotesRoute.value);
    const SUBMENU_MAP = [
      { match: "setup-checklist", selector: '.wp-submenu [href*="monsterinsights_settings#/setup-checklist"]' },
      { match: "google-ads", selector: '.wp-submenu [href*="monsterinsights_settings#/google-ads"]' },
      { match: "site-notes", selector: '.wp-submenu [href*="monsterinsights_settings#/site-notes"]' },
      { match: "tools-", selector: '.wp-submenu [href*="monsterinsights_settings#/tools"]' },
      { match: "addons", selector: '.wp-submenu [href*="monsterinsights_settings#/addons"]' },
      { match: "about", selector: '.wp-submenu [href*="monsterinsights_settings#/about"]' },
      { match: "userfeedback", selector: '.wp-submenu [href*="monsterinsights_settings#/userfeedback"]' },
      { match: "wpconsent", selector: '.wp-submenu [href*="monsterinsights_settings#/wpconsent"]' }
    ];
    let cached_settings_link = null;
    let cached_submenu_links = [];
    function updateAdminMenuHighlight(name) {
      const matched = name ? SUBMENU_MAP.find(({ match }) => name.indexOf(match) >= 0) : null;
      const submenu_link = matched ? cached_submenu_links.find((x) => x.match === matched.match)?.el : null;
      cached_submenu_links.forEach(({ el }) => {
        if (el) el.parentElement.classList.remove("current");
      });
      if (cached_settings_link) cached_settings_link.parentElement.classList.remove("current");
      if (submenu_link) {
        submenu_link.parentElement.classList.add("current");
      } else if (cached_settings_link) {
        cached_settings_link.parentElement.classList.add("current");
      }
    }
    watch(() => route.name, (name) => updateAdminMenuHighlight(name));
    onMounted(async () => {
      const settings_links = document.querySelectorAll('[href="admin.php?page=monsterinsights_settings"]');
      cached_settings_link = settings_links[settings_links.length > 1 ? 1 : 0] || null;
      cached_submenu_links = SUBMENU_MAP.map(({ match, selector }) => ({
        match,
        el: document.querySelector(selector)
      }));
      updateAdminMenuHighlight(route.name);
      settings_links.forEach((link) => {
        if (!link.href.includes("#")) {
          link.href = link.href + "#/";
        }
      });
    });
    onMounted(async () => {
      await Promise.all([
        settingsStore.fetchSettings(),
        authApi.fetchAuth().then((data) => {
          if (data) updateAuth(data);
        }).catch(() => {
        }),
        addonsStore.fetchAddonsAction().catch(() => {
        }),
        Promise.resolve()
      ]);
    });
    return (_ctx, _cache) => {
      const _component_RouterView = resolveComponent("RouterView");
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["monsterinsights-app-surface", routeClass.value])
      }, [
        (openBlock(), createElementBlock(Fragment, { key: 1 }, [
          showAppHeader.value ? (openBlock(), createBlock(_sfc_main$7, { key: 0 }, {
            "header-right": withCtx(() => [
              createVNode(_sfc_main$5),
              !isToolsRoute.value && !isSiteNotesRoute.value && !isAddonsRoute.value ? (openBlock(), createBlock(SettingsSaveStatus, { key: 0 })) : createCommentVNode("", true),
              !isToolsRoute.value && !isSiteNotesRoute.value && !isAddonsRoute.value ? (openBlock(), createBlock(_sfc_main$6, { key: 1 })) : createCommentVNode("", true)
            ]),
            _: 1
          })) : createCommentVNode("", true),
          showNavigation.value ? (openBlock(), createElementBlock("div", _hoisted_7, [
            createBaseVNode("div", _hoisted_8, [
              createVNode(_sfc_main$8)
            ])
          ])) : createCommentVNode("", true),
          showToolsNavigation.value ? (openBlock(), createElementBlock("div", _hoisted_9, [
            createBaseVNode("div", _hoisted_10, [
              createVNode(_sfc_main$2)
            ])
          ])) : createCommentVNode("", true),
          showSiteNotesNavigation.value ? (openBlock(), createElementBlock("div", _hoisted_11, [
            createBaseVNode("div", _hoisted_12, [
              createVNode(_sfc_main$1)
            ])
          ])) : createCommentVNode("", true),
          isAddonsRoute.value ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
            createBaseVNode("div", _hoisted_13, [
              createBaseVNode("div", _hoisted_14, [
                createBaseVNode("nav", _hoisted_15, [
                  createVNode(_sfc_main$9)
                ])
              ])
            ]),
            createVNode(_sfc_main$a)
          ], 64)) : createCommentVNode("", true)
        ], 64)),
        createVNode(_sfc_main$b),
        !["seo", "wpconsent", "userfeedback"].includes(unref(route).name) && true && !isToolsRoute.value && !isSiteNotesRoute.value && !isAddonsRoute.value ? (openBlock(), createBlock(_sfc_main$3, { key: 2 })) : createCommentVNode("", true),
        createVNode(_component_RouterView),
        createVNode(_sfc_main$c)
      ], 2);
    };
  }
};
const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior() {
    return { top: 0, left: 0 };
  }
});
const app = createApp(_sfc_main);
app.use(router);
installOverlays(app);
setupPinia(app);
app.directive("tooltip", vTooltip);
const mountEl = document.getElementById("monsterinsights-vue-site-settings");
if (mountEl) {
  app.mount(mountEl);
}
