1import{j as e}from"./vendor-ui-A12DDDPJ.js";import{r as c,L as x,f as y}from"./vendor-react-zaFybfsY.js";import{s as p,q as w,g as N,B as _,at as k,n as f,ay as S,k as B,az as C,C as T}from"./index-BWq0bbWM.js";import b from"./Footer-Bm1CabPQ.js";import E from"./CTABlock-BLor4oLk.js";import{E as I}from"./EditorJsRenderer-UIm8eYZG.js";import{B as L}from"./badge-CY5ERJY4.js";import{B as R}from"./BlogSocialShare-B7duC51N.js";import{U as v}from"./user-DBxapSbB.js";import{C as j}from"./calendar-CMeoWJL1.js";import{g as U}from"./BlogCrossLinks-CzdhrB0I.js";import{R as D}from"./RelatedResources-XvuQ13OV.js";import{A as $}from"./arrow-left-DEXc-Zx7.js";import"./preload-helper-CZ5Qg0oT.js";import"./vendor-supabase-BBbWDq57.js";import"./vendor-i18n-nJJiGX0r.js";import"./vendor-query-Bx_1Sw6s.js";const P=({content:a})=>{const s=c.useMemo(()=>{if(!a?.blocks)return[];const r=[];let i=0;for(const l of a.blocks)if(l.type==="header"&&[1,2,3].includes(l.data.level))r.push({id:`heading-${i++}`,text:l.data.text.replace(/<[^>]*>/g,""),level:l.data.level});else if(l.type==="raw"&&l.data?.html){const n=/<h([1-3])[^>]*>([\s\S]*?)<\/h[1-3]>/gi;let d;for(;(d=n.exec(l.data.html))!==null;){const u=d[2].replace(/<[^>]*>/g,"").trim();u&&r.push({id:`heading-${i++}`,text:u,level:parseInt(d[1],10)})}}return r},[a]);if(s.length<2)return null;const t=r=>{document.getElementById(r)?.scrollIntoView({behavior:"smooth",block:"start"})};return e.jsxs("div",{className:"bg-card border border-border rounded-xl p-5 sticky top-[100px]",children:[e.jsx("h3",{className:"font-heading font-bold text-foreground text-sm mb-3",children:"Table of Content"}),e.jsx("nav",{className:"space-y-1",children:s.map(r=>e.jsx("button",{onClick:()=>t(r.id),className:`block text-left w-full text-[13px] py-1.5 border-l-2 transition-colors hover:text-primary hover:border-primary ${r.level===3?"pl-6 border-transparent text-muted-foreground":"pl-3 border-primary/30 text-foreground/80 font-medium"}`,children:r.text},r.id))})]})},A=({currentBlogId:a,tags:s})=>{const[t,r]=c.useState([]);return c.useEffect(()=>{p.from("blogs").select("id, title, slug, excerpt, cover_image_url, author_name, published_at, tags").eq("is_published",!0).neq("id",a).order("published_at",{ascending:!1}).limit(6).then(({data:i})=>{if(!i)return;const l=i.map(n=>({...n,score:n.tags.filter(d=>s.includes(d)).length}));l.sort((n,d)=>d.score-n.score),r(l.slice(0,3))})},[a,s]),t.length===0?null:e.jsx("section",{className:"py-12 bg-[hsl(var(--section-alt))]",children:e.jsxs("div",{className:"max-w-[1100px] mx-auto px-4",children:[e.jsx("h2",{className:"font-heading font-bold text-foreground text-xl mb-6",children:"Related Articles"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:t.map(i=>e.jsxs(x,{to:`/blogs/${i.slug}`,className:"group bg-card border border-border rounded-xl overflow-hidden hover:shadow-lg transition-all hover:-translate-y-1",children:[i.cover_image_url?e.jsx("div",{className:"aspect-video overflow-hidden",children:e.jsx("img",{src:i.cover_image_url,alt:i.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",loading:"lazy",decoding:"async"})}):e.jsx("div",{className:"aspect-video bg-gradient-to-br from-[hsl(var(--primary)/0.1)] to-[hsl(var(--secondary)/0.1)] flex items-center justify-center",children:e.jsx("span",{className:"text-3xl font-heading font-bold text-primary/20",children:"TS"})}),e.jsxs("div",{className:"p-4",children:[e.jsx("h3",{className:"font-heading font-bold text-foreground text-sm mb-2 line-clamp-2 group-hover:text-primary transition-colors",children:i.title}),e.jsx("p",{className:"text-muted-foreground text-xs line-clamp-2 mb-3",children:i.excerpt}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(v,{className:"w-3 h-3"})," ",i.author_name]}),i.published_at&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(j,{className:"w-3 h-3"}),new Date(i.published_at).toLocaleDateString("en-US",{month:"short",day:"numeric"})]})]})]})]},i.id))})]})})},z=()=>{const[a,s]=c.useState(0);return c.useEffect(()=>{const t=()=>{const r=document.documentElement.scrollHeight-window.innerHeight;r>0&&s(Math.min(100,window.scrollY/r*100))};return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)},[]),e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-[3px] bg-transparent",children:e.jsx("div",{className:"h-full bg-primary transition-[width] duration-100 ease-out",style:{width:`${a}%`}})})},H=()=>{const[a,s]=c.useState(""),t=r=>{r.preventDefault(),a.trim()&&(k.success("Thanks for subscribing! We'll keep you updated."),s(""))};return e.jsxs("div",{className:"mt-12 bg-gradient-to-br from-[hsl(var(--primary)/0.06)] to-[hsl(var(--secondary)/0.06)] border border-[hsl(var(--primary)/0.12)] rounded-xl p-6 md:p-8",children:[e.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(w,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-heading font-bold text-foreground text-lg",children:"Stay Updated"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Get the latest fleet management insights delivered to your inbox."})]})]}),e.jsxs("form",{onSubmit:t,className:"flex gap-2",children:[e.jsx(N,{type:"email",placeholder:"Enter your email",value:a,onChange:r=>s(r.target.value),className:"flex-1",required:!0}),e.jsx(_,{type:"submit",children:"Subscribe"})]})]})};let m;function M(a,s){if(!s)return null;if(typeof window>"u"){const t=globalThis.__PRERENDER_DATA__;return t&&t.type===a&&t.slug===s?t.data:null}if(m===void 0)try{const t=document.getElementById("prerender-data");m=t?.textContent?JSON.parse(t.textContent):null}catch{m=null}return m&&m.type===a&&m.slug===s?m.data:null}const q=a=>{if(!a?.blocks)return 3;const s=a.blocks.map(t=>t.data?.text?t.data.text:t.data?.items?t.data.items.map(r=>typeof r=="string"?r:r.content||"").join(" "):"").join(" ").replace(/<[^>]*>/g,"");return Math.max(1,Math.ceil(s.split(/\s+/).length/200))},O=a=>a?.blocks?a.blocks.filter(s=>s.type==="embed"&&s.data?.embed).map(s=>{const t=s.data.embed,r=t.includes("youtube.com")||t.includes("youtu.be");return{"@context":"https://schema.org","@type":"VideoObject",name:s.data.caption||"Video",embedUrl:t,thumbnailUrl:r?`https://img.youtube.com/vi/${t.match(/(?:embed\/|v=)([^?&]+)/
1)?.[1]||""}/hqdefault.jpg`:void 0,uploadDate:void 0}}).filter(s=>s.embedUrl):[],le=()=>{const{slug:a}=y(),s=M("blog",a),[t,r]=c.useState(s),[i,l]=c.useState(!s);if(c.useEffect(()=>{if(a){if(s){const o=sessionStorage.getItem("visitor_id")||crypto.randomUUID();sessionStorage.setItem("visitor_id",o),p.from("content_views").insert({content_type:"blog",content_id:s.id,content_slug:s.slug,visitor_id:o,referrer:document.referrer||null}).then(()=>{});return}p.from("blogs").select("*").eq("slug",a).eq("is_published",!0).maybeSingle().then(({data:o})=>{if(r(o),l(!1),o){const h=sessionStorage.getItem("visitor_id")||crypto.randomUUID();sessionStorage.setItem("visitor_id",h),p.from("content_views").insert({content_type:"blog",content_id:o.id,content_slug:o.slug,visitor_id:h,referrer:document.referrer||null}).then(()=>{})}})}},[a]),i)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})});if(!t)return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(f,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"font-heading text-2xl font-bold text-foreground mb-2",children:"Blog Post Not Found"}),e.jsx(x,{to:"/blogs",className:"text-primary hover:underline",children:"â Back to Blog"})]})}),e.jsx(b,{})]});const n=t.published_at?new Date(t.published_at).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}).toUpperCase():"",d=q(t.content),u=(t.meta_description||t.excerpt).replace(/\s+/g," ").trim(),g=`/author/${S(t.author_name)}`;return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(B,{title:t.meta_title||`${t.title} | TransportSimple Blog`,description:t.meta_description||t.excerpt,canonical:`/blogs/${t.slug}`,type:"article",image:t.cover_image_url||void 0,publishedTime:t.published_at||void 0,modifiedTime:t.published_at||void 0,author:t.author_name,jsonLd:[{"@context":"https://schema.org","@type":"Article",headline:t.title,description:u,image:t.cover_image_url||"https://www.transportsimple.com/og-image.png",datePublished:t.published_at||void 0,dateModified:t.published_at||void 0,author:{"@id":`https://www.transportsimple.com${g}#person`},publisher:{"@type":"Organization",name:"TransportSimple",logo:{"@type":"ImageObject",url:"https://www.transportsimple.com/logo.png"}},mainEntityOfPage:{"@type":"WebPage","@id":`https://www.transportsimple.com/blogs/${t.slug}`},wordCount:t.content?.blocks?t.content.blocks.reduce((o,h)=>o+(h.data?.text?.replace(/<[^>]*>/g,"")?.split(/\s+/)?.length||0),0):void 0,keywords:t.tags.join(", "),about:t.tags.map(o=>({"@type":"Thing",name:o})),mentions:[{"@id":"https://www.transportsimple.com/#organization"},...t.tags.map(o=>({"@type":"Thing",name:o}))]},C({name:t.author_name,bio:t.author_bio,image:t.author_avatar_url,linkedin:t.author_linkedin}),...O(t.content),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.transportsimple.com/"},{"@type":"ListItem",position:2,name:"Blog",item:"https://www.transportsimple.com/blogs"},{"@type":"ListItem",position:3,name:t.title,item:`https://www.transportsimple.com/blogs/${t.slug}`}]}]}),e.jsx(f,{}),e.jsx(z,{}),e.jsx("div",{className:"bg-[hsl(var(--section-alt))] border-b border-border",children:e.jsx("div",{className:"max-w-[1100px] mx-auto px-4 py-3",children:e.jsxs("nav",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(x,{to:"/",className:"hover:text-foreground transition-colors",children:"Home"}),e.jsx("span",{children:"/"}),e.jsx(x,{to:"/blogs",className:"hover:text-foreground transition-colors",children:"Blog"}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"text-foreground/70 truncate max-w-[200px]",children:t.title})]})})}),e.jsx("section",{className:"bg-[hsl(var(--section-alt))] pt-6 pb-10 md:pt-10 md:pb-16",children:e.jsxs("div",{className:"max-w-[1100px] mx-auto px-4",children:[e.jsxs(x,{to:"/blogs",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6 transition-colors",children:[e.jsx($,{className:"w-4 h-4"})," Back to Blog"]}),e.jsxs("div",{className:"grid md:grid-cols-[1fr_1.2fr] gap-8 items-center",children:[e.jsx("div",{className:"rounded-xl overflow-hidden shadow-lg aspect-video max-h-[360px]",children:t.cover_image_url?e.jsx("img",{src:t.cover_image_url,alt:t.title,className:"w-full h-full object-cover object-center",loading:"lazy"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-[hsl(var(--primary)/0.15)] to-[hsl(var(--secondary)/0.15)] flex items-center justify-center",children:e.jsx("span",{className:"text-5xl font-heading font-bold text-primary/20",children:"TS"})})}),e.jsxs("div",{children:[t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:t.tags.map(o=>e.jsx(x,{to:`/blogs/tag/${encodeURIComponent(o.toLowerCase().replace(/\s+/g,"-"))}`,children:e.jsx(L,{variant:"secondary",className:"text-[11px] font-semibold uppercase tracking-wide bg-[hsl(var(--primary)/0.1)] text-primary border-0 hover:bg-[hsl(var(--primary)/0.2)] transition-colors cursor-pointer",children:o})},o))}),e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[n&&e.jsxs("time",{dateTime:t.published_at,className:"text-xs text-muted-foreground font-medium tracking-wide flex items-center gap-1",children:[e.jsx(j,{className:"w-3.5 h-3.5"})," ",n]}),e.jsxs("p",{className:"text-xs text-muted-foreground font-medium flex items-center gap-1",children:[e.jsx(T,{className:"w-3.5 h-3.5"})," ",d," min read"]})]}),e.jsx(R,{social_facebook:t.social_facebook,social_linkedin:t.social_linkedin,social_twitter:t.social_twitter,social_instagram:t.social_instagram}),e.jsx("h1",{className:"font-heading text-2xl md:text-3xl lg:text-4xl font-bold text-foreground mt-4 leading-tight",children:t.title})]})]})]})}),(t.author_name||t.author_bio)&&e.jsx("section",{className:"bg-[hsl(var(--section-alt))] border-t border-border",children:e.jsx("div",{className:"max-w-[1100px] mx-auto px-4 py-5",children:e.jsxs("div",{className:"flex items-start gap-4",children:[t.author_avatar_url?e.jsx("img",{src:t.author_avatar_url,alt:t.author_name,className:"w-14 h-14 roun
1ded-full object-cover flex-shrink-0"}):e.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(v,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Written By"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{to:g,className:"font-heading font-bold text-foreground hover:text-primary transition-colors",children:t.author_name}),t.author_linkedin&&e.jsx("a",{href:t.author_linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-[#0A66C2] hover:opacity-80 transition-opacity",title:"LinkedIn",children:e.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})})]}),t.author_bio&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5 leading-relaxed",children:t.author_bio})]})]})})}),e.jsx("section",{className:"py-10 md:py-16",children:e.jsx("div",{className:"max-w-[1100px] mx-auto px-4",children:e.jsxs("div",{className:"grid lg:grid-cols-[1fr_280px] gap-10",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"bg-[hsl(var(--primary)/0.04)] border border-[hsl(var(--primary)/0.12)] rounded-xl p-5 mb-8",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-primary mb-2",children:"Direct Answer"}),e.jsx("p",{className:"text-sm leading-relaxed text-foreground/85",children:u})]}),t.key_takeaways.length>0&&e.jsxs("div",{className:"bg-[hsl(var(--primary)/0.04)] border border-[hsl(var(--primary)/0.12)] rounded-xl p-6 mb-10",children:[e.jsx("h3",{className:"font-heading font-bold text-foreground text-lg mb-3",children:"Key Takeaways"}),e.jsx("ul",{className:"space-y-2",children:t.key_takeaways.map((o,h)=>e.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-primary",children:[e.jsx("span",{className:"mt-1.5 w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0"}),e.jsx("span",{children:o})]},h))})]}),e.jsx("article",{children:e.jsx(I,{data:t.content})}),e.jsx(H,{})]}),e.jsx("aside",{className:"hidden lg:block",children:e.jsx(P,{content:t.content})})]})})}),e.jsx(A,{currentBlogId:t.id,tags:t.tags}),e.jsx(D,{title:"Related Tools & Resources",links:U(t.tags),ctaHeading:"Ready to Streamline Your Fleet?",ctaDescription:"Stop relying on spreadsheets and guesswork. Get complete visibility and control over every vehicle, every route, and every cost â with TransportSimple."}),e.jsx(E,{}),e.jsx(b,{})]})};export{le 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.