{"version":3,"file":"RangeBar.DRxttJ6W.mjs","names":["useRef","useEffect","useLayoutEffect","__esmMin","le","init_ssg_sandbox_shims","window","de","p","init_npm_react_18_3_1","ce","motion","useMotionValue","animate","init_framer_motion_DhsWWWsN","RenderTarget","init_framer_BWFVvmND","addPropertyControls","ControlType","RangeBar","props","x","dotX","ref","cx","useIsoLayoutEffect","el","intro","card","bars","controls","io","entries","delay","style","track","zoneStart","zoneWidth","zone","dot","dotStroke","init_RangeBar","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/mQ6xaNYKt0doEdUCp7I0/OqX601JydQHHR3V5pgOq/RangeBar.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useMotionValue,animate}from\"framer-motion\";// Kerno range bar for the marker rows on result pages.\n// Why code: the dot sits at each marker's \"Dot x\" CMS number, and Framer cannot\n// bind a layer's position or size to a number field. Colours, the zone and the\n// dot position are all controls, so nothing else needs editing here.\n// Intro: the dot slides in from the left once, when the \"Report Card\" around it\n// comes into view, each bar 0.08s after the one above (as on the HTML site).\nconst useIsoLayoutEffect=typeof window===\"undefined\"?useEffect:useLayoutEffect;/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 196\n */export default function RangeBar(props){const{dotX,zoneStart,zoneWidth,track,zone,dot,dotStroke,intro,delay,style}=props;const x=Math.max(5,Math.min(191,Number(dotX)||0));const ref=useRef(null);const cx=useMotionValue(x);useIsoLayoutEffect(()=>{const el=ref.current;if(!intro||!el||RenderTarget.current()===RenderTarget.canvas){cx.set(x);return;}if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches){cx.set(x);return;}cx.set(5);const card=el.closest('[data-framer-name=\"Report Card\"]')||el;const bars=[...card.querySelectorAll(\"svg[data-kerno-range-bar]\")];const i=Math.max(0,bars.indexOf(el));let controls;const io=new IntersectionObserver(entries=>{if(!entries.some(e=>e.isIntersecting))return;io.disconnect();controls=animate(cx,x,{duration:1.1,ease:[.645,.045,.355,1],delay:delay+i*.08});},{threshold:.15});io.observe(card);return()=>{io.disconnect();controls&&controls.stop();};},[intro,x,delay]);return /*#__PURE__*/_jsxs(\"svg\",{ref:ref,\"data-kerno-range-bar\":\"\",viewBox:\"0 0 196 12\",\"aria-hidden\":\"true\",style:{display:\"block\",width:\"100%\",height:\"auto\",overflow:\"visible\",...style},children:[/*#__PURE__*/_jsx(\"rect\",{x:0,y:3,width:196,height:6,rx:3,fill:track}),/*#__PURE__*/_jsx(\"rect\",{x:zoneStart,y:3,width:zoneWidth,height:6,rx:3,fill:zone}),/*#__PURE__*/_jsx(motion.circle,{cx:cx,cy:6,r:5,fill:dot,stroke:dotStroke,strokeWidth:2})]});}RangeBar.defaultProps={dotX:46,zoneStart:24,zoneWidth:68,track:\"rgba(238, 240, 243, 0.22)\",zone:\"rgba(91, 149, 255, 0.45)\",dot:\"rgb(242, 244, 248)\",dotStroke:\"rgb(30, 47, 85)\",intro:false,delay:.55};addPropertyControls(RangeBar,{dotX:{type:ControlType.Number,title:\"Dot x\",min:0,max:196,step:1,defaultValue:46},zoneStart:{type:ControlType.Number,title:\"Zone start\",min:0,max:196,step:1,defaultValue:24},zoneWidth:{type:ControlType.Number,title:\"Zone width\",min:0,max:196,step:1,defaultValue:68},track:{type:ControlType.Color,title:\"Track\",defaultValue:\"rgba(238, 240, 243, 0.22)\"},zone:{type:ControlType.Color,title:\"Zone\",defaultValue:\"rgba(91, 149, 255, 0.45)\"},dot:{type:ControlType.Color,title:\"Dot\",defaultValue:\"rgb(242, 244, 248)\"},dotStroke:{type:ControlType.Color,title:\"Dot ring\",defaultValue:\"rgb(30, 47, 85)\"},intro:{type:ControlType.Boolean,title:\"Intro\",defaultValue:false},delay:{type:ControlType.Number,title:\"Delay\",min:0,max:3,step:.05,unit:\"s\",defaultValue:.55,hidden:p=>!p.intro}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RangeBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"196\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RangeBar.map"],"mappings":"A,0QAUG,SAAwBmB,EAAS,EAAM,CAAC,GAAK,CAAC,OAAK,YAAU,YAAU,QAAM,OAAK,MAAI,YAAU,QAAM,QAAM,SAAOC,EAAYC,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,IAAI,OAAOC,CAAI,GAAG,CAAC,CAAC,EAAQC,EAAIvB,EAAO,IAAI,EAAQwB,EAAGZ,EAAeS,CAAC,EAAurB,OAArrBI,MAAuB,CAAC,IAAMC,EAAGH,EAAI,QAAwF,GAA7E,CAACI,GAAO,CAACD,GAAIX,EAAa,QAAQ,IAAIA,EAAa,QAA6BT,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,CAACkB,EAAG,IAAIH,CAAC,EAAE,MAAO,CAACG,EAAG,IAAI,CAAC,EAAE,IAAMI,EAAKF,EAAG,QAAQ,kCAAkC,GAAGA,EAASG,EAAK,CAAC,GAAGD,EAAK,iBAAiB,2BAA2B,CAAC,EAAQ,EAAE,KAAK,IAAI,EAAEC,EAAK,QAAQH,CAAE,CAAC,EAAMI,EAAeC,EAAG,IAAI,qBAAqB,GAAS,CAAKC,EAAQ,KAAK,GAAG,EAAE,cAAc,IAASD,EAAG,WAAW,EAAE,EAASlB,EAAQW,EAAGH,EAAE,CAAC,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,MAAMY,EAAM,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,UAAU,GAAG,CAAC,EAAmB,OAAjBF,EAAG,QAAQH,CAAI,MAAY,CAACG,EAAG,WAAW,EAAED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