1import{b7 as p,j as e,aK as f,v as d,b6 as j,r as m,p as b,O as y,s as N}from"./index-Ge9d8XRR.js";import{a as w}from"./blog-content-D7SBJmAh.js";import{A as g}from"./arrow-left-BU44aGbi.js";const v=/(https?:\/\/[^\s]+)/g,u={"Marguerite Japy, Co-founder & CEO":"https://gcbavizlaxatiafdkaiy.supabase.co/storage/v1/object/public/community-images-homepage/marguerite.png"},x=t=>t.split(v).map((a,i)=>i%2===1?e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-4 hover:text-foreground",children:a},i):a),_=t=>t.split(/\n{2,}/).map(a=>a.trim()).filter(Boolean),k=t=>t.flatMap((a,i)=>{const o=w(a);if(o)return[e.jsx("h2",{className:"text-xl md:text-2xl font-semibold tracking-tight mt-12 mb-4",children:o},i)];const l=a.split(` 2`).map(n=>n.trim()).filter(Boolean),r=[];for(const n of l){const s=r[r.length-1];if(n.startsWith("- ")){const c=n.slice(2);(s==null?void 0:s.type)==="ul"?s.items.push([c]):r.push({type:"ul",items:[[c]]})}else(s==null?void 0:s.type)==="ul"?s.items[s.items.length-1].push(n):(s==null?void 0:s.type)==="p"?s.parts.push(n):r.push({type:"p",parts:[n]})}return r.map((n,s)=>n.type==="ul"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 mb-6",children:n.items.map((c,h)=>e.jsx("li",{children:x(c.join(" "))},h))},`${i}-${s}`):e.jsx("p",{className:"mb-6",children:x(n.parts.join(" "))},`${i}-${s}`))}),A=t=>{const a=_(t),i=a.findIndex(l=>l.trim().toUpperCase()==="FAQ");if(i===-1)return{bodySections:a,faq:[]};const o=a.slice(i+1).map(l=>{const r=l.split(` 3`).map(s=>s.trim()).filter(Boolean).join(" "),n=r.indexOf("?");return n===-1?null:{q:r.slice(0,n+1).trim(),a:r.slice(n+1).trim()}}).filter(l=>!!l);return{bodySections:a.slice(0,i),faq:o}},S=({urls:t,alt:a})=>{const i=m.useRef(null),o=l=>{const r=i.current;if(!r)return;const n=r.querySelector("[data-carousel-item]");if(!n)return;const c=n.getBoundingClientRect().width+16;r.scrollBy({left:l*c,behavior:"smooth"})};return e.jsxs("div",{className:"mt-12",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{ref:i,className:"flex gap-4 overflow-x-auto snap-x snap-mandatory [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:t.map((l,r)=>e.jsx("img",{"data-carousel-item":!0,src:l,alt:`${a} ${r+1}`,loading:"lazy",className:"shrink-0 w-[70%] sm:w-[45%] aspect-[4/5] rounded-2xl object-cover snap-start"},r))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-16 sm:w-24 bg-gradient-to-l from-[#f7f6f3] to-transparent"})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>o(-1),"aria-label":"Previous image",className:"w-10 h-10 rounded-full bg-white border border-border/60 shadow-sm flex items-center justify-center hover:bg-secondary transition-colors",children:e.jsx(g,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:()=>o(1),"aria-label":"Next image",className:"w-10 h-10 rounded-full bg-white border border-border/60 shadow-sm flex items-center justify-center hover:bg-secondary transition-colors",children:e.jsx(b,{className:"w-4 h-4"})})]})]})},R=({post:t})=>{var n;const a=`https://ernest-app.com/blog/${t.slug}`,i=(t.excerpt??`Read "${t.title}" on the ernest blog.`).slice(0,160),{bodySections:o,faq:l}=A(t.content),r=t.cover_image_url??`https://ernest-app.com${p.url}`;return e.jsxs("div",{className:"min-h-screen bg-[#f7f6f3] text-foreground",children:[e.jsxs(f,{children:[e.jsx("title",{children:`${t.title} â ernest`}),e.jsx("meta",{name:"description",content:i}),e.jsx("link",{rel:"canonical",href:a}),e.jsx("meta",{property:"og:title",content:t.title}),e.jsx("meta",{property:"og:description",content:i}),e.jsx("meta",{property:"og:url",content:a}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:image",content:r}),e.jsx("meta",{property:"og:image:alt",content:t.title}),e.jsx("meta",{name:"twitter:image",content:r}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Article",headline:t.title,de
3scription:i,image:[r],...t.author_name?{author:{"@type":"Person",name:t.author_name}}:{},...t.published_at?{datePublished:t.published_at}:{},...t.updated_at??t.published_at?{dateModified:t.updated_at??t.published_at}:{},...(n=t.tags)!=null&&n.length?{keywords:t.tags.join(", ")}:{},inLanguage:"en",mainEntityOfPage:a,publisher:{"@type":"Organization",name:"ernest",logo:{"@type":"ImageObject",url:"https://ernest-app.com/ernest-wordmark.png"}}})}),l.length>0&&e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:l.map(({q:s,a:c})=>({"@type":"Question",name:s,acceptedAnswer:{"@type":"Answer",text:c}}))})})]}),e.jsx("header",{className:"sticky top-0 z-50 backdrop-blur-md border-b border-border/40 bg-[#f7f6f3]",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-6 lg:px-10 lg:pr-0 h-16 flex items-center justify-between",children:[e.jsx(d,{to:"/",children:e.jsx("img",{src:"/ernest-wordmark.png",alt:"ernest",className:"h-7 md:h-9"})}),e.jsxs("nav",{className:"hidden md:flex items-center absolute left-1/2 -translate-x-1/2 gap-5 lg:gap-[50px]",children:[e.jsx("a",{href:"/#how",className:"text-foreground/60 font-normal transition-colors duration-300 hover:text-foreground text-sm lg:text-lg whitespace-nowrap",children:"How it works"}),e.jsx(j,{}),e.jsx(d,{to:"/blog",className:"text-foreground/60 font-normal transition-colors duration-300 hover:text-foreground text-sm lg:text-lg whitespace-nowrap",children:"Resources"})]}),e.jsxs("div",{className:"flex items-center gap-4 md:pr-4 lg:pr-[40px] md:gap-3 lg:gap-[35px]",children:[e.jsx(d,{to:"/login",className:"no-underline transition-colors duration-300 text-base md:text-sm lg:text-lg text-[#7d70f0] font-medium md:font-normal",children:"Log in"}),e.jsxs(d,{to:"/signup",className:"hidden md:inline-flex items-center gap-2 rounded-full bg-[hsl(var(--ernest-neon))] text-foreground border border-black/10 hover:scale-[1.02] transition whitespace-nowrap no-underline text-sm lg:text-base font-normal px-4 py-1.5",children:["Get started ",e.jsx("span",{"aria-hidden":"true",children:"â"})]})]})]})}),e.jsx("article",{className:"pt-16 pb-32",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-6 lg:px-10",children:[e.jsxs(d,{to:"/blog",className:"mb-10 inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[e.jsx(g,{className:"w-4 h-4"})," Back to Resources"]}),t.tags&&t.tags[0]&&e.jsx("div",{className:"text-xs uppercase tracking-[0.18em] text-[#584dff] mb-6",children:t.tags[0]}),e.jsx("h1",{className:"text-3xl md:text-4xl font-medium tracking-tight leading-[1.1]",children:t.title}),t.excerpt&&e.jsx("p",{className:"mt-6 text-xl text-muted-foreground leading-relaxed",children:t.excerpt}),e.jsxs("div",{className:"mt-8 flex items-center gap-3 text-sm text-muted-foreground",children:[t.author_name&&u[t.author_name]&&e.jsx("img",{src:u[t.author_name],alt:t.author_name,className:"w-9 h-9 rounded-full object-cover"}),e.jsxs("span",{children:[t.author_name," · ",t.published_at&&new Date(t.published_at).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]}),t.cover_image_url&&t.slug!=="venue-as-community-media"&&e.jsx("img",{src:t.cover_image_url,alt:t.title,className:"mt-10 w-full aspect-[16/9] rounded-2xl object-cover",loading:"eager"}),t.image_urls&&t.image_urls.length>0&&e.jsx(S,{urls:t.image_urls,alt:t.title}),e.jsx("div",{className:"mt-12 prose prose-lg max-w-none text-foreground leading-relaxed",children:k(o)}),l.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h2",{className:"text-2xl font-medium tracking-tight mb-5",children:"Frequently asked questions"}),e.jsx("div",{className:"flex flex-col gap-3",children:l.map(({q:s,a:c})=>e.jsx("article",{className:"rounded-2xl bg-white border border-border/60 px-5 py-4",children:e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex items-start justify-between gap-6 cursor-pointer list-none [&::-webkit-details-marker]:hidden",children:[e.jsx("h3",{className:"text-base font-medium text-foreground leading-snug",children:s}),e.jsx("span",{"aria-hidden":"true",className:"mt-0.5 shrink-0 text-2xl leading-none text-[#584dff] transition-transform duration-200 group-open:rotate-45",children:"+"})]}),e.jsx("p",{className:"mt-3 text-muted-foreground leading-relaxed",children:x(c)})]})},s))})]})]})})]})},O=()=>{const{slug:t}=y(),[a,i]=m.useState(null),[o,l]=m.useState(!0);return m.useEffect(()=>{t&&(async()=>{const{data:r}=await N.from("blog_posts").select("*").eq("slug",t).eq("published",!0).maybeSingle();r&&i(r),l(!1)})()},[t]),o?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx("div",{className:"text-muted-foreground",children:"Loadingâ¦"})}):a?e.jsx(R,{post:a}):e.jsxs("div",{className:"min-h-screen bg-background flex flex-col items-center justify-center gap-4",children:[e.jsx("h1",{className:"text-3xl font-medium",children:"Article not found"}),e.jsx(d,{to:"/blog",className:"text-sm underline underline-offset-4",children:"Back to insights"})]})};export{O as default}; 4//# sourceMappingURL=BlogPost-BJAjhGbY.js.map
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.