{"version":3,"file":"ArticleSchema.D6QfI8eR.mjs","names":["__esmMin","init_npm_react_18_3_1","init_jsx_runtime","K","c","p","addPropertyControls","init_framer_DcxuU94H","ControlType","site","init_ppSchema","personNode","publisherRef","init_siteData","clean","s","decode","textOf","node","collectBlocks","re","m","out","n","props","BLOCK_TAGS","toQA","items","i","faqFromField","blocks","value","b","level","faqFromBody","start","FAQ_HEADING","top","l","jsonLd","data","ArticleSchema","base","blogUrl","postUrl","slug","imageUrl","image","modified","dateModified","datePublished","article","title","description","breadcrumbs","fromField","faq","faqs","body","faqPage","f","init_ArticleSchema","tag"],"sources":["https:/framerusercontent.com/modules/d4Kt8GA4J8WUEGdHbjeY/VkHy09Q6vf2vdKN0jWCk/ArticleSchema.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{isValidElement}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{site}from\"https://framerusercontent.com/modules/S2BDYmS4vZ3ZgNP7plon/ykO6uLiyCN0Vbm6kIswr/siteData.js\";import{personNode,publisherRef}from\"https://framerusercontent.com/modules/4fzMUDiuRqWuC3UZL9hg/cicnHKlO4VyoJci6Rkef/ppSchema.js\";const BLOCK_TAGS=new Set([\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"li\",\"blockquote\",\"pre\"]);function clean(s){return s.replace(/\\s+/g,\" \").trim();}function decode(s){return s.replace(/<br\\s*\\/?>/gi,\" \").replace(/<[^>]+>/g,\"\").replace(/&nbsp;/g,\" \").replace(/&amp;/g,\"&\").replace(/&lt;/g,\"<\").replace(/&gt;/g,\">\").replace(/&quot;/g,'\"').replace(/&#39;|&#x27;/g,\"'\");}// Plain text of a React node tree.\nfunction textOf(node){if(node==null||typeof node===\"boolean\")return\"\";if(typeof node===\"string\"||typeof node===\"number\")return String(node);if(Array.isArray(node))return node.map(textOf).join(\"\");if(/*#__PURE__*/isValidElement(node)){if(node.type===\"br\")return\" \";return textOf(node.props.children);}return\"\";}// Flatten formatted text (a React node tree, or an HTML string) into heading/paragraph blocks.\nfunction collectBlocks(node,out){if(node==null||typeof node===\"boolean\")return;if(typeof node===\"string\"){if(/<(h[1-6]|p|li)[\\s>]/i.test(node)){const re=/<(h[1-6]|p|li|blockquote|pre)\\b[^>]*>([\\s\\S]*?)<\\/\\1>/gi;let m;while(m=re.exec(node))out.push({tag:m[1].toLowerCase(),text:clean(decode(m[2]))});}else if(clean(node))out.push({tag:\"p\",text:clean(node)});return;}if(typeof node===\"number\")return;if(Array.isArray(node)){node.forEach(n=>collectBlocks(n,out));return;}if(/*#__PURE__*/isValidElement(node)){const props=node.props;if(typeof node.type===\"string\"&&BLOCK_TAGS.has(node.type)){out.push({tag:node.type,text:clean(textOf(props.children))});return;}if(typeof props.html===\"string\")return collectBlocks(props.html,out);collectBlocks(props.children,out);}}const level=tag=>/^h[1-6]$/.test(tag)?Number(tag[1]):0;function toQA(items){return items.filter(i=>i.q&&i.a.length).map(i=>({question:i.q,answer:i.a.join(\" \")}));}// FAQ field: each H3 is a question; the text after it, until the next H3, is its answer.\nfunction faqFromField(value){const blocks=[];collectBlocks(value,blocks);const items=[];for(const b of blocks){if(b.tag===\"h3\")items.push({q:b.text,a:[]});else if(items.length&&b.text&&!level(b.tag))items[items.length-1].a.push(b.text);}return toQA(items);}// Post body (used only when the FAQ field has no questions):\n// find the first heading named \"FAQ\", \"FAQs\" or \"Frequently asked questions\" (for example\n// H2 \"FAQ\"). Headings one level below it are the questions (H3 under an H2), and the text\n// after each question is its answer. The section ends at the next heading of the same level\n// or higher (the next H2). Older posts use H3 \"FAQs\" with H4 questions; the same rule covers them.\nconst FAQ_HEADING=/\\bfaqs?\\b|frequently asked questions/i;function faqFromBody(value){const blocks=[];collectBlocks(value,blocks);const start=blocks.findIndex(b=>level(b.tag)>=2&&FAQ_HEADING.test(b.text));if(start<0)return[];const top=level(blocks[start].tag);const items=[];for(const b of blocks.slice(start+1)){const l=level(b.tag);if(l&&l<=top)break;if(l===top+1)items.push({q:b.text,a:[]});else if(!l&&items.length&&b.text)items[items.length-1].a.push(b.text);}return toQA(items);}function jsonLd(data){// Keep \"</script>\" and similar out of the inline script.\nreturn JSON.stringify(data).replace(/</g,\"\\\\u003c\");}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ArticleSchema(props){const{title,description,datePublished,dateModified,image,slug,faq,body}=props;const base=site.url;const blogUrl=`${base}/blog`;const postUrl=`${blogUrl}/${slug}`;const imageUrl=image?.src;const modified=dateModified||datePublished;const article={\"@context\":\"https://schema.org\",\"@type\":\"BlogPosting\",headline:title,...description?{description}:{},...imageUrl?{image:imageUrl}:{},...datePublished?{datePublished}:{},...modified?{dateModified:modified}:{},url:postUrl,mainEntityOfPage:{\"@type\":\"WebPage\",\"@id\":postUrl},author:personNode(),publisher:publisherRef()};const breadcrumbs={\"@context\":\"https://schema.org\",\"@type\":\"BreadcrumbList\",itemListElement:[{\"@type\":\"ListItem\",position:1,name:\"Home\",item:`${base}/`},{\"@type\":\"ListItem\",position:2,name:\"Blog\",item:blogUrl},{\"@type\":\"ListItem\",position:3,name:title,item:postUrl}]};const fromField=faqFromField(faq);const faqs=fromField.length?fromField:faqFromBody(body);const faqPage=faqs.length?{\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",mainEntity:faqs.map(f=>({\"@type\":\"Question\",name:f.question,acceptedAnswer:{\"@type\":\"Answer\",text:f.answer}}))}:null;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"none\"},\"data-schema\":\"article\",children:[/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:jsonLd(article)}}),/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:jsonLd(breadcrumbs)}}),faqPage&&/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:jsonLd(faqPage)}})]});}// Control names stay as they were (title, datePublished, image, slug) so existing CMS bindings keep working.\naddPropertyControls(ArticleSchema,{title:{type:ControlType.String,defaultValue:\"\"},description:{type:ControlType.String,defaultValue:\"\"},datePublished:{type:ControlType.Date,optional:true},dateModified:{type:ControlType.Date,optional:true,description:\"Bind to the Updated field. Empty falls back to datePublished.\"},image:{type:ControlType.ResponsiveImage},slug:{type:ControlType.String,defaultValue:\"\"},// Formatted text from the FAQ field: each H3 is a question.\n// RichText exists at runtime but is missing from the bundled typings, hence the cast.\nfaq:{type:ControlType.RichText},// Post body (the Content field). Used for FAQPage only when the FAQ field has no questions.\nbody:{type:ControlType.RichText,title:\"Body\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,8PAAod,SAASc,EAAM,EAAE,CAAC,OAAOC,EAAE,QAAQ,OAAO,GAAG,CAAC,CAAC,KAAK,CAAE,CAAC,SAASC,EAAO,EAAE,CAAC,OAAOD,EAAE,QAAQ,eAAe,GAAG,CAAC,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC,QAAQ,UAAU,GAAG,CAAC,CAAC,QAAQ,SAAS,GAAG,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,QAAQ,UAAU,GAAG,CAAC,CAAC,QAAQ,gBAAgB,GAAG,CAAE,CACruB,SAASE,EAAO,EAAK,CAAuR,OAAnRC,GAAM,MAAM,OAAOA,GAAO,UAAgB,GAAM,OAAOA,GAAO,UAAU,OAAOA,GAAO,SAAgB,OAAOA,CAAI,EAAK,MAAM,QAAQA,CAAI,EAASA,EAAK,IAAID,CAAM,CAAC,CAAC,KAAK,EAAE,EAAkB,gBAAeC,CAAI,EAAMA,EAAK,OAAO,KAAW,IA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