lido-player 0.0.2-alpha-49 → 0.0.2-alpha-43-dev

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 (159) hide show
  1. package/dist/cjs/{index-fe562525.js → index-6a69c33a.js} +36 -3
  2. package/dist/cjs/index.cjs.js +2 -2
  3. package/dist/cjs/{lido-avatar_19.cjs.entry.js → lido-avatar_21.cjs.entry.js} +431 -180
  4. package/dist/cjs/lido-player.cjs.js +2 -2
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{utils-96ce5641.js → utils-079a5e7d.js} +1032 -165
  7. package/dist/collection/collection-manifest.json +2 -0
  8. package/dist/collection/components/calculator/lido-calculator.css +87 -0
  9. package/dist/collection/components/calculator/lido-calculator.js +321 -0
  10. package/dist/collection/components/cell/lido-cell.js +1 -1
  11. package/dist/collection/components/column/lido-col.js +1 -1
  12. package/dist/collection/components/container/lido-container.js +20 -1
  13. package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
  14. package/dist/collection/components/float/lido-float.js +1 -1
  15. package/dist/collection/components/home/lido-home.js +9 -29
  16. package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
  17. package/dist/collection/components/mathMatrix/lido-math-matrix.css +10 -2
  18. package/dist/collection/components/mathMatrix/lido-math-matrix.js +226 -20
  19. package/dist/collection/components/position/lido-pos.js +1 -1
  20. package/dist/collection/components/random/lido-random.js +1 -1
  21. package/dist/collection/components/row/lido-row.js +1 -1
  22. package/dist/collection/components/scale/lido-balance.css +114 -0
  23. package/dist/collection/components/scale/lido-balance.js +549 -0
  24. package/dist/collection/components/shape/lido-shape.js +1 -1
  25. package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
  26. package/dist/collection/components/text/lido-text.js +1 -1
  27. package/dist/collection/components/trace/lido-trace.js +49 -128
  28. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  29. package/dist/collection/css/animation.css +21 -0
  30. package/dist/collection/css/index.css +45 -0
  31. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +24 -25
  32. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +0 -3
  33. package/dist/collection/stories/Templates/balancing/balancing.stories.js +67 -0
  34. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +156 -0
  35. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +49 -0
  36. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +66 -0
  37. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +65 -0
  38. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +105 -0
  39. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +92 -0
  40. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +47 -0
  41. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +59 -0
  42. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +93 -0
  43. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +100 -0
  44. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +212 -0
  45. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +6 -7
  46. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +6 -7
  47. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +158 -0
  48. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +102 -0
  49. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +94 -0
  50. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +184 -0
  51. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +213 -0
  52. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +109 -0
  53. package/dist/collection/stories/Templates/total/total.stories.js +59 -0
  54. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +96 -0
  55. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +55 -0
  56. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +5 -6
  57. package/dist/collection/utils/utils.js +439 -81
  58. package/dist/collection/utils/utilsHandlers/clickHandler.js +21 -25
  59. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +95 -42
  60. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +67 -0
  61. package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +94 -0
  62. package/dist/collection/utils/utilsHandlers/matrixHandler.js +298 -0
  63. package/dist/collection/utils/utilsHandlers/slideHandler.js +4 -2
  64. package/dist/collection/utils/utilsHandlers/sortHandler.js +21 -12
  65. package/dist/components/index.js +1 -1
  66. package/dist/components/lido-avatar.js +1 -1
  67. package/dist/components/lido-balance.d.ts +11 -0
  68. package/dist/components/lido-balance.js +6 -0
  69. package/dist/components/lido-calculator.d.ts +11 -0
  70. package/dist/components/lido-calculator.js +6 -0
  71. package/dist/components/lido-cell.js +1 -1
  72. package/dist/components/lido-col.js +1 -1
  73. package/dist/components/lido-container.js +1 -1
  74. package/dist/components/lido-flash-card.js +1 -1
  75. package/dist/components/lido-float.js +1 -1
  76. package/dist/components/lido-home.js +1 -1
  77. package/dist/components/lido-image.js +1 -1
  78. package/dist/components/lido-keyboard.js +1 -1
  79. package/dist/components/lido-math-matrix.js +1 -1
  80. package/dist/components/lido-pos.js +1 -1
  81. package/dist/components/lido-random.js +1 -1
  82. package/dist/components/lido-root.js +32 -20
  83. package/dist/components/lido-row.js +1 -1
  84. package/dist/components/lido-shape.js +1 -1
  85. package/dist/components/lido-slide-fill.js +1 -1
  86. package/dist/components/lido-text.js +1 -1
  87. package/dist/components/lido-trace.js +1 -1
  88. package/dist/components/lido-wrap.js +1 -1
  89. package/dist/components/p-08d0deab.js +254 -0
  90. package/dist/components/{p-b5b6ad27.js → p-15971ede.js} +1 -1
  91. package/dist/components/{p-0bf92c7f.js → p-1fbdb431.js} +2 -2
  92. package/dist/components/{p-b43ce4e1.js → p-29bdd953.js} +2 -2
  93. package/dist/components/{p-b8af26e6.js → p-322acda6.js} +40 -48
  94. package/dist/components/{p-51943db6.js → p-3f406017.js} +2 -2
  95. package/dist/components/p-44808985.js +186 -0
  96. package/dist/components/{p-4cabbf28.js → p-52844fa4.js} +2 -2
  97. package/dist/components/{p-4882df37.js → p-73e31a86.js} +2 -2
  98. package/dist/components/{p-af54a485.js → p-74849cdd.js} +4 -4
  99. package/dist/components/{p-9c56f378.js → p-7f7e5672.js} +2 -2
  100. package/dist/components/{p-4dbae73b.js → p-835b973d.js} +2 -2
  101. package/dist/components/{p-b55af747.js → p-90465904.js} +50 -129
  102. package/dist/components/{p-cae021c6.js → p-904711c8.js} +2 -2
  103. package/dist/components/{p-e735dce9.js → p-9be56729.js} +5 -3
  104. package/dist/components/{p-cac6c8bf.js → p-afbc196f.js} +2 -2
  105. package/dist/components/{p-cfa2aec8.js → p-bed94c37.js} +1047 -164
  106. package/dist/components/{p-7f11a624.js → p-cbac3cbc.js} +1 -1
  107. package/dist/components/{p-61d97438.js → p-d37ab4dc.js} +2 -2
  108. package/dist/components/p-e36ddcc1.js +166 -0
  109. package/dist/components/{p-03e4cafe.js → p-e4e42677.js} +2 -2
  110. package/dist/esm/{index-f47852d4.js → index-170e58c7.js} +36 -4
  111. package/dist/esm/index.js +2 -2
  112. package/dist/esm/{lido-avatar_19.entry.js → lido-avatar_21.entry.js} +430 -181
  113. package/dist/esm/lido-player.js +3 -3
  114. package/dist/esm/loader.js +3 -3
  115. package/dist/esm/{utils-9ce243d8.js → utils-5df09162.js} +1031 -164
  116. package/dist/lido-player/index.esm.js +1 -1
  117. package/dist/lido-player/lido-player.css +1 -1
  118. package/dist/lido-player/lido-player.esm.js +1 -1
  119. package/dist/lido-player/p-137c99ce.js +2 -0
  120. package/dist/lido-player/p-7556e652.js +9 -0
  121. package/dist/lido-player/p-eb956325.entry.js +1 -0
  122. package/dist/types/components/calculator/lido-calculator.d.ts +40 -0
  123. package/dist/types/components/container/lido-container.d.ts +4 -0
  124. package/dist/types/components/home/lido-home.d.ts +0 -1
  125. package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +24 -4
  126. package/dist/types/components/scale/lido-balance.d.ts +160 -0
  127. package/dist/types/components/trace/lido-trace.d.ts +0 -1
  128. package/dist/types/components.d.ts +342 -14
  129. package/dist/types/stories/Templates/balancing/balancing.stories.d.ts +4 -0
  130. package/dist/types/stories/Templates/checker-block/checkerBlock.stories.d.ts +4 -0
  131. package/dist/types/stories/Templates/checkerBlock/checkerBlock.stories.d.ts +4 -0
  132. package/dist/types/stories/Templates/fillAnswer/fill-answer.stories.d.ts +4 -0
  133. package/dist/types/stories/Templates/foodJar/food-jar.stories.d.ts +4 -0
  134. package/dist/types/stories/Templates/matchBox/matchBox.stories.d.ts +4 -0
  135. package/dist/types/stories/Templates/matchBox/matchBox2.stories.d.ts +4 -0
  136. package/dist/types/stories/Templates/matchingCard/matching-card.stories.d.ts +4 -0
  137. package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +9 -0
  138. package/dist/types/stories/Templates/nimbleTable/nimbleTable.stories.d.ts +4 -0
  139. package/dist/types/stories/Templates/numberBoardTwo/numberBoardTwo.stories.d.ts +4 -0
  140. package/dist/types/stories/Templates/numberPair/numberPair.stories.d.ts +4 -0
  141. package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +15 -0
  142. package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +11 -0
  143. package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +11 -0
  144. package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +4 -0
  145. package/dist/types/stories/Templates/shapeTractor/shape-tractor.stories.d.ts +12 -0
  146. package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +11 -0
  147. package/dist/types/stories/Templates/total/total.stories.d.ts +4 -0
  148. package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +13 -0
  149. package/dist/types/stories/Templates/writeSet/writeSet.stories.d.ts +4 -0
  150. package/dist/types/utils/utils.d.ts +8 -2
  151. package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +4 -0
  152. package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +2 -0
  153. package/dist/types/utils/utilsHandlers/lidoCalculatorHandler.d.ts +1 -0
  154. package/dist/types/utils/utilsHandlers/matrixHandler.d.ts +1 -0
  155. package/package.json +1 -1
  156. package/dist/components/p-a8ab771b.js +0 -160
  157. package/dist/lido-player/p-90212aa9.js +0 -9
  158. package/dist/lido-player/p-d3911ee1.entry.js +0 -1
  159. package/dist/lido-player/p-ddf627b0.js +0 -2
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, g as getAssetPath, h, H as Host, a as getElement } from './index-f47852d4.js';
2
- import { c as commonjsGlobal, s as setVisibilityWithDelay, i as initEventsForElement, a as convertUrlToRelative, R as RiveService, h as handlingChildElements, b as attachSpeakIcon, p as parseProp, d as calculateScale, e as handleFloatElementPosition, g as handleElementClick, j as clearLocalStorage, k as dispatchActivityChangeEvent, A as ActivityScoreKey, l as dispatchGameCompletedEvent, m as dispatchGameExitEvent, n as AudioPlayer, o as generateUUIDFallback, q as exitUrl, r as prevUrl, t as nextUrl, u as speakUrl, N as NextContainerKey, P as PrevContainerKey, L as LidoContainer$1, v as getCancelBtnPopup, S as SelectedValuesKey, w as matchStringPattern, x as triggerNextContainer, y as triggerPrevcontainer, z as executeActions, B as setCancelBtnPopup, C as getDefaultExportFromCjs, D as tinyColor, E as storingEachActivityScore, F as DropAction, G as fraction, T as TraceMode, H as speakIcon, I as fingerUrl } from './utils-9ce243d8.js';
1
+ import { r as registerInstance, g as getAssetPath, h, H as Host, a as getElement, c as createEvent } from './index-170e58c7.js';
2
+ import { c as commonjsGlobal, s as setVisibilityWithDelay, i as initEventsForElement, a as convertUrlToRelative, R as RiveService, p as parseProp, e as equationCheck, b as storingEachActivityScore, d as executeActions, N as NextContainerKey, h as handlingChildElements, g as attachSpeakIcon, j as calculateScale, k as handleFloatElementPosition, l as handleElementClick, m as dispatchActivityChangeEvent, A as ActivityScoreKey, n as dispatchGameCompletedEvent, o as dispatchGameExitEvent, q as AudioPlayer, r as generateUUIDFallback, t as exitUrl, u as prevUrl, v as nextUrl, w as speakUrl, P as PrevContainerKey, L as LidoContainer$1, x as getCancelBtnPopup, y as triggerPrevcontainer, z as setCancelBtnPopup, B as getDefaultExportFromCjs, C as tinyColor, S as SelectedValuesKey, D as triggerNextContainer, E as DropAction, F as validateObjectiveStatus, G as fraction, T as TraceMode, H as speakIcon, I as fingerUrl } from './utils-5df09162.js';
3
3
 
