@everymatrix/casino-engagement-suite-luckywheel 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.esm.js +1 -1
  2. package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -1
  3. package/dist/casino-engagement-suite-luckywheel/p-7d1170ae.js +2 -0
  4. package/dist/casino-engagement-suite-luckywheel/p-e1ff4a5e.entry.js +1 -0
  5. package/dist/casino-engagement-suite-luckywheel/p-eb7c14fc.js +15 -0
  6. package/dist/cjs/{casino-engagement-suite-luckywheel-cc8d37c2.js → casino-engagement-suite-luckywheel-8e04ce53.js} +21 -37
  7. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +2 -2
  8. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.js +2 -2
  9. package/dist/cjs/{index-b46604f4.js → index-6096cc4b.js} +70 -207
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +19 -44
  14. package/dist/esm/{casino-engagement-suite-luckywheel-cf7e798a.js → casino-engagement-suite-luckywheel-a8c23787.js} +21 -37
  15. package/dist/esm/casino-engagement-suite-luckywheel.entry.js +2 -2
  16. package/dist/esm/casino-engagement-suite-luckywheel.js +3 -3
  17. package/dist/esm/{index-8ce51859.js → index-48c42d04.js} +70 -207
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/loader.js +2 -2
  20. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +2 -0
  21. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +2 -0
  22. package/dist/types/stencil-public-runtime.d.ts +0 -6
  23. package/package.json +1 -1
  24. package/dist/casino-engagement-suite-luckywheel/p-2a6e103b.entry.js +0 -1
  25. package/dist/casino-engagement-suite-luckywheel/p-781c5f2a.js +0 -1
  26. package/dist/casino-engagement-suite-luckywheel/p-eaad80fd.js +0 -2
  27. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +0 -2
  28. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +0 -2
  29. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/main.d.ts +0 -0
  30. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/preview.d.ts +0 -0
  31. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/index.d.ts +0 -0
  32. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  33. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  34. /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,25 +1,17 @@
1
1
  const NAMESPACE = 'casino-engagement-suite-luckywheel';
2
- const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
2
+ const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
-
13
- // src/utils/constants.ts
14
- var SVG_NS = "http://www.w3.org/2000/svg";
15
- var HTML_NS = "http://www.w3.org/1999/xhtml";
16
-
17
- // src/client/client-host-ref.ts
18
12
  var hostRefs = /* @__PURE__ */ new WeakMap();
19
13
  var getHostRef = (ref) => hostRefs.get(ref);
20
- var registerInstance = (lazyInstance, hostRef) => {
21
- hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
22
- };
14
+ var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
23
15
  var registerHost = (hostElement, cmpMeta) => {
24
16
  const hostRef = {
25
17
  $flags$: 0,
@@ -32,8 +24,7 @@ var registerHost = (hostElement, cmpMeta) => {
32
24
  hostElement["s-p"] = [];
33
25
  hostElement["s-rc"] = [];
34
26
  }
35
- const ref = hostRefs.set(hostElement, hostRef);
36
- return ref;
27
+ return hostRefs.set(hostElement, hostRef);
37
28
  };
38
29
  var isMemberInElement = (elm, memberName) => memberName in elm;
39
30
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -70,22 +61,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
70
61
  /* webpackExclude: /\.system\.entry\.js$/ */
71
62
  /* webpackMode: "lazy" */
72
63
  `./${bundleId}.entry.js${""}`
73
- ).then(
74
- (importedModule) => {
75
- {
76
- cmpModules.set(bundleId, importedModule);
77
- }
78
- return importedModule[exportName];
79
- },
80
- (e) => {
81
- consoleError(e, hostRef.$hostElement$);
64
+ ).then((importedModule) => {
65
+ {
66
+ cmpModules.set(bundleId, importedModule);
82
67
  }
83
- );
68
+ return importedModule[exportName];
69
+ }, consoleError);
84
70
  };
85
71
 
86
72
  // src/client/client-style.ts
