{"version":3,"file":"HeroCarousel.DjBgpHT6.mjs","names":["React.useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/OvSxipCWyCTTdLGDMKv9/V0kkSdbQ93mGvtJsg24f/HeroCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CarouselArrowsForId({targetId,bottom=20,left=20,right=20,zIndex=10,size=44,radius=999,bg=\"#FFFFFF\",hoverBg=\"#E04B3C\",shadow=true,borderWidth=0,borderColor=\"transparent\",hoverBorderColor=\"transparent\",iconFile,iconSize,iconColor=\"#605E58\",iconHoverColor=\"#FFFFFF\"}){// --- helpers to reach the carousel ---\nconst root=()=>document.querySelector(`[data-carousel-id=\"${CSS.escape(targetId)}\"]`);const near=(a,b,eps=1)=>Math.abs(a-b)<=eps;const getItems=()=>Array.from(root()?.querySelectorAll(\"[data-cc-item]\")||[]);const getMaxScrollLeft=()=>{const s=root();if(!s)return 0;return Math.max(0,s.scrollWidth-s.clientWidth);};const posForIndex=i=>{const scroller=root();if(!scroller)return 0;const items=getItems();const len=items.length;if(!len)return 0;if(i===len-1)return getMaxScrollLeft();return items[i].offsetLeft;};const getClosestIndex=()=>{const scroller=root();if(!scroller)return 0;const items=getItems();const len=items.length;if(!len)return 0;const x=scroller.scrollLeft;let best=0;let bestDiff=Infinity;for(let i=0;i<len;i++){const px=posForIndex(i);const d=Math.abs(px-x);if(d<bestDiff){bestDiff=d;best=i;}}return best;};const scrollToIndex=i=>{const scroller=root();const items=getItems();if(!scroller||!items.length)return;const len=items.length;const idx=(i%len+len)%len// wrap\n;const x=posForIndex(idx);scroller.scrollTo({left:x,behavior:\"smooth\"});};const next=()=>{const s=root();if(!s)return;const len=getItems().length;if(!len)return;const curr=getClosestIndex();if(curr===len-1&&!near(s.scrollLeft,getMaxScrollLeft())){s.scrollTo({left:getMaxScrollLeft(),behavior:\"smooth\"});return;}scrollToIndex(curr+1);};const prev=()=>{const s=root();if(!s)return;const len=getItems().length;if(!len)return;const curr=getClosestIndex();if(curr===0&&!near(s.scrollLeft,0)){s.scrollTo({left:0,behavior:\"smooth\"});return;}scrollToIndex(curr-1);};// --- hover state (voor kleur/border wissels) ---\nconst[hoverL,setHoverL]=React.useState(false);const[hoverR,setHoverR]=React.useState(false);// --- icon renderer (supports svg recolor via mask) ---\nconst renderIcon=hover=>{const px=iconSize??Math.round(size*.55);if(iconFile&&iconFile.trim()!==\"\"){const lower=iconFile.toLowerCase();const isSvg=lower.endsWith(\".svg\");if(isSvg){// Recolor via CSS mask\nconst color=hover?iconHoverColor:iconColor;const maskStyle={width:px,height:px,background:color,WebkitMaskImage:`url(${iconFile})`,WebkitMaskRepeat:\"no-repeat\",WebkitMaskPosition:\"center\",WebkitMaskSize:\"contain\",maskImage:`url(${iconFile})`,maskRepeat:\"no-repeat\",maskPosition:\"center\",maskSize:\"contain\"};return /*#__PURE__*/_jsx(\"div\",{style:maskStyle});}// Raster: geen kleur-wissel, wel schaal\nreturn /*#__PURE__*/_jsx(\"img\",{src:iconFile,alt:\"\",style:{width:px,height:px,objectFit:\"contain\"}});}// Fallback: ingebouwde chevron (svg -> fill wijzigbaar)\nreturn /*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:px,height:px,style:{fill:hover?iconHoverColor:iconColor},children:/*#__PURE__*/_jsx(\"path\",{d:\"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z\"})});};const baseBtn={position:\"absolute\",bottom,width:size,height:size,borderRadius:radius,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",userSelect:\"none\",transition:\"background .2s ease, border-color .2s ease\",background:bg,border:`${borderWidth}px solid ${borderColor}`,boxShadow:shadow?\"0 8px 24px rgba(0,0,0,.16)\":\"none\",zIndex};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:prev,onMouseEnter:()=>setHoverL(true),onMouseLeave:()=>setHoverL(false),style:{...baseBtn,left,background:hoverL?hoverBg:bg,borderColor:hoverL?hoverBorderColor:borderColor},\"aria-label\":\"Custom Previous\",children:/*#__PURE__*/_jsx(\"div\",{style:{transform:\"scaleX(-1)\"},children:renderIcon(hoverL)})}),/*#__PURE__*/_jsx(\"button\",{onClick:next,onMouseEnter:()=>setHoverR(true),onMouseLeave:()=>setHoverR(false),style:{...baseBtn,right,background:hoverR?hoverBg:bg,borderColor:hoverR?hoverBorderColor:borderColor},\"aria-label\":\"Custom Next\",children:renderIcon(hoverR)})]});}addPropertyControls(CarouselArrowsForId,{targetId:{type:ControlType.String,title:\"Carousel ID\",defaultValue:\"canvasCarousel\"},bottom:{type:ControlType.Number,defaultValue:20,min:-400,max:400},left:{type:ControlType.Number,defaultValue:20,min:-400,max:400},right:{type:ControlType.Number,defaultValue:20,min:-400,max:400},zIndex:{type:ControlType.Number,title:\"z-index\",defaultValue:10,min:0,max:9999},size:{type:ControlType.Number,title:\"Button size\",defaultValue:44,min:24,max:120},radius:{type:ControlType.Number,defaultValue:999,min:0,max:999},bg:{type:ControlType.Color,title:\"Bg\",defaultValue:\"#FFFFFF\"},hoverBg:{type:ControlType.Color,title:\"Hover Bg\",defaultValue:\"#E04B3C\"},shadow:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:true},borderWidth:{type:ControlType.Number,title:\"Border width\",defaultValue:0,min:0,max:8},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"transparent\"},hoverBorderColor:{type:ControlType.Color,title:\"Hover border\",defaultValue:\"transparent\"},iconFile:{type:ControlType.Image,title:\"Icon (opt.)\"},iconSize:{type:ControlType.Number,title:\"Icon size (px)\",defaultValue:24,min:8,max:96},iconColor:{type:ControlType.Color,title:\"Icon color\",defaultValue:\"#605E58\"},iconHoverColor:{type:ControlType.Color,title:\"Icon hover\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\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