@xexr/blog-platform 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,80 +1,5 @@
1
- 'use strict';var X=require('next/link'),tt=require('next/image'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),dateFns=require('date-fns'),Be=require('react'),rsc=require('next-mdx-remote-client/rsc'),fa6=require('react-icons/fa6'),it=require('@radix-ui/react-separator'),un=require('remark-gfm'),dn=require('remark-toc'),mn=require('rehype-slug'),ratelimit=require('@upstash/ratelimit'),redis=require('@upstash/redis'),drizzleOrm=require('drizzle-orm'),sqliteCore=require('drizzle-orm/sqlite-core'),server=require('next/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var X__default=/*#__PURE__*/_interopDefault(X);var tt__default=/*#__PURE__*/_interopDefault(tt);var Be__namespace=/*#__PURE__*/_interopNamespace(Be);var it__namespace=/*#__PURE__*/_interopNamespace(it);var un__default=/*#__PURE__*/_interopDefault(un);var dn__default=/*#__PURE__*/_interopDefault(dn);var mn__default=/*#__PURE__*/_interopDefault(mn);function h(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Te=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none 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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function gr({className:e,variant:t,size:r,asChild:n=false,...o}){return jsxRuntime.jsx(n?reactSlot.Slot:"button",{"data-slot":"button",className:h(Te({variant:t,size:r,className:e})),...o})}function Ge({className:e,...t}){return jsxRuntime.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:h("mx-auto flex w-full justify-center",e),...t})}function Fe({className:e,...t}){return jsxRuntime.jsx("ul",{"data-slot":"pagination-content",className:h("flex flex-row items-center gap-1",e),...t})}function F({...e}){return jsxRuntime.jsx("li",{"data-slot":"pagination-item",...e})}function Y({className:e,isActive:t,size:r="icon",...n}){return jsxRuntime.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:h(Te({variant:t?"outline":"ghost",size:r}),e),...n})}function Ve({className:e,...t}){return jsxRuntime.jsxs(Y,{"aria-label":"Go to previous page",size:"default",className:h("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[jsxRuntime.jsx(lucideReact.ChevronLeftIcon,{}),jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function qe({className:e,...t}){return jsxRuntime.jsxs(Y,{"aria-label":"Go to next page",size:"default",className:h("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Next"}),jsxRuntime.jsx(lucideReact.ChevronRightIcon,{})]})}function Ce({className:e,...t}){return jsxRuntime.jsxs("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:h("flex size-9 items-center justify-center",e),...t,children:[jsxRuntime.jsx(lucideReact.MoreHorizontalIcon,{className:"size-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"More pages"})]})}function ne({currentPage:e,totalPages:t,baseUrl:r,className:n,maxVisiblePages:o=5,showPrevNext:i=true,showFirstLast:a=true}){if(t<=1)return null;let s=()=>{let p=Math.floor(o/2),g=Math.max(1,e-p),v=Math.min(t,g+o-1);return v-g+1<o&&(g=Math.max(1,v-o+1)),{start:g,end:v}},{start:l,end:c}=s(),m=Array.from({length:c-l+1},(p,g)=>l+g),d=p=>p===1?r:`${r}?page=${p}`,b=e>1,f=e<t;return jsxRuntime.jsxs(Ge,{className:n,children:[jsxRuntime.jsxs(Fe,{children:[a&&e>2&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(F,{children:jsxRuntime.jsx(Y,{href:d(1),"aria-label":"Go to first page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})})}),l>2&&jsxRuntime.jsx(F,{children:jsxRuntime.jsx(Ce,{})})]}),i&&jsxRuntime.jsx(F,{children:b?jsxRuntime.jsx(Ve,{href:d(e-1)}):jsxRuntime.jsx("span",{className:"flex h-9 items-center justify-center gap-1 px-2.5 text-muted-foreground sm:pl-2.5",children:jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Previous"})})}),m.map(p=>jsxRuntime.jsx(F,{children:jsxRuntime.jsx(Y,{href:d(p),isActive:p===e,children:p})},p)),i&&jsxRuntime.jsx(F,{children:f?jsxRuntime.jsx(qe,{href:d(e+1)}):jsxRuntime.jsx("span",{className:"flex h-9 items-center justify-center gap-1 px-2.5 text-muted-foreground sm:pr-2.5",children:jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Next"})})}),a&&e<t-1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c<t-1&&jsxRuntime.jsx(F,{children:jsxRuntime.jsx(Ce,{})}),jsxRuntime.jsx(F,{children:jsxRuntime.jsx(Y,{href:d(t),"aria-label":"Go to last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})})]})]}),jsxRuntime.jsxs("div",{className:"sr-only","aria-live":"polite",children:["Page ",e," of ",t]})]})}function Pr(e,t=10){let r=e.page,n=Array.isArray(r)?r[0]:r,o=Math.max(1,parseInt(n??"1",10)),i=(o-1)*t;return {currentPage:o,itemsPerPage:t,offset:i,calculateTotalPages:s=>Math.ceil(s/t)}}function Ar(e,t,r,n){let o=n?`${n}${e===1?r:`${r}?page=${e}`}`:void 0,i=e>1&&n?`${n}${e===2?r:`${r}?page=${e-1}`}`:void 0,a=e<t&&n?`${n}${r}?page=${e+1}`:void 0;return {alternates:{...o&&{canonical:o}},other:{...i&&{prev:i},...a&&{next:a}}}}function I(e="/blog"){let t=e.trim();return !t||t==="/"?"":t.replace(/^(?!\/)/,"/").replace(/\/+$/,"")}function L(e,t){let r=I(e),n=t?.replace(/^\/+/,"").replace(/\/+$/,"");return n?`${r}/${n}`.replace(/\/+/g,"/"):r||"/"}function R(e,t){return L(e,`authors/${t}`)}function wr(e){let t=new URL(e);return I(t.pathname)}function Ie(e,t={}){let{customDomain:r,pathPrefix:n="/blog",language:o,isAccessibleForFree:i=true,includeOptionalProperties:a=true}=t,s=r??e.site.domain,l=r?`https://${s}${n}/${e.slug}`:e.meta.canonicalUrl??`https://${s}${n}/${e.slug}`,c=e.author?Le(e.author,{customDomain:r,pathPrefix:n}):void 0,m=We(e.site,{customDomain:r,pathPrefix:n}),b=`PT${Math.max(1,Math.ceil(e.readingSeconds/60))}M`,f={"@context":"https://schema.org","@type":"BlogPosting","@id":`${l}#article`,headline:e.title,description:e.excerpt,datePublished:e.publishedAt,dateModified:e.updatedAt,author:c,publisher:m,mainEntityOfPage:{"@type":"WebPage","@id":l},wordCount:e.wordCount,timeRequired:b,isAccessibleForFree:i};return a&&(e.featuredImage&&(f.image=e.featuredImage),e.meta.keywords.length>0&&(f.keywords=[...e.meta.keywords]),(o??e.site.locale)&&(f.inLanguage=o??e.site.locale),e.site.toneAdjectives.length>0&&(f.about=e.site.toneAdjectives.map(p=>({"@type":"Thing",name:p}))),e.site.toneAdjectives.length>0&&(f.genre=[...e.site.toneAdjectives])),f}function Le(e,t={}){let{customDomain:r,pathPrefix:n="/blog"}=t,o={"@context":"https://schema.org","@type":"Person","@id":`#author-${e.id}`,name:e.name,identifier:e.id};e.bio&&(o.description=e.bio),e.avatarUrl&&(o.image=e.avatarUrl);let i=[e.socialLinks?.website,e.socialLinks?.x,e.socialLinks?.linkedin,e.socialLinks?.github].filter(a=>!!a);if(i.length>0&&(o.sameAs=i),e.slug?.trim()){let a=r?`https://${r}${R(n,e.slug)}`:R(n,e.slug);o.url=a;}return e.isGuest&&(o.additionalType="GuestAuthor"),e.toneAdjectives&&e.toneAdjectives.length>0&&(o.knowsAbout=[...e.toneAdjectives]),o}function We(e,t={}){let{customDomain:r,pathPrefix:n="/blog"}=t,i=`https://${r??e.domain}${n}`,a={"@context":"https://schema.org","@type":"Organization","@id":`${i}#organization`,name:e.name,url:i};return e.description?.trim()&&(a.description=e.description),e.tagline?.trim()&&(a.description=a.description?`${a.description}. ${e.tagline}`:e.tagline),a}function Ke(e,t={}){let{customDomain:r,pathPrefix:n="/blog",language:o,includeSearchAction:i=true}=t,s=`https://${r??e.domain}${n}`,l=We(e,t),c={"@context":"https://schema.org","@type":"WebSite","@id":`${s}#website`,name:e.name,url:s,publisher:l};return e.description?.trim()&&(c.description=e.description),(o??e.locale)&&(c.inLanguage=o??e.locale),i&&(c.potentialAction={"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${s}?search={search_term_string}`},"query-input":"required name=search_term_string"}),c}function Pt(e,t={}){let{customDomain:r}=t;return {"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((n,o)=>({"@type":"ListItem",position:o+1,name:n.name,item:r&&!n.url.startsWith("http")?`https://${r}${n.url}`:n.url}))}}function Je(e,t={}){let r=[];r.push(Ie(e,t)),r.push(Ke(e.site,t));let n=t.pathPrefix??"/blog",o=[{name:"Home",url:"/"},{name:e.site.name,url:n},{name:e.title,url:`${n}/${e.slug}`}];return r.push(Pt(o,t)),r}function Ye(e,t=[],r={}){let n=[];if(n.push(Ke(e,r)),t.length>0){let o=t.slice(0,5).map(i=>Ie(i,r));n.push(...o);}return n}function At(e){let t=[];if(e["@context"]?e["@context"]!=="https://schema.org"&&t.push("@context must be 'https://schema.org'"):t.push("Missing required @context property"),e["@type"]||t.push("Missing required @type property"),e["@type"]==="BlogPosting"){let r=e;r.headline||t.push("BlogPosting: Missing required headline"),r.datePublished||t.push("BlogPosting: Missing required datePublished"),r.author||t.push("BlogPosting: Missing required author"),r.publisher||t.push("BlogPosting: Missing required publisher");}return e["@type"]==="Person"&&(e.name||t.push("Person: Missing required name")),e["@type"]==="Organization"&&(e.name||t.push("Organization: Missing required name")),{isValid:t.length===0,errors:t}}function wt(e){return JSON.stringify(e,null,0)}function Q(e){return {type:"application/ld+json",dangerouslySetInnerHTML:{__html:wt(e)}}}function Sr(e){let t=new Set;return e.meta.keywords.forEach(r=>t.add(r)),e.site.toneAdjectives.forEach(r=>t.add(r)),e.author&&e.author.toneAdjectives.forEach(r=>t.add(r)),Array.from(t)}var ge=class extends Error{constructor(r,n,o){super(r);this.code=n;this.details=o;this.name="StructuredDataError";}code;details};function Nr(e,t={}){try{let r=Ie(e,t),n=At(r);return n.isValid?{schema:r}:{error:new ge("Generated schema validation failed","VALIDATION_FAILED",n.errors)}}catch(r){return {error:new ge("Failed to generate structured data","GENERATION_FAILED",r)}}}var ie={accentColor:"hsl(var(--primary))",accentHoverColor:"hsl(var(--primary))",textAccentColor:"hsl(var(--primary))",textAccentHoverColor:"hsl(var(--primary))",accentBackgroundColor:"hsl(var(--primary) / 0.08)",accentBorderColor:"hsl(var(--primary) / 0.25)"};function M(e={}){return {"--blog-accent":e.accentColor??ie.accentColor,"--blog-accent-hover":e.accentHoverColor??ie.accentHoverColor,"--blog-text-accent":e.textAccentColor??e.accentColor??ie.textAccentColor,"--blog-text-accent-hover":e.textAccentHoverColor??e.accentHoverColor??ie.textAccentHoverColor,"--blog-accent-bg":e.accentBackgroundColor??ie.accentBackgroundColor,"--blog-accent-border":e.accentBorderColor??ie.accentBorderColor}}function Qe(e,t){let r=new Date(e),n=new Date(t);return {publishedDateLabel:dateFns.format(r,"d MMMM yyyy"),publishedRelativeLabel:dateFns.formatDistanceToNow(r,{addSuffix:true}),updatedDateLabel:dateFns.format(n,"d MMMM yyyy"),isUpdated:n.getTime()!==r.getTime()}}function Ze(e){let t=[],r=false;for(let n of e.split(`
2
- `)){if(/^\s*```/.test(n)){r=!r;continue}if(r)continue;let o=/^(#{2,3})\s+(.+?)\s*#*\s*$/.exec(n);if(!o?.[1]||!o[2])continue;let i=Tr(o[2]);i&&t.push({id:Cr(i),text:i,level:o[1].length});}return t}function Nt(e){return `${e} ${e===1?"section":"sections"}`}function Rt(e,t){let r=e===t;return {isActive:r,ariaCurrent:r?"location":void 0}}function Tr(e){return e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`~]/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function Cr(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-")}var _e="Thanks, you're on the list. We'll confirm before sending updates.";function fe({siteId:e,settings:t,sourceSurface:r,sourceArticleSlug:n,sourceUrl:o,previewMode:i=false,className:a}){let[s,l]=Be.useState(null),[c,m]=Be.useState(null),[d,b]=Be.useState(false),[f,p]=Be.useState(false),g=Or(e),v=Be.useSyncExternalStore($r,()=>Er(g),()=>false),C=d||!i&&v;async function H(re){re.preventDefault(),m(null),l(null);let me=new FormData(re.currentTarget),sr=et(me,"company");if(i){l(_e),b(true),re.currentTarget.reset();return}p(true);try{let yt=await fetch(`${t.captureBaseUrl.replace(/\/$/,"")}/api/newsletter/subscribe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteId:Number(e),publicSubscribeToken:t.publicSubscribeToken,email:et(me,"email"),name:Br(me,"name"),sourceSurface:r,sourceUrl:_r(o),sourceArticleSlug:n??null,honeypot:sr})});if(!yt.ok)throw new Error("Newsletter signup failed.");let lr=await yt.json().catch(()=>null),cr=Dr(lr)??_e;Mr(g),l(cr),b(!0),re.currentTarget.reset();}catch{l(null),m("Newsletter signup failed. Please try again.");}finally{p(false);}}return jsxRuntime.jsx("section",{className:h("border-y border-[var(--blog-accent-border)] py-5 sm:py-6",a),"aria-labelledby":`newsletter-${r}-title`,children:jsxRuntime.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.4fr)] lg:items-end",children:[jsxRuntime.jsxs("div",{className:"max-w-xl space-y-1",children:[jsxRuntime.jsx("h2",{id:`newsletter-${r}-title`,className:"text-base leading-6 font-semibold",children:t.title}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm leading-6",children:t.description})]}),C?jsxRuntime.jsxs("div",{className:"flex items-start gap-3 text-sm leading-6 text-emerald-500",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-emerald-500/15",children:jsxRuntime.jsx(lucideReact.Check,{className:"size-3.5","aria-hidden":"true"})}),jsxRuntime.jsx("p",{children:s??_e})]}):jsxRuntime.jsxs("form",{onSubmit:H,className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,0.8fr)_minmax(0,1fr)_auto]",children:[jsxRuntime.jsx("label",{className:"sr-only",htmlFor:`newsletter-name-${r}`,children:"Name"}),jsxRuntime.jsx("input",{id:`newsletter-name-${r}`,name:"name",type:"text",autoComplete:"name",placeholder:"Name",className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring min-h-10 rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"}),jsxRuntime.jsx("label",{className:"sr-only",htmlFor:`newsletter-email-${r}`,children:"Email"}),jsxRuntime.jsx("input",{id:`newsletter-email-${r}`,name:"email",type:"email",autoComplete:"email",placeholder:"Email address",required:true,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring min-h-10 rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"}),jsxRuntime.jsx("input",{type:"text",name:"company",tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"hidden"}),jsxRuntime.jsxs("button",{type:"submit",disabled:f,className:"inline-flex min-h-10 w-full shrink-0 items-center justify-center gap-2 rounded-full bg-[var(--blog-accent)] px-5 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60 sm:w-auto",children:[f?"Submitting...":t.buttonLabel,jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"size-4","aria-hidden":"true"})]})]}),c&&jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:c})]})]})})}function _r(e){return e?.startsWith("http://")||e?.startsWith("https://")?e:typeof window<"u"?window.location.href:null}function et(e,t){let r=e.get(t);return typeof r=="string"?r:""}function Br(e,t){let r=et(e,t).trim();return r.length===0?null:r}function Or(e){return `bloggy_newsletter_subscribed_${e}`}function Er(e){if(typeof window>"u")return false;try{if(window.localStorage.getItem(e)==="true")return !0}catch{}return typeof document>"u"?false:document.cookie.split(";").some(t=>t.trim().startsWith(`${e}=true`))}function Mr(e){if(typeof window<"u")try{window.localStorage.setItem(e,"true");}catch{}typeof document<"u"&&(document.cookie=`${e}=true; Max-Age=31536000; Path=/; SameSite=Lax`);}function $r(e){return typeof window>"u"?()=>{}:(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e))}function Dr(e){return e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:null}function It({articles:e,siteName:t,siteTagline:r,className:n,site:o,includeStructuredData:i=false,basePath:a="/blog",pagination:s,theme:l,newsletter:c,newsletterPreviewMode:m=false}){let d=I(a)||"/",b=c??o?.newsletter,f=o?.id??e[0]?.site.id;return jsxRuntime.jsxs("div",{style:M(l),className:h("blog-home-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[t&&jsxRuntime.jsxs("header",{className:"blog-header mb-8 text-center sm:mb-12 lg:mb-16",children:[jsxRuntime.jsx("h1",{className:"blog-title mb-2 bg-linear-to-r from-[var(--blog-accent-hover)] to-[var(--blog-accent)] bg-clip-text text-3xl font-semibold tracking-tight text-balance text-transparent sm:text-4xl lg:text-5xl",children:t}),r&&jsxRuntime.jsx("p",{className:"blog-tagline text-muted-foreground text-base sm:text-lg",children:r})]}),jsxRuntime.jsxs("main",{className:"articles-list",children:[e.length===0?jsxRuntime.jsxs("div",{className:"no-articles text-muted-foreground py-16 text-center sm:py-24 lg:py-32",children:[jsxRuntime.jsx("h2",{className:"mb-3 text-xl font-light sm:mb-4 sm:text-2xl lg:text-3xl",children:"No articles yet"}),jsxRuntime.jsx("p",{className:"text-muted-foreground/70 mx-auto max-w-md text-base sm:text-lg",children:"This blog doesn't have any published articles yet."})]}):jsxRuntime.jsx("div",{className:"space-y-0",children:e.map(p=>jsxRuntime.jsx(jr,{article:p,basePath:d},p.id))}),s&&s.totalPages>1&&jsxRuntime.jsx("div",{className:"pagination-wrapper mt-12",children:jsxRuntime.jsx(ne,{currentPage:s.currentPage,totalPages:s.totalPages,baseUrl:s.baseUrl??d,className:"justify-center"})})]}),b?.enabled&&f&&jsxRuntime.jsx(fe,{siteId:f,settings:b,sourceSurface:"blog_home",previewMode:m,className:"mt-10 sm:mt-12"}),i&&o&&(()=>{let p=Q(Ye(o,e.slice(0,5),{pathPrefix:d}));return jsxRuntime.jsx("script",{type:p.type,dangerouslySetInnerHTML:p.dangerouslySetInnerHTML})})()]})}function Hr(e){return `${Math.ceil(e/60)} min read`}function jr({article:e,basePath:t}){let r=L(t,e.slug),n=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true}),o=Hr(e.readingSeconds),i=e.featuredImage;return jsxRuntime.jsxs("article",{className:"group border-border mb-6 block border-b pb-6 last:mb-0 last:border-b-0 last:pb-0 sm:mb-8 sm:pb-8",children:[jsxRuntime.jsxs("div",{className:"space-y-4 lg:hidden",children:[i&&jsxRuntime.jsx(X__default.default,{href:r,className:"focus-visible:ring-ring relative block aspect-[16/10] w-full overflow-hidden rounded-2xl focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","aria-label":`Read article: ${e.title}`,children:jsxRuntime.jsx(tt__default.default,{src:i,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:400,height:250,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(X__default.default,{href:r,className:"focus-visible:ring-ring block rounded-md hover:no-underline focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:jsxRuntime.jsx("h2",{className:"text-lg leading-tight font-bold text-balance transition-colors group-hover:text-[var(--blog-accent)] sm:text-xl md:text-2xl",children:e.title})}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[e.author&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tt,{author:e.author,basePath:t}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"})]}),jsxRuntime.jsx("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${n}`,children:n}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:o})]}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed sm:text-base",children:e.excerpt}),(e.topics??[]).length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:(e.topics??[]).map(a=>jsxRuntime.jsx("span",{className:"rounded-full border border-[var(--blog-accent-border)] px-2.5 py-1 text-xs font-medium text-[var(--blog-text-accent)]",children:a.name},a.id))})]})]}),jsxRuntime.jsxs("div",{className:"hidden items-start gap-6 lg:flex xl:gap-8",children:[i&&jsxRuntime.jsx(X__default.default,{href:r,className:"focus-visible:ring-ring relative block aspect-[16/10] w-64 shrink-0 overflow-hidden rounded-2xl focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none xl:w-72","aria-label":`Read article: ${e.title}`,children:jsxRuntime.jsx(tt__default.default,{src:i,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:288,height:180,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex min-h-[180px] flex-1 flex-col justify-between space-y-4 xl:min-h-[200px]",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(X__default.default,{href:r,className:"focus-visible:ring-ring block rounded-md hover:no-underline focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:jsxRuntime.jsx("h2",{className:"text-2xl leading-tight font-bold text-balance transition-colors group-hover:text-[var(--blog-accent)] xl:text-3xl",children:e.title})}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-base leading-relaxed xl:text-lg",children:e.excerpt}),(e.topics??[]).length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:(e.topics??[]).map(a=>jsxRuntime.jsx("span",{className:"rounded-full border border-[var(--blog-accent-border)] px-2.5 py-1 text-xs font-medium text-[var(--blog-text-accent)]",children:a.name},a.id))})]}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[e.author&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Tt,{author:e.author,basePath:t}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"})]}),jsxRuntime.jsx("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${n}`,children:n}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:o})]})]})]})]})}function Tt({author:e,basePath:t}){return jsxRuntime.jsxs(X__default.default,{href:R(t,e.slug),className:"inline-flex items-center gap-2 font-medium transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx(zr,{author:e,size:"sm"}),e.name]})}function zr({author:e,size:t}){let r=t==="md"?"h-9 w-9 text-sm":"h-6 w-6 text-xs",n=Gr(e.name);return e.avatarUrl?jsxRuntime.jsx(tt__default.default,{src:e.avatarUrl,alt:e.name,width:t==="md"?36:24,height:t==="md"?36:24,className:h("shrink-0 rounded-full object-cover",r),loading:"lazy"}):jsxRuntime.jsx("span",{className:h("bg-muted inline-flex shrink-0 items-center justify-center rounded-full font-medium",r),"aria-hidden":"true",children:n})}function Gr(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function Fr(e,t,r,n,o="/blog"){let i=e?`${e} - Blog`:"Blog",a=n&&n.currentPage>1?`${i} - Page ${n.currentPage}`:i,s=t??"Read our latest articles and insights.",l=I(o)||"/",c=r?`${r}${n&&n.currentPage>1?`${l}?page=${n.currentPage}`:l}`:void 0,m=n&&n.currentPage>1&&r?`${r}${n.currentPage===2?l:`${l}?page=${n.currentPage-1}`}`:void 0,d=n&&n.currentPage<n.totalPages&&r?`${r}${l}?page=${n.currentPage+1}`:void 0;return {title:a,description:s,openGraph:{title:a,description:s,type:"website",...r&&{url:c}},twitter:{card:"summary_large_image",title:a,description:s},alternates:{...c&&{canonical:c}},other:{...m&&{prev:m},...d&&{next:d}}}}var qr=classVarianceAuthority.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function be({className:e,variant:t,...r}){return jsxRuntime.jsx("div",{className:h(qr({variant:t}),e),...r})}function xe({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card",className:h("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Wr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-header",className:h("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Kr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-title",className:h("leading-none font-semibold",e),...t})}function Jr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-description",className:h("text-muted-foreground text-sm",e),...t})}function ye({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-content",className:h("px-6",e),...t})}function Yr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-footer",className:h("flex items-center px-6 [.border-t]:pt-6",e),...t})}function tn(e,t){try{return new URL(e).href}catch{if(!t)return e}try{return new URL(e,t).href}catch{return e}}async function Lt(e,t=globalThis.navigator?.clipboard,r=typeof document>"u"?void 0:document){if(t)try{await t.writeText(e);return}catch{}if(!r)throw new Error("Clipboard API is unavailable");let n=r.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",r.body.appendChild(n),n.select();try{if(!r.execCommand("copy"))throw new Error("Copy command failed")}finally{n.remove();}}async function rn(e,t=globalThis.navigator){return t?.share?(await t.share({title:e.title,url:e.url}),"shared"):(await Lt(e.url,t?.clipboard),"copied")}function Oe({title:e,url:t,className:r,size:n="md"}){let[o,i]=Be__namespace.default.useState(false),[a,s]=Be__namespace.default.useState(false),l=Be__namespace.default.useMemo(()=>tn(t,typeof window>"u"?void 0:window.location.href),[t]);Be__namespace.default.useEffect(()=>{if(!o)return;let f=window.setTimeout(()=>i(false),2e3);return ()=>window.clearTimeout(f)},[o]);async function c(){await Lt(l),i(true);}async function m(){s(true);try{await rn({title:e,url:l})==="copied"&&i(!0);}finally{s(false);}}let d=n==="sm"?"h-8 gap-1.5 px-2.5 text-xs":"h-9 gap-2 px-3 text-sm",b=n==="sm"?"size-3.5":"size-4";return jsxRuntime.jsxs("div",{className:h("article-top-actions flex flex-wrap items-center justify-center gap-2",r),children:[jsxRuntime.jsxs("button",{type:"button","aria-label":"Copy article link",onClick:c,className:h("text-muted-foreground hover:text-foreground border-border inline-flex items-center justify-center rounded-full border font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",d),children:[o?jsxRuntime.jsx(lucideReact.Check,{className:b,"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Copy,{className:b,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o?"Copied":"Copy link"})]}),jsxRuntime.jsxs("button",{type:"button","aria-label":"Share article",onClick:m,disabled:a,className:h("text-muted-foreground hover:text-foreground border-border inline-flex items-center justify-center rounded-full border font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)] disabled:cursor-wait disabled:opacity-60",d),children:[jsxRuntime.jsx(lucideReact.Share2,{className:b,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:"Share"})]})]})}function _t({alt:e="",className:t,src:r,...n}){if(typeof r!="string"||r.length===0)return jsxRuntime.jsx("img",{alt:e,className:t,...n});let o=`blog-image-preview-${nn(r)}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("a",{href:`#${o}`,className:"group mx-auto block cursor-zoom-in rounded-2xl focus-visible:ring-2 focus-visible:ring-[var(--blog-text-accent)] focus-visible:ring-offset-2 focus-visible:outline-none","aria-label":e?`Expand image: ${e}`:"Expand article image",children:jsxRuntime.jsx("img",{src:r,alt:e,className:h("mx-auto rounded-2xl border border-[var(--blog-accent-border)] shadow-[0_18px_60px_rgb(168_85_247_/_0.12)] transition-opacity group-hover:opacity-95",t),...n})}),jsxRuntime.jsxs("div",{id:o,className:"invisible fixed inset-0 z-50 flex opacity-0 transition-opacity target:visible target:opacity-100",role:"dialog","aria-modal":"true","aria-label":e?`Image preview: ${e}`:"Image preview",children:[jsxRuntime.jsx("a",{href:"#article-content",className:"absolute inset-0 bg-black/85 backdrop-blur-sm","aria-label":"Close image preview"}),jsxRuntime.jsx("div",{className:"pointer-events-none relative z-10 flex min-h-screen w-full items-center justify-center p-4 sm:p-6",children:jsxRuntime.jsx("img",{src:r,alt:e,className:"pointer-events-auto h-[88vh] w-[94vw] rounded-3xl object-contain shadow-2xl"})}),jsxRuntime.jsx("a",{href:"#article-content",className:"absolute top-4 right-4 z-20 inline-flex size-10 items-center justify-center rounded-full border border-white/20 bg-black/50 text-xl leading-none text-white no-underline transition-colors hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-white focus-visible:outline-none","aria-label":"Close image preview",children:"\xD7"})]})]})}function nn(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t).toString(36)}function nt({items:e,contentId:t,variant:r,showProgress:n=true}){let o=e[0]?.id??null;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("div",{"data-blog-reading-progress":t,className:"fixed inset-x-0 top-0 z-50 h-1 origin-left bg-[var(--blog-accent)] motion-safe:transition-transform",style:{transform:"scaleX(0)"},role:"progressbar","aria-label":"Reading progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0,suppressHydrationWarning:true}),jsxRuntime.jsx(an,{items:e,activeItemId:o,variant:r}),n&&jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:sn(t,e)}})]})}function an({items:e,activeItemId:t,variant:r}){if(e.length===0)return null;let n=jsxRuntime.jsx("ul",{className:"space-y-2 text-sm",children:e.map(o=>{let i=Rt(o.id,t);return jsxRuntime.jsx("li",{className:o.level===3?"pl-4":void 0,children:jsxRuntime.jsx("a",{href:`#${o.id}`,"aria-current":i.ariaCurrent,"data-blog-toc-link":o.id,"data-active":i.isActive?"true":"false",suppressHydrationWarning:true,className:"text-muted-foreground hover:text-[var(--blog-text-accent)] data-[active=true]:border-[var(--blog-accent)] data-[active=true]:text-[var(--blog-text-accent)] block border-l-2 border-transparent pl-3 leading-snug transition-colors",children:o.text})},o.id)})});return r==="mobile"?jsxRuntime.jsxs("details",{className:"group mb-6 rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] lg:hidden",children:[jsxRuntime.jsxs("summary",{className:"text-foreground flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx("span",{children:"On this page"}),jsxRuntime.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs font-medium",children:[Nt(e.length),jsxRuntime.jsx("span",{className:"text-[var(--blog-text-accent)] transition-transform group-open:rotate-180","aria-hidden":"true",children:"\u2193"})]})]}),jsxRuntime.jsx("nav",{"aria-label":"Table of contents",className:"border-t border-[var(--blog-accent-border)] px-4 py-4",children:n})]}):jsxRuntime.jsx("aside",{className:"hidden lg:block",children:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",className:"sticky top-24 max-h-[calc(100vh-8rem)] overflow-y-auto border-l border-border pl-5",children:[jsxRuntime.jsx("p",{className:"text-muted-foreground mb-3 text-xs font-semibold tracking-wider uppercase",children:"On this page"}),n]})})}function sn(e,t){return `
3
- (() => {
4
- const contentId = ${JSON.stringify(e)};
5
- const itemIds = ${JSON.stringify(t.map(r=>r.id))};
6
- const progressElement = document.querySelector('[data-blog-reading-progress="' + contentId + '"]');
7
- let animationFrameId = 0;
8
- let pendingHashItemId = decodeURIComponent(window.location.hash.replace(/^#/, ''));
9
-
10
- const normalizeProgress = (value) => {
11
- if (!Number.isFinite(value)) return 0;
12
- return Math.min(100, Math.max(0, value));
13
- };
14
-
15
- const setActiveItem = (activeItemId) => {
16
- const tocLinks = Array.from(document.querySelectorAll('[data-blog-toc-link]'));
17
-
18
- for (const link of tocLinks) {
19
- const isActive = link.getAttribute('data-blog-toc-link') === activeItemId;
20
- link.setAttribute('data-active', isActive ? 'true' : 'false');
21
- if (isActive) {
22
- link.setAttribute('aria-current', 'location');
23
- } else {
24
- link.removeAttribute('aria-current');
25
- }
26
- }
27
- };
28
-
29
- const updateScrollState = () => {
30
- const contentElement = document.getElementById(contentId);
31
- if (!contentElement) return;
32
-
33
- const contentRect = contentElement.getBoundingClientRect();
34
- const scrollTop = window.scrollY;
35
- const contentTop = contentRect.top + scrollTop;
36
- const readableDistance = contentElement.offsetHeight - window.innerHeight;
37
- const nextProgress = readableDistance <= 0
38
- ? scrollTop >= contentTop ? 100 : 0
39
- : ((scrollTop - contentTop) / readableDistance) * 100;
40
- const progress = normalizeProgress(nextProgress);
41
-
42
- if (progressElement) {
43
- progressElement.style.transform = 'scaleX(' + progress / 100 + ')';
44
- progressElement.setAttribute('aria-valuenow', String(Math.round(progress)));
45
- }
46
-
47
- const headings = itemIds
48
- .map((id) => document.getElementById(id))
49
- .filter(Boolean);
50
- if (pendingHashItemId && itemIds.includes(pendingHashItemId)) {
51
- setActiveItem(pendingHashItemId);
52
- pendingHashItemId = '';
53
- return;
54
- }
55
-
56
- const activeOffset = Math.max(160, Math.round(window.innerHeight * 0.33));
57
- const activeHeading = headings
58
- .filter((heading) => heading.getBoundingClientRect().top <= activeOffset)
59
- .at(-1) || headings[0] || null;
60
-
61
- setActiveItem(activeHeading ? activeHeading.id : null);
62
- };
63
-
64
- const scheduleUpdate = () => {
65
- window.cancelAnimationFrame(animationFrameId);
66
- animationFrameId = window.requestAnimationFrame(updateScrollState);
67
- };
68
-
69
- scheduleUpdate();
70
- window.addEventListener('scroll', scheduleUpdate, { passive: true });
71
- window.addEventListener('resize', scheduleUpdate);
72
- window.addEventListener('hashchange', () => {
73
- pendingHashItemId = decodeURIComponent(window.location.hash.replace(/^#/, ''));
74
- scheduleUpdate();
75
- });
76
- })();
77
- `}var ee=Be__namespace.forwardRef(({className:e,orientation:t="horizontal",decorative:r=true,...n},o)=>jsxRuntime.jsx(it__namespace.Root,{ref:o,decorative:r,orientation:t,className:h("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ee.displayName=it__namespace.Root.displayName;var Ot={mdxOptions:{remarkPlugins:[dn__default.default,un__default.default],rehypePlugins:[pn,mn__default.default]}};function pn(){return e=>{Et(e);}}function Et(e){e.children&&(e.children=e.children.flatMap(t=>(Et(t),gn(t)?t.children?.filter(ot)??[t]:[t])));}function gn(e){if(e.type!=="element"||e.tagName!=="p"||!e.children)return false;let t=e.children.filter(ot);return t.length===1&&fn(t[0])}function fn(e){if(e?.type!=="element")return false;if(e.tagName==="img")return true;if(e.tagName!=="a"||!e.children)return false;let t=e.children.filter(ot);return t.length===1&&t[0]?.tagName==="img"}function ot(e){return e.type!=="text"||!!e.value?.trim()}function Pn(e){return `${Math.ceil(e/60)} min read`}function An(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function wn({creditText:e,creditUrl:t}){if(!e&&!t)return null;let r=e??An(t??"");return jsxRuntime.jsxs("span",{children:["Credit:"," ",t?jsxRuntime.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 transition-colors hover:text-[var(--blog-text-accent)]",children:r}):r]})}function Ht({article:e,className:t,navigation:r,basePath:n="/blog",theme:o,postArticleCta:i,newsletter:a,newsletterPreviewMode:s=false,relatedArticles:l=[],showShareLinks:c=true}){let m=I(n)||"/",d=Qe(e.publishedAt,e.updatedAt),b=Pn(e.readingSeconds),f=Ze(e.content),p=e.meta.canonicalUrl??L(m,e.slug),g=a??e.site.newsletter,v=e.featuredImage,C=!!(e.featuredImageCaption??e.featuredImageCreditText??e.featuredImageCreditUrl);return jsxRuntime.jsxs("article",{style:M(o),className:h("article-page mx-auto max-w-6xl px-4 py-6 pb-12 sm:px-6 sm:py-8 sm:pb-16 lg:px-8 lg:py-12 lg:pb-24",t),children:[r?.backToHome&&jsxRuntime.jsx("header",{className:"mx-auto mb-8 max-w-4xl sm:mb-12 lg:mb-16",children:jsxRuntime.jsxs(X__default.default,{href:r.backToHome.url,className:"text-muted-foreground group focus-visible:ring-ring inline-flex touch-manipulation items-center space-x-2 rounded-md px-2 py-1 transition-colors hover:text-[var(--blog-accent)] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none sm:space-x-3","aria-label":r.backToHome.label??"Return to blog",children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-4 w-4 transition-transform group-hover:-translate-x-1 sm:h-5 sm:w-5","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"text-sm font-medium sm:text-base",children:[jsxRuntime.jsx("span",{className:"hidden sm:inline",children:r.backToHome.label??"Back to all articles"}),jsxRuntime.jsx("span",{className:"sm:hidden",children:"Back"})]})]})}),jsxRuntime.jsx("style",{children:`
1
+ 'use strict';var J=require('next/link'),lt=require('next/image'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),lucideReact=require('lucide-react'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),jsxRuntime=require('react/jsx-runtime'),dateFns=require('date-fns'),Ue=require('react'),rsc=require('next-mdx-remote-client/rsc'),fa6=require('react-icons/fa6'),dt=require('@radix-ui/react-separator'),hn=require('remark-gfm'),bn=require('remark-toc'),xn=require('rehype-slug'),crypto=require('crypto'),ratelimit=require('@upstash/ratelimit'),redis=require('@upstash/redis'),drizzleOrm=require('drizzle-orm'),sqliteCore=require('drizzle-orm/sqlite-core'),server=require('next/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var J__default=/*#__PURE__*/_interopDefault(J);var lt__default=/*#__PURE__*/_interopDefault(lt);var Ue__namespace=/*#__PURE__*/_interopNamespace(Ue);var dt__namespace=/*#__PURE__*/_interopNamespace(dt);var hn__default=/*#__PURE__*/_interopDefault(hn);var bn__default=/*#__PURE__*/_interopDefault(bn);var xn__default=/*#__PURE__*/_interopDefault(xn);function h(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Be=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none 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",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function br({className:e,variant:t,size:r,asChild:n=false,...o}){return jsxRuntime.jsx(n?reactSlot.Slot:"button",{"data-slot":"button",className:h(Be({variant:t,size:r,className:e})),...o})}function Je({className:e,...t}){return jsxRuntime.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:h("mx-auto flex w-full justify-center",e),...t})}function Ye({className:e,...t}){return jsxRuntime.jsx("ul",{"data-slot":"pagination-content",className:h("flex flex-row items-center gap-1",e),...t})}function K({...e}){return jsxRuntime.jsx("li",{"data-slot":"pagination-item",...e})}function ne({className:e,isActive:t,size:r="icon",...n}){return jsxRuntime.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:h(Be({variant:t?"outline":"ghost",size:r}),e),...n})}function Qe({className:e,...t}){return jsxRuntime.jsxs(ne,{"aria-label":"Go to previous page",size:"default",className:h("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[jsxRuntime.jsx(lucideReact.ChevronLeftIcon,{}),jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function Ze({className:e,...t}){return jsxRuntime.jsxs(ne,{"aria-label":"Go to next page",size:"default",className:h("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Next"}),jsxRuntime.jsx(lucideReact.ChevronRightIcon,{})]})}function Ee({className:e,...t}){return jsxRuntime.jsxs("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:h("flex size-9 items-center justify-center",e),...t,children:[jsxRuntime.jsx(lucideReact.MoreHorizontalIcon,{className:"size-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"More pages"})]})}function ce({currentPage:e,totalPages:t,baseUrl:r,className:n,maxVisiblePages:o=5,showPrevNext:i=true,showFirstLast:a=true}){if(t<=1)return null;let c=()=>{let g=Math.floor(o/2),p=Math.max(1,e-g),x=Math.min(t,p+o-1);return x-p+1<o&&(p=Math.max(1,x-o+1)),{start:p,end:x}},{start:l,end:u}=c(),m=Array.from({length:u-l+1},(g,p)=>l+p),s=g=>g===1?r:`${r}?page=${g}`,b=e>1,f=e<t;return jsxRuntime.jsxs(Je,{className:n,children:[jsxRuntime.jsxs(Ye,{children:[a&&e>2&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(K,{children:jsxRuntime.jsx(ne,{href:s(1),"aria-label":"Go to first page",children:jsxRuntime.jsx(lucideReact.ChevronsLeft,{className:"h-4 w-4"})})}),l>2&&jsxRuntime.jsx(K,{children:jsxRuntime.jsx(Ee,{})})]}),i&&jsxRuntime.jsx(K,{children:b?jsxRuntime.jsx(Qe,{href:s(e-1)}):jsxRuntime.jsx("span",{className:"flex h-9 items-center justify-center gap-1 px-2.5 text-muted-foreground sm:pl-2.5",children:jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Previous"})})}),m.map(g=>jsxRuntime.jsx(K,{children:jsxRuntime.jsx(ne,{href:s(g),isActive:g===e,children:g})},g)),i&&jsxRuntime.jsx(K,{children:f?jsxRuntime.jsx(Ze,{href:s(e+1)}):jsxRuntime.jsx("span",{className:"flex h-9 items-center justify-center gap-1 px-2.5 text-muted-foreground sm:pr-2.5",children:jsxRuntime.jsx("span",{className:"hidden sm:block",children:"Next"})})}),a&&e<t-1&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[u<t-1&&jsxRuntime.jsx(K,{children:jsxRuntime.jsx(Ee,{})}),jsxRuntime.jsx(K,{children:jsxRuntime.jsx(ne,{href:s(t),"aria-label":"Go to last page",children:jsxRuntime.jsx(lucideReact.ChevronsRight,{className:"h-4 w-4"})})})]})]}),jsxRuntime.jsxs("div",{className:"sr-only","aria-live":"polite",children:["Page ",e," of ",t]})]})}function Sr(e,t=10){let r=e.page,n=Array.isArray(r)?r[0]:r,o=Math.max(1,parseInt(n??"1",10)),i=(o-1)*t;return {currentPage:o,itemsPerPage:t,offset:i,calculateTotalPages:c=>Math.ceil(c/t)}}function Nr(e,t,r,n){let o=n?`${n}${e===1?r:`${r}?page=${e}`}`:void 0,i=e>1&&n?`${n}${e===2?r:`${r}?page=${e-1}`}`:void 0,a=e<t&&n?`${n}${r}?page=${e+1}`:void 0;return {alternates:{...o&&{canonical:o}},other:{...i&&{prev:i},...a&&{next:a}}}}function E(e="/blog"){let t=e.trim();return !t||t==="/"?"":t.replace(/^(?!\/)/,"/").replace(/\/+$/,"")}function S(e,t){let r=E(e),n=t?.replace(/^\/+/,"").replace(/\/+$/,"");return n?`${r}/${n}`.replace(/\/+/g,"/"):r||"/"}function k(e,t){return S(e,`authors/${t}`)}function Tr(e){let t=new URL(e);return E(t.pathname)}function Oe(e,t={}){let{customDomain:r,pathPrefix:n="/blog",language:o,isAccessibleForFree:i=true,includeOptionalProperties:a=true}=t,c=r??e.site.domain,l=r?`https://${c}${n}/${e.slug}`:e.meta.canonicalUrl??`https://${c}${n}/${e.slug}`,u=e.author?Me(e.author,{customDomain:r,pathPrefix:n}):void 0,m=tt(e.site,{customDomain:r,pathPrefix:n}),b=`PT${Math.max(1,Math.ceil(e.readingSeconds/60))}M`,f={"@context":"https://schema.org","@type":"BlogPosting","@id":`${l}#article`,headline:e.title,description:e.excerpt,datePublished:e.publishedAt,dateModified:e.updatedAt,author:u,publisher:m,mainEntityOfPage:{"@type":"WebPage","@id":l},wordCount:e.wordCount,timeRequired:b,isAccessibleForFree:i};return a&&(e.featuredImage&&(f.image=e.featuredImage),e.meta.keywords.length>0&&(f.keywords=[...e.meta.keywords]),(o??e.site.locale)&&(f.inLanguage=o??e.site.locale),e.site.toneAdjectives.length>0&&(f.about=e.site.toneAdjectives.map(g=>({"@type":"Thing",name:g}))),e.site.toneAdjectives.length>0&&(f.genre=[...e.site.toneAdjectives])),f}function Me(e,t={}){let{customDomain:r,pathPrefix:n="/blog"}=t,o={"@context":"https://schema.org","@type":"Person","@id":`#author-${e.id}`,name:e.name,identifier:e.id};e.bio&&(o.description=e.bio),e.avatarUrl&&(o.image=e.avatarUrl);let i=[e.socialLinks?.website,e.socialLinks?.x,e.socialLinks?.linkedin,e.socialLinks?.github].filter(a=>!!a);if(i.length>0&&(o.sameAs=i),e.slug?.trim()){let a=r?`https://${r}${k(n,e.slug)}`:k(n,e.slug);o.url=a;}return e.isGuest&&(o.additionalType="GuestAuthor"),e.toneAdjectives&&e.toneAdjectives.length>0&&(o.knowsAbout=[...e.toneAdjectives]),o}function tt(e,t={}){let{customDomain:r,pathPrefix:n="/blog"}=t,i=`https://${r??e.domain}${n}`,a={"@context":"https://schema.org","@type":"Organization","@id":`${i}#organization`,name:e.name,url:i};return e.description?.trim()&&(a.description=e.description),e.tagline?.trim()&&(a.description=a.description?`${a.description}. ${e.tagline}`:e.tagline),a}function rt(e,t={}){let{customDomain:r,pathPrefix:n="/blog",language:o,includeSearchAction:i=true}=t,c=`https://${r??e.domain}${n}`,l=tt(e,t),u={"@context":"https://schema.org","@type":"WebSite","@id":`${c}#website`,name:e.name,url:c,publisher:l};return e.description?.trim()&&(u.description=e.description),(o??e.locale)&&(u.inLanguage=o??e.locale),i&&(u.potentialAction={"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${c}?search={search_term_string}`},"query-input":"required name=search_term_string"}),u}function Nt(e,t={}){let{customDomain:r}=t;return {"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((n,o)=>({"@type":"ListItem",position:o+1,name:n.name,item:r&&!n.url.startsWith("http")?`https://${r}${n.url}`:n.url}))}}function nt(e,t={}){let r=[];r.push(Oe(e,t)),r.push(rt(e.site,t));let n=t.pathPrefix??"/blog",o=[{name:"Home",url:"/"},{name:e.site.name,url:n},{name:e.title,url:`${n}/${e.slug}`}];return r.push(Nt(o,t)),r}function it(e,t=[],r={}){let n=[];if(n.push(rt(e,r)),t.length>0){let o=t.slice(0,5).map(i=>Oe(i,r));n.push(...o);}return n}function Tt(e){let t=[];if(e["@context"]?e["@context"]!=="https://schema.org"&&t.push("@context must be 'https://schema.org'"):t.push("Missing required @context property"),e["@type"]||t.push("Missing required @type property"),e["@type"]==="BlogPosting"){let r=e;r.headline||t.push("BlogPosting: Missing required headline"),r.datePublished||t.push("BlogPosting: Missing required datePublished"),r.author||t.push("BlogPosting: Missing required author"),r.publisher||t.push("BlogPosting: Missing required publisher");}return e["@type"]==="Person"&&(e.name||t.push("Person: Missing required name")),e["@type"]==="Organization"&&(e.name||t.push("Organization: Missing required name")),{isValid:t.length===0,errors:t}}function Rt(e){return JSON.stringify(e,null,0)}function ie(e){return {type:"application/ld+json",dangerouslySetInnerHTML:{__html:Rt(e)}}}function Rr(e){let t=new Set;return e.meta.keywords.forEach(r=>t.add(r)),e.site.toneAdjectives.forEach(r=>t.add(r)),e.author&&e.author.toneAdjectives.forEach(r=>t.add(r)),Array.from(t)}var Pe=class extends Error{constructor(r,n,o){super(r);this.code=n;this.details=o;this.name="StructuredDataError";}code;details};function Cr(e,t={}){try{let r=Oe(e,t),n=Tt(r);return n.isValid?{schema:r}:{error:new Pe("Generated schema validation failed","VALIDATION_FAILED",n.errors)}}catch(r){return {error:new Pe("Failed to generate structured data","GENERATION_FAILED",r)}}}var G="bg-linear-to-br from-[var(--blog-accent-hover)] via-[var(--blog-text-accent)] to-fuchsia-200 bg-clip-text text-transparent",ue={accentColor:"hsl(var(--primary))",accentHoverColor:"hsl(var(--primary))",textAccentColor:"hsl(var(--primary))",textAccentHoverColor:"hsl(var(--primary))",accentBackgroundColor:"hsl(var(--primary) / 0.08)",accentBorderColor:"hsl(var(--primary) / 0.25)"};function U(e={}){return {"--blog-accent":e.accentColor??ue.accentColor,"--blog-accent-hover":e.accentHoverColor??ue.accentHoverColor,"--blog-text-accent":e.textAccentColor??e.accentColor??ue.textAccentColor,"--blog-text-accent-hover":e.textAccentHoverColor??e.accentHoverColor??ue.textAccentHoverColor,"--blog-accent-bg":e.accentBackgroundColor??ue.accentBackgroundColor,"--blog-accent-border":e.accentBorderColor??ue.accentBorderColor}}function ot(e,t){let r=new Date(e),n=new Date(t);return {publishedDateLabel:dateFns.format(r,"d MMMM yyyy"),publishedRelativeLabel:dateFns.formatDistanceToNow(r,{addSuffix:true}),updatedDateLabel:dateFns.format(n,"d MMMM yyyy"),isUpdated:n.getTime()!==r.getTime()}}function at(e){let t=[],r=false;for(let n of e.split(`
2
+ `)){if(/^\s*```/.test(n)){r=!r;continue}if(r)continue;let o=/^(#{2,3})\s+(.+?)\s*#*\s*$/.exec(n);if(!o?.[1]||!o[2])continue;let i=kr(o[2]);i&&t.push({id:_r(i),text:i,level:o[1].length});}return t}function Lt(e){return `${e} ${e===1?"section":"sections"}`}function kt(e,t){let r=e===t;return {isActive:r,ariaCurrent:r?"location":void 0}}function kr(e){return e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`~]/g,"").replace(/<[^>]+>/g,"").replace(/\s+/g," ").trim()}function _r(e){return e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-")}var De="Thanks, you're on the list. We'll confirm before sending updates.";function Ae({siteId:e,settings:t,sourceSurface:r,sourceArticleSlug:n,sourceUrl:o,previewMode:i=false,className:a}){let[c,l]=Ue.useState(null),[u,m]=Ue.useState(null),[s,b]=Ue.useState(false),[f,g]=Ue.useState(false),p=$r(e),x=Ue.useSyncExternalStore(Hr,()=>Dr(p),()=>false),N=s||!i&&x;async function L(w){w.preventDefault(),m(null),l(null);let B=new FormData(w.currentTarget),ye=st(B,"company");if(i){l(De),b(true),w.currentTarget.reset();return}g(true);try{let le=await fetch(`${t.captureBaseUrl.replace(/\/$/,"")}/api/newsletter/subscribe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteId:Number(e),publicSubscribeToken:t.publicSubscribeToken,email:st(B,"email"),name:Mr(B,"name"),sourceSurface:r,sourceUrl:Or(o),sourceArticleSlug:n??null,honeypot:ye})});if(!le.ok)throw new Error("Newsletter signup failed.");let Ke=await le.json().catch(()=>null),mr=Gr(Ke)??De;Ur(p),l(mr),b(!0),w.currentTarget.reset();}catch{l(null),m("Newsletter signup failed. Please try again.");}finally{g(false);}}return jsxRuntime.jsx("section",{className:h("border-y border-[var(--blog-accent-border)] py-5 sm:py-6",a),"aria-labelledby":`newsletter-${r}-title`,children:jsxRuntime.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,0.9fr)_minmax(0,1.4fr)] lg:items-end",children:[jsxRuntime.jsxs("div",{className:"max-w-xl space-y-1",children:[jsxRuntime.jsx("h2",{id:`newsletter-${r}-title`,className:"text-base leading-6 font-semibold",children:t.title}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm leading-6",children:t.description})]}),N?jsxRuntime.jsxs("div",{className:"flex items-start gap-3 text-sm leading-6 text-emerald-500",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("span",{className:"mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-emerald-500/15",children:jsxRuntime.jsx(lucideReact.Check,{className:"size-3.5","aria-hidden":"true"})}),jsxRuntime.jsx("p",{children:c??De})]}):jsxRuntime.jsxs("form",{onSubmit:L,className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"grid gap-2 sm:grid-cols-[minmax(0,0.8fr)_minmax(0,1fr)_auto]",children:[jsxRuntime.jsx("label",{className:"sr-only",htmlFor:`newsletter-name-${r}`,children:"Name"}),jsxRuntime.jsx("input",{id:`newsletter-name-${r}`,name:"name",type:"text",autoComplete:"name",placeholder:"Name",className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring min-h-10 rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"}),jsxRuntime.jsx("label",{className:"sr-only",htmlFor:`newsletter-email-${r}`,children:"Email"}),jsxRuntime.jsx("input",{id:`newsletter-email-${r}`,name:"email",type:"email",autoComplete:"email",placeholder:"Email address",required:true,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:ring-ring min-h-10 rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none"}),jsxRuntime.jsx("input",{type:"text",name:"company",tabIndex:-1,autoComplete:"off","aria-hidden":"true",className:"hidden"}),jsxRuntime.jsxs("button",{type:"submit",disabled:f,className:"inline-flex min-h-10 w-full shrink-0 items-center justify-center gap-2 rounded-full bg-[var(--blog-accent)] px-5 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60 sm:w-auto",children:[f?"Submitting...":t.buttonLabel,jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"size-4","aria-hidden":"true"})]})]}),u&&jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:u})]})]})})}function Or(e){return e?.startsWith("http://")||e?.startsWith("https://")?e:typeof window<"u"?window.location.href:null}function st(e,t){let r=e.get(t);return typeof r=="string"?r:""}function Mr(e,t){let r=st(e,t).trim();return r.length===0?null:r}function $r(e){return `bloggy_newsletter_subscribed_${e}`}function Dr(e){if(typeof window>"u")return false;try{if(window.localStorage.getItem(e)==="true")return !0}catch{}return typeof document>"u"?false:document.cookie.split(";").some(t=>t.trim().startsWith(`${e}=true`))}function Ur(e){if(typeof window<"u")try{window.localStorage.setItem(e,"true");}catch{}typeof document<"u"&&(document.cookie=`${e}=true; Max-Age=31536000; Path=/; SameSite=Lax`);}function Hr(e){return typeof window>"u"?()=>{}:(window.addEventListener("storage",e),()=>window.removeEventListener("storage",e))}function Gr(e){return e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"?e.message:null}function Et({articles:e,siteName:t,siteTagline:r,className:n,site:o,includeStructuredData:i=false,basePath:a="/blog",pagination:c,theme:l,newsletter:u,newsletterPreviewMode:m=false}){let s=E(a)||"/",b=u??o?.newsletter,f=o?.id??e[0]?.site.id;return jsxRuntime.jsxs("div",{style:U(l),className:h("blog-home-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[t&&jsxRuntime.jsxs("header",{className:"blog-header mb-8 text-center sm:mb-12 lg:mb-16",children:[jsxRuntime.jsx("h1",{className:h("blog-title mb-2 text-3xl font-light tracking-tight text-balance sm:text-4xl lg:text-5xl",G),children:t}),r&&jsxRuntime.jsx("p",{className:"blog-tagline text-muted-foreground text-base sm:text-lg",children:r}),jsxRuntime.jsxs("nav",{"aria-label":"Browse blog",className:"mt-5 flex flex-wrap items-center justify-center gap-2 text-sm",children:[jsxRuntime.jsx(J__default.default,{href:s,"aria-current":"page",className:"rounded-full border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] px-3 py-1.5 font-medium text-[var(--blog-text-accent)] transition-colors hover:border-[var(--blog-text-accent)] hover:text-[var(--blog-text-accent-hover)] hover:no-underline",children:"All articles"}),jsxRuntime.jsx(J__default.default,{href:S(s,"topics"),className:"text-muted-foreground rounded-full border border-transparent px-3 py-1.5 font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:text-[var(--blog-accent)] hover:no-underline",children:"Topics"}),jsxRuntime.jsx(J__default.default,{href:S(s,"authors"),className:"text-muted-foreground rounded-full border border-transparent px-3 py-1.5 font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:text-[var(--blog-accent)] hover:no-underline",children:"Authors"})]})]}),jsxRuntime.jsxs("main",{className:"articles-list",children:[e.length===0?jsxRuntime.jsxs("div",{className:"no-articles text-muted-foreground py-16 text-center sm:py-24 lg:py-32",children:[jsxRuntime.jsx("h2",{className:"mb-3 text-xl font-light sm:mb-4 sm:text-2xl lg:text-3xl",children:"No articles yet"}),jsxRuntime.jsx("p",{className:"text-muted-foreground/70 mx-auto max-w-md text-base sm:text-lg",children:"This blog doesn't have any published articles yet."})]}):jsxRuntime.jsx("div",{className:"space-y-0",children:e.map(g=>jsxRuntime.jsx(zr,{article:g,basePath:s},g.id))}),c&&c.totalPages>1&&jsxRuntime.jsx("div",{className:"pagination-wrapper mt-12",children:jsxRuntime.jsx(ce,{currentPage:c.currentPage,totalPages:c.totalPages,baseUrl:c.baseUrl??s,className:"justify-center"})})]}),b?.enabled&&f&&jsxRuntime.jsx(Ae,{siteId:f,settings:b,sourceSurface:"blog_home",previewMode:m,className:"mt-10 sm:mt-12"}),i&&o&&(()=>{let g=ie(it(o,e.slice(0,5),{pathPrefix:s}));return jsxRuntime.jsx("script",{type:g.type,dangerouslySetInnerHTML:g.dangerouslySetInnerHTML})})()]})}function Fr(e){return `${Math.ceil(e/60)} min read`}function zr({article:e,basePath:t}){let r=S(t,e.slug),n=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true}),o=Fr(e.readingSeconds),i=e.featuredImage;return jsxRuntime.jsxs("article",{className:"group border-border mb-6 block border-b pb-6 last:mb-0 last:border-b-0 last:pb-0 sm:mb-8 sm:pb-8",children:[jsxRuntime.jsxs("div",{className:"space-y-4 lg:hidden",children:[i&&jsxRuntime.jsx(J__default.default,{href:r,className:"focus-visible:ring-ring relative block aspect-[16/10] w-full overflow-hidden rounded-2xl focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","aria-label":`Read article: ${e.title}`,children:jsxRuntime.jsx(lt__default.default,{src:i,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:400,height:250,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsx(J__default.default,{href:r,className:"focus-visible:ring-ring block rounded-md hover:no-underline focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:jsxRuntime.jsx("h2",{className:"text-lg leading-tight font-bold text-balance transition-colors group-hover:text-[var(--blog-accent)] sm:text-xl md:text-2xl",children:e.title})}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[e.author&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(It,{author:e.author,basePath:t}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"})]}),jsxRuntime.jsx("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${n}`,children:n}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:o})]}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed sm:text-base",children:e.excerpt}),(e.topics??[]).length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:(e.topics??[]).map(a=>jsxRuntime.jsx(_t,{topic:a,basePath:t},a.id))})]})]}),jsxRuntime.jsxs("div",{className:"hidden items-start gap-6 lg:flex xl:gap-8",children:[i&&jsxRuntime.jsx(J__default.default,{href:r,className:"focus-visible:ring-ring relative block aspect-[16/10] w-64 shrink-0 overflow-hidden rounded-2xl focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none xl:w-72","aria-label":`Read article: ${e.title}`,children:jsxRuntime.jsx(lt__default.default,{src:i,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:288,height:180,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"flex min-h-[180px] flex-1 flex-col justify-between space-y-4 xl:min-h-[200px]",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(J__default.default,{href:r,className:"focus-visible:ring-ring block rounded-md hover:no-underline focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:jsxRuntime.jsx("h2",{className:"text-2xl leading-tight font-bold text-balance transition-colors group-hover:text-[var(--blog-accent)] xl:text-3xl",children:e.title})}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-base leading-relaxed xl:text-lg",children:e.excerpt}),(e.topics??[]).length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:(e.topics??[]).map(a=>jsxRuntime.jsx(_t,{topic:a,basePath:t},a.id))})]}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[e.author&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(It,{author:e.author,basePath:t}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"})]}),jsxRuntime.jsx("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${n}`,children:n}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:o})]})]})]})]})}function _t({topic:e,basePath:t}){let r="rounded-full border border-[var(--blog-accent-border)] px-2.5 py-1 text-xs font-medium text-[var(--blog-text-accent)] transition-colors hover:border-[var(--blog-text-accent)] hover:text-[var(--blog-text-accent-hover)]",n=e.slug.trim();return n?jsxRuntime.jsx(J__default.default,{href:S(t,`topics/${n}`),className:r,children:e.name}):jsxRuntime.jsx("span",{className:r,children:e.name})}function It({author:e,basePath:t}){return jsxRuntime.jsxs(J__default.default,{href:k(t,e.slug),className:"inline-flex items-center gap-2 font-medium transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx(Vr,{author:e,size:"sm"}),e.name]})}function Vr({author:e,size:t}){let r=t==="md"?"h-9 w-9 text-sm":"h-6 w-6 text-xs",n=qr(e.name);return e.avatarUrl?jsxRuntime.jsx(lt__default.default,{src:e.avatarUrl,alt:e.name,width:t==="md"?36:24,height:t==="md"?36:24,className:h("shrink-0 rounded-full object-cover",r),loading:"lazy"}):jsxRuntime.jsx("span",{className:h("bg-muted inline-flex shrink-0 items-center justify-center rounded-full font-medium",r),"aria-hidden":"true",children:n})}function qr(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function Xr(e,t,r,n,o="/blog"){let i=e?`${e} - Blog`:"Blog",a=n&&n.currentPage>1?`${i} - Page ${n.currentPage}`:i,c=t??"Read our latest articles and insights.",l=E(o)||"/",u=r?`${r}${n&&n.currentPage>1?`${l}?page=${n.currentPage}`:l}`:void 0,m=n&&n.currentPage>1&&r?`${r}${n.currentPage===2?l:`${l}?page=${n.currentPage-1}`}`:void 0,s=n&&n.currentPage<n.totalPages&&r?`${r}${l}?page=${n.currentPage+1}`:void 0;return {title:a,description:c,openGraph:{title:a,description:c,type:"website",...r&&{url:u}},twitter:{card:"summary_large_image",title:a,description:c},alternates:{...u&&{canonical:u}},other:{...m&&{prev:m},...s&&{next:s}}}}var Kr=classVarianceAuthority.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function we({className:e,variant:t,...r}){return jsxRuntime.jsx("div",{className:h(Kr({variant:t}),e),...r})}function Se({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card",className:h("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Yr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-header",className:h("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Qr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-title",className:h("leading-none font-semibold",e),...t})}function Zr({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-description",className:h("text-muted-foreground text-sm",e),...t})}function Ne({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-content",className:h("px-6",e),...t})}function en({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"card-footer",className:h("flex items-center px-6 [.border-t]:pt-6",e),...t})}function on(e,t){try{return new URL(e).href}catch{if(!t)return e}try{return new URL(e,t).href}catch{return e}}async function Ot(e,t=globalThis.navigator?.clipboard,r=typeof document>"u"?void 0:document){if(t)try{await t.writeText(e);return}catch{}if(!r)throw new Error("Clipboard API is unavailable");let n=r.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style.position="fixed",n.style.left="-9999px",r.body.appendChild(n),n.select();try{if(!r.execCommand("copy"))throw new Error("Copy command failed")}finally{n.remove();}}async function an(e,t=globalThis.navigator){return t?.share?(await t.share({title:e.title,url:e.url}),"shared"):(await Ot(e.url,t?.clipboard),"copied")}function He({title:e,url:t,className:r,size:n="md"}){let[o,i]=Ue__namespace.default.useState(false),[a,c]=Ue__namespace.default.useState(false),l=Ue__namespace.default.useMemo(()=>on(t,typeof window>"u"?void 0:window.location.href),[t]);Ue__namespace.default.useEffect(()=>{if(!o)return;let f=window.setTimeout(()=>i(false),2e3);return ()=>window.clearTimeout(f)},[o]);async function u(){await Ot(l),i(true);}async function m(){c(true);try{await an({title:e,url:l})==="copied"&&i(!0);}finally{c(false);}}let s=n==="sm"?"h-8 gap-1.5 px-2.5 text-xs":"h-9 gap-2 px-3 text-sm",b=n==="sm"?"size-3.5":"size-4";return jsxRuntime.jsxs("div",{className:h("article-top-actions flex flex-wrap items-center justify-center gap-2",r),children:[jsxRuntime.jsxs("button",{type:"button","aria-label":"Copy article link",onClick:u,className:h("text-muted-foreground hover:text-foreground border-border inline-flex items-center justify-center rounded-full border font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",s),children:[o?jsxRuntime.jsx(lucideReact.Check,{className:b,"aria-hidden":"true"}):jsxRuntime.jsx(lucideReact.Copy,{className:b,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:o?"Copied":"Copy link"})]}),jsxRuntime.jsxs("button",{type:"button","aria-label":"Share article",onClick:m,disabled:a,className:h("text-muted-foreground hover:text-foreground border-border inline-flex items-center justify-center rounded-full border font-medium transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)] disabled:cursor-wait disabled:opacity-60",s),children:[jsxRuntime.jsx(lucideReact.Share2,{className:b,"aria-hidden":"true"}),jsxRuntime.jsx("span",{children:"Share"})]})]})}function $t({alt:e="",className:t,src:r,...n}){if(typeof r!="string"||r.length===0)return jsxRuntime.jsx("img",{alt:e,className:t,...n});let o=`blog-image-preview-${sn(r)}`;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("a",{href:`#${o}`,className:"group mx-auto block cursor-zoom-in rounded-2xl focus-visible:ring-2 focus-visible:ring-[var(--blog-text-accent)] focus-visible:ring-offset-2 focus-visible:outline-none","aria-label":e?`Expand image: ${e}`:"Expand article image",children:jsxRuntime.jsx("img",{src:r,alt:e,className:h("mx-auto rounded-2xl border border-[var(--blog-accent-border)] shadow-[0_18px_60px_rgb(168_85_247_/_0.12)] transition-opacity group-hover:opacity-95",t),...n})}),jsxRuntime.jsxs("div",{id:o,className:"invisible fixed inset-0 z-50 flex opacity-0 transition-opacity target:visible target:opacity-100",role:"dialog","aria-modal":"true","aria-label":e?`Image preview: ${e}`:"Image preview",children:[jsxRuntime.jsx("a",{href:"#article-content",className:"absolute inset-0 bg-black/85 backdrop-blur-sm","aria-label":"Close image preview"}),jsxRuntime.jsx("div",{className:"pointer-events-none relative z-10 flex min-h-screen w-full items-center justify-center p-4 sm:p-6",children:jsxRuntime.jsx("img",{src:r,alt:e,className:"pointer-events-auto h-[88vh] w-[94vw] rounded-3xl object-contain shadow-2xl"})}),jsxRuntime.jsx("a",{href:"#article-content",className:"absolute top-4 right-4 z-20 inline-flex size-10 items-center justify-center rounded-full border border-white/20 bg-black/50 text-xl leading-none text-white no-underline transition-colors hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-white focus-visible:outline-none","aria-label":"Close image preview",children:"\xD7"})]})]})}function sn(e){let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t).toString(36)}function ut({items:e,contentId:t,variant:r,showProgress:n=true}){let o=e[0]?.id??null,i=Ue.useMemo(()=>e.map(a=>a.id),[e]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(dn,{contentId:t,itemIds:i}),n&&jsxRuntime.jsx("div",{"data-blog-reading-progress":t,className:"fixed inset-x-0 top-0 z-50 h-1 origin-left bg-[var(--blog-accent)] motion-safe:transition-transform",style:{transform:"scaleX(0)"},role:"progressbar","aria-label":"Reading progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0,suppressHydrationWarning:true}),jsxRuntime.jsx(pn,{items:e,activeItemId:o,variant:r})]})}function dn({contentId:e,itemIds:t}){return Ue.useEffect(()=>{let r=0,n=decodeURIComponent(window.location.hash.replace(/^#/,"")),o=l=>{let u=Array.from(document.querySelectorAll("[data-blog-toc-link]"));for(let m of u){let s=m.getAttribute("data-blog-toc-link")===l;m.setAttribute("data-active",s?"true":"false"),s?m.setAttribute("aria-current","location"):m.removeAttribute("aria-current");}},i=()=>{let l=document.getElementById(e);if(!l)return;let u=Array.from(document.querySelectorAll(`[data-blog-reading-progress="${e}"]`)),m=l.getBoundingClientRect(),s=window.scrollY,b=m.top+s,f=l.offsetHeight-window.innerHeight,g=f<=0?s>=b?100:0:(s-b)/f*100,p=mn(g);for(let w of u)w.style.transform=`scaleX(${p/100})`,w.setAttribute("aria-valuenow",String(Math.round(p)));let x=t.map(w=>document.getElementById(w)).filter(w=>!!w);if(n&&t.includes(n)){o(n),n="";return}let N=Math.max(160,Math.round(window.innerHeight*.33)),L=x.filter(w=>w.getBoundingClientRect().top<=N).at(-1)??x[0]??null;o(L?L.id:null);},a=()=>{window.cancelAnimationFrame(r),r=window.requestAnimationFrame(i);},c=()=>{n=decodeURIComponent(window.location.hash.replace(/^#/,"")),a();};return a(),window.addEventListener("scroll",a,{passive:true}),window.addEventListener("resize",a),window.addEventListener("hashchange",c),()=>{window.cancelAnimationFrame(r),window.removeEventListener("scroll",a),window.removeEventListener("resize",a),window.removeEventListener("hashchange",c);}},[e,t]),null}function mn(e){return Number.isFinite(e)?Math.min(100,Math.max(0,e)):0}function pn({items:e,activeItemId:t,variant:r}){if(e.length===0)return null;let n=jsxRuntime.jsx("ul",{className:"space-y-2 text-sm",children:e.map(o=>{let i=kt(o.id,t);return jsxRuntime.jsx("li",{className:o.level===3?"pl-4":void 0,children:jsxRuntime.jsx("a",{href:`#${o.id}`,"aria-current":i.ariaCurrent,"data-blog-toc-link":o.id,"data-active":i.isActive?"true":"false",suppressHydrationWarning:true,className:"text-muted-foreground hover:text-[var(--blog-text-accent)] data-[active=true]:border-[var(--blog-accent)] data-[active=true]:text-[var(--blog-text-accent)] block border-l-2 border-transparent pl-3 leading-snug transition-colors",children:o.text})},o.id)})});return r==="mobile"?jsxRuntime.jsxs("details",{className:"group mb-6 rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] lg:hidden",children:[jsxRuntime.jsxs("summary",{className:"text-foreground flex cursor-pointer list-none items-center justify-between gap-3 px-4 py-3 text-sm font-semibold [&::-webkit-details-marker]:hidden",children:[jsxRuntime.jsx("span",{children:"On this page"}),jsxRuntime.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs font-medium",children:[Lt(e.length),jsxRuntime.jsx("span",{className:"text-[var(--blog-text-accent)] transition-transform group-open:rotate-180","aria-hidden":"true",children:"\u2193"})]})]}),jsxRuntime.jsx("nav",{"aria-label":"Table of contents",className:"border-t border-[var(--blog-accent-border)] px-4 py-4",children:n})]}):jsxRuntime.jsx("aside",{className:"hidden lg:block",children:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",className:"sticky top-24 max-h-[calc(100vh-8rem)] overflow-y-auto border-l border-border pl-5",children:[jsxRuntime.jsx("p",{className:"text-muted-foreground mb-3 text-xs font-semibold tracking-wider uppercase",children:"On this page"}),n]})})}var ae=Ue__namespace.forwardRef(({className:e,orientation:t="horizontal",decorative:r=true,...n},o)=>jsxRuntime.jsx(dt__namespace.Root,{ref:o,decorative:r,orientation:t,className:h("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ae.displayName=dt__namespace.Root.displayName;var Ut={mdxOptions:{remarkPlugins:[bn__default.default,hn__default.default],rehypePlugins:[yn,xn__default.default]}};function yn(){return e=>{Ht(e);}}function Ht(e){e.children&&(e.children=e.children.flatMap(t=>(Ht(t),vn(t)?t.children?.filter(mt)??[t]:[t])));}function vn(e){if(e.type!=="element"||e.tagName!=="p"||!e.children)return false;let t=e.children.filter(mt);return t.length===1&&Pn(t[0])}function Pn(e){if(e?.type!=="element")return false;if(e.tagName==="img")return true;if(e.tagName!=="a"||!e.children)return false;let t=e.children.filter(mt);return t.length===1&&t[0]?.tagName==="img"}function mt(e){return e.type!=="text"||!!e.value?.trim()}function Rn(e){return `${Math.ceil(e/60)} min read`}function Cn(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function Ln({creditText:e,creditUrl:t}){if(!e&&!t)return null;let r=e??Cn(t??"");return jsxRuntime.jsxs("span",{children:["Credit:"," ",t?jsxRuntime.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 transition-colors hover:text-[var(--blog-text-accent)]",children:r}):r]})}function Vt({article:e,className:t,navigation:r,basePath:n="/blog",theme:o,postArticleCta:i,newsletter:a,newsletterPreviewMode:c=false,relatedArticles:l=[],showShareLinks:u=true}){let m=E(n)||"/",s=ot(e.publishedAt,e.updatedAt),b=Rn(e.readingSeconds),f=at(e.content),g=e.meta.canonicalUrl??S(m,e.slug),p=a??e.site.newsletter,x=e.featuredImage,N=!!(e.featuredImageCaption??e.featuredImageCreditText??e.featuredImageCreditUrl);return jsxRuntime.jsxs("article",{style:U(o),className:h("article-page mx-auto max-w-6xl px-4 py-6 pb-12 sm:px-6 sm:py-8 sm:pb-16 lg:px-8 lg:py-12 lg:pb-24",t),children:[r?.backToHome&&jsxRuntime.jsx("header",{className:"mx-auto mb-8 max-w-4xl sm:mb-12 lg:mb-16",children:jsxRuntime.jsxs(J__default.default,{href:r.backToHome.url,className:"text-muted-foreground group focus-visible:ring-ring inline-flex touch-manipulation items-center space-x-2 rounded-md px-2 py-1 transition-colors hover:text-[var(--blog-accent)] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none sm:space-x-3","aria-label":r.backToHome.label??"Return to blog",children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"h-4 w-4 transition-transform group-hover:-translate-x-1 sm:h-5 sm:w-5","aria-hidden":"true"}),jsxRuntime.jsxs("span",{className:"text-sm font-medium sm:text-base",children:[jsxRuntime.jsx("span",{className:"hidden sm:inline",children:r.backToHome.label??"Back to all articles"}),jsxRuntime.jsx("span",{className:"sm:hidden",children:"Back"})]})]})}),jsxRuntime.jsx("style",{children:`
78
3
  .article-content figure > p {
79
4
  margin-top: 0 !important;
80
5
  margin-bottom: 0 !important;
@@ -111,9 +36,9 @@
111
36
  text-decoration-line: underline;
112
37
  text-underline-offset: 0.18em;
113
38
  }
114
- `}),jsxRuntime.jsxs("header",{className:"article-header mx-auto mb-6 max-w-4xl space-y-4 text-center sm:mb-8 sm:space-y-6 lg:mb-12 lg:space-y-8",children:[jsxRuntime.jsx("h1",{className:"article-title bg-linear-to-br from-[var(--blog-accent-hover)] via-[var(--blog-text-accent)] to-fuchsia-200 bg-clip-text px-4 text-2xl leading-tight font-light tracking-tight text-balance text-transparent sm:px-0 sm:text-3xl md:text-4xl lg:text-5xl xl:text-6xl",children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"article-excerpt text-muted-foreground mx-auto mt-6 max-w-[42rem] px-4 text-lg leading-relaxed text-balance sm:mt-8 sm:max-w-[46rem] sm:px-0 sm:text-xl md:max-w-[52rem] md:text-2xl lg:max-w-4xl lg:text-2xl",children:e.excerpt}),jsxRuntime.jsxs("div",{className:"article-meta text-muted-foreground flex flex-col items-center gap-2 text-sm sm:gap-3 sm:text-base",children:[e.author&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Author"}),jsxRuntime.jsxs(X__default.default,{href:R(m,e.author.slug),className:"inline-flex items-center gap-2 font-medium transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx(Mt,{author:e.author,size:"md"}),e.author.name]}),e.author.isGuest&&jsxRuntime.jsx(be,{variant:"outline",className:"text-xs",children:"Guest Author"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1",children:[jsxRuntime.jsxs("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${d.publishedDateLabel}`,children:["Published ",d.publishedDateLabel]}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:d.publishedRelativeLabel}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:b})]}),d.isUpdated&&jsxRuntime.jsxs("time",{dateTime:e.updatedAt,className:"text-xs",children:["Updated ",d.updatedDateLabel]}),c&&jsxRuntime.jsx(Oe,{title:e.title,url:p,size:"sm"}),jsxRuntime.jsx("div",{className:"bg-border h-px w-6 sm:w-8","aria-hidden":"true"}),(e.topics??[]).length>0?jsxRuntime.jsx("nav",{"aria-label":"Article topics",className:"flex flex-wrap justify-center gap-2",children:(e.topics??[]).map(H=>jsxRuntime.jsx(X__default.default,{href:L((r?.backToHome?.url??"/blog").replace(/\/$/,""),`topics/${H.slug}`),className:"rounded-full border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] px-3 py-1 text-xs font-medium text-[var(--blog-text-accent)] transition-colors hover:border-[var(--blog-text-accent)] hover:text-[var(--blog-text-accent-hover)]",children:H.name},H.id))}):jsxRuntime.jsxs("span",{className:"text-xs tracking-wider uppercase sm:text-sm",role:"text",children:["From ",e.site.name]})]})]}),v&&jsxRuntime.jsxs("figure",{className:"article-featured-image mx-auto my-8 w-full max-w-4xl sm:my-12 lg:my-16",children:[jsxRuntime.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-3xl border border-[var(--blog-accent-border)] shadow-[0_24px_80px_rgb(168_85_247_/_0.14)]",children:jsxRuntime.jsx(tt__default.default,{src:v,alt:e.featuredImageAlt??`Featured image for ${e.title}`,className:"h-full w-full object-cover",width:800,height:450,priority:true})}),C&&jsxRuntime.jsxs("figcaption",{className:"text-muted-foreground mt-3 space-y-1 px-2 text-center text-sm leading-relaxed sm:px-0",children:[e.featuredImageCaption&&jsxRuntime.jsx("p",{children:e.featuredImageCaption}),(e.featuredImageCreditText??e.featuredImageCreditUrl)&&jsxRuntime.jsx("p",{className:"text-xs",children:jsxRuntime.jsx(wn,{creditText:e.featuredImageCreditText,creditUrl:e.featuredImageCreditUrl})})]})]}),jsxRuntime.jsxs("div",{id:"article-content",className:"article-content mx-auto grid max-w-6xl grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_14rem] lg:gap-12",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx(nt,{items:f,contentId:"article-body",variant:"mobile"}),jsxRuntime.jsx("div",{id:"article-body",className:"prose prose-sm sm:prose-base lg:prose-lg xl:prose-xl prose-gray dark:prose-invert prose-headings:scroll-mt-20 prose-headings:font-light prose-headings:text-balance prose-headings:text-[var(--blog-text-accent)] prose-h1:text-2xl sm:prose-h1:text-3xl lg:prose-h1:text-4xl prose-h2:text-xl sm:prose-h2:text-2xl lg:prose-h2:text-3xl prose-h3:text-lg sm:prose-h3:text-xl lg:prose-h3:text-2xl prose-p:leading-relaxed prose-p:text-pretty prose-a:text-[var(--blog-text-accent)] prose-a:transition-colors hover:prose-a:text-[var(--blog-text-accent-hover)] [&_figure>p]:!my-0 [&_figcaption]:!mt-2 [&_figcaption]:text-center [&_figcaption]:!text-sm [&_figcaption]:!leading-snug [&_figcaption]:text-muted-foreground [&_figcaption_.blog-image-credit]:mt-1 [&_figcaption_.blog-image-credit]:block [&_figcaption_.blog-image-credit]:text-xs [&_figcaption_.blog-image-credit]:tracking-wide [&_figcaption_.blog-image-credit]:text-muted-foreground/80 [&_figcaption>span:not(.blog-image-credit)]:ml-2 [&_figcaption>span:not(.blog-image-credit)]:border-l [&_figcaption>span:not(.blog-image-credit)]:border-[var(--blog-accent-border)] [&_figcaption>span:not(.blog-image-credit)]:pl-2 [&_figcaption>span:not(.blog-image-credit)]:text-xs [&_figcaption>span:not(.blog-image-credit)]:tracking-wide [&_figcaption>span:not(.blog-image-credit)]:text-muted-foreground/80 max-w-none",children:jsxRuntime.jsx(rsc.MDXRemote,{source:e.content,options:Ot,components:{img:_t}})})]}),jsxRuntime.jsx(nt,{items:f,contentId:"article-body",variant:"desktop",showProgress:false})]}),e.author?.bio&&jsxRuntime.jsxs("div",{id:"about-author",className:"author-bio mx-auto mt-12 max-w-4xl",children:[jsxRuntime.jsx(ee,{className:"mb-8"}),jsxRuntime.jsx(xe,{className:"border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsxs(ye,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-start sm:p-6",children:[jsxRuntime.jsx("div",{className:"shrink-0",children:jsxRuntime.jsx(Mt,{author:e.author,size:"lg"})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Written by"}),jsxRuntime.jsxs("h2",{className:"text-foreground flex flex-wrap items-center gap-2 text-xl font-semibold",children:[jsxRuntime.jsx(X__default.default,{href:R(m,e.author.slug),className:"transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:e.author.name}),e.author.isGuest&&jsxRuntime.jsx(be,{variant:"outline",className:"text-xs",children:"Guest Author"})]})]}),jsxRuntime.jsx(Sn,{author:e.author})]}),jsxRuntime.jsx("p",{className:"text-muted-foreground leading-relaxed",children:e.author.bio})]})]})})]}),((i??false)||(g?.enabled??false)||c||l.length>0)&&jsxRuntime.jsxs("div",{className:"mx-auto mt-12 max-w-4xl space-y-8",children:[jsxRuntime.jsx(ee,{}),i&&jsxRuntime.jsx(Tn,{cta:i}),g?.enabled&&jsxRuntime.jsx(fe,{siteId:e.site.id,settings:g,sourceSurface:"article",sourceArticleSlug:e.slug,sourceUrl:p,previewMode:s}),c&&jsxRuntime.jsx(Cn,{title:e.title,url:p}),l.length>0&&jsxRuntime.jsx(In,{articles:l.slice(0,3),basePath:m})]}),(!!r?.previousArticle||!!r?.nextArticle)&&jsxRuntime.jsxs("nav",{className:"article-nav mx-auto mt-12 max-w-4xl",children:[jsxRuntime.jsx(ee,{className:"mb-8"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[r?.previousArticle&&jsxRuntime.jsx(xe,{className:"group cursor-pointer transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsxs(X__default.default,{href:r.previousArticle.url,className:"block",children:[r.previousArticle.featuredImage&&jsxRuntime.jsx(at,{src:r.previousArticle.featuredImage,alt:r.previousArticle.featuredImageAlt??`Featured image for ${r.previousArticle.title}`}),jsxRuntime.jsxs(ye,{className:"p-4",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"\u2190 Previous Article"}),jsxRuntime.jsx("div",{className:"text-foreground transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.previousArticle.title})]})]})}),r?.nextArticle&&jsxRuntime.jsx(xe,{className:h("group cursor-pointer transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",!r?.previousArticle&&"md:col-start-2"),children:jsxRuntime.jsxs(X__default.default,{href:r.nextArticle.url,className:"block",children:[r.nextArticle.featuredImage&&jsxRuntime.jsx(at,{src:r.nextArticle.featuredImage,alt:r.nextArticle.featuredImageAlt??`Featured image for ${r.nextArticle.title}`}),jsxRuntime.jsxs(ye,{className:"p-4 md:text-right",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"Next Article \u2192"}),jsxRuntime.jsx("div",{className:"text-foreground transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.nextArticle.title})]})]})})]})]}),(()=>{let H=Q(Je(e,{pathPrefix:m}));return jsxRuntime.jsx("script",{type:H.type,dangerouslySetInnerHTML:H.dangerouslySetInnerHTML})})()]})}function Mt({author:e,size:t}){let r=t==="lg"?"h-12 w-12 text-base":"h-9 w-9 text-sm",n=Rn(e.name);return e.avatarUrl?jsxRuntime.jsx(tt__default.default,{src:e.avatarUrl,alt:e.name,width:t==="lg"?48:36,height:t==="lg"?48:36,className:h("shrink-0 rounded-full object-cover",r),loading:"lazy"}):jsxRuntime.jsx("span",{className:h("bg-muted text-muted-foreground inline-flex shrink-0 items-center justify-center rounded-full font-medium",r),"aria-hidden":"true",children:n})}function Sn({author:e}){let t=Nn(e);return t.length===0?null:jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-1 sm:justify-end",children:t.map(r=>jsxRuntime.jsx("a",{href:r.href,target:r.external?"_blank":void 0,rel:r.external?"noopener noreferrer":void 0,"aria-label":`${e.name} ${r.label}`,className:"text-muted-foreground hover:bg-background/60 hover:text-foreground inline-flex size-7 items-center justify-center rounded-full transition-colors",children:r.icon},r.key))})}function Nn(e){let t=e.socialLinks;return t?[t.website?{key:"website",href:t.website,label:"website",external:true,icon:jsxRuntime.jsx(lucideReact.Globe,{className:"size-4","aria-hidden":"true"})}:void 0,t.x?{key:"x",href:t.x,label:"on X",external:true,icon:jsxRuntime.jsx(fa6.FaXTwitter,{className:"size-4","aria-hidden":"true"})}:void 0,t.linkedin?{key:"linkedin",href:t.linkedin,label:"on LinkedIn",external:true,icon:jsxRuntime.jsx(fa6.FaLinkedinIn,{className:"size-4","aria-hidden":"true"})}:void 0,t.github?{key:"github",href:t.github,label:"on GitHub",external:true,icon:jsxRuntime.jsx(fa6.FaGithub,{className:"size-4","aria-hidden":"true"})}:void 0,t.email?{key:"email",href:`mailto:${t.email}`,label:"email",external:false,icon:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})}:void 0].filter(n=>!!n):[]}function Rn(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function Tn({cta:e}){return jsxRuntime.jsx("div",{className:"rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] p-5 sm:p-6",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("h2",{className:"text-foreground text-xl font-semibold",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground leading-relaxed",children:e.description})]}),jsxRuntime.jsxs(X__default.default,{href:e.href,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-full bg-[var(--blog-accent)] px-4 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-90",children:[e.label,jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"size-4","aria-hidden":"true"})]})]})})}function Cn({title:e,url:t}){let r=encodeURIComponent(e),n=encodeURIComponent(t);return jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-3",children:[jsxRuntime.jsx(Oe,{title:e,url:t,size:"sm"}),jsxRuntime.jsx("a",{href:`https://x.com/intent/tweet?text=${r}&url=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on X",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(fa6.FaXTwitter,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on LinkedIn",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(fa6.FaLinkedinIn,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx("a",{href:`mailto:?subject=${r}&body=${n}`,"aria-label":"Share by email",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})})]})}function In({articles:e,basePath:t}){return jsxRuntime.jsxs("section",{className:"space-y-4","aria-labelledby":"related-articles-title",children:[jsxRuntime.jsx("h2",{id:"related-articles-title",className:"text-xl font-semibold",children:"You might also like"}),jsxRuntime.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:e.map(r=>jsxRuntime.jsxs(X__default.default,{href:L(t,r.slug),className:"group border-border overflow-hidden rounded-2xl border transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)] hover:no-underline",children:[r.featuredImage&&jsxRuntime.jsx(at,{src:r.featuredImage,alt:r.featuredImageAlt??`Featured image for ${r.title}`}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("h3",{className:"text-foreground line-clamp-3 font-semibold transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.title}),r.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground mt-2 line-clamp-3 text-sm leading-relaxed",children:r.excerpt})]})]},r.id))})]})}function at({src:e,alt:t}){return jsxRuntime.jsx("div",{className:"border-border aspect-[16/9] overflow-hidden border-b bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(tt__default.default,{src:e,alt:t,width:480,height:270,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"})})}function Ln(e,t="/blog"){let r=e.meta.title??e.title,n=e.meta.description??e.excerpt,o=e.meta.canonicalUrl??`${e.site.domain}${L(t,e.slug)}`,i=e.meta.ogImage??e.featuredImage;return {title:r,description:n,keywords:e.meta.keywords.join(", "),authors:e.author?[{name:e.author.name}]:void 0,openGraph:{title:r,description:n,type:"article",url:o,images:i?[{url:i,alt:e.featuredImageAlt??r}]:void 0,publishedTime:e.publishedAt,modifiedTime:e.updatedAt,authors:e.author?[e.author.name]:void 0,siteName:e.site.name},twitter:{card:"summary_large_image",title:r,description:n,images:i?[i]:void 0},alternates:{canonical:o}}}function Gt({author:e,articles:t,site:r,className:n,basePath:o="/blog",theme:i,pagination:a,navigation:s}){let l=I(o)||"/",c=s?.backToHome?.url??l,m=R(l,e.slug),d=a?.totalItems??t.length,b=Q(Le(e,{pathPrefix:l}));return jsxRuntime.jsxs("main",{style:M(i),className:h("author-page mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-8 sm:mb-14",children:[jsxRuntime.jsxs(X__default.default,{href:c,className:"text-muted-foreground group focus-visible:ring-ring inline-flex items-center gap-2 rounded-md px-2 py-1 text-sm font-medium transition-colors hover:text-[var(--blog-accent)] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4 transition-transform group-hover:-translate-x-1","aria-hidden":"true"}),s?.backToHome?.label??"Back to all articles"]}),jsxRuntime.jsxs("div",{className:"grid gap-6 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center",children:[jsxRuntime.jsx(Dn,{author:e}),jsxRuntime.jsxs("div",{className:"min-w-0 space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.isGuest&&jsxRuntime.jsx(be,{variant:"outline",className:"text-xs",children:"Guest Author"})}),jsxRuntime.jsx("h1",{className:"text-foreground text-4xl leading-tight font-semibold text-balance sm:text-5xl",children:e.name})]}),e.bio&&jsxRuntime.jsx("p",{className:"text-muted-foreground max-w-3xl text-lg leading-relaxed text-pretty",children:e.bio}),jsxRuntime.jsx(En,{author:e})]})]})]}),jsxRuntime.jsx(ee,{className:"mb-8"}),jsxRuntime.jsxs("section",{"aria-labelledby":"author-articles-title",className:"space-y-6",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap items-end justify-between gap-3",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{id:"author-articles-title",className:"text-foreground text-2xl font-semibold",children:["Articles by ",e.name]}),jsxRuntime.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[d," ",d===1?"article":"articles"," on ",r.name]})]})}),t.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground border-border rounded-2xl border p-6",children:"This author does not have any published articles yet."}):jsxRuntime.jsx("div",{className:"divide-border divide-y",children:t.map(f=>jsxRuntime.jsx($n,{article:f,basePath:l},f.id))}),a&&a.totalPages>1&&jsxRuntime.jsx("div",{className:"pt-4",children:jsxRuntime.jsx(ne,{currentPage:a.currentPage,totalPages:a.totalPages,baseUrl:a.baseUrl??m,className:"justify-center"})})]}),jsxRuntime.jsx("script",{type:b.type,dangerouslySetInnerHTML:b.dangerouslySetInnerHTML})]})}function En({author:e}){let t=Mn(e);return t.length===0?null:jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-2","aria-label":"Author links",children:t.map(r=>jsxRuntime.jsx("a",{href:r.href,target:r.external?"_blank":void 0,rel:r.external?"noopener noreferrer":void 0,"aria-label":r.ariaLabel,className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:r.icon},r.label))})}function Mn(e){let t=e.socialLinks;return t?[t.website?{href:t.website,label:"website",ariaLabel:`${e.name}'s website`,external:true,icon:jsxRuntime.jsx(lucideReact.Globe,{className:"size-4","aria-hidden":"true"})}:null,t.x??t.twitter?{href:t.x??t.twitter??"",label:"x",ariaLabel:`${e.name} on X`,external:true,icon:jsxRuntime.jsx("span",{className:"text-sm font-semibold","aria-hidden":"true",children:"X"})}:null,t.linkedin?{href:t.linkedin,label:"linkedin",ariaLabel:`${e.name} on LinkedIn`,external:true,icon:jsxRuntime.jsx("span",{className:"text-sm font-bold","aria-hidden":"true",children:"in"})}:null,t.github?{href:t.github,label:"github",ariaLabel:`${e.name} on GitHub`,external:true,icon:jsxRuntime.jsx("span",{className:"text-xs font-bold","aria-hidden":"true",children:"GH"})}:null,t.email?{href:`mailto:${t.email}`,label:"email",ariaLabel:`Email ${e.name}`,external:false,icon:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})}:null].filter(r=>r!==null):[]}function $n({article:e,basePath:t}){let r=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true});return jsxRuntime.jsx("article",{className:"py-6 first:pt-0 last:pb-0",children:jsxRuntime.jsxs(X__default.default,{href:L(t,e.slug),className:"group grid gap-4 hover:no-underline sm:grid-cols-[minmax(0,1fr)_12rem] sm:items-start",children:[jsxRuntime.jsxs("div",{className:"min-w-0 space-y-3",children:[jsxRuntime.jsx("h3",{className:"text-xl leading-tight font-semibold text-balance transition-colors group-hover:text-[var(--blog-text-accent)]",children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 leading-relaxed",children:e.excerpt}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[jsxRuntime.jsx("time",{dateTime:e.publishedAt,children:r}),jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u2022"}),jsxRuntime.jsxs("span",{children:[Math.ceil(e.readingSeconds/60)," min read"]})]})]}),e.featuredImage&&jsxRuntime.jsx("div",{className:"border-border relative aspect-[16/10] overflow-hidden rounded-xl border bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(tt__default.default,{src:e.featuredImage,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:320,height:200,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"})})]})})}function Dn({author:e}){return e.avatarUrl?jsxRuntime.jsx(tt__default.default,{src:e.avatarUrl,alt:e.name,width:128,height:128,className:"size-28 rounded-full border border-[var(--blog-accent-border)] object-cover sm:size-32",priority:true}):jsxRuntime.jsx("span",{className:"bg-muted text-muted-foreground inline-flex size-28 items-center justify-center rounded-full text-3xl font-semibold sm:size-32",children:Un(e.name)})}function Un(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function Hn(e,t,r="/blog"){let n=`https://${t.domain.replace(/^https?:\/\//,"").replace(/\/+$/,"")}${R(r,e.slug)}`,o=`${e.name} - ${t.name}`,i=e.bio??`Read articles by ${e.name} on ${t.name}.`;return {title:o,description:i,authors:[{name:e.name}],openGraph:{title:o,description:i,type:"profile",url:n,images:e.avatarUrl?[{url:e.avatarUrl,alt:e.name}]:void 0,siteName:t.name},twitter:{card:e.avatarUrl?"summary_large_image":"summary",title:o,description:i,images:e.avatarUrl?[e.avatarUrl]:void 0},alternates:{canonical:n}}}var Ee=class{articles=new Map;operations=new Map;async saveArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(Array.from(this.articles.values()).some(a=>a.id===t.id))return n}else return n;if(this.articles.has(t.slug)){let i={success:false,error:{code:"PUB003",message:"This URL is already in use. Please choose another."},idempotencyKey:r};return await this.storeOperationResult(r,i),i}this.articles.set(t.slug,t);let o={success:true,url:`/${t.slug}`,platformPostId:t.id,publishedAt:t.publishedAt,idempotencyKey:r};return await this.storeOperationResult(r,o),o}async getArticle(t){return this.articles.get(t)??null}async listArticles(t={}){let{limit:r=10,offset:n=0,sortBy:o="publishedAt",order:i="desc"}=t,a=Array.from(this.articles.values());return a.sort((l,c)=>{let m=new Date(l[o]).getTime(),d=new Date(c[o]).getTime();return i==="desc"?d-m:m-d}),{articles:a.slice(n,n+r),total:a.length}}async removeArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(!this.articles.has(t))return n}else return n;if(!this.articles.has(t)){let i={success:false,error:{code:"PUB007",message:"Article not found"},idempotencyKey:r};return await this.storeOperationResult(r,i),i}this.articles.delete(t);let o={success:true,idempotencyKey:r};return await this.storeOperationResult(r,o),o}async checkIdempotency(t){return this.operations.get(t)??null}async storeOperationResult(t,r){this.operations.set(t,r);}};function jn(){let e=globalThis;if(e.__BLOG_PLATFORM_STORAGE_WARNED__)return;e.__BLOG_PLATFORM_STORAGE_WARNED__=true;let t="Blog platform: No storage provider configured. Falling back to in-memory storage (data is not persisted).";process.env.NODE_ENV==="production"?console.error(`${t} Call initBlogPlatform({ storage: /* your persistent adapter */ }) to avoid data loss.`):console.warn(t);}function zn(){let e=globalThis;e.__BLOG_PLATFORM_STORAGE__||(jn(),e.__BLOG_PLATFORM_STORAGE__=new Ee);let t=e.__BLOG_PLATFORM_STORAGE__;if(!t)throw new Error("Blog platform storage not initialized");return t}function z(){return zn()}function lt(e){let t=globalThis;t.__BLOG_PLATFORM_STORAGE__=e;}function ct(e){let t=new Map;for(let r of e)r.author?.slug&&t.set(r.author.slug,Vt(t.get(r.author.slug),r.author));return Array.from(t.values()).sort((r,n)=>r.name.localeCompare(n.name))}function Ft(e,t){let r=t.filter(o=>o.author?.slug===e).sort((o,i)=>new Date(i.publishedAt).getTime()-new Date(o.publishedAt).getTime()),n=r.reduce((o,i)=>i.author?Vt(o,i.author):o,null);return n?{author:n,articles:r}:null}async function Gn(e,t={},r=z()){let{articles:n}=await r.listArticles({limit:t.limit??1e3,offset:t.offset??0,sortBy:"publishedAt",order:"desc"});return Ft(e,n)}function Vt(e,t){return e?{...e,bio:e.bio??t.bio,avatarUrl:e.avatarUrl??t.avatarUrl,pronouns:e.pronouns??t.pronouns,socialLinks:e.socialLinks??t.socialLinks,toneAdjectives:e.toneAdjectives.length>0?e.toneAdjectives:t.toneAdjectives}:t}function Fn(e){let t=e.topics??[];return t.find(r=>r.isPrimary)??t[0]??null}function ut(e){let t=new Map;for(let r of e)for(let n of r.topics??[])t.has(n.slug)||t.set(n.slug,n);return Array.from(t.values()).sort((r,n)=>r.name.localeCompare(n.name))}function dt(e,t){let r=e.filter(o=>(o.topics??[]).some(i=>i.slug===t));if(r.length===0)return null;let n=r.flatMap(o=>o.topics??[]).find(o=>o.slug===t)??null;return n?{topic:n,articles:r}:null}function Xn({articles:e,basePath:t="/blog",title:r="Topics",description:n="Browse articles by topic.",className:o,theme:i}){let a=I(t)||"/",s=ut(e);return jsxRuntime.jsxs("main",{style:M(i),className:h("blog-topics-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",o),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(X__default.default,{href:a,className:"text-muted-foreground hover:text-[var(--blog-accent)] text-sm font-medium transition-colors",children:"Back to all articles"}),jsxRuntime.jsx("h1",{className:"text-4xl font-semibold tracking-tight text-balance sm:text-5xl",children:r}),jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:n})]}),s.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No topics have published articles yet."}):jsxRuntime.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.map(l=>{let c=e.filter(m=>(m.topics??[]).some(d=>d.slug===l.slug)).length;return jsxRuntime.jsxs(X__default.default,{href:L(a,`topics/${l.slug}`),className:"group rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] p-5 transition hover:border-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx("h2",{className:"group-hover:text-[var(--blog-accent)] text-xl font-semibold transition-colors",children:l.name}),l.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground mt-2 line-clamp-3 text-sm leading-relaxed",children:l.description}),jsxRuntime.jsxs("p",{className:"text-muted-foreground mt-4 text-sm",children:[c," ",c===1?"article":"articles"]})]},l.slug)})})]})}function Wn({articles:e,topicSlug:t,basePath:r="/blog",className:n,theme:o}){let i=I(r)||"/",a=dt(e,t);return jsxRuntime.jsxs("main",{style:M(o),className:h("blog-topic-archive-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(X__default.default,{href:L(i,"topics"),className:"text-muted-foreground hover:text-[var(--blog-accent)] text-sm font-medium transition-colors",children:"Back to all topics"}),jsxRuntime.jsx("h1",{className:"text-4xl font-semibold tracking-tight text-balance sm:text-5xl",children:a?.topic.name??"Topic not found"}),a?.topic.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:a.topic.description})]}),a?jsxRuntime.jsx("div",{className:"grid gap-5 md:grid-cols-2",children:a.articles.map(s=>jsxRuntime.jsx(Kn,{article:s,topic:a.topic,basePath:i},s.id))}):jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No published articles were found for this topic."})]})}function Kn({article:e,topic:t,basePath:r}){let n=L(r,e.slug),o=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true});return jsxRuntime.jsxs(X__default.default,{href:n,className:"group overflow-hidden rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] transition hover:border-[var(--blog-accent)] hover:no-underline",children:[e.featuredImage&&jsxRuntime.jsx("div",{className:"relative aspect-[16/9] overflow-hidden",children:jsxRuntime.jsx(tt__default.default,{src:e.featuredImage,alt:e.featuredImageAlt??e.title,width:640,height:360,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"space-y-3 p-5",children:[jsxRuntime.jsx("span",{className:"inline-flex rounded-full border border-[var(--blog-accent-border)] px-2.5 py-1 text-xs font-medium text-[var(--blog-text-accent)]",children:t.name}),jsxRuntime.jsx("h2",{className:"group-hover:text-[var(--blog-accent)] text-xl font-semibold text-balance transition-colors",children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed",children:e.excerpt}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm",children:o})]})]})}function Yn({articles:e,basePath:t="/blog",title:r="Authors",description:n="Browse articles by author.",className:o,theme:i}){let a=I(t)||"/",s=ct(e);return jsxRuntime.jsxs("main",{style:M(i),className:h("blog-authors-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",o),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(X__default.default,{href:a,className:"text-muted-foreground text-sm font-medium transition-colors hover:text-[var(--blog-accent)]",children:"Back to all articles"}),jsxRuntime.jsx("h1",{className:"text-4xl font-semibold tracking-tight text-balance sm:text-5xl",children:r}),jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:n})]}),s.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No authors have published articles yet."}):jsxRuntime.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.map(l=>{let c=e.filter(m=>m.author?.slug===l.slug).length;return jsxRuntime.jsx(X__default.default,{href:R(a,l.slug),className:"group rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] p-5 transition hover:border-[var(--blog-accent)] hover:no-underline",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-4",children:[jsxRuntime.jsx(Qn,{author:l}),jsxRuntime.jsxs("div",{className:"min-w-0 space-y-2",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold transition-colors group-hover:text-[var(--blog-accent)]",children:l.name}),l.bio&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed",children:l.bio}),jsxRuntime.jsxs("p",{className:"text-muted-foreground text-sm",children:[c," ",c===1?"article":"articles"]})]})]})},l.slug)})})]})}function Qn({author:e}){let t=Zn(e.name);return e.avatarUrl?jsxRuntime.jsx(tt__default.default,{src:e.avatarUrl,alt:e.name,width:56,height:56,className:"size-14 shrink-0 rounded-full border border-[var(--blog-accent-border)] object-cover"}):jsxRuntime.jsx("span",{className:"bg-muted text-muted-foreground inline-flex size-14 shrink-0 items-center justify-center rounded-full text-base font-semibold",children:t})}function Zn(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function mt(e){let t=e.headers.get("Authorization");if(!t)return null;let n=/^Bearer\s+(.+)$/i.exec(t);if(n?.[1])return n[1];let i=/^Token\s+(.+)$/i.exec(t);return i?.[1]?i[1]:null}var $e=class{validApiKeys;constructor(t){this.validApiKeys=new Set(t);}async validateToken(t){return t?.trim()?this.validApiKeys.has(t)?{valid:true,context:{tokenHash:this.hashToken(t)}}:{valid:false,errorCode:"invalid"}:{valid:false,errorCode:"missing"}}extractToken=t=>mt(t);hashToken(t){return t.substring(0,8)+"..."}},se=class extends $e{constructor(t="BLOG_PLATFORM_API_KEYS"){let r=process.env[t];!r&&t==="BLOG_PLATFORM_API_KEYS"&&(r=process.env.BLOG_AUTH_TOKEN);let n=r?r.split(",").map(o=>o.trim()).filter(Boolean):[];n.length===0&&console.warn(`\u26A0\uFE0F No API keys found in environment variable ${t}${t==="BLOG_PLATFORM_API_KEYS"?" (set BLOG_PLATFORM_API_KEYS or BLOG_AUTH_TOKEN)":""}. Authentication will fail for all requests.`),super(n);}},we=class{async validateToken(){return {valid:true,context:{development:true}}}extractToken(){return "development-mode"}},De=class{hasWarned=false;async validateToken(t){return this.hasWarned||(console.error("\u274C SECURITY WARNING: Blog platform authentication not initialized! All requests will be rejected. Call initBlogPlatform() to configure authentication."),this.hasWarned=true),{valid:false,errorCode:"invalid"}}};function ei(){return globalThis.__BLOG_PLATFORM_AUTH_CONFIG__??=new De,globalThis.__BLOG_PLATFORM_AUTH_CONFIG__}function Ue(e){globalThis.__BLOG_PLATFORM_AUTH_CONFIG__=e;}function pt(){return globalThis.__BLOG_PLATFORM_AUTH_CONFIG__??ei()}function ti(e){Ue(new se(e));}async function V(e){let t=pt(),r=t.extractToken?t.extractToken(e):mt(e);if(!r)return {authenticated:false,result:{valid:false,errorCode:"missing"},token:null};let n=await t.validateToken(r);return {authenticated:n.valid,result:n,token:r}}function ri(e,t=""){let n=pt().errorMessages??{},o,i;switch(e.errorCode){case "missing":o=n.missing??"Authentication token is required",i="PUB005";break;case "expired":o=n.expired??"Authentication token has expired",i="PUB005";break;default:o=n.invalid??"Invalid authentication credentials",i="PUB005";break}return {success:false,error:{code:i,message:o,details:{authError:e.errorCode??"invalid"}},idempotencyKey:t}}async function K(e){let t=await V(e);return t.authenticated?{authenticated:true,context:t.result.context}:{authenticated:false,error:ri(t.result)}}function ni(){let e=process.env.SKIP_BLOG_PLATFORM_AUTH;return e==="true"||e==="1"||process.env.NODE_ENV==="test"}function oi(){return globalThis.__BLOG_PLATFORM_RATE_LIMITER__??null}function ai(e){let t=globalThis;t.__BLOG_PLATFORM_RATE_LIMITER__=e;}function He(e){let{redisUrl:t,redisToken:r,requestsPerMinute:n=5,keyPrefix:o="blog-platform-ratelimit",analytics:i=true}=e,a=new redis.Redis({url:t,token:r}),s=new ratelimit.Ratelimit({redis:a,analytics:i,prefix:o,limiter:ratelimit.Ratelimit.slidingWindow(n,"1m")});ai(s);}function gt(){let e=process.env.UPSTASH_REDIS_REST_URL,t=process.env.UPSTASH_REDIS_REST_TOKEN;if(!e||!t){console.warn("Blog platform: No Upstash Redis configuration found. Rate limiting disabled.");return}He({redisUrl:e,redisToken:t}),console.log("Blog platform: Rate limiting configured (5 requests per minute per token)");}async function Wt(e){let t=oi();if(!t)return console.warn("Blog platform: Rate limiter not configured. All requests allowed."),{success:true,remaining:999,reset:Date.now()+6e4,limit:5,count:0};try{let r=await t.limit(e);return {success:r.success,remaining:r.remaining,reset:r.reset,limit:r.limit,count:r.limit-r.remaining}}catch(r){return console.error("Blog platform: Rate limit check failed:",r),{success:true,remaining:0,reset:Date.now()+6e4,limit:5,count:0}}}function Kt(e,t=""){let r=Math.ceil((e.reset-Date.now())/6e4);return {success:false,error:{code:"PUB011",message:`Rate limit exceeded. You can make ${e.limit} requests per minute. Try again in ${r} minute(s).`,details:{rateLimit:e}},idempotencyKey:t}}async function q(e,t=""){let r=await Wt(e);return r.success?{allowed:true,rateLimitResult:r}:{allowed:false,errorResponse:Kt(r,t)}}function O(e){return {"X-RateLimit-Limit":e.limit.toString(),"X-RateLimit-Remaining":e.remaining.toString(),"X-RateLimit-Reset":e.reset.toString(),"Retry-After":Math.ceil((e.reset-Date.now())/1e3).toString()}}function je(e){let{auth:t,storage:r,rateLimit:n,autoRateLimit:o=true}=e;if(!t)throw new Error(`Blog platform initialization failed: 'auth' is required.
39
+ `}),jsxRuntime.jsxs("header",{className:"article-header mx-auto mb-6 max-w-4xl space-y-4 text-center sm:mb-8 sm:space-y-6 lg:mb-12 lg:space-y-8",children:[jsxRuntime.jsx("h1",{className:h("article-title px-4 text-2xl leading-tight font-light tracking-tight text-balance sm:px-0 sm:text-3xl md:text-4xl lg:text-5xl xl:text-6xl",G),children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"article-excerpt text-muted-foreground mx-auto mt-6 max-w-[42rem] px-4 text-lg leading-relaxed text-balance sm:mt-8 sm:max-w-[46rem] sm:px-0 sm:text-xl md:max-w-[52rem] md:text-2xl lg:max-w-4xl lg:text-2xl",children:e.excerpt}),jsxRuntime.jsxs("div",{className:"article-meta text-muted-foreground flex flex-col items-center gap-2 text-sm sm:gap-3 sm:text-base",children:[e.author&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Author"}),jsxRuntime.jsxs(J__default.default,{href:k(m,e.author.slug),className:"inline-flex items-center gap-2 font-medium transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx(Gt,{author:e.author,size:"md"}),e.author.name]}),e.author.isGuest&&jsxRuntime.jsx(we,{variant:"outline",className:"text-xs",children:"Guest Author"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-3 gap-y-1",children:[jsxRuntime.jsxs("time",{dateTime:e.publishedAt,className:"font-medium","aria-label":`Published ${s.publishedDateLabel}`,children:["Published ",s.publishedDateLabel]}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:s.publishedRelativeLabel}),jsxRuntime.jsx("span",{className:"text-border",children:"\u2022"}),jsxRuntime.jsx("span",{className:"font-medium",children:b})]}),s.isUpdated&&jsxRuntime.jsxs("time",{dateTime:e.updatedAt,className:"text-xs",children:["Updated ",s.updatedDateLabel]}),u&&jsxRuntime.jsx(He,{title:e.title,url:g,size:"sm"}),jsxRuntime.jsx("div",{className:"bg-border h-px w-6 sm:w-8","aria-hidden":"true"}),(e.topics??[]).length>0?jsxRuntime.jsx("nav",{"aria-label":"Article topics",className:"flex flex-wrap justify-center gap-2",children:(e.topics??[]).map(L=>jsxRuntime.jsx(J__default.default,{href:S((r?.backToHome?.url??"/blog").replace(/\/$/,""),`topics/${L.slug}`),className:"rounded-full border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] px-3 py-1 text-xs font-medium text-[var(--blog-text-accent)] transition-colors hover:border-[var(--blog-text-accent)] hover:text-[var(--blog-text-accent-hover)]",children:L.name},L.id))}):jsxRuntime.jsxs("span",{className:"text-xs tracking-wider uppercase sm:text-sm",role:"text",children:["From ",e.site.name]})]})]}),x&&jsxRuntime.jsxs("figure",{className:"article-featured-image mx-auto my-8 w-full max-w-4xl sm:my-12 lg:my-16",children:[jsxRuntime.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-3xl border border-[var(--blog-accent-border)] shadow-[0_24px_80px_rgb(168_85_247_/_0.14)]",children:jsxRuntime.jsx(lt__default.default,{src:x,alt:e.featuredImageAlt??`Featured image for ${e.title}`,className:"h-full w-full object-cover",width:800,height:450,priority:true})}),N&&jsxRuntime.jsxs("figcaption",{className:"text-muted-foreground mt-3 space-y-1 px-2 text-center text-sm leading-relaxed sm:px-0",children:[e.featuredImageCaption&&jsxRuntime.jsx("p",{children:e.featuredImageCaption}),(e.featuredImageCreditText??e.featuredImageCreditUrl)&&jsxRuntime.jsx("p",{className:"text-xs",children:jsxRuntime.jsx(Ln,{creditText:e.featuredImageCreditText,creditUrl:e.featuredImageCreditUrl})})]})]}),jsxRuntime.jsxs("div",{id:"article-content",className:"article-content mx-auto grid max-w-6xl grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_14rem] lg:gap-12",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx(ut,{items:f,contentId:"article-body",variant:"mobile"}),jsxRuntime.jsx("div",{id:"article-body",className:"prose prose-sm sm:prose-base lg:prose-lg xl:prose-xl prose-gray dark:prose-invert prose-headings:scroll-mt-20 prose-headings:font-light prose-headings:text-balance prose-headings:text-[var(--blog-text-accent)] prose-h1:text-2xl sm:prose-h1:text-3xl lg:prose-h1:text-4xl prose-h2:text-xl sm:prose-h2:text-2xl lg:prose-h2:text-3xl prose-h3:text-lg sm:prose-h3:text-xl lg:prose-h3:text-2xl prose-p:leading-relaxed prose-p:text-pretty prose-a:text-[var(--blog-text-accent)] prose-a:transition-colors hover:prose-a:text-[var(--blog-text-accent-hover)] [&_figure>p]:!my-0 [&_figcaption]:!mt-2 [&_figcaption]:text-center [&_figcaption]:!text-sm [&_figcaption]:!leading-snug [&_figcaption]:text-muted-foreground [&_figcaption_.blog-image-credit]:mt-1 [&_figcaption_.blog-image-credit]:block [&_figcaption_.blog-image-credit]:text-xs [&_figcaption_.blog-image-credit]:tracking-wide [&_figcaption_.blog-image-credit]:text-muted-foreground/80 [&_figcaption>span:not(.blog-image-credit)]:ml-2 [&_figcaption>span:not(.blog-image-credit)]:border-l [&_figcaption>span:not(.blog-image-credit)]:border-[var(--blog-accent-border)] [&_figcaption>span:not(.blog-image-credit)]:pl-2 [&_figcaption>span:not(.blog-image-credit)]:text-xs [&_figcaption>span:not(.blog-image-credit)]:tracking-wide [&_figcaption>span:not(.blog-image-credit)]:text-muted-foreground/80 max-w-none",children:jsxRuntime.jsx(rsc.MDXRemote,{source:e.content,options:Ut,components:{img:$t}})})]}),jsxRuntime.jsx(ut,{items:f,contentId:"article-body",variant:"desktop",showProgress:false})]}),e.author?.bio&&jsxRuntime.jsxs("div",{id:"about-author",className:"author-bio mx-auto mt-12 max-w-4xl",children:[jsxRuntime.jsx(ae,{className:"mb-8"}),jsxRuntime.jsx(Se,{className:"border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsxs(Ne,{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-start sm:p-6",children:[jsxRuntime.jsx("div",{className:"shrink-0",children:jsxRuntime.jsx(Gt,{author:e.author,size:"lg"})}),jsxRuntime.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:"Written by"}),jsxRuntime.jsxs("h2",{className:"text-foreground flex flex-wrap items-center gap-2 text-xl font-semibold",children:[jsxRuntime.jsx(J__default.default,{href:k(m,e.author.slug),className:"transition-colors hover:text-[var(--blog-accent)] hover:no-underline",children:e.author.name}),e.author.isGuest&&jsxRuntime.jsx(we,{variant:"outline",className:"text-xs",children:"Guest Author"})]})]}),jsxRuntime.jsx(kn,{author:e.author})]}),jsxRuntime.jsx("p",{className:"text-muted-foreground leading-relaxed",children:e.author.bio})]})]})})]}),((i??false)||(p?.enabled??false)||u||l.length>0)&&jsxRuntime.jsxs("div",{className:"mx-auto mt-12 max-w-4xl space-y-8",children:[jsxRuntime.jsx(ae,{}),i&&jsxRuntime.jsx(Bn,{cta:i}),p?.enabled&&jsxRuntime.jsx(Ae,{siteId:e.site.id,settings:p,sourceSurface:"article",sourceArticleSlug:e.slug,sourceUrl:g,previewMode:c}),u&&jsxRuntime.jsx(En,{title:e.title,url:g}),l.length>0&&jsxRuntime.jsx(On,{articles:l.slice(0,3),basePath:m})]}),(!!r?.previousArticle||!!r?.nextArticle)&&jsxRuntime.jsxs("nav",{className:"article-nav mx-auto mt-12 max-w-4xl",children:[jsxRuntime.jsx(ae,{className:"mb-8"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[r?.previousArticle&&jsxRuntime.jsx(Se,{className:"group cursor-pointer transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsxs(J__default.default,{href:r.previousArticle.url,className:"block",children:[r.previousArticle.featuredImage&&jsxRuntime.jsx(pt,{src:r.previousArticle.featuredImage,alt:r.previousArticle.featuredImageAlt??`Featured image for ${r.previousArticle.title}`}),jsxRuntime.jsxs(Ne,{className:"p-4",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"\u2190 Previous Article"}),jsxRuntime.jsx("div",{className:"text-foreground transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.previousArticle.title})]})]})}),r?.nextArticle&&jsxRuntime.jsx(Se,{className:h("group cursor-pointer transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",!r?.previousArticle&&"md:col-start-2"),children:jsxRuntime.jsxs(J__default.default,{href:r.nextArticle.url,className:"block",children:[r.nextArticle.featuredImage&&jsxRuntime.jsx(pt,{src:r.nextArticle.featuredImage,alt:r.nextArticle.featuredImageAlt??`Featured image for ${r.nextArticle.title}`}),jsxRuntime.jsxs(Ne,{className:"p-4 md:text-right",children:[jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"Next Article \u2192"}),jsxRuntime.jsx("div",{className:"text-foreground transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.nextArticle.title})]})]})})]})]}),(()=>{let L=ie(nt(e,{pathPrefix:m}));return jsxRuntime.jsx("script",{type:L.type,dangerouslySetInnerHTML:L.dangerouslySetInnerHTML})})()]})}function Gt({author:e,size:t}){let r=t==="lg"?"h-12 w-12 text-base":"h-9 w-9 text-sm",n=In(e.name);return e.avatarUrl?jsxRuntime.jsx(lt__default.default,{src:e.avatarUrl,alt:e.name,width:t==="lg"?48:36,height:t==="lg"?48:36,className:h("shrink-0 rounded-full object-cover",r),loading:"lazy"}):jsxRuntime.jsx("span",{className:h("bg-muted text-muted-foreground inline-flex shrink-0 items-center justify-center rounded-full font-medium",r),"aria-hidden":"true",children:n})}function kn({author:e}){let t=_n(e);return t.length===0?null:jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-1 sm:justify-end",children:t.map(r=>jsxRuntime.jsx("a",{href:r.href,target:r.external?"_blank":void 0,rel:r.external?"noopener noreferrer":void 0,"aria-label":`${e.name} ${r.label}`,className:"text-muted-foreground hover:bg-background/60 hover:text-foreground inline-flex size-7 items-center justify-center rounded-full transition-colors",children:r.icon},r.key))})}function _n(e){let t=e.socialLinks;return t?[t.website?{key:"website",href:t.website,label:"website",external:true,icon:jsxRuntime.jsx(lucideReact.Globe,{className:"size-4","aria-hidden":"true"})}:void 0,t.x?{key:"x",href:t.x,label:"on X",external:true,icon:jsxRuntime.jsx(fa6.FaXTwitter,{className:"size-4","aria-hidden":"true"})}:void 0,t.linkedin?{key:"linkedin",href:t.linkedin,label:"on LinkedIn",external:true,icon:jsxRuntime.jsx(fa6.FaLinkedinIn,{className:"size-4","aria-hidden":"true"})}:void 0,t.github?{key:"github",href:t.github,label:"on GitHub",external:true,icon:jsxRuntime.jsx(fa6.FaGithub,{className:"size-4","aria-hidden":"true"})}:void 0,t.email?{key:"email",href:`mailto:${t.email}`,label:"email",external:false,icon:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})}:void 0].filter(n=>!!n):[]}function In(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function Bn({cta:e}){return jsxRuntime.jsx("div",{className:"rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-accent-bg)] p-5 sm:p-6",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("h2",{className:"text-foreground text-xl font-semibold",children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground leading-relaxed",children:e.description})]}),jsxRuntime.jsxs(J__default.default,{href:e.href,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-full bg-[var(--blog-accent)] px-4 py-2 text-sm font-semibold text-white transition-opacity hover:opacity-90",children:[e.label,jsxRuntime.jsx(lucideReact.ArrowUpRight,{className:"size-4","aria-hidden":"true"})]})]})})}function En({title:e,url:t}){let r=encodeURIComponent(e),n=encodeURIComponent(t);return jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-3",children:[jsxRuntime.jsx(He,{title:e,url:t,size:"sm"}),jsxRuntime.jsx("a",{href:`https://x.com/intent/tweet?text=${r}&url=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on X",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(fa6.FaXTwitter,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${n}`,target:"_blank",rel:"noopener noreferrer","aria-label":"Share on LinkedIn",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(fa6.FaLinkedinIn,{className:"size-4","aria-hidden":"true"})}),jsxRuntime.jsx("a",{href:`mailto:?subject=${r}&body=${n}`,"aria-label":"Share by email",className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})})]})}function On({articles:e,basePath:t}){return jsxRuntime.jsxs("section",{className:"space-y-4","aria-labelledby":"related-articles-title",children:[jsxRuntime.jsx("h2",{id:"related-articles-title",className:"text-xl font-semibold",children:"You might also like"}),jsxRuntime.jsx("div",{className:"grid gap-4 md:grid-cols-3",children:e.map(r=>jsxRuntime.jsxs(J__default.default,{href:S(t,r.slug),className:"group border-border overflow-hidden rounded-2xl border transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)] hover:no-underline",children:[r.featuredImage&&jsxRuntime.jsx(pt,{src:r.featuredImage,alt:r.featuredImageAlt??`Featured image for ${r.title}`}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("h3",{className:"text-foreground line-clamp-3 font-semibold transition-colors group-hover:text-[var(--blog-text-accent)]",children:r.title}),r.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground mt-2 line-clamp-3 text-sm leading-relaxed",children:r.excerpt})]})]},r.id))})]})}function pt({src:e,alt:t}){return jsxRuntime.jsx("div",{className:"border-border aspect-[16/9] overflow-hidden border-b bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(lt__default.default,{src:e,alt:t,width:480,height:270,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"})})}function Mn(e,t="/blog"){let r=e.meta.title??e.title,n=e.meta.description??e.excerpt,o=e.meta.canonicalUrl??`${e.site.domain}${S(t,e.slug)}`,i=e.meta.ogImage??e.featuredImage;return {title:r,description:n,keywords:e.meta.keywords.join(", "),authors:e.author?[{name:e.author.name}]:void 0,openGraph:{title:r,description:n,type:"article",url:o,images:i?[{url:i,alt:e.featuredImageAlt??r}]:void 0,publishedTime:e.publishedAt,modifiedTime:e.updatedAt,authors:e.author?[e.author.name]:void 0,siteName:e.site.name},twitter:{card:"summary_large_image",title:r,description:n,images:i?[i]:void 0},alternates:{canonical:o}}}function Wt({author:e,articles:t,site:r,className:n,basePath:o="/blog",theme:i,pagination:a,navigation:c}){let l=E(o)||"/",u=c?.backToHome?.url??l,m=k(l,e.slug),s=a?.totalItems??t.length,b=ie(Me(e,{pathPrefix:l}));return jsxRuntime.jsxs("main",{style:U(i),className:h("author-page mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-8 sm:mb-14",children:[jsxRuntime.jsxs(J__default.default,{href:u,className:"text-muted-foreground group focus-visible:ring-ring inline-flex items-center gap-2 rounded-md px-2 py-1 text-sm font-medium transition-colors hover:text-[var(--blog-accent)] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",children:[jsxRuntime.jsx(lucideReact.ArrowLeft,{className:"size-4 transition-transform group-hover:-translate-x-1","aria-hidden":"true"}),c?.backToHome?.label??"Back to all articles"]}),jsxRuntime.jsxs("div",{className:"grid gap-6 sm:grid-cols-[auto_minmax(0,1fr)] sm:items-center",children:[jsxRuntime.jsx(zn,{author:e}),jsxRuntime.jsxs("div",{className:"min-w-0 space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.isGuest&&jsxRuntime.jsx(we,{variant:"outline",className:"text-xs",children:"Guest Author"})}),jsxRuntime.jsx("h1",{className:h("text-4xl leading-tight font-light text-balance sm:text-5xl",G),children:e.name})]}),e.bio&&jsxRuntime.jsx("p",{className:"text-muted-foreground max-w-3xl text-lg leading-relaxed text-pretty",children:e.bio}),jsxRuntime.jsx(Gn,{author:e})]})]})]}),jsxRuntime.jsx(ae,{className:"mb-8"}),jsxRuntime.jsxs("section",{"aria-labelledby":"author-articles-title",className:"space-y-6",children:[jsxRuntime.jsx("div",{className:"flex flex-wrap items-end justify-between gap-3",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{id:"author-articles-title",className:"text-foreground text-2xl font-semibold",children:["Articles by ",e.name]}),jsxRuntime.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[s," ",s===1?"article":"articles"," on ",r.name]})]})}),t.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground border-border rounded-2xl border p-6",children:"This author does not have any published articles yet."}):jsxRuntime.jsx("div",{className:"divide-border divide-y",children:t.map(f=>jsxRuntime.jsx(Fn,{article:f,basePath:l},f.id))}),a&&a.totalPages>1&&jsxRuntime.jsx("div",{className:"pt-4",children:jsxRuntime.jsx(ce,{currentPage:a.currentPage,totalPages:a.totalPages,baseUrl:a.baseUrl??m,className:"justify-center"})})]}),jsxRuntime.jsx("script",{type:b.type,dangerouslySetInnerHTML:b.dangerouslySetInnerHTML})]})}function Gn({author:e}){let t=jn(e);return t.length===0?null:jsxRuntime.jsx("div",{className:"flex flex-wrap items-center gap-2","aria-label":"Author links",children:t.map(r=>jsxRuntime.jsx("a",{href:r.href,target:r.external?"_blank":void 0,rel:r.external?"noopener noreferrer":void 0,"aria-label":r.ariaLabel,className:"text-muted-foreground hover:text-foreground border-border inline-flex size-9 items-center justify-center rounded-full border grayscale transition-colors hover:border-[var(--blog-accent-border)] hover:bg-[var(--blog-accent-bg)]",children:r.icon},r.label))})}function jn(e){let t=e.socialLinks;return t?[t.website?{href:t.website,label:"website",ariaLabel:`${e.name}'s website`,external:true,icon:jsxRuntime.jsx(lucideReact.Globe,{className:"size-4","aria-hidden":"true"})}:null,t.x??t.twitter?{href:t.x??t.twitter??"",label:"x",ariaLabel:`${e.name} on X`,external:true,icon:jsxRuntime.jsx("span",{className:"text-sm font-semibold","aria-hidden":"true",children:"X"})}:null,t.linkedin?{href:t.linkedin,label:"linkedin",ariaLabel:`${e.name} on LinkedIn`,external:true,icon:jsxRuntime.jsx("span",{className:"text-sm font-bold","aria-hidden":"true",children:"in"})}:null,t.github?{href:t.github,label:"github",ariaLabel:`${e.name} on GitHub`,external:true,icon:jsxRuntime.jsx("span",{className:"text-xs font-bold","aria-hidden":"true",children:"GH"})}:null,t.email?{href:`mailto:${t.email}`,label:"email",ariaLabel:`Email ${e.name}`,external:false,icon:jsxRuntime.jsx(lucideReact.Mail,{className:"size-4","aria-hidden":"true"})}:null].filter(r=>r!==null):[]}function Fn({article:e,basePath:t}){let r=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true});return jsxRuntime.jsx("article",{className:"py-6 first:pt-0 last:pb-0",children:jsxRuntime.jsxs(J__default.default,{href:S(t,e.slug),className:"group grid gap-4 hover:no-underline sm:grid-cols-[minmax(0,1fr)_12rem] sm:items-start",children:[jsxRuntime.jsxs("div",{className:"min-w-0 space-y-3",children:[jsxRuntime.jsx("h3",{className:"text-xl leading-tight font-semibold text-balance transition-colors group-hover:text-[var(--blog-text-accent)]",children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 leading-relaxed",children:e.excerpt}),jsxRuntime.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-3 gap-y-1 text-sm",children:[jsxRuntime.jsx("time",{dateTime:e.publishedAt,children:r}),jsxRuntime.jsx("span",{"aria-hidden":"true",children:"\u2022"}),jsxRuntime.jsxs("span",{children:[Math.ceil(e.readingSeconds/60)," min read"]})]})]}),e.featuredImage&&jsxRuntime.jsx("div",{className:"border-border relative aspect-[16/10] overflow-hidden rounded-xl border bg-[var(--blog-accent-bg)]",children:jsxRuntime.jsx(lt__default.default,{src:e.featuredImage,alt:e.featuredImageAlt??`Featured image for ${e.title}`,width:320,height:200,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"})})]})})}function zn({author:e}){return e.avatarUrl?jsxRuntime.jsx(lt__default.default,{src:e.avatarUrl,alt:e.name,width:128,height:128,className:"size-28 rounded-full border border-[var(--blog-accent-border)] object-cover sm:size-32",priority:true}):jsxRuntime.jsx("span",{className:"bg-muted text-muted-foreground inline-flex size-28 items-center justify-center rounded-full text-3xl font-semibold sm:size-32",children:Vn(e.name)})}function Vn(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function qn(e,t,r="/blog"){let n=`https://${t.domain.replace(/^https?:\/\//,"").replace(/\/+$/,"")}${k(r,e.slug)}`,o=`${e.name} - ${t.name}`,i=e.bio??`Read articles by ${e.name} on ${t.name}.`;return {title:o,description:i,authors:[{name:e.name}],openGraph:{title:o,description:i,type:"profile",url:n,images:e.avatarUrl?[{url:e.avatarUrl,alt:e.name}]:void 0,siteName:t.name},twitter:{card:e.avatarUrl?"summary_large_image":"summary",title:o,description:i,images:e.avatarUrl?[e.avatarUrl]:void 0},alternates:{canonical:n}}}var Ge=class{articles=new Map;operations=new Map;async saveArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(Array.from(this.articles.values()).some(a=>a.id===t.id))return n}else return n;if(this.articles.has(t.slug)){let i={success:false,error:{code:"PUB003",message:"This URL is already in use. Please choose another."},idempotencyKey:r};return await this.storeOperationResult(r,i),i}this.articles.set(t.slug,t);let o={success:true,url:`/${t.slug}`,platformPostId:t.id,publishedAt:t.publishedAt,idempotencyKey:r};return await this.storeOperationResult(r,o),o}async getArticle(t){return this.articles.get(t)??null}async listArticles(t={}){let{limit:r=10,offset:n=0,sortBy:o="publishedAt",order:i="desc"}=t,a=Array.from(this.articles.values());return a.sort((l,u)=>{let m=new Date(l[o]).getTime(),s=new Date(u[o]).getTime();return i==="desc"?s-m:m-s}),{articles:a.slice(n,n+r),total:a.length}}async removeArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(!this.articles.has(t))return n}else return n;if(!this.articles.has(t)){let i={success:false,error:{code:"PUB007",message:"Article not found"},idempotencyKey:r};return await this.storeOperationResult(r,i),i}this.articles.delete(t);let o={success:true,idempotencyKey:r};return await this.storeOperationResult(r,o),o}async checkIdempotency(t){return this.operations.get(t)??null}async storeOperationResult(t,r){this.operations.set(t,r);}};function Xn(){let e=globalThis;if(e.__BLOG_PLATFORM_STORAGE_WARNED__)return;e.__BLOG_PLATFORM_STORAGE_WARNED__=true;let t="Blog platform: No storage provider configured. Falling back to in-memory storage (data is not persisted).";process.env.NODE_ENV==="production"?console.error(`${t} Call initBlogPlatform({ storage: /* your persistent adapter */ }) to avoid data loss.`):console.warn(t);}function Wn(){let e=globalThis;e.__BLOG_PLATFORM_STORAGE__||(Xn(),e.__BLOG_PLATFORM_STORAGE__=new Ge);let t=e.__BLOG_PLATFORM_STORAGE__;if(!t)throw new Error("Blog platform storage not initialized");return t}function q(){return Wn()}function ft(e){let t=globalThis;t.__BLOG_PLATFORM_STORAGE__=e;}function pe(e){let t=new Map;for(let r of e)r.author?.slug&&t.set(r.author.slug,Jt(t.get(r.author.slug),r.author));return Array.from(t.values()).sort((r,n)=>r.name.localeCompare(n.name))}function Kt(e,t){let r=t.filter(o=>o.author?.slug===e).sort((o,i)=>new Date(i.publishedAt).getTime()-new Date(o.publishedAt).getTime()),n=r.reduce((o,i)=>i.author?Jt(o,i.author):o,null);return n?{author:n,articles:r}:null}async function Kn(e,t={},r=q()){let{articles:n}=await r.listArticles({limit:t.limit??1e3,offset:t.offset??0,sortBy:"publishedAt",order:"desc"});return Kt(e,n)}function Jt(e,t){return e?{...e,bio:e.bio??t.bio,avatarUrl:e.avatarUrl??t.avatarUrl,pronouns:e.pronouns??t.pronouns,socialLinks:e.socialLinks??t.socialLinks,toneAdjectives:e.toneAdjectives.length>0?e.toneAdjectives:t.toneAdjectives}:t}function Jn(e){let t=e.topics??[];return t.find(r=>r.isPrimary)??t[0]??null}function ge(e){let t=new Map;for(let r of e)for(let n of r.topics??[])t.has(n.slug)||t.set(n.slug,n);return Array.from(t.values()).sort((r,n)=>r.name.localeCompare(n.name))}function ht(e,t){let r=e.filter(o=>(o.topics??[]).some(i=>i.slug===t));if(r.length===0)return null;let n=r.flatMap(o=>o.topics??[]).find(o=>o.slug===t)??null;return n?{topic:n,articles:r}:null}function Zn({articles:e,basePath:t="/blog",title:r="Topics",description:n="Browse articles by topic.",className:o,theme:i}){let a=E(t)||"/",c=ge(e);return jsxRuntime.jsxs("main",{style:U(i),className:h("blog-topics-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",o),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(J__default.default,{href:a,className:"text-muted-foreground hover:text-[var(--blog-accent)] text-sm font-medium transition-colors",children:"Back to all articles"}),jsxRuntime.jsx("h1",{className:h("text-4xl font-light tracking-tight text-balance sm:text-5xl",G),children:r}),jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:n})]}),c.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No topics have published articles yet."}):jsxRuntime.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(l=>{let u=e.filter(m=>(m.topics??[]).some(s=>s.slug===l.slug)).length;return jsxRuntime.jsxs(J__default.default,{href:S(a,`topics/${l.slug}`),className:"group rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] p-5 transition hover:border-[var(--blog-accent)] hover:no-underline",children:[jsxRuntime.jsx("h2",{className:"group-hover:text-[var(--blog-accent)] text-xl font-semibold transition-colors",children:l.name}),l.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground mt-2 line-clamp-3 text-sm leading-relaxed",children:l.description}),jsxRuntime.jsxs("p",{className:"text-muted-foreground mt-4 text-sm",children:[u," ",u===1?"article":"articles"]})]},l.slug)})})]})}function ei({articles:e,topicSlug:t,basePath:r="/blog",className:n,theme:o}){let i=E(r)||"/",a=ht(e,t);return jsxRuntime.jsxs("main",{style:U(o),className:h("blog-topic-archive-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",n),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(J__default.default,{href:S(i,"topics"),className:"text-muted-foreground hover:text-[var(--blog-accent)] text-sm font-medium transition-colors",children:"Back to all topics"}),jsxRuntime.jsx("h1",{className:h("text-4xl font-light tracking-tight text-balance sm:text-5xl",G),children:a?.topic.name??"Topic not found"}),a?.topic.description&&jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:a.topic.description})]}),a?jsxRuntime.jsx("div",{className:"grid gap-5 md:grid-cols-2",children:a.articles.map(c=>jsxRuntime.jsx(ti,{article:c,topic:a.topic,basePath:i},c.id))}):jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No published articles were found for this topic."})]})}function ti({article:e,topic:t,basePath:r}){let n=S(r,e.slug),o=dateFns.formatDistanceToNow(new Date(e.publishedAt),{addSuffix:true});return jsxRuntime.jsxs(J__default.default,{href:n,className:"group overflow-hidden rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] transition hover:border-[var(--blog-accent)] hover:no-underline",children:[e.featuredImage&&jsxRuntime.jsx("div",{className:"relative aspect-[16/9] overflow-hidden",children:jsxRuntime.jsx(lt__default.default,{src:e.featuredImage,alt:e.featuredImageAlt??e.title,width:640,height:360,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"})}),jsxRuntime.jsxs("div",{className:"space-y-3 p-5",children:[jsxRuntime.jsx("span",{className:"inline-flex rounded-full border border-[var(--blog-accent-border)] px-2.5 py-1 text-xs font-medium text-[var(--blog-text-accent)]",children:t.name}),jsxRuntime.jsx("h2",{className:"group-hover:text-[var(--blog-accent)] text-xl font-semibold text-balance transition-colors",children:e.title}),e.excerpt&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed",children:e.excerpt}),jsxRuntime.jsx("p",{className:"text-muted-foreground text-sm",children:o})]})]})}function ni({articles:e,basePath:t="/blog",title:r="Authors",description:n="Browse articles by author.",className:o,theme:i}){let a=E(t)||"/",c=pe(e);return jsxRuntime.jsxs("main",{style:U(i),className:h("blog-authors-page container mx-auto max-w-5xl px-4 py-8 sm:px-6 sm:py-12 lg:px-8 lg:py-16",o),children:[jsxRuntime.jsxs("header",{className:"mb-10 space-y-3 text-center",children:[jsxRuntime.jsx(J__default.default,{href:a,className:"text-muted-foreground text-sm font-medium transition-colors hover:text-[var(--blog-accent)]",children:"Back to all articles"}),jsxRuntime.jsx("h1",{className:h("text-4xl font-light tracking-tight text-balance sm:text-5xl",G),children:r}),jsxRuntime.jsx("p",{className:"text-muted-foreground mx-auto max-w-2xl text-lg text-pretty",children:n})]}),c.length===0?jsxRuntime.jsx("p",{className:"text-muted-foreground rounded-2xl border p-8 text-center",children:"No authors have published articles yet."}):jsxRuntime.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:c.map(l=>{let u=e.filter(m=>m.author?.slug===l.slug).length;return jsxRuntime.jsx(J__default.default,{href:k(a,l.slug),className:"group rounded-2xl border border-[var(--blog-accent-border)] bg-[var(--blog-card-bg)] p-5 transition hover:border-[var(--blog-accent)] hover:no-underline",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-4",children:[jsxRuntime.jsx(ii,{author:l}),jsxRuntime.jsxs("div",{className:"min-w-0 space-y-2",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold transition-colors group-hover:text-[var(--blog-accent)]",children:l.name}),l.bio&&jsxRuntime.jsx("p",{className:"text-muted-foreground line-clamp-3 text-sm leading-relaxed",children:l.bio}),jsxRuntime.jsxs("p",{className:"text-muted-foreground text-sm",children:[u," ",u===1?"article":"articles"]})]})]})},l.slug)})})]})}function ii({author:e}){let t=oi(e.name);return e.avatarUrl?jsxRuntime.jsx(lt__default.default,{src:e.avatarUrl,alt:e.name,width:56,height:56,className:"size-14 shrink-0 rounded-full border border-[var(--blog-accent-border)] object-cover"}):jsxRuntime.jsx("span",{className:"bg-muted text-muted-foreground inline-flex size-14 shrink-0 items-center justify-center rounded-full text-base font-semibold",children:t})}function oi(e){return e.trim().split(/\s+/).filter(Boolean).slice(0,2).map(r=>r[0]?.toUpperCase()).join("")||"?"}function X(e){return `sha256:${crypto.createHash("sha256").update(e).digest("hex")}`}function bt(e){let t=e.headers.get("Authorization");if(!t)return null;let n=/^Bearer\s+(.+)$/i.exec(t);if(n?.[1])return n[1];let i=/^Token\s+(.+)$/i.exec(t);return i?.[1]?i[1]:null}var Fe=class{validApiKeys;constructor(t){this.validApiKeys=new Set(t);}async validateToken(t){return t?.trim()?this.validApiKeys.has(t)?{valid:true,context:{tokenHash:this.hashToken(t)}}:{valid:false,errorCode:"invalid"}:{valid:false,errorCode:"missing"}}extractToken=t=>bt(t);hashToken(t){return X(t)}},fe=class extends Fe{constructor(t="BLOG_PLATFORM_API_KEYS"){let r=process.env[t];!r&&t==="BLOG_PLATFORM_API_KEYS"&&(r=process.env.BLOG_AUTH_TOKEN);let n=r?r.split(",").map(o=>o.trim()).filter(Boolean):[];n.length===0&&console.warn(`\u26A0\uFE0F No API keys found in environment variable ${t}${t==="BLOG_PLATFORM_API_KEYS"?" (set BLOG_PLATFORM_API_KEYS or BLOG_AUTH_TOKEN)":""}. Authentication will fail for all requests.`),super(n);}},Le=class{async validateToken(){return {valid:true,context:{development:true}}}extractToken(){return "development-mode"}},ze=class{hasWarned=false;async validateToken(t){return this.hasWarned||(console.error("\u274C SECURITY WARNING: Blog platform authentication not initialized! All requests will be rejected. Call initBlogPlatform() to configure authentication."),this.hasWarned=true),{valid:false,errorCode:"invalid"}}};function si(){return globalThis.__BLOG_PLATFORM_AUTH_CONFIG__??=new ze,globalThis.__BLOG_PLATFORM_AUTH_CONFIG__}function Ve(e){globalThis.__BLOG_PLATFORM_AUTH_CONFIG__=e;}function xt(){return globalThis.__BLOG_PLATFORM_AUTH_CONFIG__??si()}function li(e){Ve(new fe(e));}async function Y(e){let t=xt(),r=t.extractToken?t.extractToken(e):bt(e);if(!r)return {authenticated:false,result:{valid:false,errorCode:"missing"},token:null};let n=await t.validateToken(r);return {authenticated:n.valid,result:n,token:r}}function ci(e,t=""){let n=xt().errorMessages??{},o,i;switch(e.errorCode){case "missing":o=n.missing??"Authentication token is required",i="PUB005";break;case "expired":o=n.expired??"Authentication token has expired",i="PUB005";break;default:o=n.invalid??"Invalid authentication credentials",i="PUB005";break}return {success:false,error:{code:i,message:o,details:{authError:e.errorCode??"invalid"}},idempotencyKey:t}}async function te(e){let t=await Y(e);return t.authenticated?{authenticated:true,context:t.result.context}:{authenticated:false,error:ci(t.result)}}function ui(){let e=process.env.SKIP_BLOG_PLATFORM_AUTH;return e==="true"||e==="1"||process.env.NODE_ENV==="test"}function mi(){return globalThis.__BLOG_PLATFORM_RATE_LIMITER__??null}function pi(e){let t=globalThis;t.__BLOG_PLATFORM_RATE_LIMITER__=e;}function qe(e){let{redisUrl:t,redisToken:r,requestsPerMinute:n=5,keyPrefix:o="blog-platform-ratelimit",analytics:i=true}=e,a=new redis.Redis({url:t,token:r}),c=new ratelimit.Ratelimit({redis:a,analytics:i,prefix:o,limiter:ratelimit.Ratelimit.slidingWindow(n,"1m")});pi(c);}function yt(){let e=process.env.UPSTASH_REDIS_REST_URL,t=process.env.UPSTASH_REDIS_REST_TOKEN;if(!e||!t){console.warn("Blog platform: No Upstash Redis configuration found. Rate limiting disabled.");return}qe({redisUrl:e,redisToken:t}),console.log("Blog platform: Rate limiting configured (5 requests per minute per token)");}async function Zt(e){let t=mi();if(!t)return console.warn("Blog platform: Rate limiter not configured. All requests allowed."),{success:true,remaining:999,reset:Date.now()+6e4,limit:5,count:0};try{let r=await t.limit(e);return {success:r.success,remaining:r.remaining,reset:r.reset,limit:r.limit,count:r.limit-r.remaining}}catch(r){return console.error("Blog platform: Rate limit check failed:",r),{success:true,remaining:0,reset:Date.now()+6e4,limit:5,count:0}}}function er(e,t=""){let r=Math.ceil((e.reset-Date.now())/6e4);return {success:false,error:{code:"PUB011",message:`Rate limit exceeded. You can make ${e.limit} requests per minute. Try again in ${r} minute(s).`,details:{rateLimit:e}},idempotencyKey:t}}async function Q(e,t=""){let r=await Zt(e);return r.success?{allowed:true,rateLimitResult:r}:{allowed:false,errorResponse:er(r,t)}}function $(e){return {"X-RateLimit-Limit":e.limit.toString(),"X-RateLimit-Remaining":e.remaining.toString(),"X-RateLimit-Reset":e.reset.toString(),"Retry-After":Math.ceil((e.reset-Date.now())/1e3).toString()}}function Xe(e){let{auth:t,storage:r,rateLimit:n,autoRateLimit:o=true}=e;if(!t)throw new Error(`Blog platform initialization failed: 'auth' is required.
115
40
  Example: initBlogPlatform({ auth: new EnvAuth() })
116
- See https://github.com/xexr/blog-platform#authentication for more details.`);console.log("Blog platform: Setting up authentication"),Ue(t),n?(console.log("Blog platform: Using custom rate limiting configuration"),He(n)):o?(console.log("Blog platform: Auto-configuring rate limiting from environment"),gt()):console.log("Blog platform: Rate limiting disabled"),r?(console.log("Blog platform: Using custom storage provider"),lt(r)):console.log("Blog platform: Using default in-memory storage (not suitable for production)"),console.log("Blog platform initialized successfully"),globalThis.__BLOG_PLATFORM_INITIALISED__=true;}function si(e){if(globalThis.__BLOG_PLATFORM_INITIALISED__){console.log("Blog platform: Already initialized, skipping");return}console.log("Blog platform: Initializing blog platform once"),je(e);}function li(){je({auth:new we,autoRateLimit:false}),console.log("Blog platform: Development mode enabled (no auth, in-memory storage, no rate limiting)");}function ci(e){let t=e??"BLOG_PLATFORM_API_KEYS";if(!process.env[t])throw new Error(`Missing required environment variable: ${t}. Set this to a comma-separated list of API keys for blog platform authentication.`);je({auth:new se(t),autoRateLimit:true}),console.log("Blog platform: Production mode enabled (environment-based auth, rate limiting)");}var w=sqliteCore.sqliteTable("bp_articles",{id:sqliteCore.text("id").primaryKey(),slug:sqliteCore.text("slug").notNull(),title:sqliteCore.text("title").notNull(),excerpt:sqliteCore.text("excerpt").notNull(),content:sqliteCore.text("content").notNull(),readingSeconds:sqliteCore.integer("reading_seconds").notNull(),wordCount:sqliteCore.integer("word_count").notNull(),publishedAt:sqliteCore.text("published_at").notNull(),updatedAt:sqliteCore.text("updated_at").notNull(),featuredImage:sqliteCore.text("featured_image"),featuredImageAlt:sqliteCore.text("featured_image_alt"),featuredImageCaption:sqliteCore.text("featured_image_caption"),featuredImageCreditText:sqliteCore.text("featured_image_credit_text"),featuredImageCreditUrl:sqliteCore.text("featured_image_credit_url"),authorJson:sqliteCore.text("author_json"),siteJson:sqliteCore.text("site_json").notNull(),metaJson:sqliteCore.text("meta_json").notNull(),version:sqliteCore.integer("version").notNull()},e=>({slugUniqueIdx:sqliteCore.uniqueIndex("bp_articles_slug_unique").on(e.slug)})),le=sqliteCore.sqliteTable("bp_operations",{key:sqliteCore.text("key").primaryKey(),resultJson:sqliteCore.text("result_json").notNull(),createdAt:sqliteCore.integer("created_at",{mode:"timestamp_ms"}).notNull(),expiresAt:sqliteCore.integer("expires_at",{mode:"timestamp_ms"})});function gi(e){return {id:e.id,slug:e.slug,title:e.title,excerpt:e.excerpt,content:e.content,readingSeconds:e.readingSeconds,wordCount:e.wordCount,publishedAt:e.publishedAt,updatedAt:e.updatedAt,featuredImage:e.featuredImage??null,featuredImageAlt:e.featuredImageAlt??null,featuredImageCaption:e.featuredImageCaption??null,featuredImageCreditText:e.featuredImageCreditText??null,featuredImageCreditUrl:e.featuredImageCreditUrl??null,authorJson:e.author?JSON.stringify(e.author):null,siteJson:JSON.stringify(e.site),metaJson:JSON.stringify({...e.meta,__bloggyTopics:e.topics??[]}),version:e.version}}function Jt(e){return {id:e.id,slug:e.slug,title:e.title,excerpt:e.excerpt,content:e.content,readingSeconds:e.readingSeconds,wordCount:e.wordCount,publishedAt:e.publishedAt,updatedAt:e.updatedAt,featuredImage:e.featuredImage??void 0,featuredImageAlt:e.featuredImageAlt??void 0,featuredImageCaption:e.featuredImageCaption??void 0,featuredImageCreditText:e.featuredImageCreditText??void 0,featuredImageCreditUrl:e.featuredImageCreditUrl??void 0,author:e.authorJson?JSON.parse(e.authorJson):null,site:JSON.parse(e.siteJson),topics:fi(e.metaJson),meta:hi(e.metaJson),version:e.version}}function fi(e){return JSON.parse(e).__bloggyTopics??[]}function hi(e){let t=JSON.parse(e);return delete t.__bloggyTopics,t}var ft=class{db;options;constructor(t,r={}){this.db=t,this.options=r;}async saveArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if((await this.db.select({id:w.id}).from(w).where(drizzleOrm.eq(w.id,t.id)).limit(1)).length!==0)return n}else return n;let o=await this.db.select().from(w).where(drizzleOrm.eq(w.slug,t.slug)).limit(1),i=o[0];if(i&&i.id!==t.id){let l={success:false,error:{code:"PUB003",message:"This URL is already in use. Please choose another."},idempotencyKey:r};return await this.storeOperationResult(r,l),l}let a=gi(t);o.length===0?await this.db.insert(w).values(a).run():await this.db.update(w).set({title:a.title,excerpt:a.excerpt,content:a.content,readingSeconds:a.readingSeconds,wordCount:a.wordCount,updatedAt:a.updatedAt,featuredImage:a.featuredImage,featuredImageAlt:a.featuredImageAlt,featuredImageCaption:a.featuredImageCaption,featuredImageCreditText:a.featuredImageCreditText,featuredImageCreditUrl:a.featuredImageCreditUrl,authorJson:a.authorJson,siteJson:a.siteJson,metaJson:a.metaJson,version:a.version}).where(drizzleOrm.and(drizzleOrm.eq(w.id,a.id),drizzleOrm.eq(w.slug,a.slug))).run();let s={success:true,url:`/${t.slug}`,platformPostId:t.id,publishedAt:t.publishedAt,idempotencyKey:r};return await this.storeOperationResult(r,s),s}async getArticle(t){let r=await this.db.select().from(w).where(drizzleOrm.eq(w.slug,t)).limit(1);return r[0]?Jt(r[0]):null}async listArticles(t={}){let{limit:r=10,offset:n=0,sortBy:o="publishedAt",order:i="desc"}=t,a=o==="publishedAt"?w.publishedAt:w.updatedAt,s=i==="desc"?drizzleOrm.desc(a):a,l=await this.db.select().from(w).orderBy(s).limit(r).offset(n),c=await this.db.select({c:drizzleOrm.sql`count(*)`}).from(w),m=Number(c?.[0]?.c??0);return {articles:l.map(Jt),total:m}}async removeArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(!((await this.db.select({id:w.id}).from(w).where(drizzleOrm.eq(w.slug,t)).limit(1)).length>0))return n}else return n;if(!(await this.db.select().from(w).where(drizzleOrm.eq(w.slug,t)).limit(1))[0]){let a={success:false,error:{code:"PUB007",message:"Article not found"},idempotencyKey:r};return await this.storeOperationResult(r,a),a}await this.db.delete(w).where(drizzleOrm.eq(w.slug,t)).run();let i={success:true,idempotencyKey:r};return await this.storeOperationResult(r,i),i}async checkIdempotency(t){let r=await this.db.select().from(le).where(drizzleOrm.eq(le.key,t)).limit(1);if(!r[0])return null;try{return JSON.parse(r[0].resultJson)}catch{return null}}async storeOperationResult(t,r){let n=Date.now(),o=this.options.operationTtlMs?n+this.options.operationTtlMs:null;await this.db.delete(le).where(drizzleOrm.eq(le.key,t)).run(),await this.db.insert(le).values({key:t,resultJson:JSON.stringify(r),createdAt:new Date(n),expiresAt:o?new Date(o):null}).run();}};function bi(){return {createArticles:`CREATE TABLE IF NOT EXISTS bp_articles (
41
+ See https://github.com/xexr/blog-platform#authentication for more details.`);console.log("Blog platform: Setting up authentication"),Ve(t),n?(console.log("Blog platform: Using custom rate limiting configuration"),qe(n)):o?(console.log("Blog platform: Auto-configuring rate limiting from environment"),yt()):console.log("Blog platform: Rate limiting disabled"),r?(console.log("Blog platform: Using custom storage provider"),ft(r)):console.log("Blog platform: Using default in-memory storage (not suitable for production)"),console.log("Blog platform initialized successfully"),globalThis.__BLOG_PLATFORM_INITIALISED__=true;}function gi(e){if(globalThis.__BLOG_PLATFORM_INITIALISED__){console.log("Blog platform: Already initialized, skipping");return}console.log("Blog platform: Initializing blog platform once"),Xe(e);}function fi(){Xe({auth:new Le,autoRateLimit:false}),console.log("Blog platform: Development mode enabled (no auth, in-memory storage, no rate limiting)");}function hi(e){let t=e??"BLOG_PLATFORM_API_KEYS";if(!process.env[t])throw new Error(`Missing required environment variable: ${t}. Set this to a comma-separated list of API keys for blog platform authentication.`);Xe({auth:new fe(t),autoRateLimit:true}),console.log("Blog platform: Production mode enabled (environment-based auth, rate limiting)");}var T=sqliteCore.sqliteTable("bp_articles",{id:sqliteCore.text("id").primaryKey(),slug:sqliteCore.text("slug").notNull(),title:sqliteCore.text("title").notNull(),excerpt:sqliteCore.text("excerpt").notNull(),content:sqliteCore.text("content").notNull(),readingSeconds:sqliteCore.integer("reading_seconds").notNull(),wordCount:sqliteCore.integer("word_count").notNull(),publishedAt:sqliteCore.text("published_at").notNull(),updatedAt:sqliteCore.text("updated_at").notNull(),featuredImage:sqliteCore.text("featured_image"),featuredImageAlt:sqliteCore.text("featured_image_alt"),featuredImageCaption:sqliteCore.text("featured_image_caption"),featuredImageCreditText:sqliteCore.text("featured_image_credit_text"),featuredImageCreditUrl:sqliteCore.text("featured_image_credit_url"),authorJson:sqliteCore.text("author_json"),siteJson:sqliteCore.text("site_json").notNull(),metaJson:sqliteCore.text("meta_json").notNull(),version:sqliteCore.integer("version").notNull()},e=>({slugUniqueIdx:sqliteCore.uniqueIndex("bp_articles_slug_unique").on(e.slug)})),he=sqliteCore.sqliteTable("bp_operations",{key:sqliteCore.text("key").primaryKey(),resultJson:sqliteCore.text("result_json").notNull(),createdAt:sqliteCore.integer("created_at",{mode:"timestamp_ms"}).notNull(),expiresAt:sqliteCore.integer("expires_at",{mode:"timestamp_ms"})});function Pi(e){return {id:e.id,slug:e.slug,title:e.title,excerpt:e.excerpt,content:e.content,readingSeconds:e.readingSeconds,wordCount:e.wordCount,publishedAt:e.publishedAt,updatedAt:e.updatedAt,featuredImage:e.featuredImage??null,featuredImageAlt:e.featuredImageAlt??null,featuredImageCaption:e.featuredImageCaption??null,featuredImageCreditText:e.featuredImageCreditText??null,featuredImageCreditUrl:e.featuredImageCreditUrl??null,authorJson:e.author?JSON.stringify(e.author):null,siteJson:JSON.stringify(e.site),metaJson:JSON.stringify({...e.meta,__bloggyTopics:e.topics??[]}),version:e.version}}function tr(e){return {id:e.id,slug:e.slug,title:e.title,excerpt:e.excerpt,content:e.content,readingSeconds:e.readingSeconds,wordCount:e.wordCount,publishedAt:e.publishedAt,updatedAt:e.updatedAt,featuredImage:e.featuredImage??void 0,featuredImageAlt:e.featuredImageAlt??void 0,featuredImageCaption:e.featuredImageCaption??void 0,featuredImageCreditText:e.featuredImageCreditText??void 0,featuredImageCreditUrl:e.featuredImageCreditUrl??void 0,author:e.authorJson?JSON.parse(e.authorJson):null,site:JSON.parse(e.siteJson),topics:Ai(e.metaJson),meta:wi(e.metaJson),version:e.version}}function Ai(e){return JSON.parse(e).__bloggyTopics??[]}function wi(e){let t=JSON.parse(e);return delete t.__bloggyTopics,t}var vt=class{db;options;constructor(t,r={}){this.db=t,this.options=r;}async saveArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if((await this.db.select({id:T.id}).from(T).where(drizzleOrm.eq(T.id,t.id)).limit(1)).length!==0)return n}else return n;let o=await this.db.select().from(T).where(drizzleOrm.eq(T.slug,t.slug)).limit(1),i=o[0];if(i&&i.id!==t.id){let l={success:false,error:{code:"PUB003",message:"This URL is already in use. Please choose another."},idempotencyKey:r};return await this.storeOperationResult(r,l),l}let a=Pi(t);o.length===0?await this.db.insert(T).values(a).run():await this.db.update(T).set({title:a.title,excerpt:a.excerpt,content:a.content,readingSeconds:a.readingSeconds,wordCount:a.wordCount,updatedAt:a.updatedAt,featuredImage:a.featuredImage,featuredImageAlt:a.featuredImageAlt,featuredImageCaption:a.featuredImageCaption,featuredImageCreditText:a.featuredImageCreditText,featuredImageCreditUrl:a.featuredImageCreditUrl,authorJson:a.authorJson,siteJson:a.siteJson,metaJson:a.metaJson,version:a.version}).where(drizzleOrm.and(drizzleOrm.eq(T.id,a.id),drizzleOrm.eq(T.slug,a.slug))).run();let c={success:true,url:`/${t.slug}`,platformPostId:t.id,publishedAt:t.publishedAt,idempotencyKey:r};return await this.storeOperationResult(r,c),c}async getArticle(t){let r=await this.db.select().from(T).where(drizzleOrm.eq(T.slug,t)).limit(1);return r[0]?tr(r[0]):null}async listArticles(t={}){let{limit:r=10,offset:n=0,sortBy:o="publishedAt",order:i="desc"}=t,a=o==="publishedAt"?T.publishedAt:T.updatedAt,c=i==="desc"?drizzleOrm.desc(a):a,l=await this.db.select().from(T).orderBy(c).limit(r).offset(n),u=await this.db.select({c:drizzleOrm.sql`count(*)`}).from(T),m=Number(u?.[0]?.c??0);return {articles:l.map(tr),total:m}}async removeArticle(t,r){let n=await this.checkIdempotency(r);if(n)if(n.success){if(!((await this.db.select({id:T.id}).from(T).where(drizzleOrm.eq(T.slug,t)).limit(1)).length>0))return n}else return n;if(!(await this.db.select().from(T).where(drizzleOrm.eq(T.slug,t)).limit(1))[0]){let a={success:false,error:{code:"PUB007",message:"Article not found"},idempotencyKey:r};return await this.storeOperationResult(r,a),a}await this.db.delete(T).where(drizzleOrm.eq(T.slug,t)).run();let i={success:true,idempotencyKey:r};return await this.storeOperationResult(r,i),i}async checkIdempotency(t){let r=await this.db.select().from(he).where(drizzleOrm.eq(he.key,t)).limit(1);if(!r[0])return null;try{return JSON.parse(r[0].resultJson)}catch{return null}}async storeOperationResult(t,r){let n=Date.now(),o=this.options.operationTtlMs?n+this.options.operationTtlMs:null;await this.db.delete(he).where(drizzleOrm.eq(he.key,t)).run(),await this.db.insert(he).values({key:t,resultJson:JSON.stringify(r),createdAt:new Date(n),expiresAt:o?new Date(o):null}).run();}};function Si(){return {createArticles:`CREATE TABLE IF NOT EXISTS bp_articles (
117
42
  id TEXT PRIMARY KEY,
118
43
  slug TEXT NOT NULL UNIQUE,
119
44
  title TEXT NOT NULL,
@@ -137,11 +62,11 @@ See https://github.com/xexr/blog-platform#authentication for more details.`);con
137
62
  result_json TEXT NOT NULL,
138
63
  created_at INTEGER NOT NULL,
139
64
  expires_at INTEGER
140
- );`}}function ce(e,t=true){let r=e.trim();return r=r.replace(/\/+$/,""),/^https?:\/\//.exec(r)||(r=`${t?"https":"http"}://${r}`),t&&r.startsWith("http://")&&(r=r.replace("http://","https://")),r}function Qt(e){let t=e.trim();if(!t)throw new Error("Slug cannot be empty");if(!/^[a-z0-9-]+$/.test(t))throw new Error("Slug can only contain lowercase letters, numbers, and hyphens");let n=t.replace(/-+/g,"-").replace(/^-+|-+$/g,"");if(!n)throw new Error("Slug cannot consist only of hyphens");return n}function te(e,t={}){let{forceHttps:r=true,removeTrailingSlash:n=true,domain:o=e.site.domain,pathPrefix:i="/blog"}=t;if(!o)throw new Error("Domain is required for canonical URL generation");if(!e.slug)throw new Error("Article slug is required for canonical URL generation");let a=ce(o,r),s=Qt(e.slug),l=i.replace(/^(?!\/)/,"/").replace(/\/+$/,""),c=`${a}${l}/${s}`;return n&&(c=c.replace(/\/+$/,"")),c}function xi(e,t,r={}){return te({slug:t,site:e},r)}function yi(e){try{let t=new URL(e);return !(!["http:","https:"].includes(t.protocol)||!t.hostname||t.hostname.length===0||/^https?:\/\/\//.exec(e)&&!/^https?:\/\/[^\/]/.exec(e)||e.includes(" "))}catch{return false}}function vi(e){try{let t=new URL(e);return `${t.protocol}//${t.host}`}catch{throw new Error("Invalid canonical URL provided")}}function Pi(e,t={}){let r=te(e,t);return {...e,meta:{...e.meta,canonicalUrl:r}}}function Ai(e,t={},r){let n=r?.path??"/blog",i=`https://${t.canonical?.domain??e.domain}${n}`,a=r?.title?`${r.title} | ${e.name}`:e.name,s=r?.description??e.description,l=t.openGraph?.siteName??e.name,c=[{name:"description",content:s},{name:"author",content:l}];r?.pageNumber&&r.pageNumber>1&&c.push({name:"page",content:r.pageNumber.toString()}),t.meta?.robots&&c.push({name:"robots",content:t.meta.robots}),t.meta?.viewport&&c.push({name:"viewport",content:t.meta.viewport}),t.meta?.themeColor&&c.push({name:"theme-color",content:t.meta.themeColor}),t.meta?.applicationName&&c.push({name:"application-name",content:t.meta.applicationName});let m=[{property:"og:title",content:a},{property:"og:description",content:s},{property:"og:url",content:i},{property:"og:site_name",content:l},{property:"og:locale",content:t.openGraph?.locale??e.locale},{property:"og:type",content:t.openGraph?.type??"website"}];t.openGraph?.defaultImage&&m.push({property:"og:image",content:t.openGraph.defaultImage},{property:"og:image:alt",content:`${l} - ${e.tagline}`});let d=wi(null,{site:t.twitter?.site,creator:t.twitter?.creator,cardType:t.twitter?.cardType??"summary"},{title:a,description:s,image:t.openGraph?.defaultImage});return {meta:c,openGraph:m,twitter:d,links:[{rel:"canonical",href:i}],title:a,description:s,canonicalUrl:i}}function wi(e,t,r){let n=r?.title??e?.meta.title??e?.title??"",o=r?.description??e?.meta.description??e?.excerpt??"",i=r?.image??e?.meta.ogImage??e?.featuredImage,a=[{name:"twitter:card",content:t.cardType},{name:"twitter:title",content:n},{name:"twitter:description",content:o}];return t.site&&a.push({name:"twitter:site",content:t.site}),t.creator&&a.push({name:"twitter:creator",content:t.creator}),i&&(a.push({name:"twitter:image",content:i}),e?.featuredImageAlt),a}function Si(e){let t=[];return t.push(`<title>${E(e.title)}</title>`),e.meta.forEach(r=>{let n=[];r.name&&n.push(`name="${E(r.name)}"`),r.property&&n.push(`property="${E(r.property)}"`),r.httpEquiv&&n.push(`http-equiv="${E(r.httpEquiv)}"`),n.push(`content="${E(r.content)}"`),t.push(`<meta ${n.join(" ")} />`);}),e.openGraph.forEach(r=>{t.push(`<meta property="${E(r.property)}" content="${E(r.content)}" />`);}),e.twitter.forEach(r=>{t.push(`<meta name="${E(r.name)}" content="${E(r.content)}" />`);}),e.links.forEach(r=>{let n=[];n.push(`rel="${E(r.rel)}"`),n.push(`href="${E(r.href)}"`),r.type&&n.push(`type="${E(r.type)}"`),r.title&&n.push(`title="${E(r.title)}"`),t.push(`<link ${n.join(" ")} />`);}),t.join(`
141
- `)}function E(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};return e.replace(/[&<>"']/g,r=>t[r]??r)}function Ni(e){let t=[],r=[];return e.title?e.title.length>60?r.push("Title longer than 60 characters may be truncated in search results"):e.title.length<30&&r.push("Title shorter than 30 characters may not be descriptive enough"):t.push("Title is required"),e.description?e.description.length>160?r.push("Meta description longer than 160 characters may be truncated"):e.description.length<120&&r.push("Meta description shorter than 120 characters may not be descriptive enough"):t.push("Meta description is required"),e.canonicalUrl?e.canonicalUrl.startsWith("https://")||r.push("Canonical URL should use HTTPS for better SEO"):t.push("Canonical URL is required"),e.openGraph.find(i=>i.property==="og:image")||r.push("OpenGraph image missing - social media sharing will not show image preview"),e.twitter.find(i=>i.name==="twitter:card")||r.push("Twitter Card type missing - Twitter sharing may not display properly"),{valid:t.length===0,errors:t,warnings:r}}async function ht(e,t,r=[],n={}){let{includeAuthorPages:o=true,includePaginationPages:i=true,articlesPerPage:a=10,maxEntries:s=5e4,changeFrequency:l={},priority:c={}}=n,m=[],d=ce(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true),b=n.canonical?.pathPrefix??"/blog";if(m.push({url:`${d}${b}`,lastModified:ue(t),changeFrequency:l.homePage??"daily",priority:c.homePage??1}),t.forEach(f=>{if(m.length>=s)return;let p=te(f,n.canonical);m.push({url:p,lastModified:f.updatedAt,changeFrequency:l.articles??"monthly",priority:c.articles??.8});}),o&&r.forEach(f=>{if(m.length>=s)return;let p=`${d}${R(b,f.slug)}`,g=t.filter(C=>C.author?.id===f.id),v=ue(g);m.push({url:p,lastModified:v,changeFrequency:l.authorPages??"weekly",priority:c.authorPages??.6});}),i&&t.length>a){let f=Math.ceil(t.length/a);for(let p=2;p<=f&&!(m.length>=s);p++)m.push({url:`${d}${b}?page=${p}`,lastModified:ue(t),changeFrequency:l.paginationPages??"daily",priority:c.paginationPages??.5});}return m}function Ri(e,t,r=[],n={}){let{includeAuthorPages:o=true,includePaginationPages:i=true,articlesPerPage:a=10,maxEntries:s=5e4,changeFrequency:l={},priority:c={}}=n,m=[],d=ce(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true),b=n.canonical?.pathPrefix??"/blog",f=new Date().toISOString(),p=1;if(p+=t.length,o&&(p+=r.length),i&&t.length>a){let v=Math.ceil(t.length/a);p+=v-1;}let g=p>s;if(m.push({loc:`${d}${b}`,lastmod:ue(t),changefreq:l.homePage??"daily",priority:c.homePage??1}),t.forEach(v=>{if(m.length>=s)return;let C=te(v,n.canonical);m.push({loc:C,lastmod:v.updatedAt,changefreq:l.articles??"monthly",priority:c.articles??.8});}),o&&r.forEach(v=>{if(m.length>=s)return;let C=`${d}${R(b,v.slug)}`,H=t.filter(me=>me.author?.id===v.id),re=ue(H);m.push({loc:C,lastmod:re,changefreq:l.authorPages??"weekly",priority:c.authorPages??.6});}),i&&t.length>a){let v=Math.ceil(t.length/a);for(let C=2;C<=v&&!(m.length>=s);C++)m.push({loc:`${d}${b}?page=${C}`,lastmod:ue(t),changefreq:l.paginationPages??"daily",priority:c.paginationPages??.5});}return {entries:m,totalEntries:m.length,truncated:g,generatedAt:f,baseUrl:d}}function Zt(e){let t='<?xml version="1.0" encoding="UTF-8"?>',r='<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',n="</urlset>",o=e.entries.map(i=>{let a=[];return a.push(" <url>"),a.push(` <loc>${Ne(i.loc)}</loc>`),i.lastmod&&a.push(` <lastmod>${Ne(i.lastmod)}</lastmod>`),i.changefreq&&a.push(` <changefreq>${Ne(i.changefreq)}</changefreq>`),i.priority!==void 0&&a.push(` <priority>${i.priority.toFixed(1)}</priority>`),a.push(" </url>"),a.join(`
65
+ );`}}function be(e,t=true){let r=e.trim();return r=r.replace(/\/+$/,""),/^https?:\/\//.exec(r)||(r=`${t?"https":"http"}://${r}`),t&&r.startsWith("http://")&&(r=r.replace("http://","https://")),r}function nr(e){let t=e.trim();if(!t)throw new Error("Slug cannot be empty");if(!/^[a-z0-9-]+$/.test(t))throw new Error("Slug can only contain lowercase letters, numbers, and hyphens");let n=t.replace(/-+/g,"-").replace(/^-+|-+$/g,"");if(!n)throw new Error("Slug cannot consist only of hyphens");return n}function se(e,t={}){let{forceHttps:r=true,removeTrailingSlash:n=true,domain:o=e.site.domain,pathPrefix:i="/blog"}=t;if(!o)throw new Error("Domain is required for canonical URL generation");if(!e.slug)throw new Error("Article slug is required for canonical URL generation");let a=be(o,r),c=nr(e.slug),l=i.replace(/^(?!\/)/,"/").replace(/\/+$/,""),u=`${a}${l}/${c}`;return n&&(u=u.replace(/\/+$/,"")),u}function Ni(e,t,r={}){return se({slug:t,site:e},r)}function Ti(e){try{let t=new URL(e);return !(!["http:","https:"].includes(t.protocol)||!t.hostname||t.hostname.length===0||/^https?:\/\/\//.exec(e)&&!/^https?:\/\/[^\/]/.exec(e)||e.includes(" "))}catch{return false}}function Ri(e){try{let t=new URL(e);return `${t.protocol}//${t.host}`}catch{throw new Error("Invalid canonical URL provided")}}function Ci(e,t={}){let r=se(e,t);return {...e,meta:{...e.meta,canonicalUrl:r}}}function Li(e,t={},r){let n=r?.path??"/blog",i=`https://${t.canonical?.domain??e.domain}${n}`,a=r?.title?`${r.title} | ${e.name}`:e.name,c=r?.description??e.description,l=t.openGraph?.siteName??e.name,u=[{name:"description",content:c},{name:"author",content:l}];r?.pageNumber&&r.pageNumber>1&&u.push({name:"page",content:r.pageNumber.toString()}),t.meta?.robots&&u.push({name:"robots",content:t.meta.robots}),t.meta?.viewport&&u.push({name:"viewport",content:t.meta.viewport}),t.meta?.themeColor&&u.push({name:"theme-color",content:t.meta.themeColor}),t.meta?.applicationName&&u.push({name:"application-name",content:t.meta.applicationName});let m=[{property:"og:title",content:a},{property:"og:description",content:c},{property:"og:url",content:i},{property:"og:site_name",content:l},{property:"og:locale",content:t.openGraph?.locale??e.locale},{property:"og:type",content:t.openGraph?.type??"website"}];t.openGraph?.defaultImage&&m.push({property:"og:image",content:t.openGraph.defaultImage},{property:"og:image:alt",content:`${l} - ${e.tagline}`});let s=ki(null,{site:t.twitter?.site,creator:t.twitter?.creator,cardType:t.twitter?.cardType??"summary"},{title:a,description:c,image:t.openGraph?.defaultImage});return {meta:u,openGraph:m,twitter:s,links:[{rel:"canonical",href:i}],title:a,description:c,canonicalUrl:i}}function ki(e,t,r){let n=r?.title??e?.meta.title??e?.title??"",o=r?.description??e?.meta.description??e?.excerpt??"",i=r?.image??e?.meta.ogImage??e?.featuredImage,a=[{name:"twitter:card",content:t.cardType},{name:"twitter:title",content:n},{name:"twitter:description",content:o}];return t.site&&a.push({name:"twitter:site",content:t.site}),t.creator&&a.push({name:"twitter:creator",content:t.creator}),i&&(a.push({name:"twitter:image",content:i}),e?.featuredImageAlt),a}function _i(e){let t=[];return t.push(`<title>${D(e.title)}</title>`),e.meta.forEach(r=>{let n=[];r.name&&n.push(`name="${D(r.name)}"`),r.property&&n.push(`property="${D(r.property)}"`),r.httpEquiv&&n.push(`http-equiv="${D(r.httpEquiv)}"`),n.push(`content="${D(r.content)}"`),t.push(`<meta ${n.join(" ")} />`);}),e.openGraph.forEach(r=>{t.push(`<meta property="${D(r.property)}" content="${D(r.content)}" />`);}),e.twitter.forEach(r=>{t.push(`<meta name="${D(r.name)}" content="${D(r.content)}" />`);}),e.links.forEach(r=>{let n=[];n.push(`rel="${D(r.rel)}"`),n.push(`href="${D(r.href)}"`),r.type&&n.push(`type="${D(r.type)}"`),r.title&&n.push(`title="${D(r.title)}"`),t.push(`<link ${n.join(" ")} />`);}),t.join(`
66
+ `)}function D(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};return e.replace(/[&<>"']/g,r=>t[r]??r)}function Ii(e){let t=[],r=[];return e.title?e.title.length>60?r.push("Title longer than 60 characters may be truncated in search results"):e.title.length<30&&r.push("Title shorter than 30 characters may not be descriptive enough"):t.push("Title is required"),e.description?e.description.length>160?r.push("Meta description longer than 160 characters may be truncated"):e.description.length<120&&r.push("Meta description shorter than 120 characters may not be descriptive enough"):t.push("Meta description is required"),e.canonicalUrl?e.canonicalUrl.startsWith("https://")||r.push("Canonical URL should use HTTPS for better SEO"):t.push("Canonical URL is required"),e.openGraph.find(i=>i.property==="og:image")||r.push("OpenGraph image missing - social media sharing will not show image preview"),e.twitter.find(i=>i.name==="twitter:card")||r.push("Twitter Card type missing - Twitter sharing may not display properly"),{valid:t.length===0,errors:t,warnings:r}}async function Pt(e,t,r=[],n={}){let{includeAuthorPages:o=true,includeTopicPages:i=true,includePaginationPages:a=true,articlesPerPage:c=10,maxEntries:l=5e4,changeFrequency:u={},priority:m={}}=n,s=[],b=be(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true),f=n.canonical?.pathPrefix??"/blog",g=r.length>0?r:pe(t),p=ge([...t]);if(s.push({url:`${b}${f}`,lastModified:H(t),changeFrequency:u.homePage??"daily",priority:m.homePage??1}),t.forEach(x=>{if(s.length>=l)return;let N=se(x,n.canonical);s.push({url:N,lastModified:x.updatedAt,changeFrequency:u.articles??"monthly",priority:m.articles??.8});}),i&&p.length>0&&(s.length<l&&s.push({url:`${b}${S(f,"topics")}`,lastModified:H(t),changeFrequency:u.topicPages??"weekly",priority:m.topicPages??.6}),p.forEach(x=>{if(s.length>=l)return;let N=t.filter(L=>(L.topics??[]).some(w=>w.slug===x.slug));s.push({url:`${b}${S(f,`topics/${x.slug}`)}`,lastModified:H(N),changeFrequency:u.topicPages??"weekly",priority:m.topicPages??.6});})),o&&g.length>0&&(s.length<l&&s.push({url:`${b}${S(f,"authors")}`,lastModified:H(t),changeFrequency:u.authorPages??"weekly",priority:m.authorPages??.6}),g.forEach(x=>{if(s.length>=l)return;let N=`${b}${k(f,x.slug)}`,L=t.filter(B=>B.author?.id===x.id),w=H(L);s.push({url:N,lastModified:w,changeFrequency:u.authorPages??"weekly",priority:m.authorPages??.6});})),a&&t.length>c){let x=Math.ceil(t.length/c);for(let N=2;N<=x&&!(s.length>=l);N++)s.push({url:`${b}${f}?page=${N}`,lastModified:H(t),changeFrequency:u.paginationPages??"daily",priority:m.paginationPages??.5});}return s}function Bi(e,t,r=[],n={}){let{includeAuthorPages:o=true,includeTopicPages:i=true,includePaginationPages:a=true,articlesPerPage:c=10,maxEntries:l=5e4,changeFrequency:u={},priority:m={}}=n,s=[],b=be(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true),f=n.canonical?.pathPrefix??"/blog",g=new Date().toISOString(),p=r.length>0?r:pe(t),x=ge([...t]),N=1;if(N+=t.length,i&&x.length>0&&(N+=x.length+1),o&&(N+=p.length>0?p.length+1:0),a&&t.length>c){let w=Math.ceil(t.length/c);N+=w-1;}let L=N>l;if(s.push({loc:`${b}${f}`,lastmod:H(t),changefreq:u.homePage??"daily",priority:m.homePage??1}),t.forEach(w=>{if(s.length>=l)return;let B=se(w,n.canonical);s.push({loc:B,lastmod:w.updatedAt,changefreq:u.articles??"monthly",priority:m.articles??.8});}),i&&x.length>0&&(s.length<l&&s.push({loc:`${b}${S(f,"topics")}`,lastmod:H(t),changefreq:u.topicPages??"weekly",priority:m.topicPages??.6}),x.forEach(w=>{if(s.length>=l)return;let B=t.filter(ye=>(ye.topics??[]).some(le=>le.slug===w.slug));s.push({loc:`${b}${S(f,`topics/${w.slug}`)}`,lastmod:H(B),changefreq:u.topicPages??"weekly",priority:m.topicPages??.6});})),o&&p.length>0&&(s.length<l&&s.push({loc:`${b}${S(f,"authors")}`,lastmod:H(t),changefreq:u.authorPages??"weekly",priority:m.authorPages??.6}),p.forEach(w=>{if(s.length>=l)return;let B=`${b}${k(f,w.slug)}`,ye=t.filter(Ke=>Ke.author?.id===w.id),le=H(ye);s.push({loc:B,lastmod:le,changefreq:u.authorPages??"weekly",priority:m.authorPages??.6});})),a&&t.length>c){let w=Math.ceil(t.length/c);for(let B=2;B<=w&&!(s.length>=l);B++)s.push({loc:`${b}${f}?page=${B}`,lastmod:H(t),changefreq:u.paginationPages??"daily",priority:m.paginationPages??.5});}return {entries:s,totalEntries:s.length,truncated:L,generatedAt:g,baseUrl:b}}function ir(e){let t='<?xml version="1.0" encoding="UTF-8"?>',r='<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',n="</urlset>",o=e.entries.map(i=>{let a=[];return a.push(" <url>"),a.push(` <loc>${_e(i.loc)}</loc>`),i.lastmod&&a.push(` <lastmod>${_e(i.lastmod)}</lastmod>`),i.changefreq&&a.push(` <changefreq>${_e(i.changefreq)}</changefreq>`),i.priority!==void 0&&a.push(` <priority>${i.priority.toFixed(1)}</priority>`),a.push(" </url>"),a.join(`
142
67
  `)});return [t,r,...o,n].join(`
143
- `)}function Ti(e,t){let r='<?xml version="1.0" encoding="UTF-8"?>',n='<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',o="</sitemapindex>",i=e.map(a=>{let s=[];return s.push(" <sitemap>"),s.push(` <loc>${Ne(a.url)}</loc>`),a.lastmod&&s.push(` <lastmod>${Ne(a.lastmod)}</lastmod>`),s.push(" </sitemap>"),s.join(`
68
+ `)}function Ei(e,t){let r='<?xml version="1.0" encoding="UTF-8"?>',n='<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',o="</sitemapindex>",i=e.map(a=>{let c=[];return c.push(" <sitemap>"),c.push(` <loc>${_e(a.url)}</loc>`),a.lastmod&&c.push(` <lastmod>${_e(a.lastmod)}</lastmod>`),c.push(" </sitemap>"),c.join(`
144
69
  `)});return [r,n,...i,o].join(`
145
- `)}function Ci(e){let t=[],r=[];e.entries.length===0?t.push("Sitemap must contain at least one URL"):e.entries.length>5e4&&t.push("Sitemap contains more than 50,000 URLs (Google limit)"),e.truncated&&r.push("Sitemap was truncated due to size limits"),e.entries.forEach((o,i)=>{try{new URL(o.loc);}catch{t.push(`Invalid URL at entry ${i+1}: ${o.loc}`);}o.priority!==void 0&&(o.priority<0||o.priority>1)&&t.push(`Invalid priority at entry ${i+1}: must be between 0.0 and 1.0`),o.lastmod&&!ki(o.lastmod)&&t.push(`Invalid lastmod date at entry ${i+1}: ${o.lastmod}`),o.loc.length>2048&&r.push(`URL at entry ${i+1} exceeds 2048 character limit`);});let n=new Map;return e.entries.forEach(o=>{let i=n.get(o.loc)??0;n.set(o.loc,i+1);}),n.forEach((o,i)=>{o>1&&t.push(`Duplicate URL found: ${i} (appears ${o} times)`);}),{valid:t.length===0,errors:t,warnings:r}}function ue(e){return e.length===0?new Date().toISOString():e.reduce((r,n)=>{let o=new Date(n.updatedAt);return o>r?o:r},new Date(e[0].updatedAt)).toISOString()}function Ii(e,t,r=[],n={}){return async function(){let a=(await ht(e,t,r,n)).map(c=>({loc:c.url,lastmod:typeof c.lastModified=="string"?c.lastModified:c.lastModified?.toISOString(),changefreq:c.changeFrequency,priority:c.priority})),s={entries:a,totalEntries:a.length,generatedAt:new Date().toISOString(),baseUrl:ce(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true)},l=Zt(s);return new Response(l,{headers:{"Content-Type":"application/xml","Cache-Control":"public, max-age=3600, s-maxage=3600"}})}}function Li(e){return async function(){let r=await e.getSite(),n=await e.getArticles(),o=e.getAuthors?await e.getAuthors():[];return ht(r,n,o,e.options)}}function Ne(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};return e.replace(/[&<>"']/g,r=>t[r]??r)}function ki(e){try{let t=new Date(e),r=t.toISOString(),n=e.endsWith("Z")&&!e.includes(".")?e.replace("Z",".000Z"):e;return r===n&&!isNaN(t.getTime())}catch{return false}}var de={name:"@xexr/blog-platform",version:"1.0.11"};function er(e){let r=e.replace(/^v/,"").split(".");if(r.length<3)throw new Error(`Invalid version format: ${e}`);let n=parseInt(r[0]??"0",10),o=parseInt(r[1]??"0",10),i=parseInt(r[2]?.split("-")[0]??"0",10);if(isNaN(n)||isNaN(o)||isNaN(i))throw new Error(`Invalid version format: ${e}`);return {major:n,minor:o,patch:i}}function U(){let e=er(de.version);return {name:de.name,version:de.version,...e}}function J(e){try{let t=e.split(" "),r={};for(let n of t){let[o,i]=n.split("/");if(!o||!i)continue;let a=er(i),s={name:o,version:i,...a};o==="bloggy"?r.bloggyVersion=s:o==="platform"&&(r.platformVersion=s);}return r}catch{return null}}function tr(e,t){try{return e.major!==t.major?{compatible:!1,errorCode:"PUB009",errorMessage:`Major version incompatibility: ${e.name} ${e.version} is not compatible with ${t.name} ${t.version}. Please upgrade.`}:e.minor!==t.minor?{compatible:!0,errorCode:"PUB010",warning:`Minor version difference: ${e.name} ${e.version} with ${t.name} ${t.version}. Some features may not be available.`}:{compatible:!0}}catch(r){return {compatible:false,errorMessage:`Failed to check version compatibility: ${r instanceof Error?r.message:"Unknown error"}`}}}var rr={enableCSP:true,cspDirectives:{"default-src":"'self'","script-src":"'self' 'unsafe-inline'","style-src":"'self' 'unsafe-inline'","img-src":"'self' data: https:","font-src":"'self' https:","connect-src":"'self'","media-src":"'self'","object-src":"'none'","base-uri":"'self'","form-action":"'self'","frame-ancestors":"'none'","upgrade-insecure-requests":""},enableFrameOptions:true,frameOptions:"DENY",enableContentTypeOptions:true,enableXSSProtection:true,enableReferrerPolicy:true,referrerPolicy:"strict-origin-when-cross-origin",enableHSTS:true,hstsMaxAge:31536e3,hstsIncludeSubdomains:true,enablePermissionsPolicy:true,permissionsPolicyDirectives:{camera:"()",microphone:"()",geolocation:"()",payment:"()",usb:"()",accelerometer:"()",gyroscope:"()",magnetometer:"()"}};function Bi(){let e=process.env.BLOG_PLATFORM_DISABLE_CSP==="true",t=process.env.BLOG_PLATFORM_FRAME_OPTIONS,r=process.env.BLOG_PLATFORM_DISABLE_HSTS==="true";return {...rr,enableCSP:!e,frameOptions:t??rr.frameOptions,enableHSTS:!r}}function Oi(e){return Object.entries(e).map(([t,r])=>r?`${t} ${r}`:t).join("; ")}function Ei(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join(", ")}function Mi(e,t={}){let r={...Bi(),...t},n={};if(r.enableCSP){let o={...r.cspDirectives,...t.cspDirectives??{}};n["Content-Security-Policy"]=Oi(o);}if(r.enableFrameOptions&&(n["X-Frame-Options"]=r.frameOptions),r.enableContentTypeOptions&&(n["X-Content-Type-Options"]="nosniff"),r.enableXSSProtection&&(n["X-XSS-Protection"]="1; mode=block"),r.enableReferrerPolicy&&(n["Referrer-Policy"]=r.referrerPolicy),r.enableHSTS&&$i(e)){let o=[`max-age=${r.hstsMaxAge}`,r.hstsIncludeSubdomains?"includeSubDomains":""].filter(Boolean).join("; ");n["Strict-Transport-Security"]=o;}if(r.enablePermissionsPolicy){let o={...r.permissionsPolicyDirectives,...t.permissionsPolicyDirectives??{}};n["Permissions-Policy"]=Ei(o);}return n}function $i(e){return !!(e.url.startsWith("https://")||e.headers.get("x-forwarded-proto")==="https"||e.headers.get("cf-visitor")?.includes('"scheme":"https"'))}function ze(e,t={}){return Mi(e,{...t,cspDirectives:{...{"default-src":"'none'","frame-ancestors":"'none'","base-uri":"'none'"},...t.cspDirectives??{}}})}var nr={allowedOrigins:["http://localhost:3000","https://localhost:3000","http://127.0.0.1:3000","https://127.0.0.1:3000"],allowWildcard:false,allowCredentials:false,maxAge:86400,securityConfig:{}};function ir(){let e=process.env.BLOG_PLATFORM_ALLOWED_ORIGINS,t=process.env.BLOG_PLATFORM_ALLOW_WILDCARD==="true",r=process.env.BLOG_PLATFORM_ALLOW_CREDENTIALS==="true";return {...nr,allowedOrigins:e?e.split(",").map(n=>n.trim()):nr.allowedOrigins,allowWildcard:t,allowCredentials:r}}function or(e,t){return e?t.allowWildcard?true:t.allowedOrigins.includes(e):false}function ar(e,t){let r=e.headers.get("origin"),n={};return t.allowWildcard?n["Access-Control-Allow-Origin"]="*":r&&or(r,t)&&(n["Access-Control-Allow-Origin"]=r),t.allowCredentials&&!t.allowWildcard&&(n["Access-Control-Allow-Credentials"]="true"),t.allowWildcard||(n.Vary="Origin"),n}function Di(e,t,r,n){return {...ar(e,t),"Access-Control-Allow-Methods":r.join(", "),"Access-Control-Allow-Headers":n.join(", "),"Access-Control-Max-Age":t.maxAge.toString()}}var Ui=["Content-Type","X-Bloggy-Version","X-Idempotency-Key","Authorization","X-Requested-With"];function P(e,t,r={}){let{status:n=200,headers:o={},corsConfig:i={}}=r,a={...ir(),...i},s=ar(e,a),l=ze(e,a.securityConfig),c={"Content-Type":"application/json",...s,...l,...o};return server.NextResponse.json(t,{status:n,headers:c})}function Re(e,t,r={}){let{allowedHeaders:n=Ui,corsConfig:o={}}=r,i={...ir(),...o},a=e.headers.get("origin");if(a&&!i.allowWildcard&&!or(a,i)){let c=ze(e,i.securityConfig);return new server.NextResponse(null,{status:403,headers:{"Content-Type":"text/plain",...c}})}let s=Di(e,i,[...t,"OPTIONS"],n),l=ze(e,i.securityConfig);return new server.NextResponse(null,{status:200,headers:{...s,...l}})}async function Hi(e){try{let t=await V(e);if(!t.authenticated){let g=await K(e);return P(e,g.error,{status:401})}let r=t.token??"anonymous",n=await q(r);if(!n.allowed){let g=n.errorResponse.error?.details?.rateLimit,v=g&&typeof g=="object"&&"limit"in g&&"remaining"in g&&"reset"in g&&"count"in g&&"success"in g?g:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},C=O(v);return P(e,n.errorResponse,{status:429,headers:C})}if(!e.headers.get("content-type")?.includes("application/json"))return P(e,{success:!1,error:{code:"PUB001",message:"Content-Type must be application/json"},idempotencyKey:""},{status:400});let i;try{i=await e.json();}catch{return P(e,{success:!1,error:{code:"PUB001",message:"Invalid JSON in request body"},idempotencyKey:""},{status:400})}let a=ji(i);if(a.length>0)return P(e,{success:!1,error:{code:"PUB001",message:"Missing required fields",details:{errors:a}},idempotencyKey:i.idempotencyKey??""},{status:400});let s=e.headers.get("X-Bloggy-Version");if(s){let g=J(s);if(g?.platformVersion){let v=U();if(g.platformVersion.major!==v.major)return P(e,{success:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:g.platformVersion.version,serverVersion:v.version}},idempotencyKey:i.idempotencyKey},{status:409})}}if(i.dryRun){let g=[];return i.article.wordCount<50&&g.push("Article has fewer than 50 words, which may affect SEO"),(!i.article.excerpt||i.article.excerpt.length<120)&&g.push("Article excerpt is shorter than recommended 120 characters"),i.article.meta.keywords.length||g.push("No SEO keywords provided"),P(e,{success:!0,warnings:g,idempotencyKey:i.idempotencyKey},{status:200})}let l={...i.article,slug:i.slug??i.article.slug,meta:{...i.article.meta,description:i.metaDescription??i.article.meta.description}};if(!xt(l.slug))return P(e,{success:!1,error:{code:"PUB002",message:"Slug can only contain lowercase letters, numbers, and hyphens"},idempotencyKey:i.idempotencyKey},{status:400});let m=await z().saveArticle(l,i.idempotencyKey),d=U(),b=O(n.rateLimitResult),f={"X-Bloggy-Version":`platform/${d.version}`,"X-Idempotency-Key":i.idempotencyKey,...b};m.success&&(f.Location=m.url??`/${l.slug}`);let p=m.success?201:m.error?.code==="PUB003"?409:400;return P(e,m,{status:p,headers:f})}catch(t){return console.error("Publish endpoint error:",t),P(e,{success:false,error:{code:"PUB007",message:"Internal server error during publishing"},idempotencyKey:""},{status:500})}}function ji(e){let t=[];if(!e||typeof e!="object")return t.push("Request body must be a valid object"),t;let r=e;if((!r.article||typeof r.article!="object")&&t.push("Missing required field: article"),(!r.idempotencyKey||typeof r.idempotencyKey!="string")&&t.push("Missing required field: idempotencyKey"),r.article&&typeof r.article=="object"){let n=r.article,o=["id","slug","title","content","publishedAt","site"];for(let i of o)n[i]||t.push(`Missing required article field: ${i}`);if(n.site&&typeof n.site=="object"){let i=n.site,a=["id","name","domain"];for(let s of a)i[s]||t.push(`Missing required site field: ${s}`);}if(n.meta&&typeof n.meta=="object"){let i=n.meta;Array.isArray(i.keywords)||t.push("Article meta.keywords must be an array");}}return t}function xt(e){return !e||typeof e!="string"?false:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)&&e.length>=1&&e.length<=100}async function Gi(e){try{let t=await V(e);if(!t.authenticated){let p=await K(e);return server.NextResponse.json(p.error,{status:401})}let r=t.token??"anonymous",n=await q(r);if(!n.allowed){let p=n.errorResponse.error?.details?.rateLimit,g=p&&typeof p=="object"&&"limit"in p&&"remaining"in p&&"reset"in p&&"count"in p&&"success"in p?p:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},v=O(g);return P(e,n.errorResponse,{status:429,headers:v})}if(!e.headers.get("content-type")?.includes("application/json"))return P(e,{success:!1,error:{code:"PUB001",message:"Content-Type must be application/json"},idempotencyKey:""},{status:400});let i;try{i=await e.json();}catch{return P(e,{success:!1,error:{code:"PUB001",message:"Invalid JSON in request body"},idempotencyKey:""},{status:400})}let a=Fi(i);if(a.length>0)return P(e,{success:!1,error:{code:"PUB001",message:"Missing required fields",details:{errors:a}},idempotencyKey:i.idempotencyKey??""},{status:400});let s=e.headers.get("X-Bloggy-Version");if(s){let p=J(s);if(p?.platformVersion){let g=U();if(p.platformVersion.major!==g.major)return P(e,{success:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:p.platformVersion.version,serverVersion:g.version}},idempotencyKey:i.idempotencyKey},{status:409})}}if(!Vi(i.slug))return P(e,{success:!1,error:{code:"PUB002",message:"Slug can only contain lowercase letters, numbers, and hyphens"},idempotencyKey:i.idempotencyKey},{status:400});if(i.dryRun){let g=await z().getArticle(i.slug),v=[];return g||v.push("Article with this slug does not exist"),P(e,{success:!0,warnings:v,idempotencyKey:i.idempotencyKey},{status:200})}let c=await z().removeArticle(i.slug,i.idempotencyKey),m=U(),d=O(n.rateLimitResult),b={"X-Bloggy-Version":`platform/${m.version}`,"X-Idempotency-Key":i.idempotencyKey,...d},f=c.success?200:c.error?.code==="PUB007"?404:400;return P(e,c,{status:f,headers:b})}catch(t){return console.error("Unpublish endpoint error:",t),P(e,{success:false,error:{code:"PUB007",message:"Internal server error during unpublishing"},idempotencyKey:""},{status:500})}}function Fi(e){let t=[];if(!e||typeof e!="object")return t.push("Request body must be a valid object"),t;let r=e;return (!r.slug||typeof r.slug!="string")&&t.push("Missing required field: slug"),(!r.idempotencyKey||typeof r.idempotencyKey!="string")&&t.push("Missing required field: idempotencyKey"),r.slug&&typeof r.slug=="string"&&!r.slug.trim()&&t.push("Slug cannot be empty"),t}function Vi(e){return !e||typeof e!="string"?false:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)&&e.length>=1&&e.length<=100}async function qi(e){try{let t=await V(e);if(!t.authenticated){let d=await K(e),b={success:!1,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:!1,errorMessage:d.error?.error?.message??"Authentication required"}};return P(e,b,{status:401})}let r=t.token??"anonymous",n=await q(r);if(!n.allowed){let d=n.errorResponse.error?.details?.rateLimit,b=d&&typeof d=="object"&&"limit"in d&&"remaining"in d&&"reset"in d&&"count"in d&&"success"in d?d:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},f=O(b),p={success:!1,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:!1,errorMessage:n.errorResponse.error?.message??"Rate limit exceeded"}};return P(e,p,{status:429,headers:f})}let o=U(),i=e.headers.get("X-Bloggy-Version"),a={name:"unknown",version:"unknown",major:0,minor:0,patch:0};if(i)try{if(/^\d+\.\d+\.\d+/.test(i)){let d=i.split("."),b=parseInt(d[0]??"0",10),f=parseInt(d[1]??"0",10),p=parseInt(d[2]?.split("-")[0]??"0",10);a={name:"bloggy",version:i,major:b,minor:f,patch:p};}else {let d=J(i);d?.bloggyVersion&&(a=d.bloggyVersion);}}catch(d){console.warn("Failed to parse X-Bloggy-Version header:",d);}let s={compatible:!0};a.version!=="unknown"&&(s=tr(a,o));let l={success:!0,versions:{bloggy:a,platform:o},compatibility:s},c=O(n.rateLimitResult),m={"X-Bloggy-Version":`platform/${o.version}`,"Cache-Control":"public, max-age=300, stale-while-revalidate=60",...c};return P(e,l,{status:200,headers:m})}catch(t){console.error("Version endpoint error:",t);let r={success:false,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:false,errorMessage:"Internal server error while checking version compatibility"},error:t instanceof Error?t.message:"Unknown error"};return P(e,r,{status:500})}}async function Wi(e,{params:t}){try{let{slug:r}=await t,n=await V(e);if(!n.authenticated){let g=await K(e);return server.NextResponse.json(g.error,{status:401})}let o=n.token??"anonymous",i=await q(o);if(!i.allowed){let g=i.errorResponse.error?.details?.rateLimit||{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},v=O(g);return P(e,i.errorResponse,{status:429,headers:v})}if(!r||!xt(r))return P(e,{exists:!1,error:{code:"PUB002",message:"Invalid slug format. Must be lowercase letters, numbers, and hyphens only."}},{status:400});let a=e.headers.get("X-Bloggy-Version");if(a){let g=J(a);if(g?.platformVersion){let v=U();if(g.platformVersion.major!==v.major)return P(e,{exists:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:g.platformVersion.version,serverVersion:v.version}}},{status:409})}}let c=await z().getArticle(r)!==null,m={exists:c,...c&&{message:"Slug is already in use. Please choose another (e.g., append '-v2')."}},d=U(),b=O(i.rateLimitResult),f={"X-Bloggy-Version":`platform/${d.version}`,...b},p=e.headers.get("X-Idempotency-Key");return p&&(f["X-Idempotency-Key"]=p,console.log(`Slug check for idempotency: ${p}, exists: ${c}`)),P(e,m,{status:200,headers:f})}catch(r){return console.error("Slug existence check error:",r instanceof Error?r.message:String(r)),P(e,{exists:false,error:{code:"PUB007",message:"Internal server error during slug check"}},{status:500})}}async function Ki(e){return Re(e,["GET"])}var rl=de.version;
146
- exports.ApiKeyAuth=$e;exports.BlogArticlePage=Ht;exports.BlogAuthorPage=Gt;exports.BlogAuthorsIndexPage=Yn;exports.BlogHomePage=It;exports.BlogTopicArchivePage=Wn;exports.BlogTopicsIndexPage=Xn;exports.Button=gr;exports.Card=xe;exports.CardContent=ye;exports.CardDescription=Jr;exports.CardFooter=Yr;exports.CardHeader=Wr;exports.CardTitle=Kr;exports.DrizzleStorage=ft;exports.EnvAuth=se;exports.InMemoryStorage=Ee;exports.NEWSLETTER_SUCCESS_MESSAGE=_e;exports.NewsletterSignup=fe;exports.NoAuth=we;exports.PACKAGE_VERSION=rl;exports.Pagination=ne;exports.PaginationContent=Fe;exports.PaginationEllipsis=Ce;exports.PaginationItem=F;exports.PaginationLink=Y;exports.PaginationNext=qe;exports.PaginationPrevious=Ve;exports.ShadcnPagination=Ge;exports.StructuredDataError=ge;exports.UninitializedAuth=De;exports.autoConfigureRateLimit=gt;exports.bpArticles=w;exports.bpOperations=le;exports.buildAuthorPath=R;exports.buildBlogPath=L;exports.buttonVariants=Te;exports.checkRateLimit=Wt;exports.cn=h;exports.configureRateLimit=He;exports.createBlogSitemapRoute=Ii;exports.createDynamicBlogSitemap=Li;exports.createRateLimitErrorResponse=Kt;exports.createStructuredDataScript=Q;exports.enforceRateLimit=q;exports.extractKeywordsFromArticle=Sr;exports.extractTableOfContents=Ze;exports.extractTokenFromHeader=mt;exports.formatArticleDateMeta=Qe;exports.generateArticleMetadata=Ln;exports.generateArticleStructuredData=Ie;exports.generateAuthorPageMetadata=Hn;exports.generateAuthorStructuredData=Le;exports.generateBlogHomeMetadata=Fr;exports.generateBlogHomeStructuredData=Ye;exports.generateBlogSitemapEntries=ht;exports.generateBreadcrumbStructuredData=Pt;exports.generateCanonicalUrl=te;exports.generateCanonicalUrlFromSlug=xi;exports.generateCompleteArticleStructuredData=Je;exports.generateOrganizationStructuredData=We;exports.generatePaginationMetadata=Ar;exports.generateSiteMetadata=Ai;exports.generateSitemap=Ri;exports.generateSitemapIndex=Ti;exports.generateWebSiteStructuredData=Ke;exports.getAllTopics=ut;exports.getArticlePrimaryTopic=Fn;exports.getAuthConfig=pt;exports.getAuthorArchive=Ft;exports.getAuthorsFromArticles=ct;exports.getBaseUrl=vi;exports.getBlogThemeStyle=M;exports.getDrizzleAdapterSql=bi;exports.getPathPrefixFromBlogUrl=wr;exports.getRateLimitHeaders=O;exports.getStorage=z;exports.getTopicArchive=dt;exports.initBlogPlatform=je;exports.initBlogPlatformDev=li;exports.initBlogPlatformOnce=si;exports.initBlogPlatformProd=ci;exports.initEnvAuth=ti;exports.isValidCanonicalUrl=yi;exports.loadAuthorArchive=Gn;exports.metadataToHtml=Si;exports.normalizeBlogBasePath=I;exports.normalizeDomain=ce;exports.normalizeSlug=Qt;exports.publishHandler=Hi;exports.safeGenerateArticleStructuredData=Nr;exports.setAuthConfig=Ue;exports.setStorage=lt;exports.shouldSkipAuth=ni;exports.sitemapToXml=Zt;exports.slugExistsHandler=Wi;exports.slugExistsOptionsHandler=Ki;exports.structuredDataToJsonLd=wt;exports.unpublishHandler=Gi;exports.updateArticleCanonicalUrl=Pi;exports.usePagination=Pr;exports.validateMetadata=Ni;exports.validateSitemap=Ci;exports.validateStructuredData=At;exports.versionHandler=qi;//# sourceMappingURL=index.js.map
70
+ `)}function Oi(e){let t=[],r=[];e.entries.length===0?t.push("Sitemap must contain at least one URL"):e.entries.length>5e4&&t.push("Sitemap contains more than 50,000 URLs (Google limit)"),e.truncated&&r.push("Sitemap was truncated due to size limits"),e.entries.forEach((o,i)=>{try{new URL(o.loc);}catch{t.push(`Invalid URL at entry ${i+1}: ${o.loc}`);}o.priority!==void 0&&(o.priority<0||o.priority>1)&&t.push(`Invalid priority at entry ${i+1}: must be between 0.0 and 1.0`),o.lastmod&&!Di(o.lastmod)&&t.push(`Invalid lastmod date at entry ${i+1}: ${o.lastmod}`),o.loc.length>2048&&r.push(`URL at entry ${i+1} exceeds 2048 character limit`);});let n=new Map;return e.entries.forEach(o=>{let i=n.get(o.loc)??0;n.set(o.loc,i+1);}),n.forEach((o,i)=>{o>1&&t.push(`Duplicate URL found: ${i} (appears ${o} times)`);}),{valid:t.length===0,errors:t,warnings:r}}function H(e){return e.length===0?new Date().toISOString():e.reduce((r,n)=>{let o=new Date(n.updatedAt);return o>r?o:r},new Date(e[0].updatedAt)).toISOString()}function Mi(e,t,r=[],n={}){return async function(){let a=(await Pt(e,t,r,n)).map(u=>({loc:u.url,lastmod:typeof u.lastModified=="string"?u.lastModified:u.lastModified?.toISOString(),changefreq:u.changeFrequency,priority:u.priority})),c={entries:a,totalEntries:a.length,generatedAt:new Date().toISOString(),baseUrl:be(n.canonical?.domain??e.domain,n.canonical?.forceHttps??true)},l=ir(c);return new Response(l,{headers:{"Content-Type":"application/xml","Cache-Control":"public, max-age=3600, s-maxage=3600"}})}}function $i(e){return async function(){let r=[...e.staticRoutes??[],...e.getStaticRoutes?await e.getStaticRoutes():[]],n=await e.getSite(),o=await e.getArticles(),i=e.getAuthors?await e.getAuthors():[];return [...r,...await Pt(n,o,i,e.options)]}}function _e(e){let t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"};return e.replace(/[&<>"']/g,r=>t[r]??r)}function Di(e){try{let t=new Date(e),r=t.toISOString(),n=e.endsWith("Z")&&!e.includes(".")?e.replace("Z",".000Z"):e;return r===n&&!isNaN(t.getTime())}catch{return false}}var xe={name:"@xexr/blog-platform",version:"1.0.13"};function or(e){let r=e.replace(/^v/,"").split(".");if(r.length<3)throw new Error(`Invalid version format: ${e}`);let n=parseInt(r[0]??"0",10),o=parseInt(r[1]??"0",10),i=parseInt(r[2]?.split("-")[0]??"0",10);if(isNaN(n)||isNaN(o)||isNaN(i))throw new Error(`Invalid version format: ${e}`);return {major:n,minor:o,patch:i}}function z(){let e=or(xe.version);return {name:xe.name,version:xe.version,...e}}function re(e){try{let t=e.split(" "),r={};for(let n of t){let[o,i]=n.split("/");if(!o||!i)continue;let a=or(i),c={name:o,version:i,...a};o==="bloggy"?r.bloggyVersion=c:o==="platform"&&(r.platformVersion=c);}return r}catch{return null}}function ar(e,t){try{return e.major!==t.major?{compatible:!1,errorCode:"PUB009",errorMessage:`Major version incompatibility: ${e.name} ${e.version} is not compatible with ${t.name} ${t.version}. Please upgrade.`}:e.minor!==t.minor?{compatible:!0,errorCode:"PUB010",warning:`Minor version difference: ${e.name} ${e.version} with ${t.name} ${t.version}. Some features may not be available.`}:{compatible:!0}}catch(r){return {compatible:false,errorMessage:`Failed to check version compatibility: ${r instanceof Error?r.message:"Unknown error"}`}}}var sr={enableCSP:true,cspDirectives:{"default-src":"'self'","script-src":"'self' 'unsafe-inline'","style-src":"'self' 'unsafe-inline'","img-src":"'self' data: https:","font-src":"'self' https:","connect-src":"'self'","media-src":"'self'","object-src":"'none'","base-uri":"'self'","form-action":"'self'","frame-ancestors":"'none'","upgrade-insecure-requests":""},enableFrameOptions:true,frameOptions:"DENY",enableContentTypeOptions:true,enableXSSProtection:true,enableReferrerPolicy:true,referrerPolicy:"strict-origin-when-cross-origin",enableHSTS:true,hstsMaxAge:31536e3,hstsIncludeSubdomains:true,enablePermissionsPolicy:true,permissionsPolicyDirectives:{camera:"()",microphone:"()",geolocation:"()",payment:"()",usb:"()",accelerometer:"()",gyroscope:"()",magnetometer:"()"}};function Hi(){let e=process.env.BLOG_PLATFORM_DISABLE_CSP==="true",t=process.env.BLOG_PLATFORM_FRAME_OPTIONS,r=process.env.BLOG_PLATFORM_DISABLE_HSTS==="true";return {...sr,enableCSP:!e,frameOptions:t??sr.frameOptions,enableHSTS:!r}}function Gi(e){return Object.entries(e).map(([t,r])=>r?`${t} ${r}`:t).join("; ")}function ji(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join(", ")}function Fi(e,t={}){let r={...Hi(),...t},n={};if(r.enableCSP){let o={...r.cspDirectives,...t.cspDirectives??{}};n["Content-Security-Policy"]=Gi(o);}if(r.enableFrameOptions&&(n["X-Frame-Options"]=r.frameOptions),r.enableContentTypeOptions&&(n["X-Content-Type-Options"]="nosniff"),r.enableXSSProtection&&(n["X-XSS-Protection"]="1; mode=block"),r.enableReferrerPolicy&&(n["Referrer-Policy"]=r.referrerPolicy),r.enableHSTS&&zi(e)){let o=[`max-age=${r.hstsMaxAge}`,r.hstsIncludeSubdomains?"includeSubDomains":""].filter(Boolean).join("; ");n["Strict-Transport-Security"]=o;}if(r.enablePermissionsPolicy){let o={...r.permissionsPolicyDirectives,...t.permissionsPolicyDirectives??{}};n["Permissions-Policy"]=ji(o);}return n}function zi(e){return !!(e.url.startsWith("https://")||e.headers.get("x-forwarded-proto")==="https"||e.headers.get("cf-visitor")?.includes('"scheme":"https"'))}function We(e,t={}){return Fi(e,{...t,cspDirectives:{...{"default-src":"'none'","frame-ancestors":"'none'","base-uri":"'none'"},...t.cspDirectives??{}}})}var lr={allowedOrigins:["http://localhost:3000","https://localhost:3000","http://127.0.0.1:3000","https://127.0.0.1:3000"],allowWildcard:false,allowCredentials:false,maxAge:86400,securityConfig:{}};function cr(){let e=process.env.BLOG_PLATFORM_ALLOWED_ORIGINS,t=process.env.BLOG_PLATFORM_ALLOW_WILDCARD==="true",r=process.env.BLOG_PLATFORM_ALLOW_CREDENTIALS==="true";return {...lr,allowedOrigins:e?e.split(",").map(n=>n.trim()):lr.allowedOrigins,allowWildcard:t,allowCredentials:r}}function ur(e,t){return e?t.allowWildcard?true:t.allowedOrigins.includes(e):false}function dr(e,t){let r=e.headers.get("origin"),n={};return t.allowWildcard?n["Access-Control-Allow-Origin"]="*":r&&ur(r,t)&&(n["Access-Control-Allow-Origin"]=r),t.allowCredentials&&!t.allowWildcard&&(n["Access-Control-Allow-Credentials"]="true"),t.allowWildcard||(n.Vary="Origin"),n}function Vi(e,t,r,n){return {...dr(e,t),"Access-Control-Allow-Methods":r.join(", "),"Access-Control-Allow-Headers":n.join(", "),"Access-Control-Max-Age":t.maxAge.toString()}}var qi=["Content-Type","X-Bloggy-Version","X-Idempotency-Key","Authorization","X-Requested-With"];function P(e,t,r={}){let{status:n=200,headers:o={},corsConfig:i={}}=r,a={...cr(),...i},c=dr(e,a),l=We(e,a.securityConfig),u={"Content-Type":"application/json",...c,...l,...o};return server.NextResponse.json(t,{status:n,headers:u})}function Ie(e,t,r={}){let{allowedHeaders:n=qi,corsConfig:o={}}=r,i={...cr(),...o},a=e.headers.get("origin");if(a&&!i.allowWildcard&&!ur(a,i)){let u=We(e,i.securityConfig);return new server.NextResponse(null,{status:403,headers:{"Content-Type":"text/plain",...u}})}let c=Vi(e,i,[...t,"OPTIONS"],n),l=We(e,i.securityConfig);return new server.NextResponse(null,{status:200,headers:{...c,...l}})}async function Xi(e){try{let t=await Y(e);if(!t.authenticated){let p=await te(e);return P(e,p.error,{status:401})}let r=X(t.token??"anonymous"),n=await Q(r);if(!n.allowed){let p=n.errorResponse.error?.details?.rateLimit,x=p&&typeof p=="object"&&"limit"in p&&"remaining"in p&&"reset"in p&&"count"in p&&"success"in p?p:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},N=$(x);return P(e,n.errorResponse,{status:429,headers:N})}if(!e.headers.get("content-type")?.includes("application/json"))return P(e,{success:!1,error:{code:"PUB001",message:"Content-Type must be application/json"},idempotencyKey:""},{status:400});let i;try{i=await e.json();}catch{return P(e,{success:!1,error:{code:"PUB001",message:"Invalid JSON in request body"},idempotencyKey:""},{status:400})}let a=Wi(i);if(a.length>0)return P(e,{success:!1,error:{code:"PUB001",message:"Missing required fields",details:{errors:a}},idempotencyKey:i.idempotencyKey??""},{status:400});let c=e.headers.get("X-Bloggy-Version");if(c){let p=re(c);if(p?.platformVersion){let x=z();if(p.platformVersion.major!==x.major)return P(e,{success:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:p.platformVersion.version,serverVersion:x.version}},idempotencyKey:i.idempotencyKey},{status:409})}}if(i.dryRun){let p=[];return i.article.wordCount<50&&p.push("Article has fewer than 50 words, which may affect SEO"),(!i.article.excerpt||i.article.excerpt.length<120)&&p.push("Article excerpt is shorter than recommended 120 characters"),i.article.meta.keywords.length||p.push("No SEO keywords provided"),P(e,{success:!0,warnings:p,idempotencyKey:i.idempotencyKey},{status:200})}let l={...i.article,slug:i.slug??i.article.slug,meta:{...i.article.meta,description:i.metaDescription??i.article.meta.description}};if(!wt(l.slug))return P(e,{success:!1,error:{code:"PUB002",message:"Slug can only contain lowercase letters, numbers, and hyphens"},idempotencyKey:i.idempotencyKey},{status:400});let m=await q().saveArticle(l,i.idempotencyKey),s=z(),b=$(n.rateLimitResult),f={"X-Bloggy-Version":`platform/${s.version}`,"X-Idempotency-Key":i.idempotencyKey,...b};m.success&&(f.Location=m.url??`/${l.slug}`);let g=m.success?201:m.error?.code==="PUB003"?409:400;return P(e,m,{status:g,headers:f})}catch(t){return console.error("Publish endpoint error:",t),P(e,{success:false,error:{code:"PUB007",message:"Internal server error during publishing"},idempotencyKey:""},{status:500})}}function Wi(e){let t=[];if(!e||typeof e!="object")return t.push("Request body must be a valid object"),t;let r=e;if((!r.article||typeof r.article!="object")&&t.push("Missing required field: article"),(!r.idempotencyKey||typeof r.idempotencyKey!="string")&&t.push("Missing required field: idempotencyKey"),r.article&&typeof r.article=="object"){let n=r.article,o=["id","slug","title","content","publishedAt","site"];for(let i of o)n[i]||t.push(`Missing required article field: ${i}`);if(n.site&&typeof n.site=="object"){let i=n.site,a=["id","name","domain"];for(let c of a)i[c]||t.push(`Missing required site field: ${c}`);}if(n.meta&&typeof n.meta=="object"){let i=n.meta;Array.isArray(i.keywords)||t.push("Article meta.keywords must be an array");}}return t}function wt(e){return !e||typeof e!="string"?false:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)&&e.length>=1&&e.length<=100}async function Ji(e){try{let t=await Y(e);if(!t.authenticated){let g=await te(e);return server.NextResponse.json(g.error,{status:401})}let r=X(t.token??"anonymous"),n=await Q(r);if(!n.allowed){let g=n.errorResponse.error?.details?.rateLimit,p=g&&typeof g=="object"&&"limit"in g&&"remaining"in g&&"reset"in g&&"count"in g&&"success"in g?g:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},x=$(p);return P(e,n.errorResponse,{status:429,headers:x})}if(!e.headers.get("content-type")?.includes("application/json"))return P(e,{success:!1,error:{code:"PUB001",message:"Content-Type must be application/json"},idempotencyKey:""},{status:400});let i;try{i=await e.json();}catch{return P(e,{success:!1,error:{code:"PUB001",message:"Invalid JSON in request body"},idempotencyKey:""},{status:400})}let a=Yi(i);if(a.length>0)return P(e,{success:!1,error:{code:"PUB001",message:"Missing required fields",details:{errors:a}},idempotencyKey:i.idempotencyKey??""},{status:400});let c=e.headers.get("X-Bloggy-Version");if(c){let g=re(c);if(g?.platformVersion){let p=z();if(g.platformVersion.major!==p.major)return P(e,{success:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:g.platformVersion.version,serverVersion:p.version}},idempotencyKey:i.idempotencyKey},{status:409})}}if(!Qi(i.slug))return P(e,{success:!1,error:{code:"PUB002",message:"Slug can only contain lowercase letters, numbers, and hyphens"},idempotencyKey:i.idempotencyKey},{status:400});if(i.dryRun){let p=await q().getArticle(i.slug),x=[];return p||x.push("Article with this slug does not exist"),P(e,{success:!0,warnings:x,idempotencyKey:i.idempotencyKey},{status:200})}let u=await q().removeArticle(i.slug,i.idempotencyKey),m=z(),s=$(n.rateLimitResult),b={"X-Bloggy-Version":`platform/${m.version}`,"X-Idempotency-Key":i.idempotencyKey,...s},f=u.success?200:u.error?.code==="PUB007"?404:400;return P(e,u,{status:f,headers:b})}catch(t){return console.error("Unpublish endpoint error:",t),P(e,{success:false,error:{code:"PUB007",message:"Internal server error during unpublishing"},idempotencyKey:""},{status:500})}}function Yi(e){let t=[];if(!e||typeof e!="object")return t.push("Request body must be a valid object"),t;let r=e;return (!r.slug||typeof r.slug!="string")&&t.push("Missing required field: slug"),(!r.idempotencyKey||typeof r.idempotencyKey!="string")&&t.push("Missing required field: idempotencyKey"),r.slug&&typeof r.slug=="string"&&!r.slug.trim()&&t.push("Slug cannot be empty"),t}function Qi(e){return !e||typeof e!="string"?false:/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(e)&&e.length>=1&&e.length<=100}async function Zi(e){try{let t=await Y(e);if(!t.authenticated){let s=await te(e),b={success:!1,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:!1,errorMessage:s.error?.error?.message??"Authentication required"}};return P(e,b,{status:401})}let r=X(t.token??"anonymous"),n=await Q(r);if(!n.allowed){let s=n.errorResponse.error?.details?.rateLimit,b=s&&typeof s=="object"&&"limit"in s&&"remaining"in s&&"reset"in s&&"count"in s&&"success"in s?s:{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},f=$(b),g={success:!1,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:!1,errorMessage:n.errorResponse.error?.message??"Rate limit exceeded"}};return P(e,g,{status:429,headers:f})}let o=z(),i=e.headers.get("X-Bloggy-Version"),a={name:"unknown",version:"unknown",major:0,minor:0,patch:0};if(i)try{if(/^\d+\.\d+\.\d+/.test(i)){let s=i.split("."),b=parseInt(s[0]??"0",10),f=parseInt(s[1]??"0",10),g=parseInt(s[2]?.split("-")[0]??"0",10);a={name:"bloggy",version:i,major:b,minor:f,patch:g};}else {let s=re(i);s?.bloggyVersion&&(a=s.bloggyVersion);}}catch(s){console.warn("Failed to parse X-Bloggy-Version header:",s);}let c={compatible:!0};a.version!=="unknown"&&(c=ar(a,o));let l={success:!0,versions:{bloggy:a,platform:o},compatibility:c},u=$(n.rateLimitResult),m={"X-Bloggy-Version":`platform/${o.version}`,"Cache-Control":"public, max-age=300, stale-while-revalidate=60",...u};return P(e,l,{status:200,headers:m})}catch(t){console.error("Version endpoint error:",t);let r={success:false,versions:{bloggy:{name:"unknown",version:"unknown",major:0,minor:0,patch:0},platform:{name:"unknown",version:"unknown",major:0,minor:0,patch:0}},compatibility:{compatible:false,errorMessage:"Internal server error while checking version compatibility"},error:t instanceof Error?t.message:"Unknown error"};return P(e,r,{status:500})}}async function to(e,{params:t}){try{let{slug:r}=await t,n=await Y(e);if(!n.authenticated){let p=await te(e);return server.NextResponse.json(p.error,{status:401})}let o=X(n.token??"anonymous"),i=await Q(o);if(!i.allowed){let p=i.errorResponse.error?.details?.rateLimit||{limit:10,remaining:0,reset:Date.now()+6e4,count:10,success:!1},x=$(p);return P(e,i.errorResponse,{status:429,headers:x})}if(!r||!wt(r))return P(e,{exists:!1,error:{code:"PUB002",message:"Invalid slug format. Must be lowercase letters, numbers, and hyphens only."}},{status:400});let a=e.headers.get("X-Bloggy-Version");if(a){let p=re(a);if(p?.platformVersion){let x=z();if(p.platformVersion.major!==x.major)return P(e,{exists:!1,error:{code:"PUB009",message:"Major version incompatibility. Please upgrade your blog platform package.",details:{clientVersion:p.platformVersion.version,serverVersion:x.version}}},{status:409})}}let u=await q().getArticle(r)!==null,m={exists:u,...u&&{message:"Slug is already in use. Please choose another (e.g., append '-v2')."}},s=z(),b=$(i.rateLimitResult),f={"X-Bloggy-Version":`platform/${s.version}`,...b},g=e.headers.get("X-Idempotency-Key");return g&&(f["X-Idempotency-Key"]=g,console.log(`Slug check for idempotency: ${g}, exists: ${u}`)),P(e,m,{status:200,headers:f})}catch(r){return console.error("Slug existence check error:",r instanceof Error?r.message:String(r)),P(e,{exists:false,error:{code:"PUB007",message:"Internal server error during slug check"}},{status:500})}}async function ro(e){return Ie(e,["GET"])}var pl=xe.version;
71
+ exports.ApiKeyAuth=Fe;exports.BlogArticlePage=Vt;exports.BlogAuthorPage=Wt;exports.BlogAuthorsIndexPage=ni;exports.BlogHomePage=Et;exports.BlogTopicArchivePage=ei;exports.BlogTopicsIndexPage=Zn;exports.Button=br;exports.Card=Se;exports.CardContent=Ne;exports.CardDescription=Zr;exports.CardFooter=en;exports.CardHeader=Yr;exports.CardTitle=Qr;exports.DrizzleStorage=vt;exports.EnvAuth=fe;exports.InMemoryStorage=Ge;exports.NEWSLETTER_SUCCESS_MESSAGE=De;exports.NewsletterSignup=Ae;exports.NoAuth=Le;exports.PACKAGE_VERSION=pl;exports.Pagination=ce;exports.PaginationContent=Ye;exports.PaginationEllipsis=Ee;exports.PaginationItem=K;exports.PaginationLink=ne;exports.PaginationNext=Ze;exports.PaginationPrevious=Qe;exports.ShadcnPagination=Je;exports.StructuredDataError=Pe;exports.UninitializedAuth=ze;exports.autoConfigureRateLimit=yt;exports.bpArticles=T;exports.bpOperations=he;exports.buildAuthorPath=k;exports.buildBlogPath=S;exports.buttonVariants=Be;exports.checkRateLimit=Zt;exports.cn=h;exports.configureRateLimit=qe;exports.createBlogSitemapRoute=Mi;exports.createDynamicBlogSitemap=$i;exports.createRateLimitErrorResponse=er;exports.createStructuredDataScript=ie;exports.createTokenFingerprint=X;exports.enforceRateLimit=Q;exports.extractKeywordsFromArticle=Rr;exports.extractTableOfContents=at;exports.extractTokenFromHeader=bt;exports.formatArticleDateMeta=ot;exports.generateArticleMetadata=Mn;exports.generateArticleStructuredData=Oe;exports.generateAuthorPageMetadata=qn;exports.generateAuthorStructuredData=Me;exports.generateBlogHomeMetadata=Xr;exports.generateBlogHomeStructuredData=it;exports.generateBlogSitemapEntries=Pt;exports.generateBreadcrumbStructuredData=Nt;exports.generateCanonicalUrl=se;exports.generateCanonicalUrlFromSlug=Ni;exports.generateCompleteArticleStructuredData=nt;exports.generateOrganizationStructuredData=tt;exports.generatePaginationMetadata=Nr;exports.generateSiteMetadata=Li;exports.generateSitemap=Bi;exports.generateSitemapIndex=Ei;exports.generateWebSiteStructuredData=rt;exports.getAllTopics=ge;exports.getArticlePrimaryTopic=Jn;exports.getAuthConfig=xt;exports.getAuthorArchive=Kt;exports.getAuthorsFromArticles=pe;exports.getBaseUrl=Ri;exports.getBlogThemeStyle=U;exports.getDrizzleAdapterSql=Si;exports.getPathPrefixFromBlogUrl=Tr;exports.getRateLimitHeaders=$;exports.getStorage=q;exports.getTopicArchive=ht;exports.initBlogPlatform=Xe;exports.initBlogPlatformDev=fi;exports.initBlogPlatformOnce=gi;exports.initBlogPlatformProd=hi;exports.initEnvAuth=li;exports.isValidCanonicalUrl=Ti;exports.loadAuthorArchive=Kn;exports.metadataToHtml=_i;exports.normalizeBlogBasePath=E;exports.normalizeDomain=be;exports.normalizeSlug=nr;exports.publishHandler=Xi;exports.safeGenerateArticleStructuredData=Cr;exports.setAuthConfig=Ve;exports.setStorage=ft;exports.shouldSkipAuth=ui;exports.sitemapToXml=ir;exports.slugExistsHandler=to;exports.slugExistsOptionsHandler=ro;exports.structuredDataToJsonLd=Rt;exports.unpublishHandler=Ji;exports.updateArticleCanonicalUrl=Ci;exports.usePagination=Sr;exports.validateMetadata=Ii;exports.validateSitemap=Oi;exports.validateStructuredData=Tt;exports.versionHandler=Zi;//# sourceMappingURL=index.js.map
147
72
  //# sourceMappingURL=index.js.map