react-instagram-stories 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +907 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use strict';var E=require('react'),reactRouterDom=require('react-router-dom'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var E__default=/*#__PURE__*/_interopDefault(E);var ne=E.memo(({avatarUrl:e,username:r,hasUnreadStories:o=false,onClick:n})=>{let[l,i]=E.useState(false),[a,c]=E.useState(false);return jsxRuntime.jsxs("button",{className:`story-avatar ${o?"story-avatar-unread":"story-avatar-read"}`,onClick:n,"aria-label":`View ${r}'s story`,children:[jsxRuntime.jsx("div",{className:"story-avatar-ring",children:jsxRuntime.jsx("div",{className:"story-avatar-image-wrapper",children:a?jsxRuntime.jsx("div",{className:"story-avatar-placeholder",children:r.charAt(0).toUpperCase()}):jsxRuntime.jsx("img",{src:e,alt:r,className:`story-avatar-image ${l?"story-avatar-image-loaded":""}`,loading:"lazy",onLoad:()=>i(true),onError:()=>c(true)})})}),jsxRuntime.jsx("span",{className:"story-avatar-username",children:r})]})});ne.displayName="Avatar";var q=90,xe=3,se=E.memo(({users:e,onAvatarClick:r})=>{let o=E.useRef(null),[n,l]=E.useState(0),[i,a]=E.useState(0),c=E.useCallback(()=>{o.current&&l(o.current.scrollLeft);},[]);E.useEffect(()=>{let u=()=>{o.current&&a(o.current.clientWidth);};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u);}},[]);let{startIndex:t,endIndex:m}=E__default.default.useMemo(()=>{let u=Math.floor(n/q),g=Math.ceil(i/q);return {startIndex:Math.max(0,u-xe),endIndex:Math.min(e.length,u+g+xe)}},[n,i,e.length]),d=e.length*q,s=e.slice(t,m).map((u,g)=>({user:u,index:t+g}));return jsxRuntime.jsx("div",{ref:o,className:"story-avatar-list",onScroll:c,role:"list","aria-label":"Stories",children:jsxRuntime.jsx("div",{className:"story-avatar-list-inner",style:{width:`${d}px`,position:"relative"},children:s.map(({user:u,index:g})=>jsxRuntime.jsx("div",{className:"story-avatar-item",style:{position:"absolute",left:`${g*q}px`,width:`${q}px`},role:"listitem",children:jsxRuntime.jsx(ne,{avatarUrl:u.avatarUrl,username:u.username,hasUnreadStories:u.hasUnreadStories,onClick:()=>r(g)})},u.id))})})});se.displayName="AvatarList";var we=({duration:e,onComplete:r,autoStart:o=true})=>{let[n,l]=E.useState(0),[i,a]=E.useState(!o),[c,t]=E.useState(e),m=E.useRef(null),d=E.useRef(0),s=E.useRef(null),u=E.useRef(),g=E.useCallback(()=>{if(!m.current||i)return;let _=Date.now()-m.current+d.current,T=Math.min(_/c,1);if(l(T),T>=1){r?.();return}s.current=requestAnimationFrame(u.current);},[c,i,r]);u.current=g;let f=E.useCallback(()=>{i||(m.current&&(d.current+=Date.now()-m.current),a(true),s.current&&(cancelAnimationFrame(s.current),s.current=null));},[i]),v=E.useCallback(()=>{i&&(m.current=Date.now(),a(false));},[i]),S=E.useCallback(()=>{s.current&&(cancelAnimationFrame(s.current),s.current=null),m.current=Date.now(),d.current=0,l(0),a(false),s.current=requestAnimationFrame(u.current);},[]),R=E.useCallback(_=>{t(_);},[]);return E.useEffect(()=>(i||(m.current=Date.now(),s.current=requestAnimationFrame(u.current)),()=>{s.current&&cancelAnimationFrame(s.current);}),[i]),E.useEffect(()=>()=>{s.current&&cancelAnimationFrame(s.current);},[]),{progress:n,isPaused:i,pause:f,resume:v,reset:S,setDuration:R}};var Ie=({onLeft:e,onRight:r,onSpace:o,onEscape:n,enabled:l=true})=>{E.useEffect(()=>{if(!l)return;let i=a=>{switch(a.key){case "ArrowLeft":a.preventDefault(),e?.();break;case "ArrowRight":a.preventDefault(),r?.();break;case " ":a.preventDefault(),o?.();break;case "Escape":a.preventDefault(),n?.();break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i);}},[e,r,o,n,l]);};var Fe=e=>{let r=E.useRef(null),o=E.useRef(null);return E.useEffect(()=>{if(!e||!r.current)return;o.current=document.activeElement;let n=r.current,l=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),i=l[0],a=l[l.length-1];i?.focus();let c=t=>{t.key==="Tab"&&(t.shiftKey?document.activeElement===i&&(t.preventDefault(),a?.focus()):document.activeElement===a&&(t.preventDefault(),i?.focus()));};return n.addEventListener("keydown",c),()=>{n.removeEventListener("keydown",c),o.current?.focus();}},[e]),r};var Ee=()=>{let[e,r]=E.useState(!document.hidden);return E.useEffect(()=>{let o=()=>{r(!document.hidden);};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o);}},[]),e};var ke=()=>{let e=E.useRef({}),r=E.useRef(new Set),o=E.useCallback(t=>new Promise((m,d)=>{if(e.current[t]){m();return}if(r.current.has(t)){let u=setInterval(()=>{(e.current[t]||!r.current.has(t))&&(clearInterval(u),m());},100);return}r.current.add(t);let s=new Image;s.onload=()=>{e.current[t]=true,r.current.delete(t),m();},s.onerror=()=>{r.current.delete(t),d(new Error(`Failed to load image: ${t}`));},s.src=t;}),[]),n=E.useCallback(t=>new Promise((m,d)=>{if(e.current[t]){m();return}if(r.current.has(t)){let v=setInterval(()=>{(e.current[t]||!r.current.has(t))&&(clearInterval(v),m());},100);return}r.current.add(t);let s=document.createElement("video");s.preload="auto";let u=()=>{e.current[t]=true,r.current.delete(t),f(),m();},g=()=>{r.current.delete(t),f(),d(new Error(`Failed to load video: ${t}`));},f=()=>{s.removeEventListener("canplaythrough",u),s.removeEventListener("error",g),s.src="";};s.addEventListener("canplaythrough",u),s.addEventListener("error",g),s.src=t,s.load();}),[]),l=E.useCallback(async t=>{try{t.type==="image"&&"src"in t?await o(t.src):t.type==="video"&&"src"in t&&await n(t.src);}catch(m){console.warn("Failed to preload story item:",m);}},[o,n]),i=E.useCallback(async t=>{let d=[];for(let s=0;s<t.length;s+=3)d.push(t.slice(s,s+3));for(let s of d)await Promise.allSettled(s.map(l));},[l]),a=E.useCallback(t=>e.current[t]||false,[]),c=E.useCallback(()=>{e.current={},r.current.clear();},[]);return E.useEffect(()=>()=>{c();},[c]),{preloadImage:o,preloadVideo:n,preloadStoryItem:l,preloadMultiple:i,isPreloaded:a,clearCache:c}};var ie=E.memo(({progress:e,isActive:r})=>{let o=Math.round(e*100);return jsxRuntime.jsx("div",{className:"story-progress-bar",role:"progressbar","aria-valuenow":r?o:e===1?100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Story progress: ${o}%`,children:jsxRuntime.jsx("div",{className:"story-progress-bar-fill",style:{transform:`scaleX(${r?e:e===1?1:0})`}})})});ie.displayName="ProgressBar";var le=E.memo(({total:e,currentIndex:r,progress:o})=>jsxRuntime.jsx("div",{className:"story-progress-bars-container",children:Array.from({length:e}).map((n,l)=>jsxRuntime.jsx(ie,{progress:l<r?1:l===r?o:0,isActive:l===r},l))}));le.displayName="StoryProgressBars";var ce=E.memo(({item:e,isActive:r,isPaused:o,onDurationDetected:n,onLoadError:l,onBufferingChange:i,controls:a})=>{let c=E.useRef(null),[t,m]=E.useState(false),[d,s]=E.useState(true);E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current;(async()=>{try{o?f.pause():await f.play();}catch(S){console.warn("Video play failed:",S);}})();},[e.type,r,o]),E.useEffect(()=>{if(e.type!=="video"||!c.current)return;let f=c.current,v=()=>{f.duration&&isFinite(f.duration)&&n?.(f.duration*1e3);},S=()=>{s(false);};return f.addEventListener("loadedmetadata",v),f.addEventListener("canplay",S),f.readyState>=1&&v(),f.readyState>=3&&S(),()=>{f.removeEventListener("loadedmetadata",v),f.removeEventListener("canplay",S);}},[e.type,n]),E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current,v=()=>{i?.(true);},S=()=>{i?.(false);},R=()=>{i?.(true);};return f.addEventListener("waiting",v),f.addEventListener("playing",S),f.addEventListener("stalled",R),()=>{f.removeEventListener("waiting",v),f.removeEventListener("playing",S),f.removeEventListener("stalled",R);}},[e.type,r,i]),E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current,v,S=()=>{f.duration&&isFinite(f.duration),v=requestAnimationFrame(S);};return v=requestAnimationFrame(S),()=>{cancelAnimationFrame(v);}},[e.type,r]);let u=E.useCallback(()=>{m(true),s(false),l?.();},[l]),g=E.useCallback(()=>{s(false);},[]);if(t)return jsxRuntime.jsx("div",{className:"story-item story-item-error",children:jsxRuntime.jsx("div",{className:"story-item-error-message",children:"Failed to load content"})});switch(e.type){case "image":return jsxRuntime.jsxs("div",{className:"story-item story-item-image",children:[d&&jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}),jsxRuntime.jsx("img",{src:e.src,alt:e.alt||"Story image",onError:u,onLoad:g,draggable:false,style:{opacity:d?0:1}})]});case "video":return jsxRuntime.jsxs("div",{className:"story-item story-item-video",children:[d&&jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}),jsxRuntime.jsx("video",{ref:c,src:e.src,playsInline:true,loop:false,onError:u,preload:"auto",style:{opacity:d?0:1}})]});case "text":return jsxRuntime.jsx("div",{className:"story-item story-item-text",style:{backgroundColor:e.backgroundColor||"#000",color:e.textColor||"#fff"},children:jsxRuntime.jsx("div",{className:"story-item-text-content",children:e.text})});case "custom_component":let f=e.component;return jsxRuntime.jsx("div",{className:"story-item story-item-component",children:jsxRuntime.jsx(f,{...a})});default:return null}});ce.displayName="StoryItem";var A=5e3,De=E__default.default.memo(({users:e,initialUserIndex:r,initialStoryIndex:o,isOpen:n,onClose:l,onStoryChange:i})=>{let[a,c]=E.useState(r),[t,m]=E.useState(o??0),[d,s]=E.useState(false);E.useEffect(()=>{c(r);},[r]),E.useEffect(()=>{m(o??0);},[o]);let[u,g]=E.useState(false),[f,v]=E.useState(null),[S,R]=E.useState(false),[_,T]=E.useState(false),pe=E.useRef(null),me=E.useRef(null),fe=E.useRef(0),ye=E.useRef(A),Z=E.useRef(false),b=e[a],U=b?.stories[t],B=b?.stories.length||0;E.useEffect(()=>{ye.current=U?.duration||A;},[U?.duration]);let _e=Fe(n),ee=Ee(),{preloadStoryItem:te}=ke(),N=E.useCallback(()=>s(true),[]),z=E.useCallback(()=>s(false),[]),ge=E.useRef(),x=we({duration:ye.current||A,onComplete:()=>ge.current?.(),autoStart:false}),He=E.useCallback(y=>{y?x.pause():d||x.resume();},[x,d]);E.useEffect(()=>{let y=U?.duration||A;x.setDuration(y);},[x,U?.duration]);let k=E.useCallback(()=>{if(b)if(t<B-1){let y=t+1,I=b.stories[y]?.duration||A;m(y),x.setDuration(I),x.reset();}else a<e.length-1?(T(true),setTimeout(()=>{g(true),v("left"),setTimeout(()=>{let y=a+1,O=e[y].stories[0]?.duration||A;c(y),m(0),g(false),v(null),T(false),x.setDuration(O),x.reset();},150);},1e3)):l();},[b,t,B,a,e,x,l]),H=E.useCallback(()=>{if(b)if(t>0){let y=t-1,I=b.stories[y]?.duration||A;m(y),x.setDuration(I),x.reset();}else a>0&&(T(true),setTimeout(()=>{g(true),v("right"),setTimeout(()=>{let y=a-1,w=e[y],I=w.stories.length-1,ve=w.stories[I]?.duration||A;c(y),m(I),g(false),v(null),T(false),x.setDuration(ve),x.reset();},150);},1e3));},[b,t,a,e,x]),re=E.useCallback(()=>{window.scrollTo(0,fe.current),l();},[l]);E.useEffect(()=>{ge.current=k;},[k]);let Oe=E.useMemo(()=>({pause:N,resume:z,next:k,prev:H,setDuration:y=>me.current?.setDuration(y)}),[N,z,k,H]),Ke=E.useCallback(y=>{let w=y.target;if(w.closest(".story-viewer-close")||w.closest("button")||w.closest("input")||w.closest("select")||w.closest("textarea"))return;let I=pe.current;if(!I)return;let O=I.getBoundingClientRect();y.clientX-O.left<O.width/2?H():k();},[H,k]),j=E.useRef(null),oe=E.useRef(false),qe=E.useCallback(y=>{oe.current=false,j.current={x:y.clientX,y:y.clientY},N();},[N]),Xe=E.useCallback(y=>{if(!j.current)return;let w=y.clientX-j.current.x,I=y.clientY-j.current.y;(Math.abs(w)>10||Math.abs(I)>10)&&(oe.current=true);},[]);Ie({onLeft:H,onRight:k,onSpace:()=>d?z():N(),onEscape:re,enabled:n}),E.useEffect(()=>{ee?ee&&!d&&z():N();},[ee,N,z,d]),E.useEffect(()=>{if(!n||!b)return;let y=[];t<B-1&&y.push(b.stories[t+1]),t>0&&y.push(b.stories[t-1]),a<e.length-1&&y.push(e[a+1].stories[0]),a>0&&y.push(e[a-1].stories[0]);let w=y.slice(0,3).map(I=>te(I).catch(()=>{}));Promise.all(w);},[n,b,a,t,B,e,te]),E.useEffect(()=>(n&&!Z.current?(Z.current=true,R(true),U&&te(U),setTimeout(()=>{R(false),fe.current=window.scrollY,document.body.style.overflow="hidden",x.resume();},1500)):n||(Z.current=false,document.body.style.overflow="",R(false),T(false)),()=>{document.body.style.overflow="";}),[n,x]),E.useEffect(()=>{i&&n&&i(a,t);},[a,t,i,n]);let Ye=E.useCallback(()=>{console.warn("Story item failed to load, skipping..."),setTimeout(k,500);},[k]);if(!n||!b||!U)return null;let je=jsxRuntime.jsxs("div",{ref:pe,className:"story-viewer",role:"dialog","aria-modal":"true","aria-label":`Stories by ${b?.username||"user"}`,"aria-describedby":"story-viewer-description",children:[jsxRuntime.jsx("div",{className:"story-viewer-overlay",onClick:re}),jsxRuntime.jsx("div",{id:"story-viewer-description",className:"sr-only",children:"Instagram-style stories viewer. Tap left side to go to previous story, right side to go to next story. Swipe left or right to navigate between users. Press Escape to close."}),jsxRuntime.jsxs("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:["Viewing story ",t+1," of ",B," by"," ",b?.username]}),jsxRuntime.jsxs("div",{ref:_e,className:`story-viewer-content ${u?`story-viewer-transitioning story-viewer-transition-${f}`:""}`,onClick:Ke,onPointerDown:qe,onPointerMove:Xe,onMouseEnter:N,onMouseLeave:z,children:[jsxRuntime.jsxs("div",{className:"story-viewer-header",children:[jsxRuntime.jsx(le,{total:B,currentIndex:t,progress:x.progress}),jsxRuntime.jsxs("div",{className:"story-viewer-user-info",children:[jsxRuntime.jsx("img",{src:b.avatarUrl,alt:`${b.username} avatar`,className:"story-viewer-avatar"}),jsxRuntime.jsx("span",{className:"story-viewer-username",children:b.username})]}),jsxRuntime.jsx("button",{className:"story-viewer-close",onClick:re,"aria-label":"Close story viewer",type:"button",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"story-viewer-items",children:S||_?jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}):jsxRuntime.jsx(ce,{item:U,isActive:true,isPaused:d||oe.current,onDurationDetected:y=>me.current?.setDuration(y),onLoadError:Ye,onBufferingChange:He,controls:Oe})}),jsxRuntime.jsxs("div",{className:"story-viewer-nav-hints",children:[jsxRuntime.jsx("div",{className:"story-viewer-nav-hint story-viewer-nav-hint-left"}),jsxRuntime.jsx("div",{className:"story-viewer-nav-hint story-viewer-nav-hint-right"})]})]})]});return reactDom.createPortal(je,document.body)});function Ae(e,r){for(let o=0;o<e.length;o++){let l=e[o].stories.findIndex(i=>i.id===r);if(l!==-1)return {userIndex:o,storyIndex:l}}return null}var Be=({users:e,closeNavigateTo:r="/"})=>{let{storyId:o}=reactRouterDom.useParams(),n=reactRouterDom.useNavigate(),[l,i]=E.useState({isOpen:false,userIndex:0,storyIndex:0}),a=E.useRef(0);E.useEffect(()=>{if(o){let d=Ae(e,o);d&&i({isOpen:true,userIndex:d.userIndex,storyIndex:d.storyIndex});}},[o,e]);let c=E.useCallback(d=>{a.current=window.scrollY,i({isOpen:true,userIndex:d,storyIndex:0});let s=e[d];if(s&&s.stories.length>0){let u=s.stories[0].id;n(`/story/${u}`,{replace:true});}},[e,n]),t=E.useCallback(()=>{i({isOpen:false,userIndex:0,storyIndex:0}),requestAnimationFrame(()=>{window.scrollTo(0,a.current);}),n(r,{replace:true});},[n,r]),m=E.useCallback((d,s)=>{let u=e[d];if(u&&u.stories[s]){let g=u.stories[s].id;n(`/story/${g}`,{replace:true});}},[e,n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(se,{users:e,onAvatarClick:c}),jsxRuntime.jsx(De,{users:e,initialUserIndex:l.userIndex,initialStoryIndex:l.storyIndex,isOpen:l.isOpen,onClose:t,onStoryChange:m})]})};var $e=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(null),[i,a]=E__default.default.useState([42,28,18,12]);E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let c=d=>{l(d);let s=[...i];s[d]+=1,a(s),setTimeout(()=>{r(),o();},2e3);},t=i.reduce((d,s)=>d+s,0);return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"28px",fontWeight:"bold"},children:"Poll"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"18px"},children:"What's your favorite framework?"}),jsxRuntime.jsx("div",{style:{width:"100%"},children:["React","Vue","Angular","Svelte"].map((d,s)=>{let u=Math.round(i[s]/t*100),g=n===s;return jsxRuntime.jsxs("button",{onClick:()=>n===null&&c(s),disabled:n!==null,style:{width:"100%",padding:"16px 20px",margin:"8px 0",border:"none",borderRadius:"12px",background:n!==null?`linear-gradient(90deg, rgba(255,255,255,0.4) ${u}%, rgba(255,255,255,0.15) ${u}%)`:"rgba(255,255,255,0.2)",color:"white",fontSize:"16px",fontWeight:"600",cursor:n===null?"pointer":"default",transition:"all 0.3s ease",display:"flex",justifyContent:"space-between",alignItems:"center",backdropFilter:"blur(10px)"},children:[jsxRuntime.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[g&&"\u2713 ",d]}),n!==null&&jsxRuntime.jsxs("span",{children:[u,"%"]})]},s)})}),n!==null&&jsxRuntime.jsxs("p",{style:{color:"rgba(255,255,255,0.8)",marginTop:"20px",fontSize:"14px"},children:[t," votes \u2022 Thanks for voting!"]})]})},Ve=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(false),[i,a]=E__default.default.useState(null),c=2;E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let t=d=>{a(d),l(true),setTimeout(()=>{r(),o();},2500);};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"20px",animation:"bounce 1s infinite"},children:"\u{1FA90}"}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"24px",fontWeight:"bold",textAlign:"center"},children:"Quiz Time!"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"18px",textAlign:"center"},children:"Which is the largest planet in our solar system?"}),jsxRuntime.jsx("div",{style:{width:"100%"},children:["Mars","Venus","Jupiter","Saturn"].map((d,s)=>{let u=s===c,g=i===s,f="rgba(255,255,255,0.2)";return n&&(u?f="rgba(34, 197, 94, 0.6)":g&&(f="rgba(239, 68, 68, 0.6)")),jsxRuntime.jsxs("button",{onClick:()=>!n&&t(s),disabled:n,style:{width:"100%",padding:"16px 20px",margin:"8px 0",border:"none",borderRadius:"12px",background:f,color:"white",fontSize:"16px",fontWeight:"600",cursor:n?"default":"pointer",transition:"all 0.3s ease",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx("span",{children:d}),n&&u&&jsxRuntime.jsx("span",{children:"\u2713"}),n&&g&&!u&&jsxRuntime.jsx("span",{children:"\u2717"})]},s)})}),n&&jsxRuntime.jsx("p",{style:{color:"white",marginTop:"20px",fontSize:"16px",fontWeight:"bold"},children:i===c?"\u{1F389} Correct!":"\u274C Wrong! Jupiter is the largest."})]})},wt=()=>{let[e,r]=E__default.default.useState({days:12,hours:8,minutes:45,seconds:30});E__default.default.useEffect(()=>{let n=setInterval(()=>{r(l=>{let{days:i,hours:a,minutes:c,seconds:t}=l;return t--,t<0&&(t=59,c--),c<0&&(c=59,a--),a<0&&(a=23,i--),{days:i,hours:a,minutes:c,seconds:t}});},1e3);return ()=>clearInterval(n)},[]);let o=({value:n,label:l})=>jsxRuntime.jsxs("div",{style:{textAlign:"center"},children:[jsxRuntime.jsx("div",{style:{background:"rgba(255,255,255,0.2)",backdropFilter:"blur(10px)",borderRadius:"12px",padding:"15px 20px",minWidth:"70px"},children:jsxRuntime.jsx("div",{style:{fontSize:"32px",fontWeight:"bold",color:"white"},children:String(n).padStart(2,"0")})}),jsxRuntime.jsx("div",{style:{color:"rgba(255,255,255,0.8)",fontSize:"12px",marginTop:"8px",textTransform:"uppercase"},children:l})]});return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"15px"},children:"\u{1F680}"}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"8px",fontSize:"24px",fontWeight:"bold"},children:"Product Launch"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.7)",marginBottom:"30px",fontSize:"14px"},children:"Something amazing is coming..."}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"30px"},children:[jsxRuntime.jsx(o,{value:e.days,label:"Days"}),jsxRuntime.jsx(o,{value:e.hours,label:"Hours"}),jsxRuntime.jsx(o,{value:e.minutes,label:"Mins"}),jsxRuntime.jsx(o,{value:e.seconds,label:"Secs"})]}),jsxRuntime.jsx("button",{style:{padding:"14px 40px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",borderRadius:"30px",color:"white",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:"Notify Me"})]})},It=()=>jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"linear-gradient(180deg, #1a1a2e 0%, #16213e 100%)",position:"relative",overflow:"hidden"},children:[jsxRuntime.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:jsxRuntime.jsx("img",{src:"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&h=400&fit=crop",alt:"Product",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"20px",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"}})}),jsxRuntime.jsxs("div",{style:{padding:"30px",background:"linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%)"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"},children:[jsxRuntime.jsx("span",{style:{background:"#ef4444",color:"white",padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold"},children:"NEW"}),jsxRuntime.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:"Limited Edition"})]}),jsxRuntime.jsx("h2",{style:{color:"white",fontSize:"24px",fontWeight:"bold",marginBottom:"8px"},children:"Premium Watch Collection"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.7)",fontSize:"14px",marginBottom:"15px"},children:"Elegant design meets modern technology"}),jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[jsxRuntime.jsx("span",{style:{color:"white",fontSize:"28px",fontWeight:"bold"},children:"$299"}),jsxRuntime.jsx("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"18px",textDecoration:"line-through"},children:"$399"})]}),jsxRuntime.jsx("button",{style:{width:"100%",marginTop:"20px",padding:"16px",background:"white",border:"none",borderRadius:"12px",color:"#1a1a2e",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:"Shop Now \u2192"})]})]}),We=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(5),[i,a]=E__default.default.useState(false);E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let c=()=>{a(true),setTimeout(()=>{r(),o();},1500);};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #11998e 0%, #38ef7d 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"80px",marginBottom:"20px",transition:"all 0.3s"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F60A}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F929}","\u{1F973}"][n-1]}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"24px",fontWeight:"bold"},children:"Rate Your Experience"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"16px"},children:"How was your visit today?"}),i?jsxRuntime.jsxs("div",{style:{textAlign:"center"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"10px"},children:"\u{1F389}"}),jsxRuntime.jsx("p",{style:{color:"white",fontSize:"18px",fontWeight:"bold"},children:"Thanks for your feedback!"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{style:{width:"100%",marginBottom:"20px"},children:[jsxRuntime.jsx("input",{type:"range",min:"1",max:"10",value:n,onChange:m=>l(parseInt(m.target.value)),style:{width:"100%",height:"8px",borderRadius:"4px",appearance:"none",background:"rgba(255,255,255,0.3)",cursor:"pointer"}}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",color:"rgba(255,255,255,0.7)",fontSize:"12px",marginTop:"8px"},children:[jsxRuntime.jsx("span",{children:"1"}),jsxRuntime.jsx("span",{children:"10"})]})]}),jsxRuntime.jsxs("button",{onClick:c,style:{padding:"14px 50px",background:"white",border:"none",borderRadius:"30px",color:"#11998e",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:["Submit (",n,"/10)"]})]})]})},Y=["https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4","https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4","https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4"],ze=["https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1426604966848-d7adac402bff?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=1080&h=1920&fit=crop"],W=["https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&h=150&fit=crop"],ue=[{id:"user-travel",username:"Travel",avatarUrl:W[0],hasUnreadStories:true,stories:[{id:"travel-1",type:"image",src:"https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?w=1080&h=1920&fit=crop",duration:5e3,alt:"Beautiful mountain landscape"},{id:"travel-2",type:"image",src:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1080&h=1920&fit=crop",duration:5e3,alt:"Scenic ocean view"},{id:"travel-3",type:"text",text:`Adventure awaits! \u{1F30D}
|
|
1
|
+
'use strict';var E=require('react'),reactRouterDom=require('react-router-dom'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var E__default=/*#__PURE__*/_interopDefault(E);var ae=E.memo(({avatarUrl:e,username:r,hasUnreadStories:o=false,onClick:n})=>{let[l,i]=E.useState(false),[a,c]=E.useState(false);return jsxRuntime.jsxs("button",{className:`story-avatar ${o?"story-avatar-unread":"story-avatar-read"}`,onClick:n,"aria-label":`View ${r}'s story`,children:[jsxRuntime.jsx("div",{className:"story-avatar-ring",children:jsxRuntime.jsx("div",{className:"story-avatar-image-wrapper",children:a?jsxRuntime.jsx("div",{className:"story-avatar-placeholder",children:r.charAt(0).toUpperCase()}):jsxRuntime.jsx("img",{src:e,alt:r,className:`story-avatar-image ${l?"story-avatar-image-loaded":""}`,loading:"lazy",onLoad:()=>i(true),onError:()=>c(true)})})}),jsxRuntime.jsx("span",{className:"story-avatar-username",children:r})]})});ae.displayName="Avatar";var q=90,Se=3,X=E.memo(({users:e,onAvatarClick:r})=>{let o=E.useRef(null),[n,l]=E.useState(0),[i,a]=E.useState(0),c=E.useCallback(()=>{o.current&&l(o.current.scrollLeft);},[]);E.useEffect(()=>{let u=()=>{o.current&&a(o.current.clientWidth);};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u);}},[]);let{startIndex:t,endIndex:m}=E__default.default.useMemo(()=>{let u=Math.floor(n/q),g=Math.ceil(i/q);return {startIndex:Math.max(0,u-Se),endIndex:Math.min(e.length,u+g+Se)}},[n,i,e.length]),d=e.length*q,s=e.slice(t,m).map((u,g)=>({user:u,index:t+g}));return jsxRuntime.jsx("div",{ref:o,className:"story-avatar-list",onScroll:c,role:"list","aria-label":"Stories",children:jsxRuntime.jsx("div",{className:"story-avatar-list-inner",style:{width:`${d}px`,position:"relative"},children:s.map(({user:u,index:g})=>jsxRuntime.jsx("div",{className:"story-avatar-item",style:{position:"absolute",left:`${g*q}px`,width:`${q}px`},role:"listitem",children:jsxRuntime.jsx(ae,{avatarUrl:u.avatarUrl,username:u.username,hasUnreadStories:u.hasUnreadStories,onClick:()=>r(g)})},u.id))})})});X.displayName="AvatarList";var Ie=({duration:e,onComplete:r,autoStart:o=true})=>{let[n,l]=E.useState(0),[i,a]=E.useState(!o),[c,t]=E.useState(e),m=E.useRef(null),d=E.useRef(0),s=E.useRef(null),u=E.useRef(),g=E.useCallback(()=>{if(!m.current||i)return;let _=Date.now()-m.current+d.current,R=Math.min(_/c,1);if(l(R),R>=1){r?.();return}s.current=requestAnimationFrame(u.current);},[c,i,r]);u.current=g;let f=E.useCallback(()=>{i||(m.current&&(d.current+=Date.now()-m.current),a(true),s.current&&(cancelAnimationFrame(s.current),s.current=null));},[i]),v=E.useCallback(()=>{i&&(m.current=Date.now(),a(false));},[i]),S=E.useCallback(()=>{s.current&&(cancelAnimationFrame(s.current),s.current=null),m.current=Date.now(),d.current=0,l(0),a(false),s.current=requestAnimationFrame(u.current);},[]),T=E.useCallback(_=>{t(_);},[]);return E.useEffect(()=>(i||(m.current=Date.now(),s.current=requestAnimationFrame(u.current)),()=>{s.current&&cancelAnimationFrame(s.current);}),[i]),E.useEffect(()=>()=>{s.current&&cancelAnimationFrame(s.current);},[]),{progress:n,isPaused:i,pause:f,resume:v,reset:S,setDuration:T}};var Ce=({onLeft:e,onRight:r,onSpace:o,onEscape:n,enabled:l=true})=>{E.useEffect(()=>{if(!l)return;let i=a=>{switch(a.key){case "ArrowLeft":a.preventDefault(),e?.();break;case "ArrowRight":a.preventDefault(),r?.();break;case " ":a.preventDefault(),o?.();break;case "Escape":a.preventDefault(),n?.();break}};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i);}},[e,r,o,n,l]);};var Ee=e=>{let r=E.useRef(null),o=E.useRef(null);return E.useEffect(()=>{if(!e||!r.current)return;o.current=document.activeElement;let n=r.current,l=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),i=l[0],a=l[l.length-1];i?.focus();let c=t=>{t.key==="Tab"&&(t.shiftKey?document.activeElement===i&&(t.preventDefault(),a?.focus()):document.activeElement===a&&(t.preventDefault(),i?.focus()));};return n.addEventListener("keydown",c),()=>{n.removeEventListener("keydown",c),o.current?.focus();}},[e]),r};var Pe=()=>{let[e,r]=E.useState(!document.hidden);return E.useEffect(()=>{let o=()=>{r(!document.hidden);};return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o);}},[]),e};var Le=()=>{let e=E.useRef({}),r=E.useRef(new Set),o=E.useCallback(t=>new Promise((m,d)=>{if(e.current[t]){m();return}if(r.current.has(t)){let u=setInterval(()=>{(e.current[t]||!r.current.has(t))&&(clearInterval(u),m());},100);return}r.current.add(t);let s=new Image;s.onload=()=>{e.current[t]=true,r.current.delete(t),m();},s.onerror=()=>{r.current.delete(t),d(new Error(`Failed to load image: ${t}`));},s.src=t;}),[]),n=E.useCallback(t=>new Promise((m,d)=>{if(e.current[t]){m();return}if(r.current.has(t)){let v=setInterval(()=>{(e.current[t]||!r.current.has(t))&&(clearInterval(v),m());},100);return}r.current.add(t);let s=document.createElement("video");s.preload="auto";let u=()=>{e.current[t]=true,r.current.delete(t),f(),m();},g=()=>{r.current.delete(t),f(),d(new Error(`Failed to load video: ${t}`));},f=()=>{s.removeEventListener("canplaythrough",u),s.removeEventListener("error",g),s.src="";};s.addEventListener("canplaythrough",u),s.addEventListener("error",g),s.src=t,s.load();}),[]),l=E.useCallback(async t=>{try{t.type==="image"&&"src"in t?await o(t.src):t.type==="video"&&"src"in t&&await n(t.src);}catch(m){console.warn("Failed to preload story item:",m);}},[o,n]),i=E.useCallback(async t=>{let d=[];for(let s=0;s<t.length;s+=3)d.push(t.slice(s,s+3));for(let s of d)await Promise.allSettled(s.map(l));},[l]),a=E.useCallback(t=>e.current[t]||false,[]),c=E.useCallback(()=>{e.current={},r.current.clear();},[]);return E.useEffect(()=>()=>{c();},[c]),{preloadImage:o,preloadVideo:n,preloadStoryItem:l,preloadMultiple:i,isPreloaded:a,clearCache:c}};var le=E.memo(({progress:e,isActive:r})=>{let o=Math.round(e*100);return jsxRuntime.jsx("div",{className:"story-progress-bar",role:"progressbar","aria-valuenow":r?o:e===1?100:0,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Story progress: ${o}%`,children:jsxRuntime.jsx("div",{className:"story-progress-bar-fill",style:{transform:`scaleX(${r?e:e===1?1:0})`}})})});le.displayName="ProgressBar";var ce=E.memo(({total:e,currentIndex:r,progress:o})=>jsxRuntime.jsx("div",{className:"story-progress-bars-container",children:Array.from({length:e}).map((n,l)=>jsxRuntime.jsx(le,{progress:l<r?1:l===r?o:0,isActive:l===r},l))}));ce.displayName="StoryProgressBars";var de=E.memo(({item:e,isActive:r,isPaused:o,onDurationDetected:n,onLoadError:l,onBufferingChange:i,controls:a})=>{let c=E.useRef(null),[t,m]=E.useState(false),[d,s]=E.useState(true);E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current;(async()=>{try{o?f.pause():await f.play();}catch(S){console.warn("Video play failed:",S);}})();},[e.type,r,o]),E.useEffect(()=>{if(e.type!=="video"||!c.current)return;let f=c.current,v=()=>{f.duration&&isFinite(f.duration)&&n?.(f.duration*1e3);},S=()=>{s(false);};return f.addEventListener("loadedmetadata",v),f.addEventListener("canplay",S),f.readyState>=1&&v(),f.readyState>=3&&S(),()=>{f.removeEventListener("loadedmetadata",v),f.removeEventListener("canplay",S);}},[e.type,n]),E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current,v=()=>{i?.(true);},S=()=>{i?.(false);},T=()=>{i?.(true);};return f.addEventListener("waiting",v),f.addEventListener("playing",S),f.addEventListener("stalled",T),()=>{f.removeEventListener("waiting",v),f.removeEventListener("playing",S),f.removeEventListener("stalled",T);}},[e.type,r,i]),E.useEffect(()=>{if(e.type!=="video"||!c.current||!r)return;let f=c.current,v,S=()=>{f.duration&&isFinite(f.duration),v=requestAnimationFrame(S);};return v=requestAnimationFrame(S),()=>{cancelAnimationFrame(v);}},[e.type,r]);let u=E.useCallback(()=>{m(true),s(false),l?.();},[l]),g=E.useCallback(()=>{s(false);},[]);if(t)return jsxRuntime.jsx("div",{className:"story-item story-item-error",children:jsxRuntime.jsx("div",{className:"story-item-error-message",children:"Failed to load content"})});switch(e.type){case "image":return jsxRuntime.jsxs("div",{className:"story-item story-item-image",children:[d&&jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}),jsxRuntime.jsx("img",{src:e.src,alt:e.alt||"Story image",onError:u,onLoad:g,draggable:false,style:{opacity:d?0:1}})]});case "video":return jsxRuntime.jsxs("div",{className:"story-item story-item-video",children:[d&&jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}),jsxRuntime.jsx("video",{ref:c,src:e.src,playsInline:true,loop:false,onError:u,preload:"auto",style:{opacity:d?0:1}})]});case "text":return jsxRuntime.jsx("div",{className:"story-item story-item-text",style:{backgroundColor:e.backgroundColor||"#000",color:e.textColor||"#fff"},children:jsxRuntime.jsx("div",{className:"story-item-text-content",children:e.text})});case "custom_component":let f=e.component;return jsxRuntime.jsx("div",{className:"story-item story-item-component",children:jsxRuntime.jsx(f,{...a})});default:return null}});de.displayName="StoryItem";var A=5e3,ee=E__default.default.memo(({users:e,initialUserIndex:r,initialStoryIndex:o,isOpen:n,onClose:l,onStoryChange:i})=>{let[a,c]=E.useState(r),[t,m]=E.useState(o??0),[d,s]=E.useState(false);E.useEffect(()=>{c(r);},[r]),E.useEffect(()=>{m(o??0);},[o]);let[u,g]=E.useState(false),[f,v]=E.useState(null),[S,T]=E.useState(false),[_,R]=E.useState(false),me=E.useRef(null),fe=E.useRef(null),ye=E.useRef(0),ge=E.useRef(A),te=E.useRef(false),b=e[a],U=b?.stories[t],B=b?.stories.length||0;E.useEffect(()=>{ge.current=U?.duration||A;},[U?.duration]);let _e=Ee(n),re=Pe(),{preloadStoryItem:oe}=Le(),N=E.useCallback(()=>s(true),[]),z=E.useCallback(()=>s(false),[]),ve=E.useRef(),x=Ie({duration:ge.current||A,onComplete:()=>ve.current?.(),autoStart:false}),He=E.useCallback(y=>{y?x.pause():d||x.resume();},[x,d]);E.useEffect(()=>{let y=U?.duration||A;x.setDuration(y);},[x,U?.duration]);let k=E.useCallback(()=>{if(b)if(t<B-1){let y=t+1,I=b.stories[y]?.duration||A;m(y),x.setDuration(I),x.reset();}else a<e.length-1?(R(true),setTimeout(()=>{g(true),v("left"),setTimeout(()=>{let y=a+1,O=e[y].stories[0]?.duration||A;c(y),m(0),g(false),v(null),R(false),x.setDuration(O),x.reset();},150);},1e3)):l();},[b,t,B,a,e,x,l]),H=E.useCallback(()=>{if(b)if(t>0){let y=t-1,I=b.stories[y]?.duration||A;m(y),x.setDuration(I),x.reset();}else a>0&&(R(true),setTimeout(()=>{g(true),v("right"),setTimeout(()=>{let y=a-1,w=e[y],I=w.stories.length-1,he=w.stories[I]?.duration||A;c(y),m(I),g(false),v(null),R(false),x.setDuration(he),x.reset();},150);},1e3));},[b,t,a,e,x]),ne=E.useCallback(()=>{window.scrollTo(0,ye.current),l();},[l]);E.useEffect(()=>{ve.current=k;},[k]);let Oe=E.useMemo(()=>({pause:N,resume:z,next:k,prev:H,setDuration:y=>fe.current?.setDuration(y)}),[N,z,k,H]),Ke=E.useCallback(y=>{let w=y.target;if(w.closest(".story-viewer-close")||w.closest("button")||w.closest("input")||w.closest("select")||w.closest("textarea"))return;let I=me.current;if(!I)return;let O=I.getBoundingClientRect();y.clientX-O.left<O.width/2?H():k();},[H,k]),J=E.useRef(null),se=E.useRef(false),qe=E.useCallback(y=>{se.current=false,J.current={x:y.clientX,y:y.clientY},N();},[N]),Xe=E.useCallback(y=>{if(!J.current)return;let w=y.clientX-J.current.x,I=y.clientY-J.current.y;(Math.abs(w)>10||Math.abs(I)>10)&&(se.current=true);},[]);Ce({onLeft:H,onRight:k,onSpace:()=>d?z():N(),onEscape:ne,enabled:n}),E.useEffect(()=>{re?re&&!d&&z():N();},[re,N,z,d]),E.useEffect(()=>{if(!n||!b)return;let y=[];t<B-1&&y.push(b.stories[t+1]),t>0&&y.push(b.stories[t-1]),a<e.length-1&&y.push(e[a+1].stories[0]),a>0&&y.push(e[a-1].stories[0]);let w=y.slice(0,3).map(I=>oe(I).catch(()=>{}));Promise.all(w);},[n,b,a,t,B,e,oe]),E.useEffect(()=>(n&&!te.current?(te.current=true,T(true),U&&oe(U),setTimeout(()=>{T(false),ye.current=window.scrollY,document.body.style.overflow="hidden",x.resume();},1500)):n||(te.current=false,document.body.style.overflow="",T(false),R(false)),()=>{document.body.style.overflow="";}),[n,x]),E.useEffect(()=>{i&&n&&i(a,t);},[a,t,i,n]);let Ye=E.useCallback(()=>{console.warn("Story item failed to load, skipping..."),setTimeout(k,500);},[k]);if(!n||!b||!U)return null;let je=jsxRuntime.jsxs("div",{ref:me,className:"story-viewer",role:"dialog","aria-modal":"true","aria-label":`Stories by ${b?.username||"user"}`,"aria-describedby":"story-viewer-description",children:[jsxRuntime.jsx("div",{className:"story-viewer-overlay",onClick:ne}),jsxRuntime.jsx("div",{id:"story-viewer-description",className:"sr-only",children:"Instagram-style stories viewer. Tap left side to go to previous story, right side to go to next story. Swipe left or right to navigate between users. Press Escape to close."}),jsxRuntime.jsxs("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:["Viewing story ",t+1," of ",B," by"," ",b?.username]}),jsxRuntime.jsxs("div",{ref:_e,className:`story-viewer-content ${u?`story-viewer-transitioning story-viewer-transition-${f}`:""}`,onClick:Ke,onPointerDown:qe,onPointerMove:Xe,onMouseEnter:N,onMouseLeave:z,children:[jsxRuntime.jsxs("div",{className:"story-viewer-header",children:[jsxRuntime.jsx(ce,{total:B,currentIndex:t,progress:x.progress}),jsxRuntime.jsxs("div",{className:"story-viewer-user-info",children:[jsxRuntime.jsx("img",{src:b.avatarUrl,alt:`${b.username} avatar`,className:"story-viewer-avatar"}),jsxRuntime.jsx("span",{className:"story-viewer-username",children:b.username})]}),jsxRuntime.jsx("button",{className:"story-viewer-close",onClick:ne,"aria-label":"Close story viewer",type:"button",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"story-viewer-items",children:S||_?jsxRuntime.jsx("div",{className:"story-item-loader",children:jsxRuntime.jsx("div",{className:"story-item-spinner"})}):jsxRuntime.jsx(de,{item:U,isActive:true,isPaused:d||se.current,onDurationDetected:y=>fe.current?.setDuration(y),onLoadError:Ye,onBufferingChange:He,controls:Oe})}),jsxRuntime.jsxs("div",{className:"story-viewer-nav-hints",children:[jsxRuntime.jsx("div",{className:"story-viewer-nav-hint story-viewer-nav-hint-left"}),jsxRuntime.jsx("div",{className:"story-viewer-nav-hint story-viewer-nav-hint-right"})]})]})]});return reactDom.createPortal(je,document.body)});function Ae(e,r){for(let o=0;o<e.length;o++){let l=e[o].stories.findIndex(i=>i.id===r);if(l!==-1)return {userIndex:o,storyIndex:l}}return null}var Be=({users:e,closeNavigateTo:r="/"})=>{let{storyId:o}=reactRouterDom.useParams(),n=reactRouterDom.useNavigate(),[l,i]=E.useState({isOpen:false,userIndex:0,storyIndex:0}),a=E.useRef(0);E.useEffect(()=>{if(o){let d=Ae(e,o);d&&i({isOpen:true,userIndex:d.userIndex,storyIndex:d.storyIndex});}},[o,e]);let c=E.useCallback(d=>{a.current=window.scrollY,i({isOpen:true,userIndex:d,storyIndex:0});let s=e[d];if(s&&s.stories.length>0){let u=s.stories[0].id;n(`/story/${u}`,{replace:true});}},[e,n]),t=E.useCallback(()=>{i({isOpen:false,userIndex:0,storyIndex:0}),requestAnimationFrame(()=>{window.scrollTo(0,a.current);}),n(r,{replace:true});},[n,r]),m=E.useCallback((d,s)=>{let u=e[d];if(u&&u.stories[s]){let g=u.stories[s].id;n(`/story/${g}`,{replace:true});}},[e,n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(X,{users:e,onAvatarClick:c}),jsxRuntime.jsx(ee,{users:e,initialUserIndex:l.userIndex,initialStoryIndex:l.storyIndex,isOpen:l.isOpen,onClose:t,onStoryChange:m})]})};var $e=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(null),[i,a]=E__default.default.useState([42,28,18,12]);E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let c=d=>{l(d);let s=[...i];s[d]+=1,a(s),setTimeout(()=>{r(),o();},2e3);},t=i.reduce((d,s)=>d+s,0);return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:[jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"28px",fontWeight:"bold"},children:"Poll"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"18px"},children:"What's your favorite framework?"}),jsxRuntime.jsx("div",{style:{width:"100%"},children:["React","Vue","Angular","Svelte"].map((d,s)=>{let u=Math.round(i[s]/t*100),g=n===s;return jsxRuntime.jsxs("button",{onClick:()=>n===null&&c(s),disabled:n!==null,style:{width:"100%",padding:"16px 20px",margin:"8px 0",border:"none",borderRadius:"12px",background:n!==null?`linear-gradient(90deg, rgba(255,255,255,0.4) ${u}%, rgba(255,255,255,0.15) ${u}%)`:"rgba(255,255,255,0.2)",color:"white",fontSize:"16px",fontWeight:"600",cursor:n===null?"pointer":"default",transition:"all 0.3s ease",display:"flex",justifyContent:"space-between",alignItems:"center",backdropFilter:"blur(10px)"},children:[jsxRuntime.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[g&&"\u2713 ",d]}),n!==null&&jsxRuntime.jsxs("span",{children:[u,"%"]})]},s)})}),n!==null&&jsxRuntime.jsxs("p",{style:{color:"rgba(255,255,255,0.8)",marginTop:"20px",fontSize:"14px"},children:[t," votes \u2022 Thanks for voting!"]})]})},Ve=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(false),[i,a]=E__default.default.useState(null),c=2;E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let t=d=>{a(d),l(true),setTimeout(()=>{r(),o();},2500);};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"20px",animation:"bounce 1s infinite"},children:"\u{1FA90}"}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"24px",fontWeight:"bold",textAlign:"center"},children:"Quiz Time!"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"18px",textAlign:"center"},children:"Which is the largest planet in our solar system?"}),jsxRuntime.jsx("div",{style:{width:"100%"},children:["Mars","Venus","Jupiter","Saturn"].map((d,s)=>{let u=s===c,g=i===s,f="rgba(255,255,255,0.2)";return n&&(u?f="rgba(34, 197, 94, 0.6)":g&&(f="rgba(239, 68, 68, 0.6)")),jsxRuntime.jsxs("button",{onClick:()=>!n&&t(s),disabled:n,style:{width:"100%",padding:"16px 20px",margin:"8px 0",border:"none",borderRadius:"12px",background:f,color:"white",fontSize:"16px",fontWeight:"600",cursor:n?"default":"pointer",transition:"all 0.3s ease",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx("span",{children:d}),n&&u&&jsxRuntime.jsx("span",{children:"\u2713"}),n&&g&&!u&&jsxRuntime.jsx("span",{children:"\u2717"})]},s)})}),n&&jsxRuntime.jsx("p",{style:{color:"white",marginTop:"20px",fontSize:"16px",fontWeight:"bold"},children:i===c?"\u{1F389} Correct!":"\u274C Wrong! Jupiter is the largest."})]})},wt=()=>{let[e,r]=E__default.default.useState({days:12,hours:8,minutes:45,seconds:30});E__default.default.useEffect(()=>{let n=setInterval(()=>{r(l=>{let{days:i,hours:a,minutes:c,seconds:t}=l;return t--,t<0&&(t=59,c--),c<0&&(c=59,a--),a<0&&(a=23,i--),{days:i,hours:a,minutes:c,seconds:t}});},1e3);return ()=>clearInterval(n)},[]);let o=({value:n,label:l})=>jsxRuntime.jsxs("div",{style:{textAlign:"center"},children:[jsxRuntime.jsx("div",{style:{background:"rgba(255,255,255,0.2)",backdropFilter:"blur(10px)",borderRadius:"12px",padding:"15px 20px",minWidth:"70px"},children:jsxRuntime.jsx("div",{style:{fontSize:"32px",fontWeight:"bold",color:"white"},children:String(n).padStart(2,"0")})}),jsxRuntime.jsx("div",{style:{color:"rgba(255,255,255,0.8)",fontSize:"12px",marginTop:"8px",textTransform:"uppercase"},children:l})]});return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"15px"},children:"\u{1F680}"}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"8px",fontSize:"24px",fontWeight:"bold"},children:"Product Launch"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.7)",marginBottom:"30px",fontSize:"14px"},children:"Something amazing is coming..."}),jsxRuntime.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"30px"},children:[jsxRuntime.jsx(o,{value:e.days,label:"Days"}),jsxRuntime.jsx(o,{value:e.hours,label:"Hours"}),jsxRuntime.jsx(o,{value:e.minutes,label:"Mins"}),jsxRuntime.jsx(o,{value:e.seconds,label:"Secs"})]}),jsxRuntime.jsx("button",{style:{padding:"14px 40px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",border:"none",borderRadius:"30px",color:"white",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:"Notify Me"})]})},It=()=>jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"linear-gradient(180deg, #1a1a2e 0%, #16213e 100%)",position:"relative",overflow:"hidden"},children:[jsxRuntime.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},children:jsxRuntime.jsx("img",{src:"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&h=400&fit=crop",alt:"Product",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"20px",boxShadow:"0 20px 60px rgba(0,0,0,0.5)"}})}),jsxRuntime.jsxs("div",{style:{padding:"30px",background:"linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.8) 100%)"},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"},children:[jsxRuntime.jsx("span",{style:{background:"#ef4444",color:"white",padding:"4px 10px",borderRadius:"20px",fontSize:"12px",fontWeight:"bold"},children:"NEW"}),jsxRuntime.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:"Limited Edition"})]}),jsxRuntime.jsx("h2",{style:{color:"white",fontSize:"24px",fontWeight:"bold",marginBottom:"8px"},children:"Premium Watch Collection"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.7)",fontSize:"14px",marginBottom:"15px"},children:"Elegant design meets modern technology"}),jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:[jsxRuntime.jsx("span",{style:{color:"white",fontSize:"28px",fontWeight:"bold"},children:"$299"}),jsxRuntime.jsx("span",{style:{color:"rgba(255,255,255,0.5)",fontSize:"18px",textDecoration:"line-through"},children:"$399"})]}),jsxRuntime.jsx("button",{style:{width:"100%",marginTop:"20px",padding:"16px",background:"white",border:"none",borderRadius:"12px",color:"#1a1a2e",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:"Shop Now \u2192"})]})]}),We=({pause:e,resume:r,next:o})=>{let[n,l]=E__default.default.useState(5),[i,a]=E__default.default.useState(false);E__default.default.useEffect(()=>(e(),()=>r()),[e,r]);let c=()=>{a(true),setTimeout(()=>{r(),o();},1500);};return jsxRuntime.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",padding:"20px",width:"100%",background:"linear-gradient(135deg, #11998e 0%, #38ef7d 100%)"},children:[jsxRuntime.jsx("div",{style:{fontSize:"80px",marginBottom:"20px",transition:"all 0.3s"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F60A}","\u{1F603}","\u{1F604}","\u{1F601}","\u{1F929}","\u{1F973}"][n-1]}),jsxRuntime.jsx("h2",{style:{color:"white",marginBottom:"10px",fontSize:"24px",fontWeight:"bold"},children:"Rate Your Experience"}),jsxRuntime.jsx("p",{style:{color:"rgba(255,255,255,0.9)",marginBottom:"30px",fontSize:"16px"},children:"How was your visit today?"}),i?jsxRuntime.jsxs("div",{style:{textAlign:"center"},children:[jsxRuntime.jsx("div",{style:{fontSize:"48px",marginBottom:"10px"},children:"\u{1F389}"}),jsxRuntime.jsx("p",{style:{color:"white",fontSize:"18px",fontWeight:"bold"},children:"Thanks for your feedback!"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{style:{width:"100%",marginBottom:"20px"},children:[jsxRuntime.jsx("input",{type:"range",min:"1",max:"10",value:n,onChange:m=>l(parseInt(m.target.value)),style:{width:"100%",height:"8px",borderRadius:"4px",appearance:"none",background:"rgba(255,255,255,0.3)",cursor:"pointer"}}),jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",color:"rgba(255,255,255,0.7)",fontSize:"12px",marginTop:"8px"},children:[jsxRuntime.jsx("span",{children:"1"}),jsxRuntime.jsx("span",{children:"10"})]})]}),jsxRuntime.jsxs("button",{onClick:c,style:{padding:"14px 50px",background:"white",border:"none",borderRadius:"30px",color:"#11998e",fontSize:"16px",fontWeight:"bold",cursor:"pointer"},children:["Submit (",n,"/10)"]})]})]})},j=["https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4","https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4","https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4"],ze=["https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1426604966848-d7adac402bff?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1472214103451-9374bd1c798e?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=1080&h=1920&fit=crop","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=1080&h=1920&fit=crop"],W=["https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1517841905240-472988babdf9?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=150&h=150&fit=crop","https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=150&h=150&fit=crop"],pe=[{id:"user-travel",username:"Travel",avatarUrl:W[0],hasUnreadStories:true,stories:[{id:"travel-1",type:"image",src:"https://images.unsplash.com/photo-1682687220742-aba13b6e50ba?w=1080&h=1920&fit=crop",duration:5e3,alt:"Beautiful mountain landscape"},{id:"travel-2",type:"image",src:"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1080&h=1920&fit=crop",duration:5e3,alt:"Scenic ocean view"},{id:"travel-3",type:"text",text:`Adventure awaits! \u{1F30D}
|
|
2
2
|
|
|
3
|
-
Swipe to explore more destinations \u2192`,backgroundColor:"#FF6B6B",textColor:"#FFFFFF",duration:4e3},{id:"travel-4",type:"video",src:
|
|
3
|
+
Swipe to explore more destinations \u2192`,backgroundColor:"#FF6B6B",textColor:"#FFFFFF",duration:4e3},{id:"travel-4",type:"video",src:j[0],duration:15e3}]},{id:"user-polls",username:"Interactive",avatarUrl:W[1],hasUnreadStories:true,stories:[{id:"poll-intro",type:"text",text:`Let's have some fun! \u{1F3AE}
|
|
4
4
|
|
|
5
5
|
Interactive stories ahead \u2192`,backgroundColor:"#667eea",textColor:"#FFFFFF",duration:3e3},{id:"poll-1",type:"custom_component",component:$e,duration:3e4},{id:"quiz-1",type:"custom_component",component:Ve,duration:3e4},{id:"slider-1",type:"custom_component",component:We,duration:3e4}]},{id:"user-product",username:"Shop",avatarUrl:W[2],hasUnreadStories:true,stories:[{id:"product-1",type:"custom_component",component:It,duration:8e3},{id:"product-2",type:"image",src:"https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=1080&h=1920&fit=crop",duration:5e3,alt:"Product showcase"},{id:"product-3",type:"text",text:`Limited Time Offer! \u{1F525}
|
|
6
6
|
|
|
@@ -8,11 +8,11 @@ Interactive stories ahead \u2192`,backgroundColor:"#667eea",textColor:"#FFFFFF",
|
|
|
8
8
|
|
|
9
9
|
Use code: STORY50`,backgroundColor:"#000000",textColor:"#FFFFFF",duration:5e3}]},{id:"user-launch",username:"Events",avatarUrl:W[3],hasUnreadStories:true,stories:[{id:"launch-1",type:"custom_component",component:wt,duration:1e4},{id:"launch-2",type:"text",text:`Mark your calendars! \u{1F4C5}
|
|
10
10
|
|
|
11
|
-
Big announcement coming soon...`,backgroundColor:"#302b63",textColor:"#FFFFFF",duration:4e3},{id:"launch-3",type:"image",src:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1080&h=1920&fit=crop",duration:5e3,alt:"Event teaser"}]},{id:"user-video",username:"Videos",avatarUrl:W[4],hasUnreadStories:true,stories:[{id:"video-1",type:"video",src:
|
|
11
|
+
Big announcement coming soon...`,backgroundColor:"#302b63",textColor:"#FFFFFF",duration:4e3},{id:"launch-3",type:"image",src:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1080&h=1920&fit=crop",duration:5e3,alt:"Event teaser"}]},{id:"user-video",username:"Videos",avatarUrl:W[4],hasUnreadStories:true,stories:[{id:"video-1",type:"video",src:j[1],duration:15e3},{id:"video-2",type:"video",src:j[2],duration:15e3},{id:"video-3",type:"text",text:`More videos coming soon! \u{1F3AC}
|
|
12
12
|
|
|
13
13
|
Stay tuned \u2192`,backgroundColor:"#4ECDC4",textColor:"#FFFFFF",duration:3e3}]},{id:"user-lifestyle",username:"Lifestyle",avatarUrl:W[5],hasUnreadStories:false,stories:[{id:"lifestyle-1",type:"image",src:"https://images.unsplash.com/photo-1469474968028-56623f02e42e?w=1080&h=1920&fit=crop",duration:5e3,alt:"Nature scene"},{id:"lifestyle-2",type:"image",src:"https://images.unsplash.com/photo-1426604966848-d7adac402bff?w=1080&h=1920&fit=crop",duration:5e3,alt:"Peaceful landscape"},{id:"lifestyle-3",type:"text",text:`Find your peace \u{1F9D8}
|
|
14
14
|
|
|
15
|
-
Nature heals everything`,backgroundColor:"#45B7D1",textColor:"#FFFFFF",duration:4e3}]}],Ct=(e=50)=>{let r=[...
|
|
15
|
+
Nature heals everything`,backgroundColor:"#45B7D1",textColor:"#FFFFFF",duration:4e3}]}],Ct=(e=50)=>{let r=[...pe];for(let o=pe.length;o<e;o++){let n=Math.random()>.3,l=Math.floor(Math.random()*5)+2;r.push({id:`user-${o}`,username:`User ${o}`,avatarUrl:`https://i.pravatar.cc/150?img=${o%70}`,hasUnreadStories:n,stories:Array.from({length:l},(i,a)=>{let c=Math.random();if(c<.5)return {id:`story-${o}-${a}`,type:"image",src:ze[Math.floor(Math.random()*ze.length)],duration:5e3,alt:`Story from User ${o}`};if(c<.7)return {id:`story-${o}-${a}`,type:"video",src:j[Math.floor(Math.random()*j.length)],duration:15e3};if(c<.9){let m=["#FF6B6B","#4ECDC4","#45B7D1","#FFA07A","#98D8C8","#667eea","#764ba2"];return {id:`story-${o}-${a}`,type:"text",text:`Hello from User ${o}! \u{1F44B}
|
|
16
16
|
|
|
17
|
-
This is story ${a+1}`,backgroundColor:m[Math.floor(Math.random()*m.length)],textColor:"#FFFFFF",duration:4e3}}let t=[$e,Ve,We];return {id:`story-${o}-${a}`,type:"custom_component",component:t[Math.floor(Math.random()*t.length)],duration:3e4}})});}return r};exports.Stories=Be;exports.demoUsers=
|
|
17
|
+
This is story ${a+1}`,backgroundColor:m[Math.floor(Math.random()*m.length)],textColor:"#FFFFFF",duration:4e3}}let t=[$e,Ve,We];return {id:`story-${o}-${a}`,type:"custom_component",component:t[Math.floor(Math.random()*t.length)],duration:3e4}})});}return r};exports.AvatarList=X;exports.Stories=Be;exports.StoryViewer=ee;exports.demoUsers=pe;exports.generateDemoUsers=Ct;//# sourceMappingURL=index.cjs.map
|
|
18
18
|
//# sourceMappingURL=index.cjs.map
|