@betorigami/game-ui-wheel 1.1.11 → 1.1.12

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.
@@ -1,6 +1,4 @@
1
1
  import { AutobetSettingsWithId, GameBetResult, GameComponent } from '@betorigami/game-ui-shared';
2
- import { WheelApi } from './wheel.api';
3
- import { MockWheelApi } from './wheel.mock.api';
4
2
  export declare class WheelGame extends GameComponent {
5
3
  private readonly limits;
6
4
  private readonly layout;
@@ -17,7 +15,7 @@ export declare class WheelGame extends GameComponent {
17
15
  constructor();
18
16
  private handleWheelRiskChange;
19
17
  private handleWheelSegmentsChange;
20
- get wheelApi(): WheelApi | MockWheelApi;
18
+ private readonly getWheelApi;
21
19
  get isToggleDisabled(): boolean;
22
20
  get areInputsDisabled(): boolean;
23
21
  private wheelSpinCompletedPromise;
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
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";
1
+ import { ProviderApi as ge, resolveApiErrorCode as ue, getTranslation as g, errorCodeToTranslationKey as pe, ErrorCode as U, createMockGenerator as me, OrigamiActionType as J, desktopContainerQuery as H, 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, createApiFactory as ke, HotkeyController as Ee, HotkeyHelper as ee, waitForEvent as Ae, formatAutobetSettings as Ie, getGameOutcome as Me, calculateGameLayoutStyle as Pe, isEndAction as De } from "@betorigami/game-ui-shared";
2
+ import { css as A, svg as q, nothing as Q, html as a, LitElement as Oe } from "lit";
3
+ import { Wheel as Ce, WheelRiskLevel as u, WheelSegments as L, getWheelPattern as Be, getWheelSegmentMultipliers as We, describeWheelOutcomes as Te, isWheelRiskLevel as ne, isWheelSegments as le, WHEEL_RISK_LEVELS as Le, WHEEL_SEGMENT_OPTIONS as Re, getWheelMaxMultiplier as oe } from "@betorigami/game-wheel";
4
+ import { cache as Ne } from "lit/directives/cache.js";
5
5
  import { property as o, customElement as $, query as Z, state as v } from "lit/decorators.js";
6
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";
7
+ import { sumPayout as Ue } from "@betorigami/game-engine";
8
+ import { styleMap as Fe } 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 H {
50
+ class F {
51
51
  /**
52
52
  * Calculate exact target angle for a segment with pseudorandom position
53
53
  * @param segmentIndex - Index of winning segment (0-based)
@@ -106,7 +106,7 @@ class H {
106
106
  return 1 + n % l;
107
107
  }
108
108
  }
109
- class Fe {
109
+ class je {
110
110
  constructor(e) {
111
111
  this.client = e;
112
112
  }
@@ -128,7 +128,7 @@ class Fe {
128
128
  const s = ue(r);
129
129
  return {
130
130
  success: !1,
131
- error: g(me(s), e.language),
131
+ error: g(pe(s), e.language),
132
132
  errorCode: s
133
133
  };
134
134
  } catch {
@@ -140,16 +140,16 @@ class Fe {
140
140
  }
141
141
  }
142
142
  }
143
- class je {
143
+ class Ke {
144
144
  constructor(e) {
145
- this.edge = e;
145
+ this.getEdge = e;
146
146
  }
147
147
  async startBet(e) {
148
- const { amount: i, riskLevel: r, segments: s } = e, n = { riskLevel: r, segments: s, betAmount: c(i) }, l = new Oe().getGameResult({
149
- generator: pe(),
150
- edge: this.edge,
148
+ const { amount: i, riskLevel: r, segments: s } = e, n = { riskLevel: r, segments: s, betAmount: c(i) }, l = new Ce().getGameResult({
149
+ generator: me(),
150
+ edge: this.getEdge(),
151
151
  gameInputs: n
152
- }), d = Ne(l.payout).toString();
152
+ }), d = Ue(l.payout).toString();
153
153
  return { success: !0, data: {
154
154
  id: crypto.randomUUID(),
155
155
  tenantId: "origami-casino",
@@ -181,7 +181,7 @@ class je {
181
181
  } };
182
182
  }
183
183
  }
184
- const Ke = A`
184
+ const Ge = A`
185
185
  :host {
186
186
  width: 100%;
187
187
  height: 100%;
@@ -200,7 +200,7 @@ const Ke = A`
200
200
  display: none;
201
201
  }
202
202
 
203
- ${F} {
203
+ ${H} {
204
204
  :host {
205
205
  grid-template-rows: auto 1fr auto;
206
206
  padding-bottom: 0;
@@ -210,7 +210,7 @@ const Ke = A`
210
210
  }
211
211
  }
212
212
  }
213
- `, Ge = A`
213
+ `, qe = A`
214
214
  :host {
215
215
  width: 100%;
216
216
  height: 100%;
@@ -270,7 +270,7 @@ const Ke = A`
270
270
  display: none;
271
271
  }
272
272
 
273
- ${F} {
273
+ ${H} {
274
274
  .wheel-box {
275
275
  aspect-ratio: 1 / 1;
276
276
  height: auto;
@@ -319,17 +319,17 @@ const Ke = A`
319
319
  RED: "var(--wheel-color-red)",
320
320
  BLUE: "var(--wheel-color-blue)",
321
321
  PURPLE: "var(--wheel-color-purple)"
322
- }, qe = {
322
+ }, Ve = {
323
323
  ZERO: C.BLACK,
324
324
  A: C.GREEN,
325
325
  B: C.YELLOW,
326
326
  C: C.BLUE,
327
327
  D: C.RED,
328
328
  E: C.PURPLE
329
- }, ae = (t) => qe[t], G = 9, Ve = 0.08, Ye = 0.8, ze = 1e4, Qe = () => ({
329
+ }, ae = (t) => Ve[t], G = 9, Ye = 0.08, ze = 0.8, Qe = 1e4, Ze = () => ({
330
330
  layers: [de(2800, { duration: 15e-4, decay: 8, gain: 0.6 })],
331
331
  gainScale: 1
332
- }), Ze = A`
332
+ }), Xe = A`
333
333
  :host {
334
334
  --wheel-color-black: #1a1a1a;
335
335
  --wheel-color-green: #00d084;
@@ -350,17 +350,17 @@ const Ke = A`
350
350
  }
351
351
  }
352
352
  `;
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--)
353
+ var Je = Object.defineProperty, et = Object.getOwnPropertyDescriptor, j = (t, e, i, r) => {
354
+ for (var s = r > 1 ? void 0 : r ? et(e, i) : e, n = t.length - 1, l; n >= 0; n--)
355
355
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
356
- return r && s && Xe(e, i, s), s;
356
+ return r && s && Je(e, i, s), s;
357
357
  };
358
358
  let B = class extends O {
359
359
  constructor() {
360
360
  super(...arguments), this.risk = u.MEDIUM_RISK, this.segments = L.TEN, this.highlightedSegments = [];
361
361
  }
362
362
  generateWheelPaths() {
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 = [];
363
+ const t = Be({ riskLevel: this.risk, segments: this.segments }), e = { cx: 285, cy: 285 }, i = 284.371, r = 2 * Math.PI / this.segments, s = [];
364
364
  for (let n = 0; n < this.segments; n++) {
365
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 = {
366
366
  x: e.cx + i * Math.cos(k),
@@ -399,7 +399,7 @@ let B = class extends O {
399
399
  `;
400
400
  }
401
401
  };
402
- B.styles = [Ze];
402
+ B.styles = [Xe];
403
403
  j([
404
404
  o({ type: String })
405
405
  ], B.prototype, "risk", 2);
@@ -412,10 +412,10 @@ j([
412
412
  B = j([
413
413
  $("origami-wheel-svg")
414
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--)
415
+ var tt = Object.defineProperty, st = Object.getOwnPropertyDescriptor, m = (t, e, i, r) => {
416
+ for (var s = r > 1 ? void 0 : r ? st(e, i) : e, n = t.length - 1, l; n >= 0; n--)
417
417
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
418
- return r && s && et(e, i, s), s;
418
+ return r && s && tt(e, i, s), s;
419
419
  };
420
420
  let h = class extends O {
421
421
  constructor() {
@@ -436,10 +436,10 @@ let h = class extends O {
436
436
  this._angle = this.targetAngle, this._updateTransform(), this._stopLoop(), this.emit("wheel-spin-complete");
437
437
  return;
438
438
  }
439
- const t = this._isInstantBet ? Ye : Ve;
440
- this._decelerationOffsets = H.generateDecelerationOffsets(G, t);
439
+ const t = this._isInstantBet ? ze : Ye;
440
+ this._decelerationOffsets = F.generateDecelerationOffsets(G, t);
441
441
  const e = this._decelerationOffsets[this._decelerationOffsets.length - 1];
442
- this._decelerationStartAngle = H.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
442
+ this._decelerationStartAngle = F.calculateDecelerationStartAngle(this._angle, this.targetAngle, e), this._currentDecelerationFrame = 0;
443
443
  }
444
444
  handleIsPlayingChange() {
445
445
  this.isPlaying && this._rafId === null && !this._isInstantBet ? this._startLoop() : !this.isPlaying && this._rafId !== null && this._stopLoop();
@@ -460,7 +460,7 @@ let h = class extends O {
460
460
  this._angle += G;
461
461
  this._updateTransform();
462
462
  const r = 360 / this.segments;
463
- Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.services.value.soundEffects.play(Qe()), this._rafId = requestAnimationFrame(t);
463
+ Math.floor(this._angle / r) - Math.floor(e / r) > 0 && this.services.value.soundEffects.play(Ze()), this._rafId = requestAnimationFrame(t);
464
464
  };
465
465
  this._rafId === null && (this._rafId = requestAnimationFrame(t));
466
466
  }
@@ -513,44 +513,44 @@ let h = class extends O {
513
513
  `;
514
514
  }
515
515
  };
516
- h.styles = [T, Ge];
517
- p([
516
+ h.styles = [T, qe];
517
+ m([
518
518
  o({ type: Boolean })
519
519
  ], h.prototype, "isPlaying", 2);
520
- p([
520
+ m([
521
521
  o({ type: Boolean })
522
522
  ], h.prototype, "staticDisplay", 2);
523
- p([
523
+ m([
524
524
  o({ type: Boolean })
525
525
  ], h.prototype, "ignoreInstantBet", 2);
526
- p([
526
+ m([
527
527
  o({ type: String })
528
528
  ], h.prototype, "risk", 2);
529
- p([
529
+ m([
530
530
  o({ type: Number })
531
531
  ], h.prototype, "segments", 2);
532
- p([
532
+ m([
533
533
  o({ type: Number })
534
534
  ], h.prototype, "targetAngle", 2);
535
- p([
535
+ m([
536
536
  o({ type: Number })
537
537
  ], h.prototype, "resultSegment", 2);
538
- p([
538
+ m([
539
539
  o({ type: Array })
540
540
  ], h.prototype, "hoveredSegments", 2);
541
- p([
541
+ m([
542
542
  Z(".wheel-svg")
543
543
  ], h.prototype, "_wheelEl", 2);
544
- p([
544
+ m([
545
545
  te("targetAngle")
546
546
  ], h.prototype, "handleTargetAngleChange", 1);
547
- p([
547
+ m([
548
548
  te("isPlaying")
549
549
  ], h.prototype, "handleIsPlayingChange", 1);
550
- h = p([
550
+ h = m([
551
551
  $("origami-wheel-animator")
552
552
  ], h);
553
- const st = A`
553
+ const it = A`
554
554
  :host {
555
555
  display: flex;
556
556
  flex-direction: column;
@@ -687,10 +687,10 @@ const st = A`
687
687
  }
688
688
  }
689
689
  `;
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--)
690
+ var rt = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, R = (t, e, i, r) => {
691
+ for (var s = r > 1 ? void 0 : r ? nt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
692
692
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
693
- return r && s && it(e, i, s), s;
693
+ return r && s && rt(e, i, s), s;
694
694
  };
695
695
  let D = class extends O {
696
696
  constructor() {
@@ -703,10 +703,10 @@ let D = class extends O {
703
703
  return { riskLevel: this.risk, segments: this.segments };
704
704
  }
705
705
  get segmentMultipliers() {
706
- return Be(this.selection, this.edge);
706
+ return We(this.selection, this.edge);
707
707
  }
708
708
  get tiles() {
709
- return We(this.selection, this.edge).outcomes;
709
+ return Te(this.selection, this.edge).outcomes;
710
710
  }
711
711
  getActiveTileIndexFromSegment() {
712
712
  if (this.resultSegment === null) return null;
@@ -787,7 +787,7 @@ let D = class extends O {
787
787
  <span class="tile-label">${P}</span>
788
788
  <span
789
789
  class="dot"
790
- style=${Ue({ backgroundColor: N })}
790
+ style=${Fe({ backgroundColor: N })}
791
791
  aria-hidden="true"
792
792
  ></span>
793
793
  </div>
@@ -799,7 +799,7 @@ let D = class extends O {
799
799
  `;
800
800
  }
801
801
  };
802
- D.styles = [T, st];
802
+ D.styles = [T, it];
803
803
  R([
804
804
  o({ type: String })
805
805
  ], D.prototype, "risk", 2);
@@ -815,10 +815,10 @@ R([
815
815
  D = R([
816
816
  $("origami-wheel-content-bottom")
817
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--)
818
+ var lt = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, I = (t, e, i, r) => {
819
+ for (var s = r > 1 ? void 0 : r ? ot(e, i) : e, n = t.length - 1, l; n >= 0; n--)
820
820
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
821
- return r && s && nt(e, i, s), s;
821
+ return r && s && lt(e, i, s), s;
822
822
  };
823
823
  let b = class extends O {
824
824
  constructor() {
@@ -854,7 +854,7 @@ let b = class extends O {
854
854
  `;
855
855
  }
856
856
  };
857
- b.styles = [T, Ke];
857
+ b.styles = [T, Ge];
858
858
  I([
859
859
  o({ type: Boolean })
860
860
  ], b.prototype, "isPlaying", 2);
@@ -904,12 +904,12 @@ const he = A`
904
904
  grid-column: span 2;
905
905
  }
906
906
 
907
- ${F} {
907
+ ${H} {
908
908
  :host .action-section {
909
909
  order: 0;
910
910
  }
911
911
  }
912
- `, ot = A`
912
+ `, at = A`
913
913
  :host {
914
914
  display: contents;
915
915
  }
@@ -918,12 +918,12 @@ const he = A`
918
918
  grid-column: span 2;
919
919
  }
920
920
  `;
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--)
921
+ var ht = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, K = (t, e, i, r) => {
922
+ for (var s = r > 1 ? void 0 : r ? ct(e, i) : e, n = t.length - 1, l; n >= 0; n--)
923
923
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
924
- return r && s && at(e, i, s), s;
924
+ return r && s && ht(e, i, s), s;
925
925
  };
926
- const ct = {
926
+ const gt = {
927
927
  [u.LOW_RISK]: "common.low",
928
928
  [u.MEDIUM_RISK]: "common.medium",
929
929
  [u.HIGH_RISK]: "common.high"
@@ -946,7 +946,7 @@ let W = class extends O {
946
946
  <origami-select
947
947
  class="grid-full-width"
948
948
  label=${g("common.risk", t)}
949
- .options=${Te.map((e) => ({ value: e, label: g(ct[e], t) }))}
949
+ .options=${Le.map((e) => ({ value: e, label: g(gt[e], t) }))}
950
950
  .value=${this.risk}
951
951
  @select-change=${this.handleRiskChange}
952
952
  ?disabled=${this.disabled}
@@ -955,7 +955,7 @@ let W = class extends O {
955
955
  <origami-select
956
956
  class="grid-full-width"
957
957
  label=${g("games.wheel.segments", t)}
958
- .options=${Le.map((e) => ({ value: e.toString(), label: e.toString() }))}
958
+ .options=${Re.map((e) => ({ value: e.toString(), label: e.toString() }))}
959
959
  .value=${this.segments.toString()}
960
960
  @select-change=${this.handleSegmentsChange}
961
961
  ?disabled=${this.disabled}
@@ -963,7 +963,7 @@ let W = class extends O {
963
963
  `;
964
964
  }
965
965
  };
966
- W.styles = [T, ot];
966
+ W.styles = [T, at];
967
967
  K([
968
968
  o({ type: String })
969
969
  ], W.prototype, "risk", 2);
@@ -976,10 +976,10 @@ K([
976
976
  W = K([
977
977
  $("origami-wheel-selectors")
978
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--)
979
+ var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, x = (t, e, i, r) => {
980
+ for (var s = r > 1 ? void 0 : r ? pt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
981
981
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
982
- return r && s && gt(e, i, s), s;
982
+ return r && s && ut(e, i, s), s;
983
983
  };
984
984
  let y = class extends O {
985
985
  constructor() {
@@ -1046,8 +1046,8 @@ x([
1046
1046
  y = x([
1047
1047
  $("origami-wheel-manual")
1048
1048
  ], y);
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--)
1049
+ var mt = Object.defineProperty, dt = Object.getOwnPropertyDescriptor, M = (t, e, i, r) => {
1050
+ for (var s = r > 1 ? void 0 : r ? dt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
1051
1051
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
1052
1052
  return r && s && mt(e, i, s), s;
1053
1053
  };
@@ -1098,7 +1098,7 @@ M([
1098
1098
  w = M([
1099
1099
  $("origami-wheel-auto")
1100
1100
  ], w);
1101
- const dt = A`
1101
+ const ft = A`
1102
1102
  :host {
1103
1103
  height: 100%;
1104
1104
  }
@@ -1107,14 +1107,18 @@ const dt = A`
1107
1107
  display: block;
1108
1108
  }
1109
1109
  `;
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--)
1110
+ var yt = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, S = (t, e, i, r) => {
1111
+ for (var s = r > 1 ? void 0 : r ? vt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
1112
1112
  (l = t[n]) && (s = (r ? l(e, i, s) : l(s)) || s);
1113
- return r && s && ft(e, i, s), s;
1113
+ return r && s && yt(e, i, s), s;
1114
1114
  };
1115
- let m = class extends re {
1115
+ let p = class extends re {
1116
1116
  constructor() {
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, [
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, this.getWheelApi = ke(
1118
+ () => this.services.value.providerApi,
1119
+ () => this.session.value.isDemoMode,
1120
+ { createReal: (t) => new je(t), createMock: () => new Ke(() => this.limits.value.edge) }
1121
+ ), new Ee(this, [
1118
1122
  {
1119
1123
  key: " ",
1120
1124
  callback: () => ee.clickBetButton(this.manualOrAuto, this._wheelManualEl, this._wheelAutoEl),
@@ -1132,9 +1136,6 @@ let m = class extends re {
1132
1136
  handleWheelSegmentsChange(t) {
1133
1137
  this.numberOfSegments = t.detail.value, this.resultSegment = null;
1134
1138
  }
1135
- get wheelApi() {
1136
- return this.session.value.isDemoMode ? new je(this.limits.value.edge) : new Fe(this.services.value.providerApi);
1137
- }
1138
1139
  get isToggleDisabled() {
1139
1140
  return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
1140
1141
  }
@@ -1142,7 +1143,7 @@ let m = class extends re {
1142
1143
  return this.isManualPlaying || this.autobetInProgress || this.autobetStopping;
1143
1144
  }
1144
1145
  wheelSpinCompletedPromise() {
1145
- return Ee(this, "wheel-spin-complete", void 0, ze, !0);
1146
+ return Ae(this, "wheel-spin-complete", void 0, Qe, !0);
1146
1147
  }
1147
1148
  async handleBetExecution(t, e) {
1148
1149
  this.resetForNextBet(() => {
@@ -1156,19 +1157,19 @@ let m = class extends re {
1156
1157
  const r = !this.isInstantBet;
1157
1158
  r && (this.isWheelSpinning = !0);
1158
1159
  const s = await this.placeBet(
1159
- () => this.wheelApi.startBet({
1160
+ () => this.getWheelApi().startBet({
1160
1161
  amount: t,
1161
1162
  language: this.locale.value.language,
1162
1163
  riskLevel: this.wheelRisk,
1163
1164
  segments: this.numberOfSegments,
1164
- meta: e ? Ae(e) : void 0
1165
+ meta: e ? Ie(e) : void 0
1165
1166
  })
1166
1167
  );
1167
1168
  if (s.success) {
1168
1169
  const { data: n } = s, l = Number(n.multiplier ?? 0), { betActions: d } = n, _ = d[d.length - 1];
1169
1170
  if (_?.data?.WHEEL) {
1170
1171
  const { result: P } = _.data.WHEEL;
1171
- this.resultSegment = P[0] ?? 0, this.targetAngle = H.calculateTargetAngle(this.resultSegment, this.numberOfSegments, n.id);
1172
+ this.resultSegment = P[0] ?? 0, this.targetAngle = F.calculateTargetAngle(this.resultSegment, this.numberOfSegments, n.id);
1172
1173
  }
1173
1174
  r && await this.wheelSpinCompletedPromise(), this.isWheelSpinning = !1;
1174
1175
  const k = c(l).gt(0);
@@ -1201,11 +1202,11 @@ let m = class extends re {
1201
1202
  errorCode: i.errorCode ?? U.UNKNOWN,
1202
1203
  errorMessage: i.error || g("alerts.errorProcessingBet", this.locale.value.language)
1203
1204
  };
1204
- const r = i.data, s = c(r.payout ?? 0).minus(r.amount ?? 0), n = Number(r.multiplier), l = Ie(n);
1205
+ const r = i.data, s = c(r.payout ?? 0).minus(r.amount ?? 0), n = Number(r.multiplier), l = Me(n);
1205
1206
  return await this.holdResultDisplay(), { pnl: s, gameOutcome: l, hasError: !1, afterBalance: r.afterBalance ? c(r.afterBalance) : null };
1206
1207
  }
1207
1208
  render() {
1208
- const t = oe(this.limits.value.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), e = !1, i = Me(this.layout.value);
1209
+ const t = oe(this.limits.value.edge, { riskLevel: this.wheelRisk, segments: this.numberOfSegments }), e = !1, i = Pe(this.layout.value);
1209
1210
  return a`
1210
1211
  <origami-game-layout style=${i} .gameType=${z.WHEEL}>
1211
1212
  <origami-game-sidebar
@@ -1216,7 +1217,7 @@ let m = class extends re {
1216
1217
  @wheel-risk-change=${this.handleWheelRiskChange}
1217
1218
  @wheel-segments-change=${this.handleWheelSegmentsChange}
1218
1219
  >
1219
- ${Re(
1220
+ ${Ne(
1220
1221
  this.manualOrAuto === "Manual" ? a`<origami-wheel-manual
1221
1222
  slot="controls"
1222
1223
  .inputsDisabled=${this.areInputsDisabled}
@@ -1263,43 +1264,43 @@ let m = class extends re {
1263
1264
  `;
1264
1265
  }
1265
1266
  };
1266
- m.styles = [...re.styles, dt];
1267
+ p.styles = [...re.styles, ft];
1267
1268
  S([
1268
1269
  v()
1269
- ], m.prototype, "isManualPlaying", 2);
1270
+ ], p.prototype, "isManualPlaying", 2);
1270
1271
  S([
1271
1272
  v()
1272
- ], m.prototype, "history", 2);
1273
+ ], p.prototype, "history", 2);
1273
1274
  S([
1274
1275
  v()
1275
- ], m.prototype, "wheelRisk", 2);
1276
+ ], p.prototype, "wheelRisk", 2);
1276
1277
  S([
1277
1278
  v()
1278
- ], m.prototype, "numberOfSegments", 2);
1279
+ ], p.prototype, "numberOfSegments", 2);
1279
1280
  S([
1280
1281
  v()
1281
- ], m.prototype, "targetAngle", 2);
1282
+ ], p.prototype, "targetAngle", 2);
1282
1283
  S([
1283
1284
  v()
1284
- ], m.prototype, "resultSegment", 2);
1285
+ ], p.prototype, "resultSegment", 2);
1285
1286
  S([
1286
1287
  v()
1287
- ], m.prototype, "isWheelSpinning", 2);
1288
+ ], p.prototype, "isWheelSpinning", 2);
1288
1289
  S([
1289
1290
  Z("origami-wheel-manual")
1290
- ], m.prototype, "_wheelManualEl", 2);
1291
+ ], p.prototype, "_wheelManualEl", 2);
1291
1292
  S([
1292
1293
  Z("origami-wheel-auto")
1293
- ], m.prototype, "_wheelAutoEl", 2);
1294
- m = S([
1294
+ ], p.prototype, "_wheelAutoEl", 2);
1295
+ p = S([
1295
1296
  $("origami-wheel-game")
1296
- ], m);
1297
- var vt = Object.getOwnPropertyDescriptor, bt = (t, e, i, r) => {
1298
- for (var s = r > 1 ? void 0 : r ? vt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
1297
+ ], p);
1298
+ var bt = Object.getOwnPropertyDescriptor, wt = (t, e, i, r) => {
1299
+ for (var s = r > 1 ? void 0 : r ? bt(e, i) : e, n = t.length - 1, l; n >= 0; n--)
1299
1300
  (l = t[n]) && (s = l(s) || s);
1300
1301
  return s;
1301
1302
  };
1302
- let V = class extends De {
1303
+ let V = class extends Oe {
1303
1304
  render() {
1304
1305
  return a`<slot></slot>`;
1305
1306
  }
@@ -1319,25 +1320,25 @@ V.styles = A`
1319
1320
  box-sizing: border-box;
1320
1321
  }
1321
1322
 
1322
- ${F} {
1323
+ ${H} {
1323
1324
  :host {
1324
1325
  height: 225px;
1325
1326
  }
1326
1327
  }
1327
1328
  `;
1328
- V = bt([
1329
+ V = wt([
1329
1330
  $("origami-wheel-outcome")
1330
1331
  ], V);
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) => {
1332
+ const St = (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) => {
1332
1333
  const e = t?.WHEEL;
1333
1334
  return e !== void 0 && "segments" in e ? e : void 0;
1334
- }, St = (t) => {
1335
+ }, _t = (t) => {
1335
1336
  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))
1337
+ return e === void 0 || i === void 0 || !De(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 };
1338
+ }, $t = (t, { enableAnimation: e, inBetResultModal: i, language: r }) => {
1339
+ if (!St(t))
1339
1340
  return a`<p>${g("errors.noWheelData", r)}</p>`;
1340
- const s = H.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
1341
+ const s = F.calculateTargetAngle(t.resultSegment, t.segments, t.betId);
1341
1342
  return a`
1342
1343
  <origami-wheel-outcome>
1343
1344
  <origami-wheel-animator
@@ -1352,20 +1353,20 @@ const wt = (t) => typeof t == "object" && t !== null && "risk" in t && ne(t.risk
1352
1353
  ></origami-wheel-animator>
1353
1354
  </origami-wheel-outcome>
1354
1355
  `;
1355
- }, $t = (t) => {
1356
+ }, xt = (t) => {
1356
1357
  const e = ce(t);
1357
1358
  return e === void 0 ? {} : { segments: e.segments, riskLevel: e.riskLevel };
1358
- }, xt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), Bt = {
1359
+ }, kt = ({ segments: t, riskLevel: e }) => ({ segments: t, riskLevel: e }), Wt = {
1359
1360
  id: z.WHEEL,
1360
1361
  renderGame: () => a`<origami-wheel-game></origami-wheel-game>`,
1361
1362
  gameInfo: He,
1362
1363
  maxMultiplier: ({ edge: t }) => oe(t).toNumber(),
1363
- verifierInputs: $t,
1364
- verifierQuery: xt,
1365
- extractOutcome: St,
1366
- renderOutcome: _t
1364
+ verifierInputs: xt,
1365
+ verifierQuery: kt,
1366
+ extractOutcome: _t,
1367
+ renderOutcome: $t
1367
1368
  };
1368
1369
  export {
1369
- m as WheelGame,
1370
- Bt as wheelUiModule
1370
+ p as WheelGame,
1371
+ Wt as wheelUiModule
1371
1372
  };