PageSourceSearch

https://web.rockthesport.com/_next/static/chunks/1378-243a7410c7049a25.js

js rockthesport.com collected 2026-10-01 11:26:47 UTC 8,832 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1378],{2392:(e,t,r)=>{"use strict";r.d(t,{Rk:()=>c,dg:()=>o,hc:()=>u,ue:()=>d});let n="eventsUtmInfo",a={utm_source:"rockthesport",utm_medium:"calendar",utm_campaign:"rts-calendar-recommendation"},o={home:"rts-recommendator-home",userDashboard:"rts-recommendator-user-dashboard",calendar:"rts-recommendator-calendar",moreRecommendations:"rts-recommendator-more-recommendations"},i=()=>{try{let e=window.localStorage.getItem(n);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},s=e=>{try{window.localStorage.setItem(n,JSON.stringify(e))}catch(e){}},l=(e,t)=>{if(null==e||""===String(e).trim())return;let r=String(e),n=i().filter(e=>e&&String(e.eventId)!==r);n.push({eventId:r,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,timestamp:Date.now()}),s(n)},c=(e,t)=>{l(e,{utm_source:a.utm_source,utm_medium:a.utm_medium,utm_campaign:t||a.utm_campaign})},d=e=>{let t=new URLSearchParams(window.location.search),r=t.get("utm_source"),n=t.get("utm_medium"),o=t.get("utm_campaign");r===a.utm_source&&n&&o&&l(e,{utm_source:r,utm_medium:n,utm_campaign:o})},u=e=>{let t=Date.now(),r=i(),n=r.filter(e=>e&&"number"==typeof e.timestamp&&t-e.timestamp<=6048e5&&e.utm_source===a.utm_source);if(n.length!==r.length&&s(n),null==e||""===String(e).trim())return null;let o=String(e),l=n.find(e=>String(e.eventId)===o);return l?{utm_source:l.utm_source,utm_medium:l.utm_medium,utm_campaign:l.utm_campaign}:null}},5918:(e,t,r)=>{"use strict";function n(e){return e?e.toLowerCase().trim().replace(/[\s/]+/g,"-").replace(/[^\w\-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,""):""}function a(e){return n(e)}function o(e){return n(e)}r.d(t,{KF:()=>o,Y0:()=>a})},7021:()=>{},15173:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(95155),a=r(12115),o=r(69959),i=r(52619),s=r.n(i),l=r(64269);let c=e=>{let{direction:t="left",className:r,width:a=24,height:o=24,onClick:i}=e;return(0,n.jsxs)("svg",{width:a,height:o,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:(0,l.cn)("cursor-pointer",r),onClick:i,style:{transform:"right"===t?"rotate(180deg)":"none"},children:[(0,n.jsx)("g",{clipPath:"url(#clip0_16919_1943)",children:(0,n.jsx)("path",{d:"M7.00008 5.47656L4.66675 7.8099M4.66675 7.8099L7.00008 10.1432M4.66675 7.8099H9.33341M12.8334 7.8099C12.8334 11.0316 10.2217 13.6432 7.00008 13.6432C3.77842 13.6432 1.16675 11.0316 1.16675 7.8099C1.16675 4.58823 3.77842 1.97656 7.00008 1.97656C10.2217 1.97656 12.8334 4.58823 12.8334 7.8099Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"clip0_16919_1943",children:(0,n.jsx)("rect",{width:"14",height:"14",fill:"white",transform:"translate(0 0.810059)"})})})]})};r(7021);var d=r(5918),u=r(63134),m=r(15894),g=r(42528);function v(e){let{events:t,lang:r,title:i,eventsPerPage:l,dict:v,englishDict:f,sportId:h,customLinkHref:p,customLinkText:x,onEventClick:_}=e,[y,w]=(0,a.useState)(1),{favoriteEvents:j,addFavorite:N,deleteFavorite:S,favoritesLoading:k}=(0,u.s)(),{userProfile:b}=(0,u.s)(),{toast:I}=(0,m.dj)(),C=(0,g.d)((null!=t?t:[]).map(e=>null==e?void 0:e.eventId)),E=v.sportsTranslations.names[h],L=f.sportsTranslations.names[h],A=Math.ceil(t.length/l),D=(y-1)*l,T=t.length>0?t.slice(D,D+l):[],F=t.length>0?t:[];for(;T.length<l;)T.push(null);let M=h&&E?{type:"category",categoryId:h.toString(),categoryName:E}:{type:"all-events"},J=y>1,O=y<A,P=e=>!!j&&!k&&j.some(t=>{var r;return(null==(r=t.eventId)?void 0:r.toString())===(null==e?void 0:e.toString())}),R=async(e,t)=>{if(!(null==b?void 0:b.id))return I({description:v.favorites.toast.login_required,variant:"destructive",duration:3e3}),window.open("/".concat(r,"/login?add=").concat(e.eventId),"_blank"),!1;try{if(t){let t=await S(e.eventId.toString());return t?I({description:v.favorites.toast.removed,variant:"default",duration:3e3}):I({description:v.favorites.toast.remove_error,variant:"destructive",duration:3e3}),t}{let t=await N(e.eventId.toString());return t?I({description:v.favorites.toast.added,variant:"default",duration:3e3}):I({description:v.favorites.toast.add_error,variant:"destructive",duration:3e3}),t}}catch(e){return console.error("Error managing favorites:",e),I({description:v.favorites.toast.manage_error,variant:"destructive",duration:3e3}),!1}};return 0===t.length?null:(0,n.jsxs)("section",{className:"py-4 sm:py-8",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold",children:i}),(0,n.jsxs)("div",{className:"hidden lg:flex gap-4",children:[(0,n.jsx)(c,{direction:"left",width:24,height:24,className:"text-muted-foreground ".concat(J?"opacity-100 hover:opacity-80":"opacity-50 cursor-not-allowed"),onClick:J?()=>{y>1&&w(y-1)}:void 0}),(0,n.jsx)(c,{direction:"right",width:24,height:24,className:"text-muted-foreground ".concat(O?"opacity-100 hover:opacity-80":"opacity-50 cursor-not-allowed"),onClick:O?()=>{y<A&&w(y+1)}:void 0})]})]}),(0,n.jsx)("div",{className:"hidden lg:block",children:(0,n.jsx)("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden p-1 scrollC
1ontainer",style:{gap:16},children:T.map((e,t)=>null===e?(0,n.jsx)("div",{className:"flex-1 flex-shrink-0"},t):(0,n.jsx)("div",{className:"flex-1 flex-shrink-0 flex flex-col items-center justify-center",children:(0,n.jsx)(o.A,{event:e,lang:r,navigationContext:M,availability:C[e.eventId],isFavorite:P(e.eventId),onFavoriteToggle:R,onClick:_?()=>_(e):void 0})},e.eventId))})}),(0,n.jsx)("div",{className:"block lg:hidden",children:(0,n.jsx)("div",{className:"flex flex-row overflow-x-auto overflow-y-hidden p-1 scrollContainer",style:{gap:16},children:F.map((e,t)=>(0,n.jsx)("div",{className:"flex-shrink-0 flex flex-col items-center justify-center w-[280px] lg:w-auto",children:(0,n.jsx)(o.A,{event:e,lang:r,navigationContext:M,availability:C[e.eventId],isFavorite:P(e.eventId),onFavoriteToggle:R,onClick:_?()=>_(e):void 0})},e.eventId))})}),(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row items-center justify-between lg:mt-4 gap-4",children:[(0,n.jsx)("div",{className:"flex-1"}),A>1&&(0,n.jsx)("div",{className:"hidden lg:flex flex-1 justify-center gap-2",children:Array.from({length:A},(e,t)=>t+1).map(e=>(0,n.jsx)("button",{onClick:()=>w(e),className:"w-3 h-3 rounded-full ".concat(e===y?"bg-gray-800 dark:bg-white":"bg-gray-300 dark:bg-gray-300 hover:bg-gray-400 dark:hover:bg-gray-600")},e))}),(0,n.jsx)("div",{className:"flex-1 lg:hidden"}),p&&x?(0,n.jsx)("div",{className:"flex-1 flex flex-row justify-end",children:(0,n.jsx)(s(),{href:p,prefetch:!0,className:"text-primary hover:underline text-right",children:x})}):f&&h&&L?(0,n.jsx)("div",{className:"flex-1 flex flex-row justify-end",children:(0,n.jsx)(s(),{href:"/".concat(r,"/sport/").concat((0,d.Y0)(L)),prefetch:!0,className:"text-primary hover:underline text-right",children:(()=>{if(!E)return"";switch(r){case"en":return"".concat(v.buttons.see_all_events_of," ").concat(E.toLowerCase()," ").concat(v.pagination.events);case"eu":return"".concat(v.buttons.see_all_events_of," ").concat(E.toLowerCase(),"ko");default:return"".concat(v.buttons.see_all_events_of," ").concat(E.toLowerCase())}})()})}):(0,n.jsx)("div",{className:"flex-1"})]})]})}},79674:(e,t,r)=>{"use strict";r.d(t,{f:()=>o});var n=r(12115),a=r(63134);function o(){let[e,t]=(0,n.useState)([]),[r,o]=(0,n.useState)(!1),{userProfile:i,profileLoaded:s}=(0,a.s)(),l=e=>{if("undefined"==typeof document)return[];try{let t=localStorage.getItem(e)||"[]";return JSON.parse(t)}catch(e){return console.error("Error accessing localStorage:",e),[]}},c=(0,n.useCallback)(()=>{try{let e=[];for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);if(r.startsWith("rts_recent_events_")){let t=l(r);e=[...e,...t]}}let r=e.toSorted((e,t)=>new Date(t.visitedAt||"").getTime()-new Date(e.visitedAt||"").getTime()),n=[];for(let e of r)n.some(t=>t.eventId===e.eventId)||n.push(e);let a=n.slice(0,12);t(a),o(!0)}catch(e){console.error("Error parsing recent events from localStorage:",e),t([])}},[]),d=(0,n.useCallback)(e=>{if("undefined"!=typeof document)try{let n=(t=null==i?void 0:i.id)?"rts_recent_events_".concat(t):"rts_recent_events_visitor",a=l(n),o=a.findIndex(t=>t.eventId===e.eventId);-1!==o&&a.splice(o,1),a.unshift({...e,userId:null==i?void 0:i.id,visitedAt:new Date});let s=a.slice(0,12);var t,r=JSON.stringify(s);if("undefined"!=typeof document)try{localStorage.setItem(n,r)}catch(e){console.error("Error setting localStorage:",e)}}catch(e){console.error("Error saving recent events to localStorage:",e)}},[null==i?void 0:i.id]);return(0,n.useEffect)(()=>{r||c()},[c,r]),{recentlyViewedEvents:e,addEvent:d,recentlyViewedEventsLoaded:r}}}}]);
2//# sourceMappingURL=1378-243a7410c7049a25.js.map

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.