87
73
  var styles = /* @__PURE__ */ new Map();
88
- var HYDRATED_STYLE_ID = "sty-id";
89
74
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
90
75
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
91
76
  var XLINK_NS = "http://www.w3.org/1999/xlink";
@@ -160,6 +145,14 @@ var flush = () => {
160
145
  };
161
146
  var nextTick = (cb) => promiseResolve().then(cb);
162
147
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
148
+
149
+ // src/utils/constants.ts
150
+ var EMPTY_OBJ = {};
151
+ var SVG_NS = "http://www.w3.org/2000/svg";
152
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
153
+
154
+ // src/utils/helpers.ts
155
+ var isDef = (v) => v != null;
163
156
  var isComplexType = (o) => {
164
157
  o = typeof o;
165
158
  return o === "object" || o === "function";
@@ -342,40 +335,13 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
342
335
  }
343
336
  if (!appliedStyles.has(scopeId2)) {
344
337
  {
345
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
338
+ styleElm = doc.createElement("style");
346
339
  styleElm.innerHTML = style;
347
340
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
348
341
  if (nonce != null) {
349
342
  styleElm.setAttribute("nonce", nonce);
350
343
  }
351
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
352
- if (styleContainerNode.nodeName === "HEAD") {
353
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
354
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
355
- styleContainerNode.insertBefore(
356
- styleElm,
357
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
358
- );
359
- } else if ("host" in styleContainerNode) {
360
- if (supportsConstructableStylesheets) {
361
- const stylesheet = new CSSStyleSheet();
362
- stylesheet.replaceSync(style);
363
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
364
- } else {
365
- const existingStyleContainer = styleContainerNode.querySelector("style");
366
- if (existingStyleContainer) {
367
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
368
- } else {
369
- styleContainerNode.prepend(styleElm);
370
- }
371
- }
372
- } else {
373
- styleContainerNode.append(styleElm);
374
- }
375
- }
376
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
377
- styleContainerNode.insertBefore(styleElm, null);
378
- }
344
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
379
345
  }
380
346
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
381
347
  styleElm.innerHTML += SLOT_FB_CSS;
@@ -398,25 +364,23 @@ var attachStyles = (hostRef) => {
398
364
  const scopeId2 = addStyle(
399
365
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
400
366
  cmpMeta);
401
- if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
367
+ if (flags & 10 /* needsScopedEncapsulation */) {
402
368
  elm["s-sc"] = scopeId2;
403
369
  elm.classList.add(scopeId2 + "-h");
404
370
  }
405
371
  endAttachStyles();
406
372
  };
407
373
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
408
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
374
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
409
375
  if (oldValue !== newValue) {
410
376
  let isProp = isMemberInElement(elm, memberName);
411
377
  let ln = memberName.toLowerCase();
412
378
  if (memberName === "class") {
413
379
  const classList = elm.classList;
414
380
  const oldClasses = parseClassList(oldValue);
415
- let newClasses = parseClassList(newValue);
416
- {
417
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
418
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
419
- }
381
+ const newClasses = parseClassList(newValue);
382
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
383
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
420
384
  } else if (memberName === "style") {
421
385
  {
422
386
  for (const prop in oldValue) {
@@ -469,13 +433,9 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
469
433
  if (memberName === "list") {
470
434
  isProp = false;
471
435
  } else if (oldValue == null || elm[memberName] != n) {
472
- if (typeof elm.__lookupSetter__(memberName) === "function") {
473
- elm[memberName] = n;
474
- } else {
475
- elm.setAttribute(memberName, n);
476
- }
436
+ elm[memberName] = n;
477
437
  }
478
- } else if (elm[memberName] !== newValue) {
438
+ } else {
479
439
  elm[memberName] = newValue;
480
440
  }
481
441
  } catch (e) {
@@ -508,44 +468,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
508
468
  }
509
469
  };
510
470
  var parseClassListRegex = /\s/;
511
- var parseClassList = (value) => {
512
- if (typeof value === "object" && value && "baseVal" in value) {
513
- value = value.baseVal;
514
- }
515
- if (!value || typeof value !== "string") {
516
- return [];
517
- }
518
- return value.split(parseClassListRegex);
519
- };
471
+ var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
520
472
  var CAPTURE_EVENT_SUFFIX = "Capture";
521
473
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
522
474
 
523
475
  // src/runtime/vdom/update-element.ts
524
- var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
476
+ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
525
477
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
526
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
527
- const newVnodeAttrs = newVnode.$attrs$ || {};
478
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
479
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
528
480
  {
529
481
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
530
482
  if (!(memberName in newVnodeAttrs)) {
531
- setAccessor(
532
- elm,
533
- memberName,
534
- oldVnodeAttrs[memberName],
535
- void 0,
536
- isSvgMode2,
537
- newVnode.$flags$);
483
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
538
484
  }
539
485
  }
540
486
  }
