lido-player 0.0.2-beta-16-dev → 0.0.2-beta-17-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 (76) hide show
  1. package/dist/cjs/{decode-C08Ujimj.js → decode-DUZYNXIv.js} +1 -1
  2. package/dist/cjs/{index-BkBqiwe8.js → index-BEjUmVtH.js} +189 -53
  3. package/dist/cjs/{index-Dy19zuTX.js → index-DnqQXD5x.js} +53 -12
  4. package/dist/cjs/index.cjs.js +2 -2
  5. package/dist/cjs/lido-avatar_22.cjs.entry.js +60 -54
  6. package/dist/cjs/lido-player.cjs.js +3 -3
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/components/calculator/lido-calculator.js +3 -3
  10. package/dist/collection/components/mathMatrix/lido-math-matrix.js +12 -2
  11. package/dist/collection/components/scale/assets/Shadow.svg +9 -0
  12. package/dist/collection/components/scale/lido-balance.css +1 -1
  13. package/dist/collection/components/scale/lido-balance.js +13 -11
  14. package/dist/collection/components/text/lido-text.js +28 -2
  15. package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -0
  16. package/dist/collection/components/trace/lido-trace.js +25 -38
  17. package/dist/collection/css/index.css +7 -4
  18. package/dist/collection/stories/Templates/blender/blender.stories.js +9 -5
  19. package/dist/collection/utils/audioPlayer.js +31 -9
  20. package/dist/collection/utils/utils.js +20 -10
  21. package/dist/collection/utils/utilsHandlers/animationHandler.js +9 -2
  22. package/dist/collection/utils/utilsHandlers/clickHandler.js +8 -0
  23. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +28 -8
  24. package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +12 -15
  25. package/dist/collection/utils/utilsHandlers/slideHandler.js +76 -17
  26. package/dist/components/index.js +1 -1
  27. package/dist/components/lido-balance.js +1 -1
  28. package/dist/components/lido-calculator.js +1 -1
  29. package/dist/components/lido-container.js +1 -1
  30. package/dist/components/lido-home.js +1 -1
  31. package/dist/components/lido-keyboard.js +1 -1
  32. package/dist/components/lido-math-matrix.js +1 -1
  33. package/dist/components/lido-root.js +1 -1
  34. package/dist/components/lido-text.js +1 -1
  35. package/dist/components/lido-trace.js +1 -1
  36. package/dist/components/p-BNNX1Pew.js +12 -0
  37. package/dist/components/p-CTlwn9r7.js +1 -0
  38. package/dist/components/{p-C2p0KZh4.js → p-Cj-6tqzU.js} +1 -1
  39. package/dist/components/p-CjdDpXfk.js +1 -0
  40. package/dist/components/{p-Uluc7jQ7.js → p-D54c-ybm.js} +1 -1
  41. package/dist/components/p-DdQ1eqJr.js +1 -0
  42. package/dist/components/{p-D-IYWSAa.js → p-SPZTb5fI.js} +1 -1
  43. package/dist/components/p-yT7udDfd.js +1 -0
  44. package/dist/esm/{decode-CGJIPA4t.js → decode-BgBfbPZu.js} +1 -1
  45. package/dist/esm/{index-Dq-Z8Dx0.js → index-BeHFCsWf.js} +54 -13
  46. package/dist/esm/{index-C854B63S.js → index-D-29PaRa.js} +189 -53
  47. package/dist/esm/index.js +2 -2
  48. package/dist/esm/lido-avatar_22.entry.js +60 -54
  49. package/dist/esm/lido-player.js +4 -4
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/lido-player/assets/Shadow.svg +9 -0
  52. package/dist/lido-player/assets/Tracing-hand.svg +8 -0
  53. package/dist/lido-player/index.esm.js +1 -1
  54. package/dist/lido-player/lido-player.css +1 -1
  55. package/dist/lido-player/lido-player.esm.js +1 -1
  56. package/dist/lido-player/p-856e1956.entry.js +12 -0
  57. package/dist/lido-player/{p-Bg5mBsd9.js → p-BA2X6O7O.js} +1 -1
  58. package/dist/lido-player/p-BeHFCsWf.js +3 -0
  59. package/dist/lido-player/p-TuBmCgtK.js +1 -0
  60. package/dist/types/components/scale/lido-balance.d.ts +2 -2
  61. package/dist/types/components/text/lido-text.d.ts +6 -1
  62. package/dist/types/components/trace/lido-trace.d.ts +1 -1
  63. package/dist/types/components.d.ts +21 -10
  64. package/dist/types/stencil-public-runtime.d.ts +12 -0
  65. package/dist/types/utils/audioPlayer.d.ts +2 -0
  66. package/dist/types/utils/utilsHandlers/slideHandler.d.ts +5 -0
  67. package/loader/index.d.ts +1 -1
  68. package/package.json +1 -1
  69. package/dist/components/p-C7U1h9gI.js +0 -1
  70. package/dist/components/p-CS6iRQJh.js +0 -1
  71. package/dist/components/p-DGvzMlyn.js +0 -12
  72. package/dist/components/p-DPAlnts-.js +0 -1
  73. package/dist/components/p-DYs8s-uh.js +0 -1
  74. package/dist/lido-player/p-C4OTDhbr.js +0 -1
  75. package/dist/lido-player/p-Dq-Z8Dx0.js +0 -2
  76. package/dist/lido-player/p-f0e333c6.entry.js +0 -12
