"undefined"==typeof EventHandler&&(EventHandler={}); (function(){function t(a){try{var b=JsCache.get("#eventBoard").find("[id^=highLightEvent_]");0d&&EventHandler.eventTsMap.put(l.eventType,l.eventTs),l.marketTs>g&&EventHandler.marketTsMap.put(l.eventType,l.marketTs),l.selectionTs>c&&EventHandler.selectionTsMap.put(l.eventType,l.selectionTs),0'+h+""),$j("#eventBoard #"+g).after('
'))):parseInt($j("#eventBoard #"+g).attr("priority"))!=e.priority&&$j("#eventBoard #"+g).attr("priority",e.priority));h=null;if(0==$j("#highLightEvent_"+e.id).length){h=$j("#eventTemplate").clone();h.attr("competitionName",g);(function(x,z){return function(){NavigationHandler.navigationIds=[];location.href=PageConfig.fullMarketPath+"?eventType="+x.eventType+"&eventId="+x.id+"&marketId="+ z.marketId}})(e,n);var q=PageConfig.fullMarketPath+"?eventType="+e.eventType+"&eventId="+e.id+"&marketId="+n.marketId;h.find("#eventInfo").find("#vsName").attr("href",q);h.attr("id","highLightEvent_"+e.id);MultiMarketsHandler.bindPinEvent(h,e.eventType,e.id,n.marketId);MultiMarketsHandler.checkIsMultiMarket(h.find("#multiMarketPin"),e.eventType,e.id,n.marketId)}else h=$j("#highLightEvent_"+e.id);PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW&&EventHighlightUtil.displayAllBoardTotalMatched(e,n);HeadToHeadHandler.displayH2HIconButton(e, h,"hightLight");FancyBetMarketHandler.isEnableFancyBet()&&e.hasFancyBetMarkets?(h.find("#fancyBetIcon").show().css("display","inline-flex"),e.hasInPlayFancyBetMarkets?h.find(".game-fancy").addClass("in-play"):h.find(".game-fancy").removeClass("in-play")):h.find("#fancyBetIcon").hide();PageConfig.isEnableBookMaker&&e.hasBookMakerMarkets?(q=h.find("#bookMakerIcon"),q.show().css("display","inline-flex"),e.hasInPlayBookMakerMarkets?q.addClass("in-play"):q.removeClass("in-play")):h.find("#bookMakerIcon").hide(); SportsBookEventHandler.isEnableSportsBookBet()&&e.hasSportsBookMarkets?h.find("#sportsBookIcon_"+ApiSiteType.SPORTRADAR.unique()).show().css("display","inline-flex"):h.find("#sportsBookIcon_"+ApiSiteType.SPORTRADAR.unique()).hide();GeniusSportsEventHandler.isEnableSportsBookBet()&&e.hasGeniusSportsMarkets?h.find("#sportsBookIcon_"+ApiSiteType.GENIUSSPORTS.unique()).show().css("display","inline-flex"):h.find("#sportsBookIcon_"+ApiSiteType.GENIUSSPORTS.unique()).hide();1==e.isElectronic&&h.find("#sportsBookEIcon_"+ e.eventType).show().css("display","inline-flex");null!=e.streamingChannel&&0!=e.streamingChannel.length&&0!=e.streamingChannel?h.find("#streamingIcon").show().css("display","inline-flex"):h.find("#streamingIcon").hide();var r=e.name;if(EventType.getInstanceOf(e.eventType).isTwoTeamsEvent()){r=" v ";0"+r.trim()+""+v:(q=w[0],v=w[1],r=w[0]+""+r.trim()+""+w[1]);1==n.inPlay&&(r=EventHandler.getScoreInfo(e,q,v),r=q+r+v)}h.attr("eventType",e.eventType);h.attr("eventId",e.id);h.attr("marketId",n.marketId);h.attr("eventName",e.name);h.attr("openDate",e.openDate);h.attr("openDateTime",e.openDateTime);h.attr("totalMatched",n.totalMatched);h.attr("elapsedTime",e.elapsedTime);h.attr("inPlay", n.inPlay);h.attr("priority",e.priority);h.attr("boardType","highlight");h.find("#vsName").html(r);null!=n.inPlay&&1==n.inPlay&&(h.find("#playIcon").removeClass("icon-no_play"),h.find("#playIcon").addClass("icon-in_play"));null!=n.inPlay&&1==n.inPlay?EventHandler.updateEventCountdown(e,n,h):EventHandler.updateDateTimeInfo(n,h);0==$j("#highLightEvent_"+e.id).length&&EventHandler.bindEvent(h);EventHighlightUtil.displayAllBoardSelections(e,n,a);0==$j("#highLightEvent_"+e.id).length&&(PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW&& "competitionName"===k?(g=EventHandler.getCompetitionName(e.competitionName),p&&$j("#eventBoard #"+g+"Board").append(h.css("display","flex"))):p&&$j("#eventBoard").append(h.css("display","flex")),EventType.getInstanceOf(e.eventType).hasDraw()?($j("#gameHighlightWrap").addClass("col3"),h.find(".col-draw").show(),PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW?$j("#gameHighlightWrap .col-game").css("width",""):($j("#eventBoard dt").css("width","calc(64.1% - 41px)"),$j("#gameHighlightWrap .col-game").css("width", "calc(64.1% - 41px)"))):($j("#gameHighlightWrap").removeClass("col3"),h.find(".col-draw").hide(),PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW?($j("#eventBoard dt").css("width","calc(64.1% - 41px)"),$j("#gameHighlightWrap .col-game").css("width","calc(64.1% - 41px)")):$j("#gameHighlightWrap .col-game").css("width","")));f++;EventHighlightUtil.displayAllBoardMarketShowDisabled(e,n)}}else b.push(l)}EventHandler.bindToExpand($j("#eventBoard"));l=$j("#gameHighlightWrap");-1==c||EventType.getInstanceOf(c).hasDraw()? (l.addClass("col3"),l.find(".col-draw").show(),PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW?$j("#gameHighlightWrap .col-game").css("width",""):($j("#eventBoard dt").css("width","calc(64.1% - 41px)"),$j("#gameHighlightWrap .col-game").css("width","calc(64.1% - 41px)"))):(l.removeClass("col3"),l.find(".col-draw").hide(),PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW?($j("#eventBoard dt").css("width","calc(64.1% - 41px)"),$j("#gameHighlightWrap .col-game").css("width","calc(64.1% - 41px)")):$j("#gameHighlightWrap .col-game").css("width", ""));BetHandler.addSelectClass();c=$j("#eventBoard");a=c.find("[id^=highLightEvent_]");l=$j("#noDataDiv");0==a.length?l.show():l.hide();if(PageConfig.highlightEventType!=EventType.SOCCER.unique()&&PageConfig.highlightEventType!=EventType.E_SOCCER.unique()){for(u in b)l=b[u],d.splice(l,1);PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW||(d=d.map(function(x){return x.id}),u=a.length-1,b=c.find(a[u]),d.length==a.length&&ArrayUtil.indexOf(d,parseInt(b.attr("eventId")))!=u&&(a.sort(EventHandler.sortEventsOnUI), c.append(a)))}PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW&&EventHandler.reSortEventBoard()}}};EventHandler.bindEvent=a=>{a.find("#btnBack").click(function(){"true"==PageConfig.ENABLE_QUICK_BET&&0==PageConfig.isOneClickBet?QuickBetUtil.appendBoard(this,a,SideType.Back.unique()):BetHandler.clickBtn(this,!1)});a.find("#btnLay").click(function(){"true"==PageConfig.ENABLE_QUICK_BET&&0==PageConfig.isOneClickBet?QuickBetUtil.appendBoard(this,a,SideType.Lay.unique()):BetHandler.clickBtn(this,!1)})};EventHandler.getScoreInfo= function(a,b,d){var g="v";0('+f.sets+") "+f.games+" - "+c.games+" ("+c.sets+")"}else if(a.eventType==EventType.SOCCER.value||a.eventType==EventType.E_SOCCER.value||a.eventType==EventType.BASKETBALL.value){var k=0,p=0;if(a.eventType== EventType.BASKETBALL.value)null!=b&&null!=d&&b.trim()==f.name.trim()&&d.trim()==c.name.trim()?(k=f.score,p=c.score):(k=c.score,p=f.score);else if(a.eventType==EventType.SOCCER.value||a.eventType==EventType.E_SOCCER.value)null!=b&&null!=d&&b.trim()==c.name.trim()&&d.trim()==f.name.trim()?(k=c.score,p=f.score):(k=f.score,p=c.score);if(0<=f.score||0<=c.score)g=''+k+" - "+p+""}}return g};EventHandler.getEventDisplayName=function(a,b,d){var g=a.name,c=" v ";0";if(EventType.getInstanceOf(a.eventType).isTwoTeamsEvent()){for(var p=0;pf?-1:ck?1:ff?-1:ck?1:f'+a.inPlayStatus+ ""):(null==a.inPlayStatus&&(a.inPlayStatus="In-Play"),a=0'+a.inPlayStatus+"'":''+a.inPlayStatus+" "+a.elapsedTime+"'":''+a.inPlayStatus+""):(b=0,null==a.secondsPassed?(a.secondsPassed=0,a.uiTs=g):(b=(g-a.uiTs)/1E3,a.secondsPassed=b),a=(1+(b+a.secondsToStart)/60*-1+"").split(".")[0],a="0"==a?"Starting soon":"Starting in "+a+"' ");d.find("#dateTimeInfo").html(a);"Starting soon"== a?d.find("#dateTimeInfo").addClass("game-list-soon").removeClass("game-list-time"):d.find("#dateTimeInfo").addClass("game-list-time").removeClass("game-list-soon")};EventHandler.bindToExpand=function(a){PageConfig.ENABLE_EXPAND_HIGHT_LIGHT_VIEW&&a.find(".leagueTitle").unbind("click").click(function(){$j(this).hasClass("competition-expand")?($j(this).removeClass("competition-expand").addClass("competition-collapse"),$j('dl[competitionname="'+this.id).hide()):($j(this).removeClass("competition-collapse").addClass("competition-expand"), $j('dl[competitionname="'+this.id).show())})};EventHandler.sortEventsByViewType=function(a,b){var d=$j("#viewType").val();let g="asc"===$j("#viewType").find(":selected").attr("orderby")?1:-1;if("openDateTime"===d){d="asc"===$j("#viewType").find(":selected").attr("inplay")?1:-1;let c=a.eventType,f=b.eventType;return c===EventType.VIRTUAL_CRICKET.value&&f!==EventType.VIRTUAL_CRICKET.value?1:c!==EventType.VIRTUAL_CRICKET.value&&f===EventType.VIRTUAL_CRICKET.value?-1:d*((0==a.markets.length?0:a.markets[0].inPlay)- (0==b.markets.length?0:b.markets[0].inPlay))||g*(a.openDateTime-b.openDateTime)}if("totalMatched"===d){if(null!=a.markets[0]&&null!=b.markets[0])return g*(a.markets[0].totalMatched-b.markets[0].totalMatched)}else if("competitionName"===d)return("asc"===$j("#viewType").find(":selected").attr("priority")?1:-1)*(a.priority-b.priority)||g*a.competitionName.localeCompare(b.competitionName);return 0};EventHandler.reSortEventBoard=function(){if(!PageConfig.ENABLE_OCER_NAVIGATION){let b=$j("#viewType").val(), d="asc"===$j("#viewType").find(":selected").attr("orderby")?1:-1;$j("#viewType").find(":selected").attr("inplay");let g="asc"===$j("#viewType").find(":selected").attr("priority")?1:-1;var a=$j("#eventBoard").toArray().map(function(c,f){return c}).reduce(function(c,f){"competitionName"===b&&$j(f).find(".leagueTitle").toArray().forEach(function(k,p){c.leagueTitleAttr.push($j(k).attr("id"));c.priorityAttr.push(parseInt($j(k).attr("priority")))});"totalMatched"===b&&$j(f).find("[id^=highLightEvent_]").toArray().forEach(function(k, p){c.totalMatchedAttr.push(parseInt($j(k).attr("totalMatched")))});return c},{leagueTitleAttr:[],priorityAttr:[],openDateTimeAttr:[],totalMatchedAttr:[],inPlayAttr:[]});if("competitionName"==b){let c=EventHandler.isSorted(a.leagueTitleAttr,$j("#viewType").find(":selected").attr("orderby"));EventHandler.isSorted(a.priorityAttr,$j("#viewType").find(":selected").attr("priority"))&&c||(a=$j("#eventBoard").find(".leagueTitle").sort(function(f,k){let p=parseInt($j(f).attr("priority")),l=parseInt($j(k).attr("priority")); return g*(p-l)||d*f.id.localeCompare(k.id)}),$j("#eventBoard").find(".leagueTitle").detach(),$j("#eventBoard").append(a),$j("#eventBoard").find(".leagueBoard").toArray().forEach(function(f,k){k=$j(f).attr("id").replace("Board","");$j("#eventBoard").find(f).detach().insertAfter("#"+k)}))}else"openDateTime"===b||"totalMatched"!==b||EventHandler.isSorted(a.totalMatchedAttr,$j("#viewType").find(":selected").attr("orderby"))||(a=$j("#eventBoard").find("[id^=highLightEvent_]").sort(function(c,f){c=parseInt($j(c).attr(b)); f=parseInt($j(f).attr(b));return d*(c-f)}),$j("#eventBoard").find("[id^=highLightEvent_]").detach(),$j("#eventBoard").append(a))}$j("#eventBoard").find(".leagueBoard").toArray().forEach(function(b,d){$j("#"+b.id+":empty").length&&(b=b.id.replaceAll("Board",""),$j("#"+b).remove())})};EventHandler.getCompetitionName=function(a){return StringUtil.isEmpty(a)?"zzz":StringUtil.trim(a).replace(/[^a-zA-Z0-9_-]/g,"")};EventHandler.isSorted=function(a,b){for(let d=0;da[d+1]: a[d]