{"version":3,"file":"BlogSchema.DX3N4n1K.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/MKMdIkY3iTcdG552YVWx/0LcsHcygfXEj4gSIBsWr/BlogSchema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useState}from\"react\";// Set this once the CamHause domain is connected, for example \"https://camhause.com\".\n// While it is empty, the markup is added in the browser using the address the page is served from.\nconst SITE_URL=\"\";const LOGO=\"https://framerusercontent.com/images/zYnRWa0WOLDx9rdokytQVgtsPuA.png\";function isoDate(value){if(!value)return undefined;const date=new Date(value);return isNaN(date.getTime())?undefined:date.toISOString().slice(0,10);}function imageUrl(value){const src=typeof value===\"string\"?value:value?.src;return src&&src.startsWith(\"http\")?src.split(\"?\")[0]:undefined;}function clean(value){return JSON.parse(JSON.stringify(value));}function buildGraph(p,origin){const blogUrl=`${origin}/blog`;const organization={\"@type\":\"Organization\",\"@id\":`${origin}/#organization`,name:\"CamHause\",url:`${origin}/`,logo:{\"@type\":\"ImageObject\",url:LOGO}};const crumb=items=>({\"@context\":\"https://schema.org\",\"@type\":\"BreadcrumbList\",itemListElement:items.map((item,index)=>({\"@type\":\"ListItem\",position:index+1,name:item.name,...item.url?{item:item.url}:{}}))});if(p.kind===\"post\"){const url=`${blogUrl}/${p.slug}`;const categoryUrl=p.categorySlug?`${blogUrl}/category/${p.categorySlug}`:undefined;const published=isoDate(p.published);return[{\"@context\":\"https://schema.org\",\"@type\":\"BlogPosting\",\"@id\":`${url}#article`,mainEntityOfPage:url,headline:p.title,description:p.description,image:imageUrl(p.image)?[imageUrl(p.image)]:undefined,datePublished:published,dateModified:isoDate(p.updated)??published,articleSection:p.categoryName||undefined,inLanguage:\"en\",author:p.authorName?[{\"@type\":\"Person\",name:p.authorName,url:p.authorSlug?`${blogUrl}/authors/${p.authorSlug}`:undefined}]:[organization],publisher:organization},crumb([{name:\"Blog\",url:blogUrl},...p.categoryName?[{name:p.categoryName,url:categoryUrl}]:[],{name:p.title}])];}if(p.kind===\"author\"){const url=`${blogUrl}/authors/${p.slug}`;return[{\"@context\":\"https://schema.org\",\"@type\":\"ProfilePage\",\"@id\":`${url}#profile`,url,mainEntity:{\"@type\":\"Person\",\"@id\":`${url}#person`,name:p.title,description:p.description,url,worksFor:{\"@type\":\"Organization\",name:\"CamHause\",url:`${origin}/`}}},crumb([{name:\"Blog\",url:blogUrl},{name:\"Authors\",url:`${blogUrl}/authors`},{name:p.title}])];}if(p.kind===\"category\"){const url=`${blogUrl}/category/${p.slug}`;return[{\"@context\":\"https://schema.org\",\"@type\":\"CollectionPage\",\"@id\":`${url}#page`,url,name:p.title,description:p.description,inLanguage:\"en\",isPartOf:{\"@type\":\"Blog\",\"@id\":`${blogUrl}#blog`,name:\"CamHause Blog\",url:blogUrl},publisher:organization},crumb([{name:\"Blog\",url:blogUrl},{name:p.title}])];}return[{\"@context\":\"https://schema.org\",\"@type\":\"CollectionPage\",\"@id\":`${blogUrl}/authors#page`,url:`${blogUrl}/authors`,name:p.title,description:p.description,isPartOf:{\"@type\":\"Blog\",\"@id\":`${blogUrl}#blog`,name:\"CamHause Blog\",url:blogUrl}},crumb([{name:\"Blog\",url:blogUrl},{name:\"Authors\"}])];}/**\n * Blog Schema\n *\n * Adds JSON-LD structured data for CamHause blog pages. Renders nothing visible on the live site.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function BlogSchema(props){const[origin,setOrigin]=useState(SITE_URL);const onCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(!SITE_URL&&typeof window!==\"undefined\"){setOrigin(window.location.origin);}},[]);if(onCanvas)return null;if(!origin||!props.title)return null;const json=JSON.stringify(clean(buildGraph(props,origin.replace(/\\/$/,\"\")))).replace(/</g,\"\\\\u003c\");return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"relative\",width:0,height:0,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:json}})});}addPropertyControls(BlogSchema,{kind:{type:ControlType.Enum,title:\"Page\",options:[\"post\",\"author\",\"category\",\"authors\"],optionTitles:[\"Blog post\",\"Author\",\"Category\",\"Authors index\"],defaultValue:\"post\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Title\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"\",displayTextArea:true},slug:{type:ControlType.String,title:\"Slug\",defaultValue:\"\"},image:{type:ControlType.ResponsiveImage,title:\"Image\",hidden:p=>p.kind!==\"post\"},published:{type:ControlType.Date,title:\"Published\",optional:true,hidden:p=>p.kind!==\"post\"},updated:{type:ControlType.Date,title:\"Updated\",optional:true,hidden:p=>p.kind!==\"post\"},authorName:{type:ControlType.String,title:\"Author\",defaultValue:\"\",hidden:p=>p.kind!==\"post\"},authorSlug:{type:ControlType.String,title:\"Author slug\",defaultValue:\"\",hidden:p=>p.kind!==\"post\"},categoryName:{type:ControlType.String,title:\"Category\",defaultValue:\"\",hidden:p=>p.kind!==\"post\"},categorySlug:{type:ControlType.String,title:\"Category slug\",defaultValue:\"\",hidden:p=>p.kind!==\"post\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogSchema.map"],"mappings":"sMAEoG,SAAS,EAAQ,EAAM,CAAC,GAAG,CAAC,EAAM,OAAiB,IAAM,EAAK,IAAI,KAAK,CAAK,EAAE,OAAO,MAAM,EAAK,QAAQ,CAAC,EAAE,IAAA,GAAU,EAAK,YAAY,CAAC,CAAC,MAAM,EAAE,EAAE,CAAE,CAAC,SAAS,EAAS,EAAM,CAAC,IAAM,EAAI,OAAO,GAAQ,SAA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