{"version":3,"file":"Loop_Comentarios.DHTLSLGE.mjs","names":["React.useRef","React.useState","React.useId","c"],"sources":["https:/framerusercontent.com/modules/I45s4OUsry35o1CLP1Wx/Mo5Tq7M42Ex5z9dMXjwR/Loop_Comentarios.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * LOOP COMENTARIOS\n * Faixa horizontal de prints/depoimentos em loop infinito, sem inicio nem fim.\n * O truque: a lista e repetida N vezes e o trilho anda exatamente a distancia\n * de UM ciclo (soma das larguras + gaps). Quando a animacao reinicia, o frame\n * seguinte e visualmente identico, entao nao existe salto.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 200\n */export default function LoopComentarios(props){const{items,gap,speed,direction,pauseOnHover,fadeEdges,fadeSize,cardRadius,shadow,borderWidth,borderColor,style}=props;const containerRef=React.useRef(null);const[containerW,setContainerW]=React.useState(1200);React.useEffect(()=>{const el=containerRef.current;if(!el||typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(entries=>{for(const entry of entries){const w=entry.contentRect.width;if(w>0)setContainerW(w);}});ro.observe(el);return()=>ro.disconnect();},[]);const list=(items||[]).map(it=>resolveItem(it)).filter(it=>it&&it.src);const n=list.length;const rawId=React.useId?React.useId():\"loop\";const uid=rawId.replace(/[^a-zA-Z0-9]/g,\"\");if(n===0){return /*#__PURE__*/_jsx(\"div\",{style:{...style,...emptyStyle},children:'Adicione os prints em \"Coment\\xe1rios\", no painel da direita.'});}// distancia de um ciclo completo: largura de todos os cards + um gap por card\nconst cycle=list.reduce((acc,it)=>acc+it.width+gap,0);// quantas copias sao necessarias para nunca deixar buraco na tela\nconst copies=Math.max(2,Math.ceil(containerW/cycle)+1);const duration=Math.max(4,cycle/Math.max(speed,5));const mask=fadeEdges?`linear-gradient(90deg, transparent 0%, #000 ${fadeSize}%, #000 ${100-fadeSize}%, transparent 100%)`:undefined;const cards=[];for(let c=0;c<copies;c++){for(let i=0;i<n;i++){const it=list[i];cards.push(/*#__PURE__*/_jsx(\"div\",{style:{flex:\"0 0 auto\",width:it.width,borderRadius:cardRadius,overflow:\"hidden\",border:borderWidth?`${borderWidth}px solid ${borderColor}`:\"none\",boxShadow:shadow?\"0 12px 32px rgba(40, 12, 70, 0.10)\":\"none\",lineHeight:0},\"aria-hidden\":c>0?\"true\":undefined,children:/*#__PURE__*/_jsx(\"img\",{src:it.src,srcSet:it.srcSet,alt:it.alt||\"\",draggable:false,loading:c===0?\"eager\":\"lazy\",style:{width:\"100%\",height:\"auto\",display:\"block\",userSelect:\"none\",pointerEvents:\"none\"}})},`${c}-${i}`));}}return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,className:`loopRoot${uid}`,style:{width:\"100%\",...style,position:\"relative\",overflow:\"hidden\",WebkitMaskImage:mask,maskImage:mask},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes loopL${uid} {\n                    from { transform: translate3d(0, 0, 0) }\n                    to   { transform: translate3d(-${cycle}px, 0, 0) }\n                }\n                @keyframes loopR${uid} {\n                    from { transform: translate3d(-${cycle}px, 0, 0) }\n                    to   { transform: translate3d(0, 0, 0) }\n                }\n                .loopRoot${uid}:hover .loopTrack${uid} {\n                    animation-play-state: ${pauseOnHover?\"paused\":\"running\"};\n                }\n                @media (prefers-reduced-motion: reduce) {\n                    .loopTrack${uid} { animation: none !important; }\n                }\n            `}),/*#__PURE__*/_jsx(\"div\",{className:`loopTrack${uid}`,style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",gap:gap,width:\"max-content\",animation:`${direction===\"right\"?`loopR${uid}`:`loopL${uid}`} ${duration}s linear infinite`,willChange:\"transform\"},children:cards})]});}// aceita {image: url | {src, srcSet}, width, alt}\nfunction resolveItem(entry){if(!entry)return null;const raw=typeof entry===\"string\"?entry:entry.image??entry;const parsedWidth=typeof entry===\"object\"?Number(entry.width):Number.NaN;const width=parsedWidth>0?parsedWidth:420;const alt=typeof entry===\"object\"&&entry.alt||\"\";if(!raw)return null;if(typeof raw===\"string\")return{src:raw,srcSet:undefined,width,alt};return{src:raw.src||raw.url||\"\",srcSet:raw.srcSet,width,alt:alt||raw.alt||\"\"};}const emptyStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"center\",minHeight:140,borderRadius:12,border:\"1px dashed rgba(90, 40, 140, 0.35)\",color:\"rgba(90, 40, 140, 0.7)\",fontFamily:\"Inter, sans-serif\",fontSize:14,textAlign:\"center\"};LoopComentarios.defaultProps={items:[{image:\"https://framerusercontent.com/images/qwVMkAj2bH06bYEqELo9DE2i1U.jpg\",width:423,alt:\"Depoimento de aluno aprovado\"},{image:\"https://framerusercontent.com/images/fDm632enMhbE4A8h90zgMn88E.jpg\",width:316,alt:\"Depoimento de aluno aprovado\"},{image:\"https://framerusercontent.com/images/cNKfgU4XZiAHJIrvm95wcgswJA.jpg\",width:338,alt:\"Depoimento de aluno aprovado\"},{image:\"https://framerusercontent.com/images/8LOwhUvl9rKBrpOkUJsrd6Yat60.jpg\",width:563,alt:\"Depoimento de aluno aprovado\"},{image:\"https://framerusercontent.com/images/f3HJg7yBC2wiUxniBqbDapqH8I.jpg\",width:580,alt:\"Depoimento de aluno aprovado\"},{image:\"https://framerusercontent.com/images/jWHNl4SjXEjDDuoQ4WpIZ8akLnY.png\",width:580,alt:\"Depoimento de aluno aprovado\"}],gap:40,speed:60,direction:\"left\",pauseOnHover:true,fadeEdges:true,fadeSize:8,cardRadius:24,shadow:false,borderWidth:0,borderColor:\"rgba(90, 40, 140, 0.12)\"};addPropertyControls(LoopComentarios,{items:{type:ControlType.Array,title:\"Coment\\xe1rios\",control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Print\"},width:{type:ControlType.Number,title:\"Largura\",min:80,max:1200,step:1,unit:\"px\",defaultValue:420},alt:{type:ControlType.String,title:\"Alt\",defaultValue:\"\"}}}},gap:{type:ControlType.Number,title:\"Dist\\xe2ncia\",min:0,max:200,step:2,unit:\"px\"},speed:{type:ControlType.Number,title:\"Velocidade\",min:5,max:300,step:5,unit:\"px/s\"},direction:{type:ControlType.Enum,title:\"Dire\\xe7\\xe3o\",options:[\"left\",\"right\"],optionTitles:[\"Esquerda\",\"Direita\"],displaySegmentedControl:true},pauseOnHover:{type:ControlType.Boolean,title:\"Pausar hover\"},fadeEdges:{type:ControlType.Boolean,title:\"Fade laterais\"},fadeSize:{type:ControlType.Number,title:\"Tam. fade\",min:2,max:25,step:1,unit:\"%\",hidden:p=>!p.fadeEdges},cardRadius:{type:ControlType.Number,title:\"Raio card\",min:0,max:60,step:1,unit:\"px\"},shadow:{type:ControlType.Boolean,title:\"Sombra\"},borderWidth:{type:ControlType.Number,title:\"Borda\",min:0,max:6,step:1,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Cor borda\",hidden:p=>!p.borderWidth}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopComentarios\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1200\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loop_Comentarios.map"],"mappings":"sMAWG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,MAAI,QAAM,YAAU,eAAa,YAAU,WAAS,aAAW,SAAO,cAAY,cAAY,SAAO,EAAY,EAAaA,EAAa,IAAI,EAAO,CAAC,EAAW,GAAeC,EAAe,IAAI,EAAE,MAAoB,CAAC,IAAM,EAAG,EAAa,QAAQ,GAAG,CAAC,GAAI,OAAO,eAAiB,IAAY,OAAO,IAAM,EAAG,IAAI,eAAe,GAAS,CAAC,IAAI,IAAM,KAAS,EAAQ,CAAC,IAAM,EAAE,EAAM,YAAY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