PageSourceSearch

https://marshallatkinson.com/assets/AdminSEO-DrHmib8G.js

js marshallatkinson.com collected 2026-10-09 18:17:41 UTC 33,591 bytes, 1 lines download raw bytes

1import{R as v,p as oe,r as b,j as e,b as I,L as Y}from"./index-DGkLpluX.js";import{A as pe}from"./AdminLayout-D5HLJA4k.js";import{f as F,L as V,K as W,n as G,C as U,A as he,l as T,h as se,M as fe,m as ae,y as ge,o as be,u as ye,i as X,G as ve,j as re,z as ne,D as je,B as Ne,X as ce,Y as q,F as ke,R as we,I as Ae}from"./generateCategoricalChart--7ZEz5Ni.js";import{C as Se}from"./CartesianGrid-DwzKguRy.js";import"./users-2dRIhlyG.js";import"./clipboard-list-Cd478zZV.js";import"./youtube-C_FTWmy9.js";import"./video-CgL_0JV6.js";import"./log-out-0XKQ889s.js";import"./isEqual-lENM9kF_.js";var Pe=["layout","type","stroke","connectNulls","isRange","ref"],Ce=["key"],de;function M(t){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},M(t)}function xe(t,a){if(t==null)return{};var r=Oe(t,a),s,n;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(n=0;n<c.length;n++)s=c[n],!(a.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(t,s)&&(r[s]=t[s])}return r}function Oe(t,a){if(t==null)return{};var r={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(a.indexOf(s)>=0)continue;r[s]=t[s]}return r}function D(){return D=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var r=arguments[a];
vendor: 8,080 bytes, line 1
1for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},D.apply(this,arguments)}function ie(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);a&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,s)}return r}function R(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?ie(Object(r),!0).forEach(function(s){O(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function _e(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function le(t,a){for(var r=0;r<a.length;r++){var s=a[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,ue(s.key),s)}}function Le(t,a,r){return a&&le(t.prototype,a),r&&le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ee(t,a,r){return a=K(a),Re(t,me()?Reflect.construct(a,r||[],K(t).constructor):a.apply(t,r))}function Re(t,a){if(a&&(M(a)==="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return De(t)}function De(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function me(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(me=function(){return!!t})()}function K(t){return K=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},K(t)}function Ie(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),a&&Q(t,a)}function Q(t,a){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},Q(t,a)}function O(t,a,r){return a=ue(a),a in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}function ue(t){var a=Fe(t,"string");return M(a)=="symbol"?a:a+""}function Fe(t,a){if(M(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,a);if(M(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var L=(function(t){function a(){var r;_e(this,a);for(var s=arguments.length,n=new Array(s),c=0;c<s;c++)n[c]=arguments[c];return r=Ee(this,a,[].concat(n)),O(r,"state",{isAnimationFinished:!0}),O(r,"id",ye("recharts-area-")),O(r,"handleAnimationEnd",function(){var l=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),X(l)&&l()}),O(r,"handleAnimationStart",function(){var l=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),X(l)&&l()}),r}return Ie(a,t),Le(a,[{key:"renderDots",value:function(s,n,c){var l=this.props.isAnimationActive,i=this.state.isAnimationFinished;if(l&&!i)return null;var d=this.props,x=d.dot,p=d.points,m=d.dataKey,f=F(this.props,!1),h=F(x,!0),g=p.map(function(k,S){var w=R(R(R({key:"dot-".concat(S),r:3},f),h),{},{index:S,cx:k.x,cy:k.y,dataKey:m,value:k.value,payload:k.payload,points:p});return a.renderDotItem(x,w)}),A={clipPath:s?"url(#clipPath-".concat(n?"":"dots-").concat(c,")"):null};return v.createElement(V,D({className:"recharts-area-dots"},A),g)}},{key:"renderHorizontalRect",value:function(s){var n=this.props,c=n.baseLine,l=n.points,i=n.strokeWidth,d=l[0].x,x=l[l.length-1].x,p=s*Math.abs(d-x),m=W(l.map(function(f){return f.y||0}));return G(c)&&typeof c=="number"?m=Math.max(c,m):c&&Array.isArray(c)&&c.length&&(m=Math.max(W(c.map(function(f){return f.y||0})),m)),G(m)?v.createElement("rect",{x:d<x?d:d-p,y:0,width:p,height:Math.floor(m+(i?parseInt("".concat(i),10):1))}):null}},{key:"renderVerticalRect",value:function(s){var n=this.props,c=n.baseLine,l=n.points,i=n.strokeWidth,d=l[0].y,x=l[l.length-1].y,p=s*Math.abs(d-x),m=W(l.map(function(f){return f.x||0}));return G(c)&&typeof c=="number"?m=Math.max(c,m):c&&Array.isArray(c)&&c.length&&(m=Math.max(W(c.map(function(f){return f.x||0})),m)),G(m)?v.createElement("rect",{x:0,y:d<x?d:d-p,width:m+(i?parseInt("".concat(i),10):1),height:Math.floor(p)}):null}},{key:"renderClipRect",value:function(s){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(s):this.renderHorizontalRect(s)}},{key:"renderAreaStatically",value:function(s,n,c,l){var i=this.props,d=i.layout,x=i.type,p=i.stroke,m=i.connectNulls,f=i.isRange;i.ref;var h=xe(i,Pe);return v.createElement(V,{clipPath:c?"url(#clipPath-".concat(l,")"):null},v.createElement(U,D({},F(h,!0),{points:s,connectNulls:m,type:x,baseLine:n,layout:d,stroke:"none",className:"recharts-area-area"})),p!=="none"&&v.createElement(U,D({},F(this.props,!1),{className:"recharts-area-curve",layout:d,type:x,connectNulls:m,fill:"none",points:s})),p!=="none"&&f&&v.createElement(U,D({},F(this.props,!1),{className:"recharts-area-curve",layout:d,type:x,connectNulls:m,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(s,n){var c=this,l=this.props,i=l.points,d=l.baseLine,x=l.isAnimationActive,p=l.animationBegin,m=l.animationDuration,f=l.animationEasing,h=l.animationId,g=this.state,A=g.prevPoints,k=g.prevBaseLine;return v.createElement(he,{begin:p,duration:m,isActive:x,easing:f,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(A){var P=A.length/i.length,y=i.map(function(N,C){var _=Math.floor(C*P);if(A[_]){var E=A[_],B=T(E.x,N.x),z=T(E.y,N.y);return R(R({},N),{},{x:B(w),y:z(w)})}return N}),o;if(G(d)&&typeof d=="number"){var u=T(k,d);o=u(w)}else if(se(d)||fe(d)){var j=T(k,0);o=j(w)}else o=d.map(function(N,C){var _=Math.floor(C*P);if(k[_]){var E=k[_],B=T(E.x,N.x),z=T(E.y,N.y);return R(R({},N),{},{x:B(w),y:z(w)})}return N});return c.renderAreaStatically(y,o,s,n)}return v.createElement(V,null,v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(n)},c.renderClipRect(w))),v.createElement(V,{clipPath:"url(#animationClipPath-".concat(n,")")},c.renderAreaStatically(i,d,s,n)))})}},{key:"renderArea",value:function(s,n){var c=this.props,l=c.points,i=c.baseLine,d=c.isAnimationActive,x=this.state,p=x.prevPoints,m=x.prevBaseLine,f=x.totalLength;return d&&l&&l.length&&(!p&&f>0||!ae(p,l)||!ae(m,i))?this.renderAreaWithAnimation(s,n):this.renderAreaStatically(l,i,s,n)}},{key:"render",value:function(){var s,n=this.props,c=n.hide,l=n.dot,i=n.points,d=n.className,x=n.top,p=n.left,m=n.xAxis,f=n.yAxis,h=n.width,g=n.height,A=n.isAnimationActive,k=n.id;if(c||!i||!i.length)return null;var S=this.state.isAnimationFinished,w=i.length===1,P=oe("recharts-area",d),y=m&&m.allowDataOverflow,o=f&&f.allowDataOverflow,u=y||o,j=se(k)?this.id:k,N=(s=F(l,!1))!==null&&s!==void 0?s:{r:3,strokeWidth:2},C=N.r,_=C===void 0?3:C,E=N.strokeWidth,B=E===void 0?2:E,z=ge(l)?l:{},ee=z.clipDot,te=ee===void 0?!0:ee,$=_*2+B;return v.createElement(V,{className:P},y||o?v.createElement("defs",null,v.createElement("clipPath",{id:"clipPath-".concat(j)},v.createElement("rect",{x:y?p:p-h/2,y:o?x:x-g/2,width:y?h:h*2,height:o?g:g*2})),!te&&v.createElement("clipPath",{id:"clipPath-dots-".concat(j)},v.createElement("rect",{x:p-$/2,y:x-$/2,width:h+$,height:g+$}))):null,w?null:this.renderArea(u,j),(l||w)&&this.renderDots(u,te,j),(!A||S)&&be.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(s,n){return s.animationId!==n.prevAnimationId?{prevAnimationId:s.animationId,curPoints:s.points,curBaseLine:s.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:s.points!==n.curPoints||s.baseLine!==n.curBaseLine?{curPoints:s.points,curBaseLine:s.baseLine}:null}}])})(b.PureComponent);de=L;O(L,"displayName","Area");O(L,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendT
1ype:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ve.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});O(L,"getBaseValue",function(t,a,r,s){var n=t.layout,c=t.baseValue,l=a.props.baseValue,i=l??c;if(G(i)&&typeof i=="number")return i;var d=n==="horizontal"?s:r,x=d.scale.domain();if(d.type==="number"){var p=Math.max(x[0],x[1]),m=Math.min(x[0],x[1]);return i==="dataMin"?m:i==="dataMax"||p<0?p:Math.max(Math.min(x[0],x[1]),0)}return i==="dataMin"?x[0]:i==="dataMax"?x[1]:x[0]});O(L,"getComposedData",function(t){var a=t.props,r=t.item,s=t.xAxis,n=t.yAxis,c=t.xAxisTicks,l=t.yAxisTicks,i=t.bandSize,d=t.dataKey,x=t.stackedData,p=t.dataStartIndex,m=t.displayedData,f=t.offset,h=a.layout,g=x&&x.length,A=de.getBaseValue(a,r,s,n),k=h==="horizontal",S=!1,w=m.map(function(y,o){var u;g?u=x[p+o]:(u=re(y,d),Array.isArray(u)?S=!0:u=[A,u]);var j=u[1]==null||g&&re(y,d)==null;return k?{x:ne({axis:s,ticks:c,bandSize:i,entry:y,index:o}),y:j?null:n.scale(u[1]),value:u,payload:y}:{x:j?null:s.scale(u[1]),y:ne({axis:n,ticks:l,bandSize:i,entry:y,index:o}),value:u,payload:y}}),P;return g||S?P=w.map(function(y){var o=Array.isArray(y.value)?y.value[0]:null;return k?{x:y.x,y:o!=null&&y.y!=null?n.scale(o):null}:{x:o!=null?s.scale(o):null,y:y.y}}):P=k?n.scale(A):s.scale(A),R({points:w,baseLine:P,layout:h,isRange:S},f)});O(L,"renderDotItem",function(t,a){var r;if(v.isValidElement(t))r=v.cloneElement(t,a);else if(X(t))r=t(a);else{var s=oe("recharts-area-dot",typeof t!="boolean"?t.className:""),n=a.key,c=xe(a,Ce);r=v.createElement(je,D({},c,{key:n,className:s}))}return r});var Te=Ne({chartName:"AreaChart",GraphicalChild:L,axisComponents:[{axisType:"xAxis",AxisComp:ce},{axisType:"yAxis",AxisComp:q}],formatAxisMap:ke});function Ge(){const[t,a]=b.useState(""),[r,s]=b.useState(!1),[n,c]=b.useState(null);async function l(){if(!t.trim())return;s(!0),c(null);const d=await I.functions.invoke("purgeCacheForContent",{path:t.trim()});c(d.data),s(!1)}const i=(n==null?void 0:n.ok)===!0;return e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-1",children:"Hado SEO — Manual Cache Purge"}),e.jsxs("p",{className:"text-xs text-slate-400 mb-4",children:["Enter a path (e.g. ",e.jsx("code",{className:"bg-slate-100 px-1 rounded",children:"/library/some-slug"}),") and send a purge request to the Hado API."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("input",{type:"text",value:t,onChange:d=>a(d.target.value),onKeyDown:d=>d.key==="Enter"&&l(),placeholder:"/library/some-slug",className:"flex-1 border border-slate-200 rounded-md px-3 py-2 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-orange-400"}),e.jsx("button",{onClick:l,disabled:r||!t.trim(),className:"px-5 py-2 text-sm font-semibold bg-orange-500 text-white rounded-md hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:r?"Purging…":"Purge Cache"})]}),n&&e.jsxs("div",{className:`mt-4 rounded-md p-4 text-xs font-mono whitespace-pre-wrap break-all border ${i?"bg-green-50 border-green-200 text-green-800":"bg-red-50 border-red-200 text-red-800"}`,children:[e.jsxs("div",{className:"font-semibold mb-1 text-sm",children:[i?"✓ Purge queued":"✗ Purge failed"," — HTTP ",n.status]}),JSON.stringify(n.response,null,2)]})]})}function J(){return e.jsx("div",{className:"w-4 h-4 border-2 border-slate-200 border-t-orange-500 rounded-full animate-spin"})}function Z({title:t,note:a,children:r}){return e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-1",children:t}),a&&e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:a}),r]})}function Me(){const[t,a]=b.useState(null),[r,s]=b.useState(!1),[n,c]=b.useState(null);async function l(){s(!0),c(null);try{const i=await I.functions.invoke("getThinContentReport",{});a(i.data)}catch(i){c(i.message||"Failed to load")}finally{s(!1)}}
1return e.jsxs(Z,{title:"Thin Content",note:"Review flags, not auto-actions — some short pages are intentional.",children:[!t&&!r&&e.jsx("button",{onClick:l,className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-800",children:"Run thin-content check"}),r&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[e.jsx(J,{})," Checking…"]}),n&&!r&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded p-3 text-sm",children:n}),t&&!r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-sm",children:[e.jsxs("span",{className:"text-slate-600",children:["Scanned: ",e.jsx("b",{children:t.total_scanned})]}),e.jsxs("span",{className:"text-orange-600 font-medium",children:["Flagged: ",e.jsx("b",{children:t.flagged_count})]}),e.jsx("button",{onClick:l,className:"ml-auto px-3 py-1.5 text-xs font-medium bg-white border border-slate-200 rounded-md hover:bg-slate-50",children:"Re-run"})]}),t.flagged.length===0?e.jsx("p",{className:"text-sm text-green-600",children:"No thin content flagged — all published pages meet thresholds."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Title"}),e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Type"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Words"}),e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Flags"}),e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2",children:"Missing meta"})]})}),e.jsx("tbody",{children:t.flagged.map((i,d)=>e.jsxs("tr",{className:"border-b border-slate-50 hover:bg-slate-50",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx(Y,{to:`/library/${i.slug}`,className:"text-slate-800 font-medium hover:text-orange-600 truncate max-w-xs block",children:i.title})}),e.jsx("td",{className:"py-2 pr-4 text-slate-600",children:i.content_type}),e.jsx("td",{className:"py-2 pr-4 text-right text-slate-700",children:i.word_count}),e.jsx("td",{className:"py-2 pr-4 text-xs text-slate-500",children:i.reasons.join(", ").replace(/_/g," ")}),e.jsx("td",{className:"py-2 text-xs text-slate-500",children:[i.missing_meta_title&&"title",i.missing_meta_description&&"description"].filter(Boolean).join(", ")||"—"})]},d))})]})})]})]})}function Be(){const[t,a]=b.useState(null),[r,s]=b.useState(!1),[n,c]=b.useState(null);async function l(){s(!0),c(null);try{const i=await I.functions.invoke("getVisibilityGaps",{});a(i.data)}catch(i){c(i.message||"Failed to load")}finally{s(!1)}}return e.jsxs(Z,{title:"Search Visibility Gaps",note:"90-day Google Search Console data. Invisible = zero impressions; Deep = ranking past page 1.",children:[!t&&!r&&e.jsx("button",{onClick:l,className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-800",children:"Run visibility check"}),r&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[e.jsx(J,{})," Checking…"]}),n&&!r&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded p-3 text-sm",children:n}),t&&!r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-sm",children:[e.jsxs("span",{className:"text-slate-600",children:["Invisible: ",e.jsx("b",{className:"text-orange-600",children:t.invisible_count})]}),e.jsxs("span",{className:"text-slate-600",children:["Deep-ranking: ",e.jsx("b",{className:"text-amber-600",children:t.deep_ranking_count})]}),e.jsxs("span",{className:"text-slate-500 text-xs",children:["of ",t.total_published_library," published · ",t.total_pages_in_search," in search"]}),e.jsx("button",{onClick:l,className:"ml-auto px-3 py-1.5 text-xs font-medium bg-white border border-slate-200 rounded-md hover:bg-slate-50",children:"Re-run"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-xs font-semibold text-slate-700 uppercase tracking-wider mb-2",children:"Not surfaced by Google"}),t.invisible.length===0?e.jsx("p",{className:"text-sm text-green-600",children:"All published pages have impressions — nothing invisible."}):e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:t.invisible.map((i,d)=>{const x=i.url.replace("https://marshallatkinson.com","");return e.jsx(Y,{to:x,className:"block text-sm text-slate-700 hover:text-orange-600 truncate",children:x},d)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-semibold text-slate-700 uppercase tracking-wider mb-2",children:"Ranking deep — page 2+"}),t.deep_ranking.length===0?e.jsx("p",{className:"text-sm text-slate-400",children:"No pages ranking past position 20."}):e.jsx("div",{className:"overflow-x-auto max-h-64 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"sticky top-0 bg-white",children:e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"URL"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Imp"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Clicks"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2",children:"Pos"})]})}),e.jsx("tbody",{children:t.deep_ranking.map((i,d)=>{const x=i.url.replace("https://marshallatkinson.com","");return e.jsxs("tr",{className:"border-b border-slate-50 hover:bg-slate-50",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx(Y,{to:x,className:"text-slate-700 hover:text-orange-600 truncate max-w-xs block",children:x})}),e.jsx("td",{className:"py-1.5 pr-4 text-right text-slate-500",children:i.impressions.toLocaleStr
1ing()}),e.jsx("td",{className:"py-1.5 pr-4 text-right text-slate-600",children:i.clicks}),e.jsx("td",{className:"py-1.5 text-right text-amber-600 font-medium",children:i.position.toFixed(0)})]},d)})})]})})]})]})]})}function ze(){const[t,a]=b.useState([]),[r,s]=b.useState(null),[n,c]=b.useState(!0),[l,i]=b.useState(!1),[d,x]=b.useState(null);async function p(){c(!0);try{const h=await I.entities.LinkHealthCheck.list("-run_date",500);if(h.length===0){a([]),s(null);return}const g=h[0].run_date;s(g),a(h.filter(A=>A.run_date===g))}catch(h){x(h.message||"Failed to load")}finally{c(!1)}}b.useEffect(()=>{p()},[]);async function m(){i(!0),x(null);try{await I.functions.invoke("runLinkHealthCheck",{}),await p()}catch(h){x(h.message||"Run failed")}finally{i(!1)}}const f=t.filter(h=>!h.ok);return e.jsxs(Z,{title:"Link Health",note:"Checks live public URLs (prerendered by Hado). Weekly automated crawl; manual run below.",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-sm",children:[r&&e.jsxs("span",{className:"text-slate-500",children:["Last run: ",new Date(r).toLocaleString()]}),e.jsxs("span",{className:"text-slate-600",children:["Checked: ",e.jsx("b",{children:t.length})]}),e.jsxs("span",{className:"text-red-600 font-medium",children:["Broken: ",e.jsx("b",{children:f.length})]}),e.jsx("button",{onClick:m,disabled:l,className:"ml-auto px-4 py-2 text-sm font-medium bg-orange-500 text-white rounded-md hover:bg-orange-600 disabled:opacity-50",children:l?"Running…":"Run check now"})]}),n&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[e.jsx(J,{})," Loading…"]}),d&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded p-3 text-sm",children:d}),!n&&!d&&f.length===0&&e.jsx("p",{className:"text-sm text-green-600",children:"No broken links in the latest run — all checked URLs returned 200."}),!n&&f.length>0&&e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"URL"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2",children:"Status"})]})}),e.jsx("tbody",{children:f.map((h,g)=>e.jsxs("tr",{className:"border-b border-slate-50",children:[e.jsx("td",{className:"py-2 pr-4 text-slate-800 truncate max-w-md",children:e.jsx("a",{href:h.url,target:"_blank",rel:"noopener noreferrer",className:"hover:text-orange-600",children:h.url})}),e.jsx("td",{className:"py-2 text-right text-red-600 font-medium",children:h.status_code===0?"failed":h.status_code})]},g))})]})})]})}function Ve(){return e.jsxs(e.Fragment,{children:[e.jsx(Me,{}),e.jsx(Be,{}),e.jsx(ze,{})]})}const $e={usa:"United States",gbr:"United Kingdom",can:"Canada",aus:"Australia",deu:"Germany",fra:"France",ind:"India",bra:"Brazil",rus:"Russia",arg:"Argentina",col:"Colombia",mex:"Mexico",esp:"Spain",ita:"Italy",nld:"Netherlands",phl:"Philippines",zaf:"South Africa",nzl:"New Zealand"};function We(t){return $e[t==null?void 0:t.toLowerCase()]||(t||"").toUpperCase()}function H({label:t,value:a,sub:r,color:s="text-slate-900"}){return e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-5",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1",children:t}),e.jsx("div",{className:`text-3xl font-bold ${s}`,children:a}),r&&e.jsx("div",{className:"text-xs text-slate-400 mt-1",children:r})]})}function tt(){var P,y;const[t,a]=b.useState(null),[r,s]=b.useState(!0),[n,c]=b.useState(null),[l,i]=b.useState(28);b.useEffect(()=>{d()},[l]);async function d(){s(!0),c(null);try{const o=await I.functions.invoke("getSearchConsoleData",{days:l});a(o.data)}catch(o){c(o.message||"Failed to load data")}finally{s(!1)}}const x=((t==null?void 0:t.dailyData)||[]).map(o=>{var u;return{date:o.keys[0].slice(5),clicks:o.clicks,impressions:o.impressions,position:parseFloat((u=o.position)==null?void 0:u.toFixed(1))}}),p=(t==null?void 0:t.topQueries)||[],m=(t==null?void 0:t.topPages)||[],f=(t==null?void 0:t.devices)||[],h=(t==null?void 0:t.countries)||[],g=(t==null?void 0:t.totals)||{},[A,k]=b.useState([]);b.useEffect(()=>{I.entities.PageView.list("-created_date",500).then(k).catch(()=>{})},[]);const S=A.reduce((o,u)=>{const j=u.path||u.page_name||"unknown";return o[j]=(o[j]||0)+1,o},{}),w=Object.entries(S).sort((o,u)=>u[1]-o[1]).slice(0,10);return e.jsx(pe,{currentPage:"AdminSEO",children:e.jsxs("div",{className:"p-6 max-w-7xl mx-auto 
1space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"SEO & Search Performance"}),e.jsxs("p",{className:"text-sm text-slate-500 mt-1",children:["Google Search Console data for marshallatkinson.com",(t==null?void 0:t.period)&&` · ${t.period.startDate} → ${t.period.endDate}`]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[[7,28,90].map(o=>e.jsxs("button",{onClick:()=>i(o),className:`px-4 py-2 text-sm font-medium rounded-md transition-colors ${l===o?"bg-slate-900 text-white":"bg-white border border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:[o," days"]},o)),e.jsx("button",{onClick:d,className:"px-4 py-2 text-sm font-medium bg-orange-500 text-white rounded-md hover:bg-orange-600",children:"Refresh"})]})]}),n&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded-lg p-4 text-sm",children:n}),r?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-orange-500 rounded-full animate-spin"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(H,{label:"Total Clicks",value:((P=g.clicks)==null?void 0:P.toLocaleString())||0,sub:"from Google Search",color:"text-orange-600"}),e.jsx(H,{label:"Total Impressions",value:((y=g.impressions)==null?void 0:y.toLocaleString())||0,sub:"times shown in results"}),e.jsx(H,{label:"Avg CTR",value:`${((g.avgCtr||0)*100).toFixed(1)}%`,sub:"click-through rate",color:(g.avgCtr||0)>.03?"text-green-600":"text-slate-900"}),e.jsx(H,{label:"Avg Position",value:(g.avgPosition||0).toFixed(1),sub:"avg ranking position",color:(g.avgPosition||0)<10?"text-green-600":(g.avgPosition||0)<30?"text-amber-600":"text-red-500"})]}),x.length>0&&e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-4",children:"Clicks & Impressions Over Time"}),e.jsx(we,{width:"100%",height:220,children:e.jsxs(Te,{data:x,children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"impGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#94a3b8",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"#94a3b8",stopOpacity:0})]}),e.jsxs("linearGradient",{id:"clkGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#f97316",stopOpacity:.4}),e.jsx("stop",{offset:"95%",stopColor:"#f97316",stopOpacity:0})]})]}),e.jsx(Se,{strokeDasharray:"3 3",stroke:"#f1f5f9"}),e.jsx(ce,{dataKey:"date",tick:{fontSize:11}}),e.jsx(q,{yAxisId:"imp",orientation:"right",tick:{fontSize:11}}),e.jsx(q,{yAxisId:"clk",orientation:"left",tick:{fontSize:11}}),e.jsx(Ae,{}),e.jsx(L,{yAxisId:"imp",type:"monotone",dataKey:"impressions",stroke:"#94a3b8",fill:"url(#impGrad)",name:"Impressions"}),e.jsx(L,{yAxisId:"clk",type:"monotone",dataKey:"clicks",stroke:"#f97316",fill:"url(#clkGrad)",name:"Clicks"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-4",children:"Top Search Queries"}),e.jsxs("div",{className:"space-y-2",children:[p.slice(0,15).map((o,u)=>e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-slate-50 last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs text-slate-400 w-5 shrink-0",children:u+1}),e.jsx("span",{className:"text-sm text-slate-800 truncate",children:o.keys[0]})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0 ml-2",children:[e.jsxs("span",{className:"text-xs text-slate-500",title:"Impressions",children:[o.impressions.toLocaleString()," imp"]}),e.jsxs("span",{className:"text-xs font-semibold text-orange-600",title:"Clicks",children:[o.clicks," clicks"]}),e.jsxs("span",{className:"text-xs text-slate-400",title:"Avg Position",children:["#",o.position.toFixed(0)]})]})]},u)),p.length===0&&e.jsx("p",{className:"text-sm text-slate-400",children:"No query data yet."})]})]}),e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-4",children:"Top Pages (Google Search)"}),e.jsxs("div",{className:"space-y-2",children:[m.slice(0,15).map((o,u)=>{const j=o.keys[0].replace("https://marshallatkinson.com","");return e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-slate-50 last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs text-slate-400 w-
15 shrink-0",children:u+1}),e.jsx("span",{className:"text-sm text-slate-800 truncate",title:j,children:j||"/"})]}),e.jsxs("div",{className:"flex items-center gap-4 shrink-0 ml-2",children:[e.jsxs("span",{className:"text-xs text-slate-500",children:[o.impressions.toLocaleString()," imp"]}),e.jsxs("span",{className:"text-xs font-semibold text-orange-600",children:[o.clicks," clicks"]}),e.jsxs("span",{className:"text-xs text-slate-400",children:["#",o.position.toFixed(0)]})]})]},u)}),m.length===0&&e.jsx("p",{className:"text-sm text-slate-400",children:"No page data yet."})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-4",children:"Traffic by Device"}),e.jsx("div",{className:"space-y-3",children:f.map((o,u)=>{const j=f.reduce((C,_)=>C+_.impressions,0),N=j>0?(o.impressions/j*100).toFixed(0):0;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[e.jsx("span",{className:"capitalize text-slate-700",children:o.keys[0]}),e.jsxs("span",{className:"text-slate-500",children:[N,"% · ",o.clicks," clicks"]})]}),e.jsx("div",{className:"w-full bg-slate-100 rounded-full h-2",children:e.jsx("div",{className:"bg-orange-400 h-2 rounded-full",style:{width:`${N}%`}})})]},u)})})]}),e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-4",children:"Top Countries"}),e.jsx("div",{className:"space-y-2",children:h.map((o,u)=>e.jsxs("div",{className:"flex items-center justify-between py-1.5 border-b border-slate-50 last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-slate-400 w-5",children:u+1}),e.jsx("span",{className:"text-sm text-slate-800",children:We(o.keys[0])})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-xs text-slate-500",children:[o.impressions," imp"]}),e.jsxs("span",{className:"text-xs font-semibold text-orange-600",children:[o.clicks," clicks"]})]})]},u))})]})]}),e.jsx(Ge,{}),e.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg p-6",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-700 uppercase tracking-wider mb-1",children:"Internal Page Views vs. Google Search Traffic"}),e.jsx("p",{className:"text-xs text-slate-400 mb-4",children:"Internal = all visits tracked by this app (all sources) · GSC = visits from Google Search only"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-slate-100",children:[e.jsx("th",{className:"text-left text-xs text-slate-500 uppercase tracking-wider py-2 pr-4",children:"Page"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 px-4",children:"Internal Views"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 px-4",children:"GSC Impressions"}),e.jsx("th",{className:"text-right text-xs text-slate-500 uppercase tracking-wider py-2 pl-4",children:"GSC Clicks"})]})}),e.jsx("tbody",{children:w.map(([o,u],j)=>{const N=m.find(C=>C.keys[0].replace("https://marshallatkinson.com","")===o);return e.jsxs("tr",{className:"border-b border-slate-50 hover:bg-slate-50",children:[e.jsx("td",{className:"py-2 pr-4 text-slate-800 font-medium truncate max-w-xs",children:o||"/"}),e.jsx("td",{className:"py-2 px-4 text-right text-slate-600",children:u.toLocaleString()}),e.jsx("td",{className:"py-2 px-4 text-right text-slate-500",children:N?N.impressions.toLocaleString():"—"}),e.jsx("td",{className:"py-2 pl-4 text-right font-semibold text-orange-600",children:N?N.clicks:"—"})]},j)})})]})}),e.jsx("p",{className:"text-xs text-slate-400 mt-3",children:"Note: Internal views include direct links, social, email, and all other traffic sources — not just Google Search. A high internal view count with low GSC impressions means that page is getting traffic from non-search sources."})]}),e.jsx(Ve,{})]})]})})}export{tt as default};

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.