541
487
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
542
- setAccessor(
543
- elm,
544
- memberName,
545
- oldVnodeAttrs[memberName],
546
- newVnodeAttrs[memberName],
547
- isSvgMode2,
548
- newVnode.$flags$);
488
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
549
489
  }
550
490
  };
551
491
  function sortedAttrNames(attrNames) {
@@ -557,10 +497,13 @@ function sortedAttrNames(attrNames) {
557
497
  attrNames
558
498
  );
559
499
  }
500
+
501
+ // src/runtime/vdom/vdom-render.ts
502
+ var scopeId;
560
503
  var hostTagName;
561
504
  var useNativeShadowDom = false;
562
505
  var isSvgMode = false;
563
- var createElm = (oldParentVNode, newParentVNode, childIndex) => {
506
+ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
564
507
  const newVNode2 = newParentVNode.$children$[childIndex];
565
508
  let i2 = 0;
566
509
  let elm;
@@ -581,6 +524,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
581
524
  {
582
525
  updateElement(null, newVNode2, isSvgMode);
583
526
  }
527
+ if (isDef(scopeId) && elm["s-si"] !== scopeId) {
528
+ elm.classList.add(elm["s-si"] = scopeId);
529
+ }
584
530
  if (newVNode2.$children$) {
585
531
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
586
532
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -717,9 +663,6 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
717
663
  if (!isInitialRender) {
718
664
  return leftVNode.$key$ === rightVNode.$key$;
719
665
  }
720
- if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
721
- leftVNode.$key$ = rightVNode.$key$;
722
- }
723
666
  return true;
724
667
  }
725
668
  return false;
@@ -746,10 +689,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
746
689
  elm.textContent = "";
747
690
  }
748
691
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
749
- } else if (
750
- // don't do this on initial render as it can cause non-hydrated content to be removed
751
- !isInitialRender && BUILD.updatable && oldChildren !== null
752
- ) {
692
+ } else if (oldChildren !== null) {
753
693
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
754
694
  }
755
695
  if (isSvgMode && tag === "svg") {
@@ -766,9 +706,8 @@ var nullifyVNodeRefs = (vNode) => {
766
706
  }
767
707
  };
768
708
  var insertBefore = (parent, newNode, reference) => {
769
- {
770
- return parent == null ? void 0 : parent.insertBefore(newNode, reference);
771
- }
709
+ const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
710
+ return inserted;
772
711
  };
773
712
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
774
713
  const hostElm = hostRef.$hostElement$;
@@ -793,21 +732,17 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
793
732
  rootVnode.$flags$ |= 4 /* isHost */;
794
733
  hostRef.$vnode$ = rootVnode;
795
734
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
796
- useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
735
+ {
736
+ scopeId = hostElm["s-sc"];
737
+ }
738
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
797
739
  patch(oldVNode, rootVnode, isInitialLoad);
798
740
  };
799
741
 
800
742
  // src/runtime/update-component.ts
