{"version":3,"file":"ScrollDots.BVf2UI6J.mjs","names":["useState","useEffect","startTransition","_jsx","__esmMin","window","te","init_ssg_sandbox_shims","_e","c","init_jsx_runtime","ce","init_npm_react_18_3_1","addPropertyControls","init_framer_ChujFWHC","ControlType","ScrollDots","props","targetId","count","activeColor","inactiveColor","dotSize","activeWidth","gap","style","active","setActive","el","raf","cancelled","slides","row","out","child","inner","update","kids","padLeft","anchor","best","bestDistance","i","distance","attach","dots","isActive","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,SAAwBgB,EAAWC,EAAM,CAAC,GAAK,CAACC,WAAS,GAAGC,QAAM,EAAEC,cAAY,UAAUC,gBAAc,4BAA4BC,UAAQ,EAAEC,cAAY,GAAGC,MAAI,EAAEC,SAAOR,EAAW,CAACS,EAAOC,GAAW3B,EAAS,CAAC,EAAEC,MAAc,CAAsE,GAAlE,OAAO,SAAW,KAAoBI,IAAS,QAAsB,CAACa,EAAS,OAAO,IAAIU,EAAG,KAASC,EAAI,EAAMC,EAAU,GAEnW,SAASC,EAAOC,EAAI,CAAC,IAAMC,EAAI,CAAC,EAAE,IAAI,IAAMC,KAAS,MAAM,KAAKF,EAAI,QAAQ,EAAG,GAAGE,EAAM,sBAAsB,CAAC,CAAC,MAAM,EAAGD,EAAI,KAAKC,CAAK,OAAQ,IAAI,IAAMC,KAAS,MAAM,KAAKD,EAAM,QAAQ,EAAMC,EAAM,sBAAsB,CAAC,CAAC,MAAM,GAAEF,EAAI,KAAKE,CAAK,EAAK,OAAOF,CAAI,CAAC,SAASG,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,OAAOK,IAAI,CAAC,IAAMC,EAAS,KAAK,IAAIN,EAAKK,EAAE,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