function initHeights(){sliderHeight=$(".rankingSlider ul.selectedWeek").height()+60;weekHeight={lastWeek:$(".rankingSlider ul.lastWeek").height()+60,thisWeek:$(".rankingSlider ul.thisWeek").height()+60}}function enforceCollapse(){typeof lblExpand!="undefined"&&$("#rankSliderToggle").text()==lblExpand&&($("#rankingMultiple .rankingSlider ul li:not(.winner)").hide(),$("#rankSliderToggle").is(":visible")&&$("#divRankingRules").hide())}function valignContent(){$(".rankingSlider").css("height",sliderHeight)}function weekHeightDisplay(){var r=$(".rankingSlider a.action.active").size(),n="",t,i;r==2?(t=$("#rankingMultiple .rankingSlider ul.lastWeek li").length,i=$("#rankingMultiple .rankingSlider ul.thisWeek li").length,n=t>i?"lastWeek":"thisWeek"):n=$(".rankingSlider a.action.active").attr("id");$.each(weekHeight,function(t){var r,u,i;n==t&&($(".rankingSlider ul."+t).hasClass("reduced")?(r=$("ul."+t+" .winner").height()+55,$("#divRankingRules").is(":visible")&&(r=r+20),$(".rankingSlider").animate({height:r},0)):(u=$("#rankingMultiple .rankingSlider ul."+t+" li").first().outerHeight()+3,i=$("#rankingMultiple .rankingSlider ul."+t+" li").length*u,i=i+60,$(".rankingSlider ul."+t+" li:not(.basic)").hasClass("userRank")&&(i=$("#rankingMultiple .rankingSlider ul."+t+" li").length*48,i=i+60),$(".rankingSlider ul."+t+" li.basic").hasClass("userRank")&&(i=$("#rankingMultiple .rankingSlider ul."+t+" li").length*48,i=i+70),$("#rankingMultiple .rankingSlider ul."+t+" li p.shareRank").length>0&&(i=i+$("#rankingMultiple .rankingSlider ul."+t+" li p.shareRank").length*26),$(".rankingSlider").animate({height:i},0)))})}function sliderDisplay(){typeof lblExpand!="undefined"&&typeof lblCollapse!="undefined"&&($("#rankSliderToggle").text()==lblExpand?($("#divRankingRules").show(),$("#rankSliderToggle").text(lblCollapse).toggleClass("minimized")):$("#rankSliderToggle").text()==lblCollapse&&($("#rankSliderToggle").is(":visible")&&$("#divRankingRules").hide(),$("#rankSliderToggle").text(lblExpand).toggleClass("minimized")));$("#rankingMultiple .rankingSlider ul").toggleClass("reduced");weekHeightDisplay();$("#rankingMultiple .rankingSlider ul li:not(.winner)").slideToggle(0)}function lockCurrentWeek(){$("#thisWeek").click();$("#lastWeek").addClass("disabled")}function lockPreviousWeek(){$("#lastWeek").click();$("#thisWeek").addClass("disabled")}function checkSliderDisplay(n){$("#rankingMultiple .rankingSlider ul."+n+" li").length<2?($("#rankSliderToggle").hide(),$("#divRankingRules").show()):($("#rankSliderToggle").show(),typeof lblExpand!="undefined"&&$("#rankSliderToggle").text()==lblExpand?$("#divRankingRules").hide():typeof lblCollapse!="undefined"&&$("#rankSliderToggle").text()==lblCollapse&&$("#divRankingRules").show())}function getCote(n,t){return n>1?(t=="us"&&(strcote=QuotationConversionjs(n,"us")),t=="uk"&&(strcote=QuotationConversionjs(n,"uk")),t=="eu"&&(strcote=AffichageMontant(Arrondir(n))),strcote):AffichageMontant(Arrondir(1))}function QuotationConversionjs(n,t){var i,o,s,r,u=[100,50,25,20,10,5,4,2,1],f,e;if(n==1||n==0)return n;if(t=="uk"){for(f=Math.round((n-1)*100)/100,e=f*100,i=0;i<=u.length-1;i++)if(r=e/u[i],Math.abs(r-Math.round(e/u[i]))<=.01){s=Math.round(r)+"/"+Math.round(r/f);break}return s}return o=n>=2?Math.round(1e4*(n-1))/100:Math.round(1e4/(1-n))/100,o.toString().replace(",",".")}function BettingSlipApiResources(n){this._informationLabel=n.InformationLabel;this._betLabel=n.BetLabel;this._betsLabel=n.BetsLabel;this._aboveMaxNumberOfSelectionsErrMsg=n.AboveMaxNumberOfSelectionsErrMsg;this._currencySymbol=n.CurrencySymbol}function BettingSlipApiParameters(n){this._maxBetAvailable=n.MaxBetAvailable;this._minBetAvailable=n.MinBetAvailable;this._maxNumberOfSelections=n.MaxNumberOfSelections;this._oddsFormat=n.OddsFormat;this._isSystemEnabled=n.IsSystemEnabled;this._isSystemVisible=n.IsSystemVisible;this._isBetterSelectionsEnabled=n.IsBetterSelectionsEnabled;this._isMailNotificationsEnabled=n.IsMailNotificationsEnabled;this._currencyCode=n.CurrencyCode;this._bonusMinOdds=n.BonusMinOdds;this._cancelBonusIfAnyBlocked=n.CancelBonusIfAnyBlocked;this._isLegalMaxBetAvailable=n.IsLegalMaxBetAvailable;this._isTaxFreeApplication=n.IsTaxFreeApplicable;this._taxFreeMinimumOdds=n.TaxFreeMinimumOdds;this._taxFreeMinimumBets=n.TaxFreeMinimumBets}function BettingSlipApiMultipleBonusResources(n){this._minNumberOfSelectionsLabel=n.MinNumberOfSelectionsLabel;this._addOneForBonusLabel=n.AddOneForBonusLabel;this._addMoreForBonusLabel=n.AddMoreForBonusLabel;this._nextBonusLabel=n.NextBonusLabel;this._includingBonusLabel=n.IncludingBonusLabel;this._includingBonusLimitedLabel=n.IncludingBonusLimitedLabel;this._eventBlockedLabel=n.EventBlockedLabel;this._oddsBlockedLabel=n.OddsBlockedLabel}function BettingSlipApiConfiguration(n){this._resources=new BettingSlipApiResources(n.Resources);this._parameters=new BettingSlipApiParameters(n.Parameters);!n.MultipleBonusResources||(this._multipleBonusResources=new BettingSlipApiMultipleBonusResources(n.MultipleBonusResources))}function updateStakesFieldset(n,t){function s(n){if(n.data.isActivated){var r=$(n.data.otherSfSelector,$bsContainer),i=$(this).parent(),u=null;i.hasClass("reduced")?i.find(".wrap-collapse").slideDown(t,function(){i.removeClass("reduced")}):i.find(".wrap-collapse").slideUp(t,function(){i.addClass("reduced")});i.hasClass("reduced")||$("input:text",i).attr("disabled")?r.hasClass("reduced")||$("input:text",r).attr("disabled")||(u=$("input:text",r)):u=r.hasClass("reduced")||$("input:text",r).attr("disabled")?$("input:text",i):$("input:text",n.data.setFocusByDefault?i:r);u&&u.focus()}}function f(n,t,i,r){n.off("click");n.on("click",{isActivated:t,otherSfSelector:!i?null:"div.stakes-fieldset"+i,setFocusByDefault:r},s)}function e(n,t,i,r){if(typeof t!="undefined"){var u=$("div.stakes-fieldset"+n),e=u.children(".stakes-fieldset-title :first"),o=u.attr("data-sf-activated")=="true";o!=t&&(e.off("click"),t?(u.hasClass("reduced")&&u.removeClass("reduced"),f(e,t,i,r)):u.removeClass("reduced").addClass("reduced"));u.attr("data-sf-activated",t)}}var u,i,r,o;t=t||0;$("#possible-win-single",$bsContainer).html(n.SimpleWinnings);$("#possible-win-combined",$bsContainer).html(n.MultipleWinnings);u=getNbSelections();e(".single",n.ActivateSimple,".multiple",!1);e(".multiple",n.ActivateMultiple,".single",!0);i=$("div.stakes-fieldset.single",$bsContainer);i.length>0&&(u==2&&n.PreviousCount==1&&i.find("input:text:first").val().length<=0&&!i.hasClass("reduced")?i.addClass("reduced"):u==1&&n.PreviousCount==2&&i.hasClass("reduced")&&i.removeClass("reduced"));BettingSlipApi.parameters.isSystemEnabled&&n.ActivateSystems&&(r=$("div.stakes-fieldset.systems",$bsContainer),o=r.children(".stakes-fieldset-title :first"),r.find("input:text").length>0&&r.find("input:text").val().length>0&&r.removeClass("reduced"),f(o,!0,null,!1))}function setEventListeners(){isBSScrollingEnabled&&($(window).resize(function(){checkBettingSlipPosition()}),$(window).scroll(function(){checkBettingSlipPosition()}),$(window).load(checkBettingSlipPosition));$(Config.BSTitleSelector,$bsContainer).hover(function(){$("#bs-empty-all").qtip({position:{my:"right center",at:"left center"}})});$("#bs-empty-all",$bsContainer).click(function(){isBetInProgress||cartApi.empty().done(function(n){$("."+OddButtonClass).removeClass(oddButtonSelectedClass);triggerEvent(document,"allChoicesRemovedFromTheCart");updateAfterSelectionChange(n);checkBettingSlipPosition();setupMultipleStake(!0);setupSystemStake(!0)})}),function(){function n(){bcTrack.track(spTrack.keys.categories.bettingSlip,"settings",spTrack.keys.labels.click);BettingSlipControls.BetSettings().slideToggle("fast")}BettingSlipControls.BetSettingsToggle().click(n);BettingSlipControls.BetSettings().find(".bs-settings-close").click(n);isImprovedSelectionsMode=BettingSlipApi.parameters.isBetterSelectionsEnabled;$("#bs-setting-selections").prop("checked",isImprovedSelectionsMode).change(function(){var n=$(this).prop("checked"),t,i;cartApi.setImprovedSelections(n);isImprovedSelectionsMode=n;bcTrack.track(spTrack.keys.categories.bettingSlip,"display selection checkboxes",n?"on":"off");t=$("#bettingslip .refine-selection");i=t.find("input");t.toggle(isImprovedSelectionsMode);isImprovedSelectionsMode||i.not(":checked").length>0&&(i.prop("checked",!0),cartApi.multipleSelections(getCombinationSelections()).done(updateAfterSelectionChange))});isSystemBetsVisible=BettingSlipApi.parameters.isSystemVisible;var t=$("#bs-setting-system");t.prop("checked",isSystemBetsVisible).change(function(){isSystemBetsVisible=t.prop("checked");bcTrack.track(spTrack.keys.categories.bettingSlip,"display system bets",isSystemBetsVisible?"on":"off");cartApi.setSystemBets(isSystemBetsVisible);BettingSlipControls.SystemPanel().toggle(checkSystemsVisibility());isSystemBetsVisible||BettingSlipControls.SystemStake().val("").trigger("keydown")});$("#bs-setting-email").prop("checked",BettingSlipApi.parameters.isMailNotificationsEnabled).change(function(){var n=$(this).prop("checked");bcTrack.track(spTrack.keys.categories.bettingSlip,"email notifications",n?"on":"off");cartApi.setEmailNotifications(n)});$("#bettingslip").on("change",".refine-selection input",function(){isImprovedSelectionsMode&&cartApi.multipleSelections(getCombinationSelections()).done(updateAfterSelectionChange)});$("#freebet-choose").change(function(){cartApi.setIsFreebet(this.checked).done(function(n){var t,i,r,u,f;for(updateQuickBet(n),t=0,i=n.CurrentSimplePossibleWinnings.length;t<i;t++)r=n.CurrentSimplePossibleWinnings[t].selectionId,u=n.CurrentSimplePossibleWinnings[t].selectionWinning,$("span[data-total-box-selection-id='"+r+"']").html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(u)));updateTotalStakeAndWinnings(n);f=CheckSimpleStakeMinimumOdds(n);f&&CheckMultipleStakeMinimumOdds(n);CheckDisplayError();CheckFreebetDisplay()})})}();$(document).on("mouseenter","."+OddButtonClass,function(){var n=$(this);n.hasClass(oddButtonSelectedClass)||n.hasClass(oddButtonNotClickable)||n.addClass(oddButtonHoverClass)}).on("mouseleave","."+OddButtonClass,function(){$(this).removeClass(oddButtonHoverClass)});if(isPrelive)$(document).on("click","."+OddButtonClass,function(){var t=$(this),n;spTrack.trackOddsClick(t);t.hasClass(oddButtonNotClickable)||(n=getSelectionId(t),t.hasClass(oddButtonSelectedClass)?isNewCalendarFFOn?betCartRemoveSelection(n):betCartRemove(n):isNewCalendarFFOn?betCartAddSelection(n):betCartAdd(n))});$bsContainer.on("click",Config.BSDeleteSelector,function(){var n=getSelectionId($(this).parent());isNewCalendarFFOn?betCartRemoveSelection(n):betCartRemove(n)});$("form",$bsContainer).submit(function(n){SubmitBetForm(n,$(this))})}function initStakes(){allowIndividualStakes?setupMultipleStake():setupComplexStakes(!1);!areStakesInitialized&&isPrelive&&BettingSlipApi.parameters.isSystemEnabled&&(areStakesInitialized=!0,setupSystemStake())}function setupSingleStakes(n){var t=BettingSlipControls.SimpleStakes(),i=$(t[0]),r=i.parent().find(".icon");r.click(function(){t.filter(":enabled").val(i.val());t.trigger("keydown");$(this).blur()});i.on("change keyup",function(){t.length>1&&i.val().length>0?r.css({display:"inline-block"}):r.hide()});i.trigger("change");t.typeWatchStake(function(){var i=$(this),r=$(this).val(),t,n;checkSimpleStakeIsValid($(this),!0);CheckDisplayError();t=getSelectionId(i);n=$(this);cartApi.simplestake(r,t,n).done(function(t){updateQuickBet(t);n.closest("*[data-selection-id]").find(".totalBox").html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(t.CurrentSimplePossibleWinning)));updateTotalStakeAndWinnings(t);var i=CheckSimpleStakeMinimumOdds(t);i&&CheckMultipleStakeMinimumOdds(t);CheckDisplayError()})},n)}function setupMultipleStake(){BettingSlipControls.MultipleStake().typeWatchStake(function(){var n=$(this),t;checkMultipleAndSystemStake(n,null);t=n.val();cartApi.multiplestake(getCombinationSelections(),t).done(function(t){n.data("bsActivateMultiple",t.ActivateMultiple);updateTotalStakeAndWinnings(t);CheckMultipleStakeMinimumOdds(t)})},!1)}function setupComplexStakes(n){$("#SimpleStake, #MultipleStake",$bsContainer).typeWatchStake(function(){var n=BettingSlipControls.SimpleStake(),t=BettingSlipControls.MultipleStake(),i,r;checkSimpleStakeIsValid(n);checkMultipleStakeIsValid(t);ManageTaxFreeMessage();CheckDisplayError();toggleStakeActiveState();i=n.val();r=t.val();cartApi.stakes(i,r).done(function(i){n.data("bsActivateSimple",i.ActivateSimple);t.data("bsActivateMultiple",i.ActivateMultiple);updateTotalStakeAndWinnings(i);toggleStakeActiveState()})},n)}function setupSystemStake(n){BettingSlipControls.SystemStake().typeWatchStake(function(){StoreSystemMultipleStatus("Ok");var n=getSystemStakeValue(),t=BettingSlipControls.GetSystemOptionSelected().val();cartApi.systemStake(n,t).done(function(n){updateTotalStakeAndWinnings(n)})},n);setupSystemCombobox()}function setupSystemCombobox(){var n=BettingSlipControls.SystemCombobox();n&&n.length!==0&&n.uniform({selectAutoWidth:!1}).change(function(){StoreSystemMultipleStatus("Ok");var n=getSystemStakeValue(),t=BettingSlipControls.GetSystemOptionSelected().val();cartApi.systemStake(n,t).done(function(n){updateSystemBox(n);updateTotalStakeAndWinnings(n)}).fail(function(){})})}function betCartRemove(n){return $("#bs-error-input-max-odds").hide(),cartApi.remove(n).done(function(t){setOddsHighLightInContainer($(document));triggerEvent(document,"choiceRemovedFromTheCart",{selectionId:n});Config.OnBetRemoved&&Config.OnBetRemoved();StoreSystemMultipleStatus("Ok");BettingSlipControls.SystemStake().val()&&BettingSlipControls.SystemStake().val("").trigger("change");updateAfterSelectionChange(t);checkBettingSlipPosition(!0)})}function _setOddsHighLight(n){var i=function(n){var t=arrayHelpers.first(cartApi.getIds(),function(t){return t.toString()===n});return t!==undefined},r=function(n,t){return n.lastIndexOf(t,0)===0},t=n.filter(function(){var t=$(this),n=t.attr("data-selection-id"),u,f;return(n||(u=t.attr("id"),u&&t.is("span")&&r(u,"CH_")?n=u.replace("CH_",""):(f=t.parents(".multiplexOdd").attr("id"),f&&(n=f))),!n)?!1:i(n)}),u=n.not(t);u.removeClass(oddButtonSelectedClass);t.removeClass(oddButtonHoverClass).addClass(oddButtonSelectedClass)}function betCartAdd(n){var t,i;return window.GlobalIsBeginnerMode?(t=new BetBeginnerApi,t.SimpleBet(n)):(i=IsValideCartAdd(n),i===!1)?null:(cartApi.add(n).done(function(t){if(typeof t.PopUp!="undefined"){var i=new frontApi;i.manageAjaxResult(t)}else setOddsHighLightInContainer($(document)),triggerEvent(document,"choiceAddedToTheCart",{selectionId:n}),StoreSystemMultipleStatus("Ok"),BettingSlipControls.SystemStake().val()&&BettingSlipControls.SystemStake().val("").trigger("change"),t.PreviousCount=getNbSelections(),updateAfterSelectionChange(t),checkBettingSlipPosition(),updateSimpleStakePossibleWinnings(),$bsContainer.trigger("bet.added",n)}),null)}function betCartToggle(n,t,i){cartApi.toggle(n).done(function(r){if(typeof r.PopUp!="undefined"){var u=new frontApi;u.manageAjaxResult(r);return}r.PreviousCount=getNbSelections();updateAfterSelectionChange(r);checkBettingSlipPosition();updateSimpleStakePossibleWinnings();Config.OnBetAdded&&Config.OnBetAdded(n,t,i)})}function restoreCart(){cartApi.restore().done(function(n){(new frontApi).manageAjaxResult(n)})}function DisplayAddNotification(n,t,i){var r=$("#"+n+".multiplexOdd");r.attr("data")==null&&(r=$("#CH_"+n));var u=r.attr("data"),f=r.text(),e=$("#"+n+"_label").text();i&&t&&($("#dummyUnicaOddClick").data("sportId",i).data("matchId",t).click(),($("#match_"+t).hasClass("liveBox")||$("#match_"+t).hasClass("live-box"))&&$.gritter.add({class_name:"oddStyle",title:resx_live_notif_bet,text:"<em>"+f+'<\/em><div class="oddEvent">'+u+"<\/div><div>"+resx_result+" : <span>"+e+"<\/span><\/div>",sticky:!1,time:"1800"}),$(".oddStyle .gritter-item").click(function(){$("html, body").animate({scrollTop:$("#liveBasketSelection").offset().top-40},500)}))}function getNbSelections(){return $(".bet",$bsContainer).length}function checkBettingSlipPosition(){function h(){var n=BettingSlipControls.SimpleStake(),t=BettingSlipControls.MultipleStake(),i=n.attr("disabled")==="disabled",r=t.attr("disabled")==="disabled";r?i||n.focus():t.focus()}function r(n){$bsContainer.stop().animate({marginTop:n},400,function(){Config.AutoFocusStake&&h()})}if(isBSScrollingEnabled&&$bsContainer.css("display")==="block"&&!$bsContainer.hasClass("bsNoScroll")){var i=$(window).height(),n=$bsContainer.height(),t=$(window).scrollTop(),u=$("#main-content").offset().top,e=$("#main-content").height(),o=$bsContainer.offset().top,f=t-u+20,s=$("#loadingBg",$bsContainer);s.find(".loaderIcon").css({position:"absolute",top:n/2-30,left:"88px"});s.find("span").css({marginTop:n/2-70});n<i&&t>u&&f+n<e?r(t-u):n>i&&t>u?t<o-20?r(f-20):t>o+n-i&&f+n-(n-i)<e&&r(f-(n-i)-70+Config.BSScrollAdjustment):t<100&&r(0)}}function getCombinationSelections(){var n=$("#bettingslip .bet");return isImprovedSelectionsMode&&(n=n.find(".refine-selection input:checked")),$.map(n,function(n){return getSelectionId(n)})}function getSelectionId(n){return $(n).closest("*[data-selection-id]").data("selectionId")}function getGacategory(n){return n.data("gacategory")}function getGaLabel(n){return n.data("galabel")}function updateContainer(n){n.ShowContainer?(typeof window.displayToogleRightColum!="undefined"&&window.displayToogleRightColum?RightColumn.showPreliveBettingSlip():isPrelive?$bsContainer.show().siblings().hide():($bsContainer.show().siblings(),$("#home-bet-selection-box").hide()),BettingSlipRefresh()):hideBettingSlip()}function hideBettingSlip(){typeof window.displayToogleRightColum!="undefined"&&window.displayToogleRightColum?RightColumn.hidePreliveBettingSlip():$bsContainer.hide().siblings().show();CancelBettingSlipTimer()}function betCartGet(){return cartApi.get().done(function(n){subscribeToEvent(document,"serviceWasLoaded",function(){triggerEvent(document,"allChoicesAreLoaded")});triggerEvent(document,"allChoicesAreLoaded");updateAfterSelectionChange(n);checkAllErrors()})}function betCartGetLive(){liveCartApi.get().done(function(){subscribeToEvent(document,"serviceWasLoaded",function(){triggerEvent(document,"allChoicesAreLoadedLive")});triggerEvent(document,"allChoicesAreLoadedLive")})}function updateSelections(n){$(Config.BSBetsContainerSelector,$bsContainer).empty().html(n).find(".qTip").qtip({position:{my:"right center",at:"left center"}});isImprovedSelectionsMode&&$("#bettingslip .refine-selection").show();allowIndividualStakes&&setupSingleStakes()}function CheckDisplayError(){var n=$("#bs-error").show();$('div[id^="bs-"]:visible',n).length===0&&n.hide()}function CheckFreebetDisplay(){var n=$("#freebet-choose").is(":checked");$("span.cashoutIcon").toggle(!n);$("span.multipleboost-logo").toggle(!n);$("span.betLogo_cashout").toggle(!n);$("span.betLogo_multipleboost").toggle(!n)}function hideBettingSlipArrowsAfterDelay(){setTimeout(function(){$("#bettingslip span.odd-evolution").hide()},5e3)}function updateAfterSelectionChange(n){updateSelections(n.Selection);updateSimpleState(n);updateMultipleState(n);CheckDisplayError();updateQuickBet(n);updateContainer(n);updateMultipleBonus(n.MultipleBonus,n.MultipleStatus==="Ok");isPrelive?(updateSystem(n),updateTotalStakeAndWinnings(n),updateSimpleStakePossibleWinnings()):(toggleStakeActiveState(),n?(typeof n.LiveIds!="undefined"&&(tabLiveIds=n.LiveIds),setOddsHighLightInContainer($(document)),tabLiveIds.length>0&&$("#multiplex-grid").length>0&&CheckMDisplay(tabLiveIds)):(tabSelectionIds=[],tabLiveIds=[],$(".icon-multiple").not(".no-multiple").show()));CheckFreebetDisplay()}function updateSimpleStakePossibleWinnings(){$bsContainer.find(".totalBox").html(function(n,t){return $.isNumeric(t)?BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(t)):t})}function StoreSystemMultipleStatus(n){BettingSlipControls.SystemStake().data("bsSystemMultipleStatus",n)}function GetSystemMultipleStatus(){return BettingSlipControls.SystemStake().data("bsSystemMultipleStatus")}function updateSystem(n){function o(n){var t=!n?BettingSlipControls.GetFirstSystemOption():BettingSlipControls.GetSystemOptionByCode(n);t.prop("selected",!0);$.uniform.update(BettingSlipControls.SystemCombobox())}var e,t,f,i;if(BettingSlipApi.parameters.isSystemEnabled&&(e=$("#SystemStake",$bsContainer),e.val(n.SystemStake||""),$bsContainer.trigger("systemstake.update",n),!n.IsNbBetSystemMax)){var s=0,r=BettingSlipControls.SystemCombobox(),h=$("#inputSystemHidden",$bsContainer),c=$("#systemeTemplate",$bsContainer),l=$("#systemeTemplateTooltip"),u=BettingSlipControls.SystemPanel();$("#systeme-summary").hide();r&&u&&(r.empty(),checkSystemsVisibility()?(u.show(),s++,indexOverLib=0,indexSystem=0,t={},t.systemeTemplate=Handlebars.compile(c.html()),t.systemeTemplateTooltip=Handlebars.compile(l.html()),f=AvailableCombinations(),i=t.systemeTemplate({systemes:f}),r.empty().html(i),i=t.systemeTemplateTooltip({systemes:f}),h.empty().html(i),o(n.SystemCode),updateSystemBox(n)):u.hide())}}function checkSystemsVisibility(){if(!BettingSlipApi.parameters.isSystemEnabled||!isSystemBetsVisible)return!1;var n=AvailableCombinations(),t=getCombinationSelections().length;return t<3||n.length===0?!1:!0}function setSelectedSystemOption(n){var t=!n?BettingSlipControls.GetFirstSystemOption():BettingSlipControls.GetSystemOptionByCode(n);t.prop("selected",!0);$.uniform.update(BettingSlipControls.SystemCombobox())}function updateSystemBox(n){var r=BettingSlipControls.GetSystemOptionSelected().text(),i,t;$(".selectSystem .firstInfo",$bsContainer).empty().html(r.substring(0,r.indexOf("(")));i=getSelectedSystemNbBets();t=BettingSlipApi.resources.betsLabel;i===1&&(t=BettingSlipApi.resources.betLabel);t=i+" "+t;$("#nbBetSystem",$bsContainer).empty().html(t);updateTotalStakeAndWinnings(n);updateSystemTooltip()}function updateSystemTooltip(){var t=BettingSlipControls.GetSystemOptionSelected().val(),i=$('#inputSystemHidden input[name="system-description-'+t+'"]',$bsContainer).val(),n=$("#betSystem .qTip",$bsContainer);n.removeAttr("oldtitle");n.qtip("option","content.text",i)}function updateSystemStakeAndTotalStake(n){var i=round(getSelectedSystemNbBets()*getSystemStakeValue(),2,!1),t;$(Config.TotalStakeValueContainer,$bsContainer).empty().html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(i)));t=BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(n.TotalStake));$("#stakes-recap-value").html(t);Number(n.TotalStake)===0||$('div.unableBet div[id^="bs-error"]:visible').size()>0?$("#PlaceBet",$bsContainer).addClass("disabled").attr("disabled","disabled"):$("#PlaceBet",$bsContainer).removeClass("disabled").removeAttr("disabled")}function updateSystemAndTotalPossibleWinning(n){var i=getSystemStakeValue(),r=i>0?Arrondir(getSelectedSystemMaxWinningOdds()*i):0,u=$("#freebet-choose").is(":checked"),t;u&&(r-=i*getSelectedSystemNbBets());$(Config.SystemPossibleWinningContainer,$bsContainer).empty().html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(r)));t=n.PotentialWinnings;t=BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(t));$("#stakes-potential-value",$bsContainer).empty().html(t)}function getSelectedSystemMaxWinningOdds(){var n=BettingSlipControls.GetSystemOptionSelected().attr("max-winning-odd");return!n?0:Number(n)}function ManageTaxFreeMessage(){var r,t,u,i,n;if(BettingSlipApi.parameters.isTaxFreeApplicable){if($multipleStake=$("#MultipleStake"),$systemStake=$("#SystemStake"),r=$multipleStake.val(),t=stakeToNumber(r),!isNaN(t)&&t>0&&(n=t.toString().split("."),n.length<=1||n[1].length<=2))return!AddTaxFreeConditionContent(MultipleErrorDivIds,$multipleStake)||toggleErrorState(MultipleErrorDivIds,$multipleStake);if(u=$systemStake.val(),i=stakeToNumber(u),i!==NaN&&i>0&&(n=i.toString().split("."),n.length<=1||n[1].length<=2))return!AddTaxFreeConditionContent(SystemErrorDivIds,$systemStake)||toggleErrorState(SystemErrorDivIds,$systemStake)}}function checkSystemStakeIsValid(n){var r,i,t,u;return(n=n||BettingSlipControls.SystemStake(),r=n.val(),n.attr("disabled")==="disabled")?toggleErrorState(SystemErrorDivIds,n):r==null||r.length<=0?toggleErrorState(SystemErrorDivIds,n):(i=GetSystemMultipleStatus(),i==="BadKeys")?toggleErrorState(SystemErrorDivIds,n,"#bs-error-system-keyserror"):i==="AboveMaximumOddsLimit"?toggleErrorState(SystemErrorDivIds,n,"#bs-error-system-abovemaxodds"):i==="IsSingleOnly"?toggleErrorState(SystemErrorDivIds,n,"#bs-error-system-single"):i==="SameEvent"?toggleErrorState(SystemErrorDivIds,n,"#bs-error-system"):(t=stakeToNumber(r),t>BettingSlipApi.parameters.maxBetAvailable&&BettingSlipApi.parameters.isLegalMaxBetAvailable)?toggleErrorState(SystemErrorDivIds,n,"#bs-error-input-system-max"):t<BettingSlipApi.parameters.minBetAvailable?toggleErrorState(SystemErrorDivIds,n,"#bs-error-input-system-min"):t!==NaN&&t>=0?(u=t.toString().split("."),u.length>1&&u[1].length>2?toggleErrorState(SystemErrorDivIds,n,"#bs-error-input-system"):toggleErrorState(SystemErrorDivIds,n)):toggleErrorState(SystemErrorDivIds,n,"#bs-error-input-system")}function AddTaxFreeConditionContent(n,t){if(BettingSlipApi.parameters.isTaxFreeApplicable){var u={list:function(){var n=preliveCartApi.getCombinedBetSelections();return n.map(function(n){return n.odd})}(),minBets:BettingSlipApi.parameters.taxFreeMinimumBets||3,remaining:function(){for(var t=this.minBets,r=BettingSlipApi.parameters.taxFreeMinimumOdds,i=this.list,n=0;n<i.length;n++)i[n]>=r&&t--;return t}},r={many:function(n){var t="#bs-warning-taxFreeSomeMore",i="_taxFreeSomeMoreContent_",r=window[i]=window[i]||$(t).html();return $(t).html(r.replace("%remaining%",n.toString())),t},one:function(){return"#bs-warning-taxFreeOneMore"},none:function(){return"#bs-warning-taxFree"}},i=u.remaining();if(i<u.minBets)return!toggleErrorState2(n,t,i>1?r.many(i):i==1?r.one():r.none(),!0)}return!0}function AvailableCombinations(){var r=[],t=Cart.SystemCombination.createAllSystemCombinations(preliveCartApi.getCombinedBetSelections()||[]),n,i;if(t.length>0)for(n=0;n<t.length;n++)i=t[n],i.isAvailable()&&r.push(i);return r}function refreshCart(n){return cartApi.refreshCart(n).done(function(n){n.HasChange&&updateAfterSelectionChange(n)})}function getSystemStakeValue(){var t=0,n=BettingSlipControls.SystemStake();return checkSystemStakeIsValid()&&n.val()!=null&&n.val().length>0&&(t=convertdecimal(n.val())),t}function getSelectedSystemNbBets(){var n=BettingSlipControls.GetSystemOptionSelected().attr("nb-bet");return Number(n||0)}function updateTotalStakeAndWinnings(n){StoreSystemMultipleStatus(n.SystemMultipleStatus);updateQuickBet(n);updateSystemAndTotalPossibleWinning(n);updateSystemStakeAndTotalStake(n);ManageTaxFreeMessage();CheckDisplayError()}function checkMultipleAndSystemStake(n,t){n=n||$("#MultipleStake");t=t||$("#SystemStake");checkMultipleStakeIsValid(n)&&checkSystemStakeIsValid(t);ManageTaxFreeMessage();CheckDisplayError()}function triggerBetHasBeenSubmittedEvent(){triggerEvent(document,"betHasBeenSubmitted")}function triggerLiveBetHasBeenSubmittedEvent(){triggerEvent(document,"liveBetHasBeenSubmitted")}function SubmitBetForm(n,t){function u(n){triggerBetHasBeenSubmittedEvent();var t=new frontApi;t.IsPopupResult(n)&&(!n.PopUp.NeedRefresh||refreshCart(!0),BettingSlipRefresh());t.IsRedirectResult(n)||t.IsReloadResult(n)||i.find(".loading").fadeOut();window.scrollTo(0,0);t.IsViewResult(n)?(hideBettingSlip(),setupMultipleStake(!0),setupSystemStake(!0),checkBettingSlipPosition(),$("#RightRecap").html(n.Html),$("."+OddButtonClass).removeClass(oddButtonSelectedClass),t.refreshHeader(),$.ajax({type:"GET",url:MyBetBoxUrl,dataType:"html",success:function(n){$("#my-right-bet-box").html(n)},error:function(n){console.log(n.responseText)}})):t.manageAjaxResult(n)}function f(n){var t,i;if(n!=null){if(t=((new Date).getTime()-r)/1e3,SetDelayPlaceBet(n,t))return;BettingSlipRefresh();i=new frontApi;i.manageAjaxResult(n);$bsContainer.find(".loading",$bsContainer).fadeOut()}}var i=t,r=(new Date).getTime();(n.preventDefault(),checkCartFormIsValid(i))&&(CancelBettingSlipTimer(),i.find(".loading").fadeIn(function(){var t;if(isPrelive){GaPush(GaLblAction_BsValidation,GaCurrentPage,"");var r=serializeListSelection(),e=BettingSlipControls.MultipleStake().val(),o=BettingSlipControls.SystemStake().val(),s=$("#systemSelect option:selected").val(),h=$("#notify-mail").is(":checked"),n=$("#redirectUrlPlacedBet").val();n&&n.length>0&&(n="redirectUrlPlacedBet="+n);t=$("#freebet-choose").is(":checked");cartApi.placeBet(r,e,o,s,h,n,t).done(u)}else cartApi.checkLive(i.serialize()).done(f)}))}function SetDelayPlaceBet(n,t){if(n.delay!=null){var i=n.Ticks;return isBetInProgress=!0,t=0,window.setTimeout(function(){PlaceLiveBet(i)},(n.delay-t)*1e3),!0}return!1}function PlaceLiveBet(n){GaPush(GaLblAction_BsValidation,GaCurrentPage,"");var t=$("#freebet-choose").is(":checked");cartApi.placeLiveBet(n,t).done(function(n){var t,i;triggerLiveBetHasBeenSubmittedEvent();BettingSlipRefresh();n!=null&&(t=new frontApi,window.scrollTo(0,0),t.IsViewResult(n)?(BettingSlipControls.SimpleStake().val(""),BettingSlipControls.MultipleStake().val(""),initStakes(),$("."+OddButtonClass).removeClass(oddButtonSelectedClass),$(".loading",$bsContainer).fadeOut(),isBetInProgress=!1,hideBettingSlip(),setupMultipleStake(!0),setupSystemStake(!0),tabSelectionIds=[],checkBettingSlipPosition(),$("#stakeRecapLive").html(n.Html),t.refreshHeader(),i=$(".ui-widget-overlay"),i.length&&(i.remove(),$(".ui-dialog.ui-widget.ui-widget-content").remove()),$.ajax({type:"GET",url:liveStakesUrl,dataType:"html",success:function(n){$("#resume-livestake-right-column").html(n)},error:function(n){console.log(n.responseText)}})):t.manageAjaxResult(n));try{GaCurrentPage==="Live"&&bcTrack.track(spTrack.keys.categories.matchLiveFunctionalities,spTrack.keys.actions.numberOfSelectedMatch,$("#multiplex-grid .live-container").length)}catch(r){if(bcTrack.debug===!0)throw r;}}).always(function(){$(".loading",$bsContainer).fadeOut();isBetInProgress=!1})}function BettingSlipRefresh(){bettingSlipTimer===-1&&window.refreshTime&&SetBettingSlipTimer(!0)}function CancelBettingSlipTimer(){clearTimeout(bettingSlipTimer);bettingSlipTimer=-1}function SetBettingSlipTimer(n){n||(isPrelive?refreshCart(!1):betCartGet().done(function(){setupComplexStakes(!0)}));bettingSlipTimer=setTimeout(function(){SetBettingSlipTimer(!1)},window.refreshTime)}function checkCartFormIsValid(){var n=$("input[name=SimpleStake]"),i=BettingSlipControls.MultipleStake(),r=BettingSlipControls.SystemStake(),u=n.filter(function(){return stakeToNumber($(this).val())>0}).length,f,e,o,t,s,h;if(stakeToNumber(i.val())>0&&u++,stakeToNumber(r.val())>0&&u++,u===0)return n.length===1&&n.focus(),!1;for(f=checkSystemStakeIsValid(r),f||r.focus(),e=checkMultipleStakeIsValid(i),e||i.focus(),ManageTaxFreeMessage(),o=!0,t=n.length-1;t>=0;t--)s=$(n.get(t)),h=checkSimpleStakeIsValid(s),h||s.focus(),o&=h;return f&&e&&o}function serializeListSelection(){var n=[];return BettingSlipControls.SimpleStakes().each(function(){var t={Id:getSelectionId($(this)),Stake:stakeToNumber($(this).val())};n.push(t)}),n}function IsValideCartAdd(n){var r=$('input[name="SimpleStake"]'),t,i,u,f;if(r.length>=BettingSlipApi.parameters.maxNumberOfSelections){for(t=!1,i=0;i<r.length&&!t;i++)u=r[i],f=getSelectionId(u),f==n&&(t=!0);return t==!1?(setPopup(BettingSlipApi.resources.aboveMaxNumberOfSelectionsErrMsg,BettingSlipApi.resources.informationLabel),!1):!0}return!0}function updateSimpleState(n){var r=$("input[name=SimpleStake]",$bsContainer),i=$(".stakes-fieldset.single",$bsContainer),t;if(r.each(function(){checkSimpleStakeIsValid($(this))}),i.length>0){t=$(r[0]);i.qtip("destroy");n.SimpleTooltip!=null&&n.SimpleTooltip.length>0&&(t.attr("disabled","disabled"),clearStake(t),i.attr("data-tooltip",n.SimpleTooltip).qtip({content:{attr:"data-tooltip"}}));t.data("bsActivateSimple",n.ActivateSimple);t.data("bsHasLowOddsSelection",n.HasLowOddsSelection);t.data("bsMaxSingleOdds",n.MaxSingleOdds);CheckSimpleStakeMinimumOdds(n);return}}function updateMultipleState(n){var i=$(".stakes-fieldset.multiple",$bsContainer),t=BettingSlipControls.MultipleStake(),r;i.qtip("destroy");n.MultipleTooltip!=null&&n.MultipleTooltip.length>0&&i.attr("data-tooltip",n.MultipleTooltip).qtip({content:{attr:"data-tooltip"},position:{my:"right center",at:"left center"}});t.data("bsActivateMultiple",n.ActivateMultiple);t.data("bsMultipleStatus",n.MultipleStatus);t.data("bsMultipleOdds",n.MultipleOdds);r=checkMultipleStakeIsValid(t);ManageTaxFreeMessage();r&&CheckMultipleStakeMinimumOdds(n)}function CheckSimpleStakeMinimumOdds(n){var t=$("#SimpleStake",$bsContainer);return n.isSimpleStakeOddsLowerThanMinimum?($("#PlaceBet",$bsContainer).addClass("disabled"),toggleErrorState(SimpleErrorDivIds,t,"#bs-warning-simpleOddsLowerThanMinimum")):(n.TotalStake>0&&$("#PlaceBet",$bsContainer).removeClass("disabled"),null)}function CheckMultipleStakeMinimumOdds(n){var t=$("#MultipleStake",$bsContainer);return n.isMultiStakeOddsLowerThanMinimum?($("#PlaceBet",$bsContainer).addClass("disabled"),toggleErrorState(MultipleErrorDivIds,t,"#bs-warning-multipleOddsLowerThanMinimum")):($("#PlaceBet",$bsContainer).removeClass("disabled"),null)}function toggleErrorState(n,t,i,r){for(var f,e,u=0;u<n.length;u++)f=n[u]===i,$(n[u],$bsContainer).toggle(f).toggleClass("displayed",f);return e=!!i&&!r,t.toggleClass("invalid",e),!e}function toggleErrorState2(n,t,i,r){for(var f,e,u=0;u<n.length;u++)f=n[u]===i,f&&$(n[u],$bsContainer).toggle(f).toggleClass("displayed",f);return e=!!i&&!r,t.toggleClass("invalid",e),!e}function toggleStakeActiveState(){var n=BettingSlipControls.SimpleStake(),t=BettingSlipControls.MultipleStake(),i=n.data("bsActivateSimple")!==!1,r=t.data("bsActivateMultiple")!==!1;!i||r&&t.val().length>0?(n.attr("disabled","disabled"),n.val("")):n.removeAttr("disabled");!r||i&&n.val().length>0?(t.attr("disabled","disabled"),t.val("")):t.removeAttr("disabled")}function stakeToNumber(n){return n?Number(n.replace(",",".")):0}function checkAllErrors(){}function clearStake(n){n.val("").keydown()}function getNbSelections(){return $("li.bet",$bsContainer).length}function updateQuickBet(n){var t=n.MultipleTotalOdds.replace(",","."),i;$.isNumeric(t)?(t=Number(t),$("#total-odds",$bsContainer).show(),i=t.toString().replace(",","."),$("#total-odds-value",$bsContainer).html(i)):$("#total-odds",$bsContainer).hide();$("#stakes-recap-value",$bsContainer).html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(n.TotalStake)));$("#stakes-potential-value",$bsContainer).html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(n.PotentialWinnings)));$("#stakes-recap .qTip",$bsContainer).qtip("option","content.text",n.TotalStakeTooltip);$("#stakes-potential .qTip",$bsContainer).qtip("option","content.text",n.PotentialWinningsTooltip);n.isMultipleCashOutAvailable?$("#isMultipleCashOutAvailable",$bsContainer).show():$("#isMultipleCashOutAvailable",$bsContainer).hide();updateStakesFieldset(n,Config.SlideDuration);n.MultipleBonus!=null&&updateMultipleBonus(n.MultipleBonus,n.MultipleStatus==="Ok")}function setOddsHighLightInContainer(n){n=$(n);_setOddsHighLight(n.find(".odd-button, .multiplexOdd span"),n)}function checkSimpleStakeIsValid(n){var t,i,r,u;return(n=n||$("#SimpleStake",$bsContainer),t=n.val(),t==null||t.length<=0)?toggleErrorState(SimpleErrorDivIds,n):(t=t.replace(",","."),i=Number(t),i>BettingSlipApi.parameters.maxBetAvailable&&BettingSlipApi.parameters.isLegalMaxBetAvailable)?toggleErrorState(SimpleErrorDivIds,n,"#bs-error-input-simple-max"):i<BettingSlipApi.parameters.minBetAvailable?toggleErrorState(SimpleErrorDivIds,n,"#bs-error-input-simple-min"):!isNaN(i)&&i>=0?(r=i.toString().split("."),r.length>1&&r[1].length>2)?toggleErrorState(SimpleErrorDivIds,n,"#bs-error-input-simple"):(u=n.data("bsHasLowOddsSelection")==!0,u?toggleErrorState(SimpleErrorDivIds,n,"#bs-warning-haslowodds",!0):n.data("bsMaxSingleOdds")<BettingSlipApi.parameters.bonusMinOdds?toggleErrorState(SimpleErrorDivIds,n,"#bs-warning-haslowoddsbonus",!0):toggleErrorState(SimpleErrorDivIds,n)):toggleErrorState(SimpleErrorDivIds,n,"#bs-error-input-simple")}function checkMultipleStakeIsValid(n){var i,t,r,u;if(n=n||$("#MultipleStake",$bsContainer),n.data("bsActivateMultiple"))n.removeAttr("disabled");else return n.attr("disabled","disabled"),clearStake(n),toggleErrorState(MultipleErrorDivIds,n);return(i=n.val(),i==null||i.length<=0)?toggleErrorState(MultipleErrorDivIds,n):($("#bs-warning-haslowoddsbonus").is(":visible")&&n.data("bsMultipleOdds")>=BettingSlipApi.parameters.bonusMinOdds&&$("#bs-warning-haslowoddsbonus").hide(),t=n.data("bsMultipleStatus"),t=="BadKeys")?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-combined-keyserror"):t=="BelowMinimumOddsLimit"?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-combined-lowodds"):t=="AboveMaximumOddsLimit"?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-combined-abovemaxodds"):t=="IsSingleOnly"?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-combined-single"):t=="SameEvent"?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-combined"):t=="Legame"?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-isLegame"):(i=i.replace(",","."),r=Number(i),r>BettingSlipApi.parameters.maxBetAvailable&&BettingSlipApi.parameters.isLegalMaxBetAvailable)?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-input-multiple-max"):r<BettingSlipApi.parameters.minBetAvailable?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-input-multiple-min"):!isNaN(r)&&r>=0?(u=r.toString().split("."),u.length>1&&u[1].length>2?toggleErrorState(MultipleErrorDivIds,n,"#bs-error-input-multiple"):!$("#bs-warning-haslowoddsbonus").is(":visible")&&n.data("bsMultipleOdds")<BettingSlipApi.parameters.bonusMinOdds?toggleErrorState(MultipleErrorDivIds,n,"#bs-warning-haslowoddsbonusmultiple",!0):toggleErrorState(MultipleErrorDivIds,n)):toggleErrorState(MultipleErrorDivIds,n,"#bs-error-input-multiple")}function IsValideCartAdd(n){var r=$('input[name="SimpleStake"]'),t,i,u,f;if(r.length>=BettingSlipApi.parameters.maxNumberOfSelections){for(t=!1,i=0;i<r.length&&!t;i++)u=r[i],f=getSelectionId(u),f==n&&(t=!0);return t==!1?(setPopup(BettingSlipApi.resources.aboveMaxNumberOfSelectionsErrMsg,BettingSlipApi.resources.informationLabel),!1):!0}return!0}function setPopup(n,t){var r=new frontApi,i=new frontApi.prototype.modalPopup;i.SetTitle(t);i.ShowPopup("<\/br><center>"+n+"<\/center><\/br>");i.SetWidth(500);r.manageAjaxResult(i)}function displayPopUp(n){var t=new frontApi;t.manageAjaxResult(n)}function AffichageMontant(n){var t=String(n).split(".");return t[1]==null?t[1]="00":(t[1].length>2&&(t[1]=""+t[1][0]+""+t[1][1]),t[1]=t[1].length!=2?t[1]+"0":t[1]),t.join(".")}function Arrondir(n){return n=Number(n),n.toFixed(2)}function isNumerique(n){return n=n.toString().indexOf(",")!=-1?n.replace(/,/gi,"."):n,n=="."|!isNaN(n)}function convertdecimal(n){return n=n.length==0?-1:n.toString().indexOf(" ")!=-1?n.replace(/ /gi,""):n,n=n.toString().indexOf(",")!=-1?n.replace(/,/gi,"."):n,isNumerique(n)?parseFloat(n):-1}function round(n,t,i){var r,t,f,o;if(n=parseFloat(n),isNaN(n))return n;r=0;t||(t=0);var u=Math.pow(10,t),e=n*u,s=Math.floor(e);return e=n*u*10,f=Math.floor(e%10),i?(o=s%2,(o!=0&&f==5||f>5)&&(r=1)):f>=5&&(r=1),Math.floor(n*u+r)/u}var Handlebars=function(){var r=function(){"use strict";function n(n){this.string=n}var t;return n.prototype.toString=function(){return""+this.string},t=n}(),t=function(n){"use strict";function f(n){return c[n]||"&amp;"}function e(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}function o(n){return n instanceof h?n.toString():n||0===n?(n=""+n,a.test(n)?n.replace(l,f):n):""}function s(n){return n||0===n?u(n)&&0===n.length?!0:!1:!0}var t={},h=n,c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},l=/[&<>"'`]/g,a=/[&<>"'`]/,i,r,u;return t.extend=e,i=Object.prototype.toString,t.toString=i,r=function(n){return"function"==typeof n},r(/x/)&&(r=function(n){return"function"==typeof n&&"[object Function]"===i.call(n)}),t.isFunction=r,u=Array.isArray||function(n){return n&&"object"==typeof n?"[object Array]"===i.call(n):!1},t.isArray=u,t.escapeExpression=o,t.isEmpty=s,t}(r),n=function(){"use strict";function t(t,i){var u,f,r;for(i&&i.firstLine&&(u=i.firstLine,t+=" - "+u+":"+i.firstColumn),f=Error.prototype.constructor.call(this,t),r=0;r<n.length;r++)this[n[r]]=f[n[r]];u&&(this.lineNumber=u,this.column=i.firstColumn)}var i,n=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,i=t}(),i=function(n,t){"use strict";function e(n,t){this.helpers=n||{};this.partials=t||{};p(this)}function p(n){n.registerHelper("helperMissing",function(n){if(2===arguments.length)return void 0;throw new h("Missing helper: '"+n+"'");});n.registerHelper("blockHelperMissing",function(t,i){var r=i.inverse||function(){},u=i.fn;return f(t)&&(t=t.call(this)),t===!0?u(this):t===!1||null==t?r(this):a(t)?t.length>0?n.helpers.each(t,i):r(this):u(t)});n.registerHelper("each",function(n,t){var i,s=t.fn,c=t.inverse,r=0,u="",h,e;if(f(n)&&(n=n.call(this)),t.data&&(i=o(t.data)),n&&"object"==typeof n)if(a(n))for(h=n.length;h>r;r++)i&&(i.index=r,i.first=0===r,i.last=r===n.length-1),u+=s(n[r],{data:i});else for(e in n)n.hasOwnProperty(e)&&(i&&(i.key=e,i.index=r,i.first=0===r),u+=s(n[e],{data:i}),r++);return 0===r&&(u=c(this)),u});n.registerHelper("if",function(n,t){return f(n)&&(n=n.call(this)),!t.hash.includeZero&&!n||r.isEmpty(n)?t.inverse(this):t.fn(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn,hash:i.hash})});n.registerHelper("with",function(n,t){return f(n)&&(n=n.call(this)),r.isEmpty(n)?void 0:t.fn(n)});n.registerHelper("log",function(t,i){var r=i.data&&null!=i.data.level?parseInt(i.data.level,10):1;n.log(r,t)})}function s(n,t){u.log(n,t)}var i={},r=n,h=t,c,l,u,o;i.VERSION="1.3.0";c=4;i.COMPILER_REVISION=c;l={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};i.REVISION_CHANGES=l;var a=r.isArray,f=r.isFunction,v=r.toString,y="[object Object]";return i.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:u,log:s,registerHelper:function(n,t,i){if(v.call(n)===y){if(i||t)throw new h("Arg not supported with multiple helpers");r.extend(this.helpers,n)}else i&&(t.not=i),this.helpers[n]=t},registerPartial:function(n,t){v.call(n)===y?r.extend(this.partials,n):this.partials[n]=t}},u={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(n,t){if(u.level<=n){var i=u.methodMap[n];"undefined"!=typeof console&&console[i]&&console[i].call(console,t)}}},i.logger=u,i.log=s,o=function(n){var t={};return r.extend(t,n),t},i.createFrame=o,i}(t,n),f=function(n,t,i){"use strict";function s(n){var t=n&&n[0]||1,i=v,r,f;if(t!==i){if(i>t){r=o[i];f=o[t];throw new u("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+f+").");}throw new u("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+n[1]+").");}}function h(n,t){if(!t)throw new u("No environment passed to template");var r=function(n,i,r,f,e,o){var s=t.VM.invokePartial.apply(this,arguments),h;if(null!=s)return s;if(t.compile)return h={helpers:f,partials:e,data:o},e[i]=t.compile(n,{data:void 0!==o},t),e[i](r,h);throw new u("The partial "+i+" could not be compiled when running in runtime-only mode");},i={escapeExpression:e.escapeExpression,invokePartial:r,programs:[],program:function(n,t,i){var r=this.programs[n];return i?r=f(n,t,i):r||(r=this.programs[n]=f(n,t)),r},merge:function(n,t){var i=n||t;return n&&t&&n!==t&&(i={},e.extend(i,t),e.extend(i,n)),i},programWithDepth:t.VM.programWithDepth,noop:t.VM.noop,compilerInfo:null};return function(r,u){var f,e,o,s;return u=u||{},o=u.partial?u:t,u.partial||(f=u.helpers,e=u.partials),s=n.call(i,o,r,f,e,u.data),u.partial||t.VM.checkRevision(i.compilerInfo),s}}function c(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r}function f(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r}function l(n,t,i,r,f,e){var o={partial:!0,helpers:r,partials:f,data:e};if(void 0===n)throw new u("The partial "+t+" could not be found");if(n instanceof Function)return n(i,o)}function a(){return""}var r={},e=n,u=t,v=i.COMPILER_REVISION,o=i.REVISION_CHANGES;return r.checkRevision=s,r.template=h,r.programWithDepth=c,r.program=f,r.invokePartial=l,r.noop=a,r}(t,n,i),e=function(n,t,i,r,u){"use strict";var c,f=n,l=t,a=i,e=r,o=u,s=function(){var n=new f.HandlebarsEnvironment;return e.extend(n,f),n.SafeString=l,n.Exception=a,n.Utils=e,n.VM=o,n.template=function(t){return o.template(t,n)},n},h=s();return h.create=s,c=h}(i,r,n,t,f),u=function(n){"use strict";function t(n){n=n||{};this.firstLine=n.first_line;this.firstColumn=n.first_column;this.lastColumn=n.last_column;this.lastLine=n.last_line}var r=n,i={ProgramNode:function(n,r,u,f){var o,e;3===arguments.length?(f=u,u=null):2===arguments.length&&(f=r,r=null);t.call(this,f);this.type="program";this.statements=n;this.strip={};u?(e=u[0],e?(o={first_line:e.firstLine,last_line:e.lastLine,last_column:e.lastColumn,first_column:e.firstColumn},this.inverse=new i.ProgramNode(u,r,o)):this.inverse=new i.ProgramNode(u,r),this.strip.right=r.left):r&&(this.strip.left=r.right)},MustacheNode:function(n,r,u,f,e){if(t.call(this,e),this.type="mustache",this.strip=f,null!=u&&u.charAt){var o=u.charAt(3)||u.charAt(2);this.escaped="{"!==o&&"&"!==o}else this.escaped=!!u;this.sexpr=n instanceof i.SexprNode?n:new i.SexprNode(n,r);this.sexpr.isRoot=!0;this.id=this.sexpr.id;this.params=this.sexpr.params;this.hash=this.sexpr.hash;this.eligibleHelper=this.sexpr.eligibleHelper;this.isHelper=this.sexpr.isHelper},SexprNode:function(n,i,r){t.call(this,r);this.type="sexpr";this.hash=i;var u=this.id=n[0],f=this.params=n.slice(1),e=this.eligibleHelper=u.isSimple;this.isHelper=e&&(f.length||i)},PartialNode:function(n,i,r,u){t.call(this,u);this.type="partial";this.partialName=n;this.context=i;this.strip=r},BlockNode:function(n,i,u,f,e){if(t.call(this,e),n.sexpr.id.original!==f.path.original)throw new r(n.sexpr.id.original+" doesn't match "+f.path.original,this);this.type="block";this.mustache=n;this.program=i;this.inverse=u;this.strip={left:n.strip.left,right:f.strip.right};(i||u).strip.left=n.strip.right;(u||i).strip.right=f.strip.left;u&&!i&&(this.isInverse=!0)},ContentNode:function(n,i){t.call(this,i);this.type="content";this.string=n},HashNode:function(n,i){t.call(this,i);this.type="hash";this.pairs=n},IdNode:function(n,i){var u;t.call(this,i);this.type="ID";for(var o="",f=[],s=0,e=0,h=n.length;h>e;e++)if(u=n[e].part,o+=(n[e].separator||"")+u,".."===u||"."===u||"this"===u){if(f.length>0)throw new r("Invalid path: "+o,this);".."===u?s++:this.isScoped=!0}else f.push(u);this.original=o;this.parts=f;this.string=f.join(".");this.depth=s;this.isSimple=1===n.length&&!this.isScoped&&0===s;this.stringModeValue=this.string},PartialNameNode:function(n,i){t.call(this,i);this.type="PARTIAL_NAME";this.name=n.original},DataNode:function(n,i){t.call(this,i);this.type="DATA";this.id=n},StringNode:function(n,i){t.call(this,i);this.type="STRING";this.original=this.string=this.stringModeValue=n},IntegerNode:function(n,i){t.call(this,i);this.type="INTEGER";this.original=this.integer=n;this.stringModeValue=Number(n)},BooleanNode:function(n,i){t.call(this,i);this.type="BOOLEAN";this.bool=n;this.stringModeValue="true"===n},CommentNode:function(n,i){t.call(this,i);this.type="comment";this.comment=n}};return i}(n),o=function(){"use strict";return function(){function n(n,t){return{left:"~"===n.charAt(2),right:"~"===t.charAt(0)||"~"===t.charAt(1)}}function t(){this.yy={}}var i={trace:function(){},yy:{},symbols_:{error:2,root:3,statements:4,EOF:5,program:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,sexpr:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,partial_option0:27,sexpr_repetition0:28,sexpr_option0:29,dataName:30,param:31,STRING:32,INTEGER:33,BOOLEAN:34,OPEN_SEXPR:35,CLOSE_SEXPR:36,hash:37,hash_repetition_plus0:38,hashSegment:39,ID:40,EQUALS:41,DATA:42,pathSegments:43,SEP:44,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",32:"STRING",33:"INTEGER",34:"BOOLEAN",35:"OPEN_SEXPR",36:"CLOSE_SEXPR",40:"ID",41:"EQUALS",42:"DATA",44:"SEP"},productions_:[0,[3,2],[3,1],[6,2],[6,3],[6,2],[6,1],[6,1],[6,0],[4,1],[4,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,4],[7,2],[17,3],[17,1],[31,1],[31,1],[31,1],[31,1],[31,1],[31,3],[37,1],[39,3],[26,1],[26,1],[26,1],[30,2],[21,1],[43,3],[43,1],[27,0],[27,1],[28,0],[28,2],[29,0],[29,1],[38,1],[38,2]],performAction:function(t,i,r,u,f,e){var o=e.length-1;switch(f){case 1:return new u.ProgramNode(e[o-1],this._$);case 2:return new u.ProgramNode([],this._$);case 3:this.$=new u.ProgramNode([],e[o-1],e[o],this._$);break;case 4:this.$=new u.ProgramNode(e[o-2],e[o-1],e[o],this._$);break;case 5:this.$=new u.ProgramNode(e[o-1],e[o],[],this._$);break;case 6:this.$=new u.ProgramNode(e[o],this._$);break;case 7:this.$=new u.ProgramNode([],this._$);break;case 8:this.$=new u.ProgramNode([],this._$);break;case 9:this.$=[e[o]];break;case 10:e[o-1].push(e[o]);this.$=e[o-1];break;case 11:this.$=new u.BlockNode(e[o-2],e[o-1].inverse,e[o-1],e[o],this._$);break;case 12:this.$=new u.BlockNode(e[o-2],e[o-1],e[o-1].inverse,e[o],this._$);break;case 13:this.$=e[o];break;case 14:this.$=e[o];break;case 15:this.$=new u.ContentNode(e[o],this._$);break;case 16:this.$=new u.CommentNode(e[o],this._$);break;case 17:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 18:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 19:this.$={path:e[o-1],strip:n(e[o-2],e[o])};break;case 20:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 21:this.$=new u.MustacheNode(e[o-1],null,e[o-2],n(e[o-2],e[o]),this._$);break;case 22:this.$=new u.PartialNode(e[o-2],e[o-1],n(e[o-3],e[o]),this._$);break;case 23:this.$=n(e[o-1],e[o]);break;case 24:this.$=new u.SexprNode([e[o-2]].concat(e[o-1]),e[o],this._$);break;case 25:this.$=new u.SexprNode([e[o]],null,this._$);break;case 26:this.$=e[o];break;case 27:this.$=new u.StringNode(e[o],this._$);break;case 28:this.$=new u.IntegerNode(e[o],this._$);break;case 29:this.$=new u.BooleanNode(e[o],this._$);break;case 30:this.$=e[o];break;case 31:e[o-1].isHelper=!0;this.$=e[o-1];break;case 32:this.$=new u.HashNode(e[o],this._$);break;case 33:this.$=[e[o-2],e[o]];break;case 34:this.$=new u.PartialNameNode(e[o],this._$);break;case 35:this.$=new u.PartialNameNode(new u.StringNode(e[o],this._$),this._$);break;case 36:this.$=new u.PartialNameNode(new u.IntegerNode(e[o],this._$));break;case 37:this.$=new u.DataNode(e[o],this._$);break;case 38:this.$=new u.IdNode(e[o],this._$);break;case 39:e[o-2].push({part:e[o],separator:e[o-1]});this.$=e[o-2];break;case 40:this.$=[{part:e[o]}];break;case 43:this.$=[];break;case 44:e[o-1].push(e[o]);break;case 47:this.$=[e[o]];break;case 48:e[o-1].push(e[o])}},table:[{3:1,4:2,5:[1,3],8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[3]},{5:[1,16],8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],25:[1,15]},{1:[2,2]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{4:20,6:18,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{4:20,6:22,7:19,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,8],22:[1,13],23:[1,14],25:[1,15]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{17:23,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:29,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:30,21:24,30:25,40:[1,28],42:[1,27],43:26},{17:31,21:24,30:25,40:[1,28],42:[1,27],43:26},{21:33,26:32,32:[1,34],33:[1,35],40:[1,28],43:26},{1:[2,1]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{10:36,20:[1,37]},{4:38,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,7],22:[1,13],23:[1,14],25:[1,15]},{7:39,8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,21],20:[2,6],22:[1,13],23:[1,14],25:[1,15]},{17:23,18:[1,40],21:24,30:25,40:[1,28],42:[1,27],43:26},{10:41,20:[1,37]},{18:[1,42]},{18:[2,43],24:[2,43],28:43,32:[2,43],33:[2,43],34:[2,43],35:[2,43],36:[2,43],40:[2,43],42:[2,43]},{18:[2,25],24:[2,25],36:[2,25]},{18:[2,38],24:[2,38],32:[2,38],33:[2,38],34:[2,38],35:[2,38],36:[2,38],40:[2,38],42:[2,38],44:[1,44]},{21:45,40:[1,28],43:26},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],42:[2,40],44:[2,40]},{18:[1,46]},{18:[1,47]},{24:[1,48]},{18:[2,41],21:50,27:49,40:[1,28],43:26},{18:[2,34],40:[2,34]},{18:[2,35],40:[2,35]},{18:[2,36],40:[2,36]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{21:51,40:[1,28],43:26},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,3],22:[1,13],23:[1,14],25:[1,15]},{4:52,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,5],22:[1,13],23:[1,14],25:[1,15]},{14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]},{18:[2,45],21:56,24:[2,45],29:53,30:60,31:54,32:[1,57],33:[1,58],34:[1,59],35:[1,61],36:[2,45],37:55,38:62,39:63,40:[1,64],42:[1,27],43:26},{40:[1,65]},{18:[2,37],24:[2,37],32:[2,37],33:[2,37],34:[2,37],35:[2,37],36:[2,37],40:[2,37],42:[2,37]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,66]},{18:[2,42]},{18:[1,67]},{8:17,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],25:[1,15]},{18:[2,24],24:[2,24],36:[2,24]},{18:[2,44],24:[2,44],32:[2,44],33:[2,44],34:[2,44],35:[2,44],36:[2,44],40:[2,44],42:[2,44]},{18:[2,46],24:[2,46],36:[2,46]},{18:[2,26],24:[2,26],32:[2,26],33:[2,26],34:[2,26],35:[2,26],36:[2,26],40:[2,26],42:[2,26]},{18:[2,27],24:[2,27],32:[2,27],33:[2,27],34:[2,27],35:[2,27],36:[2,27],40:[2,27],42:[2,27]},{18:[2,28],24:[2,28],32:[2,28],33:[2,28],34:[2,28],35:[2,28],36:[2,28],40:[2,28],42:[2,28]},{18:[2,29],24:[2,29],32:[2,29],33:[2,29],34:[2,29],35:[2,29],36:[2,29],40:[2,29],42:[2,29]},{18:[2,30],24:[2,30],32:[2,30],33:[2,30],34:[2,30],35:[2,30],36:[2,30],40:[2,30],42:[2,30]},{17:68,21:24,30:25,40:[1,28],42:[1,27],43:26},{18:[2,32],24:[2,32],36:[2,32],39:69,40:[1,70]},{18:[2,47],24:[2,47],36:[2,47],40:[2,47]},{18:[2,40],24:[2,40],32:[2,40],33:[2,40],34:[2,40],35:[2,40],36:[2,40],40:[2,40],41:[1,71],42:[2,40],44:[2,40]},{18:[2,39],24:[2,39],32:[2,39],33:[2,39],34:[2,39],35:[2,39],36:[2,39],40:[2,39],42:[2,39],44:[2,39]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{36:[1,72]},{18:[2,48],24:[2,48],36:[2,48],40:[2,48]},{41:[1,71]},{21:56,30:60,31:73,32:[1,57],33:[1,58],34:[1,59],35:[1,61],40:[1,28],42:[1,27],43:26},{18:[2,31],24:[2,31],32:[2,31],33:[2,31],34:[2,31],35:[2,31],36:[2,31],40:[2,31],42:[2,31]},{18:[2,33],24:[2,33],36:[2,33],40:[2,33]}],defaultActions:{3:[2,2],16:[2,1],50:[2,42]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,"number"!=typeof n&&(n=k.symbols_[n]||n),n}var k=this,r=[0],e=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,a,f,tt,v,s,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError),s={};;){if((o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((null===i||"undefined"==typeof i)&&(i=it()),u=h[o]&&h[o][i]),"undefined"==typeof u||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==i?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);e.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(f=this.productions_[u[1]][1],s.$=e[e.length-f],s._$={first_line:t[t.length-(f||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(f||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(f||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],e,t),"undefined"!=typeof w)return w;f&&(r=r.slice(0,-2*f),e=e.slice(0,-1*f),t=t.slice(0,-1*f));r.push(this.productions_[u[1]][0]);e.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},r=function(){var n={EOF:1,parseError:function(n,t){if(!this.yy.parser)throw new Error(n);this.yy.parser.parseError(n,t)},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length&&(r=this._input.match(this.rules[u[i]]),!r||n&&!(r[0].length>n[0].length)||(n=r,e=i,this.options.flex));i++);return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f?f:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return"undefined"!=typeof n?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i){function r(n,i){return t.yytext=t.yytext.substr(n,t.yyleng-i)}switch(i){case 0:if("\\\\"===t.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return r(0,4),this.popState(),15;case 4:return 35;case 5:return 36;case 6:return 25;case 7:return 16;case 8:return 20;case 9:return 19;case 10:return 19;case 11:return 23;case 12:return 22;case 13:this.popState();this.begin("com");break;case 14:return r(3,5),this.popState(),15;case 15:return 22;case 16:return 41;case 17:return 40;case 18:return 40;case 19:return 44;case 21:return this.popState(),24;case 22:return this.popState(),18;case 23:return t.yytext=r(1,2).replace(/\\"/g,'"'),32;case 24:return t.yytext=r(1,2).replace(/\\'/g,"'"),32;case 25:return 42;case 26:return 34;case 27:return 34;case 28:return 33;case 29:return 40;case 30:return t.yytext=r(1,2),40;case 31:return"INVALID";case 32:return 5}},n.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[3],inclusive:!1},INITIAL:{rules:[0,1,32],inclusive:!0}},n}();return i.lexer=r,t.prototype=i,i.Parser=t,new t}()}(),s=function(n,t){"use strict";function f(n){return n.constructor===u.ProgramNode?n:(r.yy=u,r.parse(n))}var i={},r=n,u=t;return i.parser=r,i.parse=f,i}(o,u),h=function(n){"use strict";function r(){}function u(n,t,r){if(null==n||"string"!=typeof n&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u=r.parse(n),f=(new r.Compiler).compile(u,t);return(new r.JavaScriptCompiler).compile(f,t)}function f(n,t,r){function f(){var i=r.parse(n),u=(new r.Compiler).compile(i,t),f=(new r.JavaScriptCompiler).compile(u,t,void 0,!0);return r.template(f)}if(null==n||"string"!=typeof n&&n.constructor!==r.AST.ProgramNode)throw new i("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+n);t=t||{};"data"in t||(t.data=!0);var u;return function(n,t){return u||(u=f()),u.call(this,n,t)}}var t={},i=n;return t.Compiler=r,r.prototype={compiler:r,disassemble:function(){for(var i,n,r,t,e=this.opcodes,u=[],f=0,o=e.length;o>f;f++)if(n=e[f],"DECLARE"===n.opcode)u.push("DECLARE "+n.name+"="+n.value);else{for(r=[],i=0;i<n.args.length;i++)t=n.args[i],"string"==typeof t&&(t='"'+t.replace("\n","\\n")+'"'),r.push(t);u.push(n.opcode+" "+r.join(" "))}return u.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;i>t;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;i>t;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.opcodes=[],this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.accept(n)},accept:function(n){var t,i=n.strip||{};return i.left&&this.opcode("strip"),t=this[n.type](n),i.right&&this.opcode("strip"),t},program:function(n){for(var i=n.statements,t=0,r=i.length;r>t;t++)this.accept(i[t]);return this.isSimple=1===r,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var r,t=(new this.compiler).compile(n,this.options),u=this.guid++,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;f>i;i++)r=t.depths.list[i],2>r||this.addDepth(r-1);return u},block:function(n){var f=n.mustache,t=n.program,i=n.inverse,r,u;t&&(t=this.compileProgram(t));i&&(i=this.compileProgram(i));r=f.sexpr;u=this.classifySexpr(r);"helper"===u?this.helperSexpr(r,t,i):"simple"===u?(this.simpleSexpr(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousSexpr(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(n){var r,t,u=n.pairs,i,f;for(this.opcode("pushHash"),i=0,f=u.length;f>i;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),"sexpr"===t.type&&this.sexpr(t)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0;n.context?this.ID(n.context):this.opcode("push","depth0");this.opcode("invokePartial",t.name);this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){this.sexpr(n.sexpr);n.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousSexpr:function(n,t,i){var r=n.id,u=r.parts[0],f=null!=t||null!=i;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);this.opcode("invokeAmbiguous",u,f)},simpleSexpr:function(n){var t=n.id;"DATA"===t.type?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperSexpr:function(n,t,r){var f=this.setupFullMustacheParams(n,t,r),u=n.id.parts[0];if(this.options.knownHelpers[u])this.opcode("invokeKnownHelper",f.length,u);else{if(this.options.knownHelpersOnly)throw new i("You specified knownHelpersOnly, but used the unknown helper "+u,n);this.opcode("invokeHelper",f.length,u,n.isRoot)}},sexpr:function(n){var t=this.classifySexpr(n);"simple"===t?this.simpleSexpr(n):"helper"===t?this.helperSexpr(n):this.ambiguousSexpr(n)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;r>t;t++)this.opcode("lookup",n.parts[t])},DATA:function(n){if(this.options.data=!0,n.id.isScoped||n.id.depth)throw new i("Scoped data references are not supported: "+n.original,n);this.opcode("lookupData");for(var r=n.id.parts,t=0,u=r.length;u>t;t++)this.opcode("lookup",r[t])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){0!==n&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifySexpr:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var t,i=n.length;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type),"sexpr"===t.type&&this.sexpr(t)):this[t.type](t)},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},t.precompile=u,t.compile=f,t}(n),c=function(n,t){"use strict";function r(n){this.value=n}function i(){}var s,h=n.COMPILER_REVISION,c=n.REVISION_CHANGES,f=n.log,e=t;i.prototype={nameLookup:function(n,t){var u,r;return 0===n.indexOf("depth")&&(u=!0),r=/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']",u?"("+n+" && "+r+")":r},compilerInfo:function(){var n=h,t=c[n];return"this.compilerInfo = ["+n+",'"+t+"'];\n"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(n,t,i,r){var u,o,s;for(this.environment=n,this.options=t||{},f("debug",this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!i,this.context=i||{programs:[],environments:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.compileChildren(n,t),o=n.opcodes,this.i=0,s=o.length;this.i<s;this.i++)u=o[this.i],"DECLARE"===u.opcode?this[u.name]=u.value:this[u.opcode].apply(this,u.args),u.opcode!==this.stripNext&&(this.stripNext=!1);if(this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new e("Compile completed with content left on stack");return this.createFunctionContext(r)},preamble:function(){var n=[],i,t;this.isChild?n.push(""):(i=this.namespace,t="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(t=t+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(t+=" data = data || {};"),n.push(t));this.environment.isSimple?n.push(""):n.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=n},createFunctionContext:function(n){var o=this.stackVars.concat(this.registers.list),i,t,e;if(o.length>0&&(this.source[1]=this.source[1]+", "+o.join(", ")),!this.isChild)for(i in this.context.aliases)this.context.aliases.hasOwnProperty(i)&&(this.source[1]=this.source[1]+", "+i+"="+this.context.aliases[i]);this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";");this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n");this.environment.isSimple||this.pushSource("return buffer;");for(var r=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],u=0,s=this.environment.depths.list.length;s>u;u++)r.push("depth"+this.environment.depths.list[u]);return(t=this.mergeSource(),this.isChild||(t=this.compilerInfo()+t),n)?(r.push(t),Function.apply(this,r)):(e="function "+(this.name||"")+"("+r.join(",")+") {\n  "+t+"}",f("debug",e+"\n\n"),e)},mergeSource:function(){for(var t,n,i="",r=0,u=this.source.length;u>r;r++)t=this.source[r],t.appendToBuffer?n=n?n+"\n    + "+t.content:t.content:(n&&(i+="buffer += "+n+";\n  ",n=void 0),i+=t+"\n  ");return i},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n);this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";n=["depth0"];this.setupParams(0,n);t=this.topStack();n.splice(1,0,t);this.pushSource("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.pendingContent&&(n=this.pendingContent+n);this.stripNext&&(n=n.replace(/^\s+/,""));this.pendingContent=n},strip:function(){this.pendingContent&&(this.pendingContent=this.pendingContent.replace(/\s+$/,""));this.stripNext="strip"},append:function(){this.flushInline();var n=this.popStack();this.pushSource("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }");this.environment.isSimple&&this.pushSource("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.pushSource(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.pushStackLiteral("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext);this.pushString(t);"sexpr"!==t&&("string"==typeof n?this.pushString(n):this.pushStackLiteral(n))},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.push("{}"),this.push("{}"))},pushHash:function(){this.hash&&this.hashes.push(this.hash);this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=this.hashes.pop();this.options.stringParams&&(this.push("{"+n.contexts.join(",")+"}"),this.push("{"+n.types.join(",")+"}"));this.push("{\n    "+n.values.join(",\n    ")+"\n  }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){null!=n?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t,i){this.context.aliases.helperMissing="helpers.helperMissing";this.useRegister("helper");var r=this.lastHelper=this.setupHelper(n,t,!0),f=this.nameLookup("depth"+this.lastContext,t,"context"),u="helper = "+r.name+" || "+f;r.paramsInit&&(u+=","+r.paramsInit);this.push("("+u+",helper ? helper.call("+r.callParams+") : helperMissing.call("+r.helperMissingParams+"))");i||this.flushInline()},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"';this.useRegister("helper");this.emptyHash();var i=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),r=this.nextStack();i.paramsInit&&this.pushSource(i.paramsInit);this.pushSource("if (helper = "+u+") { "+r+" = helper.call("+i.callParams+"); }");this.pushSource("else { helper = "+f+"; "+r+" = typeof helper === functionType ? helper.call("+i.callParams+") : helper; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var i,r,u=this.popStack(),t;this.options.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&t.contexts.push("'"+n+"': "+i);r&&t.types.push("'"+n+"': "+r);t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var i,r,f,e=n.children,u=0,o=e.length;o>u;u++)r=e[u],f=new this.compiler,i=this.matchExistingProgram(r),null==i?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=f.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;r>t;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){if(this.context.aliases.self="this",null==n)return"self.noop";for(var t,i=this.environment.children[n],r=i.depths.list,u=[i.index,i.name,"data"],f=0,e=r.length;e>f;f++)t=r[f],1===t?u.push("depth0"):u.push("depth"+(t-1));return(0===r.length?"self.program(":"self.programWithDepth(")+u.join(", ")+")"},register:function(n,t){this.useRegister(n);this.pushSource(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new r(n))},pushSource:function(n){this.pendingContent&&(this.source.push(this.appendToBuffer(this.quotedString(this.pendingContent))),this.pendingContent=void 0);n&&this.source.push(n)},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.pushSource(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var t,u,o,f="",s=this.isInline(),i,h,e;return s?(i=this.popStack(!0),i instanceof r?(t=i.value,o=!0):(u=!this.stackSlot,h=u?this.incrStack():this.topStackName(),f="("+this.push(h)+" = "+i+"),",t=this.topStack())):t=this.topStack(),e=n.call(this,t),s?(o||this.popStack(),u&&this.stackSlot--,this.push("("+f+e+")")):(/^stack/.test(t)||(t=this.nextStack()),this.pushSource(t+" = ("+f+e+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,u,t;if(i.length)for(this.inlineStack=[],n=0,u=i.length;u>n;n++)t=i[n],t instanceof r?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();if(!n&&t instanceof r)return t.value;if(!i){if(!this.stackSlot)throw new e("Invalid stack pop");this.stackSlot--}return t},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof r?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u=this.setupParams(n,r,i),f=this.nameLookup("helpers",t,"helper");return{params:r,paramsInit:u,name:f,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupOptions:function(n,t){var e,r,u,i=[],o=[],s=[],f;for(i.push("hash:"+this.popStack()),this.options.stringParams&&(i.push("hashTypes:"+this.popStack()),i.push("hashContexts:"+this.popStack())),r=this.popStack(),u=this.popStack(),(u||r)&&(u||(this.context.aliases.self="this",u="self.noop"),r||(this.context.aliases.self="this",r="self.noop"),i.push("inverse:"+r),i.push("fn:"+u)),f=0;n>f;f++)e=this.popStack(),t.push(e),this.options.stringParams&&(s.push(this.popStack()),o.push(this.popStack()));return this.options.stringParams&&(i.push("contexts:["+o.join(",")+"]"),i.push("types:["+s.join(",")+"]")),this.options.data&&i.push("data:data"),i},setupParams:function(n,t,i){var r="{"+this.setupOptions(n,t).join(",")+"}";return i?(this.useRegister("options"),t.push("options"),"options="+r):(t.push(r),"")}};for(var o="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),l=i.RESERVED_WORDS={},u=0,a=o.length;a>u;u++)l[o[u]]=!0;return i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n)?!0:!1},s=i}(i,n);return function(n,t,i,r,u){"use strict";var o,f=n,s=t,h=i.parser,c=i.parse,l=r.Compiler,a=r.compile,v=r.precompile,y=u,p=f.create,e=function(){var n=p();return n.compile=function(t,i){return a(t,i,n)},n.precompile=function(t,i){return v(t,i,n)},n.AST=s,n.Compiler=l,n.JavaScriptCompiler=y,n.Parser=h,n.parse=c,n};return f=e(),f.create=e,o=f}(e,u,s,h,c)}(),AntiFrogeryAPI=function(){},alt,RightColumn,sliderHeight,weekHeight,BettingSlipApi,updateMultipleBonus,MultipleErrorDivIds,MyStake,BetBeginnerApi;AntiFrogeryAPI.prototype={Const:{DataConst:"__RequestVerificationToken",IdMainDivConst:"idDivAntiForgery",EnumBeginner:"Beginner",EnumSuper14:"Super14",EnumSystem:"System",EnumAdvance:"Advance"},Param:{Mode:"",JSonData:[]},SetMode:function(n){this.Param.Mode=n},SetJSonData:function(n){this.Param.JSonData=n;this.SetJSonDataToken()},GetTokenValue:function(){var n="#"+this.Const.IdMainDivConst+this.Param.Mode+" input[name='__RequestVerificationToken']";return $(n).val()},SetJSonDataToken:function(){var n=this.GetTokenValue();this.Param.JSonData.__RequestVerificationToken=n},GetJsonToPost:function(){return this.Param.JSonData}};alt=!1;Handlebars.registerHelper("include",function(n){var t={},i=function(n){for(var i in n)t[i]=n[i]};return i(this),i(n.hash),n.fn(t)});Handlebars.registerHelper("listSelections",function(n){var i=function(n){return'<div class="match-odd"><a class="'+oddButtonCssClass(n)+'" data-selection-id="'+n.Id+'">'+n.OddStr+"<\/a><\/div>"},t=i(n[0]);return n.length===2?(t+='<div class="match-odd"><\/div>',t+=i(n[1])):(t+=i(n[1]),t+=i(n[2])),t});Handlebars.registerHelper("SafeString",function(n){var t=" "+n;return new Handlebars.SafeString(t)});Handlebars.registerHelper("NumMarketInfo",function(n){return new Handlebars.SafeString(AvailableBetsCountTTipTrad.replace("%nb%",n))});Handlebars.registerHelper("LinkFormat",function(n){return rootLink+n});Handlebars.registerHelper("MapLink",function(n,t){return n!=null?rootLink+n:rootLink+t});Handlebars.registerHelper("DateFormat",function(n){var i,t,r;return n==null?"":(i=n.KeyDay,n.KeyDay==7439?i=Jour0Trad:n.KeyDay==7479?i=JourOneTrad:n.KeyDay==7441?i=JourTwoTrad:n.KeyDay==7480?i=JourThreeTrad:n.KeyDay==7481?i=JourFourTrad:n.KeyDay==7444?i=JourFiveTrad:n.KeyDay==7445&&(i=JourSixTrad),t=n.KeyMonth,n.KeyMonth==7487?t=Mois0:n.KeyMonth==7488?t=MoisOne:n.KeyMonth==7505?t=MoisTwo:n.KeyMonth==7486?t=MoisThree:n.KeyMonth==7410?t=MoisFour:n.KeyMonth==7492?t=MoisFive:n.KeyMonth==7377?t=MoisSix:n.KeyMonth==7509?t=MoisSeven:n.KeyMonth==7494?t=MoisHeight:n.KeyMonth==7495?t=MoisNine:n.KeyMonth==7490?t=MoisOne0:n.KeyMonth==7452&&(t=MoisOneOne),r=DateFormatTrad.replace("%LibJour%",i).replace("%Jour%",n.Day).replace("%LibMois%",t).replace("%Annee%",n.Year),r+" - "+n.HourStr)});Handlebars.registerHelper("ClassDivSelectionCarousel",function(n){return n.length==2?"halves":n.length==1?"one":"thirds"});Handlebars.registerHelper("isLastEvent",function(){return this.isLast==1?"last":""});Handlebars.registerHelper("isEven",function(){return this.isEven==1?"evenBox":""});Handlebars.registerHelper("ClassWinScore",function(){return this.IsWinner==1?" win":""});Handlebars.registerHelper("ClassRunningScore",function(){return this.IsRunning==1?" running":""});Handlebars.registerHelper("ClassTime",function(n){return n==1?"match-time countdown":n==5?"match-time countdown5":"match-time"});Handlebars.registerHelper("ComputeReasonsToBetCount",function(n){return n>1?reasonsToBetCountTrad.replace("%nb%",n):oneReasonToBetTrad});Handlebars.registerHelper("HasMoreMarket",function(n,t){return n>1?t.fn(this):""});Handlebars.registerHelper("GetNbBetSimple",function(n){return n.template.getNbSimpleCombinations(preliveCartApi.getCombinedBetSelections().length)});Handlebars.registerHelper("GetNbBet",function(n){return n.template.getNbChoicesCombinations(preliveCartApi.getCombinedBetSelections().length)});Handlebars.registerHelper("GetName",function(n){var t=preliveCartApi.getCombinedBetSelections().length;return n.template.formatName(t)+" ("+n.template.getNbChoicesCombinations(t)+" "+tradSlips+")"});Handlebars.registerHelper("GetOdd",function(n){return getCote(n.maxWinningOdds,BettingSlipApi.parameters.oddsFormat)});Handlebars.registerHelper("GetIndexSystem",function(){var n=indexSystem;return indexSystem++,n});Handlebars.registerHelper("GetIndex",function(){return indexOverLib});Handlebars.registerHelper("GetTooltip",function(n){return indexOverLib++,$("<div/>").html(n.template.formatOverlib(preliveCartApi.getCombinedBetSelections().length)).text()});Handlebars.registerHelper("FormatNumOfMarkets",function(n){return n-1});Handlebars.registerHelper("GetOddsClassTopBet",function(n){return n=="---"?" notclickable":""});Handlebars.registerHelper("isAlt",function(){return alt?(alt=!1,"alt"):(alt=!0,"")});Handlebars.registerHelper("CarouselOnClick",function(n,t){var r=Handlebars.Utils.escapeExpression(this.Title);n=Handlebars.Utils.escapeExpression(n);var i=typeof t=="string",u=i?"bcTrack.trackAndChangeLocation":"bcTrack.trackOnClick",f=i?"'"+rootLink+Handlebars.Utils.escapeExpression(t)+"'":"this";return"return "+u+"("+f+", bcTrack.categories.carousel, bcTrack.actions.position + '"+n+"', '"+r+"');"});Handlebars.registerHelper("OpportunityOnClick",function(n){var t=Handlebars.Utils.escapeExpression(this.Title);return n=Handlebars.Utils.escapeExpression(n),"return bcTrack.trackOnClick(this, spTrack.keys.oddsOn, bcTrack.actions.position + '"+n+"', '"+t+"');"});Handlebars.registerHelper("GetEventNameOnClick",function(n){typeof n!="string"&&(n=this.Sport.Name);n=Handlebars.Utils.escapeExpression(n);var t=Handlebars.Utils.escapeExpression(this.Competition.Name),i=Handlebars.Utils.escapeExpression(this.Event.Name),r=Handlebars.Utils.escapeExpression(this.Event.Name)+"_"+this.Event.Id;return"return bcTrack.trackOnClick(this, { event : spTrack.keys.matchTitle, title : '"+i+"', 'Event Name' : '"+t+"', 'Match' : '"+r+"' , Sport : '"+n+"' });"});Handlebars.registerHelper("GetStatsIconTrackData",function(n,t){var i=Handlebars.Utils.escapeExpression(this.Competition.Name),r=Handlebars.Utils.escapeExpression(this.Event.Name),u=Handlebars.Utils.escapeExpression(this.Sport.Name);return typeof t!="string"&&(t="spTrack.keys.statistic"),n=Handlebars.Utils.escapeExpression(n),"{ event : "+t+", 'Blocks Title' : '"+n+"', 'Event Name' : '"+i+"' , Match : '"+r+"', Sport : '"+u+"' }"});RightColumn=function(){function n(){return $("#pre-live-bs")}function o(){return n().is(":visible")}function t(){return $("#rankingWrap")}function f(){return $("aside#match-list-box")}function i(){return $("#tblToggleContentBox")}function r(){return $("#displayContentBox")}function e(){return $("#hideContentBox")}function s(){return $("#home-bet-selection-box")}function h(n){var t,i,r,s;if(n||(n=-1),n=parseInt(n),t=f(),t.length===1){var u=t.attr("data-competition-events-template-id"),e=t.attr("data-competition-events-url"),o=t.attr("data-competition-events-container-selector");u&&e&&o&&(i=$(o),i.length===1)&&((r=t.attr("data-competition-events-competition-id"),r||(r=-1),r=parseInt(r),n>0&&n===r)||(s=Handlebars.compile($("#"+u).html()),t.hide(),n>0?$.get(e,{competitionId:n}).done(function(r){if(r&&r.length>1){var u=s(r);i.html(u);i.attr("data-competition-events-competition-id",n);t.fadeIn(500);bcTrack.addTrackDefinition("A45",spTrack.keys.categories.matchList,function(n){var t=$("#competitionEvents li").index(n.closest("li"))+1;return"Position "+t},spTrack.keys.labels.click,{delay:!0});bcTrack.bindTrackDefinitionOnClick("A45",$("#competitionEvents a"))}}):(i.empty(),i.attr("data-competition-events-competition-id",n))))}}function c(n){function a(n,t){var e="",i,f;if(u&&t===2&&(n.rnk.cat&&(e+=n.rnk.cat),n.rnk.dat&&(i=n.rnk.dat.split("-"),i.length==3))){var o=parseInt(i[0],10),r=parseInt(i[1],10)-1,s=parseInt(i[2],10);isNaN(o)||isNaN(r)||isNaN(s)||(f=new Date(o,r,s),r=f.getMonth()+1,e+="&nbsp;"+f.getDate()+"/"+r.toString(10)+"/"+f.getFullYear())}return e}function e(n,t){var f=n;u.hide();r.hide();t&&t.length!=0||(t=l);u.html(t);i.toggle(f);f&&(u.fadeIn(500),r.fadeIn(500))}function o(n,t,i){var o="",f=n&&n.rnk,s,h;f?(o=a(n,t),h=$.ajax({url:i,dataType:"html"}).done(function(t){s=t;r.setTemplate(s,[],{filter_data:!1});r.processTemplate(n);f=!r.is(":empty");e(f,o)}).fail(function(){f=!1;e(f,o)})):(r.empty(),u.empty(),e(f,o))}var i,r,u,l,f;if(n||(n=-1),n=parseInt(n),i=t(),i.length==1){var s=i.attr("data-ranking-content-id"),h=i.attr("data-ranking-title-id"),c=i.attr("data-ranking-api-url");s&&h&&c&&(r=$("#"+s),u=$("#"+h),r.length==1&&u.length==1)&&((l=i.attr("data-ranking-default-title"),f=i.attr("data-ranking-competition-id"),f||(f=-1),f=parseInt(f),n>0&&n==f)||(n>0?$.get(c,{competitionId:n}).done(function(t){t&&t.SportId&&t.TemplateUrl?$.ajax({url:t.ServiceDataUrl,dataType:"jsonp",jsonpCallback:"getRanking",type:"GET",cache:!0}).done(function(r){i.attr("data-ranking-competition-id",n);o(r,t.SportId,t.TemplateUrl)}).fail(function(){e(!1)}):(i.attr("data-ranking-competition-id",n),o())}).fail(function(){e(!1)}):(i.attr("data-ranking-competition-id",n),o())))}}function l(){var u=t(),i,r,n;u.length==1&&(i=u.attr("data-ranking-content-id"),i)&&(r=$("#"+i),r.length==1)&&(n=r.children("table"),n&&(n.children("tbody").children(".cache").removeClass("cache"),n.children("tbody").children("#voirplus").removeClass("voirplus").addClass("cache")))}function a(n){$.cookie("betclic_toggleContentBoxState",n,{path:"/",secure:!0})}function v(){return $.cookie("betclic_toggleContentBoxState")}function u(t){var u=s(),i;return u.hide(),i=n(),i.show().siblings().not(u).toggle(t),a(t),r().toggle(!t),e().toggle(t),i.toggleClass("bsScroll",!t).toggleClass("bsNoScroll",t),i}function y(){u(!0).css({position:"static",marginTop:"0"})}function p(){u(!1)}function w(){i().removeClass("objCache").show();r().removeClass("objCache");var n=v()=="true";u(n)}function b(){var t=i();t.hide();n().hide().siblings().not(t).show()}return $(function(){var n=i();n.length>0&&(r().click(y),e().click(p))}),{getPreliveBettingSlip:n,isBettingSlipVisible:o,competitionRankingContainer:t,refreshCompetitionRanking:c,competitionEventsContainer:f,refreshCompetitionEvents:h,displayFullCompetitionRanking:l,showPreliveBettingSlip:w,hidePreliveBettingSlip:b}}();$(document).ready(function(){initHeights();valignContent();sliderDisplay(!0);$("#rankingMultiple a.action").click(function(){var n=$(this).attr("id");if($(this).hasClass("disabled")||$(this).hasClass("active"))return!1;n=="lastWeek"&&$(".rankingSlider h3").text(lblLastWeek);n=="thisWeek"&&$(".rankingSlider h3").text(lblCurrentWeek);$(this).addClass("active").siblings().removeClass("active");$("#rankingMultiple .rankingSlider ul."+n).animate({left:"0"},500,function(){$(this).addClass("selectedWeek")});$("#rankingMultiple .rankingSlider ul:not(."+n+")").animate({left:"+226px"},500,function(){$(this).removeClass("selectedWeek")});checkSliderDisplay(n);weekHeightDisplay()});$("#rankSliderToggle").click(function(){sliderDisplay(!0)});$("#rankingMultiple .rankingSlider li .notification,#rankingMultiple .rankingSlider li .name").click(function(){$("#rankingMultiple .rankingSlider ul").hasClass("reduced")&&sliderDisplay(!0)});$("#rankingMultiple .rankingSlider li .notification, #rankingMultiple .rankingSlider li .name").hover(function(){var u=$(this).parents("li").position().top,f,n,i;$("body").hasClass("expekt")&&(f=$("#rankingMultiple .section-title").height()-16,u+=f);$(".rankingDetailBox").addClass("hover").css({top:u});$(".rankingDetailBox .rankingDetail").children().hide();$(".rankingDetailBox .rankingDetail .boxArrow").show();n=null;$(this).hasClass("notification")&&(n=$(this).parent().attr("id"));$(this).hasClass("name")&&(n=$(this).parent().parent().attr("id"));n=n.replace("ucMultiple_","");i=$(".rankingDetail").children("#repRankingStake_"+n);i.show();var t=i.children().find("li"),r=t.find(".rankingDetailToggle").parent("li"),e=t.find(".rankingDetailtotal");e.css("background-color","#ededed");t.filter(":even").css("background-color","#ededed");r.css("background-color","#ffffff");t.length<8?r.hide():(t.filter(":gt(4)").hide(),r.show());$(".rankingDetailtotal").show()},function(){$(".rankingDetailBox").removeClass("hover")});$(".rankingDetailBox").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$(".rankingDetailToggle").click(function(){$(this).parent("li").siblings("li").show();$(this).parent("li").hide()})});window||(this.window=this);window.Type=Function;String.__typeName="String";String.Empty="";String.isNullOrEmpty=function(n){return!n||!n.length};Type.prototype.callBaseMethod=function(n,t,i){var r=Sys._getBaseMethod(this,n,t);return i?r.apply(n,i):r.apply(n)};Type.prototype.getBaseMethod=function(n,t){return Sys._getBaseMethod(this,n,t)};Type.prototype.getBaseType=function(){return typeof this.__baseType=="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){for(var n=[],t=this,i,r,f,u;t;){if(i=t.__interfaces,i)for(r=0,f=i.length;r<f;r++)u=i[r],Array.contains(n,u)||(n[n.length]=u);t=t.__baseType}return n};Type.prototype.getName=function(){return typeof this.__typeName=="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(n){var r,t,u,i,f;if(this.resolveInheritance(),r=n.getName(),t=this.__interfaceCache,t){if(u=t[r],typeof u!="undefined")return u}else t=this.__interfaceCache={};for(i=this;i;){if(f=i.__interfaces,f&&Array.indexOf(f,n)!==-1)return t[r]=!0;i=i.__baseType}return t[r]=!1};Type.prototype.inheritsFrom=function(n){this.resolveInheritance();for(var t=this.__baseType;t;){if(t===n)return!0;t=t.__baseType}return!1};Type.prototype.initializeBase=function(n,t){return this.resolveInheritance(),this.__baseType&&(t?this.__baseType.apply(n,t):this.__baseType.apply(n)),n};Type.prototype.isImplementedBy=function(n){if(typeof n=="undefined"||n===null)return!1;var t=Object.getType(n);return!!(t.implementsInterface&&t.implementsInterface(this))};Type.prototype.isInstanceOfType=function(n){return Sys._isInstanceOfType(this,n)};Type.prototype.registerClass=function(n,t,i){var r,u,f;if(this.prototype.constructor=this,this.__typeName=n,this.__class=!0,t&&(this.__baseType=t,this.__basePrototypePending=!0),Sys.__upperCaseTypes[n.toUpperCase()]=this,i)for(this.__interfaces=[],r=2,u=arguments.length;r<u;r++)f=arguments[r],this.__interfaces.push(f);return this};Type.prototype.registerInterface=function(n){return Sys.__upperCaseTypes[n.toUpperCase()]=this,this.prototype.constructor=this,this.__typeName=n,this.__interface=!0,this};Type.prototype.registerEnum=function(n,t){for(var i in this.prototype)this[i]=this.prototype[i];this.__typeName=n;this.__enum=!0;t&&(this.__flags=!0)};Type.prototype.resolveInheritance=function(){var n,t,i;if(this.__basePrototypePending){n=this.__baseType;n.resolveInheritance();for(t in n.prototype)i=n.prototype[t],this.prototype[t]||(this.prototype[t]=i);delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(n){return typeof n=="undefined"||n===null?!1:!!n.__class};Type.isInterface=function(n){return typeof n=="undefined"||n===null?!1:!!n.__interface};Type.isNamespace=function(n){return typeof n=="undefined"||n===null?!1:!!n.__namespace};Type.parse=function(typeName,ns){var fn;return ns?(fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()],fn||null):typeName?(Type.__htClasses||(Type.__htClasses={}),fn=Type.__htClasses[typeName],fn||(fn=eval(typeName),Type.__htClasses[typeName]=fn),fn):null};Type.registerNamespace=function(n){for(var r=window,u=n.split("."),f,t,i=0;i<u.length;i++)f=u[i],t=r[f],t||(t=r[f]={}),t.__namespace||(i===0&&n!=="Sys"&&(Sys.__rootNamespaces[Sys.__rootNamespaces.length]=t),t.__namespace=!0,t.__typeName=u.slice(0,i+1).join("."),t.getName=function(){return this.__typeName}),r=t};Type._checkDependency=function(n,t){var i=Type._registerScript._scripts,r=i?!!i[n]:!1;if(typeof t!="undefined"&&!r)throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded,t,n));return r};Type._registerScript=function(n,t){var i=Type._registerScript._scripts,r,f,u;if(i||(Type._registerScript._scripts=i={}),i[n])throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded,n));if(i[n]=!0,t)for(r=0,f=t.length;r<f;r++)if(u=t[r],!Type._checkDependency(u))throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound,n,u));};Type.registerNamespace("Sys");Sys.__upperCaseTypes={};Sys.__rootNamespaces=[Sys];Sys._isInstanceOfType=function(n,t){if(typeof t=="undefined"||t===null)return!1;if(t instanceof n)return!0;var i=Object.getType(t);return!!(i===n)||i.inheritsFrom&&i.inheritsFrom(n)||i.implementsInterface&&i.implementsInterface(n)};Sys._getBaseMethod=function(n,t,i){var u=n.getBaseType(),r;return u?(r=u.prototype[i],r instanceof Function?r:null):null};Sys._isDomElement=function(n){var i=!1,t,r;return typeof n.nodeType!="number"&&(t=n.ownerDocument||n.document||n,t!=n?(r=t.defaultView||t.parentWindow,i=r!=n):i=typeof t.body=="undefined"),!i};Array.__typeName="Array";Array.__class=!0;Array.add=Array.enqueue=function(n,t){n[n.length]=t};Array.addRange=function(n,t){n.push.apply(n,t)};Array.clear=function(n){n.length=0};Array.clone=function(n){return n.length===1?[n[0]]:Array.apply(null,n)};Array.contains=function(n,t){return Sys._indexOf(n,t)>=0};Array.dequeue=function(n){return n.shift()};Array.forEach=function(n,t,i){for(var u,r=0,f=n.length;r<f;r++)u=n[r],typeof u!="undefined"&&t.call(i,u,r,n)};Array.indexOf=function(n,t,i){return Sys._indexOf(n,t,i)};Array.insert=function(n,t,i){n.splice(t,0,i)};Array.parse=function(value){return value?eval(value):[]};Array.remove=function(n,t){var i=Sys._indexOf(n,t);return i>=0&&n.splice(i,1),i>=0};Array.removeAt=function(n,t){n.splice(t,1)};Sys._indexOf=function(n,t,i){var u,r;if(typeof t=="undefined")return-1;if(u=n.length,u!==0)for(i=+i,isNaN(i)?i=0:(isFinite(i)&&(i=i-i%1),i<0&&(i=Math.max(0,u+i))),r=i;r<u;r++)if(typeof n[r]!="undefined"&&n[r]===t)return r;return-1};Array.prototype.add=function(n){this[this.length]=n};Array.prototype.clear=function(){this.length=0};Array.prototype.contains=function(n){var t=this.indexOf(n);return t>=0};Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){var r,i;if(t=t||0,r=this.length,r)for(i=t;i<r;i++)if(this[i]===n)return i;return-1});Array.prototype.remove=function(n){var t=this.indexOf(n);return t>=0?(this.splice(t,1),!0):!1};typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});Type.registerNamespace("Cart");Cart.CombinationStatus=function(){};Cart.CombinationStatus.prototype={ok:0,topSimple:1,matchConflict:2,keyConflict:3,oddsTooHigh:4,oddsTooLow:5};Cart.SystemCombination=function(n,t){Cart.SystemCombination.initializeBase(this,[n,t])};Cart.SystemCombination.createXYSystemCombinations=function(n,t){var i=t.length,r,u;return!Cart.BetclicSystems.isSystemPossible(i)||n<2||n>=i?null:(r=Cart.SystemCombination.$2(t,n),u=Cart.BetclicSystems.get(i,n,!0),new Cart.SystemCombination(u,r))};Cart.SystemCombination.createAllXYSystemCombinations=function(n){var i=[],r=n.length,t,u;if(Cart.BetclicSystems.isSystemPossible(r))for(t=2;t<r;t++)u=Cart.SystemCombination.createXYSystemCombinations(t,n),i.add(u);return i};Cart.SystemCombination.createAllSystemCombinations=function(n){var r=[],u=n.length,t,f,e,o,i,c,l,h,s,a;if(Cart.BetclicSystems.isSystemPossible(u)){for(t=[],f=2;f<u;f++)for(e=Cart.SystemCombination.createXYSystemCombinations(f,n),r.add(e),o=0;o<e.choicesCombinations.length;o++)t.add(e.choicesCombinations[o]);if(i=Cart.BetclicSystems.get(u,2,!1),i!=null&&(c=new Cart.ChoicesCombination(n),t.add(c),l=new Cart.SystemCombination(i,t),r.add(l)),i=Cart.BetclicSystems.get(u,1,!1),i!=null){for(h=Cart.ChoicesCombination.createAllSimpleChoicesCombinations(n),s=0;s<h.length;s++)t.add(h[s]);a=new Cart.SystemCombination(i,t);r.add(a)}}return r};Cart.SystemCombination.$1=function(n){return Cart.SystemCombination.$0[n]};Cart.SystemCombination.$2=function(n,t){for(var r=t-1,c=0,f=n.length,b=Cart.SystemCombination.$1(f)/(Cart.SystemCombination.$1(t)*Cart.SystemCombination.$1(f-t)),i=[],e=[],l=[],v,y,p,s,u,a,w,h,o=0;o<=t-1;o++)i.add(o),e.add(n[i[o]]);for(l.add(new Cart.ChoicesCombination(e)),v=1;v<=b-1;v++){for(y=1;y<=100;y++){if(i[r]+=1,p=0,i[r]>f-(t-r)){if(p=1,r-=1,r<0)return l;for(i[r]+=1,s=r+1;s<=t-1;s++)i[s]=i[s-1]+1;for(c=0,u=t-1;u>=r;u+=-1)if(i[u]<f-(t-u)+1){r=u;c=1;break}}if(c===1){c=0;break}if(!p)break}for(e=[],a=0;a<=t-1;a++)e.add(n[i[a]]);for(l.add(new Cart.ChoicesCombination(e)),w=0,h=0;h<=t-1;h++)if(i[h]!==f-(t-h)){w=1;break}if(!w)break}return l};Cart.SystemTemplate=function(n,t,i){Cart.SystemTemplate.initializeBase(this,[n,i]);this.$0={};for(var r=0;r<t.length;r++)this.$0[t[r][0]]=t[r][1];this.pMin=parseInt(n.substr(6,1));this.n=n.length===7?-1:parseInt(n.substr(7,1))};Cart.SystemTemplate.prototype={n:0,pMin:0,$0:null,isXYSystem:function(){return this.n===-1},nbChoicesMin:function(){return this.isXYSystem()?this.pMin+1:this.n},nbChoicesMax:function(){return this.isXYSystem()?8:this.n},formatName:function(n){return this.name.replace("%s%",Cart.SystemTemplate.translatedLabel).replace("%y%",n.toString())},formatOverlib:function(n){return this.overlib.replace("%NbChoix%",n.toString()).replace("%NbPari%",this.getNbChoicesCombinations(n).toString())},getNbChoicesCombinations:function(n){return this.$0[n]},getNbClassicCombinations:function(n){return this.getNbChoicesCombinations(n)-this.getNbSimpleCombinations(n)},getNbSimpleCombinations:function(n){return this.pMin===1?n:0}};Cart.BetclicSystems=function(){};Cart.BetclicSystems.isSystemPossible=function(n){return n>=3&&n<=8};Cart.BetclicSystems.getXYSystems=function(n){var i,r,t,f,u;if(!Cart.BetclicSystems.isSystemPossible(n))return null;for(i=new Array(n-2),r=Cart.BetclicSystems.$0[n],t=0,f=0;t<r.length;t++)u=r[t],u.isXYSystem()&&(i[f++]=u);return i};Cart.BetclicSystems.getAll=function(n){var i,t;if(!Cart.BetclicSystems.isSystemPossible(n))return null;for(i=new Array(Cart.BetclicSystems.$0[n].length),t=0;t<i.length;t++)i[t]=Cart.BetclicSystems.$0[n][t];return i};Cart.BetclicSystems.get=function(n,t,i){var f=Cart.BetclicSystems.getAll(n),r,u;if(f==null)return null;for(r=0;r<f.length;r++)if(u=f[r],u.pMin===t&&u.isXYSystem()===i)return u;return null};Cart.Choice=function(n,t){this.choiceId=n;this.odd=t};Cart.Choice.prototype={choiceId:0,odd:0};Cart.ChoicesCombination=function(n){this.choices=n;this.odds=1;for(var t=0;t<n.length;t++)this.odds*=n[t].odd};Cart.ChoicesCombination.createAllSimpleChoicesCombinations=function(n){for(var r=[],u=n.length,i,t=0;t<u;t++)i=[],i.add(n[t]),r.add(new Cart.ChoicesCombination(i));return r};Cart.ChoicesCombination.isCombinationPossible=function(n){return n>=2};Cart.ChoicesCombination.prototype={choices:null,odds:0,isAvailable:function(){return this.odds>=Cart.Configuration.getMinimumOdds()}};Cart.ClassicCombination=function(n){Cart.ClassicCombination.initializeBase(this,[Cart.ClassicCombination.$0,n])};Cart.ClassicCombination.createClassicCombination=function(n){var t=[];return t.add(new Cart.ChoicesCombination(n)),new Cart.ClassicCombination(t)};Cart.ClassicCombination.$1=function(n,t,i){Cart.ClassicCombination.$0=new Cart.ClassicCombinationTemplate(n,t,i)};Cart.ClassicCombinationTemplate=function(n,t,i){Cart.ClassicCombinationTemplate.initializeBase(this,[n,t]);this.overlib=i};Cart.ClassicCombinationTemplate.prototype={formatName:function(){return this.name},formatOverlib:function(){return this.overlib},getNbChoicesCombinations:function(){return 1},getNbClassicCombinations:function(){return 1},getNbSimpleCombinations:function(){return 0}};Cart.CombinableChoice=function(n,t,i,r,u,f,e,o,s){Cart.CombinableChoice.initializeBase(this,[n,r]);this.betId=t;this.matchId=i;this.key1=u.trim();this.key2=f.trim();this.key3=e.trim();this.topSimple=o;this.topProbable=s};Cart.CombinableChoice.getCombinationStatus=function(n,t){return n.equals(t)?0:n.topSimple||t.topSimple?1:n.matchId===t.matchId?2:!String.isNullOrEmpty(t.key1)&&(t.key1===n.key1||t.key1===n.key2||t.key1===n.key3)?3:!String.isNullOrEmpty(t.key2)&&(t.key2===n.key1||t.key2===n.key2||t.key2===n.key3)?3:!String.isNullOrEmpty(t.key3)&&(t.key3===n.key1||t.key3===n.key2||t.key3===n.key3)?3:0};Cart.CombinableChoice.areConflicting=function(n,t){return!!Cart.CombinableChoice.getCombinationStatus(n,t)};Cart.CombinableChoice.prototype={betId:0,matchId:0,topSimple:!1,key1:null,key2:null,key3:null,topProbable:!1,clone:function(n){return new Cart.CombinableChoice(n.choiceId,n.betId,n.matchId,n.odd,n.key1,n.key2,n.key3,n.topSimple,n.topProbable)},isConflictingWith:function(n){return Cart.CombinableChoice.areConflicting(this,n)},equals:function(n){return this.choiceId===n.choiceId}};Cart.CombinableChoice.parseServerJSon=function(n){for(var r=JSON.parse(n),u=[],t,i=0;i<r.length;i++)t=r[i],u.push(new Cart.CombinableChoice(t.Id,t.BId,t.MId,t.O,t.K1,t.K2,t.K3,t.S,t.P));return u};Cart.CombinationValidator=function(){};Cart.CombinationValidator.tryChoice=function(n,t){var i,r,u,f;if(t!=null&&t.length){for(i=n.odd,r=0;r<t.length;r++){if(u=t[r],f=Cart.CombinableChoice.getCombinationStatus(n,u),!!f)return f;i*=u.odd}return i<Cart.Configuration.getMinimumOdds()?5:i>=5e4?4:0}return n.topSimple?1:0};Cart.Combination=function(n,t){var r,f,u,i;for(this.choicesCombinations=[],r=0;r<t.length;r++)this.choicesCombinations.add(t[r]);for(this.template=n,this.maxWinningOdds=0,this.minWinningOdds=0,f=t.length,u=0;u<f;u++)i=t[u].odds,this.maxWinningOdds+=f>1?round(i,2,!0):i,(this.minWinningOdds===0||this.minWinningOdds>i)&&(this.minWinningOdds=i)};Cart.Combination.prototype={maxWinningOdds:0,minWinningOdds:0,choicesCombinations:null,template:null,isAvailable:function(){for(var n=0;n<this.choicesCombinations.length;n++)if(!this.choicesCombinations[n].isAvailable())return!1;return!0}};Cart.CombinationTemplate=function(n,t){this.code=n;this.name=t};Cart.CombinationTemplate.prototype={name:null,overlib:null,code:null};Cart.CombinationStatus.registerEnum("Cart.CombinationStatus",!1);Cart.Combination.registerClass("Cart.Combination");Cart.SystemCombination.registerClass("Cart.SystemCombination",Cart.Combination);Cart.CombinationTemplate.registerClass("Cart.CombinationTemplate");Cart.SystemTemplate.registerClass("Cart.SystemTemplate",Cart.CombinationTemplate);Cart.BetclicSystems.registerClass("Cart.BetclicSystems");Cart.Choice.registerClass("Cart.Choice");Cart.ChoicesCombination.registerClass("Cart.ChoicesCombination");Cart.ClassicCombination.registerClass("Cart.ClassicCombination",Cart.Combination);Cart.ClassicCombinationTemplate.registerClass("Cart.ClassicCombinationTemplate",Cart.CombinationTemplate);Cart.CombinableChoice.registerClass("Cart.CombinableChoice",Cart.Choice);Cart.SystemCombination.$0=null,function(){Cart.SystemCombination.$0=new Array(21);Cart.SystemCombination.$0[0]=1;for(var n=1;n<21;n++)Cart.SystemCombination.$0[n]=n*Cart.SystemCombination.$0[n-1]}();Cart.SystemTemplate.translatedLabel="";Cart.BetclicSystems.system2=new Cart.SystemTemplate("System2",[[3,3],[4,6],[5,10],[6,15],[7,21],[8,28]],"%s% 2/%y%");Cart.BetclicSystems.system3=new Cart.SystemTemplate("System3",[[4,4],[5,10],[6,20],[7,35],[8,56]],"%s% 3/%y%");Cart.BetclicSystems.system4=new Cart.SystemTemplate("System4",[[5,5],[6,15],[7,35],[8,70]],"%s% 4/%y%");Cart.BetclicSystems.system5=new Cart.SystemTemplate("System5",[[6,6],[7,21],[8,56]],"%s% 5/%y%");Cart.BetclicSystems.system6=new Cart.SystemTemplate("System6",[[7,7],[8,28]],"%s% 6/%y%");Cart.BetclicSystems.system7=new Cart.SystemTemplate("System7",[[8,8]],"%s% 7/%y%");Cart.BetclicSystems.system23=new Cart.SystemTemplate("System23",[[3,4]],"Trixie");Cart.BetclicSystems.system24=new Cart.SystemTemplate("System24",[[4,11]],"Yankee");Cart.BetclicSystems.system25=new Cart.SystemTemplate("System25",[[5,26]],"Canadian");Cart.BetclicSystems.system26=new Cart.SystemTemplate("System26",[[6,57]],"Heinz");Cart.BetclicSystems.system27=new Cart.SystemTemplate("System27",[[7,120]],"Super Heinz");Cart.BetclicSystems.system28=new Cart.SystemTemplate("System28",[[8,247]],"Goliath");Cart.BetclicSystems.system13=new Cart.SystemTemplate("System13",[[3,7]],"Patent");Cart.BetclicSystems.system14=new Cart.SystemTemplate("System14",[[4,15]],"Lucky 15");Cart.BetclicSystems.system15=new Cart.SystemTemplate("System15",[[5,31]],"Lucky 31");Cart.BetclicSystems.system16=new Cart.SystemTemplate("System16",[[6,63]],"Lucky 63");Cart.BetclicSystems.$0=null;Cart.BetclicSystems.maxNbChoicesInSystem=8;Cart.BetclicSystems.minNbChoicesInSystem=3,function(){Cart.BetclicSystems.$0={};Cart.BetclicSystems.$0[3]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system23,Cart.BetclicSystems.system13];Cart.BetclicSystems.$0[4]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system3,Cart.BetclicSystems.system24,Cart.BetclicSystems.system14];Cart.BetclicSystems.$0[5]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system3,Cart.BetclicSystems.system4,Cart.BetclicSystems.system25,Cart.BetclicSystems.system15];Cart.BetclicSystems.$0[6]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system3,Cart.BetclicSystems.system4,Cart.BetclicSystems.system5,Cart.BetclicSystems.system26,Cart.BetclicSystems.system16];Cart.BetclicSystems.$0[7]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system3,Cart.BetclicSystems.system4,Cart.BetclicSystems.system5,Cart.BetclicSystems.system6,Cart.BetclicSystems.system27];Cart.BetclicSystems.$0[8]=[Cart.BetclicSystems.system2,Cart.BetclicSystems.system3,Cart.BetclicSystems.system4,Cart.BetclicSystems.system5,Cart.BetclicSystems.system6,Cart.BetclicSystems.system7,Cart.BetclicSystems.system28]}();Cart.ClassicCombination.$0=null;Cart.Configuration=function(){};Cart.Configuration.getMinimumOdds=function(){return Cart.Configuration.$0};Cart.Configuration.setupClassicCombinationTemplate=function(n,t,i){Cart.ClassicCombination.$1(n,t,i)};Cart.Configuration.setupSystemTemplateOverlib=function(n,t){n.overlib=t};Cart.Configuration.setupSystemTemplateTranslatedLabel=function(n){Cart.SystemTemplate.translatedLabel=n};Cart.Configuration.setupMinimumOdds=function(n){Cart.Configuration.$0=n};Cart.Configuration.$0=1;Cart.Configuration.registerClass("Cart.Configuration"),function(n,t,i){"use strict";var u={_controller:function(t){return n.betControllerUrl.replace("action",t)},_enrichCartApiResult:function(n){return n=this._currentMapCartApiResultDataCallback(n),t.isArray(n.SelectionIds)&&(this._selectionIds=n.SelectionIds),n},_resetSelectionsInCart:function(){this._selectionIds=[]},get:function(){return t.get(this._controller("get")+this.cart).pipe(this._enrichCartApiResult.bind(this))},add:function(n,i,r){var u={id:n,redirectMultiplex:i};return typeof r!="undefined"&&r!==""&&(u={id:n,matchId:i,matchName:r}),t.post(this._controller("add")+this.cart,u).pipe(this._enrichCartApiResult.bind(this))},remove:function(n,i){if(!n)throw new Error("selectionId is not defined.");return t.post(this._controller("remove")+this.cart,{id:n,redirectMultiplex:i}).pipe(this._enrichCartApiResult.bind(this))},toggle:function(n,i){if(!n)throw new Error("selectionId is not defined.");return t.post(this._controller("toggle")+this.cart,{id:n,redirectMultiplex:i}).pipe(this._enrichCartApiResult.bind(this))},empty:function(){var n=new i;return n.SetMode(n.Const.EnumAdvance),n.SetJSonData({}),t.post(this._controller("empty")+this.cart,n.GetJsonToPost()).pipe(this._enrichCartApiResult.bind(this))},stakes:function(n,i){return t.post(this._controller("stakes")+this.cart,{simpleStake:n,multipleStake:i}).pipe(this._enrichCartApiResult.bind(this))},multiplestake:function(n,i){return t.post(this._controller("multiplestake")+this.cart,{selections:n,multipleStake:i}).pipe(this._enrichCartApiResult.bind(this))},getIds:function(){return this._selectionIds},multipleSelections:function(n){return t.post(this._controller("setMultipleSelections"),{selections:n})},simplestake:function(n,i){return t.post(this._controller("simplestake")+this.cart,{simplestake:n,selectionId:i}).pipe(this._enrichCartApiResult.bind(this))},placeBet:function(n,r,u,f,e,o,s){var h=new i,c;return h.SetMode(h.Const.EnumAdvance),h.SetJSonData({simpleStakes:JSON.stringify(n),multipleStake:r,systemStake:u,systemCode:f,sendAMail:e,redirectUrlPlacedBet:o,isFreebet:s}),c=this,t.post(this._controller("placebet"),h.GetJsonToPost()).pipe(function(n){return c._resetSelectionsInCart(),n})},placeLiveBet:function(n,r){var u=new i,f;return u.SetMode(u.Const.EnumAdvance),u.SetJSonData({ticks:n,isFreebet:r}),f=this,t.post(this._controller("placelivebet"),u.GetJsonToPost()).pipe(function(n){return f._resetSelectionsInCart(),n})},systemStake:function(n,i){return t.post(this._controller("systemstake"),{systemStake:n,systemCode:i}).pipe(this._enrichCartApiResult.bind(this))},checkLive:function(n){return t.post(this._controller("checklive"),n)},refreshCart:function(n){return t.get(this._controller("refreshCart"),{isOddChanged:n}).pipe(this._enrichCartApiResult.bind(this))},restore:function(){return t.get(this._controller("restoreCart")).pipe(this._enrichCartApiResult.bind(this))},setEmailNotifications:function(n){return t.post(this._controller("setEmailNotifications"),{enabled:n})},setImprovedSelections:function(n,i){return t.post(this._controller("setImprovedSelections"),{enabled:n,selections:i})},setMultipleSelections:function(n){return t.post(this._controller("setMultipleSelections"),{selections:n})},setSystemBets:function(n){return t.post(this._controller("setSystemBets"),{enabled:n})},setIsFreebet:function(n){return t.post(this._controller("setIsFreebet")+this.cart,{enabled:n}).pipe(this._enrichCartApiResult.bind(this)).done(function(n){n.ResultType==="Popup"&&(t("#freebet-choose").prop("checked",!1),PopupOnSuccess(n))})}},r;n.CartApi=function(n,t){this.cart=n===!0?"livecart":"cart";this._selectionIds=[];this._currentMapCartApiResultDataCallback=t?t:function(n){return n}};n.CartApi.prototype=u;r=function(t){return n.Cart&&t.CombinedBetSelections&&(t.CombinedBetSelections=n.Cart.CombinableChoice.parseServerJSon(t.CombinedBetSelections),t.SelectionIds||(t.SelectionIds=t.CombinedBetSelections.map(function(n){return n.choiceId})),this._CombinedBetSelections=t.CombinedBetSelections),t};n.preliveCartApi=new CartApi(!1,r);n.liveCartApi=new CartApi(!0);n.preliveCartApi._resetSelectionsInCart=function(){this._selectionIds=[];this._CombinedBetSelections=[]};n.preliveCartApi._CombinedBetSelections=[];n.preliveCartApi.getCombinedBetSelections=function(){return this._CombinedBetSelections}}(window,jQuery,AntiFrogeryAPI);BettingSlipApiResources.prototype={get informationLabel(){return this._informationLabel},get betLabel(){return this._betLabel},get betsLabel(){return this._betsLabel},get aboveMaxNumberOfSelectionsErrMsg(){return this._aboveMaxNumberOfSelectionsErrMsg},get currencySymbol(){return this._currencySymbol}};BettingSlipApiParameters.prototype={get maxBetAvailable(){return this._maxBetAvailable},get minBetAvailable(){return this._minBetAvailable},get maxNumberOfSelections(){return this._maxNumberOfSelections},get oddsFormat(){return this._oddsFormat},get isSystemEnabled(){return this._isSystemEnabled},get isSystemVisible(){return this._isSystemVisible},get isBetterSelectionsEnabled(){return this._isBetterSelectionsEnabled},get isMailNotificationsEnabled(){return this._isMailNotificationsEnabled},get currencyCode(){return this._currencyCode},get bonusMinOdds(){return this._bonusMinOdds},get cancelBonusIfAnyBlocked(){return this._cancelBonusIfAnyBlocked},get isLegalMaxBetAvailable(){return this._isLegalMaxBetAvailable},get isTaxFreeApplicable(){return this._isTaxFreeApplication},get taxFreeMinimumOdds(){return this._taxFreeMinimumOdds},get taxFreeMinimumBets(){return this._taxFreeMinimumBets}};BettingSlipApiMultipleBonusResources.prototype={get minNumberOfSelectionsLabel(){return this._minNumberOfSelectionsLabel},get addOneForBonusLabel(){return this._addOneForBonusLabel},get addMoreForBonusLabel(){return this._addMoreForBonusLabel},get nextBonusLabel(){return this._nextBonusLabel},get includingBonusLabel(){return this._includingBonusLabel},get includingBonusLimitedLabel(){return this._includingBonusLimitedLabel},get eventBlockedLabel(){return this._eventBlockedLabel},get oddsBlockedLabel(){return this._oddsBlockedLabel}};BettingSlipApiConfiguration.prototype={get resources(){return this._resources},get parameters(){return this._parameters},get multipleBonusResources(){return this._multipleBonusResources}};BettingSlipApi=function(){function t(t){n=new BettingSlipApiConfiguration(t)}function i(t){return n.parameters.currencyCode=="GBP"?n.resources.currencySymbol+"&nbsp;"+t:t+"&nbsp;"+n.resources.currencySymbol}var n=null;return{setup:t,get resources(){return n.resources},get parameters(){return n.parameters},get multipleBonusResources(){return n.multipleBonusResources},formatAmountUsingCurrency:i}}(),function(n,t){"use strict";function i(n){var t=Array.prototype.slice.call(arguments,1);return n.prop?n.prop.apply(n,t):n.attr.apply(n,t)}function r(n,t,i){var r,u;for(r in i)i.hasOwnProperty(r)&&(u=r.replace(/ |$/g,t.eventNamespace),n.bind(r,i[r]))}function f(n,t,i){r(n,i,{focus:function(){t.addClass(i.focusClass)},blur:function(){t.removeClass(i.focusClass);t.removeClass(i.activeClass)},mouseenter:function(){t.addClass(i.hoverClass)},mouseleave:function(){t.removeClass(i.hoverClass);t.removeClass(i.activeClass)},"mousedown touchbegin":function(){n.is(":disabled")||t.addClass(i.activeClass)},"mouseup touchend":function(){t.removeClass(i.activeClass)}})}function e(n,t){n.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass)}function v(n,t,i){i?n.addClass(t):n.removeClass(t)}function o(n,t,i){var r="checked",u=t.is(":"+r);t.prop?t.prop(r,u):u?t.attr(r,r):t.removeAttr(r);v(n,i.checkedClass,u)}function u(n,t,i){v(n,i.disabledClass,t.is(":disabled"))}function l(n,t,i){switch(i){case"after":return n.after(t),n.next();case"before":return n.before(t),n.prev();case"wrap":return n.wrap(t),n.parent()}return null}function s(t,r,f){var e,o,s;return f||(f={}),f=n.extend({bind:{},divClass:null,divWrap:"wrap",spanClass:null,spanHtml:null,spanWrap:"wrap"},f),e=n("<div />"),o=n("<span />"),r.autoHide&&t.is(":hidden")&&"none"===t.css("display")&&e.hide(),f.divClass&&e.addClass(f.divClass),f.spanClass&&o.addClass(f.spanClass),s=i(t,"id"),r.useID&&s&&i(e,"id",r.idPrefix+"-"+s),f.spanHtml&&o.html(f.spanHtml),e=l(t,e,f.divWrap),o=l(t,o,f.spanWrap),u(e,t,r),{div:e,span:o}}function g(){var u,t,i,r;return r="rgb(120,2,153)",t=n('<div style="width:0;height:0;color:'+r+'">'),n("body").append(t),i=t.get(0),u=window.getComputedStyle?window.getComputedStyle(i,"").color:(i.currentStyle||i.style||{}).color,t.remove(),u.replace(/ /g,"")!==r}function nt(t){return t?n("<span />").text(t).html():""}function y(n){var t;return n[0].multiple?!0:(t=i(n,"size"),!t||1>=t?!1:!0)}function h(){return!1}function c(n,t){var i="none";r(n,t,{"selectstart dragstart mousedown":h});n.css({MozUserSelect:i,msUserSelect:i,webkitUserSelect:i,userSelect:i})}function p(n,t,i){var r=n.val();""===r?r=i.fileDefaultHtml:(r=r.split(/[\/\\]+/),r=r[r.length-1]);t.text(r)}function tt(n,t,i){var r,u;for(r=[],n.each(function(){var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r.push({el:this,name:n,old:this.style[n]}),this.style[n]=t[n])}),i();r.length;)u=r.pop(),u.el.style[u.name]=u.old}function w(n,t){tt(n.parents().andSelf().not(":visible"),{visibility:"hidden",display:"block",position:"absolute"},t)}function b(n,t){return function(){n.unwrap().unwrap().unbind(t.eventNamespace)}}var a=!0,k=!1,d=[{match:function(n){return n.is("a, button, :submit, :reset, input[type='button']")},apply:function(n,t){var o,h,a,v,l;return h=t.submitDefaultHtml,n.is(":reset")&&(h=t.resetDefaultHtml),v=n.is("a, button")?function(){return n.html()||h}:function(){return nt(i(n,"value"))||h},a=s(n,t,{divClass:t.buttonClass,spanHtml:v()}),o=a.div,f(n,o,t),l=!1,r(o,t,{"click touchend":function(){var r,f,t,u;l||(l=!0,n[0].dispatchEvent?(r=document.createEvent("MouseEvents"),r.initEvent("click",!0,!0),f=n[0].dispatchEvent(r),(jQuery.browser.msie||jQuery.browser.mozilla)&&n.is("a")&&f&&(t=i(n,"target"),u=i(n,"href"),t&&"_self"!==t?window.open(u,t):document.location.href=u)):n.click(),l=!1)}}),c(o,t),{remove:function(){return o.after(n),o.remove(),n.unbind(t.eventNamespace),n},update:function(){e(o,t);u(o,n,t);a.span.html(v())}}}},{match:function(n){return n.is(":checkbox")},apply:function(n,t){var c,h,i;return c=s(n,t,{divClass:t.checkboxClass}),h=c.div,i=c.span,f(n,h,t),r(n,t,{"click touchend":function(){o(i,n,t)}}),o(i,n,t),{remove:b(n,t),update:function(){e(h,t);i.removeClass(t.checkedClass);o(i,n,t);u(h,n,t)}}}},{match:function(n){return n.is(":file")},apply:function(t,o){function v(){p(t,h,o)}var y,a,h,w;return y=s(t,o,{divClass:o.fileClass,spanClass:o.fileButtonClass,spanHtml:o.fileButtonHtml,spanWrap:"after"}),a=y.div,w=y.span,h=n("<span />").html(o.fileDefaultHtml),h.addClass(o.filenameClass),h=l(t,h,"after"),i(t,"size")||i(t,"size",a.width()/10),f(t,a,o),v(),n.browser.msie?r(t,o,{click:function(){t.trigger("change");setTimeout(v,0)}}):r(t,o,{change:v}),c(h,o),c(w,o),{remove:function(){return h.remove(),w.remove(),t.unwrap().unbind(o.eventNamespace)},update:function(){e(a,o);p(t,h,o);u(a,t,o)}}}},{match:function(n){if(n.is("input")){var t=(" "+i(n,"type")+" ").toLowerCase();return" color date datetime datetime-local email month number password search tel text time url week ".indexOf(t)>=0}return!1},apply:function(n){var t=i(n,"type");return n.addClass(t),{remove:function(){n.removeClass(t)},update:h}}},{match:function(n){return n.is(":radio")},apply:function(t,h){var l,c,a;return l=s(t,h,{divClass:h.radioClass}),c=l.div,a=l.span,f(t,c,h),r(t,h,{"click touchend":function(){n.uniform.update(n(':radio[name="'+i(t,"name")+'"]'))}}),o(a,t,h),{remove:b(t,h),update:function(){e(c,h);o(a,t,h);u(c,t,h)}}}},{match:function(n){return n.is("select")&&!y(n)?!0:!1},apply:function(t,i){var l,h,o,a;return i.selectAutoWidth&&w(t,function(){a=t.width()}),l=s(t,i,{divClass:i.selectClass,spanHtml:(t.find(":selected:first")||t.find("option:first")).html(),spanWrap:"before"}),h=l.div,o=l.span,i.selectAutoWidth?w(t,function(){var n;n=o.outerWidth()-o.width();h.width(a+n);o.width(a)}):h.addClass("fixedWidth"),f(t,h,i),r(t,i,{change:function(){o.html(t.find(":selected").html());h.removeClass(i.activeClass)},"click touchend":function(){var n=t.find(":selected").html();o.html()!==n&&t.trigger("change")},keyup:function(){o.html(t.find(":selected").html())}}),c(o,i),{remove:function(){return o.remove(),t.unwrap().unbind(i.eventNamespace),t},update:function(){i.selectAutoWidth?(n.uniform.restore(t),t.uniform(i)):(e(h,i),o.html(t.find(":selected").html()),u(h,t,i))}}}},{match:function(n){return n.is("select")&&y(n)?!0:!1},apply:function(n,t){return n.addClass(t.selectMultiClass),{remove:function(){n.removeClass(t.selectMultiClass)},update:h}}},{match:function(n){return n.is("textarea")},apply:function(n,t){return n.addClass(t.textareaClass),{remove:function(){n.removeClass(t.textareaClass)},update:h}}}];n.browser.msie&&7>n.browser.version&&(a=!1);n.uniform={defaults:{activeClass:"active",autoHide:!0,buttonClass:"button",checkboxClass:"checker",checkedClass:"checked",disabledClass:"disabled",eventNamespace:".uniform",fileButtonClass:"action",fileButtonHtml:"Choose File",fileClass:"uploader",fileDefaultHtml:"No file selected",filenameClass:"filename",focusClass:"focus",hoverClass:"hover",idPrefix:"uniform",radioClass:"radio",resetDefaultHtml:"Reset",resetSelector:!1,selectAutoWidth:!0,selectClass:"selector",selectMultiClass:"uniform-multiselect",submitDefaultHtml:"Submit",textareaClass:"uniform",useID:!0},elements:[]};n.fn.uniform=function(t){var i=this;return t=n.extend({},n.uniform.defaults,t),k||(k=!0,g()&&(a=!1)),a?(t.resetSelector&&n(t.resetSelector).mouseup(function(){window.setTimeout(function(){n.uniform.update(i)},10)}),this.each(function(){var r,u,f,i=n(this);if(i.data("uniformed"))return n.uniform.update(i),void 0;for(r=0;d.length>r;r+=1)if(u=d[r],u.match(i,t))return f=u.apply(i,t),i.data("uniformed",f),n.uniform.elements.push(i.get(0)),void 0})):this};n.uniform.restore=n.fn.uniform.restore=function(i){i===t&&(i=n.uniform.elements);n(i).each(function(){var t,i,r=n(this);i=r.data("uniformed");i&&(i.remove(),t=n.inArray(this,n.uniform.elements),t>=0&&n.uniform.elements.splice(t,1),r.removeData("uniformed"))})};n.uniform.update=n.fn.uniform.update=function(i){i===t&&(i=n.uniform.elements);n(i).each(function(){var t,i=n(this);t=i.data("uniformed");t&&t.update(i,t.options)})}}(jQuery);var BettingSlipControls={MultipleStake:function(){return $("#MultipleStake",$bsContainer)},SimpleStake:function(){return $("#SimpleStake",$bsContainer)},SimpleStakes:function(){return $("input[name=SimpleStake]",$bsContainer)},SystemCombobox:function(){return $("#systemSelect",$bsContainer)},SystemStake:function(){return $("#SystemStake",$bsContainer)},SystemPanel:function(){return $("#betSystem",$bsContainer)},GetSystemOptionByCode:function(n){return BettingSlipControls.SystemCombobox().find("option[value="+n+"]")},GetFirstSystemOption:function(){return BettingSlipControls.SystemCombobox().find("option:first")},GetSystemOptionSelected:function(){return BettingSlipControls.SystemCombobox().find("option:selected")},BetSettings:function(){return $("#bs-settings")},BetSettingsToggle:function(){return $("#bs-settings-toggle")}},Config={BSPanelSelector:"#pre-live-bs",BSTitleSelector:".betslipTitle",BSDeleteSelector:".bs-delete-bet",AutoFocusStake:!1,BSScrollAdjustment:20,BSBetsContainerSelector:"#wrapBetslipBox",TotalStakeValueContainer:"#system-total-stake-value",SystemPossibleWinningContainer:"#possible-win-systems",SlideDuration:0},OddButtonClass=OddButtonClass||"",oddButtonSelectedClass="selected",oddButtonNotClickable="notclickable",oddButtonHoverClass="hover",tabSelectionIds="",tabLiveIds=[],SimpleErrorDivIds=["#bs-error-input-simple","#bs-error-input-simple-max","#bs-error-input-simple-min","#bs-warning-haslowodds","#bs-warning-haslowoddsbonus","#bs-warning-simpleOddsLowerThanMinimum","#bs-warning-taxFreeSomeMore","#bs-warning-taxFreeOneMore","#bs-warning-taxFree"],SystemErrorDivIds=["#bs-error-input-system","#bs-error-input-system-max","#bs-error-input-system-min","#bs-error-system","#bs-error-system-keyserror","#bs-error-system-abovemaxodds","#bs-error-system-single","#bs-warning-taxFree"],$bsContainer,isBSScrollingEnabled=!1,isPrelive,allowIndividualStakes,areStakesInitialized=!1,bettingSlipTimer=-1,isImprovedSelectionsMode=!1,isSystemBetsVisible=!1,isBetInProgress=!1,isNewCalendarFFOn=!1;$(function(){$bsContainer=$bsContainer||$(Config.BSPanelSelector);isBSScrollingEnabled=$bsContainer.hasClass("bsScroll");isPrelive=$bsContainer.attr("id")!=="live-bs";allowIndividualStakes=isPrelive;betCartGet().done(function(n){updateTotalStakeAndWinnings(n);updateSimpleStakePossibleWinnings(n);updateStakesFieldset(n,Config.SlideDuration);updateMultipleBonus(n.MultipleBonus,n.MultipleStatus==="Ok");initStakes();CheckDisplayError();setOddsHighLightInContainer($(document));n.isFreebet&&$("#freebet-choose").prop("checked",!0)});betCartGetLive();setEventListeners()});updateMultipleBonus=function(n,t){function u(n){return Math.floor(n*100)/100}var e,i,r,f,o,s;if($("#bs-multiBonus-min-odd-error-msg").hide(),$("#bs-bonus-dy-nb-eligible").hide(),$("#bs-bonus-dy-nb-left").hide(),$("#bs-bonus-dy-label").hide(),$("#bs-bonus-dy-value").hide(),$("#bs-bonus-dy").hide(),e=$("#freebet-choose").is(":checked"),!e&&n!=null&&(t||!(getNbSelections()>1))){if($("#bs-bonus-dy").show(),i=BettingSlipApi.multipleBonusResources,r=n.NbOfSelections,BettingSlipApi.parameters.cancelBonusIfAnyBlocked===!0){if(n.ThereIsOneMatchBlocked){$("#bs-bonus-dy-nb-left").html(i.eventBlockedLabel);$("#bs-bonus-dy-nb-left").show();return}if(n.ThereIsOneOddsTooLow){$("#bs-bonus-dy-nb-left").html(i.oddsBlockedLabel);$("#bs-bonus-dy-nb-left").show();return}}r<n.MinNbBet?(i.minNumberOfSelectionsLabel&&($("#bs-bonus-dy-nb-eligible").html(i.minNumberOfSelectionsLabel.replace("%nb%",r)),$("#bs-bonus-dy-nb-eligible").show()),f=n.MinNbBet-r,o=f===1&&i.addOneForBonusLabel?i.addOneForBonusLabel.replace("%percent%",n.NextPercent):i.addMoreForBonusLabel.replace("%min_events%",n.MinNbBet).replace("%nb%",f).replace("%percent%",n.NextPercent),$("#bs-bonus-dy-nb-left").html(o),$("#bs-bonus-dy-nb-left").show()):(n.NextPercent>0&&(s=i.nextBonusLabel.replace("%odd_of_next_line%",u(n.NextPercent)+"%").replace("%percent%",u(n.NextPercent)),n.CurrentPercent!==n.NextPercent&&($("#bs-bonus-dy-nb-left").html(s),$("#bs-bonus-dy-nb-left").show())),i.includingBonusLabel&&(n.IsLimited?$("#bs-bonus-dy-label").html(i.includingBonusLimitedLabel).show():$("#bs-bonus-dy-label").html(i.includingBonusLabel.replace("%boostPercentage%",u(n.CurrentPercent))).show(),$("#bs-bonus-dy-value").html(BettingSlipApi.formatAmountUsingCurrency(AffichageMontant(n.MultipleBonusWinnings))).show()))}};window.cartApi=preliveCartApi;Config.BSPanelSelector="#pre-live-bs";Config.BSTitleSelector=".section-title";Config.AutoFocusStake=!1;Config.BSScrollAdjustment=0;Config.BSBetsContainerSelector="#bets-container";Config.BSDeleteSelector=".bs-delete-bet";Config.TotalStakeValueContainer="#system-total-stake-value";Config.SystemPossibleWinningContainer="#possible-win-systems";$(document).on("bet.added",function(n,t){$(this).trigger("bet.highlight",t)});$(document).on("systemstake.update",function(n,t){t.IsNbBetSystemMax?($("#betSystem a.qTip",$bsContainer).hide(),$("#betSystemError",$bsContainer).show().addClass("active")):($("#betSystem a.qTip",$bsContainer).show(),$("#betSystemError",$bsContainer).hide().removeClass("active"))});(function(n){$(function(){$("#bets-container").on("mouseenter","li",function(){$(".bs-delete-bet",this).show()}).on("mouseleave","li",function(){$(".bs-delete-bet",this).hide()});n.registerInitCallback("odds-highlight",setOddsHighLightInContainer)})})(DOMElementInitializationManager);MultipleErrorDivIds=["#bs-error-combined-keyserror","#bs-error-combined","#bs-error-combined-single","#bs-error-input-multiple","#bs-error-input-multiple-max","#bs-error-input-multiple-min","#bs-error-combined-lowodds","#bs-error-combined-abovemaxodds","#bs-error-isLegame","#bs-warning-haslowoddsbonusmultiple","#bs-warning-multipleOddsLowerThanMinimum","#bs-warning-taxFreeSomeMore","#bs-warning-taxFreeOneMore","#bs-warning-taxFree"];MyStake={OpenTicket:function(n){$.ajax({url:n,type:"POST",dataType:"json",success:function(n){var t=new frontApi;t.manageAjaxResult(n)}})}};BetBeginnerApi=function(){};BetBeginnerApi.prototype={Params:{progressList:[],progressMax:1e6},GetActionBetBeginner:function(n){return betBeginnerControllerUrl.replace("action",n)},GetActionBet:function(n){return betControllerUrl.replace("action",n)},GetTaxAmount:function(n){return $.ajax({url:this.GetActionBetBeginner("GetTaxRate"),data:{simpleBetAmount:n}})},SimpleBet:function(n){$.ajax({url:this.GetActionBetBeginner("SimpleBet"),data:{selectionId:n},success:function(n){displayPopUp(n)}})},OpportunityBet:function(n){GaPush(GaLblAction_Opportunities,GaLblCateg_HomePage);$.ajax({url:this.GetActionBetBeginner("OpportunityBet"),data:{opportunityId:n},success:function(n){displayPopUp(n)}})},AmountLess:function(n,t,i){for(var f=this.Params.progressList,e=n.val(),r=0,u=0;u<f.length;u++)parseFloat(f[u])<parseFloat(e)&&(r=f[u]);r==0&&(r=1);r=Math.min(r,this.Params.progressMax);n.val(AffichageMontant(r));this.UpdateWinning(i,r,t)},AmountMore:function(n,t,i){for(var f=this.Params.progressList,e=n.val(),r=0,u=f.length-1;u>=0;u--)parseFloat(f[u])>parseFloat(e)&&(r=f[u]);r=Math.min(r,this.Params.progressMax);n.val(AffichageMontant(r));this.UpdateWinning(i,r,t)},AmountCompute:function(n,t,i,r){var u=n.val(),f;u=u.replace(",00","");u=u.replace(".00","");r||u.toString().indexOf(",")==-1&&u.toString().indexOf(".")==-1?u!=""&&u!=undefined&&isNumerique(u)&&isNumerique(i)?(f=convertdecimal(u),this.UpdateWinning(convertdecimal(i),f,t)):(n.val(""),this.UpdateWinning(0,0,t)):(n.val(""),this.UpdateWinning(0,0,t))},UpdateWinning:function(n,t,i){var r=0,u=0;isNumerique(t)&&(u=convertdecimal(t),r=u*n,this.GetTaxAmount(r).done(function(n){this.Params=this.Params||{};this.Params.taxValue=n.TaxRate;this.Params.taxValue>0&&(r=r*(1-this.Params.taxValue/100));i.text(AffichageMontant(r))}))},GetOpportunityBetPostData:function(n,t,i){var r=new AntiFrogeryAPI;return r.SetMode(r.Const.EnumBeginner),r.SetJSonData({opportunityId:n,opportunityStake:t,needConfirmMail:i}),r.GetJsonToPost()},GetSimpleBetPostData:function(n,t,i){var r=new AntiFrogeryAPI;return r.SetMode(r.Const.EnumBeginner),r.SetJSonData({selectionId:n,selectionStake:t,needConfirmMail:i}),r.GetJsonToPost()},GetPlaceSimpleBetActionUrl:function(){return this.GetActionBetBeginner("PlaceSimpleBet")},GetPlaceOpportunityBetActionUrl:function(){return this.GetActionBetBeginner("PlaceOpportunityBet")},UpdateUserBetLevel:function(n,t){$.ajax({url:this.GetActionBet("UpdateUserBetLevel"),data:{setExpertMode:n,selectionId:t},success:function(n){displayPopUp(n)}})},ValidateAmountType:function(n){return isNumerique(n)&&convertdecimal(n)>0?!0:!1},DisplayErrorMessage:function(n){var t=$("<div/>").html(n).text();$("#popBetError").show();$("#popBetErrorLabel").empty().html(t)}};jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{};t===null&&(t="",i.expires=-1);f="";i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",encodeURIComponent(t),f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=decodeURIComponent(s.substring(n.length+1));break}return e}}