1/** 2 * Shared casino constants and auth helpers. 3 */ 4(function (global) { 5 'use strict'; 6 7 var STARTING_BALANCE = 500; 8 var DAILY_BONUS = 500; 9 var WORK_REWARDS = { 10 dishes: 20, 11 trash: 25, 12 sweep: 30 13 }; 14 15 function isCasinoLoggedIn() { 16 var username = global.__sharedUsername && global.__sharedUsername.get 17 ? global.__sharedUsername.get() 18 : null; 19 var hasPassword = false; 20 var isGuest = false; 21 try { 22 hasPassword = localStorage.getItem('puppy_username_password') !== null; 23 isGuest = localStorage.getItem('puppy_guest_mode') === 'true'; 24 } catch (e) {} 25 return !!(username && hasPassword && !isGuest); 26 } 27 28 function getUsername() { 29 if (!isCasinoLoggedIn()) return null; 30 return global.__sharedUsername.get(); 31 } 32 33 function sanitizeUsername(name) { 34 if (!name) return ''; 35 return String(name).substring(0, 20).replace(/[^a-zA-Z0-9 ]/g, '').trim(); 36 } 37 38 function utcDateString(d) { 39 d = d || new Date(); 40 return d.getUTCFullYear() + '-' + 41 String(d.getUTCMonth() + 1).padStart(2, '0') + '-' + 42 String(d.getUTCDate()).padStart(2, '0'); 43 } 44 45 function formatCoins(n) { 46 var val = Math.max(0, Math.floor(Number(n) || 0)); 47 return val.toLocaleString(); 48 } 49 50 function promptSignIn() { 51 if (global.__sharedUsername && typeof global.__sharedUsername.promptAgain === 'function') { 52 global.__sharedUsername.promptAgain(); 53 } else { 54 global.location.href = '/account.html'; 55 } 56 } 57 58 global.CasinoCore = { 59 STARTING_BALANCE: STARTING_BALANCE, 60 DAILY_BONUS: DAILY_BONUS, 61 WORK_REWARDS: WORK_REWARDS, 62 isCasinoLoggedIn: isCasinoLoggedIn, 63 getUsername: getUsername, 64 sanitizeUsername: sanitizeUsername, 65 utcDateString: utcDateString, 66 formatCoins: formatCoins, 67 promptSignIn: promptSignIn 68 }; 69})(typeof window !== 'undefined' ? window : this);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.