801
743
  var attachToAncestor = (hostRef, ancestorComponent) => {
802
744
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
803
- const index = ancestorComponent["s-p"].push(
804
- new Promise(
805
- (r) => hostRef.$onRenderResolve$ = () => {
806
- ancestorComponent["s-p"].splice(index - 1, 1);
807
- r();
808
- }
809
- )
810
- );
745
+ ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
811
746
  }
812
747
  };
813
748
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -836,12 +771,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
836
771
  {
837
772
  hostRef.$flags$ |= 256 /* isListenReady */;
838
773
  if (hostRef.$queuedListeners$) {
839
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
774
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
840
775
  hostRef.$queuedListeners$ = void 0;
841
776
  }
842
777
  }
843
778
  {
844
- maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
779
+ maybePromise = safeCall(instance, "componentWillLoad");
845
780
  }
846
781
  }
847
782
  endSchedule();
@@ -910,7 +845,7 @@ var postUpdateComponent = (hostRef) => {
910
845
  const instance = hostRef.$lazyInstance$ ;
911
846
  const ancestorComponent = hostRef.$ancestorComponent$;
912
847
  {
913
- safeCall(instance, "componentDidRender", void 0, elm);
848
+ safeCall(instance, "componentDidRender");
914
849
  }
915
850
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
916
851
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -939,14 +874,17 @@ var postUpdateComponent = (hostRef) => {
939
874
  }
940
875
  };
941
876
  var appDidLoad = (who) => {
877
+ {
878
+ addHydratedFlag(doc.documentElement);
879
+ }
942
880
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
943
881
  };
944
- var safeCall = (instance, method, arg, elm) => {
882
+ var safeCall = (instance, method, arg) => {
945
883
  if (instance && instance[method]) {
946
884
  try {
947
885
  return instance[method](arg);
948
886
  } catch (e) {
949
- consoleError(e, elm);
887
+ consoleError(e);
950
888
  }
951
889
  }
952
890
  return void 0;
@@ -989,68 +927,15 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
989
927
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
990
928
  members.map(([memberName, [memberFlags]]) => {
991
929
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
992
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
993
- if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
994
- if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
995
- if (flags & 1 /* isElementConstructor */ || !origGetter) {
996
- Object.defineProperty(prototype, memberName, {
997
- get() {
998
- {
999
- if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1000
- return getValue(this, memberName);
1001
- }
1002
- const ref = getHostRef(this);
1003
- const instance = ref ? ref.$lazyInstance$ : prototype;
1004
- if (!instance) return;
1005
- return instance[memberName];
1006
- }
1007
- },
1008
- configurable: true,
1009
- enumerable: true
1010
- });
1011
- }
1012
930
  Object.defineProperty(prototype, memberName, {
931
+ get() {
932
+ return getValue(this, memberName);
933
+ },
1013
934
  set(newValue) {
1014
- const ref = getHostRef(this);
1015
- if (origSetter) {
1016
- const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1017
- if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1018
- newValue = ref.$instanceValues$.get(memberName);
1019
- } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1020
- ref.$instanceValues$.set(memberName, currentValue);
1021
- }
1022
- origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1023
- newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1024
- setValue(this, memberName, newValue, cmpMeta);
1025
- return;
1026
- }
1027
- {
1028
- if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1029
- setValue(this, memberName, newValue, cmpMeta);
1030
- if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1031
- ref.$onReadyPromise$.then(() => {
1032
- if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1033
- ref.$lazyInstance$[memberName] = newValue;
1034
- }
1035
- });
1036
- }
1037
- return;
1038
- }
1039
- const setterSetVal = () => {
1040
- const currentValue = ref.$lazyInstance$[memberName];
1041
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
1042
- ref.$instanceValues$.set(memberName, currentValue);
1043
- }
1044
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1045
- setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1046
- };
1047
- if (ref.$lazyInstance$) {
1048
- setterSetVal();
1049
- } else {
1050
- ref.$onReadyPromise$.then(() => setterSetVal());
1051
- }
1052
- }
1053
- }
935
+ setValue(this, memberName, newValue, cmpMeta);
936
+ },
937
+ configurable: true,
938
+ enumerable: true
1054
939
  });
