@oneclick.dev/cms-core-modules 0.0.78 → 0.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{AppointmentDetailsCard-SMNXi117.mjs → AppointmentDetailsCard-Bu9VzIRx.mjs} +54 -55
  2. package/dist/AppointmentDetailsCard-LL-6PARb.js +1 -0
  3. package/dist/{AppointmentListTable-vMSMt0M5.mjs → AppointmentListTable-B8YLwOfT.mjs} +41 -42
  4. package/dist/AppointmentListTable-DNvvb4sz.js +1 -0
  5. package/dist/CountryBreakdownCard-BpDXbxwZ.js +1 -0
  6. package/dist/{CountryBreakdownCard-B_VhBsm8.mjs → CountryBreakdownCard-oDzmpvAd.mjs} +45 -46
  7. package/dist/DeviceBreakdownCard-OXiU9Cf0.js +1 -0
  8. package/dist/DeviceBreakdownCard-Oh_yzipG.mjs +159 -0
  9. package/dist/{PeakHoursCard-_1JS0tpZ.mjs → PeakHoursCard-DzNo4SNo.mjs} +56 -57
  10. package/dist/PeakHoursCard-OkgI1vnd.js +1 -0
  11. package/dist/ProductDetailsCard-BBOorNmB.js +1 -0
  12. package/dist/{ProductDetailsCard-C5gqBJag.mjs → ProductDetailsCard-CYK9Mtt4.mjs} +44 -45
  13. package/dist/RealtimeCard-DESm9Fs_.js +1 -0
  14. package/dist/{RealtimeCard-CtX6Yyk-.mjs → RealtimeCard-tNUSIw6B.mjs} +44 -45
  15. package/dist/{SearchTermsCard-DzSu9jzo.mjs → SearchTermsCard-BVHFHWUZ.mjs} +66 -67
  16. package/dist/SearchTermsCard-DmyhGQVM.js +1 -0
  17. package/dist/{TopPagesCard-D7lH_QYV.mjs → TopPagesCard-CRIa3rSZ.mjs} +52 -53
  18. package/dist/TopPagesCard-CgtNyhwY.js +1 -0
  19. package/dist/TrafficSourcesCard-CPAxaQTi.js +1 -0
  20. package/dist/{TrafficSourcesCard-Fng3fVh7.mjs → TrafficSourcesCard-Ct20QYax.mjs} +48 -49
  21. package/dist/VisitorStatsCard-Cs6jPehw.js +1 -0
  22. package/dist/{VisitorStatsCard-CuXXnMBc.mjs → VisitorStatsCard-DMULybKV.mjs} +57 -58
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.mjs +11 -11
  25. package/package.json +2 -2
  26. package/dist/AppointmentDetailsCard-BfBwWxTU.js +0 -1
  27. package/dist/AppointmentListTable-Dk-CnNR6.js +0 -1
  28. package/dist/CountryBreakdownCard-Ghg0Wz-h.js +0 -1
  29. package/dist/DeviceBreakdownCard-CQR65Zr_.mjs +0 -160
  30. package/dist/DeviceBreakdownCard-Cpcj75Rv.js +0 -1
  31. package/dist/PeakHoursCard-CFIg8dys.js +0 -1
  32. package/dist/ProductDetailsCard-Ce11f_9r.js +0 -1
  33. package/dist/RealtimeCard-CatAzdxv.js +0 -1
  34. package/dist/SearchTermsCard-BPAdRL-r.js +0 -1
  35. package/dist/TopPagesCard-BA9Are_Z.js +0 -1
  36. package/dist/TrafficSourcesCard-DV13ZOBq.js +0 -1
  37. package/dist/VisitorStatsCard-CAzAZtKD.js +0 -1
@@ -1,22 +1,21 @@
1
- import { defineComponent as R, computed as j, ref as m, onMounted as C, resolveComponent as S, openBlock as o, createElementBlock as i, unref as a, createVNode as n, createElementVNode as e, toDisplayString as r, Fragment as P, renderList as V, createCommentVNode as _, withCtx as D, createTextVNode as E } from "vue";
1
+ import { defineComponent as j, computed as C, ref as m, onMounted as S, resolveComponent as $, openBlock as o, createElementBlock as n, unref as a, createVNode as i, createElementVNode as e, toDisplayString as r, Fragment as P, renderList as V, createCommentVNode as _, withCtx as D, createTextVNode as E } from "vue";
2
2
  import { Loader2 as F, Radio as I, Users as h, ExternalLink as M } from "lucide-vue-next";
