{"version":3,"file":"FAQSchema.mG0OdRea.mjs","names":[],"sources":["https:/framerusercontent.com/modules/MiFsG9gHOljeNs4hz0CG/1ZUq6QAfEeDX9GG7fKmK/FAQSchema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";/** See _locale.md. */function useLocale(fallback){const info=useLocaleInfo?.()??{};const active=info.activeLocale??{};const raw=active.code??active.slug??active.id??\"\";return String(raw).toLowerCase().startsWith(\"nl\")?\"nl\":fallback;}/**\n * FAQSchema\n *\n * Puts the FAQ answers back into the served HTML. Framer accordions mount their\n * answers on click, so a crawler that does not run JavaScript sees the questions\n * and almost none of the answers. The site this replaces server-rendered all of\n * them. See watermelon-jsonld/README.md section 2.\n *\n * Place once per FAQ page, anywhere in the page body. Each page passes only its\n * own pairs, and the Dutch set is separate from the English one: a Framer page and\n * its /nl counterpart are the same page, and the active locale is the only thing\n * that differs between the two renders.\n *\n * Pairs are one string, `question |~| answer ~~ question |~| answer`. Not JSON:\n * the Framer edit DSL strips backslash escapes, so a JSON payload with quotes in it\n * cannot be written into a property control programmatically. No question or answer\n * on this site contains a quote, a newline, `|~|` or `~~` (checked).\n *\n * @framerIntrinsicWidth 0\n * @framerIntrinsicHeight 0\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FAQSchema(props){const{path,qaEn,qaNl,locale:localeFallback}=props;const locale=useLocale(localeFallback);const origin=\"https://watermelon.ai\";const prefix=locale===\"nl\"?\"/nl\":\"\";const url=`${origin}${prefix}${path}`;const raw=(locale===\"nl\"?qaNl:qaEn)||\"\";const entities=raw.split(\"~~\").map(chunk=>chunk.split(\"|~|\")).filter(parts=>parts.length===2&&parts[0].trim()&&parts[1].trim()).map(parts=>({\"@type\":\"Question\",name:parts[0].trim(),acceptedAnswer:{\"@type\":\"Answer\",text:parts[1].trim()}}));if(!entities.length)return null;const json=JSON.stringify({\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"FAQPage\",// The page's own WebPage node is pasted per page and always\n// carries the un-prefixed URL, so isPartOf points at that one.\n\"@id\":`${url}#faq`,inLanguage:locale,isPartOf:{\"@id\":`${origin}${path}#webpage`},mainEntity:entities}]},(_key,value)=>value===undefined||value===\"\"?undefined:value);return /*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:json.replace(/</g,\"\\\\u003c\")}});}FAQSchema.defaultProps={path:\"/\",qaEn:\"\",qaNl:\"\",locale:\"en\"};addPropertyControls(FAQSchema,{path:{type:ControlType.String,title:\"Path\",defaultValue:\"/\"},qaEn:{type:ControlType.String,title:\"Q&A EN\",displayTextArea:true,defaultValue:\"\"},qaNl:{type:ControlType.String,title:\"Q&A NL\",displayTextArea:true,defaultValue:\"\"},locale:{type:ControlType.Enum,title:\"Fallback\",options:[\"en\",\"nl\"],optionTitles:[\"English\",\"Dutch\"],defaultValue:\"en\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"0\",\"framerIntrinsicHeight\":\"0\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQSchema.map"],"mappings":"oKAAmI,SAAS,EAAU,EAAS,CAAkC,IAAM,GAA5B,IAAgB,GAAG,CAAC,EAAA,CAAoB,cAAc,CAAC,EAAQ,EAAI,EAAO,MAAM,EAAO,MAAM,EAAO,IAAI,GAAG,OAAO,OAAO,CAAG,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,IAAI,EAAE,KAAK,CAAS,CAsBnV,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,OAAK,OAAO,GAAgB,EAAY,EAAO,EAAU,CAAc,EAAQ,EAAO,wBAAkE,EAAI,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