{"version":3,"file":"WebStories.DVF02LTM.mjs","names":["p"],"sources":["https:/framerusercontent.com/modules/GjoWt08bq93T4uOyNBqf/nPHjDPidFnakC74AFDaZ/WebStories.js"],"sourcesContent":["// Componente de Web Stories similar ao Google Web Stories\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer,RenderTarget}from\"framer\";const defaultStories=[{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Story 1\"},title:\"Story 1\",description:\"Descri\\xe7\\xe3o da primeira hist\\xf3ria.\"},{image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Story 2\"},title:\"Story 2\",description:\"Descri\\xe7\\xe3o da segunda hist\\xf3ria.\"},{image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Story 3\"},title:\"Story 3\",description:\"Descri\\xe7\\xe3o da terceira hist\\xf3ria.\"}];/**\n * Web Stories (Google-like)\n *\n * @framerIntrinsicWidth 360\n * @framerIntrinsicHeight 640\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function WebStories(props){const{children=[],duration,borderRadius,style}=props;// Garantir array\nconst stories=Array.isArray(children)?children:[children];const storiesCount=stories.length;const[current,setCurrent]=useState(0);const[progress,setProgress]=useState(0);const timerRef=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||RenderTarget.current()===RenderTarget.thumbnail)return;setProgress(0);if(timerRef.current)clearInterval(timerRef.current);timerRef.current=setInterval(()=>{startTransition(()=>setProgress(p=>p+100/(duration*10)));},100);return()=>clearInterval(timerRef.current);},[current,duration,isStatic]);useEffect(()=>{if(progress>=100){if(current<storiesCount-1){startTransition(()=>{setCurrent(current+1);setProgress(0);});}else{startTransition(()=>setProgress(100));}}},[progress,current,storiesCount]);function goTo(idx){if(idx<0||idx>=storiesCount)return;startTransition(()=>{setCurrent(idx);setProgress(0);});}function handleNext(){if(current<storiesCount-1)goTo(current+1);}function handlePrev(){if(current>0)goTo(current-1);}return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:\"100%\",height:\"100%\",background:\"transparent\",borderRadius,overflow:\"hidden\",position:\"relative\",display:\"flex\",flexDirection:\"column\",userSelect:\"none\"},tabIndex:0,\"aria-label\":\"Web Stories\",role:\"region\",onClick:e=>{const x=e.nativeEvent.offsetX;const w=e.currentTarget.offsetWidth;if(x<w/2)handlePrev();else handleNext();},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",gap:4,position:\"absolute\",top:12,left:12,right:12,zIndex:2},children:stories.map((_,i)=>/*#__PURE__*/_jsx(\"div\",{style:{flex:1,height:4,background:\"rgba(255,255,255,0.3)\",borderRadius:2,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:i<current?\"100%\":i===current?`${progress}%`:\"0%\",height:\"100%\",background:\"#fff\",transition:i===current?\"width 0.1s linear\":\"none\"}})},i))}),/*#__PURE__*/_jsx(\"div\",{style:{flex:1,width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\"},children:stories[current]})]});}addPropertyControls(WebStories,{children:{type:ControlType.Array,title:\"Stories\",control:{type:ControlType.ComponentInstance},maxCount:10,defaultValue:[]},duration:{type:ControlType.Number,title:\"Dura\\xe7\\xe3o (s)\",defaultValue:5,min:2,max:15,step:1},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:40}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WebStories\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"640\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"360\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\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