{"version":3,"file":"WithPreloadVideo.Bi1hEBuR.mjs","names":["useState","useRef","useRef"],"sources":["https:/ga.jspm.io/npm:@motionone/utils@10.12.0/dist/index.es.js","https:/framerusercontent.com/modules/G0fWmB8gRZ6Myh8zVf16/ZhBxAQxGa1LivxhZCMwD/Counter1.js","https:/framerusercontent.com/modules/whxEH3PjGHzad5tGykbf/JzV8a5Lfeypj2P1XDGTu/WithPreloadVideo.js"],"sourcesContent":["function addUniqueItem(t,e){-1===t.indexOf(e)&&t.push(e)}function removeItem(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const clamp=(t,e,n)=>Math.min(Math.max(n,t),e);const t={duration:.3,delay:0,endDelay:0,repeat:0,easing:\"ease\"};const isNumber=t=>\"number\"===typeof t;const isString=t=>\"string\"===typeof t;const isEasingGenerator=t=>\"object\"===typeof t&&Boolean(t.createAnimation);const isCubicBezier=t=>Array.isArray(t)&&isNumber(t[0]);const isEasingList=t=>Array.isArray(t)&&!isNumber(t[0]);const wrap=(t,e,n)=>{const o=e-t;return((n-t)%o+o)%o+t};function getEasingForSegment(t,e){return isEasingList(t)?t[wrap(0,t.length,e)]:t}const mix=(t,e,n)=>-n*t+n*e+t;const noop=()=>{};const noopReturn=t=>t;const progress=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function fillOffset(t,e){const n=t[t.length-1];for(let o=1;o<=e;o++){const s=progress(0,e,o);t.push(mix(n,1,s))}}function defaultOffset(t){const e=[0];fillOffset(e,t-1);return e}function interpolate(t,e=defaultOffset(t.length),n=noopReturn){const o=t.length;const s=o-e.length;s>0&&fillOffset(e,s);return s=>{let r=0;for(;r<o-2;r++)if(s<e[r+1])break;let f=clamp(0,1,progress(e[r],e[r+1],s));const c=getEasingForSegment(n,r);f=c(f);return mix(t[r],t[r+1],f)}}const e={ms:t=>1e3*t,s:t=>t/1e3};\n/*\n  Convert velocity into velocity per second\n\n  @param [number]: Unit per frame\n  @param [number]: Frame duration in ms\n*/function velocityPerSecond(t,e){return e?t*(1e3/e):0}export{addUniqueItem,clamp,defaultOffset,t as defaults,fillOffset,getEasingForSegment,interpolate,isCubicBezier,isEasingGenerator,isEasingList,isNumber,isString,mix,noop,noopReturn,progress,removeItem,e as time,velocityPerSecond,wrap};\n\n//# sourceMappingURL=index.es.js.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const CounterStyles={container:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\"}};export function Counter(props){const{start,end,speed,gapSize,prefixText,suffixText,prefixFont,suffixFont,prefixColor,suffixColor,loop,decimalSeparatorType,textSize,selectedFont,textColor,startOnViewport,restartOnViewport,incrementType}=props;const[count,setCount]=useState(start);const[isVisible,setIsVisible]=useState(false);const containerRef=useRef(null);useEffect(()=>{const observer=new IntersectionObserver(entries=>{const entry=entries[0];setIsVisible(entry.isIntersecting);});if(containerRef.current){observer.observe(containerRef.current);}return()=>{if(containerRef.current){observer.unobserve(containerRef.current);}};},[]);useEffect(()=>{const updateCount=()=>{const increment=incrementType===\"integer\"?1:.1;setCount(prevCount=>{const nextCount=parseFloat((prevCount+increment).toFixed(2));return nextCount>=end?end:nextCount;});};if(isVisible||!startOnViewport&&start!==end){const intervalId=setInterval(updateCount,speed);return()=>{clearInterval(intervalId);};}else if(startOnViewport&&isVisible){setCount(start);}},[count,start,end,loop,isVisible,speed,startOnViewport,incrementType]);useEffect(()=>{if(restartOnViewport&&isVisible){setCount(start)// Restart the animation when re-entering the viewport\n;}},[isVisible,restartOnViewport,start]);const formatNumber=number=>{if(decimalSeparatorType===\"comma\"){return number.toLocaleString(\"en-US\");}else if(decimalSeparatorType===\"period\"){return number.toLocaleString(\"en-US\").replace(/,/g,\".\");}else{return number.toFixed(incrementType===\"integer\"?0:1);}};return /*#__PURE__*/_jsxs(motion.div,{ref:containerRef,style:{...CounterStyles.container,gap:`${gapSize}px`,flexDirection:\"row\",alignItems:\"center\",fontSize:`${textSize}px`,fontFamily:selectedFont.fontFamily,fontWeight:selectedFont.fontWeight,color:textColor},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:prefixFont.fontFamily,fontWeight:prefixFont.fontWeight,color:prefixColor},children:prefixText}),/*#__PURE__*/_jsx(\"span\",{children:formatNumber(count)}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:suffixFont.fontFamily,fontWeight:suffixFont.fontWeight,color:suffixColor},children:suffixText})]});}Counter.defaultProps={start:0,end:100,speed:100,prefixText:\"\",suffixText:\"\",loop:false,decimalSeparatorType:\"comma\",textSize:36,selectedFont:{fontFamily:\"Inter\",fontWeight:500,systemFont:true},textColor:\"#D3D3D3\",startOnViewport:false,incrementType:\"integer\"};addPropertyControls(Counter,{startOnViewport:{type:ControlType.Boolean,title:\"Viewport\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},restartOnViewport:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},selectedFont:{title:\"Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Inter\",fontWeight:500,systemFont:true}},textSize:{title:\"Font Size\",type:ControlType.Number,min:8,max:240,step:1},textColor:{type:ControlType.Color,title:\"Font Color\"},start:{type:ControlType.Number,title:\"Start Number\",defaultValue:0,displayStepper:true},end:{type:ControlType.Number,title:\"End Number\",defaultValue:10,displayStepper:true},decimalSeparatorType:{type:ControlType.Enum,title:\"Separator\",defaultValue:\"comma\",options:[\"comma\",\"period\",\"none\"],optionTitles:[\"Comma (1,000)\",\"Decimal (1.000)\",\"None\"]},incrementType:{type:ControlType.Enum,title:\"Increment Type\",defaultValue:\"integer\",options:[\"integer\",\"decimal\"],optionTitles:[\"Integer\",\"Decimal\"]},prefixText:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},prefixFont:{title:\"Prefix Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Inter\",fontWeight:500,systemFont:true}},prefixColor:{type:ControlType.Color,title:\"Prefix Color\"},suffixText:{type:ControlType.String,title:\"Suffix\",defaultValue:\"\"},suffixFont:{title:\"Suffix Font\",type:ControlType.Font,defaultValue:{fontFamily:\"Inter\",fontWeight:500,systemFont:true}},suffixColor:{type:ControlType.Color,title:\"Suffix Color\"},gapSize:{type:ControlType.Number,title:\"Gap Size\",defaultValue:4,min:0,max:100,step:4},speed:{type:ControlType.Number,title:\"Speed (ms)\",defaultValue:100,min:0,max:2e3,step:10},loop:{type:ControlType.Boolean,title:\"Loop Animation\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Built by Microstacks\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"Counter\":{\"type\":\"reactComponent\",\"name\":\"Counter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Counter1.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export const withVideoPreloadNone=Component=>{return props=>{const containerRef=useRef(null);useEffect(()=>{if(containerRef?.current){const video=containerRef?.current?.querySelector(\"video\");if(video){video.setAttribute(\"preload\",\"none\");}}},[]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,children:/*#__PURE__*/_jsx(Component,{...props})});};};\nexport const __FramerMetadata__ = {\"exports\":{\"withVideoPreloadNone\":{\"type\":\"reactHoc\",\"name\":\"withVideoPreloadNone\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithPreloadVideo.map"],"mappings":"iQAAiI,GAAO,EAAE,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC,EAAE,ICAgH,SAAgB,EAAQ,EAAM,CAAC,GAAK,CAAC,QAAM,MAAI,QAAM,UAAQ,aAAW,aAAW,aAAW,aAAW,cAAY,cAAY,OAAK,uBAAqB,WAAS,eAAa,YAAU,kBAAgB,oB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