UNPKG

@dotcms/analytics

Version:

Official JavaScript library for Content Analytics with DotCMS.

22 lines (21 loc) 776 B
import { UVE_MODE as t } from "../../../../types/src/lib/editor/public.js"; import "../../internal/constants.js"; function p() { if (typeof window > "u" || window.parent === window || !window.location) return; const e = new URL(window.location.href), o = Object.values(t); let a = e.searchParams.get("mode") ?? t.EDIT; const s = e.searchParams.get("language_id"), n = e.searchParams.get("personaId"), r = e.searchParams.get("variantName"), i = e.searchParams.get("experimentId"), c = e.searchParams.get("publishDate"), d = e.searchParams.get("dotCMSHost"); return o.includes(a) || (a = t.EDIT), { mode: a, languageId: s, persona: n, variantName: r, experimentId: i, publishDate: c, dotCMSHost: d }; } export { p as getUVEState };