{"version":3,"file":"LIGHT_LOGO.BUCbUh5b.mjs","names":["useState","useRef","customEvent"],"sources":["https:/framerusercontent.com/modules/t54LE15lHPOQSSNXgmIP/AlumLF3SKF3GRogNIZsx/LIGHT_LOGO.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{useMotionValue,useSpring}from\"framer-motion\";const LIGHT_LOGO_BACKGROUNDS=[\"rgb(104, 103, 128)\",\"rgb(82, 33, 54)\",\"rgb(104, 106, 128)\",\"rgb(49, 34, 44)\",\"rgb(112, 114, 133)\"];// Op deze lichte achtergronden moet het donkere logo worden gebruikt.\nconst DARK_LOGO_BACKGROUNDS=[\"rgb(255, 226, 249)\",\"rgb(252, 248, 237)\"];function getResponsiveSettings(){if(typeof window===\"undefined\"){return{x:50,y:55,smallScale:.2};}if(window.innerWidth<810){return{x:24,y:28,smallScale:.2};}if(window.innerWidth<1200){return{x:36,y:42,smallScale:.2};}return{x:50,y:55,smallScale:.2};}function normalizeColor(color){return color.replace(/\\s+/g,\" \").trim();}function readRgb(color){const match=color.match(/rgba?\\(\\s*(\\d+)[,\\s]+(\\d+)[,\\s]+(\\d+)/);if(!match)return null;return{r:Number(match[1]),g:Number(match[2]),b:Number(match[3])};}function isTransparent(color){const normalized=normalizeColor(color);return!normalized||normalized===\"transparent\"||normalized===\"rgba(0, 0, 0, 0)\";}function colorsAreClose(colorA,colorB,tolerance=16){const a=readRgb(colorA);const b=readRgb(colorB);if(!a||!b)return false;return Math.abs(a.r-b.r)<=tolerance&&Math.abs(a.g-b.g)<=tolerance&&Math.abs(a.b-b.b)<=tolerance;}function matchesColorList(color,colors){const normalized=normalizeColor(color);return colors.some(listedColor=>normalized===listedColor||colorsAreClose(normalized,listedColor));}function isDarkColor(color){const rgb=readRgb(color);if(!rgb)return false;const brightness=.299*rgb.r+.587*rgb.g+.114*rgb.b;return brightness<155;}function shouldUseLightLogo(color){const normalized=normalizeColor(color);// De twee lichte merkkleuren winnen altijd van donkere ancestors.\nif(matchesColorList(normalized,DARK_LOGO_BACKGROUNDS))return false;if(matchesColorList(normalized,LIGHT_LOGO_BACKGROUNDS))return true;return isDarkColor(normalized);}function createLightLogoZone(Component){return props=>{/*\n         * Framer-instances forwarden een React-ref niet altijd naar hun echte\n         * DOM-node. Een data-attribuut en className worden wel doorgegeven en\n         * zijn daardoor betrouwbaar terug te vinden vanuit autoLogo.\n         */return /*#__PURE__*/_jsx(Component,{...props,\"data-light-logo-zone\":\"true\",className:`${props.className||\"\"} light-logo-zone`.trim()});};}/* Zet deze override op iedere sectie waarop het lichte logo nodig is. */export function lightLogoZone(Component){return createLightLogoZone(Component);}/* Oude naam blijft werken voor bestaande toegewezen overrides. */export function videoZone(Component){return createLightLogoZone(Component);}export function autoLogo(Component){return props=>{const[light,setLight]=useState(false);const frame=useRef(null);const logoRef=useRef(null);const syncedTheme=useRef(null);const targetScale=useMotionValue(1);const smoothScale=useSpring(targetScale,{stiffness:115,damping:24,mass:.9});useEffect(()=>{const onBackgroundTheme=event=>{const customEvent=event;syncedTheme.current=customEvent.detail?.useLightLogo??null;if(syncedTheme.current!==null){setLight(syncedTheme.current);}};window.addEventListener(\"not-me-background-theme\",onBackgroundTheme);const hasDarkBackground=()=>{const settings=getResponsiveSettings();let x=settings.x;let y=settings.y;// Meet op de werkelijke positie van het logo. De vaste\n// fallback blijft beschikbaar wanneer Framer geen ref doorgeeft.\nif(logoRef.current){const logoRect=logoRef.current.getBoundingClientRect();if(logoRect.width>0&&logoRect.height>0){x=Math.min(window.innerWidth-2,Math.max(1,logoRect.left+8));y=Math.min(window.innerHeight-2,Math.max(1,logoRect.top+8));}}const zoneElements=document.querySelectorAll('[data-light-logo-zone=\"true\"], .light-logo-zone');for(const zoneElement of zoneElements){const rect=zoneElement.getBoundingClientRect();if(rect.width>0&&rect.height>0&&rect.left<=x&&rect.right>=x&&rect.top<=y&&rect.bottom>=y){return true;}}/*\n                 * Dit is de eerdere, werkende meetmethode: haal het logo zelf\n                 * heel even uit de hit-test en meet daarna rechtstreeks wat er\n                 * zichtbaar onder ligt. Alleen children overslaan bleek in\n                 * Framer niet betrouwbaar, omdat het logo in extra containers\n                 * wordt gerenderd.\n                 */const logoElement=logoRef.current;const previousPointerEvents=logoElement?.style.pointerEvents;if(logoElement)logoElement.style.pointerEvents=\"none\";const elements=document.elementsFromPoint(x,y);if(logoElement){logoElement.style.pointerEvents=previousPointerEvents||\"\";}/*\n                 * elementsFromPoint geeft de visuele volgorde terug. De eerste\n                 * niet-transparante kleur is dus de achtergrond die de bezoeker\n                 * werkelijk achter het logo ziet. Onderliggende pagina- of\n                 * bodykleuren mogen die keuze niet meer overschrijven.\n                 */for(const element of elements){if(logoElement&&(element===logoElement||logoElement.contains(element))){continue;}const color=normalizeColor(window.getComputedStyle(element).backgroundColor);if(!isTransparent(color)){return shouldUseLightLogo(color);}}const clients=document.querySelector(\".clients-section\");if(clients){const rect=clients.getBoundingClientRect();if(rect.top<=y&&rect.bottom>=y)return true;}return false;};/*\n             * Framer verplaatst sticky/code-secties soms pas ná het normale\n             * scroll-event. Daarom meten we op ieder visueel frame. Zo volgt\n             * het logo ook achtergronden die met transforms bewegen.\n             */const monitor=()=>{const settings=getResponsiveSettings();const nextLight=syncedTheme.current??hasDarkBackground();targetScale.set(window.scrollY>18?settings.smallScale:1);setLight(current=>current===nextLight?current:nextLight);frame.current=requestAnimationFrame(monitor);};frame.current=requestAnimationFrame(monitor);return()=>{if(frame.current!==null){cancelAnimationFrame(frame.current);}window.removeEventListener(\"not-me-background-theme\",onBackgroundTheme);};},[targetScale]);return /*#__PURE__*/_jsx(Component,{...props,ref:logoRef,variant:light?\"Light logo\":\"Dark logo\",style:{...props.style,scale:smoothScale,transformOrigin:\"0% 0%\",originX:0,originY:0,translate:\"0px 10px\",willChange:\"transform\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"videoZone\":{\"type\":\"reactHoc\",\"name\":\"videoZone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoLogo\":{\"type\":\"reactHoc\",\"name\":\"autoLogo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"lightLogoZone\":{\"type\":\"reactHoc\",\"name\":\"lightLogoZone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LIGHT_LOGO.map"],"mappings":"sMACwE,SAAS,GAAuB,CAAyL,OAA9K,IAAS,OAAmB,CAAC,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE,EAAM,EAAO,WAAW,IAAW,CAAC,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE,EAAM,EAAO,WAAW,KAAY,CAAC,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE,EAAS,CAAC,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE,CAAE,CAAC,SAAS,EAAe,EAAM,CAAC,OAAO,EAAM,QAAQ,OAAO,GAAG,CAAC,CAAC,KAAK,CAAE,CAAC,SAAS,EAAQ,EAAM,CAAC,IAAM,EAAM,EAAM,MAAM,uCAAuC,EAAwB,OAAlB,EAAwB,CAAC,EAAE,OAAO,EAAM,EAAE,EAAE,EAAE,OAAO,EAAM,EAAE,EAAE,EAAE,OAAO,EAAM,EAAE,CAAC,EAApE,IAAsE,CAAC,SAAS,EAAc,EAAM,CAAC,IAAM,EAAW,EAAe,CAAK,EAAE,MAAM,CAAC,GAAY,IAAa,eAAe,IAAa,kBAAmB,CAAC,SAAS,EAAe,EAAO,EAAO,EAAU,GAAG,CAAC,IAAM,EAAE,EAAQ,CAAM,EAAQ,EAAE,EAAQ,CAAM,EAAyB,MAApB,CAAC,GAAG,CAAC,EAAS,GAAa,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,GAAW,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,GAAW,KAAK,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAU,CAAC,SAAS,EAAiB,EAAM,EAAO,CAAC,IAAM,EAA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