(function(e){function t(t){for(var o,r,s=t[0],c=t[1],u=t[2],l=0,d=[];l1?n("div",{staticClass:"fbOverlay_pagination"},e._l(e.loginPromptQueue,(function(e,t){return n("span",{key:t,staticClass:"fbOverlay_dot",class:{"fbOverlay_dot--active":0===t}})})),0):e._e()])]],2)])],1):e._e()])},Oe=[],De=n("3dae"),je=n("25e7"),Se={name:"FreeBetLoginPromptOverlay",components:{SvgIcon:De["a"]},data:function(){return{loginPromptQueue:[],hasLoaded:!1,isDetailView:!1,robotDetectDismissed:!!sessionStorage.getItem("robotDetectBannerDismissed")}},computed:{currentPrompt:function(){var e;return null!==(e=this.loginPromptQueue[0])&&void 0!==e?e:null},isFreeBetEnabled:function(){return this.$store.getters["featureToggle/isFreeBetEnabled"]},accountId:function(){return this.$store.state.account.customerInfo.accountId},isRobotDetectBannerEnabled:function(){var e,t;return!!(null===(e=this.$store.state.account.customerInfo)||void 0===e||null===(t=e.featureConfig)||void 0===t?void 0:t.isRobotDetectBannerEnabled)},isBlockedByRobotDetect:function(){return this.isRobotDetectBannerEnabled&&!this.robotDetectDismissed},isHomePage:function(){return["Main","MainBySport"].includes(this.$route.name)},shouldShowOverlay:function(){return!!this.currentPrompt&&!this.isBlockedByRobotDetect&&this.isHomePage},formattedAmount:function(){var e,t;return this.formatWithCommas(null!==(e=null===(t=this.currentPrompt)||void 0===t?void 0:t.freeBetAmount)&&void 0!==e?e:0)}},watch:{currentPrompt:function(){this.isDetailView=!1},shouldShowOverlay:function(e){document.body.style.overflow=e?"hidden":""}},mounted:function(){this.isFreeBetEnabled&&this.accountId&&!this.hasLoaded&&this.loadQueue(),document.body.style.overflow=this.shouldShowOverlay?"hidden":"",window.addEventListener("castor:robotDetect:dismissed",this.onRobotDetectDismissed),window.addEventListener("keydown",this.onKeyDown)},beforeDestroy:function(){document.body.style.overflow="",window.removeEventListener("castor:robotDetect:dismissed",this.onRobotDetectDismissed),window.removeEventListener("keydown",this.onKeyDown)},methods:{loadQueue:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,o,r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.hasLoaded=!0,t.prev=1,t.next=4,S["default"].getLoginPromptFreeBets();case 4:a=t.sent,0===(null===(n=a.data)||void 0===n?void 0:n.errorCode)&&(null===(o=a.data)||void 0===o||null===(r=o.result)||void 0===r?void 0:r.items)&&(e.loginPromptQueue=a.data.result.items),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](1),console.error("[FreeBetLoginPromptOverlay] loadQueue failed",t.t0);case 11:case"end":return t.stop()}}),t,null,[[1,8]])})))()},handleDismiss:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.currentPrompt){t.next=2;break}return t.abrupt("return");case 2:return n=e.currentPrompt.freeBetCode,t.prev=3,t.next=6,S["default"].alreadyShowFreeBetWhenLogin(n);case 6:t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](3),console.error("[FreeBetLoginPromptOverlay] alreadyShowFreeBetWhenLogin failed",t.t0);case 11:e.loginPromptQueue.shift();case 12:case"end":return t.stop()}}),t,null,[[3,8]])})))()},handleViewDetail:function(){this.isDetailView=!0},onRobotDetectDismissed:function(){this.robotDetectDismissed=!0},onKeyDown:function(e){"Escape"===e.key&&this.shouldShowOverlay&&(this.isDetailView?this.isDetailView=!1:this.handleDismiss())},formatExpiresAt:function(e){return Object(je["a"])(e)}}},Be=Se,Pe=(n("0b60"),Object(w["a"])(Be,Ie,Oe,!1,null,"21fa7fd9",null)),Te=Pe.exports,Ce=n("685e"),ke=n("51a4"),Ae={name:"Sports",components:{ProductPlatform:q,BetSlip:W["a"],BottomFunction:I["a"],Message:G["a"],PopupAcceptAnyOdds:C,PopupBetBuilderTutorial:L,PopupVoucherRedeem:fe,RobotDetectBanner:_e,FreeBetLoginPromptOverlay:Te,BackToTop:Y["a"],Balance:_},mixins:[ke["a"]],data:function(){return{selectedOddsPosition:0,selectedOddsPrePosition:0,redirectFrom:new URLSearchParams(window.location.search).get("n"),showBBTutorial:"true"!==localStorage.getItem("isShowBBTutorial")}},computed:Object(o["a"])(Object(o["a"])(Object(o["a"])(Object(o["a"])(Object(o["a"])(Object(o["a"])({},Object(m["c"])("headerDisplay",["ppHeight"])),Object(m["c"])(["isAsi","topScreenToast","showAcceptAnyOddsBanner","oddsPosition","isMixParlayMode"])),Object(m["c"])("betSlip",["betSlipSingle","betSlipMixParlay"])),Object(m["c"])("account",["customerInfo"])),Object(m["b"])("localization",["isIndiaSite"])),{},{isFreeBetEnabled:function(){return this.$store.getters["featureToggle/isFreeBetEnabled"]}}),watch:{showAcceptAnyOddsBanner:{immediate:!0,handler:function(e){e?Object(z["a"])():Object(z["b"])()}},oddsPosition:function(){this.selectedOddsPosition=this.oddsPosition,this.selectedOddsPrePosition===this.selectedOddsPosition||this.isMixParlayMode||0===this.selectedOddsPosition||(this.handleOpenTicketScrollOdds(this.selectedOddsPosition),this.selectedOddsPrePosition=this.selectedOddsPosition)}},created:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var n,o,r,i,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.isAsi&&(e.handleGoToTargetPage(),e.handleReloadBetSlip(),e.handleAaoBanner(),e.handleMatchDetailRedirect()),n=Object.keys(e.betSlipSingle)[0],o=e.betSlipSingle[n],!o){t.next=8;break}return t.next=6,e.$store.dispatch("betSlip/removeTicket",n);case 6:return t.next=8,e.$store.commit("setOddsPosition",0);case 8:e.$windowEventBus.$on("sports.closedBetslip",e.closedBetSlip),e.$once("hook:beforeDestroy",(function(){e.$windowEventBus.$off("sports.closedBetslip",e.closedBetSlip)})),r=p()(e.handleScrollBackToTop,200),window.addEventListener("scroll",r),e.$once("hook:beforeDestroy",(function(){window.removeEventListener("scroll",r)})),i=p()(e.handleScrollEvent,200),window.addEventListener("scroll",i),e.$once("hook:beforeDestroy",(function(){window.removeEventListener("scroll",i)})),e.customerInfo.featureConfig.isgaEnabled&&(s=new Ce["a"],s.init("G-VCE1W4NMKX"),e.customerInfo.featureConfig.isVoucherButtonEnabled&&s.pushCustomEvent("page_view",{username:e.customerInfo.accountId,value:"view_sportsbook"})),a["a"].identify(String(e.customerInfo.accountId));case 18:case"end":return t.stop()}}),t)})))()},methods:{goForwardPage:function(){window.history.back()},closeAcceptAnyOddsBanner:function(){this.$store.commit("setShowAcceptAnyOddsBanner",!1),this.$store.commit("setFailedPlaceBetShowAaoBanner",!1)},handleReloadBetSlip:function(){var e=this,t=JSON.parse(window.localStorage.getItem("tempBetSlipExpiration")),n=window.localStorage.getItem("tempBetSlipSingle")?"":JSON.parse(window.localStorage.getItem("tempBetSlipSingle")),o=window.localStorage.getItem("tempBetSlipMixParlay")?"":JSON.parse(window.localStorage.getItem("tempBetSlipMixParlay"));window.localStorage.removeItem("tempBetSlipExpiration"),window.localStorage.removeItem("tempBetSlipSingle"),window.localStorage.removeItem("tempBetSlipMixParlay");var r=(new Date).getTime()>t;n&&o&&!r&&(this.$store.dispatch("betSlip/setBetSlipSingle",n),this.$store.dispatch("betSlip/setBetSlipMixParlay",o)),window.onbeforeunload=function(){window.localStorage.setItem("tempBetSlipExpiration",JSON.stringify((new Date).getTime()+15e3)),window.localStorage.setItem("tempBetSlipSingle",JSON.stringify(e.betSlipSingle)),window.localStorage.setItem("tempBetSlipMixParlay",JSON.stringify(e.betSlipMixParlay))}},handleAaoBanner:function(){if(null===this.showAcceptAnyOddsBanner){var e=s.a.get("SportsAaoPopup");e&&this.$store.commit("setShowAcceptAnyOddsBanner",!1)}},handleMatchDetailRedirect:function(){var e=s.a.get("matchDetailRoute");e&&(this.$router.push(JSON.parse(e)),s.a.remove("matchDetailRoute",{domain:Object(le["c"])()}))},handleGoToTargetPage:function(){var e=s.a.get("SwitchToSportsTargetPage");s.a.remove("SwitchToSportsTargetPage",{domain:Object(le["c"])()}),e&&""!==e&&this.$router.push({name:e})},closedBetSlip:function(){this.$store.commit("betSlip/setShowBetSlip",!1),this.$store.dispatch("betSlip/setBetSlipSingle",{})}}},$e=Ae,Me=(n("774c"),Object(w["a"])($e,u,l,!1,null,null,null)),Re=Me.exports,xe=n("8b00"),Ee=(n("e2c2"),n("6b5e")),Ve=n("04e9"),Le=n("41cb"),Ne=n("4360");n("bb53");function Fe(){return(ce=ce||Object(r["a"])(regeneratorRuntime.mark((function e(){var t,o,r,a,i,c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return Object(Ee["b"])(window.location.search),e.next=3,Ne["a"].dispatch("initApiInfo");case 3:if(t=e.sent,t){e.next=6;break}throw new Error("initApiInfo failed");case 6:return o=new URLSearchParams(window.location.search),r=o.get("loginname")||"",sessionStorage.setItem("loginname",r),e.next=11,n.e("chunk-68490b09").then(n.bind(null,"baa8"));case 11:if(a=e.sent,i=a.apolloProvider,c=a.provideApollo,!Ne["a"].state.isAsi){e.next=27;break}return s.a.set("SportsHaveSession",1,{domain:Object(le["c"])()}),s.a.remove("switchToMPPage",{domain:Object(le["c"])()}),localStorage.setItem("isAcceptAnyCashOutValue",Ne["a"].state.account.isAcceptAnyCashOutValue),e.next=20,S["default"].updateIsAcceptAnyCashOutValue(Ne["a"].state.account.isAcceptAnyCashOutValue);case 20:if(!Ne["a"].state.account.customerInfo.displayName){e.next=24;break}Ne["a"].state.account.customerInfo.featureConfig.isSports568&&window.document.documentElement.setAttribute("data-theme","Green"),e.next=25;break;case 24:return e.abrupt("return",setTimeout(Fe,500));case 25:e.next=28;break;case 27:Object(xe["b"])(xe["a"].promoCode);case 28:return e.next=30,Object(Ve["c"])();case 30:return Ne["a"].state.featureToggle.isShowBlockSportsAlert&&alert("Due to a change in our PAGCOR regulation, you are no longer allowed to place any bets in Sports."),e.abrupt("return",{apolloProvider:i,provideApollo:c});case 32:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object(Ve["e"])(),c["default"].config.ignoredElements=["sports-widget"];var He="qpxfihoagk";a["a"].init(He),Fe().then((function(e){var t=e.apolloProvider,a=e.provideApollo;new c["default"]({i18n:ue["a"],router:Le["a"],store:Ne["a"],apolloProvider:t,setup:function(){a()},data:function(){return{clockIntervalId:0,getPpHeightAttempt:0}},created:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$windowEventBus.$on("product.updateLanguage",e.changeLanguage),e.$windowEventBus.$on("product.logout",e.logout),e.$windowEventBus.$on("product.ppReady",e.ppReady),e.clockIntervalId=setInterval((function(){e.$root.$emit("tick")}),1e3);case 4:case"end":return t.stop()}}),t)})))()},mounted:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.checkAndRedirectToSportWithEvents();case 2:e.$nextTick((function(){e.$root.$emit("triggerInitialSportsFetch")}));case 3:case"end":return t.stop()}}),t)})))()},beforeDestroy:function(){this.$windowEventBus.$off("product.updateLanguage",this.changeLanguage),this.$windowEventBus.$off("product.logout",this.logout),this.$windowEventBus.$off("product.ppReady",this.ppReady),clearInterval(this.clockIntervalId)},methods:{checkAndRedirectToSportWithEvents:function(){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function t(){var r,a,i,s,c,u,l,d,p,m,f,h,v,b,g,w;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,r=e.$route.name,"MainBySport"===r){t.next=4;break}return t.abrupt("return");case 4:return t.next=6,n.e("chunk-68490b09").then(n.bind(null,"baa8"));case 6:return a=t.sent,i=a.apolloClient,t.next=10,Promise.resolve().then(n.t.bind(null,"5fd3",7));case 10:return s=t.sent,c=s.SportsInfoQuery,t.next=14,Promise.resolve().then(n.bind(null,"bb0a"));case 14:return u=t.sent,t.next=17,Promise.resolve().then(n.bind(null,"e2c2"));case 17:return l=t.sent,t.next=20,i.query({query:c,variables:{query:{}},fetchPolicy:"network-only",errorPolicy:"all"});case 20:d=t.sent,p=d.data.sportsInfo,p&&p.length>0&&(m=p.map((function(e){return Object(o["a"])(Object(o["a"])({},e),{},{sportType:u.default.EnumSportType[e.sport],hasEvents:e.eventCount+e.outrightTournamentCount>0})})),f=Ne["a"].state.sportType,h=m.find((function(e){return e.sportType===f})),v=h&&h.hasEvents,v||(b=m.find((function(e){return e.hasEvents})),b&&(g=l.default.sportType.toRouteName(b.sportType),w="MainBySport"===e.$route.name&&e.$route.params.sportRouteName===g,w||e.$router.push({name:"MainBySport",params:{sportRouteName:g}})))),t.next=27;break;case 25:t.prev=25,t.t0=t["catch"](0);case 27:case"end":return t.stop()}}),t,null,[[0,25]])})))()},logout:function(e){S["default"].logout(e),this.$store.commit("betBuilder/setMixParlayEventIds",[])},ppReady:function(){var e=this;if(window.isPpReady=!0,"undefined"!==typeof MutationObserver){var t=new MutationObserver((function(){e.setPpHeight()})),n=document.querySelector("#pp-component");if(null===n)return;t.observe(n,{childList:!0})}this.setPpHeight()},setPpHeight:function(){var e,t=null===(e=document.querySelector(".sboMenu-header"))||void 0===e?void 0:e.clientHeight;t&&this.$store.dispatch("headerDisplay/setState",{ppHeight:t}),this.getPpHeightAttempt<20&&(this.getPpHeightAttempt++,setTimeout(this.setPpHeight,500))}},render:function(e){return e(Re)}}).$mount("#sports")})).catch((function(e){console.error(e)}))},b368:function(e,t,n){"use strict";var o=n("e033"),r=n.n(o);r.a},bb53:function(e,t,n){},e033:function(e,t,n){},e542:function(e,t,n){var o={"./img_voucherTutorial_EN.png":"4296","./img_voucherTutorial_ID_ID.png":"5d7e","./img_voucherTutorial_JA_JP.png":"98cd","./img_voucherTutorial_KO_KR.png":"510c","./img_voucherTutorial_MY_MM.png":"774a","./img_voucherTutorial_TH_TH.png":"44a4","./img_voucherTutorial_VI_VN.png":"163f","./img_voucherTutorial_ZH_CN.png":"5959"};function r(e){var t=a(e);return n(t)}function a(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=a,e.exports=r,r.id="e542"},f9b5:function(e,t,n){}}); //# sourceMappingURL=sports.2d1d518b.js.map