{"version":3,"file":"ScrollProgress.CALO2SKQ.mjs","names":["useState","useRef","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","p","c","init_jsx_runtime","ce","useTransform","motion","useScroll","init_framer_motion_DhsWWWsN","init_framer_CKT6jEEQ","addPropertyControls","ControlType","useIsStaticRenderer","Dot","props","start","threshold","bg","progress","inactive","active","scale","staticActive","staticProgress","size","isStatic","halo","inFlow","el","cs","firstRow","card","depth","kids","layoutTop","y","e","parent","sameMarks","a","b","i","useCardMarks","marks","setMarks","align","root","ref","isCard","cards","holder","found","inner","heights","median","measure","h","top","next","target","f","prev","observer","ScrollProgress","aligned","measured","ready","thresholds","count","steps","from","to","span","fillHeight","scrollYProgress","v","thickness","trackColor","radius","fillColor","t","dotSize","dotInactiveColor","haloColor","init_ScrollProgress"],"sources":["https:/framerusercontent.com/modules/pX1MnQjQzGSWhjNsVHxc/xNfrH4eoBq7KaLLs625a/ScrollProgress.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{motion,useScroll,useTransform}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";function Dot(props){const{progress,threshold,size,active,inactive,halo,isStatic,staticProgress}=props;const start=Math.max(0,threshold-.04);const bg=useTransform(progress,[start,threshold],[inactive,active]);const scale=useTransform(progress,[start,threshold],[1,1.35]);const staticActive=staticProgress>=threshold;return /*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:`${threshold*100}%`,left:\"50%\",x:\"-50%\",y:\"-50%\",width:size,height:size,borderRadius:\"50%\",background:isStatic?staticActive?active:inactive:bg,scale:isStatic?staticActive?1.35:1:scale,boxShadow:`0 0 0 4px ${halo}`,zIndex:2}});}// An element in the flow and displayed (not absolute, fixed or hidden).\nfunction inFlow(el){if(!(el instanceof HTMLElement))return false;const cs=window.getComputedStyle(el);if(cs.position===\"absolute\"||cs.position===\"fixed\")return false;if(cs.display===\"none\"||cs.visibility===\"hidden\")return false;return el.offsetHeight>0;}// Descend through single-child wrappers, then return the first row of the card.\nfunction firstRow(card){let el=card;for(let depth=0;depth<6;depth++){const kids=Array.from(el.children).filter(inFlow);if(kids.length===1){el=kids[0];continue;}return kids.length>0?kids[0]:el;}return el;}// Vertical position from layout only: ignores transforms (hover, appear effects, canvas zoom).\nfunction layoutTop(el){let y=0;let e=el;while(e){y+=e.offsetTop;const parent=e.offsetParent instanceof HTMLElement?e.offsetParent:null;if(parent)y+=parent.clientTop;e=parent;}return y;}function sameMarks(a,b){if(!a||a.length!==b.length)return false;for(let i=0;i<a.length;i++)if(Math.abs(a[i]-b[i])>5e-4)return false;return true;}/**\n * Aligned mode: the rail sits in an absolute frame next to the cards\n * (same parent). Each dot is placed on the measured position of a card,\n * as a fraction of the rail height.\n * Returns null until the first measurement, [] when no card is found.\n */function useCardMarks(ref,align){const[marks,setMarks]=useState(null);useEffect(()=>{if(align===\"even\"){setMarks(null);return;}const root=ref.current;if(!root||typeof window===\"undefined\")return;const isCard=c=>inFlow(c)&&c.offsetHeight>=40;// Climb from the rail until a parent holds the cards (or a single stack of cards).\nconst cards=()=>{let holder=root;for(let depth=0;depth<8&&holder.parentElement;depth++){const parent=holder.parentElement;let found=Array.from(parent.children).filter(c=>c!==holder&&isCard(c));if(found.length===1){const inner=Array.from(found[0].children).filter(isCard);if(inner.length>=2)found=inner;}if(found.length>0){// Leave out small blocks (button, title) next to the cards.\nconst heights=found.map(c=>c.offsetHeight).sort((a,b)=>a-b);const median=heights[Math.floor(heights.length/2)];return found.filter(c=>c.offsetHeight>=median/2);}holder=parent;}return[];};const measure=()=>{const h=root.offsetHeight;if(h<=0)return;const top=layoutTop(root);const next=[];for(const card of cards()){const target=align===\"first\"?firstRow(card):card;const f=(layoutTop(target)+target.offsetHeight/2-top)/h;if(f>=0&&f<=1)next.push(f);}setMarks(prev=>sameMarks(prev,next)?prev:next);};measure();let observer=null;if(typeof ResizeObserver!==\"undefined\"){observer=new ResizeObserver(()=>measure());observer.observe(root);for(const card of cards())observer.observe(card);}window.addEventListener(\"resize\",measure);if(typeof document!==\"undefined\"&&\"fonts\"in document){document.fonts.ready.then(measure).catch(()=>{});}return()=>{observer?.disconnect();window.removeEventListener(\"resize\",measure);};},[align]);return marks;}/**\n * Scroll Progress Rail\n *\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ScrollProgress(props){const{trackColor=\"rgba(17, 17, 17, 0.12)\",fillColor=\"#EDD900\",thickness=5,radius=5,steps=5,dotSize=14,dotInactiveColor=\"#D9D9D9\",haloColor=\"#FFFFFF\",align=\"even\"}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const{scrollYProgress}=useScroll({target:ref,offset:[\"start center\",\"end center\"]});const marks=useCardMarks(ref,align);const aligned=align!==\"even\";const measured=marks!==null&&marks.length>0;// Aligned mode: hidden until the first measurement (no jump after loading).\nconst ready=!aligned||marks!==null;// Dots: measured on the cards, or spread evenly (default).\nlet thresholds;if(measured&&marks){thresholds=marks;}else{const count=Math.max(0,Math.round(steps));thresholds=[];for(let i=0;i<count;i++)thresholds.push((i+.5)/count);}// Track: full height, or from the first to the last card.\nconst from=measured&&marks&&marks.length>1?marks[0]:0;const to=measured&&marks&&marks.length>1?marks[marks.length-1]:1;const span=Math.max(1e-4,to-from);const fillHeight=useTransform(scrollYProgress,v=>{const p=(Math.min(Math.max(v,from),to)-from)/span;return`${p*100}%`;});const staticProgress=from+span*.34;return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{...props.style,position:\"relative\",width:\"100%\",height:\"100%\",minHeight:80,minWidth:thickness},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",inset:0,opacity:ready?1:0,transition:aligned?\"opacity 0.3s ease\":undefined},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:`${from*100}%`,height:`${span*100}%`,left:0,right:0,marginLeft:\"auto\",marginRight:\"auto\",width:thickness,background:trackColor,borderRadius:radius},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:isStatic?\"34%\":fillHeight,background:fillColor,borderRadius:radius}})}),thresholds.map((t,i)=>/*#__PURE__*/_jsx(Dot,{progress:scrollYProgress,threshold:t,size:dotSize,active:fillColor,inactive:dotInactiveColor,halo:haloColor,isStatic:isStatic,staticProgress:staticProgress},i))]})});}addPropertyControls(ScrollProgress,{align:{type:ControlType.Enum,title:\"Points\",options:[\"even\",\"first\",\"center\"],optionTitles:[\"R\\xe9partis\",\"1re ligne des cartes\",\"Centre des cartes\"],defaultValue:\"even\"},trackColor:{type:ControlType.Color,title:\"Track\",defaultValue:\"rgba(17, 17, 17, 0.12)\"},fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#EDD900\"},dotInactiveColor:{type:ControlType.Color,title:\"Dot Off\",defaultValue:\"#D9D9D9\"},haloColor:{type:ControlType.Color,title:\"Halo\",defaultValue:\"#FFFFFF\"},steps:{type:ControlType.Number,title:\"Steps\",defaultValue:5,min:0,max:12,step:1,displayStepper:true,hidden:p=>p.align!==undefined&&p.align!==\"even\"},dotSize:{type:ControlType.Number,title:\"Dot Size\",defaultValue:14,min:4,max:40,unit:\"px\"},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:5,min:1,max:24,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:5,min:0,max:24,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgress\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n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