@oneclick.dev/cms-core-modules 0.0.83 → 0.0.85
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.
- package/dist/{ContentEditor-CxKirDdL.mjs → ContentEditor-C5ydvk8b.mjs} +7067 -5886
- package/dist/{ContentEditor-CRFkD4tE.js → ContentEditor-DiveHwSJ.js} +43 -43
- package/dist/{Create-CsqVYhPO.mjs → Create-6uT9HWar.mjs} +35 -35
- package/dist/{Create-ip0MnS0o.js → Create-DuZ5nZrX.js} +1 -1
- package/dist/{DateFormatter-CvOfaUnU.mjs → DateFormatter-2B0R-DY4.mjs} +204 -400
- package/dist/DateFormatter-DbtOLV0L.js +1 -0
- package/dist/{Detail-RMXFuSRQ.js → Detail-BZ-iE9vf.js} +1 -1
- package/dist/{Detail-B4b_FLDa.mjs → Detail-C1Blq61w.mjs} +90 -90
- package/dist/{Detail-BayNaAg9.js → Detail-C8wQiDcv.js} +1 -1
- package/dist/{Detail-CbLk1v37.mjs → Detail-CJVMJDP7.mjs} +17 -17
- package/dist/{Detail-CnK-qbhE.js → Detail-CPqug27l.js} +1 -1
- package/dist/Detail-CjuhjPby.js +1 -0
- package/dist/{Detail-U0mgLKt6.mjs → Detail-CtItxMX4.mjs} +62 -63
- package/dist/{Detail-CVgWHbMC.mjs → Detail-Dnpnmy4-.mjs} +158 -158
- package/dist/{Entries-D7MHylQE.mjs → Entries-BkOPae4R.mjs} +49 -49
- package/dist/Entries-CcEW98F5.js +1 -0
- package/dist/{Find-XPcJxeRH.mjs → Find-Bd1uLqSa.mjs} +55 -55
- package/dist/Find-D4Qa45qC.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CDc8MIq2.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-StaNp-3y.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js} +1 -1
- package/dist/{Overview-CwCAeBnX.js → Overview-CA8wh_BI.js} +1 -1
- package/dist/{Overview-CgViRnNc.mjs → Overview-D4MFwRI_.mjs} +67 -68
- package/dist/{Overview-B2bFNGhH.js → Overview-Da0XexiT.js} +1 -1
- package/dist/Overview-DeQQ0FY3.js +1 -0
- package/dist/{Overview--XpvBbqz.mjs → Overview-DoOASlNz.mjs} +1 -3
- package/dist/{Overview-Cczt_dcE.mjs → Overview-gJSvftdE.mjs} +34 -34
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs} +0 -1
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js} +1 -1
- package/dist/{SeoHealth-ZpvB7CS2.mjs → SeoHealth-Bc5chnaa.mjs} +14 -14
- package/dist/{SeoHealth-DFZ0LLBH.js → SeoHealth-BkpJ1F2Y.js} +1 -1
- package/dist/TableView-Ei_w_-bn.mjs +5745 -0
- package/dist/TableView-klOTPJKZ.js +4 -0
- package/dist/View-BaFlMcM6.js +1 -0
- package/dist/View-C4MBWRlA.mjs +28 -0
- package/dist/{agenda-Cl3s_FIE.mjs → agenda-C5grvzSa.mjs} +166 -169
- package/dist/agenda-DXMwVWpN.js +1 -0
- package/dist/{availability-B-tRp8hB.mjs → availability-C1NqOFsQ.mjs} +81 -81
- package/dist/{availability-BiBbzEIM.js → availability-D_wnfLsH.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-DQPSFSj7.mjs → exceptions-BIwMhYa4.mjs} +1 -1
- package/dist/{exceptions-BA3PsW4n.js → exceptions-Cn7zooEu.js} +1 -1
- package/dist/{index-CBC9dWZ9.js → index-C9pSS15N.js} +2 -2
- package/dist/{index-YOOlBEZB.mjs → index-MwjeLHPP.mjs} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +23 -23
- package/dist/{orders-DZzdsHOW.mjs → orders-DhQ2EFXS.mjs} +157 -157
- package/dist/orders-V1pch_ih.js +1 -0
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +142 -147
- package/package.json +2 -2
- package/dist/DateFormatter-ls6HfWpS.js +0 -1
- package/dist/Detail-BcboL7NF.js +0 -1
- package/dist/Entries-BPkZ7Jg5.js +0 -1
- package/dist/Find-Ds6OvuH6.js +0 -1
- package/dist/Overview-B-8TLLjh.js +0 -1
- package/dist/TableView-BUPPcHUW.mjs +0 -89505
- package/dist/TableView-CksiPsTL.js +0 -586
- package/dist/View-DDXN0tKD.mjs +0 -25
- package/dist/View-DfzaVOzS.js +0 -1
- package/dist/agenda-rlFma_wn.js +0 -1
- package/dist/floating-ui.dom-B9WYoHj2.js +0 -1
- package/dist/floating-ui.dom-fpIfhXTZ.mjs +0 -1291
- package/dist/index-DYpruS-A-Cw57iwdY.mjs +0 -4210
- package/dist/index-DYpruS-A-DwDXo9Tq.js +0 -88
- package/dist/index-YMaY4uuk-BgpTtr73.js +0 -1
- package/dist/index-YMaY4uuk-C_xV5K9Z.mjs +0 -1300
- package/dist/orders-tP4WdF5q.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as ce, ref as f, computed as b, watch as me, onMounted as xe, resolveComponent as W, openBlock as a, createElementBlock as i, createElementVNode as e, Fragment as $, renderList as
|
|
1
|
+
import { defineComponent as ce, ref as f, computed as b, watch as me, onMounted as xe, resolveComponent as W, openBlock as a, createElementBlock as i, createElementVNode as e, Fragment as $, renderList as N, normalizeClass as v, toDisplayString as r, createVNode as o, withCtx as u, unref as n, createCommentVNode as y, createBlock as H, createTextVNode as d, normalizeStyle as C } from "vue";
|
|
2
2
|
import { useModule as pe, useModuleRoute as fe, useModuleBreadcrumbs as ve } from "@oneclick.dev/cms-kit";
|
|
3
3
|
import "./index-CMk3uhUt.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { RefreshCw as ge, AlertTriangle as ye, Loader2 as he, MousePointerClick as
|
|
4
|
+
import { componentToString as Y, ChartTooltipContent as Z } from "@oneclick.dev/cms-kit/charts";
|
|
5
|
+
import { RefreshCw as ge, AlertTriangle as ye, Loader2 as he, MousePointerClick as U, Eye as V, TrendingUp as _e, Hash as be, Search as ke, FileText as we, ArrowUpRight as Ce } from "lucide-vue-next";
|
|
6
6
|
import { S as ee, C as B, A as te, z as se } from "./index-_2lRVt_k.mjs";
|
|
7
7
|
import { C as oe, a as le } from "./index-p5Uqu8c2.mjs";
|
|
8
8
|
const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { class: "flex items-center justify-between" }, ze = {
|
|
@@ -11,7 +11,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
11
11
|
}, Se = { class: "flex items-center border rounded-lg overflow-hidden" }, De = ["onClick"], Pe = { class: "text-sm text-destructive font-medium" }, Re = {
|
|
12
12
|
key: 3,
|
|
13
13
|
class: "flex items-center justify-center py-20"
|
|
14
|
-
}, Fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, Me = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ae = { class: "text-2xl font-bold tabular-nums" }, Le = { class: "flex items-center gap-2 text-xs text-muted-foreground" },
|
|
14
|
+
}, Fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, Me = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ae = { class: "text-2xl font-bold tabular-nums" }, Le = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ne = { class: "text-2xl font-bold tabular-nums" }, Ue = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Be = { class: "text-2xl font-bold tabular-nums" }, je = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ee = { class: "flex items-center gap-4" }, Ke = { class: "flex items-center gap-2" }, Oe = { class: "text-xs" }, Ie = { class: "flex items-center gap-2" }, He = { class: "text-xs" }, Ve = { class: "flex items-center gap-2" }, Xe = { class: "text-xs" }, qe = { class: "flex items-center gap-2" }, Ge = { class: "text-xs" }, Je = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "flex h-3 rounded-full overflow-hidden mt-3"
|
|
17
17
|
}, Qe = { class: "grid grid-cols-1 @3xl:grid-cols-2 gap-4" }, We = {
|
|
@@ -127,7 +127,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
127
127
|
], -1)),
|
|
128
128
|
P.value ? (a(), i("div", ze, [
|
|
129
129
|
e("div", Se, [
|
|
130
|
-
(a(), i($, null,
|
|
130
|
+
(a(), i($, null, N(ae, (l) => e("button", {
|
|
131
131
|
key: l.value,
|
|
132
132
|
class: v(["px-3 py-1.5 text-xs font-medium transition-colors", S.value === l.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
|
|
133
133
|
onClick: (p) => S.value = l.value
|
|
@@ -174,7 +174,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
174
174
|
o(m, { class: "p-4 space-y-1" }, {
|
|
175
175
|
default: u(() => [
|
|
176
176
|
e("div", Me, [
|
|
177
|
-
o(n(
|
|
177
|
+
o(n(U), { class: "size-3.5" }),
|
|
178
178
|
t[8] || (t[8] = d(" Total Clicks ", -1))
|
|
179
179
|
]),
|
|
180
180
|
e("p", Ae, r(_(w.value.clicks)), 1)
|
|
@@ -187,13 +187,13 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
187
187
|
o(n(V), { class: "size-3.5" }),
|
|
188
188
|
t[9] || (t[9] = d(" Total Impressions ", -1))
|
|
189
189
|
]),
|
|
190
|
-
e("p",
|
|
190
|
+
e("p", Ne, r(_(w.value.impressions)), 1)
|
|
191
191
|
]),
|
|
192
192
|
_: 1
|
|
193
193
|
}),
|
|
194
194
|
o(m, { class: "p-4 space-y-1" }, {
|
|
195
195
|
default: u(() => [
|
|
196
|
-
e("div",
|
|
196
|
+
e("div", Ue, [
|
|
197
197
|
o(n(_e), { class: "size-3.5" }),
|
|
198
198
|
t[10] || (t[10] = d(" Average CTR ", -1))
|
|
199
199
|
]),
|
|
@@ -387,7 +387,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
387
387
|
]),
|
|
388
388
|
x.value === "keywords" ? (a(), i("div", ot, [
|
|
389
389
|
c.value.length === 0 ? (a(), i("div", lt, " No keyword data found for this period. ")) : y("", !0),
|
|
390
|
-
(a(!0), i($, null,
|
|
390
|
+
(a(!0), i($, null, N(c.value, (l, p) => (a(), i("div", {
|
|
391
391
|
key: p,
|
|
392
392
|
class: "px-4 py-3 hover:bg-muted/30 transition-colors"
|
|
393
393
|
}, [
|
|
@@ -404,7 +404,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
404
404
|
]),
|
|
405
405
|
e("div", ut, [
|
|
406
406
|
e("span", ct, [
|
|
407
|
-
o(n(
|
|
407
|
+
o(n(U), { class: "size-3" }),
|
|
408
408
|
d(" " + r(_(l.clicks)), 1)
|
|
409
409
|
]),
|
|
410
410
|
e("span", mt, [
|
|
@@ -421,7 +421,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
421
421
|
])) : y("", !0),
|
|
422
422
|
x.value === "pages" ? (a(), i("div", pt, [
|
|
423
423
|
D.value.length === 0 ? (a(), i("div", ft, " No page data found for this period. ")) : y("", !0),
|
|
424
|
-
(a(!0), i($, null,
|
|
424
|
+
(a(!0), i($, null, N(D.value, (l, p) => (a(), i("div", {
|
|
425
425
|
key: p,
|
|
426
426
|
class: "px-4 py-3 hover:bg-muted/30 transition-colors"
|
|
427
427
|
}, [
|
|
@@ -441,7 +441,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
441
441
|
]),
|
|
442
442
|
e("div", bt, [
|
|
443
443
|
e("span", kt, [
|
|
444
|
-
o(n(
|
|
444
|
+
o(n(U), { class: "size-3" }),
|
|
445
445
|
d(" " + r(_(l.clicks)), 1)
|
|
446
446
|
]),
|
|
447
447
|
e("span", wt, [
|
|
@@ -458,7 +458,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
458
458
|
])) : y("", !0),
|
|
459
459
|
x.value === "mapping" ? (a(), i("div", $t, [
|
|
460
460
|
j.value.length === 0 ? (a(), i("div", Tt, " No query-page data found for this period. ")) : y("", !0),
|
|
461
|
-
(a(!0), i($, null,
|
|
461
|
+
(a(!0), i($, null, N(j.value, (l, p) => (a(), i("div", {
|
|
462
462
|
key: p,
|
|
463
463
|
class: "px-4 py-3 hover:bg-muted/30 transition-colors"
|
|
464
464
|
}, [
|
|
@@ -473,7 +473,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
|
|
|
473
473
|
]),
|
|
474
474
|
e("div", Ft, [
|
|
475
475
|
e("span", Mt, [
|
|
476
|
-
o(n(
|
|
476
|
+
o(n(U), { class: "size-3" }),
|
|
477
477
|
d(" " + r(_(l.clicks)), 1)
|
|
478
478
|
]),
|
|
479
479
|
e("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const b=require("./index-DYpruS-A-DwDXo9Tq.js"),r=require("lucide-vue-next"),a=require("./index-DQYBP8Js.js"),w=require("./index-C4YUVWzJ.js"),O={class:"w-full max-w-7xl mx-auto py-8 px-4 space-y-6"},I={class:"flex items-center justify-between"},H={key:0,class:"flex items-center gap-2"},X={class:"flex items-center border rounded-lg overflow-hidden"},G=["onClick"],Y={class:"text-sm text-destructive font-medium"},J={key:3,class:"flex items-center justify-center py-20"},Q={class:"grid grid-cols-2 @3xl:grid-cols-4 gap-4"},W={class:"flex items-center gap-2 text-xs text-muted-foreground"},Z={class:"text-2xl font-bold tabular-nums"},ee={class:"flex items-center gap-2 text-xs text-muted-foreground"},te={class:"text-2xl font-bold tabular-nums"},oe={class:"flex items-center gap-2 text-xs text-muted-foreground"},se={class:"text-2xl font-bold tabular-nums"},re={class:"flex items-center gap-2 text-xs text-muted-foreground"},ne={class:"flex items-center gap-4"},le={class:"flex items-center gap-2"},ae={class:"text-xs"},ie={class:"flex items-center gap-2"},de={class:"text-xs"},ce={class:"flex items-center gap-2"},ue={class:"text-xs"},me={class:"flex items-center gap-2"},pe={class:"text-xs"},xe={key:0,class:"flex h-3 rounded-full overflow-hidden mt-3"},fe={class:"grid grid-cols-1 @3xl:grid-cols-2 gap-4"},ge={key:0,class:"h-48"},ve={key:1,class:"text-xs text-muted-foreground text-center py-10"},ye={key:0,class:"h-48"},Ne={key:1,class:"text-xs text-muted-foreground text-center py-10"},Ve={class:"border-b"},he={class:"flex"},ke={key:0,class:"divide-y"},Ee={key:0,class:"p-8 text-center text-sm text-muted-foreground"},_e={class:"flex items-center gap-3"},be={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},we={class:"flex-1 min-w-0"},Ce={class:"text-sm font-medium truncate"},Be={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Se={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},De={class:"flex items-center gap-1 w-16 justify-end"},Te={class:"flex items-center gap-1 w-16 justify-end"},ze={class:"w-14 text-right"},$e={key:1,class:"divide-y"},Pe={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Fe={class:"flex items-center gap-3"},Me={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Le={class:"flex-1 min-w-0"},Re=["title"],Ae={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Ue={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},je={class:"flex items-center gap-1 w-16 justify-end"},qe={class:"flex items-center gap-1 w-16 justify-end"},Ke={class:"w-14 text-right"},Oe={key:2,class:"divide-y"},Ie={key:0,class:"p-8 text-center text-sm text-muted-foreground"},He={class:"flex items-start gap-3"},Xe={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5"},Ge={class:"flex-1 min-w-0 space-y-0.5"},Ye={class:"text-sm font-medium"},Je=["title"],Qe={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},We={class:"flex items-center gap-1"},Ze=e.defineComponent({__name:"SeoHealth",setup(et){const{config:f}=z.useModule(),{moduleId:R}=z.useModuleRoute();z.useModuleBreadcrumbs(()=>[{label:"SEO Health"}]);const p=e.ref(!0),g=e.ref(null),v=e.ref("30"),u=e.ref([]),x=e.ref({clicks:0,impressions:0,ctr:0,avgPosition:0}),n=e.ref([]),y=e.ref([]),C=e.ref([]),N=e.computed(()=>!!(f.serviceAccount&&f.propertyId&&f.siteUrl)),A=e.computed(()=>!!f.siteUrl);function V(o){return`/api/v1/modules/${R}${o}`}const U=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}],h=(o,t)=>t,$=o=>o.clicks||0,P=o=>o.impressions||0,F=o=>{const t=u.value[Math.round(o)];if(!t)return"";const c=new Date(t.date);return`${c.getDate()}/${c.getMonth()+1}`},M=o=>{const t=u.value[Math.round(Number(o))];return t?new Date(t.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};function m(o){return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:Math.round(o).toString()}function B(o){return`${(o*100).toFixed(1)}%`}function k(o){return o.toFixed(1)}function j(o){return o<=3?"text-emerald-600 dark:text-emerald-400":o<=10?"text-blue-600 dark:text-blue-400":o<=20?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function S(o){return o<=3?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":o<=10?"bg-blue-500/10 text-blue-600 dark:text-blue-400":o<=20?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-red-500/10 text-red-600 dark:text-red-400"}function L(o){try{return new URL(o).pathname}catch{return o}}const D=e.computed(()=>n.value.filter(o=>o.position<=3).length),T=e.computed(()=>n.value.filter(o=>o.position<=10).length),E=e.computed(()=>n.value.filter(o=>o.position<=20).length),q=e.computed(()=>Math.max(...n.value.map(o=>o.clicks),1)),K=e.computed(()=>Math.max(...y.value.map(o=>o.clicks),1));async function _(){if(!N.value)return;p.value=!0,g.value=null;const o=`${v.value}daysAgo`;try{const[t,c,l,s]=await Promise.all([$fetch(V(`/seo/trends?startDate=${o}&endDate=today`)),$fetch(V(`/seo/keywords?startDate=${o}&endDate=today&limit=50`)),$fetch(V(`/seo/pages?startDate=${o}&endDate=today&limit=30`)),$fetch(V(`/seo/query-pages?startDate=${o}&endDate=today`))]);u.value=t.rows||[],x.value=t.totals||{clicks:0,impressions:0,ctr:0,avgPosition:0},n.value=c.rows||[],y.value=l.rows||[],C.value=s.rows||[]}catch(t){g.value=t?.data?.statusMessage||t?.message||"Failed to load SEO data"}finally{p.value=!1}}e.watch(v,()=>_()),e.onMounted(()=>{N.value?_():p.value=!1});const i=e.ref("keywords");return(o,t)=>{const c=e.resolveComponent("Button"),l=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",I,[t[3]||(t[3]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"SEO Health"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Search Console performance & keyword rankings")],-1)),N.value?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",X,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,s=>e.createElementVNode("button",{key:s.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",v.value===s.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:d=>v.value=s.value},e.toDisplayString(s.label),11,G)),64))]),e.createVNode(c,{variant:"outline",size:"icon",onClick:_,disabled:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(r.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":p.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),A.value?N.value?g.value?(e.openBlock(),e.createBlock(l,{key:2,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",Y,e.toDisplayString(g.value),1),e.createVNode(c,{variant:"outline",size:"sm",class:"mt-3",onClick:_},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):p.value?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(e.unref(r.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Q,[e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",W,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3.5"}),t[8]||(t[8]=e.createTextVNode(" Total Clicks ",-1))]),e.createElementVNode("p",Z,e.toDisplayString(m(x.value.clicks)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(e.unref(r.Eye),{class:"size-3.5"}),t[9]||(t[9]=e.createTextVNode(" Total Impressions ",-1))]),e.createElementVNode("p",te,e.toDisplayString(m(x.value.impressions)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(r.TrendingUp),{class:"size-3.5"}),t[10]||(t[10]=e.createTextVNode(" Average CTR ",-1))]),e.createElementVNode("p",se,e.toDisplayString(B(x.value.ctr)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.createVNode(e.unref(r.Hash),{class:"size-3.5"}),t[11]||(t[11]=e.createTextVNode(" Avg Position ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["text-2xl font-bold tabular-nums",j(x.value.avgPosition)])},e.toDisplayString(k(x.value.avgPosition)),3)]),_:1})]),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[20]||(t[20]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Keyword Ranking Distribution",-1)),e.createElementVNode("div",ne,[e.createElementVNode("div",le,[t[13]||(t[13]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-emerald-500"},null,-1)),e.createElementVNode("span",ae,[t[12]||(t[12]=e.createTextVNode("Top 3: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(D.value),1)])]),e.createElementVNode("div",ie,[t[15]||(t[15]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",de,[t[14]||(t[14]=e.createTextVNode("Top 10: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(T.value),1)])]),e.createElementVNode("div",ce,[t[17]||(t[17]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"},null,-1)),e.createElementVNode("span",ue,[t[16]||(t[16]=e.createTextVNode("Top 20: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(E.value),1)])]),e.createElementVNode("div",me,[t[19]||(t[19]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"},null,-1)),e.createElementVNode("span",pe,[t[18]||(t[18]=e.createTextVNode("20+: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value.length-E.value),1)])])]),n.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:"bg-emerald-500 transition-all",style:e.normalizeStyle({width:`${D.value/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-blue-500 transition-all",style:e.normalizeStyle({width:`${(T.value-D.value)/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-amber-500 transition-all",style:e.normalizeStyle({width:`${(E.value-T.value)/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-red-500 transition-all",style:e.normalizeStyle({width:`${(n.value.length-E.value)/n.value.length*100}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",fe,[e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[21]||(t[21]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Clicks Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(w.C),{x:h,y:$,color:"#3b82f6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(w.C$1),{x:h,y:$,color:"#3b82f6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.st)(e.unref(b.Ue),{namePayload:[{name:"Clicks",value:s.clicks,color:"#3b82f6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",ve,"Not enough data for chart"))]),_:1}),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[22]||(t[22]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Impressions Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(w.C),{x:h,y:P,color:"#8b5cf6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(w.C$1),{x:h,y:P,color:"#8b5cf6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.st)(e.unref(b.Ue),{namePayload:[{name:"Impressions",value:s.impressions,color:"#8b5cf6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",Ne,"Not enough data for chart"))]),_:1})]),e.createVNode(l,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.createElementVNode("div",he,[e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="keywords"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[0]||(t[0]=s=>i.value="keywords")},[e.createVNode(e.unref(r.Search),{class:"size-3.5 inline mr-1.5"}),t[23]||(t[23]=e.createTextVNode(" Keywords ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[1]||(t[1]=s=>i.value="pages")},[e.createVNode(e.unref(r.FileText),{class:"size-3.5 inline mr-1.5"}),t[24]||(t[24]=e.createTextVNode(" Pages ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="mapping"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[2]||(t[2]=s=>i.value="mapping")},[e.createVNode(e.unref(r.ArrowUpRight),{class:"size-3.5 inline mr-1.5"}),t[25]||(t[25]=e.createTextVNode(" Keyword → Page ",-1))],2)])]),i.value==="keywords"?(e.openBlock(),e.createElementBlock("div",ke,[n.value.length===0?(e.openBlock(),e.createElementBlock("div",Ee," No keyword data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",_e,[e.createElementVNode("span",be,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",we,[e.createElementVNode("p",Ce,e.toDisplayString(s.query),1),e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70",style:e.normalizeStyle({width:`${s.clicks/q.value*100}%`})},null,4)])]),e.createElementVNode("div",Se,[e.createElementVNode("span",De,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",Te,[e.createVNode(e.unref(r.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",ze,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="pages"?(e.openBlock(),e.createElementBlock("div",$e,[y.value.length===0?(e.openBlock(),e.createElementBlock("div",Pe," No page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Fe,[e.createElementVNode("span",Me,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Le,[e.createElementVNode("p",{class:"text-sm font-medium truncate",title:s.page},e.toDisplayString(L(s.page)),9,Re),e.createElementVNode("div",Ae,[e.createElementVNode("div",{class:"h-full rounded-full bg-violet-500/70",style:e.normalizeStyle({width:`${s.clicks/K.value*100}%`})},null,4)])]),e.createElementVNode("div",Ue,[e.createElementVNode("span",je,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",qe,[e.createVNode(e.unref(r.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",Ke,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="mapping"?(e.openBlock(),e.createElementBlock("div",Oe,[C.value.length===0?(e.openBlock(),e.createElementBlock("div",Ie," No query-page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",He,[e.createElementVNode("span",Xe,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ge,[e.createElementVNode("p",Ye,e.toDisplayString(s.query),1),e.createElementVNode("p",{class:"text-xs text-muted-foreground truncate",title:s.page},"→ "+e.toDisplayString(L(s.page)),9,Je)]),e.createElementVNode("div",Qe,[e.createElementVNode("span",We,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0)]),_:1})],64)):(e.openBlock(),e.createBlock(l,{key:1,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Configure your service account, property ID, and site URL in module settings.",-1)])]),_:1})):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center space-y-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.AlertTriangle),{class:"size-10 text-amber-500 mx-auto"}),t[4]||(t[4]=e.createElementVNode("p",{class:"text-lg font-medium"},"Search Console not configured",-1)),t[5]||(t[5]=e.createElementVNode("p",{class:"text-sm text-muted-foreground max-w-md mx-auto"},[e.createTextVNode(" Add your "),e.createElementVNode("strong",null,"Search Console Site URL"),e.createTextVNode(" in the module settings to enable SEO data. Use the exact format from Google Search Console (e.g. "),e.createElementVNode("code",null,"https://example.com"),e.createTextVNode(" or "),e.createElementVNode("code",null,"sc-domain:example.com"),e.createTextVNode("). ")],-1))]),_:1}))])}}});exports.default=Ze;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const b=require("@oneclick.dev/cms-kit/charts"),n=require("lucide-vue-next"),a=require("./index-DQYBP8Js.js"),C=require("./index-C4YUVWzJ.js"),O={class:"w-full max-w-7xl mx-auto py-8 px-4 space-y-6"},I={class:"flex items-center justify-between"},H={key:0,class:"flex items-center gap-2"},X={class:"flex items-center border rounded-lg overflow-hidden"},G=["onClick"],J={class:"text-sm text-destructive font-medium"},Q={key:3,class:"flex items-center justify-center py-20"},W={class:"grid grid-cols-2 @3xl:grid-cols-4 gap-4"},Y={class:"flex items-center gap-2 text-xs text-muted-foreground"},Z={class:"text-2xl font-bold tabular-nums"},ee={class:"flex items-center gap-2 text-xs text-muted-foreground"},te={class:"text-2xl font-bold tabular-nums"},oe={class:"flex items-center gap-2 text-xs text-muted-foreground"},se={class:"text-2xl font-bold tabular-nums"},ne={class:"flex items-center gap-2 text-xs text-muted-foreground"},re={class:"flex items-center gap-4"},le={class:"flex items-center gap-2"},ae={class:"text-xs"},ie={class:"flex items-center gap-2"},de={class:"text-xs"},ce={class:"flex items-center gap-2"},ue={class:"text-xs"},me={class:"flex items-center gap-2"},pe={class:"text-xs"},xe={key:0,class:"flex h-3 rounded-full overflow-hidden mt-3"},fe={class:"grid grid-cols-1 @3xl:grid-cols-2 gap-4"},ge={key:0,class:"h-48"},ve={key:1,class:"text-xs text-muted-foreground text-center py-10"},ye={key:0,class:"h-48"},Ne={key:1,class:"text-xs text-muted-foreground text-center py-10"},Ve={class:"border-b"},he={class:"flex"},ke={key:0,class:"divide-y"},Ee={key:0,class:"p-8 text-center text-sm text-muted-foreground"},_e={class:"flex items-center gap-3"},be={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Ce={class:"flex-1 min-w-0"},we={class:"text-sm font-medium truncate"},Be={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Se={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},Te={class:"flex items-center gap-1 w-16 justify-end"},De={class:"flex items-center gap-1 w-16 justify-end"},ze={class:"w-14 text-right"},$e={key:1,class:"divide-y"},Pe={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Fe={class:"flex items-center gap-3"},Me={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Le={class:"flex-1 min-w-0"},Re=["title"],Ae={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Ue={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},je={class:"flex items-center gap-1 w-16 justify-end"},qe={class:"flex items-center gap-1 w-16 justify-end"},Ke={class:"w-14 text-right"},Oe={key:2,class:"divide-y"},Ie={key:0,class:"p-8 text-center text-sm text-muted-foreground"},He={class:"flex items-start gap-3"},Xe={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5"},Ge={class:"flex-1 min-w-0 space-y-0.5"},Je={class:"text-sm font-medium"},Qe=["title"],We={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},Ye={class:"flex items-center gap-1"},Ze=e.defineComponent({__name:"SeoHealth",setup(et){const{config:f}=z.useModule(),{moduleId:R}=z.useModuleRoute();z.useModuleBreadcrumbs(()=>[{label:"SEO Health"}]);const p=e.ref(!0),g=e.ref(null),v=e.ref("30"),u=e.ref([]),x=e.ref({clicks:0,impressions:0,ctr:0,avgPosition:0}),r=e.ref([]),y=e.ref([]),w=e.ref([]),N=e.computed(()=>!!(f.serviceAccount&&f.propertyId&&f.siteUrl)),A=e.computed(()=>!!f.siteUrl);function V(o){return`/api/v1/modules/${R}${o}`}const U=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}],h=(o,t)=>t,$=o=>o.clicks||0,P=o=>o.impressions||0,F=o=>{const t=u.value[Math.round(o)];if(!t)return"";const c=new Date(t.date);return`${c.getDate()}/${c.getMonth()+1}`},M=o=>{const t=u.value[Math.round(Number(o))];return t?new Date(t.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};function m(o){return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:Math.round(o).toString()}function B(o){return`${(o*100).toFixed(1)}%`}function k(o){return o.toFixed(1)}function j(o){return o<=3?"text-emerald-600 dark:text-emerald-400":o<=10?"text-blue-600 dark:text-blue-400":o<=20?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function S(o){return o<=3?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":o<=10?"bg-blue-500/10 text-blue-600 dark:text-blue-400":o<=20?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-red-500/10 text-red-600 dark:text-red-400"}function L(o){try{return new URL(o).pathname}catch{return o}}const T=e.computed(()=>r.value.filter(o=>o.position<=3).length),D=e.computed(()=>r.value.filter(o=>o.position<=10).length),E=e.computed(()=>r.value.filter(o=>o.position<=20).length),q=e.computed(()=>Math.max(...r.value.map(o=>o.clicks),1)),K=e.computed(()=>Math.max(...y.value.map(o=>o.clicks),1));async function _(){if(!N.value)return;p.value=!0,g.value=null;const o=`${v.value}daysAgo`;try{const[t,c,l,s]=await Promise.all([$fetch(V(`/seo/trends?startDate=${o}&endDate=today`)),$fetch(V(`/seo/keywords?startDate=${o}&endDate=today&limit=50`)),$fetch(V(`/seo/pages?startDate=${o}&endDate=today&limit=30`)),$fetch(V(`/seo/query-pages?startDate=${o}&endDate=today`))]);u.value=t.rows||[],x.value=t.totals||{clicks:0,impressions:0,ctr:0,avgPosition:0},r.value=c.rows||[],y.value=l.rows||[],w.value=s.rows||[]}catch(t){g.value=t?.data?.statusMessage||t?.message||"Failed to load SEO data"}finally{p.value=!1}}e.watch(v,()=>_()),e.onMounted(()=>{N.value?_():p.value=!1});const i=e.ref("keywords");return(o,t)=>{const c=e.resolveComponent("Button"),l=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",I,[t[3]||(t[3]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"SEO Health"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Search Console performance & keyword rankings")],-1)),N.value?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",X,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,s=>e.createElementVNode("button",{key:s.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",v.value===s.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:d=>v.value=s.value},e.toDisplayString(s.label),11,G)),64))]),e.createVNode(c,{variant:"outline",size:"icon",onClick:_,disabled:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(n.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":p.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),A.value?N.value?g.value?(e.openBlock(),e.createBlock(l,{key:2,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",J,e.toDisplayString(g.value),1),e.createVNode(c,{variant:"outline",size:"sm",class:"mt-3",onClick:_},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):p.value?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(e.unref(n.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",W,[e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3.5"}),t[8]||(t[8]=e.createTextVNode(" Total Clicks ",-1))]),e.createElementVNode("p",Z,e.toDisplayString(m(x.value.clicks)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(e.unref(n.Eye),{class:"size-3.5"}),t[9]||(t[9]=e.createTextVNode(" Total Impressions ",-1))]),e.createElementVNode("p",te,e.toDisplayString(m(x.value.impressions)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(n.TrendingUp),{class:"size-3.5"}),t[10]||(t[10]=e.createTextVNode(" Average CTR ",-1))]),e.createElementVNode("p",se,e.toDisplayString(B(x.value.ctr)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ne,[e.createVNode(e.unref(n.Hash),{class:"size-3.5"}),t[11]||(t[11]=e.createTextVNode(" Avg Position ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["text-2xl font-bold tabular-nums",j(x.value.avgPosition)])},e.toDisplayString(k(x.value.avgPosition)),3)]),_:1})]),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[20]||(t[20]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Keyword Ranking Distribution",-1)),e.createElementVNode("div",re,[e.createElementVNode("div",le,[t[13]||(t[13]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-emerald-500"},null,-1)),e.createElementVNode("span",ae,[t[12]||(t[12]=e.createTextVNode("Top 3: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(T.value),1)])]),e.createElementVNode("div",ie,[t[15]||(t[15]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",de,[t[14]||(t[14]=e.createTextVNode("Top 10: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(D.value),1)])]),e.createElementVNode("div",ce,[t[17]||(t[17]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"},null,-1)),e.createElementVNode("span",ue,[t[16]||(t[16]=e.createTextVNode("Top 20: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(E.value),1)])]),e.createElementVNode("div",me,[t[19]||(t[19]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"},null,-1)),e.createElementVNode("span",pe,[t[18]||(t[18]=e.createTextVNode("20+: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(r.value.length-E.value),1)])])]),r.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:"bg-emerald-500 transition-all",style:e.normalizeStyle({width:`${T.value/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-blue-500 transition-all",style:e.normalizeStyle({width:`${(D.value-T.value)/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-amber-500 transition-all",style:e.normalizeStyle({width:`${(E.value-D.value)/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-red-500 transition-all",style:e.normalizeStyle({width:`${(r.value.length-E.value)/r.value.length*100}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",fe,[e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[21]||(t[21]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Clicks Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(C.C),{x:h,y:$,color:"#3b82f6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(C.C$1),{x:h,y:$,color:"#3b82f6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.componentToString)(e.unref(b.ChartTooltipContent),{namePayload:[{name:"Clicks",value:s.clicks,color:"#3b82f6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",ve,"Not enough data for chart"))]),_:1}),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[22]||(t[22]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Impressions Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(C.C),{x:h,y:P,color:"#8b5cf6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(C.C$1),{x:h,y:P,color:"#8b5cf6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.componentToString)(e.unref(b.ChartTooltipContent),{namePayload:[{name:"Impressions",value:s.impressions,color:"#8b5cf6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",Ne,"Not enough data for chart"))]),_:1})]),e.createVNode(l,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.createElementVNode("div",he,[e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="keywords"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[0]||(t[0]=s=>i.value="keywords")},[e.createVNode(e.unref(n.Search),{class:"size-3.5 inline mr-1.5"}),t[23]||(t[23]=e.createTextVNode(" Keywords ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[1]||(t[1]=s=>i.value="pages")},[e.createVNode(e.unref(n.FileText),{class:"size-3.5 inline mr-1.5"}),t[24]||(t[24]=e.createTextVNode(" Pages ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="mapping"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[2]||(t[2]=s=>i.value="mapping")},[e.createVNode(e.unref(n.ArrowUpRight),{class:"size-3.5 inline mr-1.5"}),t[25]||(t[25]=e.createTextVNode(" Keyword → Page ",-1))],2)])]),i.value==="keywords"?(e.openBlock(),e.createElementBlock("div",ke,[r.value.length===0?(e.openBlock(),e.createElementBlock("div",Ee," No keyword data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",_e,[e.createElementVNode("span",be,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ce,[e.createElementVNode("p",we,e.toDisplayString(s.query),1),e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70",style:e.normalizeStyle({width:`${s.clicks/q.value*100}%`})},null,4)])]),e.createElementVNode("div",Se,[e.createElementVNode("span",Te,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",De,[e.createVNode(e.unref(n.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",ze,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="pages"?(e.openBlock(),e.createElementBlock("div",$e,[y.value.length===0?(e.openBlock(),e.createElementBlock("div",Pe," No page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Fe,[e.createElementVNode("span",Me,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Le,[e.createElementVNode("p",{class:"text-sm font-medium truncate",title:s.page},e.toDisplayString(L(s.page)),9,Re),e.createElementVNode("div",Ae,[e.createElementVNode("div",{class:"h-full rounded-full bg-violet-500/70",style:e.normalizeStyle({width:`${s.clicks/K.value*100}%`})},null,4)])]),e.createElementVNode("div",Ue,[e.createElementVNode("span",je,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",qe,[e.createVNode(e.unref(n.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",Ke,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="mapping"?(e.openBlock(),e.createElementBlock("div",Oe,[w.value.length===0?(e.openBlock(),e.createElementBlock("div",Ie," No query-page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",He,[e.createElementVNode("span",Xe,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ge,[e.createElementVNode("p",Je,e.toDisplayString(s.query),1),e.createElementVNode("p",{class:"text-xs text-muted-foreground truncate",title:s.page},"→ "+e.toDisplayString(L(s.page)),9,Qe)]),e.createElementVNode("div",We,[e.createElementVNode("span",Ye,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0)]),_:1})],64)):(e.openBlock(),e.createBlock(l,{key:1,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Configure your service account, property ID, and site URL in module settings.",-1)])]),_:1})):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center space-y-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.AlertTriangle),{class:"size-10 text-amber-500 mx-auto"}),t[4]||(t[4]=e.createElementVNode("p",{class:"text-lg font-medium"},"Search Console not configured",-1)),t[5]||(t[5]=e.createElementVNode("p",{class:"text-sm text-muted-foreground max-w-md mx-auto"},[e.createTextVNode(" Add your "),e.createElementVNode("strong",null,"Search Console Site URL"),e.createTextVNode(" in the module settings to enable SEO data. Use the exact format from Google Search Console (e.g. "),e.createElementVNode("code",null,"https://example.com"),e.createTextVNode(" or "),e.createElementVNode("code",null,"sc-domain:example.com"),e.createTextVNode("). ")],-1))]),_:1}))])}}});exports.default=Ze;
|