PageSourceSearch

https://blast.tv/ssr-assets/2024-10-15/useCallToAction-HDeGgwBn.js

js blast.tv collected 2026-09-24 18:13:33 UTC 3,593 bytes, 1 lines download raw bytes

1import{u as p}from"./chunk-OIYGIGL5-fdmY2nYp.js";import{a as w}from"./AuthProvider-FkniZDzB.js";import{u as y}from"./AuthModalProvider-0ca-gwl9.js";import{u as b}from"./useMutation-Cr4ESEf6.js";import{A as h}from"./index-DUwAfxww.js";import{b as m}from"./blastApi-DFI7C5q7.js";import{c as l}from"./exports-CIqIrnmg.js";import{t as u}from"./trackGaEvent-Gp5MXdof.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[new t.Error().stack]=(function(r){for(var n=1;n<arguments.length;n++){var d=arguments[n];if(d!=null)for(var a in d)d.hasOwnProperty(a)&&(r[a]=d[a])}return r})({},t._sentryModuleMetadata[new t.Error().stack],{"_sentryBundlerPluginAppKey:portal-frontend-ssr":!0});var o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="615fb073-8503-4759-8c5c-dffd40d2513d",t._sentryDebugIdIdentifier="sentry-dbid-615fb073-8503-4759-8c5c-dffd40d2513d")}catch{}})();const v=async({userId:t,avatarId:o})=>{try{await m.post(`/v1/users/${t}/profile/avatars/${o}`)}catch(r){const n=r instanceof h?r.toJSON():r;throw l(n),n}},g=()=>b({mutationFn:v}),C=async({userId:t,emojiId:o})=>{try{await m.post(`/v1/users/${t}/profile/emojis/${o}`)}catch(r){const n=r instanceof h?r.toJSON():r;throw l(n),n}},E=()=>b({mutationFn:C}),M=({handleLogin:t,handleRegister:o,handleNavigate:r,handleClaimAvatar:n,handleClaimEmoji:d,callToAction:a,analyticsArgs:e})=>{if(a&&a.type!=="none")switch(a.type){case"external":e&&u({category:e.category,label:e.label,action:`External Link: ${a.url}`}),window.open(a.url,"_blank");break;case"reroute":e&&u({category:e.category,label:e.label,action:`Reroute: ${a.route}`}),r(a.route);break;case"register":e&&u({category:e.category,label:e.label,action:"Register"}),o();break;case"login":e&&u({category:e.category,label:e.label,action:"Login"}),t();break;case"copyRouteToClipboard":e&&u({category:e.category,label:e.label,action:"Copy Route To Clipboard"}),window.navigator.clipboard.writeText(window.location.href);break;case"copyTextToClipboard":e&&u({category:e.category,label:e.label,action:"Copy Text To Clipboard"}),window.navigator.clipboard.writeText(a.text);break;case"avatar":e&&u({category:e.category,label:e.label,action:"Claim Avatar"}),n(a.avatar);break;case"emoji":e&&u({category:e.category,label:e.label,action:"Claim Emoji"}),d(a.emoji);break}},R=()=>{const t=p(),o=w(),r=y(),{mutateAsync:n}=g(),{mutateAsync:d}=E();return({callToAction:a,analyticsArgs:e,onSuccess:f})=>M({callToAction:a,analyticsArgs:e,handleNavigate:i=>{i.startsWith("/article")||i.startsWith("/cs/news")||i.startsWith("/gaming/news")||i.startsWith("/supercell/news")||i.startsWith("/quiz")||i.startsWith("/dota/news")?t(i):window.location.href=i},handleLogin:()=>{o.isAuthenticated||r.openModal()},handleRegister:()=>{o.isAuthenticated||r.openModal()},handleClaimAvatar:async i=>{if(!o?.isAuthenticated){r?.openModal(),f?.();return}const s=o?.userId;if(!s)throw l("Couldn't find user id in auth context"),new Error("Couldn't find user id in auth context");try{await n({userId:s,avatarId:i}),f?.()}catch(c){throw l(c),new Error(`Failed to claim avatar with id: ${i}.`)}},handleClaimEmoji:async i=>{if(!o?.isAuthenticated){r?.openModal(),f?.();return}const s=o?.userId;if(!s)throw l("Couldn't find user id in auth context"),new Error("Couldn't find user id in auth context");try{await d({userId:s,emojiId:i}),f?.()}catch(c){throw l(c),new Error(`Failed to claim emoji with id: ${i}.`)}}})};export{R as u};

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.