{"version":3,"file":"StructuredData.Sm5K-E9E.mjs","names":["_Fragment","useMemo"],"sources":["https:/framerusercontent.com/modules/Mpfp5AFDNeVHlaWJWfXt/oQt3tbZP7Eqag1b6nw4M/StructuredData.js"],"sourcesContent":["// Request: Update StructuredData without breaking current instances, keeping CreativeWork as default while adding BlogPosting support, FAQ JSON parsing, URL resolution from url/baseUrl+slug, safe JSON-LD script serialization, and Framer-compatible controls.\nimport{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function StructuredData(props){const{schemaType,name,description,image,publicationDate,datePublished,url,author,slug,baseUrl,publisherName,faqJson}=props;const toSafeScriptJson=value=>{return JSON.stringify(value).replace(/</g,\"\\\\u003c\");};const resolveJoinedUrl=(base,slugValue)=>{const trimmedBase=typeof base===\"string\"?base.trim():\"\";const trimmedSlug=typeof slugValue===\"string\"?slugValue.trim():\"\";if(!trimmedBase&&!trimmedSlug)return\"\";if(!trimmedBase)return trimmedSlug;if(!trimmedSlug)return trimmedBase;const baseClean=trimmedBase.replace(/\\/+$/,\"\");const slugClean=trimmedSlug.replace(/^\\/+/,\"\");return`${baseClean}/${slugClean}`;};const scripts=useMemo(()=>{const imageValue=typeof image===\"string\"?image.trim():typeof image?.src===\"string\"?image.src.trim():\"\";const urlValue=typeof url===\"string\"?url.trim():typeof url?.href===\"string\"?url.href.trim():\"\";const resolvedUrl=urlValue||resolveJoinedUrl(baseUrl,slug);const nameValue=name?.trim()??\"\";const descriptionValue=description?.trim()??\"\";const publicationDateValue=publicationDate?.trim()??\"\";const datePublishedValue=datePublished?.trim()??\"\";const effectiveDatePublished=publicationDateValue||datePublishedValue;const authorValue=author?.trim()??\"\";const publisherValue=publisherName?.trim()??\"\";const primaryData={\"@context\":\"https://schema.org\",\"@type\":schemaType||\"CreativeWork\"};if(schemaType===\"BlogPosting\"){if(nameValue)primaryData.headline=nameValue;if(descriptionValue)primaryData.description=descriptionValue;if(imageValue)primaryData.image=imageValue;if(effectiveDatePublished)primaryData.datePublished=effectiveDatePublished;if(resolvedUrl)primaryData.url=resolvedUrl;if(authorValue){primaryData.author={\"@type\":\"Person\",name:authorValue};}if(publisherValue){primaryData.publisher={\"@type\":\"Organization\",name:publisherValue};}}else{if(nameValue)primaryData.name=nameValue;if(descriptionValue)primaryData.description=descriptionValue;if(imageValue)primaryData.image=imageValue;if(effectiveDatePublished)primaryData.datePublished=effectiveDatePublished;if(resolvedUrl)primaryData.url=resolvedUrl;}const outputScripts=[toSafeScriptJson(primaryData)];const getFaqSourceArray=parsed=>{if(Array.isArray(parsed)){return{matchedShape:true,sourceArray:parsed};}if(typeof parsed===\"object\"&&parsed!==null&&Array.isArray(parsed.faqs)){return{matchedShape:true,sourceArray:parsed.faqs};}return{matchedShape:false,sourceArray:[]};};const parseFaqCandidate=candidate=>{try{const parsed=JSON.parse(candidate);const direct=getFaqSourceArray(parsed);if(direct.matchedShape)return direct;if(typeof parsed===\"string\"){const nestedString=parsed.trim();if(!nestedString)return{matchedShape:false,sourceArray:[]};try{const nestedParsed=JSON.parse(nestedString);return getFaqSourceArray(nestedParsed);}catch{return{matchedShape:false,sourceArray:[]};}}return{matchedShape:false,sourceArray:[]};}catch{return{matchedShape:false,sourceArray:[]};}};const faqRaw=faqJson?.trim();if(faqRaw){const firstResult=parseFaqCandidate(faqRaw);let faqResult=firstResult;if(!firstResult.matchedShape){const unescapedQuotesCandidate=faqRaw.replace(/\\\\\"/g,'\"');if(unescapedQuotesCandidate!==faqRaw){faqResult=parseFaqCandidate(unescapedQuotesCandidate);}}const faqs=faqResult.sourceArray.map(item=>{if(typeof item!==\"object\"||item===null)return null;const faqItem=item;const question=(typeof faqItem.question===\"string\"?faqItem.question:typeof faqItem.name===\"string\"?faqItem.name:\"\").trim();const answer=(typeof faqItem.answer===\"string\"?faqItem.answer:typeof faqItem.text===\"string\"?faqItem.text:\"\").trim();if(!question||!answer)return null;const decodedQuestion=question.replace(/&quot;/g,'\"');const decodedAnswer=answer.replace(/&quot;/g,'\"');return{question:decodedQuestion,answer:decodedAnswer};}).filter(entry=>entry!==null);if(faqs.length>0){outputScripts.push(toSafeScriptJson({\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",mainEntity:faqs.map(entry=>({\"@type\":\"Question\",name:entry.question,acceptedAnswer:{\"@type\":\"Answer\",text:entry.answer}}))}));}}return outputScripts;},[schemaType,name,description,image,publicationDate,datePublished,url,author,slug,baseUrl,publisherName,faqJson]);return /*#__PURE__*/_jsx(_Fragment,{children:scripts.map((script,index)=>/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:script}},index))});}addPropertyControls(StructuredData,{schemaType:{type:ControlType.Enum,title:\"Schema Type\",options:[\"CreativeWork\",\"BlogPosting\"],optionTitles:[\"CreativeWork\",\"BlogPosting\"],defaultValue:\"CreativeWork\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"\"},description:{type:ControlType.String,title:\"Description\",defaultValue:\"\"},image:{type:ControlType.Image,title:\"Image\"},datePublished:{type:ControlType.String,title:\"Date Published\",defaultValue:\"\"},publicationDate:{type:ControlType.Date,title:\"Publication Date\"},url:{type:ControlType.Link,title:\"Url\",defaultValue:\"\"},author:{type:ControlType.String,title:\"Author\",defaultValue:\"\"},slug:{type:ControlType.String,title:\"Slug\",defaultValue:\"\"},baseUrl:{type:ControlType.String,title:\"Base Url\",defaultValue:\"\"},publisherName:{type:ControlType.String,title:\"Publisher Name\",defaultValue:\"Amplifier Security\"},faqJson:{type:ControlType.String,title:\"Faq Json\",defaultValue:\"\",displayTextArea:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StructuredData\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerM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