PageSourceSearch

https://dawnmcgruer.com/assets/search-console-Cc7g8dzT.js

js dawnmcgruer.com collected 2026-10-02 15:13:08 UTC 23,666 bytes, 1 lines download raw bytes

vendor: 4,854 bytes, line 1
1import{bQ as fe,bR as oe,bS as g,bT as I,bU as R,bV as M,bW as X,bX as ce,bY as ve,bZ as _,b_ as je,b$ as ye,c0 as le,c1 as L,c2 as he,c3 as Ne,r as d,c4 as ee,c5 as $,c6 as we,at as B,j as t,c7 as q,y as Re,L as Se}from"./index-361hUuKw.js";import{c as A,u as P}from"./createServerFn-Db-tJcSD.js";import{c as j,B as Z}from"./button-DHXkrmlg.js";var Ce=class extends fe{constructor(e,s){super(),this.options=s,this.#s=e,this.#o=null,this.#n=oe(),this.bindMethods(),this.setOptions(s)}#s;#e=void 0;#r=void 0;#t=void 0;#i;#a;#n;#o;#x;#u;#m;#l;#h;#c;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),de(this.#e,this.options)?this.#d():this.updateResult(),this.#v())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#j(),this.#y(),this.#e.removeObserver(this)}setOptions(e){const s=this.options,i=this.#e;if(this.options=this.#s.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof g(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#N(),this.#e.setOptions(this.options),s._defaulted&&!I(this.options,s)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&ue(this.#e,i,this.options,s)&&this.#d(),this.updateResult(),r&&(this.#e!==i||g(this.options.enabled,this.#e)!==g(s.enabled,this.#e)||R(this.options.staleTime,this.#e)!==R(s.staleTime,this.#e))&&this.#p();const n=this.#g();r&&(this.#e!==i||g(this.options.enabled,this.#e)!==g(s.enabled,this.#e)||n!==this.#c)&&this.#b(n)}getOptimisticResult(e){const s=this.#s.getQueryCache().build(this.#s,e),i=this.createResult(s,e);return Oe(this,i)&&(this.#t=i,this.#a=this.options,this.#i=this.#e.state),i}getCurrentResult(){return this.#t}trackResult(e,s){return new Proxy(e,{get:(i,r)=>(this.trackProp(r),s?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#n.status==="pending"&&this.#n.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const s=this.#s.defaultQueryOptions(e),i=this.#s.getQueryCache().build(this.#s,s);return i.fetch().then(()=>this.createResult(i,s))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#t))}#d(e){this.#N();let s=this.#e.fetch(this.options,e);return e?.throwOnError||(s=s.catch(M)),s}#p(){this.#j();const e=R(this.options.staleTime,this.#e);if(X.isServer()||this.#t.isStale||!ce(e))return;const i=ve(this.#t.dataUpdatedAt,e)+1;this.#l=_.setTimeout(()=>{this.#t.isStale||this.updateResult()},i)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#b(e){this.#y(),this.#c=e,!(X.isServer()||g(this.options.enabled,this.#e)===!1||!ce(this.#c)||this.#c===0)&&(this.#h=_.setInterval(()=>{(this.options.refetchIntervalInBackground||je.isFocused())&&this.#d()},this.#c))}#v(){this.#p(),this.#b(this.#g())}#j(){this.#l!==void 0&&(_.clearTimeout(this.#l),this.#l=void 0)}#y(){this.#h!==void 0&&(_.clearInterval(this.#h),this.#h=void 0)}createResult(e,s){const i=this.#e,r=this.options,n=this.#t,l=this.#i,a=this.#a,b=e!==i?e.state:this.#r,{state:m}=e;let c={...m},o=!1,h;if(s._optimisticResults){const p=this.hasListeners(),w=!p&&de(e,s),C=p&&ue(e,i,s,r);(w||C)&&(c={...c,...ye(m.data,e.options)}),s._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:S,errorUpdatedAt:se,status:y}=c;h=c.data;let re=!1;if(s.placeholderData!==void 0&&h===void 0&&y==="pending"){let p;n?.isPlaceholderData&&s.placeholderData===a?.placeholderData?(p=n.data,re=!0):p=typeof s.placeholderData=="function"?s.placeholderData(this.#m?.state.data,this.#m):s.placeholderData,p!==void 0&&(y="success",h=le(n?.data,p,s),o=!0)}if(s.select&&h!==void 0&&!re)if(n&&h===l?.data&&s.select===this.#x)h=this.#u;else try{this.#x=s.select,h=s.select(h),h=le(n?.data,h,s),this.#u=h,this.#o=null}catch(p){this.#o=p}this.#o&&(S=this.#o,h=this.#u,se=Date.now(),y="error");const G=c.fetchStatus==="fetching",H=y==="pending",W=y==="error",ie=H&&G,ae=h!==void 0,v={status:y,fetchStatus:c.fetchStatus,isPending:H,isSuccess:y==="success",isError:W,isInitialLoading:ie,isLoading:ie,data:h,dataUpdatedAt:c.dataUpdatedAt,error:S,errorUpdatedAt:se,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdate
1Count:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>b.dataUpdateCount||c.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!H,isLoadingError:W&&!ae,isPaused:c.fetchStatus==="paused",isPlaceholderData:o,isRefetchError:W&&ae,isStale:te(e,s),refetch:this.refetch,promise:this.#n,isEnabled:g(s.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const p=v.data!==void 0,w=v.status==="error"&&!p,C=O=>{w?O.reject(v.error):p&&O.resolve(v.data)},ne=()=>{const O=this.#n=v.promise=oe();C(O)},k=this.#n;switch(k.status){case"pending":e.queryHash===i.queryHash&&C(k);break;case"fulfilled":(w||v.data!==k.value)&&ne();break;case"rejected":(!w||v.error!==k.reason)&&ne();break}}return v}updateResult(){const e=this.#t,s=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#a=this.options,this.#i.data!==void 0&&(this.#m=this.#e),I(s,e))return;this.#t=s;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,n=typeof r=="function"?r():r;if(n==="all"||!n&&!this.#f.size)return!0;const l=new Set(n??this.#f);return this.options.throwOnError&&l.add("error"),Object.keys(this.#t).some(a=>{const u=a;return this.#t[u]!==e[u]&&l.has(u)})};this.#w({listeners:i()})}#N(){const e=this.#s.getQueryCache().build(this.#s,this.options);if(e===this.#e)return;const s=this.#e;this.#e=e,this.#r=e.state,this.hasListeners()&&(s?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#v()}#w(e){L.batch(()=>{e.listeners&&this.listeners.forEach(s=>{s(this.#t)}),this.#s.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function ke(e,s){return g(s.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&g(s.retryOnMount,e)===!1)}function de(e,s){return ke(e,s)||e.state.data!==void 0&&J(e,s,s.refetchOnMount)}function J(e,s,i){if(g(s.enabled,e)!==!1&&R(s.staleTime,e)!=="static"){const r=typeof i=="function"?i(e):i;return r==="always"||r!==!1&&te(e,s)}return!1}function ue(e,s,i,r){return(e!==s||g(r.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&te(e,i)}function te(e,s){return g(s.enabled,e)!==!1&&e.isStaleByTime(R(s.staleTime,e))}function Oe(e,s){return!I(e.getCurrentResult(),s)}var _e=class extends fe{#s;#e=void 0;#r;#t;constructor(e,s){super(),this.#s=e,this.setOptions(s),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const s=this.options;this.options=this.#s.defaultMutationOptions(e),I(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),s?.mutationKey&&this.options.mutationKey&&he(s.mutationKey)!==he(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#e}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#i(),this.#a()}mutate(e,s){return this.#t=s,this.#r?.removeObserver(this),this.#r=this.#s.getMutationCache().build(this.#s,this.options),this.#r.addObserver(this),this.#r.execute(e)}#i(){const e=this.#r?.state??Ne();this.#e={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#a(e){L.batch(()=>{if(this.#t&&this.hasListeners()){const s=this.#e.variables,i=this.#e.context,r={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#t.onSuccess?.(e.data,s,i,r)}catch(n){Promise.reject(n)}try{this.#t.onSettled?.(e.data,null,s,i,r)}catch(n){Promise.reject(n)}}else if(e?.type==="error"){try{this.#t.onError?.(e.error,s,i,r)}catch(n){Promise.reject(n)}try{this.#t.onSettled?.(void 0,e.error,s,i,r)}catch(n){Promise.reject(n)}}}this.listeners.forEach(s=>{s(this.#e)})})}},xe=d.createContext(!1),Ee=()=>d.useContext(xe);xe.Provider;function Te(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ie=d.createContext(Te()),Me=()=>d.useContext(Ie),Pe=(e,s,i)=>{const r=i?.state.error&&typeof e.throwOnError=="function"?ee(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(s.isReset()||(e.retryOn
1Mount=!1))},Fe=e=>{d.useEffect(()=>{e.clearReset()},[e])},Qe=({result:e,errorResetBoundary:s,throwOnError:i,query:r,suspense:n})=>e.isError&&!s.isReset()&&!e.isFetching&&r&&(n&&e.data===void 0||ee(i,[e.error,r])),De=e=>{if(e.suspense){const i=n=>n==="static"?n:Math.max(n??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...n)=>i(r(...n)):i(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ue=(e,s)=>e.isLoading&&e.isFetching&&!s,Le=(e,s)=>e?.suspense&&s.isPending,me=(e,s,i)=>s.fetchOptimistic(e).catch(()=>{i.clearReset()});function $e(e,s,i){const r=Ee(),n=Me(),l=$(),a=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(a);const u=l.getQueryCache().get(a.queryHash);a._optimisticResults=r?"isRestoring":"optimistic",De(a),Pe(a,n,u),Fe(n);const b=!l.getQueryCache().get(a.queryHash),[m]=d.useState(()=>new s(l,a)),c=m.getOptimisticResult(a),o=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(h=>{const S=o?m.subscribe(L.batchCalls(h)):M;return m.updateResult(),S},[m,o]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),d.useEffect(()=>{m.setOptions(a)},[a,m]),Le(a,c))throw me(a,m,n);if(Qe({result:c,errorResetBoundary:n,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw c.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(a,c),a.experimental_prefetchInRender&&!X.isServer()&&Ue(c,r)&&(b?me(a,m,n):u?.promise)?.catch(M).finally(()=>{m.updateResult()}),a.notifyOnChangeProps?c:m.trackResult(c)}function pe(e,s){return $e(e,Ce)}function ge(e,s){const i=$(),[r]=d.useState(()=>new _e(i,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);const n=d.useSyncExternalStore(d.useCallback(a=>r.subscribe(L.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=d.useCallback((a,u)=>{r.mutate(a,u).catch(M)},[r]);if(n.error&&ee(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:l,mutateAsync:n.mutate}}const K=we({type:"function"}),Be=A({method:"GET"}).middleware([K]).handler(B("b25f5de455a26d6c55086fb2a732452cca58a1cdc96ad05d8bdb623b42854a3a")),Ae=A({method:"POST"}).middleware([K]).handler(B("c44e12dd18ccd2ecdc53544abb5786328178bbaec7dfd3e83526f5902c1547a1")),F=d.forwardRef(({className:e,...s},i)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:i,className:j("w-full caption-bottom text-sm",e),...s})}));F.displayName="Table";const Q=d.forwardRef(({className:e,...s},i)=>t.jsx("thead",{ref:i,className:j("[&_tr]:border-b",e),...s}));Q.displayName="TableHeader";const D=d.forwardRef(({className:e,...s},i)=>t.jsx("tbody",{ref:i,className:j("[&_tr:last-child]:border-0",e),...s}));D.displayName="TableBody";const Ke=d.forwardRef(({className:e,...s},i)=>t.jsx("tfoot",{ref:i,className:j("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...s}));Ke.displayName="TableFooter";const N=d.forwardRef(({className:e,...s},i)=>t.jsx("tr",{ref:i,className:j("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...s}));N.displayName="TableRow";const f=d.forwardRef(({className:e,...s},i)=>t.jsx("th",{ref:i,className:j("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...s}));f.displayName="TableHead";const x=d.forwardRef(({className:e,...s},i)=>t.jsx("td",{ref:i,className:j("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...s}));x.displayName="TableCell";const Ge=d.forwardRef(({className:e,...s},i)=>t.jsx("caption",{ref:i,className:j("mt-4 text-sm text-muted-foreground",e),...s}));Ge.displayName="TableCaption";const He=A({method:"GET"}).middleware([K]).handler(B("8deb319d6c5187aaa5ffb4c2a66bc883aafa7135708823205c5fd94db8aa7e5c")),We=A({method:"POST"}).middleware([K]).handler(B("49c0850e74d32edee67ae168c6bcbe7b35f01b18009bf8
1054524fa17950fbae6")),E=e=>e?new Date(e).toLocaleString("en-GB"):"—";function qe(){const e=P(He),s=P(We),i=$(),{data:r,isLoading:n,error:l}=pe({queryKey:["index-status"],queryFn:()=>e()}),a=ge({mutationFn:()=>s({data:void 0}),onSuccess:o=>{i.invalidateQueries({queryKey:["index-status"]}),q.success(`Rechecked ${o.checked} pages — ${o.indexed} indexed, ${o.failing} not indexed`+(o.changes>0?`, ${o.changes} change(s) recorded`:"")),o.errors.length>0&&q.warning(`${o.errors.length} page(s) could not be checked`)},onError:o=>q.error(o.message)}),u=r?.pages??[],b=u.filter(o=>o.is_indexed),m=u.filter(o=>!o.is_indexed),c=u.reduce((o,h)=>!o||h.last_checked_at>o?h.last_checked_at:o,null);return t.jsxs("section",{className:"mt-16 border-t border-border pt-12",children:[t.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-light tracking-wide",children:"Indexing alerts"}),t.jsxs("p",{className:"mt-2 text-sm text-muted-foreground font-light",children:["Important pages are checked daily. You are emailed whenever a page becomes indexed or starts failing indexing.",c?` Last checked ${E(c)}.`:""]})]}),t.jsx(Z,{onClick:()=>a.mutate(),disabled:a.isPending,className:"min-h-[48px]",children:a.isPending?"Rechecking all pages…":"Recheck all important pages now"})]}),a.isPending&&t.jsx("p",{className:"mt-4 text-sm text-muted-foreground font-light",children:"Asking Google for the live index status of every important page — this takes up to a minute."}),a.isError&&t.jsx("p",{className:"mt-4 text-sm text-destructive font-light",children:a.error.message}),a.isSuccess&&!a.isPending&&t.jsxs("p",{className:"mt-4 text-sm text-muted-foreground font-light",children:["Checked ",a.data.checked," pages · ",a.data.indexed," ","indexed · ",a.data.failing," not indexed ·"," ",a.data.changes," change(s) recorded.",a.data.errors.length>0?` Could not check: ${a.data.errors.join("; ")}`:""]}),n&&t.jsx("p",{className:"mt-6 text-sm text-muted-foreground font-light",children:"Loading indexing status…"}),l&&t.jsx("p",{className:"mt-6 text-sm text-destructive font-light",children:l.message}),u.length===0&&!n&&t.jsx("p",{className:"mt-6 text-sm text-muted-foreground font-light",children:"No indexing data stored yet. Use “Recheck all important pages now” to run the first sweep."}),u.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mt-8 grid gap-4 sm:grid-cols-3",children:[t.jsx(V,{label:"Pages monitored",value:String(u.length)}),t.jsx(V,{label:"Indexed",value:String(b.length)}),t.jsx(V,{label:"Not indexed",value:String(m.length)})]}),t.jsx("h3",{className:"mt-12 text-xs uppercase tracking-[0.25em] text-gold",children:"Recent status changes"}),r&&r.events.length===0?t.jsx("p",{className:"mt-4 text-sm text-muted-foreground font-light",children:"No status changes recorded yet."}):t.jsx("div",{className:"mt-4 overflow-x-auto",children:t.jsxs(F,{children:[t.jsx(Q,{children:t.jsxs(N,{children:[t.jsx(f,{children:"When"}),t.jsx(f,{children:"Page"}),t.jsx(f,{children:"Change"}),t.jsx(f,{children:"Detail"}),t.jsx(f,{children:"Alert"})]})}),t.jsx(D,{children:(r?.events??[]).map((o,h)=>t.jsxs(N,{children:[t.jsx(x,{className:"whitespace-nowrap text-xs",children:E(o.created_at)}),t.jsx(x,{className:"max-w-[220px] truncate",children:o.label??o.url}),t.jsx(x,{children:t.jsx("span",{className:o.kind==="indexed"?"text-gold":"text-destructive",children:o.kind==="indexed"?"Now indexed":"Failing"})}),t.jsx(x,{className:"max-w-[320px] text-xs font-light",children:o.detail??"—"}),t.jsx(x,{className:"text-xs font-light",children:o.alert_sent?"Emailed":o.alert_notes??"Not sent"})]},`${o.url}-${o.created_at}-${h}`))})]})}),t.jsx("h3",{className:"mt-12 text-xs uppercase tracking-[0.25em] text-gold",children:"Current status by page"}),t.jsx("div",{className:"mt-4 overflow-x-auto",children:t.jsxs(F,{children:[t.jsx(Q,{children:t.jsxs(N,{children:[t.jsx(f,{children:"Page"}),t.jsx(f,{children:"Status"}),t.jsx(f,{children:"Google coverage"}),t.jsx(f,{children:"Last crawled"}),t.jsx(f,{children:"Checked"})]})}),t.jsx(D,{children:u.map(o=>t.jsxs(N,{children:[t.jsx(x,{className:"max-w-[240px]",children:t.jsx("a",{href:o.url,className:"underline underline-offset-4",target:"_blank",rel:"noreferrer",children:o.label??o.url})}),t.jsx(x,{className:o.is_indexed?"text-gold":"text-destructive",children:o.is_indexed?"Indexed":"Not indexed"}),t.jsx(x,{className:"max-w-[280px] text-xs font-light",children:o.coverage_state??"—"}),t.jsx(x,{className:"whitespace-nowrap text-xs",children:E(o.last_crawl_time)}),t.jsx(x,{className:"whitespace-nowrap text-xs",children:E(o.last_checked_at)})]},o.url))})]})})]})]})}function V({label:e,value:s}){return t.jsxs("div",{className:"rounded-lg border border-border p-6",children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground",children:e}),t.jsx("p",{className:"mt-3 text-3xl font-light",children:s})]})}const be=e=>`${(e*100).toFixed(2)}%`,U=e=>
1e.toLocaleString("en-GB");function Je(){const e=P(Be),s=P(Ae),i=$(),{data:r,isLoading:n,error:l}=pe({queryKey:["search-console-dashboard"],queryFn:()=>e()}),a=ge({mutationFn:()=>s({data:void 0}),onSuccess:()=>i.invalidateQueries({queryKey:["search-console-dashboard"]})});return t.jsx("main",{className:"min-h-screen px-6 py-16 md:px-10",children:t.jsxs("div",{className:"mx-auto max-w-6xl",children:[t.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.3em] text-gold",children:"Admin"}),t.jsx("h1",{className:"mt-2 text-3xl font-light tracking-wide",children:"Search Console performance"}),r?.configured&&t.jsxs("p",{className:"mt-2 text-sm text-muted-foreground font-light",children:[r.site_url," · ",r.range_start," → ",r.range_end,r.captured_at?` · updated ${new Date(r.captured_at).toLocaleString("en-GB")}`:""]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Z,{variant:"outline",onClick:()=>a.mutate(),disabled:a.isPending,children:a.isPending?"Refreshing…":"Refresh now"}),t.jsx(Z,{variant:"ghost",onClick:async()=>{await Re.auth.signOut(),i.clear()},children:"Sign out"})]})]}),a.isError&&t.jsx("p",{className:"mt-6 text-sm text-destructive font-light",children:a.error.message}),n&&t.jsx("p",{className:"mt-10 text-sm text-muted-foreground font-light",children:"Loading performance data…"}),l&&t.jsx("p",{className:"mt-10 text-sm text-destructive font-light",children:l.message}),r&&!r.configured&&t.jsx("p",{className:"mt-10 text-sm text-muted-foreground font-light",children:"No snapshot stored yet. Use “Refresh now” to pull the latest 28 days from Google Search Console."}),r?.configured&&t.jsxs(t.Fragment,{children:[t.jsxs("section",{className:"mt-10 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[t.jsx(T,{label:"Clicks",value:U(r.totals.clicks)}),t.jsx(T,{label:"Impressions",value:U(r.totals.impressions)}),t.jsx(T,{label:"CTR",value:be(r.totals.ctr)}),t.jsx(T,{label:"Avg. position",value:r.totals.position.toFixed(1)})]}),t.jsx(Ve,{daily:r.daily}),t.jsx(z,{title:"Daily performance",children:t.jsx(Y,{rows:r.daily,label:"Date"})}),t.jsx(z,{title:"Query trends",children:t.jsx(Y,{rows:r.queries.slice(0,50),label:"Query"})}),t.jsx(z,{title:"Pages",children:t.jsx(Y,{rows:r.pages.slice(0,50),label:"Page",isUrl:!0})})]}),t.jsx(qe,{}),t.jsxs("p",{className:"mt-16 text-xs text-muted-foreground font-light",children:["Data is a cached Search Console snapshot (delayed by ~3 days; low volume rows may be omitted)."," ",t.jsx(Se,{to:"/",className:"text-gold underline underline-offset-4",children:"Back to the website"})]})]})})}function T({label:e,value:s}){return t.jsxs("div",{className:"rounded-lg border border-border p-6",children:[t.jsx("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground",children:e}),t.jsx("p",{className:"mt-3 text-3xl font-light",children:s})]})}function z({title:e,children:s}){return t.jsxs("section",{className:"mt-14",children:[t.jsx("h2",{className:"text-lg font-light tracking-wide",children:e}),t.jsx("div",{className:"mt-4 overflow-x-auto rounded-lg border border-border",children:s})]})}function Ve({daily:e}){if(e.length<2)return null;const s=1e3,i=180,r=Math.max(...e.map(a=>a.impressions),1),n=Math.max(...e.map(a=>a.clicks),1),l=(a,u)=>a.map((b,m)=>{const c=m/(a.length-1)*s,o=i-b/u*(i-10)-5;return`${m===0?"M":"L"}${c.toFixed(1)},${o.toFixed(1)}`}).join(" ");return t.jsxs("section",{className:"mt-12 rounded-lg border border-border p-6",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-lg font-light tracking-wide",children:"Daily trend"}),t.jsx("p",{className:"text-xs text-muted-foreground font-light",children:"Gold = impressions · muted = clicks"})]}),t.jsxs("svg",{viewBox:`0 0 ${s} ${i}`,className:"mt-6 h-44 w-full",role:"img","aria-label":"Daily impressions and clicks trend",preserveAspectRatio:"none",children:[t.jsx("path",{d:l(e.map(a=>a.impressions),r),fill:"none",stroke:"hsl(var(--gold, 43 74% 52%))",strokeWidth:"2"}),t.jsx("path",{d:l(e.map(a=>a.clicks),n),fill:"none",stroke:"currentColor",className:"text-muted-foreground",strokeWidth:"1.5",strokeDasharray:"4 4"})]}),t.jsxs("div",{className:"mt-2 flex justify-between text-xs text-muted-foreground font-light",children:[t.jsx("span",{children:e[0].dim_value}),t.jsx("span",{children:e[e.length-1].dim_value})]})]})}function Y({rows:e,label:s,isUrl:i=!1}){return e.length===0?t.jsx("p",{className:"p-6 text-sm text-muted-foreground font-light",children:"No rows reported for this period."}):t.jsxs(F,{children:[t.jsx(Q,{children:t.jsxs(N,{children:[t.jsx(f,{children:s}),t.jsx(f,{className:"text-right",children:"Clicks"}),t.jsx(f,{className:"text-right",children:"Impressions"}),t.jsx(f,{className:"text-right",children:"CTR"}),t.jsx(f,{className:"text-right",children:"Avg. position"})]})}),t.jsx(D,{children:e.map(r=>
1t.jsxs(N,{children:[t.jsx(x,{className:"max-w-[380px] truncate font-light",children:i?t.jsx("a",{href:r.dim_value,target:"_blank",rel:"noreferrer",className:"text-gold underline underline-offset-4",children:r.dim_value.replace("https://dawnmcgruer.com","")||"/"}):r.dim_value}),t.jsx(x,{className:"text-right",children:U(r.clicks)}),t.jsx(x,{className:"text-right",children:U(r.impressions)}),t.jsx(x,{className:"text-right",children:be(r.ctr)}),t.jsx(x,{className:"text-right",children:r.position.toFixed(1)})]},`${r.dimension}-${r.dim_value}`))})]})}export{Je as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.