PageSourceSearch

https://www.il.betmgm.com/ClientDist/browser/preloader.4c8c6bf7e970.js

js betmgm.com collected 2026-09-24 09:01:46 UTC 11,280 bytes, 3 lines download raw bytes

1if(MS2JS===void 0){var MS2JS={};(function(){window._boot.then(()=>{if(!globalThis.clientConfig)return;const{vnPage:S,vnDevice:$,haApp:N,msImages:v,msPreloader:x,msTeasers:Q,vnUser:X}=globalThis.clientConfig,R=N.productApiUrls.sports;function G(s){try{const d=new URL(s),u=new URL(R);d.hostname=u.hostname,d.port=u.port,s=d.href}catch{s=R+s}return s}MS2JS.Http=new(function(){return{get:d,post:u,getMS2Api:s};function s(p,g){const h={"x-bwin-browser-url":globalThis.location.href,"X-XSRF-TOKEN":T("XSRF-TOKEN")};h["x-bwin-sports-api"]=S.environment,d(G(p),g,{headers:h})}function d(p,g,h){m(p,"GET",g,h)}function u(p,g,h){m(p,"POST",g,h)}function m(p,g,h,y){y=y||{};const k=Object.assign({},{"Content-Type":"application/json;charset=UTF-8"},y.headers||{}),L=y.data?JSON.stringify(y.data):void 0;return fetch(p,{method:g,cache:"no-cache",credentials:"include",headers:k,body:L}).then(U=>U.json()).then(U=>h(null,U)).catch(U=>{console.error(U),h(U)})}function T(p){const h=`; ${document.cookie}`.split(`; ${p}=`);if(h.length===2)return h.pop().split(";").shift()}}),MS2JS.GridGroupLoader=new(function(){let s=!1,d=null,u=!1;const m="x-bwin-cds-api";return T(),{loading(){return s},error(){return u},data(){return d},reset(){s=!1,d=null,u=!1}};function T(){s=!0,MS2JS.Http.get(x.groupingUrl,function(p,g){u=!!p,s=!1,d=g},{headers:S.isProduction?{}:{[m]:x.cdsApiUrl}})}}),MS2JS.ModularHomePageDataLoader=new(function(){let s=!1,d=null,u=!1,m=null;return T(),{loading(){return s},error(){return u},data(){return d},requestContext(){return m},reset(){s=!1,m=null,d=null,u=!1}};function T(){const e=M();if(!E()&&!e)return;const t=p(e,y()),a=g(t);s=!0;const r=y();!E()&&!e||(s=!0,L(a,(i,o)=>{u=!!i,s=!1,d=o,m=t,o?.widgets&&(O(o.widgets),h(o.widgets,r,e,m.sportId))}))}function p(e,t,a){if(e){const r=globalThis.location.pathname.split("-").at(-1);return{page:"SportLobby",layoutSize:t,sportId:Number.parseInt(r)}}return{page:"HomeLobby",layoutSize:t,widgetId:a,promoBannerPreview:globalThis.location.search.includes("offerId")&&globalThis.location.search.includes("sitecoreId")}}function g(e){const t=new URL(`${x.pagePrefix}/api/widget`,`${globalThis.location.protocol}//${globalThis.location.host}`);return t.searchParams.set("layoutSize",e.layoutSize),t.searchParams.set("page",e.page),e.page==="SportLobby"&&t.searchParams.set("sportId",e.sportId),e.widgetId&&(t.pathname+="/widgetdata",t.searchParams.set("widgetId",e.widgetId),t.searchParams.set("shouldIncludePayload","true")),X.isAuthenticated&&t.searchParams.set("isAuth","1"),e.promoBannerPreview&&t.searchParams.set("promoBannerPreview","true"),decodeURIComponent(t.pathname+t.search)}async function h(e,t,a,r){const i=$.isMobile?$.isTablet?"tablet":"phone":"desktop",o={headers:{accept:"application/json, text/plain, */*","X-From-Product":S.product,"x-bwin-browser-url":globalThis.location.href,"x-app-context":"default","x-device-type":`${i}_${$.osName}`,"sports-api-version":"SportsAPIv2"}};o.headers["x-bwin-sports-api"]=S.environment,await Promise.all(e.filter(c=>!c.shouldIncludePayload&&["Center","Top"].includes(c.location)).sort((c,f)=>c.order-f.order).slice(0,6).map(c=>{const f=R||`${globalThis.location.protocol}//${globalThis.location.host}`,l=new URL(`${x.pagePrefix}/api/widget/widgetdata`,f);if(l.searchParams.set("layoutSize",t),l.searchParams.set("page",a?"SportLobby":"HomeLobby"),r&&l.searchParams.set("sportId",r),l.searchParams.set("widgetId",c.id),c.type=="TopEvents"&&l.searchParams.set("useAggregateMatchList",globalThis.clientConfig.msTopEvents.useAggregateMatchList),l.searchParams.set("shouldIncludePayload",!0),c.type==="RotatingTeaser")return fetch(decodeURIComponent(l.href),o).then(n=>n.ok?n.json():null).then(n=>{if(n?.widgets?.length){const b=n.widgets.find(P=>P.visible&&P.type==="RotatingTeaser");b&&globalThis.clientConfig.msPreloader?.teaserLcpPlaceholderWaitForSelector&&t==="Small"&&Y(b)}});if(c.type==="Marquee"){l.searchParams.set("marqueesOnly",!0),l.searchParams.set("shouldIncludePersonalizedData",!1);const n=new URL(l.href.replace("widgetdata","personalizedWidgetData"));return n.searchParams.set("shouldIncludePersonalizedData",!0),Promise.all([fetch(decodeURIComponent(l.href),o).then(b=>b.ok?b.json():[]),fetch(decodeURIComponent(n.href),o).then(b=>b.ok?b.json():[])]).then(([b,P])=>{const z=b.widgets?.filter(w=>w.visible&&w.type==="Marquee").sort((w,F)=>w.order-F.order)?.[0],A=P.widgets?.filter(w=>w.visible&&w.type==="Marquee").sort((w,F)=>w.order-F.order)?.[0],j=z||A;var te=W(z?.payload,A?.payload);B(j,z?.payload,A?.payload),globalThis.clientConfig.msMarquee?.lcpPlaceholderWaitForSelector&&t==="Small"&&V(j,te)})}return fetch(decodeURIComponent(l.href),o)}))}function y(){return globalThis.matchMedia("(min-width:601px) and (max-width: 1279px)").matches?"Medium":globalThis.matchMedia("(min-width: 1280px)").matches?"Large":"Small"}function O(e){const t=y(),a=e.find(n=>n.type==="StaticTeaser");J(a);const r=e.find(n=>n.type==="StoryContent");U(r);const i=e.find(n=>n.type==="RotatingTeaser");K(i);const o=e.find(n=>n.type==="Marquee");B(o,o?.payload,null);
1const c=e.find(n=>n.type==="Banner"&&!!n.payload?.imageUrl);ee(c);const f=e.filter(n=>n.type==="PopularMultiBets"&&n.visible);k(f);const l=e.find(n=>n.type==="ShowCase"&&n.shouldIncludePayload);l&&globalThis.clientConfig.msPreloader?.showcaseLcpPlaceholderWaitForSelector&&t==="Small"&&Z(l)}function k(e){const t=M(),a=y(),r=new Set;for(const i of e){if(!i.id)continue;const o=p(t,a,i.id),c=g(o);L(c,(f,l)=>{if(f||!l?.widgets?.length)return;const n=l.widgets[0];if(!(!n.visible||!n.payload?.pods?.length))for(const b of n.payload.pods){const{backgroundImage:P}=b;P&&!r.has(P.src)&&(r.add(P.src),I(P.src))}})}}function L(e,t){MS2JS.Http.getMS2Api(e,function(a,r){t(a,r)})}function U(e){if(e){const t=e.payload.stories,a=t?.length>0?t[0]:null;if(a?.tileImage){const r=t.length>1,i=new URL(a?.tileImage),c=`width${r?"540":"160"}`;i.searchParams.set("p",c),I(i.toString())}}}function W(e,t){var a=e?.tiles||[],r=t?.tiles||[],i=a.concat(r);if(!i.length)return null;if(t&&!t.isPersonalizedMarquee&&r.length){var o=t.sitecoreIds||[];o.length&&i.sort(function(c,f){var l=c.trackingDetail?.sitecoreTemplateId||"",n=f.trackingDetail?.sitecoreTemplateId||"";return l=l.slice(Math.max(0,l.lastIndexOf("/")+1)),n=n.slice(Math.max(0,n.lastIndexOf("/")+1)),o.indexOf(l)-o.indexOf(n)})}return i[0]}function B(e,t,a){var r=W(t,a);if(!r&&e?.payload?.tiles?.length>0&&(r=e.payload.tiles[0]),r?.imageUrl){var i=["280","560"].map(function(o,c){return C(r.imageUrl,o)+" "+(c+1)+"x"});I(r.imageUrl,null,i)}}function K(e){if(e){const t=e.payload.teasers;if(t?.length>0&&t[0].imageUrl){const a=t[0].imageUrl,r=["480","640","768"].map(o=>`${C(a,o)} ${o}w`).join(", ");I(a,"(min-width: 960px) 768px, 100vw",r)}}}function D(){return 128}function _(){return 168}function q(e){try{if(document.getElementById(e.id))return;const t=document.createElement("div");if(t.id=e.id,t.style=e.containerStyle,e.backgroundImage)t.style.backgroundImage=e.backgroundImage,e.preloadImage&&e.imageUrl&&I(e.imageUrl);else if(e.imageUrl){const i=document.createElement("img");i.src=e.imageUrl,e.srcSet&&(i.srcset=e.srcSet),e.sizes&&(i.sizes=e.sizes),i.fetchPriority="high",i.style="width: 100%; height: 100%; object-fit: cover;",t.append(i)}else return;t.style.display="none",document.body.insertBefore(t,document.body.firstChild);const a=e.waitForSelector;if(!a){t.remove();return}if(document.querySelector(a)){t.style.display="";return}const r=new MutationObserver((i,o)=>
1{if(t.dataset.dismissed){o.disconnect();return}document.querySelector(a)&&(t.style.display="",o.disconnect())});r.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{r.disconnect(),t.style.display="none"},1e4)}catch(t){console.error("LCP "+e.errorContext+" placeholder error:",t)}}function V(e,t){const a=t||e?.payload?.tiles?.[0];if(!a?.imageUrl)return;const r=a.imageUrl,i=["280","560"].map((c,f)=>`${C(r,c)} ${f+1}x`).join(", "),o=D();q({id:"preloader-marquee-lcp",containerStyle:"position: absolute; top: "+o+"px; left: 8px; width: 280px; height: 140px; overflow: hidden; z-index: 2; border-radius: 8px;",imageUrl:r,srcSet:i,waitForSelector:globalThis.clientConfig.msMarquee?.lcpPlaceholderWaitForSelector,errorContext:"marquee"})}function Y(e){const t=e?.payload?.teasers;if(!t?.length||!t[0].imageUrl)return;const a=t[0].imageUrl,r=["480","640","768"].map(f=>`${C(a,f)} ${f}w`).join(", "),i="(min-width: 960px) 768px, 100vw",o=D(),c=Q?.teaserAspectRatio??3.2;q({id:"preloader-teaser-lcp",containerStyle:"position: absolute; top: "+o+"px; left: 0; width: 100%; aspect-ratio: "+c+"; max-height: 240px; overflow: hidden; z-index: 2;",imageUrl:a,srcSet:r,sizes:i,waitForSelector:globalThis.clientConfig.msPreloader?.teaserLcpPlaceholderWaitForSelector,errorContext:"teaser"})}function Z(e){const t=e?.payload?.fixtures;if(!t?.length)return;const a=t[0]?.fixture?.sport?.id;if(!a)return;const i=(globalThis.clientConfig.msShowcase?.backgrounds||[]).find(l=>l.id===a||l.id===String(a));if(!i?.imageSrc)return;let o=i.imageSrc;v?.imageQualityParams?.homePage?.showCase&&(o=H(o,v.imageQualityParams.allowedImageTypes,v.imageQualityParams.homePage.showCase));const c=o.includes("?")?"&p=width540":"?p=width540";o=o+c;const f=_();q({id:"preloader-showcase-lcp",containerStyle:"position: absolute; top: "+f+"px; left: 0; width: 100%; height: 340px; overflow: hidden; z-index: 2; background-size: cover; background-position: center;",backgroundImage:"linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url("+o+")",imageUrl:o,preloadImage:!0,waitForSelector:globalThis.clientConfig.msPreloader?.showcaseLcpPlaceholderWaitForSelector,errorContext:"showcase"})}function J(e){if(e){const t=e.payload;if(t?.imageUrl){const a=`${t.imageUrl}?p=width540`;I(a)}}}function ee(e){if(e){let t=e.payload.imageUrl;v?.imageQualityParams?.homePage?.casinoBanner&&(t=H(t,v.imageQualityParams.allowedImageTypes,v.imageQualityParams.homePage.casinoBanner)),I(t)}}function H(e,t,a){const r=new RegExp(t,"i");return e&&e.match(r)&&!e.includes("q=")?e+=e.includes("?")?`&${a}`:`?${a}`:e}function C(e,t){return`${e}${e.includes("?")?"&":"?"}w=${t}`}function I(e,t,a){const r=document.createElement("link");r.rel="preload",r.href=e,t&&(r.imageSizes=t),a&&(r.imageSrcset=a),r.as="image",r.setAttribute("fetchpriority","high"),document.head.append(r)}}),MS2JS.SiteMapLoader=new(function(){let s=!1,d=null,u=!1;return m(),{loading(){return s},error(){return u},data(){return d},reset(){s=!1,d=null,u=!1}};function m(){if(!x.loadSitemap)return;s=!0;const p=globalThis.clientConfig.msLayoutNavigation?.isFlexibleTopNavV3Enabled?"?flexible=true":"";MS2JS.Http.getMS2Api(`${x.pagePrefix}/api/sitemap${p}`,function(g,h){u=!!g,s=!1,d=h})}}),MS2JS.TeaserPricesTableLoader=new(function(){let s=!1,d=null,u=!1;return m(),{loading(){return s},error(){return u},data(){return d},reset(){s=!1,d=null,u=!1}};function m(){s=!0,MS2JS.Http.getMS2Api(`${x.pagePrefix}/api/teaserbet/getLatestTeaserPrices`,function(T,p){u=!!T,s=!1,d=p})}});function M(){return/sports\/[^/]+-\d{1,3}\/?$/gm.test(decodeURI(globalThis.location.pathname))}function E(){return new RegExp(`${x.pagePrefix}$`,"i").test(globalThis.location.pathname)}})})()}
2//# debugId=14214012-87a8-5a7a-a73c-825b14df63fe
3//# sourceMappingURL=preloader.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.