{"version":3,"file":"PageSchema.50HTFCFb.mjs","names":["useMemo","__esmMin","pe","init_npm_react_18_3_1","ce","init_jsx_runtime","c","addPropertyControls","init_framer_DKgW_P28","ControlType","useLocaleInfo","absolute","root","path","PageSchema","props","localePath","activeLocale","language","schema","siteUrl","url","slug","siteRoot","imageUrl","image","trail","crumbs","label","href","crumb","part","crumbName","name","page","pageType","description","i","schemaInHTML","script","HEAD_ID","style","init_PageSchema"],"sources":["https:/framerusercontent.com/modules/mqqshe7bXFn7RjlhxfBQ/Q5MZdV3boSsyJwvrvtkY/PageSchema.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";import{useEffect,useMemo}from\"react\";const HEAD_ID=\"page-schema\";function absolute(root,path){return root+(path.startsWith(\"/\")?path:\"/\"+path);}/**\n * WebPage or CollectionPage JSON-LD plus a BreadcrumbList. Renders nothing visible.\n * Path is the page URL; on a CMS page set Path to the folder (e.g. /events/past-events)\n * and bind Slug. Crumbs are the levels above this page, as \"Label|/path\". The page\n * itself is added as the last crumb.\n *\n * Framer renders every breakpoint into the HTML, so only turn \"Schema in HTML\" on\n * for the Desktop instance. Other breakpoints add one copy to <head> on the client\n * when no inline copy is live.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function PageSchema(props){const{pageType=\"WebPage\",name=\"\",description=\"\",path=\"/\",slug=\"\",image,crumbs=[],crumbName=\"\",siteUrl=\"https://www.goideally.com\",schemaInHTML=true,style}=props;// US pages live under /us and are their own canonical, so the schema follows the locale\nconst{activeLocale}=useLocaleInfo();const localePath=activeLocale?.slug?\"/\"+activeLocale.slug:\"\";const language=activeLocale?.code||\"en\";const schema=useMemo(()=>{const root=siteUrl.replace(/\\/+$/,\"\")+localePath;const url=absolute(root,slug?path.replace(/\\/+$/,\"\")+\"/\"+slug:path);const siteRoot=siteUrl.replace(/\\/+$/,\"\");const imageUrl=(image?.src||\"\").split(\"?\")[0];const trail=crumbs.filter(Boolean).map(crumb=>{const[label,href=\"/\"]=crumb.split(\"|\").map(part=>part.trim());return{name:label,item:absolute(root,href)};});trail.push({name:crumbName||name,item:url});const page={\"@type\":pageType,\"@id\":url+\"#webpage\",url,name,isPartOf:{\"@id\":siteRoot+\"/#website\"},publisher:{\"@id\":siteRoot+\"/#organization\"},breadcrumb:{\"@id\":url+\"#breadcrumb\"},inLanguage:language};if(description)page.description=description;if(imageUrl)page.primaryImageOfPage={\"@type\":\"ImageObject\",url:imageUrl};return JSON.stringify({\"@context\":\"https://schema.org\",\"@graph\":[page,{\"@type\":\"BreadcrumbList\",\"@id\":url+\"#breadcrumb\",itemListElement:trail.map((crumb,i)=>({\"@type\":\"ListItem\",position:i+1,...crumb}))}]});},[pageType,name,description,path,slug,image?.src,crumbs,crumbName,siteUrl,localePath,language]);// One copy only: if no inline script is live (this breakpoint has it off,\n// or the Desktop copy was dropped on hydration), add one to <head>\nuseEffect(()=>{if(schemaInHTML||typeof document===\"undefined\")return;const inline=document.querySelector('script[data-page-schema=\"inline\"]');if(inline)return;let script=document.getElementById(HEAD_ID);if(!script){script=document.createElement(\"script\");script.type=\"application/ld+json\";script.id=HEAD_ID;document.head.appendChild(script);}script.textContent=schema;return()=>{document.getElementById(HEAD_ID)?.remove();};},[schema,schemaInHTML]);return /*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{...style,width:1,height:1,overflow:\"hidden\",pointerEvents:\"none\"},children:schemaInHTML&&/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",\"data-page-schema\":\"inline\",dangerouslySetInnerHTML:{__html:schema}})});}addPropertyControls(PageSchema,{pageType:{type:ControlType.Enum,title:\"Page Type\",options:[\"WebPage\",\"CollectionPage\"],defaultValue:\"WebPage\"},name:{type:ControlType.String,title:\"Name\",defaultValue:\"\"},description:{type:ControlType.String,title:\"Description\",displayTextArea:true,defaultValue:\"\"},path:{type:ControlType.String,title:\"Path\",defaultValue:\"/\"},slug:{type:ControlType.String,title:\"Slug\",defaultValue:\"\",description:\"CMS pages only. Added after Path\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},crumbs:{type:ControlType.Array,title:\"Crumbs\",control:{type:ControlType.String},defaultValue:[\"Home|/\"],description:\"Levels above this page, as Label|/path\"},crumbName:{type:ControlType.String,title:\"Crumb Name\",defaultValue:\"\",description:\"This page's breadcrumb label. Falls back to Name\"},siteUrl:{type:ControlType.String,title:\"Site URL\",defaultValue:\"https://www.goideally.com\"},schemaInHTML:{type:ControlType.Boolean,title:\"Schema in HTML\",defaultValue:true,description:\"On for Desktop only, so the page has one copy\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PageSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PageSchema.map"],"mappings":"A,yLAA8K,SAASW,EAAS,EAAK,EAAK,CAAC,OAAOC,GAAMC,EAAK,WAAW,GAAG,EAAEA,EAAK,IAAIA,EAAM,CAYzP,SAAwBC,EAAW,EAAM,CAAC,GAAK,CAAC,WAAS,UAAU,OAAK,GAAG,cAAY,GAAG,OAAK,IAAI,OAAK,GAAG,QAAM,SAAO,CAAC,EAAE,YAAU,GAAG,UAAQ,4BAA4B,eAAa,GAAK,SAAOC,EACnM,CAAC,gBAAcL,EAAc,EAAQM,EAAWC,GAAc,KAAK,IAAIA,EAAa,KAAK,GAASC,EAASD,GAAc,MAAM,KAAWE,EAAOnB,MAAY,CAAC,IAAMY,EAAKQ,EAAQ,QAAQ,OAAO,EAAE,EAAEJ,EAAiBK,EAAIV,EAASC,EAAKU,EAAKT,EAAK,QAAQ,OAAO,EAAE,EAAE,IAAIS,EAAKT,CAAI,EAAQU,EAASH,EAAQ,QAAQ,OAAO,EAAE,EAAQI,GAAUC,GAAO,KAAK,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