PageSourceSearch

https://tikscan.live/assets/overlay-event-action-Bsq9v8Og.js

js tikscan.live collected 2026-10-08 16:06:53 UTC 12,232 bytes, 1 lines download raw bytes

1import{r,j as o}from"./index-nKZe9k73.js";import{d as D}from"./overlaySession-CkveSbBD.js";import{u as B}from"./useOverlayAccess-DD2JCOUP.js";import{N as W}from"./NotificationOverlay-DybY71bn.js";import{A as Z}from"./index-QGRvknO3.js";import{m as h}from"./proxy-2IlcHMNA.js";function Q(e,s){return e!==s}function q(e){const{todos:s,prioritarios:l,teto:n}=e,a=l===void 0?s:s.slice(0,Math.max(0,l));return Array.from(new Set(a)).slice(0,n)}function G(e){const{novos:s,anteriores:l,noAr:n}=e,a=Array.from(new Set(s));return n&&l.includes(n)&&!a.includes(n)&&a.push(n),a}const k=1080,T=1920,H=220/960,J=-5;function K(){const e=r.useRef(!1);r.useEffect(()=>{const s=()=>{if(e.current)return;e.current=!0;const l=new(window.AudioContext||window.webkitAudioContext);l.state==="suspended"&&l.resume();const n=l.createBuffer(1,1,22050),a=l.createBufferSource();a.buffer=n,a.connect(l.destination),a.start(0);const u=new Audio("data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=");u.volume=.01,u.play().catch(()=>{})};return s(),document.addEventListener("click",s,{once:!0}),document.addEventListener("touchstart",s,{once:!0}),()=>{document.removeEventListener("click",s),document.removeEventListener("touchstart",s)}},[])}const _=1,E=2,F=3;function C({d:e}){const[s,l]=r.useState(1);return r.useEffect(()=>{const n=()=>l(Math.min(window.innerWidth/k,window.innerHeight/T));return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),o.jsxs(o.Fragment,{children:[e.imageUrl&&!e.videoUrl&&o.jsx("div",{style:{position:"absolute",left:`${e.imageX??50}%`,top:`${e.imageY??50}%`,width:`${e.imageScale??100}%`,transform:`translate(-50%, -50%) rotate(${e.imageRotation??0}deg)`,zIndex:E},children:o.jsx(h.img,{src:e.imageUrl,alt:"",initial:e.fadeEnabled?{opacity:0}:{opacity:1},animate:{opacity:1},exit:e.fadeEnabled?{opacity:0}:{opacity:0},transition:{duration:.4},style:{width:"100%",height:"auto",objectFit:"contain",display:"block"}})},`img-wrap-${e.timestamp}`),e.animationUrl&&!e.videoUrl&&o.jsx("div",{style:{position:"absolute",left:`${e.animationX??50}%`,top:`${e.animationY??50}%`,width:`${e.animationScale??100}%`,transform:`translate(-50%, -50%) rotate(${e.animationRotation??0}deg)`,zIndex:E},children:o.jsx(h.img,{src:e.animationUrl,alt:"",initial:e.fadeEnabled?{opacity:0}:{opacity:1},animate:{opacity:1},exit:e.fadeEnabled?{opacity:0}:{opacity:0},transition:{duration:.4},style:{width:"100%",height:"auto",objectFit:"contain",display:"block"}})},`anim-wrap-${e.timestamp}`),(e.emojiUrl||e.emojiCode)&&o.jsx("div",{style:{position:"absolute",left:`${e.emojiX??50}%`,top:`${e.emojiY??50}%`,width:`${e.emojiScale??100}%`,transform:`translate(-50%, -50%) rotate(${e.emojiRotation??0}deg)`,zIndex:E},children:o.jsx(h.img,{src:e.emojiUrl||`https://fonts.gstatic.com/s/e/notoemoji/latest/${e.emojiCode}/512.gif`,alt:"",initial:e.fadeEnabled?{opacity:0}:{opacity:1},animate:{opacity:1},exit:e.fadeEnabled?{opacity:0}:{opacity:0},transition:{duration:.4},style:{width:"100%",height:"auto",objectFit:"contain",display:"block"}})},`emoji-wrap-${e.timestamp}`),e.giftNotif&&o.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",pointerEvents:"none",zIndex:F},children:o.jsx("div",{style:{position:"relative",width:k,height:T,transform:`scale(${s})`,transformOrigin:"center center"},children:o.jsx(W,{name:e.giftNotif.name,action:e.giftNotif.action,count:e.giftNotif.count,avatarUrl:e.giftNotif.avatarUrl,roseUrl:e.giftNotif.roseUrl,duration:e.giftNotif.duration,x:e.giftNotif.x,y:e.giftNotif.y,w:e.giftNotif.w,h:Math.round(e.giftNotif.w*H)+J,bgOpacity:.5,scale:1,trigger:e.timestamp})})},`giftnotif-${e.timestamp}`),!e.giftNotif&&e.showAlert&&(e.showAlertAvatar||e.showAlertName)&&o.jsx("div",{style:{position:"absolute",left:`${e.alertX??50}%`,top:`${e.alertY??85}%`,transform:`translate(-50%, -50%) scale(${(e.alertScale??100)/100})`,zIndex:F},children:o.jsxs(h.div,{initial:e.fadeEnabled?{opacity:0,y:30}:{opacity:1},animate:{opacity:1,y:0},exit:e.fadeEnabled?{opacity:0,y:30}:{opacity:0}
1,transition:{duration:.4},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:10,padding:"12px 20px",maxWidth:900},children:[e.showAlertAvatar&&e.avatarUrl&&o.jsx("img",{src:`/api/img-proxy?url=${encodeURIComponent(e.avatarUrl)}`,alt:"",onError:n=>{const a=n.currentTarget,u=`https://ui-avatars.com/api/?name=${encodeURIComponent(e.nickname||"?")}&background=4FC3F7&color=fff&size=256`;a.src!==u&&(a.src=u)},style:{width:128,height:128,borderRadius:"50%",objectFit:"cover",flexShrink:0,border:"3px solid rgba(255,255,255,0.25)",boxShadow:"0 4px 14px rgba(0,0,0,0.5)"}}),e.showAlertName&&e.nickname&&o.jsx("div",{style:{color:"#fff",fontSize:32,fontWeight:700,textAlign:"center",textShadow:"0 2px 4px rgba(0,0,0,0.5), 0 0 12px rgba(0,0,0,0.6)"},children:e.nickname})]})},`alert-wrap-${e.timestamp}`)]})}function rt(){K();const e=new URLSearchParams(window.location.search),s=e.get("session")||"default",l=e.get("actionId")||"",n=e.get("screen")||"",[a,u]=r.useState(null),f=r.useRef(),y=r.useRef([]),x=r.useRef(!1),V=30,[Y,U]=r.useState([]),P=6,X=t=>!!t.videoUrl||!!t.audioUrl,M=t=>{U(i=>[...i,t].slice(-P)),window.setTimeout(()=>{U(i=>i.filter(c=>c.timestamp!==t.timestamp))},Math.max(1,t.duration)*1e3)},[w,O]=r.useState([]),L=24,j=r.useRef(new Map),A=r.useRef(new Map),R=r.useRef(0),S=r.useRef(null),p=B(s,"events"),g=r.useRef(!1),v=()=>{g.current||(g.current=!0,f.current&&clearTimeout(f.current),y.current.length>0?$():(u(null),x.current=!1))},$=t=>{const i=t??y.current.shift();if(!i){x.current=!1;return}if(x.current=!0,g.current=!1,A.current.set(i.timestamp,performance.now()),u(i),i.audioUrl)try{const c=new Audio(i.audioUrl);c.volume=i.audioVolume/100,c.play().catch(()=>{})}catch{}if(i._readTts&&i._ttsText)try{const c=String(i._ttsText).trim();if(c){const d=String(i._ttsVoice||"pt-BR-AntonioNeural"),m=Number(i._ttsRate)||1,b=`/api/tts-audio?text=${encodeURIComponent(c)}&provider=edge&voice=${encodeURIComponent(d)}&rate=${m}`,N=new Audio(b);N.volume=1,N.play().catch(z=>console.error("[event-action TTS] play failed",z))}}catch(c){console.error("[event-action TTS] error",c)}f.current&&clearTimeout(f.current),f.current=setTimeout(v,i.duration*1e3)};r.useEffect(()=>{S.current=a},[a]),r.useEffect(()=>{document.documentElement.style.setProperty("background","transparent","important"),document.body.style.setProperty("background","transparent","important"),document.body.classList.remove("bg-background"),document.documentElement.style.margin="0",document.body.style.margin="0",document.documentElement.style.padding="0",document.body.style.padding="0",document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden"},[]);const I=()=>{fetch(`/api/events/prefetch?sessionId=${s}`).then(t=>t.json()).then(t=>{if(!(t!=null&&t.success))return;const i=(t.videoUrls||[]).filter(Boolean),c=t.videosPrioritarios===void 0?void 0:Number(t.videosPrioritarios)||0,d=q({todos:i,prioritarios:c,teto:L});(c??i.length)-d.length,O(m=>{var b;return G({novos:d,anteriores:m,noAr:(b=S.current)==null?void 0:b.videoUrl})})}).catch(()=>{})};return r.useEffect(()=>{p==="allowed"&&I()},[s,p]),r.useEffect(()=>{if(!(a!=null&&a.videoUrl)||!w.includes(a.videoUrl))return;const t=j.current.get(a.videoUrl);if(t&&Q(R.current,a.timestamp)){R.current=a.timestamp;try{t.pause(),t.currentTime=0,t.muted=!1,t.volume=Math.max(0,Math.min(1,a.videoVolume/100)),t.play().catch(()=>{}),A.current.get(a.timestamp)!==void 0&&A.current.delete(a.timestamp)}catch{}}},[a==null?void 0:a.timestamp,a==null?void 0:a.videoUrl,a==null?void 0:a.videoVolume,w]),D(s,t=>{var i,c;if(t.event==="eventActionsUpdated"){I();return}if(t.event==="eventAction"&&t.data){if(l&&t.data.actionId!==l)return;if(n){const m=t.data.screen||"";if(m!==n&&m!==`Screen ${n}`)return}const d={actionId:t.data.actionId,nickname:((i=t.data.user)==null?void 0:i.nickname)||t.data.nickname||"",avatarUrl:((c=t.data.user)==null?void 0:c.profilePictureUrl)||"",showAlert:!!t.data.showAlert,showAlertName:t.data.showAlertName??!0,alertX:t.data.alertX??50,alertY:t.data.alertY??85,alertScale:t.data.alertScale??100,showAlertAvatar:t.data.showAlertAvatar??!1,giftNotif:t.data.giftNotif??null,imageUrl:t.data.showImage?t.data.imageUrl:void 0,animationUrl:t.data.showAnimation?t.data.animationUrl:void 0,videoUrl:t.data.playVideo?t.data.videoUrl:void 0,videoX:t.data.videoX??50,videoY:t.data.videoY??50,videoScale:t.data.videoScale??100,videoRotation:t.data.videoRotation??0,videoFit:t.data.videoFit||"cover",imageX:t.data.imageX??50,imageY:t.data.imageY??50,imageScale:t.data.imageScale??100,imageRotation:t.data.imageRotation??0,animationX:t.data.animationX??50,animationY:t.data.animationY??50,animationScale:t.data.animationScale??100,animationRotation:t.data.animationRotation??0,emojiCode:t.data.showEmoji&&t.data.emojiCode||"",emojiUrl:t.data.showEmoji&&t.data.emojiUrl||"",emojiX:t.data.emojiX??50,emojiY:t.data.emojiY??50,emojiScale:t.data.emojiScale??100,emojiRotation:t.data.emojiRotation??0,audioUrl:t.data.playAudio?t.data.audioUrl:void 0,audioVolume:t.data.audioVolume??80,videoVolume:t.data.videoVolume??80,duration:t.data.duration||5,fadeEnabled:t.data.fadeEnabled??!0,fadeDuration:t.data.fadeDuration??.18,timestamp:Date.now()};if(d._readTts=!!t.data.readTts,d._ttsText=t.data.ttsText,d._ttsVoice=t.data.ttsVoice,d._ttsRate=t.data.ttsRate,!X(d)){M(d);return}x.current?y.current.length<V&&y.current.push(d):$(d)}},{overlayId:n?`event-action-screen-${n}`:"event-action-all",enabled:p==="allowed",events:["eventActionsUpdated","eventAction"]}),r.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),p!=="allowed"?p==="checking"?o.jsx("div",{style:{position:"fixed",inset:0,background:"transparent"}}):o.jsx("div",{style:{position:"fixed",inset:0,background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Inter', system-ui, sans-serif"},children:o.jsx("div",{style:{padding:"18px 26px",borderRadius:16,background:"rgba(10,12,18,0.82)",border:"1px solid rgba(234,179,8,0.35)",color:"#fde68a",fontWeight:700,fontSize:15,textAlign:"center",boxShadow:"0 20px 60px -20px rgba(0,0,0,0.7)"},children:"🔒 Overlay PRO — assine um plano ativo para usar"})}):o.jsx("div",{style:{position:"fixed",inset:0,background:"transparent",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsxs("div",{style:{position:"relative",width:"min(100vw, calc(100vh * 9 / 16))",height:"min(100vh, calc(100vw * 16 / 9))",aspectRatio:"9 / 16"},children:[w.map(t=>{const i=(a==null?void 0:a.videoUrl)===t;return o.jsx("div",{"aria-hidden":!i,style:{position:"absolute",left:i?`${a.videoX}%`:-9999,top:i?`${a.videoY}%`:-9999,width:i?`${a.videoScale}%`:1,height:i?`${a.videoScale}%`:1,transform:i?`translate(-50%, -50%) rotate(${a.videoRotation??0}deg)`:"none",opacity:i?1:0,pointerEvents:"none",transition:`opacity ${a!=null&&a.fadeEnabled?(a.fadeDuration??.18)+"s":"0s"} ease-out`,zIndex:_},children:o.jsx("video",{ref:c=>{c?j.current.set(t,c):j.current.delete(t)}
1,src:t,preload:"auto",muted:!i,playsInline:!0,onEnded:()=>{i&&v()},onError:()=>{i&&v()},style:{width:"100%",height:"100%",objectFit:(a==null?void 0:a.videoFit)||"cover",display:"block"}})},t)}),o.jsxs(Z,{children:[a&&o.jsxs(o.Fragment,{children:[a.videoUrl&&!w.includes(a.videoUrl)&&o.jsx("div",{style:{position:"absolute",left:`${a.videoX}%`,top:`${a.videoY}%`,width:`${a.videoScale}%`,height:`${a.videoScale}%`,transform:`translate(-50%, -50%) rotate(${a.videoRotation??0}deg)`,zIndex:_},children:o.jsx(h.video,{src:a.videoUrl,autoPlay:!0,muted:!1,preload:"auto",playsInline:!0,onEnded:v,onError:v,onCanPlay:t=>{A.current.get(a.timestamp),t.currentTarget.play().catch(()=>{})},ref:t=>{t&&(t.volume=Math.max(0,Math.min(1,a.videoVolume/100)))},initial:a.fadeEnabled?{opacity:0}:{opacity:1},animate:{opacity:1},exit:a.fadeEnabled?{opacity:0}:{opacity:0},transition:{duration:a.fadeEnabled?a.fadeDuration??.18:0},style:{width:"100%",height:"100%",objectFit:a.videoFit,display:"block"}})},`video-wrap-${a.timestamp}`),o.jsx(C,{d:a})]}),Y.map(t=>o.jsx(C,{d:t},`leve-${t.timestamp}`))]})]})})}export{rt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.