PageSourceSearch

https://www.poolrentalnearme.com/fw-assets/admin.rank-tracker-CI2xPD3V.js

js poolrentalnearme.com collected 2026-10-04 15:18:45 UTC 6,126 bytes, 1 lines download raw bytes

1import{ac as j,r as s,j as e}from"./index-C_-MLoF4.js";import{b as T,c as C,r as f,d as S}from"./admin-weapons.functions-DVbiQNYk.js";import{A as R,T as y}from"./admin-layout-lSmCQPI5.js";import{P as $}from"./plus-tThLJlsD.js";import{L}from"./loader-circle-D67_jK1d.js";import{R as E}from"./refresh-cw-F8LIToXc.js";import{T as K}from"./trash-2-DnrUn_5V.js";import"./admin-tools.functions-CHVECwI4.js";import"./circle-check-kT-tUnzh.js";import"./circle-alert-BzsWcawb.js";import"./x-DdcmrPJs.js";import"./house-BQF1CyUN.js";import"./network-sGsrGOpa.js";import"./sparkles-DUoTQ644.js";import"./graduation-cap-XLRV_xjM.js";import"./triangle-alert-Wmdy96vD.js";import"./mail-Dr0vUg07.js";import"./bell-BokINSEb.js";import"./share-2-Ni8DI3CA.js";import"./shield-check-CBem69TM.js";const A=[["path",{d:"M5 12h14",key:"1ays0h"}]],g=j("minus",A);const M=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],P=j("trending-down",M);function re(){const[i,b]=s.useState([]),[c,m]=s.useState(""),[x,p]=s.useState(""),[n,l]=s.useState(null),[u,d]=s.useState(null),r=s.useCallback(async()=>{const t=await T();b(t.rows)},[]);s.useEffect(()=>{r()},[r]);async function k(){if(!c.trim())return;const t=await C({data:{keyword:c.trim(),target_url_path:x.trim()||void 0}});t.ok?(m(""),p(""),await r()):d(t.error)}async function w(){l("all"),d(null);try{const t=await f({data:{limit:20}});if(t?.ok===!1){d(`Error: ${t.error}`);return}const o=(t.results||[]).filter(a=>a.position!=null).length,h=(t.results||[]).filter(a=>a.error).slice(0,2).map(a=>`${a.keyword}: ${a.error}`).join(" | ");d(`Checked ${t.results?.length??0} keywords, ${o} ranked.${h?" "+h:""}`),await r()}finally{l(null)}}async function N(t){l(t);try{await f({data:{id:t}}),await r()}finally{l(null)}}async function v(t){confirm("Stop tracking this keyword?")&&(await S({data:{id:t}}),await r())}function _(t,o){return t==null||o==null?e.jsx(g,{className:"h-3.5 w-3.5 text-muted-foreground"}):t<o?e.jsx(y,{className:"h-3.5 w-3.5 text-emerald-600"}):t>o?e.jsx(P,{className:"h-3.5 w-3.5 text-destructive"}):e.jsx(g,{className:"h-3.5 w-3.5 text-muted-foreground"})}return e.jsxs(R,{title:"Rank Tracker",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("h1",{className:"flex items-center gap-2 text-2xl font-bold sm:text-3xl",children:[e.jsx(y,{className:"h-6 w-6 text-primary"})," SERP Rank Tracker"]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Daily Google position checks for your priority keywords. Win/loss arrows show movement since the last check."})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[e.jsx("p",{className:"text-sm font-semibold",children:"Track a new keyword"}),e.jsxs("div",{className:"mt-2 grid gap-2 sm:grid-cols-3",children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"pool rental austin",className:"rounded-lg border border-border bg-background px-3 py-2 text-sm sm:col-span-2"}),e.jsx("input",{value:x,onChange:t=>p(t.target.value),placeholder:"/p/austin-tx (optional)",className:"rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono"}),e.jsxs("button",{onClick:k,className:"inline-flex items-center justify-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground sm:col-span-3",children:[e.jsx($,{className:"h-4 w-4"})," Add keyword"]})]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsxs("h2",{className:"text-lg font-bold",children:["Tracked keywords (",i.length,")"]}),e.jsxs("button",{onClick:w,disabled:n==="all",className:"inline-flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground disabled:opacity-50",children:[n==="all"?e.jsx(L,{className:"h-4 w-4 animate-spin"}):e.jsx(E,{className:"h-4 w-4"}),"Check 20 oldest"]})]}),u&&e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:u}),e.jsx("div",{className:"mt-3 overflow-hidden rounded-2xl border border-border bg-card",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted text-xs uppercase text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 text-left",children:"Keyword"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Target"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Now"}),e.jsx("th",{className:"px-3 py-2 text-center",children:"Prev"}),e.jsx("th",{className:"px-3 py-2 text-left",children:"Last check"}),e.jsx("th",{className:"px-3 py-2"})]})}),e.jsxs("tbody",{className:"divide-y divide-border",children:[i.map(t=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 font-medium",children:t.keyword}),e.jsx("td",{className:"px-3 py-2 font-mono text-xs text-muted-foreground",children:t.target_url_path||"—"}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[_(t.last_position,t.previous_position),e.jsx("span",{className:`font-bold ${t.last_position==null?"text-muted-foreground":t.last_position<=3?"text-emerald-600":t.last_position<=10?"text-foreground":"text-muted-foreground"}`,children:t.last_position??"—"})]})}),e.jsx("td",{className:"px-3 py-2 text-center text-xs text-muted-foreground",children:t.previous_position??"—"}),e.jsx("td",{className:"px-3 py-2 text-xs text-muted-foreground",children:t.last_checked_at?new Date(t.last_checked_at).toLocaleStr
1ing():"never"}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.jsx("button",{onClick:()=>N(t.id),disabled:n===t.id,className:"rounded-full bg-secondary px-2.5 py-1 text-xs font-semibold disabled:opacity-50",children:n===t.id?"…":"Recheck"}),e.jsx("button",{onClick:()=>v(t.id),className:"rounded-full border border-border p-1.5 text-destructive",children:e.jsx(K,{className:"h-3 w-3"})})]})})]},t.id)),i.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"p-8 text-center text-sm text-muted-foreground",children:"No keywords tracked yet."})})]})]})})]})}export{re 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.