{"version":3,"file":"SocialShareCodeComponent.t18iDbTK.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/a9V1WOZZKnRnqXPGIWvW/uMk6awDtqt1ed2ilCOI7/SocialShareCodeComponent.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 196\n * @framerIntrinsicHeight 40\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function SocialShare(props){const{style}=props;const[isClient,setIsClient]=useState(false);const[hovered,setHovered]=useState(null);const[focused,setFocused]=useState(null);const[copied,setCopied]=useState(false);const[meta,setMeta]=useState({url:\"\",title:\"\",description:\"\",image:\"\"});const DEFAULT_COLOR=\"#9ca3af\";const HOVER_COLOR=\"#4b5563\";// Hydration guard\nuseEffect(()=>{setIsClient(true);},[]);// Capture metadata after CMS content settles\nuseEffect(()=>{if(!isClient)return;const readMeta=()=>{const readContent=selectors=>{for(const sel of selectors){const el=document.querySelector(sel);if(el?.content)return el.content;}return\"\";};const canonical=document.querySelector('link[rel=\"canonical\"]');const next={url:canonical?.href||window.location.href,title:readContent(['meta[property=\"og:title\"]','meta[name=\"twitter:title\"]'])||document.title,description:readContent(['meta[property=\"og:description\"]','meta[name=\"twitter:description\"]','meta[name=\"description\"]']),image:readContent(['meta[property=\"og:image\"]','meta[name=\"twitter:image\"]'])};startTransition(()=>{setMeta(next);});};// Delay for CMS content to populate\nconst timer=setTimeout(readMeta,150);return()=>clearTimeout(timer);},[isClient]);// Popup share window\nconst openShare=url=>{const width=600;const height=600;const left=window.screen.width/2-width/2;const top=window.screen.height/2-height/2;window.open(url,\"_blank\",`noopener,noreferrer,width=${width},height=${height},top=${top},left=${left}`);};const shareLinkedIn=()=>{if(!meta.url)return;openShare(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(meta.url)}`);};const shareFacebook=()=>{if(!meta.url)return;openShare(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(meta.url)}`);};const shareTwitter=()=>{if(!meta.url)return;const text=meta.title||\"\";openShare(`https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}&url=${encodeURIComponent(meta.url)}`);};const handleCopy=async()=>{if(!meta.url)return;try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(meta.url);}else{// Fallback for older browsers / non-secure contexts\nconst textarea=document.createElement(\"textarea\");textarea.value=meta.url;textarea.style.position=\"fixed\";textarea.style.opacity=\"0\";textarea.style.pointerEvents=\"none\";document.body.appendChild(textarea);textarea.select();document.execCommand(\"copy\");document.body.removeChild(textarea);}}catch(err){console.warn(\"Copy failed:\",err);return;}startTransition(()=>{setCopied(true);});window.setTimeout(()=>{startTransition(()=>{setCopied(false);});},1800);};const buttons=[{id:\"linkedin\",label:\"Share on LinkedIn\",onClick:shareLinkedIn,path:\"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.063 2.063 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452z\"},{id:\"facebook\",label:\"Share on Facebook\",onClick:shareFacebook,path:\"M13.397 20.997v-8.196h2.765l.411-3.209h-3.176V7.548c0-.926.258-1.56 1.587-1.56h1.684V3.127A22.336 22.336 0 0 0 14.201 3c-2.444 0-4.122 1.492-4.122 4.231v2.355H7.332v3.209h2.753v8.202h3.312z\"},{id:\"twitter\",label:\"Share on X\",onClick:shareTwitter,path:\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"},{id:\"copy\",label:\"Copy link\",onClick:handleCopy,path:\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\"}];return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:12,alignItems:\"center\",...style},children:buttons.map(b=>{const active=hovered===b.id||focused===b.id;const color=active?HOVER_COLOR:DEFAULT_COLOR;const isCopy=b.id===\"copy\";return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",lineHeight:0},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:b.onClick,onMouseEnter:()=>startTransition(()=>setHovered(b.id)),onMouseLeave:()=>startTransition(()=>setHovered(null)),onFocus:()=>startTransition(()=>setFocused(b.id)),onBlur:()=>startTransition(()=>setFocused(null)),\"aria-label\":b.label,style:{width:40,height:40,borderRadius:\"50%\",border:`1.5px solid ${color}`,background:\"transparent\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:0,color,transition:\"border-color 150ms ease, color 150ms ease\",outline:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"currentColor\",\"aria-hidden\":\"true\",style:{display:\"block\"},children:/*#__PURE__*/_jsx(\"path\",{d:b.path})})}),isCopy&&/*#__PURE__*/_jsx(AnimatePresence,{children:copied&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.15,ease:\"easeOut\"},role:\"status\",\"aria-live\":\"polite\",style:{position:\"absolute\",bottom:\"calc(100% + 8px)\",left:\"50%\",transform:\"translateX(-50%)\",background:\"#111827\",color:\"#ffffff\",fontSize:12,fontWeight:500,lineHeight:1,padding:\"7px 10px\",borderRadius:6,whiteSpace:\"nowrap\",pointerEvents:\"none\",fontFamily:\"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\"},children:[\"Copied!\",/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"100%\",left:\"50%\",transform:\"translateX(-50%)\",width:0,height:0,borderLeft:\"4px solid transparent\",borderRight:\"4px solid transparent\",borderTop:\"4px solid #111827\"}})]})})]},b.id);})});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SocialShare\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"40\",\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 196\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SocialShareCodeComponent.map"],"mappings":"oNAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,EAAW,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAM,CAAC,EAAQ,GAAYA,EAAS,KAAK,CAAM,CAAC,EAAQ,GAAYA,EAAS,KAAK,CAAM,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAM,CAAC,EAAK,GAASA,EAAS,CAAC,IAAI,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,CAAC,CAC9S,MAAc,CAAC,EAAY,GAAK,EAAG,EAAE,CAAC,CACtC,MAAc,CAAC,GAAG,CAAC,EAAS,OAC5B,IAAM,EAAM,eAD0C,CAAC,IAAM,EAAY,GAAW,CAAC,IAAI,IAAM,KAAO,EAAU,CAAC,IAAM,EAAG,SAAS,cAAc,EAAI,CAAC,GAAG,GAAI,QAAQ,OAAO,EAAG,QAAS,MAAM,IAA2E,EAAK,CAAC,IAA5D,SAAS,cAAc,wBAAwB,EAA4B,MAAM,EAAO,SAAS,KAAK,MAAM,EAAY,CAAC,4BAA4B,6BAA6B,CAAC,EAAE,SAAS,MAAM,YAAY,EAAY,CAAC,kCAAkC,mCAAm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