{"version":3,"file":"ScrollDots.0sgCML_3.mjs","names":["useState","__esmMin","window","te","init_ssg_sandbox_shims","_e","c","init_jsx_runtime","ce","init_npm_react_18_3_1","addPropertyControls","init_framer_Bf4_tcb2","ControlType","ScrollDots","props","active","setActive","targetId","el","raf","cancelled","slides","out","child","row","inner","update","kids","padLeft","anchor","best","bestDistance","i","distance","attach","count","dots","isActive","activeWidth","dotSize","activeColor","inactiveColor","style","init_ScrollDots"],"sources":["https:/framerusercontent.com/modules/UaE3I3zCs0OHK1zIeUaf/B9Ab1SbUgM2YloD3NKdr/ScrollDots.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Scroll Dots\n *\n * Pagination dots that follow a horizontal scroll container.\n * Point Target ID at the element ID of the scrolling row.\n *\n * @framerIntrinsicWidth 60\n * @framerIntrinsicHeight 8\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ScrollDots(props){const{targetId=\"\",count=3,activeColor=\"#FBCE01\",inactiveColor=\"rgba(255, 255, 255, 0.22)\",dotSize=8,activeWidth=26,gap=7,style}=props;const[active,setActive]=useState(0);useEffect(()=>{if(typeof document===\"undefined\"||typeof window===\"undefined\")return;if(!targetId)return;let el=null;let raf=0;let cancelled=false;// Framer wraps any child that carries breakpoint overrides in a zero-width\n// \"ssr-variant\" div, so el.children is not reliably the slide list.\nfunction slides(row){const out=[];for(const child of Array.from(row.children)){if(child.getBoundingClientRect().width>0){out.push(child);}else{for(const inner of Array.from(child.children)){if(inner.getBoundingClientRect().width>0)out.push(inner);}}}return out;}function update(){if(!el)return;const kids=slides(el);if(kids.length===0)return;const padLeft=parseFloat(getComputedStyle(el).paddingLeft)||0;// measure against live rects so wrapper nesting cannot skew the offsets\nconst anchor=el.getBoundingClientRect().left+padLeft;let best=0;let bestDistance=Number.POSITIVE_INFINITY;for(let i=0;i<kids.length;i++){const distance=Math.abs(kids[i].getBoundingClientRect().left-anchor);if(distance<bestDistance){bestDistance=distance;best=i;}}startTransition(function(){setActive(best);});}// the row may not be in the DOM on the first pass, so keep looking\nfunction attach(){el=document.getElementById(targetId);if(!el){if(!cancelled)raf=requestAnimationFrame(attach);return;}update();el.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);}attach();return function(){cancelled=true;cancelAnimationFrame(raf);if(el)el.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[targetId,count]);const dots=[];for(let i=0;i<count;i++){const isActive=i===active;dots.push(/*#__PURE__*/_jsx(\"div\",{role:\"tab\",\"aria-selected\":isActive,\"aria-label\":\"Slide \"+(i+1),style:{width:isActive?activeWidth:dotSize,height:dotSize,borderRadius:100,backgroundColor:isActive?activeColor:inactiveColor,flex:\"0 0 auto\",transition:\"width 0.32s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.32s ease\"}},i));}return /*#__PURE__*/_jsx(\"div\",{role:\"tablist\",\"aria-label\":\"Carousel position\",style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"center\",gap:gap},children:dots});}addPropertyControls(ScrollDots,{targetId:{type:ControlType.String,title:\"Target ID\",defaultValue:\"\",placeholder:\"coach-carousel\"},count:{type:ControlType.Number,title:\"Dots\",defaultValue:3,min:1,max:12,step:1},activeColor:{type:ControlType.Color,title:\"Active\",defaultValue:\"#FBCE01\"},inactiveColor:{type:ControlType.Color,title:\"Inactive\",defaultValue:\"rgba(255, 255, 255, 0.22)\"},dotSize:{type:ControlType.Number,title:\"Dot Size\",defaultValue:8,min:4,max:20,step:1,unit:\"px\"},activeWidth:{type:ControlType.Number,title:\"Active Width\",defaultValue:26,min:8,max:60,step:1,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:7,min:0,max:24,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollDots\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"60\",\"framerIntrinsicHeight\":\"8\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollDots.map"],"mappings":"A,uMAWG,SAAwBa,EAAW,EAAM,CAAC,GAAK,CAAC,WAAS,GAAG,QAAM,EAAE,cAAY,UAAU,gBAAc,4BAA4B,UAAQ,EAAE,cAAY,GAAG,MAAI,EAAE,SAAOC,EAAW,CAACC,EAAOC,GAAWhB,EAAS,CAAC,EAAEQ,MAAc,CAAsE,GAAlE,OAAO,SAAW,KAAoBN,IAAS,QAAsB,CAACe,EAAS,OAAO,IAAIC,EAAG,KAASC,EAAI,EAAMC,EAAU,GAEnW,SAASC,EAAO,EAAI,CAAC,IAAMC,EAAI,CAAC,EAAE,IAAI,IAAMC,KAAS,MAAM,KAAKC,EAAI,QAAQ,EAAG,GAAGD,EAAM,sBAAsB,CAAC,CAAC,MAAM,EAAGD,EAAI,KAAKC,CAAK,OAAQ,IAAI,IAAME,KAAS,MAAM,KAAKF,EAAM,QAAQ,EAAME,EAAM,sBAAsB,CAAC,CAAC,MAAM,GAAEH,EAAI,KAAKG,CAAK,EAAK,OAAOH,CAAI,CAAC,SAASI,GAAQ,CAAC,GAAG,CAACR,EAAG,OAAO,IAAMS,EAAKN,EAAOH,CAAE,EAAE,GAAGS,EAAK,SAAS,EAAE,OAAO,IAAMC,EAAQ,WAAW,iBAAiBV,CAAE,CAAC,CAAC,WAAW,GAAG,EAC5YW,EAAOX,EAAG,sBAAsB,CAAC,CAAC,KAAKU,EAAYE,EAAK,EAAMC,EAAa,IAAyB,IAAI,IAAIC,EAAE,EAAEA,EAAEL,EAAK,OAAO,IAAI,CAAC,IAAMM,EAAS,KAAK,IAAIN,EAAKK,EAAE,CAAC,sBAAsB,CAAC,CAAC,KAAKH,C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