keeperboard 2.1.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,903 +1 @@
1
- // src/types.ts
2
- var KeeperBoardError = class extends Error {
3
- constructor(message, code, statusCode) {
4
- super(message);
5
- this.code = code;
6
- this.statusCode = statusCode;
7
- this.name = "KeeperBoardError";
8
- }
9
- };
10
-
11
- // src/KeeperBoardClient.ts
12
- var _KeeperBoardClient = class _KeeperBoardClient {
13
- constructor(config) {
14
- const url = config.apiUrl ?? _KeeperBoardClient.DEFAULT_API_URL;
15
- this.apiUrl = url.replace(/\/$/, "");
16
- this.apiKey = config.apiKey;
17
- this.defaultLeaderboard = config.defaultLeaderboard;
18
- }
19
- // ============================================
20
- // SCORE SUBMISSION
21
- // ============================================
22
- /**
23
- * Submit a score. Only updates if the new score is higher than the existing one.
24
- *
25
- * @example
26
- * const result = await client.submitScore({
27
- * playerGuid: 'abc-123',
28
- * playerName: 'ACE',
29
- * score: 1500,
30
- * });
31
- * console.log(result.rank, result.isNewHighScore);
32
- */
33
- async submitScore(options) {
34
- const leaderboard = options.leaderboard ?? this.defaultLeaderboard;
35
- const params = new URLSearchParams();
36
- if (leaderboard) params.set("leaderboard", leaderboard);
37
- const url = `${this.apiUrl}/api/v1/scores${params.toString() ? "?" + params.toString() : ""}`;
38
- const body = {
39
- player_guid: options.playerGuid,
40
- player_name: options.playerName,
41
- score: options.score,
42
- ...options.metadata && { metadata: options.metadata }
43
- };
44
- const raw = await this.request(url, {
45
- method: "POST",
46
- body: JSON.stringify(body)
47
- });
48
- return this.mapScoreResponse(raw);
49
- }
50
- // ============================================
51
- // LEADERBOARD
52
- // ============================================
53
- /**
54
- * Get a leaderboard. Supports pagination and version-based lookups for
55
- * time-based boards.
56
- *
57
- * @example
58
- * // Top 10 on default board
59
- * const lb = await client.getLeaderboard();
60
- *
61
- * // Top 25 on a specific board
62
- * const lb = await client.getLeaderboard({ leaderboard: 'Weekly', limit: 25 });
63
- *
64
- * // Historical version
65
- * const lb = await client.getLeaderboard({ leaderboard: 'Weekly', version: 3 });
66
- */
67
- async getLeaderboard(options) {
68
- const leaderboard = options?.leaderboard ?? this.defaultLeaderboard;
69
- const limit = options?.limit ?? 10;
70
- const offset = options?.offset ?? 0;
71
- const params = new URLSearchParams();
72
- params.set("limit", String(Math.min(limit, 100)));
73
- params.set("offset", String(offset));
74
- if (leaderboard) params.set("leaderboard", leaderboard);
75
- if (options?.version !== void 0) params.set("version", String(options.version));
76
- const url = `${this.apiUrl}/api/v1/leaderboard?${params.toString()}`;
77
- const raw = await this.request(url, { method: "GET" });
78
- return this.mapLeaderboardResponse(raw);
79
- }
80
- // ============================================
81
- // PLAYER
82
- // ============================================
83
- /**
84
- * Get a player's rank and score. Returns `null` if the player has no score.
85
- *
86
- * @example
87
- * const player = await client.getPlayerRank({ playerGuid: 'abc-123' });
88
- * if (player) console.log(`Rank #${player.rank}`);
89
- */
90
- async getPlayerRank(options) {
91
- const leaderboard = options.leaderboard ?? this.defaultLeaderboard;
92
- const params = new URLSearchParams();
93
- if (leaderboard) params.set("leaderboard", leaderboard);
94
- const url = `${this.apiUrl}/api/v1/player/${encodeURIComponent(options.playerGuid)}${params.toString() ? "?" + params.toString() : ""}`;
95
- try {
96
- const raw = await this.request(url, { method: "GET" });
97
- return this.mapPlayerResponse(raw);
98
- } catch (error) {
99
- if (error instanceof KeeperBoardError && error.code === "NOT_FOUND") {
100
- return null;
101
- }
102
- throw error;
103
- }
104
- }
105
- /**
106
- * Update a player's display name.
107
- *
108
- * @example
109
- * const player = await client.updatePlayerName({
110
- * playerGuid: 'abc-123',
111
- * newName: 'MAVERICK',
112
- * });
113
- */
114
- async updatePlayerName(options) {
115
- const leaderboard = options.leaderboard ?? this.defaultLeaderboard;
116
- const params = new URLSearchParams();
117
- if (leaderboard) params.set("leaderboard", leaderboard);
118
- const url = `${this.apiUrl}/api/v1/player/${encodeURIComponent(options.playerGuid)}${params.toString() ? "?" + params.toString() : ""}`;
119
- const raw = await this.request(url, {
120
- method: "PUT",
121
- body: JSON.stringify({ player_name: options.newName })
122
- });
123
- return this.mapPlayerResponse(raw);
124
- }
125
- // ============================================
126
- // CLAIM (for migrated scores)
127
- // ============================================
128
- /**
129
- * Claim a migrated score by matching player name.
130
- * Used when scores were imported without player GUIDs.
131
- */
132
- async claimScore(options) {
133
- const leaderboard = options.leaderboard ?? this.defaultLeaderboard;
134
- const params = new URLSearchParams();
135
- if (leaderboard) params.set("leaderboard", leaderboard);
136
- const url = `${this.apiUrl}/api/v1/claim${params.toString() ? "?" + params.toString() : ""}`;
137
- const raw = await this.request(url, {
138
- method: "POST",
139
- body: JSON.stringify({
140
- player_guid: options.playerGuid,
141
- player_name: options.playerName
142
- })
143
- });
144
- return this.mapClaimResponse(raw);
145
- }
146
- // ============================================
147
- // HEALTH CHECK
148
- // ============================================
149
- /**
150
- * Check if the API is healthy. Does not require an API key.
151
- */
152
- async healthCheck() {
153
- const url = `${this.apiUrl}/api/v1/health`;
154
- const response = await fetch(url, {
155
- method: "GET",
156
- headers: { Accept: "application/json" }
157
- });
158
- const json = await response.json();
159
- if (!json.success) {
160
- throw new KeeperBoardError(json.error, json.code, response.status);
161
- }
162
- return json.data;
163
- }
164
- // ============================================
165
- // RESPONSE MAPPERS (snake_case → camelCase)
166
- // ============================================
167
- mapScoreResponse(raw) {
168
- return {
169
- id: raw.id,
170
- playerGuid: raw.player_guid,
171
- playerName: raw.player_name,
172
- score: raw.score,
173
- rank: raw.rank,
174
- isNewHighScore: raw.is_new_high_score
175
- };
176
- }
177
- mapLeaderboardResponse(raw) {
178
- return {
179
- entries: raw.entries.map((e) => ({
180
- rank: e.rank,
181
- playerGuid: e.player_guid,
182
- playerName: e.player_name,
183
- score: e.score
184
- })),
185
- totalCount: raw.total_count,
186
- resetSchedule: raw.reset_schedule,
187
- version: raw.version,
188
- oldestVersion: raw.oldest_version,
189
- nextReset: raw.next_reset
190
- };
191
- }
192
- mapPlayerResponse(raw) {
193
- return {
194
- id: raw.id,
195
- playerGuid: raw.player_guid,
196
- playerName: raw.player_name,
197
- score: raw.score,
198
- rank: raw.rank
199
- };
200
- }
201
- mapClaimResponse(raw) {
202
- return {
203
- claimed: raw.claimed,
204
- score: raw.score,
205
- rank: raw.rank,
206
- playerName: raw.player_name
207
- };
208
- }
209
- // ============================================
210
- // INTERNAL
211
- // ============================================
212
- async request(url, options) {
213
- const headers = {
214
- "Content-Type": "application/json",
215
- Accept: "application/json",
216
- "X-API-Key": this.apiKey
217
- };
218
- const response = await fetch(url, {
219
- ...options,
220
- headers: { ...headers, ...options.headers || {} }
221
- });
222
- const json = await response.json();
223
- if (!json.success) {
224
- throw new KeeperBoardError(json.error, json.code, response.status);
225
- }
226
- return json.data;
227
- }
228
- };
229
- _KeeperBoardClient.DEFAULT_API_URL = "https://keeperboard.vercel.app";
230
- var KeeperBoardClient = _KeeperBoardClient;
231
-
232
- // src/nameGenerator.ts
233
- var MAX_BASE_LENGTH = 10;
234
- var ADJECTIVES = [
235
- "Arcane",
236
- "Astro",
237
- "Blazing",
238
- "Bouncy",
239
- "Brassy",
240
- "Brisk",
241
- "Bubbly",
242
- "Chaotic",
243
- "Cheeky",
244
- "Chill",
245
- "Chunky",
246
- "Cloaked",
247
- "Cosmic",
248
- "Crimson",
249
- "Crispy",
250
- "Dashing",
251
- "Dizzy",
252
- "Dynamic",
253
- "Electric",
254
- "Epic",
255
- "Feisty",
256
- "Fiery",
257
- "Flashy",
258
- "Frosty",
259
- "Funky",
260
- "Furious",
261
- "Galactic",
262
- "Glitchy",
263
- "Golden",
264
- "Goofy",
265
- "Gritty",
266
- "Groovy",
267
- "Hyper",
268
- "Icy",
269
- "Inky",
270
- "Jazzy",
271
- "Jolly",
272
- "Jumpy",
273
- "Laser",
274
- "Legendary",
275
- "Loud",
276
- "Lucky",
277
- "Lunar",
278
- "Madcap",
279
- "Magic",
280
- "Majestic",
281
- "Meteor",
282
- "Mighty",
283
- "Minty",
284
- "Mystic",
285
- "Neon",
286
- "Nimble",
287
- "Nova",
288
- "Nuclear",
289
- "Omega",
290
- "Orbital",
291
- "Peppy",
292
- "Phantom",
293
- "Pixel",
294
- "Plasma",
295
- "Polished",
296
- "Primal",
297
- "Quantum",
298
- "Quick",
299
- "Radiant",
300
- "Rampaging",
301
- "Razor",
302
- "Rebel",
303
- "Retro",
304
- "Rogue",
305
- "Rowdy",
306
- "Savage",
307
- "Shadow",
308
- "Shiny",
309
- "Silly",
310
- "Sketchy",
311
- "Skybound",
312
- "Slick",
313
- "Snappy",
314
- "Solar",
315
- "Sonic",
316
- "Sparky",
317
- "Speedy",
318
- "Spiky",
319
- "Starry",
320
- "Stealthy",
321
- "Stormy",
322
- "Supreme",
323
- "Swift",
324
- "Thunder",
325
- "Turbo",
326
- "Twilight",
327
- "Ultra",
328
- "Vibrant",
329
- "Warped",
330
- "Wicked",
331
- "Wild",
332
- "Wizard",
333
- "Zappy",
334
- "Zesty"
335
- ];
336
- var NOUNS = [
337
- "Aardvark",
338
- "Asteroid",
339
- "Badger",
340
- "Bandit",
341
- "Banshee",
342
- "Beacon",
343
- "Beetle",
344
- "Blaster",
345
- "Blob",
346
- "Boomer",
347
- "Bot",
348
- "Brawler",
349
- "Buccaneer",
350
- "Buffalo",
351
- "Cannon",
352
- "Captain",
353
- "Caribou",
354
- "Charger",
355
- "Cheetah",
356
- "Chimera",
357
- "Cobra",
358
- "Comet",
359
- "Cosmonaut",
360
- "Cougar",
361
- "Coyote",
362
- "Cyborg",
363
- "Dagger",
364
- "Defender",
365
- "Dino",
366
- "Dragon",
367
- "Drifter",
368
- "Drone",
369
- "Duck",
370
- "Eagle",
371
- "Eel",
372
- "Falcon",
373
- "Ferret",
374
- "Fireball",
375
- "Fox",
376
- "Fury",
377
- "Gazelle",
378
- "Ghost",
379
- "Gizmo",
380
- "Gladiator",
381
- "Goblin",
382
- "Griffin",
383
- "Hammer",
384
- "Hawk",
385
- "Hero",
386
- "Hydra",
387
- "Iguana",
388
- "Jaguar",
389
- "Jester",
390
- "Jetpack",
391
- "Jinx",
392
- "Kangaroo",
393
- "Katana",
394
- "Kraken",
395
- "Lancer",
396
- "Laser",
397
- "Legend",
398
- "Lemur",
399
- "Leopard",
400
- "Lion",
401
- "Luchador",
402
- "Lynx",
403
- "Maverick",
404
- "Meteor",
405
- "Monkey",
406
- "Monsoon",
407
- "Moose",
408
- "Ninja",
409
- "Nova",
410
- "Octopus",
411
- "Oracle",
412
- "Otter",
413
- "Panther",
414
- "Phoenix",
415
- "Pirate",
416
- "Pixel",
417
- "Puma",
418
- "Quasar",
419
- "Racer",
420
- "Raptor",
421
- "Raven",
422
- "Reactor",
423
- "Rocket",
424
- "Ronin",
425
- "Saber",
426
- "Scorpion",
427
- "Shark",
428
- "Spartan",
429
- "Sphinx",
430
- "Sprinter",
431
- "Stallion",
432
- "Tiger",
433
- "Titan",
434
- "Viking",
435
- "Viper",
436
- "Wizard"
437
- ];
438
- function generatePlayerName() {
439
- const adjective = ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)];
440
- const noun = NOUNS[Math.floor(Math.random() * NOUNS.length)];
441
- const number = Math.floor(Math.random() * 99) + 1;
442
- const base = (adjective + noun).slice(0, MAX_BASE_LENGTH);
443
- return `${base}${number}`;
444
- }
445
-
446
- // src/PlayerIdentity.ts
447
- var DEFAULT_KEY_PREFIX = "keeperboard_";
448
- var PlayerIdentity = class {
449
- constructor(config = {}) {
450
- this.keyPrefix = config.keyPrefix ?? DEFAULT_KEY_PREFIX;
451
- this.guidKey = `${this.keyPrefix}player_guid`;
452
- this.nameKey = `${this.keyPrefix}player_name`;
453
- this.nameAutoKey = `${this.keyPrefix}player_name_auto`;
454
- }
455
- /**
456
- * Get the stored player GUID, or null if none exists.
457
- */
458
- getPlayerGuid() {
459
- if (typeof window === "undefined" || !window.localStorage) {
460
- return null;
461
- }
462
- return localStorage.getItem(this.guidKey);
463
- }
464
- /**
465
- * Set the player GUID in localStorage.
466
- */
467
- setPlayerGuid(guid) {
468
- if (typeof window === "undefined" || !window.localStorage) {
469
- return;
470
- }
471
- localStorage.setItem(this.guidKey, guid);
472
- }
473
- /**
474
- * Get the stored player GUID, creating one if it doesn't exist.
475
- * Uses crypto.randomUUID() for generating new GUIDs.
476
- */
477
- getOrCreatePlayerGuid() {
478
- let guid = this.getPlayerGuid();
479
- if (!guid) {
480
- guid = this.generateUUID();
481
- this.setPlayerGuid(guid);
482
- }
483
- return guid;
484
- }
485
- /**
486
- * Get the stored player name, or null if none exists.
487
- */
488
- getPlayerName() {
489
- if (typeof window === "undefined" || !window.localStorage) {
490
- return null;
491
- }
492
- return localStorage.getItem(this.nameKey);
493
- }
494
- /**
495
- * Set the player name in localStorage.
496
- */
497
- setPlayerName(name) {
498
- if (typeof window === "undefined" || !window.localStorage) {
499
- return;
500
- }
501
- localStorage.setItem(this.nameKey, name);
502
- localStorage.removeItem(this.nameAutoKey);
503
- }
504
- /**
505
- * Get the stored player name, creating an auto-generated one if it doesn't exist.
506
- * Uses AdjectiveNounNumber pattern (e.g., ArcaneBlob99).
507
- */
508
- getOrCreatePlayerName() {
509
- let name = this.getPlayerName();
510
- if (!name) {
511
- name = generatePlayerName();
512
- if (typeof window !== "undefined" && window.localStorage) {
513
- localStorage.setItem(this.nameKey, name);
514
- localStorage.setItem(this.nameAutoKey, "true");
515
- }
516
- }
517
- return name;
518
- }
519
- /**
520
- * Check if the current player name was auto-generated (vs explicitly set by user).
521
- */
522
- isAutoGeneratedName() {
523
- if (typeof window === "undefined" || !window.localStorage) {
524
- return false;
525
- }
526
- return localStorage.getItem(this.nameAutoKey) === "true";
527
- }
528
- /**
529
- * Clear all stored player identity data.
530
- */
531
- clear() {
532
- if (typeof window === "undefined" || !window.localStorage) {
533
- return;
534
- }
535
- localStorage.removeItem(this.guidKey);
536
- localStorage.removeItem(this.nameKey);
537
- localStorage.removeItem(this.nameAutoKey);
538
- }
539
- /**
540
- * Check if player identity is stored.
541
- */
542
- hasIdentity() {
543
- return this.getPlayerGuid() !== null;
544
- }
545
- /**
546
- * Generate a UUID v4.
547
- * Uses crypto.randomUUID() if available, otherwise falls back to a manual implementation.
548
- */
549
- generateUUID() {
550
- if (typeof crypto !== "undefined" && crypto.randomUUID) {
551
- return crypto.randomUUID();
552
- }
553
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
554
- const r = Math.random() * 16 | 0;
555
- const v = c === "x" ? r : r & 3 | 8;
556
- return v.toString(16);
557
- });
558
- }
559
- };
560
-
561
- // src/Cache.ts
562
- var Cache = class {
563
- constructor(ttlMs) {
564
- this.fetchedAt = 0;
565
- this.inflight = null;
566
- this.pendingRefresh = null;
567
- this.ttlMs = ttlMs;
568
- }
569
- /**
570
- * Get cached value if fresh, otherwise fetch via the provided function.
571
- * Deduplicates concurrent calls — only one fetch runs at a time.
572
- */
573
- async getOrFetch(fetchFn) {
574
- if (this.isFresh()) {
575
- return this.data;
576
- }
577
- if (this.inflight) {
578
- return this.inflight;
579
- }
580
- this.inflight = fetchFn().then((result) => {
581
- this.data = result;
582
- this.fetchedAt = Date.now();
583
- this.inflight = null;
584
- return result;
585
- }).catch((err) => {
586
- this.inflight = null;
587
- throw err;
588
- });
589
- return this.inflight;
590
- }
591
- /**
592
- * Trigger a background refresh without awaiting the result.
593
- * Returns immediately. If a fetch is already in flight, schedules
594
- * the refresh to run after the current one completes.
595
- */
596
- refreshInBackground(fetchFn) {
597
- if (this.inflight) {
598
- this.pendingRefresh = fetchFn;
599
- return;
600
- }
601
- this.startBackgroundFetch(fetchFn);
602
- }
603
- startBackgroundFetch(fetchFn) {
604
- this.inflight = fetchFn().then((result) => {
605
- this.data = result;
606
- this.fetchedAt = Date.now();
607
- this.inflight = null;
608
- if (this.pendingRefresh) {
609
- const pending = this.pendingRefresh;
610
- this.pendingRefresh = null;
611
- this.startBackgroundFetch(pending);
612
- }
613
- return result;
614
- }).catch((err) => {
615
- this.inflight = null;
616
- this.pendingRefresh = null;
617
- throw err;
618
- });
619
- this.inflight.catch(() => {
620
- });
621
- }
622
- /** Invalidate the cache, forcing the next getOrFetch to re-fetch. */
623
- invalidate() {
624
- this.fetchedAt = 0;
625
- }
626
- /** Get the cached value without fetching. Returns undefined if empty or stale. */
627
- get() {
628
- return this.isFresh() ? this.data : void 0;
629
- }
630
- /** Get the cached value even if stale. Returns undefined only if never fetched. */
631
- getStale() {
632
- return this.data;
633
- }
634
- /** Check if the cache has fresh (non-expired) data. */
635
- isFresh() {
636
- return this.data !== void 0 && Date.now() - this.fetchedAt < this.ttlMs;
637
- }
638
- };
639
-
640
- // src/RetryQueue.ts
641
- var DEFAULT_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
642
- var RetryQueue = class {
643
- constructor(storageKey, maxAgeMs = DEFAULT_MAX_AGE_MS) {
644
- this.storageKey = storageKey;
645
- this.maxAgeMs = maxAgeMs;
646
- }
647
- /** Save a failed score for later retry. */
648
- save(score, metadata) {
649
- try {
650
- const pending = { score, metadata, timestamp: Date.now() };
651
- localStorage.setItem(this.storageKey, JSON.stringify(pending));
652
- } catch {
653
- }
654
- }
655
- /**
656
- * Get the pending score, or null if none exists or it has expired.
657
- * Automatically clears expired entries.
658
- */
659
- get() {
660
- try {
661
- const raw = localStorage.getItem(this.storageKey);
662
- if (!raw) return null;
663
- const pending = JSON.parse(raw);
664
- if (Date.now() - pending.timestamp > this.maxAgeMs) {
665
- this.clear();
666
- return null;
667
- }
668
- return { score: pending.score, metadata: pending.metadata };
669
- } catch {
670
- return null;
671
- }
672
- }
673
- /** Check if there's a pending score. */
674
- hasPending() {
675
- return this.get() !== null;
676
- }
677
- /** Clear the pending score. */
678
- clear() {
679
- try {
680
- localStorage.removeItem(this.storageKey);
681
- } catch {
682
- }
683
- }
684
- };
685
-
686
- // src/validation.ts
687
- var DEFAULTS = {
688
- minLength: 2,
689
- maxLength: 12,
690
- allowedPattern: /[^A-Za-z0-9_ ]/g
691
- // Letters, numbers, underscore, space
692
- };
693
- function validateName(input, options) {
694
- const opts = { ...DEFAULTS, ...options };
695
- let name = input.trim();
696
- const pattern = options?.allowedPattern ?? /[^A-Za-z0-9_ ]/g;
697
- name = name.replace(pattern, "");
698
- name = name.replace(/ +/g, " ").trim();
699
- name = name.substring(0, opts.maxLength);
700
- if (name.length < opts.minLength) {
701
- return null;
702
- }
703
- return name;
704
- }
705
-
706
- // src/KeeperBoardSession.ts
707
- var KeeperBoardSession = class {
708
- constructor(config) {
709
- this.cachedLimit = 0;
710
- // Track the limit used for cached data
711
- this.isSubmitting = false;
712
- this.client = new KeeperBoardClient({
713
- apiKey: config.apiKey,
714
- defaultLeaderboard: config.leaderboard,
715
- apiUrl: config.apiUrl
716
- });
717
- this.identity = new PlayerIdentity(config.identity);
718
- this.leaderboard = config.leaderboard;
719
- this.cache = config.cache ? new Cache(config.cache.ttlMs) : null;
720
- this.retryQueue = config.retry ? new RetryQueue(
721
- `keeperboard_retry_${config.leaderboard}`,
722
- config.retry.maxAgeMs
723
- ) : null;
724
- }
725
- // ============================================
726
- // IDENTITY
727
- // ============================================
728
- /** Get or create a persistent player GUID. */
729
- getPlayerGuid() {
730
- return this.identity.getOrCreatePlayerGuid();
731
- }
732
- /** Get the stored player name, auto-generating one if none exists. */
733
- getPlayerName() {
734
- return this.identity.getOrCreatePlayerName();
735
- }
736
- /** Store a player name locally. Does NOT update the server — call updatePlayerName() for that. */
737
- setPlayerName(name) {
738
- this.identity.setPlayerName(name);
739
- }
740
- /** Check if the player has explicitly set a name (vs auto-generated). */
741
- hasExplicitPlayerName() {
742
- return this.identity.getPlayerName() !== null && !this.identity.isAutoGeneratedName();
743
- }
744
- /** Validate a name using configurable rules. Returns sanitized string or null. */
745
- validateName(input, options) {
746
- return validateName(input, options);
747
- }
748
- // ============================================
749
- // CORE API
750
- // ============================================
751
- /**
752
- * Submit a score. Identity and leaderboard are auto-injected.
753
- * Returns a discriminated union: `{ success: true, rank, isNewHighScore }` or `{ success: false, error }`.
754
- *
755
- * If retry is enabled, failed submissions are saved to localStorage for later retry.
756
- * Prevents concurrent double-submissions.
757
- */
758
- async submitScore(score, metadata) {
759
- if (this.isSubmitting) {
760
- return { success: false, error: "Submission in progress" };
761
- }
762
- this.isSubmitting = true;
763
- try {
764
- const result = await this.client.submitScore({
765
- playerGuid: this.getPlayerGuid(),
766
- playerName: this.getPlayerName(),
767
- score,
768
- metadata
769
- });
770
- this.retryQueue?.clear();
771
- if (this.cache) {
772
- this.cache.invalidate();
773
- this.cachedLimit = 0;
774
- this.cache.refreshInBackground(() => this.fetchSnapshot());
775
- }
776
- return {
777
- success: true,
778
- rank: result.rank,
779
- isNewHighScore: result.isNewHighScore
780
- };
781
- } catch (error) {
782
- const errorCode = error instanceof KeeperBoardError ? error.code : void 0;
783
- if (errorCode !== "PROFANITY_DETECTED") {
784
- this.retryQueue?.save(score, metadata);
785
- }
786
- return {
787
- success: false,
788
- error: error instanceof Error ? error.message : "Unknown error",
789
- errorCode
790
- };
791
- } finally {
792
- this.isSubmitting = false;
793
- }
794
- }
795
- /**
796
- * Get a combined snapshot: leaderboard entries (with `isCurrentPlayer` flag)
797
- * plus the current player's rank if they're outside the top N.
798
- *
799
- * Uses cache if enabled and fresh. If a larger limit is requested than
800
- * what's cached, the cache is invalidated and fresh data is fetched.
801
- */
802
- async getSnapshot(options) {
803
- const limit = options?.limit ?? 10;
804
- if (this.cache) {
805
- if (limit > this.cachedLimit) {
806
- this.cache.invalidate();
807
- }
808
- const result = await this.cache.getOrFetch(() => this.fetchSnapshot(limit));
809
- this.cachedLimit = limit;
810
- return result;
811
- }
812
- return this.fetchSnapshot(limit);
813
- }
814
- /**
815
- * Update the player's name on the server and locally.
816
- * Returns `{ success: true }` on success, or `{ success: false, error, errorCode }` on failure.
817
- */
818
- async updatePlayerName(newName) {
819
- try {
820
- await this.client.updatePlayerName({
821
- playerGuid: this.getPlayerGuid(),
822
- newName
823
- });
824
- this.identity.setPlayerName(newName);
825
- if (this.cache) {
826
- this.cache.invalidate();
827
- this.cachedLimit = 0;
828
- }
829
- return { success: true };
830
- } catch (error) {
831
- const errorCode = error instanceof KeeperBoardError ? error.code : void 0;
832
- return {
833
- success: false,
834
- error: error instanceof Error ? error.message : "Unknown error",
835
- errorCode
836
- };
837
- }
838
- }
839
- /**
840
- * Retry submitting a pending score (from a previous failed submission).
841
- * Call this on app startup.
842
- */
843
- async retryPendingScore() {
844
- const pending = this.retryQueue?.get();
845
- if (!pending) return null;
846
- const result = await this.submitScore(pending.score, pending.metadata);
847
- if (result.success) {
848
- this.retryQueue?.clear();
849
- }
850
- return result;
851
- }
852
- /** Check if there's a pending score in the retry queue. */
853
- hasPendingScore() {
854
- return this.retryQueue?.hasPending() ?? false;
855
- }
856
- /**
857
- * Pre-fetch snapshot data in the background for instant display later.
858
- * No-op if cache is disabled or already fresh.
859
- */
860
- prefetch() {
861
- if (!this.cache) return;
862
- if (this.cache.isFresh()) return;
863
- this.cache.refreshInBackground(() => this.fetchSnapshot());
864
- }
865
- /** Escape hatch: access the underlying KeeperBoardClient. */
866
- getClient() {
867
- return this.client;
868
- }
869
- // ============================================
870
- // INTERNAL
871
- // ============================================
872
- async fetchSnapshot(limit = 10) {
873
- const playerGuid = this.getPlayerGuid();
874
- const [leaderboard, playerRank] = await Promise.all([
875
- this.client.getLeaderboard({ limit }),
876
- this.client.getPlayerRank({ playerGuid })
877
- ]);
878
- const entries = leaderboard.entries.map((e) => ({
879
- rank: e.rank,
880
- playerGuid: e.playerGuid,
881
- playerName: e.playerName,
882
- score: e.score,
883
- isCurrentPlayer: e.playerGuid === playerGuid
884
- }));
885
- const playerInEntries = entries.some((e) => e.isCurrentPlayer);
886
- const effectivePlayerRank = playerRank && !playerInEntries ? playerRank : null;
887
- return {
888
- entries,
889
- totalCount: leaderboard.totalCount,
890
- playerRank: effectivePlayerRank
891
- };
892
- }
893
- };
894
- export {
895
- Cache,
896
- KeeperBoardClient,
897
- KeeperBoardError,
898
- KeeperBoardSession,
899
- PlayerIdentity,
900
- RetryQueue,
901
- generatePlayerName,
902
- validateName
903
- };
1
+ const _0x47bb59=_0x59d5;(function(_0x2dab89,_0x162e26){const _0x5541e8=_0x59d5,_0x4b3ff4=_0x2dab89();while(!![]){try{const _0x3bb283=-parseInt(_0x5541e8(0x147))/(-0x1*0x46c+-0x10cb+0x1538)*(-parseInt(_0x5541e8(0x18e))/(-0x4ce*-0x1+0x194*0x10+-0x1e0c))+parseInt(_0x5541e8(0x1c5))/(0x582*-0x1+0xf52*-0x2+0x1*0x2429)*(parseInt(_0x5541e8(0x14b))/(0x207c+-0x1b89*0x1+-0x1a5*0x3))+-parseInt(_0x5541e8(0x186))/(0xf1*-0xd+0x23c2+-0x1780)*(parseInt(_0x5541e8(0x14f))/(0x3c6+-0x22a0+0x1ee0))+-parseInt(_0x5541e8(0xb0))/(-0xfa4+-0x740*0x2+0x1e2b)*(-parseInt(_0x5541e8(0x12a))/(0x1126*0x1+0x259+0x1*-0x1377))+-parseInt(_0x5541e8(0xc9))/(0x15a7+-0x7*-0x477+-0x34df)*(-parseInt(_0x5541e8(0x164))/(-0x1b1a+0x1*0x52f+0x15f5))+parseInt(_0x5541e8(0x12d))/(0xf66+0x12fa+-0x2255)*(-parseInt(_0x5541e8(0x1e3))/(-0x9a3*-0x4+-0x11*-0xf5+-0x36c5))+parseInt(_0x5541e8(0x11b))/(-0x33*-0x55+-0x2699+0x15b7)*(-parseInt(_0x5541e8(0x17d))/(0xa6*0x19+0x11*0x1d6+0x17af*-0x2));if(_0x3bb283===_0x162e26)break;else _0x4b3ff4['push'](_0x4b3ff4['shift']());}catch(_0x5d3a82){_0x4b3ff4['push'](_0x4b3ff4['shift']());}}}(_0x1245,0x31a6+-0x42*-0x1695+0x1*-0x160a2));function _0x59d5(_0x95b67,_0x1dc61b){_0x95b67=_0x95b67-(-0x13cc+0x1*0x2007+-0x1f4*0x6);const _0x7d9d93=_0x1245();let _0x36e6f5=_0x7d9d93[_0x95b67];if(_0x59d5['vvwWGA']===undefined){var _0x5acb09=function(_0x18fe66){const _0x4f54a3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x429ecf='',_0x4c393a='';for(let _0x1449d9=0xba1+0xcf8*0x1+0x3*-0x833,_0x7053b4,_0x5a3765,_0x1e397a=-0x35*-0x89+0x718*0x1+0x1d*-0x139;_0x5a3765=_0x18fe66['charAt'](_0x1e397a++);~_0x5a3765&&(_0x7053b4=_0x1449d9%(-0xe1a+0x1*0x254a+0x5cb*-0x4)?_0x7053b4*(-0x735+0x16c2+0x1*-0xf4d)+_0x5a3765:_0x5a3765,_0x1449d9++%(0x1ad0+0x26*0xa7+-0x3396))?_0x429ecf+=String['fromCharCode'](-0x1cf*0x4+0x21f6+-0x19bb&_0x7053b4>>(-(0x106c+-0x4f*-0x35+-0x20c5)*_0x1449d9&-0xb1a+-0x12a*-0x3+0x7a2)):0x12c7*0x1+-0x13eb*0x1+0x1*0x124){_0x5a3765=_0x4f54a3['indexOf'](_0x5a3765);}for(let _0x51b352=-0x114c+0x16f4+-0x5a8,_0x459f47=_0x429ecf['length'];_0x51b352<_0x459f47;_0x51b352++){_0x4c393a+='%'+('00'+_0x429ecf['charCodeAt'](_0x51b352)['toString'](-0x1392+0x108d+0x315))['slice'](-(0x1*0x1ebd+-0x3f1*-0x5+-0x3270));}return decodeURIComponent(_0x4c393a);};_0x59d5['xrAMms']=_0x5acb09,_0x59d5['MnyXbd']={},_0x59d5['vvwWGA']=!![];}const _0x561ff3=_0x7d9d93[-0x175c+0x5e*0x30+0x4*0x16f],_0x3b4052=_0x95b67+_0x561ff3,_0x4019ba=_0x59d5['MnyXbd'][_0x3b4052];return!_0x4019ba?(_0x36e6f5=_0x59d5['xrAMms'](_0x36e6f5),_0x59d5['MnyXbd'][_0x3b4052]=_0x36e6f5):_0x36e6f5=_0x4019ba,_0x36e6f5;}var d=class extends Error{constructor(_0x4bcefa,_0x17ebff,_0x3d1814){const _0x135994=_0x59d5,_0x93afb9={'vrczb':'KeeperBoardError'};super(_0x4bcefa),this['code']=_0x17ebff,this['statusCode']=_0x3d1814,this['name']=_0x93afb9[_0x135994(0x15a)];}};async function R(_0x4ca6a0,_0x4863ad){const _0x46ec3c=_0x59d5,_0x59b5b9={'tVaQC':function(_0x3d5d14,_0xde7503){return _0x3d5d14%_0xde7503;},'mZBKi':function(_0x141faf,_0x5844c2){return _0x141faf^_0x5844c2;},'VHtHB':_0x46ec3c(0xd1),'DdTEe':_0x46ec3c(0xdd),'gDwLO':_0x46ec3c(0x17a),'asZlu':_0x46ec3c(0x1bb),'SCvpC':function(_0x1f7408,_0x3443e4){return _0x1f7408(_0x3443e4);},'GaiSR':function(_0x3ac1a7,_0x464029){return _0x3ac1a7(_0x464029);},'VKpCY':function(_0x2c0f4c,_0x5c5135){return _0x2c0f4c^_0x5c5135;}};let _0xab886b=new TextEncoder(),_0x21fa91=await crypto[_0x46ec3c(0x194)][_0x46ec3c(0x170)](_0x59b5b9[_0x46ec3c(0x10a)],_0xab886b[_0x46ec3c(0xb6)](_0x4863ad),{'name':_0x59b5b9[_0x46ec3c(0x1ef)],'hash':_0x59b5b9['gDwLO']},!(-0x1*0xc1f+-0xbb9+0x17d9),[_0x59b5b9[_0x46ec3c(0x8e)]]),_0xe3fdbe=await crypto['subtle'][_0x46ec3c(0x1bb)](_0x59b5b9[_0x46ec3c(0x1ef)],_0x21fa91,_0xab886b[_0x46ec3c(0xb6)](_0x4ca6a0[_0x46ec3c(0x1be)][_0x46ec3c(0x190)](0x1*-0x277+0x8f*0xc+0x5*-0xd9,0x19bd+0x20c6+0xb*-0x551))),_0x71e741=await crypto[_0x46ec3c(0x194)][_0x46ec3c(0x170)](_0x59b5b9['VHtHB'],_0xe3fdbe,{'name':_0x59b5b9[_0x46ec3c(0x1ef)],'hash':_0x59b5b9[_0x46ec3c(0x19e)]},!(-0x1c9f*0x1+-0x2c*-0x8+0x2*0xda0),[_0x59b5b9[_0x46ec3c(0x8e)]]),_0x3cd7b8=[_0x4ca6a0[_0x46ec3c(0x1be)]];_0x4ca6a0[_0x46ec3c(0x1db)]&&_0x3cd7b8[_0x46ec3c(0x16d)](_0x4ca6a0[_0x46ec3c(0x1db)][_0x46ec3c(0x86)]('')[_0x46ec3c(0x1b7)]()['join']('')),_0x4ca6a0['score']!==void(0x165e+-0x5b*0x62+-0x39*-0x38)&&_0x3cd7b8[_0x46ec3c(0x16d)](_0x59b5b9['SCvpC'](String,_0x59b5b9[_0x46ec3c(0x1ca)](_0x4ca6a0['score'],-0x3*-0x3a5+0x5230+0x61d*0x10))),_0x3cd7b8[_0x46ec3c(0x16d)](_0x59b5b9['GaiSR'](String,_0x59b5b9[_0x46ec3c(0x15c)](_0x4ca6a0[_0x46ec3c(0x16a)],-0x16*-0x541+-0x1*-0xf25d+-0x8746)));let _0x4f1c2e=_0x3cd7b8[_0x46ec3c(0x8a)]('::'),_0x3e7e53=await crypto['subtle'][_0x46ec3c(0x1bb)](_0x59b5b9[_0x46ec3c(0x1ef)],_0x71e741,_0xab886b[_0x46ec3c(0xb6)](_0x4f1c2e)),_0x5ea164=Array[_0x46ec3c(0x184)](new Uint8Array(_0x3e7e53))[_0x46ec3c(0xd4)](_0x30b1f5=>_0x30b1f5[_0x46ec3c(0x1f7)](-0x1*-0x19c1+-0x1277*-0x2+-0x3e9f)[_0x46ec3c(0x1a0)](0x1*0x1d53+-0x12ae+-0x185*0x7,'0'))[_0x46ec3c(0x8a)](''),_0x3e2e0d=String(_0x4ca6a0['timestamp']),_0x196250=_0x5ea164[_0x46ec3c(0x86)]('')['map']((_0x275fa1,_0x37bc41)=>{const _0x2e2efb=_0x46ec3c;let _0x23959d=_0x3e2e0d[_0x59b5b9[_0x2e2efb(0x13a)](_0x37bc41,_0x3e2e0d[_0x2e2efb(0x187)])];return String[_0x2e2efb(0x155)](_0x59b5b9[_0x2e2efb(0x1ca)](_0x275fa1[_0x2e2efb(0x16e)](0x20f9*0x1+0x44d+-0x2546),_0x23959d[_0x2e2efb(0x16e)](0xe6f*0x1+-0x7de+-0x1*0x691)));})[_0x46ec3c(0x8a)]('');return _0x59b5b9[_0x46ec3c(0x1c1)](btoa,_0x196250)[_0x46ec3c(0x1a4)](/\+/g,'-')['replace'](/\//g,'_')[_0x46ec3c(0x1a4)](/=/g,'');}var y=class y{constructor(_0x39dcfa){const _0x3eb408=_0x59d5;let _0x13802d=_0x39dcfa['apiUrl']??y[_0x3eb408(0x100)];this[_0x3eb408(0x8b)]=_0x13802d['replace'](/\/$/,''),this[_0x3eb408(0x126)]=_0x39dcfa[_0x3eb408(0x126)],this[_0x3eb408(0x1a3)]=_0x39dcfa[_0x3eb408(0x1a3)],this[_0x3eb408(0x188)]=_0x39dcfa[_0x3eb408(0x188)];}async[_0x47bb59(0x1fd)](_0x3eb941){const _0x46a700=_0x47bb59,_0x1a503a={'dQdQs':_0x46a700(0x18a),'DxRyy':_0x46a700(0x95)};let _0x3fbe4a=_0x3eb941[_0x46a700(0x18a)]??this[_0x46a700(0x1a3)],_0xae5872=new URLSearchParams();_0x3fbe4a&&_0xae5872[_0x46a700(0x88)](_0x1a503a[_0x46a700(0xb8)],_0x3fbe4a);let _0x319f3b=this[_0x46a700(0x8b)]+'/api/v1/scores'+(_0xae5872[_0x46a700(0x1f7)]()?'?'+_0xae5872['toString']():''),_0x284d65={'player_guid':_0x3eb941[_0x46a700(0x1be)],'player_name':_0x3eb941[_0x46a700(0x171)],'score':_0x3eb941[_0x46a700(0xa3)],..._0x3eb941['metadata']&&{'metadata':_0x3eb941[_0x46a700(0x173)]}},_0x744a82=await this['request'](_0x319f3b,{'method':_0x1a503a[_0x46a700(0xe5)],'body':JSON[_0x46a700(0x92)](_0x284d65)});return this[_0x46a700(0x83)](_0x744a82);}async[_0x47bb59(0x1e5)](_0x231f43){const _0x5ec852=_0x47bb59,_0x40b51d={'ERFpT':_0x5ec852(0x1ad),'khuTM':'leaderboard','mMFzh':'version','TNkKU':function(_0x2afa7c,_0x4f0d97){return _0x2afa7c(_0x4f0d97);},'STrBd':'GET'};let _0xf62c03=_0x231f43?.['leaderboard']??this['defaultLeaderboard'],_0x5124b6=_0x231f43?.[_0x5ec852(0x1ad)]??-0x29*0xa9+0x7fb+0x1320,_0x2997bd=_0x231f43?.[_0x5ec852(0xb4)]??0x24aa+0x1252+-0x36fc,_0x2fc4e9=new URLSearchParams();_0x2fc4e9['set'](_0x40b51d[_0x5ec852(0xac)],String(Math[_0x5ec852(0x1e4)](_0x5124b6,0x19f6+0x1ef7+-0x3889))),_0x2fc4e9['set'](_0x5ec852(0xb4),String(_0x2997bd)),_0xf62c03&&_0x2fc4e9[_0x5ec852(0x88)](_0x40b51d[_0x5ec852(0x1c3)],_0xf62c03),_0x231f43?.[_0x5ec852(0x9a)]!==void(0xd*0x83+0x1af3+-0x219a)&&_0x2fc4e9[_0x5ec852(0x88)](_0x40b51d[_0x5ec852(0x185)],_0x40b51d[_0x5ec852(0x179)](String,_0x231f43[_0x5ec852(0x9a)]));let _0x42f5f5=this[_0x5ec852(0x8b)]+'/api/v1/leaderboard?'+_0x2fc4e9['toString'](),_0x26127f=await this[_0x5ec852(0xae)](_0x42f5f5,{'method':_0x40b51d[_0x5ec852(0x1dc)]});return this[_0x5ec852(0x197)](_0x26127f);}async[_0x47bb59(0x12c)](_0x240aeb){const _0x56d797=_0x47bb59,_0x1f7f9c={'JQGXL':_0x56d797(0x18a),'Skost':function(_0x2dabef,_0x1af492){return _0x2dabef(_0x1af492);},'qldhZ':'GET','eKOwX':function(_0x2448dd,_0x3e434f){return _0x2448dd===_0x3e434f;}};let _0x5223b4=_0x240aeb[_0x56d797(0x18a)]??this['defaultLeaderboard'],_0x771a89=new URLSearchParams();_0x5223b4&&_0x771a89[_0x56d797(0x88)](_0x1f7f9c[_0x56d797(0x11f)],_0x5223b4);let _0x35bd63=this[_0x56d797(0x8b)]+_0x56d797(0xf6)+_0x1f7f9c[_0x56d797(0x195)](encodeURIComponent,_0x240aeb[_0x56d797(0x1be)])+(_0x771a89['toString']()?'?'+_0x771a89['toString']():'');try{let _0xb9998d=await this[_0x56d797(0xae)](_0x35bd63,{'method':_0x1f7f9c['qldhZ']});return this['mapPlayerResponse'](_0xb9998d);}catch(_0x1f6983){if(_0x1f6983 instanceof d&&_0x1f7f9c[_0x56d797(0xe6)](_0x1f6983[_0x56d797(0x137)],_0x56d797(0xe8)))return null;throw _0x1f6983;}}async[_0x47bb59(0x15b)](_0x4ec18e){const _0x1caffe=_0x47bb59,_0x51d8af={'DpZZE':_0x1caffe(0x18a),'ZrhUf':function(_0x2810e7,_0x5b85b6){return _0x2810e7(_0x5b85b6);},'rBfwG':function(_0x55e3d2,_0x3c4480){return _0x55e3d2+_0x3c4480;},'oYkIy':_0x1caffe(0x132)};let _0x4bffa7=_0x4ec18e[_0x1caffe(0x18a)]??this['defaultLeaderboard'],_0x559698=new URLSearchParams();_0x4bffa7&&_0x559698[_0x1caffe(0x88)](_0x51d8af[_0x1caffe(0x157)],_0x4bffa7);let _0x408ef0=this[_0x1caffe(0x8b)]+'/api/v1/player/'+_0x51d8af[_0x1caffe(0xd9)](encodeURIComponent,_0x4ec18e[_0x1caffe(0x1be)])+(_0x559698[_0x1caffe(0x1f7)]()?_0x51d8af[_0x1caffe(0x1aa)]('?',_0x559698[_0x1caffe(0x1f7)]()):''),_0x8cf3ce=await this[_0x1caffe(0xae)](_0x408ef0,{'method':_0x51d8af[_0x1caffe(0x191)],'body':JSON[_0x1caffe(0x92)]({'player_name':_0x4ec18e[_0x1caffe(0xe9)]})});return this[_0x1caffe(0x1b9)](_0x8cf3ce);}async[_0x47bb59(0xea)](_0x3065ce){const _0x5e227b=_0x47bb59,_0xe671cd={'dmAyo':function(_0x4d1914,_0x3d023e){return _0x4d1914+_0x3d023e;},'JmtGd':_0x5e227b(0x95)};let _0x23055e=_0x3065ce[_0x5e227b(0x18a)]??this[_0x5e227b(0x1a3)],_0x1a8364=new URLSearchParams();_0x23055e&&_0x1a8364['set'](_0x5e227b(0x18a),_0x23055e);let _0x3d0189=this[_0x5e227b(0x8b)]+_0x5e227b(0xeb)+(_0x1a8364['toString']()?_0xe671cd['dmAyo']('?',_0x1a8364[_0x5e227b(0x1f7)]()):''),_0x42b994=await this['request'](_0x3d0189,{'method':_0xe671cd[_0x5e227b(0x1ee)],'body':JSON[_0x5e227b(0x92)]({'player_guid':_0x3065ce['playerGuid'],'player_name':_0x3065ce[_0x5e227b(0x171)]})});return this[_0x5e227b(0x152)](_0x42b994);}async['healthCheck'](){const _0x5997ef=_0x47bb59,_0x12c959={'jzdPy':function(_0x21f864,_0x5df324,_0x4ea7e8){return _0x21f864(_0x5df324,_0x4ea7e8);},'XViPK':_0x5997ef(0x13e),'UMeQF':_0x5997ef(0x1fe)};let _0x1a0621=this[_0x5997ef(0x8b)]+'/api/v1/health',_0x376f9=await _0x12c959['jzdPy'](fetch,_0x1a0621,{'method':_0x12c959[_0x5997ef(0x17b)],'headers':{'Accept':_0x12c959[_0x5997ef(0xf3)]}}),_0x2f72c6=await _0x376f9[_0x5997ef(0x149)]();if(!_0x2f72c6[_0x5997ef(0x1f3)])throw new d(_0x2f72c6[_0x5997ef(0x1e9)],_0x2f72c6[_0x5997ef(0x137)],_0x376f9['status']);return _0x2f72c6[_0x5997ef(0x19a)];}async['startRun'](_0x33614a){const _0x271e0b=_0x47bb59,_0x347551={'BSzPW':'leaderboard','HrZli':function(_0x2b2eb5,_0x4092d3){return _0x2b2eb5+_0x4092d3;},'OFxWk':function(_0x549161,_0xbc743c,_0x4918cf){return _0x549161(_0xbc743c,_0x4918cf);},'LZdwv':'X-Signature','TnUyP':_0x271e0b(0x95)};let _0x1a5b6b=_0x33614a['leaderboard']??this[_0x271e0b(0x1a3)],_0x49584f=new URLSearchParams();_0x1a5b6b&&_0x49584f['set'](_0x347551[_0x271e0b(0xa6)],_0x1a5b6b);let _0x130c38=this[_0x271e0b(0x8b)]+_0x271e0b(0x193)+(_0x49584f[_0x271e0b(0x1f7)]()?_0x347551['HrZli']('?',_0x49584f[_0x271e0b(0x1f7)]()):''),_0x5dc6d6=Date['now'](),_0x3c3819={'player_guid':_0x33614a[_0x271e0b(0x1be)],'timestamp':_0x5dc6d6},_0x46af89={};if(this[_0x271e0b(0x188)]){let _0x2fa5fa=await _0x347551['OFxWk'](R,{'playerGuid':_0x33614a[_0x271e0b(0x1be)],'timestamp':_0x5dc6d6},this['signingSecret']);_0x46af89[_0x347551[_0x271e0b(0x102)]]=_0x2fa5fa;}let _0x436cc4=await this[_0x271e0b(0xae)](_0x130c38,{'method':_0x347551[_0x271e0b(0xb7)],'body':JSON[_0x271e0b(0x92)](_0x3c3819),'headers':_0x46af89});return this[_0x271e0b(0x1bd)](_0x436cc4);}async[_0x47bb59(0x131)](_0x32642c){const _0x515ab2=_0x47bb59,_0x4ad22b={'xOPFd':_0x515ab2(0x18a),'HwCoY':function(_0x18e229,_0x54a30a){return _0x18e229+_0x54a30a;},'aQWEq':_0x515ab2(0x123),'rziQo':function(_0x10cf69,_0x59d48c,_0x32a88f){return _0x10cf69(_0x59d48c,_0x32a88f);},'LWPvA':'X-Signature','PbnbR':_0x515ab2(0x95)};let _0x3d0cb7=_0x32642c[_0x515ab2(0x18a)]??this[_0x515ab2(0x1a3)],_0x184624=new URLSearchParams();_0x3d0cb7&&_0x184624['set'](_0x4ad22b['xOPFd'],_0x3d0cb7);let _0x568c9a=this[_0x515ab2(0x8b)]+_0x515ab2(0x1ab)+(_0x184624[_0x515ab2(0x1f7)]()?_0x4ad22b['HwCoY']('?',_0x184624[_0x515ab2(0x1f7)]()):''),_0x1ce9b4=Date['now'](),_0x3d3541={'run_id':_0x32642c[_0x515ab2(0x1db)],'player_guid':_0x32642c['playerGuid'],'player_name':_0x32642c[_0x515ab2(0x171)],'score':_0x32642c[_0x515ab2(0xa3)],'timestamp':_0x1ce9b4,..._0x32642c[_0x515ab2(0x173)]&&{'metadata':_0x32642c['metadata']}},_0x5e7b40={};if(this[_0x515ab2(0x188)]){if(_0x4ad22b[_0x515ab2(0x94)]===_0x515ab2(0x123)){let _0x475a64=await _0x4ad22b[_0x515ab2(0x1a5)](R,{'playerGuid':_0x32642c[_0x515ab2(0x1be)],'timestamp':_0x1ce9b4,'score':_0x32642c[_0x515ab2(0xa3)],'runId':_0x32642c['runId']},this[_0x515ab2(0x188)]);_0x5e7b40[_0x4ad22b[_0x515ab2(0x199)]]=_0x475a64;}else try{_0x3775c0[_0x515ab2(0x150)](this[_0x515ab2(0x1e2)]);}catch{}}let _0xd9917a=await this[_0x515ab2(0xae)](_0x568c9a,{'method':_0x4ad22b[_0x515ab2(0xfd)],'body':JSON[_0x515ab2(0x92)](_0x3d3541),'headers':_0x5e7b40});return this[_0x515ab2(0xf4)](_0xd9917a);}['mapScoreResponse'](_0x52fad6){const _0x91f01e=_0x47bb59;return{'id':_0x52fad6['id'],'playerGuid':_0x52fad6[_0x91f01e(0x116)],'playerName':_0x52fad6[_0x91f01e(0x163)],'score':_0x52fad6['score'],'rank':_0x52fad6[_0x91f01e(0x189)],'isNewHighScore':_0x52fad6[_0x91f01e(0x1a9)]};}[_0x47bb59(0x197)](_0x56c7f5){const _0x31d092=_0x47bb59;return{'entries':_0x56c7f5[_0x31d092(0x169)][_0x31d092(0xd4)](_0x15a6c4=>({'rank':_0x15a6c4[_0x31d092(0x189)],'playerGuid':_0x15a6c4[_0x31d092(0x116)],'playerName':_0x15a6c4['player_name'],'score':_0x15a6c4[_0x31d092(0xa3)]})),'totalCount':_0x56c7f5[_0x31d092(0x113)],'resetSchedule':_0x56c7f5[_0x31d092(0x107)],'version':_0x56c7f5[_0x31d092(0x9a)],'oldestVersion':_0x56c7f5['oldest_version'],'nextReset':_0x56c7f5['next_reset']};}['mapPlayerResponse'](_0x12bb1e){const _0x58af7d=_0x47bb59;return{'id':_0x12bb1e['id'],'playerGuid':_0x12bb1e[_0x58af7d(0x116)],'playerName':_0x12bb1e[_0x58af7d(0x163)],'score':_0x12bb1e[_0x58af7d(0xa3)],'rank':_0x12bb1e[_0x58af7d(0x189)]};}[_0x47bb59(0x152)](_0x4788c9){const _0x70cdf1=_0x47bb59;return{'claimed':_0x4788c9['claimed'],'score':_0x4788c9['score'],'rank':_0x4788c9[_0x70cdf1(0x189)],'playerName':_0x4788c9['player_name']};}[_0x47bb59(0x1bd)](_0x46edac){const _0xa030e8=_0x47bb59;return{'runId':_0x46edac['run_id'],'startedAt':_0x46edac[_0xa030e8(0xcf)],'expiresAt':_0x46edac[_0xa030e8(0xc5)]};}[_0x47bb59(0xf4)](_0x3c616d){const _0x15ecea=_0x47bb59;return{'scoreId':_0x3c616d['score_id'],'rank':_0x3c616d[_0x15ecea(0x189)],'isNewHighScore':_0x3c616d[_0x15ecea(0x1a9)]};}async['request'](_0x5ac8df,_0x5d6737){const _0x50caa1=_0x47bb59,_0x3a89d1={'aBuEI':_0x50caa1(0x1fe),'nRBFh':function(_0x81012b,_0x352633,_0x524cd3){return _0x81012b(_0x352633,_0x524cd3);}};let _0x1c3ede={'Content-Type':'application/json','Accept':_0x3a89d1[_0x50caa1(0x1d0)],'X-API-Key':this[_0x50caa1(0x126)]},_0x282f76=await _0x3a89d1[_0x50caa1(0x12b)](fetch,_0x5ac8df,{..._0x5d6737,'headers':{..._0x1c3ede,..._0x5d6737[_0x50caa1(0x14d)]||{}}}),_0x1e1a13=await _0x282f76['json']();if(!_0x1e1a13['success'])throw new d(_0x1e1a13['error'],_0x1e1a13[_0x50caa1(0x137)],_0x282f76[_0x50caa1(0x1f1)]);return _0x1e1a13[_0x50caa1(0x19a)];}};y[_0x47bb59(0x100)]=_0x47bb59(0x129);var c=y,x=[_0x47bb59(0x1df),_0x47bb59(0x182),_0x47bb59(0x13c),_0x47bb59(0x144),_0x47bb59(0x14a),'Brisk',_0x47bb59(0x120),_0x47bb59(0x10f),_0x47bb59(0x1ff),_0x47bb59(0x17c),_0x47bb59(0x1ae),'Cloaked',_0x47bb59(0x118),_0x47bb59(0xbd),_0x47bb59(0x1b3),_0x47bb59(0x11a),_0x47bb59(0xd7),_0x47bb59(0x9d),'Electric',_0x47bb59(0xa9),_0x47bb59(0x1cc),_0x47bb59(0x1b8),_0x47bb59(0x1f8),_0x47bb59(0x97),_0x47bb59(0x168),'Furious',_0x47bb59(0x9e),'Glitchy',_0x47bb59(0x160),'Goofy','Gritty',_0x47bb59(0x1de),_0x47bb59(0x159),_0x47bb59(0x1fc),_0x47bb59(0x180),_0x47bb59(0x9f),_0x47bb59(0x124),_0x47bb59(0x1f9),_0x47bb59(0x18d),_0x47bb59(0x1b5),_0x47bb59(0x1a6),_0x47bb59(0xbe),'Lunar','Madcap',_0x47bb59(0x202),_0x47bb59(0xd6),_0x47bb59(0x10b),_0x47bb59(0x134),'Minty',_0x47bb59(0x11e),_0x47bb59(0x1d5),_0x47bb59(0x11c),_0x47bb59(0xc8),'Nuclear',_0x47bb59(0x201),'Orbital',_0x47bb59(0x1d1),'Phantom',_0x47bb59(0x151),_0x47bb59(0x167),_0x47bb59(0x13f),_0x47bb59(0x178),_0x47bb59(0x16f),_0x47bb59(0x1a8),_0x47bb59(0x11d),_0x47bb59(0x1b0),_0x47bb59(0x14e),_0x47bb59(0x140),_0x47bb59(0x90),_0x47bb59(0x15f),'Rowdy',_0x47bb59(0xbf),_0x47bb59(0xec),'Shiny',_0x47bb59(0x1da),_0x47bb59(0x143),'Skybound',_0x47bb59(0xa4),'Snappy',_0x47bb59(0xa0),'Sonic','Sparky',_0x47bb59(0x101),_0x47bb59(0x1c8),'Starry',_0x47bb59(0x200),_0x47bb59(0xe0),_0x47bb59(0xcc),_0x47bb59(0xbb),_0x47bb59(0xde),_0x47bb59(0x1a7),'Twilight','Ultra',_0x47bb59(0x1fb),_0x47bb59(0x138),'Wicked',_0x47bb59(0x122),_0x47bb59(0xf5),_0x47bb59(0xff),_0x47bb59(0x146)],A=[_0x47bb59(0xaa),_0x47bb59(0x12f),_0x47bb59(0x121),_0x47bb59(0xba),'Banshee',_0x47bb59(0x1ac),'Beetle','Blaster',_0x47bb59(0x135),'Boomer',_0x47bb59(0xcb),'Brawler',_0x47bb59(0x110),_0x47bb59(0xd3),_0x47bb59(0xef),_0x47bb59(0xee),_0x47bb59(0xad),_0x47bb59(0xaf),_0x47bb59(0x13b),_0x47bb59(0xf1),'Cobra','Comet',_0x47bb59(0x18b),_0x47bb59(0xf2),_0x47bb59(0xca),'Cyborg','Dagger',_0x47bb59(0x13d),_0x47bb59(0xed),_0x47bb59(0x145),_0x47bb59(0x111),_0x47bb59(0x161),_0x47bb59(0x142),'Eagle','Eel',_0x47bb59(0xc1),_0x47bb59(0x85),_0x47bb59(0x18c),_0x47bb59(0x127),'Fury',_0x47bb59(0x8d),_0x47bb59(0xf7),_0x47bb59(0x192),'Gladiator','Goblin',_0x47bb59(0x165),_0x47bb59(0x1d4),'Hawk',_0x47bb59(0xc2),'Hydra',_0x47bb59(0x1d7),_0x47bb59(0x17f),'Jester',_0x47bb59(0x1cd),_0x47bb59(0xf0),_0x47bb59(0xb2),'Katana','Kraken','Lancer',_0x47bb59(0x18d),_0x47bb59(0x87),_0x47bb59(0x8c),'Leopard',_0x47bb59(0x1c0),_0x47bb59(0x1b1),_0x47bb59(0xd2),_0x47bb59(0xe2),_0x47bb59(0x10b),_0x47bb59(0x128),'Monsoon',_0x47bb59(0x106),_0x47bb59(0x154),_0x47bb59(0xc8),_0x47bb59(0x10e),'Oracle',_0x47bb59(0x109),_0x47bb59(0x1a2),'Phoenix',_0x47bb59(0xdc),_0x47bb59(0x151),'Puma',_0x47bb59(0x84),_0x47bb59(0x1b6),_0x47bb59(0xdf),'Raven',_0x47bb59(0x9b),_0x47bb59(0x12e),_0x47bb59(0xc6),'Saber',_0x47bb59(0x175),'Shark','Spartan',_0x47bb59(0xe3),_0x47bb59(0x1fa),_0x47bb59(0x1a1),'Tiger',_0x47bb59(0x139),_0x47bb59(0x1d2),_0x47bb59(0xd5),_0x47bb59(0xf5)];function _0x1245(){const _0x1b7780=['yxbWBgLJyxrPB24VANnVBG','q2HLzwT5','u3rLywX0AhK','t21Lz2e','twfNAwm','z3vPzeTLEq','BwfWu2nVCMvszxnWB25Zzq','uxvHC2fY','rMvYCMv0','C3bSAxq','tgvNzw5K','C2v0','C3nYALu','AM9PBG','yxbPvxjS','tgvTDxi','r2f6zwXSzq','yxnABhu','z2v0t3jgzxrJAa','uMv0CM8','z2v0t3jdCMvHDgvqBgf5zxjoyw1L','C3rYAw5NAwz5','vw5RBM93BIbLCNjVCG','yvfxrxe','ue9tva','CMfUzg9Tvvvjra','rNjVC3r5','v2TXsMO','Aw5MBgLNAhq','DMvYC2LVBG','uMvHy3rVCG','CMv0CNLrDwv1zq','rhLUyw1PyW','r2fSywn0Awm','sMf6ENK','u29Syxi','CMvMCMvZAeLUqMfJA2DYB3vUza','C3vIC3rYAw5N','C2nVCMu','u2XPy2S','BMfTzuTLEq','qLn6ufC','ELbft2O','DM55D0G','rxbPyW','qwfYzhzHCMS','yuLhzKO','rvjgCfq','q2fYAwjVDq','CMvXDwvZDa','q2HHCMDLCG','nJaXntHzyxbsEuC','AgfZrxHWBgLJAxrqBgf5zxjoyw1L','s2fUz2fYB28','s3j2vMC','B2zMC2v0','D3HYzxO','zw5JB2rL','vg5vEva','zffKuxm','Bwf4qwDLtxm','qMfUzgL0','u3DPzNq','q21UBfO','q3jPBxnVBG','thvJA3K','u2f2ywDL','z2v0','rMfSy29U','sgvYBW','z2v0q3vYCMvUDfj1BKLK','AxnbDxrVr2vUzxjHDgvKtMfTzq','zxHWAxjLC19HDa','uM9UAw4','DunlsgG','tM92yq','mZC0otrNuu9xwwy','q295B3rL','qM90','u3vWCMvTzq','z2v0u3rHBgu','y2fJAgvKtgLTAxq','C3rHCNrLzf9HDa','y2XLyxi','CMf3','thLUEa','qNvMzMfSBW','BwfW','vMLWzxi','twfQzxn0Awm','rgL6ENK','CMv0CNK','wNjOvwy','ChjvveW','EKnZDg4','ugLYyxrL','se1bqW','vgH1BMrLCG','uMfWDg9Y','u3rVCM15','zhLjtwy','twf2zxjPy2S','u3bOAw54','vxrNBwm','rhHsExK','zuTpD1G','y2XPzw50','tK9ux0zpvu5e','BMv3tMfTzq','y2XHAw1ty29Yzq','l2fWAs92ms9JBgfPBq','u2HHzg93','rgLUBW','q2fWDgfPBG','q2fUBM9U','sMLUEa','q2HPBwvYyq','q291z2fY','vu1Luuy','BwfWrMLUAxnOuNvUuMvZCg9UC2u','v2L6yxjK','l2fWAs92ms9WBgf5zxiV','r2HVC3q','B3LWwNy','uuHkveG','tuTTAfu','ufjprKfosvrzx0rfvevdveve','A2vLCgvYyM9HCMrFCMv0CNLF','ugjUyLi','CgXHEwvYx25HBwvFyxv0BW','wMfWChK','revgqvvmvf9bueLFvvjm','u3bLzwr5','tfPKD3y','AxngCMvZAa','CMfUzg9T','D3Dqzhm','tw9VC2u','CMvZzxrFC2nOzwr1Bgu','y2f0y2G','t3r0zxi','vKH0sei','twv0zw9Y','zMv0y2HLzef0','C2v0ugXHEwvYr3vPza','t2n0B3b1CW','q2HHB3rPyW','qNvJy2fUzwvY','rhjPzNrLCG','zKPbr3y','Dg90ywXFy291BNq','z2v0q2XPzw50','y2fJAgu','CgXHEwvYx2D1Awq','A2v5uhjLzML4','q29ZBwLJ','BwvZC2fNzq','rgfZAgLUzW','mtnItfz2uLy','tMLTyMXL','uMfKAwfUDa','txLZDgLJ','sLfhweW','qNvIyMX5','qMfKz2vY','v2LSza','ALjwsvi','sM9SBhK','z2v0ugXHEwvYr3vPza','yxbPs2v5','rM94','tw9UA2v5','Ahr0Chm6lY9RzwvWzxjIB2fYzc52zxjJzwWUyxbW','ndu2qMrZwgLK','BLjcrMG','z2v0ugXHEwvYuMfUAW','mJy0AuXVAMTv','uM9JA2v0','qxn0zxjVAwq','AgfZugvUzgLUzW','zMLUAxnOuNvU','ufvu','su5LrgC','twLNAhr5','qMXVyG','C2v0sxrLBq','y29Kzq','v2fYCgvK','vgL0yw4','DfzHuum','q2HLzxrHAa','qMXHEMLUzW','rgvMzw5Kzxi','r0vu','ug9SAxnOzwq','uMvIzwW','zKX2txq','rhvJAW','u2TLDgnOEq','qM91BMn5','rhjHz29U','wMvZDhK','mteWoxLqsu5jvG','ywXS','ANnVBG','qNjHC3n5','otKYne9VqvDqtq','uNfTEha','AgvHzgvYCW','uMf6B3i','ntrhqLPvrvy','CMvTB3zLsxrLBq','ugL4zwW','BwfWq2XHAw1szxnWB25Zzq','AwrLBNrPDhK','tMLUAMe','zNjVBunOyxjdB2rL','BM93','rhbAwKu','zMv0y2HtBMfWC2HVDa','shLWzxi','DNjJEMi','DxbKyxrLugXHEwvYtMfTzq','vKTWq1K','DhjPBq','z2v0u25HChnOB3q','uM9NDwu','r29SzgvU','rhjVBMu','AgfZugvUzgLUz1nJB3jL','CgXHEwvYx25HBwu','mtb0rgTxq3u','r3jPzMzPBG','AxnozxDiAwDOu2nVCMu','ugXHC21H','rNvUA3K','zw50CMLLCW','DgLTzxn0yw1W','u090twq','zMXVB3i','ChvZAa','y2HHCKnVzgvbDa','uxvHBNr1Bq','Aw1WB3j0s2v5','CgXHEwvYtMfTzq','EhH4EhH4EhGTEhH4Ec00EhH4lxL4EhGTEhH4EhH4EhH4EhH4','Bwv0ywrHDge','Cu5ir0m','u2nVCNbPB24','AgfZswrLBNrPDhK','C2v0ugXHEwvYtMfTzq','uhjPBwfS','ve5Rs1u','u0Hblti1nG','wfzPueS','q2HPBgW','mJqXmtGZnMPHq2fqqq','r3vjwwm','sMfNDwfY','sw5REq','Eu9wCg8','qxn0CM8','wwL4uK4','zNjVBq','Bu1gEMG','odq5nJvPCfHQAge','BgvUz3rO','C2LNBMLUz1nLy3jLDa','CMfUAW','BgvHzgvYyM9HCMq','q29ZBw9Uyxv0','rMLYzwjHBgW','tgfZzxi','mJe0wNzIvNnM','vvDnsxa','C2XPy2u','B1LRsxK','r2L6Bw8','l2fWAs92ms9YDw5Zl3n0yxj0','C3vIDgXL','u2TVC3q','su9JzwG','BwfWtgvHzgvYyM9HCMrszxnWB25Zzq','AxntDwjTAxr0Aw5N','tfDqDKe','zgf0yq','q2jVq08','ywXSB3DLzfbHDhrLCM4','A1LXzuq','z0r3te8','v1LbyvK','CgfKu3rHCNq','u3rHBgXPB24','ugfUDgHLCG','zgvMyxvSDeXLywrLCMjVyxjK','CMvWBgfJzq','CNPPuw8','tg91za','vhvYyM8','uxvPy2S','AxnFBMv3x2HPz2HFC2nVCMu','CKjMD0C','l2fWAs92ms9YDw5Zl2zPBMLZAa','qMvHy29U','BgLTAxq','q2H1BMT5','AxPsqMG','uMfTCgfNAw5N','thvJAgfKB3i','z2v0ugXHEwvYtMfTzq','q3jPC3b5','CgfYC2u','tgvNzw5Kyxj5','uMfJzxi','CMv2zxjZzq','rMLLCNK','BwfWugXHEwvYuMvZCg9UC2u','uw5Wvgy','C2LNBG','zfztqNm','BwfWu3rHCNrsDw5szxnWB25Zzq','CgXHEwvYr3vPza','Bg9JywXtDg9YywDL','tgLVBG','u0n2Cem','C3rHCNrcywnRz3jVDw5KrMv0y2G','A2H1ve0','DfvZz2q','mJq2tLzwrgjQ','BMzAvKK','DMvLsNG','u3bPA3K','z0X6she','BvPcs2K','wNPVrwW','rMvPC3r5','sMv0CgfJAW','BwLUtgvUz3rO','BMfTzuf1Dg9lzxK','yuj1ruK','ugvWChK','vMLRAw5N','u0r0zw8','sgfTBwvY','tMvVBG','Aw52ywXPzgf0zq','swD1yw5H','ChjLzMv0y2G','y3vYCMvUDfj1BKLK','u2LSBhK','CNvUswq','u1rYqMq','tM8Gywn0AxzLihj1BI4Gq2fSBcbZDgfYDfj1BIGPigzPCNn0lG','r3jVB3z5','qxjJyw5L','vxfKCue','AxndDxjYzw50ugXHEwvY','C3rVCMfNzuTLEq','otm0nJHTueLpuhy','BwLU','z2v0tgvHzgvYyM9HCMq','DhrStxm','rLvQy2G','CujOwwG','zxjYB3i','yxv0sgi','yKfwrgK','z2vUzxjHDgvvvuLe','z2v0t3jdCMvHDgvqBgf5zxjhDwLK','sM10r2q','rgrurwu','AuPurgm','C3rHDhvZ','yNPYrKG','C3vJy2vZCW','z2v0sxrLBq','Dhj1zq','CgvUzgLUz1jLzNjLC2G','Dg9tDhjPBMC','rMXHC2H5','sNvTChK','u3bYAw50zxi','vMLICMfUDa','swn5','C3vIBwL0u2nVCMu'];_0x1245=function(){return _0x1b7780;};return _0x1245();}function f(){const _0x5b99a1=_0x47bb59,_0x2b6d33={'nfZVI':function(_0x39a1dc,_0x507d31){return _0x39a1dc*_0x507d31;},'rygqU':function(_0x2ff6a2,_0x46e6a){return _0x2ff6a2+_0x46e6a;},'iJTDc':function(_0x4ce49a,_0xea59db){return _0x4ce49a*_0xea59db;},'UqdqA':function(_0x1c8ab9,_0x59d29c){return _0x1c8ab9+_0x59d29c;}};let _0xdd2117=x[Math[_0x5b99a1(0x16c)](Math[_0x5b99a1(0x104)]()*x['length'])],_0x367d74=A[Math[_0x5b99a1(0x16c)](_0x2b6d33[_0x5b99a1(0x1c6)](Math[_0x5b99a1(0x104)](),A['length']))],_0x2d0023=_0x2b6d33['rygqU'](Math[_0x5b99a1(0x16c)](_0x2b6d33[_0x5b99a1(0x1f0)](Math['random'](),-0x94+-0x14c3+0x15ba)),-0x12da+-0xea+0x13c5);return''+_0x2b6d33[_0x5b99a1(0x1e0)](_0xdd2117,_0x367d74)[_0x5b99a1(0x190)](0x20f1+-0x9f3+-0x16fe,-0xd51+-0x6ee+0x1449*0x1)+_0x2d0023;}var N='keeperboard_',p=class{constructor(_0xe479eb={}){const _0x52a08=_0x47bb59;this['keyPrefix']=_0xe479eb[_0x52a08(0x117)]??N,this[_0x52a08(0x203)]=this[_0x52a08(0x117)]+'player_guid',this[_0x52a08(0xa5)]=this[_0x52a08(0x117)]+_0x52a08(0x163),this[_0x52a08(0x1cf)]=this[_0x52a08(0x117)]+_0x52a08(0xfe);}[_0x47bb59(0x125)](){const _0x409a9d=_0x47bb59,_0x11e0b5={'dVSBs':function(_0x488b1e,_0x513cd9){return _0x488b1e>_0x513cd9;}};return _0x11e0b5[_0x409a9d(0x1bc)](typeof window,'u')||!window['localStorage']?null:localStorage[_0x409a9d(0x1f4)](this[_0x409a9d(0x203)]);}[_0x47bb59(0x10d)](_0x229c6c){const _0x23af00=_0x47bb59,_0x259b39={'yOVpo':function(_0x3e1249,_0xa6ff9b){return _0x3e1249>_0xa6ff9b;}};_0x259b39[_0x23af00(0x181)](typeof window,'u')||!window[_0x23af00(0x1bf)]||localStorage['setItem'](this[_0x23af00(0x203)],_0x229c6c);}['getOrCreatePlayerGuid'](){const _0x1408b9=_0x47bb59;let _0x115a23=this['getPlayerGuid']();return _0x115a23||(_0x115a23=this[_0x1408b9(0x1ec)](),this[_0x1408b9(0x10d)](_0x115a23)),_0x115a23;}['getPlayerName'](){const _0x2670b8=_0x47bb59,_0xf7b14f={'aIGfJ':function(_0x2a4c6f,_0x3a11ab){return _0x2a4c6f>_0x3a11ab;}};return _0xf7b14f[_0x2670b8(0xab)](typeof window,'u')||!window[_0x2670b8(0x1bf)]?null:localStorage[_0x2670b8(0x1f4)](this[_0x2670b8(0xa5)]);}[_0x47bb59(0x177)](_0x11a4e4){const _0xe18eba=_0x47bb59;typeof window>'u'||!window[_0xe18eba(0x1bf)]||(localStorage[_0xe18eba(0x136)](this[_0xe18eba(0xa5)],_0x11a4e4),localStorage['removeItem'](this[_0xe18eba(0x1cf)]));}[_0x47bb59(0x91)](){const _0x2ee6ea=_0x47bb59,_0x518936={'fLvMt':function(_0x3e61a4){return _0x3e61a4();},'TYROJ':function(_0x3e9f43,_0x3ddb70){return _0x3e9f43<_0x3ddb70;},'qBhYh':_0x2ee6ea(0x1f5)};let _0x118425=this[_0x2ee6ea(0x1b2)]();return _0x118425||(_0x118425=_0x518936[_0x2ee6ea(0x141)](f),_0x518936['TYROJ'](typeof window,'u')&&window[_0x2ee6ea(0x1bf)]&&(localStorage[_0x2ee6ea(0x136)](this[_0x2ee6ea(0xa5)],_0x118425),localStorage[_0x2ee6ea(0x136)](this[_0x2ee6ea(0x1cf)],_0x518936[_0x2ee6ea(0x1e8)]))),_0x118425;}[_0x47bb59(0xc4)](){const _0x5f104d=_0x47bb59,_0x3198a8={'ZzoEl':function(_0x518459,_0x36374d){return _0x518459>_0x36374d;},'FaOgI':function(_0xa1ea7d,_0x4587e2){return _0xa1ea7d===_0x4587e2;},'bAVDi':_0x5f104d(0x1f5)};return _0x3198a8[_0x5f104d(0x1cb)](typeof window,'u')||!window[_0x5f104d(0x1bf)]?!(0x24ac+0x1*-0x15f5+0xeb6*-0x1):_0x3198a8['FaOgI'](localStorage[_0x5f104d(0x1f4)](this['nameAutoKey']),_0x3198a8[_0x5f104d(0x1eb)]);}['clear'](){const _0x540a04=_0x47bb59,_0x12f34a={'RPeHr':function(_0x9f4088,_0xddf02b){return _0x9f4088>_0xddf02b;}};_0x12f34a['RPeHr'](typeof window,'u')||!window[_0x540a04(0x1bf)]||(localStorage[_0x540a04(0x150)](this['guidKey']),localStorage[_0x540a04(0x150)](this['nameKey']),localStorage['removeItem'](this['nameAutoKey']));}[_0x47bb59(0x176)](){const _0x25e469=_0x47bb59,_0x20f15c={'veeJx':function(_0x431454,_0x2bb41c){return _0x431454!==_0x2bb41c;}};return _0x20f15c[_0x25e469(0x1c7)](this[_0x25e469(0x125)](),null);}[_0x47bb59(0x1ec)](){const _0x135748=_0x47bb59,_0x535968={'autHb':function(_0x3ffdfe,_0x2fc308){return _0x3ffdfe|_0x2fc308;},'wxrez':function(_0x393289,_0x3a5662){return _0x393289*_0x3a5662;},'CmnlZ':function(_0x215946,_0x398c55){return _0x215946===_0x398c55;},'bzrFH':function(_0x2eb050,_0xd7a47a){return _0x2eb050|_0xd7a47a;},'IOceh':function(_0x1a21f2,_0x1db38d){return _0x1a21f2&_0x1db38d;},'SOtMd':function(_0x36fea4,_0x4ed96e){return _0x36fea4<_0x4ed96e;},'QHJTH':_0x135748(0x172)};return _0x535968[_0x135748(0x16b)](typeof crypto,'u')&&crypto[_0x135748(0x96)]?crypto['randomUUID']():_0x535968[_0x135748(0xf9)][_0x135748(0x1a4)](/[xy]/g,_0x50698d=>{const _0x48db22=_0x135748;let _0x3e8633=_0x535968[_0x48db22(0x1ea)](_0x535968[_0x48db22(0xb5)](Math[_0x48db22(0x104)](),0x3*-0x927+0x175a+0x42b*0x1),0x1*0x1499+-0x42a*-0x3+-0x2117);return(_0x535968[_0x48db22(0xbc)](_0x50698d,'x')?_0x3e8633:_0x535968[_0x48db22(0x1f2)](_0x535968[_0x48db22(0x196)](_0x3e8633,-0x143d+-0xd8*0x8+-0x6*-0x480),0x5*-0x625+-0x678+0x2539))['toString'](0x12a*0x1f+-0x1*0x17fc+0x43*-0x2e);});}},h=class{constructor(_0x1a3ee4){const _0x23847d=_0x47bb59;this[_0x23847d(0x10c)]=0x1f45+-0xe44+-0x1*0x1101,this[_0x23847d(0x99)]=null,this[_0x23847d(0x1f6)]=null,this['ttlMs']=_0x1a3ee4;}async['getOrFetch'](_0x461454){const _0x45c386=_0x47bb59;return this[_0x45c386(0x103)]()?this[_0x45c386(0x19a)]:this[_0x45c386(0x99)]?this[_0x45c386(0x99)]:(this[_0x45c386(0x99)]=_0x461454()['then'](_0x31872f=>(this[_0x45c386(0x19a)]=_0x31872f,this[_0x45c386(0x10c)]=Date['now'](),this[_0x45c386(0x99)]=null,_0x31872f))[_0x45c386(0x108)](_0x5487a0=>{const _0x3a8569=_0x45c386;throw this[_0x3a8569(0x99)]=null,_0x5487a0;}),this[_0x45c386(0x99)]);}[_0x47bb59(0xa1)](_0x106ed5){const _0x2ecb88=_0x47bb59;if(this['inflight']){this[_0x2ecb88(0x1f6)]=_0x106ed5;return;}this['startBackgroundFetch'](_0x106ed5);}[_0x47bb59(0x1c2)](_0x4ab343){const _0x19680f=_0x47bb59,_0x2cd124={'ssrjU':function(_0x42fb20,_0x1a563e){return _0x42fb20===_0x1a563e;},'dyIMf':_0x19680f(0x1d3),'vnywH':_0x19680f(0x105),'MKmhU':function(_0x2ef8eb){return _0x2ef8eb();}};this[_0x19680f(0x99)]=_0x2cd124[_0x19680f(0xfa)](_0x4ab343)['then'](_0x421684=>{const _0x562b7f=_0x19680f;if(this[_0x562b7f(0x19a)]=_0x421684,this[_0x562b7f(0x10c)]=Date[_0x562b7f(0x156)](),this[_0x562b7f(0x99)]=null,this[_0x562b7f(0x1f6)]){if(_0x2cd124[_0x562b7f(0x89)](_0x2cd124[_0x562b7f(0xe1)],_0x2cd124[_0x562b7f(0xa8)]))return this['isFresh']()?this[_0x562b7f(0x19a)]:void(0x1*0xd50+0x2037+0x2d87*-0x1);else{let _0x499d23=this['pendingRefresh'];this[_0x562b7f(0x1f6)]=null,this[_0x562b7f(0x1c2)](_0x499d23);}}return _0x421684;})['catch'](_0x719643=>{const _0x811ea9=_0x19680f;throw this[_0x811ea9(0x99)]=null,this[_0x811ea9(0x1f6)]=null,_0x719643;}),this[_0x19680f(0x99)][_0x19680f(0x108)](()=>{});}[_0x47bb59(0x1d6)](){const _0x2ffeb5=_0x47bb59;this[_0x2ffeb5(0x10c)]=-0x24bf+-0x1f82+-0x1*-0x4441;}['get'](){const _0x216ef7=_0x47bb59;return this['isFresh']()?this[_0x216ef7(0x19a)]:void(-0x1d0*0x1+0x1514+-0x112*0x12);}[_0x47bb59(0xcd)](){const _0x241d11=_0x47bb59;return this[_0x241d11(0x19a)];}[_0x47bb59(0x103)](){const _0x1e4d10=_0x47bb59;return this['data']!==void(-0x1*0xf1+0x9*0x333+0x592*-0x5)&&Date[_0x1e4d10(0x156)]()-this[_0x1e4d10(0x10c)]<this[_0x1e4d10(0x1e6)];}},m=class{constructor(_0x5b16e4,_0x3de3dd=0x664003a+-0xdf6d*0x3e1+0x1cd*0x130df){const _0x4e43ff=_0x47bb59;this['storageKey']=_0x5b16e4,this[_0x4e43ff(0xb9)]=_0x3de3dd;}['save'](_0x3818b7,_0x49ae68){const _0x1decf7=_0x47bb59;try{let _0x51bb9c={'score':_0x3818b7,'metadata':_0x49ae68,'timestamp':Date[_0x1decf7(0x156)]()};localStorage[_0x1decf7(0x136)](this[_0x1decf7(0x1e2)],JSON[_0x1decf7(0x92)](_0x51bb9c));}catch{}}[_0x47bb59(0xc0)](){const _0x2a03e2=_0x47bb59,_0x5760d5={'DgQPG':function(_0x47c986,_0xe489eb){return _0x47c986>_0xe489eb;},'UWMIp':function(_0x2da016,_0x2c36b9){return _0x2da016-_0x2c36b9;},'FUjch':'wKsbr','WbiFC':_0x2a03e2(0x17e)};try{let _0x2ca9a1=localStorage['getItem'](this['storageKey']);if(!_0x2ca9a1)return null;let _0x215f1b=JSON[_0x2a03e2(0x1b4)](_0x2ca9a1);return _0x5760d5['DgQPG'](_0x5760d5[_0x2a03e2(0x18f)](Date[_0x2a03e2(0x156)](),_0x215f1b[_0x2a03e2(0x16a)]),this['maxAgeMs'])?(this[_0x2a03e2(0xd0)](),null):{'score':_0x215f1b[_0x2a03e2(0xa3)],'metadata':_0x215f1b[_0x2a03e2(0x173)]};}catch{if(_0x5760d5[_0x2a03e2(0x1e7)]!==_0x5760d5['WbiFC'])return null;else this[_0x2a03e2(0x153)]['setPlayerName'](_0x2c579a);}}[_0x47bb59(0x130)](){const _0x3d679e=_0x47bb59,_0x209446={'Utgmc':function(_0x680f4b,_0x5ba7ab){return _0x680f4b!==_0x5ba7ab;}};return _0x209446[_0x3d679e(0xe4)](this[_0x3d679e(0xc0)](),null);}[_0x47bb59(0xd0)](){try{localStorage['removeItem'](this['storageKey']);}catch{}}},k={'minLength':0x2,'maxLength':0xc,'allowedPattern':/[^A-Za-z0-9_ ]/g};function S(_0xaf9496,_0x523a20){const _0x5513ef=_0x47bb59;let _0x521e80={...k,..._0x523a20},_0x430768=_0xaf9496[_0x5513ef(0x15d)](),_0x4ef487=_0x523a20?.[_0x5513ef(0x19c)]??/[^A-Za-z0-9_ ]/g;return _0x430768=_0x430768[_0x5513ef(0x1a4)](_0x4ef487,''),_0x430768=_0x430768['replace'](/ +/g,'\x20')[_0x5513ef(0x15d)](),_0x430768=_0x430768[_0x5513ef(0xa2)](-0x2f8*0x2+0x1c7a+-0x168a,_0x521e80['maxLength']),_0x430768[_0x5513ef(0x187)]<_0x521e80[_0x5513ef(0x1ce)]?null:_0x430768;}var b=class{constructor(_0x3d423d){const _0x41fc0e=_0x47bb59;this[_0x41fc0e(0xce)]=0x19e8+-0x1*-0x20fd+0x3ae5*-0x1,this[_0x41fc0e(0x198)]=!(0x1663+-0x2*-0x287+-0x4*0x6dc),this[_0x41fc0e(0x1d9)]=null,(this[_0x41fc0e(0xe7)]=new c({'apiKey':_0x3d423d[_0x41fc0e(0x126)],'defaultLeaderboard':_0x3d423d[_0x41fc0e(0x18a)],'signingSecret':_0x3d423d[_0x41fc0e(0x188)],'apiUrl':_0x3d423d['apiUrl']}),this[_0x41fc0e(0x153)]=new p(_0x3d423d['identity']),this[_0x41fc0e(0x18a)]=_0x3d423d[_0x41fc0e(0x18a)],this[_0x41fc0e(0x115)]=_0x3d423d[_0x41fc0e(0x115)]?new h(_0x3d423d[_0x41fc0e(0x115)]['ttlMs']):null,this[_0x41fc0e(0x9c)]=_0x3d423d[_0x41fc0e(0xd8)]?new m(_0x41fc0e(0xfc)+_0x3d423d[_0x41fc0e(0x18a)],_0x3d423d[_0x41fc0e(0xd8)]['maxAgeMs']):null);}[_0x47bb59(0x125)](){const _0x265ff2=_0x47bb59;return this[_0x265ff2(0x153)][_0x265ff2(0x1ed)]();}[_0x47bb59(0x1b2)](){const _0x19bedf=_0x47bb59;return this['identity'][_0x19bedf(0x91)]();}['setPlayerName'](_0x164e81){const _0x203e7e=_0x47bb59;this['identity'][_0x203e7e(0x177)](_0x164e81);}[_0x47bb59(0xb1)](){const _0x3c5ffc=_0x47bb59,_0x236f24={'tUsgd':function(_0x32409e,_0x50c809){return _0x32409e!==_0x50c809;}};return _0x236f24[_0x3c5ffc(0x1c4)](this[_0x3c5ffc(0x153)][_0x3c5ffc(0x1b2)](),null)&&!this[_0x3c5ffc(0x153)]['isAutoGeneratedName']();}['validateName'](_0x1d0e37,_0x411d44){const _0x3b59df=_0x47bb59,_0x16b56f={'WYAaY':function(_0x35de06,_0x227b5d,_0x4e8a04){return _0x35de06(_0x227b5d,_0x4e8a04);}};return _0x16b56f[_0x3b59df(0x19f)](S,_0x1d0e37,_0x411d44);}async['submitScore'](_0x4fbbeb,_0x57f854){const _0x32bf42=_0x47bb59,_0x144453={'oypZv':function(_0x56617b,_0x3f3a48){return _0x56617b>_0x3f3a48;},'dXVji':'Submission\x20in\x20progress','KrvVg':function(_0x49641f,_0x57f8ca){return _0x49641f!==_0x57f8ca;},'knxsA':_0x32bf42(0x174),'gLzHq':function(_0x3934ad,_0xcc942c){return _0x3934ad instanceof _0xcc942c;},'WkqJj':function(_0x1f36c0,_0x199b95){return _0x1f36c0!==_0x199b95;},'prUTL':_0x32bf42(0xfb),'CboCO':function(_0x885266,_0x1d16ce){return _0x885266===_0x1d16ce;},'fJAGv':_0x32bf42(0x1af)};if(this['isSubmitting'])return{'success':!(-0x1f0*-0xb+0x26b3+-0x3c02),'error':_0x144453['dXVji']};this[_0x32bf42(0x198)]=!(-0x80e+-0x35a+0xb68);try{let _0x52a4c3=await this['client'][_0x32bf42(0x1fd)]({'playerGuid':this['getPlayerGuid'](),'playerName':this[_0x32bf42(0x1b2)](),'score':_0x4fbbeb,'metadata':_0x57f854});return this['retryQueue']?.[_0x32bf42(0xd0)](),this['cache']&&(this[_0x32bf42(0x115)]['invalidate'](),this['cachedLimit']=-0x25*0x1b+0x653*-0x5+0x2386,this[_0x32bf42(0x115)][_0x32bf42(0xa1)](()=>this[_0x32bf42(0x158)]())),{'success':!(-0x1355+0x2ce+0x1087),'rank':_0x52a4c3[_0x32bf42(0x189)],'isNewHighScore':_0x52a4c3[_0x32bf42(0x166)]};}catch(_0x4ccd26){if(_0x144453[_0x32bf42(0xb3)](_0x144453['knxsA'],'tRaBo')){let _0xf06a9e=_0x144453[_0x32bf42(0x1c9)](_0x4ccd26,d)?_0x4ccd26['code']:void(-0x3ca+-0x56d+0x937);return _0x144453[_0x32bf42(0x98)](_0xf06a9e,_0x144453[_0x32bf42(0xda)])&&this[_0x32bf42(0x9c)]?.['save'](_0x4fbbeb,_0x57f854),{'success':!(-0xe08+-0x1*0x1d87+0x2b90),'error':_0x4ccd26 instanceof Error?_0x4ccd26[_0x32bf42(0x119)]:_0x32bf42(0x93),'errorCode':_0xf06a9e};}else return GHlfAW[_0x32bf42(0xf8)](typeof _0x309471,'u')||!_0x285c9c[_0x32bf42(0x1bf)]?null:_0x41e59f['getItem'](this[_0x32bf42(0x203)]);}finally{if(_0x144453[_0x32bf42(0x19b)](_0x144453[_0x32bf42(0x112)],_0x32bf42(0x1af)))this[_0x32bf42(0x198)]=!(0x1b4*-0xb+-0x2377+-0x1b1a*-0x2);else{let _0xcb857e=this[_0x32bf42(0x125)]();return _0xcb857e||(_0xcb857e=this['generateUUID'](),this[_0x32bf42(0x10d)](_0xcb857e)),_0xcb857e;}}}async['startRun'](){const _0x465f7a=_0x47bb59;let _0x19566b=await this[_0x465f7a(0xe7)]['startRun']({'playerGuid':this[_0x465f7a(0x125)]()});return this[_0x465f7a(0x1d9)]=_0x19566b[_0x465f7a(0x1db)],_0x19566b;}async[_0x47bb59(0x131)](_0x27a79d,_0x120a4c){const _0x366cc9=_0x47bb59,_0x72a0c1={'kYqeD':_0x366cc9(0x1dd)};if(!this[_0x366cc9(0x1d9)])throw new Error(_0x72a0c1[_0x366cc9(0x19d)]);let _0x21e0a0=await this[_0x366cc9(0xe7)][_0x366cc9(0x131)]({'runId':this['currentRunId'],'playerGuid':this[_0x366cc9(0x125)](),'playerName':this[_0x366cc9(0x1b2)](),'score':_0x27a79d,'metadata':_0x120a4c});return this[_0x366cc9(0x1d9)]=null,this['cache']&&(this[_0x366cc9(0x115)][_0x366cc9(0x1d6)](),this[_0x366cc9(0xce)]=-0x26cb*-0x1+0xb*0x102+0x1*-0x31e1,this[_0x366cc9(0x115)]['refreshInBackground'](()=>this[_0x366cc9(0x158)]())),_0x21e0a0;}['hasActiveRun'](){const _0x4c831f=_0x47bb59;return this[_0x4c831f(0x1d9)]!==null;}[_0x47bb59(0xc3)](){return this['currentRunId'];}async[_0x47bb59(0x15e)](_0x4ae751){const _0x13a69e=_0x47bb59,_0x27753e={'Rqmxp':function(_0xa2bd56,_0xbe2aec){return _0xa2bd56>_0xbe2aec;}};let _0x3f37b1=_0x4ae751?.[_0x13a69e(0x1ad)]??0x1ee2+0x5*-0x647+0x8b;if(this[_0x13a69e(0x115)]){_0x27753e[_0x13a69e(0x14c)](_0x3f37b1,this[_0x13a69e(0xce)])&&this[_0x13a69e(0x115)]['invalidate']();let _0x4a44c0=await this[_0x13a69e(0x115)][_0x13a69e(0x8f)](()=>this[_0x13a69e(0x158)](_0x3f37b1));return this[_0x13a69e(0xce)]=_0x3f37b1,_0x4a44c0;}return this[_0x13a69e(0x158)](_0x3f37b1);}async[_0x47bb59(0x15b)](_0x19c5e4){const _0x248b1e=_0x47bb59,_0x1cd4af={'YixRN':function(_0x203d77,_0x2e71ac){return _0x203d77!==_0x2e71ac;},'uCKHh':_0x248b1e(0xa7),'QnpTf':function(_0x2f8606,_0x23997b){return _0x2f8606 instanceof _0x23997b;},'zCstn':_0x248b1e(0x93)};try{return await this[_0x248b1e(0xe7)][_0x248b1e(0x15b)]({'playerGuid':this[_0x248b1e(0x125)](),'newName':_0x19c5e4}),this[_0x248b1e(0x153)][_0x248b1e(0x177)](_0x19c5e4),this['cache']&&(this[_0x248b1e(0x115)]['invalidate'](),this[_0x248b1e(0xce)]=-0x2365+0x48+0x231d*0x1),{'success':!(0x1*0x16ec+-0x11aa+-0x542)};}catch(_0xf6a33f){if(_0x1cd4af[_0x248b1e(0x183)](_0x1cd4af[_0x248b1e(0xc7)],_0x1cd4af[_0x248b1e(0xc7)]))this['keyPrefix']=_0x146836[_0x248b1e(0x117)]??_0x351830,this[_0x248b1e(0x203)]=this[_0x248b1e(0x117)]+_0x248b1e(0x116),this['nameKey']=this[_0x248b1e(0x117)]+'player_name',this['nameAutoKey']=this[_0x248b1e(0x117)]+'player_name_auto';else{let _0x4d17c6=_0x1cd4af[_0x248b1e(0x1ba)](_0xf6a33f,d)?_0xf6a33f['code']:void(-0x560+0x1a11+0x14b1*-0x1);return{'success':!(-0x2*0x80e+0x25*-0x28+-0x5f*-0x3b),'error':_0x1cd4af[_0x248b1e(0x1ba)](_0xf6a33f,Error)?_0xf6a33f[_0x248b1e(0x119)]:_0x1cd4af[_0x248b1e(0xdb)],'errorCode':_0x4d17c6};}}}async['retryPendingScore'](){const _0x4d3e64=_0x47bb59;let _0x4a8e63=this['retryQueue']?.[_0x4d3e64(0xc0)]();if(!_0x4a8e63)return null;let _0x442cff=await this['submitScore'](_0x4a8e63[_0x4d3e64(0xa3)],_0x4a8e63[_0x4d3e64(0x173)]);return _0x442cff['success']&&this[_0x4d3e64(0x9c)]?.[_0x4d3e64(0xd0)](),_0x442cff;}[_0x47bb59(0x162)](){const _0x2fc0b2=_0x47bb59;return this[_0x2fc0b2(0x9c)]?.[_0x2fc0b2(0x130)]()??!(0x19e7+-0x1e75+-0x3*-0x185);}[_0x47bb59(0x1d8)](){const _0x23a8f3=_0x47bb59;this[_0x23a8f3(0x115)]&&(this['cache'][_0x23a8f3(0x103)]()||this[_0x23a8f3(0x115)][_0x23a8f3(0xa1)](()=>this[_0x23a8f3(0x158)]()));}[_0x47bb59(0x114)](){const _0x5f0d54=_0x47bb59;return this[_0x5f0d54(0xe7)];}async[_0x47bb59(0x158)](_0x61cfe7=0x2611+-0x5*-0x3e9+-0x3994){const _0x595048=_0x47bb59,_0x559e50={'INeDg':function(_0x2b72e5,_0x1ab055){return _0x2b72e5&&_0x1ab055;}};let _0x4c72bb=this['getPlayerGuid'](),[_0xba288c,_0x1c943d]=await Promise[_0x595048(0x148)]([this[_0x595048(0xe7)][_0x595048(0x1e5)]({'limit':_0x61cfe7}),this[_0x595048(0xe7)][_0x595048(0x12c)]({'playerGuid':_0x4c72bb})]),_0x2112b4=_0xba288c['entries'][_0x595048(0xd4)](_0x16f73b=>({'rank':_0x16f73b[_0x595048(0x189)],'playerGuid':_0x16f73b[_0x595048(0x1be)],'playerName':_0x16f73b['playerName'],'score':_0x16f73b[_0x595048(0xa3)],'isCurrentPlayer':_0x16f73b['playerGuid']===_0x4c72bb})),_0x35e9c1=_0x2112b4['some'](_0x44a239=>_0x44a239[_0x595048(0x1e1)]),_0x12d826=_0x559e50[_0x595048(0x133)](_0x1c943d,!_0x35e9c1)?_0x1c943d:null;return{'entries':_0x2112b4,'totalCount':_0xba288c['totalCount'],'playerRank':_0x12d826};}};export{h as Cache,c as KeeperBoardClient,d as KeeperBoardError,b as KeeperBoardSession,p as PlayerIdentity,m as RetryQueue,f as generatePlayerName,S as validateName};