@everymatrix/mini-games-hub 0.1.20 → 0.1.22
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/components/{CoinRoyale-Bgl4Ea3N.js → CoinRoyale-BOm4-S8w.js} +119 -141
- package/components/{CoinRoyale-BfaHdSQN.cjs → CoinRoyale-CH5uxsuD.cjs} +4 -17
- package/components/{CoinRoyale-t3opSEHv.js → CoinRoyale-CnNtLq-A.js} +135 -157
- package/components/{CoinRoyale-CuEAflkt.cjs → CoinRoyale-D2pyi_GY.cjs} +4 -17
- package/components/{MiniGamesHub-CfeP3fA-.cjs → MiniGamesHub-1gI8xWg3.cjs} +1 -1
- package/components/{MiniGamesHub-CQ1jWyWR.js → MiniGamesHub-BokfXy1A.js} +3 -3
- package/components/{MiniGamesHub-ChMf3rL7.js → MiniGamesHub-CPXGTqSS.js} +3 -3
- package/components/{MiniGamesHub-Cv7rxLAO.cjs → MiniGamesHub-Cy_b-cvx.cjs} +1 -1
- package/components/{MysteryChest-pWptmU6O.js → MysteryChest-CGtkoyYH.js} +2 -3
- package/components/{MysteryChest-Bq1NBRQI.cjs → MysteryChest-CtJ77A-4.cjs} +2 -3
- package/components/{MysteryChest-BsUxRwj9.js → MysteryChest-jlPEk0Vu.js} +2 -3
- package/components/{MysteryChest-Cq77jWfV.cjs → MysteryChest-zfL6oGq0.cjs} +2 -3
- package/components/{WheelOfFortune-uTfPiHqd.js → WheelOfFortune-B3VH8v94.js} +1 -1
- package/components/{WheelOfFortune-Dsr3jMxy.cjs → WheelOfFortune-BcALwQhX.cjs} +1 -1
- package/components/{WheelOfFortune-CriOHAfp.cjs → WheelOfFortune-CxwbJNRK.cjs} +1 -1
- package/components/{WheelOfFortune-D2AVLv8r.js → WheelOfFortune-cfvAy6JH.js} +1 -1
- package/es2015/mini-games-hub.cjs +1 -1
- package/es2015/mini-games-hub.js +1 -1
- package/esnext/mini-games-hub.cjs +1 -1
- package/esnext/mini-games-hub.js +1 -1
- package/package.json +1 -1
- package/components/BackButton-BMWvZ9Lb.js +0 -39
- package/components/BackButton-BNp3jVLa.js +0 -39
- package/components/BackButton-Bi1zFTns.js +0 -38
- package/components/BackButton-BvRNh4nJ.js +0 -39
- package/components/BackButton-C_v3b0Ky.cjs +0 -1
- package/components/BackButton-D5gfQ3NI.cjs +0 -1
- package/components/BackButton-DznJk3U4.js +0 -38
- package/components/BackButton-gIVGAf6v.js +0 -38
- package/components/BackButton-s0YqvufR.cjs +0 -1
- package/components/CoinFlip-5qt33VpA.js +0 -399
- package/components/CoinFlip-9-7FNYAn.js +0 -364
- package/components/CoinFlip-BWNJK7aS.js +0 -402
- package/components/CoinFlip-BaNNMAYb.cjs +0 -1
- package/components/CoinFlip-BgRZmhbg.js +0 -367
- package/components/CoinFlip-COwy7cq1.cjs +0 -1
- package/components/CoinFlip-CSel9VZR.js +0 -398
- package/components/CoinFlip-ClRh6gz2.js +0 -363
- package/components/CoinFlip-D7Bwnl8W.cjs +0 -1
- package/components/CoinFlip-D8OLaQiA.js +0 -367
- package/components/CoinFlip-Dg2ZA_B2.cjs +0 -1
- package/components/CoinFlip-DoASIhfX.cjs +0 -1
- package/components/CoinFlip-pvtcTO4f.cjs +0 -1
- package/components/CoinFlip-vrZpkrnS.js +0 -402
- package/components/CoinRoyale-4Oe-x5-J.cjs +0 -734
- package/components/CoinRoyale-9nHMXODj.js +0 -1017
- package/components/CoinRoyale-B3bu5S4n.cjs +0 -734
- package/components/CoinRoyale-B4dKiGgG.cjs +0 -736
- package/components/CoinRoyale-BCSu92s7.cjs +0 -759
- package/components/CoinRoyale-BJWVsEJj.cjs +0 -759
- package/components/CoinRoyale-BNxFDqe1.js +0 -999
- package/components/CoinRoyale-BwNvG3QI.js +0 -1009
- package/components/CoinRoyale-Bza84vCL.cjs +0 -738
- package/components/CoinRoyale-C-x6uDgh.js +0 -989
- package/components/CoinRoyale-CAI2JCvG.js +0 -1020
- package/components/CoinRoyale-CGHKZ-kc.js +0 -997
- package/components/CoinRoyale-CbqmmMPg.cjs +0 -736
- package/components/CoinRoyale-ChWsctqo.cjs +0 -759
- package/components/CoinRoyale-Ck3dlmOV.js +0 -1040
- package/components/CoinRoyale-Cw8ImDP5.js +0 -1040
- package/components/CoinRoyale-CxIBSKFK.js +0 -1017
- package/components/CoinRoyale-D-rF6BV4.js +0 -1019
- package/components/CoinRoyale-DH-tQHtT.cjs +0 -736
- package/components/CoinRoyale-DKWXkm3P.js +0 -1040
- package/components/CoinRoyale-DmcgvBwG.js +0 -997
- package/components/CoinRoyale-Y2G7RWga.js +0 -1020
- package/components/CoinRoyale-d2utu3E3.cjs +0 -759
- package/components/CoinRoyale-hmGqx4pF.cjs +0 -759
- package/components/CoinRoyale-ifgbuEK3.cjs +0 -759
- package/components/CoinRoyale-xAkf1dm_.cjs +0 -738
- package/components/CoinRoyale-xHokf0cY.js +0 -1020
- package/components/DrawResult-BHZeM1oX.cjs +0 -1
- package/components/DrawResult-BVtwLs-z.js +0 -373
- package/components/DrawResult-CG5KTjF7.cjs +0 -1
- package/components/DrawResult-CbLPtjvZ.js +0 -343
- package/components/DrawResult-DMRODSxk.cjs +0 -1
- package/components/DrawResult-DTJJfQkP.js +0 -373
- package/components/DrawResult-DdL4fFZM.js +0 -343
- package/components/DrawResult-DxG4CaKK.cjs +0 -1
- package/components/DrawResult-SyzKXHgd.js +0 -343
- package/components/DrawResult-ZEAa0flC.js +0 -373
- package/components/GameCard-8k9KvRun.cjs +0 -3
- package/components/GameCard-A3k7RxF5.js +0 -63
- package/components/GameCard-B2td6J8K.js +0 -62
- package/components/GameCard-Bku9nP58.cjs +0 -3
- package/components/GameCard-CBGi9i6m.cjs +0 -3
- package/components/GameCard-CHZmVd6n.cjs +0 -3
- package/components/GameCard-Cj4zAE8_.js +0 -59
- package/components/GameCard-CrKoQU1B.js +0 -59
- package/components/GameCard-DFVjSdtd.cjs +0 -3
- package/components/GameCard-DHetS96-.js +0 -66
- package/components/GameCard-DcWpuwMl.cjs +0 -3
- package/components/GameCard-jIcB63Tt.js +0 -62
- package/components/GameHistory-9Mf_u0La.js +0 -231
- package/components/GameHistory-BktmYuDa.js +0 -231
- package/components/GameHistory-CGAhNQKk.js +0 -231
- package/components/GameHistory-ChYjWDsa.cjs +0 -12
- package/components/GameHistory-CmiIChL-.cjs +0 -12
- package/components/GameHistory-CrrlOaAg.js +0 -231
- package/components/GameHistory-DVsHn3lx.cjs +0 -12
- package/components/GameHistory-_jU0BiqI.js +0 -231
- package/components/GameHistory-aQf3vf9u.cjs +0 -12
- package/components/GameHistory-lyXo0tYb.cjs +0 -12
- package/components/GameHistory-uzrT81kU.js +0 -231
- package/components/GameHistory-v6cI-TIF.cjs +0 -12
- package/components/GamePlaceholder-4oI8uJ-1.cjs +0 -1
- package/components/GamePlaceholder-Bp4nTJeL.js +0 -84
- package/components/GamePlaceholder-COiYGwNi.cjs +0 -15
- package/components/GamePlaceholder-CfJ4hx9w.js +0 -70
- package/components/GamePlaceholder-D9JEXsAk.js +0 -84
- package/components/GamePlaceholder-DGnB06iW.js +0 -71
- package/components/GamePlaceholder-DS5evGU6.js +0 -85
- package/components/GamePlaceholder-DmiU1G7G.cjs +0 -15
- package/components/GamePlaceholder-Dwo_YAUQ.cjs +0 -1
- package/components/GamePlaceholder-Uni3xW09.cjs +0 -15
- package/components/GamePlaceholder-fVPk29f9.cjs +0 -15
- package/components/GamePlaceholder-vUYYV2Ps.js +0 -85
- package/components/GameRules-41OkRwZu.js +0 -115
- package/components/GameRules-BwLJBo6z.cjs +0 -3
- package/components/GameRules-CRiycUU8.js +0 -115
- package/components/GameRules-CTKyBDZO.cjs +0 -3
- package/components/GameRules-CV9sxZYz.js +0 -126
- package/components/GameRules-CuuoMoqN.cjs +0 -3
- package/components/GameRules-Cy7jwBok.js +0 -126
- package/components/GameRules-DUD8OKC0.js +0 -115
- package/components/GameRules-Dkl0qVzr.js +0 -126
- package/components/GameRules-DpGqZdSj.cjs +0 -3
- package/components/GameRules-DrBYjWA6.cjs +0 -3
- package/components/GameRules-DrZ6w0LM.cjs +0 -3
- package/components/MiniGamesHub-9mWWh3N1.js +0 -1111
- package/components/MiniGamesHub-B6YnaRxS.cjs +0 -79
- package/components/MiniGamesHub-B9aQplHl.js +0 -1135
- package/components/MiniGamesHub-BRRQIXZj.cjs +0 -79
- package/components/MiniGamesHub-BWPRLpyq.cjs +0 -16
- package/components/MiniGamesHub-BXcQ_faH.js +0 -1022
- package/components/MiniGamesHub-BaMQ2sWj.js +0 -1105
- package/components/MiniGamesHub-BbkgB1GV.js +0 -1105
- package/components/MiniGamesHub-BjME_rom.cjs +0 -16
- package/components/MiniGamesHub-Bn-xvO1e.js +0 -1055
- package/components/MiniGamesHub-BpjzFxHO.cjs +0 -16
- package/components/MiniGamesHub-BtC6TmtK.cjs +0 -16
- package/components/MiniGamesHub-BvS3Q0HA.js +0 -1135
- package/components/MiniGamesHub-C-9Nf-x7.js +0 -1029
- package/components/MiniGamesHub-C0ESIt9P.cjs +0 -16
- package/components/MiniGamesHub-CWV1acJR.cjs +0 -79
- package/components/MiniGamesHub-CfIFEVOU.js +0 -1022
- package/components/MiniGamesHub-Cj_6ebsL.cjs +0 -16
- package/components/MiniGamesHub-CkVJjuZl.cjs +0 -79
- package/components/MiniGamesHub-CktxKKTj.cjs +0 -16
- package/components/MiniGamesHub-ClPq7L0V.cjs +0 -79
- package/components/MiniGamesHub-CrPltGGl.js +0 -1042
- package/components/MiniGamesHub-D2Eet3pe.js +0 -1048
- package/components/MiniGamesHub-D4fNnQ70.js +0 -1141
- package/components/MiniGamesHub-D9A4HvPC.js +0 -1135
- package/components/MiniGamesHub-DCCeYwnc.js +0 -1055
- package/components/MiniGamesHub-DuAv3Z6t.cjs +0 -79
- package/components/MiniGamesHub-DuyWceLB.cjs +0 -16
- package/components/MiniGamesHub-Dz8Ltp98.js +0 -1048
- package/components/MiniGamesHub-_uRBhzYg.js +0 -1029
- package/components/MiniGamesHub-gVFlxi4x.cjs +0 -79
- package/components/MiniGamesHub-kIXoGqbZ.cjs +0 -16
- package/components/MiniGamesHub-o7rVTqn5.cjs +0 -79
- package/components/MiniGamesHub-v8PPHifq.js +0 -1072
- package/components/MiniGamesHub-w5poRbtq.js +0 -1105
- package/components/MysteryChest-4_QXLnuB.js +0 -1298
- package/components/MysteryChest-B10zFJU3.cjs +0 -741
- package/components/MysteryChest-B4h9tqVR.js +0 -1301
- package/components/MysteryChest-BJCFkn02.cjs +0 -737
- package/components/MysteryChest-BXPAdruk.js +0 -1290
- package/components/MysteryChest-BuB9PD57.js +0 -1240
- package/components/MysteryChest-C1jSQFBT.cjs +0 -741
- package/components/MysteryChest-C40hwiCW.cjs +0 -745
- package/components/MysteryChest-CKPELFiF.cjs +0 -737
- package/components/MysteryChest-CRJtPhlo.cjs +0 -743
- package/components/MysteryChest-CScyc3Jw.cjs +0 -745
- package/components/MysteryChest-Cg48wdP6.cjs +0 -741
- package/components/MysteryChest-CheF_Rh5.cjs +0 -739
- package/components/MysteryChest-CkSMlhn1.cjs +0 -741
- package/components/MysteryChest-CrL8IXga.js +0 -1309
- package/components/MysteryChest-CrXzepqD.js +0 -1296
- package/components/MysteryChest-D5OWiZfM.js +0 -1250
- package/components/MysteryChest-D6eks4QE.js +0 -1254
- package/components/MysteryChest-DE2NS9aL.js +0 -1299
- package/components/MysteryChest-DJuhkpSa.cjs +0 -743
- package/components/MysteryChest-DOTlHt7A.js +0 -1248
- package/components/MysteryChest-DfggF659.js +0 -1262
- package/components/MysteryChest-Di-dVQnd.cjs +0 -745
- package/components/MysteryChest-DnstXEZJ.js +0 -1298
- package/components/MysteryChest-IcRh-Dcp.js +0 -1247
- package/components/MysteryChest-dyhqTxMg.cjs +0 -739
- package/components/MysteryChest-egeYjlMm.js +0 -1249
- package/components/WheelOfFortune--1feiOUD.js +0 -950
- package/components/WheelOfFortune-B0g1znMo.cjs +0 -627
- package/components/WheelOfFortune-BC0wwnC-.cjs +0 -617
- package/components/WheelOfFortune-BYxOqBjA.js +0 -928
- package/components/WheelOfFortune-BgUB1tnc.js +0 -942
- package/components/WheelOfFortune-Bh2XAbs4.cjs +0 -619
- package/components/WheelOfFortune-Bq6wSR__.cjs +0 -627
- package/components/WheelOfFortune-BwmCnHru.js +0 -926
- package/components/WheelOfFortune-CEH-5uIV.js +0 -950
- package/components/WheelOfFortune-CHgHhi9q.cjs +0 -619
- package/components/WheelOfFortune-CRgnumXh.cjs +0 -627
- package/components/WheelOfFortune-CZ2cERqz.cjs +0 -619
- package/components/WheelOfFortune-CpYsfi8D.js +0 -934
- package/components/WheelOfFortune-Cy64rFDw.js +0 -942
- package/components/WheelOfFortune-D2dcgbxg.js +0 -934
- package/components/WheelOfFortune-DZ7fGpS9.cjs +0 -619
- package/components/WheelOfFortune-DZg0i79U.js +0 -949
- package/components/WheelOfFortune-DawF7WTd.js +0 -944
- package/components/WheelOfFortune-DjdKhLGF.cjs +0 -617
- package/components/WheelOfFortune-KpRQWn3C.cjs +0 -627
- package/components/WheelOfFortune-M5VMIsnw.cjs +0 -619
- package/components/WheelOfFortune-kXjxp6t7.js +0 -926
- package/components/WheelOfFortune-pBG33-QJ.js +0 -933
- package/components/WheelOfFortuneWheel-B4fe-idJ.cjs +0 -3
- package/components/WheelOfFortuneWheel-BABzaEBd.js +0 -1812
- package/components/WheelOfFortuneWheel-BQFaJ7ZB.cjs +0 -3
- package/components/WheelOfFortuneWheel-BYEHNHdI.js +0 -1807
- package/components/WheelOfFortuneWheel-BuBjvGRI.cjs +0 -3
- package/components/WheelOfFortuneWheel-CQCLWOFi.js +0 -1908
- package/components/WheelOfFortuneWheel-CsOjhUcv.cjs +0 -3
- package/components/WheelOfFortuneWheel-DUE4gyGP.js +0 -1741
- package/components/WheelOfFortuneWheel-DXhwrWpD.js +0 -1978
- package/components/WheelOfFortuneWheel-DgVQP4GA.js +0 -1735
- package/components/constants-BDMySuIA.cjs +0 -1
- package/components/constants-DNSPUges.cjs +0 -1
- package/components/constants-DdcZGwlM.js +0 -38
- package/components/constants-DgCBmV7S.js +0 -29
- package/components/countdown-2m_26DZf.js +0 -157
- package/components/countdown-Bp3yWidJ.cjs +0 -1
- package/components/countdown-CH5h-cVr.js +0 -146
- package/components/countdown-CnUPVFlE.cjs +0 -1
- package/components/countdown-YmZm4DrD.js +0 -146
- package/components/sparkles-B2kHtb3R.js +0 -14
- package/components/sparkles-BBLT1jhq.js +0 -14
- package/components/sparkles-BIl7-lvq.cjs +0 -1
- package/components/sparkles-BRrL2C0i.cjs +0 -1
- package/components/sparkles-BXFe6GK6.js +0 -18
- package/components/sparkles-Cot5wZXx.cjs +0 -1
- package/components/sparkles-DKbGLSaY.cjs +0 -1
- package/components/sparkles-WqrZ-iXs.js +0 -18
- package/components/spin-controller-BF6ymCY4.cjs +0 -1
- package/components/spin-controller-Bc8nQATS.cjs +0 -1
- package/components/spin-controller-CC3QZvWl.js +0 -175
- package/components/spin-controller-CEIahkSh.cjs +0 -1
- package/components/spin-controller-CUb1rpPl.js +0 -177
- package/components/spin-controller-CVXfvzb7.cjs +0 -1
- package/components/spin-controller-DkSQ07IL.js +0 -177
- package/components/spin-controller-Dxxx3-ya.js +0 -175
- package/components/utils-AGVOgUGK.cjs +0 -3
- package/components/utils-B3aNdyMX.js +0 -6055
- package/components/utils-DEov6Qk_.js +0 -6007
- package/components/utils-DQ220WK3.js +0 -6016
- package/components/utils-DwrHy7a0.js +0 -6007
- package/components/utils-Dwz-wUFC.cjs +0 -3
- package/components/utils-Rda5erjI.cjs +0 -3
- package/components/utils-fG_nzyoc.cjs +0 -3
- package/components/utils-qUyu-MNU.js +0 -6064
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import { d as vt, c as ft, p as P, o as pt, n as oe, i as le, l as he, s as U, h as S, m as J, b as I, f as V, u as mt } from "./WheelOfFortuneWheel-DgVQP4GA.js";
|
|
2
|
-
import { G as gt, aM as k, aC as yt, W as we, au as y, a0 as t, aN as Ue, aS as u, aT as o, ah as H, L as ht, aO as wt, aP as bt, aY as Tt, aU as xt, aV as Et, aG as F, aQ as Mt, aW as l, b0 as St } from "./utils-DwrHy7a0.js";
|
|
3
|
-
import { E as be, R as Rt, T as At, k as Ct, j as Pt, l as Te, m as Ft, n as He, o as Ve, p as It } from "./constants-DgCBmV7S.js";
|
|
4
|
-
import { f as kt } from "./countdown-CH5h-cVr.js";
|
|
5
|
-
import { c as $e } from "./coin-heads-loqcEtH2.js";
|
|
6
|
-
import { c as Lt } from "./coin-tails-BTbsTwkz.js";
|
|
7
|
-
var Dt = V('<div><span class="coin-royale__chev">︿</span> <span class="coin-royale__hint-text"> </span> <span class="coin-royale__chev coin-royale__chev--down">﹀</span></div> <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9 11V5.5a1.5 1.5 0 0 1 3 0V11h.5V7.5a1.5 1.5 0 0 1 3 0V11h.5V9a1.5 1.5 0 0 1 3 0v6.5c0 3-2 5.5-5.5 5.5H12c-2 0-3.2-.8-4.2-2.3l-2.4-3.6a1.5 1.5 0 0 1 2.3-1.9L9 15.5V11Z"></path></svg>', 1), Yt = V('<div class="coin-royale__badge"><p class="coin-royale__badge-title"> </p> <p class="coin-royale__badge-countdown"> </p></div>'), Ot = V('<div class="coin-royale__badge"><p class="coin-royale__badge-title"> </p> <p class="coin-royale__badge-body"> </p> <button class="coin-royale__badge-close" type="button"> </button></div>'), zt = V('<span class="coin-royale__flips-loader"></span>'), Nt = V('<p class="coin-royale__flips"> <span class="coin-royale__flips-count"><img class="coin-royale__flips-icon" alt="" aria-hidden="true"/> <!></span></p>'), Ut = V('<div class="coin-royale__play"><div class="coin-royale__stage"><div role="button"><div class="coin-royale__coin-shadow"></div> <div class="coin-royale__coin"><div class="coin-royale__coin-drop-shadow" aria-hidden="true"></div> <div class="coin-royale__coin-edge" aria-hidden="true"></div> <div class="coin-royale__face coin-royale__face--front"><img alt="" draggable="false"/></div> <div class="coin-royale__face coin-royale__face--back"><img alt="" draggable="false"/></div></div> <!></div> <!></div></div> <!> <button class="coin-royale__cta" type="button"> </button>', 1);
|
|
8
|
-
function Ht(Ge, h) {
|
|
9
|
-
gt(h, !0);
|
|
10
|
-
const w = () => wt(bt, "$_", Xe), [Xe, We] = Mt();
|
|
11
|
-
let R = P(h, "program", 7, null), K = P(h, "endpoint", 7, null), Q = P(h, "session", 7, null), f = P(h, "isAvailable", 7, !1), ce = P(h, "spinResults", 15, null), p = P(h, "spinActive", 15, !1), ee = P(h, "remainingTimesLoading", 7, !1), de = P(h, "onFlip", 7, () => {
|
|
12
|
-
}), $ = k(yt({}));
|
|
13
|
-
we(() => {
|
|
14
|
-
if (!f() && R()) {
|
|
15
|
-
const e = () => y($, kt(R()?.next?.startTime), !0);
|
|
16
|
-
e();
|
|
17
|
-
const a = setInterval(e, 1e3);
|
|
18
|
-
return () => clearInterval(a);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
let G = k(!1);
|
|
22
|
-
we(() => {
|
|
23
|
-
if (f()) {
|
|
24
|
-
const e = setTimeout(() => y(G, !0), 2e3);
|
|
25
|
-
return () => clearTimeout(e);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
let X = k(!1), A = k(void 0), i = k(void 0), L = k(void 0), C = k(void 0);
|
|
29
|
-
const ue = Tt(() => f() && !p() && !t(X) && !ee());
|
|
30
|
-
let D = 0, Y = !1, W = !1, _e = 0, j = 0, ve = 0, _ = null, te = null, xe, Z = !1;
|
|
31
|
-
const O = (e, a = 1, n = 0) => {
|
|
32
|
-
t(i) && (t(i).style.transform = `translateY(${n}px) rotateX(${e}deg) scale(${a})`);
|
|
33
|
-
};
|
|
34
|
-
we(() => {
|
|
35
|
-
if (!t(A) || !t(i) || !t(L)) return;
|
|
36
|
-
Ee(), O(D);
|
|
37
|
-
const e = new ResizeObserver(() => Ee());
|
|
38
|
-
return e.observe(t(A)), () => e.disconnect();
|
|
39
|
-
});
|
|
40
|
-
const Ee = () => {
|
|
41
|
-
if (!t(A) || !t(i) || !t(L)) return;
|
|
42
|
-
const e = t(A).clientWidth;
|
|
43
|
-
if (!e) return;
|
|
44
|
-
const a = e / 2 * Rt, n = Math.max(14, e * At), r = 2 * a * Math.tan(Math.PI / be) + 0.6;
|
|
45
|
-
t(i).style.setProperty("--half-t", `${(n / 2).toFixed(2)}px`), t(L).replaceChildren();
|
|
46
|
-
for (let s = 0; s < be; s++) {
|
|
47
|
-
const d = document.createElement("div");
|
|
48
|
-
d.className = `coin-royale__edge-seg coin-royale__edge-seg--${s % 2 === 0 ? "a" : "b"}`, d.style.width = `${r.toFixed(2)}px`, d.style.height = `${n.toFixed(2)}px`, d.style.transform = `translate(-50%,-50%) rotateZ(${s * 360 / be}deg) translateY(${(-a).toFixed(2)}px) rotateX(90deg)`, t(L).appendChild(d);
|
|
49
|
-
}
|
|
50
|
-
}, Me = (e) => {
|
|
51
|
-
D = e, _?.cancel(), _ = null, O(e, 1), t(i) && (t(i).style.animation = ""), t(C) && (t(C).style.opacity = "", t(C).style.width = "");
|
|
52
|
-
}, je = (e, a) => new Promise((n) => {
|
|
53
|
-
if (!t(i)) return n();
|
|
54
|
-
_?.cancel(), _ = t(i).animate(e, { fill: "forwards", ...a }), _.onfinish = () => n(), _.oncancel = () => n();
|
|
55
|
-
}), Ze = async (e, a) => {
|
|
56
|
-
const n = new Headers({ "Content-Type": "application/json" });
|
|
57
|
-
Q() && n.append("X-SessionId", Q());
|
|
58
|
-
const r = await fetch(new URL(`${K()}/v1/wof/draw/${R()?.id}`), {
|
|
59
|
-
method: "PUT",
|
|
60
|
-
headers: n,
|
|
61
|
-
cache: "no-store",
|
|
62
|
-
body: JSON.stringify({ action: 1, guid: e }),
|
|
63
|
-
signal: a
|
|
64
|
-
});
|
|
65
|
-
if (!r.ok) throw new Error(`draw request failed: ${r.status}`);
|
|
66
|
-
return r.json();
|
|
67
|
-
}, ae = async (e) => {
|
|
68
|
-
if (!t(ue) || !t(i) || !t(A) || !K()) return;
|
|
69
|
-
de()();
|
|
70
|
-
const a = typeof e == "number" ? e : D;
|
|
71
|
-
p(!0), y(G, !0), y(X, !1), _?.cancel();
|
|
72
|
-
const n = -(t(A).clientHeight * Ct);
|
|
73
|
-
t(C) && (t(C).style.opacity = "0.3", t(C).style.width = "34%");
|
|
74
|
-
const r = () => new Promise((x, E) => requestAnimationFrame((me) => Z ? E(new Error("destroyed")) : x(me)));
|
|
75
|
-
let s = !1, d = !1, v;
|
|
76
|
-
const g = xt(), c = new AbortController();
|
|
77
|
-
te = c;
|
|
78
|
-
const b = Promise.race([
|
|
79
|
-
Ze(g, c.signal),
|
|
80
|
-
new Promise((x, E) => {
|
|
81
|
-
v = setTimeout(
|
|
82
|
-
() => {
|
|
83
|
-
d = !0, c.abort(), E(new Error("draw timed out"));
|
|
84
|
-
},
|
|
85
|
-
Pt
|
|
86
|
-
);
|
|
87
|
-
})
|
|
88
|
-
]);
|
|
89
|
-
b.then(() => s = !0, () => s = !0);
|
|
90
|
-
let T = a;
|
|
91
|
-
try {
|
|
92
|
-
let x = await r();
|
|
93
|
-
const E = x;
|
|
94
|
-
for (; !s || x - E < Te; ) {
|
|
95
|
-
const M = await r(), z = Math.min(M - x, 50) / 1e3;
|
|
96
|
-
x = M;
|
|
97
|
-
const q = M - E, N = Math.min(q / Ft, 1);
|
|
98
|
-
T += He * N * N * (3 - 2 * N) * z;
|
|
99
|
-
const B = Math.min(q / Te, 1), re = 1 - (1 - B) ** 3, Ne = B >= 1 ? Math.sin((q - Te) / 380) * 0.015 : 0;
|
|
100
|
-
O(T, 1 + Ve * (re + Ne), n * (re + Ne));
|
|
101
|
-
}
|
|
102
|
-
const me = await b;
|
|
103
|
-
clearTimeout(v);
|
|
104
|
-
const ie = Et(me, "draw");
|
|
105
|
-
if (ie.success !== !0) throw new Error("draw failed");
|
|
106
|
-
const ct = {
|
|
107
|
-
...ie,
|
|
108
|
-
guid: g,
|
|
109
|
-
lotteryProgramID: ie.lotteryProgramID ?? R()?.id
|
|
110
|
-
}, dt = ie.type === "noprize" ? 180 : 0, Oe = 360, ge = Oe + (dt - ((T + Oe) % 360 + 360) % 360 + 360) % 360, ut = T + ge, ze = 2 * ge / He * 1e3, _t = T, ye = await r();
|
|
111
|
-
for (let M = ye; M - ye < ze; M = await r()) {
|
|
112
|
-
const z = (M - ye) / ze, q = 1 - (1 - z) ** 2, N = Math.min(z / 0.78, 1), B = 1 - N * N, re = z > 0.78 ? Math.sin((z - 0.78) / 0.22 * Math.PI) * 5 : 0;
|
|
113
|
-
O(_t + ge * q, 1 + Ve * B, n * B + re);
|
|
114
|
-
}
|
|
115
|
-
if (Me(ut), await new Promise((M) => xe = setTimeout(M, 550)), Z) return;
|
|
116
|
-
ce(ct), p(!1);
|
|
117
|
-
} catch (x) {
|
|
118
|
-
if (clearTimeout(v), Z) return;
|
|
119
|
-
console.log(x);
|
|
120
|
-
const E = T + ((a - T) % 360 + 360) % 360;
|
|
121
|
-
if (t(i) && await je(
|
|
122
|
-
[
|
|
123
|
-
{ transform: t(i).style.transform },
|
|
124
|
-
{ transform: `translateY(0px) rotateX(${E}deg) scale(1)` }
|
|
125
|
-
],
|
|
126
|
-
{ duration: 420, easing: "cubic-bezier(.55,0,.75,.4)" }
|
|
127
|
-
), Z) return;
|
|
128
|
-
Me(E), d && y(X, !0), p(!1);
|
|
129
|
-
} finally {
|
|
130
|
-
te === c && (te = null);
|
|
131
|
-
}
|
|
132
|
-
}, qe = () => {
|
|
133
|
-
y(X, !1), p(!1);
|
|
134
|
-
}, Se = (e) => {
|
|
135
|
-
t(i) && (_?.cancel(), _ = t(i).animate(
|
|
136
|
-
[
|
|
137
|
-
{ transform: `translateY(0px) rotateX(${e}deg) scale(1)` },
|
|
138
|
-
{
|
|
139
|
-
transform: `translateY(0px) rotateX(${D}deg) scale(1)`
|
|
140
|
-
}
|
|
141
|
-
],
|
|
142
|
-
{
|
|
143
|
-
duration: 320,
|
|
144
|
-
easing: "cubic-bezier(.22,.61,.32,1)",
|
|
145
|
-
fill: "forwards"
|
|
146
|
-
}
|
|
147
|
-
), _.onfinish = () => {
|
|
148
|
-
_?.cancel(), _ = null, O(D, 1), t(i) && (t(i).style.animation = "");
|
|
149
|
-
});
|
|
150
|
-
}, Be = (e) => {
|
|
151
|
-
t(ue) && (Y = !0, W = !1, _e = e.clientY, ve = 0, j = D, _?.cancel(), t(i) && (t(i).style.animation = "none"), y(G, !0));
|
|
152
|
-
}, Re = (e) => {
|
|
153
|
-
if (!Y || p()) return;
|
|
154
|
-
const a = _e - e.clientY;
|
|
155
|
-
ve = a, Math.abs(a) > 4 && (W = !0), O(j + a * 1.1, 1 + Math.min(Math.abs(a) / 400, 0.12));
|
|
156
|
-
}, Ae = (e) => {
|
|
157
|
-
if (!Y) return;
|
|
158
|
-
Y = !1;
|
|
159
|
-
const a = _e - e.clientY;
|
|
160
|
-
if (Math.abs(a) > It) {
|
|
161
|
-
ae(j + a * 1.1);
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
Se(j + a * 1.1);
|
|
165
|
-
}, Ce = () => {
|
|
166
|
-
Y && (Y = !1, W = !1, Se(j + ve * 1.1));
|
|
167
|
-
}, Je = () => {
|
|
168
|
-
if (W) {
|
|
169
|
-
W = !1;
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
ae();
|
|
173
|
-
};
|
|
174
|
-
pt(() => (window.addEventListener("pointermove", Re), window.addEventListener("pointerup", Ae), window.addEventListener("pointercancel", Ce), () => {
|
|
175
|
-
Z = !0, te?.abort(), clearTimeout(xe), window.removeEventListener("pointermove", Re), window.removeEventListener("pointerup", Ae), window.removeEventListener("pointercancel", Ce), _?.cancel();
|
|
176
|
-
}));
|
|
177
|
-
var Ke = {
|
|
178
|
-
get program() {
|
|
179
|
-
return R();
|
|
180
|
-
},
|
|
181
|
-
set program(e = null) {
|
|
182
|
-
R(e), F();
|
|
183
|
-
},
|
|
184
|
-
get endpoint() {
|
|
185
|
-
return K();
|
|
186
|
-
},
|
|
187
|
-
set endpoint(e = null) {
|
|
188
|
-
K(e), F();
|
|
189
|
-
},
|
|
190
|
-
get session() {
|
|
191
|
-
return Q();
|
|
192
|
-
},
|
|
193
|
-
set session(e = null) {
|
|
194
|
-
Q(e), F();
|
|
195
|
-
},
|
|
196
|
-
get isAvailable() {
|
|
197
|
-
return f();
|
|
198
|
-
},
|
|
199
|
-
set isAvailable(e = !1) {
|
|
200
|
-
f(e), F();
|
|
201
|
-
},
|
|
202
|
-
get spinResults() {
|
|
203
|
-
return ce();
|
|
204
|
-
},
|
|
205
|
-
set spinResults(e = null) {
|
|
206
|
-
ce(e), F();
|
|
207
|
-
},
|
|
208
|
-
get spinActive() {
|
|
209
|
-
return p();
|
|
210
|
-
},
|
|
211
|
-
set spinActive(e = !1) {
|
|
212
|
-
p(e), F();
|
|
213
|
-
},
|
|
214
|
-
get remainingTimesLoading() {
|
|
215
|
-
return ee();
|
|
216
|
-
},
|
|
217
|
-
set remainingTimesLoading(e = !1) {
|
|
218
|
-
ee(e), F();
|
|
219
|
-
},
|
|
220
|
-
get onFlip() {
|
|
221
|
-
return de();
|
|
222
|
-
},
|
|
223
|
-
set onFlip(e = () => {
|
|
224
|
-
}) {
|
|
225
|
-
de(e), F();
|
|
226
|
-
}
|
|
227
|
-
}, Pe = Ut(), fe = Ue(Pe), Fe = o(fe), m = o(Fe);
|
|
228
|
-
let Ie;
|
|
229
|
-
var ke = o(m);
|
|
230
|
-
oe(ke, (e) => y(C, e), () => t(C));
|
|
231
|
-
var ne = u(ke, 2), Le = u(o(ne), 2);
|
|
232
|
-
oe(Le, (e) => y(L, e), () => t(L));
|
|
233
|
-
var pe = u(Le, 2), Qe = o(pe);
|
|
234
|
-
l(pe);
|
|
235
|
-
var De = u(pe, 2), et = o(De);
|
|
236
|
-
l(De), l(ne), oe(ne, (e) => y(i, e), () => t(i));
|
|
237
|
-
var tt = u(ne, 2);
|
|
238
|
-
{
|
|
239
|
-
var at = (e) => {
|
|
240
|
-
var a = Dt(), n = Ue(a);
|
|
241
|
-
let r;
|
|
242
|
-
var s = u(o(n), 2), d = o(s, !0);
|
|
243
|
-
l(s), St(2), l(n);
|
|
244
|
-
var v = u(n, 2);
|
|
245
|
-
let g;
|
|
246
|
-
H(
|
|
247
|
-
(c) => {
|
|
248
|
-
r = he(n, 1, "coin-royale__drag-hint", null, r, {
|
|
249
|
-
"coin-royale__drag-hint--hidden": t(G) || p()
|
|
250
|
-
}), S(d, c), g = he(v, 0, "coin-royale__finger-cue", null, g, {
|
|
251
|
-
"coin-royale__finger-cue--hidden": t(G) || p()
|
|
252
|
-
});
|
|
253
|
-
},
|
|
254
|
-
[() => w()("dragToFlip")]
|
|
255
|
-
), I(e, a);
|
|
256
|
-
};
|
|
257
|
-
le(tt, (e) => {
|
|
258
|
-
f() && e(at);
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
l(m), oe(m, (e) => y(A, e), () => t(A));
|
|
262
|
-
var nt = u(m, 2);
|
|
263
|
-
{
|
|
264
|
-
var st = (e) => {
|
|
265
|
-
var a = Yt(), n = o(a), r = o(n, !0);
|
|
266
|
-
l(n);
|
|
267
|
-
var s = u(n, 2), d = o(s, !0);
|
|
268
|
-
l(s), l(a), H(
|
|
269
|
-
(v, g) => {
|
|
270
|
-
S(r, v), S(d, g);
|
|
271
|
-
},
|
|
272
|
-
[
|
|
273
|
-
() => w()("nextAvailable"),
|
|
274
|
-
() => w()("countdown", {
|
|
275
|
-
values: {
|
|
276
|
-
days: t($).days,
|
|
277
|
-
hours: t($).hours,
|
|
278
|
-
minutes: t($).minutes,
|
|
279
|
-
seconds: t($).seconds
|
|
280
|
-
}
|
|
281
|
-
})
|
|
282
|
-
]
|
|
283
|
-
), I(e, a);
|
|
284
|
-
}, it = (e) => {
|
|
285
|
-
var a = Ot(), n = o(a), r = o(n, !0);
|
|
286
|
-
l(n);
|
|
287
|
-
var s = u(n, 2), d = o(s, !0);
|
|
288
|
-
l(s);
|
|
289
|
-
var v = u(s, 2), g = o(v, !0);
|
|
290
|
-
l(v), l(a), H(
|
|
291
|
-
(c, b, T) => {
|
|
292
|
-
S(r, c), S(d, b), S(g, T);
|
|
293
|
-
},
|
|
294
|
-
[
|
|
295
|
-
() => w()("timeoutTitle"),
|
|
296
|
-
() => w()("timeoutDescription"),
|
|
297
|
-
() => w()("close")
|
|
298
|
-
]
|
|
299
|
-
), J("click", v, qe), I(e, a);
|
|
300
|
-
};
|
|
301
|
-
le(nt, (e) => {
|
|
302
|
-
f() ? t(X) && e(it, 1) : e(st);
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
l(Fe), l(fe);
|
|
306
|
-
var Ye = u(fe, 2);
|
|
307
|
-
{
|
|
308
|
-
var rt = (e) => {
|
|
309
|
-
var a = Nt(), n = o(a), r = u(n), s = o(r), d = u(s, 2);
|
|
310
|
-
{
|
|
311
|
-
var v = (c) => {
|
|
312
|
-
var b = zt();
|
|
313
|
-
I(c, b);
|
|
314
|
-
}, g = (c) => {
|
|
315
|
-
var b = mt();
|
|
316
|
-
H(() => S(b, R()?.current?.remainingTimes ?? R()?.remainingTimes)), I(c, b);
|
|
317
|
-
};
|
|
318
|
-
le(d, (c) => {
|
|
319
|
-
ee() ? c(v) : c(g, -1);
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
l(r), l(a), H(
|
|
323
|
-
(c) => {
|
|
324
|
-
S(n, `${c ?? ""} `), U(s, "src", $e);
|
|
325
|
-
},
|
|
326
|
-
[() => w()("remainingFlips")]
|
|
327
|
-
), I(e, a);
|
|
328
|
-
};
|
|
329
|
-
le(Ye, (e) => {
|
|
330
|
-
f() && e(rt);
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
var se = u(Ye, 2), ot = o(se, !0);
|
|
334
|
-
l(se), H(
|
|
335
|
-
(e, a) => {
|
|
336
|
-
Ie = he(m, 1, "coin-royale__flip-zone", null, Ie, {
|
|
337
|
-
"coin-royale__flip-zone--disabled": !f(),
|
|
338
|
-
"coin-royale__flip-zone--settling": p()
|
|
339
|
-
}), U(m, "tabindex", f() ? 0 : -1), U(m, "aria-label", e), U(m, "aria-disabled", !t(ue)), U(Qe, "src", $e), U(et, "src", Lt), se.disabled = !f(), S(ot, a);
|
|
340
|
-
},
|
|
341
|
-
[() => w()("flipCoin"), () => w()("flipCoin")]
|
|
342
|
-
), J("pointerdown", m, Be), J("click", m, Je), J("keydown", m, (e) => {
|
|
343
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), ae());
|
|
344
|
-
}), J("click", se, () => ae()), I(Ge, Pe);
|
|
345
|
-
var lt = ht(Ke);
|
|
346
|
-
return We(), lt;
|
|
347
|
-
}
|
|
348
|
-
vt(["pointerdown", "click", "keydown"]);
|
|
349
|
-
ft(
|
|
350
|
-
Ht,
|
|
351
|
-
{
|
|
352
|
-
program: {},
|
|
353
|
-
endpoint: {},
|
|
354
|
-
session: {},
|
|
355
|
-
isAvailable: {},
|
|
356
|
-
spinResults: {},
|
|
357
|
-
spinActive: {},
|
|
358
|
-
remainingTimesLoading: {},
|
|
359
|
-
onFlip: {}
|
|
360
|
-
},
|
|
361
|
-
[],
|
|
362
|
-
[],
|
|
363
|
-
{ mode: "open" }
|
|
364
|
-
);
|
|
365
|
-
export {
|
|
366
|
-
Ht as C
|
|
367
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./WheelOfFortuneWheel-BQFaJ7ZB.cjs"),e=require("./utils-fG_nzyoc.cjs"),d=require("./constants-DNSPUges.cjs"),Be=require("./countdown-CnUPVFlE.cjs"),Se=require("./coin-heads-BuJOLpyg.cjs"),Je=require("./coin-tails-20vJmhwv.cjs");var Ke=n.from_html('<div><span class="coin-royale__chev">︿</span> <span class="coin-royale__hint-text"> </span> <span class="coin-royale__chev coin-royale__chev--down">﹀</span></div> <svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9 11V5.5a1.5 1.5 0 0 1 3 0V11h.5V7.5a1.5 1.5 0 0 1 3 0V11h.5V9a1.5 1.5 0 0 1 3 0v6.5c0 3-2 5.5-5.5 5.5H12c-2 0-3.2-.8-4.2-2.3l-2.4-3.6a1.5 1.5 0 0 1 2.3-1.9L9 15.5V11Z"></path></svg>',1),Qe=n.from_html('<div class="coin-royale__badge"><p class="coin-royale__badge-title"> </p> <p class="coin-royale__badge-countdown"> </p></div>'),et=n.from_html('<div class="coin-royale__badge"><p class="coin-royale__badge-title"> </p> <p class="coin-royale__badge-body"> </p> <button class="coin-royale__badge-close" type="button"> </button></div>'),tt=n.from_html('<span class="coin-royale__flips-loader"></span>'),nt=n.from_html('<p class="coin-royale__flips"> <span class="coin-royale__flips-count"><img class="coin-royale__flips-icon" alt="" aria-hidden="true"/> <!></span></p>'),it=n.from_html('<div class="coin-royale__play"><div class="coin-royale__stage"><div role="button"><div class="coin-royale__coin-shadow"></div> <div class="coin-royale__coin"><div class="coin-royale__coin-drop-shadow" aria-hidden="true"></div> <div class="coin-royale__coin-edge" aria-hidden="true"></div> <div class="coin-royale__face coin-royale__face--front"><img alt="" draggable="false"/></div> <div class="coin-royale__face coin-royale__face--back"><img alt="" draggable="false"/></div></div> <!></div> <!></div></div> <!> <button class="coin-royale__cta" type="button"> </button>',1);function Te(Me,m){e.push(m,!0);const h=()=>e.store_get(e.$format,"$_",Ie),[Ie,Ae]=e.setup_stores();let S=n.prop(m,"program",7,null),G=n.prop(m,"endpoint",7,null),q=n.prop(m,"session",7,null),v=n.prop(m,"isAvailable",7,!1),B=n.prop(m,"spinResults",15,null),u=n.prop(m,"spinActive",15,!1),U=n.prop(m,"remainingTimesLoading",7,!1),J=n.prop(m,"onFlip",7,()=>{}),L=e.state(e.proxy({}));e.user_effect(()=>{if(!v()&&S()){const t=()=>e.set(L,Be.formatTimeRemaining(S()?.next?.startTime),!0);t();const i=setInterval(t,1e3);return()=>clearInterval(i)}});let I=e.state(!1),K;const Re=()=>{clearTimeout(K),K=setTimeout(()=>e.set(I,!1),400)};let N=e.state(!1),T=e.state(void 0),r=e.state(void 0),A=e.state(void 0),M=e.state(void 0);const Q=e.user_derived(()=>v()&&!u()&&!e.get(N)&&!U());let R=0,F=!1,Y=!1,ee=0,H=0,te=0,_=null,$=null,oe,P=!1;const C=(t,i=1,s=0)=>{e.get(r)&&(e.get(r).style.transform=`translateY(${s}px) rotateX(${t}deg) scale(${i})`)};e.user_effect(()=>{if(!e.get(T)||!e.get(r)||!e.get(A))return;le(),C(R);const t=new ResizeObserver(()=>le());return t.observe(e.get(T)),()=>t.disconnect()});const le=()=>{if(!e.get(T)||!e.get(r)||!e.get(A))return;const t=e.get(T).clientWidth;if(!t)return;const i=t/2*d.RIM_FACTOR,s=Math.max(14,t*d.THICKNESS_FACTOR),o=2*i*Math.tan(Math.PI/d.EDGE_SEGMENTS)+.6;e.get(r).style.setProperty("--half-t",`${(s/2).toFixed(2)}px`),e.get(A).replaceChildren();for(let a=0;a<d.EDGE_SEGMENTS;a++){const c=document.createElement("div");c.className=`coin-royale__edge-seg coin-royale__edge-seg--${a%2===0?"a":"b"}`,c.style.width=`${o.toFixed(2)}px`,c.style.height=`${s.toFixed(2)}px`,c.style.transform=`translate(-50%,-50%) rotateZ(${a*360/d.EDGE_SEGMENTS}deg) translateY(${(-i).toFixed(2)}px) rotateX(90deg)`,e.get(A).appendChild(c)}},ce=t=>{R=t,_?.cancel(),_=null,C(t,1),e.get(r)&&(e.get(r).style.animation=""),e.get(M)&&(e.get(M).style.opacity="",e.get(M).style.width="")},Fe=(t,i)=>new Promise(s=>{if(!e.get(r))return s();_?.cancel(),_=e.get(r).animate(t,{fill:"forwards",...i}),_.onfinish=()=>s(),_.oncancel=()=>s()}),Pe=async(t,i)=>{const s=new Headers({"Content-Type":"application/json"});q()&&s.append("X-SessionId",q());const o=await fetch(new URL(`${G()}/v1/wof/draw/${S()?.id}`),{method:"PUT",headers:s,cache:"no-store",body:JSON.stringify({action:1,guid:t}),signal:i});if(!o.ok)throw new Error(`draw request failed: ${o.status}`);return o.json()},V=async t=>{if(!e.get(Q)||!e.get(r)||!e.get(T)||!G())return;J()();const i=typeof t=="number"?t:R;u(!0),e.set(I,!0),e.set(N,!1),_?.cancel();const s=-(e.get(T).clientHeight*d.RISE_FACTOR);e.get(M)&&(e.get(M).style.opacity="0.3",e.get(M).style.width="34%");const o=()=>new Promise((w,E)=>requestAnimationFrame(se=>P?E(new Error("destroyed")):w(se)));let a=!1,c=!1,g;const p=e.generateUUID(),l=new AbortController;$=l;const y=Promise.race([Pe(p,l.signal),new Promise((w,E)=>{g=setTimeout(()=>{c=!0,l.abort(),E(new Error("draw timed out"))},d.SPIN_TIMEOUT_MS)})]);y.then(()=>a=!0,()=>a=!0);let b=i;try{let w=await o();const E=w;for(;!a||w-E<d.RISE_MS;){const x=await o(),k=Math.min(x-w,50)/1e3;w=x;const O=x-E,D=Math.min(O/d.SPIN_UP_MS,1);b+=d.SPIN_SPEED*D*D*(3-2*D)*k;const z=Math.min(O/d.RISE_MS,1),j=1-(1-z)**3,xe=z>=1?Math.sin((O-d.RISE_MS)/380)*.015:0;C(b,1+d.SCALE_GAIN*(j+xe),s*(j+xe))}const se=await y;clearTimeout(g);const Z=e.normalizeDrawResult(se,"draw");if(Z.success!==!0)throw new Error("draw failed");const Xe={...Z,guid:p,lotteryProgramID:Z.lotteryProgramID??S()?.id},We=Z.type==="noprize"?180:0,we=360,ae=we+(We-((b+we)%360+360)%360+360)%360,Ze=b+ae,Ee=2*ae/d.SPIN_SPEED*1e3,je=b,re=await o();for(let x=re;x-re<Ee;x=await o()){const k=(x-re)/Ee,O=1-(1-k)**2,D=Math.min(k/.78,1),z=1-D*D,j=k>.78?Math.sin((k-.78)/.22*Math.PI)*5:0;C(je+ae*O,1+d.SCALE_GAIN*z,s*z+j)}if(ce(Ze),await new Promise(x=>oe=setTimeout(x,550)),P)return;B(Xe),u(!1)}catch(w){if(clearTimeout(g),P)return;console.log(w);const E=b+((i-b)%360+360)%360;if(e.get(r)&&await Fe([{transform:e.get(r).style.transform},{transform:`translateY(0px) rotateX(${E}deg) scale(1)`}],{duration:420,easing:"cubic-bezier(.55,0,.75,.4)"}),P)return;ce(E),c&&e.set(N,!0),u(!1)}finally{$===l&&($=null),P||Re()}},Ce=()=>{e.set(N,!1),u(!1)},de=t=>{e.get(r)&&(_?.cancel(),_=e.get(r).animate([{transform:`translateY(0px) rotateX(${t}deg) scale(1)`},{transform:`translateY(0px) rotateX(${R}deg) scale(1)`}],{duration:320,easing:"cubic-bezier(.22,.61,.32,1)",fill:"forwards"}),_.onfinish=()=>{_?.cancel(),_=null,C(R,1),e.get(r)&&(e.get(r).style.animation=""),e.set(I,!1)})},ke=t=>{e.get(Q)&&(F=!0,Y=!1,ee=t.clientY,te=0,H=R,_?.cancel(),e.get(r)&&(e.get(r).style.animation="none"),e.set(I,!0))},_e=t=>{if(!F||u())return;const i=ee-t.clientY;te=i,Math.abs(i)>4&&(Y=!0),C(H+i*1.1,1+Math.min(Math.abs(i)/400,.12))},ge=t=>{if(!F)return;F=!1;const i=ee-t.clientY;if(Math.abs(i)>d.DRAG_THRESHOLD){V(H+i*1.1);return}de(H+i*1.1)},ue=()=>{F&&(F=!1,Y=!1,de(H+te*1.1))},De=()=>{if(Y){Y=!1;return}V()};n.onMount(()=>(window.addEventListener("pointermove",_e),window.addEventListener("pointerup",ge),window.addEventListener("pointercancel",ue),()=>{P=!0,$?.abort(),clearTimeout(oe),clearTimeout(K),window.removeEventListener("pointermove",_e),window.removeEventListener("pointerup",ge),window.removeEventListener("pointercancel",ue),_?.cancel()}));var Le={get program(){return S()},set program(t=null){S(t),e.flushSync()},get endpoint(){return G()},set endpoint(t=null){G(t),e.flushSync()},get session(){return q()},set session(t=null){q(t),e.flushSync()},get isAvailable(){return v()},set isAvailable(t=!1){v(t),e.flushSync()},get spinResults(){return B()},set spinResults(t=null){B(t),e.flushSync()},get spinActive(){return u()},set spinActive(t=!1){u(t),e.flushSync()},get remainingTimesLoading(){return U()},set remainingTimesLoading(t=!1){U(t),e.flushSync()},get onFlip(){return J()},set onFlip(t=()=>{}){J(t),e.flushSync()}},fe=it(),ne=e.first_child(fe),pe=e.child(ne),f=e.child(pe);let ve;var me=e.child(f);n.bind_this(me,t=>e.set(M,t),()=>e.get(M));var X=e.sibling(me,2),he=e.sibling(e.child(X),2);n.bind_this(he,t=>e.set(A,t),()=>e.get(A));var ie=e.sibling(he,2),Ne=e.child(ie);e.reset(ie);var ye=e.sibling(ie,2),Ye=e.child(ye);e.reset(ye),e.reset(X),n.bind_this(X,t=>e.set(r,t),()=>e.get(r));var He=e.sibling(X,2);{var Oe=t=>{var i=Ke(),s=e.first_child(i);let o;var a=e.sibling(e.child(s),2),c=e.child(a,!0);e.reset(a),e.next(2),e.reset(s);var g=e.sibling(s,2);let p;e.template_effect(l=>{o=n.set_class(s,1,"coin-royale__drag-hint",null,o,{"coin-royale__drag-hint--hidden":e.get(I)||u()}),n.set_text(c,l),p=n.set_class(g,0,"coin-royale__finger-cue",null,p,{"coin-royale__finger-cue--hidden":e.get(I)||u()})},[()=>h()("dragToFlip")]),n.append(t,i)};n.if_block(He,t=>{v()&&t(Oe)})}e.reset(f),n.bind_this(f,t=>e.set(T,t),()=>e.get(T));var ze=e.sibling(f,2);{var Ge=t=>{var i=Qe(),s=e.child(i),o=e.child(s,!0);e.reset(s);var a=e.sibling(s,2),c=e.child(a,!0);e.reset(a),e.reset(i),e.template_effect((g,p)=>{n.set_text(o,g),n.set_text(c,p)},[()=>h()("nextAvailable"),()=>h()("countdown",{values:{days:e.get(L).days,hours:e.get(L).hours,minutes:e.get(L).minutes,seconds:e.get(L).seconds}})]),n.append(t,i)},qe=t=>{var i=et(),s=e.child(i),o=e.child(s,!0);e.reset(s);var a=e.sibling(s,2),c=e.child(a,!0);e.reset(a);var g=e.sibling(a,2),p=e.child(g,!0);e.reset(g),e.reset(i),e.template_effect((l,y,b)=>{n.set_text(o,l),n.set_text(c,y),n.set_text(p,b)},[()=>h()("timeoutTitle"),()=>h()("timeoutDescription"),()=>h()("close")]),n.delegated("click",g,Ce),n.append(t,i)};n.if_block(ze,t=>{v()?e.get(N)&&t(qe,1):t(Ge)})}e.reset(pe),e.reset(ne);var be=e.sibling(ne,2);{var Ue=t=>{var i=nt(),s=e.child(i),o=e.sibling(s),a=e.child(o),c=e.sibling(a,2);{var g=l=>{var y=tt();n.append(l,y)},p=l=>{var y=n.text();e.template_effect(()=>n.set_text(y,S()?.current?.remainingTimes??S()?.remainingTimes)),n.append(l,y)};n.if_block(c,l=>{U()?l(g):l(p,-1)})}e.reset(o),e.reset(i),e.template_effect(l=>{n.set_text(s,`${l??""} `),n.set_attribute(a,"src",Se.coinHeads)},[()=>h()("remainingFlips")]),n.append(t,i)};n.if_block(be,t=>{v()&&t(Ue)})}var W=e.sibling(be,2),$e=e.child(W,!0);e.reset(W),e.template_effect((t,i)=>{ve=n.set_class(f,1,"coin-royale__flip-zone",null,ve,{"coin-royale__flip-zone--disabled":!v(),"coin-royale__flip-zone--settling":u()}),n.set_attribute(f,"tabindex",v()?0:-1),n.set_attribute(f,"aria-label",t),n.set_attribute(f,"aria-disabled",!e.get(Q)),n.set_attribute(Ne,"src",Se.coinHeads),n.set_attribute(Ye,"src",Je.coinTails),W.disabled=!v(),n.set_text($e,i)},[()=>h()("flipCoin"),()=>h()("flipCoin")]),n.delegated("pointerdown",f,ke),n.delegated("click",f,De),n.delegated("keydown",f,t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),V())}),n.delegated("click",W,()=>V()),n.append(Me,fe);var Ve=e.pop(Le);return Ae(),Ve}n.delegate(["pointerdown","click","keydown"]);n.create_custom_element(Te,{program:{},endpoint:{},session:{},isAvailable:{},spinResults:{},spinActive:{},remainingTimesLoading:{},onFlip:{}},[],[],{mode:"open"});exports.CoinFlip=Te;
|