4
4
  var rive = {exports: {}};
5
5
 
@@ -6592,6 +6592,267 @@ const LidoAvatar = class {
6592
6592
  };
6593
6593
  LidoAvatar.style = LidoAvatarStyle0;
6594
6594
 
6595
+ const lidoBalanceCss = "#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^=\"M78.9414\"]{fill:white}";
6596
+ const LidoBalanceStyle0 = lidoBalanceCss;
6597
+
6598
+ const LidoBalance = class {
6599
+ constructor(hostRef) {
6600
+ registerInstance(this, hostRef);
6601
+ this.currentAngle = 0;
6602
+ this.pivotimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg';
6603
+ this.scaleimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg';
6604
+ this.handlerimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg';
6605
+ this.fill = 'brown';
6606
+ this.tilt = 0;
6607
+ this.maxTilt = 9.5;
6608
+ this.onEntry = '';
6609
+ this.height = 'auto';
6610
+ this.width = 'auto';
6611
+ this.x = '0px';
6612
+ this.y = '0px';
6613
+ this.z = '0';
6614
+ this.visible = false;
6615
+ this.margin = '';
6616
+ this.padding = '';
6617
+ this.balanceSymbol = '=';
6618
+ this.showSymbol = false;
6619
+ this.operation = 'count';
6620
+ this.pivotSvg = '';
6621
+ this.scaleSvg = '';
6622
+ this.handlerSvg = '';
6623
+ this.style = {};
6624
+ this.tiltf = 0;
6625
+ this.leftVal = 0;
6626
+ this.rightVal = 0;
6627
+ }
6628
+ async revealSymbol() {
6629
+ this.showSymbol = true;
6630
+ }
6631
+ async hideSymbol() {
6632
+ this.showSymbol = false;
6633
+ }
6634
+ async componentWillLoad() {
6635
+ this.updateStyles();
6636
+ this.pivotSvg = await this.fetchAndApplyFill(this.pivotimage);
6637
+ this.scaleSvg = await this.fetchAndApplyFill(this.scaleimage);
6638
+ this.handlerSvg = await this.fetchAndApplyFill(this.handlerimage);
6639
+ }
6640
+ componentDidLoad() {
6641
+ setTimeout(() => {
6642
+ this.animateBalance();
6643
+ }, 4000);
6644
+ this.leftParentEl = document.getElementById("leftparent");
6645
+ this.rightParentEl = document.getElementById("rightparent");
6646
+ initEventsForElement(this.el);
6647
+ }
6648
+ disconnectedCallback() {
6649
+ if (this.animationFrameId != null)
6650
+ cancelAnimationFrame(this.animationFrameId);
6651
+ }
6652
+ async fetchAndApplyFill(url) {
6653
+ try {
6654
+ const res = await fetch(url);
6655
+ if (!res.ok)
6656
+ return '';
6657
+ let svg = await res.text();
6658
+ svg = svg.replace(/fill="[^"]*"/g, '');
6659
+ svg = svg.replace(/stroke="[^"]*"/g, '');
6660
+ svg = svg.replace(/<svg([^>]*)>/, `<svg$1 fill="${this.fill}" stroke="${this.fill}">`);
6661
+ return svg;
6662
+ }
6663
+ catch (e) {
6664
+ console.error('SVG fetch failed:', e);
6665
+ return '';
6666
+ }
6667
+ }
6668
+ tiltChanged(newValue) {
6669
+ this.tiltf = newValue;
6670
+ }
6671
+ async updateTilt(leftVal, rightVal) {
6672
+ const diff = rightVal - leftVal;
6673
+ const newTilt = Math.max(-5, Math.min(5, diff));
6674
+ this.tiltf = newTilt;
6675
+ }
6676
+ animateBalance() {
6677
+ const rotate = () => {
6678
+ let targetAngle = (this.tiltf / 5) * this.maxTilt;
6679
+ if (targetAngle > this.maxTilt)
6680
+ targetAngle = this.maxTilt;
6681
+ if (targetAngle < -this.maxTilt)
6682
+ targetAngle = -this.maxTilt;
6683
+ this.currentAngle += (targetAngle - this.currentAngle) * 0.1;
6684
+ if (this.currentAngle > this.maxTilt)
6685
+ this.currentAngle = this.maxTilt;
6686
+ if (this.currentAngle < -this.maxTilt)
6687
+ this.currentAngle = -this.maxTilt;
6688
+ if (this.scaleEl) {
6689
+ this.scaleEl.style.transform = `rotate(${this.currentAngle}deg)`;
6690
+ this.scaleEl.style.transformOrigin = '50% 80%';
6691
+ }
6692
+ if (this.leftParentEl && this.rightParentEl) {
6693
+ const maxOffset = 60;
6694
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
6695
+ this.leftParentEl.style.transform = `translateY(${-offset}px)`;
6696
+ this.rightParentEl.style.transform = `translateY(${offset}px)`;
6697
+ }
6698
+ if (this.leftHandleEl && this.rightHandleEl) {
6699
+ const isPortrait = window.innerHeight > window.innerWidth;
6700
+ const maxOffset = isPortrait ? 40 : 60;
6701
+ const offset = (this.currentAngle / this.maxTilt) * maxOffset;
6702
+ this.leftHandleEl.style.transform = `translateY(${-offset}px)`;
6703
+ this.rightHandleEl.style.transform = `translateY(${offset}px)`;
6704
+ }
6705
+ this.animationFrameId = requestAnimationFrame(rotate);
6706
+ };
6707
+ rotate();
6708
+ }
6709
+ updateStyles() {
6710
+ const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
6711
+ this.style = {
6712
+ height: parseProp(this.height, orientation),
6713
+ width: parseProp(this.width, orientation),
6714
+ top: parseProp(this.y, orientation),
6715
+ left: parseProp(this.x, orientation),
6716
+ zIndex: this.z,
6717
+ display: parseProp(`${this.visible}`, orientation) === "true" ? 'flex' : 'none',
6718
+ margin: parseProp(this.margin, orientation),
6719
+ padding: parseProp(this.padding, orientation),
6720
+ };
6721
+ }
6722
+ render() {
6723
+ return (h(Host, { key: '868cc05ae503a6e04039c615815102470eb402d4', id: "lido-balance", onEntry: this.onEntry, class: "lido-balance", tilt: this.tilt.toString(), style: this.style, operation: this.operation.toString() }, h("div", { key: '2627a49d1ad5045bd9a3ac217354c9be98f1f52b', innerHTML: this.pivotSvg, id: "pivotimg", class: "pivot" }), h("div", { key: 'c5b2432f5e3c62ebbb7f17146f18e22e7e2b29bb', innerHTML: this.scaleSvg, id: "scaleimg", class: "scale", ref: (el) => (this.scaleEl = el) }), h("div", { key: 'd5e8051aedb784189f19a1e7b0dfd645e95ed4a5', innerHTML: this.handlerSvg, id: "handlerimg", class: "handler", ref: (el) => (this.leftHandleEl = el) }), h("div", { key: '3779886d4fc8dfadc0791f69cb87df78d5f843c8', innerHTML: this.handlerSvg, id: "handimg", class: "hand", ref: (el) => (this.rightHandleEl = el) }), h("div", { key: 'df5d4094c302548bf64f166643a3f05d262d95b1', id: "balanceSymbol", class: "lido-balance-symbol", "aria-hidden": !this.showSymbol }, this.showSymbol ? this.balanceSymbol : '')));
6724
+ }
6725
+ get el() { return getElement(this); }
6726
+ static get watchers() { return {
6727
+ "tilt": ["tiltChanged"]
6728
+ }; }
6729
+ };
6730
+ LidoBalance.style = LidoBalanceStyle0;
6731
+
6732
+ const lidoCalculatorCss = "#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:96px !important;height:80px !important;font-size:72px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}";
6733
+ const LidoCalculatorStyle0 = lidoCalculatorCss;
6734
+
6735
+ const LidoCalculator = class {
6736
+ constructor(hostRef) {
6737
+ registerInstance(this, hostRef);
6738
+ this.onOk = createEvent(this, "onOk", 7);
6739
+ this.userAnswers = []; // store all calculator inputs
6740
+ this.width = '479px';
6741
+ this.visible = false;
6742
+ this.height = '711px';
6743
+ this.objective = '';
6744
+ this.onEntry = '';
6745
+ this.x = '0px';
6746
+ this.y = '0px';
6747
+ this.bgColor = '#60DADA';
6748
+ this.penIcon = "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/Pen--Streamline-Solar%201.svg";
6749
+ this.displayValue = '';
6750
+ this.style = {};
6751
+ }
6752
+ updateValueAttr() {
6753
+ this.el.setAttribute('value', this.displayValue);
6754
+ }
6755
+ componentWillLoad() {
6756
+ if (!this.objective) {
6757
+ const container = this.el.closest('lido-container');
6758
+ if (container) {
6759
+ this.objective = (container.getAttribute('objective') || '').replace('=', '').trim();
6760
+ }
6761
+ }
6762
+ this.updateValueAttr();
6763
+ }
6764
+ handleClick(value) {
6765
+ const MAX_LENGTH = 10;
6766
+ if (value === 'OK') {
6767
+ this.verifyAnswer();
6768
+ }
6769
+ else if (value === '←') {
6770
+ this.displayValue = this.displayValue.slice(0, -1);
6771
+ }
6772
+ else {
6773
+ if (this.displayValue.length < MAX_LENGTH) {
6774
+ this.displayValue += value;
6775
+ }
6776
+ }
6777
+ this.updateValueAttr();
6778
+ }
6779
+ async verifyAnswer() {
6780
+ const userInput = this.displayValue.trim();
6781
+ if (!userInput)
6782
+ return;
6783
+ let isCorrect = false;
6784
+ const container = this.el.closest('lido-container');
6785
+ if (!container)
6786
+ return;
6787
+ if (this.objective && this.objective.length === 1) {
6788
+ isCorrect = userInput === this.objective;
6789
+ }
6790
+ // --- Multiple Objectives ---
6791
+ else if (this.objective && this.objective.includes(',')) {
6792
+ const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
6793
+ const objectives = this.objective.split(',').map(obj => obj.trim());
6794
+ const currentIndex = this.userAnswers.length;
6795
+ // Compare current input with corresponding objective
6796
+ if (currentIndex < objectives.length && Number(userInput) === Number(objectives[currentIndex])) {
6797
+ isCorrect = true;
6798
+ }
6799
+ else {
6800
+ isCorrect = false;
6801
+ }
6802
+ // Store behavior based on mode
6803
+ if (isContinueOnCorrect) {
6804
+ // PRACTICE MODE → store only correct answers
6805
+ if (isCorrect) {
6806
+ this.userAnswers.push(Number(userInput));
6807
+ }
6808
+ }
6809
+ else {
6810
+ // TEST MODE → store all user inputs
6811
+ this.userAnswers.push(Number(userInput));
6812
+ }
6813
+ }
6814
+ else if (this.objective === '') {
6815
+ const equationAttr = container.getAttribute('equationCheck') || '';
6816
+ if (!equationAttr)
6817
+ return;
6818
+ try {
6819
+ const calculatedValue = equationCheck(equationAttr);
6820
+ isCorrect = Number(calculatedValue) === Number(userInput.trim());
6821
+ console.log('Equation check:', calculatedValue, userInput, isCorrect);
6822
+ }
6823
+ catch (err) {
6824
+ console.error('Error evaluating equation:', err);
6825
+ isCorrect = false;
6826
+ }
6827
+ }
6828
+ this.onOk.emit(isCorrect);
6829
+ if (isCorrect) {
6830
+ this.displayValue = "";
6831
+ storingEachActivityScore(isCorrect);
6832
+ const onCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onCorrect')) || '';
6833
+ await executeActions(onCorrect, container);
6834
+ if (this.objective.length === 0) {
6835
+ window.dispatchEvent(new CustomEvent(NextContainerKey));
6836
+ }
6837
+ }
6838
+ else {
6839
+ this.displayValue = "";
6840
+ storingEachActivityScore(isCorrect);
6841
+ const onInCorrect = (container === null || container === void 0 ? void 0 : container.getAttribute('onInCorrect')) || '';
6842
+ await executeActions(onInCorrect, container);
6843
+ }
6844
+ }
6845
+ render() {
6846
+ const numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '←', '0', 'OK'];
6847
+ return (h(Host, { key: '61d14ce0ff858db8ff04b502c0d303f18f5552b8', onEntry: this.onEntry, id: "lidoCalculator", style: { width: this.width, height: this.height, backgroundColor: this.bgColor, left: this.x, top: this.y } }, h("lido-cell", { key: '86318d0fb2a707af14fca1b1a615536e7bcdb9a3', visible: "true", height: "94px", width: "60px" }, h("lido-text", { key: 'd552cf17bedcbb321af0c7fb5fc0b44c89be4561', visible: "true", id: "lido-calculator-penIcon", type: "click", height: "80px", x: "176%", width: "96px", onEntry: "this.position='relative';", class: "top-icon" }, h("img", { key: '46f9003a72906617169fb76b19a208e6f6cbb0bc', src: this.penIcon, alt: "pen", style: { width: '100%', height: '100%' } }))), h("div", { key: 'a7ffc6dbdaabfa944e115eeecf08cc53808c0234', class: "lido-calculator-displayParent" }, h("div", { key: '27926d1370cbdd4423404ad1f78b1ade381288d9', class: "lido-calculator-display" }, this.displayValue)), h("div", { key: '58288a987ea3090da498fff03220d4d4b24aa7c5', class: "lido-calculator-buttons" }, numbers.map((num, i) => (h("lido-text", { id: `btn-${i}`, string: num, visible: "true", type: "click", class: {
6848
+ 'lido-calculator-btn-special': num === '←' || num === 'OK',
6849
+ 'lido-calculator-btn-default': num !== '←' && num !== 'OK'
6850
+ }, onClick: () => this.handleClick(num) }))))));
6851
+ }
6852
+ get el() { return getElement(this); }
6853
+ };
6854
+ LidoCalculator.style = LidoCalculatorStyle0;
6855
+
6595
6856
  const lidoCellCss = ".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}.lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}.lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}.lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}.lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}.lido-col::-webkit-scrollbar,.lido-wrap::-webkit-scrollbar,.lido-flex::-webkit-scrollbar{width:var(--scrollbar-width);height:var(--scrollbar-width)}.lido-col::-webkit-scrollbar-thumb,.lido-wrap::-webkit-scrollbar-thumb,.lido-flex::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;border:3px solid transparent;background-clip:content-box}.lido-col::-webkit-scrollbar-track,.lido-wrap::-webkit-scrollbar-track,.lido-flex::-webkit-scrollbar-track{background:#f1f1f1}";
