@betorigami/game-ui-wheel 1.1.9 → 1.1.11
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 +218 -223
- package/dist/standalone.mjs +12707 -10365
- package/dist/wheel.api.d.ts +3 -4
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { css as
|
|
3
|
-
import { Wheel as
|
|
4
|
-
import { cache as
|
|
5
|
-
import { property as o, customElement as $, query as
|
|
6
|
-
import
|
|
7
|
-
import { sumPayout as
|
|
8
|
-
import { styleMap as
|
|
1
|
+
import { ProviderApi as ge, resolveApiErrorCode as ue, getTranslation as g, errorCodeToTranslationKey as me, ErrorCode as U, createMockGenerator as pe, OrigamiActionType as J, desktopContainerQuery as F, noiseClick as de, OrigamiElement as O, componentStyles as T, watch as te, RequiredContext as f, servicesContext as fe, skinContext as ye, preferencesContext as ve, mobileContainerQuery as be, localeContext as Y, limitsContext as se, layoutContext as ie, walletContext as we, calculateProfitOnWin as Se, formatMonetaryAmount as _e, getCurrencyIcon as $e, OrigamiGame as z, InvalidReason as xe, GameComponent as re, HotkeyController as ke, HotkeyHelper as ee, waitForEvent as Ee, formatAutobetSettings as Ae, getGameOutcome as Ie, calculateGameLayoutStyle as Me, isEndAction as Pe } from "@betorigami/game-ui-shared";
|
|
2
|
+
import { css as A, svg as q, nothing as Q, html as a, LitElement as De } from "lit";
|
|
3
|
+
import { Wheel as Oe, WheelRiskLevel as u, WheelSegments as L, getWheelPattern as Ce, getWheelSegmentMultipliers as Be, describeWheelOutcomes as We, isWheelRiskLevel as ne, isWheelSegments as le, WHEEL_RISK_LEVELS as Te, WHEEL_SEGMENT_OPTIONS as Le, getWheelMaxMultiplier as oe } from "@betorigami/game-wheel";
|
|
4
|
+
import { cache as Re } from "lit/directives/cache.js";
|
|
5
|
+
import { property as o, customElement as $, query as Z, state as v } from "lit/decorators.js";
|
|
6
|
+
import c from "big.js";
|
|
7
|
+
import { sumPayout as Ne } from "@betorigami/game-engine";
|
|
8
|
+
import { styleMap as Ue } from "lit/directives/style-map.js";
|
|
9
9
|
const He = {
|
|
10
10
|
overview: {
|
|
11
11
|
translation: {
|
|
@@ -47,7 +47,7 @@ const He = {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
class
|
|
50
|
+
class H {
|
|
51
51
|
/**
|
|
52
52
|
* Calculate exact target angle for a segment with pseudorandom position
|
|
53
53
|
* @param segmentIndex - Index of winning segment (0-based)
|
|
@@ -74,10 +74,10 @@ class j {
|
|
|
74
74
|
let n = 0, l = 0;
|
|
75
75
|
for (; ; ) {
|
|
76
76
|
l++;
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
77
|
+
const d = e * Math.exp(-i * l);
|
|
78
|
+
if (d < 0.01)
|
|
79
79
|
break;
|
|
80
|
-
n +=
|
|
80
|
+
n += d, s.push(n);
|
|
81
81
|
}
|
|
82
82
|
return s;
|
|
83
83
|
}
|
|
@@ -107,34 +107,28 @@ class j {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
class Fe {
|
|
110
|
-
constructor(e
|
|
111
|
-
this.
|
|
110
|
+
constructor(e) {
|
|
111
|
+
this.client = e;
|
|
112
112
|
}
|
|
113
113
|
async startBet(e) {
|
|
114
114
|
try {
|
|
115
|
-
const i = await
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
headers: {
|
|
119
|
-
"Content-Type": "application/json",
|
|
120
|
-
Authorization: `Bearer ${this.authToken}`,
|
|
121
|
-
"X-Origami-Trace": ce()
|
|
122
|
-
},
|
|
123
|
-
body: JSON.stringify({
|
|
115
|
+
const { data: i, error: r } = await ge.postGamesWheelPlay({
|
|
116
|
+
client: this.client,
|
|
117
|
+
body: {
|
|
124
118
|
amount: e.amount,
|
|
125
119
|
gameInputs: {
|
|
126
120
|
riskLevel: e.riskLevel,
|
|
127
121
|
segments: e.segments
|
|
128
122
|
},
|
|
129
123
|
meta: e.meta
|
|
130
|
-
}
|
|
131
|
-
})
|
|
132
|
-
if (i
|
|
133
|
-
return { success: !0, data:
|
|
134
|
-
const s =
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
if (i)
|
|
127
|
+
return { success: !0, data: i };
|
|
128
|
+
const s = ue(r);
|
|
135
129
|
return {
|
|
136
130
|
success: !1,
|
|
137
|
-
error: g(
|
|
131
|
+
error: g(me(s), e.language),
|
|
138
132
|
errorCode: s
|
|
139
133
|
};
|
|
140
134
|
} catch {
|
|
@@ -146,16 +140,16 @@ class Fe {
|
|
|
146
140
|
}
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
|
-
class
|
|
143
|
+
class je {
|
|
150
144
|
constructor(e) {
|
|
151
145
|
this.edge = e;
|
|
152
146
|
}
|
|
153
147
|
async startBet(e) {
|
|
154
|
-
const { amount: i, riskLevel: r, segments: s } = e, n = { riskLevel: r, segments: s, betAmount:
|
|
155
|
-
generator:
|
|
148
|
+
const { amount: i, riskLevel: r, segments: s } = e, n = { riskLevel: r, segments: s, betAmount: c(i) }, l = new Oe().getGameResult({
|
|
149
|
+
generator: pe(),
|
|
156
150
|
edge: this.edge,
|
|
157
151
|
gameInputs: n
|
|
158
|
-
}),
|
|
152
|
+
}), d = Ne(l.payout).toString();
|
|
159
153
|
return { success: !0, data: {
|
|
160
154
|
id: crypto.randomUUID(),
|
|
161
155
|
tenantId: "origami-casino",
|
|
@@ -163,7 +157,7 @@ class Ke {
|
|
|
163
157
|
tenantUserId: "mock-user",
|
|
164
158
|
gameId: "wheel",
|
|
165
159
|
amount: i,
|
|
166
|
-
payout:
|
|
160
|
+
payout: d,
|
|
167
161
|
afterBalance: "1000",
|
|
168
162
|
multiplier: l.payoutMultiplier.toString(),
|
|
169
163
|
clientSeed: "mock-seed",
|
|
@@ -187,7 +181,7 @@ class Ke {
|
|
|
187
181
|
} };
|
|
188
182
|
}
|
|
189
183
|
}
|
|
190
|
-
const
|
|
184
|
+
const Ke = A`
|
|
191
185
|
:host {
|
|
192
186
|
width: 100%;
|
|
193
187
|
height: 100%;
|
|
@@ -206,7 +200,7 @@ const Ge = I`
|
|
|
206
200
|
display: none;
|
|
207
201
|
}
|
|
208
202
|
|
|
209
|
-
${
|
|
203
|
+
${F} {
|
|
210
204
|
:host {
|
|
211
205
|
grid-template-rows: auto 1fr auto;
|
|
212
206
|
padding-bottom: 0;
|
|
@@ -216,7 +210,7 @@ const Ge = I`
|
|
|
216
210
|
}
|
|
217
211
|
}
|
|
218
212
|
}
|
|
219
|
-
`,
|
|
213
|
+
`, Ge = A`
|
|
220
214
|
:host {
|
|
221
215
|
width: 100%;
|
|
222
216
|
height: 100%;
|
|
@@ -276,7 +270,7 @@ const Ge = I`
|
|
|
276
270
|
display: none;
|
|
277
271
|
}
|
|
278
272
|
|
|
279
|
-
${
|
|
273
|
+
${F} {
|
|
280
274
|
.wheel-box {
|
|
281
275
|
aspect-ratio: 1 / 1;
|
|
282
276
|
height: auto;
|
|
@@ -325,17 +319,17 @@ const Ge = I`
|
|
|
325
319
|
RED: "var(--wheel-color-red)",
|
|
326
320
|
BLUE: "var(--wheel-color-blue)",
|
|
327
321
|
PURPLE: "var(--wheel-color-purple)"
|
|
328
|
-
},
|
|
322
|
+
}, qe = {
|
|
329
323
|
ZERO: C.BLACK,
|
|
330
324
|
A: C.GREEN,
|
|
331
325
|
B: C.YELLOW,
|
|
332
326
|
C: C.BLUE,
|
|
333
327
|
D: C.RED,
|
|
334
328
|
E: C.PURPLE
|
|
335
|
-
}, ae = (t) =>
|
|
336
|
-
layers: [
|
|
329
|
+
}, ae = (t) => qe[t], G = 9, Ve = 0.08, Ye = 0.8, ze = 1e4, Qe = () => ({
|
|
330
|
+
layers: [de(2800, { duration: 15e-4, decay: 8, gain: 0.6 })],
|
|
337
331
|
gainScale: 1
|
|
338
|
-
}), Ze =
|
|
332
|
+
}), Ze = A`
|
|
339
333
|
:host {
|
|
340
334
|
--wheel-color-black: #1a1a1a;
|
|
341
335
|
--wheel-color-green: #00d084;
|
|
@@ -356,17 +350,17 @@ const Ge = I`
|
|
|
356
350
|
}
|
|
357
351
|
}
|
|
358
352
|
`;
|
|
359
|
-
var
|
|
360
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
353
|
+
var Xe = Object.defineProperty, Je = Object.getOwnPropertyDescriptor, j = (t, e, i, r) => {
|
|
354
|
+
for (var s = r > 1 ? void 0 : r ? Je(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
361
355
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
362
|
-
return r && s &&
|
|
356
|
+
return r && s && Xe(e, i, s), s;
|
|
363
357
|
};
|
|
364
|
-
let
|
|
358
|
+
let B = class extends O {
|
|
365
359
|
constructor() {
|
|
366
|
-
super(...arguments), this.risk =
|
|
360
|
+
super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.highlightedSegments = [];
|
|
367
361
|
}
|
|
368
362
|
generateWheelPaths() {
|
|
369
|
-
const t =
|
|
363
|
+
const t = Ce({ riskLevel: this.risk, segments: this.segments }), e = { cx: 285, cy: 285 }, i = 284.371, r = 2 * Math.PI / this.segments, s = [];
|
|
370
364
|
for (let n = 0; n < this.segments; n++) {
|
|
371
365
|
const l = ae(t[n]), _ = this.highlightedSegments.length > 0 && !this.highlightedSegments.includes(n) ? 0.25 : 1, k = n * r - Math.PI / 2, E = (n + 1) * r - Math.PI / 2, P = {
|
|
372
366
|
x: e.cx + i * Math.cos(k),
|
|
@@ -405,27 +399,27 @@ let T = class extends D {
|
|
|
405
399
|
`;
|
|
406
400
|
}
|
|
407
401
|
};
|
|
408
|
-
|
|
409
|
-
|
|
402
|
+
B.styles = [Ze];
|
|
403
|
+
j([
|
|
410
404
|
o({ type: String })
|
|
411
|
-
],
|
|
412
|
-
|
|
405
|
+
], B.prototype, "risk", 2);
|
|
406
|
+
j([
|
|
413
407
|
o({ type: Number })
|
|
414
|
-
],
|
|
415
|
-
|
|
408
|
+
], B.prototype, "segments", 2);
|
|
409
|
+
j([
|
|
416
410
|
o({ type: Array })
|
|
417
|
-
],
|
|
418
|
-
|
|
411
|
+
], B.prototype, "highlightedSegments", 2);
|
|
412
|
+
B = j([
|
|
419
413
|
$("origami-wheel-svg")
|
|
420
|
-
],
|
|
421
|
-
var
|
|
422
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
414
|
+
], B);
|
|
415
|
+
var et = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, p = (t, e, i, r) => {
|
|
416
|
+
for (var s = r > 1 ? void 0 : r ? tt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
423
417
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
424
|
-
return r && s &&
|
|
418
|
+
return r && s && et(e, i, s), s;
|
|
425
419
|
};
|
|
426
|
-
let h = class extends
|
|
420
|
+
let h = class extends O {
|
|
427
421
|
constructor() {
|
|
428
|
-
super(...arguments), this.services = new f(this,
|
|
422
|
+
super(...arguments), this.services = new f(this, fe), this.skin = new f(this, ye), this.preferences = new f(this, ve), 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;
|
|
429
423
|
}
|
|
430
424
|
firstUpdated() {
|
|
431
425
|
this._updateTransform();
|
|
@@ -442,10 +436,10 @@ let h = class extends D {
|
|
|
442
436
|
this._angle = this.targetAngle, this._updateTransform(), this._stopLoop(), this.emit("wheel-spin-complete");
|
|
443
437
|
return;
|
|
444
438
|
}
|
|
445
|
-
const t = this._isInstantBet ? Ye :
|
|
446
|
-
this._decelerationOffsets =
|
|
439
|
+
const t = this._isInstantBet ? Ye : Ve;
|
|
440
|
+
this._decelerationOffsets = H.generateDecelerationOffsets(G, t);
|
|
447
441
|
const e = this._decelerationOffsets[this._decelerationOffsets.length - 1];
|
|
448
|
-
this._decelerationStartAngle =
|
|
442
|
+
this._decelerationStartAngle = H.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
|
|
449
443
|
}
|
|
450
444
|
handleIsPlayingChange() {
|
|
451
445
|
this.isPlaying && this._rafId === null && !this._isInstantBet ? this._startLoop() : !this.isPlaying && this._rafId !== null && this._stopLoop();
|
|
@@ -466,7 +460,7 @@ let h = class extends D {
|
|
|
466
460
|
this._angle += G;
|
|
467
461
|
this._updateTransform();
|
|
468
462
|
const r = 360 / this.segments;
|
|
469
|
-
Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.services.value.soundEffects.play(
|
|
463
|
+
Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.services.value.soundEffects.play(Qe()), this._rafId = requestAnimationFrame(t);
|
|
470
464
|
};
|
|
471
465
|
this._rafId === null && (this._rafId = requestAnimationFrame(t));
|
|
472
466
|
}
|
|
@@ -519,44 +513,44 @@ let h = class extends D {
|
|
|
519
513
|
`;
|
|
520
514
|
}
|
|
521
515
|
};
|
|
522
|
-
h.styles = [
|
|
523
|
-
|
|
516
|
+
h.styles = [T, Ge];
|
|
517
|
+
p([
|
|
524
518
|
o({ type: Boolean })
|
|
525
519
|
], h.prototype, "isPlaying", 2);
|
|
526
|
-
|
|
520
|
+
p([
|
|
527
521
|
o({ type: Boolean })
|
|
528
522
|
], h.prototype, "staticDisplay", 2);
|
|
529
|
-
|
|
523
|
+
p([
|
|
530
524
|
o({ type: Boolean })
|
|
531
525
|
], h.prototype, "ignoreInstantBet", 2);
|
|
532
|
-
|
|
526
|
+
p([
|
|
533
527
|
o({ type: String })
|
|
534
528
|
], h.prototype, "risk", 2);
|
|
535
|
-
|
|
529
|
+
p([
|
|
536
530
|
o({ type: Number })
|
|
537
531
|
], h.prototype, "segments", 2);
|
|
538
|
-
|
|
532
|
+
p([
|
|
539
533
|
o({ type: Number })
|
|
540
534
|
], h.prototype, "targetAngle", 2);
|
|
541
|
-
|
|
535
|
+
p([
|
|
542
536
|
o({ type: Number })
|
|
543
537
|
], h.prototype, "resultSegment", 2);
|
|
544
|
-
|
|
538
|
+
p([
|
|
545
539
|
o({ type: Array })
|
|
546
540
|
], h.prototype, "hoveredSegments", 2);
|
|
547
|
-
|
|
548
|
-
|
|
541
|
+
p([
|
|
542
|
+
Z(".wheel-svg")
|
|
549
543
|
], h.prototype, "_wheelEl", 2);
|
|
550
|
-
|
|
544
|
+
p([
|
|
551
545
|
te("targetAngle")
|
|
552
546
|
], h.prototype, "handleTargetAngleChange", 1);
|
|
553
|
-
|
|
547
|
+
p([
|
|
554
548
|
te("isPlaying")
|
|
555
549
|
], h.prototype, "handleIsPlayingChange", 1);
|
|
556
|
-
h =
|
|
550
|
+
h = p([
|
|
557
551
|
$("origami-wheel-animator")
|
|
558
552
|
], h);
|
|
559
|
-
const
|
|
553
|
+
const st = A`
|
|
560
554
|
:host {
|
|
561
555
|
display: flex;
|
|
562
556
|
flex-direction: column;
|
|
@@ -676,7 +670,7 @@ const it = I`
|
|
|
676
670
|
cursor: help;
|
|
677
671
|
}
|
|
678
672
|
|
|
679
|
-
${
|
|
673
|
+
${be} {
|
|
680
674
|
:host .tiles {
|
|
681
675
|
display: flex;
|
|
682
676
|
flex-wrap: nowrap;
|
|
@@ -693,14 +687,14 @@ const it = I`
|
|
|
693
687
|
}
|
|
694
688
|
}
|
|
695
689
|
`;
|
|
696
|
-
var
|
|
697
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
690
|
+
var it = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, R = (t, e, i, r) => {
|
|
691
|
+
for (var s = r > 1 ? void 0 : r ? rt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
698
692
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
699
|
-
return r && s &&
|
|
693
|
+
return r && s && it(e, i, s), s;
|
|
700
694
|
};
|
|
701
|
-
let
|
|
695
|
+
let D = class extends O {
|
|
702
696
|
constructor() {
|
|
703
|
-
super(...arguments), this.locale = new f(this,
|
|
697
|
+
super(...arguments), this.locale = new f(this, Y), this.limits = new f(this, se), this.layout = new f(this, ie), this.wallet = new f(this, we), this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.resultSegment = null, this.hoveredTileIndex = null;
|
|
704
698
|
}
|
|
705
699
|
get edge() {
|
|
706
700
|
return this.limits.value.edge;
|
|
@@ -738,14 +732,14 @@ let O = class extends D {
|
|
|
738
732
|
this.layout.value.isDesktop && (this.hoveredTileIndex = null, this.emit("wheel-multiplier-hover", { detail: { segments: [] } }));
|
|
739
733
|
}
|
|
740
734
|
formatProfit(t) {
|
|
741
|
-
const { betAmount: e } = this.wallet.value, { maxPayout: i } = this.limits.value, { currency: r } = this.locale.value, s =
|
|
742
|
-
return
|
|
735
|
+
const { betAmount: e } = this.wallet.value, { maxPayout: i } = this.limits.value, { currency: r } = this.locale.value, s = Se({ betAmount: c(e), multiplier: t, maxPayout: c(i) });
|
|
736
|
+
return _e(s.toFixed(), r, { includeSymbol: !1 });
|
|
743
737
|
}
|
|
744
738
|
formatChance(t, e) {
|
|
745
739
|
return `${t}/${e}`;
|
|
746
740
|
}
|
|
747
741
|
render() {
|
|
748
|
-
const t = this.tiles, e = Math.min(t.length, 6), { language: i } = this.locale.value, r = this.activeTileIndex, s = t[r], n = t.reduce((_, k) => _ + k.weight, 0), l = this.formatProfit(s.multiplier),
|
|
742
|
+
const t = this.tiles, e = Math.min(t.length, 6), { language: i } = this.locale.value, r = this.activeTileIndex, s = t[r], n = t.reduce((_, k) => _ + k.weight, 0), l = this.formatProfit(s.multiplier), d = this.formatChance(s.weight, n);
|
|
749
743
|
return a`
|
|
750
744
|
<div class="container">
|
|
751
745
|
${this.layout.value.isDesktop ? a`<div class="multiplier-info">
|
|
@@ -761,14 +755,14 @@ let O = class extends D {
|
|
|
761
755
|
.offset=${6}
|
|
762
756
|
inline
|
|
763
757
|
>
|
|
764
|
-
<span class="info-icon">${
|
|
758
|
+
<span class="info-icon">${$e(this.locale.value.currency)}</span>
|
|
765
759
|
</origami-tooltip>
|
|
766
760
|
</div>
|
|
767
761
|
|
|
768
762
|
<div class="info-item">
|
|
769
763
|
<div>
|
|
770
764
|
<span class="label">${g("common.winChance", i)}:</span>
|
|
771
|
-
<span class="value">${
|
|
765
|
+
<span class="value">${d}</span>
|
|
772
766
|
</div>
|
|
773
767
|
<lottie-icon
|
|
774
768
|
src="https://assets.betorigami.com/games/animations/percentage_symbol.json"
|
|
@@ -780,20 +774,20 @@ let O = class extends D {
|
|
|
780
774
|
|
|
781
775
|
<div class="tiles" role="list" style="--grid-columns: ${e}" @mouseleave=${() => this.handleTileMouseLeave()}>
|
|
782
776
|
${t.map(({ slot: _, multiplier: k }, E) => {
|
|
783
|
-
const P = `${k.toString()}X`, N = ae(_),
|
|
777
|
+
const P = `${k.toString()}X`, N = ae(_), X = this.hoveredTileIndex === E;
|
|
784
778
|
return a`
|
|
785
779
|
<div
|
|
786
780
|
class="tile"
|
|
787
781
|
role="listitem"
|
|
788
|
-
hovered=${
|
|
789
|
-
active=${!
|
|
782
|
+
hovered=${X}
|
|
783
|
+
active=${!X && E === r}
|
|
790
784
|
@mouseenter=${() => this.handleTileMouseEnter(E)}
|
|
791
785
|
>
|
|
792
786
|
<div class="tile-content">
|
|
793
787
|
<span class="tile-label">${P}</span>
|
|
794
788
|
<span
|
|
795
789
|
class="dot"
|
|
796
|
-
style=${
|
|
790
|
+
style=${Ue({ backgroundColor: N })}
|
|
797
791
|
aria-hidden="true"
|
|
798
792
|
></span>
|
|
799
793
|
</div>
|
|
@@ -805,30 +799,30 @@ let O = class extends D {
|
|
|
805
799
|
`;
|
|
806
800
|
}
|
|
807
801
|
};
|
|
808
|
-
|
|
802
|
+
D.styles = [T, st];
|
|
809
803
|
R([
|
|
810
804
|
o({ type: String })
|
|
811
|
-
],
|
|
805
|
+
], D.prototype, "risk", 2);
|
|
812
806
|
R([
|
|
813
807
|
o({ type: Number })
|
|
814
|
-
],
|
|
808
|
+
], D.prototype, "segments", 2);
|
|
815
809
|
R([
|
|
816
810
|
o({ type: Number })
|
|
817
|
-
],
|
|
811
|
+
], D.prototype, "resultSegment", 2);
|
|
818
812
|
R([
|
|
819
|
-
|
|
820
|
-
],
|
|
821
|
-
|
|
813
|
+
v()
|
|
814
|
+
], D.prototype, "hoveredTileIndex", 2);
|
|
815
|
+
D = R([
|
|
822
816
|
$("origami-wheel-content-bottom")
|
|
823
|
-
],
|
|
824
|
-
var
|
|
825
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
817
|
+
], D);
|
|
818
|
+
var nt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, I = (t, e, i, r) => {
|
|
819
|
+
for (var s = r > 1 ? void 0 : r ? lt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
826
820
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
827
|
-
return r && s &&
|
|
821
|
+
return r && s && nt(e, i, s), s;
|
|
828
822
|
};
|
|
829
|
-
let
|
|
823
|
+
let b = class extends O {
|
|
830
824
|
constructor() {
|
|
831
|
-
super(...arguments), this.isPlaying = !1, this.history = [], this.risk =
|
|
825
|
+
super(...arguments), this.isPlaying = !1, this.history = [], this.risk = u.MEDIUM_RISK, this.segments = 10, this.targetAngle = null, this.resultSegment = null, this.hoveredSegments = [];
|
|
832
826
|
}
|
|
833
827
|
handleMultiplierHover(t) {
|
|
834
828
|
this.hoveredSegments = t.detail.segments;
|
|
@@ -836,7 +830,7 @@ let v = class extends D {
|
|
|
836
830
|
render() {
|
|
837
831
|
return a`
|
|
838
832
|
<origami-history-pills
|
|
839
|
-
.gameType=${
|
|
833
|
+
.gameType=${z.WHEEL}
|
|
840
834
|
.history=${[...this.history].reverse()}
|
|
841
835
|
></origami-history-pills>
|
|
842
836
|
|
|
@@ -860,32 +854,32 @@ let v = class extends D {
|
|
|
860
854
|
`;
|
|
861
855
|
}
|
|
862
856
|
};
|
|
863
|
-
|
|
864
|
-
|
|
857
|
+
b.styles = [T, Ke];
|
|
858
|
+
I([
|
|
865
859
|
o({ type: Boolean })
|
|
866
|
-
],
|
|
867
|
-
|
|
860
|
+
], b.prototype, "isPlaying", 2);
|
|
861
|
+
I([
|
|
868
862
|
o({ type: Array })
|
|
869
|
-
],
|
|
870
|
-
|
|
863
|
+
], b.prototype, "history", 2);
|
|
864
|
+
I([
|
|
871
865
|
o({ type: String })
|
|
872
|
-
],
|
|
873
|
-
|
|
866
|
+
], b.prototype, "risk", 2);
|
|
867
|
+
I([
|
|
874
868
|
o({ type: Number })
|
|
875
|
-
],
|
|
876
|
-
|
|
869
|
+
], b.prototype, "segments", 2);
|
|
870
|
+
I([
|
|
877
871
|
o({ type: Number })
|
|
878
|
-
],
|
|
879
|
-
|
|
872
|
+
], b.prototype, "targetAngle", 2);
|
|
873
|
+
I([
|
|
880
874
|
o({ type: Number })
|
|
881
|
-
],
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
],
|
|
885
|
-
|
|
875
|
+
], b.prototype, "resultSegment", 2);
|
|
876
|
+
I([
|
|
877
|
+
v()
|
|
878
|
+
], b.prototype, "hoveredSegments", 2);
|
|
879
|
+
b = I([
|
|
886
880
|
$("origami-wheel-layout")
|
|
887
|
-
],
|
|
888
|
-
const he =
|
|
881
|
+
], b);
|
|
882
|
+
const he = A`
|
|
889
883
|
:host {
|
|
890
884
|
display: flex;
|
|
891
885
|
flex-direction: column;
|
|
@@ -910,12 +904,12 @@ const he = I`
|
|
|
910
904
|
grid-column: span 2;
|
|
911
905
|
}
|
|
912
906
|
|
|
913
|
-
${
|
|
907
|
+
${F} {
|
|
914
908
|
:host .action-section {
|
|
915
909
|
order: 0;
|
|
916
910
|
}
|
|
917
911
|
}
|
|
918
|
-
`,
|
|
912
|
+
`, ot = A`
|
|
919
913
|
:host {
|
|
920
914
|
display: contents;
|
|
921
915
|
}
|
|
@@ -924,19 +918,19 @@ const he = I`
|
|
|
924
918
|
grid-column: span 2;
|
|
925
919
|
}
|
|
926
920
|
`;
|
|
927
|
-
var
|
|
928
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
921
|
+
var at = Object.defineProperty, ht = Object.getOwnPropertyDescriptor, K = (t, e, i, r) => {
|
|
922
|
+
for (var s = r > 1 ? void 0 : r ? ht(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
929
923
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
930
|
-
return r && s &&
|
|
924
|
+
return r && s && at(e, i, s), s;
|
|
931
925
|
};
|
|
932
926
|
const ct = {
|
|
933
|
-
[
|
|
934
|
-
[
|
|
935
|
-
[
|
|
927
|
+
[u.LOW_RISK]: "common.low",
|
|
928
|
+
[u.MEDIUM_RISK]: "common.medium",
|
|
929
|
+
[u.HIGH_RISK]: "common.high"
|
|
936
930
|
};
|
|
937
|
-
let
|
|
931
|
+
let W = class extends O {
|
|
938
932
|
constructor() {
|
|
939
|
-
super(...arguments), this.locale = new f(this,
|
|
933
|
+
super(...arguments), this.locale = new f(this, Y), this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.disabled = !1;
|
|
940
934
|
}
|
|
941
935
|
handleRiskChange(t) {
|
|
942
936
|
const { value: e } = t.detail;
|
|
@@ -952,7 +946,7 @@ let B = class extends D {
|
|
|
952
946
|
<origami-select
|
|
953
947
|
class="grid-full-width"
|
|
954
948
|
label=${g("common.risk", t)}
|
|
955
|
-
.options=${
|
|
949
|
+
.options=${Te.map((e) => ({ value: e, label: g(ct[e], t) }))}
|
|
956
950
|
.value=${this.risk}
|
|
957
951
|
@select-change=${this.handleRiskChange}
|
|
958
952
|
?disabled=${this.disabled}
|
|
@@ -961,7 +955,7 @@ let B = class extends D {
|
|
|
961
955
|
<origami-select
|
|
962
956
|
class="grid-full-width"
|
|
963
957
|
label=${g("games.wheel.segments", t)}
|
|
964
|
-
.options=${
|
|
958
|
+
.options=${Le.map((e) => ({ value: e.toString(), label: e.toString() }))}
|
|
965
959
|
.value=${this.segments.toString()}
|
|
966
960
|
@select-change=${this.handleSegmentsChange}
|
|
967
961
|
?disabled=${this.disabled}
|
|
@@ -969,27 +963,27 @@ let B = class extends D {
|
|
|
969
963
|
`;
|
|
970
964
|
}
|
|
971
965
|
};
|
|
972
|
-
|
|
966
|
+
W.styles = [T, ot];
|
|
973
967
|
K([
|
|
974
968
|
o({ type: String })
|
|
975
|
-
],
|
|
969
|
+
], W.prototype, "risk", 2);
|
|
976
970
|
K([
|
|
977
971
|
o({ type: Number })
|
|
978
|
-
],
|
|
972
|
+
], W.prototype, "segments", 2);
|
|
979
973
|
K([
|
|
980
974
|
o({ type: Boolean })
|
|
981
|
-
],
|
|
982
|
-
|
|
975
|
+
], W.prototype, "disabled", 2);
|
|
976
|
+
W = K([
|
|
983
977
|
$("origami-wheel-selectors")
|
|
984
|
-
],
|
|
985
|
-
var
|
|
986
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
978
|
+
], W);
|
|
979
|
+
var gt = Object.defineProperty, ut = Object.getOwnPropertyDescriptor, x = (t, e, i, r) => {
|
|
980
|
+
for (var s = r > 1 ? void 0 : r ? ut(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
987
981
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
988
|
-
return r && s &&
|
|
982
|
+
return r && s && gt(e, i, s), s;
|
|
989
983
|
};
|
|
990
|
-
let y = class extends
|
|
984
|
+
let y = class extends O {
|
|
991
985
|
constructor() {
|
|
992
|
-
super(...arguments), this.locale = new f(this,
|
|
986
|
+
super(...arguments), this.locale = new f(this, Y), this.isPlaying = !1, this.betDisabled = !1, this.inputsDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.betMaxMultiplier = c(1), this.isBetAmountValid = !0, this._betAboveBalance = !1;
|
|
993
987
|
}
|
|
994
988
|
render() {
|
|
995
989
|
const t = this.locale.value.language;
|
|
@@ -1002,7 +996,7 @@ let y = class extends D {
|
|
|
1002
996
|
this.isBetAmountValid = e.detail.isValid;
|
|
1003
997
|
}}
|
|
1004
998
|
@bet-amount-input-error-change=${(e) => {
|
|
1005
|
-
this._betAboveBalance = e.detail.invalidReason ===
|
|
999
|
+
this._betAboveBalance = e.detail.invalidReason === xe.BET_AMOUNT_ABOVE_BALANCE;
|
|
1006
1000
|
}}
|
|
1007
1001
|
></origami-bet-amount-input>
|
|
1008
1002
|
|
|
@@ -1024,7 +1018,7 @@ let y = class extends D {
|
|
|
1024
1018
|
`;
|
|
1025
1019
|
}
|
|
1026
1020
|
};
|
|
1027
|
-
y.styles = [
|
|
1021
|
+
y.styles = [T, he];
|
|
1028
1022
|
x([
|
|
1029
1023
|
o({ type: Boolean })
|
|
1030
1024
|
], y.prototype, "isPlaying", 2);
|
|
@@ -1044,22 +1038,22 @@ x([
|
|
|
1044
1038
|
o({ attribute: !1 })
|
|
1045
1039
|
], y.prototype, "betMaxMultiplier", 2);
|
|
1046
1040
|
x([
|
|
1047
|
-
|
|
1041
|
+
v()
|
|
1048
1042
|
], y.prototype, "isBetAmountValid", 2);
|
|
1049
1043
|
x([
|
|
1050
|
-
|
|
1044
|
+
v()
|
|
1051
1045
|
], y.prototype, "_betAboveBalance", 2);
|
|
1052
1046
|
y = x([
|
|
1053
1047
|
$("origami-wheel-manual")
|
|
1054
1048
|
], y);
|
|
1055
|
-
var
|
|
1056
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1049
|
+
var mt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, M = (t, e, i, r) => {
|
|
1050
|
+
for (var s = r > 1 ? void 0 : r ? pt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
1057
1051
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
1058
|
-
return r && s &&
|
|
1052
|
+
return r && s && mt(e, i, s), s;
|
|
1059
1053
|
};
|
|
1060
|
-
let w = class extends
|
|
1054
|
+
let w = class extends O {
|
|
1061
1055
|
constructor() {
|
|
1062
|
-
super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.risk =
|
|
1056
|
+
super(...arguments), this.inputsDisabled = !1, this.autobetStopping = !1, this.autobetInProgress = !1, this.betDisabled = !1, this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.betMaxMultiplier = c(1);
|
|
1063
1057
|
}
|
|
1064
1058
|
render() {
|
|
1065
1059
|
return a`
|
|
@@ -1079,7 +1073,7 @@ let w = class extends D {
|
|
|
1079
1073
|
`;
|
|
1080
1074
|
}
|
|
1081
1075
|
};
|
|
1082
|
-
w.styles = [
|
|
1076
|
+
w.styles = [T, he];
|
|
1083
1077
|
M([
|
|
1084
1078
|
o({ type: Boolean })
|
|
1085
1079
|
], w.prototype, "inputsDisabled", 2);
|
|
@@ -1104,7 +1098,7 @@ M([
|
|
|
1104
1098
|
w = M([
|
|
1105
1099
|
$("origami-wheel-auto")
|
|
1106
1100
|
], w);
|
|
1107
|
-
const
|
|
1101
|
+
const dt = A`
|
|
1108
1102
|
:host {
|
|
1109
1103
|
height: 100%;
|
|
1110
1104
|
}
|
|
@@ -1113,14 +1107,14 @@ const ft = I`
|
|
|
1113
1107
|
display: block;
|
|
1114
1108
|
}
|
|
1115
1109
|
`;
|
|
1116
|
-
var
|
|
1117
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
1110
|
+
var ft = Object.defineProperty, yt = Object.getOwnPropertyDescriptor, S = (t, e, i, r) => {
|
|
1111
|
+
for (var s = r > 1 ? void 0 : r ? yt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
1118
1112
|
(l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
|
|
1119
|
-
return r && s &&
|
|
1113
|
+
return r && s && ft(e, i, s), s;
|
|
1120
1114
|
};
|
|
1121
|
-
let
|
|
1115
|
+
let m = class extends re {
|
|
1122
1116
|
constructor() {
|
|
1123
|
-
super(), this.limits = new f(this, se), this.layout = new f(this, ie), this.isManualPlaying = !1, this.history = [], this.wheelRisk =
|
|
1117
|
+
super(), this.limits = new f(this, se), this.layout = new f(this, ie), this.isManualPlaying = !1, this.history = [], this.wheelRisk = u.MEDIUM_RISK, this.numberOfSegments = 10, this.targetAngle = null, this.resultSegment = null, this.isWheelSpinning = !1, new ke(this, [
|
|
1124
1118
|
{
|
|
1125
1119
|
key: " ",
|
|
1126
1120
|
callback: () => ee.clickBetButton(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl),
|
|
@@ -1139,7 +1133,7 @@ let u = class extends re {
|
|
|
1139
1133
|
this.numberOfSegments = t.detail.value, this.resultSegment = null;
|
|
1140
1134
|
}
|
|
1141
1135
|
get wheelApi() {
|
|
1142
|
-
return this.session.value.isDemoMode ? new
|
|
1136
|
+
return this.session.value.isDemoMode ? new je(this.limits.value.edge) : new Fe(this.services.value.providerApi);
|
|
1143
1137
|
}
|
|
1144
1138
|
get isToggleDisabled() {
|
|
1145
1139
|
return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
|
|
@@ -1148,13 +1142,13 @@ let u = class extends re {
|
|
|
1148
1142
|
return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
|
|
1149
1143
|
}
|
|
1150
1144
|
wheelSpinCompletedPromise() {
|
|
1151
|
-
return
|
|
1145
|
+
return Ee(this, "wheel-spin-complete", void 0, ze, !0);
|
|
1152
1146
|
}
|
|
1153
1147
|
async handleBetExecution(t, e) {
|
|
1154
1148
|
this.resetForNextBet(() => {
|
|
1155
1149
|
this.targetAngle = null, this.resultSegment = null;
|
|
1156
1150
|
});
|
|
1157
|
-
const i =
|
|
1151
|
+
const i = c(this.wallet.value.balance);
|
|
1158
1152
|
try {
|
|
1159
1153
|
if (this.session.value.isDemoMode && i.lt(t))
|
|
1160
1154
|
throw new Error(g("alerts.insufficientBalance", this.locale.value.language));
|
|
@@ -1171,16 +1165,16 @@ let u = class extends re {
|
|
|
1171
1165
|
})
|
|
1172
1166
|
);
|
|
1173
1167
|
if (s.success) {
|
|
1174
|
-
const { data: n } = s, l = Number(n.multiplier ?? 0), { betActions:
|
|
1168
|
+
const { data: n } = s, l = Number(n.multiplier ?? 0), { betActions: d } = n, _ = d[d.length - 1];
|
|
1175
1169
|
if (_?.data?.WHEEL) {
|
|
1176
1170
|
const { result: P } = _.data.WHEEL;
|
|
1177
|
-
this.resultSegment = P[0] ?? 0, this.targetAngle =
|
|
1171
|
+
this.resultSegment = P[0] ?? 0, this.targetAngle = H.calculateTargetAngle(this.resultSegment, this.numberOfSegments, n.id);
|
|
1178
1172
|
}
|
|
1179
1173
|
r && await this.wheelSpinCompletedPromise(), this.isWheelSpinning = !1;
|
|
1180
|
-
const k =
|
|
1174
|
+
const k = c(l).gt(0);
|
|
1181
1175
|
this.history = [...this.history, { multiplier: l, won: k, id: n.id }], this.updateHistoryWithBet(n);
|
|
1182
|
-
const E = this.session.value.isDemoMode ? i.minus(n.amount ?? 0).plus(n.payout ?? 0) :
|
|
1183
|
-
return this.wallet.value.updateBalance(E),
|
|
1176
|
+
const E = this.session.value.isDemoMode ? i.minus(n.amount ?? 0).plus(n.payout ?? 0) : c(n.afterBalance ?? 0);
|
|
1177
|
+
return this.wallet.value.updateBalance(E), c(l).gt(1) && this.playWinFeedback(), s;
|
|
1184
1178
|
} else
|
|
1185
1179
|
return this.wallet.value.updateBalance(i), this.isWheelSpinning = !1, s;
|
|
1186
1180
|
} catch (r) {
|
|
@@ -1200,19 +1194,20 @@ let u = class extends re {
|
|
|
1200
1194
|
const i = await this.handleBetExecution(e, t);
|
|
1201
1195
|
if (!i.success)
|
|
1202
1196
|
return {
|
|
1203
|
-
pnl:
|
|
1197
|
+
pnl: c(0),
|
|
1204
1198
|
gameOutcome: "Draw",
|
|
1205
1199
|
hasError: !0,
|
|
1200
|
+
afterBalance: null,
|
|
1206
1201
|
errorCode: i.errorCode ?? U.UNKNOWN,
|
|
1207
1202
|
errorMessage: i.error || g("alerts.errorProcessingBet", this.locale.value.language)
|
|
1208
1203
|
};
|
|
1209
|
-
const r = i.data, s =
|
|
1210
|
-
return await this.holdResultDisplay(), { pnl: s, gameOutcome: l, hasError: !1 };
|
|
1204
|
+
const r = i.data, s = c(r.payout ?? 0).minus(r.amount ?? 0), n = Number(r.multiplier), l = Ie(n);
|
|
1205
|
+
return await this.holdResultDisplay(), { pnl: s, gameOutcome: l, hasError: !1, afterBalance: r.afterBalance ? c(r.afterBalance) : null };
|
|
1211
1206
|
}
|
|
1212
1207
|
render() {
|
|
1213
|
-
const t = oe(this.limits.value.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), e = !1, i =
|
|
1208
|
+
const t = oe(this.limits.value.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), e = !1, i = Me(this.layout.value);
|
|
1214
1209
|
return a`
|
|
1215
|
-
<origami-game-layout style=${i} .gameType=${
|
|
1210
|
+
<origami-game-layout style=${i} .gameType=${z.WHEEL}>
|
|
1216
1211
|
<origami-game-sidebar
|
|
1217
1212
|
slot="control-panel"
|
|
1218
1213
|
?toggleDisabled=${this.isToggleDisabled}
|
|
@@ -1221,7 +1216,7 @@ let u = class extends re {
|
|
|
1221
1216
|
@wheel-risk-change=${this.handleWheelRiskChange}
|
|
1222
1217
|
@wheel-segments-change=${this.handleWheelSegmentsChange}
|
|
1223
1218
|
>
|
|
1224
|
-
${
|
|
1219
|
+
${Re(
|
|
1225
1220
|
this.manualOrAuto === "Manual" ? a`<origami-wheel-manual
|
|
1226
1221
|
slot="controls"
|
|
1227
1222
|
.inputsDisabled=${this.areInputsDisabled}
|
|
@@ -1268,38 +1263,38 @@ let u = class extends re {
|
|
|
1268
1263
|
`;
|
|
1269
1264
|
}
|
|
1270
1265
|
};
|
|
1271
|
-
|
|
1266
|
+
m.styles = [...re.styles, dt];
|
|
1272
1267
|
S([
|
|
1273
|
-
|
|
1274
|
-
],
|
|
1268
|
+
v()
|
|
1269
|
+
], m.prototype, "isManualPlaying", 2);
|
|
1275
1270
|
S([
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1271
|
+
v()
|
|
1272
|
+
], m.prototype, "history", 2);
|
|
1278
1273
|
S([
|
|
1279
|
-
|
|
1280
|
-
],
|
|
1274
|
+
v()
|
|
1275
|
+
], m.prototype, "wheelRisk", 2);
|
|
1281
1276
|
S([
|
|
1282
|
-
|
|
1283
|
-
],
|
|
1277
|
+
v()
|
|
1278
|
+
], m.prototype, "numberOfSegments", 2);
|
|
1284
1279
|
S([
|
|
1285
|
-
|
|
1286
|
-
],
|
|
1280
|
+
v()
|
|
1281
|
+
], m.prototype, "targetAngle", 2);
|
|
1287
1282
|
S([
|
|
1288
|
-
|
|
1289
|
-
],
|
|
1283
|
+
v()
|
|
1284
|
+
], m.prototype, "resultSegment", 2);
|
|
1290
1285
|
S([
|
|
1291
|
-
|
|
1292
|
-
],
|
|
1286
|
+
v()
|
|
1287
|
+
], m.prototype, "isWheelSpinning", 2);
|
|
1293
1288
|
S([
|
|
1294
|
-
|
|
1295
|
-
],
|
|
1289
|
+
Z("origami-wheel-manual")
|
|
1290
|
+
], m.prototype, "_wheelManualEl", 2);
|
|
1296
1291
|
S([
|
|
1297
|
-
|
|
1298
|
-
],
|
|
1299
|
-
|
|
1292
|
+
Z("origami-wheel-auto")
|
|
1293
|
+
], m.prototype, "_wheelAutoEl", 2);
|
|
1294
|
+
m = S([
|
|
1300
1295
|
$("origami-wheel-game")
|
|
1301
|
-
],
|
|
1302
|
-
var vt = Object.getOwnPropertyDescriptor,
|
|
1296
|
+
], m);
|
|
1297
|
+
var vt = Object.getOwnPropertyDescriptor, bt = (t, e, i, r) => {
|
|
1303
1298
|
for (var s = r > 1 ? void 0 : r ? vt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
|
|
1304
1299
|
(l = t[n]) && (s = l(s) || s);
|
|
1305
1300
|
return s;
|
|
@@ -1309,7 +1304,7 @@ let V = class extends De {
|
|
|
1309
1304
|
return a`<slot></slot>`;
|
|
1310
1305
|
}
|
|
1311
1306
|
};
|
|
1312
|
-
V.styles =
|
|
1307
|
+
V.styles = A`
|
|
1313
1308
|
:host {
|
|
1314
1309
|
pointer-events: none;
|
|
1315
1310
|
width: 100%;
|
|
@@ -1324,25 +1319,25 @@ V.styles = I`
|
|
|
1324
1319
|
box-sizing: border-box;
|
|
1325
1320
|
}
|
|
1326
1321
|
|
|
1327
|
-
${
|
|
1322
|
+
${F} {
|
|
1328
1323
|
:host {
|
|
1329
1324
|
height: 225px;
|
|
1330
1325
|
}
|
|
1331
1326
|
}
|
|
1332
1327
|
`;
|
|
1333
|
-
V =
|
|
1328
|
+
V = bt([
|
|
1334
1329
|
$("origami-wheel-outcome")
|
|
1335
1330
|
], V);
|
|
1336
|
-
const
|
|
1331
|
+
const wt = (t) => typeof t == "object" && t !== null && "risk" in t && ne(t.risk) && "segments" in t && le(t.segments) && "resultSegment" in t && typeof t.resultSegment == "number" && "betId" in t && typeof t.betId == "string", ce = (t) => {
|
|
1337
1332
|
const e = t?.WHEEL;
|
|
1338
1333
|
return e !== void 0 && "segments" in e ? e : void 0;
|
|
1339
|
-
},
|
|
1340
|
-
const e =
|
|
1341
|
-
return e === void 0 || i === void 0 || !
|
|
1342
|
-
},
|
|
1343
|
-
if (!
|
|
1334
|
+
}, St = (t) => {
|
|
1335
|
+
const e = ce(t.betActions[0]?.data), i = t.betActions[t.betActions.length - 1]?.data.WHEEL;
|
|
1336
|
+
return e === void 0 || i === void 0 || !Pe(i) ? { risk: u.MEDIUM_RISK, segments: L.TEN, resultSegment: 0, betId: t.id || "123" } : { risk: e.riskLevel, segments: e.segments, resultSegment: i.result[0] ?? 0, betId: t.id };
|
|
1337
|
+
}, _t = (t, { enableAnimation: e, inBetResultModal: i, language: r }) => {
|
|
1338
|
+
if (!wt(t))
|
|
1344
1339
|
return a`<p>${g("errors.noWheelData", r)}</p>`;
|
|
1345
|
-
const s =
|
|
1340
|
+
const s = H.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
|
|
1346
1341
|
return a`
|
|
1347
1342
|
<origami-wheel-outcome>
|
|
1348
1343
|
<origami-wheel-animator
|
|
@@ -1357,20 +1352,20 @@ const St = (t) => typeof t == "object" && t !== null && "risk" in t && ne(t.risk
|
|
|
1357
1352
|
></origami-wheel-animator>
|
|
1358
1353
|
</origami-wheel-outcome>
|
|
1359
1354
|
`;
|
|
1360
|
-
},
|
|
1361
|
-
const e =
|
|
1355
|
+
}, $t = (t) => {
|
|
1356
|
+
const e = ce(t);
|
|
1362
1357
|
return e === void 0 ? {} : { segments: e.segments, riskLevel: e.riskLevel };
|
|
1363
|
-
},
|
|
1364
|
-
id:
|
|
1358
|
+
}, xt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), Bt = {
|
|
1359
|
+
id: z.WHEEL,
|
|
1365
1360
|
renderGame: () => a`<origami-wheel-game></origami-wheel-game>`,
|
|
1366
1361
|
gameInfo: He,
|
|
1367
1362
|
maxMultiplier: ({ edge: t }) => oe(t).toNumber(),
|
|
1368
|
-
verifierInputs:
|
|
1369
|
-
verifierQuery:
|
|
1370
|
-
extractOutcome:
|
|
1371
|
-
renderOutcome:
|
|
1363
|
+
verifierInputs: $t,
|
|
1364
|
+
verifierQuery: xt,
|
|
1365
|
+
extractOutcome: St,
|
|
1366
|
+
renderOutcome: _t
|
|
1372
1367
|
};
|
|
1373
1368
|
export {
|
|
1374
|
-
|
|
1369
|
+
m as WheelGame,
|
|
1375
1370
|
Bt as wheelUiModule
|
|
1376
1371
|
};
|