{"version":3,"file":"TestimonialStackCarousel.D2eJyNrR.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/bBkSUAhS7jCKURN5KrLl/ncXx4LZ1fhVeiBhma3yT/TestimonialStackCarousel.js"],"sourcesContent":["// TESTIMONIAL STACK CAROUSEL - Pure Background Image Version\n// @ts-nocheck\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function TestimonialStackCarousel(props){const{testimonials,cardStyle,layout3D,autoPlay,autoPlayInterval,typography,showArrows,arrowColor,arrowBgColor}=props;const[activeIndex,setActiveIndex]=useState(0);const[isDragging,setIsDragging]=useState(false);const[isMobile,setIsMobile]=useState(false);const dragStartX=useRef(0);const timerRef=useRef(null);const containerRef=useRef(null);const nextSlide=()=>{startTransition(()=>{setActiveIndex(prev=>(prev+1)%(testimonials.length||1));});};const prevSlide=()=>{startTransition(()=>{setActiveIndex(prev=>(prev-1+(testimonials.length||1))%(testimonials.length||1));});};useEffect(()=>{const checkMobile=()=>{if(typeof window!==\"undefined\"){startTransition(()=>{setIsMobile(window.innerWidth<768);});}};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);useEffect(()=>{if(autoPlay&&!isDragging&&testimonials.length>0){timerRef.current=window.setInterval(nextSlide,autoPlayInterval);}return()=>{if(timerRef.current)clearInterval(timerRef.current);};},[autoPlay,autoPlayInterval,isDragging,testimonials.length]);const handlePointerDown=e=>{dragStartX.current=e.clientX;startTransition(()=>setIsDragging(true));};const handlePointerUp=e=>{if(!isDragging)return;const diff=e.clientX-dragStartX.current;if(Math.abs(diff)>50){if(diff>0)prevSlide();else nextSlide();}startTransition(()=>setIsDragging(false));};const getSlideStyle=index=>{const total=testimonials.length;if(total===0)return{};let relPos=index-activeIndex;if(relPos>total/2)relPos-=total;if(relPos<-total/2)relPos+=total;const absPos=Math.abs(relPos);const isActive=relPos===0;const containerWidth=containerRef.current?.offsetWidth||800;const containerHeight=containerRef.current?.offsetHeight||600;const mobileScale=isMobile?.85:1;const responsiveWidth=Math.min(cardStyle.slideWidth*mobileScale,containerWidth*.9);const responsiveHeight=Math.min(cardStyle.slideHeight*mobileScale,containerHeight*.8);const responsiveSpread=isMobile?layout3D.spread/1200*containerWidth*.5:layout3D.spread/1200*containerWidth;const xOffset=relPos*responsiveSpread;const zOffset=absPos*-(isMobile?layout3D.depth*.5:layout3D.depth);const yRotation=relPos*-(isMobile?layout3D.rotation*.5:layout3D.rotation);const scale=1-absPos*(isMobile?.2:.15);const opacity=Math.max(0,1-absPos*.4);return{position:\"absolute\",width:responsiveWidth,height:responsiveHeight,left:\"50%\",top:\"50%\",transform:`translate3d(calc(-50% + ${xOffset}px), -50%, ${zOffset}px) rotateY(${yRotation}deg) scale(${scale})`,zIndex:100-absPos,opacity:opacity,borderRadius:cardStyle.borderRadius,transition:`all ${props.transitionDuration}s cubic-bezier(0.23, 1, 0.32, 1)`,cursor:isActive?\"grab\":\"pointer\",userSelect:\"none\",boxShadow:isActive?\"0 20px 40px rgba(0,0,0,0.15)\":\"0 10px 20px rgba(0,0,0,0.05)\",overflow:\"hidden\",display:\"flex\",flexDirection:\"column\",padding:isMobile?\"24px\":\"40px\"};};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"visible\",perspective:\"1200px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},onPointerDown:handlePointerDown,onPointerUp:handlePointerUp,children:[showArrows&&testimonials.length>1&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:e=>{e.stopPropagation();prevSlide();},style:{position:\"absolute\",left:16,top:\"50%\",transform:\"translateY(-50%)\",zIndex:200,width:40,height:40,borderRadius:\"50%\",border:\"none\",backgroundColor:arrowBgColor,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 0 0 rgba(0,0,0,0)\",flexShrink:0},children:/*#__PURE__*/_jsx(\"svg\",{width:\"8\",height:\"16\",viewBox:\"0 0 8 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 1L1 8L7 15\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),/*#__PURE__*/_jsx(\"button\",{onClick:e=>{e.stopPropagation();nextSlide();},style:{position:\"absolute\",right:16,top:\"50%\",transform:\"translateY(-50%)\",zIndex:200,width:40,height:40,borderRadius:\"50%\",border:\"none\",backgroundColor:arrowBgColor,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 0 0 rgba(0,0,0,0)\",flexShrink:0},children:/*#__PURE__*/_jsx(\"svg\",{width:\"8\",height:\"16\",viewBox:\"0 0 8 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M1 1L7 8L1 15\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]}),testimonials.map((item,idx)=>/*#__PURE__*/_jsxs(\"div\",{style:getSlideStyle(idx),onClick:()=>idx!==activeIndex&&setActiveIndex(idx),children:[/*#__PURE__*/_jsx(\"img\",{src:item.avatar?.src,alt:item.name,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",zIndex:-1,border:\"none\",outline:\"none\",boxShadow:\"none\"}}),/*#__PURE__*/_jsx(\"div\",{style:{color:typography.quoteColor,...typography.quoteFont,marginBottom:\"20px\"},children:item.quote}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"28px\",marginTop:\"auto\"},children:/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{style:{color:typography.nameColor,...typography.nameFont},children:item.name}),/*#__PURE__*/_jsx(\"div\",{style:{color:typography.positionColor,...typography.positionFont},children:item.position})]})})]},idx))]});}addPropertyControls(TestimonialStackCarousel,{testimonials:{type:ControlType.Array,title:\"Testimonials\",control:{type:ControlType.Object,controls:{name:{type:ControlType.String,defaultValue:\"Alex Morgan\"},quote:{type:ControlType.String,defaultValue:\"Amazing work!\",displayTextArea:true},position:{type:ControlType.String,defaultValue:\"CEO\"},avatar:{type:ControlType.ResponsiveImage,title:\"Background Image\"}}}},cardStyle:{type:ControlType.Object,title:\"Card Style\",controls:{slideWidth:{type:ControlType.Number,defaultValue:500},slideHeight:{type:ControlType.Number,defaultValue:530},borderRadius:{type:ControlType.Number,defaultValue:24},sideCardsBlur:{type:ControlType.Number,defaultValue:4}}},layout3D:{type:ControlType.Object,title:\"3D Layout\",controls:{spread:{type:ControlType.Number,defaultValue:200},depth:{type:ControlType.Number,defaultValue:150},rotation:{type:ControlType.Number,defaultValue:15}}},autoPlay:{type:ControlType.Boolean,defaultValue:true},autoPlayInterval:{type:ControlType.Number,defaultValue:5e3},transitionDuration:{type:ControlType.Number,defaultValue:.8},showArrows:{type:ControlType.Boolean,title:\"Show Arrows\",defaultValue:true},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#111111\"},arrowBgColor:{type:ControlType.Color,title:\"Arrow BG\",defaultValue:\"rgba(255,255,255,0.9)\"},typography:{type:ControlType.Object,title:\"Typography\",controls:{quoteFont:{type:ControlType.Font},quoteColor:{type:ControlType.Color,defaultValue:\"#FFFFFF\"},nameFont:{type:ControlType.Font},nameColor:{type:ControlType.Color,defaultValue:\"#FFFFFF\"},positionFont:{type:ControlType.Font},positionColor:{type:ControlType.Color,defaultValue:\"#CCCCCC\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TestimonialStackCarousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 800\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TestimonialStackCarousel.map"],"mappings":"sNAQG,SAAwB,EAAyB,EAAM,CAAC,GAAK,CAAC,eAAa,YAAU,WAAS,WAAS,mBAAiB,aAAW,aAAW,aAAW,gBAAc,EAAW,CAAC,EAAY,GAAgBA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAWC,EAAO,EAAE,CAAO,EAASA,EAAO,KAAK,CAAO,EAAaA,EAAO,KAAK,CAAO,MAAc,CAAC,MAAoB,CAAC,EAAe,IAAO,EAAK,IAAI,EAAa,QAAQ,GAAG,EAAG,EAAS,MAAc,CAAC,MAAoB,CAAC,EAAe,IAAO,EAAK,GAAG,EAAa,QAAQ,KAAK,EAAa,QAAQ,GAAG,EAAG,EAAG,MAAc,CAAC,IAAM,MAAgB,CAAW,IAAS,QAAa,MAAoB,CAAC,EAAY,EAAO,WAAW,IAAI,EAAG,EAAgE,OAA5D,GAAa,CAAC,EAAO,iBAAiB,SAAS,EAAY,KAAW,EAAO,oBAAoB,SAAS,EAAY,EAAG,EAAE,CAAC,CAAC,OAAkB,GAAU,CAAC,GAAY,EAAa,OAAO,IAAG,EAAS,QAAQ,EAAO,YAAY,EAAU,EAAiB,MAAY,CAAI,EAAS,SAAQ,cAAc,EAAS,QAAQ,GAAK,CAAC,EAAS,EAAiB,EAAW,EAAa,OAAO,CAAC,CAAC,IAAM,EAAkB,GAAG,CAAC,EAAW,QAAQ,EAAE,QAAQ,MAAoB,EAAc,GAAK,CAAC,EAAS,EAAgB,GAAG,CAA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