function ProductionEnvironment(){return-1==window.location.hostname.search("local")}"undefined"==typeof modules&&(modules=[]);var app=angular.module("mainApp",["ngAnimate"]);app.config(["$httpProvider",function(e){e.defaults.transformRequest=function(e){return void 0===e?e:$.param(e)},e.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"}]),app.filter("startFrom",(function(){return function(e,t){return e?(t=+t,e.slice(t)):[]}}));var restartInt,servIP=_theme.server_ip||"",socket=io.connect(servIP+"/game",{transports:["websocket"],secure:!0,rememberTransport:!0,reconnectionAttempts:1600}),latest_disconnect=!1;let deferredPrompt,removePrefixWhenDisable=["djdl777","77live","mdl97","zak168","phl63","thb999","ssbet77","myn77","mmbet99","ubet95","pph855","gog777","shall777","shwe666","jdbkx","yg168","ing555","ing777","saigon777","iplay69","phv88","959slot","jdbjhl","jzb668","jdbtg","mandalay888","live368","ppg11","gkk777","i8mm","jp789","21slot","jyjdb88","hn989","dexi777","spin368","true788","topslot","popeye888","pro9","mthai7","kyat365","kst777","shwe999","jiliam","999lord","rpg666"],removePrefixWhenEnabled=["550ww","oko99","mdl97","ubet89","betluckmak","zak168","phl63","thb999","ssbet77","myn77","mmbet99","shall777","jdbkx","shwe666","ubet95","pph855","gog777","ing555","ing777","saigon777","皇家利华","iplay69","phv88","959slot","jdbjhl","jzb668","jdbtg","mandalay888","live368","ppg11","gkk777","i8mm","jp789","21slot","jyjdb88","yg168","hn989","dexi777","spin368","true788","topslot","popeye888","pro9","Kodluck","mthai7","kyat365","kst777","shwe999","jiliam","999lord","rpg666"],addPrefix=["zak168","djdl777","77live","mdl97","fed88","phl63","myn77","ubet95","pph855","jdbjhl","MWD666","jzb668","jdbtg","mandalay888","live368","jdbkx","shwe666","ppg11","phv88","gkk777","i8mm","jp789","21slot","jyjdb88","shall777","yg168","hn989","dexi777","spin368","true788","topslot","popeye888","pro9","mthai7","kyat365","kst777","shwe999","jiliam","999lord","rpg666"];function ajax(e,t,a){e.includes("/play")?$.ajax({url:e,xhrFields:{withCredentials:!0},contentType:"application/json; charset=UTF-8",type:void 0===a?"GET":"POST",data:JSON.stringify(a),timeout:6e4}).done((function(e){return t(e)})).fail((function(e,a,o){return t(o)})):$.ajax({url:e,xhrFields:{withCredentials:!0},contentType:"application/json; charset=UTF-8",type:void 0===a?"GET":"POST",data:JSON.stringify(a)}).done((function(e){return t(e)}))}function ajaxFormData(e,t,a){var o=new FormData(t);$.ajax({type:"POST",xhrFields:{withCredentials:!0},url:servIP+e,data:o,cache:!1,contentType:!1,processData:!1,success:function(e){return a(e)},error:function(e){}})}function ajaxFormDataEdit(e,t,a){var o=new FormData("object"==typeof t?void 0:t);if("object"==typeof t)for(var n in t)o.append(n,t[n]);$.ajax({type:"POST",xhrFields:{withCredentials:!0},url:servIP+e,data:o,cache:!1,contentType:!1,processData:!1,success:function(e){return a(e)},error:function(e){return a(e)}})}function objectifyForm(e){for(var t=$(e).serializeArray(),a={},o=0;o{deferredPrompt=e})),window.addEventListener("appinstalled",(e=>{swal({title:'"App installed!',text:"Please check home your screen",imageUrl:msg_img.success,imageSize:"100x100",confirmButtonText:'ตกลง'})})),window.addEventListener("message",(e=>{var t=angular.element(document.body).injector().get("$rootScope");if("claimReward"==e.data.event_name){let a=e.data.Loyalty_point;$(".loyalty_loading").css("display","flex"),$(".loyalty_point_home").css("display","none"),setTimeout((()=>{$(".loyalty_point_home").text(Number(a).toFixed(2)),$(".loyalty_point_home").css("display","block"),$(".loyalty_loading").css("display","none")}),1200),t.checkClaimRewardOnGame()}else if("claimCashback"==e.data.event_name){let a=e.data.cashback_point;setTimeout((()=>{$(".cashback_point_home").text(Number(a).toFixed(2)),$(".cashback_point_home").css("display","block"),$(".dots-loading-cashback").css("display","none"),$(".cashback_popup").css("display","block")}),1200),t.checkClaimRewardOnGame()}else if("promotionClick"==e.data.event_name){let t=e.data.url;window.location.href=/t}else/"refreshGift"==e.data.event_name&&t.goToPageReward()})),$(document).ready((function(){if($('[data-target="#modal_login"]').on("click",(function(){Cookies.remove("desire")})),$(".set-lang").on("click",(function(){Cookies.remove("modal");let e=$(this).data("lang");ajax("/script",(function(t){t.success&&(Cookies.set("Cookies_lang",e,{expires:365}),location.href=/location.origin location.pathname"?lang="+e)}),{method:"lang",val:$(this).data("lang")})})),$.fn.qrcode&&$("[data-qr]").each((function(e){$(this).qrcode($(this).data("qr"))})),$("#login_btn").on("click",(function(){if(Cookies.get("usr")&&parseInt(Cookies.get("atmp"))>0)return $("#modal_login_pattern").modal();$("#modal_login").modal()})),($draggable=$(".menu-switcher").draggabilly({containment:!1}).on("dragEnd",(function(e,t){var a=window.innerWidth,o=window.innerHeight,n=t?t.pageX:$(this).position().left;$(this).css({transition:"0.2s ease-out"}).delay(200).queue((function(e){$(this).css({transition:""}),e()})),n{$(this).removeClass("transition"),$(this).find(".highlight").removeClass("transition")}),250)})).on("mousemove",(function(t){var a=t.offsetX,o=t.offsetY,n=$(this).width()/2,i=$(this).height()/2,l=e/n*(a-n),s=e/i*(i-o);$(this).css("transform",`rotateX(${s}deg) rotateY(${l}deg)`),$(this).find(".highlight").css("top",`-${50*s}px`),$(this).find(".highlight").css("right",50*l+"px")})).on("mouseleave",(function(e){$(this).addClass("transition"),$(this).find(".highlight").addClass("transition"),setTimeout((()=>{$(this).attr("style",""),$(this).find(".highlight").attr("style","")}),250),setTimeout((()=>{$(this).removeClass("transition"),$(this).find(".highlight").removeClass("transition")}),500)}))}})),$("#modal_money_popup .modal-header .close").on("click",(function(){$("#modal_money_popup").modal("hide"),$("#moneyIframeUrl").attr("src","about:blank")})),$("#modal_notification_credit .modal-header .close").on("click",(function(){$("#modal_notification_credit").modal("hide")})),app.run(["$rootScope",function(e){function t(){_theme.allPlayNewTab?$("#newtab-game-frame").height($(window).height()):($("#game-frame").width("UG"==e.playing_game&&"mobile"==_theme.device?2*$(window).width():$(window).width()),$("#game-frame").height($(window).height()))}document.getElementById("sky")&&start_snow(),document.getElementById("rains")&&start_rain(),e.playing_game="",e.playing=!1,e.hide_menu=!1,e.countMail=!1,e.countReward=!1,e.countMail_count=0,e.countReward_count=0,Cookies.get("Hidetoday"),e.userEmailLogin=Cookies.get("login_email"),e.social_list={},e.contact_list=[],e.contact_selection=[],e.data_loyalty,e.dataLayer=[],e.total_loyalty_point=0,e.data_cashback,e.dataLayer_cashback=[],e.total_cashback_point=0,e.claimRewardOnGame={cashback:!1,loyalty:!1},e.showGiftOngame=!1,socket.on("reconnect",(function(){console.log("restarting"),e.goneOffline(!1)})).on("connect",(function(){socket.emit("tell","trigger"),loading(!1),clearTimeout(restartInt)})).on("disconnect",(function(t){$("#server_status").html(' Offline'),console.info("Server Stop connection!",t),loading(!0),restartInt=setTimeout((function(){e.goneOffline(!0,"Server Disconnected!"),latest_disconnect=!0}),1e4)})).on("reconnect_attempt",(function(){console.log("reconnecting")})).on("logout",(function(e){if("duplicate"==e.duplicate)swal({title:"มีการเข้าสู่ระบบจากที่อื่น",imageUrl:msg_img.confuse,imageSize:"100x100",confirmButtonText:"ตกลง"},(function(){return location.replace("/")})),setTimeout((function(){socket.emit("logout")}),1e4);else if("lockUser"==e.duplicate||"banUser"==e.duplicate){let t="";switch(e.duplicate){case"lockUser":t="Members is locked. Please contact the customer service to verify your account before use.";break;case"banUser":t="Members is banned. Please contact the customer service to verify your account before use.";break;default:t=e.duplicate}swal({title:t,imageUrl:msg_img.confuse,imageSize:"100x100",confirmButtonText:"ตกลง"},(function(){return location.replace("/")})),setTimeout((function(){socket.emit("logout")}),1e4)}else location.reload()})).on("msg",(function(e){if("LOGIN_DUPLICATE"===e)alert("You logged from another location"),socket.emit("logout",{duplicate:!0});else alert(e)})).on("announce",(function(t){if(("xeng88"==_theme.siteName||"oko99"==_theme.siteName)&&"object"==typeof t&&"help2pay"==t.action){if($("#moneyIframe").html(""),t.success){var a="";return"code"in t&&(a='โอนเงินให้ - ไอดีผู้ใช้ '+t.code.username+' จำนวน '+t.code.amount),swal({title:'รายการ Help2Pay สำเร็จ',text:a,imageUrl:msg_img.success,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){location.replace("/money")}))}return swal({title:'รายการ Help2Pay ล้มเหลว',text:'กรุณาตรวจสอบข้อมูลธนาคารของคุณแล้วลองอีกครั้งข้อผิดพลาด :'+t.msg,imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){location.replace("/money")}))}if("feibaopay"==t.action){if($("#moneyIframe").html(""),t.success){a="";return"code"in t&&(a='โอนเงินให้ - ไอดีผู้ใช้',a="phl63"==_theme.siteName?a+" "+t.code.username.substring(_theme.member_prefix.length,t.code.username.length):a+" "+t.code.username),swal({title:'Feibaopay SUCCESS!',text:a,imageUrl:msg_img.success,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){location.replace("/money")}))}return swal({title:'Feibaopay FAIL!',text:'กรุณาตรวจสอบข้อมูลธนาคารของคุณแล้วลองอีกครั้งข้อผิดพลาด :'+t.msg,imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){location.replace("/money")}))}if("string"==typeof t&&("go_home"==t||"readMail"==t&&e.getCountMail()),"desktop"==_theme.device&&"object"==typeof t&&"gtm"==t.action&&t.data){let a=t.data;(_theme.analytics.ga.enabled||_theme.analytics.ga4.enabled)&&e.userdata.username==a.memberId&&e.pushToDataLayers(a.event,{event:a.event,memberId:a.memberId,deposit:a.deposit,depositTimes:a.depositTimes,eventCreatedAt:a.eventCreatedAt})}})).on("check_play_game",(function(t){if(_theme.logged){let a=e.userdata.id;null!=t.uid&&t.uid==a&&"desktop"==_theme.device&&t.deposit_times&&t.lastestDepositChannels&&t.event&&e.pushToDataLayers(t.event,{memberId:e.userdata.username,deposit:t.amount,depositTimes:t.deposit_times,device:_theme.device,currency:_theme.currency,siteName:_theme.siteName,lastestDepositChannels:t.lastestDepositChannels,event:t.event,eventCreatedAt:Math.floor(Date.now()/1e3)}),document.getElementById("game-frame")&&null!=t.uid&&t.uid==a&&socket.emit("play_game_status",{uid:t.uid,amount:t.amount},(function(a){if(a&&a.success){let o=a.gameHall;"short77"==o&&(o="OMG"),$("#modal_money_popup").modal("hide"),document.getElementById("moneyIframeUrl").src="about:blank";let n="เครดิตถูกเพิ่มเข้าเกมแล้ว
("+parseInt(t.amount).toFixed(2)+" เครดิต : "+o+")
หากเครดิตของคุณยังไม่แสดง กรุณากดปุ่มสปินเพื่ออัปเดตยอดเครดิตของคุณ";return swal({title:'เติมเงินสำเร็จแล้ว!',text:n+"
⚠️WARNING⚠️
Spin places an immediate bet. Check value first!
",icon:"success",html:!0,confirmButtonText:"OK"},(function(){e.checkClaimRewardOnGame()}))}return $("#modal_money_popup").modal("hide"),document.getElementById("moneyIframeUrl").src="about:blank",swal({title:'เติมเงินสำเร็จแล้ว!',text:"เครดิตของคุณจะอยู่ในกระเป๋าเงิน
หากเครดิตของคุณยังไม่แสดง กรุณากดปุ่มสปินเพื่ออัปเดตยอดเครดิตของคุณ"+"
⚠️WARNING⚠️
Spin places an immediate bet. Check value first!
",icon:"success",html:!0,confirmButtonText:"OK"},(function(){e.checkClaimRewardOnGame()}))}))}})).on("maintenance_game",(function(t){if(_GobalLogin&&e.userdata.username&&"JDB"===t)if("JDB"==e.playing_game&&e.playing)return socket.emit("clickplayer_maintenance",e.userdata.username),swal({title:'Game Maintenance !',text:'System will be Exist this game now',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){return window.location.reload()}))})).on("getMaintenance",(function(t){t&&e.setShowPopup&&$("#modal_maintenance").modal()})).on("returnCheckSessionIdBySocket",(function(e){if(!e)return swal({title:"Session expired please login again.",text:" ",imageSize:"100x100",confirmButtonText:"OK",timer:3e3},(function(e){if(e)return window.location.reload()}))})).on("loyaltyRealTime",(function(t){if(_theme.logged&&_theme.show_loyalty){let a=e.userdata.id;e.data_loyalty=t,e.sum_loyalty_point=0;let o={today:0,other:0};0!==Object.keys(e.data_loyalty).length&&e.data_loyalty.otherPeriods[a]&&e.data_loyalty.otherPeriods[a].forEach((function(t,a){e.sum_loyalty_point+=parseFloat(t.loyalty_point);let n=t.endtime,[i,l]=n.split(" "),[s,r,m]=i.split("-"),[c,d,g]=l.split(":");new Date(s,r-1,m,c,d,g).getTime()>Date.now()?o.today+=parseFloat(t.loyalty_point):o.other+=parseFloat(t.loyalty_point)}));let n=Cookies.get("uid_claimed_loyalty")?JSON.parse(Cookies.get("uid_claimed_loyalty")):{};0!==Object.keys(n).length&&n[a]?e.data_loyalty.timestamp>n[a].timeStamp&&(delete n[a],n[a]={totalPaid:parseFloat(e.sum_loyalty_point.toFixed(2)),detail:o,timeStamp:e.data_loyalty.timestamp},Cookies.set("uid_claimed_loyalty",n,{expires:30})):(n[a]={totalPaid:parseFloat(e.sum_loyalty_point.toFixed(2)),detail:o,timeStamp:e.data_loyalty.timestamp},Cookies.set("uid_claimed_loyalty",n,{expires:30}));let i=0;n[a]&&(i=n[a].totalPaid,n[a].detail.other>0?e.$apply((function(){e.claimRewardOnGame.loyalty=!0})):e.$apply((function(){e.claimRewardOnGame.loyalty=!1}))),$(".loyalty_point_home").text(Number(i).toFixed(2))}})).on("cashbackRealTime",(function(t){if(_theme.logged&&_theme.show_cashback){let o=e.userdata.id;e.result_data_cashback=t;let n=Cookies.get("uid_claimed_cashback")?JSON.parse(Cookies.get("uid_claimed_cashback")):{},i={};if(e.cashback_data={},e.result_data_cashback.dataOnPeriods[o]&&(i=e.result_data_cashback.dataOnPeriods[o][0]),0!==Object.keys(n).length)if(n[o]){if(e.result_data_cashback.timeStamp>n[o].timeStamp){delete n[o];let t=0;if(void 0!==i&&i&&(t=i.cashback?i.cashback:0),n[o]={totalPaid:parseFloat(t.toFixed(2)),data:i,timeStamp:e.result_data_cashback.timeStamp},Cookies.set("uid_claimed_cashback",n,{expires:30}),window.location.href.includes("reward")){var a=document.getElementById("rewardFrame");a.src=/a.src.split("?")[0]+"?content_only=1&t="+Date.now()+"#/info-tabs/reward"}}}else{let t=0;void 0!==i&&(t=i.cashback?i.cashback:0),n[o]={totalPaid:parseFloat(t.toFixed(2)),data:i,timeStamp:e.result_data_cashback.timeStamp},Cookies.set("uid_claimed_cashback",n,{expires:30})}else{let t=0;void 0!==i&&(t=i.cashback?i.cashback:0),n[o]={totalPaid:parseFloat(t.toFixed(2)),data:i,timeStamp:e.result_data_cashback.timeStamp},Cookies.set("uid_claimed_cashback",n,{expires:30})}let l=0;n[o]&&(l=n[o].totalPaid,e.cashback_data=n[o].data),$(".cashback_point_home").text(Number(l).toFixed(2)),l>0?e.$apply((function(){e.claimRewardOnGame.cashback=!0})):e.$apply((function(){e.claimRewardOnGame.cashback=!1}))}})),e.checkClaimRewardOnGame=function(){let t=e.userdata.id;if(e.show_loyalty_homepage){let a=Cookies.get("uid_claimed_loyalty")?JSON.parse(Cookies.get("uid_claimed_loyalty")):{},o=0;a[t]&&(o=a[t].detail.other),0==o&&(e.claimRewardOnGame.loyalty=!1)}if(e.show_cashback_homepage){let a=Cookies.get("uid_claimed_cashback")?JSON.parse(Cookies.get("uid_claimed_cashback")):{},o=0;a[t]&&(o=a[t].totalPaid),0==o&&(e.claimRewardOnGame.cashback=!1)}},e.contact_social=function(){let t=this.social;e.contact_selection=e.contact_list[t],e.contact_list[t].length>1?(setTimeout((()=>{document.querySelectorAll("[data-qr]").forEach((e=>{""!=e.innerHTML&&null!=e.innerHTML||$("[data-qr]").each((function(e){$(this).qrcode($(this).data("qr"))}))}))}),1e3),$("#modal_service").modal("show")):window.open(e.contact_list[t][0].url,"_blank")},e.setPathImageGame_ALL=function(t,a,o,n){let i="en";"zh_CN"===_theme.lang&&(i="cn"),"TBS"==t&&(t="UG"),"WIN568"==t&&(t=t.toLowerCase()),"AWC"==t&&"141"==a&&(t="SEXYBCRT"),"HRG"!=t||"ROULETTE"!=o&&"BACCARAT"!=o||(o=o.charAt(0).toUpperCase()+o.slice(1).toLowerCase());let l={JDB:`${_theme.imgPath}/gamelist/jdb_gamelist/${o}_${e.currentLangs}.webp`,FC:`${_theme.imgPath}/gamelist/fc_gamelist/${o}_${e.langImageGame}.webp`,JILI:`${_theme.imgPath}/gamelist/jili_gamelist/${o}_${e.currentLangs}.webp`,CQ9:`${_theme.imgPath}/gamelist/cq9_gamelist/${o}_${e.currentLangs}.webp`,RT:`${_theme.imgPath}/gamelist/redtiger_gamelist/${o}.webp`,IMOne:`${_theme.imgPath}/gamelist/playtech_gamelist/${o}.webp`,GPS:`${_theme.imgPath}/gamelist/gps_gamelist/${o}_${e.currentLangs}.webp`,AMB:`${_theme.imgPath}/gamelist/amb_gamelist/${o}.webp`,RSG:`${_theme.imgPath}/gamelist/rsg_gamelist/${o}_${e.currentLangs}.webp`,PG:`${_theme.imgPath}/gamelist/pg_gamelist/${o}_${e.currentLangs}.webp`,KA:`${_theme.imgPath}/gamelist/ka_gamelist/${o}_${e.currentLangs}.webp`,PP:`${_theme.imgPath}/gamelist/pp_gamelist/${o}_${e.currentLangs}.webp`,PPO:`${_theme.imgPath}/gamelist/ppo_gamelist/${o}_${e.currentLangs}.webp`,PP_EGAME:`${_theme.imgPath}/gamelist/pp_gamelist/${o}_${e.currentLangs}.webp`,PP_LIVE:`${_theme.imgPath}/gamelist/pp_gamelist/${o}_${e.currentLangs}.webp`,YB:`${_theme.imgPath}/gamelist/yb_gamelist/${o}_${e.currentLangs}.webp`,JOKER:`${_theme.imgPath}/gamelist/joker_gamelist/${o}.webp`,EVO:`${_theme.imgPath}/gamelist/evo_gamelist/${o}_${e.currentLangs}.webp`,BK89:`${_theme.imgPath}/gamelist/bk89_gamelist/${o}_${e.currentLangs}.webp`,SA:`${_theme.imgPath}/gamelist/sa_baccarat/${o}.webp`,SEXYBCRT:`${_theme.imgPath}/gamelist/sexy_baccarat/${o}.webp`,NINEKG:`${_theme.imgPath}/gamelist/ninekg_gamelist/${o}.webp`,MABU:`${_theme.imgPath}/gamelist/mabu_gamelist/${o}_${e.currentLangs}.webp`,YGG:`${_theme.imgPath}/gamelist/ygg_gamelist/${o}.webp`,ACEWIN:`${_theme.imgPath}/gamelist/acewin_gamelist/${o}_${e.currentLangs}.webp`,AG:`${_theme.imgPath}/gamelist/ag_gamelist/${o}.webp`,HRG:`${_theme.imgPath}/gamelist/hrg_gamelist/${o}_${e.currentLangs}.webp`,PS:`${_theme.imgPath}/gamelist/ps_gamelist/${o}_${e.currentLangs}.webp`,UG:`${_theme.imgPath}/gamelist/ug_gamelist/${o}.webp`,win568:`${_theme.imgPath}/gamelist/win568_gamelist/${o}.webp`,TEZ:`${_theme.imgPath}/gamelist/lotto_gamelist/${o}.webp`,SVL:`${_theme.imgPath}/gamelist/svl_gamelist/${o}.webp`,VR:`${_theme.imgPath}/gamelist/vr_gamelist/${o}.webp`,FIVEG:`${_theme.imgPath}/gamelist/fiveg_gamelist/${o}_${e.currentLangs}.webp`,HS:`${_theme.imgPath}/gamelist/hs_gamelist/${o}_en.png`,FUNKY:`${_theme.imgPath}/gamelist/funky_gamelist/${o}_${e.currentLangs}.webp`,WONWON:`${_theme.imgPath}/gamelist/wonwon_gamelist/${o}_${e.currentLangs}.webp`,VP:`${_theme.imgPath}/gamelist/vp_gamelist/${o}_${e.currentLangs}.webp`,BNG:`${_theme.imgPath}/gamelist/bng_gamelist/${o}_${e.currentLangs}.webp`,SABA:`${_theme.imgPath}/gamelist/saba_gamelist/${o}.webp`,SABASPORT:`${_theme.imgPath}/gamelist/saba_gamelist/${o}.webp`,SV388:`${_theme.imgPath}/gamelist/sv388_gamelist/${o}.webp`,DS88:`${_theme.imgPath}/gamelist/ds88_gamelist/${o}.webp`,KYG:`${_theme.imgPath}/gamelist/kyg_gamelist/${o}_${e.currentLangs}.webp`,TWOJ:`${_theme.imgPath}/gamelist/twoj_gamelist/${o}.webp`,VA:`${_theme.imgPath}/gamelist/va_gamelist/${o}_${e.currentLangs}.webp`,CG:`${_theme.imgPath}/gamelist/cg_gamelist/${o}.webp`};if("short77"===t){const t={cn:{origin:"cn",replace:"sc"}},a=["en","mm","ph","sc","th"].map((e=>{for(const a in t)if(t[a].origin===e)return t[a].replace;return e})),n=t[e.currentLangs]?t[e.currentLangs].replace:e.currentLangs,i=a.includes(n)?n:"en";l.short77=`${_theme.imgPath}/gamelist/short77_gamelist/${o}_${i}.webp`}return"JILI"===t&&"1202"==a&&(l.JILI=`${_theme.imgPath}/gamelist/jili_gamelist/${o}_${e.currentLangs}.webp`),"IMOne"===t&&(l.IMOne=`${_theme.imgPath}/gamelist/playtech_gamelist/${o}.webp`),"EVO"===t&&("Peek Baccarat"==n?l.EVO=`${_theme.imgPath}/gamelist/evo_gamelist/peekbaccarat0001_en.webp`:"Lightning Roulette"==n?l.EVO=`${_theme.imgPath}/gamelist/evo_gamelist/lightningroulette_en.webp`:"Gold Vault Roulette"==n?l.EVO=`${_theme.imgPath}/gamelist/evo_gamelist/goldvaultroulette_en.webp`:"Prosperity Tree Baccarat"==n?l.EVO=`${_theme.imgPath}/gamelist/evo_gamelist/prosperitytreebaccarat_en.webp`:"XXXtreme lightning Baccarat"==n&&(l.EVO=`${_theme.imgPath}/gamelist/evo_gamelist/xxxtremelightningbaccarat_en.webp`)),"jdbYG"!==_theme.siteName&&"kyat365"!=_theme.siteName||"BK89"==t&&(l.BK89=`${_theme.imgPath}/gamelist/bk89_gamelist/${o}_mm.webp`),"MT"==t&&(l.MT=`${_theme.imgPath}/gamelist/cq9_gamelist/${o}_${e.currentLangs}.webp`),l[t]},e.showCopy=function(){document.getElementById("copyToast").style.display="block",setTimeout((function(){document.getElementById("copyToast").style.display="none"}),2e3)},e.tabListGameRanking={lastGame:!0,favGame:!1},e.changeTabsRankingListGame=function(t=!0,a=!1){t&&(e.tabListGameRanking={lastGame:!0,favGame:!1}),a&&(e.tabListGameRanking={lastGame:!1,favGame:!0})},e.setLink=function(t,a,o){"WIN568"==t&&(t=t.toLowerCase());let n=t;"RT"==t||"SEXYBCRT"==t?t="AWC":"PT"==t&&(t="IMOne"),e.configGamehall[t].iframe||("RT"==n?t="RT":"SEXYBCRT"==n&&(t="SEXYBCRT"),window.open("/play?vendor="+t+"&g="+a+"&m="+o,"_bank"))},e.checkPlayByIframe=function(t){return"WIN568"==t&&(t=t.toLowerCase()),"RT"==t||"SEXYBCRT"==t?t="AWC":"PT"==t&&(t="IMOne"),!!e.configGamehall[t].iframe},e.goneOffline=function(t,a){t?(e.playing=!1,$("body").append('

Lost internet connection
Please check internet connection...

')):$("#disconnect_text").remove()},e.getCountMail=function(){_theme.logged&&ajax("/report",(function(t){t.success?(e.countMail=!0,e.countMail_count=t.msg):e.countMail=!1}),{report:"countMail",page:0})},e.clickPopupMoneyPage=function(e=!1){let t=_theme.siteName.toLowerCase(),a=msg_img.confuse;if(_theme.deposit_on_game){let t="/app?content_only=1&content_play_game=y#/info-tabs/money";e&&(t="/app?content_only=1&content_play_game=y&"+e+"=1#/info-tabs/reward"),setTimeout((()=>{document.getElementById("moneyIframeUrl").src=/t,$/("#modal_money_popup").modal({backdrop:"static",keyboard:!1}),$("#modal_money_popup").modal("show")}),1e3)}else swal({title:'ออกจากเกมส์',imageUrl:a,imageSize:"100x100",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(){if($('[data-scroll-to="#slot-game"]').length)return $('[data-scroll-to="#slot-game"]').click();$("#menu-slot").length?$("#menu-slot").click():$('[data-scroll-to="#topBanner"]').click(),document.getElementById("sky")&&start_snow(),document.getElementById("rains")&&start_rain(),_theme.allPlayNewTab&&window.close()})),$("#topLayer").toggleClass("hide-menu");"mnl168"==t&&(a=`${_theme.imgPath}/icon/general/exit_game.webp`),setTimeout((function(){$(window).trigger("resize")}),900)},e.clickBackToPage=function(){if($("#modal_money_popup").modal("hide"),$("#moneyIframeUrl").attr("src","about:blank"),_theme.deposit_on_game&&_theme.check_low_credit&&_theme.check_low_credit.enabled)ajax("/api/check-low-credit",(function(t){e.$apply((function(){if(t.success&&t.lowCredit){let t=_theme.check_low_credit.title[_theme.lang]?_theme.check_low_credit.title[_theme.lang]:"🎮 เติมพลัง แล้วลุยต่อเลย! 🚀",a=_theme.check_low_credit.text[_theme.lang]?_theme.check_low_credit.text[_theme.lang]:"เติมพลังนิดนึงน้าา แต่ความมันส์ยังไม่จบเพียงเท่านี้ ✨ เติมพลังของคุณตอนนี้ แล้วออกลุยต่อได้เลย!";swal({title:t,text:a,imageUrl:`${_theme.imgPath}/icon/general/deposit.webp`,imageSize:"180x150",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"เติมเงิน",cancelButtonText:"ออก"},(function(t){t?setTimeout((()=>{document.getElementById("moneyIframeUrl").src="/app/content_only/1/content_play_game/y.html",$("#modal_money_popup").modal({backdrop:"static",keyboard:!1}),$("#modal_money_popup").modal("show")}),1e3):(e.playing=!1,document.getElementById("sky")&&start_snow(),document.getElementById("rains")&&start_rain(),Cookies.get("gift_bonus")&&$("#modal_show_gift_D").modal("hide"),_theme.allPlayNewTab&&window.close())}))}else{let t=_theme.siteName.toLowerCase(),a=msg_img.confuse;swal({title:'ออกจากเกมส์',imageUrl:a,imageSize:"100x100",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(){e.playing=!1,document.getElementById("sky")&&start_snow(),document.getElementById("rains")&&start_rain(),Cookies.get("gift_bonus")&&$("#modal_show_gift_D").modal("hide"),_theme.allPlayNewTab&&window.close()})),"mnl168"==t&&(a=`${_theme.imgPath}/icon/general/exit_game.webp`)}}))}));else{let t=_theme.siteName.toLowerCase(),a=msg_img.confuse;swal({title:'ออกจากเกมส์',imageUrl:a,imageSize:"100x100",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(){e.playing=!1,document.getElementById("sky")&&start_snow(),document.getElementById("rains")&&start_rain(),_theme.allPlayNewTab&&window.close()})),"mnl168"==t&&(a=`${_theme.imgPath}/icon/general/exit_game.webp`)}},e.goToPageReward=function(){if(e.playing){let e=msg_img.confuse;swal({title:'ออกจากเกมส์',imageUrl:e,imageSize:"100x100",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(e){e&&(window.location.href="/reward/giftbonus/1.html")}))}else if(_theme.allPlayNewTab){let e=msg_img.confuse;swal({title:'ออกจากเกมส์',imageUrl:e,imageSize:"100x100",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(e){try{window.opener&&!window.opener.closed?(window.opener.location.href="/reward/giftbonus/1.html",window.close()):window.location.href="/reward/giftbonus/1.html"}catch(e){window.location.href="/reward/giftbonus/1.html"}}))}else window.location.href="/reward/giftbonus/1.html"},e.getCountReward=function(){_theme.logged&&_theme.show_loyalty&&ajax("/loyaltyRewardList",(function(t){t.success&&0!=t.total?(e.countReward=!0,e.countReward_count=t.total):e.countReward=!1}),{status:0,page:1})};var a,o,n=$(window).height();if($(window).on("resize",(function(){if(t(),$draggable&&$draggable.position()){$draggable.trigger("dragEnd");var e=$draggable.position().top,a=Math.floor($(window).height()*(e/n));$draggable.draggabilly("setPosition",void 0,a),n=$(window).height()}})),window.addEventListener("orientationchange",(function(){$("body").removeClass("orientation t90 t-90 t180"),0!=window.orientation&&$("body").addClass("orientation"),90==window.orientation&&$("body").addClass("t90"),-90==window.orientation&&$("body").addClass("t-90"),180==window.orientation&&$("body").addClass("180"),t()}),!1),e.last_play=!1,e.play_game=function(t,a,o,n,i,l){if(!_theme.logged&&!n)return Cookies.set("desire",{vendor:t,gType:a,mType:o,trial:n,webType:i}),$("#modal_login").modal();ajax("/api/maintenance",(function(s){if(!s||!s.data)return alert("GAME CONF ERROR");if(s.data.enabled)return swal({title:'กำลังปิดเกมส์ปรับปรุง',text:s.data.maintenance.text,imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'});let r=i?"&webType="+i:"";if(1==a&&80==o||"win568"==t?($("#game-frame").addClass("desktop"==_theme.device?"sport-desktop":"sport-mobile"),$("#game-frame").attr("scrolling","yes"),$("body").removeClass("no-scroll"),$("html").removeClass("no-scroll")):($("#game-frame").removeClass("sport-desktop sport-mobile"),$("#game-frame").attr("scrolling","no"),$("body").removeClass("no-scroll"),$("html").removeClass("no-scroll")),"VSL"==a||"tez"==a||"VSL"==t||"TEZ"==t){let e=$("#game-frame");e.removeClass("sport-desktop sport-mobile"),e.attr("scrolling","yes"),e.css("-webkit-overflow-scrolling","touch !important"),$("body").addClass("no-scroll"),$("html").addClass("no-scroll")}e.playing_game=t;let m="";l&&(m="&gamehall="+l);let c="/play/?json=1&vendor="+t+"&g="+a+"&m="+o+r;n&&(c="/playdemo/?json=1&vendor="+t+"&g="+a+"&m="+o+r),"JDB"==t||"TEZ"==t||"BK89"==t?ajax(c,(function(e){if("TEZ"==t){if(!e.success)return alert("err: "+JSON.stringify(e));$("#game-frame").attr("src",e.data.data.path)}else{if("BK89"==t)return"SUCCESS"==e.Message?$("#game-frame").attr("src",e.Content.Instance):alert("err: MessageCode: "+e.MessageCode);if(!e.data||0!==parseInt(e.data.status))return alert("err: "+JSON.stringify(e));$("#game-frame").attr("src",e.data.path)}})):$("#game-frame").attr("src",c),e.$apply((function(){e.playing=!0})),$("#vidFish").length&&$("#vidFish").get(0).pause(),$("#modal_game").length&&$("#modal_game").modal({keyboard:!1,backdrop:"static"})}),{vendor:t})},e.$watch("playing",(function(n,i){n?($draggable.hide(),e.hide_menu=!0,a=setTimeout((function(){$(window).trigger("resize"),$draggable.show(),$draggable.draggabilly("setPosition",void 0,.7*$(window).height()),t()}),4e3),o=setInterval((function(){$("#game-frame").focus(),$("#game-frame").prop("src").indexOf("not_login.html")>-1&&(clearInterval(o),e.playing=!1)}),4e3),document.getElementById("sky")&&stop_snow(),document.getElementById("rains")&&stop_rain()):(e.hide_menu=!1,clearTimeout(a),clearInterval(o),$("#modal_game").length&&$("#modal_game").modal("hide"),$("#game-frame").attr("src",""),setTimeout((function(){$(".main-carousel").length&&$(".main-carousel").slick("setPosition"),$(".swiper-wrapper").length&&$(".swiper-wrapper").slick("setPosition"),$(window).trigger("resize")}),1e3))})),e.$watch("configGift_bonus",(function(t){t&&t.enabled&&Cookies.get("gift_bonus")&&(e.showGiftOngame=!0)})),e.$watch("claimRewardOnGame",(function(e,t){}),!0),Cookies.get("desire")){var i=JSON.parse(Cookies.get("desire"));e.play_game(i.vendor,i.gType,i.mType,i.trial,i.webType),Cookies.remove("desire")}$("#modal_login").on("show.bs.modal",(function(){e.getCaptchaImage()})),$("#modal_login").on("hide.bs.modal",(function(){e.clearCaptchaCountdown()})),$(document).ready((function(){$(".to-game").on("click",(function(){e.playing&&(e.$apply((function(){e.playing=!1})),$("#modal_game").modal("hide"))})),$(document).on("click","#slot-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("JDB",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-IMOne-game .play_game",(function(){e.play_game("IMOne",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-cq9-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("CQ9",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-rt-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("RT",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-jili-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("JILI",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-wonwon-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("WONWON",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-fc-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("FC",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-amb-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("AMB",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-rsg-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("RSG",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-pg-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("PG",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-fiveg-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("FIVEG",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-pp-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("PP",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-ka-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("KA",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-joker-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("JOKER",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#live-casino-game .play_game",(function(){})),$(document).on("click","#slot-vr-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("VR",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-yb-game .play_game",(function(){e.play_game("YB",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-mabu-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("MABU",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-ygg-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("YGG",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-ppo-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("PPO",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-acewin-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("ACEWIN",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-ps-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("PS",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))})),$(document).on("click","#slot-hs-game .play_game",(function(){$(this).data("vendor")?e.play_game($(this).data("vendor"),$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial")):e.play_game("HS",$(this).data("gtype"),$(this).data("mtype"),$(this).data("trial"))}));var t=Cookies.get("usr");t&&$("#pattern_username").text(t),$("#login_mobile").on("click",(function(){if(t&&parseInt(Cookies.get("atmp"))>0)return $("#modal_login_pattern").modal();$("#modal_login").modal()})),$("#popup-last").on("click",(function(){$("#modalPromotion_1").length&&_theme.logged&&!_theme.inPro?setTimeout((function(){if($("#modalPromotion_1").modal(),current=1,document.querySelector("#proImg_"+current)){let e=[],t=0;t=e.indexOf(Math.min.apply(Math,e)),$(".listOfMoney").css("background-color","rgb(255 255 255 / 19%)"),$(".AmountOfMoney").css("background-color","rgb(255 255 255 / 19%)")}}),300):t&&$("#modal_login_pattern").length&&!e.userdata.username&&$("#modal_login_pattern").modal()})),$(".Hidetoday").on("click",(function(e){setTimeout((function(){e.currentTarget.checked?($(".Hidetoday").prop("checked",!0),Cookies.set("modal_htd",!0,{expires:1})):($(".Hidetoday").prop("checked",!1),Cookies.remove("modal_htd"))}),500)}));let a=window.location.href;a.includes("nopopup")||a.includes("popuplogin")||$(".modalPromotion").on("hidden.bs.modal",(function(){let a=$(this).data("current");a=parseInt(a)+1,$("#modalPromotion_"+a).length?($("#modalPromotion_"+a).modal(),setTimeout((function(){if(document.querySelector("#proImg_"+a)){let e=[],t=0;t=e.indexOf(Math.min.apply(Math,e)),$(".listOfMoney").css("background-color","rgb(255 255 255 / 19%)"),$(".AmountOfMoney").css("background-color","rgb(255 255 255 / 19%)")}}),300)):t&&$("#modal_login_pattern").length&&!e.userdata.username&&$("#modal_login_pattern").modal()})),_theme.popupHidetoday||Cookies.remove("modal_htd"),a.includes("nopopup")||a.includes("popuplogin")||($("#modal_popup_1").length?"notlogin"==_theme.popup&&_theme.logged?$("#modalPromotion_1").length&&_theme.logged&&!_theme.inPro&&($("#modalPromotion_1").modal(),setTimeout((function(){if(current=1,document.querySelector("#proImg_"+current).complete){$(".listOfMoney").css("background-color","rgb(255 255 255 / 19%)"),$(".AmountOfMoney").css("background-color","rgb(255 255 255 / 19%)")}}),300)):Cookies.get("modal_htd")||(Cookies.get("modal")?"once"==_theme.popup?Cookies.set("modal",!0):Cookies.remove("modal"):$("#modal_popup_1").modal()):$("#modalPromotion_1").length&&_theme.logged&&!_theme.inPro&&($("#modalPromotion_1").modal(),setTimeout((function(){if(current=1,document.querySelector("#proImg_"+current).complete){let e=[],t=0;t=e.indexOf(Math.min.apply(Math,e)),$(".listOfMoney").css("background-color","rgb(255 255 255 / 19%)"),$(".AmountOfMoney").css("background-color","rgb(255 255 255 / 19%)")}}),300))),a.includes("popuplogin")&&(_GobalLogin||$("#modal_login").modal())})),e.pushToDataLayers=function(e,t={},a={}){try{const o=void 0!==a.pushMain?a.pushMain:_theme.analytics?.ga?.enabled||_theme.analytics?.ga4?.enabled||_theme.analytics?.gtm?.enabled,n=void 0!==a.pushSecond&&a.pushSecond,i=void 0!==a.pushNct?a.pushNct:_theme.analytics?.gtm_for_nct?.enabled||_theme.analytics?.ga_nct?.enabled&&_theme.analytics?.ga4_nct?.enabled,l=Object.assign({device:_theme.device,currency:_theme.currency,siteName:_theme.siteName,event:e||"",eventCreatedAt:Math.floor(Date.now()/1e3)},t);o&&(window.dataLayer=window.dataLayer||[],window.dataLayer.push(l)),n&&(window.dataLayer2=window.dataLayer2||[],window.dataLayer2.push(l)),i&&(window.dataLayerNct01=window.dataLayerNct01||[],window.dataLayerNct01.push(l))}catch(e){console.error("pushToDataLayers error:",e)}}}]),app.run(["$rootScope","$interval","$timeout",function(e,t,a){if(e.userdata={},e.memberPrefix="",e.themeFolder="",e.TtlSec=0,e.user={username:"",password:"",captcha:""},$(document).ready((function(){$(".get-balance").on("click",(function(){if(0==Object.entries(e.userdata).length&&e.userdata.constructor==Object)return!1;let t=e.userdata.money;e.userdata.money=void 0,$(this).addClass("spin"),$(this).addClass("disabled-click");let a=setTimeout((()=>{$(this).removeClass("spin"),clearTimeout(a)}),500);ajax("/api/get-manual-balance",(function(a){let o=setTimeout((function(){$(".get-balance").removeClass("disabled-click"),e.$apply((function(){if(a.success)if("object"==typeof a.data){let t=0;for(let e in a.data)!a.data[e]&&0!=a.data[e]||"total"==e||"balance_all_api"==e||(t+=a.data[e]);a.data.total=t,e.userdata.money=a.data}else e.userdata.money=t;else e.userdata.money=t})),clearTimeout(o)}),1e3)}))}))})),ajax("/api/config",(function(t){let a;e.memberPrefix=t["game_hall.JDB.api.member_prefix"],e.themeFolder=t["homepage.theme_folder"],e.configGamehall=t.game_hall,e.show_prefix=t["feature.login"].show_prefix,e.checkCaptcha=t["feature.login"].captcha,e.configRegister=t["feature.register.fields"],e.configLogin=t["feature.login"],e.currentLangs="",e.langImageGame="",e.defaultLangs=_theme.lang,e.social_list=t["homepage.contact.social"],e.show_loyalty_homepage=t["feature.show_loyalty_homepage"],e.configRankingRule=t["feature.ranking.ranking_rule"],e.configCaptcha=t["feature.captcha"],e.TtlSec=0==e.configCaptcha.ttl_sec?30:e.configCaptcha.ttl_sec,e.configGift_bonus=t["feature.gift_bonus"],a="Ubet89"==_theme.siteName||"Ubet78"==_theme.siteName||"Ubet95"==_theme.siteName||"88fed"==_theme.siteName?e.configRegister.phone_number.max_length:"zk"==e.memberPrefix||"zkt"==e.memberPrefix?e.configRegister.register_auto_truename.enabled?e.configRegister.phone_number.max_length:e.configLogin.max_length:e.show_prefix||"fd"==e.memberPrefix||"fdt"==e.memberPrefix?e.configLogin.max_length-e.memberPrefix.length:e.configLogin.max_length,e.currentLangs="en",e.langImageGame="en","zh_CN"==e.defaultLangs||"zh_CN2"==e.defaultLangs?(e.currentLangs="cn",e.langImageGame="cn"):"mm"==e.defaultLangs?"myn77"==_theme.siteName||"jdbYG"==_theme.siteName||"kyat365"==_theme.siteName?e.langImageGame="en":e.langImageGame="mm":"th"==e.defaultLangs?e.langImageGame="th":(e.currentLangs="en",e.langImageGame="en"),$("#login_user").attr({maxlength:a}),e.contact_list=e.social_list.list.filter((({enabled:e})=>1==e)),e.contact_list=e.contact_list.reduce(((e,t)=>{let{type:a}=t;return e[a]=e[a]??[],e[a].push(t),e}),{})}),{config:{memberPrefix:"game_hall.JDB.api.member_prefix",folder:"homepage.theme_folder",config:"game_hall",configRegister:"feature.register.fields",configLogin:"feature.login",social_list:"homepage.contact.social",show_loyalty_homepage:"feature.show_loyalty_homepage",configRankingRule:"feature.ranking.ranking_rule",configCaptcha:"feature.captcha",configGift_bonus:"feature.gift_bonus"}}),e.popupFirstLogin=function(){void 0!==e.userdata.first_login?e.userdata.first_login&&swal({title:"Recommended to change the password.",showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(t){ajax("/update-status-first-login",(function(a){e.$apply((function(){if(a.success&&t)return window.location.href="/new_profile/"}))}))})):a((function(){e.popupFirstLogin()}),3e3)},e.pattern_log=!1,e.pattern={password:/^[A-Za-z0-9]{6,}$/,pay_pass:/^[A-Za-z0-9]{5,8}$/,name_vietnam:/^((?!\s{2})[a-zA-ZÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼỀỂưạảấầẩẫậắằẳẵặẹẻẽềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ\s]{5,})$/,name:/^[A-Za-z0-9]{5,}$/,email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,phone:/^[0]{1}\d{9,10}$/,captcha:/^[0-9]{4}$/,credit_card:/^(?=.*\d)(?=(?:\d*[a-zA-Z]?\d*){0,3}$)[a-zA-Z\d]{9,19}$/,id_card:/^\d{9}$|^\d{12}$/},e.patternRes={engOnly:"^[A-Za-z0-9]{0,}$",text:"^[A-Za-z]{0,}$",number:"^[0-9]{0,}$",login_pass:"^[A-Za-z0-9]{0,16}$",no_spec:"^[^][\\s<>%$@!#^*+\\/()=\\-]*$",number_with_decimal:"^[0-9][0-9.]*[0-9]$",number_with_decimal_no_first_zero:"^[1-9][0-9]{0,}(?:.d+)?",number_no_first_zero:"^[1-9][0-9]{0,}$",name_vietnam:"^[a-zA-ZÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼỀỂưạảấầẩẫậắằẳẵặẹẻẽềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ ]{0,}$"},e.logged=!1,e.waitingLogin=!1,e.warningLogin="",latest_disconnect&&(latest_disconnect=!1,e.goneOffline(!1),!_theme.userdata))return $("#modal_login").modal();if("object"==typeof _theme.userdata)if(void 0!==_theme.userdata.popup_reward_merchant&&_theme.userdata.popup_reward_merchant&&(Cookies.get("pornSite_login")||$("#aox_banner").show(1e3)),"object"==typeof _theme.userdata.money){let e=0;for(let t in _theme.userdata.money)!_theme.userdata.money[t]&&0!=_theme.userdata.money[t]||"total"==t||"balance_all_api"==t||(e+=_theme.userdata.money[t]);_theme.userdata.money.total=e,_theme.login_not_create_member&&(_theme.userdata.money.total="*****")}else _theme.userdata.money={total:"*****"};if(e.userdata=angular.merge(e.userdata,_theme.userdata),_theme.logged){let t=e.userdata.id;if(_theme.show_loyalty){let a=Cookies.get("uid_claimed_loyalty")?JSON.parse(Cookies.get("uid_claimed_loyalty")):{},o=0;a[t]&&(o=a[t].totalPaid),$(".loyalty_point_home").text(Number(o).toFixed(2)),$(".loyalty_point_home").css("display","block"),$(".loyalty_loading").css("display","none"),a[t]&&a[t].detail&&a[t].detail.other>0&&(e.claimRewardOnGame.loyalty=!0)}if(_theme.show_cashback){let a=Cookies.get("uid_claimed_cashback")?JSON.parse(Cookies.get("uid_claimed_cashback")):{},o=0;a[t]&&(o=a[t].totalPaid,e.cashback_data=a[t].data),$(".cashback_point_home").text(Number(o).toFixed(2)),$(".cashback_point_home").css("display","block"),$(".cashback_loading").css("display","none"),$(".cashback_popup").css("display","block"),o>0&&(e.claimRewardOnGame.cashback=!0)}}if(e.login=function(t){if(!e.waitingLogin&&!e.highlightInvalidForm(t)){if(e.checkCaptcha){if(""==e.user.captcha||""==e.user.username||""==e.user.password||4!=(""+e.user.captcha).length)return swal({title:'เข้าสู่ระบบล้มเหลว',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'}),e.getCaptchaImage(),e.user.captcha="",void e.$emit("loginFail")}else if(""==e.user.username||""==e.user.password)return swal({title:'เข้าสู่ระบบล้มเหลว',imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'}),e.getCaptchaImage(),e.user.captcha="",void e.$emit("loginFail");if(("xeng88"==_theme.siteName||"1g17"==_theme.siteName||"jdbMK"==_theme.siteName)&&e.user.username){if(e.user.username.substring(0,e.memberPrefix.length)!=e.memberPrefix)return e.user.username=e.memberPrefix+e.user.username,swal({title:'User id must start with : '+e.memberPrefix,text:'กรุณาเข้าระบบใหม่อีกครั้ง',imageUrl:msg_img.fail,imageSize:"100x100",icon:"fail",confirmButtonText:"OK"},(function(){}))}var a=angular.copy(e.user);a.password=mask(a.password),e.show_prefix&&(a.username=e.memberPrefix+a.username),addPrefix.includes(_theme.siteName.toLowerCase())&&0==e.show_prefix&&(a.username=e.memberPrefix+a.username),a.checkSessionId=e.resCheckSession,e.waitingLogin=!0,ajax("/login",(function(t){e.$apply((function(){e.waitingLogin=!1;let a="";if("LOGIN_SUCCESS"!=t.code){switch(t.user_data.code){case"CANNOT_GET_DATA":a='There was a problem accessing the data please try again';break;case"USER_NOT_EXIST":a='ไม่มีชื่อผู้ใข้งาน';break;case"PASSWORD_INCORRECT":a="รหัสผ่านไม่ถูกต้อง","incorrect_pwd"in t.user_data&&(a="รหัสผ่านไม่ถูกต้อง "+t.user_data.incorrect_pwd);break;case"PASSWORD_INCORRECT_ATTEMPT_3":a="รหัสผ่านไม่ถูกต้อง","incorrect_pwd"in t.user_data&&(a="รหัสผ่านไม่ถูกต้อง "+t.user_data.incorrect_pwd+" user ID locked");break;case"CAPTCHA_ERROR":a="captcha ไม่ถูกต้อง";break;case"PATTERN_PASSWORD_NOT_MATCH":a="รูปแบบไม่ตรงกัน";break;case"CAPTCHA_INCORRECT":a="รหัสยืนยันผิด กรุณาลองอีกครั้ง";break;case"USER_BANNED_STATUS_1":a="User locked! Please contact our staff";break;case"USER_BANNED_STATUS_99":a="ไอดีผู้ใช้งานถูกล็อค กรุณาติดต่อพนักงาน";break;case"CAPTCHA_MISSING":case"SESSION_INCORRECT":a="Session expired please login again.";break;case"IP_BLOCKED":a="เกิดข้อผิดพลาดในการล็อกอิน การเข้าถึงของคุณถูกระงับชั่วคราว กรุณาติดต่อ Customer service";break;default:a=t.user_data.msg}return swal({title:'เข้าสู่ระบบล้มเหลว',text:a,imageUrl:msg_img.fail,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){"PASSWORD_INCORRECT"==t.user_data.code&&(e.user.captcha="",e.user.password="",$("#login_captcha").focus()),"CAPTCHA_ERROR"!=t.user_data.code&&"CAPTCHA_MISSING"!=t.user_data.code&&"SESSION_INCORRECT"!=t.user_data.code||location.reload()})),void e.getCaptchaImage()}socket.emit("checkDuplicateLogin",t.user_data.username),e.userdata=t.user_data,setTimeout((function(){$(".sa-confirm-button-container .confirm").attr("disabled","disabled")}),100),setTimeout((function(){$(".sa-confirm-button-container .confirm").removeAttr("disabled")}),1e3),$("#modal_login").length&&$("#modal_login").modal("hide"),e.$emit("LOGIN_SUCCESS",t.user_data.username),e.pushToDataLayers("login",{memberId:t.user_data.username,pid:t.user_data.pid,device:_theme.device,currency:_theme.currency,siteName:_theme.siteName,loginType:"Normal",event:"login",eventCreatedAt:Math.floor(Date.now()/1e3)});let o=e.userdata.id;if(_theme.show_loyalty){let t=Cookies.get("uid_claimed_loyalty")?JSON.parse(Cookies.get("uid_claimed_loyalty")):{};ajax("/getCurrentLoyalty",(function(a){e.$apply((function(){if(a.success){let e=a.loyalty_point,n=a.loyalty_detail;0!==Object.keys(t).length&&t[o]?(delete t[o],t[o]={totalPaid:parseFloat(e.toFixed(2)),detail:n,timeStamp:a.timeStamp}):t[o]={totalPaid:parseFloat(e.toFixed(2)),detail:n,timeStamp:a.timeStamp},Cookies.set("uid_claimed_loyalty",t,{expires:30}),$(".loyalty_point_home").text(Number(e).toFixed(2)),$(".loyalty_point_home").css("display","block"),$(".loyalty_loading").css("display","none")}}))}))}if(_theme.show_cashback){let t=Cookies.get("uid_claimed_cashback")?JSON.parse(Cookies.get("uid_claimed_cashback")):{};ajax("/getCurrentCashback",(function(a){e.$apply((function(){let e=Date.now();if(a.success&&0!==Object.keys(a.data).length)if(0!==Object.keys(a.data[o]).length){let n=a.data[o][0],i=n.cashback;0!==Object.keys(t).length&&t[o]?(delete t[o],t[o]={totalPaid:parseFloat(i.toFixed(2)),data:n,timeStamp:e}):t[o]={totalPaid:parseFloat(i.toFixed(2)),data:n,timeStamp:e},Cookies.set("uid_claimed_cashback",t,{expires:30}),$(".cashback_point_home").text(Number(i).toFixed(2)),$(".cashback_point_home").css("display","block"),$(".cashback_loading").css("display","none"),$(".cashback_popup").css("display","block")}else t[o]={totalPaid:0,data:{},timeStamp:e},Cookies.set("uid_claimed_cashback",t,{expires:30});else t[o]={totalPaid:0,data:{},timeStamp:e},Cookies.set("uid_claimed_cashback",t,{expires:30})}))}))}e.$watch("configGift_bonus",(function(t){t&&t.enabled&&ajax("/api/getGiftList",(function(t){e.$apply((function(){if(t.success&&t.data.success&&0!=t.data.data.length){let a=t.data.data.filter((function(e){return e.uid==o}));e.cookieUniversal("remove","gift_bonus"),a.forEach((function(t){0!=t.status||e.cookieUniversal("set","gift_bonus",!0,{expires:10})}))}else e.cookieUniversal("remove","gift_bonus")}))}))}));var n=!t.user_data.pattern_password&&"mobile"==_theme.device&&Cookies.get("usr")!=t.user_data.username;if(t.user_data.pattern_password&&Cookies.set("usr",e.user.username,{expires:30,path:"/"}),!_theme.show_prefix&&removePrefixWhenDisable.includes(_theme.siteName.toLowerCase())&&(t.user_data.username=t.user_data.username.substring(_theme.member_prefix.length,t.user_data.username.length)),_theme.show_prefix&&removePrefixWhenEnabled.includes(_theme.siteName.toLowerCase())&&(t.user_data.username=t.user_data.username.substring(_theme.member_prefix.length,t.user_data.username.length)),("wofa168"==_theme.siteName||"mofa168"==_theme.siteName)&&!e.userdata.showPrefixWofaMofa){let e=["mb","mbt","mp","mpt"];["mba","mbta","mpa","mpta"].includes(t.user_data.username.substring(0,_theme.member_prefix.length+_theme.after_prefix.length))?t.user_data.username=t.user_data.username.substring(_theme.member_prefix.length+_theme.after_prefix.length,t.user_data.username.length):e.includes(t.user_data.username.substring(0,_theme.member_prefix.length))&&(t.user_data.username=t.user_data.username.substring(_theme.member_prefix.length,t.user_data.username.length))}let i=_theme.siteName.toLowerCase(),l=msg_img.confuse;"mnl168"==i&&(l=_theme.logo_mobile),"phl63"==i&&(l=_theme.logo_mobile),"ssbet77"==i&&(l=_theme.logo_mobile),"ubet95"==i&&(l=_theme.logo_mobile),"phv88"==i&&(l=_theme.logo_mobile),"betluckmak"==i&&(l=`${_theme.imgPath}/icon/general/login.webp`),"Kodluck"==i&&(l=_theme.logo_mobile),e.pushToDataLayers("login",{event:"login",memberId:_theme.member_prefix+e.userdata.username}),swal({title:'เข้าสู่ระบบสำเร็จ\r\nUsername : '+t.user_data.username,imageUrl:l,showCancelButton:!1,confirmButtonText:'ตกลง',timer:3e3},(function(){return n?(setTimeout((function(){$(".sa-confirm-button-container .confirm").attr("disabled","disabled")}),100),setTimeout((function(){$(".sa-confirm-button-container .confirm").removeAttr("disabled")}),1e3),t.pattern_login_on?void swal({title:'รูปแบบการเข้าระบบสำหรับมือถือ!',text:'ต้องการตั้งค่ารูปแบบบการเข้ารหัสใช่หรือไม่?',imageUrl:`${_theme.imgPath}/icon/general/pattern_unlock.webp`,showCancelButton:!0,imageSize:"160x160",confirmButtonText:'ตกลง',cancelButtonText:"ยกเลิก"},(function(e){return e?window.location.href="/pattern_setup/":window.location.reload()})):window.location.reload()):window.location.reload(!0)}))}))}),{_data:a})}},e.logout=function(){Cookies.remove("pornSite_login"),Cookies.remove("rid"),Cookies.remove("login_email");let e=_theme.siteName.toLowerCase(),t=msg_img.confuse;"mnl168"==e&&(t=_theme.logo_mobile),"phl63"==e&&(t=_theme.logo_mobile),"ssbet77"==e&&(t=_theme.logo_mobile),"ubet95"==e&&(t=_theme.logo_mobile),"phv88"==e&&(t=_theme.logo_mobile),swal({title:"ออกจากระบบ?",imageUrl:t,showCancelButton:!0,closeOnConfirm:!0,confirmButtonText:"ตกลง",cancelButtonText:"ยกเลิก"},(function(){socket.emit("logout_all")}))},e.showNotGameInPro=function(e="GAME_NOT_IN_PRO"){let t="",a="";switch(e){case"ENTER_GAME_TOO_FAST":case"ENTER_GAME_TOO_FAST_LOG_FAILED":t='ไม่สามารถเล่นเกมส์ได้',a='คุณเข้าเกมส์เร็วเกินไป';break;case"EER_ENTERING_PROMOTION":t='Play game before enter promotion process finish',a='You has entering promotion process please wait until finish';break;case"THIS_GAME_NOT_IN_PRO":t='This game not in promotion',a='Your username is in promotion\nPlease try other game which in your promotion';break;case"FAIL_GAME_RESPONSE":case"GAME_RESPONSE_NOTFOUND":t='Found a problem in this game',a='Please try again or contact to customer service';break;case"FAIL_GAME_RESPONSE_JMK":case"GAME_RESPONSE_NOTFOUND_JMK":t='Can not transfer credit.',a='Please wait 1 minute and try again.';break;case"GAME_ERROR":t='GAME ERROR !',a='CANNOT PROCEED GAME REQUEST';break;case"CHECK_SESSION_PLAY_GAME_AND_ENTER_PROMOTION":t='ไม่สามารถเล่นเกมส์ได้',a='Please wait a moment and try again';break;case"COUNTRY_BLOCKED":t='ไม่สามารถเล่นเกมส์ได้',a='Country Blocked';break;case"USER_BANNED":t='ไม่สามารถเล่นเกมส์ได้',a='Members is banned. Please contact the customer service to verify your account before use.';break;case"NOT_TRIAL_MODE":t='ไม่สามารถเล่นเกมส์ได้',a='This game requires a register or login to play the game.';break;case"NEGATIVE_MONEY":t='ไม่สามารถเล่นเกมส์ได้',a='Please try again';break;case"API_TRANSFER_FAIL":t='ไม่สามารถเล่นเกมส์ได้',a='ไม่สามารเข้าเล่นได้. โปรดลองอีกครั้ง';break;case"DUPLICATE_TRANSFER":t='DUPLICATE TRANSFER',a='ไม่สามารถดำเนินการได้ในขณะนี้ กรุณารอ 1 นาที และทำรายการซ้ำ';break;default:t=e,a=""}return"betluckmak"==_theme.siteName.toLowerCase()?swal({title:t,text:a,imageUrl:msg_img.BLM_fail,showCancelButton:!1,html:!0,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){if("CHECK_SESSION_PLAY_GAME_AND_ENTER_PROMOTION"==e){let e=new XMLHttpRequest;e.open("GET","/clearSession-playGames",!0),e.send()}return window.close(),window.location.href="/"})):swal({title:t,text:a,imageUrl:msg_img.fail,showCancelButton:!1,html:!0,imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){if("CHECK_SESSION_PLAY_GAME_AND_ENTER_PROMOTION"==e){let e=new XMLHttpRequest;e.open("GET","/clearSession-playGames",!0),e.send()}return window.close(),window.location.href="/"}))},e.showPopupFloating=function(){$(".popup-floating").css("display","flex")},e.showPopupFloatingGift=function(){$(".popup-floating-gift").css("display","flex")},e.closePopupfloatingGift=function(){$(".popup-floating-gift").css("display","none")},e.showGiftModal=function(t){if(e.playing){if(!t)return $("#modal_show_gift_D").modal("hide"),e.closePopupfloatingGift(),$(".icon-close-popup-floating-gift").css("display","none"),$(".icon-popup-floating-gift").css("display","none"),e.closeGiftBoxOngame(),void e.cookieUniversal("remove","gift_bonus");$("#modal_show_gift_D").modal("show"),e.closePopupfloatingGift()}t?($("#modal_show_gift_D").modal("show"),e.closePopupfloatingGift()):(e.modal_show_gift=!1,$("#modal_show_gift_D").modal("hide"),e.closePopupfloatingGift(),$(".icon-close-popup-floating-gift").css("display","none"),$(".icon-popup-floating-gift").css("display","none"),e.cookieUniversal("remove","gift_bonus"))},e.openGiftBox=function(){$(".icon-close-popup-floating-gift").css("display","flex"),$(".icon-popup-floating-gift").css("display","flex")},e.openGiftBoxOngame=function(){Cookies.get("gift_bonus")&&$(".gift_bonus_ongame").css("display","flex")},e.closeGiftBoxOngame=function(){$(".gift_bonus_ongame").css("display","none")},e.get_gift=function(){let t=e.userdata.id;e.gift_text='Congratulations! Your special Gift Bonus has arrived',e.giftList=[],ajax("/api/getGiftList",(function(a){e.$apply((function(){if(a.success&&a.data.success){let o=a.data.data,n=new Date,i=null;totalAmount=0;let l=o.filter((function(e){return e.uid==t}));l.forEach((function(t){let a=new Date(t.claim_expiration);a>n&&0==t.status?totalAmount+=Number(t.amount):a<=n&&0==t.status&&(t.status=3),0==totalAmount&&a>n&&(e.gift_text='We are sorry, the claim period for this bonus has ended.'),(!i||new Date(t.add_time)>new Date(i.add_time))&&(i=t)})),e.giftList=l,e.giftList_total_amount=totalAmount,0==e.giftList_total_amount?e.giftList_add_time=" ":e.giftList_add_time=i?i.add_time:"null"}}))}))},e.cookieUniversal=function(e,t,a,o={}){const n=window.location.hostname,i=n.split(".").filter(Boolean),l=/^\d{1,3}(\.\d{1,3}){3}$/.test(n),s={path:"/",...o},r=i.length>2?"."+i.slice(-2).join("."):null,m=()=>{const e=[];return Cookies.remove(t,{path:"/"}),e.push("(host-only)"),r&&"localhost"!==n&&!l&&(Cookies.remove(t,{path:"/",domain:r}),e.push(r)),{domainUsed:null,removedDomains:e}};if("remove"===e)return m();if("set"!==e)throw new Error("cookieUniversal: action ต้องเป็น 'set' หรือ 'remove'");const c=String(a),{removedDomains:d}=m();return"localhost"===n||l||i.length<2?(Cookies.set(t,c,s),{domainUsed:null,removedDomains:d}):r&&(Cookies.set(t,c,{...s,domain:r}),Cookies.get(t)===c)?{domainUsed:r,removedDomains:d}:(Cookies.set(t,c,s),{domainUsed:null,removedDomains:d})},_theme.logged&&socket.on("gift-bonus",(function(t){let a=e.userdata.id;t.includes(a.toString())&&(e.cookieUniversal("set","gift_bonus",!0,{expires:10}),e.showGiftOngame=!0,e.get_gift(),e.playing?e.openGiftBoxOngame():(e.openGiftBox(),e.showPopupFloatingGift()))})),Cookies.get("gift_bonus")&&e.openGiftBox(),e.claimAllGift=function(t){ajax("/api/claimGift",(function(t){e.totalClaimAmount=t.totalClaimAmount,e.$apply((function(){0==e.totalClaimAmount?swal({title:'We are sorry, the claim period for this bonus has ended.',imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){e.showGiftModal(!1),e.showGiftOngame=!1,e.get_gift(),e.cookieUniversal("remove","gift_bonus")})):swal({title:'Claim Success',imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){e.showGiftModal(!1),e.showGiftOngame=!1,e.get_gift(),e.cookieUniversal("remove","gift_bonus");let t=window.location.href;["reward","new_profile","money-bypass-deposit","report"].some((e=>t.includes(e)))&&["rewardFrame","moneyIframe","profileFrame","logsFrame"].forEach((e=>{let t=document.getElementById(e);t&&(t.src=/t.src.split("?")[0]+"?content_only=1&t="+Date.now()+"#/info-tabs/reward")}))}))}))}),{giftList:""})},e.claimGift=function(t){ajax("/api/claimGift",(function(t){e.totalClaimAmount=t.totalClaimAmount,e.$apply((function(){0==e.totalClaimAmount?swal({title:'We are sorry, the claim period for this bonus has ended.',imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){e.showGiftModal(!1),e.get_gift(),e.cookieUniversal("remove","gift_bonus")})):swal({title:'Claim Success',imageSize:"100x100",confirmButtonText:'ตกลง'},(function(){e.showGiftModal(!1),e.get_gift(),e.cookieUniversal("remove","gift_bonus"),console.log("test desktop")}))}))}),{giftId:t})},e.openContactModal=function(){console.log("opne contact modal"),$("#modal-channel-contact").modal("show")},window.jivo_onLoadCallback=function(){console.log("Widget fully loaded"),window.jivo_onOpen=function(){console.log("Widget opened")},window.jivo_onClose=function(){console.log("Widget closed");let e=document.querySelector('jdiv [class^="globalClass"]');e&&(e.style.display="none")}},e.statusOpenLiveChat=!1,"Fresh Chat"==_theme.liveChatConfig.type&&waitForFreshchat((function(){console.log("Freshchat loaded"),e.statusOpenLiveChat=!0,window.fcWidget.hide(),window.fcWidget.on("widget:closed",(function(){window.fcWidget.hide()}))}),3e4),"Sale Smartly"==_theme.liveChatConfig.type&&waitForSaleSmarty((function(){console.log("SaleSmarty loaded"),e.statusOpenLiveChat=!0,window.__ssc.setting={hideIcon:!0}}),3e4),"Respond IO"==_theme.liveChatConfig.type&&waitForRespond((function(){console.log("Respond IO loaded"),e.statusOpenLiveChat=!0,window.$respond.on("chat:opened",(function(){console.log("respond chat:opened")})),window.$respond.on("chat:closed",(function(){console.log("respond chat:closed");let e=document.querySelector('iframe[src*="respond.io"]');e&&(e.style.display="none")}))}),3e4),"Kommo"==_theme.liveChatConfig.type&&waitForKommo((function(){console.log("Kommo loaded"),e.statusOpenLiveChat=!0,crmPlugin("onChatReady",(function(){console.log("Kommo onChatReady")}))}),3e4),"Zendesk"==_theme.liveChatConfig.type&&waitForZendesk((function(){window.zE&&(console.log("Zendesk loaded"),e.statusOpenLiveChat=!0)}),3e4),"MKEFU"==_theme.liveChatConfig.type&&waitForMKEFU((function(){window._MKEFU&&(console.log("MKEFU loaded"),e.statusOpenLiveChat=!0)}),3e4),"Livechat"==_theme.liveChatConfig.type&&waitForLivechat((function(){if(window.LiveChatWidget){console.log("Livechat loaded"),e.statusOpenLiveChat=!0,LiveChatWidget.on("ready",(function(){LiveChatWidget.call("hide"),console.log("Livechat onReady")})),LiveChatWidget.on("visibility_changed",(function(e){switch(console.log("onVisibilityChanged - ",e.visibility),e.visibility){case"maximized":break;case"minimized":case"hidden":LiveChatWidget.call("hide")}}))}}),3e4),"Jivo"==_theme.liveChatConfig.type&&waitForJivo((function(){window.jivo_api&&(console.log("jivo loaded"),e.statusOpenLiveChat=!0)}),3e4),e.openLiveChat=function(){if($("#modal-channel-contact").modal("hide"),!e.statusOpenLiveChat)return swal({title:e.translateMessage("Live chat is not available. Please add live chat information"),imageUrl:msg_img.fail,confirmButtonText:e.translateMessage("OK")});if("Livechat"==_theme.liveChatConfig.type&&window.LiveChatWidget)LiveChatWidget.call("maximize");else if("MKEFU"==_theme.liveChatConfig.type&&window._MKEFU)window._MKEFU.openMessageDialog();else if("Zendesk"==_theme.liveChatConfig.type&&window.zE)zE("webWidget","open");else if("Kommo"==_theme.liveChatConfig.type&&window.crmPlugin){crmPlugin("runChatShow");let e=document.getElementById("amo-livechat"),t=document.getElementsByClassName("amo-button-holder")[0];if(e){new MutationObserver((()=>{e.classList.contains("amo-livechat_chat")&&(console.log("📢 Chat เปิด"),t.style.display="block"),e.classList.contains("amo-livechat_hidden")&&(console.log("📢 Chat ปิด"),t.style.display="none")})).observe(e,{attributes:!0,attributeFilter:["class"]})}}else if("Respond IO"==_theme.liveChatConfig.type&&window.$respond)waitForRespond((function(){!function({interval:e=500,maxRetry:t=20}={}){if(!window.$respond)return;let a=0;$respond.do("chat:open");const o=setInterval((()=>{if(a++,$respond.is("chat:open")){clearInterval(o);const e=document.querySelector('iframe[src*="respond.io"]');return e&&(e.style.display="block"),void console.log("✅ Respond chat opened")}$respond.do("chat:open"),console.log("retryCount - ",a),a>=t&&(clearInterval(o),console.warn("❌ Respond chat not opened after retry"))}),e)}()}));else if("Sale Smartly"==_theme.liveChatConfig.type&&window.__ssc)waitForSaleSmarty((function(){ssq.push("chatOpen")}));else{if("Fresh Chat"!=_theme.liveChatConfig.type||!window.fcWidget){if("Jivo"==_theme.liveChatConfig.type&&window.jivo_api){let e=document.querySelector('jdiv [class^="globalClass"]');return e&&(e.style.display="block"),jivo_api.open({start:"chat"}),void($("jdiv[class^='menu__']")&&setTimeout((()=>{let e=[];element1=$("a[class^='link_']"),element2=$("jdiv[class^='mobileBack_']");for(let t=0;t=0&&(element1[t].setAttribute("id","telegram"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),a.indexOf("telegram")>=0&&(element1[t].setAttribute("id","telegram"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),a.indexOf("viber")>=0&&(element1[t].setAttribute("id","viber"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),a.indexOf("tel:")>=0&&(element1[t].setAttribute("id","tel"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),a.indexOf("/m.me")>=0&&(element1[t].setAttribute("id","facebook"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),a.indexOf("facebook.com")>=0&&(element1[t].setAttribute("id","facebook"),element1[t].removeAttribute("href"),element1[t].children[0].setAttribute("onClick",'clickNewtab("'+a+'")'),element1[t].children[0].setAttribute("style","border-bottom: 1px solid rgba(0,0,0,.12)!important;")),e[t]=element1[t].href}$("#telegram").replaceWith((function(){return $("",{html:this.innerHTML})})),$("#facebook").replaceWith((function(){return $("",{html:this.innerHTML})})),$("#viber").replaceWith((function(){return $("",{html:this.innerHTML})})),$("#tel").replaceWith((function(){return $("",{html:this.innerHTML})}))}),500))}return _theme.liveChatScript?void swal({title:"Live chat is unscripted. Please add live chat information",imageUrl:msg_img.fail,imageSize:"100x100",showCancelButton:!1,closeOnConfirm:!0,confirmButtonText:"ตกลง"}):void swal({title:"Live chat is not available. Please add live chat information",imageUrl:msg_img.fail,imageSize:"100x100",showCancelButton:!1,closeOnConfirm:!0,confirmButtonText:"ตกลง"})}waitForFreshchat((function(){window.fcWidget.show(),window.fcWidget.open()}))}},e.hot_game=[],e.getHotGame=function(){ajax("/api/get-hot-games",(function(t){e.$apply((function(){if(t.success&&t&&t.data.length>0){t.data.map((function(t){let a={vendor:"OMG"==t.game_hall?"short77":t.game_hall,gType:t.game_type_id,type:t.game_theme,order:t.ordered};if("short77"==a.vendor)switch(a.type){case"7017":a.type="1051s";break;case"7016":a.type="1041s";break;case"7013":a.type="1035s"}e.hot_game.push(a)}));let a=(new Date).getTime()+3e5;localStorage.setItem("hot_game_config",JSON.stringify({data:e.hot_game,timeStamp:a}))}}))}))},_theme.hot_game){let t=new Date,a=!!localStorage.getItem("hot_game_config")&&JSON.parse(localStorage.getItem("hot_game_config"));a?t.getTime()>a.timeStamp?(localStorage.removeItem("hot_game_config"),e.getHotGame()):e.$apply((function(){e.hot_game=a.data})):e.getHotGame()}e.captchaTimer=null,e.captchaCountdown=0,e.clearCaptchaCountdown=function(){e.captchaTimer&&(console.log("--- clearCaptchaCountdown ---"),clearInterval(e.captchaTimer),e.captchaTimer=null)},e.renderCaptchaCountdown=function(){e.captchaCountdown>0?$(".captcha-countdown").text("หมดอายุใน "+e.captchaCountdown+" วินาที"):$(".captcha-countdown").text("กำลังโหลด captcha ใหม่...")},e.startCaptchaCountdown=function(){e.$apply((function(){e.clearCaptchaCountdown(),e.captchaCountdown=e.TtlSec,e.renderCaptchaCountdown(),e.captchaTimer=setInterval((function(){e.$apply((function(){e.captchaCountdown--,e.renderCaptchaCountdown(),e.captchaCountdown<=0&&(e.clearCaptchaCountdown(),e.getCaptchaImage())}))}),1e3)}))},e.getCaptchaImage=function(t){ajax("/captcha",(function(a){e.startCaptchaCountdown(),"function"==typeof t&&t(),a&&(e.checkCaptchaImage=!0,$(".captcha").html($(a).find("svg")))}))}}]),app.controller("loginCtrl",["$scope","$http","$rootScope","$interval","$window",function(e,t,a,o,n){if(e.init=function(){a.checkCaptchaImage=!1,a.getCountMail(),a.getCountReward()},$(".tez-countdown").prevObject.length){}e.clock="---",o((function(){e.clock=Date.now()}),1e3),e.scoreGameList={},e.scoreWinner={},a.isValid=function(e,t){var a=t||!1;return null==e.$$rawModelValue||!e.$$rawModelValue||e.$invalid?!a&&"has-error":!!a||"has-success"},e.isValidPattern=function(e,t){var a=angular.element(e)[0];return t.test(a.$modelValue)&&""!==a.$modelValue?(a.$valid=!0,a.$invalid=!1,"has-success"):(a.$valid=!1,a.$invalid=!0,"has-error")},a.highlightInvalidForm=function(e){var t=!1;return angular.forEach(angular.element(e.$$controls),(function(e,a){var o=e.$$attr.required||e.$$attr.ngRequired||!1;if(!t){var n=angular.element(e.$$element),i=n.parent().hasClass("has-error");if(o&&(null==e.$$rawModelValue||!e.$$rawModelValue||e.$invalid||i)){e.$invalid=!0,e.$valid=!1,e.$dirty=!0,e.$pristine=!1,n.focus();var l=n.parent().hasClass("input-group")?n.parent():n;l.addClass("shake"),setTimeout((function(){l.removeClass("shake")}),800),t=!0}}})),t},a.openModalToApp=function(){$("#modal_to_app").modal("show")},$(document).on("click",".item-ranking-today",(function(){let e,t=_theme.siteName.toLowerCase(),a=$(this).data("prefix");if(e=""!==a?a+$(this).data("user"):$(this).data("user"),("betluckmak"==t||"Kodluck"==t)&&""==$(this).data("gamehall"))return!1;if(_theme.result_show&&""!==$(this).attr("data-gamehall")&&("JDB"==$(this).data("gamehall")||"CQ9"==$(this).data("gamehall")||"RT"==$(this).data("gamehall")||"PT"==$(this).data("gamehall")||"AWC"==$(this).data("gamehall")||"MRG"==$(this).data("gamehall")||"PPO"==$(this).data("gamehall")||"JILI"==$(this).data("gamehall")||"FC"==$(this).data("gamehall")||"RSG"==$(this).data("gamehall")||"PG"==$(this).data("gamehall")||"PP"==$(this).data("gamehall")||"YB"==$(this).attr("gamehall")||"KA"==$(this).attr("gamehall")||"MABU"==$(this).attr("gamehall")||"JOKER"==$(this).data("gamehall")||"YB"==$(this).data("gamehall")||"PS"==$(this).data("gamehall")||"FUNKY"==$(this).data("gamehall")||"FIVEG"==$(this).data("gamehall")||"HS"==$(this).data("gamehall")||"SHORT77"==$(this).data("gamehall")||"VP"==$(this).data("gamehall")||"SABA"==$(this).data("gamehall")||"YGG"==$(this).data("gamehall")||"BNG"==$(this).data("gamehall")||"KYG"==$(this).data("gamehall")||"TWOJ"==$(this).data("gamehall")||"VA"==$(this).data("gamehall"))){var o=$(this).offset().left+500,n=$(this).offset().top;ajax("/result",(function(e){let a="";if(e.success){let i=e.data;if(!i.url)return void swal({title:"Severice of this game is unnormal please try again later!",imageUrl:msg_img.fail,imageSize:"100x100",showCancelButton:!1,closeOnConfirm:!0,confirmButtonText:"ตกลง"});a="xeng88"!=t||"oko99"!=_theme.siteName&&"PP"!=$(this).attr("data-gamehall")?window.open("","gamedetail","height=600,width=500,scrollbars=no,location=no,menubar=no,status=no,left="+o+",top="+n):window.open("","gamedetail","height=600,width=570,scrollbars=no,location=no,menubar=no,status=no,left="+o+",top="+n),a.location=i.url,a.focus()}else swal({title:"Severice of this game is unnormal please try again later!",imageUrl:msg_img.fail,imageSize:"100x100",showCancelButton:!1,closeOnConfirm:!0,confirmButtonText:"ตกลง"})}),{username:e,seqNo:$(this).data("seq"),gameHall:$(this).data("gamehall"),gameDate:$(this).data("gamedate"),gameCode:$(this).attr("data-gametype")})}})),$(document).on("click","[data-scroll-to]",(function(e){let t=$(this).data("scroll-to"),a=240;if(".game-tabs-container"==t&&(a=300),$(t).length){if(e.preventDefault(),"desktop"==_theme.device){let e=$(".the-content");$(".the-content, html").animate({scrollTop:e.scrollTop()+$(t).offset().top-a},300)}else $("html, body",parent.document).animate({scrollTop:$(".the-content").scrollTop()+$(t).offset().top-($(".side-menu_mobile").height()+10)},500);parent.location.hash="",$(t).addClass("highlight-game"),setTimeout((function(){$(t).removeClass("highlight-game")}),1e3)}})),$(document).on("click","[data-click-to]",(function(e){var t=$(this).data("click-to");$(t).length&&(e.preventDefault(),$(t).click())})),a.showTextLoadingLoyalty=!0,a.getLoyaltyRealtime=function(){if(void 0!==a.data_loyalty){a.showTextLoadingLoyalty=!1;let e=a.userdata.id,t=a.data_loyalty.today[e],o=a.data_loyalty.otherPeriods[e];null!=t&&null!=o&&t.forEach((function(e,a){o.forEach((function(e,n){o[n].period_id==t[a].periodID&&(t[a].starttime=o[n].starttime,t[a].endtime=o[n].endtime)}))})),a.dataLayer=t}else a.showTextLoadingLoyalty=!0}}]),app.controller("downloadCtrl",["$scope","$http","$rootScope","$window",function(e,t,a,o){e.downloadApp=function(){window.open("http://download.jdb168.com:8080/168/app.html","_blank"),$("#modal_to_app").modal("hide")},e.openApp=function(){window.location.replace("jdb://jdb168.com")}}]),app.directive("ngDataToggle",(function(){return{restrict:"A",link:function(e,t,a){e.$watch(a.ngDataToggle,(function(e,a){t.attr("data-toggle",e)}))}}})),$('[role="dialog"]:not(".no-blur")').on("show.bs.modal",(function(){$('[role="dialog"].in').length||$("#topLayer").addClass("blur")})).on("shown.bs.modal",(function(){$(this).find("input").first().focus(),setTimeout((function(){$(window).trigger("resize")}),600)})).on("hide.bs.modal",(function(){$("#topLayer").removeClass("blur")}));var nLogColor={Reset:"",Bright:"",Dim:"",Underscore:"",Blink:"",Reverse:"",Hidden:"",FgBlack:"",FgRed:"",FgGreen:"",FgYellow:"",FgBlue:"",FgMagenta:"",FgCyan:"",FgWhite:"",BgBlack:"",BgRed:"",BgGreen:"",BgYellow:"",BgBlue:"",BgMagenta:"",BgCyan:"",BgWhite:""};document.addEventListener("mousewheel",(function(e){e.deltaY%1!=0&&e.preventDefault()}));var first_show=!1;function onchange(e){first_show||document.hidden||document.mozHidden||document.webkitHidden||document.msHidden||(first_show=!0)}document.addEventListener("visibilitychange",onchange);let btnRegister=document.querySelector(".main-register");function waitForFreshchat(e,t){var a=Date.now();t=t||3e4,function o(){window.fcWidget?e():Date.now()-a