{"version":3,"file":"CustomCursor.e7y3NJTO.mjs","names":["useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/Sw8kMFNm30I2GIJynkct/0ctpq29tRzDe8ygkSjjd/CustomCursor.js"],"sourcesContent":["/**\n * CustomCursor\n * Follows the pointer on desktop as a small dot with a fine ring, grows over\n * links and buttons and changes its label over marked areas. Hidden on touch\n * devices and when reduced motion is requested. Colours, sizes and labels are\n * editable through property controls.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";// @ts-ignore\nimport{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CustomCursor(props){const{grundfarbe,ringfarbe,standardgroesse,grossgroesse,textMedien,textRechner}=props;const[isTouch,setIsTouch]=useState(false);const[prefersReducedMotion,setPrefersReducedMotion]=useState(false);const[isVisible,setIsVisible]=useState(false);const[hideForFormField,setHideForFormField]=useState(false);const[cursorState,setCursorState]=useState({x:0,y:0,mode:\"none\"});const cursorStateRef=useRef(cursorState);useEffect(()=>{cursorStateRef.current=cursorState;},[cursorState]);useEffect(()=>{if(typeof window!==\"undefined\"&&window.matchMedia){const touchQuery=window.matchMedia(\"(hover: none), (pointer: coarse)\");const reducedQuery=window.matchMedia(\"(prefers-reduced-motion: reduce)\");startTransition(()=>{setIsTouch(touchQuery.matches);setPrefersReducedMotion(reducedQuery.matches);});const handleTouchChange=event=>{startTransition(()=>setIsTouch(event.matches));};const handleReducedChange=event=>{startTransition(()=>setPrefersReducedMotion(event.matches));};touchQuery.addEventListener(\"change\",handleTouchChange);reducedQuery.addEventListener(\"change\",handleReducedChange);return()=>{touchQuery.removeEventListener(\"change\",handleTouchChange);reducedQuery.removeEventListener(\"change\",handleReducedChange);};}startTransition(()=>{setIsTouch(false);setPrefersReducedMotion(false);});return undefined;},[]);const isReadingTarget=useCallback(target=>{if(!(target instanceof Element))return false;if(target.closest(\"input, textarea, select\"))return true;if(target.closest(\"[data-cursor='none']\"))return true;const hasBlockScope=el=>{let node=el;while(node){const markers=[node.getAttribute(\"data-framer-name\"),node.getAttribute(\"data-framer-component\"),node.getAttribute(\"id\"),node.getAttribute(\"class\")].filter(Boolean).join(\" \").toLowerCase().replace(/\\s+/g,\"\");if(markers.includes(\"blocktabs\")||markers.includes(\"dotcloud\")){return true;}node=node.parentElement;}return false;};if(hasBlockScope(target))return true;if(target.closest([\".block-tabs-layout\",\".block-tabs-steps\",\".block-tabs-step-button\",\"[data-framer-name='BlockTabs']\",\"[data-framer-name='Block Tabs']\",\"[data-framer-name='DotCloud']\",\"[data-framer-name='Dot Cloud']\",\"[data-framer-component='BlockTabs']\",\"[data-framer-component='DotCloud']\"].join(\", \"))){return true;}return false;},[]);const isHomePage=useCallback(()=>{if(typeof window===\"undefined\")return false;const path=window.location.pathname.replace(/\\/+$/,\"\");return path===\"\"||path===\"/\"||path===\"/index.html\";},[]);const isHomeInteractiveTarget=useCallback(target=>{if(!(target instanceof Element))return false;if(!isHomePage())return false;if(target.closest(\"a, button, [role='button']\"))return true;if(target.closest(\"nav, [role='navigation']\"))return true;if(target.closest(\"[data-framer-name*='logo' i], [id*='logo' i], [class*='logo' i]\"))return true;return false;},[isHomePage]);const isFormFieldTarget=useCallback(target=>{if(!(target instanceof Element))return false;return!!target.closest(\"input, textarea, select\");},[]);const resolveMode=useCallback(target=>{if(!(target instanceof Element))return\"none\";if(target.closest(\"#award-media\"))return\"media\";if(target.closest(\"#award-calculator\"))return\"calculator\";if(target.closest(\"[data-award-cursor='media']\"))return\"media\";if(target.closest(\"[data-award-cursor='calculator']\"))return\"calculator\";if(isHomeInteractiveTarget(target))return\"homeReading\";if(isReadingTarget(target))return\"reading\";if(target.closest(\"a, button, [role='button']\"))return\"interactive\";return\"none\";},[isReadingTarget,isHomeInteractiveTarget]);useEffect(()=>{if(typeof window===\"undefined\"||isTouch||prefersReducedMotion){startTransition(()=>setIsVisible(false));return undefined;}const updateModeIfNeeded=target=>{const nextMode=resolveMode(target);const current=cursorStateRef.current;if(current.mode!==nextMode){startTransition(()=>setCursorState({x:current.x,y:current.y,mode:nextMode}));}};const handlePointerMove=event=>{if(event.pointerType&&event.pointerType!==\"mouse\"){startTransition(()=>setIsVisible(false));return;}const nextMode=resolveMode(event.target);const current=cursorStateRef.current;const changed=current.x!==event.clientX||current.y!==event.clientY||current.mode!==nextMode;if(changed){startTransition(()=>setCursorState({x:event.clientX,y:event.clientY,mode:nextMode}));}if(!isVisible){startTransition(()=>setIsVisible(true));}};const handlePointerOver=event=>{if(event.pointerType&&event.pointerType!==\"mouse\")return;updateModeIfNeeded(event.target);};const handlePointerOut=event=>{if(event.pointerType&&event.pointerType!==\"mouse\")return;const related=event.relatedTarget;updateModeIfNeeded(related);};const handlePointerLeave=()=>{startTransition(()=>setIsVisible(false));};window.addEventListener(\"pointermove\",handlePointerMove,{passive:true});window.addEventListener(\"pointerover\",handlePointerOver,true);window.addEventListener(\"pointerout\",handlePointerOut,true);window.addEventListener(\"mouseout\",handlePointerLeave);return()=>{window.removeEventListener(\"pointermove\",handlePointerMove);window.removeEventListener(\"pointerover\",handlePointerOver,true);window.removeEventListener(\"pointerout\",handlePointerOut,true);window.removeEventListener(\"mouseout\",handlePointerLeave);};},[isTouch,prefersReducedMotion,resolveMode,isVisible]);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return undefined;const updateHiddenState=target=>{const focusElement=document.activeElement;const hasFocusOnForm=isFormFieldTarget(focusElement);const hasHoverOnForm=isFormFieldTarget(target);const shouldHide=hasFocusOnForm||hasHoverOnForm;startTransition(()=>setHideForFormField(shouldHide));};const onPointerOver=event=>{updateHiddenState(event.target);};const onPointerOut=event=>{updateHiddenState(event.relatedTarget);};const onFocusIn=event=>{updateHiddenState(event.target);};const onFocusOut=()=>{updateHiddenState(document.activeElement);};document.addEventListener(\"pointerover\",onPointerOver,true);document.addEventListener(\"pointerout\",onPointerOut,true);document.addEventListener(\"focusin\",onFocusIn,true);document.addEventListener(\"focusout\",onFocusOut,true);updateHiddenState(document.activeElement);return()=>{document.removeEventListener(\"pointerover\",onPointerOver,true);document.removeEventListener(\"pointerout\",onPointerOut,true);document.removeEventListener(\"focusin\",onFocusIn,true);document.removeEventListener(\"focusout\",onFocusOut,true);};},[isFormFieldTarget]);const label=useMemo(()=>{if(cursorState.mode===\"media\")return textMedien;if(cursorState.mode===\"calculator\")return textRechner;return\"\";},[cursorState.mode,textMedien,textRechner]);const isReading=cursorState.mode===\"reading\";const isHomeReading=cursorState.mode===\"homeReading\";const isTransparentRing=isReading||isHomeReading;const ringBorder=isHomeReading?\"1px solid rgba(31, 58, 68, 0.6)\":`${isReading?1.5:1}px solid ${ringfarbe}`;const size=cursorState.mode===\"none\"?standardgroesse:grossgroesse;const shouldHide=isTouch||prefersReducedMotion||!isVisible;const cursorOpacity=hideForFormField?0:1;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",overflow:\"visible\"},\"aria-hidden\":\"true\",children:!shouldHide&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",left:0,top:0,width:size,height:size,transform:`translate3d(${cursorState.x-size/2}px, ${cursorState.y-size/2}px, 0)`,borderRadius:999,border:ringBorder,backgroundColor:isTransparentRing?\"transparent\":grundfarbe,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxSizing:\"border-box\",transition:\"transform 110ms linear, width 160ms ease, height 160ms ease, background-color 180ms ease, border-width 180ms ease, opacity 140ms ease\",opacity:cursorOpacity,zIndex:2147483647},children:!isTransparentRing&&label&&/*#__PURE__*/_jsx(\"span\",{style:{color:ringfarbe,fontSize:10,lineHeight:1,whiteSpace:\"nowrap\",userSelect:\"none\",transition:\"opacity 160ms ease\"},children:label})})});}addPropertyControls(CustomCursor,{grundfarbe:{type:ControlType.Color,title:\"Base color\",defaultValue:\"#000000\"},ringfarbe:{type:ControlType.Color,title:\"Ring color\",defaultValue:\"#CCCCCC\"},standardgroesse:{type:ControlType.Number,title:\"Default size\",defaultValue:12,min:4,max:64,step:1},grossgroesse:{type:ControlType.Number,title:\"Large size\",defaultValue:28,min:8,max:120,step:1},textMedien:{type:ControlType.String,title:\"Media text\",defaultValue:\"View\"},textRechner:{type:ControlType.String,title:\"Calculator text\",defaultValue:\"Calculate\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomCursor\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomCursor.map"],"mappings":"2NAUG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,aAAW,YAAU,kBAAgB,eAAa,aAAW,eAAa,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAO,CAAC,EAAqB,GAAyBA,EAAS,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAiB,GAAqBA,EAAS,EAAK,EAAO,CAAC,EAAY,GAAgBA,EAAS,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,MAAM,CAAC,EAAQ,EAAeC,EAAO,CAAW,EAAE,MAAc,CAAC,EAAe,QAAQ,CAAY,EAAE,CAAC,CAAW,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,QAAa,EAAO,WAAW,CAAC,IAAM,EAAW,EAAO,WAAW,kCAAkC,EAAQ,EAAa,EAAO,WAAW,kCAAkC,EAAE,MAAoB,CAAC,EAAW,EAAW,OAAO,EAAE,EAAwB,EAAa,OAAO,CAAE,CAAC,EAAE,IAAM,EAAkB,GAAO,CAAC,MAAoB,EAAW,EAAM,OAAO,CAAC,CAAE,EAAQ,EAAoB,GAAO,CAAC,MAAoB,EAAwB,EAAM,OAAO,CAAC,CAAE,EA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