@@ -1,7 +1,7 @@
1
1
  export declare class LidoBalance {
2
2
  /**
3
- * URL of the pivot (base stand) image used in the balance visualization.
4
- */
3
+ * URL of the pivot (base stand) image used in the balance visualization.
4
+ */
5
5
  pivotimage: string;
6
6
  /**
7
7
  * URL of the scale (bar) image that tilts based on the weight difference.
@@ -16,8 +16,13 @@ export declare class LidoText {
16
16
  id: string;
17
17
  /**
18
18
  * Value associated with the text element, typically used for internal logic or tracking.
19
- */
19
+ */
20
20
  value: string;
21
+ /**
22
+ * Number of drag elements required for count-based drop interactions.
23
+ * Used by the Blender template to determine the correct and incorrect border state.
24
+ */
25
+ requiredDrops: string;
21
26
  /**
22
27
  * The string of text to be displayed in the component.
23
28
  */
@@ -117,7 +117,7 @@ export declare class LidoTrace {
117
117
  fileIndex: number;
118
118
  isDragging: boolean;
119
119
  activePointerId: number | null;
120
- freeTraceUpdateCounter: number;
120
+ private freeTraceUpdateCounter;
121
121
  /** ───────────────────────────────────────────────────────────
122
122
  * NEW: idle‑timer + finger‑hint state
123
123
  * ─────────────────────────────────────────────────────────── */
@@ -129,7 +129,7 @@ export namespace Components {
129
129
  "fill": string;
130
130
  /**
131
131
  * URL of the handler (side stands / hooks) image for the balance.
132
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg'
132
+ * @default ''
133
133
  */
134
134
  "handlerimage": string;
135
135
  /**
@@ -165,13 +165,13 @@ export namespace Components {
165
165
  "padding": string;
166
166
  /**
167
167
  * URL of the pivot (base stand) image used in the balance visualization.
168
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg'
168
+ * @default ''
169
169
  */
170
170
  "pivotimage": string;
171
171
  "revealSymbol": () => Promise<void>;
172
172
  /**
173
173
  * URL of the scale (bar) image that tilts based on the weight difference.
174
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg'
174
+ * @default ''
175
175
  */
176
176
  "scaleimage": string;
177
177
  /**
@@ -234,7 +234,7 @@ export namespace Components {
234
234
  "onEntry": string;
235
235
  /**
236
236
  * Icon URL for the pen image shown on the calculator UI
237
- * @default "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png"
237
+ * @default ''
238
238
  */
239
239
  "penIcon": string;
240
240
  /**
@@ -2185,6 +2185,11 @@ export namespace Components {
2185
2185
  * @default ''
2186
2186
  */
2187
2187
  "padding": string;
2188
+ /**
2189
+ * Number of drag elements required for count-based drop interactions. Used by the Blender template to determine the correct and incorrect border state.
2190
+ * @default ''
2191
+ */
2192
+ "requiredDrops": string;
2188
2193
  /**
2189
2194
  * Controls whether the speak icon should appear directly on the top right corner of targeted element if it is true.
2190
2195
  * @default false
@@ -2274,7 +2279,7 @@ export namespace Components {
2274
2279
  "disableSpeak": boolean;
2275
2280
  /**
2276
2281
  * URL for the finger hint image
2277
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg'
2282
+ * @default getAssetPath('assets/Tracing-hand.svg')
2278
2283
  */
2279
2284
  "fingerHintUrl": string;
2280
2285
  /**
@@ -2847,7 +2852,7 @@ declare namespace LocalJSX {
2847
2852
  "fill"?: string;
2848
2853
  /**
2849
2854
  * URL of the handler (side stands / hooks) image for the balance.
2850
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg'
2855
+ * @default ''
2851
2856
  */
2852
2857
  "handlerimage"?: string;
2853
2858
  /**
@@ -2882,12 +2887,12 @@ declare namespace LocalJSX {
2882
2887
  "padding"?: string;
2883
2888
  /**
2884
2889
  * URL of the pivot (base stand) image used in the balance visualization.
2885
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg'
2890
+ * @default ''
2886
2891
  */
2887
2892
  "pivotimage"?: string;
2888
2893
  /**
2889
2894
  * URL of the scale (bar) image that tilts based on the weight difference.
2890
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg'
2895
+ * @default ''
2891
2896
  */
2892
2897
  "scaleimage"?: string;
2893
2898
  /**
@@ -2953,7 +2958,7 @@ declare namespace LocalJSX {
2953
2958
  "onOnOk"?: (event: LidoCalculatorCustomEvent<boolean>) => void;
2954
2959
  /**
2955
2960
  * Icon URL for the pen image shown on the calculator UI
2956
- * @default "https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png"
2961
+ * @default ''
2957
2962
  */
2958
2963
  "penIcon"?: string;
2959
2964
  /**
@@ -4904,6 +4909,11 @@ declare namespace LocalJSX {
4904
4909
  * @default ''
4905
4910
  */
4906
4911
  "padding"?: string;
4912
+ /**
4913
+ * Number of drag elements required for count-based drop interactions. Used by the Blender template to determine the correct and incorrect border state.
4914
+ * @default ''
4915
+ */
4916
+ "requiredDrops"?: string;
4907
4917
  /**
4908
4918
  * Controls whether the speak icon should appear directly on the top right corner of targeted element if it is true.
4909
4919
  * @default false
@@ -4993,7 +5003,7 @@ declare namespace LocalJSX {
4993
5003
  "disableSpeak"?: boolean;
4994
5004
  /**
4995
5005
  * URL for the finger hint image
4996
- * @default 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg'
5006
+ * @default getAssetPath('assets/Tracing-hand.svg')
4997
5007
  */
4998
5008
  "fingerHintUrl"?: string;
4999
5009
  /**
@@ -5647,6 +5657,7 @@ declare namespace LocalJSX {
5647
5657
  "showSpeakIcon": boolean;
5648
5658
  "id": string;
5649
5659
  "value": string;
5660
+ "requiredDrops": string;
5650
5661
  "string": string;
5651
5662
  "fontFamily": string;
5652
5663
  "fontSize": string;
@@ -1008,6 +1008,7 @@ export declare namespace JSXBase {
1008
1008
  onClose?: (event: Event) => void;
1009
1009
  open?: boolean;
1010
1010
  returnValue?: string;
1011
+ closedby?: 'any' | 'closerequest' | 'none';
1011
1012
  }
1012
1013
  interface EmbedHTMLAttributes<T> extends HTMLAttributes<T> {
1013
1014
  height?: number | string;
@@ -1045,6 +1046,8 @@ export declare namespace JSXBase {
1045
1046
  allowtransparency?: string | boolean;
1046
1047
  frameBorder?: number | string;
1047
1048
  frameborder?: number | string;
1049
+ fetchPriority?: 'high' | 'low' | 'auto';
1050
+ fetchpriority?: 'high' | 'low' | 'auto';
1048
1051
  importance?: 'low' | 'auto' | 'high';
1049
1052
  height?: number | string;
1050
1053
  loading?: 'lazy' | 'auto' | 'eager';
@@ -1067,6 +1070,8 @@ export declare namespace JSXBase {
1067
1070
  crossOrigin?: string;
1068
1071
  crossorigin?: string;
1069
1072
  decoding?: 'async' | 'auto' | 'sync';
1073
+ fetchPriority?: 'high' | 'low' | 'auto';
1074
+ fetchpriority?: 'high' | 'low' | 'auto';
1070
1075
  importance?: 'low' | 'auto' | 'high';
1071
1076
  height?: number | string;
1072
1077
  loading?: 'lazy' | 'auto' | 'eager';
@@ -1166,6 +1171,8 @@ export declare namespace JSXBase {
1166
1171
  }
1167
1172
  interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
1168
1173
  as?: string;
1174
+ fetchPriority?: 'high' | 'low' | 'auto';
1175
+ fetchpriority?: 'high' | 'low' | 'auto';
1169
1176
  href?: string;
1170
1177
  hrefLang?: string;
1171
1178
  hreflang?: string;
@@ -1289,6 +1296,8 @@ export declare namespace JSXBase {
1289
1296
  crossOrigin?: string;
1290
1297
  crossorigin?: string;
1291
1298
  defer?: boolean;
1299
+ fetchPriority?: 'high' | 'low' | 'auto';
1300
+ fetchpriority?: 'high' | 'low' | 'auto';
1292
1301
  importance?: 'low' | 'auto' | 'high';
1293
1302
  integrity?: string;
1294
1303
  nonce?: string;
@@ -1404,7 +1413,10 @@ export declare namespace JSXBase {
1404
1413
  tabIndex?: number;
1405
1414
  tabindex?: number | string;
1406
1415
  title?: string;
1416
+ translate?: 'yes' | 'no' | (string & {});
1407
1417
  popover?: string | null;
1418
+ focusgroup?: string;
1419
+ focusgroupstart?: boolean;
1408
1420
  inputMode?: string;
1409
1421
  inputmode?: string;
1410
1422
  enterKeyHint?: string;
@@ -3,6 +3,7 @@ export declare class AudioPlayer {
3
3
  private audioElement;
4
4
  private currentTargetElement;
5
5
  private pendingReplayElement;
6
+ private playbackHasStarted;
6
7
  private highlightOverlay;
7
8
  private wordRects;
8
9
  private activeWordIndex;
@@ -12,6 +13,7 @@ export declare class AudioPlayer {
12
13
  private isVisibilityChangeRegistered;
13
14
  private readonly stopEvents;
14
15
  private handleGlobalStopEvent;
16
+ private resolvePlaybackWait;
15
17
  private constructor();
16
18
  static getI(): AudioPlayer;
17
19
  static destroyI(): void;
@@ -1,2 +1,7 @@
1
1
  export declare const slideAnimation: () => Promise<void>;
2
2
  export declare function slidingWithScaling(element: HTMLElement): void;
3
+ export declare const getSlideValuesForValidation: (container: HTMLElement, slideElements: HTMLElement[]) => string[];
4
+ export declare const updateArrangeLettersCorrectness: (container: HTMLElement, slideValues: string[], objectiveValues: string[]) => void;
5
+ export declare const isArrangeLettersComplete: (slideValues: string[], objectiveString: string) => boolean;
6
+ export declare const updateReorderCorrectness: (container: HTMLElement, slideValues: string[], objectiveValues: string[]) => void;
7
+ export declare const isReorderComplete: (slideValues: string[], objectiveString: string) => boolean;
package/loader/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export interface CustomElementsDefineOptions {
8
8
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
9
9
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
10
10
  }
11
- export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
11
+ export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
12
12
  /**
13
13
  * @deprecated
14
14
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lido-player",
3
- "version": "0.0.2-beta-16-dev",
3
+ "version": "0.0.2-beta-17-dev",
4
4
  "description": "Stencil Component For Lido Player",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{t,p as i,H as e,i as s,c as o,w as n,a as l,y as a,h,b as r}from"./index.js";const c=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.rows="10",this.cols="10",this.defualtFill=0,this.leftIndex=!1,this.topIndex=!1,this.bottomIndex=!1,this.clickable=!0,this.activeOnlyVisible=!1,this.activeBgColor="transparent",this.deactiveBgColor="transparent",this.border="2px solid green",this.height="100%",this.width="100%",this.borderRadius="5px",this.visible="false",this.previousFilledSlot=-1,this.previousFilledSlotElement=null,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}updateValue(t){this.el.setAttribute("value",t)}componentDidLoad(){const t=this.el.querySelectorAll(".slot");s(this.el,this.type),t.forEach((t=>{const i=t;i.style.setProperty("--active-bg-color",this.activeBgColor),i.style.setProperty("--deactive-bg-color",this.deactiveBgColor),i.style.pointerEvents=this.clickable?"":"none",i.style.border=this.border,i.style.color=this.fontColor,i.className.includes("slot-active")?(i.style.visibility="",this.matrixImage&&i.style.setProperty("--bg-image",`url(${o(this.matrixImage)})`)):this.activeOnlyVisible&&(i.style.visibility="hidden")})),this.updateSlots(),this.updateStyles()}componentWillLoad(){this.updateStyles(),this.updateSlots(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateSlots(){const t=this.el.querySelectorAll(".slot"),i=this.el.querySelector(".slot");if(!t.length||!i)return;const e=document.getElementById(n);let s=this.rows,o=this.cols;e&&"multiplyBeeds"===e.getAttribute("template-id")&&(o="9",s="1");const l=Number(s)<Number(o)?this.el.offsetHeight:this.el.offsetWidth,a=Number(s)>Number(o)?Number(s):Number(o),h=this.el.querySelectorAll(".slot-parent"),r=l/a;h.forEach((t=>{t.style.width=`${r}px`,Array.from(t.children).forEach((t=>{const i=t;i.style.width=`${r}px`,i.style.height=`${r}px`,"drop"!==this.type&&"drag"!==this.type&&"checkerBlock"!==this.type||(this.el.style.width="auto",this.el.style.height="auto"),(!this.topIndex&&i.classList.contains("topIndex")||!this.leftIndex&&i.classList.contains("leftIndex")||!this.bottomIndex&&i.classList.contains("bottomIndex"))&&(i.classList.contains("leftIndex")&&i.parentElement.remove(),i.remove())}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:l(this.height,t),width:l(this.width,t),zIndex:this.z,display:"true"===l(`${this.visible}`,t)?"flex":"none",borderRadius:l(this.borderRadius,t),left:l(this.x,t),top:l(this.y,t),cols:l(`${this.cols}`,t),rows:l(`${this.rows}`,t)}}handleClickSlot(t){const i=parseInt(t.className.split(" ")[1].split("-")[1]),e=this.el.querySelectorAll(".slot");if(e.forEach(((t,e)=>{const s=t;e<i?(s.classList.add("slot-active"),s.classList.remove("slot-inactive"),this.matrixImage&&s.style.setProperty("--bg-image",`url(${o(this.matrixImage)})`)):(s.classList.remove("slot-active"),s.classList.add("slot-inactive"))})),-1!==this.previousFilledSlot&&null!==this.previousFilledSlotElement&&(this.previousFilledSlotElement.textContent=""),t.textContent=i.toString(),this.previousFilledSlot=i,this.previousFilledSlotElement=t,i===e.length)try{const t=new CustomEvent("math-matrix-bottom-click",{detail:{matrix:this.el,cols:this.style.cols,rows:this.style.rows},bubbles:!0,composed:!0});this.el.dispatchEvent(t)}catch(t){console.warn("Error dispatching math-matrix-bottom-click from handleClickSlot",t)}this.updateValue(i.toString()),a()}getSlotData(){const t={};return this.text?(this.text.split(",").forEach(((i,e)=>{const[s,o]=i.split("-"),n=parseInt(s.trim());isNaN(n)||(t[e]={text:s.trim(),color:null==o?void 0:o.trim()})})),t):t}render(){let t=1;const i=this.getSlotData();return h(r,{key:"4628494c0109ae927e379a442d3921b40e01f1e3",class:"math-matrix",style:{height:this.style.height,width:this.style.width,z:this.style.z,display:this.style.display,top:this.style.top,left:this.style.left},type:this.type,value:this.value,"tab-index":this.tabIndex,rows:this.style.rows,cols:this.style.cols,text:this.text,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},Array.from({length:parseInt(this.style.rows)+1},((e,s)=>h("div",{class:"slot-parent",key:`row-${s}`},h("div",{style:0===s&&{visibility:"hidden"},class:"topIndex"},s),Array.from({length:parseInt(this.style.cols)},((e,o)=>{var n,l;return 0===s?h("div",{class:"leftIndex"},++o):h("div",{class:`slot slot-${t} ${this.defualtFill>=t?"slot-active":"slot-inactive"}`,onClick:t=>this.handleClickSlot(t.currentTarget),key:`slot-${s}-${o}`,style:{borderRadius:this.style.borderRadius,backgroundColor:(null===(n=i[t-1])||void 0===n?void 0:n.color)||""}},null===(l=i[t-1])||void 0===l?void 0:l.text,t++&&null)})),h("div",{style:0===s&&{visibility:"hidden"},class:"bottomIndex"},parseInt(this.style.cols)*s)))))}get el(){return this}static get style(){return".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'}"}},[0,"lido-math-matrix",{rows:[1],cols:[1],defualtFill:[1538,"defualt-fill"],leftIndex:[4,"left-index"],topIndex:[4,"top-index"],bottomIndex:[4,"bottom-index"],clickable:[4],activeOnlyVisible:[4,"active-only-visible"],matrixImage:[1,"matrix-image"],activeBgColor:[1537,"active-bg-color"],deactiveBgColor:[1537,"deactive-bg-color"],border:[1537],height:[1537],width:[1537],borderRadius:[1,"border-radius"],z:[1],margin:[1],padding:[1],visible:[1],text:[1],type:[1],value:[1],tabIndex:[2,"tab-index"],x:[1],y:[1],fontColor:[1,"font-color"],onCorrect:[1,"on-correct"],onInCorrect:[1,"on-in-correct"],onEntry:[1,"on-entry"],previousFilledSlot:[32],previousFilledSlotElement:[32],style:[32]}]);function d(){"undefined"!=typeof customElements&&["lido-math-matrix"].forEach((i=>{"lido-math-matrix"===i&&(customElements.get(t(i))||customElements.define(t(i),c))}))}d();export{c as L,d}
@@ -1 +0,0 @@
1
- import{t,p as i,H as o,d as e,e as s,S as a,s as l,C as r,A as n,f as c,g as d,j as h,h as p,c as u,b}from"./index.js";import{d as f}from"./p-Bw-OC9iR.js";import{d as m}from"./p-C2p0KZh4.js";const x=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.onOk=e(this,"onOk"),this.width="479px",this.visible=!1,this.height="711px",this.objective="",this.onEntry="",this.x="0px",this.y="0px",this.bgColor="#60DADA",this.penIcon="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png",this.displayValue="",this.style={},this.userAnswers=[],this.tempInputs=[]}updateValueAttr(){this.el.setAttribute("value",this.displayValue)}componentWillLoad(){if(!this.objective){const t=this.el.closest("lido-container");t&&(this.objective=(t.getAttribute("objective")||"").replace("=","").trim())}this.updateValueAttr()}handleClick(t){"OK"===t?this.verifyAnswer():"←"===t?this.displayValue=this.displayValue.slice(0,-1):this.displayValue.length<8&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){var t;const i=this.displayValue.trim();if(!i)return;let o=!1;const e=this.el.closest("lido-container");if(!e)return;if(this.objective&&""!=this.objective&&!this.objective.includes(","))o=Number(i)===Number(this.objective);else if(this.objective&&this.objective.includes(",")){const t="true"===e.getAttribute("is-continue-on-correct"),s=this.objective.split(",").map((t=>t.trim())),a=this.userAnswers.length;a<s.length&&Number(i)===Number(s[a])&&(o=!0),t?o&&this.userAnswers.push(Number(i)):this.userAnswers.push(Number(i))}else if(""===this.objective){const t=e.getAttribute("equationCheck")||"";if(!t)return;try{const e=s(t);o=Number(e)===Number(i.trim())}catch(t){console.error("Error evaluating equation:",t),o=!1}}this.onOk.emit(o);const p=document.getElementById("btn-11");if(o){const s="nimbleTable"===e.getAttribute("template-id"),u=this.objective.includes(",");s&&u||e.setAttribute("game-completed","true"),this.tempInputs.push(i);const b=JSON.parse(null!==(t=e.getAttribute(a))&&void 0!==t?t:"[]"),f=Array.isArray(b)?b.filter((t=>""!==String(t).trim())):[],m=this.tempInputs[this.tempInputs.length-1];if(""!==String(m).trim()&&f.push(m),e.setAttribute(a,JSON.stringify(f)),p.style.pointerEvents="none",this.displayValue="",l(o,r),s&&u){const t=e.querySelector("[type='calculate']");t&&(t.getAttribute("audio")||"").trim()&&(t.style.boxShadow="none !important",t.setAttribute("onCorrect","this.speak='true'"),n.getI().play(t))}const x=(null==e?void 0:e.getAttribute("onCorrect"))||"";if(await c(x,e),!x.includes("scrollCellAfterEquationSolved"))if(u){const t=this.objective.split(",").map((t=>t.trim()));this.userAnswers.length>=t.length&&(e.setAttribute("game-completed","true"),d(),h())}else d(),h()}else{p.style.pointerEvents="none",this.displayValue="",l(o,r);const t=(null==e?void 0:e.getAttribute("onInCorrect"))||"",i=(null==e?void 0:e.getAttribute("onCorrect"))||"",s="true"===e.getAttribute("is-continue-on-correct");s?await c(t,e):await c(i,e),s||(e.setAttribute("game-completed","true"),d(),h())}p.style.pointerEvents="auto"}render(){return p(b,{key:"63cfc3e353a89b76ad809a921cc7b51ce6d06e93",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},p("lido-cell",{key:"66cc572079209533f8fd4f6c4ca76fdb9435b3b8",visible:"true",height:"94px",width:"60px"},p("lido-text",{key:"aca3392da8c74ab136268296f2ff584bf5cacd61",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"204%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},p("img",{key:"46275d788f7bb3132e657d4902d4471cc7928b39",src:u(this.penIcon),alt:"pen",style:{width:"100%",height:"100%"}}))),p("div",{key:"5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e",class:"lido-calculator-displayParent"},p("div",{key:"cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052",class:"lido-calculator-display"},this.displayValue)),p("div",{key:"64b70b100e8165dfe6d0dd9522b0362f12856a9e",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,i)=>p("lido-text",{id:`btn-${i}`,string:t,visible:"true",type:"click",class:{"lido-calculator-btn-special":"←"===t||"OK"===t,"lido-calculator-btn-default":"←"!==t&&"OK"!==t},onClick:()=>this.handleClick(t)})))))}get el(){return this}static get style(){return"#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{--btn-bg-color:#014D4D !important;background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{--btn-bg-color:#029A9A !important;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:100px !important;height:88px !important;font-size:80px !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)}"}},[0,"lido-calculator",{width:[1],visible:[8],height:[1],objective:[1],onEntry:[1,"on-entry"],x:[1],y:[1],bgColor:[1,"bg-color"],penIcon:[1,"pen-icon"],displayValue:[32],style:[32]}]);function g(){"undefined"!=typeof customElements&&["lido-calculator","lido-cell","lido-text"].forEach((i=>{switch(i){case"lido-calculator":customElements.get(t(i))||customElements.define(t(i),x);break;case"lido-cell":customElements.get(t(i))||f();break;case"lido-text":customElements.get(t(i))||m()}}))}g();export{x as L,g as d}