{"version":3,"file":"Carousel_01.7BnDx9bZ.mjs","names":["React.useState","React.useMemo","__esmMin","pe","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","ce","addPropertyControls","init_framer_DcGZRLrs","ControlType","InstagramReelCarousel","props","reelCount","reels","activeRealIndex","setActiveRealIndex","activeIndex","setActiveIndex","getEmbedUrl","url","displayReels","changeSlide","normalized","newIndex","goNext","goPrev","styles","itemWidth","cardWidth","gap","realIndex","index","isActive","distance","scale","opacity","sideOpacity","borderRadius","reel","arrowSize","arrowBackground","arrowColor","init_Carousel_01"],"sources":["https:/framerusercontent.com/modules/DxyOauDzH93QeemKpWxO/QohFmveNKN9CbgK7NsLm/Carousel_01.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function InstagramReelCarousel(props){const{reels,cardWidth,gap,borderRadius,sideOpacity,arrowBackground,arrowColor,arrowSize}=props;const reelCount=reels.length;const[activeRealIndex,setActiveRealIndex]=React.useState(0);const[activeIndex,setActiveIndex]=React.useState(reelCount);const getEmbedUrl=url=>{if(!url)return\"\";const cleanUrl=url.split(\"?\")[0].replace(/\\/$/,\"\");return`${cleanUrl}/embed/`;};// Triple reels so left + right reels are always available\nconst displayReels=React.useMemo(()=>{if(!reelCount)return[];return[...reels,...reels,...reels];},[reels,reelCount]);// Keep carousel positioned in the middle copy\nReact.useEffect(()=>{if(reelCount>0){setActiveIndex(reelCount+activeRealIndex);}},[reelCount]);const changeSlide=newIndex=>{if(reelCount<=0)return;const normalized=(newIndex%reelCount+reelCount)%reelCount;// Change active real reel first.\n// Old active iframe is removed immediately.\nsetActiveRealIndex(normalized);setActiveIndex(reelCount+normalized);};const goNext=()=>{changeSlide(activeRealIndex+1);};const goPrev=()=>{changeSlide(activeRealIndex-1);};if(!reelCount){return /*#__PURE__*/_jsx(\"div\",{style:styles.empty,children:\"Add Instagram Reels\"});}const itemWidth=cardWidth+gap;return /*#__PURE__*/_jsxs(\"div\",{style:styles.wrapper,children:[/*#__PURE__*/_jsx(\"div\",{style:styles.viewport,children:/*#__PURE__*/_jsx(\"div\",{style:{...styles.track,gap:`${gap}px`,paddingLeft:`calc(50% - ${cardWidth/2}px)`,paddingRight:`calc(50% - ${cardWidth/2}px)`,transform:`translateX(-${activeIndex*itemWidth}px)`},children:displayReels.map((reel,index)=>{const realIndex=index%reelCount;const isActive=realIndex===activeRealIndex;// Distance from visual center\nlet distance=Math.abs(index-activeIndex);const scale=distance===0?1:distance===1?.88:.78;const opacity=distance===0?1:distance===1?sideOpacity:.3;return /*#__PURE__*/_jsx(\"div\",{onClick:()=>{if(!isActive&&distance<=2){changeSlide(realIndex);}},style:{...styles.card,width:`${cardWidth}px`,borderRadius:`${borderRadius}px`,transform:`scale(${scale})`,opacity,zIndex:isActive?10:1,cursor:isActive?\"default\":\"pointer\",pointerEvents:distance<=2?\"auto\":\"none\"},children:isActive?/*#__PURE__*/_jsx(\"iframe\",{src:getEmbedUrl(reel.url),style:styles.iframe,frameBorder:\"0\",scrolling:\"no\",allow:\"autoplay; clipboard-write; encrypted-media; picture-in-picture\",allowFullScreen:true,title:`Instagram Reel ${realIndex+1}`},`active-${activeRealIndex}`):/* SIDE REEL PREVIEW *//*#__PURE__*/_jsxs(\"div\",{style:styles.sidePreview,children:[/*#__PURE__*/_jsx(\"iframe\",{src:getEmbedUrl(reel.url),style:{...styles.iframe,pointerEvents:\"none\"},frameBorder:\"0\",scrolling:\"no\",tabIndex:\"-1\",title:`Preview ${realIndex+1}`}),/*#__PURE__*/_jsx(\"div\",{style:styles.previewOverlay})]})},`${index}-${reel.url}`);})})}),reelCount>1&&/*#__PURE__*/_jsx(\"button\",{onClick:goPrev,style:{...styles.arrow,left:\"24px\",width:`${arrowSize}px`,height:`${arrowSize}px`,background:arrowBackground,color:arrowColor},\"aria-label\":\"Previous Reel\",children:\"‹\"}),reelCount>1&&/*#__PURE__*/_jsx(\"button\",{onClick:goNext,style:{...styles.arrow,right:\"24px\",width:`${arrowSize}px`,height:`${arrowSize}px`,background:arrowBackground,color:arrowColor},\"aria-label\":\"Next Reel\",children:\"›\"})]});}const styles={wrapper:{width:\"100%\",height:\"100%\",minHeight:\"680px\",position:\"relative\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\"},viewport:{width:\"100%\",overflow:\"visible\",paddingTop:\"70px\",paddingBottom:\"70px\"},track:{display:\"flex\",alignItems:\"center\",willChange:\"transform\",transition:\"transform 0.6s cubic-bezier(.22,.8,.22,1)\"},card:{flexShrink:0,aspectRatio:\"9 / 16\",overflow:\"hidden\",background:\"#eee\",position:\"relative\",transformOrigin:\"center center\",transition:\"transform 0.6s cubic-bezier(.22,.8,.22,1), opacity 0.45s ease\",boxShadow:\"0 20px 50px rgba(0,0,0,0.14)\"},iframe:{width:\"100%\",height:\"100%\",border:\"none\",display:\"block\",background:\"#fff\"},sidePreview:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},previewOverlay:{position:\"absolute\",inset:0,background:\"rgba(255,255,255,0.12)\",pointerEvents:\"none\"},arrow:{position:\"absolute\",top:\"50%\",transform:\"translateY(-50%)\",borderRadius:\"50%\",border:\"none\",fontSize:\"34px\",lineHeight:\"1\",cursor:\"pointer\",zIndex:50,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 5px 20px rgba(0,0,0,0.12)\"},empty:{width:\"100%\",height:\"100%\",minHeight:\"400px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#777\",fontSize:\"16px\",background:\"#f5f5f5\"}};addPropertyControls(InstagramReelCarousel,{reels:{type:ControlType.Array,title:\"Reels\",control:{type:ControlType.Object,controls:{url:{type:ControlType.String,title:\"Reel URL\",placeholder:\"https://www.instagram.com/reel/...\"}}},defaultValue:[{url:\"\"},{url:\"\"},{url:\"\"}]},cardWidth:{type:ControlType.Number,title:\"Card Width\",defaultValue:270,min:180,max:400,step:10},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:28,min:0,max:100,step:4},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:20,min:0,max:60,step:2},sideOpacity:{type:ControlType.Number,title:\"Side Opacity\",defaultValue:.55,min:.1,max:1,step:.05},arrowBackground:{type:ControlType.Color,title:\"Arrow BG\",defaultValue:\"#FFFFFF\"},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#222222\"},arrowSize:{type:ControlType.Number,title:\"Arrow Size\",defaultValue:48,min:32,max:80,step:2}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InstagramReelCarousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carousel_01.map"],"mappings":"A,+LAAyI,SAAwBa,EAAsB,EAAM,CAAC,GAAK,CAAC,QAAM,YAAU,MAAI,eAAa,cAAY,kBAAgB,aAAW,aAAWC,EAAYC,EAAUC,EAAM,OAAY,CAACC,EAAgBC,GAAoBlB,EAAe,CAAC,EAAO,CAACmB,EAAYC,GAAgBpB,EAAee,CAAS,EAAQM,EAAY,GAAUC,EAAsE,GAA1CA,EAAI,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,QAAQ,MAAM,EAAoB,EAAE,SAAxE,GACldC,EAAatB,MAAuBc,EAAyB,CAAC,GAAGC,EAAM,GAAGA,EAAM,GAAGA,CAAK,EAApC,CAAC,EAAuC,CAACA,EAAMD,CAAS,CAAC,EACnHN,MAAoB,CAAIM,EAAU,GAAGK,EAAeL,EAAUE,CAAe,CAAG,EAAE,CAACF,CAAS,CAAC,EAAE,IAAMS,EAAY,GAAU,CAAC,GAAGT,GAAW,EAAE,OAAO,IAAMU,GAAYC,EAASX,EAAUA,GAAWA,EAEnMG,EAAmBO,CAAU,EAAEL,EAAeL,EAAUU,CAAU,CAAE,EAAQE,MAAW,CAACH,EAAYP,EAAgB,CAAC,CAAE,EAAQW,MAAW,CAAC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