1055
940
  }
1056
941
  });
@@ -1060,11 +945,10 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1060
945
  plt.jmp(() => {
1061
946
  var _a2;
1062
947
  const propName = attrNameToPropName.get(attrName);
1063
- if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
948
+ if (this.hasOwnProperty(propName)) {
1064
949
  newValue = this[propName];
1065
950
  delete this[propName];
1066
- } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
1067
- this[propName] == newValue) {
951
+ } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && this[propName] == newValue) {
1068
952
  return;
1069
953
  } else if (propName == null) {
1070
954
  const hostRef = getHostRef(this);
@@ -1080,11 +964,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1080
964
  }
1081
965
  return;
1082
966
  }
1083
- const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1084
- newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1085
- if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1086
- this[propName] = newValue;
1087
- }
967
+ this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1088
968
  });
1089
969
  };
1090
970
  Cstr.observedAttributes = Array.from(
@@ -1113,7 +993,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1113
993
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1114
994
  const bundleId = cmpMeta.$lazyBundleId$;
1115
995
  if (bundleId) {
1116
- const CstrImport = loadModule(cmpMeta, hostRef);
996
+ const CstrImport = loadModule(cmpMeta);
1117
997
  if (CstrImport && "then" in CstrImport) {
1118
998
  const endLoad = uniqueTime();
1119
999
  Cstr = await CstrImport;
@@ -1135,7 +1015,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1135
1015
  try {
1136
1016
  new Cstr(hostRef);
1137
1017
  } catch (e) {
1138
- consoleError(e, elm);
1018
+ consoleError(e);
1139
1019
  }
1140
1020
  {
1141
1021
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1167,7 +1047,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1167
1047
  schedule();
1168
1048
  }
1169
1049
  };
1170
- var fireConnectedCallback = (instance, elm) => {
1050
+ var fireConnectedCallback = (instance) => {
1171
1051
  };
1172
1052
 
1173
1053
  // src/runtime/connected-callback.ts
@@ -1208,7 +1088,7 @@ var connectedCallback = (elm) => {
1208
1088
  endConnected();
1209
1089
  }
1210
1090
  };
1211
- var disconnectInstance = (instance, elm) => {
1091
+ var disconnectInstance = (instance) => {
1212
1092
  };
1213
1093
  var disconnectedCallback = async (elm) => {
1214
1094
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1223,12 +1103,6 @@ var disconnectedCallback = async (elm) => {
1223
1103
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1224
1104
  }
1225
1105
  }
1226
- if (rootAppliedStyles.has(elm)) {
1227
- rootAppliedStyles.delete(elm);
1228
- }
1229
- if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1230
- rootAppliedStyles.delete(elm.shadowRoot);
1231
- }
1232
1106
  };
1233
1107
 
1234
1108
  // src/runtime/bootstrap-lazy.ts
@@ -1309,17 +1183,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1309
1183
  }
1310
1184
  disconnectedCallback() {
1311
1185
  plt.jmp(() => disconnectedCallback(this));
1312
- plt.raf(() => {
1313
- var _a3;
1314
- const hostRef = getHostRef(this);
1315
- const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1316
- if (i2 > -1) {
1317
- deferredConnectedCallbacks.splice(i2, 1);
1318
- }
1319
- if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1320
- delete hostRef.$vnode$.$elm$;
1321
- }
1322
- });
1323
1186
  }
1324
1187
  componentOnReady() {
1325
1188
  return getHostRef(this).$onReadyPromise$;
@@ -1383,7 +1246,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1383
1246
  }
1384
1247
  }
1385
1248
  } catch (e) {
1386
- consoleError(e, hostRef.$hostElement$);
1249
+ consoleError(e);
1387
1250
  }
1388
1251
  };