6596
6857
  const LidoCellStyle0 = lidoCellCss;
6597
6858
 
@@ -6720,7 +6981,7 @@ const LidoCell = class {
6720
6981
  this.el.className = `lido-${parseProp(this.layout, orientation)}`;
6721
6982
  }
6722
6983
  render() {
6723
- return (h(Host, { key: '8c2593f5b6493530e0ab725b7f9f543f884d086d', id: this.id, class: "lido-cell", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "flex-direction": this.flexDirection, "disable-speak": this.disableSpeak }, h("slot", { key: '1497f2f179a474a4a2a8944d03c0841d055b1b6d' })));
6984
+ return (h(Host, { key: '00183a8d67c4c64eae2d2bb2e3db5def7ffe3caf', id: this.id, class: "lido-cell", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "flex-direction": this.flexDirection, "disable-speak": this.disableSpeak }, h("slot", { key: '33fbb691c5c8f015bc9c6cf1e86c237758f126c3' })));
6724
6985
  }
6725
6986
  get el() { return getElement(this); }
6726
6987
  };
@@ -6805,7 +7066,7 @@ const LidoCol = class {
6805
7066
  };
6806
7067
  }
6807
7068
  render() {
6808
- return (h(Host, { key: '753487ca4817b020aaf7e34dadff00a61c826dfc', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'a9d9f0f2c30dc02e6468e597b5a02e032d786538' })));
7069
+ return (h(Host, { key: '1cf21bb1e817c9078213312aa7165423eaf54ea7', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'c3bc168ccccacf1425b5d93853bc27ab2962436f' })));
6809
7070
  }
6810
7071
  get el() { return getElement(this); }
6811
7072
  };
@@ -6853,6 +7114,7 @@ const LidoContainer = class {
6853
7114
  this.showPrevButton = 'false';
6854
7115
  this.showNextButton = 'false';
6855
7116
  this.delayVisible = '';
7117
+ this.disableSpeak = false;
6856
7118
  }
