1import{r,j as t,x as b,L as v}from"./react-vendor-BP-FEySG.js";import{u as f,c as y,a as N,N as w,B as h,C as E,d as D,e as S,f as P,b as k,F as T}from"./index-CiYXYxzr.js";import{b as M}from"./blog-data-D6wdfajR.js";const K=r.createContext({isComposing:()=>!1,setComposing:()=>{},justEndedComposing:()=>!1,markCompositionEnd:()=>{}}),L=()=>r.useContext(K);function _(c={}){const{onKeyDown:m,onCompositionStart:l,onCompositionEnd:d}=c,a=r.useRef(!1),n=r.useRef(null),s=r.useRef(null),g=f(e=>{n.current&&(clearTimeout(n.current),n.current=null),s.current&&(clearTimeout(s.current),s.current=null),a.current=!0,l?.(e)}),u=f(e=>{n.current=setTimeout(()=>{s.current=setTimeout(()=>{a.current=!1})}),d?.(e)}),x=f(e=>{if(a.current&&(e.key==="Escape"||e.key==="Enter"&&!e.shiftKey)){e.stopPropagation();return}m?.(e)}),o=f(()=>a.current);return{onCompositionStart:g,onCompositionEnd:u,onKeyDown:x,isComposing:o}}function I({className:c,type:m,onKeyDown:l,onCompositionStart:d,onCompositionEnd:a,...n}){const s=L(),{onCompositionStart:g,onCompositionEnd:u,onKeyDown:x}=_({onKeyDown:o=>{const e=o.nativeEvent.isComposing||s.justEndedComposing();
1o.key==="Enter"&&e||l?.(o)},onCompositionStart:o=>{s.setComposing(!0),d?.(o)},onCompositionEnd:o=>{s.markCompositionEnd(),setTimeout(()=>{s.setComposing(!1)},100),a?.(o)}});return t.jsx("input",{"data-loc":"client/src/components/ui/input.tsx:53",type:m,"data-slot":"input",className:y("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",c),onCompositionStart:g,onCompositionEnd:u,onKeyDown:x,...n})}const C=12;function O(){const[c,m]=r.useState(""),[l,d]=r.useState(1),a=r.useMemo(()=>[...N,...M],[]),n=r.useMemo(()=>{const e=a.sort((p,j)=>{const B=new Date(p.publishedDate).getTime();return new Date(j.publishedDate).getTime()-B});if(!c.trim())return e;const i=c.toLowerCase();return e.filter(p=>p.title.toLowerCase().includes(i)||p.excerpt&&p.excerpt.toLowerCase().includes(i))},[a,c]),s=Math.ceil(n.length/C),g=r.useMemo(()=>{const e=(l-1)*C;return n.slice(e,e+C)},[n,l]),u=e=>{m(e),d(1)},x=e=>{try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch{return e}},o=e=>{const i=document.createElement("DIV");return i.innerHTML=e,i.textContent||i.innerText||""};return t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:74",className:"min-h-screen flex flex-col",children:[t.jsx(w,{"data-loc":"client/src/pages/Blog.tsx:75"}),t.jsx("section",{"data-loc":"client/src/pages/Blog.tsx:78",className:"bg-gradient-to-br from-primary/10 via-accent/20 to-secondary/10 py-16",children:t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:79",className:"container mx-auto px-4 text-center",children:[t.jsx("h1",{"data-loc":"client/src/pages/Blog.tsx:80",className:"text-5xl font-bold text-foreground mb-4",children:"Pest Control Blog"}),t.jsx("p",{"data-loc":"client/src/pages/Blog.tsx:81",className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Expert tips, pest prevention advice, and industry insights from Dustin Pest Control"})]})}),t.jsx("section",{"data-loc":"client/src/pages/Blog.tsx:88",className:"py-8 bg-background border-b",children:t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:89",className:"container mx-auto px-4",children:[t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:90",className:"max-w-2xl mx-auto relative",children:[t.jsx(b,{"data-loc":"client/src/pages/Blog.tsx:91",className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-5 w-5"}),t.jsx(I,{"data-loc":"client/src/pages/Blog.tsx:92",type:"text",placeholder:"Search blog posts...",value:c,onChange:e=>u(e.target.value),className:"pl-10 pr-4 py-6 text-lg"})]}),t.jsxs("p",{"data-loc":"client/src/pages/Blog.tsx:100",className:"text-center text-muted-foreground mt-4",children:["Showing ",n.length," of ",a.length," posts"]})]})}),t.jsx("section",{"data-loc":"client/src/pages/Blog.tsx:107",className:"py-12 flex-grow",children:t.jsx("div",{"data-loc":"client/src/pages/Blog.tsx:108",className:"container mx-auto px-4",children:g.length===0?t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:110",className:"text-center py-12",children:[t.jsx("p",{"data-loc":"client/src/pages/Blog.tsx:111",className:"text-xl text-muted-foreground",children:"No posts found matching your search."}),t.jsx(h,{"data-loc":"client/src/pages/Blog.tsx:112",onClick:()=>u(""),className:"mt-4",variant:"outline",children:"Clear Search"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-loc":"client/src/pages/Blog.tsx:122",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:g.map(e=>t.jsx(v,{"data-loc":"client/src/pages/Blog.tsx:124",href:`/blog/${e.slug}`,children:t.jsxs(E,{"data-loc":"client/src/pages/Blog.tsx:125",className:"h-full hover:shadow-lg transition-shadow cursor-pointer overflow-hidden",children:[e.featuredImage&&t.jsx("div",{"data-loc":"client/src/pages/Blog.tsx:127",className:"aspect-video w-full overflow-hidden bg-muted",children:t.jsx("img",{"data-loc":"client/src/pages/Blog.tsx:128",src:e.featuredImage,alt:e.title,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300",loading:"lazy"})}),t.jsxs(D,{"data-loc":"client/src/pages/Blog.tsx:136",children:[t.jsx(S,{"data-loc":"client/src/pages/Blog.tsx:137",className:"text-xl line-clamp-2",children:e.title}),t.jsx(P,{"data-loc":"client/src/pages/Blog.tsx:138",children:x(e.publishedDate)})]}),t.jsxs(k,{"data-loc":"client/src/pages/Blog.tsx:142",children:[t.jsx("p",{"data-loc":"client/src/pages/Blog.tsx:143",className:"text-muted-foreground line-clamp-3",children:e.excerpt?o(e.excerpt):o(e.content).substring(0,150)+"..."}),t.jsx(h,{"data-loc":"client/src/pages/Blog.tsx:146",variant:"link",className:"mt-4 px-0",children:"Read More â"})]})]})},e.slug))}),s>1&&t.jsxs("div",{"data-loc":"client/src/pages/Blog.tsx:157",className:"flex justify-center items-center gap-2 mt-12",children:[t.jsx(h,{"data-loc":"client/src/pages/Blog.tsx:158",onClick:()=>d(e=>Math.max(1,e-1)),disabled:l===1,variant:"outline",children:"Previous"}),t.jsx("div",{"data-loc":"client/src/pages/Blog.tsx:166",className:"flex gap-2",children:Array.from({length:s},(e,i)=>i+1).map(e=>t.jsx(h,{"data-loc":"client/src/pages/Blog.tsx:168",onClick:()=>d(e),variant:l===e?"default":"outline",className:"w-10",children:e},e))}),t.jsx(h,{"data-loc":"client/src/pages/Blog.tsx:179",onClick:()=>d(e=>Math.min(s,e+1)),disabled:l===s,variant:"outline",children:"Next"})]})]})})}),t.jsx(T,{"data-loc":"client/src/pages/Blog.tsx:193"})]})}const z=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));
1export{z as B,I,_ as a,L as u};
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.