@betorigami/game-ui-wheel 1.0.3 → 1.1.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 +301 -305
- package/dist/standalone.mjs +6414 -6189
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { genCorrelationId as
|
|
2
|
-
import { css as
|
|
3
|
-
import { Wheel as
|
|
4
|
-
import { cache as
|
|
5
|
-
import { property as
|
|
1
|
+
import { genCorrelationId as ge, resolveApiErrorCode as ce, getTranslation as g, errorCodeToTranslationKey as ue, ErrorCode as K, createMockGenerator as pe, OrigamiActionType as ee, noiseClick as me, gameContext as R, OrigamiElement as C, componentStyles as L, watch as se, DEFAULT_CURRENCY as q, formatMonetaryAmount as de, DEFAULT_LANGUAGE as W, getCurrencyIcon as fe, OrigamiGame as X, InvalidReason as ye, GameComponent as ie, HotkeyController as be, HotkeyHelper as te, waitForEvent as ve, formatAutobetSettings as we, getGameOutcome as Se, calculateGameLayoutStyle as _e, isEndAction as $e } from "@betorigami/game-ui-shared";
|
|
2
|
+
import { css as I, svg as Y, nothing as Z, html as l, LitElement as ke } from "lit";
|
|
3
|
+
import { Wheel as De, WheelRiskLevel as u, WheelSegments as N, getWheelPattern as xe, getWheelSegmentMultipliers as Ee, describeWheelOutcomes as Ae, isWheelRiskLevel as re, isWheelSegments as ae, WHEEL_RISK_LEVELS as Ie, WHEEL_SEGMENT_OPTIONS as Me, getWheelMaxMultiplier as oe } from "@betorigami/game-wheel";
|
|
4
|
+
import { cache as Pe } from "lit/directives/cache.js";
|
|
5
|
+
import { property as n, customElement as k, query as J, state as v } from "lit/decorators.js";
|
|
6
6
|
import f from "big.js";
|
|
7
|
-
import { sumPayout as
|
|
7
|
+
import { sumPayout as Oe } from "@betorigami/game-engine";
|
|
8
8
|
import { consume as U } from "@lit/context";
|
|
9
|
-
import { styleMap as
|
|
10
|
-
const
|
|
9
|
+
import { styleMap as Ce } from "lit/directives/style-map.js";
|
|
10
|
+
const Te = {
|
|
11
11
|
overview: {
|
|
12
12
|
translation: {
|
|
13
13
|
key: "gameInfo.wheel.overview",
|
|
@@ -48,7 +48,7 @@ const Pe = {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
class
|
|
51
|
+
class G {
|
|
52
52
|
/**
|
|
53
53
|
* Calculate exact target angle for a segment with pseudorandom position
|
|
54
54
|
* @param segmentIndex - Index of winning segment (0-based)
|
|
@@ -56,9 +56,9 @@ class K {
|
|
|
56
56
|
* @param betId - UUID to seed random position
|
|
57
57
|
* @returns Target angle in degrees (0-360)
|
|
58
58
|
*/
|
|
59
|
-
static calculateTargetAngle(e, i,
|
|
60
|
-
const s = 360 / i,
|
|
61
|
-
return ((360 - (
|
|
59
|
+
static calculateTargetAngle(e, i, r) {
|
|
60
|
+
const s = 360 / i, a = e * s, o = this.hashUuidToSegmentOffset(r, s);
|
|
61
|
+
return ((360 - (a + o)) % 360 + 360) % 360;
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Generate deceleration frame offsets using exponential decay
|
|
@@ -72,13 +72,13 @@ class K {
|
|
|
72
72
|
*/
|
|
73
73
|
static generateDecelerationOffsets(e, i) {
|
|
74
74
|
const s = [0];
|
|
75
|
-
let
|
|
75
|
+
let a = 0, o = 0;
|
|
76
76
|
for (; ; ) {
|
|
77
|
-
|
|
78
|
-
const d = e * Math.exp(-i *
|
|
77
|
+
o++;
|
|
78
|
+
const d = e * Math.exp(-i * o);
|
|
79
79
|
if (d < 0.01)
|
|
80
80
|
break;
|
|
81
|
-
|
|
81
|
+
a += d, s.push(a);
|
|
82
82
|
}
|
|
83
83
|
return s;
|
|
84
84
|
}
|
|
@@ -89,8 +89,8 @@ class K {
|
|
|
89
89
|
* @param decelerationDistance - Total degrees to decelerate over
|
|
90
90
|
* @returns Angle at which to start decelerating
|
|
91
91
|
*/
|
|
92
|
-
static calculateDecelerationStartAngle(e, i,
|
|
93
|
-
let s = i -
|
|
92
|
+
static calculateDecelerationStartAngle(e, i, r) {
|
|
93
|
+
let s = i - r;
|
|
94
94
|
for (; s <= e; )
|
|
95
95
|
s += 360;
|
|
96
96
|
return s;
|
|
@@ -103,11 +103,11 @@ class K {
|
|
|
103
103
|
* @private Internal helper method
|
|
104
104
|
*/
|
|
105
105
|
static hashUuidToSegmentOffset(e, i) {
|
|
106
|
-
const s = e.split("-").pop(),
|
|
107
|
-
return 1 +
|
|
106
|
+
const s = e.split("-").pop(), a = s ? parseInt(s, 16) : 0, o = i - 2;
|
|
107
|
+
return 1 + a % o;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
class
|
|
110
|
+
class Be {
|
|
111
111
|
constructor(e, i) {
|
|
112
112
|
this.authToken = e, this.baseUrl = i + "/games/wheel";
|
|
113
113
|
}
|
|
@@ -118,7 +118,7 @@ class Oe {
|
|
|
118
118
|
headers: {
|
|
119
119
|
"Content-Type": "application/json",
|
|
120
120
|
Authorization: `Bearer ${this.authToken}`,
|
|
121
|
-
"X-Origami-Trace":
|
|
121
|
+
"X-Origami-Trace": ge()
|
|
122
122
|
},
|
|
123
123
|
body: JSON.stringify({
|
|
124
124
|
amount: e.amount,
|
|
@@ -128,40 +128,34 @@ class Oe {
|
|
|
128
128
|
},
|
|
129
129
|
meta: e.meta
|
|
130
130
|
})
|
|
131
|
-
}),
|
|
132
|
-
if (i.ok &&
|
|
133
|
-
return { success: !0, data:
|
|
134
|
-
|
|
135
|
-
switch (a?.errorCode) {
|
|
136
|
-
case "INSUFFICIENT_BALANCE":
|
|
137
|
-
s = "alerts.insufficientBalance";
|
|
138
|
-
break;
|
|
139
|
-
case "LIMIT_REACHED":
|
|
140
|
-
s = "alerts.betLimitReached";
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
131
|
+
}), r = await i.json();
|
|
132
|
+
if (i.ok && r.id)
|
|
133
|
+
return { success: !0, data: r };
|
|
134
|
+
const s = ce(r);
|
|
143
135
|
return {
|
|
144
136
|
success: !1,
|
|
145
|
-
error: g(s, e.language)
|
|
137
|
+
error: g(ue(s), e.language),
|
|
138
|
+
errorCode: s
|
|
146
139
|
};
|
|
147
140
|
} catch {
|
|
148
141
|
return {
|
|
149
142
|
success: !1,
|
|
150
|
-
error: g("alerts.gameError", e.language)
|
|
143
|
+
error: g("alerts.gameError", e.language),
|
|
144
|
+
errorCode: K.UNKNOWN
|
|
151
145
|
};
|
|
152
146
|
}
|
|
153
147
|
}
|
|
154
148
|
}
|
|
155
|
-
class
|
|
149
|
+
class We {
|
|
156
150
|
constructor(e) {
|
|
157
151
|
this.edge = e;
|
|
158
152
|
}
|
|
159
153
|
async startBet(e) {
|
|
160
|
-
const { amount: i, riskLevel:
|
|
161
|
-
generator:
|
|
154
|
+
const { amount: i, riskLevel: r, segments: s } = e, a = { riskLevel: r, segments: s, betAmount: f(i) }, o = new De().getGameResult({
|
|
155
|
+
generator: pe(),
|
|
162
156
|
edge: this.edge,
|
|
163
|
-
gameInputs:
|
|
164
|
-
}), d =
|
|
157
|
+
gameInputs: a
|
|
158
|
+
}), d = Oe(o.payout).toString();
|
|
165
159
|
return { success: !0, data: {
|
|
166
160
|
id: crypto.randomUUID(),
|
|
167
161
|
tenantId: "origami-casino",
|
|
@@ -171,7 +165,7 @@ class Te {
|
|
|
171
165
|
amount: i,
|
|
172
166
|
payout: d,
|
|
173
167
|
afterBalance: "1000",
|
|
174
|
-
multiplier:
|
|
168
|
+
multiplier: o.payoutMultiplier.toString(),
|
|
175
169
|
clientSeed: "mock-seed",
|
|
176
170
|
randomValue: "mock-random",
|
|
177
171
|
proof: "mock-proof",
|
|
@@ -179,21 +173,21 @@ class Te {
|
|
|
179
173
|
betActions: [
|
|
180
174
|
{
|
|
181
175
|
data: {
|
|
182
|
-
WHEEL: { riskLevel:
|
|
176
|
+
WHEEL: { riskLevel: r, segments: s }
|
|
183
177
|
},
|
|
184
|
-
type:
|
|
178
|
+
type: ee.START_BET
|
|
185
179
|
},
|
|
186
180
|
{
|
|
187
181
|
data: {
|
|
188
|
-
WHEEL: { result:
|
|
182
|
+
WHEEL: { result: o.outputs.result }
|
|
189
183
|
},
|
|
190
|
-
type:
|
|
184
|
+
type: ee.END_BET
|
|
191
185
|
}
|
|
192
186
|
]
|
|
193
187
|
} };
|
|
194
188
|
}
|
|
195
189
|
}
|
|
196
|
-
const
|
|
190
|
+
const Le = I`
|
|
197
191
|
:host {
|
|
198
192
|
width: 100%;
|
|
199
193
|
height: 100%;
|
|
@@ -220,7 +214,7 @@ const Be = A`
|
|
|
220
214
|
display: block;
|
|
221
215
|
}
|
|
222
216
|
}
|
|
223
|
-
`,
|
|
217
|
+
`, Ne = I`
|
|
224
218
|
:host {
|
|
225
219
|
width: 100%;
|
|
226
220
|
height: 100%;
|
|
@@ -322,24 +316,24 @@ const Be = A`
|
|
|
322
316
|
aspect-ratio: 1 / 1;
|
|
323
317
|
margin: 0 auto;
|
|
324
318
|
}
|
|
325
|
-
`,
|
|
319
|
+
`, B = {
|
|
326
320
|
BLACK: "var(--wheel-color-black)",
|
|
327
321
|
GREEN: "var(--wheel-color-green)",
|
|
328
322
|
YELLOW: "var(--wheel-color-yellow)",
|
|
329
323
|
RED: "var(--wheel-color-red)",
|
|
330
324
|
BLUE: "var(--wheel-color-blue)",
|
|
331
325
|
PURPLE: "var(--wheel-color-purple)"
|
|
332
|
-
},
|
|
333
|
-
ZERO:
|
|
334
|
-
A:
|
|
335
|
-
B:
|
|
336
|
-
C:
|
|
337
|
-
D:
|
|
338
|
-
E:
|
|
339
|
-
}, ne = (t) =>
|
|
340
|
-
layers: [
|
|
326
|
+
}, Re = {
|
|
327
|
+
ZERO: B.BLACK,
|
|
328
|
+
A: B.GREEN,
|
|
329
|
+
B: B.YELLOW,
|
|
330
|
+
C: B.BLUE,
|
|
331
|
+
D: B.RED,
|
|
332
|
+
E: B.PURPLE
|
|
333
|
+
}, ne = (t) => Re[t], V = 9, Ue = 0.08, je = 0.8, Fe = 1e4, He = () => ({
|
|
334
|
+
layers: [me(2800, { duration: 15e-4, decay: 8, gain: 0.6 })],
|
|
341
335
|
gainScale: 1
|
|
342
|
-
}),
|
|
336
|
+
}), Ke = I`
|
|
343
337
|
:host {
|
|
344
338
|
--wheel-color-black: #1a1a1a;
|
|
345
339
|
--wheel-color-green: #00d084;
|
|
@@ -360,40 +354,40 @@ const Be = A`
|
|
|
360
354
|
}
|
|
361
355
|
}
|
|
362
356
|
`;
|
|
363
|
-
var
|
|
364
|
-
for (var s =
|
|
365
|
-
(
|
|
366
|
-
return
|
|
357
|
+
var Ge = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, j = (t, e, i, r) => {
|
|
358
|
+
for (var s = r > 1 ? void 0 : r ? qe(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
359
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
360
|
+
return r && s && Ge(e, i, s), s;
|
|
367
361
|
};
|
|
368
|
-
let P = class extends
|
|
362
|
+
let P = class extends C {
|
|
369
363
|
constructor() {
|
|
370
|
-
super(...arguments), this.risk = u.MEDIUM_RISK, this.segments =
|
|
364
|
+
super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.highlightedSegments = [];
|
|
371
365
|
}
|
|
372
366
|
generateWheelPaths() {
|
|
373
|
-
const t =
|
|
374
|
-
for (let
|
|
375
|
-
const
|
|
367
|
+
const t = xe({ riskLevel: this.risk, segments: this.segments }), e = { cx: 285, cy: 285 }, i = 284.371, r = 2 * Math.PI / this.segments, s = [];
|
|
368
|
+
for (let a = 0; a < this.segments; a++) {
|
|
369
|
+
const o = ne(t[a]), _ = this.highlightedSegments.length > 0 && !this.highlightedSegments.includes(a) ? 0.25 : 1, E = a * r - Math.PI / 2, A = (a + 1) * r - Math.PI / 2, M = {
|
|
376
370
|
x: e.cx + i * Math.cos(E),
|
|
377
371
|
y: e.cy + i * Math.sin(E)
|
|
378
|
-
},
|
|
379
|
-
x: e.cx + i * Math.cos(
|
|
380
|
-
y: e.cy + i * Math.sin(
|
|
372
|
+
}, H = {
|
|
373
|
+
x: e.cx + i * Math.cos(A),
|
|
374
|
+
y: e.cy + i * Math.sin(A)
|
|
381
375
|
};
|
|
382
376
|
s.push(
|
|
383
|
-
|
|
377
|
+
Y`<path
|
|
384
378
|
class="segment-path"
|
|
385
|
-
fill="${
|
|
386
|
-
stroke="${
|
|
379
|
+
fill="${o}"
|
|
380
|
+
stroke="${o}"
|
|
387
381
|
stroke-width="1"
|
|
388
382
|
opacity="${_}"
|
|
389
|
-
d="M${e.cx} ${e.cy} L${M.x.toFixed(3)} ${M.y.toFixed(3)} A${i} ${i} 0 0 1 ${
|
|
383
|
+
d="M${e.cx} ${e.cy} L${M.x.toFixed(3)} ${M.y.toFixed(3)} A${i} ${i} 0 0 1 ${H.x.toFixed(3)} ${H.y.toFixed(3)} Z"
|
|
390
384
|
/>`
|
|
391
385
|
);
|
|
392
386
|
}
|
|
393
387
|
return s;
|
|
394
388
|
}
|
|
395
389
|
render() {
|
|
396
|
-
return
|
|
390
|
+
return Y`
|
|
397
391
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 570 570" width="100%" height="100%" fill="none" preserveAspectRatio="xMidYMid meet">
|
|
398
392
|
<g clip-path="url(#a)">
|
|
399
393
|
${this.generateWheelPaths()}
|
|
@@ -409,28 +403,28 @@ let P = class extends T {
|
|
|
409
403
|
`;
|
|
410
404
|
}
|
|
411
405
|
};
|
|
412
|
-
P.styles = [
|
|
413
|
-
|
|
414
|
-
|
|
406
|
+
P.styles = [Ke];
|
|
407
|
+
j([
|
|
408
|
+
n({ type: String })
|
|
415
409
|
], P.prototype, "risk", 2);
|
|
416
|
-
|
|
417
|
-
|
|
410
|
+
j([
|
|
411
|
+
n({ type: Number })
|
|
418
412
|
], P.prototype, "segments", 2);
|
|
419
|
-
|
|
420
|
-
|
|
413
|
+
j([
|
|
414
|
+
n({ type: Array })
|
|
421
415
|
], P.prototype, "highlightedSegments", 2);
|
|
422
|
-
|
|
423
|
-
U({ context:
|
|
416
|
+
j([
|
|
417
|
+
U({ context: R, subscribe: !0 })
|
|
424
418
|
], P.prototype, "gameData", 2);
|
|
425
|
-
P =
|
|
419
|
+
P = j([
|
|
426
420
|
k("origami-wheel-svg")
|
|
427
421
|
], P);
|
|
428
|
-
var
|
|
429
|
-
for (var s =
|
|
430
|
-
(
|
|
431
|
-
return
|
|
422
|
+
var Ve = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, c = (t, e, i, r) => {
|
|
423
|
+
for (var s = r > 1 ? void 0 : r ? Ye(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
424
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
425
|
+
return r && s && Ve(e, i, s), s;
|
|
432
426
|
};
|
|
433
|
-
let h = class extends
|
|
427
|
+
let h = class extends C {
|
|
434
428
|
constructor() {
|
|
435
429
|
super(...arguments), this.isPlaying = !1, this.staticDisplay = !1, this.ignoreInstantBet = !1, this.risk = u.MEDIUM_RISK, this.segments = 10, this.targetAngle = null, this.resultSegment = null, this.hoveredSegments = [], this._angle = 0, this._rafId = null, this._decelerationOffsets = null, this._currentDecelerationFrame = 0, this._decelerationStartAngle = 0;
|
|
436
430
|
}
|
|
@@ -449,10 +443,10 @@ let h = class extends T {
|
|
|
449
443
|
this._angle = this.targetAngle, this._updateTransform(), this._stopLoop(), this.emit("wheel-spin-complete");
|
|
450
444
|
return;
|
|
451
445
|
}
|
|
452
|
-
const t = this._isInstantBet ?
|
|
453
|
-
this._decelerationOffsets =
|
|
446
|
+
const t = this._isInstantBet ? je : Ue;
|
|
447
|
+
this._decelerationOffsets = G.generateDecelerationOffsets(V, t);
|
|
454
448
|
const e = this._decelerationOffsets[this._decelerationOffsets.length - 1];
|
|
455
|
-
this._decelerationStartAngle =
|
|
449
|
+
this._decelerationStartAngle = G.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
|
|
456
450
|
}
|
|
457
451
|
handleIsPlayingChange() {
|
|
458
452
|
this.isPlaying && this._rafId === null && !this._isInstantBet ? this._startLoop() : !this.isPlaying && this._rafId !== null && this._stopLoop();
|
|
@@ -461,19 +455,19 @@ let h = class extends T {
|
|
|
461
455
|
const t = () => {
|
|
462
456
|
const e = this._angle;
|
|
463
457
|
if (this._currentDecelerationFrame > 0) {
|
|
464
|
-
const
|
|
465
|
-
if (this._angle = this._decelerationStartAngle +
|
|
458
|
+
const a = this._decelerationOffsets[this._currentDecelerationFrame];
|
|
459
|
+
if (this._angle = this._decelerationStartAngle + a, this._currentDecelerationFrame++, this._currentDecelerationFrame >= this._decelerationOffsets.length) {
|
|
466
460
|
this._angle = this.targetAngle, this._decelerationOffsets = null, this._currentDecelerationFrame = 0, this._updateTransform(), this.emit("wheel-spin-complete"), this._rafId = null;
|
|
467
461
|
return;
|
|
468
462
|
}
|
|
469
463
|
} else if (this._decelerationOffsets !== null && this._currentDecelerationFrame === 0) {
|
|
470
|
-
const
|
|
471
|
-
|
|
464
|
+
const a = this._angle + V;
|
|
465
|
+
a >= this._decelerationStartAngle ? (this._angle = this._decelerationStartAngle, this._currentDecelerationFrame = 1) : this._angle = a;
|
|
472
466
|
} else
|
|
473
|
-
this._angle +=
|
|
467
|
+
this._angle += V;
|
|
474
468
|
this._updateTransform();
|
|
475
|
-
const
|
|
476
|
-
Math.floor(this._angle /
|
|
469
|
+
const r = 360 / this.segments;
|
|
470
|
+
Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.gameData?.soundEffects?.play(He()), this._rafId = requestAnimationFrame(t);
|
|
477
471
|
};
|
|
478
472
|
this._rafId === null && (this._rafId = requestAnimationFrame(t));
|
|
479
473
|
}
|
|
@@ -506,7 +500,7 @@ let h = class extends T {
|
|
|
506
500
|
fill="none"
|
|
507
501
|
>
|
|
508
502
|
<circle cx="284" cy="284" r="78" fill="var(--background-base)" stroke="white" stroke-width="36" />
|
|
509
|
-
${this.gameData?.customWheelCenterSvgUrl ?
|
|
503
|
+
${this.gameData?.customWheelCenterSvgUrl ? Y`<image
|
|
510
504
|
href=${this.gameData.customWheelCenterSvgUrl}
|
|
511
505
|
x=${224 + (this.gameData.customWheelCenterPadding ?? 0)}
|
|
512
506
|
y=${224 + (this.gameData.customWheelCenterPadding ?? 0)}
|
|
@@ -514,7 +508,7 @@ let h = class extends T {
|
|
|
514
508
|
height=${120 - 2 * (this.gameData.customWheelCenterPadding ?? 0)}
|
|
515
509
|
style="clip-path: circle(50%)"
|
|
516
510
|
preserveAspectRatio="xMidYMid slice"
|
|
517
|
-
/>` :
|
|
511
|
+
/>` : Z}
|
|
518
512
|
<path
|
|
519
513
|
d="M281.402 125.5C282.557 123.5 285.443 123.5 286.598 125.5L334.23 208C335.384 210 333.941 212.5 331.632 212.5H236.369C234.059 212.5 232.616 210 233.771 208L281.402 125.5Z"
|
|
520
514
|
fill="white"
|
|
@@ -526,47 +520,47 @@ let h = class extends T {
|
|
|
526
520
|
`;
|
|
527
521
|
}
|
|
528
522
|
};
|
|
529
|
-
h.styles = [
|
|
523
|
+
h.styles = [L, Ne];
|
|
530
524
|
c([
|
|
531
|
-
|
|
525
|
+
n({ type: Boolean })
|
|
532
526
|
], h.prototype, "isPlaying", 2);
|
|
533
527
|
c([
|
|
534
|
-
|
|
528
|
+
n({ type: Boolean })
|
|
535
529
|
], h.prototype, "staticDisplay", 2);
|
|
536
530
|
c([
|
|
537
|
-
|
|
531
|
+
n({ type: Boolean })
|
|
538
532
|
], h.prototype, "ignoreInstantBet", 2);
|
|
539
533
|
c([
|
|
540
|
-
|
|
534
|
+
n({ type: String })
|
|
541
535
|
], h.prototype, "risk", 2);
|
|
542
536
|
c([
|
|
543
|
-
|
|
537
|
+
n({ type: Number })
|
|
544
538
|
], h.prototype, "segments", 2);
|
|
545
539
|
c([
|
|
546
|
-
|
|
540
|
+
n({ type: Number })
|
|
547
541
|
], h.prototype, "targetAngle", 2);
|
|
548
542
|
c([
|
|
549
|
-
|
|
543
|
+
n({ type: Number })
|
|
550
544
|
], h.prototype, "resultSegment", 2);
|
|
551
545
|
c([
|
|
552
|
-
|
|
546
|
+
n({ type: Array })
|
|
553
547
|
], h.prototype, "hoveredSegments", 2);
|
|
554
548
|
c([
|
|
555
|
-
U({ context:
|
|
549
|
+
U({ context: R, subscribe: !0 })
|
|
556
550
|
], h.prototype, "gameData", 2);
|
|
557
551
|
c([
|
|
558
|
-
|
|
552
|
+
J(".wheel-svg")
|
|
559
553
|
], h.prototype, "_wheelEl", 2);
|
|
560
554
|
c([
|
|
561
|
-
|
|
555
|
+
se("targetAngle")
|
|
562
556
|
], h.prototype, "handleTargetAngleChange", 1);
|
|
563
557
|
c([
|
|
564
|
-
|
|
558
|
+
se("isPlaying")
|
|
565
559
|
], h.prototype, "handleIsPlayingChange", 1);
|
|
566
560
|
h = c([
|
|
567
561
|
k("origami-wheel-animator")
|
|
568
562
|
], h);
|
|
569
|
-
const
|
|
563
|
+
const ze = I`
|
|
570
564
|
:host {
|
|
571
565
|
display: flex;
|
|
572
566
|
flex-direction: column;
|
|
@@ -701,14 +695,14 @@ const qe = A`
|
|
|
701
695
|
cursor: help;
|
|
702
696
|
}
|
|
703
697
|
`;
|
|
704
|
-
var
|
|
705
|
-
for (var s =
|
|
706
|
-
(
|
|
707
|
-
return
|
|
698
|
+
var Xe = Object.defineProperty, Ze = Object.getOwnPropertyDescriptor, T = (t, e, i, r) => {
|
|
699
|
+
for (var s = r > 1 ? void 0 : r ? Ze(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
700
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
701
|
+
return r && s && Xe(e, i, s), s;
|
|
708
702
|
};
|
|
709
|
-
let $ = class extends
|
|
703
|
+
let $ = class extends C {
|
|
710
704
|
constructor() {
|
|
711
|
-
super(...arguments), this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments =
|
|
705
|
+
super(...arguments), this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.resultSegment = null, this.hoveredTileIndex = null;
|
|
712
706
|
}
|
|
713
707
|
get edge() {
|
|
714
708
|
return this.gameData?.edge ?? 1;
|
|
@@ -717,10 +711,10 @@ let $ = class extends T {
|
|
|
717
711
|
return { riskLevel: this.risk, segments: this.segments };
|
|
718
712
|
}
|
|
719
713
|
get segmentMultipliers() {
|
|
720
|
-
return
|
|
714
|
+
return Ee(this.selection, this.edge);
|
|
721
715
|
}
|
|
722
716
|
get tiles() {
|
|
723
|
-
return
|
|
717
|
+
return Ae(this.selection, this.edge).outcomes;
|
|
724
718
|
}
|
|
725
719
|
getActiveTileIndexFromSegment() {
|
|
726
720
|
if (this.resultSegment === null) return null;
|
|
@@ -746,30 +740,30 @@ let $ = class extends T {
|
|
|
746
740
|
this.isDesktop && (this.hoveredTileIndex = null, this.emit("wheel-multiplier-hover", { detail: { segments: [] } }));
|
|
747
741
|
}
|
|
748
742
|
formatProfit(t) {
|
|
749
|
-
const e = f(this.gameData?.betAmount ?? 0).times(t.minus(1)), i = e.lt(0) ? f(0) : e,
|
|
750
|
-
return
|
|
743
|
+
const e = f(this.gameData?.betAmount ?? 0).times(t.minus(1)), i = e.lt(0) ? f(0) : e, r = this.gameData?.currency ?? q;
|
|
744
|
+
return de(i.toNumber(), r, { includeSymbol: !1 });
|
|
751
745
|
}
|
|
752
746
|
formatChance(t, e) {
|
|
753
747
|
return `${t}/${e}`;
|
|
754
748
|
}
|
|
755
749
|
render() {
|
|
756
|
-
const t = this.tiles, e = Math.min(t.length, 6), i = this.gameData?.language ||
|
|
750
|
+
const t = this.tiles, e = Math.min(t.length, 6), i = this.gameData?.language || W, r = this.activeTileIndex, s = t[r], a = t.reduce((_, E) => _ + E.weight, 0), o = this.formatProfit(s.multiplier), d = this.formatChance(s.weight, a);
|
|
757
751
|
return l`
|
|
758
752
|
<div class="container">
|
|
759
753
|
${this.isDesktop ? l`<div class="multiplier-info">
|
|
760
754
|
<div class="info-item">
|
|
761
755
|
<div>
|
|
762
756
|
<span class="label">${g("common.profitOnWin", i)}:</span>
|
|
763
|
-
<span class="value">${
|
|
757
|
+
<span class="value">${o}</span>
|
|
764
758
|
</div>
|
|
765
759
|
<origami-tooltip
|
|
766
|
-
content=${this.gameData?.currency ??
|
|
760
|
+
content=${this.gameData?.currency ?? q}
|
|
767
761
|
position="top"
|
|
768
762
|
.trigger=${["hover"]}
|
|
769
763
|
.offset=${6}
|
|
770
764
|
inline
|
|
771
765
|
>
|
|
772
|
-
<span class="info-icon">${
|
|
766
|
+
<span class="info-icon">${fe(this.gameData?.currency ?? q)}</span>
|
|
773
767
|
</origami-tooltip>
|
|
774
768
|
</div>
|
|
775
769
|
|
|
@@ -784,24 +778,24 @@ let $ = class extends T {
|
|
|
784
778
|
size="16px"
|
|
785
779
|
></lottie-icon>
|
|
786
780
|
</div>
|
|
787
|
-
</div>` :
|
|
781
|
+
</div>` : Z}
|
|
788
782
|
|
|
789
783
|
<div class="tiles" role="list" style="--grid-columns: ${e}" @mouseleave=${() => this.handleTileMouseLeave()}>
|
|
790
|
-
${t.map(({ slot: _, multiplier: E },
|
|
791
|
-
const M = `${E.toString()}X`,
|
|
784
|
+
${t.map(({ slot: _, multiplier: E }, A) => {
|
|
785
|
+
const M = `${E.toString()}X`, H = ne(_), Q = this.hoveredTileIndex === A;
|
|
792
786
|
return l`
|
|
793
787
|
<div
|
|
794
788
|
class="tile"
|
|
795
789
|
role="listitem"
|
|
796
|
-
hovered=${
|
|
797
|
-
active=${!
|
|
798
|
-
@mouseenter=${() => this.handleTileMouseEnter(
|
|
790
|
+
hovered=${Q}
|
|
791
|
+
active=${!Q && A === r}
|
|
792
|
+
@mouseenter=${() => this.handleTileMouseEnter(A)}
|
|
799
793
|
>
|
|
800
794
|
<div class="tile-content">
|
|
801
795
|
<span class="tile-label">${M}</span>
|
|
802
796
|
<span
|
|
803
797
|
class="dot"
|
|
804
|
-
style=${
|
|
798
|
+
style=${Ce({ backgroundColor: H })}
|
|
805
799
|
aria-hidden="true"
|
|
806
800
|
></span>
|
|
807
801
|
</div>
|
|
@@ -813,34 +807,34 @@ let $ = class extends T {
|
|
|
813
807
|
`;
|
|
814
808
|
}
|
|
815
809
|
};
|
|
816
|
-
$.styles = [
|
|
817
|
-
|
|
818
|
-
|
|
810
|
+
$.styles = [L, ze];
|
|
811
|
+
T([
|
|
812
|
+
n({ type: Boolean, attribute: "data-is-desktop" })
|
|
819
813
|
], $.prototype, "isDesktop", 2);
|
|
820
|
-
|
|
821
|
-
|
|
814
|
+
T([
|
|
815
|
+
n({ type: String })
|
|
822
816
|
], $.prototype, "risk", 2);
|
|
823
|
-
|
|
824
|
-
|
|
817
|
+
T([
|
|
818
|
+
n({ type: Number })
|
|
825
819
|
], $.prototype, "segments", 2);
|
|
826
|
-
|
|
827
|
-
|
|
820
|
+
T([
|
|
821
|
+
n({ type: Number })
|
|
828
822
|
], $.prototype, "resultSegment", 2);
|
|
829
|
-
|
|
830
|
-
|
|
823
|
+
T([
|
|
824
|
+
v()
|
|
831
825
|
], $.prototype, "hoveredTileIndex", 2);
|
|
832
|
-
|
|
833
|
-
U({ context:
|
|
826
|
+
T([
|
|
827
|
+
U({ context: R, subscribe: !0 })
|
|
834
828
|
], $.prototype, "gameData", 2);
|
|
835
|
-
$ =
|
|
829
|
+
$ = T([
|
|
836
830
|
k("origami-wheel-content-bottom")
|
|
837
831
|
], $);
|
|
838
|
-
var
|
|
839
|
-
for (var s =
|
|
840
|
-
(
|
|
841
|
-
return
|
|
832
|
+
var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, D = (t, e, i, r) => {
|
|
833
|
+
for (var s = r > 1 ? void 0 : r ? Qe(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
834
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
835
|
+
return r && s && Je(e, i, s), s;
|
|
842
836
|
};
|
|
843
|
-
let y = class extends
|
|
837
|
+
let y = class extends C {
|
|
844
838
|
constructor() {
|
|
845
839
|
super(...arguments), this.isDesktop = !1, this.isPlaying = !1, this.history = [], this.risk = u.MEDIUM_RISK, this.segments = 10, this.targetAngle = null, this.resultSegment = null, this.hoveredSegments = [];
|
|
846
840
|
}
|
|
@@ -851,7 +845,7 @@ let y = class extends T {
|
|
|
851
845
|
return l`
|
|
852
846
|
<origami-history-pills
|
|
853
847
|
data-is-desktop=${this.isDesktop}
|
|
854
|
-
.gameType=${
|
|
848
|
+
.gameType=${X.WHEEL}
|
|
855
849
|
.history=${[...this.history].reverse()}
|
|
856
850
|
></origami-history-pills>
|
|
857
851
|
|
|
@@ -877,35 +871,35 @@ let y = class extends T {
|
|
|
877
871
|
`;
|
|
878
872
|
}
|
|
879
873
|
};
|
|
880
|
-
y.styles = [
|
|
874
|
+
y.styles = [L, Le];
|
|
881
875
|
D([
|
|
882
|
-
|
|
876
|
+
n({ type: Boolean })
|
|
883
877
|
], y.prototype, "isDesktop", 2);
|
|
884
878
|
D([
|
|
885
|
-
|
|
879
|
+
n({ type: Boolean })
|
|
886
880
|
], y.prototype, "isPlaying", 2);
|
|
887
881
|
D([
|
|
888
|
-
|
|
882
|
+
n({ type: Array })
|
|
889
883
|
], y.prototype, "history", 2);
|
|
890
884
|
D([
|
|
891
|
-
|
|
885
|
+
n({ type: String })
|
|
892
886
|
], y.prototype, "risk", 2);
|
|
893
887
|
D([
|
|
894
|
-
|
|
888
|
+
n({ type: Number })
|
|
895
889
|
], y.prototype, "segments", 2);
|
|
896
890
|
D([
|
|
897
|
-
|
|
891
|
+
n({ type: Number })
|
|
898
892
|
], y.prototype, "targetAngle", 2);
|
|
899
893
|
D([
|
|
900
|
-
|
|
894
|
+
n({ type: Number })
|
|
901
895
|
], y.prototype, "resultSegment", 2);
|
|
902
896
|
D([
|
|
903
|
-
|
|
897
|
+
v()
|
|
904
898
|
], y.prototype, "hoveredSegments", 2);
|
|
905
899
|
y = D([
|
|
906
900
|
k("origami-wheel-layout")
|
|
907
901
|
], y);
|
|
908
|
-
const
|
|
902
|
+
const le = I`
|
|
909
903
|
:host {
|
|
910
904
|
display: flex;
|
|
911
905
|
flex-direction: column;
|
|
@@ -935,7 +929,7 @@ const oe = A`
|
|
|
935
929
|
.grid-full-width {
|
|
936
930
|
grid-column: span 2;
|
|
937
931
|
}
|
|
938
|
-
`,
|
|
932
|
+
`, et = I`
|
|
939
933
|
:host {
|
|
940
934
|
display: contents;
|
|
941
935
|
}
|
|
@@ -944,35 +938,35 @@ const oe = A`
|
|
|
944
938
|
grid-column: span 2;
|
|
945
939
|
}
|
|
946
940
|
`;
|
|
947
|
-
var
|
|
948
|
-
for (var s =
|
|
949
|
-
(
|
|
950
|
-
return
|
|
941
|
+
var tt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, F = (t, e, i, r) => {
|
|
942
|
+
for (var s = r > 1 ? void 0 : r ? st(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
943
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
944
|
+
return r && s && tt(e, i, s), s;
|
|
951
945
|
};
|
|
952
|
-
const
|
|
946
|
+
const it = {
|
|
953
947
|
[u.LOW_RISK]: "common.low",
|
|
954
948
|
[u.MEDIUM_RISK]: "common.medium",
|
|
955
949
|
[u.HIGH_RISK]: "common.high"
|
|
956
950
|
};
|
|
957
|
-
let O = class extends
|
|
951
|
+
let O = class extends C {
|
|
958
952
|
constructor() {
|
|
959
|
-
super(...arguments), this.risk = u.MEDIUM_RISK, this.segments =
|
|
953
|
+
super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.disabled = !1;
|
|
960
954
|
}
|
|
961
955
|
handleRiskChange(t) {
|
|
962
956
|
const { value: e } = t.detail;
|
|
963
|
-
|
|
957
|
+
re(e) && this.emit("wheel-risk-change", { detail: { value: e } });
|
|
964
958
|
}
|
|
965
959
|
handleSegmentsChange(t) {
|
|
966
960
|
const e = Number(t.detail.value);
|
|
967
961
|
ae(e) && this.emit("wheel-segments-change", { detail: { value: e } });
|
|
968
962
|
}
|
|
969
963
|
render() {
|
|
970
|
-
const t = this.gameData?.language ||
|
|
964
|
+
const t = this.gameData?.language || W;
|
|
971
965
|
return l`
|
|
972
966
|
<origami-select
|
|
973
967
|
class="grid-full-width"
|
|
974
968
|
label=${g("common.risk", t)}
|
|
975
|
-
.options=${
|
|
969
|
+
.options=${Ie.map((e) => ({ value: e, label: g(it[e], t) }))}
|
|
976
970
|
.value=${this.risk}
|
|
977
971
|
@select-change=${this.handleRiskChange}
|
|
978
972
|
?disabled=${this.disabled}
|
|
@@ -981,7 +975,7 @@ let O = class extends T {
|
|
|
981
975
|
<origami-select
|
|
982
976
|
class="grid-full-width"
|
|
983
977
|
label=${g("games.wheel.segments", t)}
|
|
984
|
-
.options=${
|
|
978
|
+
.options=${Me.map((e) => ({ value: e.toString(), label: e.toString() }))}
|
|
985
979
|
.value=${this.segments.toString()}
|
|
986
980
|
@select-change=${this.handleSegmentsChange}
|
|
987
981
|
?disabled=${this.disabled}
|
|
@@ -989,30 +983,30 @@ let O = class extends T {
|
|
|
989
983
|
`;
|
|
990
984
|
}
|
|
991
985
|
};
|
|
992
|
-
O.styles = [
|
|
993
|
-
|
|
994
|
-
|
|
986
|
+
O.styles = [L, et];
|
|
987
|
+
F([
|
|
988
|
+
n({ type: String })
|
|
995
989
|
], O.prototype, "risk", 2);
|
|
996
|
-
|
|
997
|
-
|
|
990
|
+
F([
|
|
991
|
+
n({ type: Number })
|
|
998
992
|
], O.prototype, "segments", 2);
|
|
999
|
-
|
|
1000
|
-
|
|
993
|
+
F([
|
|
994
|
+
n({ type: Boolean })
|
|
1001
995
|
], O.prototype, "disabled", 2);
|
|
1002
|
-
|
|
1003
|
-
U({ context:
|
|
996
|
+
F([
|
|
997
|
+
U({ context: R, subscribe: !0 })
|
|
1004
998
|
], O.prototype, "gameData", 2);
|
|
1005
|
-
O =
|
|
999
|
+
O = F([
|
|
1006
1000
|
k("origami-wheel-selectors")
|
|
1007
1001
|
], O);
|
|
1008
|
-
var
|
|
1009
|
-
for (var s =
|
|
1010
|
-
(
|
|
1011
|
-
return
|
|
1002
|
+
var rt = Object.defineProperty, at = Object.getOwnPropertyDescriptor, w = (t, e, i, r) => {
|
|
1003
|
+
for (var s = r > 1 ? void 0 : r ? at(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1004
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
1005
|
+
return r && s && rt(e, i, s), s;
|
|
1012
1006
|
};
|
|
1013
|
-
let p = class extends
|
|
1007
|
+
let p = class extends C {
|
|
1014
1008
|
constructor() {
|
|
1015
|
-
super(...arguments), this.isPlaying = !1, this.betDisabled = !1, this.inputsDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments =
|
|
1009
|
+
super(...arguments), this.isPlaying = !1, this.betDisabled = !1, this.inputsDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.betMaxMultiplier = f(1), this.isBetAmountValid = !0, this._betAboveBalance = !1;
|
|
1016
1010
|
}
|
|
1017
1011
|
render() {
|
|
1018
1012
|
const t = this.gameData?.language || "en";
|
|
@@ -1025,7 +1019,7 @@ let p = class extends T {
|
|
|
1025
1019
|
this.isBetAmountValid = e.detail.isValid;
|
|
1026
1020
|
}}
|
|
1027
1021
|
@bet-amount-input-error-change=${(e) => {
|
|
1028
|
-
this._betAboveBalance = e.detail.invalidReason ===
|
|
1022
|
+
this._betAboveBalance = e.detail.invalidReason === ye.BET_AMOUNT_ABOVE_BALANCE;
|
|
1029
1023
|
}}
|
|
1030
1024
|
></origami-bet-amount-input>
|
|
1031
1025
|
|
|
@@ -1047,45 +1041,45 @@ let p = class extends T {
|
|
|
1047
1041
|
`;
|
|
1048
1042
|
}
|
|
1049
1043
|
};
|
|
1050
|
-
p.styles = [
|
|
1051
|
-
|
|
1052
|
-
|
|
1044
|
+
p.styles = [L, le];
|
|
1045
|
+
w([
|
|
1046
|
+
n({ type: Boolean })
|
|
1053
1047
|
], p.prototype, "isPlaying", 2);
|
|
1054
|
-
|
|
1055
|
-
|
|
1048
|
+
w([
|
|
1049
|
+
n({ type: Boolean })
|
|
1056
1050
|
], p.prototype, "betDisabled", 2);
|
|
1057
|
-
|
|
1058
|
-
|
|
1051
|
+
w([
|
|
1052
|
+
n({ type: Boolean })
|
|
1059
1053
|
], p.prototype, "inputsDisabled", 2);
|
|
1060
|
-
|
|
1061
|
-
|
|
1054
|
+
w([
|
|
1055
|
+
n({ type: String })
|
|
1062
1056
|
], p.prototype, "risk", 2);
|
|
1063
|
-
|
|
1064
|
-
|
|
1057
|
+
w([
|
|
1058
|
+
n({ type: Number })
|
|
1065
1059
|
], p.prototype, "segments", 2);
|
|
1066
|
-
|
|
1067
|
-
|
|
1060
|
+
w([
|
|
1061
|
+
n({ attribute: !1 })
|
|
1068
1062
|
], p.prototype, "betMaxMultiplier", 2);
|
|
1069
|
-
|
|
1070
|
-
U({ context:
|
|
1063
|
+
w([
|
|
1064
|
+
U({ context: R, subscribe: !0 })
|
|
1071
1065
|
], p.prototype, "gameData", 2);
|
|
1072
|
-
|
|
1073
|
-
|
|
1066
|
+
w([
|
|
1067
|
+
v()
|
|
1074
1068
|
], p.prototype, "isBetAmountValid", 2);
|
|
1075
|
-
|
|
1076
|
-
|
|
1069
|
+
w([
|
|
1070
|
+
v()
|
|
1077
1071
|
], p.prototype, "_betAboveBalance", 2);
|
|
1078
|
-
p =
|
|
1072
|
+
p = w([
|
|
1079
1073
|
k("origami-wheel-manual")
|
|
1080
1074
|
], p);
|
|
1081
|
-
var
|
|
1082
|
-
for (var s =
|
|
1083
|
-
(
|
|
1084
|
-
return
|
|
1075
|
+
var ot = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, x = (t, e, i, r) => {
|
|
1076
|
+
for (var s = r > 1 ? void 0 : r ? nt(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1077
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
1078
|
+
return r && s && ot(e, i, s), s;
|
|
1085
1079
|
};
|
|
1086
|
-
let b = class extends
|
|
1080
|
+
let b = class extends C {
|
|
1087
1081
|
constructor() {
|
|
1088
|
-
super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments =
|
|
1082
|
+
super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.isDesktop = !1, this.risk = u.MEDIUM_RISK, this.segments = N.TEN, this.betMaxMultiplier = f(1);
|
|
1089
1083
|
}
|
|
1090
1084
|
render() {
|
|
1091
1085
|
return l`
|
|
@@ -1106,35 +1100,35 @@ let b = class extends T {
|
|
|
1106
1100
|
`;
|
|
1107
1101
|
}
|
|
1108
1102
|
};
|
|
1109
|
-
b.styles = [
|
|
1103
|
+
b.styles = [L, le];
|
|
1110
1104
|
x([
|
|
1111
|
-
|
|
1105
|
+
n({ type: Boolean })
|
|
1112
1106
|
], b.prototype, "inputsDisabled", 2);
|
|
1113
1107
|
x([
|
|
1114
|
-
|
|
1108
|
+
n({ type: Boolean })
|
|
1115
1109
|
], b.prototype, "autobetStopping", 2);
|
|
1116
1110
|
x([
|
|
1117
|
-
|
|
1111
|
+
n({ type: Boolean })
|
|
1118
1112
|
], b.prototype, "autobetInProgress", 2);
|
|
1119
1113
|
x([
|
|
1120
|
-
|
|
1114
|
+
n({ type: Boolean })
|
|
1121
1115
|
], b.prototype, "betDisabled", 2);
|
|
1122
1116
|
x([
|
|
1123
|
-
|
|
1117
|
+
n({ type: Boolean })
|
|
1124
1118
|
], b.prototype, "isDesktop", 2);
|
|
1125
1119
|
x([
|
|
1126
|
-
|
|
1120
|
+
n({ type: String })
|
|
1127
1121
|
], b.prototype, "risk", 2);
|
|
1128
1122
|
x([
|
|
1129
|
-
|
|
1123
|
+
n({ type: Number })
|
|
1130
1124
|
], b.prototype, "segments", 2);
|
|
1131
1125
|
x([
|
|
1132
|
-
|
|
1126
|
+
n({ attribute: !1 })
|
|
1133
1127
|
], b.prototype, "betMaxMultiplier", 2);
|
|
1134
1128
|
b = x([
|
|
1135
1129
|
k("origami-wheel-auto")
|
|
1136
1130
|
], b);
|
|
1137
|
-
const
|
|
1131
|
+
const lt = I`
|
|
1138
1132
|
:host {
|
|
1139
1133
|
height: 100%;
|
|
1140
1134
|
}
|
|
@@ -1143,21 +1137,21 @@ const rt = A`
|
|
|
1143
1137
|
display: block;
|
|
1144
1138
|
}
|
|
1145
1139
|
`;
|
|
1146
|
-
var
|
|
1147
|
-
for (var s =
|
|
1148
|
-
(
|
|
1149
|
-
return
|
|
1140
|
+
var ht = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, S = (t, e, i, r) => {
|
|
1141
|
+
for (var s = r > 1 ? void 0 : r ? gt(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1142
|
+
(o = t[a]) && (s = (r ? o(e, i, s) : o(s)) || s);
|
|
1143
|
+
return r && s && ht(e, i, s), s;
|
|
1150
1144
|
};
|
|
1151
|
-
let m = class extends
|
|
1145
|
+
let m = class extends ie {
|
|
1152
1146
|
constructor() {
|
|
1153
|
-
super(), this.isManualPlaying = !1, this.history = [], this.wheelRisk = u.MEDIUM_RISK, this.numberOfSegments = 10, this.targetAngle = null, this.resultSegment = null, this.isWheelSpinning = !1, new
|
|
1147
|
+
super(), this.isManualPlaying = !1, this.history = [], this.wheelRisk = u.MEDIUM_RISK, this.numberOfSegments = 10, this.targetAngle = null, this.resultSegment = null, this.isWheelSpinning = !1, new be(this, [
|
|
1154
1148
|
{
|
|
1155
1149
|
key: " ",
|
|
1156
|
-
callback: () =>
|
|
1150
|
+
callback: () => te.clickBetButton(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl),
|
|
1157
1151
|
options: {
|
|
1158
1152
|
repeat: !0,
|
|
1159
1153
|
repeatInterval: 200,
|
|
1160
|
-
disabled: () => this.gameData?.hotkeysOpenEnabled ?
|
|
1154
|
+
disabled: () => this.gameData?.hotkeysOpenEnabled ? te.isBetButtonDisabled(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl) : !0
|
|
1161
1155
|
}
|
|
1162
1156
|
}
|
|
1163
1157
|
]);
|
|
@@ -1169,7 +1163,7 @@ let m = class extends se {
|
|
|
1169
1163
|
this.numberOfSegments = t.detail.value, this.resultSegment = null;
|
|
1170
1164
|
}
|
|
1171
1165
|
get wheelApi() {
|
|
1172
|
-
return this.isDemoMode ? new
|
|
1166
|
+
return this.isDemoMode ? new We(this.gameData.edge) : new Be(this.gameData.authToken, this.gameData.baseUrl);
|
|
1173
1167
|
}
|
|
1174
1168
|
get isToggleDisabled() {
|
|
1175
1169
|
return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
|
|
@@ -1178,7 +1172,7 @@ let m = class extends se {
|
|
|
1178
1172
|
return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
|
|
1179
1173
|
}
|
|
1180
1174
|
wheelSpinCompletedPromise() {
|
|
1181
|
-
return
|
|
1175
|
+
return ve(this, "wheel-spin-complete", void 0, Fe, !0);
|
|
1182
1176
|
}
|
|
1183
1177
|
async handleBetExecution(t, e) {
|
|
1184
1178
|
if (this.resetForNextBet(() => {
|
|
@@ -1186,48 +1180,49 @@ let m = class extends se {
|
|
|
1186
1180
|
}), !this.gameData?.currency)
|
|
1187
1181
|
return {
|
|
1188
1182
|
success: !1,
|
|
1189
|
-
error: g("alerts.gameError", this.gameData?.language ||
|
|
1183
|
+
error: g("alerts.gameError", this.gameData?.language || W)
|
|
1190
1184
|
};
|
|
1191
1185
|
const i = f(this.gameData.balance);
|
|
1192
1186
|
try {
|
|
1193
1187
|
if (this.isDemoMode && i.lt(t))
|
|
1194
|
-
throw new Error(g("alerts.insufficientBalance", this.gameData?.language ||
|
|
1188
|
+
throw new Error(g("alerts.insufficientBalance", this.gameData?.language || W));
|
|
1195
1189
|
this.preDeductStake(i, t);
|
|
1196
|
-
const
|
|
1197
|
-
|
|
1190
|
+
const r = !this.isInstantBet;
|
|
1191
|
+
r && (this.isWheelSpinning = !0);
|
|
1198
1192
|
const s = await this.placeBet(
|
|
1199
1193
|
() => this.wheelApi.startBet({
|
|
1200
1194
|
amount: t,
|
|
1201
1195
|
language: this.gameData.language,
|
|
1202
1196
|
riskLevel: this.wheelRisk,
|
|
1203
1197
|
segments: this.numberOfSegments,
|
|
1204
|
-
meta: e ?
|
|
1198
|
+
meta: e ? we(e) : void 0
|
|
1205
1199
|
})
|
|
1206
1200
|
);
|
|
1207
1201
|
if (s.success) {
|
|
1208
|
-
const { data:
|
|
1202
|
+
const { data: a } = s, o = Number(a.multiplier ?? 0), { betActions: d } = a, _ = d[d.length - 1];
|
|
1209
1203
|
if (_?.data?.WHEEL) {
|
|
1210
1204
|
const { result: M } = _.data.WHEEL;
|
|
1211
|
-
this.resultSegment = M[0] ?? 0, this.targetAngle =
|
|
1205
|
+
this.resultSegment = M[0] ?? 0, this.targetAngle = G.calculateTargetAngle(this.resultSegment, this.numberOfSegments, a.id);
|
|
1212
1206
|
}
|
|
1213
|
-
|
|
1214
|
-
const E = f(
|
|
1215
|
-
this.history = [...this.history, { multiplier:
|
|
1216
|
-
const
|
|
1217
|
-
return this.gameData.updateBalance(
|
|
1207
|
+
r && await this.wheelSpinCompletedPromise(), this.isWheelSpinning = !1;
|
|
1208
|
+
const E = f(o).gt(0);
|
|
1209
|
+
this.history = [...this.history, { multiplier: o, won: E, id: a.id }], this.updateHistoryWithBet(a);
|
|
1210
|
+
const A = this.isDemoMode ? i.minus(a.amount ?? 0).plus(a.payout ?? 0) : f(a.afterBalance ?? 0);
|
|
1211
|
+
return this.gameData.updateBalance(A), f(o).gt(1) && this.playWinFeedback(), s;
|
|
1218
1212
|
} else
|
|
1219
|
-
|
|
1220
|
-
} catch (
|
|
1221
|
-
this.gameData.updateBalance(i), this.isWheelSpinning = !1
|
|
1222
|
-
const s = a instanceof Error ? a.message : g("alerts.gameError", this.gameData?.language || L);
|
|
1223
|
-
return this.showError(s), {
|
|
1213
|
+
return this.gameData.updateBalance(i), this.isWheelSpinning = !1, s;
|
|
1214
|
+
} catch (r) {
|
|
1215
|
+
return this.gameData.updateBalance(i), this.isWheelSpinning = !1, {
|
|
1224
1216
|
success: !1,
|
|
1225
|
-
error:
|
|
1217
|
+
error: r instanceof Error ? r.message : g("alerts.gameError", this.gameData?.language || W),
|
|
1218
|
+
errorCode: K.UNKNOWN
|
|
1226
1219
|
};
|
|
1227
1220
|
}
|
|
1228
1221
|
}
|
|
1229
1222
|
async wheelPlay() {
|
|
1230
|
-
this.isManualPlaying = !0
|
|
1223
|
+
this.isManualPlaying = !0;
|
|
1224
|
+
const t = await this.handleBetExecution(this.gameData?.betAmount ?? "0");
|
|
1225
|
+
t.success || (this.checkSessionExpired(t.errorCode ?? K.UNKNOWN), this.showError(t.error)), this.isManualPlaying = !1;
|
|
1231
1226
|
}
|
|
1232
1227
|
async executeAutobet(t, e) {
|
|
1233
1228
|
const i = await this.handleBetExecution(e, t);
|
|
@@ -1236,15 +1231,16 @@ let m = class extends se {
|
|
|
1236
1231
|
pnl: f(0),
|
|
1237
1232
|
gameOutcome: "Draw",
|
|
1238
1233
|
hasError: !0,
|
|
1239
|
-
|
|
1234
|
+
errorCode: i.errorCode ?? K.UNKNOWN,
|
|
1235
|
+
errorMessage: i.error || g("alerts.errorProcessingBet", this.gameData?.language || W)
|
|
1240
1236
|
};
|
|
1241
|
-
const
|
|
1242
|
-
return await this.holdResultDisplay(), { pnl: s, gameOutcome:
|
|
1237
|
+
const r = i.data, s = f(r.payout ?? 0).minus(r.amount ?? 0), a = Number(r.multiplier), o = Se(a);
|
|
1238
|
+
return await this.holdResultDisplay(), { pnl: s, gameOutcome: o, hasError: !1 };
|
|
1243
1239
|
}
|
|
1244
1240
|
render() {
|
|
1245
|
-
const t = this.gameData?.mainWidth >= 768, e =
|
|
1241
|
+
const t = this.gameData?.mainWidth >= 768, e = oe(this.gameData.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), i = !1, r = _e(this.gameData);
|
|
1246
1242
|
return l`
|
|
1247
|
-
<origami-game-layout style=${
|
|
1243
|
+
<origami-game-layout style=${r} .gameType=${X.WHEEL} data-is-desktop=${t}>
|
|
1248
1244
|
<origami-game-sidebar
|
|
1249
1245
|
slot="control-panel"
|
|
1250
1246
|
data-is-desktop=${t}
|
|
@@ -1254,7 +1250,7 @@ let m = class extends se {
|
|
|
1254
1250
|
@wheel-risk-change=${this.handleWheelRiskChange}
|
|
1255
1251
|
@wheel-segments-change=${this.handleWheelSegmentsChange}
|
|
1256
1252
|
>
|
|
1257
|
-
${
|
|
1253
|
+
${Pe(
|
|
1258
1254
|
this.manualOrAuto === "Manual" ? l`<origami-wheel-manual
|
|
1259
1255
|
slot="controls"
|
|
1260
1256
|
data-is-desktop=${t}
|
|
@@ -1283,7 +1279,7 @@ let m = class extends se {
|
|
|
1283
1279
|
)}
|
|
1284
1280
|
</origami-game-sidebar>
|
|
1285
1281
|
|
|
1286
|
-
${t ?
|
|
1282
|
+
${t ? Z : l`
|
|
1287
1283
|
<origami-wheel-content-bottom
|
|
1288
1284
|
slot="content-bottom"
|
|
1289
1285
|
?data-is-desktop=${t}
|
|
@@ -1307,48 +1303,48 @@ let m = class extends se {
|
|
|
1307
1303
|
`;
|
|
1308
1304
|
}
|
|
1309
1305
|
};
|
|
1310
|
-
m.styles = [...
|
|
1306
|
+
m.styles = [...ie.styles, lt];
|
|
1311
1307
|
S([
|
|
1312
|
-
|
|
1308
|
+
v()
|
|
1313
1309
|
], m.prototype, "isManualPlaying", 2);
|
|
1314
1310
|
S([
|
|
1315
|
-
|
|
1311
|
+
v()
|
|
1316
1312
|
], m.prototype, "history", 2);
|
|
1317
1313
|
S([
|
|
1318
|
-
|
|
1314
|
+
v()
|
|
1319
1315
|
], m.prototype, "wheelRisk", 2);
|
|
1320
1316
|
S([
|
|
1321
|
-
|
|
1317
|
+
v()
|
|
1322
1318
|
], m.prototype, "numberOfSegments", 2);
|
|
1323
1319
|
S([
|
|
1324
|
-
|
|
1320
|
+
v()
|
|
1325
1321
|
], m.prototype, "targetAngle", 2);
|
|
1326
1322
|
S([
|
|
1327
|
-
|
|
1323
|
+
v()
|
|
1328
1324
|
], m.prototype, "resultSegment", 2);
|
|
1329
1325
|
S([
|
|
1330
|
-
|
|
1326
|
+
v()
|
|
1331
1327
|
], m.prototype, "isWheelSpinning", 2);
|
|
1332
1328
|
S([
|
|
1333
|
-
|
|
1329
|
+
J("origami-wheel-manual")
|
|
1334
1330
|
], m.prototype, "_wheelManualEl", 2);
|
|
1335
1331
|
S([
|
|
1336
|
-
|
|
1332
|
+
J("origami-wheel-auto")
|
|
1337
1333
|
], m.prototype, "_wheelAutoEl", 2);
|
|
1338
1334
|
m = S([
|
|
1339
1335
|
k("origami-wheel-game")
|
|
1340
1336
|
], m);
|
|
1341
|
-
var
|
|
1342
|
-
for (var s =
|
|
1343
|
-
(
|
|
1337
|
+
var ct = Object.getOwnPropertyDescriptor, ut = (t, e, i, r) => {
|
|
1338
|
+
for (var s = r > 1 ? void 0 : r ? ct(e, i) : e, a = t.length - 1, o; a >= 0; a--)
|
|
1339
|
+
(o = t[a]) && (s = o(s) || s);
|
|
1344
1340
|
return s;
|
|
1345
1341
|
};
|
|
1346
|
-
let
|
|
1342
|
+
let z = class extends ke {
|
|
1347
1343
|
render() {
|
|
1348
1344
|
return l`<slot></slot>`;
|
|
1349
1345
|
}
|
|
1350
1346
|
};
|
|
1351
|
-
|
|
1347
|
+
z.styles = I`
|
|
1352
1348
|
:host {
|
|
1353
1349
|
pointer-events: none;
|
|
1354
1350
|
width: 100%;
|
|
@@ -1369,19 +1365,19 @@ Y.styles = A`
|
|
|
1369
1365
|
}
|
|
1370
1366
|
}
|
|
1371
1367
|
`;
|
|
1372
|
-
|
|
1368
|
+
z = ut([
|
|
1373
1369
|
k("origami-wheel-outcome")
|
|
1374
|
-
],
|
|
1375
|
-
const
|
|
1370
|
+
], z);
|
|
1371
|
+
const pt = (t) => typeof t == "object" && t !== null && "risk" in t && re(t.risk) && "segments" in t && ae(t.segments) && "resultSegment" in t && typeof t.resultSegment == "number" && "betId" in t && typeof t.betId == "string", he = (t) => {
|
|
1376
1372
|
const e = t?.WHEEL;
|
|
1377
1373
|
return e !== void 0 && "segments" in e ? e : void 0;
|
|
1378
|
-
},
|
|
1379
|
-
const e =
|
|
1380
|
-
return e === void 0 || i === void 0 ||
|
|
1381
|
-
},
|
|
1382
|
-
if (!
|
|
1383
|
-
return l`<p>${g("errors.noWheelData",
|
|
1384
|
-
const s =
|
|
1374
|
+
}, mt = (t) => {
|
|
1375
|
+
const e = he(t.betActions[0]?.data), i = t.betActions[t.betActions.length - 1]?.data.WHEEL;
|
|
1376
|
+
return e === void 0 || i === void 0 || !$e(i) ? { risk: u.MEDIUM_RISK, segments: N.TEN, resultSegment: 0, betId: t.id || "123" } : { risk: e.riskLevel, segments: e.segments, resultSegment: i.result[0] ?? 0, betId: t.id };
|
|
1377
|
+
}, dt = (t, { enableAnimation: e, inBetResultModal: i, language: r }) => {
|
|
1378
|
+
if (!pt(t))
|
|
1379
|
+
return l`<p>${g("errors.noWheelData", r)}</p>`;
|
|
1380
|
+
const s = G.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
|
|
1385
1381
|
return l`
|
|
1386
1382
|
<origami-wheel-outcome>
|
|
1387
1383
|
<origami-wheel-animator
|
|
@@ -1397,20 +1393,20 @@ const gt = (t) => typeof t == "object" && t !== null && "risk" in t && ie(t.risk
|
|
|
1397
1393
|
></origami-wheel-animator>
|
|
1398
1394
|
</origami-wheel-outcome>
|
|
1399
1395
|
`;
|
|
1400
|
-
},
|
|
1401
|
-
const e =
|
|
1396
|
+
}, ft = (t) => {
|
|
1397
|
+
const e = he(t);
|
|
1402
1398
|
return e === void 0 ? {} : { segments: e.segments, riskLevel: e.riskLevel };
|
|
1403
|
-
},
|
|
1404
|
-
id:
|
|
1399
|
+
}, yt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), At = {
|
|
1400
|
+
id: X.WHEEL,
|
|
1405
1401
|
renderGame: () => l`<origami-wheel-game></origami-wheel-game>`,
|
|
1406
|
-
gameInfo:
|
|
1407
|
-
maxMultiplier: (t) =>
|
|
1408
|
-
verifierInputs:
|
|
1409
|
-
verifierQuery:
|
|
1410
|
-
extractOutcome:
|
|
1411
|
-
renderOutcome:
|
|
1402
|
+
gameInfo: Te,
|
|
1403
|
+
maxMultiplier: (t) => oe(t).toNumber(),
|
|
1404
|
+
verifierInputs: ft,
|
|
1405
|
+
verifierQuery: yt,
|
|
1406
|
+
extractOutcome: mt,
|
|
1407
|
+
renderOutcome: dt
|
|
1412
1408
|
};
|
|
1413
1409
|
export {
|
|
1414
1410
|
m as WheelGame,
|
|
1415
|
-
|
|
1411
|
+
At as wheelUiModule
|
|
1416
1412
|
};
|