6857
7119
  convertToPixels(height, parentElement = document.body) {
6858
7120
  if (!height)
@@ -6935,7 +7197,7 @@ const LidoContainer = class {
6935
7197
  userSelect: 'none', // Prevent any field selection
6936
7198
  };
6937
7199
  console.log('🚀 ~ LidoContainer ~ canplay:', this.canplay);
6938
- return (h(Host, { key: '782cc0c88592899d58f942245db8e0561714d35c', id: "lido-container", "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl }, h("slot", { key: 'e23be1cba95353ad3678c2d1d41b4d23ae76f2d9' })));
7200
+ return (h(Host, { key: '1f61c4443b96466e2802b5550e8d999319b41ce7', id: "lido-container", "tab-index": 0, class: "lido-container", objective: this.objective, baseUrl: this.baseUrl, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, onTouch: this.onTouch, onInCorrect: this.onInCorrect, onCorrect: this.onCorrect, onEntry: this.onEntry, "show-check": `${this.showCheck}`, "is-continue-on-correct": `${this.isContinueOnCorrect}`, "is-allow-only-correct": `${this.isAllowOnlyCorrect}`, canplay: `${this.canplay}`, appendToDropOnCompletion: `${this.appendToDropOnCompletion}`, "show-prev-button": `${this.showPrevButton}`, "show-next-button": `${this.showNextButton}`, "show-drop-border": `${this.showDropBorder}`, "bg-image": this.bgImage, "exit-button-url": this.exitButtonUrl, "prev-button-url": this.prevButtonUrl, "next-button-url": this.nextButtonUrl, "speaker-button-url": this.speakerButtonUrl, "disable-speak": this.disableSpeak }, h("slot", { key: '2df61e731d3a9de3fd9cdb23f47035ee2e35c30a' })));
6939
7201
  }
6940
7202
  get el() { return getElement(this); }
6941
7203
  };
@@ -7016,7 +7278,7 @@ const LidoFlash = class {
7016
7278
  }
7017
7279
  /* ---------- Render ---------- */
7018
7280
  render() {
7019
- return (h(Host, { key: 'e0140af2e33c8cdc9d5c94743bcd83b98d0ce2f4', value: this.value, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, type: this.type, onClick: this.handleFlip, "disable-speak": this.disableSpeak }, h("div", { key: '11b7e0be1957e15ac5644b73b4ffbd00a27a93ff', class: `card ${this.flipped ? 'flipped' : ''}` }, h("div", { key: 'acd9ae1eb8b1d6ac2658dbdcb26d9d7f6549811c', class: "card-face card-front" }, this.front != null ? this.front : h("slot", { name: "front" })), h("div", { key: 'd62cbfdd84fcc6596aefe6d8d55f7e5ffeaaa5f2', class: "card-face card-back" }, this.back != null ? this.back : h("slot", { name: "back" })))));
7281
+ return (h(Host, { key: 'df221d302a1e91eb995af2f70aa69957cb769ffe', value: this.value, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, type: this.type, onClick: this.handleFlip, "disable-speak": this.disableSpeak }, h("div", { key: 'd799a3525d9af4ba98d7750a3a76a313dd9cdd76', class: `card ${this.flipped ? 'flipped' : ''}` }, h("div", { key: 'fb7734ca5648e2cf8a91d551b383a5c2c3eae255', class: "card-face card-front" }, this.front != null ? this.front : h("slot", { name: "front" })), h("div", { key: '6071da403b17a079f80f0c5dd576dac7b5a2c357', class: "card-face card-back" }, this.back != null ? this.back : h("slot", { name: "back" })))));
7020
7282
  }
7021
7283
  get el() { return getElement(this); }
7022
7284
  static get watchers() { return {
@@ -7084,16 +7346,16 @@ const LidoFloat = class {
7084
7346
  };
7085
7347
  }
7086
7348
  render() {
7087
- return (h(Host, { key: '2866d98e4a22a5825c24f23324473016c5e8c33f', class: "lido-float", "float-direction": this.floatDirection, id: this.id, "tab-index": this.tabIndex, style: this.style, onEntry: this.onEntry }, h("slot", { key: 'dd0a4405b91e1ddb95e90d6dfa1e16f8ac106c58' })));
7349
+ return (h(Host, { key: 'b4c271689b52272251d5623e53b67ef78389c012', class: "lido-float", "float-direction": this.floatDirection, id: this.id, "tab-index": this.tabIndex, style: this.style, onEntry: this.onEntry }, h("slot", { key: '852149328b2a8e85e84fdf9e2a4a64bb2ec8ad3a' })));
7088
7350
  }
7089
7351
  get el() { return getElement(this); }
7090
7352
  };
7091
7353
  LidoFloat.style = LidoFloatStyle0;
7092
7354
 
7093
- const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:0 2px 4px rgba(151, 150, 150, 0.1) !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}";
7355
+ const indexCss = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:0 2px 4px rgba(151, 150, 150, 0.1) !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}";
7094
7356
  const LidoHomeStyle0 = indexCss;
7095
7357
 
7096
- const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}";
7358
+ const animationCss = "@keyframes rightToPlace{from{transform:translateX(2000px)}to{transform:translateX(0)}}@keyframes topToPlace{from{transform:translateY(-1000px)}to{transform:translateY(0)}}@keyframes bottomToPlace{from{transform:translateY(1000px)}to{transform:translateY(0)}}@keyframes placeToLeft{from{}to{transform:translateX(-2000px)}}@keyframes leftToPlace{from{transform:translateX(-2000px)}to{transform:translateX(0)}}@keyframes shake{0%{transform:translateX(0)}10%{transform:translateX(-5px)}20%{transform:translateX(5px)}30%{transform:translateX(-5px)}40%{transform:translateX(5px)}50%{transform:translateX(-5px)}60%{transform:translateX(5px)}70%{transform:translateX(-5px)}80%{transform:translateX(5px)}90%{transform:translateX(-5px)}100%{transform:translateX(0)}}@keyframes fallAndBounce{0%{transform:translateY(-1000px)}25%{transform:translateY(0px)}50%{transform:translateY(-200px)}75%{transform:translateY(0)}90%{transform:translateY(-100px)}100%{transform:translateY(0)}}@keyframes placeToDown{0%{transform:translateY(0)}100%{transform:translateY(1000px)}}@keyframes strongShake{0%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}100%{transform:translateX(0)}}@keyframes scaledShake{0%{transform:scale(1) translateX(0);box-shadow:0 0 0 transparent}20%{transform:scale(1.10) translateX(-12px);box-shadow:0 0 10px red}40%{transform:scale(1.10) translateX(12px);box-shadow:0 0 12px red}60%{transform:scale(1.10) translateX(-8px);box-shadow:0 0 10px red}80%{transform:scale(1.10) translateX(8px);box-shadow:0 0 12px red}100%{transform:scale(1) translateX(0);box-shadow:none}}@keyframes horizontalShake{0%{transform:scale(1) translateX(0);background-color:transparent}20%{transform:translateX(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateX(20px);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateX(-10px);background-color:rgba(255, 0, 0, 0.3)}80%{transform:translateX(10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translateX(0);background-color:transparent}}@keyframes verticalShake{0%{transform:translateY(0);background-color:transparent}20%{transform:translateY(-20px);background-color:rgba(255, 0, 0, 0.2)}40%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.4)}60%{transform:translateY(20px);background-color:rgba(255, 0, 0, 0.2)}80%{transform:translateY(0);background-color:rgba(255, 0, 0, 0.1)}100%{transform:translateY(0);background-color:transparent}}@keyframes diagonalShake{0%{transform:translate(0, 0);background-color:transparent}25%{transform:translate(20px, -20px);background-color:rgba(255, 0, 0, 0.2)}50%{transform:translate(-20px, 20px);background-color:rgba(255, 0, 0, 0.3)}75%{transform:translate(10px, -10px);background-color:rgba(255, 0, 0, 0.2)}100%{transform:translate(0, 0);background-color:transparent}}@keyframes glowPulse{0%{filter:drop-shadow(0 0 5px yellow)\n drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 30px orange)}50%{filter:drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 40px yellow)\n drop-shadow(0 0 50px orange)}100%{filter:drop-shadow(0 0 5px yellow)\n drop-shadow(0 0 10px yellow)\n drop-shadow(0 0 20px yellow)\n drop-shadow(0 0 30px orange)}}";
7097
7359
  const LidoHomeStyle1 = animationCss;
7098
7360
 
7099
7361
  const lidoHomeCss = ".lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active .lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";
