PageSourceSearch

https://rainfactory.ai/assets/BlogPost-bGJhnP_H.js

js rainfactory.ai collected 2026-10-05 14:39:10 UTC 5,725 bytes, 2 lines download raw bytes

1import{a as z,j as a}from"./ui-vendor-Pu0cN9S7.js";import{ah as I,h as U,q,ai as A,C as l,b as d,r as F,aj as P}from"./index-DVqYXXq7.js";import{u as O}from"./usePublicContent-BfrQAWnI.js";import{r as R}from"./slug-utils-DU6uXJgO.js";function V(){var x,u,g,h,_,j,p,b,f,N,y,v,w,C,S,T,k,B;const{guid:n,slug:$}=I(),{content:e,loading:H,error:o}=O(n),[L,M]=z.useState(!1),m=()=>{const t="https://rainfactory.ai",s=e!=null&&e.content_json?R(e.content_json):$;return s?`${t}/blog/${n}/${s}`:`${t}/blog/${n}`},i=(x=e==null?void 0:e.content_json)==null?void 0:x.title;U({title:i,description:((g=(u=e==null?void 0:e.content_json)==null?void 0:u.bonus_metadata)==null?void 0:g.meta_description)||((_=(h=e==null?void 0:e.content_json)==null?void 0:h.bonus_metadata)==null?void 0:_.excerpt),keywords:(b=(p=(j=e==null?void 0:e.content_json)==null?void 0:j.bonus_metadata)==null?void 0:p.tags)==null?void 0:b.join(", "),author:(N=(f=e==null?void 0:e.content_json)==null?void 0:f.bonus_metadata)==null?void 0:N.author,image:((y=e==null?void 0:e.content_json)==null?void 0:y.image_url)||((v=e==null?void 0:e.content_json)==null?void 0:v.featured_image),url:m(),type:"article",publishedTime:e==null?void 0:e.created_at,modifiedTime:e==null?void 0:e.updated_at,tags:(C=(w=e==null?void 0:e.content_json)==null?void 0:w.bonus_metadata)==null?void 0:C.tags,readingTime:(T=(S=e==null?void 0:e.content_json)==null?void 0:S.bonus_metadata)==null?void 0:T.reading_time,breadcrumbs:[{name:"Home",url:`${window.location.origin}/`},{name:"Blog",url:`${window.location.origin}/blog`},...i?[{name:i,url:m()}]:[]]});const c=(t,s=!1)=>{const r=P.parse(t);return typeof r=="string"&&s&&!L?(M(!0),r.replace(new RegExp("(?<!<blockquote[^>]*>[\\s\\S]*?)(<p(?!\\s+class=)[^>]*>)([\\s\\S]*?<\\/p>)"),'<p class="text-2xl font-medium leading-relaxed mb-6">$2')):typeof r=="string"?r:t},E=t=>t.content_sections&&t.content_sections.length>0?a.jsxs("div",{className:"space-y-6",children:[(t.featured_image||t.image_url)&&a.jsx("div",{className:"mb-6",children:a.jsx("img",{src:t.featured_image||t.image_url,alt:t.title||"Blog post feature image",className:"w-full h-auto rounded-lg shadow-md hover:shadow-lg transition-shadow",width:1200,height:630,loading:"lazy"})}),t.content_sections.map((s,r)=>a.jsxs("div",{className:"prose-section",children:[s.heading&&a.jsx("h2",{className:"text-xl font-semibold mb-2 text-public-title",children:s.heading}),a.jsx("div",{className:"prose prose-zinc dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:c(s.content,r===0)}})]},r)),t.bonus_metadata&&a.jsxs("div",{className:"mt-8 pt-6 border-t border-muted space-y-4",children:[t.bonus_metadata.tags&&t.bonus_metadata.tags.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-foreground mb-2",children:"Tags"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.bonus_metadata.tags.map((s,r)=>a.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-primary/10 text-primary",children:s},r))})]}),t.bonus_metadata.categories&&t.bonus_metadata.categories.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-foreground mb-2",children:"Categories"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.bonus_metadata.categories.map((s,r)=>a.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-secondary text-secondary-foreground",children:s},r))})]}),t.bonus_metadata.call_to_action&&a.jsx("div",{className:"bg-muted/50 rounded-lg p-4 border",children:a.jsx("p",{className:"text-sm font-medium text-primary text-center",children:t.bonus_metadata.call_to_action})}),t.bonus_metadata.author&&a.jsxs("div",{className:"text-sm text-muted-foreground",children:[a.jsx("strong",{children:"Author:"})," ",t.bonus_metadata.author]})]})]}):t.primary_content?a.jsx("div",{className:"prose prose-zinc dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:c(t.primary_content,!0)}}):a.jsx("p",{className:"text-muted-foreground",children:"No content available for this blog post."});return a.jsx("div",{className:"min-h-screen py-12 sm:py-16",children:a.jsxs("div",{className:"container mx-auto max-w-3xl px-4",children:[a.jsx("div",{className:"mb-8",children:a.jsxs(q,{to:"/blog",className:"inline-flex items-center text-sm text-primary hover:text-primary/80 transition-colors",children:[a.jsx(A,{className:"mr-2 h-4 w-4"}),"Back to Blog"]})}),H?a.jsx("div",{className:"flex justify-center items-center py-16",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):o?a.jsx(l,{children:a.jsx(d,{className:"pt-6",children:a.jsxs("p",{className:"text-red-500 text-base leading-relaxed",children:["Error loading blog post: ",o]})})}):e?a.jsxs(l,{children:[a.jsxs(F,{children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-semibold text-public-title",children:e.content_json.title||"Blog Post"}),a.jsxs("div",{className:"flex flex-col gap-1 pt-2",children:[a.jsx("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:((k=e.content_json.bonus_metadata)==null?void 0:k.reading_time)&&a.jsxs("span",{children:["• ",e.content_json.bonus_metadata.reading_time]})}),((B=e.content_json.bonus_metadata)==null?void 0:B.excerpt)&&a.jsx("p",{className:"text-sm text-muted-foreground mt-2 italic",dangerouslySetInnerHTML:{__html:P.parse(e.content_json.bonus_metadata.excerpt)}})]})]}),a.jsx(d,{children:E(e.content_json)})]}):a.jsx(l,{children:a.jsx(d,{className:"pt-6",children:a.jsx("p",{className:"text-muted-foreground text-base leading-relaxed",children:"Blog post not found."})})})]})})}export{V as default};
2//# sourceMappingURL=BlogPost-bGJhnP_H.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.