{"version":3,"file":"ProgressAnimation.CWZwNbpl.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","de","p","init_jsx_runtime","useInView","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_BEr93sCn","RenderTarget","ControlType","ProgressAnimation","props","rootRef","isInView","isCanvas","animationDurationMs","timeAnimation","styles","style","progressColor","PROGRESS_KEYFRAME_NAME","PROGRESS_KEYFRAMES_CSS","init_ProgressAnimation"],"sources":["https:/framerusercontent.com/modules/NBqMggOnu1hP7lHQ1ily/H4t9c9sxEG06iTSuZhBP/ProgressAnimation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useInView}from\"framer-motion\";const PROGRESS_KEYFRAME_NAME=\"mollie-progress-animation-fill-v1\";const PROGRESS_KEYFRAMES_CSS=`@keyframes ${PROGRESS_KEYFRAME_NAME} {\n    from { transform: scaleX(0); }\n    to { transform: scaleX(1); }\n}`;/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ProgressAnimation(props){const{backgroundColor,progressColor,timeAnimation,style}=props;const rootRef=useRef(null);const isInView=useInView(rootRef);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const normalizedTimeAnimation=Number.isFinite(timeAnimation)?timeAnimation:1500;const animationDurationMs=Math.max(0,normalizedTimeAnimation)*100;const styles={container:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor,...style},progress:{position:\"absolute\",inset:0,background:progressColor,transformOrigin:\"left center\",transform:isCanvas?\"scaleX(1)\":\"scaleX(0)\",animationName:isCanvas?\"none\":PROGRESS_KEYFRAME_NAME,animationDuration:`${animationDurationMs}ms`,animationTimingFunction:\"linear\",animationIterationCount:\"infinite\",animationPlayState:isInView?\"running\":\"paused\"}};return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:styles.container,children:[/*#__PURE__*/_jsx(\"style\",{children:PROGRESS_KEYFRAMES_CSS}),/*#__PURE__*/_jsx(\"div\",{style:styles.progress})]});}addPropertyControls(ProgressAnimation,{backgroundColor:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"rgba(0, 0, 0, 0.12)\"},progressColor:{title:\"Progress Color\",type:ControlType.Color,defaultValue:\"black\"},timeAnimation:{title:\"Animation Time (ms)\",type:ControlType.Number,defaultValue:1500,min:10,max:1e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressAnimation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProgressAnimation.map"],"mappings":"A,2OAMG,SAAwBY,EAAkB,EAAM,CAAC,GAAK,CAAC,kBAAgB,gBAAc,gBAAc,SAAOC,EAAYC,EAAQd,EAAO,IAAI,EAAQe,EAAST,EAAUQ,CAAO,EAAQE,EAASN,EAAa,QAAQ,IAAIA,EAAa,OAA6FO,EAAoB,KAAK,IAAI,EAArF,OAAO,SAASC,CAAa,EAAEA,EAAc,IAAiE,EAAE,IAAUC,EAAO,CAAC,UAAU,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,WAAW,SAAS,SAAS,kBAAgB,GAAGC,CAAK,EAAE,SAAS,CAAC,SAAS,WAAW,MAAM,EAAE,WAAWC,EAAc,gBAAgB,cAAc,UAAUL,EAAS,YAAY,YAAY,cAAcA,EAAS,OAAOM,EAAuB,kBAAkB,GAAGL,EAAoB,IAAI,wBAAwB,SAAS,wBAAwB,WAAW,mBAAmBF,EAAS,UAAU,QAAQ,CAAC,EAAE,MAAoB,gBAAM,MAAM,CAAC,IAAID,EAAQ,MAAMK,EAAO,UAAU,SAAS,CAAc,gBAAK,QAAQ,CAAC,SAASI,CAAsB,CAAC,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