@@ -7115,7 +7377,7 @@ const LidoHome = class {
7115
7377
  if (index != undefined && index == this.currentContainerIndex)
7116
7378
  return;
7117
7379
  // Clear selected values from localStorage on container transition
7118
- clearLocalStorage();
7380
+ // clearmemoryStorage();
7119
7381
  if (index != undefined && index < this.containers.length) {
7120
7382
  // Move to the next container
7121
7383
  this.currentContainerIndex = index;
@@ -7145,7 +7407,7 @@ const LidoHome = class {
7145
7407
  if (this.currentContainerIndex <= 0)
7146
7408
  return;
7147
7409
  // Clear selected values from localStorage on container transition
7148
- clearLocalStorage();
7410
+ // clearmemoryStorage();
7149
7411
  // Move to the previous container
7150
7412
  this.currentContainerIndex--;
7151
7413
  // Dispatch event to update the UI or state
@@ -7187,7 +7449,7 @@ const LidoHome = class {
7187
7449
  dispatchGameExitEvent();
7188
7450
  AudioPlayer.getI().stop();
7189
7451
  localStorage.removeItem(ActivityScoreKey);
7190
- clearLocalStorage();
7452
+ // clearmemoryStorage();
7191
7453
  alertElement.remove();
7192
7454
  this.currentContainerIndex = 0;
7193
7455
  }
@@ -7226,7 +7488,7 @@ const LidoHome = class {
7226
7488
  };
7227
7489
  if (this.currentContainerIndex === 0) {
7228
7490
  localStorage.removeItem(ActivityScoreKey);
7229
- clearLocalStorage();
7491
+ // clearmemoryStorage();
7230
7492
  }
7231
7493
  // Listen for 'NextContainerKey' event to transition between containers
7232
7494
  window.addEventListener(NextContainerKey, () => {
@@ -7244,7 +7506,7 @@ const LidoHome = class {
7244
7506
  window.addEventListener('beforeunload', () => {
7245
7507
  AudioPlayer.getI().stop();
7246
7508
  localStorage.removeItem(ActivityScoreKey);
7247
- clearLocalStorage();
7509
+ // clearmemoryStorage();
7248
7510
  });
7249
7511
  }
7250
7512
  componentDidLoad() {
@@ -7387,6 +7649,8 @@ const LidoHome = class {
7387
7649
  'lido-float': h("lido-float", Object.assign({}, props), children),
7388
7650
  'lido-keyboard': h("lido-keyboard", Object.assign({}, props), children),
7389
7651
  'lido-math-matrix': h("lido-math-matrix", Object.assign({}, props), children),
7652
+ 'lido-balance': h("lido-balance", Object.assign({}, props), children),
7653
+ 'lido-calculator': h("lido-calculator", Object.assign({}, props), children),
7390
7654
  };
7391
7655
  // If the tag is known, return the corresponding Stencil component, otherwise log a warning
7392
7656
  if (componentMapping[tagName]) {
@@ -7410,16 +7674,6 @@ const LidoHome = class {
7410
7674
  });
7411
7675
  this.containers = containers;
7412
7676
  }
7413
- areAllDropsFilled() {
7414
- const drops = Array.from(document.querySelectorAll('[type="drop"]'));
7415
- const drags = Array.from(document.querySelectorAll('[type="drag"]')).filter(drag => drag.getAttribute('drop-to'));
7416
- console.log('drops', drops);
7417
- console.log('drags', drags);
7418
- return drops.every(drop => {
7419
- const dropId = drop.id;
7420
- return drags.some(drag => drag.getAttribute('drop-to') === dropId);
7421
- });
7422
- }
7423
7677
  async btnpopup() {
7424
7678
  setCancelBtnPopup(false);
7425
7679
  await AudioPlayer.getI().stop();
@@ -7439,18 +7693,6 @@ const LidoHome = class {
7439
7693
  await new Promise(resolve => setTimeout(resolve, 300));
7440
7694
  }
7441
7695
  }
7442
- if (this.areAllDropsFilled()) {
7443
- const objectiveString = container['objective'];
7444
- const objectiveArray = JSON.parse(localStorage.getItem(SelectedValuesKey) || '[]');
7445
- const res = matchStringPattern(objectiveString, objectiveArray);
7446
- console.log('Resultt', res);
7447
- if (res) {
7448
- triggerNextContainer();
7449
- }
7450
- }
7451
- else {
7452
- console.log('Not yet filled ');
7453
- }
7454
7696
  }
7455
7697
  scaleNavbarContainer() {
7456
7698
  setTimeout(() => {
@@ -10450,10 +10692,10 @@ const LidoKeyboard = class {
10450
10692
  const keysArray = this.keys.split(',').map(k => k.trim());
10451
10693
  const container = document.getElementById(LidoContainer$1);
10452
10694
  const showCheck = container.getAttribute('show-check') === 'true';
10453
- return (h(Host, { key: 'b01d3c5bab495def25c14239a3c94e9f6af15b4f', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '1e475df899a9e8cead3d4ee313d6e0b09a1e766f', class: "input-area" }, h("input", { key: '1d27787a42dc81ba97d5045718d726683bf8f32a', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), h("lido-text", { key: '5695c9662b22bd7c3d7c7dfc49481641e795b290', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
10695
+ return (h(Host, { key: 'e4cd1fc51d8d3c87ed011120f13454bbef1883b3', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '114224c18345951e749db6f1eba242cc1179431f', class: "input-area" }, h("input", { key: '14741df7dc29f51420c1164ddebf60fd464fade4', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), h("lido-text", { key: '3bb801fbcab03b58a628c4c365f46113e9829fdc', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
10454
10696
  this.inputString = this.inputString.slice(0, -1);
10455
10697
  this.inputValidation(event);
10456
- } }), h("lido-text", { key: 'd1a786e8f4015c7aeaeffe7a677f1f7e106b3691', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: 'bdd01380b832949bf2abbe4481ac000c1f3a358f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: 'd54959bfe639803c7e048d5112514a7dccbf9dc4', class: "keyboard-wrapper", style: {
10698
+ } }), h("lido-text", { key: '46212bcfe4e5c22744d13d8235d82bdb73bce802', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: 'a886ac1d7ceadda37eadd4bed59bd5096d46619f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: '5238d1dc1bafda2ffab63932d1f5d29ef449bf4b', class: "keyboard-wrapper", style: {
10457
10699
  display: 'flex',
10458
10700
  flexWrap: 'wrap',
10459
10701
  justifyContent: 'center',
@@ -10477,14 +10719,14 @@ const LidoKeyboard = class {
10477
10719
  };
10478
10720
  LidoKeyboard.style = LidoKeyboardStyle0;
10479
10721
 
10480
- const lidoMathMatrixCss = ".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:cover;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--inactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px}";
10722
+ const lidoMathMatrixCss = ".math-matrix{width:100%;height:100%;display:flex;justify-content:center}.slot{width:100%;height:100%;text-align:center;align-content:center;font-size:42px;font-weight:800;font-family:'Baloo Bhai 2';box-sizing:content-box}.slot:hover{opacity:0.7}.slot-parent{width:100%;height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column}.slot-active{background-color:var(--active-bg-color);background-image:var(--bg-image);background-size:contain;background-position:center;background-repeat:no-repeat}.slot-inactive{background-color:var(--deactive-bg-color);background-size:cover;background-position:center;background-repeat:no-repeat}.topIndex,.leftIndex,.bottomIndex{height:100%;width:100%;text-align:center;align-content:center;font-size:30px;font-weight:600;font-family:'Baloo Bhai 2'}";
10481
10723
  const LidoMathMatrixStyle0 = lidoMathMatrixCss;
10482
10724
 
10483
10725
  const LidoMathMatrix = class {
10484
10726
  constructor(hostRef) {
10485
10727
  registerInstance(this, hostRef);
10486
- this.rows = 7;
10487
- this.cols = 5;
10728
+ this.rows = "7";
10729
+ this.cols = "5";
10488
10730
  this.defualtFill = 0;
10489
10731
  this.leftIndex = false;
10490
10732
  this.topIndex = false;
@@ -10492,8 +10734,8 @@ const LidoMathMatrix = class {
10492
10734
  this.clickable = true;
10493
10735
  this.activeOnlyVisible = false;
10494
10736
  this.matrixImage = undefined;
10495
- this.activeBgColor = 'red';
10496
- this.inactiveBgColor = 'transparent';
10737
+ this.activeBgColor = 'transparent';
10738
+ this.deactiveBgColor = 'transparent';
10497
10739
  this.border = '2px solid green';
10498
10740
  this.height = '100%';
10499
10741
  this.width = '100%';
@@ -10502,16 +10744,30 @@ const LidoMathMatrix = class {
10502
10744
  this.margin = undefined;
10503
10745
  this.padding = undefined;
10504
10746
  this.visible = 'false';
10747
+ this.text = undefined;
10748
+ this.type = undefined;
10749
+ this.value = undefined;
10750
+ this.tabIndex = undefined;
10751
+ this.x = undefined;
10752
+ this.y = undefined;
10753
+ this.fontColor = undefined;
10754
+ this.previousFilledSlot = -1;
10755
+ this.previousFilledSlotElement = null;
10505
10756
  this.style = {};
10506
10757
  }
10758
+ updateValue(index) {
10759
+ this.el.setAttribute('value', index);
10760
+ }
10507
10761
  componentDidLoad() {
10508
10762
  const slotElements = this.el.querySelectorAll('.slot');
10763
+ initEventsForElement(this.el, this.type);
10509
10764
  slotElements.forEach((el, i) => {
10510
10765
  const slot = el;
10511
10766
  slot.style.setProperty('--active-bg-color', this.activeBgColor);
10512
- slot.style.setProperty('--inactive-bg-color', this.inactiveBgColor);
10767
+ slot.style.setProperty('--deactive-bg-color', this.deactiveBgColor);
10513
10768
  this.clickable ? (slot.style.pointerEvents = '') : (slot.style.pointerEvents = 'none');
10514
10769
  slot.style.border = this.border;
10770
+ slot.style.color = this.fontColor;
10515
10771
  if (slot.className.includes('slot-active')) {
10516
10772
  slot.style.visibility = 'visible';
10517
10773
  if (this.matrixImage) {
@@ -10552,6 +10808,10 @@ const LidoMathMatrix = class {
10552
10808
  const item = el;
10553
10809
  item.style.width = `${slotMaxValues}px`;
10554
10810
  item.style.height = `${slotMaxValues}px`;
10811
+ if (this.type === 'drop' || this.type === 'drag' || this.type === 'checkerBlock') {
10812
+ this.el.style.width = 'auto';
10813
+ this.el.style.height = 'auto';
10814
+ }
10555
10815
  if ((!this.topIndex && item.classList.contains('topIndex')) ||
10556
10816
  (!this.leftIndex && item.classList.contains('leftIndex')) ||
10557
10817
  (!this.bottomIndex && item.classList.contains('bottomIndex'))) {
@@ -10570,11 +10830,16 @@ const LidoMathMatrix = class {
10570
10830
  zIndex: this.z,
10571
10831
  display: parseProp(`${this.visible}`, orientation) === 'true' ? 'flex' : 'none',
10572
10832
  borderRadius: parseProp(this.borderRadius, orientation),
10833
+ left: parseProp(this.x, orientation),
10834
+ top: parseProp(this.y, orientation),
10835
+ cols: parseProp(`${this.cols}`, orientation),
10836
+ rows: parseProp(`${this.rows}`, orientation),
10573
10837
  };
10838
+ // console.log("cols and rows : ", );
10574
10839
  }
10575
10840
  handleClickSlot(element) {
10576
10841
  const index = parseInt(element.className.split(' ')[1].split('-')[1]);
10577
- const slotElements = document.querySelectorAll('.slot');
10842
+ const slotElements = this.el.querySelectorAll('.slot');
10578
10843
  slotElements.forEach((el, i) => {
10579
10844
  const slotEl = el;
10580
10845
  if (i < index) {
@@ -10589,10 +10854,72 @@ const LidoMathMatrix = class {
10589
10854
  slotEl.classList.add('slot-inactive');
10590
10855
  }
10591
10856
  });
10857
+ if (this.previousFilledSlot !== -1) {
10858
+ // Clear the text from the previously filled slot
10859
+ if (this.previousFilledSlotElement !== null) {
10860
+ this.previousFilledSlotElement.textContent = '';
10861
+ }
10862
+ }
10863
+ // Display the slot value/text on the clicked slot itself
10864
+ element.textContent = index.toString();
10865
+ // Track this slot as the previously filled slot for next click
10866
+ this.previousFilledSlot = index;
10867
+ this.previousFilledSlotElement = element;
10868
+ // If the slot is the bottom-most slot for this matrix, dispatch a generic event
10869
+ // so templates or global handlers can handle bottom-slot behaviour (e.g., MultiplyBeadsAnimation).
10870
+ if (index === slotElements.length) {
10871
+ try {
10872
+ const event = new CustomEvent('math-matrix-bottom-click', {
10873
+ detail: {
10874
+ matrix: this.el,
10875
+ cols: this.style.cols,
10876
+ rows: this.style.rows,
10877
+ },
10878
+ bubbles: true,
10879
+ composed: true,
10880
+ });
10881
+ // dispatch from the host so listeners on container or document receive it
10882
+ this.el.dispatchEvent(event);
10883
+ }
10884
+ catch (err) {
10885
+ console.warn('Error dispatching math-matrix-bottom-click from handleClickSlot', err);
10886
+ }
10887
+ }
10888
+ this.updateValue(index.toString());
10889
+ // trigger the next container if right slot was clicked
10890
+ validateObjectiveStatus();
10891
+ }
10892
+ getSlotData() {
10893
+ const data = {};
10894
+ if (!this.text)
10895
+ return data;
10896
+ this.text.split(',').forEach((item, index) => {
10897
+ const [rawText, rawColor] = item.split('-');
10898
+ const num = parseInt(rawText.trim());
10899
+ if (!isNaN(num)) {
10900
+ data[index] = { text: rawText.trim(), color: rawColor === null || rawColor === void 0 ? void 0 : rawColor.trim() };
10901
+ }
10902
+ });
10903
+ return data;
10592
10904
  }
10593
10905
  render() {
10594
10906
  let slotNumber = 1;
10595
- return (h(Host, { key: 'bfde8ad01e4b47a0b13dc0fd325d78e5014cfef9', class: "math-matrix", style: { height: this.style.height, width: this.style.width, z: this.style.z, display: this.style.display } }, Array.from({ length: this.rows + 1 }, (_, rowIndex) => (h("div", { class: "slot-parent", key: `row-${rowIndex}` }, h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "topIndex" }, rowIndex), Array.from({ length: this.cols }, (_, colIndex) => rowIndex === 0 ? (h("div", { class: "leftIndex" }, ++colIndex)) : (h("div", { class: `slot slot-${slotNumber++} ${this.defualtFill + 1 >= slotNumber ? 'slot-active' : 'slot-inactive'}`, onClick: () => this.handleClickSlot(event.target), key: `slot-${rowIndex}-${colIndex}`, style: { borderRadius: this.style.borderRadius } }))), h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "bottomIndex" }, this.cols * rowIndex))))));
10907
+ const slotData = this.getSlotData();
10908
+ return (h(Host, { key: '66d627c33553f3f6473c6d1b465c9af7cc6741d3', class: "math-matrix", style: {
10909
+ height: this.style.height,
10910
+ width: this.style.width,
10911
+ z: this.style.z,
10912
+ display: this.style.display,
10913
+ top: this.style.top,
10914
+ left: this.style.left,
10915
+ }, type: this.type, value: this.value, "tab-index": this.tabIndex, rows: this.style.rows, cols: this.style.cols, text: this.text }, Array.from({ length: parseInt(this.style.rows) + 1 }, (_, rowIndex) => (h("div", { class: "slot-parent", key: `row-${rowIndex}` }, h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "topIndex" }, rowIndex), Array.from({ length: parseInt(this.style.cols) }, (_, colIndex) => {
10916
+ var _a, _b;
10917
+ return rowIndex === 0 ? (h("div", { class: "leftIndex" }, ++colIndex)) : (h("div", { class: `slot slot-${slotNumber} ${this.defualtFill >= slotNumber ? 'slot-active' : 'slot-inactive'}`, onClick: (ev) => this.handleClickSlot(ev.currentTarget), key: `slot-${rowIndex}-${colIndex}`, style: {
10918
+ borderRadius: this.style.borderRadius,
10919
+ backgroundColor: ((_a = slotData[slotNumber - 1]) === null || _a === void 0 ? void 0 : _a.color) || '',
10920
+ } }, (_b = slotData[slotNumber - 1]) === null || _b === void 0 ? void 0 :
10921
+ _b.text, slotNumber++ && null));
10922
+ }), h("div", { style: rowIndex === 0 && { visibility: 'hidden' }, class: "bottomIndex" }, parseInt(this.style.cols) * rowIndex))))));
10596
10923
  }
10597
10924
  get el() { return getElement(this); }
10598
10925
  };
@@ -10661,7 +10988,7 @@ const LidoPos = class {
10661
10988
  };
10662
10989
  }
10663
10990
  render() {
10664
- return (h(Host, { key: '3c032fcd1655362851d75d7ed55b26a9d12b7e6f', id: this.id, class: "lido-pos", type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, value: this.value, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: '99bb4083a93a247133cc6df2d439c437e3d5cb1b' })));
10991
+ return (h(Host, { key: '20b34af6af7a1f061789d00ade88dc79eec595ef', id: this.id, class: "lido-pos", type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, value: this.value, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'dae7759306330a01ecfb66be08debe8ec1f97d6e' })));
10665
10992
  }
10666
10993
  get el() { return getElement(this); }
10667
10994
  };
@@ -10742,7 +11069,7 @@ const LidoRandom = class {
10742
11069
  backgroundColor: this.bgColor,
10743
11070
  margin: this.margin,
10744
11071
  };
10745
- return (h(Host, { key: 'a5f930317fec6552ac0c9daf09da0348a49dcbf0', class: "lido-random", type: this.type, "tab-index": this.tabIndex, value: this.value, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, minDrops: this.minDrops, maxDrops: this.maxDrops, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: '1451bbc2df4f459d4af93bf6b0a6dfc52dc2113e' })));
11072
+ return (h(Host, { key: '328c7a0533a52a1be5cee0d71fc7a43338e5290f', class: "lido-random", type: this.type, "tab-index": this.tabIndex, value: this.value, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, minDrops: this.minDrops, maxDrops: this.maxDrops, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'c1a93405cbbd2a06a92134c4ff5853204215c317' })));
10746
11073
  }
10747
11074
  get el() { return getElement(this); }
10748
11075
  };
@@ -10886,7 +11213,7 @@ const LidoRow = class {
10886
11213
  };
10887
11214
  }
10888
11215
  render() {
10889
- return (h(Host, { key: '03f15dcfc2abc394d0313d4b40dd6465a19dc34a', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: 'fbb5e6ce6b8436d718c043561e0d92908baaabdc' })));
11216
+ return (h(Host, { key: '4c1f45afe8866df81a6a798afe348e03fa1f4292', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: '194de56621025a4b1a4fdb6ccae347f34dc19fdb' })));
10890
11217
  }
10891
11218
  get el() { return getElement(this); }
10892
11219
  };
@@ -10943,7 +11270,7 @@ const LidoShape = class {
10943
11270
  backgroundColor: this.shapeType !== 'polygon' ? this.bgColor : 'transparent', // Apply background only if not a polygon
10944
11271
  margin: this.margin,
10945
11272
  };
10946
- return (h(Host, { key: '887f02445ef694f84ebc85e05e4dfb740d0bc78b', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
11273
+ return (h(Host, { key: '6712d974e85c5d82dabb5ed0d482ece4b18af16a', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
10947
11274
  }
10948
11275
  get el() { return getElement(this); }
10949
11276
  };
@@ -11142,7 +11469,7 @@ const LidoSlideFill = class {
11142
11469
  }
11143
11470
  }
11144
11471
  render() {
11145
- return (h(Host, { key: 'a7be214e99b8917ebe3d4ae0275036e77967d3b7', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, h("div", { key: 'e3210823de751a3fdff90b54bf93fc13890ca28a', innerHTML: this.svgContent, class: "svg-element" })));
11472
+ return (h(Host, { key: '57ee54a6a0e7d3bbac893ce535a3375ea529e75a', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, h("div", { key: '386330e0562851f2f00aba169018c23bf5ffa4b7', innerHTML: this.svgContent, class: "svg-element" })));
11146
11473
  }
11147
11474
  get el() { return getElement(this); }
11148
11475
  static get watchers() { return {
@@ -11277,7 +11604,7 @@ const LidoText = class {
11277
11604
  }
11278
11605
  }
11279
11606
  render() {
11280
- return (h(Host, { key: '44444c496287fcacce28fa0073d1b87a80d07874', class: "lido-text", value: this.value, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, "span-type": this.spanType, "disable-speak": this.disableSpeak }, this.spanType !== '' ? h("div", { class: "lido-text-content" }, this.string) : this.string));
11607
+ return (h(Host, { key: '6b5b31a544cc63cfd4030aa1b56e41cc255b12cf', class: "lido-text", value: this.value, type: this.type, "tab-index": this.tabIndex, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, minDrops: this.minDrops, maxDrops: this.maxDrops, id: this.id, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, "span-type": this.spanType, "disable-speak": this.disableSpeak }, this.spanType !== '' ? h("div", { class: "lido-text-content" }, this.string) : this.string));
11281
11608
  }
11282
11609
  get el() { return getElement(this); }
11283
11610
  };
@@ -11318,7 +11645,6 @@ const LidoTrace = class {
11318
11645
  this.fileIndex = -1;
11319
11646
  this.isDragging = false;
11320
11647
  this.activePointerId = null;
11321
- this.freeTraceUpdateCounter = 0;
11322
11648
  this.idleTimer = null;
11323
11649
  this.fingerImg = null;
11324
11650
  }
@@ -11335,8 +11661,8 @@ const LidoTrace = class {
11335
11661
  circle: null,
11336
11662
  paths: [],
11337
11663
  svg: null,
11338
- proximityThreshold: 375, // Increased general proximity threshold (was 100)
11339
- freeTraceProximityThreshold: 350, // Increased proximity for free trace (was 50)
11664
+ proximityThreshold: 100, // General proximity threshold
11665
+ freeTraceProximityThreshold: 50, // Reduced proximity threshold for free trace
11340
11666
  rafId: null,
11341
11667
  pointerMoveEvent: null,
11342
11668
  activePointerId: null,
@@ -11672,7 +11998,7 @@ const LidoTrace = class {
11672
11998
  }
11673
11999
  // Modified handlePointerMove function
11674
12000
  handlePointerMove(state) {
11675
- var _a, _b, _c, _d, _e, _f;
12001
+ var _a, _b, _c, _d;
11676
12002
  if (!state.isDragging)
11677
12003
  return;
11678
12004
  if (!state.circle || !state.paths || state.paths.length === 0)
@@ -11684,15 +12010,6 @@ const LidoTrace = class {
11684
12010
  x: parseFloat(state.circle.getAttribute('cx')),
11685
12011
  y: parseFloat(state.circle.getAttribute('cy')),
11686
12012
  };
11687
- // Only update if pointer moved a minimum distance (to reduce unnecessary updates)
11688
- const MOVE_THRESHOLD = 1; // px
11689
- if (state.lastPointerPos) {
11690
- const dx = pointerPos.x - state.lastPointerPos.x;
11691
- const dy = pointerPos.y - state.lastPointerPos.y;
11692
- if (dx * dx + dy * dy < MOVE_THRESHOLD * MOVE_THRESHOLD) {
11693
- return;
11694
- }
11695
- }
11696
12013
  const currentPath = state.paths[state.currentPathIndex];
11697
12014
  if (!currentPath) {
11698
12015
  console.error('No valid path found at the current index');
@@ -11720,76 +12037,48 @@ const LidoTrace = class {
11720
12037
  }
11721
12038
  // For free trace mode and blind free trace mode, allow free drawing only if within the reduced proximity threshold
11722
12039
  if (state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace) {
11723
- // Throttle: Only update every 2nd event (for reducing excessive dom updates)
11724
- this.freeTraceUpdateCounter = (this.freeTraceUpdateCounter || 0) + 1;
11725
- if (this.freeTraceUpdateCounter % 2 !== 0) {
11726
- return;
11727
- }
11728
12040
  // Initialize the currentFreePath array if it's not created
11729
12041
  if (!state.currentFreePath) {
11730
12042
  state.currentFreePath = [];
11731
12043
  }
11732
- // Create a new polyline element if it's the first trace for the current path index
12044
+ // Create a new path element if it's the first trace for the current path index
11733
12045
  if (!state.currentFreePath[state.currentPathIndex]) {
11734
- const newPolyline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
12046
+ const newPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
12047
+ // newPath.setAttribute('stroke', 'green');
11735
12048
  const strokeWidth = state.paths[state.currentPathIndex].style['stroke-width'] || state.paths[state.currentPathIndex].getAttribute('stroke-width');
11736
- newPolyline.setAttribute('stroke-width', strokeWidth);
11737
- newPolyline.setAttribute('fill', 'none');
11738
- newPolyline.setAttribute('stroke-linecap', 'round');
11739
- newPolyline.setAttribute('stroke', 'lightgreen');
11740
- newPolyline.setAttribute('points', `${pointerPos.x},${pointerPos.y}`);
11741
- (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPolyline);
11742
- state.currentFreePath[state.currentPathIndex] = newPolyline;
11743
- // Store points array for this polyline
11744
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
11745
- state.currentFreePolylinePoints[state.currentPathIndex] = [
11746
- { x: pointerPos.x, y: pointerPos.y }
11747
- ];
12049
+ newPath.setAttribute('stroke-width', strokeWidth);
12050
+ newPath.setAttribute('fill', 'none');
12051
+ newPath.setAttribute('stroke-linecap', 'round');
12052
+ newPath.setAttribute('stroke', 'lightgreen');
12053
+ // Start the new path at the current pointer position
12054
+ newPath.setAttribute('d', `M${pointerPos.x},${pointerPos.y}`);
12055
+ (_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPath);
12056
+ state.currentFreePath[state.currentPathIndex] = newPath;
11748
12057
  // Reset lastPointerPos for the new path
11749
12058
  state.lastPointerPos = pointerPos;
11750
- // Add a points counter to limit path growth
11751
- state.freeTracePointsCount = 1;
11752
- }
11753
- // Limit the number of points in the free trace path for performance
11754
- const MAX_FREE_TRACE_POINTS = 10;
11755
- state.freeTracePointsCount = (state.freeTracePointsCount || 1) + 1;
11756
- if (state.freeTracePointsCount > MAX_FREE_TRACE_POINTS) {
11757
- // If limit reached, skip adding more points
11758
- return;
11759
12059
  }
11760
- // Add the new point to the polyline's points array
11761
- state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
11762
- let pointsArr = state.currentFreePolylinePoints[state.currentPathIndex] || [];
11763
- pointsArr.push({ x: pointerPos.x, y: pointerPos.y });
11764
- state.currentFreePolylinePoints[state.currentPathIndex] = pointsArr;
11765
- // Update the polyline's points attribute
11766
- const pointsStr = pointsArr.map(pt => `${pt.x},${pt.y}`).join(' ');
11767
- state.currentFreePath[state.currentPathIndex].setAttribute('points', pointsStr);
12060
+ // Get the previous position to draw a smooth curve
12061
+ const previousPos = state.lastPointerPos || pointerPos;
12062
+ // Create a quadratic curve from the previous point to the current point
12063
+ const newPathData = state.currentFreePath[state.currentPathIndex].getAttribute('d');
12064
+ const midPointX = (previousPos.x + pointerPos.x) / 2;
12065
+ const midPointY = (previousPos.y + pointerPos.y) / 2;
12066
+ const updatedPathData = `${newPathData} Q ${previousPos.x},${previousPos.y} ${midPointX},${midPointY}`;
12067
+ // Update the path's 'd' attribute with the new curve
12068
+ state.currentFreePath[state.currentPathIndex].setAttribute('d', updatedPathData);
11768
12069
  // Move the draggable circle with the freehand trace
11769
12070
  state.circle.setAttribute('cx', pointerPos.x.toString());
11770
12071
  state.circle.setAttribute('cy', pointerPos.y.toString());
11771
- // Only re-append if not already children list
11772
- const childNodes = (_b = state.svg) === null || _b === void 0 ? void 0 : _b.childNodes;
11773
- let circleFound = false;
11774
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
11775
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
11776
- if (child && child.tagName === 'circle') {
11777
- circleFound = true;
11778
- break; // No need to continue once found
11779
- }
11780
- }
11781
- // If not found, append the circle
11782
- if (!circleFound && state.circle) {
11783
- (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle);
11784
- }
12072
+ // Make sure the red dot (circle) is always on top
12073
+ (_b = state.svg) === null || _b === void 0 ? void 0 : _b.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
11785
12074
  // Update the last pointer position
11786
12075
  state.lastPointerPos = pointerPos;
11787
- // For polyline, estimate the end by number of points (not path length)
11788
- if (pointsArr.length >= MAX_FREE_TRACE_POINTS) {
12076
+ const currentPathLength = currentPath.getTotalLength();
12077
+ const distanceToEnd = currentPathLength - closestPoint.length;
12078
+ // If close to the end of the path, move to the next path
12079
+ if (distanceToEnd < 5) {
11789
12080
  this.moveToNextPath(state);
11790
12081
  state.currentFreePath[state.currentPathIndex] = null; // Reset free path for next path
11791
- state.currentFreePolylinePoints[state.currentPathIndex] = [];
11792
- state.freeTracePointsCount = 0;
11793
12082
  }
11794
12083
  // this.resetIdleTimer(state); // ← keep timer alive
11795
12084
  return; // Exit early since we're in free trace or blind free trace mode
@@ -11797,62 +12086,24 @@ const LidoTrace = class {
11797
12086
  // In normal modes, allow movement and drawing only within the general proximity threshold
11798
12087
  if (state.isDragging && closestPoint.length >= state.lastLength) {
11799
12088
  state.lastLength = closestPoint.length;
11800
- // Only update the circle if it moved enough
11801
- if (Math.abs(closestPoint.x - circlePos.x) > MOVE_THRESHOLD || Math.abs(closestPoint.y - circlePos.y) > MOVE_THRESHOLD) {
11802
- state.circle.setAttribute('cx', closestPoint.x.toString());
11803
- state.circle.setAttribute('cy', closestPoint.y.toString());
11804
- }
11805
- // Only re-append if not already children list
11806
- const childNodes = (_d = state.svg) === null || _d === void 0 ? void 0 : _d.childNodes;
11807
- let circleFound = false;
11808
- for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
11809
- const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
11810
- if (child && child.tagName === 'circle') {
11811
- circleFound = true;
11812
- break; // No need to continue once found
11813
- }
11814
- }
11815
- // If not found, append the circle
11816
- if (!circleFound && state.circle) {
11817
- (_e = state.svg) === null || _e === void 0 ? void 0 : _e.appendChild(state.circle);
11818
- }
11819
- (_f = currentPath.greenPath) === null || _f === void 0 ? void 0 : _f.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
11820
- // Completion logic for closed paths: only allow completion if almost all points are traced
11821
- const COMPLETION_THRESHOLD = 0.90; // 90% of the path must be traced
11822
- let percentComplete = state.lastLength / state.totalPathLength;
11823
- let startPoint = currentPath.getPointAtLength(0);
11824
- let endPoint = currentPath.getPointAtLength(currentPath.getTotalLength());
11825
- let pathIsClosed = this.getDistanceSquared(startPoint, endPoint) < 200; // threshold for overlap
11826
- console.log('lastLength, totalPathLength', state.lastLength, state.totalPathLength);
11827
- console.log('percentComplete', percentComplete);
11828
- console.log('startPoint, endPoint', startPoint, endPoint);
11829
- console.log('distance squared between start & end:', this.getDistanceSquared(startPoint, endPoint));
11830
- console.log('pathIsClosed:', pathIsClosed);
11831
- if (pathIsClosed && state.totalPathLength > 50) {
11832
- if (percentComplete >= COMPLETION_THRESHOLD) {
11833
- if (state.currentPathIndex < state.paths.length - 1) {
11834
- this.moveToNextPath(state);
11835
- }
11836
- else if (state.currentPathIndex === state.paths.length - 1) {
11837
- this.moveToNextContainer();
11838
- }
11839
- }
11840
- }
11841
- else {
11842
- // For open paths, allow completion if near the end
11843
- if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
11844
- this.moveToNextPath(state);
11845
- }
11846
- else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
11847
- this.moveToNextContainer();
11848
- }
11849
- }
12089
+ state.circle.setAttribute('cx', closestPoint.x.toString());
12090
+ state.circle.setAttribute('cy', closestPoint.y.toString());
12091
+ // Make sure the red dot (circle) is always on top
12092
+ (_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
12093
+ (_d = currentPath.greenPath) === null || _d === void 0 ? void 0 : _d.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
12094
+ }
12095
+ // Check if the current path is completed
12096
+ if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
12097
+ this.moveToNextPath(state);
12098
+ }
12099
+ else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
12100
+ // this.loadAnotherSVG(state, true);
12101
+ this.moveToNextContainer();
11850
12102
  }
11851
12103
  // this.resetIdleTimer(state); // ← keep timer alive
11852
12104
  }
11853
12105
  // Move to the next container after completing the current SVG
11854
12106
  async moveToNextContainer() {
11855
- this.isDragging = false;
11856
12107
  if (this.moving)
11857
12108
  return; // Prevent multiple calls
11858
12109
  this.moving = true; // Set moving to true to prevent re-entrance
@@ -11863,19 +12114,17 @@ const LidoTrace = class {
11863
12114
  await this.playTraceAnimation();
11864
12115
  }
11865
12116
  console.log(`Moving to next container after SVG index: ${this.currentSvgIndex}`);
11866
- console.log('Total SVGs:', this.svgUrls.length);
12117
+ const delay = 1000; // milliseconds
11867
12118
  if (this.currentSvgIndex < this.svgUrls.length - 1) {
12119
+ await new Promise(resolve => setTimeout(resolve, delay));
11868
12120
  this.currentSvgIndex++;
11869
12121
  await this.initializeSVG();
11870
12122
  this.moving = false;
11871
12123
  return;
11872
12124
  }
11873
- console.log('onCorrect:', this.onCorrect);
11874
- console.log('el :', this.el);
11875
12125
  if (this.el && this.onCorrect) {
11876
12126
  await executeActions(this.onCorrect, this.el);
11877
12127
  }
11878
- console.log('All SVGs completed, hiding component.');
11879
12128
  triggerNextContainer();
11880
12129
  }
11881
12130
  // Get the pointer position relative to the SVG
@@ -11893,13 +12142,13 @@ const LidoTrace = class {
11893
12142
  const dy = p1.y - p2.y;
11894
12143
  return dx * dx + dy * dy;
11895
12144
  }
11896
- // Find the closest point on the given path to the specified point using two-pass sampling (optimized)
12145
+ // Find the closest point on the given path to the specified point using two-pass sampling
11897
12146
  getClosestPointOnPath(pathNode, point) {
11898
12147
  const pathLength = pathNode.getTotalLength();
11899
12148
  let closestPoint = { x: 0, y: 0, length: 0 };
11900
12149
  let minDistanceSquared = Infinity;
11901
- // Optimized: Increase coarse steps for better performance
11902
- const coarseStep = 40; // was 20
12150
+ // First pass: coarse sampling
12151
+ const coarseStep = 20; // Increased step for better performance
11903
12152
  let coarseClosestPoint = { x: 0, y: 0, length: 0 };
11904
12153
  let coarseMinDistanceSquared = Infinity;
11905
12154
  for (let i = 0; i <= pathLength; i += coarseStep) {
@@ -11915,7 +12164,7 @@ const LidoTrace = class {
11915
12164
  }
11916
12165
  }
11917
12166
  // Second pass: fine sampling around coarseClosestPoint
11918
- const fineStep = 6; // was 2
12167
+ const fineStep = 2; // Increased step to reduce computations
11919
12168
  const searchStart = Math.max(coarseClosestPoint.length - coarseStep, 0);
11920
12169
  const searchEnd = Math.min(coarseClosestPoint.length + coarseStep, pathLength);
11921
12170
  for (let i = searchStart; i <= searchEnd; i += fineStep) {
@@ -12075,7 +12324,7 @@ const LidoTrace = class {
12075
12324
  };
12076
12325
  }
12077
12326
  render() {
12078
- return (h(Host, { key: 'ca50ce7efcc822c69b8bd673993dace0b7ccad75', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: 'e473c6c488d952be730ee0a659d216afe41d34a2', style: this.style, id: "lido-svgContainer" })));
12327
+ return (h(Host, { key: '6be6d97477a80afc0275eef5b17718a5f43ce358', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '4e650d7142c61549aec021fd2a8da4e592eaf94e', style: this.style, id: "lido-svgContainer" })));
12079
12328
  }
12080
12329
  static get assetsDirs() { return ["svg", "images"]; }
12081
12330
  get el() { return getElement(this); }
@@ -12163,10 +12412,10 @@ const LidoWrap = class {
12163
12412
  };
12164
12413
  }
12165
12414
  render() {
12166
- return (h(Host, { key: '8f9a578e3bf8c491373b7564b93c05de92a3e1a7', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, h("slot", { key: '0dbba1d2c88bac9a29bb81340698f5f3cb36c7be' })));
12415
+ return (h(Host, { key: '7e2bb4af31b5aff0f063a9f6c3cab96cdd25f31f', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, h("slot", { key: '03179b28e45692e61aff0bf3634ef0a72bab0726' })));
12167
12416
  }
12168
12417
  get el() { return getElement(this); }
12169
12418
  };
12170
12419
  LidoWrap.style = LidoWrapStyle0;
12171
12420
 
12172
- export { LidoAvatar as lido_avatar, LidoCell as lido_cell, LidoCol as lido_col, LidoContainer as lido_container, LidoFlash as lido_flash_card, LidoFloat as lido_float, LidoHome as lido_home, LidoImage as lido_image, LidoKeyboard as lido_keyboard, LidoMathMatrix as lido_math_matrix, LidoPos as lido_pos, LidoRandom as lido_random, LidoRoot as lido_root, LidoRow as lido_row, LidoShape as lido_shape, LidoSlideFill as lido_slide_fill, LidoText as lido_text, LidoTrace as lido_trace, LidoWrap as lido_wrap };
12421
+ export { LidoAvatar as lido_avatar, LidoBalance as lido_balance, LidoCalculator as lido_calculator, LidoCell as lido_cell, LidoCol as lido_col, LidoContainer as lido_container, LidoFlash as lido_flash_card, LidoFloat as lido_float, LidoHome as lido_home, LidoImage as lido_image, LidoKeyboard as lido_keyboard, LidoMathMatrix as lido_math_matrix, LidoPos as lido_pos, LidoRandom as lido_random, LidoRoot as lido_root, LidoRow as lido_row, LidoShape as lido_shape, LidoSlideFill as lido_slide_fill, LidoText as lido_text, LidoTrace as lido_trace, LidoWrap as lido_wrap };