{"version":3,"file":"WithLoopRotateY.DNbv68L0.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/KpnXhfjhkTMEbsZlpwZM/ezSJX9Om71ORRsA4uJDu/WithLoopRotateY.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useEffect,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";import{animate,useMotionValue,useMotionValueEvent}from\"framer-motion\";// User request: Create a new override named withLoopRotateY that continuously swings rotateY between -15 and 15 as a plain numeric prop.\nconst minAngle=-15;const maxAngle=15;const durationSeconds=4;export function withLoopRotateY(Component){return /*#__PURE__*/forwardRef(function WithLoopRotateY(props,ref){const isStatic=useIsStaticRenderer();const canAnimate=!isStatic&&typeof window!==\"undefined\";const motionRotateY=useMotionValue(minAngle);const[rotateYValue,setRotateYValue]=useState(typeof props.rotateY===\"number\"?props.rotateY:minAngle);useMotionValueEvent(motionRotateY,\"change\",latest=>{if(!canAnimate)return;if(typeof latest!==\"number\"||Number.isNaN(latest))return;startTransition(()=>{setRotateYValue(latest);});});useEffect(()=>{let controls;if(canAnimate){motionRotateY.set(minAngle);controls=animate(motionRotateY,maxAngle,{duration:durationSeconds,repeat:Infinity,repeatType:\"mirror\",ease:\"easeInOut\"});}else{const fallback=typeof props.rotateY===\"number\"?props.rotateY:minAngle;startTransition(()=>{setRotateYValue(fallback);});}return()=>{controls?.stop();};},[canAnimate,motionRotateY,props.rotateY]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,rotateY:rotateYValue});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withLoopRotateY\":{\"type\":\"reactHoc\",\"name\":\"withLoopRotateY\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithLoopRotateY.map"],"mappings":"sQAC6D,SAAgB,EAAgB,EAAU,CAAC,OAAoB,EAAW,SAAyB,EAAM,EAAI,CAAsC,IAAM,EAAW,CAAvC,EAA+C,GAAU,IAAS,OAAkB,EAAc,EAAe,CAAQ,EAAO,CAAC,EAAa,GAAiBA,EAAS,OAAO,EAAM,SAAU,SAAS,EAAM,QAAQ,CAAQ,EAAikB,OAA/jB,EAAoB,EAAc,SAAS,GAAQ,CAAK,IAAqB,OAAO,GAAS,UAAU,OAAO,MAAM,CAAM,GAAS,MAAoB,CAAC,EAAgB,CAAM,CAAE,CAAC,EAAE,CAAC,EAAE,MAAc,CAAC,IAAI,EAAS,GAAG,EAAY,EAAc,IAAI,CAAQ,EAAE,EAAS,EAAQ,EAAc,EAAS,CAAC,SAAS,EAAgB,OAAO,IAAS,WAAW,SAAS,KAAK,WAAW,CAAC,MAAO,CAAC,IAAM,EAAS,OAAO,EAAM,SAAU,SAAS,EAAM,QAAQ,EAAS,MAAoB,CAAC,EAAgB,CAAQ,CAAE,CAAC,CAAE,CAAC,UAAU,CAAC,GAAU,KAAK,CAAE,CAAE,EAAE,CAAC,EAAW,EAAc,EAAM,OAAO,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,QAAQ,CAAY,CAAC,CAAE,CAAC,CAAE,2BAD9/B,IAAiE,IAAwC,IAAsE,EACnN,EAAS,IAAU,EAAS,GAAS,EAAgB"}