"use strict";
window.mobileCheck = () => { let check = 0; (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = 1; })(navigator.userAgent || navigator.vendor || window.opera); return check; };
const isMob = mobileCheck();
const ajaxURL = 'https://wallet.web-t3.rbqund.xyz';
const missionHost = "https://mission.web-t3.rbqund.xyz";
// const pageName = location.pathname.split('/').pop().replace('.html', '');
if (localStorage.getItem(`loginToken`) && !window.location.pathname.includes(`secure`)) window.location = "/secure/home.html";
const lgin = !window.location.pathname.includes(`secure`);
$(document).ready(function () {
setInterval(function () {
var currentTime = new Date();
var date = currentTime.toLocaleDateString(["ban", "id"], {
year: "numeric",
month: "2-digit",
day: "2-digit",
});
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
// Add leading zeros
hours = (hours < 10 ? "0" : "") + hours;
minutes = (minutes < 10 ? "0" : "") + minutes;
seconds = (seconds < 10 ? "0" : "") + seconds;
// Compose the string for display
var currentTimeString = hours + ":" + minutes + ":" + seconds;
$("#timer").html(
date + " " + currentTimeString + " (GMT+" + Math.abs(currentTime.getTimezoneOffset() / 60) + ")"
);
}, 1000);
// Add Icon APK
$('#showD').append(`
`);
$('#showM').append(`
`);
$('.menu .games').click(function() {
$(this).find('.all-games').slideToggle(300);
});
if ($('.g8-banner').length) {
if ($('.g8-banner-d').length) {
$('.g8-banner-d').empty().append('\
`);
$('#showM .box__detail.hot').append(`

Main Sekarang
`)
$('#showD .dropdown-menu__detail.-hot').append(`
`)
});
});
}
$(document).on('click', '.launch-hot', function () {
let gamecodepick = $(this).attr('gc');
let providerIdpick = $(this).attr('pid');
$.ajax({
type: 'POST',
dataType: 'json',
url: `${ajaxURL}/ajax/transaction/launchGame`,
headers: headerAuth,
data: { 'provider_id': providerIdpick, 'game_code': gamecodepick, "mobile_view": 0, "credit_type": 10, "freespinId": '' },
success: function (res) {
// console.log(res.result);
if (res.code === "0") {
window.open(res.result.gameToken, "_blank", "width=1024,height=768");
}
else {
alert(res.code + " - " + res.description);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert("Launch Game error, Please contact our customer service");
}
});
})
$(document).on('click', '.launch-listgame', function() {
let keyprov = $(this).attr('lobby-key');
sessionStorage.setItem('keyprov', keyprov);
var val = {
url: 'listGame.html?r=',
gamecode: '&keyprov='+keyprov,
name: '',
width: 1024,
height: 768,
resizable : true,
location: false,
menubar: false,
scrollbars: false,
status: false,
toolbar: false
}
winOpen(val.url+Math.random()+val.gamecode, val.name, val.width, val.height, val.resizable, val.location, val.menubar, val.scrollbars, val.status, val.status);
return false;
});
function winOpen(URL, windowName, width, height, resizable, location, menubar, scrollbars, status, toolbar){
var windowFeatures;
windowFeatures = '';
if (width != '' && width != null){
windowFeatures = windowFeatures+'width='+width+',';
}
if (height != '' && height != null){
windowFeatures = windowFeatures+'height='+height+',';
}
if (resizable){
windowFeatures = windowFeatures+'resizable,';
}
if (location){
windowFeatures = windowFeatures+'location,';
}
if (menubar){
windowFeatures = windowFeatures+'menubar,';
}
if (scrollbars){
windowFeatures = windowFeatures+'scrollbars,';
}
if (status){
windowFeatures = windowFeatures+'status,';
}
if (toolbar){
windowFeatures = windowFeatures+'toolbar,';
}
window.open(URL, windowName, windowFeatures);
}
function auth(form = null) {
let bank_info = '';
if ($(form).attr('action') == `/func/player/register`) {
let bank = $(form).find('[name="bank"]');
let bankDetail = {
account_no: $(form).find('[name="accNo"]').val(),
account_name: $(form).find('[name="bankAccName"]').val(),
depositBankId: bank.val(),
withdrawBankId: bank.attr('wd_id'),
extData: {
firstName: '',
lastName: '',
}
};
bank_info = `&bank_info=${JSON.stringify(bankDetail)}`;
}
$.ajax({
type: "POST",
url: ajaxURL + $(form).attr('action'),
headers: headerAuth,
dataType: 'json',
data: $(form).serialize() + `${bank_info}`,
async: false,
success: function (res) {
if (res.code == "0") {
if ($(form).attr('action') == `/j_spring_security_check`) {
localStorage.setItem('loginToken', res.result.loginToken);
window.location = "/secure/home.html";
}
if ($(form).attr('action') == `/func/player/register`) {
localStorage.setItem('loginToken', res.result.loginToken);
window.location = "/secure/home.html";
}
if ($(form).attr('action') == `j_spring_security_logout`) {
localStorage.setItem('loginToken', res.result.loginToken);
window.location = "/";
}
}
else {
jAlert(res.description, `Alert!`);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);//Unauthorized
}
});
}
function request(method, endPoint, data = {}, headerAuth = {}) {
return $.ajax({
type: method,
url: ajaxURL + endPoint,
headers: headerAuth,
data: data,
dataType: 'json',
async: false,
error: function (jqXHR, textStatus, errorThrown) {
jAlert(jqXHR.responseText, `Alert!`);
}
});
}
function player() {
this.getPlayerInfo = () => {
$.ajax({
type: "GET",
url: ajaxURL + `/ajax/account/getInfo`,
headers: headerAuth,
dataType: 'json',
data: {},
async: false,
success: function (res) {
if (res.code == "0") {
const data = res.result;
$(`.g8-name`).text(data.username);
}
else {
localStorage.removeItem('loginToken', res.loginToken);
window.location = "/";
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);//Unauthorized
}
});
};
}
if ($('.jackpotNumber').length) {
var SEC = 50;
var LIMIT = 1000000000;
var cnt = 683188708;
var disp = $('.jackpotNumber');
setInterval(countup, SEC);
function countup() {
var cnt_str = addCommas(cnt);
disp.html(cnt_str);
cnt = (cnt + 1) % LIMIT;
}
function addCommas(nStr) {
nStr += '';
let x, x1, x2;
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
}
function parseCurrency(num){
if(num.length==0){
return "0";
}
var numFixed = num.replace(/\./g,"");
numFixed = numFixed.replace(",",".");
numFixed = parseFloat(numFixed);
return numFixed;
}
function formatCurrency(el) {
function setValue(_el) {
let value = _el.val();
if (value === '') {
return;
}
// original length
var original_len = value.length;
// initial caret position
var caret_pos = _el.prop("selectionStart");
_el.val(parseInt(value.replace(/\D/g, '')).toLocaleString('id-ID', {
maximumFractionDigits: 0
}));
// put caret back in the right position
var updated_len = _el.val().length;
caret_pos = updated_len - original_len + caret_pos;
_el[0].setSelectionRange(caret_pos, caret_pos);
}
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
$(el).on({
keyup: function() {
setValue($(this));
},
mouseout: function() {
setValue($(this));
}
});
} else {
$(el).on({
keyup: function() {
setValue($(this));
},
blur: function() {
setValue($(this));
}
});
}
}
function displayIDR(amount, showLabel = true) {
return displayCurrency(amount, showLabel, false)
}
function displayCurrency(amount = 0, isShowLabel = true, isCredit = true) {
if (typeof amount === 'string') {
amount = parseFloat(amount.includes(',') ? amount.replace(/\./g, '').replace(',', '.') : amount)
}
let idrAmount = (!isCredit ? amount : amount * (globalObj.rate || 1)).toLocaleString('id-ID', {maximumFractionDigits: 0});
return String((isShowLabel ? 'IDR' : '') + ' ' + idrAmount).trim();
}
function formatDateTime(input, format) {
const date = new Date(input);
if (isNaN(date)) {
throw new Error("Invalid date input");
}
const map = {
"YYYY": date.getFullYear(),
"yyyy": date.getFullYear(),
"MM": String(date.getMonth() + 1).padStart(2, "0"),
"DD": String(date.getDate()).padStart(2, "0"),
"dd": String(date.getDate()).padStart(2, "0"),
"HH": String(date.getHours()).padStart(2, "0"),
"mm": String(date.getMinutes()).padStart(2, "0"),
"ss": String(date.getSeconds()).padStart(2, "0")
};
let formatted = format;
for (const token in map) {
formatted = formatted.replace(token, map[token]);
}
return formatted;
}
$(document).on('click', '.s-check', function () {
jAlert('Please login and register to enter the game');
return false;
});