lido-player 0.0.2-alpha-50-dev → 0.0.2-alpha-51-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 (213) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/{index-6a69c33a.js → index-baff5c15.js} +48 -14
  3. package/dist/cjs/index.cjs.js +2 -2
  4. package/dist/cjs/{lido-avatar_21.cjs.entry.js → lido-avatar_22.cjs.entry.js} +3043 -162
  5. package/dist/cjs/lido-player.cjs.js +2 -2
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/{utils-079a5e7d.js → utils-dc02d753.js} +150 -95
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/avatar/lido-avatar.css +4 -4
  10. package/dist/collection/components/avatar/lido-avatar.js +1 -1
  11. package/dist/collection/components/calculator/lido-calculator.css +87 -87
  12. package/dist/collection/components/calculator/lido-calculator.js +14 -8
  13. package/dist/collection/components/canvas/lido-canvas.css +38 -0
  14. package/dist/collection/components/canvas/lido-canvas.js +220 -0
  15. package/dist/collection/components/cell/lido-cell.css +100 -100
  16. package/dist/collection/components/cell/lido-cell.js +12 -12
  17. package/dist/collection/components/column/lido-col.css +19 -19
  18. package/dist/collection/components/column/lido-col.js +6 -6
  19. package/dist/collection/components/container/lido-container.css +10 -10
  20. package/dist/collection/components/container/lido-container.js +70 -8
  21. package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
  22. package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
  23. package/dist/collection/components/float/lido-float.css +30 -30
  24. package/dist/collection/components/float/lido-float.js +2 -2
  25. package/dist/collection/components/home/lido-home.css +278 -278
  26. package/dist/collection/components/home/lido-home.js +92 -12
  27. package/dist/collection/components/image/lido-image.css +17 -17
  28. package/dist/collection/components/image/lido-image.js +6 -6
  29. package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
  30. package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
  31. package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
  32. package/dist/collection/components/mathMatrix/lido-math-matrix.js +56 -2
  33. package/dist/collection/components/position/lido-pos.css +16 -16
  34. package/dist/collection/components/position/lido-pos.js +2 -2
  35. package/dist/collection/components/random/lido-random.css +8 -8
  36. package/dist/collection/components/random/lido-random.js +2 -2
  37. package/dist/collection/components/root/lido-root.js +42 -6
  38. package/dist/collection/components/row/lido-row.css +10 -10
  39. package/dist/collection/components/row/lido-row.js +6 -6
  40. package/dist/collection/components/scale/lido-balance.css +145 -114
  41. package/dist/collection/components/scale/lido-balance.js +17 -17
  42. package/dist/collection/components/shape/lido-shape.css +96 -96
  43. package/dist/collection/components/shape/lido-shape.js +5 -5
  44. package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
  45. package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
  46. package/dist/collection/components/text/lido-text.css +53 -53
  47. package/dist/collection/components/text/lido-text.js +6 -5
  48. package/dist/collection/components/trace/lido-trace.css +97 -97
  49. package/dist/collection/components/trace/lido-trace.js +2 -2
  50. package/dist/collection/components/wrap/lido-wrap.css +18 -18
  51. package/dist/collection/components/wrap/lido-wrap.js +6 -6
  52. package/dist/collection/css/animation.css +194 -194
  53. package/dist/collection/css/index.css +277 -277
  54. package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +60 -60
  55. package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
  56. package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +55 -48
  57. package/dist/collection/stories/Templates/Tag/tagGame.stories.js +29 -29
  58. package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +42 -42
  59. package/dist/collection/stories/Templates/balancing/balancing.stories.js +37 -31
  60. package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
  61. package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
  62. package/dist/collection/stories/Templates/calculator/calculator.stories.js +48 -0
  63. package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
  64. package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
  65. package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +28 -22
  66. package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
  67. package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
  68. package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
  69. package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +37 -37
  70. package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
  71. package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
  72. package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
  73. package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
  74. package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
  75. package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
  76. package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
  77. package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
  78. package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +54 -54
  79. package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +23 -23
  80. package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
  81. package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
  82. package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +32 -28
  83. package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +56 -54
  84. package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +56 -45
  85. package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +38 -38
  86. package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +131 -127
  87. package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +53 -49
  88. package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +44 -40
  89. package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +96 -96
  90. package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
  91. package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +47 -45
  92. package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
  93. package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
  94. package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +62 -58
  95. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
  96. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
  97. package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
  98. package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
  99. package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +52 -48
  100. package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +65 -61
  101. package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -58
  102. package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +111 -107
  103. package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +46 -46
  104. package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
  105. package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
  106. package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +51 -47
  107. package/dist/collection/stories/Templates/total/total.stories.js +27 -27
  108. package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +35 -31
  109. package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +62 -58
  110. package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -40
  111. package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +36 -32
  112. package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +37 -33
  113. package/dist/collection/stories/components/flash-card.stories.js +48 -48
  114. package/dist/collection/stories/components/keyboard.stories.js +10 -10
  115. package/dist/collection/stories/components/slider.stories.js +4 -4
  116. package/dist/collection/stories/components/trace.stories.js +5 -5
  117. package/dist/collection/utils/audioPlayer.js +43 -6
  118. package/dist/collection/utils/constants.js +1 -0
  119. package/dist/collection/utils/i18n.js +36 -0
  120. package/dist/collection/utils/utils.js +36 -29
  121. package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
  122. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +17 -9
  123. package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
  124. package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +2 -2
  125. package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +9 -9
  126. package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
  127. package/dist/components/index.js +1 -1
  128. package/dist/components/lido-avatar.js +1 -1
  129. package/dist/components/lido-balance.js +1 -1
  130. package/dist/components/lido-calculator.js +1 -1
  131. package/dist/components/lido-canvas.d.ts +11 -0
  132. package/dist/components/lido-canvas.js +6 -0
  133. package/dist/components/lido-cell.js +1 -1
  134. package/dist/components/lido-col.js +1 -1
  135. package/dist/components/lido-container.js +1 -1
  136. package/dist/components/lido-flash-card.js +1 -1
  137. package/dist/components/lido-float.js +1 -1
  138. package/dist/components/lido-home.js +1 -1
  139. package/dist/components/lido-image.js +1 -1
  140. package/dist/components/lido-keyboard.js +1 -1
  141. package/dist/components/lido-math-matrix.js +1 -1
  142. package/dist/components/lido-pos.js +1 -1
  143. package/dist/components/lido-random.js +1 -1
  144. package/dist/components/lido-root.js +49 -25
  145. package/dist/components/lido-row.js +1 -1
  146. package/dist/components/lido-shape.js +1 -1
  147. package/dist/components/lido-slide-fill.js +1 -1
  148. package/dist/components/lido-text.js +1 -1
  149. package/dist/components/lido-trace.js +1 -1
  150. package/dist/components/lido-wrap.js +1 -1
  151. package/dist/components/{p-73e31a86.js → p-04e904b5.js} +8 -8
  152. package/dist/components/p-0fbeb3a1.js +2700 -0
  153. package/dist/components/{p-1fbdb431.js → p-12432f23.js} +2 -2
  154. package/dist/components/p-1c84cf65.js +123 -0
  155. package/dist/components/{p-74849cdd.js → p-1f3c2783.js} +4 -4
  156. package/dist/components/{p-e4e42677.js → p-4fd6b588.js} +2 -2
  157. package/dist/components/{p-e36ddcc1.js → p-56c8f3da.js} +14 -11
  158. package/dist/components/{p-cbac3cbc.js → p-62d2a5b3.js} +2 -2
  159. package/dist/components/{p-44808985.js → p-6ba0f1af.js} +7 -7
  160. package/dist/components/{p-52844fa4.js → p-6be6c5eb.js} +2 -2
  161. package/dist/components/{p-08d0deab.js → p-74b90a9c.js} +9 -3
  162. package/dist/components/{p-d37ab4dc.js → p-988477ad.js} +2 -2
  163. package/dist/components/{p-7f7e5672.js → p-a8724f06.js} +2 -2
  164. package/dist/components/{p-3f406017.js → p-b7efadad.js} +2 -2
  165. package/dist/components/{p-15971ede.js → p-b89371ac.js} +1 -1
  166. package/dist/components/{p-904711c8.js → p-bb907e43.js} +2 -2
  167. package/dist/components/{p-afbc196f.js → p-bef96764.js} +3 -2
  168. package/dist/components/{p-322acda6.js → p-c8815e84.js} +67 -31
  169. package/dist/components/{p-835b973d.js → p-caa05d1e.js} +2 -2
  170. package/dist/components/{p-bed94c37.js → p-d0131159.js} +187 -105
  171. package/dist/components/{p-29bdd953.js → p-d3f7d561.js} +2 -2
  172. package/dist/components/{p-90465904.js → p-d7693f47.js} +2 -2
  173. package/dist/components/{p-9be56729.js → p-e9548986.js} +46 -2
  174. package/dist/esm/{index-170e58c7.js → index-37c2ad2d.js} +48 -14
  175. package/dist/esm/index.js +2 -2
  176. package/dist/esm/{lido-avatar_21.entry.js → lido-avatar_22.entry.js} +3043 -163
  177. package/dist/esm/lido-player.js +3 -3
  178. package/dist/esm/loader.js +3 -3
  179. package/dist/esm/{utils-5df09162.js → utils-b5eb2360.js} +150 -95
  180. package/dist/lido-player/index.esm.js +1 -1
  181. package/dist/lido-player/lido-player.esm.js +1 -1
  182. package/dist/lido-player/p-9a9d5339.js +2 -0
  183. package/dist/lido-player/{p-7556e652.js → p-9fd87d44.js} +2 -2
  184. package/dist/lido-player/p-e1a9c26f.entry.js +1 -0
  185. package/dist/types/components/canvas/lido-canvas.d.ts +27 -0
  186. package/dist/types/components/container/lido-container.d.ts +6 -0
  187. package/dist/types/components/home/lido-home.d.ts +8 -0
  188. package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +3 -0
  189. package/dist/types/components/root/lido-root.d.ts +5 -0
  190. package/dist/types/components.d.ts +71 -0
  191. package/dist/types/stories/Templates/RocketGame/rocketGame.stories.d.ts +1 -0
  192. package/dist/types/stories/Templates/calculator/calculator.stories.d.ts +4 -0
  193. package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +1 -0
  194. package/dist/types/stories/Templates/openwindow/openwindow.stories.d.ts +1 -0
  195. package/dist/types/stories/Templates/openwindow/openwindow2.stories.d.ts +1 -0
  196. package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +1 -0
  197. package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +1 -0
  198. package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +1 -0
  199. package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +1 -1
  200. package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +1 -0
  201. package/dist/types/stories/Templates/writeCard/writeCard.stories.d.ts +1 -0
  202. package/dist/types/stories/Templates/writeLetter/writeLetter.stories.d.ts +1 -0
  203. package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +1 -0
  204. package/dist/types/stories/Templates/writeWord/writeWord.stories.d.ts +1 -0
  205. package/dist/types/types/json.d.ts +4 -0
  206. package/dist/types/utils/audioPlayer.d.ts +2 -0
  207. package/dist/types/utils/constants.d.ts +1 -0
  208. package/dist/types/utils/i18n.d.ts +5 -0
  209. package/dist/types/utils/utils.d.ts +1 -0
  210. package/package.json +71 -69
  211. package/readme.md +113 -113
  212. package/dist/lido-player/p-137c99ce.js +0 -2
  213. package/dist/lido-player/p-eb956325.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{r as t,g as i,h as e,H as n,a as r,c as o}from"./p-137c99ce.js";import{c as s,s as a,i as h,a as c,R as l,p as u,e as d,b as f,d as p,N as v,h as b,g as w,j as g,k as m,l as y,m as x,A as k,n as _,o as C,q as j,r as M,t as $,u as T,v as A,w as O,P as S,L as P,x as E,y as z,z as I,B as D,C as L,S as F,D as R,E as W,F as U,G as B,T as X,H as N,I as H}from"./p-7556e652.js";var Y,G={exports:{}};Y=()=>(()=>{var t=[,(t,i,e)=>{var n;e.r(i),e.d(i,{default:()=>r});const r=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var i,e,r=t;function o(){function t(t){const o=n;e=i=0,n=new Map,o.forEach((i=>{try{i(t)}catch(t){console.error(t)}})),this.ob(),r&&r.Tb()}let i=0,e=0,n=new Map,r=null,o=null;this.requestAnimationFrame=function(r){i||(i=requestAnimationFrame(t.bind(this)));const o=++e;return n.set(o,r),o},this.cancelAnimationFrame=function(t){n.delete(t),i&&0==n.size&&(cancelAnimationFrame(i),i=0)},this.Rb=function(t){o&&(document.body.remove(o),o=null),t||(o=document.createElement("div"),o.style.backgroundColor="black",o.style.position="fixed",o.style.right=0,o.style.top=0,o.style.color="white",o.style.padding="4px",o.innerHTML="RIVE FPS",t=function(t){o.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(o)),r=new function(){let i=0,e=0;this.Tb=function(){var n=performance.now();e?(++i,1e3<(n-=e)&&(t(1e3*i/n),i=e=0)):(e=n,i=0)}}},this.Ob=function(){o&&(document.body.remove(o),o=null),r=null},this.ob=function(){}}function s(t){console.assert(!0);const i=new Map;let e=-1/0;this.push=function(n){return i.has(n=n+((1<<t)-1)>>t)&&clearTimeout(i.get(n)),i.set(n,setTimeout((function(){i.delete(n),0==i.length?e=-1/0:n==e&&(e=Math.max(...i.keys()),console.assert(e<n))}),1e3)),e=Math.max(n,e),e<<t}}r.ready=new Promise(((t,n)=>{i=t,e=n}));const a=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){a&&a();let t=r.decodeAudio;r.decodeAudio=function(i,e){e(i=t(i))};let i=r.decodeFont;r.decodeFont=function(t,e){e(t=i(t))};const e=r.FileAssetLoader;r.ptrToAsset=t=>{let i=r.ptrToFileAsset(t);return i.isImage?r.ptrToImageAsset(t):i.isFont?r.ptrToFontAsset(t):i.isAudio?r.ptrToAudioAsset(t):i},r.CustomFileAssetLoader=e.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Gb=t},loadContents:function(t,i){return t=r.ptrToAsset(t),this.Gb(t,i)}}),r.CDNFileAssetLoader=e.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=r.ptrToAsset(t);return""!==(t=i.cdnUuid)&&(e=i.cdnBaseUrl+"/"+t,(n=new XMLHttpRequest).responseType="arraybuffer",n.onreadystatechange=function(){4==n.readyState&&200==n.status&&(t=>{i.decode(new Uint8Array(t.response))})(n)},n.open("GET",e,!0),n.send(null),!0);var e,n}}),r.FallbackFileAssetLoader=e.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.kb=[]},addLoader:function(t){this.kb.push(t)},loadContents:function(t,i){for(let e of this.kb)if(e.loadContents(t,i))return!0;return!1}});let n=r.computeAlignment;r.computeAlignment=function(t,i,e,r,o=1){return n.call(this,t,i,e,r,o)}};const h="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),c=new function(){function t(){if(!i){var t=document.createElement("canvas"),s={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let a;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(a=t.getContext("webgl",s),e=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",s))e=2;else{if(!(a=t.getContext("webgl",s)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;e=1}function h(t,i,e){if(i=a.createShader(i),a.shaderSource(i,e),a.compileShader(i),0<((e=a.getShaderInfoLog(i))||"").length)throw e;a.attachShader(t,i)}if(a=new Proxy(a,{get:(t,i)=>t.isContextLost()?(c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),c=!0),"function"==typeof t[i]?function(){}:void 0):"function"==typeof t[i]?function(...e){return t[i].apply(t,e)}:t[i],set(t,i,e){if(!t.isContextLost())return t[i]=e,!0;c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),c=!0)}}),n=Math.min(a.getParameter(a.MAX_RENDERBUFFER_SIZE),a.getParameter(a.MAX_TEXTURE_SIZE)),h(t=a.createProgram(),a.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }"),h(t,a.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),a.bindAttribLocation(t,0,"vertex"),a.bindAttribLocation(t,1,"uv"),a.linkProgram(t),0<((s=a.getProgramInfoLog(t))||"").trim().length)throw s;r=a.getUniformLocation(t,"mat"),o=a.getUniformLocation(t,"translate"),a.useProgram(t),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.enableVertexAttribArray(0),a.enableVertexAttribArray(1),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,a.createBuffer()),a.uniform1i(a.getUniformLocation(t,"image"),0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i=a}return!0}let i=null,e=0,n=0,r=null,o=null,a=0,h=0,c=!1;t(),this.hc=function(){return t(),n},this.Mb=function(t){i.deleteTexture&&i.deleteTexture(t)},this.Lb=function(n){if(!t())return null;const r=i.createTexture();return r?(i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),2==e?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.generateMipmap(i.TEXTURE_2D)):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),r):null};const l=new s(8),u=new s(8),d=new s(10),f=new s(10);this.Qb=function(e,n,s,c,p){if(t()){var v=l.push(e),b=u.push(n);if(i.canvas){for(var w of(i.canvas.width==v&&i.canvas.height==b||(i.canvas.width=v,i.canvas.height=b),i.viewport(0,b-n,e,n),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.SCISSOR_TEST),s.sort(((t,i)=>i.wb-t.wb)),v=d.push(c),a!=v&&(i.bufferData(i.ARRAY_BUFFER,8*v,i.DYNAMIC_DRAW),a=v),v=0,s))i.bufferSubData(i.ARRAY_BUFFER,v,w.Ta),v+=4*w.Ta.length;for(var g of(console.assert(v==4*c),s))i.bufferSubData(i.ARRAY_BUFFER,v,g.Db),v+=4*g.Db.length;for(var m of(console.assert(v==8*c),v=f.push(p),h!=v&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*v,i.DYNAMIC_DRAW),h=v),w=0,s))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,w,m.indices),w+=2*m.indices.length;console.assert(w==2*p),m=0,g=!0,v=w=0;for(const t of s){t.image.Ka!=m&&(i.bindTexture(i.TEXTURE_2D,t.image.Ja||null),m=t.image.Ka),t.mc?(i.scissor(t.Ya,b-t.Za-t.jb,t.Ac,t.jb),g=!0):g&&(i.scissor(0,b-n,e,n),g=!1);const a=-2/n;i.uniform4f(r,t.ha[0]*(s=2/e)*t.Ba,t.ha[1]*a*t.Ca,t.ha[2]*s*t.Ba,t.ha[3]*a*t.Ca),i.uniform2f(o,t.ha[4]*s*t.Ba+s*(t.Ya-t.ic*t.Ba)-1,t.ha[5]*a*t.Ca+a*(t.Za-t.jc*t.Ca)+1),i.vertexAttribPointer(0,2,i.FLOAT,!1,0,v),i.vertexAttribPointer(1,2,i.FLOAT,!1,0,v+4*c),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,w),v+=4*t.Ta.length,w+=2*t.indices.length}console.assert(v==4*c),console.assert(w==2*p)}}},this.canvas=function(){return t()&&i.canvas}},l=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function i(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function e(){0<C.length&&(c.Qb(_.drawWidth(),_.drawHeight(),C,j,M),C=[],M=j=0,_.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}l&&l();var n=r.RenderPaintStyle;const s=r.RenderPath,a=r.RenderPaint,u=r.Renderer,d=r.StrokeCap,f=r.StrokeJoin,p=r.BlendMode,v=n.fill,b=n.stroke,w=r.FillRule.evenOdd;let g=1;var m=r.RenderImage.extend("CanvasRenderImage",{__construct:function({la:t,xa:i}={}){this.__parent.__construct.call(this),this.Ka=g,g=g+1&2147483647||1,this.la=t,this.xa=i},__destruct:function(){this.Ja&&(c.Mb(this.Ja),URL.revokeObjectURL(this.Wa)),this.__parent.__destruct.call(this)},decode:function(t){var i=this;i.xa&&i.xa(i);var e=new Image;i.Wa=URL.createObjectURL(new Blob([t],{type:"image/png"})),e.onload=function(){i.Fb=e,i.Ja=c.Lb(e),i.size(e.width,e.height),i.la&&i.la(i)},e.src=i.Wa}}),y=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,i,e,n,r,o,s){var a=this.T,h=a.addPath;t=t.T;const c=new DOMMatrix;c.a=i,c.b=e,c.c=n,c.d=r,c.e=o,c.f=s,h.call(a,t,c)},fillRule:function(t){this.Va=t},moveTo:function(t,i){this.T.moveTo(t,i)},lineTo:function(t,i){this.T.lineTo(t,i)},cubicTo:function(t,i,e,n,r,o){this.T.bezierCurveTo(t,i,e,n,r,o)},close:function(){this.T.closePath()}}),x=a.extend("CanvasRenderPaint",{color:function(t){this.Xa=i(t)},thickness:function(t){this.Ib=t},join:function(t){switch(t){case f.miter:this.Ia="miter";break;case f.round:this.Ia="round";break;case f.bevel:this.Ia="bevel"}},cap:function(t){switch(t){case d.butt:this.Ha="butt";break;case d.round:this.Ha="round";break;case d.square:this.Ha="square"}},style:function(t){this.Hb=t},blendMode:function(i){this.Eb=t(i)},clearGradient:function(){this.ja=null},linearGradient:function(t,i,e,n){this.ja={yb:t,zb:i,bb:e,cb:n,Ra:[]}},radialGradient:function(t,i,e,n){this.ja={yb:t,zb:i,bb:e,cb:n,Ra:[],ec:!0}},addStop:function(t,i){this.ja.Ra.push({color:t,stop:i})},completeGradient:function(){},draw:function(t,e,n){let r=this.Hb;var o=this.Xa,s=this.ja;if(t.globalCompositeOperation=this.Eb,null!=s){o=s.yb;var a=s.zb;const e=s.bb;var h=s.cb;const n=s.Ra;s.ec?(s=e-o,h-=a,o=t.createRadialGradient(o,a,0,o,a,Math.sqrt(s*s+h*h))):o=t.createLinearGradient(o,a,e,h);for(let t=0,e=n.length;t<e;t++)o.addColorStop((a=n[t]).stop,i(a.color));this.Xa=o,this.ja=null}switch(r){case b:t.strokeStyle=o,t.lineWidth=this.Ib,t.lineCap=this.Ha,t.lineJoin=this.Ia,t.stroke(e);break;case v:t.fillStyle=o,t.fill(e,n)}}});const k=new Set;let _=null,C=[],j=0,M=0;var $=r.CanvasRenderer=u.extend("Renderer",{__construct:function(t){this.__parent.__construct.call(this),this.S=[1,0,0,1,0,0],this.C=t.getContext("2d"),this.Ua=t,this.H=[]},save:function(){this.S.push(...this.S.slice(this.S.length-6)),this.H.push(this.C.save.bind(this.C))},restore:function(){const t=this.S.length-6;if(6>t)throw"restore() called without matching save().";this.S.splice(t),this.H.push(this.C.restore.bind(this.C))},transform:function(t,i,e,n,r,o){const s=this.S,a=s.length-6;s.splice(a,6,s[a]*t+s[a+2]*i,s[a+1]*t+s[a+3]*i,s[a]*e+s[a+2]*n,s[a+1]*e+s[a+3]*n,s[a]*r+s[a+2]*o+s[a+4],s[a+1]*r+s[a+3]*o+s[a+5]),this.H.push(this.C.transform.bind(this.C,t,i,e,n,r,o))},rotate:function(t){const i=Math.sin(t);t=Math.cos(t),this.transform(t,i,-i,t,0,0)},_drawPath:function(t,i){this.H.push(i.draw.bind(i,this.C,t.T,t.Va===w?"evenodd":"nonzero"))},_drawRiveImage:function(i,e,n){var r=i.Fb;if(r){var o=this.C,s=t(e);this.H.push((function(){o.globalCompositeOperation=s,o.globalAlpha=n,o.drawImage(r,0,0),o.globalAlpha=1}))}},_getMatrix:function(t){const i=this.S,e=i.length-6;for(let n=0;6>n;++n)t[n]=i[e+n]},_drawImageMesh:function(i,n,o,s,a,h,l,u,d,f){var p=this.C.canvas.width,v=this.C.canvas.height;const b=d-l,w=f-u;l=Math.max(l,0),u=Math.max(u,0),d=Math.min(d,p),f=Math.min(f,v);const g=d-l,m=f-u;if(console.assert(g<=Math.min(b,p)),console.assert(m<=Math.min(w,v)),!(0>=g||0>=m)){d=g<b||m<w,p=f=1;var y=Math.ceil(g*f),x=Math.ceil(m*p);v=c.hc(),y>v&&(f*=v/y,y=v),x>v&&(p*=v/x,x=v),_||(_=new r.DynamicRectanizer(v),_.reset(512,512)),0>(v=_.addRect(y,x))&&(e(),k.add(this),v=_.addRect(y,x),console.assert(0<=v));var $=65535&v,T=v>>16;C.push({ha:this.S.slice(this.S.length-6),image:i,Ya:$,Za:T,ic:l,jc:u,Ac:y,jb:x,Ba:f,Ca:p,Ta:new Float32Array(s),Db:new Float32Array(a),indices:new Uint16Array(h),mc:d,wb:i.Ka<<1|(d?1:0)}),j+=s.length,M+=h.length;var A=this.C,O=t(n);this.H.push((function(){A.save(),A.resetTransform(),A.globalCompositeOperation=O,A.globalAlpha=o;const t=c.canvas();t&&A.drawImage(t,$,T,y,x,l,u,g,m),A.restore()}))}},_clipPath:function(t){this.H.push(this.C.clip.bind(this.C,t.T,t.Va===w?"evenodd":"nonzero"))},clear:function(){k.add(this),this.H.push(this.C.clearRect.bind(this.C,0,0,this.Ua.width,this.Ua.height))},flush:function(){},translate:function(t,i){this.transform(1,0,0,1,t,i)}});r.makeRenderer=function(t){const i=new $(t),e=i.C;return new Proxy(i,{get(t,n){if("function"==typeof t[n])return function(...i){return t[n].apply(t,i)};if("function"==typeof e[n]){if(-1<h.indexOf(n))throw Error("RiveException: Method call to '"+n+"()' is not allowed, as the renderer cannot immediately pass through the return values of any canvas 2d context methods.");return function(...t){i.H.push(e[n].bind(e,...t))}}return t[n]},set(t,n,r){if(n in e)return i.H.push((()=>{e[n]=r})),!0}})},r.decodeImage=function(t,i){new m({la:i}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=A;return new m({xa:()=>{t.total++},la:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let T=r.load,A=null;r.load=function(t,i,e=!0){const n=new r.FallbackFileAssetLoader;return void 0!==i&&n.addLoader(i),e&&(i=new r.CDNFileAssetLoader,n.addLoader(i)),new Promise((function(i){let e=null;A={total:0,loaded:0,ready:function(){i(e)}},e=T(t,n),0==A.total&&i(e)}))};let O=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,i,e,n,r=1){O.call(this,t,i,e,n,r)},n=new o,r.requestAnimationFrame=n.requestAnimationFrame.bind(n),r.cancelAnimationFrame=n.cancelAnimationFrame.bind(n),r.enableFPSCounter=n.Rb.bind(n),r.disableFPSCounter=n.Ob,n.ob=e,r.resolveAnimationFrame=e,r.cleanup=function(){_&&_.delete()}};var u,d,f=Object.assign({},r),p="./this.program",v="object"==typeof window,b="function"==typeof importScripts,w="";(v||b)&&(b?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",b&&(d=t=>{var i=new XMLHttpRequest;return i.open("GET",t,!1),i.responseType="arraybuffer",i.send(null),new Uint8Array(i.response)}),u=(t,i,e)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?i(n.response):e()},n.onerror=e,n.send(null)});var g,m=r.print||console.log.bind(console),y=r.printErr||console.error.bind(console);Object.assign(r,f),f=null,r.thisProgram&&(p=r.thisProgram),r.wasmBinary&&(g=r.wasmBinary),"object"!=typeof WebAssembly&&U("no native wasm support detected");var x,k,_,C,j,M,$,T,A,O,S=!1;function P(){var t=x.buffer;r.HEAP8=_=new Int8Array(t),r.HEAP16=j=new Int16Array(t),r.HEAP32=$=new Int32Array(t),r.HEAPU8=C=new Uint8Array(t),r.HEAPU16=M=new Uint16Array(t),r.HEAPU32=T=new Uint32Array(t),r.HEAPF32=A=new Float32Array(t),r.HEAPF64=O=new Float64Array(t)}var E,z=[],I=[],D=[];function L(){var t=r.preRun.shift();z.unshift(t)}var F,R=0,W=null;function U(t){throw r.onAbort&&r.onAbort(t),y(t="Aborted("+t+")"),S=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),e(t),t}function B(t){return t.startsWith("data:application/octet-stream;base64,")}if(!B(F="canvas_advanced.wasm")){var X=F;F=r.locateFile?r.locateFile(X,w):w+X}function N(t){if(t==F&&g)return new Uint8Array(g);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}function H(t,i,e){return function(t){if(!g&&(v||b)){if("function"==typeof fetch&&!t.startsWith("file://"))return fetch(t,{credentials:"same-origin"}).then((i=>{if(!i.ok)throw"failed to load wasm binary file at '"+t+"'";return i.arrayBuffer()})).catch((()=>N(t)));if(u)return new Promise(((i,e)=>{u(t,(t=>i(new Uint8Array(t))),e)}))}return Promise.resolve().then((()=>N(t)))}(t).then((t=>WebAssembly.instantiate(t,i))).then((t=>t)).then(e,(t=>{y("failed to asynchronously prepare wasm: "+t),U(t)}))}var Y,G,V={446236:(t,i,e,n,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={Aa:0},window.h.I={},window.h.I.ya=t,window.h.I.capture=i,window.h.I.La=e,window.h.ga={},window.h.ga.stopped=n,window.h.ga.xb=r;let o=window.h;o.D=[],o.yc=function(t){for(var i=0;i<o.D.length;++i)if(null==o.D[i])return o.D[i]=t,i;return o.D.push(t),o.D.length-1},o.Cb=function(t){for(o.D[t]=null;0<o.D.length&&null==o.D[o.D.length-1];)o.D.pop()},o.Sc=function(t){for(var i=0;i<o.D.length;++i)if(o.D[i]==t)return o.Cb(i)},o.ra=function(t){return o.D[t]},o.Bb=["touchend","click"],o.unlock=function(){for(var t=0;t<o.D.length;++t){var i=o.D[t];null!=i&&null!=i.J&&i.state===o.ga.xb&&i.J.resume().then((()=>{Te(i.pb)}),(t=>{console.error("Failed to resume audiocontext",t)}))}o.Bb.map((function(t){document.removeEventListener(t,o.unlock,!0)}))},o.Bb.map((function(t){document.addEventListener(t,o.unlock,!0)}))}return window.h.Aa+=1,1},448414:()=>{void 0!==window.h&&(--window.h.Aa,0===window.h.Aa&&delete window.h)},448578:()=>void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia,448682:()=>{try{var t=new(window.AudioContext||window.webkitAudioContext),i=t.sampleRate;return t.close(),i}catch(t){return 0}},448853:(t,i,e,n,r,o)=>{if(void 0===window.h)return-1;var s={},a={};return t==window.h.I.ya&&0!=e&&(a.sampleRate=e),s.J=new(window.AudioContext||window.webkitAudioContext)(a),s.J.suspend(),s.state=window.h.ga.stopped,e=0,t!=window.h.I.ya&&(e=i),s.Z=s.J.createScriptProcessor(n,e,i),s.Z.onaudioprocess=function(e){if(null!=s.sa&&0!=s.sa.length||(s.sa=new Float32Array(A.buffer,r,n*i)),t==window.h.I.capture||t==window.h.I.La){for(var a=0;a<i;a+=1)for(var h=e.inputBuffer.getChannelData(a),c=s.sa,l=0;l<n;l+=1)c[l*i+a]=h[l];Oe(o,n,r)}if(t==window.h.I.ya||t==window.h.I.La)for(Se(o,n,r),a=0;a<e.outputBuffer.numberOfChannels;++a)for(h=e.outputBuffer.getChannelData(a),c=s.sa,l=0;l<n;l+=1)h[l]=c[l*i+a];else for(a=0;a<e.outputBuffer.numberOfChannels;++a)e.outputBuffer.getChannelData(a).fill(0)},t!=window.h.I.capture&&t!=window.h.I.La||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){s.Da=s.J.createMediaStreamSource(t),s.Da.connect(s.Z),s.Z.connect(s.J.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.ya&&s.Z.connect(s.J.destination),s.pb=o,window.h.yc(s)},451730:t=>window.h.ra(t).J.sampleRate,451803:t=>{void 0!==(t=window.h.ra(t)).Z&&(t.Z.onaudioprocess=function(){},t.Z.disconnect(),t.Z=void 0),void 0!==t.Da&&(t.Da.disconnect(),t.Da=void 0),t.J.close(),t.J=void 0,t.pb=void 0},452203:t=>{window.h.Cb(t)},452253:t=>{(t=window.h.ra(t)).J.resume(),t.state=window.h.ga.xb},452392:t=>{(t=window.h.ra(t)).J.suspend(),t.state=window.h.ga.stopped}},q=t=>{for(;0<t.length;)t.shift()(r)},K=(t,i)=>{for(var e=0,n=t.length-1;0<=n;n--){var r=t[n];"."===r?t.splice(n,1):".."===r?(t.splice(n,1),e++):e&&(t.splice(n,1),e--)}if(i)for(;e;e--)t.unshift("..");return t},J=t=>{var i="/"===t.charAt(0),e="/"===t.substr(-1);return(t=K(t.split("/").filter((t=>!!t)),!i).join("/"))||i||(t="."),t&&e&&(t+="/"),(i?"/":"")+t},Q=t=>{var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=i[0],i=i[1],t||i?(i&&(i=i.substr(0,i.length-1)),t+i):"."},Z=t=>{if("/"===t)return"/";var i=(t=(t=J(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===i?t:t.substr(i+1)},tt=t=>(tt=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);U("initRandomDevice")})())(t);function it(){for(var t="",i=!1,e=arguments.length-1;-1<=e&&!i;e--){if("string"!=typeof(i=0<=e?arguments[e]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";t=i+"/"+t,i="/"===i.charAt(0)}return(i?"/":"")+(t=K(t.split("/").filter((t=>!!t)),!i).join("/"))||"."}var et="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,nt=(t,i,e)=>{var n=i+e;for(e=i;t[e]&&!(e>=n);)++e;if(16<e-i&&t.buffer&&et)return et.decode(t.subarray(i,e));for(n="";i<e;){var r=t[i++];if(128&r){var o=63&t[i++];if(192==(224&r))n+=String.fromCharCode((31&r)<<6|o);else{var s=63&t[i++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|s:(7&r)<<18|o<<12|s<<6|63&t[i++])?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else n+=String.fromCharCode(r)}return n},rt=[],ot=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);127>=n?i++:2047>=n?i+=2:55296<=n&&57343>=n?(i+=4,++e):i+=3}return i},st=(t,i,e,n)=>{if(!(0<n))return 0;var r=e;n=e+n-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(e>=n)break;i[e++]=s}else{if(2047>=s){if(e+1>=n)break;i[e++]=192|s>>6}else{if(65535>=s){if(e+2>=n)break;i[e++]=224|s>>12}else{if(e+3>=n)break;i[e++]=240|s>>18,i[e++]=128|s>>12&63}i[e++]=128|s>>6&63}i[e++]=128|63&s}}return i[e]=0,e-r};function at(t,i){var e=Array(ot(t)+1);return t=st(t,e,0,e.length),i&&(e.length=t),e}var ht=[];function ct(t,i){ht[t]={input:[],F:[],V:i},Ft(t,lt)}var lt={open:function(t){var i=ht[t.node.za];if(!i)throw new jt(43);t.s=i,t.seekable=!1},close:function(t){t.s.V.qa(t.s)},qa:function(t){t.s.V.qa(t.s)},read:function(t,i,e,n){if(!t.s||!t.s.V.ib)throw new jt(60);for(var r=0,o=0;o<n;o++){try{var s=t.s.V.ib(t.s)}catch(t){throw new jt(29)}if(void 0===s&&0===r)throw new jt(6);if(null==s)break;r++,i[e+o]=s}return r&&(t.node.timestamp=Date.now()),r},write:function(t,i,e,n){if(!t.s||!t.s.V.Oa)throw new jt(60);try{for(var r=0;r<n;r++)t.s.V.Oa(t.s,i[e+r])}catch(t){throw new jt(29)}return n&&(t.node.timestamp=Date.now()),r}},ut={ib:function(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t){t=null;break t}rt=at(t,!0)}t=rt.shift()}return t},Oa:function(t,i){null===i||10===i?(m(nt(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(m(nt(t.F,0)),t.F=[])},bc:function(){return{Fc:25856,Hc:5,Ec:191,Gc:35387,Dc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},cc:function(){return 0},dc:function(){return[24,80]}},dt={Oa:function(t,i){null===i||10===i?(y(nt(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(y(nt(t.F,0)),t.F=[])}};function ft(t,i){var e=t.j?t.j.length:0;e>=i||(i=Math.max(i,e*(1048576>e?2:1.125)>>>0),0!=e&&(i=Math.max(i,256)),e=t.j,t.j=new Uint8Array(i),0<t.v&&t.j.set(e.subarray(0,t.v),0))}var pt,vt,bt,wt,gt={O:null,U:()=>gt.createNode(null,"/",16895,0),createNode(t,i,e,n){if(24576==(61440&e)||4096==(61440&e))throw new jt(63);return gt.O||(gt.O={dir:{node:{Y:gt.l.Y,P:gt.l.P,ka:gt.l.ka,va:gt.l.va,ub:gt.l.ub,Ab:gt.l.Ab,vb:gt.l.vb,sb:gt.l.sb,Ea:gt.l.Ea},stream:{ba:gt.m.ba}},file:{node:{Y:gt.l.Y,P:gt.l.P},stream:{ba:gt.m.ba,read:gt.m.read,write:gt.m.write,pa:gt.m.pa,lb:gt.m.lb,nb:gt.m.nb}},link:{node:{Y:gt.l.Y,P:gt.l.P,ma:gt.l.ma},stream:{}},$a:{node:{Y:gt.l.Y,P:gt.l.P},stream:Lt}}),16384==(61440&(e=St(t,i,e,n)).mode)?(e.l=gt.O.dir.node,e.m=gt.O.dir.stream,e.j={}):32768==(61440&e.mode)?(e.l=gt.O.file.node,e.m=gt.O.file.stream,e.v=0,e.j=null):40960==(61440&e.mode)?(e.l=gt.O.link.node,e.m=gt.O.link.stream):8192==(61440&e.mode)&&(e.l=gt.O.$a.node,e.m=gt.O.$a.stream),e.timestamp=Date.now(),t&&(t.j[i]=e,t.timestamp=e.timestamp),e},Kc:t=>t.j?t.j.subarray?t.j.subarray(0,t.v):new Uint8Array(t.j):new Uint8Array(0),l:{Y(t){var i={};return i.Jc=8192==(61440&t.mode)?t.id:1,i.Mc=t.id,i.mode=t.mode,i.Oc=1,i.uid=0,i.Lc=0,i.za=t.za,i.size=16384==(61440&t.mode)?4096:32768==(61440&t.mode)?t.v:40960==(61440&t.mode)?t.link.length:0,i.Bc=new Date(t.timestamp),i.Nc=new Date(t.timestamp),i.Ic=new Date(t.timestamp),i.Jb=4096,i.Cc=Math.ceil(i.size/i.Jb),i},P(t,i){if(void 0!==i.mode&&(t.mode=i.mode),void 0!==i.timestamp&&(t.timestamp=i.timestamp),void 0!==i.size&&t.v!=(i=i.size))if(0==i)t.j=null,t.v=0;else{var e=t.j;t.j=new Uint8Array(i),e&&t.j.set(e.subarray(0,Math.min(i,t.v))),t.v=i}},ka(){throw Mt[44]},va:(t,i,e,n)=>gt.createNode(t,i,e,n),ub(t,i,e){if(16384==(61440&t.mode)){try{var n=Ot(i,e)}catch(t){}if(n)for(var r in n.j)throw new jt(55)}delete t.parent.j[t.name],t.parent.timestamp=Date.now(),t.name=e,i.j[e]=t,i.timestamp=t.parent.timestamp,t.parent=i},Ab(t,i){delete t.j[i],t.timestamp=Date.now()},vb(t,i){var e,n=Ot(t,i);for(e in n.j)throw new jt(55);delete t.j[i],t.timestamp=Date.now()},sb(t){var i,e=[".",".."];for(i in t.j)t.j.hasOwnProperty(i)&&e.push(i);return e},Ea:(t,i,e)=>((t=gt.createNode(t,i,41471,0)).link=e,t),ma(t){if(40960!=(61440&t.mode))throw new jt(28);return t.link}},m:{read(t,i,e,n,r){var o=t.node.j;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,n))&&o.subarray)i.set(o.subarray(r,r+t),e);else for(n=0;n<t;n++)i[e+n]=o[r+n];return t},write(t,i,e,n,r,o){if(i.buffer===_.buffer&&(o=!1),!n)return 0;if((t=t.node).timestamp=Date.now(),i.subarray&&(!t.j||t.j.subarray)){if(o)return t.j=i.subarray(e,e+n),t.v=n;if(0===t.v&&0===r)return t.j=i.slice(e,e+n),t.v=n;if(r+n<=t.v)return t.j.set(i.subarray(e,e+n),r),n}if(ft(t,r+n),t.j.subarray&&i.subarray)t.j.set(i.subarray(e,e+n),r);else for(o=0;o<n;o++)t.j[r+o]=i[e+o];return t.v=Math.max(t.v,r+n),n},ba(t,i,e){if(1===e?i+=t.position:2===e&&32768==(61440&t.node.mode)&&(i+=t.node.v),0>i)throw new jt(28);return i},pa(t,i,e){ft(t.node,i+e),t.node.v=Math.max(t.node.v,i+e)},lb(t,i,e,n,r){if(32768!=(61440&t.node.mode))throw new jt(43);if(t=t.node.j,2&r||t.buffer!==_.buffer){if((0<e||e+i<t.length)&&(t=t.subarray?t.subarray(e,e+i):Array.prototype.slice.call(t,e,e+i)),e=!0,U(),!(i=void 0))throw new jt(48);_.set(t,i)}else e=!1,i=t.byteOffset;return{o:i,M:e}},nb:(t,i,e,n)=>(gt.m.write(t,i,0,n,e,!1),0)}},mt=null,yt={},xt=[],kt=1,_t=null,Ct=!0,jt=null,Mt={},$t=(t,i={})=>{if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Qa:0},i)).Qa)throw new jt(32);t=t.split("/").filter((t=>!!t));for(var e=mt,n="/",r=0;r<t.length;r++){var o=r===t.length-1;if(o&&i.parent)break;if(e=Ot(e,t[r]),n=J(n+"/"+t[r]),e.wa&&(!o||o&&i.gb)&&(e=e.wa.root),!o||i.fb)for(o=0;40960==(61440&e.mode);)if(e=Xt(n),n=it(Q(n),e),e=$t(n,{Qa:i.Qa+1}).node,40<o++)throw new jt(32)}return{path:n,node:e}},Tt=t=>{for(var i;;){if(t===t.parent)return t=t.U.mb,i?"/"!==t[t.length-1]?`${t}/${i}`:t+i:t;i=i?`${t.name}/${i}`:t.name,t=t.parent}},At=(t,i)=>{for(var e=0,n=0;n<i.length;n++)e=(e<<5)-e+i.charCodeAt(n)|0;return(t+e>>>0)%_t.length},Ot=(t,i)=>{var e;if(e=(e=Et(t,"x"))?e:t.l.ka?0:2)throw new jt(e,t);for(e=_t[At(t.id,i)];e;e=e.lc)if(e.parent.id===t.id&&e.name===i)return e;return t.l.ka(t,i)},St=(t,i,e,n)=>(t=new ke(t,i,e,n),i=At(t.parent.id,t.name),t.lc=_t[i],_t[i]=t),Pt=t=>{var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i},Et=(t,i)=>Ct?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2,zt=(t,i)=>{try{return Ot(t,i),20}catch(t){}return Et(t,"wx")},It=t=>{if(!(t=xt[t]))throw new jt(8);return t},Dt=(t,i=-1)=>(bt||((bt=function(){this.h={}}).prototype={},Object.defineProperties(bt.prototype,{object:{get(){return this.node},set(t){this.node=t}},flags:{get(){return this.h.flags},set(t){this.h.flags=t}},position:{get(){return this.h.position},set(t){this.h.position=t}}})),t=Object.assign(new bt,t),-1==i&&(i=(()=>{for(var t=0;4096>=t;t++)if(!xt[t])return t;throw new jt(33)})()),t.X=i,xt[i]=t),Lt={open:t=>{t.m=yt[t.node.za].m,t.m.open&&t.m.open(t)},ba:()=>{throw new jt(70)}},Ft=(t,i)=>{yt[t]={m:i}},Rt=(t,i)=>{var e="/"===i,n=!i;if(e&&mt)throw new jt(10);if(!e&&!n){var r=$t(i,{gb:!1});if(i=r.path,(r=r.node).wa)throw new jt(10);if(16384!=(61440&r.mode))throw new jt(54)}(t=t.U(i={type:t,Qc:{},mb:i,kc:[]})).U=i,i.root=t,e?mt=t:r&&(r.wa=i,r.U&&r.U.kc.push(i))},Wt=(t,i,e)=>{var n=$t(t,{parent:!0}).node;if(!(t=Z(t))||"."===t||".."===t)throw new jt(28);var r=zt(n,t);if(r)throw new jt(r);if(!n.l.va)throw new jt(63);return n.l.va(n,t,i,e)},Ut=(t,i,e)=>{void 0===e&&(e=i,i=438),Wt(t,8192|i,e)},Bt=(t,i)=>{if(!it(t))throw new jt(44);var e=$t(i,{parent:!0}).node;if(!e)throw new jt(44);i=Z(i);var n=zt(e,i);if(n)throw new jt(n);if(!e.l.Ea)throw new jt(63);e.l.Ea(e,i,t)},Xt=t=>{if(!(t=$t(t).node))throw new jt(44);if(!t.l.ma)throw new jt(28);return it(Tt(t.parent),t.l.ma(t))},Nt=(t,i,e)=>{if(""===t)throw new jt(44);if("string"==typeof i){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[i];if(void 0===n)throw Error(`Unknown file open mode: ${i}`);i=n}if(e=64&i?4095&(void 0===e?438:e)|32768:0,"object"==typeof t)var o=t;else{t=J(t);try{o=$t(t,{fb:!(131072&i)}).node}catch(t){}}if(n=!1,64&i)if(o){if(128&i)throw new jt(20)}else o=Wt(t,e,0),n=!0;if(!o)throw new jt(44);if(8192==(61440&o.mode)&&(i&=-513),65536&i&&16384!=(61440&o.mode))throw new jt(54);if(!n&&(e=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Pt(i)||512&i)?31:Et(o,Pt(i)):44))throw new jt(e);if(512&i&&!n){if(!(e="string"==typeof(e=o)?$t(e,{fb:!0}).node:e).l.P)throw new jt(63);if(16384==(61440&e.mode))throw new jt(31);if(32768!=(61440&e.mode))throw new jt(28);if(n=Et(e,"w"))throw new jt(n);e.l.P(e,{size:0,timestamp:Date.now()})}return i&=-131713,(o=Dt({node:o,path:Tt(o),flags:i,seekable:!0,position:0,m:o.m,zc:[],error:!1})).m.open&&o.m.open(o),!r.logReadFiles||1&i||(wt||(wt={}),t in wt||(wt[t]=1)),o},Ht=(t,i,e)=>{if(null===t.X)throw new jt(8);if(!t.seekable||!t.m.ba)throw new jt(70);if(0!=e&&1!=e&&2!=e)throw new jt(28);t.position=t.m.ba(t,i,e),t.zc=[]},Yt=()=>{jt||((jt=function(t,i){this.name="ErrnoError",this.node=i,this.pc=function(t){this.aa=t},this.pc(t),this.message="FS error"}).prototype=Error(),jt.prototype.constructor=jt,[44].forEach((t=>{Mt[t]=new jt(t),Mt[t].stack="<generic error, no stack>"})))},Gt=(t,i,e)=>{t=J("/dev/"+t);var n=function(t,i){var e=0;return t&&(e|=365),i&&(e|=146),e}(!!i,!!e);vt||(vt=64);var r=vt++<<8;Ft(r,{open:t=>{t.seekable=!1},close:()=>{e&&e.buffer&&e.buffer.length&&e(10)},read:(t,e,n,r)=>{for(var o=0,s=0;s<r;s++){try{var a=i()}catch(t){throw new jt(29)}if(void 0===a&&0===o)throw new jt(6);if(null==a)break;o++,e[n+s]=a}return o&&(t.node.timestamp=Date.now()),o},write:(t,i,n,r)=>{for(var o=0;o<r;o++)try{e(i[n+o])}catch(t){throw new jt(29)}return r&&(t.node.timestamp=Date.now()),o}}),Ut(t,n,r)},Vt={},qt=void 0;function Kt(){return $[(qt+=4)-4>>2]}function Jt(t){if(void 0===t)return"_unknown";var i=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=i&&57>=i?`_${t}`:t}function Qt(t,i){return t=Jt(t),{[t]:function(){return i.apply(this,arguments)}}[t]}function Zt(){this.M=[void 0],this.hb=[]}var ti=new Zt,ii=void 0;function ei(t){throw new ii(t)}var ni=t=>(t||ei("Cannot use deleted val. handle = "+t),ti.get(t).value),ri=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ti.pa({tb:1,value:t})}};function oi(t){var i=Error,e=Qt(t,(function(i){this.name=t,this.message=i,void 0!==(i=Error(i).stack)&&(this.stack=this.toString()+"\n"+i.replace(/^Error(:[^\n]*)?\n/,""))}));return e.prototype=Object.create(i.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},e}var si=void 0,ai=void 0;function hi(t){for(var i="";C[t];)i+=ai[C[t++]];return i}var ci=[];function li(){for(;ci.length;){var t=ci.pop();t.g.fa=!1,t.delete()}}var ui=void 0,di={};function fi(t,i){for(void 0===i&&ei("ptr should not be undefined");t.A;)i=t.na(i),t=t.A;return i}var pi={};function vi(t){var i=hi(t=Ee(t));return Me(t),i}function bi(t,i){var e=pi[t];return void 0===e&&ei(i+" has unknown type "+vi(t)),e}function wi(){}var gi=!1;function mi(t){--t.count.value,0===t.count.value&&(t.G?t.L.W(t.G):t.u.i.W(t.o))}function yi(t,i,e){return i===e?t:void 0===e.A||null===(t=yi(t,i,e.A))?null:e.Pb(t)}var xi={},ki=void 0;function _i(t){throw new ki(t)}function Ci(t,i){return i.u&&i.o||_i("makeClassHandle requires ptr and ptrType"),!!i.L!=!!i.G&&_i("Both smartPtrType and smartPtr must be specified"),i.count={value:1},ji(Object.create(t,{g:{value:i}}))}function ji(t){return"undefined"==typeof FinalizationRegistry?(ji=t=>t,t):(gi=new FinalizationRegistry((t=>{mi(t.g)})),wi=t=>{gi.unregister(t)},(ji=t=>{var i=t.g;return i.G&&gi.register(t,{g:i},t),t})(t))}var Mi={};function $i(t){for(;t.length;){var i=t.pop();t.pop()(i)}}function Ti(t){return this.fromWireType($[t>>2])}var Ai={},Oi={};function Si(t,i,e){function n(i){(i=e(i)).length!==t.length&&_i("Mismatched type converter count");for(var n=0;n<t.length;++n)Ei(t[n],i[n])}t.forEach((function(t){Oi[t]=i}));var r=Array(i.length),o=[],s=0;i.forEach(((t,i)=>{pi.hasOwnProperty(t)?r[i]=pi[t]:(o.push(t),Ai.hasOwnProperty(t)||(Ai[t]=[]),Ai[t].push((()=>{r[i]=pi[t],++s===o.length&&n(r)})))})),0===o.length&&n(r)}function Pi(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError(`Unknown type size: ${t}`)}}function Ei(t,i,e={}){if(!("argPackAdvance"in i))throw new TypeError("registerType registeredInstance requires argPackAdvance");!function(t,i,e={}){var n=i.name;if(t||ei(`type "${n}" must have a positive integer typeid pointer`),pi.hasOwnProperty(t)){if(e.$b)return;ei(`Cannot register type '${n}' twice`)}pi[t]=i,delete Oi[t],Ai.hasOwnProperty(t)&&(i=Ai[t],delete Ai[t],i.forEach((t=>t())))}(t,i,e)}function zi(t){ei(t.g.u.i.name+" instance already deleted")}function Ii(){}function Di(t,i,e){if(void 0===t[i].B){var n=t[i];t[i]=function(){return t[i].B.hasOwnProperty(arguments.length)||ei(`Function '${e}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[i].B})!`),t[i].B[arguments.length].apply(this,arguments)},t[i].B=[],t[i].B[n.ea]=n}}function Li(t,i,e){r.hasOwnProperty(t)?((void 0===e||void 0!==r[t].B&&void 0!==r[t].B[e])&&ei(`Cannot register public name '${t}' twice`),Di(r,t,t),r.hasOwnProperty(e)&&ei(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`),r[t].B[e]=i):(r[t]=i,void 0!==e&&(r[t].Pc=e))}function Fi(t,i,e,n,r,o,s,a){this.name=t,this.constructor=i,this.N=e,this.W=n,this.A=r,this.Ub=o,this.na=s,this.Pb=a,this.qb=[]}function Ri(t,i,e){for(;i!==e;)i.na||ei(`Expected null or instance of ${e.name}, got an instance of ${i.name}`),t=i.na(t),i=i.A;return t}function Wi(t,i){return null===i?(this.Na&&ei(`null is not a valid ${this.name}`),0):(i.g||ei(`Cannot pass "${ie(i)}" as a ${this.name}`),i.g.o||ei(`Cannot pass deleted object as a pointer of type ${this.name}`),Ri(i.g.o,i.g.u.i,this.i))}function Ui(t,i){if(null===i){if(this.Na&&ei(`null is not a valid ${this.name}`),this.ua){var e=this.Pa();return null!==t&&t.push(this.W,e),e}return 0}if(i.g||ei(`Cannot pass "${ie(i)}" as a ${this.name}`),i.g.o||ei(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.ta&&i.g.u.ta&&ei(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`),e=Ri(i.g.o,i.g.u.i,this.i),this.ua)switch(void 0===i.g.G&&ei("Passing raw pointer to smart pointer is illegal"),this.tc){case 0:i.g.L===this?e=i.g.G:ei(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`);break;case 1:e=i.g.G;break;case 2:if(i.g.L===this)e=i.g.G;else{var n=i.clone();e=this.oc(e,ri((function(){n.delete()}))),null!==t&&t.push(this.W,e)}break;default:ei("Unsupporting sharing policy")}return e}function Bi(t,i){return null===i?(this.Na&&ei(`null is not a valid ${this.name}`),0):(i.g||ei(`Cannot pass "${ie(i)}" as a ${this.name}`),i.g.o||ei(`Cannot pass deleted object as a pointer of type ${this.name}`),i.g.u.ta&&ei(`Cannot convert argument of type ${i.g.u.name} to parameter type ${this.name}`),Ri(i.g.o,i.g.u.i,this.i))}function Xi(t,i,e,n){this.name=t,this.i=i,this.Na=e,this.ta=n,this.ua=!1,this.W=this.oc=this.Pa=this.rb=this.tc=this.nc=void 0,void 0!==i.A?this.toWireType=Ui:(this.toWireType=n?Wi:Bi,this.K=null)}function Ni(t,i,e){r.hasOwnProperty(t)||_i("Replacing nonexistant public symbol"),void 0!==r[t].B&&void 0!==e?r[t].B[e]=i:(r[t]=i,r[t].ea=e)}var Hi=[],Yi=t=>{var i=Hi[t];return i||(t>=Hi.length&&(Hi.length=t+1),Hi[t]=i=E.get(t)),i};function Gi(t,i){var e=(t=hi(t)).includes("j")?((t,i)=>{var e=[];return function(){if(e.length=0,Object.assign(e,arguments),t.includes("j")){var n=r["dynCall_"+t];n=e&&e.length?n.apply(null,[i].concat(e)):n.call(null,i)}else n=Yi(i).apply(null,e);return n}})(t,i):Yi(i);return"function"!=typeof e&&ei(`unknown function pointer with signature ${t}: ${i}`),e}var Vi=void 0;function qi(t,i){var e=[],n={};throw i.forEach((function t(i){n[i]||pi[i]||(Oi[i]?Oi[i].forEach(t):(e.push(i),n[i]=!0))})),new Vi(`${t}: `+e.map(vi).join([", "]))}function Ki(t,i,e,n,r){var o=i.length;2>o&&ei("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==i[1]&&null!==e,a=!1;for(e=1;e<i.length;++e)if(null!==i[e]&&void 0===i[e].K){a=!0;break}var h="void"!==i[0].name,c=o-2,l=Array(c),u=[],d=[];return function(){if(arguments.length!==c&&ei(`function ${t} called with ${arguments.length} arguments, expected ${c} args!`),d.length=0,u.length=s?2:1,u[0]=r,s){var e=i[1].toWireType(d,this);u[1]=e}for(var o=0;o<c;++o)l[o]=i[o+2].toWireType(d,arguments[o]),u.push(l[o]);if(o=n.apply(null,u),a)$i(d);else for(var f=s?1:2;f<i.length;f++)null!==i[f].K&&i[f].K(1===f?e:l[f-2]);return h?i[0].fromWireType(o):void 0}}function Ji(t,i){for(var e=[],n=0;n<t;n++)e.push(T[i+4*n>>2]);return e}function Qi(t,i,e){return t instanceof Object||ei(`${e} with invalid "this": ${t}`),t instanceof i.i.constructor||ei(`${e} incompatible with "this" of type ${t.constructor.name}`),t.g.o||ei(`cannot call emscripten binding method ${e} on deleted object`),Ri(t.g.o,t.g.u.i,i.i)}function Zi(t){t>=ti.h&&0==--ti.get(t).tb&&ti.Zb(t)}function te(t,i,e){switch(i){case 0:return function(t){return this.fromWireType((e?_:C)[t])};case 1:return function(t){return this.fromWireType((e?j:M)[t>>1])};case 2:return function(t){return this.fromWireType((e?$:T)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function ie(t){if(null===t)return"null";var i=typeof t;return"object"===i||"array"===i||"function"===i?t.toString():""+t}function ee(t,i){switch(i){case 2:return function(t){return this.fromWireType(A[t>>2])};case 3:return function(t){return this.fromWireType(O[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ne(t,i,e){switch(i){case 0:return e?function(t){return _[t]}:function(t){return C[t]};case 1:return e?function(t){return j[t>>1]}:function(t){return M[t>>1]};case 2:return e?function(t){return $[t>>2]}:function(t){return T[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,oe=(t,i)=>{for(var e=t>>1,n=e+i/2;!(e>=n)&&M[e];)++e;if(32<(e<<=1)-t&&re)return re.decode(C.subarray(t,e));for(e="",n=0;!(n>=i/2);++n){var r=j[t+2*n>>1];if(0==r)break;e+=String.fromCharCode(r)}return e},se=(t,i,e)=>{if(void 0===e&&(e=2147483647),2>e)return 0;var n=i;e=(e-=2)<2*t.length?e/2:t.length;for(var r=0;r<e;++r)j[i>>1]=t.charCodeAt(r),i+=2;return j[i>>1]=0,i-n},ae=t=>2*t.length,he=(t,i)=>{for(var e=0,n="";!(e>=i/4);){var r=$[t+4*e>>2];if(0==r)break;++e,65536<=r?(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r)):n+=String.fromCharCode(r)}return n},ce=(t,i,e)=>{if(void 0===e&&(e=2147483647),4>e)return 0;var n=i;e=n+e-4;for(var r=0;r<t.length;++r){var o=t.charCodeAt(r);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++r)),$[i>>2]=o,(i+=4)+4>e)break}return $[i>>2]=0,i-n},le=t=>{for(var i=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);55296<=n&&57343>=n&&++e,i+=4}return i},ue={};function de(t){var i=ue[t];return void 0===i?hi(t):i}var fe,pe=[],ve=[],be=[],we={},ge=()=>{if(!fe){var t,i={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in we)void 0===we[t]?delete i[t]:i[t]=we[t];var e=[];for(t in i)e.push(`${t}=${i[t]}`);fe=e}return fe},me=t=>0==t%4&&(0!=t%100||0==t%400),ye=[31,29,31,30,31,30,31,31,30,31,30,31],xe=[31,28,31,30,31,30,31,31,30,31,30,31];function ke(t,i,e,n){t||(t=this),this.parent=t,this.U=t.U,this.wa=null,this.id=kt++,this.name=i,this.mode=e,this.l={},this.m={},this.za=n}Object.defineProperties(ke.prototype,{read:{get:function(){return!(365&~this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return!(146&~this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}}}),Yt(),_t=Array(4096),Rt(gt,"/"),Wt("/tmp",16895,0),Wt("/home",16895,0),Wt("/home/web_user",16895,0),(()=>{Wt("/dev",16895,0),Ft(259,{read:()=>0,write:(t,i,e,n)=>n}),Ut("/dev/null",259),ct(1280,ut),ct(1536,dt),Ut("/dev/tty",1280),Ut("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,e=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Gt("random",e),Gt("urandom",e),Wt("/dev/shm",16895,0),Wt("/dev/shm/tmp",16895,0)})(),(()=>{Wt("/proc",16895,0);var t=Wt("/proc/self",16895,0);Wt("/proc/self/fd",16895,0),Rt({U:()=>{var i=St(t,"fd",16895,73);return i.l={ka:(t,i)=>{var e=It(+i);return(t={parent:null,U:{mb:"fake"},l:{ma:()=>e.path}}).parent=t}},i}},"/proc/self/fd")})(),Object.assign(Zt.prototype,{get(t){return this.M[t]},has(t){return void 0!==this.M[t]},pa(t){var i=this.hb.pop()||this.M.length;return this.M[i]=t,i},Zb(t){this.M[t]=void 0,this.hb.push(t)}}),ii=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ti.M.push({value:void 0},{value:null},{value:!0},{value:!1}),ti.h=ti.M.length,r.count_emval_handles=function(){for(var t=0,i=ti.h;i<ti.M.length;++i)void 0!==ti.M[i]&&++t;return t},si=r.PureVirtualError=oi("PureVirtualError");for(var _e=Array(256),Ce=0;256>Ce;++Ce)_e[Ce]=String.fromCharCode(Ce);ai=_e,r.getInheritedInstanceCount=function(){return Object.keys(di).length},r.getLiveInheritedInstances=function(){var t,i=[];for(t in di)di.hasOwnProperty(t)&&i.push(di[t]);return i},r.flushPendingDeletes=li,r.setDelayFunction=function(t){ui=t,ci.length&&ui&&ui(li)},ki=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ii.prototype.isAliasOf=function(t){if(!(this instanceof Ii&&t instanceof Ii))return!1;var i=this.g.u.i,e=this.g.o,n=t.g.u.i;for(t=t.g.o;i.A;)e=i.na(e),i=i.A;for(;n.A;)t=n.na(t),n=n.A;return i===n&&e===t},Ii.prototype.clone=function(){if(this.g.o||zi(this),this.g.ia)return this.g.count.value+=1,this;var t=ji,i=Object,e=i.create,n=Object.getPrototypeOf(this),r=this.g;return(t=t(e.call(i,n,{g:{value:{count:r.count,fa:r.fa,ia:r.ia,o:r.o,u:r.u,G:r.G,L:r.L}}}))).g.count.value+=1,t.g.fa=!1,t},Ii.prototype.delete=function(){this.g.o||zi(this),this.g.fa&&!this.g.ia&&ei("Object already scheduled for deletion"),wi(this),mi(this.g),this.g.ia||(this.g.G=void 0,this.g.o=void 0)},Ii.prototype.isDeleted=function(){return!this.g.o},Ii.prototype.deleteLater=function(){return this.g.o||zi(this),this.g.fa&&!this.g.ia&&ei("Object already scheduled for deletion"),ci.push(this),1===ci.length&&ui&&ui(li),this.g.fa=!0,this},Xi.prototype.Vb=function(t){return this.rb&&(t=this.rb(t)),t},Xi.prototype.ab=function(t){this.W&&this.W(t)},Xi.prototype.argPackAdvance=8,Xi.prototype.readValueFromPointer=Ti,Xi.prototype.deleteObject=function(t){null!==t&&t.delete()},Xi.prototype.fromWireType=function(t){function i(){return Ci(this.i.N,this.ua?{u:this.nc,o:e,L:this,G:t}:{u:this,o:t})}var e=this.Vb(t);if(!e)return this.ab(t),null;var n=function(t,i){return i=fi(t,i),di[i]}(this.i,e);if(void 0!==n)return 0===n.g.count.value?(n.g.o=e,n.g.G=t,n.clone()):(n=n.clone(),this.ab(t),n);if(n=this.i.Ub(e),!(n=xi[n]))return i.call(this);var r=yi(e,this.i,(n=this.ta?n.Kb:n.pointerType).i);return null===r?i.call(this):Ci(n.i.N,this.ua?{u:n,o:r,L:this,G:t}:{u:n,o:r})},Vi=r.UnboundTypeError=oi("UnboundTypeError");var je={__syscall_fcntl64:function(t,i,e){qt=e;try{var n=It(t);switch(i){case 0:var r=Kt();return 0>r?-28:Dt(n,r).X;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:return r=Kt(),n.flags|=r,0;case 5:return r=Kt(),j[r+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return $[Pe()>>2]=28,-1}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_ioctl:function(t,i,e){qt=e;try{var n=It(t);switch(i){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.s?0:-59;case 21505:if(!n.s)return-59;if(n.s.V.bc){i=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Kt();$[r>>2]=25856,$[r+4>>2]=5,$[r+8>>2]=191,$[r+12>>2]=35387;for(var o=0;32>o;o++)_[r+o+17|0]=i[o]||0}return 0;case 21506:case 21507:case 21508:if(!n.s)return-59;if(n.s.V.cc)for(r=Kt(),i=[],o=0;32>o;o++)i.push(_[r+o+17|0]);return 0;case 21519:return n.s?(r=Kt(),$[r>>2]=0):-59;case 21520:return n.s?-28:-59;case 21531:if(r=Kt(),!n.m.ac)throw new jt(59);return n.m.ac(n,i,r);case 21523:return n.s?(n.s.V.dc&&(o=[24,80],r=Kt(),j[r>>1]=o[0],j[r+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_openat:function(t,i,e,n){qt=n;try{var r=i=i?nt(C,i):"";if("/"===r.charAt(0))i=r;else{var o=-100===t?"/":It(t).path;if(0==r.length)throw new jt(44);i=J(o+"/"+r)}var s=n?Kt():0;return Nt(i,e,s).X}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},_embind_create_inheriting_constructor:function(t,i,e){t=hi(t),i=bi(i,"wrapper"),e=ni(e);var n=[].slice,r=i.i,o=r.N,s=r.A.N,a=r.A.constructor;for(var h in t=Qt(t,(function(){r.A.qb.forEach(function(t){if(this[t]===s[t])throw new si(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:o}),this.__construct.apply(this,n.call(arguments))})),o.__construct=function(){this===o&&ei("Pass correct 'this' to __construct");var t=a.implement.apply(void 0,[this].concat(n.call(arguments)));wi(t);var i=t.g;t.notifyOnDestruction(),i.ia=!0,Object.defineProperties(this,{g:{value:i}}),ji(this),t=fi(r,t=i.o),di.hasOwnProperty(t)?ei(`Tried to register registered instance: ${t}`):di[t]=this},o.__destruct=function(){this===o&&ei("Pass correct 'this' to __destruct"),wi(this);var t=this.g.o;t=fi(r,t),di.hasOwnProperty(t)?delete di[t]:ei(`Tried to unregister unregistered instance: ${t}`)},t.prototype=Object.create(o),e)t.prototype[h]=e[h];return ri(t)},_embind_finalize_value_object:function(t){var i=Mi[t];delete Mi[t];var e=i.Pa,n=i.W,r=i.eb;Si([t],r.map((t=>t.Yb)).concat(r.map((t=>t.rc))),(t=>{var o={};return r.forEach(((i,e)=>{var n=t[e],s=i.Wb,a=i.Xb,h=t[e+r.length],c=i.qc,l=i.sc;o[i.Sb]={read:t=>n.fromWireType(s(a,t)),write:(t,i)=>{var e=[];c(l,t,h.toWireType(e,i)),$i(e)}}})),[{name:i.name,fromWireType:function(t){var i,e={};for(i in o)e[i]=o[i].read(t);return n(t),e},toWireType:function(t,i){for(var r in o)if(!(r in i))throw new TypeError(`Missing field: "${r}"`);var s=e();for(r in o)o[r].write(s,i[r]);return null!==t&&t.push(n,s),s},argPackAdvance:8,readValueFromPointer:Ti,K:n}]}))},_embind_register_bigint:function(){},_embind_register_bool:function(t,i,e,n,r){var o=Pi(e);Ei(t,{name:i=hi(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?n:r},argPackAdvance:8,readValueFromPointer:function(t){if(1===e)var n=_;else if(2===e)n=j;else{if(4!==e)throw new TypeError("Unknown boolean type size: "+i);n=$}return this.fromWireType(n[t>>o])},K:null})},_embind_register_class:function(t,i,e,n,r,o,s,a,h,c,l,u,d){l=hi(l),o=Gi(r,o),a&&(a=Gi(s,a)),c&&(c=Gi(h,c)),d=Gi(u,d);var f=Jt(l);Li(f,(function(){qi(`Cannot construct ${l} due to unbound types`,[n])})),Si([t,i,e],n?[n]:[],(function(i){if(i=i[0],n)var e=i.i,r=e.N;else r=Ii.prototype;i=Qt(f,(function(){if(Object.getPrototypeOf(this)!==s)throw new ii("Use 'new' to construct "+l);if(void 0===h.$)throw new ii(l+" has no accessible constructor");var t=h.$[arguments.length];if(void 0===t)throw new ii(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.$).toString()}) parameters instead!`);return t.apply(this,arguments)}));var s=Object.create(r,{constructor:{value:i}});i.prototype=s;var h=new Fi(l,i,s,d,e,o,a,c);h.A&&(void 0===h.A.oa&&(h.A.oa=[]),h.A.oa.push(h)),e=new Xi(l,h,!0,!1),r=new Xi(l+"*",h,!1,!1);var u=new Xi(l+" const*",h,!1,!0);return xi[t]={pointerType:r,Kb:u},Ni(f,i),[e,r,u]}))},_embind_register_class_class_function:function(t,i,e,n,r,o,s){var a=Ji(e,n);i=hi(i),o=Gi(r,o),Si([],[t],(function(t){function n(){qi(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]);var h=t.i.constructor;return void 0===h[i]?(n.ea=e-1,h[i]=n):(Di(h,i,r),h[i].B[e-1]=n),Si([],a,(function(n){if(n=Ki(r,[n[0],null].concat(n.slice(1)),null,o,s),void 0===h[i].B?(n.ea=e-1,h[i]=n):h[i].B[e-1]=n,t.i.oa)for(const e of t.i.oa)e.constructor.hasOwnProperty(i)||(e.constructor[i]=n);return[]})),[]}))},_embind_register_class_class_property:function(t,i,e,n,r,o,s,a){i=hi(i),o=Gi(r,o),Si([],[t],(function(t){var r=`${(t=t[0]).name}.${i}`,h={get(){qi(`Cannot access ${r} due to unbound types`,[e])},enumerable:!0,configurable:!0};return h.set=a?()=>{qi(`Cannot access ${r} due to unbound types`,[e])}:()=>{ei(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Si([],[e],(function(e){e=e[0];var r={get:()=>e.fromWireType(o(n)),enumerable:!0};return a&&(a=Gi(s,a),r.set=t=>{var i=[];a(n,e.toWireType(i,t)),$i(i)}),Object.defineProperty(t.i.constructor,i,r),[]})),[]}))},_embind_register_class_constructor:function(t,i,e,n,r,o){var s=Ji(i,e);r=Gi(n,r),Si([],[t],(function(t){var e=`constructor ${(t=t[0]).name}`;if(void 0===t.i.$&&(t.i.$=[]),void 0!==t.i.$[i-1])throw new ii(`Cannot register multiple constructors with identical number of parameters (${i-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.$[i-1]=()=>{qi(`Cannot construct ${t.name} due to unbound types`,s)},Si([],s,(function(n){return n.splice(1,0,null),t.i.$[i-1]=Ki(e,n,null,r,o),[]})),[]}))},_embind_register_class_function:function(t,i,e,n,r,o,s,a){var h=Ji(e,n);i=hi(i),o=Gi(r,o),Si([],[t],(function(t){function n(){qi(`Cannot call ${r} due to unbound types`,h)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.qb.push(i);var c=t.i.N,l=c[i];return void 0===l||void 0===l.B&&l.className!==t.name&&l.ea===e-2?(n.ea=e-2,n.className=t.name,c[i]=n):(Di(c,i,r),c[i].B[e-2]=n),Si([],h,(function(n){return n=Ki(r,n,t,o,s),void 0===c[i].B?(n.ea=e-2,c[i]=n):c[i].B[e-2]=n,[]})),[]}))},_embind_register_class_property:function(t,i,e,n,r,o,s,a,h,c){i=hi(i),r=Gi(n,r),Si([],[t],(function(t){var n=`${(t=t[0]).name}.${i}`,l={get(){qi(`Cannot access ${n} due to unbound types`,[e,s])},enumerable:!0,configurable:!0};return l.set=h?()=>{qi(`Cannot access ${n} due to unbound types`,[e,s])}:()=>{ei(n+" is a read-only property")},Object.defineProperty(t.i.N,i,l),Si([],h?[e,s]:[e],(function(e){var s=e[0],l={get(){var i=Qi(this,t,n+" getter");return s.fromWireType(r(o,i))},enumerable:!0};if(h){h=Gi(a,h);var u=e[1];l.set=function(i){var e=Qi(this,t,n+" setter"),r=[];h(c,e,u.toWireType(r,i)),$i(r)}}return Object.defineProperty(t.i.N,i,l),[]})),[]}))},_embind_register_emval:function(t,i){Ei(t,{name:i=hi(i),fromWireType:function(t){var i=ni(t);return Zi(t),i},toWireType:function(t,i){return ri(i)},argPackAdvance:8,readValueFromPointer:Ti,K:null})},_embind_register_enum:function(t,i,e,n){function r(){}e=Pi(e),i=hi(i),r.values={},Ei(t,{name:i,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,i){return i.value},argPackAdvance:8,readValueFromPointer:te(i,e,n),K:null}),Li(i,r)},_embind_register_enum_value:function(t,i,e){var n=bi(t,"enum");i=hi(i),t=n.constructor,n=Object.create(n.constructor.prototype,{value:{value:e},constructor:{value:Qt(`${n.name}_${i}`,(function(){}))}}),t.values[e]=n,t[i]=n},_embind_register_float:function(t,i,e){e=Pi(e),Ei(t,{name:i=hi(i),fromWireType:function(t){return t},toWireType:function(t,i){return i},argPackAdvance:8,readValueFromPointer:ee(i,e),K:null})},_embind_register_function:function(t,i,e,n,r,o){var s=Ji(i,e);t=hi(t),r=Gi(n,r),Li(t,(function(){qi(`Cannot call ${t} due to unbound types`,s)}),i-1),Si([],s,(function(e){return Ni(t,Ki(t,[e[0],null].concat(e.slice(1)),null,r,o),i-1),[]}))},_embind_register_integer:function(t,i,e,n,r){i=hi(i),-1===r&&(r=4294967295),r=Pi(e);var o=t=>t;if(0===n){var s=32-8*e;o=t=>t<<s>>>s}e=i.includes("unsigned")?function(t,i){return i>>>0}:function(t,i){return i},Ei(t,{name:i,fromWireType:o,toWireType:e,argPackAdvance:8,readValueFromPointer:ne(i,r,0!==n),K:null})},_embind_register_memory_view:function(t,i,e){function n(t){return new r(T.buffer,T[1+(t>>=2)],T[t])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][i];Ei(t,{name:e=hi(e),fromWireType:n,argPackAdvance:8,readValueFromPointer:n},{$b:!0})},_embind_register_std_string:function(t,i){var e="std::string"===(i=hi(i));Ei(t,{name:i,fromWireType:function(t){var i=T[t>>2],n=t+4;if(e)for(var r=n,o=0;o<=i;++o){var s=n+o;if(o==i||0==C[s]){if(r=r?nt(C,r,s-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=s+1}}else{for(a=Array(i),o=0;o<i;++o)a[o]=String.fromCharCode(C[n+o]);a=a.join("")}return Me(t),a},toWireType:function(t,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var n="string"==typeof i;n||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||ei("Cannot pass non-string to std::string");var r=e&&n?ot(i):i.length,o=$e(4+r+1),s=o+4;if(T[o>>2]=r,e&&n)st(i,C,s,r+1);else if(n)for(n=0;n<r;++n){var a=i.charCodeAt(n);255<a&&(Me(s),ei("String has UTF-16 code units that do not fit in 8 bits")),C[s+n]=a}else for(n=0;n<r;++n)C[s+n]=i[n];return null!==t&&t.push(Me,o),o},argPackAdvance:8,readValueFromPointer:Ti,K:function(t){Me(t)}})},_embind_register_std_wstring:function(t,i,e){if(e=hi(e),2===i)var n=oe,r=se,o=ae,s=()=>M,a=1;else 4===i&&(n=he,r=ce,o=le,s=()=>T,a=2);Ei(t,{name:e,fromWireType:function(t){for(var e,r=T[t>>2],o=s(),h=t+4,c=0;c<=r;++c){var l=t+4+c*i;c!=r&&0!=o[l>>a]||(h=n(h,l-h),void 0===e?e=h:(e+=String.fromCharCode(0),e+=h),h=l+i)}return Me(t),e},toWireType:function(t,n){"string"!=typeof n&&ei(`Cannot pass non-string to C++ string type ${e}`);var s=o(n),h=$e(4+s+i);return T[h>>2]=s>>a,r(n,h+4,s+i),null!==t&&t.push(Me,h),h},argPackAdvance:8,readValueFromPointer:Ti,K:function(t){Me(t)}})},_embind_register_value_object:function(t,i,e,n,r,o){Mi[t]={name:hi(i),Pa:Gi(e,n),W:Gi(r,o),eb:[]}},_embind_register_value_object_field:function(t,i,e,n,r,o,s,a,h,c){Mi[t].eb.push({Sb:hi(i),Yb:e,Wb:Gi(n,r),Xb:o,rc:s,qc:Gi(a,h),sc:c})},_embind_register_void:function(t,i){Ei(t,{fc:!0,name:i=hi(i),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},_emscripten_get_now_is_monotonic:()=>!0,_emval_as:function(t,i,e){t=ni(t),i=bi(i,"emval::as");var n=[],r=ri(n);return T[e>>2]=r,i.toWireType(n,t)},_emval_call_method:function(t,i,e,n,r){t=pe[t],i=ni(i),e=de(e);var o=[];return T[n>>2]=ri(o),t(i,e,o,r)},_emval_call_void_method:function(t,i,e,n){(t=pe[t])(i=ni(i),e=de(e),null,n)},_emval_decref:Zi,_emval_get_method_caller:function(t,i){var e=function(t,i){for(var e=Array(t),n=0;n<t;++n)e[n]=bi(T[i+4*n>>2],"parameter "+n);return e}(t,i),n=e[0];i=n.name+"_$"+e.slice(1).map((function(t){return t.name})).join("_")+"$";var r=ve[i];if(void 0!==r)return r;var o=Array(t-1);return r=function(t){var i=pe.length;return pe.push(t),i}(((i,r,s,a)=>{for(var h=0,c=0;c<t-1;++c)o[c]=e[c+1].readValueFromPointer(a+h),h+=e[c+1].argPackAdvance;for(i=i[r].apply(i,o),c=0;c<t-1;++c)e[c+1].Nb&&e[c+1].Nb(o[c]);if(!n.fc)return n.toWireType(s,i)})),ve[i]=r},_emval_get_module_property:function(t){return t=de(t),ri(r[t])},_emval_get_property:function(t,i){return t=ni(t),i=ni(i),ri(t[i])},_emval_incref:function(t){4<t&&(ti.get(t).tb+=1)},_emval_new_cstring:function(t){return ri(de(t))},_emval_new_object:function(){return ri({})},_emval_run_destructors:function(t){$i(ni(t)),Zi(t)},_emval_set_property:function(t,i,e){t=ni(t),i=ni(i),e=ni(e),t[i]=e},_emval_take_value:function(t,i){return t=(t=bi(t,"_emval_take_value")).readValueFromPointer(i),ri(t)},abort:()=>{U("")},emscripten_asm_const_int:(t,i,e)=>{var n;for(be.length=0,e>>=2;n=C[i++];)e+=105!=n&e,be.push(105==n?$[e]:O[e++>>1]),++e;return V[t].apply(null,be)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:()=>performance.now(),emscripten_memcpy_big:(t,i,e)=>C.copyWithin(t,i,i+e),emscripten_resize_heap:t=>{var i=C.length;if(2147483648<(t>>>=0))return!1;for(var e=1;4>=e;e*=2){var n=i*(1+.2/e);n=Math.min(n,t+100663296);var r=Math;n=Math.max(t,n);t:{r=r.min.call(r,2147483648,n+(65536-n%65536)%65536)-x.buffer.byteLength+65535>>>16;try{x.grow(r),P();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,i)=>{var e=0;return ge().forEach((function(n,r){var o=i+e;for(r=T[t+4*r>>2]=o,o=0;o<n.length;++o)_[0|r++]=n.charCodeAt(o);_[0|r]=0,e+=n.length+1})),0},environ_sizes_get:(t,i)=>{var e=ge();T[t>>2]=e.length;var n=0;return e.forEach((function(t){n+=t.length+1})),T[i>>2]=n,0},fd_close:function(t){try{var i=It(t);if(null===i.X)throw new jt(8);i.Ma&&(i.Ma=null);try{i.m.close&&i.m.close(i)}catch(t){throw t}finally{xt[i.X]=null}return i.X=null,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_read:function(t,i,e,n){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<e;s++){var a=T[t>>2],h=T[t+4>>2];t+=8;var c=r,l=a,u=h,d=o,f=_;if(0>u||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(1==(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.read)throw new jt(28);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.read(c,f,l,u,d);p||(c.position+=v);var b=v;if(0>b){var w=-1;break t}if(i+=b,b<h)break;void 0!==o&&(o+=b)}w=i}return T[n>>2]=w,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_seek:function(t,i,e,n,r){i=e+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*e:NaN;try{if(isNaN(i))return 61;var o=It(t);return Ht(o,i,n),G=[o.position>>>0,(Y=o.position,1<=+Math.abs(Y)?0<Y?+Math.floor(Y/4294967296)>>>0:~~+Math.ceil((Y-+(~~Y>>>0))/4294967296)>>>0:0)],$[r>>2]=G[0],$[r+4>>2]=G[1],o.Ma&&0===i&&0===n&&(o.Ma=null),0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_write:function(t,i,e,n){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<e;s++){var a=T[t>>2],h=T[t+4>>2];t+=8;var c=r,l=a,u=h,d=o,f=_;if(0>u||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(!(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.write)throw new jt(28);c.seekable&&1024&c.flags&&Ht(c,0,2);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.write(c,f,l,u,d,void 0);p||(c.position+=v);var b=v;if(0>b){var w=-1;break t}i+=b,void 0!==o&&(o+=b)}w=i}return T[n>>2]=w,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},strftime_l:(t,i,e,n)=>((t,i,e,n)=>{function r(t,i,e){for(t="number"==typeof t?t.toString():t||"";t.length<i;)t=e[0]+t;return t}function o(t,i){return r(t,i,"0")}function s(t,i){function e(t){return 0>t?-1:0<t?1:0}var n;return 0===(n=e(t.getFullYear()-i.getFullYear()))&&0===(n=e(t.getMonth()-i.getMonth()))&&(n=e(t.getDate()-i.getDate())),n}function a(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function h(t){var i=t.ca;for(t=new Date(new Date(t.da+1900,0,1).getTime());0<i;){var e=t.getMonth(),n=(me(t.getFullYear())?ye:xe)[e];if(!(i>n-t.getDate())){t.setDate(t.getDate()+i);break}i-=n-t.getDate()+1,t.setDate(1),11>e?t.setMonth(e+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return e=new Date(t.getFullYear()+1,0,4),i=a(new Date(t.getFullYear(),0,4)),e=a(e),0>=s(i,t)?0>=s(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=$[n+40>>2];for(var l in n={wc:$[n>>2],vc:$[n+4>>2],Fa:$[n+8>>2],Sa:$[n+12>>2],Ga:$[n+16>>2],da:$[n+20>>2],R:$[n+24>>2],ca:$[n+28>>2],Rc:$[n+32>>2],uc:$[n+36>>2],xc:c&&c?nt(C,c):""},e=e?nt(C,e):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(l,"g"),c[l]);var u="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(l in c={"%a":t=>u[t.R].substring(0,3),"%A":t=>u[t.R],"%b":t=>d[t.Ga].substring(0,3),"%B":t=>d[t.Ga],"%C":t=>o((t.da+1900)/100|0,2),"%d":t=>o(t.Sa,2),"%e":t=>r(t.Sa,2," "),"%g":t=>h(t).toString().substring(2),"%G":t=>h(t),"%H":t=>o(t.Fa,2),"%I":t=>(0==(t=t.Fa)?t=12:12<t&&(t-=12),o(t,2)),"%j":t=>{for(var i=0,e=0;e<=t.Ga-1;i+=(me(t.da+1900)?ye:xe)[e++]);return o(t.Sa+i,3)},"%m":t=>o(t.Ga+1,2),"%M":t=>o(t.vc,2),"%n":()=>"\n","%p":t=>0<=t.Fa&&12>t.Fa?"AM":"PM","%S":t=>o(t.wc,2),"%t":()=>"\t","%u":t=>t.R||7,"%U":t=>o(Math.floor((t.ca+7-t.R)/7),2),"%V":t=>{var i=Math.floor((t.ca+7-(t.R+6)%7)/7);if(2>=(t.R+371-t.ca-2)%7&&i++,i)53==i&&(4==(e=(t.R+371-t.ca)%7)||3==e&&me(t.da)||(i=1));else{i=52;var e=(t.R+7-t.ca-1)%7;(4==e||5==e&&me(t.da%400-1))&&i++}return o(i,2)},"%w":t=>t.R,"%W":t=>o(Math.floor((t.ca+7-(t.R+6)%7)/7),2),"%y":t=>(t.da+1900).toString().substring(2),"%Y":t=>t.da+1900,"%z":t=>{var i=0<=(t=t.uc);return t=Math.abs(t)/60,(i?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":t=>t.xc,"%%":()=>"%"},e=e.replace(/%%/g,"\0\0"),c)e.includes(l)&&(e=e.replace(new RegExp(l,"g"),c[l](n)));return(l=at(e=e.replace(/\0\0/g,"%"),!1)).length>i?0:(_.set(l,t),l.length-1)})(t,i,e,n)};!function(){function t(t){if(k=t=t.exports,x=k.memory,P(),E=k.__indirect_function_table,I.unshift(k.__wasm_call_ctors),R--,r.monitorRunDependencies&&r.monitorRunDependencies(R),0==R&&W){var i=W;W=null,i()}return t}var i={env:je,wasi_snapshot_preview1:je};if(R++,r.monitorRunDependencies&&r.monitorRunDependencies(R),r.instantiateWasm)try{return r.instantiateWasm(i,t)}catch(t){y("Module.instantiateWasm callback failed with error: "+t),e(t)}(function(t,i){var e=F;return g||"function"!=typeof WebAssembly.instantiateStreaming||B(e)||e.startsWith("file://")||"function"!=typeof fetch?H(e,t,i):fetch(e,{credentials:"same-origin"}).then((n=>WebAssembly.instantiateStreaming(n,t).then(i,(function(n){return y("wasm streaming compile failed: "+n),y("falling back to ArrayBuffer instantiation"),H(e,t,i)}))))})(i,(function(i){t(i.instance)})).catch(e)}();var Me=t=>(Me=k.free)(t),$e=t=>($e=k.malloc)(t),Te=r._ma_device__on_notification_unlocked=t=>(Te=r._ma_device__on_notification_unlocked=k.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,i)=>(r._ma_malloc_emscripten=k.ma_malloc_emscripten)(t,i),r._ma_free_emscripten=(t,i)=>(r._ma_free_emscripten=k.ma_free_emscripten)(t,i);var Ae,Oe=r._ma_device_process_pcm_frames_capture__webaudio=(t,i,e)=>(Oe=r._ma_device_process_pcm_frames_capture__webaudio=k.ma_device_process_pcm_frames_capture__webaudio)(t,i,e),Se=r._ma_device_process_pcm_frames_playback__webaudio=(t,i,e)=>(Se=r._ma_device_process_pcm_frames_playback__webaudio=k.ma_device_process_pcm_frames_playback__webaudio)(t,i,e),Pe=()=>(Pe=k.__errno_location)(),Ee=t=>(Ee=k.__getTypeName)(t);function ze(){function t(){if(!Ae&&(Ae=!0,r.calledRun=!0,!S)){if(r.noFSInit||pt||(pt=!0,Yt(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Gt("stdin",r.stdin):Bt("/dev/tty","/dev/stdin"),r.stdout?Gt("stdout",null,r.stdout):Bt("/dev/tty","/dev/stdout"),r.stderr?Gt("stderr",null,r.stderr):Bt("/dev/tty1","/dev/stderr"),Nt("/dev/stdin",0),Nt("/dev/stdout",1),Nt("/dev/stderr",1)),Ct=!1,q(I),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();D.unshift(t)}q(D)}}if(!(0<R)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)L();q(z),0<R||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.__embind_initialize_bindings=()=>(r.__embind_initialize_bindings=k._embind_initialize_bindings)(),r.dynCall_iiji=(t,i,e,n,o)=>(r.dynCall_iiji=k.dynCall_iiji)(t,i,e,n,o),r.dynCall_jiji=(t,i,e,n,o)=>(r.dynCall_jiji=k.dynCall_jiji)(t,i,e,n,o),r.dynCall_iiiji=(t,i,e,n,o,s)=>(r.dynCall_iiiji=k.dynCall_iiiji)(t,i,e,n,o,s),r.dynCall_iij=(t,i,e,n)=>(r.dynCall_iij=k.dynCall_iij)(t,i,e,n),r.dynCall_jii=(t,i,e)=>(r.dynCall_jii=k.dynCall_jii)(t,i,e),r.dynCall_viijii=(t,i,e,n,o,s,a)=>(r.dynCall_viijii=k.dynCall_viijii)(t,i,e,n,o,s,a),r.dynCall_iiiiij=(t,i,e,n,o,s,a)=>(r.dynCall_iiiiij=k.dynCall_iiiiij)(t,i,e,n,o,s,a),r.dynCall_iiiiijj=(t,i,e,n,o,s,a,h,c)=>(r.dynCall_iiiiijj=k.dynCall_iiiiijj)(t,i,e,n,o,s,a,h,c),r.dynCall_iiiiiijj=(t,i,e,n,o,s,a,h,c,l)=>(r.dynCall_iiiiiijj=k.dynCall_iiiiiijj)(t,i,e,n,o,s,a,h,c,l),W=function t(){Ae||ze(),Ae||(W=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return ze(),t.ready})},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.25.7","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n.Animation});var n=e(4)},(t,i,e)=>{e.r(i),e.d(i,{Animation:()=>n});var n=function(){function t(t,i,e,n){this.animation=t,this.artboard=i,this.playing=n,this.loopCount=0,this.scrubTo=null,this.instance=new e.LinearAnimationInstance(t,i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.instance.time},set:function(t){this.instance.time=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"needsScrub",{get:function(){return null!==this.scrubTo},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){null===this.scrubTo?this.instance.advance(t):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},t.prototype.apply=function(t){this.instance.apply(t)},t.prototype.cleanup=function(){this.instance.delete()},t}()},(t,i,e)=>{e.r(i),e.d(i,{BLANK_URL:()=>r.BLANK_URL,registerTouchInteractions:()=>n.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var n=e(6),r=e(7)},(t,i,e)=>{e.r(i),e.d(i,{registerTouchInteractions:()=>n});var n=function(t){var i=t.canvas,e=t.artboard,n=t.stateMachines,r=void 0===n?[]:n,o=t.rive,s=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,c=void 0!==h&&h,l=t.layoutScaleFactor,u=void 0===l?1:l;if(!(i&&r.length&&t.renderer&&o&&e&&"undefined"!=typeof window))return null;var d=null,f=!1,p=function(t){if(f&&t instanceof MouseEvent)"mouseup"==t.type&&(f=!1);else{f=c&&"touchend"===t.type&&"touchstart"===d,d=t.type;var i=t.currentTarget.getBoundingClientRect(),n=function(t,i){var e,n;return["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(e=t.touches)||void 0===e?void 0:e.length)?(i||t.preventDefault(),{clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}):"touchend"===t.type&&(null===(n=t.changedTouches)||void 0===n?void 0:n.length)?{clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY}:{clientX:t.clientX,clientY:t.clientY}}(t,c),h=n.clientX,l=n.clientY;if(h||l){var p=h-i.left,v=l-i.top,b=o.computeAlignment(s,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},e.bounds,u),w=new o.Mat2D;b.invert(w);var g=new o.Vec2D(p,v),m=o.mapXY(w,g),y=m.x(),x=m.y();switch(m.delete(),w.delete(),g.delete(),b.delete(),t.type){case"mouseout":for(var k=0,_=r;k<_.length;k++)_[k].pointerMove(y,x);break;case"touchmove":case"mouseover":case"mousemove":for(var C=0,j=r;C<j.length;C++)j[C].pointerMove(y,x);break;case"touchstart":case"mousedown":for(var M=0,$=r;M<$.length;M++)$[M].pointerDown(y,x);break;case"touchend":case"mouseup":for(var T=0,A=r;T<A.length;T++)A[T].pointerUp(y,x)}}}}.bind(void 0);return i.addEventListener("mouseover",p),i.addEventListener("mouseout",p),i.addEventListener("mousemove",p),i.addEventListener("mousedown",p),i.addEventListener("mouseup",p),i.addEventListener("touchmove",p,{passive:c}),i.addEventListener("touchstart",p,{passive:c}),i.addEventListener("touchend",p),function(){i.removeEventListener("mouseover",p),i.removeEventListener("mouseout",p),i.removeEventListener("mousemove",p),i.removeEventListener("mousedown",p),i.removeEventListener("mouseup",p),i.removeEventListener("touchmove",p),i.removeEventListener("touchstart",p),i.removeEventListener("touchend",p)}}},(t,i,e)=>{e.r(i),e.d(i,{BLANK_URL:()=>c,sanitizeUrl:()=>l});var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,h=[".","/"],c="about:blank";function l(t){if(!t)return c;var i,e=(i=t,i.replace(s,"").replace(r,(function(t,i){return String.fromCharCode(i)}))).replace(o,"").replace(s,"").trim();if(!e)return c;if(function(t){return h.indexOf(t[0])>-1}(e))return e;var l=e.match(a);return l&&n.test(l[0])?c:e}}],i={};function e(n){var r=i[n];if(void 0!==r)return r.exports;var o=i[n]={exports:{}};return t[n](o,o.exports,e),o.exports}e.d=(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},e.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{e.r(n),e.d(n,{Alignment:()=>r,EventType:()=>w,Fit:()=>i,Layout:()=>f,LoopType:()=>g,Rive:()=>A,RiveEventType:()=>v,RiveFile:()=>T,RuntimeLoader:()=>p,StateMachineInput:()=>b,StateMachineInputType:()=>d,Testing:()=>P,decodeAudio:()=>E,decodeFont:()=>I,decodeImage:()=>z});var t,i,r,o=e(1),s=e(2),a=e(3),h=e(5),c=(t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)},function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t,i,e,n){return new(e||(e=Promise))((function(r,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(s,a)}h((n=n.apply(t,i||[])).next())}))},u=function(t,i){var e,n,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(h){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(e=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=i.call(t,o)}catch(t){a=[6,t],n=0}finally{e=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}};!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(i||(i={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var d,f=function(){function t(t){var e,n,o,s,a,h,c;this.fit=null!==(e=null==t?void 0:t.fit)&&void 0!==e?e:i.Contain,this.alignment=null!==(n=null==t?void 0:t.alignment)&&void 0!==n?n:r.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(s=null==t?void 0:t.minX)&&void 0!==s?s:0,this.minY=null!==(a=null==t?void 0:t.minY)&&void 0!==a?a:0,this.maxX=null!==(h=null==t?void 0:t.maxX)&&void 0!==h?h:0,this.maxY=null!==(c=null==t?void 0:t.maxY)&&void 0!==c?c:0}return t.new=function(i){var e=i.fit,n=i.alignment,r=i.minX,o=i.minY,s=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:e,alignment:n,minX:r,minY:o,maxX:s,maxY:a})},t.prototype.copyWith=function(i){var e=i.fit,n=i.alignment,r=i.layoutScaleFactor,o=i.minX,s=i.minY,a=i.maxX,h=i.maxY;return new t({fit:null!=e?e:this.fit,alignment:null!=n?n:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=s?s:this.minY,maxX:null!=a?a:this.maxX,maxY:null!=h?h:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=e=this.fit===i.Cover?t.Fit.cover:this.fit===i.Contain?t.Fit.contain:this.fit===i.Fill?t.Fit.fill:this.fit===i.FitWidth?t.Fit.fitWidth:this.fit===i.FitHeight?t.Fit.fitHeight:this.fit===i.ScaleDown?t.Fit.scaleDown:this.fit===i.Layout?t.Fit.layout:t.Fit.none,e);var e},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=i=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,i);var i},t}(),p=function(){function t(){}return t.loadRuntime=function(){o.default({locateFile:function(){return t.wasmURL}}).then((function(i){var e;for(t.runtime=i;t.callBackQueue.length>0;)null===(e=t.callBackQueue.shift())||void 0===e||e(t.runtime)})).catch((function(i){var e={message:(null==i?void 0:i.message)||"Unknown error",type:(null==i?void 0:i.name)||"Error",wasmError:i instanceof WebAssembly.CompileError||i instanceof WebAssembly.RuntimeError,originalError:i};console.debug("Rive WASM load error details:",e);var n="https://cdn.jsdelivr.net/npm/".concat(s.name,"@").concat(s.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==n)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(e.message,"), trying jsdelivr as a backup")),t.setWasmUrl(n),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(n,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(e.type),"- Message: ".concat(e.message),"- WebAssembly-specific error: ".concat(e.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(i){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?i(t.runtime):t.callBackQueue.push(i)},t.awaitInstance=function(){return new Promise((function(i){return t.getInstance((function(t){return i(t)}))}))},t.setWasmUrl=function(i){t.wasmURL=i},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(s.name,"@").concat(s.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(d||(d={}));var v,b=function(){function t(t,i){this.type=t,this.runtimeInput=i}return Object.defineProperty(t.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(t){this.runtimeInput.value=t},enumerable:!1,configurable:!0}),t.prototype.fire=function(){this.type===d.Trigger&&this.runtimeInput.fire()},t.prototype.delete=function(){this.runtimeInput=null},t}();!function(t){t[t.General=128]="General",t[t.OpenUrl=131]="OpenUrl"}(v||(v={}));var w,g,m=function(){function t(t,i,e,n){this.stateMachine=t,this.playing=e,this.artboard=n,this.inputs=[],this.instance=new i.StateMachineInstance(t,n),this.initInputs(i)}return Object.defineProperty(t.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"statesChanged",{get:function(){for(var t=[],i=0;i<this.instance.stateChangedCount();i++)t.push(this.instance.stateChangedNameByIndex(i));return t},enumerable:!1,configurable:!0}),t.prototype.advance=function(t){this.instance.advance(t)},t.prototype.advanceAndApply=function(t){this.instance.advanceAndApply(t)},t.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},t.prototype.reportedEventAt=function(t){return this.instance.reportedEventAt(t)},t.prototype.initInputs=function(t){for(var i=0;i<this.instance.inputCount();i++){var e=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(e,t))}},t.prototype.mapRuntimeInput=function(t,i){return t.type===i.SMIInput.bool?new b(d.Boolean,t.asBool()):t.type===i.SMIInput.number?new b(d.Number,t.asNumber()):t.type===i.SMIInput.trigger?new b(d.Trigger,t.asTrigger()):void 0},t.prototype.cleanup=function(){this.inputs.forEach((function(t){t.delete()})),this.inputs.length=0,this.instance.delete()},t}(),y=function(){function t(t,i,e,n,r){void 0===n&&(n=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=i,this.eventManager=e,this.animations=n,this.stateMachines=r}return t.prototype.add=function(t,i,e){if(void 0===e&&(e=!0),0===(t=S(t)).length)this.animations.forEach((function(t){return t.playing=i})),this.stateMachines.forEach((function(t){return t.playing=i}));else for(var n=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var s=n.indexOf(t[o]),h=r.indexOf(t[o]);if(s>=0||h>=0)s>=0?this.animations[s].playing=i:this.stateMachines[h].playing=i;else{var c=this.artboard.animationByName(t[o]);if(c){var l=new a.Animation(c,this.artboard,this.runtime,i);l.advance(0),l.apply(1),this.animations.push(l)}else{var u=this.artboard.stateMachineByName(t[o]);if(u){var d=new m(u,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return e&&this.eventManager.fire(i?{type:w.Play,data:this.playing}:{type:w.Pause,data:this.paused}),i?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,i){for(var e=this.animations.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.animations[r].playing=i;else{var o=this.artboard.animationByName(t[n]);if(o){var s=new a.Animation(o,this.artboard,this.runtime,i);s.advance(0),s.apply(1),this.animations.push(s)}}}},t.prototype.initStateMachines=function(t,i){for(var e=this.stateMachines.map((function(t){return t.name})),n=0;n<t.length;n++){var r=e.indexOf(t[n]);if(r>=0)this.stateMachines[r].playing=i;else{var o=this.artboard.stateMachineByName(t[n]);if(o){var s=new m(o,this.runtime,i,this.artboard);this.stateMachines.push(s)}else this.initLinearAnimations([t[n]],i)}}},t.prototype.play=function(t){return this.add(t,!0)},t.prototype.pause=function(t){return this.add(t,!1)},t.prototype.scrub=function(t,i){var e=this.animations.filter((function(i){return t.includes(i.name)}));return e.forEach((function(t){return t.scrubTo=i})),e.map((function(t){return t.name}))},Object.defineProperty(t.prototype,"playing",{get:function(){return this.animations.filter((function(t){return t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){return this.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})).concat(this.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})))},enumerable:!1,configurable:!0}),t.prototype.stop=function(t){var i=this,e=[];if(0===(t=S(t)).length)e=this.animations.map((function(t){return t.name})).concat(this.stateMachines.map((function(t){return t.name}))),this.animations.forEach((function(t){return t.cleanup()})),this.stateMachines.forEach((function(t){return t.cleanup()})),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var n=this.animations.filter((function(i){return t.includes(i.name)}));n.forEach((function(t){t.cleanup(),i.animations.splice(i.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(i){return t.includes(i.name)}));r.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),e=n.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:w.Stop,data:e}),e},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animations.reduce((function(t,i){return t||i.playing}),!1)||this.stateMachines.reduce((function(t,i){return t||i.playing}),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return 0===this.animations.length&&0===this.stateMachines.length},enumerable:!1,configurable:!0}),t.prototype.atLeastOne=function(t,i){var e;return void 0===i&&(i=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([e=this.artboard.animationByIndex(0).name],t,i):this.artboard.stateMachineCount()>0&&this.add([e=this.artboard.stateMachineByIndex(0).name],t,i)),e},t.prototype.handleLooping=function(){for(var t=0,i=this.animations.filter((function(t){return t.playing}));t<i.length;t++){var e=i[t];0===e.loopValue&&e.loopCount?(e.loopCount=0,this.stop(e.name)):1===e.loopValue&&e.loopCount?(this.eventManager.fire({type:w.Loop,data:{animation:e.name,type:g.Loop}}),e.loopCount=0):2===e.loopValue&&e.loopCount>1&&(this.eventManager.fire({type:w.Loop,data:{animation:e.name,type:g.PingPong}}),e.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],i=0,e=this.stateMachines.filter((function(t){return t.playing}));i<e.length;i++)t.push.apply(t,e[i].statesChanged);t.length>0&&this.eventManager.fire({type:w.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:w.Advance,data:t})},t}();!function(t){t.Load="load",t.LoadError="loaderror",t.Play="play",t.Pause="pause",t.Stop="stop",t.Loop="loop",t.Draw="draw",t.Advance="advance",t.StateChange="statechange",t.RiveEvent="riveevent",t.AudioStatusChange="audiostatuschange"}(w||(w={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(g||(g={}));var x,k=function(){function t(t){void 0===t&&(t=[]),this.listeners=t}return t.prototype.getListeners=function(t){return this.listeners.filter((function(i){return i.type===t}))},t.prototype.add=function(t){this.listeners.includes(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var i=0;i<this.listeners.length;i++){var e=this.listeners[i];if(e.type===t.type&&e.callback===t.callback){this.listeners.splice(i,1);break}}},t.prototype.removeAll=function(t){var i=this;t?this.listeners.filter((function(i){return i.type===t})).forEach((function(t){return i.remove(t)})):this.listeners.splice(0,this.listeners.length)},t.prototype.fire=function(t){this.getListeners(t.type).forEach((function(i){return i.callback(t)}))},t}(),_=function(){function t(t){this.eventManager=t,this.queue=[]}return t.prototype.add=function(t){this.queue.push(t)},t.prototype.process=function(){for(;this.queue.length>0;){var t=this.queue.shift();(null==t?void 0:t.action)&&t.action(),(null==t?void 0:t.event)&&this.eventManager.fire(t.event)}},t}();!function(t){t[t.AVAILABLE=0]="AVAILABLE",t[t.UNAVAILABLE=1]="UNAVAILABLE"}(x||(x={}));var C=new(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=x.UNAVAILABLE,i}return c(i,t),i.prototype.delay=function(t){return l(this,void 0,void 0,(function(){return u(this,(function(){return[2,new Promise((function(i){return setTimeout(i,t)}))]}))}))},i.prototype.timeout=function(){return l(this,void 0,void 0,(function(){return u(this,(function(){return[2,new Promise((function(t,i){return setTimeout(i,50)}))]}))}))},i.prototype.reportToListeners=function(){this.fire({type:w.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return l(this,void 0,void 0,(function(){return u(this,(function(){return this._enabled||(this._enabled=!0,this._status=x.AVAILABLE,this.reportToListeners()),[2]}))}))},i.prototype.testAudio=function(){return l(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:if(this._status!==x.UNAVAILABLE||null===this._audioContext)return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return t.sent(),this.enableAudio(),[3,4];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},i.prototype._establishAudio=function(){return l(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return this._started?[3,5]:(this._started=!0,"undefined"!=typeof window?[3,1]:(this.enableAudio(),[3,5]));case 1:this._audioContext=new AudioContext,this.listenForUserAction(),t.label=2;case 2:return this._status!==x.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return t.sent(),[4,this.delay(1e3)];case 4:return t.sent(),[3,2];case 5:return[2]}}))}))},i.prototype.listenForUserAction=function(){var t=this;document.addEventListener("pointerdown",(function(){return l(t,void 0,void 0,(function(){return u(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return l(this,void 0,void 0,(function(){return u(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===x.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(k)),j=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),M=globalThis.ResizeObserver||j,$=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var e=t._elementsMap.get(i.target);null!==e?e.onResize(0==i.target.clientWidth||0==i.target.clientHeight):t._resizeObserver.unobserve(i.target)},this._onObserved=function(i){i.forEach(t._onObservedEntry)},this._resizeObserver=new M(this._onObserved)}return t.prototype.add=function(t,i){var e={onResize:i,element:t};return this._elementsMap.set(t,e),this._resizeObserver.observe(t),e},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),T=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new k,t.onLoad&&this.on(w.Load,t.onLoad),t.onLoadError&&this.on(w.LoadError,t.onLoadError)}return t.prototype.initData=function(){return l(this,void 0,void 0,(function(){var i,e,n;return u(this,(function(r){switch(r.label){case 0:return this.src?(i=this,[4,O(this.src)]):[3,2];case 1:i.buffer=r.sent(),r.label=2;case 2:return this.assetLoader&&(e=new this.runtime.CustomFileAssetLoader({loadContents:this.assetLoader})),n=this,[4,this.runtime.load(new Uint8Array(this.buffer),e,this.enableRiveAssetCDN)];case 3:if(n.file=r.sent(),null===this.file)throw this.eventManager.fire({type:w.LoadError,data:null}),new Error(t.fileLoadErrorMessage);return this.eventManager.fire({type:w.Load,data:this}),[2]}}))}))},t.prototype.init=function(){return l(this,void 0,void 0,(function(){var i;return u(this,(function(e){switch(e.label){case 0:if(!this.src&&!this.buffer)throw new Error(t.missingErrorMessage);return i=this,[4,p.awaitInstance()];case 1:return i.runtime=e.sent(),[4,this.initData()];case 2:return e.sent(),[2]}}))}))},t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.cleanup=function(){var t;this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),null===(t=this.file)||void 0===t||t.delete())},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.getInstance=function(){if(null!==this.file)return this.referenceCount+=1,this.file},t.missingErrorMessage="Rive source file or data buffer required",t.fileLoadErrorMessage="The file failed to load",t}(),A=function(){function t(t){var i,e=this;this.loaded=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._audioEventListener=null,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(t){e._hasZeroSize=t,e._layout.maxX&&e._layout.maxY||e.resizeToCanvas()},this.renderSecondTimer=0,this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=$.add(this.canvas,this.onCanvasResize)),this.src=t.src,this.buffer=t.buffer,this.riveFile=t.riveFile,this.layout=null!==(i=t.layout)&&void 0!==i?i:new f,this.shouldDisableRiveListeners=!!t.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!t.isTouchScrollEnabled,this.automaticallyHandleEvents=!!t.automaticallyHandleEvents,this.enableRiveAssetCDN=void 0===t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new k,t.onLoad&&this.on(w.Load,t.onLoad),t.onLoadError&&this.on(w.LoadError,t.onLoadError),t.onPlay&&this.on(w.Play,t.onPlay),t.onPause&&this.on(w.Pause,t.onPause),t.onStop&&this.on(w.Stop,t.onStop),t.onLoop&&this.on(w.Loop,t.onLoop),t.onStateChange&&this.on(w.StateChange,t.onStateChange),t.onAdvance&&this.on(w.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(w.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(w.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(w.Play,t.onplay),t.onpause&&!t.onPause&&this.on(w.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(w.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(w.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(w.StateChange,t.onstatechange),t.assetLoader&&(this.assetLoader=t.assetLoader),this.taskQueue=new _(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:t.autoplay,animations:t.animations,stateMachines:t.stateMachines,artboard:t.artboard,useOffscreenRenderer:t.useOffscreenRenderer})}return t.new=function(i){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new t(i)},t.prototype.onSystemAudioChanged=function(){this.volume=this._volume},t.prototype.init=function(i){var e=this,n=i.buffer,r=i.riveFile,o=i.animations,s=i.stateMachines,a=i.artboard,h=i.autoplay,c=void 0!==h&&h,l=i.useOffscreenRenderer,u=void 0!==l&&l;if(this.src=i.src,this.buffer=n,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new Error(t.missingErrorMessage);var d=S(o),f=S(s);this.loaded=!1,this.readyForPlaying=!1,p.awaitInstance().then((function(t){e.runtime=t,e.removeRiveListeners(),e.deleteRiveRenderer(),e.renderer=e.runtime.makeRenderer(e.canvas,u),e.canvas.width||e.canvas.height||e.resizeDrawingSurfaceToCanvas(),e.initData(a,d,f,c).then((function(){return e.setupRiveListeners()})).catch((function(t){console.error(t)}))})).catch((function(t){console.error(t)}))},t.prototype.setupRiveListeners=function(t){var i=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var e=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&i.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),n=this.isTouchScrollEnabled;t&&"isTouchScrollEnabled"in t&&(n=t.isTouchScrollEnabled),this.eventCleanup=(0,h.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:e,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:n,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,i=this;C.status==x.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:w.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},C.add(this._audioEventListener),C.establishAudio())},t.prototype.initArtboardSize=function(){this.artboard&&(this._artboardWidth=this.artboard.width=this._artboardWidth||this.artboard.width,this._artboardHeight=this.artboard.height=this._artboardHeight||this.artboard.height)},t.prototype.initData=function(t,i,e,n){return l(this,void 0,void 0,(function(){var r,o;return u(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(this.riveFile=new T({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),[4,this.riveFile.init()]);case 1:s.sent(),s.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,i,e,n),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:w.Load,data:null!==(o=this.src)&&void 0!==o?o:"buffer"}),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,Promise.resolve()];case 3:return s.sent(),r="Problem loading file; may be corrupt!",console.warn(r),this.eventManager.fire({type:w.LoadError,data:r}),[2,Promise.reject(r)];case 4:return[2]}}))}))},t.prototype.initArtboard=function(t,i,e,n){if(this.file){var r,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var s="Invalid artboard name or no default artboard";return console.warn(s),void this.eventManager.fire({type:w.LoadError,data:s})}if(this.artboard=o,o.volume=this._volume*C.systemVolume,this.artboard.animationCount()<1)throw this.eventManager.fire({type:w.LoadError,data:s="Artboard has no animations"}),s;this.animator=new y(this.runtime,this.artboard,this.eventManager),i.length>0||e.length>0?(r=i.concat(e),this.animator.initLinearAnimations(i,n),this.animator.initStateMachines(e,n)):r=[this.animator.atLeastOne(n,!1)],this.taskQueue.add({event:{type:n?w.Play:w.Pause,data:r}})}},t.prototype.drawFrame=function(){this.startRendering()},t.prototype.draw=function(t,i){this.frameRequestId=null;var e=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==i||i());var n=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var r=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));r<o.length;r++){var s=o[r];s.advance(n),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var a=0,c=this.animator.stateMachines.filter((function(t){return t.playing}));a<c.length;a++){var l=c[a],u=l.reportedEventCount();if(u)for(var d=0;d<u;d++){var f=l.reportedEventAt(d);if(f)if(f.type===v.OpenUrl){if(this.eventManager.fire({type:w.RiveEvent,data:f}),this.automaticallyHandleEvents){var p=document.createElement("a"),b=f.url,g=f.target,m=(0,h.sanitizeUrl)(b);b&&p.setAttribute("href",m),g&&p.setAttribute("target",g),m&&m!==h.BLANK_URL&&p.click()}}else this.eventManager.fire({type:w.RiveEvent,data:f})}l.advanceAndApply(n)}0==this.animator.stateMachines.length&&this.artboard.advance(n);var y=this.renderer;y.clear(),y.save(),this.alignRenderer(),this._hasZeroSize||this.artboard.draw(y),y.restore(),y.flush(),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(n),this.frameCount++;var x=performance.now();for(this.frameTimes.push(x),this.durations.push(x-e);this.frameTimes[0]<=x-1e3;)this.frameTimes.shift(),this.durations.shift();this.animator.isPlaying?this.startRendering():(this.animator.isPaused||this.animator.isStopped)&&(this.lastRenderTime=0)},t.prototype.alignRenderer=function(){var t=this,i=t.runtime,e=t._layout,n=t.artboard;t.renderer.align(e.runtimeFit(i),e.runtimeAlignment(i),{minX:e.minX,minY:e.minY,maxX:e.maxX,maxY:e.maxY},n.bounds,this._devicePixelRatioUsed*e.layoutScaleFactor)},Object.defineProperty(t.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"frameTime",{get:function(){return 0===this.durations.length?0:(this.durations.reduce((function(t,i){return t+i}),0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),t.prototype.cleanup=function(){var t;this.stopRendering(),this.cleanupInstances(),null!==this._observed&&$.remove(this._observed),this.removeRiveListeners(),null===(t=this.riveFile)||void 0===t||t.cleanup(),this.riveFile=null,this.file=null,this.deleteRiveRenderer(),null!==this._audioEventListener&&(C.remove(this._audioEventListener),this._audioEventListener=null)},t.prototype.deleteRiveRenderer=function(){var t;null===(t=this.renderer)||void 0===t||t.delete(),this.renderer=null},t.prototype.cleanupInstances=function(){null!==this.eventCleanup&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},t.prototype.retrieveTextRun=function(t){var i;if(t)if(this.artboard){var e=this.artboard.textRun(t);if(e)return e;console.warn("Could not access a text run with name '".concat(t,"' in the '").concat(null===(i=this.artboard)||void 0===i?void 0:i.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."))}else console.warn("Tried to access text run, but the Artboard is null");else console.warn("No text run name provided")},t.prototype.getTextRunValue=function(t){var i=this.retrieveTextRun(t);return i?i.text:void 0},t.prototype.setTextRunValue=function(t,i){var e=this.retrieveTextRun(t);e&&(e.text=i)},t.prototype.play=function(t,i){var e=this;t=S(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return e.play(t,i)}})},t.prototype.pause=function(t){var i=this;t=S(t),this.readyForPlaying?(this.eventCleanup&&this.eventCleanup(),this.animator.pause(t)):this.taskQueue.add({action:function(){return i.pause(t)}})},t.prototype.scrub=function(t,i){var e=this;t=S(t),this.readyForPlaying?(this.animator.scrub(t,i||0),this.drawFrame()):this.taskQueue.add({action:function(){return e.scrub(t,i)}})},t.prototype.stop=function(t){var i=this;t=S(t),this.readyForPlaying?(this.animator&&this.animator.stop(t),this.eventCleanup&&this.eventCleanup()):this.taskQueue.add({action:function(){return i.stop(t)}})},t.prototype.reset=function(t){var i,e=null==t?void 0:t.artboard,n=S(null==t?void 0:t.animations),r=S(null==t?void 0:t.stateMachines),o=null!==(i=null==t?void 0:t.autoplay)&&void 0!==i&&i;this.cleanupInstances(),this.initArtboard(e,n,r,o),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var e=this.canvas.getBoundingClientRect(),n=e.width,r=e.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*n,this.canvas.height=o*r,this.startRendering(),this.resizeToCanvas(),this.layout.fit===i.Layout){var s=this._layout.layoutScaleFactor;this.artboard.width=n/s,this.artboard.height=r/s}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.animationCount();i++)t.push(this.artboard.animationByIndex(i).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.stateMachineCount();i++)t.push(this.artboard.stateMachineByIndex(i).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var i=this.animator.stateMachines.find((function(i){return i.name===t}));return null==i?void 0:i.inputs}},t.prototype.retrieveInputAtPath=function(t,i){if(t)if(this.artboard){var e=this.artboard.inputByPath(t,i);if(e)return e;console.warn("Could not access an input with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access input: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No input name provided for path '".concat(i,"'"))},t.prototype.setBooleanStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===d.Boolean?n.asBool().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,i,e){var n=this.retrieveInputAtPath(t,e);n&&(n.type===d.Number?n.asNumber().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(e,"' is not a number")))},t.prototype.fireStateAtPath=function(t,i){var e=this.retrieveInputAtPath(t,i);e&&(e.type===d.Trigger?e.asTrigger().fire():console.warn("Input with name: '".concat(t,"', at path:'").concat(i,"' is not a trigger")))},t.prototype.retrieveTextAtPath=function(t,i){if(t)if(i)if(this.artboard){var e=this.artboard.textByPath(t,i);if(e)return e;console.warn("Could not access text with name: '".concat(t,"', at path:'").concat(i,"'"))}else console.warn("Tried to access text: '".concat(t,"', at path: '").concat(i,"', but the Artboard is null"));else console.warn("No path provided for text '".concat(t,"'"));else console.warn("No text name provided for path '".concat(i,"'"))},t.prototype.getTextRunValueAtPath=function(t,i){var e=this.retrieveTextAtPath(t,i);if(e)return e.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(i,"'"))},t.prototype.setTextRunValueAtPath=function(t,i,e){var n=this.retrieveTextAtPath(t,e);n?n.text=i:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(e,"'"))},Object.defineProperty(t.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter((function(t){return!t.playing})).map((function(t){return t.name})):[]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){this.eventManager.add({type:t,callback:i})},t.prototype.off=function(t,i){this.eventManager.remove({type:t,callback:i})},t.prototype.unsubscribe=function(t,i){console.warn("This function is deprecated: please use `off()` instead."),this.off(t,i)},t.prototype.removeAllRiveEventListeners=function(t){this.eventManager.removeAll(t)},t.prototype.unsubscribeAll=function(t){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(t)},t.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},t.prototype.startRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.frameRequestId=this.runtime.requestAnimationFrame?this.runtime.requestAnimationFrame(this.draw.bind(this)):requestAnimationFrame(this.draw.bind(this)))},t.prototype.enableFPSCounter=function(t){this.runtime.enableFPSCounter(t)},t.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(t.prototype,"contents",{get:function(){if(this.loaded){for(var t={artboards:[]},i=0;i<this.file.artboardCount();i++){for(var e=this.file.artboardByIndex(i),n={name:e.name,animations:[],stateMachines:[]},r=0;r<e.animationCount();r++){var o=e.animationByIndex(r);n.animations.push(o.name)}for(var s=0;s<e.stateMachineCount();s++){for(var a=e.stateMachineByIndex(s),h=a.name,c=new this.runtime.StateMachineInstance(a,e),l=[],u=0;u<c.inputCount();u++){var d=c.input(u);l.push({name:d.name,type:d.type})}n.stateMachines.push({name:h,inputs:l})}t.artboards.push(n)}return t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(t){this._volume=t,this.artboard&&(this.artboard.volume=t*C.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.missingErrorMessage="Rive source file or data buffer required",t}(),O=function(t){return l(void 0,void 0,void 0,(function(){var i;return u(this,(function(e){switch(e.label){case 0:return i=new Request(t),[4,fetch(i)];case 1:return[4,e.sent().arrayBuffer()];case 2:return[2,e.sent()]}}))}))},S=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},P={EventManager:k,TaskQueueManager:_},E=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeAudio(t,i)}))}))},z=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeImage(t,i)}))}))},I=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeFont(t,i)}))}))}})(),n})(),G.exports=Y();const V=class{constructor(i){t(this,i),this.initializeRive=t=>{const i=l.getInstance(),e=this.el.querySelector("canvas");this.riveInstance=new G.exports.Rive({src:t,canvas:e,stateMachines:"Idle",autoplay:!0,onLoad:()=>{this.riveInstance.resizeDrawingSurfaceToCanvas(),i.setRiveInstance(this.riveInstance)}})},this.id="",this.value="",this.height="",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.src="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.delayVisible=""}async componentDidLoad(){G.exports.RuntimeLoader.setWasmUrl(i("./rive.wasm")),a(this.el,this.delayVisible),h(this.el,this.type),this.initializeRive(c(this.src))}render(){return e(n,{key:"0889129b1e69b8966dec70f6364c602cadce10ef",id:this.id,type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,backgroundColor:this.bgColor,top:this.y,left:this.x,display:this.visible?"flex":"none",zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},e("canvas",{key:"975318180c4454f81d307accd823e2eaaeddf6cc",class:"lido-canvas"}))}get el(){return r(this)}};V.style=".lido-canvas{height:100%;width:100%}";const q=class{constructor(i){t(this,i),this.currentAngle=0,this.pivotimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg",this.scaleimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg",this.handlerimage="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg",this.fill="brown",this.tilt=0,this.maxTilt=9.5,this.onEntry="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.visible=!1,this.margin="",this.padding="",this.balanceSymbol="=",this.showSymbol=!1,this.operation="count",this.pivotSvg="",this.scaleSvg="",this.handlerSvg="",this.style={},this.tiltf=0,this.leftVal=0,this.rightVal=0}async revealSymbol(){this.showSymbol=!0}async hideSymbol(){this.showSymbol=!1}async componentWillLoad(){this.updateStyles(),this.pivotSvg=await this.fetchAndApplyFill(this.pivotimage),this.scaleSvg=await this.fetchAndApplyFill(this.scaleimage),this.handlerSvg=await this.fetchAndApplyFill(this.handlerimage)}componentDidLoad(){setTimeout((()=>{this.animateBalance()}),4e3),this.leftParentEl=document.getElementById("leftparent"),this.rightParentEl=document.getElementById("rightparent"),h(this.el)}disconnectedCallback(){null!=this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}async fetchAndApplyFill(t){try{const i=await fetch(t);if(!i.ok)return"";let e=await i.text();return e=e.replace(/fill="[^"]*"/g,""),e=e.replace(/stroke="[^"]*"/g,""),e=e.replace(/<svg([^>]*)>/,`<svg$1 fill="${this.fill}" stroke="${this.fill}">`),e}catch(t){return console.error("SVG fetch failed:",t),""}}tiltChanged(t){this.tiltf=t}async updateTilt(t,i){const e=Math.max(-5,Math.min(5,i-t));this.tiltf=e}animateBalance(){const t=()=>{let i=this.tiltf/5*this.maxTilt;if(i>this.maxTilt&&(i=this.maxTilt),i<-this.maxTilt&&(i=-this.maxTilt),this.currentAngle+=.1*(i-this.currentAngle),this.currentAngle>this.maxTilt&&(this.currentAngle=this.maxTilt),this.currentAngle<-this.maxTilt&&(this.currentAngle=-this.maxTilt),this.scaleEl&&(this.scaleEl.style.transform=`rotate(${this.currentAngle}deg)`,this.scaleEl.style.transformOrigin="50% 80%"),this.leftParentEl&&this.rightParentEl){const t=this.currentAngle/this.maxTilt*60;this.leftParentEl.style.transform=`translateY(${-t}px)`,this.rightParentEl.style.transform=`translateY(${t}px)`}if(this.leftHandleEl&&this.rightHandleEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftHandleEl.style.transform=`translateY(${-i}px)`,this.rightHandleEl.style.transform=`translateY(${i}px)`}this.animationFrameId=requestAnimationFrame(t)};t()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:"true"===u(`${this.visible}`,t)?"flex":"none",margin:u(this.margin,t),padding:u(this.padding,t)}}render(){return e(n,{key:"868cc05ae503a6e04039c615815102470eb402d4",id:"lido-balance",onEntry:this.onEntry,class:"lido-balance",tilt:this.tilt.toString(),style:this.style,operation:this.operation.toString()},e("div",{key:"2627a49d1ad5045bd9a3ac217354c9be98f1f52b",innerHTML:this.pivotSvg,id:"pivotimg",class:"pivot"}),e("div",{key:"c5b2432f5e3c62ebbb7f17146f18e22e7e2b29bb",innerHTML:this.scaleSvg,id:"scaleimg",class:"scale",ref:t=>this.scaleEl=t}),e("div",{key:"d5e8051aedb784189f19a1e7b0dfd645e95ed4a5",innerHTML:this.handlerSvg,id:"handlerimg",class:"handler",ref:t=>this.leftHandleEl=t}),e("div",{key:"3779886d4fc8dfadc0791f69cb87df78d5f843c8",innerHTML:this.handlerSvg,id:"handimg",class:"hand",ref:t=>this.rightHandleEl=t}),e("div",{key:"df5d4094c302548bf64f166643a3f05d262d95b1",id:"balanceSymbol",class:"lido-balance-symbol","aria-hidden":!this.showSymbol},this.showSymbol?this.balanceSymbol:""))}get el(){return r(this)}static get watchers(){return{tilt:["tiltChanged"]}}};q.style='#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}';const K=class{constructor(i){t(this,i),this.onOk=o(this,"onOk",7),this.userAnswers=[],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/Pen--Streamline-Solar%201.svg",this.displayValue="",this.style={}}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<10&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){const t=this.displayValue.trim();if(!t)return;let i=!1;const e=this.el.closest("lido-container");if(e){if(this.objective&&1===this.objective.length)i=t===this.objective;else if(this.objective&&this.objective.includes(",")){const n="true"===e.getAttribute("is-continue-on-correct"),r=this.objective.split(",").map((t=>t.trim())),o=this.userAnswers.length;i=o<r.length&&Number(t)===Number(r[o]),n?i&&this.userAnswers.push(Number(t)):this.userAnswers.push(Number(t))}else if(""===this.objective){const n=e.getAttribute("equationCheck")||"";if(!n)return;try{const e=d(n);i=Number(e)===Number(t.trim()),console.log("Equation check:",e,t,i)}catch(t){console.error("Error evaluating equation:",t),i=!1}}if(this.onOk.emit(i),i){this.displayValue="",f(i);const t=(null==e?void 0:e.getAttribute("onCorrect"))||"";await p(t,e),0===this.objective.length&&window.dispatchEvent(new CustomEvent(v))}else{this.displayValue="",f(i);const t=(null==e?void 0:e.getAttribute("onInCorrect"))||"";await p(t,e)}}}render(){return e(n,{key:"61d14ce0ff858db8ff04b502c0d303f18f5552b8",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},e("lido-cell",{key:"86318d0fb2a707af14fca1b1a615536e7bcdb9a3",visible:"true",height:"94px",width:"60px"},e("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"},e("img",{key:"46f9003a72906617169fb76b19a208e6f6cbb0bc",src:this.penIcon,alt:"pen",style:{width:"100%",height:"100%"}}))),e("div",{key:"a7ffc6dbdaabfa944e115eeecf08cc53808c0234",class:"lido-calculator-displayParent"},e("div",{key:"27926d1370cbdd4423404ad1f78b1ade381288d9",class:"lido-calculator-display"},this.displayValue)),e("div",{key:"58288a987ea3090da498fff03220d4d4b24aa7c5",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,i)=>e("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 r(this)}};K.style="#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)}";const J=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.scrollbarWidth="",this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.gap="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible="false",this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.childElementsLength=9999,this.minLength=0,this.maxLength=9999,this.layout="wrap",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.alignItems="",this.borderRadius="0px",this.flexDirection="",this.style={},this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),b(this.el,this.minLength,this.maxLength,this.childElementsLength),setTimeout((()=>{const t=this.el.className.includes("lido-random")?this.el:null;if(t){const i=t.parentElement;if(!i)return;const e=i.offsetWidth,n=i.offsetHeight;Array.from(t.children).forEach((t=>{const i=e-t.offsetWidth,r=n-t.offsetHeight,o=Math.random()*i,s=Math.random()*r;t.style.position="absolute",t.style.left=`${o}px`,t.style.top=`${s}px`}))}}),50),this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,margin:u(this.margin,t),padding:u(this.padding,t),borderRadius:u(this.borderRadius,t),gap:u(this.gap,t),"--scrollbar-width":u(this.scrollbarWidth||"0px",t),display:JSON.parse(u(`${this.visible}`,t))?"wrap"===u(this.layout,t)?"grid":"pos"===u(this.layout,t)||"random"===u(this.layout,t)?"block":"flex":"none",flexDirection:this.flexDirection?u(this.flexDirection,t):"",alignItems:this.alignItems?u(this.alignItems,t):""},this.el.className=`lido-${u(this.layout,t)}`}render(){return e(n,{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},e("slot",{key:"33fbb691c5c8f015bc9c6cf1e86c237758f126c3"}))}get el(){return r(this)}};J.style=".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}";const Q=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id=void 0,this.value=void 0,this.height=void 0,this.width=void 0,this.ariaLabel=void 0,this.ariaHidden=void 0,this.x=void 0,this.y=void 0,this.z=void 0,this.bgColor=void 0,this.type=void 0,this.tabIndex=void 0,this.visible=void 0,this.audio=void 0,this.onTouch=void 0,this.onInCorrect=void 0,this.onCorrect=void 0,this.onEntry=void 0,this.childElementsLength=void 0,this.minLength=void 0,this.maxLength=void 0,this.direction=void 0,this.borderImage=void 0,this.boxShadow=void 0,this.minDrops=1,this.maxDrops=1,this.margin="",this.style={}}componentDidLoad(){h(this.el,this.type),b(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=this.borderImage?c(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,i),width:u(this.width,i),backgroundColor:u(this.bgColor,i),top:u(this.y,i),left:u(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?u(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:u(this.margin,i)}}render(){return e(n,{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},e("slot",{key:"c3bc168ccccacf1425b5d93853bc27ab2962436f"}))}get el(){return r(this)}};Q.style=".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>*{}";const Z=class{constructor(i){t(this,i),this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.exitButtonUrl=void 0,this.prevButtonUrl=void 0,this.nextButtonUrl=void 0,this.speakerButtonUrl=void 0,this.showPrevButton="false",this.showNextButton="false",this.delayVisible="",this.disableSpeak=!1}convertToPixels(t,i=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const e=document.createElement("div");e.style.position="absolute",e.style.visibility="hidden",e.style.height=t,i.appendChild(e);const n=e.offsetHeight;return i.removeChild(e),n}scaleContainer(t){t.style.transform=`translate(-50%, -50%) scale(${g()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?c(this.bgImage):"";if(document.body.style.backgroundColor=this.bgColor,document.body.style.backgroundImage=t?`url(${t})`:"none",document.body.style.backgroundPosition=t?"bottom":"none",window.addEventListener("resize",(()=>this.scaleContainer(this.el))),window.addEventListener("load",(()=>this.scaleContainer(this.el))),h(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}}disconnectedCallback(){window.removeEventListener("resize",(()=>this.scaleContainer(this.el))),window.removeEventListener("load",(()=>this.scaleContainer(this.el))),document.body.style.backgroundColor="",document.body.style.backgroundImage=""}render(){const t={backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin,userSelect:"none"};return console.log("🚀 ~ LidoContainer ~ canplay:",this.canplay),e(n,{key:"1f61c4443b96466e2802b5550e8d999319b41ce7",id:"lido-container","tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:t,"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},e("slot",{key:"2df61e731d3a9de3fd9cdb23f47035ee2e35c30a"}))}get el(){return r(this)}};Z.style=".lido-container{position:relative;height:100%;width:100%;background-color:var(--bgColor, transparent);display:flex;flex-direction:column;justify-content:center;align-items:center}";const tt=class{constructor(i){t(this,i),this.updateStyles=()=>{const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t)||"200px",width:u(this.width,t)||"200px",backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:this.visible?this.display?u(this.display,t):"inline-block":"none",flexDirection:this.direction?u(this.direction,t):void 0,margin:u(this.margin,t)}},this.handleFlip=()=>{this.flipped=!this.flipped},this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!0,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.direction=void 0,this.display=void 0,this.front=void 0,this.back=void 0,this.flipped=!1,this.margin="",this.disableSpeak=!1,this.style={},this.delayVisible=""}handleFlippedChange(){}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles),window.addEventListener("load",this.updateStyles)}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type)}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles),window.removeEventListener("load",this.updateStyles)}render(){return e(n,{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},e("div",{key:"d799a3525d9af4ba98d7750a3a76a313dd9cdd76",class:"card "+(this.flipped?"flipped":"")},e("div",{key:"fb7734ca5648e2cf8a91d551b383a5c2c3eae255",class:"card-face card-front"},null!=this.front?this.front:e("slot",{name:"front"})),e("div",{key:"6071da403b17a079f80f0c5dd576dac7b5a2c357",class:"card-face card-back"},null!=this.back?this.back:e("slot",{name:"back"}))))}get el(){return r(this)}static get watchers(){return{flipped:["handleFlippedChange"]}}};tt.style=".card{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform 0.6s ease;cursor:pointer}.card.flipped{transform:rotateY(180deg)}.card-face{position:absolute;width:100%;height:100%;backface-visibility:hidden;display:flex;align-items:center;justify-content:center}.card-back{transform:rotateY(180deg)}";const it=class{constructor(i){t(this,i),this.id="",this.value="",this.z="0",this.tabIndex=0,this.visible=!1,this.onEntry="",this.width=void 0,this.height=void 0,this.bgColor=void 0,this.type=void 0,this.delayVisible="",this.floatDirection="bottomToTop",this.style=void 0}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.initializeFloatElement()}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}initializeFloatElement(){Array.from(this.el.children).forEach((t=>{const i=t;m(i),t.addEventListener("click",(()=>{y(i)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:"leftToRight"!==this.floatDirection?"100%":u(this.height,t),width:"leftToRight"===this.floatDirection?"100%":u(this.width,t),backgroundColor:u(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return e(n,{key:"b4c271689b52272251d5623e53b67ef78389c012",class:"lido-float","float-direction":this.floatDirection,id:this.id,"tab-index":this.tabIndex,style:this.style,onEntry:this.onEntry},e("slot",{key:"852149328b2a8e85e84fdf9e2a4a64bb2ec8ad3a"}))}get el(){return r(this)}};it.style=".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:var(--el-top)}to{top:-500px}}#removeShadow{box-shadow:unset !important}@keyframes float-lr{from{right:var(--el-left)}to{right:-500px}}";const et=class{constructor(i){t(this,i),this.NextContainerKey=t=>{var i,e;console.log("🚀 ~ LidoHome ~ NextContainerKey ~","ths uuid",this.uuid,"doc uuid",document.querySelector("lido-home").getAttribute("uuid"),"are both equal : ",this.uuid===(null===(i=document.querySelector("lido-home"))||void 0===i?void 0:i.getAttribute("uuid"))),this.uuid===(null===(e=document.querySelector("lido-home"))||void 0===e?void 0:e.getAttribute("uuid"))&&(null!=t&&t==this.currentContainerIndex||(null!=t&&t<this.containers.length?(this.currentContainerIndex=t,console.log("container index ; ",this.currentContainerIndex),x(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,x(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(localStorage.removeItem(k),_(),this.currentContainerIndex=null),this.containers=[...this.containers],this.updateArrowVisibility()))},this.PrevContainerKey=t=>{console.log("👉 PrevContainerKey CALLED with index:",t),this.currentContainerIndex<=0||(this.currentContainerIndex--,x(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.updateArrowVisibility=()=>{setTimeout((()=>{const t=this.el.querySelector("lido-container");if(!t)return;const i=t.getAttribute("show-prev-button"),e=t.getAttribute("show-next-button"),n=this.el.querySelector("#lido-arrow-right");this.el.querySelector("#lido-arrow-left").style.visibility="true"!==i?"hidden":"visible","true"!==e?n.style.visibility="hidden":(n.style.pointerEvents="auto",n.style.visibility="visible")}),100)},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(C(),j.getI().stop(),localStorage.removeItem(k),i.remove(),this.currentContainerIndex=0):i.remove())},this.xmlData="",this.initialIndex=0,this.canplay=!0,this.baseUrl="",this.height="",this.exitButtonUrl=void 0,this.prevButtonUrl=void 0,this.nextButtonUrl=void 0,this.speakerButtonUrl=void 0,this.avatarUrl=void 0,this.uuid=M(),this.navBarIcons=void 0,this.currentContainerIndex=this.initialIndex,this.exitFlag=!1,this.containers=[],this.showDotsandbtn=!1}componentWillLoad(){this.navBarIcons={exit:this.exitButtonUrl||$,prev:this.prevButtonUrl||T,next:this.nextButtonUrl||A,speak:this.speakerButtonUrl||O},0===this.currentContainerIndex&&localStorage.removeItem(k),window.addEventListener(v,(()=>{this.NextContainerKey()})),window.addEventListener(S,(()=>{this.PrevContainerKey()})),window.addEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),this.parseXMLData(this.xmlData),window.addEventListener("beforeunload",(()=>{j.getI().stop(),localStorage.removeItem(k)}))}componentDidLoad(){setTimeout((()=>{this.showDotsandbtn=!0}),10),this.updateArrowVisibility(),this.scaleNavbarContainer(),this.currentContainerIndex=0,this.handleIcons(),window.addEventListener("resize",(()=>{this.scaleNavbarContainer()}))}async handleIcons(){var t;const i=async(t,i,e)=>t?c(t):i?c(i):null!=e&&e,e=document.getElementById(P),n=e.getAttribute("exit-button-url"),r=e.getAttribute("prev-button-url"),o=e.getAttribute("next-button-url"),s=null!==(t=e.getAttribute("speak-button-url"))&&void 0!==t?t:e.getAttribute("speaker-button-url");this.navBarIcons={exit:`${await i(this.exitButtonUrl,n,$)}`,prev:`${await i(this.prevButtonUrl,r,T)}`,next:`${await i(this.nextButtonUrl,o,A)}`,speak:`${await i(this.speakerButtonUrl,s,O)}`}}updateBackgroundImage(){const t=document.querySelector(P),i=t.getAttribute("bg-image");document.body.style.background="none",t.style.backgroundImage=i?`url(${i})`:"none",t.style.backgroundPosition=i?"bottom":"none",setTimeout((()=>{const i=document.querySelector(".lido-dot-container");i.classList.add("nav-for-lanai"),t.append(i)}),50)}disconnectedCallback(){window.removeEventListener(v,(()=>{this.NextContainerKey()})),window.removeEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),window.removeEventListener(S,(()=>{this.PrevContainerKey()})),window.removeEventListener("resize",(()=>{this.scaleNavbarContainer()}))}parseXMLData(t){if(t){const i=(new DOMParser).parseFromString(t,"text/xml");this.parseContainers(i.documentElement)}}onXmlDataChange(t){this.parseXMLData(t)}parseElement(t){const i=t.nodeName.toLowerCase(),n={};Array.from(t.attributes).forEach((t=>{n[t.name]=t.value}));const r=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean),o={"lido-container":e("lido-container",Object.assign({},n,{canplay:this.canplay,baseUrl:this.baseUrl,height:this.height}),r),"lido-flash-card":e("lido-flash-card",Object.assign({},n),r),"lido-col":e("lido-col",Object.assign({},n),r),"lido-trace":e("lido-trace",Object.assign({},n),r),"lido-image":e("lido-image",Object.assign({},n),r),"lido-row":e("lido-row",Object.assign({},n),r),"lido-text":e("lido-text",Object.assign({},n),r),"lido-pos":e("lido-pos",Object.assign({},n),r),"lido-shape":e("lido-shape",Object.assign({},n),r),"lido-wrap":e("lido-wrap",Object.assign({},n),r),"lido-random":e("lido-random",Object.assign({},n),r),"lido-avatar":e("lido-avatar",Object.assign({},n),r),"lido-cell":e("lido-cell",Object.assign({},n),r),"lido-slide-fill":e("lido-slide-fill",Object.assign({},n),r),"lido-float":e("lido-float",Object.assign({},n),r),"lido-keyboard":e("lido-keyboard",Object.assign({},n),r),"lido-math-matrix":e("lido-math-matrix",Object.assign({},n),r),"lido-balance":e("lido-balance",Object.assign({},n),r),"lido-calculator":e("lido-calculator",Object.assign({},n),r)};return o[i]?o[i]:(console.warn(`Unknown tag: ${i}`),null)}parseContainers(t){const i=t.querySelectorAll("lido-container"),e=Array.from(i).map((t=>()=>this.parseElement(t)));this.containers=e}async btnpopup(){I(!1),await j.getI().stop();const t=document.getElementById(P).querySelectorAll("*");for(const i of Array.from(t)){if(E())break;const t=i.getAttribute("tab-index"),e=i;if(t&&Number(t)>0){if(await j.getI().play(e),E()){await j.getI().stop();break}await new Promise((t=>setTimeout(t,300)))}}}scaleNavbarContainer(){setTimeout((()=>{const t=document.querySelector(".lido-dot-container");t&&((1600===window.innerWidth&&900===window.innerHeight||900===window.innerWidth&&1600===window.innerHeight)&&document.querySelectorAll(".lido-exit-button, #main-audio").forEach((t=>{t.style.marginLeft="10px",t.style.marginRight="10px"})),t.style.top=window.innerWidth>window.innerHeight?"6%":"3.5%",t.style.transform="translate(-50%, -50%)",t.style.visibility="visible",Array.from(t.children).forEach((t=>{t.style.transform=`scale(${g()})`})),t.style.width=window.outerWidth+"px")}),700)}renderDots(){const t={pointerEvents:this.canplay?"none":""};return e("div",{id:"lido-dot-indicator",class:"lido-dot-container"},e("div",{class:"lido-exit-button popup\n -button",onClick:()=>{this.exitFlag=!0,j.getI().stop()}},e("lido-image",{src:this.navBarIcons.exit})),e("div",{class:"lido-btn-dot-container"},e("div",{id:"lido-arrow-left",onClick:()=>{z()}},e("lido-image",{src:this.navBarIcons.prev})),this.containers.map(((i,n)=>e("div",{class:"parent_dots"},e("span",{class:"lido-dot "+(n<this.currentContainerIndex?"completed":n===this.currentContainerIndex?"current":""),onClick:()=>this.jumpToContainer(n),style:t})))),e("div",{id:"lido-arrow-right",onClick:t=>{console.log("Target:",t.target),console.log("Current Target:",t.currentTarget),console.log("✅ Button clicked - nextBtn action triggered"),p("this.nextBtn='true'",t.currentTarget)}},e("lido-image",{src:this.navBarIcons.next}))),e("div",{id:"main-audio",class:"popup-button",onClick:()=>this.btnpopup()},e("lido-image",{visible:"true",src:this.navBarIcons.speak})))}jumpToContainer(t){this.NextContainerKey(t)}render(){var t,i;return console.log("🚀 ~ LidoHome ~ render ~ this.containers:",this),this.xmlData?e(n,{class:"lido-home",uuid:this.uuid,index:this.currentContainerIndex,totalIndex:this.containers.length,style:{userSelect:"none"}},e("div",{key:this.currentContainerIndex},null===(i=(t=this.containers)[this.currentContainerIndex])||void 0===i?void 0:i.call(t)),this.renderDots(),this.exitFlag&&e("div",{class:"lido-alert-parent"},e("div",{class:"lido-alert-popup"},e("lido-cell",{class:"lido-alert-content",visible:"true",layout:"col",width:"340px",height:"210px","bg-color":"#fff","border-radius":"16px",onEntry:"this.box-shadow= '0 4px 8px 0 rgba(0, 0, 0, 0.25)';"},e("lido-text",{visible:"true",string:"Quer sair?",width:"294px",height:"38px",class:"popup-exit-text","font-size":"22px",onEntry:"this.margin-bottom =' -36px';"}),e("lido-cell",{visible:"true",layout:"row",width:"294px",class:"btn-cell"},e("lido-text",{visible:"true",string:"Sair",width:"92px",height:"53px","font-size":"16px",margin:"0px 50px 0px 0px",class:"popup-button",onClick:()=>this.popUpClick("exit"),borderRadius:"16px",onEntry:'this.color="#F34D08"; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',fontFamily:"Baloo Bhai 2","font-weight":"700",bgColor:"white","border-radius":"16px"}),e("lido-text",{visible:"true",string:"Continuar a jogar",width:"155px",height:"53px","font-size":"16px",class:"popup-button",onClick:()=>this.popUpClick("cancel"),borderRadius:"16px",onEntry:'this.color=white; this.font-weight="700"; this.box-shadow="0 2px 0 #F34D08";',"font-family":"Baloo Bhai 2","font-weight":"700",bgColor:"#F34D08","border-radius":"16px"})))))):e("div",null,"Please provide XML data.")}get el(){return r(this)}static get watchers(){return{xmlData:["onXmlDataChange"]}}};et.style="@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}@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)}}.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}";var nt,rt={exports:{}},ot={},st={},at={};nt=at,Object.defineProperty(nt,"__esModule",{value:!0}),nt.MUST_INSTALL_PUPPETEER=nt.DEFAULT_CONVERSION_ERROR_MESSAGE=nt.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=nt.UNEXPECTED_ERROR_MESSAGE_LINK=nt.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,nt.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",nt.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",nt.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=nt.UNEXPECTED_ERROR_MESSAGE_PREFIX+nt.UNEXPECTED_ERROR_MESSAGE_LINK,nt.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",nt.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer",Object.defineProperty(st,"__esModule",{value:!0}),st.ErrorHandling=void 0;const ht=at;class ct{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,i,e){const n=[`Input ${t} color string could not be parsed.`,`String received: ${i}.`];return e&&n.splice(1,0,`Expected format: ${e}.`),n.join(" ")}static generateUnexpectedError(t){return ct.generateErrorResult(`${ht.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${t.message}`)}static hasError(t){return!!t.errorMessage}}st.ErrorHandling=ct;var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.SheenUtil=void 0;class ut{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}lt.SheenUtil=ut,ut.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)";var dt={};!function(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ColorTypes=void 0,(i=t.ColorTypes||(t.ColorTypes={})).HEX="hex",i.RGB="rgb",i.HSL="hsl",i.KEYWORD="keyword",i.FILTER="filter"}(dt);var ft={},pt={},vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.RgbColor=void 0,vt.RgbColor=class{constructor(t=[0,0,0]){this.r=this.clamp(t[0]),this.g=this.clamp(t[1]),this.b=this.clamp(t[2])}clamp(t){return t>255?t=255:t<0&&(t=0),t}setRgb(t,i,e){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(e)}multiply(t){const i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),e=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),n=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=e,this.b=n}hueRotate(t=0){t=t/180*Math.PI;const i=Math.sin(t),e=Math.cos(t);this.multiply([.213+.787*e-.213*i,.715-.715*e-.715*i,.072-.072*e+.928*i,.213-.213*e+.143*i,.715+.285*e+.14*i,.072-.072*e-.283*i,.213-.213*e-.787*i,.715-.715*e+.715*i,.072+.928*e+.072*i])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}linear(t=1,i=0){this.r=this.clamp(this.r*t+255*i),this.g=this.clamp(this.g*t+255*i),this.b=this.clamp(this.b*t+255*i)}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}},Object.defineProperty(pt,"__esModule",{value:!0}),pt.RgbToFilterWorker=void 0;const bt=lt,wt=vt;class gt{constructor(t,i){this.targetRgbColor=t,this.reusedRgbColor=new wt.RgbColor,this.addSheen=i}static fmt(t,i,e=1){return Math.round(t[i]*e)}generateCss(t){return`${this.addSheen?`${bt.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${gt.fmt(t,0)}%) sepia(${gt.fmt(t,1)}%) saturate(${gt.fmt(t,2)}%) hue-rotate(${gt.fmt(t,3,3.6)}deg) brightness(${gt.fmt(t,4)}%) contrast(${gt.fmt(t,5)}%)`}loss(t){return this.reusedRgbColor.setRgb(0,0,0),this.reusedRgbColor.invert(t[0]/100),this.reusedRgbColor.sepia(t[1]/100),this.reusedRgbColor.saturate(t[2]/100),this.reusedRgbColor.hueRotate(3.6*t[3]),this.reusedRgbColor.brightness(t[4]/100),this.reusedRgbColor.contrast(t[5]/100),Math.abs(this.reusedRgbColor.r-this.targetRgbColor.r)+Math.abs(this.reusedRgbColor.g-this.targetRgbColor.g)+Math.abs(this.reusedRgbColor.b-this.targetRgbColor.b)}static fixSpsa(t,i){let e=100;return 2===i?e=7500:4!==i&&5!==i||(e=200),3===i?t>e?t%=e:t<0&&(t=e+t%e):t<0?t=0:t>e&&(t=e),t}spsa(t,i,e,n,r){let o=[],s=1/0;const a=new Array(6),h=new Array(6),c=new Array(6);for(let l=0;l<r;l+=1){const r=e/Math.pow(l+1,.16666666666666666);for(let t=0;t<6;t+=1)a[t]=Math.random()>.5?1:-1,h[t]=n[t]+r*a[t],c[t]=n[t]-r*a[t];const u=this.loss(h)-this.loss(c);for(let e=0;e<6;e+=1){const o=u/(2*r)*a[e],s=i[e]/Math.pow(t+l+1,1);n[e]=gt.fixSpsa(n[e]-s*o,e)}const d=this.loss(n);d<s&&(o=n.slice(0),s=d)}return{values:o,loss:s}}solveNarrow(t){const i=t.loss,e=i+1;return this.spsa(i,[.25*e,.25*e,e,.25*e,.2*e,.2*e],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let i={values:[],loss:1/0};for(let e=0;i.loss>25&&e<3;e+=1){const e=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);e.loss<i.loss&&(i=e)}return i}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}pt.RgbToFilterWorker=gt,Object.defineProperty(ft,"__esModule",{value:!0}),ft.RgbToFilter=void 0;const mt=st,yt=at,xt=pt,kt=vt;class _t{static generateConversionError(t){return mt.ErrorHandling.generateErrorResult(t||yt.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(t){return mt.ErrorHandling.generateErrorResult(t)}static execute(t,i){const e=new kt.RgbColor(t);return new xt.RgbToFilterWorker(e,i).convert()}static convertToRGB(t,i){return t&&i?i(t):null}static convert(t){try{const{colorString:i,validateAndParse:e,convertToRgb:n,conversionErrorMessage:r,addSheen:o}=t,s=i.trim().toLocaleLowerCase(),a=(null==e?void 0:e(s))||{color:s};if(mt.ErrorHandling.hasError(a))return _t.generateValidateAndParseError(a.errorMessage);const h=_t.convertToRGB(a.color,n)||a.color;return h?_t.execute(h,o):_t.generateConversionError(r)}catch(t){return mt.ErrorHandling.generateUnexpectedError(t)}}}ft.RgbToFilter=_t;var Ct={},jt={};Object.defineProperty(jt,"__esModule",{value:!0}),jt.MATCH_HEXADECIMAL=jt.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,jt.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,jt.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.MAX_COLOR_INPUT_STRING_LENGTH=void 0,Mt.MAX_COLOR_INPUT_STRING_LENGTH=25;var $t={};!function(t){var i;Object.defineProperty(t,"__esModule",{value:!0}),t.ColorFormats=void 0,(i=t.ColorFormats||(t.ColorFormats={})).HEX="#ffffff or #fff",i.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",i.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",i.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",i.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"}($t);var Tt={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},At=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.ColorParser=void 0;const Ot=jt,St=st,Pt=Mt,Et=$t,zt=dt,It=At(Tt);class Dt{static validateAndParseHex(t){return t.length<Pt.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(Ot.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:St.ErrorHandling.generateInputErrorMessage(zt.ColorTypes.HEX,t,Et.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<Pt.MAX_COLOR_INPUT_STRING_LENGTH){const i=t.match(Ot.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(Ot.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,i&&i.length>=3)return i.slice(0,3).map((t=>Number.parseInt(t)))}return null}static validateAndParseRgb(t){const i=Dt.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=255&&i[1]>=0&&i[1]<=255&&i[2]>=0&&i[2]<=255?{color:i}:{errorMessage:St.ErrorHandling.generateInputErrorMessage(zt.ColorTypes.RGB,t,Et.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=Dt.parseFirstThreeIntegersFromString(t);return i&&i[0]>=0&&i[0]<=360&&i[1]>=0&&i[1]<=100&&i[2]>=0&&i[2]<=100?{color:i}:{errorMessage:St.ErrorHandling.generateInputErrorMessage(zt.ColorTypes.HSL,t,Et.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<Pt.MAX_COLOR_INPUT_STRING_LENGTH&&It.default[t]?{color:t}:{errorMessage:St.ErrorHandling.generateInputErrorMessage(zt.ColorTypes.KEYWORD,t,Et.ColorFormats.KEYWORD)}}}Ct.ColorParser=Dt;const Lt=Tt,Ft={};for(const t of Object.keys(Lt))Ft[Lt[t]]=t;const Rt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var Wt=Rt;for(const t of Object.keys(Rt)){if(!("channels"in Rt[t]))throw new Error("missing channels property: "+t);if(!("labels"in Rt[t]))throw new Error("missing channel labels property: "+t);if(Rt[t].labels.length!==Rt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:e}=Rt[t];delete Rt[t].channels,delete Rt[t].labels,Object.defineProperty(Rt[t],"channels",{value:i}),Object.defineProperty(Rt[t],"labels",{value:e})}Rt.rgb.hsl=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(i,e,n),o=Math.max(i,e,n),s=o-r;let a,h;o===r?a=0:i===o?a=(e-n)/s:e===o?a=2+(n-i)/s:n===o&&(a=4+(i-e)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+o)/2;return h=o===r?0:c<=.5?s/(o+r):s/(2-o-r),[a,100*h,100*c]},Rt.rgb.hsv=function(t){let i,e,n,r,o;const s=t[0]/255,a=t[1]/255,h=t[2]/255,c=Math.max(s,a,h),l=c-Math.min(s,a,h),u=function(t){return(c-t)/6/l+.5};return 0===l?(r=0,o=0):(o=l/c,i=u(s),e=u(a),n=u(h),s===c?r=n-e:a===c?r=1/3+i-n:h===c&&(r=2/3+e-i),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*c]},Rt.rgb.hwb=function(t){const i=t[0],e=t[1];let n=t[2];const r=Rt.rgb.hsl(t)[0],o=1/255*Math.min(i,Math.min(e,n));return n=1-1/255*Math.max(i,Math.max(e,n)),[r,100*o,100*n]},Rt.rgb.cmyk=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.min(1-i,1-e,1-n);return[100*((1-i-r)/(1-r)||0),100*((1-e-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*r]},Rt.rgb.keyword=function(t){const i=Ft[t];if(i)return i;let e,n=1/0;for(const i of Object.keys(Lt)){const s=((r=t)[0]-(o=Lt[i])[0])**2+(r[1]-o[1])**2+(r[2]-o[2])**2;s<n&&(n=s,e=i)}var r,o;return e},Rt.keyword.rgb=function(t){return Lt[t]},Rt.rgb.xyz=function(t){let i=t[0]/255,e=t[1]/255,n=t[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,[100*(.4124*i+.3576*e+.1805*n),100*(.2126*i+.7152*e+.0722*n),100*(.0193*i+.1192*e+.9505*n)]},Rt.rgb.lab=function(t){const i=Rt.rgb.xyz(t);let e=i[0],n=i[1],r=i[2];return e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(e-n),200*(n-r)]},Rt.hsl.rgb=function(t){const i=t[0]/360,e=t[1]/100,n=t[2]/100;let r,o,s;if(0===e)return s=255*n,[s,s,s];r=n<.5?n*(1+e):n+e-n*e;const a=2*n-r,h=[0,0,0];for(let t=0;t<3;t++)o=i+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?a+6*(r-a)*o:2*o<1?r:3*o<2?a+(r-a)*(2/3-o)*6:a,h[t]=255*s;return h},Rt.hsl.hsv=function(t){const i=t[0];let e=t[1]/100,n=t[2]/100,r=e;const o=Math.max(n,.01);return n*=2,e*=n<=1?n:2-n,r*=o<=1?o:2-o,[i,100*(0===n?2*r/(o+r):2*e/(n+e)),(n+e)/2*100]},Rt.hsv.rgb=function(t){const i=t[0]/60,e=t[1]/100;let n=t[2]/100;const r=Math.floor(i)%6,o=i-Math.floor(i),s=255*n*(1-e),a=255*n*(1-e*o),h=255*n*(1-e*(1-o));switch(n*=255,r){case 0:return[n,h,s];case 1:return[a,n,s];case 2:return[s,n,h];case 3:return[s,a,n];case 4:return[h,s,n];case 5:return[n,s,a]}},Rt.hsv.hsl=function(t){const i=t[0],e=t[1]/100,n=t[2]/100,r=Math.max(n,.01);let o,s;s=(2-e)*n;const a=(2-e)*r;return o=e*r,o/=a<=1?a:2-a,o=o||0,s/=2,[i,100*o,100*s]},Rt.hwb.rgb=function(t){const i=t[0]/360;let e=t[1]/100,n=t[2]/100;const r=e+n;let o;r>1&&(e/=r,n/=r);const s=Math.floor(6*i),a=1-n;o=6*i-s,1&s&&(o=1-o);const h=e+o*(a-e);let c,l,u;switch(s){default:case 6:case 0:c=a,l=h,u=e;break;case 1:c=h,l=a,u=e;break;case 2:c=e,l=a,u=h;break;case 3:c=e,l=h,u=a;break;case 4:c=h,l=e,u=a;break;case 5:c=a,l=e,u=h}return[255*c,255*l,255*u]},Rt.cmyk.rgb=function(t){const i=t[1]/100,e=t[2]/100,n=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-n)+n)),255*(1-Math.min(1,i*(1-n)+n)),255*(1-Math.min(1,e*(1-n)+n))]},Rt.xyz.rgb=function(t){const i=t[0]/100,e=t[1]/100,n=t[2]/100;let r,o,s;return r=3.2406*i+-1.5372*e+-.4986*n,o=-.9689*i+1.8758*e+.0415*n,s=.0557*i+-.204*e+1.057*n,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[255*r,255*o,255*s]},Rt.xyz.lab=function(t){let i=t[0],e=t[1],n=t[2];return i/=95.047,e/=100,n/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,[116*e-16,500*(i-e),200*(e-n)]},Rt.lab.xyz=function(t){let i,e,n;e=(t[0]+16)/116,i=t[1]/500+e,n=e-t[2]/200;const r=e**3,o=i**3,s=n**3;return e=r>.008856?r:(e-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,n=s>.008856?s:(n-16/116)/7.787,i*=95.047,e*=100,n*=108.883,[i,e,n]},Rt.lab.lch=function(t){const i=t[0],e=t[1],n=t[2];let r;return r=360*Math.atan2(n,e)/2/Math.PI,r<0&&(r+=360),[i,Math.sqrt(e*e+n*n),r]},Rt.lch.lab=function(t){const i=t[1],e=t[2]/360*2*Math.PI;return[t[0],i*Math.cos(e),i*Math.sin(e)]},Rt.rgb.ansi16=function(t,i=null){const[e,n,r]=t;let o=null===i?Rt.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===o&&(s+=60),s},Rt.hsv.ansi16=function(t){return Rt.rgb.ansi16(Rt.hsv.rgb(t),t[2])},Rt.rgb.ansi256=function(t){const i=t[0],e=t[1],n=t[2];return i===e&&e===n?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5)},Rt.ansi16.rgb=function(t){let i=t%10;if(0===i||7===i)return t>50&&(i+=3.5),i=i/10.5*255,[i,i,i];const e=.5*(1+~~(t>50));return[(1&i)*e*255,(i>>1&1)*e*255,(i>>2&1)*e*255]},Rt.ansi256.rgb=function(t){if(t>=232){const i=10*(t-232)+8;return[i,i,i]}let i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},Rt.rgb.hex=function(t){const i=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(i.length)+i},Rt.hex.rgb=function(t){const i=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!i)return[0,0,0];let e=i[0];3===i[0].length&&(e=e.split("").map((t=>t+t)).join(""));const n=parseInt(e,16);return[n>>16&255,n>>8&255,255&n]},Rt.rgb.hcg=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,r=Math.max(Math.max(i,e),n),o=Math.min(Math.min(i,e),n),s=r-o;let a,h;return a=s<1?o/(1-s):0,h=s<=0?0:r===i?(e-n)/s%6:r===e?2+(n-i)/s:4+(i-e)/s,h/=6,h%=1,[360*h,100*s,100*a]},Rt.hsl.hcg=function(t){const i=t[1]/100,e=t[2]/100,n=e<.5?2*i*e:2*i*(1-e);let r=0;return n<1&&(r=(e-.5*n)/(1-n)),[t[0],100*n,100*r]},Rt.hsv.hcg=function(t){const i=t[2]/100,e=t[1]/100*i;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},Rt.hcg.rgb=function(t){const i=t[1]/100,e=t[2]/100;if(0===i)return[255*e,255*e,255*e];const n=[0,0,0],r=t[0]/360%1*6,o=r%1,s=1-o;let a=0;switch(Math.floor(r)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=o;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=o,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return a=(1-i)*e,[255*(i*n[0]+a),255*(i*n[1]+a),255*(i*n[2]+a)]},Rt.hcg.hsv=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);let n=0;return e>0&&(n=i/e),[t[0],100*n,100*e]},Rt.hcg.hsl=function(t){const i=t[1]/100,e=t[2]/100*(1-i)+.5*i;let n=0;return e>0&&e<.5?n=i/(2*e):e>=.5&&e<1&&(n=i/(2*(1-e))),[t[0],100*n,100*e]},Rt.hcg.hwb=function(t){const i=t[1]/100,e=i+t[2]/100*(1-i);return[t[0],100*(e-i),100*(1-e)]},Rt.hwb.hcg=function(t){const i=1-t[2]/100,e=i-t[1]/100;let n=0;return e<1&&(n=(i-e)/(1-e)),[t[0],100*e,100*n]},Rt.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},Rt.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},Rt.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},Rt.gray.hsl=function(t){return[0,0,t[0]]},Rt.gray.hsv=Rt.gray.hsl,Rt.gray.hwb=function(t){return[0,100,t[0]]},Rt.gray.cmyk=function(t){return[0,0,0,t[0]]},Rt.gray.lab=function(t){return[t[0],0,0]},Rt.gray.hex=function(t){const i=255&Math.round(t[0]/100*255),e=((i<<16)+(i<<8)+i).toString(16).toUpperCase();return"000000".substring(e.length)+e},Rt.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const Ut=Wt;function Bt(t,i){return function(e){return i(t(e))}}function Xt(t,i){const e=[i[t].parent,t];let n=Ut[i[t].parent][t],r=i[t].parent;for(;i[r].parent;)e.unshift(i[r].parent),n=Bt(Ut[i[r].parent][r],n),r=i[r].parent;return n.conversion=e,n}const Nt=Wt,Ht=function(t){const i=function(t){const i=function(){const t={},i=Object.keys(Ut);for(let e=i.length,n=0;n<e;n++)t[i[n]]={distance:-1,parent:null};return t}(),e=[t];for(i[t].distance=0;e.length;){const t=e.pop(),n=Object.keys(Ut[t]);for(let r=n.length,o=0;o<r;o++){const r=n[o],s=i[r];-1===s.distance&&(s.distance=i[t].distance+1,s.parent=t,e.unshift(r))}}return i}(t),e={},n=Object.keys(i);for(let t=n.length,r=0;r<t;r++){const t=n[r];null!==i[t].parent&&(e[t]=Xt(t,i))}return e},Yt={};Object.keys(Nt).forEach((t=>{Yt[t]={},Object.defineProperty(Yt[t],"channels",{value:Nt[t].channels}),Object.defineProperty(Yt[t],"labels",{value:Nt[t].labels});const i=Ht(t);Object.keys(i).forEach((e=>{const n=i[e];Yt[t][e]=function(t){const i=function(...i){const e=i[0];if(null==e)return e;e.length>1&&(i=e);const n=t(i);if("object"==typeof n)for(let t=n.length,i=0;i<t;i++)n[i]=Math.round(n[i]);return n};return"conversion"in t&&(i.conversion=t.conversion),i}(n),Yt[t][e].raw=function(t){const i=function(...i){const e=i[0];return null==e?e:(e.length>1&&(i=e),t(i))};return"conversion"in t&&(i.conversion=t.conversion),i}(n)}))}));var Gt=Yt,Vt=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ot,"__esModule",{value:!0}),ot.ColorToFilter=void 0;const qt=st,Kt=lt,Jt=dt,Qt=ft,Zt=Ct,ti=Vt(Gt);ot.ColorToFilter=class{static rgbToFilter(t,i){return Qt.RgbToFilter.convert({colorString:t,validateAndParse:Zt.ColorParser.validateAndParseRgb,addSheen:Kt.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return Qt.RgbToFilter.convert({colorString:t,validateAndParse:Zt.ColorParser.validateAndParseHex,convertToRgb:ti.default.hex.rgb,addSheen:Kt.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return Qt.RgbToFilter.convert({colorString:t,validateAndParse:Zt.ColorParser.validateAndParseHsl,convertToRgb:ti.default.hsl.rgb,addSheen:Kt.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,i){return Qt.RgbToFilter.convert({colorString:t,validateAndParse:Zt.ColorParser.validateAndParseKeyword,convertToRgb:ti.default.keyword.rgb,conversionErrorMessage:qt.ErrorHandling.generateInputErrorMessage(Jt.ColorTypes.KEYWORD,t),addSheen:Kt.SheenUtil.parseSheenFromOptions(i)})}};var ii={},ei={},ni={},ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.FilterToHexShared=void 0;const oi=st,si=$t,ai=dt;ri.FilterToHexShared=class{static generateInputErrorMessage(t){return oi.ErrorHandling.generateInputErrorMessage(ai.ColorTypes.FILTER,t,si.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,i=1){const e=function(){const t=document.createElement("div");return t.style.height=`${i}px`,t.style.width=`${i}px`,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t}(),n=function(){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");n.style.height="inherit",n.style.width="inherit",n.style.float="left",n.style.filter=t;const r=document.createElementNS(e,"rect");return r.setAttributeNS(null,"width",i.toString()),r.setAttributeNS(null,"height",i.toString()),n.appendChild(r),n}();return""===n.style.filter?{errorMessage:"error indicator",svgContainerElement:e}:(e.appendChild(n),document.body.appendChild(e),{svgContainerElement:e})}static async getColorViaImageDataURL(t){return function(t){const i=function(t){const i=t.width;return t.getContext("2d").getImageData(0,0,i,i).data}(t);return`#${`000000${function(t,i,e){if(t>255||i>255||e>255)throw new Error("Invalid color component");return(t<<16|i<<8|e).toString(16)}(i[0],i[1],i[2])}`.slice(-6)}`}(function(t){const i=document.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(t,0,0,t.width,t.height),i}(await async function(){const i=new Image;return i.src=t,new Promise((t=>{setTimeout((()=>t(i)))}))}()))}};var hi,ci={exports:{}};hi=ci,function(){var t=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:i,mimeType:function(t){var e,n;return(e="application/font-woff",n="image/jpeg",{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[i(t).toLowerCase()]||""},dataAsUrl:function(t,i){return"data:"+i+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(i){t.toBlob(i)})):function(t){return new Promise((function(i){for(var e=window.atob(t.toDataURL().split(",")[1]),n=e.length,r=new Uint8Array(n),o=0;o<n;o++)r[o]=e.charCodeAt(o);i(new Blob([r],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var e=document.implementation.createHTMLDocument(),n=e.createElement("base");e.head.appendChild(n);var r=e.createElement("a");return e.body.appendChild(r),n.href=i,r.href=t,r.href},getAndEncode:function(t){return o.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(i){var e,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var t=r.result.split(/,/)[1];i(t)},r.readAsDataURL(n.response)}else e?i(e):s("cannot fetch resource: "+t+", status: "+n.status)},n.ontimeout=function(){e?i(e):s("timeout of 30000ms occured while fetching resource: "+t)},n.responseType="blob",n.timeout=3e4,n.open("GET",t,!0),n.send(),o.impl.options.imagePlaceholder){var r=o.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(e=r[1])}function s(t){console.error(t),i("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(i){return new Promise((function(e){setTimeout((function(){e(i)}),t)}))}},asArray:function(t){for(var i=[],e=t.length,n=0;n<e;n++)i.push(t[n]);return i},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(i,e){var n=new Image;n.onload=function(){i(n)},n.onerror=e,n.src=t}))},width:function(t){var i=e(t,"border-left-width"),n=e(t,"border-right-width");return t.scrollWidth+i+n},height:function(t){var i=e(t,"border-top-width"),n=e(t,"border-bottom-width");return t.scrollHeight+i+n}};var t;function i(t){var i=/\.([^\.\/]*?)$/g.exec(t);return i?i[1]:""}function e(t,i){var e=window.getComputedStyle(t).getPropertyValue(i);return parseFloat(e.replace("px",""))}}(),i=function(){var i=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,o){return e(t)?Promise.resolve(t).then(n).then((function(e){var n=Promise.resolve(t);return e.forEach((function(t){n=n.then((function(e){return r(e,t,i,o)}))})),n})):Promise.resolve(t)},shouldProcess:e,impl:{readUrls:n,inline:r}};function e(t){return-1!==t.search(i)}function n(e){for(var n,r=[];null!==(n=i.exec(e));)r.push(n[1]);return r.filter((function(i){return!t.isDataUrl(i)}))}function r(i,e,n,r){return Promise.resolve(e).then((function(i){return n?t.resolveUrl(i,n):i})).then(r||t.getAndEncode).then((function(i){return t.dataAsUrl(i,t.mimeType(e))})).then((function(n){return i.replace(function(i){return new RegExp("(url\\(['\"]?)("+t.escape(i)+")(['\"]?\\))","g")}(e),"$1"+n+"$3")}))}}(),e=function(){return{resolveAll:function(){return e().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(i){var e=[];return i.forEach((function(i){try{t.asArray(i.cssRules||[]).forEach(e.push.bind(e))}catch(t){console.log("Error while reading CSS rules from "+i.href,t.toString())}})),e})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return i.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(t){return{resolve:function(){return i.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),n=function(){return{inlineAll:function n(r){return r instanceof Element?function(t){var e=t.style.getPropertyValue("background");return e?i.inlineAll(e).then((function(i){t.style.setProperty("background",i,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(t){return n(t)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(i){return{inline:function(e){return t.isDataUrl(i.src)?Promise.resolve():Promise.resolve(i.src).then(e||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(i.src))})).then((function(t){return new Promise((function(e,n){i.onload=e,i.onerror=n,i.src=t}))}))}}}}(),r={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:s,toPng:function(t,i){return a(t,i||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,i){return a(t,i=i||{}).then((function(t){return t.toDataURL("image/jpeg",i.quality||1)}))},toBlob:function(i,e){return a(i,e||{}).then(t.canvasToBlob)},toPixelData:function(i,e){return a(i,e||{}).then((function(e){return e.getContext("2d").getImageData(0,0,t.width(i),t.height(i)).data}))},impl:{fontFaces:e,images:n,util:t,inliner:i,options:{}}};function s(i,e){return function(t){o.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?r.imagePlaceholder:t.imagePlaceholder,o.impl.options.cacheBust=void 0===t.cacheBust?r.cacheBust:t.cacheBust}(e=e||{}),Promise.resolve(i).then((function(t){return h(t,e.filter,!0)})).then(c).then(l).then((function(t){return e.bgcolor&&(t.style.backgroundColor=e.bgcolor),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.style&&Object.keys(e.style).forEach((function(i){t.style[i]=e.style[i]})),t})).then((function(n){return function(i,e,n){return Promise.resolve(i).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(t.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+n+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(n,e.width||t.width(i),e.height||t.height(i))}))}function a(i,e){return s(i,e).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(i){var n=document.createElement("canvas");if(n.width=e.width||t.width(i),n.height=e.height||t.height(i),e.bgcolor){var r=n.getContext("2d");r.fillStyle=e.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(i);return r.getContext("2d").drawImage(n,0,0),r}))}function h(i,e,n){return n||!e||e(i)?Promise.resolve(i).then((function(i){return i instanceof HTMLCanvasElement?t.makeImage(i.toDataURL()):i.cloneNode(!1)})).then((function(n){return function(i,e,n){var r=i.childNodes;return 0===r.length?Promise.resolve(e):function(t,i,e){var n=Promise.resolve();return i.forEach((function(i){n=n.then((function(){return h(i,e)})).then((function(i){i&&t.appendChild(i)}))})),n}(e,t.asArray(r),n).then((function(){return e}))}(i,n,e)})).then((function(e){return function(i,e){return e instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(i),r=e.style,n.cssText?r.cssText=n.cssText:function(i,e){t.asArray(i).forEach((function(t){e.setProperty(t,i.getPropertyValue(t),i.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(i,n),o=r.getPropertyValue("content");if(""!==o&&"none"!==o){var s=t.uid();e.className=e.className+" "+s;var a=document.createElement("style");a.appendChild(function(i,e,n){var r="."+i+":"+e,o=n.cssText?s(n):a(n);return document.createTextNode(r+"{"+o+"}");function s(t){var i=t.getPropertyValue("content");return t.cssText+" content: "+i+";"}function a(i){return t.asArray(i).map(e).join("; ")+";";function e(t){return t+": "+i.getPropertyValue(t)+(i.getPropertyPriority(t)?" !important":"")}}}(s,n,r)),e.appendChild(a)}}(n)}))})).then((function(){i instanceof HTMLTextAreaElement&&(e.innerHTML=i.value),i instanceof HTMLInputElement&&e.setAttribute("value",i.value)})).then((function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&["width","height"].forEach((function(t){var i=e.getAttribute(t);i&&e.style.setProperty(t,i)})))})).then((function(){return e})):e}(i,e)})):Promise.resolve()}function c(t){return e.resolveAll().then((function(i){var e=document.createElement("style");return t.appendChild(e),e.appendChild(document.createTextNode(i)),t}))}function l(t){return n.inlineAll(t).then((function(){return t}))}hi.exports=o}();var li=s&&s.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),ui=s&&s.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),di=s&&s.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&li(i,t,e);return ui(i,t),i};Object.defineProperty(ni,"__esModule",{value:!0}),ni.FilterToHexBrowser=void 0;const fi=st,pi=ri;class vi extends pi.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const e=pi.FilterToHexShared.generateInputErrorMessage(t),n=fi.ErrorHandling.generateErrorResult(e);return vi.cleanup(i),n}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>di(ci.exports)))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:e}=pi.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return vi.returnInputError(t,e);const n=await vi.getImageBase64ViaSVG(e),r=await pi.FilterToHexShared.getColorViaImageDataURL(n);return vi.cleanup(e),{color:r}}}ni.FilterToHexBrowser=vi;var bi=s&&s.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var r=Object.getOwnPropertyDescriptor(i,e);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,r)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),wi=s&&s.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),gi=s&&s.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)"default"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&bi(i,t,e);return wi(i,t),i};Object.defineProperty(ei,"__esModule",{value:!0}),ei.FilterToHex=void 0;const mi=st,yi=ni;ei.FilterToHex=class{static async convert(t,i,e){try{let n;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>gi(require("./workers/node"))));n=await i.convert(t)}else n=await yi.FilterToHexBrowser.convert(t);return n.color&&i&&"string"==typeof n.color&&(n.color=i(n.color,e)),n}catch(t){return mi.ErrorHandling.generateUnexpectedError(t)}}};var xi={},ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.ColorFormatter=void 0,ki.ColorFormatter=class{static arrayToRgbString(t){return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}static arrayToHslString(t){return`hsl(${t[0]}deg, ${t[1]}%, ${t[2]}%)`}};var _i=s&&s.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xi,"__esModule",{value:!0}),xi.HexToColor=void 0;const Ci=ki,ji=_i(Gt);xi.HexToColor=class{static convertToRgb(t,i){const e=ji.default.hex.rgb(t);return"string"===(null==i?void 0:i.resultType)?Ci.ColorFormatter.arrayToRgbString(e):e}static convertToHsl(t,i){const e=ji.default.hex.hsl(t);return"string"===(null==i?void 0:i.resultType)?Ci.ColorFormatter.arrayToHslString(e):e}},Object.defineProperty(ii,"__esModule",{value:!0}),ii.FilterToColor=void 0;const Mi=ei,$i=xi;ii.FilterToColor=class{static async filterToHex(t){const i=await Mi.FilterToHex.convert(t);return i.color&&(i.color=i.color.toUpperCase()),i}static async filterToRgb(t,i){return Mi.FilterToHex.convert(t,$i.HexToColor.convertToRgb,i)}static async filterToHsl(t,i){return Mi.FilterToHex.convert(t,$i.HexToColor.convertToHsl,i)}},function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const e=ot,n=ii;class r{static rgbToFilter(t,i){return e.ColorToFilter.rgbToFilter(t,i)}static hexToFilter(t,i){return e.ColorToFilter.hexToFilter(t,i)}static hslToFilter(t,i){return e.ColorToFilter.hslToFilter(t,i)}static keywordToFilter(t,i){return e.ColorToFilter.keywordToFilter(t,i)}static async filterToHex(t){return n.FilterToColor.filterToHex(t)}static async filterToRgb(t,i){return n.FilterToColor.filterToRgb(t,i)}static async filterToHsl(t,i){return n.FilterToColor.filterToHsl(t,i)}}i.default=r,t.exports=r}(rt,rt.exports);const Ti=D(rt.exports),Ai=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id=void 0,this.value=void 0,this.height=void 0,this.width=void 0,this.ariaLabel=void 0,this.ariaHidden=void 0,this.x=void 0,this.y=void 0,this.z=void 0,this.bgColor=void 0,this.type=void 0,this.tabIndex=void 0,this.visible=void 0,this.audio=void 0,this.onTouch=void 0,this.onInCorrect=void 0,this.onCorrect=void 0,this.onEntry=void 0,this.src=void 0,this.isSlice=void 0,this.sliceWidth="30px",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.filter="",this.borderRadius="0px",this.transform="",this.style=void 0,this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(a(this.el,this.delayVisible),h(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${Ti.hexToFilter(L(this.filter).toHexString()).color}`)}this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:u(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:u(this.margin,t),padding:u(this.padding,t),transform:u(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${c(this.src)})`:"none",borderImageSlice:"true"===this.isSlice?`${parseInt(this.sliceWidth)} fill`:"unset",borderImageRepeat:"true"===this.isSlice?"round":"unset",borderImageWidth:"true"===this.isSlice?`${this.sliceWidth}`:"unset",backgroundImage:"true"===this.isSlice?`url(${c(this.src)})`:"none"}}render(){return"true"===this.isSlice?e(n,{class:"slice",id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry}):e(n,{id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,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},e("img",{class:"lido-image",src:c(this.src),alt:"",style:this.style}))}get el(){return r(this)}};Ai.style=".lido-image{user-select:none;-webkit-user-drag:none;object-fit:contain;width:100% !important;height:100% !important;aspect-ratio:1 / 1;transform:rotate(0) !important;margin:0 !important}.slice{background-repeat:no-repeat;background-position:center;background-size:100% 100%}";const Oi=class{constructor(i){t(this,i),this.keys="",this.width=void 0,this.height=void 0,this.fontSize=void 0,this.fontColor=void 0,this.fontFamily=void 0,this.gap="10px",this.bgColor="",this.borderRadius="",this.y=void 0,this.x=void 0,this.z=void 0,this.margin=void 0,this.padding=void 0,this.visible=void 0,this.onEntry=void 0,this.type=void 0,this.keyboardInput=!1,this.columns="10",this.letterLength=void 0,this.disableSpeak=!1,this.numberOfClick=0,this.inputString="",this.style={}}async inputValidation(t){if("click"!==this.type)return;let i=JSON.parse(localStorage.getItem(F))||"";i=this.inputString,localStorage.setItem(F,JSON.stringify(i));const e=document.getElementById(P),n=t.target.getAttribute("value"),r=e.querySelectorAll(`[value= '${n}']`),o=Array.from(r).find((t=>!t.className.includes("key-button")));let s;if(this.inputString=n,o){const t=document.body.getBoundingClientRect(),i=o.getBoundingClientRect();s=i.left<t.right&&i.right>t.left&&i.top<t.bottom&&i.bottom>t.top}if(s)if(o.style.animation="none",this.numberOfClick++,this.numberOfClick===this.letterLength){const t=e.getAttribute("onCorrect");e.style.pointerEvents="none",await p(t,this.el),R()}else m(o),f(!0);else{const t=e.getAttribute("onInCorrect");await p(t,this.el),f(!1)}}componentDidLoad(){if(document.getElementById(P).getAttribute("drop-action")===W.InfiniteDrop){const t=this.el.querySelectorAll(".key-button"),i=t[0];t.forEach((t=>{t.style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px"}))}}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,fontSize:u(this.fontSize,t),fontFamily:this.fontFamily,color:u(this.fontColor,t),display:"true"===u(`${this.visible}`,t)?"flex":"none",margin:u(this.margin,t),padding:u(this.padding,t),borderRadius:u(this.borderRadius,t),columns:u(`${this.columns}`,t),gap:u(this.gap,t)}}render(){const t=this.keys.split(",").map((t=>t.trim())),i="true"===document.getElementById(P).getAttribute("show-check");return e(n,{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&&e("div",{key:"114224c18345951e749db6f1eba242cc1179431f",class:"input-area"},e("input",{key:"14741df7dc29f51420c1164ddebf60fd464fade4",type:"text",value:this.inputString,class:"input-area",readonly:!0,onInput:t=>this.inputString=t.target.value}),e("lido-text",{key:"3bb801fbcab03b58a628c4c365f46113e9829fdc",visible:i?"true":"false",string:"<<","bg-color":"black","font-color":"white","border-radius":"20px","font-size":"30px",width:"100px",height:"70px",type:"click",onClick:()=>{this.inputString=this.inputString.slice(0,-1),this.inputValidation(event)}}),e("lido-text",{key:"46212bcfe4e5c22744d13d8235d82bdb73bce802",visible:i?"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&&e("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"}),e("div",{key:"5238d1dc1bafda2ffab63932d1f5d29ef449bf4b",class:"keyboard-wrapper",style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"stretch",gap:this.gap,width:"100%",height:"100%"}},t.map(((t,i)=>{const[n,r]=t.split("-"),o="disable"===r;let s="Space"===n?" ":n;return e("lido-text",{id:"key-button-"+i,style:{flex:`0 0 calc(${100/parseInt(this.style.columns)}% - ${this.style.gap})`},visible:"true","font-size":this.style.fontSize,"font-color":this.fontColor,"font-family":this.fontFamily,"bg-color":this.bgColor,string:n,onEntry:this.onEntry,"border-radius":this.style.borderRadius,value:n.toLowerCase(),type:this.type,class:"key-button"+(o?" disabled":""),onClick:()=>{this.inputString+=s,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return r(this)}};Oi.style='.lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type="text"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}';const Si=class{constructor(i){t(this,i),this.rows="7",this.cols="5",this.defualtFill=0,this.leftIndex=!1,this.topIndex=!1,this.bottomIndex=!1,this.clickable=!0,this.activeOnlyVisible=!1,this.matrixImage=void 0,this.activeBgColor="transparent",this.deactiveBgColor="transparent",this.border="2px solid green",this.height="100%",this.width="100%",this.borderRadius="5px",this.z=void 0,this.margin=void 0,this.padding=void 0,this.visible="false",this.text=void 0,this.type=void 0,this.value=void 0,this.tabIndex=void 0,this.x=void 0,this.y=void 0,this.fontColor=void 0,this.previousFilledSlot=-1,this.previousFilledSlotElement=null,this.style={}}updateValue(t){this.el.setAttribute("value",t)}componentDidLoad(){const t=this.el.querySelectorAll(".slot");h(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="visible",this.matrixImage&&i.style.setProperty("--bg-image",`url(${c(this.matrixImage)})`)):this.activeOnlyVisible&&(i.style.visibility="hidden")})),this.updateSlots(),this.updateStyles()}componentWillLoad(){this.updateStyles(),this.updateSlots(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateSlots(){const t=this.el.querySelectorAll(".slot"),i=this.el.querySelector(".slot");if(!t.length||!i)return;const e=i.offsetWidth<i.offsetHeight?i.offsetWidth:i.offsetHeight;this.el.querySelectorAll(".slot-parent").forEach((t=>{t.style.width=`${e}px`,Array.from(t.children).forEach((t=>{const i=t;i.style.width=`${e}px`,i.style.height=`${e}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:u(this.height,t),width:u(this.width,t),zIndex:this.z,display:"true"===u(`${this.visible}`,t)?"flex":"none",borderRadius:u(this.borderRadius,t),left:u(this.x,t),top:u(this.y,t),cols:u(`${this.cols}`,t),rows:u(`${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 n=t;e<i?(n.classList.add("slot-active"),n.classList.remove("slot-inactive"),this.matrixImage&&n.style.setProperty("--bg-image",`url(${c(this.matrixImage)})`)):(n.classList.remove("slot-active"),n.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()),U()}getSlotData(){const t={};return this.text?(this.text.split(",").forEach(((i,e)=>{const[n,r]=i.split("-"),o=parseInt(n.trim());isNaN(o)||(t[e]={text:n.trim(),color:null==r?void 0:r.trim()})})),t):t}render(){let t=1;const i=this.getSlotData();return e(n,{key:"66d627c33553f3f6473c6d1b465c9af7cc6741d3",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},Array.from({length:parseInt(this.style.rows)+1},((n,r)=>e("div",{class:"slot-parent",key:`row-${r}`},e("div",{style:0===r&&{visibility:"hidden"},class:"topIndex"},r),Array.from({length:parseInt(this.style.cols)},((n,o)=>{var s,a;return 0===r?e("div",{class:"leftIndex"},++o):e("div",{class:`slot slot-${t} ${this.defualtFill>=t?"slot-active":"slot-inactive"}`,onClick:t=>this.handleClickSlot(t.currentTarget),key:`slot-${r}-${o}`,style:{borderRadius:this.style.borderRadius,backgroundColor:(null===(s=i[t-1])||void 0===s?void 0:s.color)||""}},null===(a=i[t-1])||void 0===a?void 0:a.text,t++&&null)})),e("div",{style:0===r&&{visibility:"hidden"},class:"bottomIndex"},parseInt(this.style.cols)*r)))))}get el(){return r(this)}};Si.style=".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'}";const Pi=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.style=void 0}componentDidLoad(){h(this.el,this.type)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:JSON.parse(u(`${this.visible}`,t))?"block":"none",margin:u(this.margin,t)}}render(){return e(n,{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},e("slot",{key:"dae7759306330a01ecfb66be08debe8ec1f97d6e"}))}get el(){return r(this)}};Pi.style=".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}";const Ei=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin=""}componentDidLoad(){setTimeout((()=>{const t=this.el.parentElement;if(!t)return;const i=t.offsetWidth,e=t.offsetHeight;Array.from(this.el.children).forEach((t=>{const n=t.offsetWidth,r=t.offsetHeight;console.log("child width",n);const o=i-n,s=e-r,a=Math.random()*o,h=Math.random()*s;console.log("randomleft",a),console.log("randomtop",h),t.style.position="absolute",t.style.left=`${a}px`,t.style.top=`${h}px`}))}),50),this.showSpeakIcon&&w(this.el)}render(){return e(n,{key:"328c7a0533a52a1be5cee0d71fc7a43338e5290f",class:"lido-random",type:this.type,"tab-index":this.tabIndex,value:this.value,style:{height:this.height,width:this.width,top:this.y,left:this.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:this.bgColor,margin:this.margin},"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},e("slot",{key:"c1a93405cbbd2a06a92134c4ff5853204215c317"}))}get el(){return r(this)}};Ei.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const zi=class{constructor(i){t(this,i),this.xmlPath="",this.initialIndex=0,this.margin="",this.canplay=!0,this.baseUrl="",this.exitButtonUrl=void 0,this.prevButtonUrl=void 0,this.nextButtonUrl=void 0,this.speakerButtonUrl=void 0,this.xmlData=void 0}async componentWillLoad(){var t,e;const n=null!==(t=this.xmlPath)&&void 0!==t?t:this.baseUrl+((null===(e=this.baseUrl)||void 0===e?void 0:e.endsWith("/"))?"index.xml":"/index.xml");console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.baseUrl:",this.baseUrl),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.xmlPath:",this.xmlPath),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ xmlPath:",n);try{const t=n.startsWith("http")?n:i(n),e=await fetch(t);if(!e.ok)throw new Error(`Failed to fetch XML data: ${e.statusText}`);const r=await e.text();this.xmlData=r}catch(t){console.error("Error fetching XML data:",t),this.xmlData=null}}render(){return void 0===this.xmlData?e("div",null,"Loading..."):null===this.xmlData?e("div",null,"Error loading XML data. Please check the path or URL."):e("lido-home",{initialIndex:this.initialIndex,canplay:this.canplay,xmlData:this.xmlData,baseUrl:this.baseUrl,exitButtonUrl:this.exitButtonUrl,prevButtonUrl:this.prevButtonUrl,nextButtonUrl:this.nextButtonUrl,speakerButtonUrl:this.speakerButtonUrl})}static get assetsDirs(){return["assets"]}},Ii=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.value=void 0,this.height=void 0,this.width=void 0,this.ariaLabel=void 0,this.ariaHidden=void 0,this.x=void 0,this.y=void 0,this.z=void 0,this.bgColor=void 0,this.type=void 0,this.tabIndex=void 0,this.visible=void 0,this.audio=void 0,this.onTouch=void 0,this.onInCorrect=void 0,this.onCorrect=void 0,this.onEntry=void 0,this.childElementsLength=void 0,this.minLength=void 0,this.maxLength=void 0,this.direction=void 0,this.minDrops=1,this.maxDrops=1,this.style={},this.display=void 0,this.margin="",this.disableSpeak=!1}componentDidLoad(){h(this.el,this.type),b(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:this.visible?this.display?u(this.display,t):"flex":"none",flexDirection:this.direction?u(this.direction,t):"row",gridTemplateColumns:this.display&&"grid"===u(this.display,t)?"repeat(auto-fill, minmax(186px, auto))":void 0,gap:this.display&&"grid"===u(this.display,t)?"20px":void 0,margin:u(this.margin,t)}}render(){return e(n,{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},e("slot",{key:"194de56621025a4b1a4fdb6ccae347f34dc19fdb"}))}get el(){return r(this)}};Ii.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const Di=class{constructor(i){t(this,i),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.shapeType="circle",this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type)}render(){return e(n,{key:"6712d974e85c5d82dabb5ed0d482ece4b18af16a",class:`lido-shape ${this.shapeType}`,value:this.value,type:this.type,"tab-index":this.tabIndex,style:{height:"polygon"!==this.shapeType?this.height:void 0,width:"polygon"!==this.shapeType?this.width:void 0,top:this.y,left:this.x,display:this.visible?"block":"none",zIndex:this.z,backgroundColor:"polygon"!==this.shapeType?this.bgColor:"transparent",margin:this.margin},"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})}get el(){return r(this)}};Di.style=".lido-shape{position:absolute;top:var(--y);left:var(--x);display:var(--display);z-index:var(--z)}.lido-rectangle{border-radius:0}.lido-circle{width:var(--width);height:var(--width);border-radius:50%;background-color:var(--bgColor)}.lido-ellipse{width:var(--width);height:var(--height);border-radius:50%;background-color:var(--bgColor)}.lido-triangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(50% 0%, 100% 100%, 0% 100%)}.lido-rightTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(100% 0%, 100% 100%, 0% 100%)}.lido-leftTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--triangleBgColor);clip-path:polygon(0% 0%, 100% 100%, 0% 100%)}.lido-parallelogram{width:var(--paralleWidth);height:var(--paralleHeight);transform:skew(20deg)}.lido-star{width:var(--starWidth);height:var(--starHeight);background-color:var(--starBgColor);clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)}.lido-pentagon{width:var(--pentagonWidth);height:var(--pentagonHeight);background-color:var(--pentagonBgColor);clip-path:polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)}.lido-heptagon{width:var(--heptagonWidth);height:var(--heptagonHeight);background-color:var(--heptagonBgColor);clip-path:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)}.lido-octagon{width:var(--octagonWidth);height:var(--octagonHeight);background-color:var(--octagonBgColor);clip-path:polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%)}.lido-rhombus{width:var(--rhombusWidth);height:var(--rhombusHeight);background-color:var(--rhombusBgColor);clip-path:polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)}.lido-heart{height:var(--heartHeight);width:var(--heartWidth);border-image:radial-gradient(var(--heartBgColor) 69%, #0000 70%) 84.5%/50%;clip-path:polygon(-41% 0, 50% 91%, 141% 0)}";const Li=class{constructor(i){t(this,i),this.originalHeight=null,this.originalY=null,this.id="lido-slide-fill",this.width=void 0,this.height=void 0,this.x=void 0,this.y=void 0,this.z=void 0,this.bgColor=void 0,this.visible=void 0,this.margin=void 0,this.padding="",this.borderRadius="0px",this.fill=void 0,this.numberType="integer",this.min=0,this.division=5,this.max=10,this.slider=void 0,this.src=void 0,this.fillDirection=void 0,this.type="",this.onEntry="",this.svgContent="",this.style=void 0,this.delayVisible="",this.disableSpeak=!1}async componentWillLoad(){await this.renderSVG(),this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}async onSrcChange(){await this.renderSVG(),this.onPropChange()}async renderSVG(){const t=await fetch(c(this.src));if(t.ok){let i=await t.text(),e=0;i=i.replace(/<path([^>]*)>/g,((t,i)=>(e++,`<path id="${1===e?"glassPath":2===e?"rulerPath":`path${e}`}"${i}>`))),i=i.replace(/<svg([^>]*)>/,'<svg$1>\n \n <clipPath id="clipGlass">\n <use xlink:href="#glassPath" />\n </clipPath>\n \n '),i=i.replace(/<rect([^>]*)\/?>/,'<rect id="fillArea" $1 clip-path="url(#clipGlass)" />'),this.svgContent=i}}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),this.updateFill(),this.addRulerNumbers()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:u(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:u(this.margin,t),padding:u(this.padding,t),borderRadius:this.borderRadius}}onPropChange(){this.updateFill(),this.addRulerNumbers()}updateFill(){var t;const i=null===(t=this.el.querySelector(".svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#fillArea");if(!e)return;const n=this.fillDirection;let r,o;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("height")||100,this.originalY=+e.getAttribute("y")||0),r=this.originalHeight,o=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("width")||100,this.originalY=+e.getAttribute("x")||0),r=this.originalHeight,o=this.originalY);const s=r,a=o;let h=0;if("string"==typeof this.fill){const t=this.fill.match(/^(\d+(?:\.\d+)?)%$/);if(t)h=Math.min(Math.max(parseFloat(t[1])/100,0),1);else{const t=this.fill.match(/^(\d+(?:\.\d+)?)$/);t&&(h=Math.min(Math.max(parseFloat(t[1])/100,0),1))}}const c=s*h,l="vertical"===n?a+(s-c):a;"vertical"===n?(e.setAttribute("height",c.toString()),e.setAttribute("y",l.toString())):(e.setAttribute("width",c.toString()),e.setAttribute("x","0"))}addRulerNumbers(){var t;const i=null===(t=this.el.querySelector(".svg-element"))||void 0===t?void 0:t.querySelector("svg");if(!i)return;const e=i.querySelector("#rulerPath");if(!e)return;i.querySelectorAll(".ruler-number").forEach((t=>t.remove()));const n=this.division,r=n+1,o=e.getTotalLength(),s=(this.max-this.min)/n;for(let t=0;t<r;t++){let r=0;"vertical"===this.fillDirection?r=this.max-t*s:"horizontal"===this.fillDirection&&(r=this.min+t*s);const a=e.getPointAtLength(o/n*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),c=B(r/this.max);r="integer"===this.numberType?Math.round(r):"decimal"===this.numberType?parseFloat(r.toFixed(1)):c.toFraction(!0),h.classList.add("ruler-number"),h.setAttribute("x",a.x.toString()),h.setAttribute("y",(a.y+15).toString()),h.setAttribute("text-anchor","end"),h.setAttribute("font-size","40"),h.setAttribute("fill","#333"),h.textContent=r.toString(),i.appendChild(h)}}render(){return e(n,{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},e("div",{key:"386330e0562851f2f00aba169018c23bf5ffa4b7",innerHTML:this.svgContent,class:"svg-element"}))}get el(){return r(this)}static get watchers(){return{src:["onSrcChange"],fill:["onPropChange"],division:["onPropChange"],fillDirection:["onPropChange"],numberType:["onPropChange"],min:["onPropChange"],max:["onPropChange"]}}};Li.style=".svg-element,svg{width:100%;height:100%}";const Fi=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.value="",this.string="",this.fontFamily="",this.fontSize="20px",this.fontColor="",this.highlightWhileSpeaking=!1,this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.borderImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.minDrops=1,this.maxDrops=1,this.onEntry="",this.margin="",this.padding="",this.borderRadius="0px",this.spanType="",this.style={},this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){a(this.el,this.delayVisible),h(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=this.borderImage?c(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,i),width:u(this.width,i),backgroundColor:u(this.bgColor,i),top:u(this.y,i),left:u(this.x,i),zIndex:this.z,fontSize:u(this.fontSize,i),fontFamily:this.fontFamily,color:u(this.fontColor,i),display:"true"===u(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:u(this.margin,i),padding:u(this.padding,i),borderRadius:u(this.borderRadius,i)}}async addSpanToText(){const t=this.el.querySelector(".lido-text-content");if(!t)return;const i=t.textContent||"";t.innerHTML="","letters"===this.spanType&&i.split("").forEach((i=>{if(""===i.trim())return;const e=document.createElement("span");e.textContent=i,e.className="text-letters",t.appendChild(e)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const e=document.createElement("span");e.textContent=i,e.className="text-words",t.appendChild(e)}))}render(){return e(n,{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?e("div",{class:"lido-text-content"},this.string):this.string)}get el(){return r(this)}};Fi.style=".lido-text{transition:background-color 0.3s ease;user-select:none;align-items:center;justify-content:center;text-align:center;border-radius:24px;color:#333;cursor:pointer;font-family:'Baloo Bhai 2', serif}.text-letters{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-letters.letter-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-letter-bounce 0.4s}.text-words{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-words.word-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-word-bounce 0.4s}@keyframes text-letter-bounce{0%{transform:scale(1)}60%{transform:scale(1.4)}100%{transform:scale(1)}}@keyframes text-word-bounce{0%{transform:scale(1)}60%{transform:scale(1.3)}100%{transform:scale(1)}}";const Ri=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.audioUrls=[],this.currentSvgIndex=0,this.moving=!1,this.value="",this.height="auto",this.width="auto",this.audio="",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=X.ShowFlow,this.fingerHintUrl="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.svg",this.onInCorrect=void 0,this.onCorrect=void 0,this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.disableSpeak=!1,this.style={},this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:100,freeTraceProximityThreshold:50,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null};const i=this.svgUrls[this.currentSvgIndex];console.log("Loading SVG from URL:",i),i&&""!==i.trim()?(await this.fetchSVG(c(i)),console.log("SVG fetched successfully\n"),await this.loadAnotherSVG(t,!0)):console.error("No SVG URL provided or index out of bounds.")}componentDidLoad(){a(this.el,this.delayVisible)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this)),this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),console.log("svgUrls",this.svgUrls),this.currentSvgIndex=0,console.log("curentSvgIndex",this.currentSvgIndex),this.showSpeakIcon&&(N(this.el),this.el.append(N(this.el))),this.initializeSVG()}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}resetIdleTimer(t){null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.showFingerHint(t)}),3e3)}showFingerHint(t){var i;if(this.fingerImg)return;const e=t.paths[t.currentPathIndex];if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","image"),r=new Image;r.onload=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",c(this.fingerHintUrl))},r.onerror=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",c(H))},r.src=c(this.fingerHintUrl||H),n.setAttribute("width","40"),n.setAttribute("height","40"),n.setAttribute("id","lido-finger-hint"),n.style.pointerEvents="none",n.style.opacity="0.8",n.setAttribute("x","0"),n.setAttribute("y","0");const o=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");o.setAttribute("dur","2s"),o.setAttribute("repeatCount","indefinite");const s=document.createElementNS("http://www.w3.org/2000/svg","mpath");s.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),o.appendChild(s),n.appendChild(o),null===(i=t.svg)||void 0===i||i.appendChild(n),this.fingerImg=n}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(t){console.log(`Fetching SVG from: ${t}`);const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch SVG (${t}): ${i.statusText}`);return await i.text()}calculateBoundingBox(t,i=22){let e=1/0,n=1/0,r=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let s=0;s<=100;s++){const a=t.getPointAtLength(s/100*i);a.x<e&&(e=a.x),a.y<n&&(n=a.y),a.x>r&&(r=a.x),a.y>o&&(o=a.y)}})),e-=i,n-=i,r+=i,o+=i,{minX:e,minY:n,maxX:r,maxY:o}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const e=i.querySelector("svg");e.removeAttribute("width"),e.removeAttribute("height");const n=e.querySelectorAll("path, line"),r=this.calculateBoundingBox(Array.from(n));e.setAttribute("viewBox",`${r.minX} ${r.minY} ${r.maxX-r.minX} ${r.maxY-r.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t){var i;if(!t)return;const e=t.ownerSVGElement;if(!e)return;const n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d",t.getAttribute("d")||""),n.setAttribute("stroke","blue"),n.setAttribute("stroke-width","2"),n.setAttribute("stroke-dasharray","6,6"),n.setAttribute("fill","none"),n.setAttribute("class","lido-flow-indicator"),null===(i=t.parentNode)||void 0===i||i.appendChild(n);let r=e.querySelector("defs#lido-flow-defs");r||(r=document.createElementNS("http://www.w3.org/2000/svg","defs"),r.setAttribute("id","lido-flow-defs"),e.insertBefore(r,e.firstChild));const o=`arrow-${Math.random().toString(36)}`,s=document.createElementNS("http://www.w3.org/2000/svg","marker");s.setAttribute("id",o),s.setAttribute("markerWidth","10"),s.setAttribute("markerHeight","10"),s.setAttribute("refX","5"),s.setAttribute("refY","5"),s.setAttribute("orient","auto"),s.setAttribute("markerUnits","strokeWidth");const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d","M0,0 L10,5 L0,10 L2,5 Z"),a.setAttribute("fill","blue"),s.appendChild(a),r.appendChild(s),n.setAttribute("marker-end",`url(#${o})`),n}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===X.NoFlow?i.style.display="none":t.mode===X.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,e)=>{const n=i.getTotalLength();i.setAttribute("id","lido-path-"+e);const r=i.cloneNode();r.style.opacity="100",r.style["stroke-opacity"]="100";const o=i.style["stroke-width"]||i.getAttribute("stroke-width");r.setAttribute("stroke-width",o),r.setAttribute("stroke-dasharray",n.toString()),r.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(r,i),i.setAttribute("class","lido-trace-path"),r.setAttribute("class","lido-trace-path-green"),i.greenPath=r,i.classList.add(t.mode),t.mode===X.BlindTracing||t.mode===X.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",o),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",n.toString()),i.setAttribute("stroke-dashoffset","0")),e===t.currentPathIndex&&t.mode===X.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const e=t.paths[0].getPointAtLength(0),n=document.createElementNS("http://www.w3.org/2000/svg","circle");t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width"),n.setAttribute("id","lido-draggableCircle"),n.setAttribute("cx",e.x.toString()),n.setAttribute("cy",e.y.toString()),n.setAttribute("r","calc(20)"),n.setAttribute("fill","#CF1565"),null===(i=t.svg)||void 0===i||i.appendChild(n),t.circle=n,this.resetIdleTimer(t)}addEventListeners(t){var i,e,n,r;if(!t.circle||!t.paths||0===t.paths.length)return;t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const e=this.getPointerPosition(i,t.svg),n={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};this.getDistanceSquared(e,n)<=t.proximityThreshold*t.proximityThreshold&&(t.isDragging=!0,t.activePointerId=i.pointerId,t.circle.setPointerCapture(i.pointerId)),this.hideFingerHint(),this.resetIdleTimer(t)})),null===(i=t.svg)||void 0===i||i.addEventListener("pointermove",(i=>{t.isDragging&&i.pointerId===t.activePointerId&&(t.pointerMoveEvent=i,t.rafId||(t.rafId=requestAnimationFrame((()=>{this.handlePointerMove(t),t.rafId=null}))))}));const o=i=>{i.pointerId===t.activePointerId&&(t.isDragging=!1,t.activePointerId=null,this.hideFingerHint(),this.resetIdleTimer(t))};null===(e=t.svg)||void 0===e||e.addEventListener("pointerup",o),null===(n=t.svg)||void 0===n||n.addEventListener("pointercancel",o),null===(r=t.svg)||void 0===r||r.addEventListener("contextmenu",(t=>{t.preventDefault()}))}handlePointerMove(t){var i,e,n,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;this.hideFingerHint();const o=this.getPointerPosition(t.pointerMoveEvent,t.svg),s={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},a=t.paths[t.currentPathIndex];if(!a)return void console.error("No valid path found at the current index");let h;if(h=t.mode===X.FreeTrace||t.mode===X.BlindFreeTrace?t.freeTraceProximityThreshold*t.freeTraceProximityThreshold:t.proximityThreshold*t.proximityThreshold,this.getDistanceSquared(o,s)>h)return;const c=this.getClosestPointOnPath(a,o);if(!(this.getDistanceSquared(o,c)>h))if(t.mode!==X.FreeTrace&&t.mode!==X.BlindFreeTrace)t.isDragging&&c.length>=t.lastLength&&(t.lastLength=c.length,t.circle.setAttribute("cx",c.x.toString()),t.circle.setAttribute("cy",c.y.toString()),null===(n=t.svg)||void 0===n||n.appendChild(t.circle),null===(r=a.greenPath)||void 0===r||r.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString())),t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer();else{if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","path"),n=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("stroke-width",n),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke","lightgreen"),e.setAttribute("d",`M${o.x},${o.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.lastPointerPos=o}const n=t.lastPointerPos||o,r=t.currentFreePath[t.currentPathIndex].getAttribute("d");t.currentFreePath[t.currentPathIndex].setAttribute("d",`${r} Q ${n.x},${n.y} ${(n.x+o.x)/2},${(n.y+o.y)/2}`),t.circle.setAttribute("cx",o.x.toString()),t.circle.setAttribute("cy",o.y.toString()),null===(e=t.svg)||void 0===e||e.appendChild(t.circle),t.lastPointerPos=o,a.getTotalLength()-c.length<5&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null)}}async moveToNextContainer(){if(!this.moving){if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),console.log(`Moving to next container after SVG index: ${this.currentSvgIndex}`),this.currentSvgIndex<this.svgUrls.length-1)return await new Promise((t=>setTimeout(t,1e3))),this.currentSvgIndex++,await this.initializeSVG(),void(this.moving=!1);this.el&&this.onCorrect&&await p(this.onCorrect,this.el),R()}}getPointerPosition(t,i){var e;const n=i.createSVGPoint();n.x=t.clientX,n.y=t.clientY;const r=null===(e=i.getScreenCTM())||void 0===e?void 0:e.inverse();return r?n.matrixTransform(r):{x:t.clientX,y:t.clientY}}getDistanceSquared(t,i){const e=t.x-i.x,n=t.y-i.y;return e*e+n*n}getClosestPointOnPath(t,i){const e=t.getTotalLength();let n={x:0,y:0,length:0},r=1/0,o={x:0,y:0,length:0},s=1/0;for(let n=0;n<=e;n+=20){const e=t.getPointAtLength(n),r=this.getDistanceSquared(i,e);r<s&&(s=r,o={x:e.x,y:e.y,length:n})}const a=Math.max(o.length-20,0),h=Math.min(o.length+20,e);for(let e=a;e<=h;e+=2){const o=t.getPointAtLength(e),s=this.getDistanceSquared(i,o);s<r&&(r=s,n={x:o.x,y:o.y,length:e})}return n}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(c(this.svgSource.split(";").map((t=>t.trim()))[this.currentSvgIndex]));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==X.BlindTracing&&this.mode!==X.BlindFreeTrace||t.svg.querySelectorAll("image").forEach((t=>{t.style.display="none"})),t.paths=this.getPaths(t.svg),this.setupDrawingPath(t),this.setupDraggableCircle(t),this.addEventListeners(t)}catch(t){console.error(`Error loading SVG (${this.svgSource}):`,t)}}cleanupPreviousSVG(t){var i,e;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(e=t.svg)||void 0===e?void 0:e.querySelectorAll(".lido-flow-indicator")).forEach((t=>{t.remove()})),t.currentPathIndex=0,t.lastLength=0,t.totalPathLength=t.paths[0].getTotalLength(),this.hideFingerHint(),this.resetIdleTimer(t)}async moveToNextPath(t){var i,e;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const n=t.paths[t.currentPathIndex];if(!n)return void console.error("No valid path found at the next index");t.totalPathLength=n.getTotalLength();const r=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",r.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",r.y.toString()),t.mode===X.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(n)),this.resetIdleTimer(t)}async playTraceAnimation(){const t=document.getElementById(this.id);t&&(t.classList.add("trace-animate"),await new Promise((t=>setTimeout(t,500))),t.classList.remove("trace-animate"))}async highlightLetter(t){if(!document.getElementById(P))return;if(!this.el)return;const i=this.highlightTextId;if(!i)return;const e=document.getElementById(i);if(!e)return;const n=this.audio;if(!n)return;this.audioUrls=n.split(";").map((t=>t.trim())),console.log("audioUrls",this.audioUrls);const r=e.getAttribute("span-type");if(!r)return;const o=e.querySelector(".lido-text-content");if(o){if("letters"===r){const i=o.querySelectorAll(".text-letters");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("letter-highlight"),this.audioUrls[this.currentSvgIndex])){console.log("Playing audio:",this.audioUrls[this.currentSvgIndex]);const t=new Audio(c(this.audioUrls[this.currentSvgIndex]));await t.play()}}if("words"===r){const i=o.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("word-highlight"),this.audioUrls[this.currentSvgIndex])){const t=new Audio(c(this.audioUrls[this.currentSvgIndex]));await t.play()}}}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z}}render(){return e(n,{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},e("div",{key:"4e650d7142c61549aec021fd2a8da4e592eaf94e",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return r(this)}static get watchers(){return{svgSource:["initializeSVG"],mode:["initializeSVG"]}}};Ri.style=":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}";const Wi=class{constructor(i){t(this,i),this.showSpeakIcon=!1,this.id=void 0,this.value=void 0,this.height=void 0,this.width=void 0,this.ariaLabel=void 0,this.ariaHidden=void 0,this.x=void 0,this.y=void 0,this.z=void 0,this.bgColor=void 0,this.type=void 0,this.tabIndex=void 0,this.visible=void 0,this.audio=void 0,this.onTouch=void 0,this.onInCorrect=void 0,this.onCorrect=void 0,this.onEntry=void 0,this.childElementsLength=void 0,this.minLength=void 0,this.maxLength=void 0,this.flex=void 0,this.minDrops=1,this.maxDrops=1,this.margin="",this.disableSpeak=!1,this.style=void 0}componentDidLoad(){h(this.el,this.type),b(this.el,this.minLength,this.maxLength,this.childElementsLength),"true"===this.flex&&(this.el.classList.remove("lido-wrap"),this.el.classList.add("lido-flex")),this.showSpeakIcon&&w(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles.bind(this)),window.addEventListener("load",this.updateStyles.bind(this))}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles.bind(this)),window.removeEventListener("load",this.updateStyles.bind(this))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,display:JSON.parse(u(`${this.visible}`,t))?"true"===this.flex?"flex":"grid":"none",margin:u(this.margin,t)}}render(){return e(n,{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},e("slot",{key:"03179b28e45692e61aff0bf3634ef0a72bab0726"}))}get el(){return r(this)}};Wi.style=".lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;background-color:var(--child-bg-color, #f0f0f0);box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}";export{V as lido_avatar,q as lido_balance,K as lido_calculator,J as lido_cell,Q as lido_col,Z as lido_container,tt as lido_flash_card,it as lido_float,et as lido_home,Ai as lido_image,Oi as lido_keyboard,Si as lido_math_matrix,Pi as lido_pos,Ei as lido_random,zi as lido_root,Ii as lido_row,Di as lido_shape,Li as lido_slide_fill,Fi as lido_text,Ri as lido_trace,Wi as lido_wrap}