{"version":3,"file":"ShareOnFacebook.ChFgmXGo.mjs","names":["useEffect","_jsx","useState","useEffect","_jsx","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","c","init_jsx_runtime","ce","init_framer_BWzg2IRg","addPropertyControls","ControlType","OpenGraphMetadata","title","description","image","slug","setMeta","property","content","element","init_OpenGraphMetadata","ShareOnFacebook","currentUrl","setCurrentUrl","shareUrl","init_ShareOnFacebook"],"sources":["https:/framerusercontent.com/modules/7JOszn06VBvBoDduhLyd/vLoZGOENhAq6ecL6Eyu1/OpenGraphMetadata.js","https:/framerusercontent.com/modules/wstFb6aEPBBkaGNZ4DRZ/qifL8H1AJFAAFaRKsG6e/ShareOnFacebook.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function OpenGraphMetadata({title=\"\",description=\"\",image=\"\",slug=\"\"}){useEffect(()=>{function setMeta(property,content){if(!content||content===\"undefined\"||content===\"\")return;let element=document.querySelector(`meta[property=\"${property}\"]`);if(!element){element=document.createElement(\"meta\");element.setAttribute(\"property\",property);document.head.appendChild(element);}element.setAttribute(\"content\",content);}// Oppdater Open Graph-metadataene med riktige verdier\nsetMeta(\"og:title\",title||\"Standard tittel\");setMeta(\"og:description\",description||\"Standard beskrivelse\");setMeta(\"og:image\",image||\"https://www.legedom.no/default-image.jpg\");setMeta(\"og:url\",slug?`https://www.legedom.no/${slug}`:\"https://www.legedom.no/\");setMeta(\"og:type\",\"article\");console.log(\"✅ Open Graph metadata oppdatert!\",{title,description,image,slug});},[title,description,image,slug]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"},children:\"OpenGraphMetadata aktiv!\"});}// 📌 Property Controls for å koble til CMS i Framer\naddPropertyControls(OpenGraphMetadata,{title:{type:ControlType.String,title:\"Title\"},description:{type:ControlType.String,title:\"Description\"},image:{type:ControlType.String,title:\"Image URL\"},slug:{type:ControlType.String,title:\"Slug\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OpenGraphMetadata\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OpenGraphMetadata.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export default function ShareOnFacebook({slug}){const[currentUrl,setCurrentUrl]=useState(\"https://legedom.no/\");useEffect(()=>{if(typeof window!==\"undefined\"){setCurrentUrl(window.location.href);}},[]);const shareUrl=slug?`https://legedom.no/${slug}`:currentUrl;return /*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(typeof window!==\"undefined\"){window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`,\"_blank\");}},style:{padding:\"10px 15px\",backgroundColor:\"#1877F2\",color:\"white\",border:\"none\",borderRadius:\"5px\",cursor:\"pointer\",fontWeight:\"bold\",fontSize:\"18px\"},children:\"Del p\\xe5 Facebook\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareOnFacebook\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareOnFacebook.map"],"mappings":"A,+LAA4H,SAAwBgB,EAAkB,CAACC,QAAM,GAAGC,cAAY,GAAGC,QAAM,GAAGC,OAAK,IAAI,CACgM,OAD/LpB,MAAc,CAAC,SAASqB,EAAQC,EAASC,EAAQ,CAAC,GAAG,CAACA,GAASA,IAAU,aAAaA,IAAU,GAAG,OAAO,IAAIC,EAAQ,SAAS,cAAc,kBAAkBF,EAAS,GAAG,EAAME,IAASA,EAAQ,SAAS,cAAc,MAAM,EAAEA,EAAQ,aAAa,WAAWF,CAAQ,EAAE,SAAS,KAAK,YAAYE,CAAO,GAAGA,EAAQ,aAAa,UAAUD,CAAO,CAAE,CACziBF,EAAQ,WAAW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