1389
1252
  var getHostListenerTarget = (elm, flags) => {
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-cf7e798a.js';
2
- import './index-8ce51859.js';
1
+ export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-a8c23787.js';
2
+ import './index-48c42d04.js';
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-8ce51859.js';
2
- export { s as setNonce } from './index-8ce51859.js';
1
+ import { b as bootstrapLazy } from './index-48c42d04.js';
2
+ export { s as setNonce } from './index-48c42d04.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -1015,8 +1015,6 @@ export declare namespace JSXBase {
1015
1015
  autoPlay?: boolean;
1016
1016
  autoplay?: boolean | string;
1017
1017
  controls?: boolean;
1018
- controlslist?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
1019
- controlsList?: 'nodownload' | 'nofullscreen' | 'noremoteplayback';
1020
1018
  crossOrigin?: string;
1021
1019
  crossorigin?: string;
1022
1020
  loop?: boolean;
@@ -1566,10 +1564,6 @@ export declare namespace JSXBase {
1566
1564
  onSubmitCapture?: (event: Event) => void;
1567
1565
  onInvalid?: (event: Event) => void;
1568
1566
  onInvalidCapture?: (event: Event) => void;
1569
- onBeforeToggle?: (event: Event) => void;
1570
- onBeforeToggleCapture?: (event: Event) => void;
1571
- onToggle?: (event: Event) => void;
1572
- onToggleCapture?: (event: Event) => void;
1573
1567
  onLoad?: (event: Event) => void;
1574
1568
  onLoadCapture?: (event: Event) => void;
1575
1569
  onError?: (event: Event) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-luckywheel",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- export{C as casino_engagement_suite_luckywheel}from"./p-781c5f2a.js";import"./p-eaad80fd.js";
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e}from"./p-eaad80fd.js";var s,r,n,a,o,h;"function"==typeof SuppressedError&&SuppressedError,function(t){t.Arrow="Arrow",t.Partition="Partition"}(s||(s={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(r||(r={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(n||(n={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(a||(a={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(o||(o={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(h||(h={}));const c=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),d=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},l=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),u=t=>({x:t,y:t}),g=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),b={image:"",name:"Thank you",prizeText:"",prizeImage:""},f=async(t,i)=>{const{partitions:e}=t.program.wheelOfFortune;let s=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s].hasOwnProperty("*")&&(e["image1"===s?"image":s]=t[s][i]||t[s]["*"])})),e}));return(t=>{let i=0;return t.map((t=>{i+=Number(t.probability)})),i})(t)<1&&e.push(b),e})(e,i);return s=c()?s.map((t=>{if(t.image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.image,Object.assign(Object.assign({},t),{image:i})}return t})):await Promise.all(s.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{image:await l(t)}:{})(t.image))))),s},p={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},m={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},y={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},v=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],x=t=>Object.keys(t).map((i=>t[i]));var w;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(w||(w={}));class k{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:n}){this.arrowmode=r.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case r.DownFromTop:case r.UpFromCenter:return-Math.PI/2;case r.DownFromCenter:case r.UpFromBottom:return Math.PI/2}},this.contentdirection=n||"anticlockwise",this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,a.outward)),{width:e,height:e})}getSvgTextProps(t){const i=this.getSizeImageByPartition(t);let e;return e=this.options[t].image?this.radius-i-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,e))}getSvgTextPropsAdjustedByImage(t){const i=this.getSvgTextProps(t),e=this.options[t].image?80:100,s={width:e,height:e};return Object.assign(Object.assign(Object.assign({},i),s),{x:"clockwise"===this.contentdirection?i.x:i.x-s.width,y:i.y-s.height/2})}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return w.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:a[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=u(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:g(r,e.transform),point:g(r,e.position)}}getPropsForPartitionInfo(t,i,e,s){const{point:r,transformOrigin:n}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},r),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg)`,"transform-origin":`${a=n,Object.keys(a).map((t=>`${a[t]}px`)).join(" ")}`}});var a}getPartitionDraw(t){const i=u(this.center),e=u(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=u(s),a=u(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...x(i),"L",...x(s),"A",...x(e),"0 0 1",...x(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(length-(t||this.length-1),length)}getSpinnerProps(){const t=u(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class P{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=h.cubic,this.param=v[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=o.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*m[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,p.in[this.easingType],y.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,p.out[this.easingType],y.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,m[this.easingType]),this.continueRepeat()};({[o.launch]:()=>{this.cb=()=>{this.step=o.loop,this.setDeg(t,m[this.easingType]),this.continueRepeat()},e()},[o.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[o.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,d=Math.abs(r(h/t));this.setDeg(c,d),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=o.launch,this.ticker()}}const j=class{constructor(i){t(this,i),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.radius=.85*Number(this.size)/2,this.speed=0,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].image;d(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.current){if(Number(this.luckywheel.current.remainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",lotteryProgramID:this.luckywheel.program.id}),setTimeout((()=>{window.postMessage({type:"SpinLuckyWheelRes",data:{item:{result:{wheelOfFortunePartitionIndex:1}},success:!1}})}),2500))},this.handleSpinClick=()=>{c()||this.eventSpin()}}handleEvent(t){const i=null==t?void 0:t.data,{type:e}=i,s=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e}(i,["type"]);"SpinLuckyWheelRes"===e&&this.spinner.halt(this.settings.getDeg(s.data.item.result.wheelOfFortunePartitionIndex),(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.program.wheelOfFortune.partitions[s.data.item.result.wheelOfFortunePartitionIndex].prizeText;window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeMessage:t.en||t["*"],HasError:s.data.success}})}))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await f(this.luckywheel,n.en),this.settings=new k({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new P({tick:(t,i)=>{d(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}render(){const t={height:this.size,width:this.size},e={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"8d964d9a81690d2a22240cb1355abb3c7cf6f665",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"92f44f4659874e1fedaffa32813c57d1c9c04440",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",Object.assign({key:"f042214f1516c688035f650a92ff1437c5d06a36"},t,{class:"Bottom Customable"}),i("div",{key:"6c80c40dfdb80159d75af8f70a75604257039c53",style:e})),i("g",Object.assign({key:"46c01589f440c19727c8364d5e1bdb3a90082cac",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"fd0e9a65b7ba25db742ff12bb26e389b8d72e4c7",class:"PartitionsBackgrounds"},this.options.map(((t,s)=>i("foreignObject",{"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:{"--index":s.toString()},width:this.size,height:this.size},i("div",{style:e}))))),i("g",{key:"8c116aa611b92b87b98f23aa344025953a27e90d",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"8907e6529e660e6452328aaa684995719b528ec6",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.name&&i("foreignObject",Object.assign({class:"PartitionText"},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.name})))])))),i("g",{key:"62cf4e41e77374dd8f8c1af0833a4143e5d45403",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition1 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("g",{key:"6b0538da5d4f52e4b543205fb64dedda084f81b2",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition2 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("foreignObject",Object.assign({key:"907db579094a7a192999510ade3150fdadbb94b6",class:"Middle Customable"},t),i("div",{key:"fa66cb96da2f285015fb8afeea5db05313ed832c",style:e})),i("foreignObject",Object.assign({key:"688c0d33ad480ea331847286335a88fd74dbbb26",class:"Top Customable"},t),i("div",{key:"292f6ea3549322a605fc8c3c61a93addcba00890",style:e})),i("g",{key:"22368be98007a7fa820cee96c666c363f85cd32a",class:{spinning:this.isSpinning,Center:!0},onClick:this.handleSpinClick},i("foreignObject",{key:"efffd7edb9ed21d5bd93896a4bead8931d91ff1f",x:Number(this.size)/2-50,y:Number(this.size)/2-50,width:100,height:100})),i("g",{key:"7d8b741cc21d6d07f5736336f147cef2bfdf90ca"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};j.style=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 14px);font-weight:900}';export{j as C}