PageSourceSearch

https://keywestflorida.ai/assets/AdminDataAudit-B77pKurM.js

js keywestflorida.ai collected 2026-10-05 12:18:06 UTC 10,348 bytes, 1 lines download raw bytes

1import{r as D,b as g,j as e,C as o,K as d,N as c,c as u,w as m,L as S,s as f}from"./index-PtGACUVf.js";import{T as b,a as y,b as r,c as a,d as N,e as l}from"./table-BzCEyvEt.js";import{S as q,a as F,b as A,c as P,d as I}from"./select-BwSQ4ldD.js";import{S as k}from"./scroll-area-DNolq6ne.js";import{D as R}from"./database-DgpwkAuf.js";import{C as E}from"./circle-check-big-sSf7dLsd.js";import{C as H}from"./circle-x-D8wBAwq0.js";import{C as K}from"./circle-alert-zZK6adB6.js";import"./index-BdQq_4o_.js";import"./chevron-up-BZ1Up2zp.js";const O=[{field:"google_place_id",type:"text",populated:55601,total:55617,sample:null},{field:"latitude",type:"numeric",populated:55600,total:55617,sample:"-33.84824390"},{field:"longitude",type:"numeric",populated:55600,total:55617,sample:"-100.12454640"},{field:"rating",type:"numeric",populated:55581,total:55617,sample:"4.8"},{field:"google_category",type:"text",populated:55578,total:55617,sample:"Yoga studio"},{field:"review_count",type:"integer",populated:55561,total:55617,sample:"1657"},{field:"address",type:"text",populated:55205,total:55617,sample:"4225 Main St"},{field:"city",type:"text",populated:55071,total:55617,sample:"Dallas"},{field:"photos",type:"jsonb[]",populated:55033,total:55617,sample:"[{url, alt}]"},{field:"state",type:"text",populated:54497,total:55617,sample:"TX"},{field:"phone",type:"text",populated:52458,total:55617,sample:"(720) 679-8577"},{field:"website",type:"text",populated:48757,total:55617,sample:"https://..."},{field:"price_level",type:"integer",populated:12681,total:55617,sample:"1-4"},{field:"description",type:"text",populated:11415,total:55617,sample:null},{field:"hours",type:"jsonb",populated:0,total:55617,sample:null},{field:"open_state",type:"text",populated:45e3,total:55617,sample:"Open 24 hours"},{field:"service_dine_in",type:"boolean",populated:10020,total:55617,sample:"true (18%)"},{field:"service_takeout",type:"boolean",populated:7791,total:55617,sample:"true (14%)"},{field:"service_delivery",type:"boolean",populated:5035,total:55617,sample:"true (9%)"},{field:"service_curbside",type:"boolean",populated:2852,total:55617,sample:"true (5%)"},{field:"service_drive_through",type:"boolean",populated:377,total:55617,sample:"true (<1%)"},{field:"google_unclaimed",type:"boolean",populated:5866,total:55617,sample:"true (11%)"}].sort((i,p)=>p.populated/p.total-i.populated/i.total),U=[{table:"business_analytics",records:39060,uniqueBusinesses:25458,description:"Page views, clicks, impressions tracking"},{table:"business_mentions",records:150,uniqueBusinesses:57,description:"AI search mentions"},{table:"business_team_members",records:4,uniqueBusinesses:2,description:"Staff/team member profiles"},{table:"business_showcase",records:1,uniqueBusinesses:1,description:"Featured products/services"},{table:"business_deals",records:0,uniqueBusinesses:0,description:"Special offers and promotions"},{table:"business_leads",records:0,uniqueBusinesses:0,description:"Contact form submissions"},{table:"business_menus",records:0,uniqueBusinesses:0,description:"Menu PDFs and documents"},{table:"business_reports",records:0,uniqueBusinesses:0,description:"User-reported issues"}],Z=()=>{var w;const[i,p]=D.useState(""),{data:x,isLoading:C}=g({queryKey:["audit-businesses"],queryFn:async()=>{const{data:s,error:t}=await f.from("businesses").select("id, name, city, state").order("name").limit(500);if(t)throw t;return s}}),{data:v,isLoading:_}=g({queryKey:["audit-business",i],queryFn:async()=>{const{data:s,error:t}=await f.from("businesses").select("*").eq("id",i).single();if(t)throw t;return s},enabled:!!i}),{data:h}=g({queryKey:["audit-live-stats"],queryFn:async()=>{const{count:s}=await f.from("businesses").select("*",{count:"exact",head:!0});return{totalBusinesses:s}}}),B=s=>s>=90?"bg-green-500":s>=70?"bg-emerald-500":s>=50?"bg-yellow-500":s>=20?"bg-orange-500":"bg-red-500",T=s=>s==null?"NULL":typeof s=="object"?JSON.stringify(s).slice(0,100)+"...":typeof s=="string"&&s.length>100?s.slice(0,100)+"...":String(s),j=s=>s==null||typeof s=="string"&&s===""?!1:typeof s=="object"?Array.isArray(s)?s.length>0:Object.keys(s).length>0&&JSON.stringify(s)!=="{}":!0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Data Audit"}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:["Analyze data population from SerpAPI scrapes across ",((w=h==null?void 0:h.totalBusinesses)==null?void 0:w.toLocaleStr
1ing())||"55,617"," businesses"]})]}),e.jsxs(o,{children:[e.jsx(d,{children:e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(R,{className:"h-5 w-5"}),"Field Population Report"]})}),e.jsx(u,{children:e.jsxs(b,{children:[e.jsx(y,{children:e.jsxs(r,{children:[e.jsx(a,{children:"Field Name"}),e.jsx(a,{children:"Data Type"}),e.jsx(a,{className:"text-right",children:"Populated"}),e.jsx(a,{className:"text-right",children:"Percentage"}),e.jsx(a,{children:"Sample Value"})]})}),e.jsx(N,{children:O.map(s=>{const t=(s.populated/s.total*100).toFixed(1);return e.jsxs(r,{children:[e.jsx(l,{className:"font-mono text-sm",children:s.field}),e.jsx(l,{children:e.jsx(m,{variant:"outline",children:s.type})}),e.jsxs(l,{className:"text-right",children:[s.populated.toLocaleString()," / ",s.total.toLocaleString()]}),e.jsx(l,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("div",{className:"w-20 h-2 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full ${B(parseFloat(t))}`,style:{width:`${t}%`}})}),e.jsxs("span",{className:"w-14 text-right",children:[t,"%"]})]})}),e.jsx(l,{className:"font-mono text-xs text-muted-foreground max-w-[200px] truncate",children:s.sample||"-"})]},s.field)})})]})})]}),e.jsxs(o,{children:[e.jsx(d,{children:e.jsx(c,{children:"Service Flags & Boolean Fields"})}),e.jsx(u,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Dine In",value:10020,icon:"🍽️"},{label:"Takeout",value:7791,icon:"📦"},{label:"Delivery",value:5035,icon:"🚗"},{label:"Curbside",value:2852,icon:"🛻"},{label:"Drive Through",value:377,icon:"🚘"},{label:"Google Unclaimed",value:5866,icon:"⚠️"},{label:"Is Claimed",value:22,icon:"✅"},{label:"Is Featured",value:15,icon:"⭐"}].map(s=>e.jsxs("div",{className:"p-4 border rounded-lg",children:[e.jsx("div",{className:"text-2xl mb-1",children:s.icon}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s.label}),e.jsx("div",{className:"text-xl font-bold",children:s.value.toLocaleString()}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[(s.value/55617*100).toFixed(1),"% of businesses"]})]},s.label))})})]}),e.jsxs(o,{children:[e.jsx(d,{children:e.jsx(c,{children:"Related Tables with Business Data"})}),e.jsx(u,{children:e.jsxs(b,{children:[e.jsx(y,{children:e.jsxs(r,{children:[e.jsx(a,{children:"Table Name"}),e.jsx(a,{children:"Description"}),e.jsx(a,{className:"text-right",children:"Total Records"}),e.jsx(a,{className:"text-right",children:"Unique Businesses"})]})}),e.jsx(N,{children:U.map(s=>e.jsxs(r,{children:[e.jsx(l,{className:"font-mono text-sm",children:s.table}),e.jsx(l,{className:"text-muted-foreground",children:s.description}),e.jsx(l,{className:"text-right",children:s.records.toLocaleString()}),e.jsx(l,{className:"text-right",children:s.uniqueBusinesses.toLocaleString()})]},s.table))})]})})]}),e.jsxs(o,{children:[e.jsx(d,{children:e.jsx(c,{children:"Sample Business Deep Dive"})}),e.jsxs(u,{className:"space-y-4",children:[e.jsxs(q,{value:i,onValueChange:p,children:[e.jsx(F,{className:"w-full max-w-md",children:e.jsx(A,{placeholder:"Select a business to inspect..."})}),e.jsx(P,{children:C?e.jsx("div",{className:"p-2 text-center",children:e.jsx(S,{className:"h-4 w-4 animate-spin mx-auto"})}):x==null?void 0:x.map(s=>e.jsxs(I,{value:s.id,children:[s.name," - ",s.city,", ",s.state]},s.id))})]}),_&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(S,{className:"h-6 w-6 animate-spin"})}),v&&e.jsx(k,{className:"h-[500px] border rounded-lg",children:e.jsxs(b,{children:[e.jsx(y,{children:e.jsxs(r,{children:[e.jsx(a,{className:"w-[200px]",children:"Field"}),e.jsx(a,{className:"w-[80px]",children:"Status"}),e.jsx(a,{children:"Value"})]})}),e.jsx(N,{children:Object.entries(v).sort(([,s],[,t])=>{const n=j(s),L=j(t);return n===L?0:n?-1:1}).map(([s,t])=>{const n=j(t);return e.jsxs(r,{className:n?"":"opacity-50",children:[e.jsx(l,{className:"font-mono text-sm",children:s}),e.jsx(l,{children:n?e.jsx(E,{className:"h-4 w-4 text-green-500"}):e.jsx(H,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(l,{className:"font-mono text-xs max-w-[500px]",children:e.jsx("pre",{className:"whitespace-pre-wrap break-all",children:T(t)})})]},s)})})]})})]})]}),e.jsxs(o,{className:"border-primary/50 bg-primary/5",children:[e.jsx(d,{children:e.jsxs(c,{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-5 w-5"}),"Key Insights for Ungating"]})}),e.jsx(u,{className:"space-y-3",children:e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-background rounded-lg",children:[e.jsx(m,{className:"bg-green-500",children:"High Coverage"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Ready to ungate on cards:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Rating (99.9%), Google Category (99.9%), Review Count (99.9%), Phone (94%), Location (99%), Photos (99%)"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-background rounded-lg",children:[e.jsx(m,{className:"bg-yellow-500",children:"Partial Coverage"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Could show when available:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Website (88%), Price Level (23%), Service Flags (5-18%)"})]})]}),e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-background rounded-lg",children:[e.jsx(m,{className:"bg-red-500",children:"Low Coverage"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Claimed-only or need enrichment:"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Description (21%), Hours (0% - stored in open_state instead), FAQs, Deals, Team"})]})]})]})})]})]})};export{Z 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.