3
- import { useRoute as T, useModuleApi as $ } from "@oneclick.dev/cms-kit";
4
- const B = { class: "w-full" }, O = {
3
+ const T = { class: "w-full" }, B = {
5
4
  key: 0,
6
5
  class: "flex items-center gap-2 py-3"
7
- }, q = {
6
+ }, O = {
8
7
  key: 1,
9
8
  class: "text-xs text-destructive py-2"
10
- }, G = {
9
+ }, q = {
11
10
  key: 2,
12
11
  class: "rounded-xl border bg-background overflow-hidden"
13
- }, H = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, J = { class: "flex items-center gap-2" }, K = { class: "px-3 py-4 text-center" }, Q = { class: "flex items-center justify-center gap-2 mb-1" }, W = { class: "text-3xl font-bold" }, X = { class: "text-xs text-muted-foreground" }, Y = {
12
+ }, G = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, H = { class: "flex items-center gap-2" }, J = { class: "px-3 py-4 text-center" }, K = { class: "flex items-center justify-center gap-2 mb-1" }, Q = { class: "text-3xl font-bold" }, W = { class: "text-xs text-muted-foreground" }, X = {
14
13
  key: 0,
15
14
  class: "border-t"
16
- }, Z = { class: "divide-y" }, ee = ["title"], te = { class: "flex items-center gap-1 text-[10px] text-muted-foreground shrink-0 ml-2" }, se = { class: "font-medium" }, ae = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, oe = {
15
+ }, Y = { class: "divide-y" }, Z = ["title"], ee = { class: "flex items-center gap-1 text-[10px] text-muted-foreground shrink-0 ml-2" }, te = { class: "font-medium" }, se = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, ae = {
17
16
  key: 0,
18
17
  class: "text-[10px] text-muted-foreground"
19
- }, le = /* @__PURE__ */ R({
18
+ }, re = /* @__PURE__ */ j({
20
19
  __name: "RealtimeCard",
21
20
  props: {
22
21
  toolName: {},
@@ -28,19 +27,19 @@ const B = { class: "w-full" }, O = {
28
27
  },
29
28
  emits: ["submit"],
30
29
  setup(v, { emit: y }) {
31
- const l = v, b = y, w = T(), k = j(() => w.params.slug), N = $(l.instanceId), p = m(!0), d = m(null), c = m(0), u = m([]), f = m(null);
30
+ const { $useRoute: b, $useModuleOverlay: oe } = useNuxtApp(), l = v, w = y, k = b(), N = C(() => k.params.slug), A = $useModuleApi(l.instanceId), p = m(!0), d = m(null), c = m(0), u = m([]), x = m(null);
32
31
  function U() {
33
32
  const s = l.resolvedArgs?._cachedData;
34
33
  return s ? (c.value = s.activeUsersRightNow || 0, u.value = (s.topActivePages || []).map((t) => ({
35
34
  page: t.page,
36
35
  activeUsers: t.activeUsers
37
- })), f.value = l.resolvedArgs._fetchedAt || null, p.value = !1, !0) : !1;
36
+ })), x.value = l.resolvedArgs._fetchedAt || null, p.value = !1, !0) : !1;
38
37
  }
39
- async function A() {
38
+ async function z() {
40
39
  p.value = !0, d.value = null;
41
40
  try {
42
- const s = await N.get("/realtime");
43
- c.value = s.activeUsers || 0, u.value = s.activePages || [], f.value = (/* @__PURE__ */ new Date()).toISOString(), g({
41
+ const s = await A.get("/realtime");
42
+ c.value = s.activeUsers || 0, u.value = s.activePages || [], x.value = (/* @__PURE__ */ new Date()).toISOString(), g({
44
43
  activeUsersRightNow: c.value,
45
44
  topActivePages: u.value.map((t) => ({
46
45
  page: t.page,
@@ -53,23 +52,23 @@ const B = { class: "w-full" }, O = {
53
52
  p.value = !1;
54
53
  }
55
54
  }
56
- C(() => {
57
- l.status === "completed" && U() || A();
55
+ S(() => {
56
+ l.status === "completed" && U() || z();
58
57
  });
59
58
  function g(s) {
60
- l.status !== "completed" && b("submit", s);
59
+ l.status !== "completed" && w("submit", s);
61
60
  }
62
- const z = (s) => s ? new Date(s).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "";
61
+ const L = (s) => s ? new Date(s).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "";
63
62
  return (s, t) => {
64
- const L = S("NuxtLink");
65
- return o(), i("div", B, [
66
- a(p) ? (o(), i("div", O, [
67
- n(a(F), { class: "size-4 animate-spin text-muted-foreground" }),
63
+ const R = $("NuxtLink");
64
+ return o(), n("div", T, [
65
+ a(p) ? (o(), n("div", B, [
66
+ i(a(F), { class: "size-4 animate-spin text-muted-foreground" }),
68
67
  t[0] || (t[0] = e("span", { class: "text-xs text-muted-foreground" }, "Loading realtime data…", -1))
69
- ])) : a(d) ? (o(), i("div", q, r(a(d)), 1)) : (o(), i("div", G, [
70
- e("div", H, [
71
- e("div", J, [
72
- n(a(I), { class: "size-3.5 text-emerald-500" }),
68
+ ])) : a(d) ? (o(), n("div", O, r(a(d)), 1)) : (o(), n("div", q, [
69
+ e("div", G, [
70
+ e("div", H, [
71
+ i(a(I), { class: "size-3.5 text-emerald-500" }),
73
72
  t[1] || (t[1] = e("span", { class: "text-xs font-medium" }, "Realtime", -1))
74
73
  ]),
75
74
  t[2] || (t[2] = e("span", { class: "relative flex size-2" }, [
@@ -77,41 +76,41 @@ const B = { class: "w-full" }, O = {
77
76
  e("span", { class: "relative inline-flex rounded-full size-2 bg-emerald-500" })
78
77
  ], -1))
79
78
  ]),
80
- e("div", K, [
81
- e("div", Q, [
82
- n(a(h), { class: "size-5 text-primary" }),
83
- e("span", W, r(a(c)), 1)
79
+ e("div", J, [
80
+ e("div", K, [
81
+ i(a(h), { class: "size-5 text-primary" }),
82
+ e("span", Q, r(a(c)), 1)
84
83
  ]),
85
- e("p", X, "active " + r(a(c) === 1 ? "user" : "users") + " right now", 1)
84
+ e("p", W, "active " + r(a(c) === 1 ? "user" : "users") + " right now", 1)
86
85
  ]),
87
- a(u).length > 0 ? (o(), i("div", Y, [
86
+ a(u).length > 0 ? (o(), n("div", X, [
88
87
  t[3] || (t[3] = e("div", { class: "px-3 py-1.5 bg-muted/20" }, [
89
88
  e("span", { class: "text-[10px] font-medium text-muted-foreground uppercase tracking-wide" }, "Active Pages")
90
89
  ], -1)),
91
- e("div", Z, [
92
- (o(!0), i(P, null, V(a(u), (x) => (o(), i("div", {
93
- key: x.page,
90
+ e("div", Y, [
91
+ (o(!0), n(P, null, V(a(u), (f) => (o(), n("div", {
92
+ key: f.page,
94
93
  class: "px-3 py-2 flex items-center justify-between hover:bg-muted/30 transition-colors"
95
94
  }, [
96
95
  e("span", {
97
96
  class: "text-xs truncate flex-1",
98
- title: x.page
99
- }, r(x.page), 9, ee),
100
- e("div", te, [
101
- n(a(h), { class: "size-2.5" }),
102
- e("span", se, r(x.activeUsers), 1)
97
+ title: f.page
98
+ }, r(f.page), 9, Z),
99
+ e("div", ee, [
100
+ i(a(h), { class: "size-2.5" }),
101
+ e("span", te, r(f.activeUsers), 1)
103
102
  ])
104
103
  ]))), 128))
105
104
  ])
106
105
  ])) : _("", !0),
107
- e("div", ae, [
108
- a(f) ? (o(), i("span", oe, " Fetched " + r(z(a(f))), 1)) : _("", !0),
109
- n(L, {
110
- to: `/projects/${a(k)}/modules/${v.instanceId}`,
106
+ e("div", se, [
107
+ a(x) ? (o(), n("span", ae, " Fetched " + r(L(a(x))), 1)) : _("", !0),
108
+ i(R, {
109
+ to: `/projects/${a(N)}/modules/${v.instanceId}`,
111
110
  class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
112
111
  }, {
113
112
  default: D(() => [
114
- n(a(M), { class: "size-3" }),
113
+ i(a(M), { class: "size-3" }),
115
114
  t[4] || (t[4] = E(" View full report ", -1))
116
115
  ]),
117
116
  _: 1
@@ -123,5 +122,5 @@ const B = { class: "w-full" }, O = {
123
122
  }
124
123
  });
125
124
  export {
126
- le as default
125
+ re as default
127
126
  };
@@ -1,25 +1,24 @@
1
- import { defineComponent as O, computed as _, ref as f, onMounted as H, resolveComponent as J, openBlock as u, createElementBlock as m, unref as s, createVNode as l, createElementVNode as o, toDisplayString as i, Fragment as C, renderList as W, normalizeStyle as X, createTextVNode as g, createCommentVNode as Y, withCtx as Z } from "vue";
2
- import { Loader2 as ee, Search as z, MousePointerClick as A, Eye as se, TrendingUp as N, Hash as te, Users as oe, ExternalLink as ne } from "lucide-vue-next";
3
- import { useRoute as ae, useModuleApi as re } from "@oneclick.dev/cms-kit";
4
- const ie = { class: "w-full" }, le = {
1
+ import { defineComponent as H, computed as _, ref as h, onMounted as J, resolveComponent as W, openBlock as u, createElementBlock as m, unref as s, createVNode as l, createElementVNode as o, toDisplayString as i, Fragment as A, renderList as X, normalizeStyle as Y, createTextVNode as g, createCommentVNode as Z, withCtx as ee } from "vue";
2
+ import { Loader2 as se, Search as C, MousePointerClick as z, Eye as te, TrendingUp as N, Hash as oe, Users as ne, ExternalLink as ae } from "lucide-vue-next";
3
+ const re = { class: "w-full" }, ie = {
5
4
  key: 0,
6
5
  class: "flex items-center gap-2 py-3"
7
- }, ce = {
6
+ }, le = {
8
7
  key: 1,
9
8
  class: "text-xs text-destructive py-2"
10
- }, de = {
9
+ }, ce = {
11
10
  key: 2,
12
11
  class: "rounded-xl border bg-background p-4 text-center space-y-2"
13
- }, ue = {
12
+ }, de = {
14
13
  key: 3,
15
14
  class: "rounded-xl border bg-background overflow-hidden"
16
- }, me = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, ge = { class: "flex items-center gap-2" }, pe = { class: "text-xs font-medium" }, fe = { class: "text-[10px] text-muted-foreground" }, he = { class: "divide-y" }, xe = { class: "flex items-center gap-2 mb-1.5" }, _e = { class: "text-[10px] font-medium text-muted-foreground w-5 text-right shrink-0" }, ve = { class: "text-xs font-medium truncate flex-1" }, ye = { class: "ml-7 space-y-1.5" }, be = { class: "h-1.5 rounded-full bg-muted overflow-hidden" }, ke = {
15
+ }, ue = { class: "px-3 py-2 border-b bg-muted/40 flex items-center justify-between" }, me = { class: "flex items-center gap-2" }, ge = { class: "text-xs font-medium" }, pe = { class: "text-[10px] text-muted-foreground" }, he = { class: "divide-y" }, fe = { class: "flex items-center gap-2 mb-1.5" }, xe = { class: "text-[10px] font-medium text-muted-foreground w-5 text-right shrink-0" }, _e = { class: "text-xs font-medium truncate flex-1" }, ve = { class: "ml-7 space-y-1.5" }, ye = { class: "h-1.5 rounded-full bg-muted overflow-hidden" }, be = {
17
16
  key: 0,
18
17
  class: "flex items-center gap-3 text-[10px] text-muted-foreground"
19
- }, Se = { class: "flex items-center gap-1" }, Te = { class: "flex items-center gap-1" }, $e = { class: "flex items-center gap-1" }, we = { class: "flex items-center gap-1" }, Le = {
18
+ }, ke = { class: "flex items-center gap-1" }, Se = { class: "flex items-center gap-1" }, $e = { class: "flex items-center gap-1" }, Te = { class: "flex items-center gap-1" }, we = {
20
19
  key: 1,
21
20
  class: "flex items-center gap-3 text-[10px] text-muted-foreground"
22
- }, Ce = { class: "flex items-center gap-1" }, ze = { class: "flex items-center gap-1" }, Ae = { class: "flex items-center gap-1" }, Ne = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, De = { class: "text-[10px] text-muted-foreground" }, Re = /* @__PURE__ */ O({
21
+ }, Le = { class: "flex items-center gap-1" }, Ae = { class: "flex items-center gap-1" }, Ce = { class: "flex items-center gap-1" }, ze = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, Ne = { class: "text-[10px] text-muted-foreground" }, Pe = /* @__PURE__ */ H({
23
22
  __name: "SearchTermsCard",
24
23
  props: {
25
24
  toolName: {},
@@ -30,9 +29,9 @@ const ie = { class: "w-full" }, le = {
30
29
  status: {}
31
30
  },
32
31
  emits: ["submit"],
33
- setup(T, { emit: D }) {
34
- const p = T, F = D, P = ae(), M = _(() => P.params.slug), R = re(p.instanceId), v = f(!0), h = f(null), n = f([]), $ = f(0), y = f(null), x = f("google_ads"), U = (e) => e.label || e.query || e.sessionGoogleAdsQuery || e.landingPagePlusQueryString || "—";
35
- function j() {
32
+ setup($, { emit: D }) {
33
+ const { $useRoute: F, $useModuleOverlay: De } = useNuxtApp(), p = $, M = D, P = F(), R = _(() => P.params.slug), U = $useModuleApi(p.instanceId), v = h(!0), f = h(null), n = h([]), T = h(0), y = h(null), x = h("google_ads"), j = (e) => e.label || e.query || e.sessionGoogleAdsQuery || e.landingPagePlusQueryString || "—";
34
+ function E() {
36
35
  const e = p.resolvedArgs?._cachedData;
37
36
  return e ? (x.value = e.source || "google_ads", e.source === "search_console" ? n.value = (e.searchTerms || []).map((t) => ({
38
37
  label: t.term,
@@ -45,15 +44,15 @@ const ie = { class: "w-full" }, le = {
45
44
  sessions: t.sessions,
46
45
  totalUsers: t.users,
47
46
  engagementRate: parseFloat(t.engagementRate) / 100
48
- })), $.value = e.count || n.value.length, y.value = p.resolvedArgs._fetchedAt || null, v.value = !1, !0) : !1;
47
+ })), T.value = e.count || n.value.length, y.value = p.resolvedArgs._fetchedAt || null, v.value = !1, !0) : !1;
49
48
  }
50
- async function E() {
49
+ async function V() {
51
50
  const { startDate: e, endDate: t } = p.resolvedArgs || {};
52
- v.value = !0, h.value = null;
51
+ v.value = !0, f.value = null;
53
52
  try {
54
53
  const c = new URLSearchParams();
55
54
  e && c.set("startDate", e), t && c.set("endDate", t);
56
- const a = await R.get(`/content/search-terms?${c.toString()}`), d = a.source || "google_ads";
55
+ const a = await U.get(`/content/search-terms?${c.toString()}`), d = a.source || "google_ads";
57
56
  if (x.value = d, d === "search_console")
58
57
  n.value = (a.rows || []).map((r) => ({
59
58
  ...r,
@@ -66,8 +65,8 @@ const ie = { class: "w-full" }, le = {
66
65
  label: k[r]
67
66
  }));
68
67
  }
69
- $.value = a.rowCount || n.value.length, y.value = (/* @__PURE__ */ new Date()).toISOString();
70
- const K = () => {
68
+ T.value = a.rowCount || n.value.length, y.value = (/* @__PURE__ */ new Date()).toISOString();
69
+ const O = () => {
71
70
  if (n.value.length === 0) return "No search data found for this period.";
72
71
  const r = n.value.slice(0, 5).map((k) => k.label).join(", ");
73
72
  return d === "search_console" ? `Found ${n.value.length} search queries from Google Search Console. The top keywords are: ${r}.` : d === "organic_landing_pages" ? `Found ${n.value.length} pages receiving organic search traffic. The top organic landing pages are: ${r}.` : `Found ${n.value.length} search terms. The top keywords driving traffic are: ${r}.`;
@@ -87,86 +86,86 @@ const ie = { class: "w-full" }, le = {
87
86
  count: n.value.length,
88
87
  source: d,
89
88
  searchTerms: B,
90
- suggestion: K()
89
+ suggestion: O()
91
90
  });
92
91
  } catch (c) {
93
- h.value = c?.data?.statusMessage || c?.message || "Failed to load search data", w(`Error loading search data: ${h.value}`);
92
+ f.value = c?.data?.statusMessage || c?.message || "Failed to load search data", w(`Error loading search data: ${f.value}`);
94
93
  } finally {
95
94
  v.value = !1;
96
95
  }
97
96
  }
98
- H(() => {
99
- p.status === "completed" && j() || E();
97
+ J(() => {
98
+ p.status === "completed" && E() || V();
100
99
  });
101
100
  function w(e) {
102
- p.status !== "completed" && F("submit", e);
101
+ p.status !== "completed" && M("submit", e);
103
102
  }
104
- const b = (e) => e == null ? "0" : Math.round(e).toLocaleString(), L = (e) => e == null ? "0%" : `${(e * 100).toFixed(1)}%`, V = (e) => e == null ? "—" : e.toFixed(1), G = (e) => e ? new Date(e).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "", S = _(() => x.value === "search_console"), I = _(() => n.value.length === 0 ? 1 : S.value ? Math.max(...n.value.map((e) => e.clicks || 0)) : Math.max(...n.value.map((e) => e.sessions || 0))), Q = _(() => x.value === "search_console" ? "Search Keywords (Search Console)" : x.value === "organic_landing_pages" ? "Top Organic Landing Pages" : "Search Terms & Keywords"), q = _(() => {
103
+ const b = (e) => e == null ? "0" : Math.round(e).toLocaleString(), L = (e) => e == null ? "0%" : `${(e * 100).toFixed(1)}%`, G = (e) => e == null ? "—" : e.toFixed(1), I = (e) => e ? new Date(e).toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }) : "", S = _(() => x.value === "search_console"), Q = _(() => n.value.length === 0 ? 1 : S.value ? Math.max(...n.value.map((e) => e.clicks || 0)) : Math.max(...n.value.map((e) => e.sessions || 0))), q = _(() => x.value === "search_console" ? "Search Keywords (Search Console)" : x.value === "organic_landing_pages" ? "Top Organic Landing Pages" : "Search Terms & Keywords"), K = _(() => {
105
104
  const { startDate: e, endDate: t } = p.resolvedArgs || {};
106
105
  if (!e && !t) return "Last 30 days";
107
106
  const c = e || "30daysAgo", a = c.match(/^(\d+)daysAgo$/);
108
107
  return a ? `Last ${a[1]} days` : `${c} → ${t || "today"}`;
109
108
  });
110
109
  return (e, t) => {
111
- const c = J("NuxtLink");
112
- return u(), m("div", ie, [
113
- s(v) ? (u(), m("div", le, [
114
- l(s(ee), { class: "size-4 animate-spin text-muted-foreground" }),
110
+ const c = W("NuxtLink");
111
+ return u(), m("div", re, [
112
+ s(v) ? (u(), m("div", ie, [
113
+ l(s(se), { class: "size-4 animate-spin text-muted-foreground" }),
115
114
  t[0] || (t[0] = o("span", { class: "text-xs text-muted-foreground" }, "Loading search data…", -1))
116
- ])) : s(h) ? (u(), m("div", ce, i(s(h)), 1)) : s(n).length === 0 ? (u(), m("div", de, [
117
- l(s(z), { class: "size-8 text-muted-foreground mx-auto" }),
115
+ ])) : s(f) ? (u(), m("div", le, i(s(f)), 1)) : s(n).length === 0 ? (u(), m("div", ce, [
116
+ l(s(C), { class: "size-8 text-muted-foreground mx-auto" }),
118
117
  t[1] || (t[1] = o("p", { class: "text-sm text-muted-foreground" }, "No search data found for this period.", -1))
119
- ])) : (u(), m("div", ue, [
120
- o("div", me, [
121
- o("div", ge, [
122
- l(s(z), { class: "size-3.5 text-primary" }),
123
- o("span", pe, i(s(Q)), 1)
118
+ ])) : (u(), m("div", de, [
119
+ o("div", ue, [
120
+ o("div", me, [
121
+ l(s(C), { class: "size-3.5 text-primary" }),
122
+ o("span", ge, i(s(q)), 1)
124
123
  ]),
125
- o("span", fe, i(s(q)), 1)
124
+ o("span", pe, i(s(K)), 1)
126
125
  ]),
127
126
  o("div", he, [
128
- (u(!0), m(C, null, W(s(n), (a, d) => (u(), m("div", {
127
+ (u(!0), m(A, null, X(s(n), (a, d) => (u(), m("div", {
129
128
  key: d,
130
129
  class: "px-3 py-2.5 hover:bg-muted/30 transition-colors"
131
130
  }, [
132
- o("div", xe, [
133
- o("span", _e, i(d + 1) + ".", 1),
134
- o("span", ve, i(U(a)), 1)
131
+ o("div", fe, [
132
+ o("span", xe, i(d + 1) + ".", 1),
133
+ o("span", _e, i(j(a)), 1)
135
134
  ]),
136
- o("div", ye, [
137
- o("div", be, [
135
+ o("div", ve, [
136
+ o("div", ye, [
138
137
  o("div", {
139
138
  class: "h-full rounded-full bg-amber-500/70 transition-all",
140
- style: X({ width: `${((s(S) ? a.clicks : a.sessions) || 0) / s(I) * 100}%` })
139
+ style: Y({ width: `${((s(S) ? a.clicks : a.sessions) || 0) / s(Q) * 100}%` })
141
140
  }, null, 4)
142
141
  ]),
143
- s(S) ? (u(), m("div", ke, [
144
- o("span", Se, [
145
- l(s(A), { class: "size-2.5" }),
142
+ s(S) ? (u(), m("div", be, [
143
+ o("span", ke, [
144
+ l(s(z), { class: "size-2.5" }),
146
145
  g(" " + i(b(a.clicks)) + " clicks ", 1)
147
146
  ]),
148
- o("span", Te, [
149
- l(s(se), { class: "size-2.5" }),
147
+ o("span", Se, [
148
+ l(s(te), { class: "size-2.5" }),
150
149
  g(" " + i(b(a.impressions)) + " impr. ", 1)
151
150
  ]),
152
151
  o("span", $e, [
153
152
  l(s(N), { class: "size-2.5" }),
154
153
  g(" " + i(L(a.ctr)) + " CTR ", 1)
155
154
  ]),
156
- o("span", we, [
157
- l(s(te), { class: "size-2.5" }),
158
- g(" pos " + i(V(a.position)), 1)
155
+ o("span", Te, [
156
+ l(s(oe), { class: "size-2.5" }),
157
+ g(" pos " + i(G(a.position)), 1)
159
158
  ])
160
- ])) : (u(), m("div", Le, [
161
- o("span", Ce, [
162
- l(s(A), { class: "size-2.5" }),
159
+ ])) : (u(), m("div", we, [
160
+ o("span", Le, [
161
+ l(s(z), { class: "size-2.5" }),
163
162
  g(" " + i(b(a.sessions)) + " sessions ", 1)
164
163
  ]),
165
- o("span", ze, [
166
- l(s(oe), { class: "size-2.5" }),
164
+ o("span", Ae, [
165
+ l(s(ne), { class: "size-2.5" }),
167
166
  g(" " + i(b(a.totalUsers)) + " users ", 1)
168
167
  ]),
169
- o("span", Ae, [
168
+ o("span", Ce, [
170
169
  l(s(N), { class: "size-2.5" }),
171
170
  g(" " + i(L(a.engagementRate)) + " engaged ", 1)
172
171
  ])
@@ -174,19 +173,19 @@ const ie = { class: "w-full" }, le = {
174
173
  ])
175
174
  ]))), 128))
176
175
  ]),
177
- o("div", Ne, [
178
- o("span", De, [
176
+ o("div", ze, [
177
+ o("span", Ne, [
179
178
  g(i(s(n).length) + " result" + i(s(n).length === 1 ? "" : "s") + " ", 1),
180
- s(y) ? (u(), m(C, { key: 0 }, [
181
- g(" · fetched " + i(G(s(y))), 1)
182
- ], 64)) : Y("", !0)
179
+ s(y) ? (u(), m(A, { key: 0 }, [
180
+ g(" · fetched " + i(I(s(y))), 1)
181
+ ], 64)) : Z("", !0)
183
182
  ]),
184
183
  l(c, {
185
- to: `/projects/${s(M)}/modules/${T.instanceId}`,
184
+ to: `/projects/${s(R)}/modules/${$.instanceId}`,
186
185
  class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
187
186
  }, {
188
- default: Z(() => [
189
- l(s(ne), { class: "size-3" }),
187
+ default: ee(() => [
188
+ l(s(ae), { class: "size-3" }),
190
189
  t[2] || (t[2] = g(" View full report ", -1))
191
190
  ]),
192
191
  _: 1
@@ -198,5 +197,5 @@ const ie = { class: "w-full" }, le = {
198
197
  }
199
198
  });
200
199
  export {
201
- Re as default
200
+ Pe as default
202
201
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),M={class:"w-full"},P={key:0,class:"flex items-center gap-2 py-3"},R={key:1,class:"text-xs text-destructive py-2"},U={key:2,class:"rounded-xl border bg-background p-4 text-center space-y-2"},j={key:3,class:"rounded-xl border bg-background overflow-hidden"},q={class:"px-3 py-2 border-b bg-muted/40 flex items-center justify-between"},G={class:"flex items-center gap-2"},I={class:"text-xs font-medium"},O={class:"text-[10px] text-muted-foreground"},Q={class:"divide-y"},K={class:"flex items-center gap-2 mb-1.5"},H={class:"text-[10px] font-medium text-muted-foreground w-5 text-right shrink-0"},J={class:"text-xs font-medium truncate flex-1"},W={class:"ml-7 space-y-1.5"},X={class:"h-1.5 rounded-full bg-muted overflow-hidden"},Y={key:0,class:"flex items-center gap-3 text-[10px] text-muted-foreground"},Z={class:"flex items-center gap-1"},ee={class:"flex items-center gap-1"},te={class:"flex items-center gap-1"},se={class:"flex items-center gap-1"},oe={key:1,class:"flex items-center gap-3 text-[10px] text-muted-foreground"},ne={class:"flex items-center gap-1"},re={class:"flex items-center gap-1"},ae={class:"flex items-center gap-1"},ce={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},le={class:"text-[10px] text-muted-foreground"},ie=e.defineComponent({__name:"SearchTermsCard",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(x,{emit:N}){const{$useRoute:V,$useModuleOverlay:de}=useNuxtApp(),i=x,k=N,S=V(),b=e.computed(()=>S.params.slug),E=$useModuleApi(i.instanceId),m=e.ref(!0),d=e.ref(null),o=e.ref([]),_=e.ref(0),g=e.ref(null),u=e.ref("google_ads"),T=t=>t.label||t.query||t.sessionGoogleAdsQuery||t.landingPagePlusQueryString||"—";function D(){const t=i.resolvedArgs?._cachedData;return t?(u.value=t.source||"google_ads",t.source==="search_console"?o.value=(t.searchTerms||[]).map(s=>({label:s.term,clicks:s.clicks,impressions:s.impressions,ctr:s.ctr,position:s.position})):o.value=(t.searchTerms||[]).map(s=>({label:s.term,sessions:s.sessions,totalUsers:s.users,engagementRate:parseFloat(s.engagementRate)/100})),_.value=t.count||o.value.length,g.value=i.resolvedArgs._fetchedAt||null,m.value=!1,!0):!1}async function B(){const{startDate:t,endDate:s}=i.resolvedArgs||{};m.value=!0,d.value=null;try{const a=new URLSearchParams;t&&a.set("startDate",t),s&&a.set("endDate",s);const n=await E.get(`/content/search-terms?${a.toString()}`),l=n.source||"google_ads";if(u.value=l,l==="search_console")o.value=(n.rows||[]).map(r=>({...r,label:r.query}));else{const r=l==="organic_landing_pages"?"landingPagePlusQueryString":"sessionGoogleAdsQuery";o.value=(n.rows||[]).map(f=>({...f,label:f[r]}))}_.value=n.rowCount||o.value.length,g.value=new Date().toISOString();const z=()=>{if(o.value.length===0)return"No search data found for this period.";const r=o.value.slice(0,5).map(f=>f.label).join(", ");return l==="search_console"?`Found ${o.value.length} search queries from Google Search Console. The top keywords are: ${r}.`:l==="organic_landing_pages"?`Found ${o.value.length} pages receiving organic search traffic. The top organic landing pages are: ${r}.`:`Found ${o.value.length} search terms. The top keywords driving traffic are: ${r}.`},F=o.value.map(r=>l==="search_console"?{term:r.label,clicks:r.clicks,impressions:r.impressions,ctr:r.ctr,position:r.position}:{term:r.label,sessions:r.sessions,users:r.totalUsers,engagementRate:`${(r.engagementRate*100).toFixed(1)}%`});v({count:o.value.length,source:l,searchTerms:F,suggestion:z()})}catch(a){d.value=a?.data?.statusMessage||a?.message||"Failed to load search data",v(`Error loading search data: ${d.value}`)}finally{m.value=!1}}e.onMounted(()=>{i.status==="completed"&&D()||B()});function v(t){i.status!=="completed"&&k("submit",t)}const p=t=>t==null?"0":Math.round(t).toLocaleString(),y=t=>t==null?"0%":`${(t*100).toFixed(1)}%`,$=t=>t==null?"—":t.toFixed(1),w=t=>t?new Date(t).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",h=e.computed(()=>u.value==="search_console"),C=e.computed(()=>o.value.length===0?1:h.value?Math.max(...o.value.map(t=>t.clicks||0)):Math.max(...o.value.map(t=>t.sessions||0))),L=e.computed(()=>u.value==="search_console"?"Search Keywords (Search Console)":u.value==="organic_landing_pages"?"Top Organic Landing Pages":"Search Terms & Keywords"),A=e.computed(()=>{const{startDate:t,endDate:s}=i.resolvedArgs||{};if(!t&&!s)return"Last 30 days";const a=t||"30daysAgo",n=a.match(/^(\d+)daysAgo$/);return n?`Last ${n[1]} days`:`${a} → ${s||"today"}`});return(t,s)=>{const a=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",M,[e.unref(m)?(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),s[0]||(s[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading search data…",-1))])):e.unref(d)?(e.openBlock(),e.createElementBlock("div",R,e.toDisplayString(e.unref(d)),1)):e.unref(o).length===0?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(e.unref(c.Search),{class:"size-8 text-muted-foreground mx-auto"}),s[1]||(s[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No search data found for this period.",-1))])):(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",q,[e.createElementVNode("div",G,[e.createVNode(e.unref(c.Search),{class:"size-3.5 text-primary"}),e.createElementVNode("span",I,e.toDisplayString(e.unref(L)),1)]),e.createElementVNode("span",O,e.toDisplayString(e.unref(A)),1)]),e.createElementVNode("div",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(n,l)=>(e.openBlock(),e.createElementBlock("div",{key:l,class:"px-3 py-2.5 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",K,[e.createElementVNode("span",H,e.toDisplayString(l+1)+".",1),e.createElementVNode("span",J,e.toDisplayString(T(n)),1)]),e.createElementVNode("div",W,[e.createElementVNode("div",X,[e.createElementVNode("div",{class:"h-full rounded-full bg-amber-500/70 transition-all",style:e.normalizeStyle({width:`${((e.unref(h)?n.clicks:n.sessions)||0)/e.unref(C)*100}%`})},null,4)]),e.unref(h)?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("span",Z,[e.createVNode(e.unref(c.MousePointerClick),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(p(n.clicks))+" clicks ",1)]),e.createElementVNode("span",ee,[e.createVNode(e.unref(c.Eye),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(p(n.impressions))+" impr. ",1)]),e.createElementVNode("span",te,[e.createVNode(e.unref(c.TrendingUp),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(y(n.ctr))+" CTR ",1)]),e.createElementVNode("span",se,[e.createVNode(e.unref(c.Hash),{class:"size-2.5"}),e.createTextVNode(" pos "+e.toDisplayString($(n.position)),1)])])):(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("span",ne,[e.createVNode(e.unref(c.MousePointerClick),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(p(n.sessions))+" sessions ",1)]),e.createElementVNode("span",re,[e.createVNode(e.unref(c.Users),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(p(n.totalUsers))+" users ",1)]),e.createElementVNode("span",ae,[e.createVNode(e.unref(c.TrendingUp),{class:"size-2.5"}),e.createTextVNode(" "+e.toDisplayString(y(n.engagementRate))+" engaged ",1)])]))])]))),128))]),e.createElementVNode("div",ce,[e.createElementVNode("span",le,[e.createTextVNode(e.toDisplayString(e.unref(o).length)+" result"+e.toDisplayString(e.unref(o).length===1?"":"s")+" ",1),e.unref(g)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" · fetched "+e.toDisplayString(w(e.unref(g))),1)],64)):e.createCommentVNode("",!0)]),e.createVNode(a,{to:`/projects/${e.unref(b)}/modules/${x.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ExternalLink),{class:"size-3"}),s[2]||(s[2]=e.createTextVNode(" View full report ",-1))]),_:1},8,["to"])])]))])}}});exports.default=ie;