lido-player 0.0.2-alpha-53-dev → 0.0.2-alpha-55-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.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +4 -2
- package/dist/cjs/{utils-3c1ce74e.js → utils-4b44610b.js} +23 -2
- package/dist/collection/components/calculator/lido-calculator.js +4 -2
- package/dist/collection/utils/customEvents.js +1 -0
- package/dist/collection/utils/utils.js +2 -0
- package/dist/collection/utils/utilsHandlers/animationHandler.js +21 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +0 -2
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-image.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +22 -22
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-b3e67e7f.js → p-0be6b5d5.js} +1 -1
- package/dist/components/{p-df1af62c.js → p-2c518dbe.js} +1 -1
- package/dist/components/{p-92b9ae9e.js → p-2e023f67.js} +1 -1
- package/dist/components/{p-511377d2.js → p-36c2e21a.js} +23 -3
- package/dist/components/{p-cca545f9.js → p-3fc01453.js} +1 -1
- package/dist/components/{p-875c1411.js → p-43d79c61.js} +1 -1
- package/dist/components/{p-9ea1a67d.js → p-5078599e.js} +1 -1
- package/dist/components/{p-09b3b152.js → p-590ce2c9.js} +1 -1
- package/dist/components/{p-567983a9.js → p-67a24ad4.js} +2 -2
- package/dist/components/{p-3f0e4436.js → p-72d6a594.js} +1 -1
- package/dist/components/{p-004adc43.js → p-73b2bd74.js} +6 -4
- package/dist/components/{p-8774f517.js → p-9acf0fcc.js} +1 -1
- package/dist/components/{p-90f7dd48.js → p-b095de27.js} +1 -1
- package/dist/components/{p-057fb7b8.js → p-b0dbee97.js} +21 -21
- package/dist/components/{p-3e8ae1c5.js → p-b847f269.js} +1 -1
- package/dist/components/{p-71ded596.js → p-bc5202db.js} +2 -2
- package/dist/components/{p-d2fe2bb6.js → p-c296051d.js} +1 -1
- package/dist/components/{p-6beee44b.js → p-c69ef266.js} +1 -1
- package/dist/components/{p-d568d595.js → p-ca8aea4b.js} +1 -1
- package/dist/components/{p-561908ec.js → p-de2193c5.js} +1 -1
- package/dist/components/{p-23549651.js → p-e534ea52.js} +1 -1
- package/dist/components/{p-0733b277.js → p-f8c00485.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +4 -2
- package/dist/esm/{utils-eefe4a1c.js → utils-ae1eb036.js} +23 -3
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-589fc3b8.js → p-a632e2ce.js} +2 -2
- package/dist/lido-player/p-f1b879f6.entry.js +1 -0
- package/package.json +1 -1
- package/dist/lido-player/p-4d9ad047.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,g as i,h as e,H as n,a as s,c as o}from"./p-9a9d5339.js";import{c as r,s as a,i as h,a as l,R as c,p as u,e as d,b as f,d as p,g as v,N as g,h as b,j as m,k as w,l as y,m as x,n as k,A as $,o as j,q as _,r as C,t as S,u as O,v as M,w as T,x as P,P as A,L as E,y as L,S as z,z as I,B as D,C as F,D as R,E as N,F as W,G as U,H as B,I as V,T as X,J as H,K as Y}from"./p-a632e2ce.js";var G,q={exports:{}};G=()=>(()=>{var t=[,(t,i,e)=>{e.r(i),e.d(i,{default:()=>o});var n,s=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var i,e,s=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(),s&&s.Tb()}let i=0,e=0,n=new Map,s=null,o=null;this.requestAnimationFrame=function(s){i||(i=requestAnimationFrame(t.bind(this)));const o=++e;return n.set(o,s),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)),s=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),s=null},this.ob=function(){}}function r(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}}s.ready=new Promise(((t,n)=>{i=t,e=n}));const a=s.onRuntimeInitialized;s.onRuntimeInitialized=function(){a&&a();let t=s.decodeAudio;s.decodeAudio=function(i,e){e(i=t(i))};let i=s.decodeFont;s.decodeFont=function(t,e){e(t=i(t))};const e=s.FileAssetLoader;s.ptrToAsset=t=>{let i=s.ptrToFileAsset(t);return i.isImage?s.ptrToImageAsset(t):i.isFont?s.ptrToFontAsset(t):i.isAudio?s.ptrToAudioAsset(t):i},s.CustomFileAssetLoader=e.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Gb=t},loadContents:function(t,i){return t=s.ptrToAsset(t),this.Gb(t,i)}}),s.CDNFileAssetLoader=e.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=s.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}}),s.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=s.computeAlignment;s.computeAlignment=function(t,i,e,s,o=1){return n.call(this,t,i,e,s,o)}};const h="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),l=new function(){function t(){if(!i){var t=document.createElement("canvas"),r={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",r),e=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",r))e=2;else{if(!(a=t.getContext("webgl",r)))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()?(l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),l=!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;l||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),l=!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<((r=a.getProgramInfoLog(t))||"").trim().length)throw r;s=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,s=null,o=null,a=0,h=0,l=!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 s=i.createTexture();return s?(i.bindTexture(i.TEXTURE_2D,s),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),s):null};const c=new r(8),u=new r(8),d=new r(10),f=new r(10);this.Qb=function(e,n,r,l,p){if(t()){var v=c.push(e),g=u.push(n);if(i.canvas){for(var b of(i.canvas.width==v&&i.canvas.height==g||(i.canvas.width=v,i.canvas.height=g),i.viewport(0,g-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),r.sort(((t,i)=>i.wb-t.wb)),v=d.push(l),a!=v&&(i.bufferData(i.ARRAY_BUFFER,8*v,i.DYNAMIC_DRAW),a=v),v=0,r))i.bufferSubData(i.ARRAY_BUFFER,v,b.Ta),v+=4*b.Ta.length;for(var m of(console.assert(v==4*l),r))i.bufferSubData(i.ARRAY_BUFFER,v,m.Db),v+=4*m.Db.length;for(var w of(console.assert(v==8*l),v=f.push(p),h!=v&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*v,i.DYNAMIC_DRAW),h=v),b=0,r))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,b,w.indices),b+=2*w.indices.length;console.assert(b==2*p),w=0,m=!0,v=b=0;for(const t of r){t.image.Ka!=w&&(i.bindTexture(i.TEXTURE_2D,t.image.Ja||null),w=t.image.Ka),t.mc?(i.scissor(t.Ya,g-t.Za-t.jb,t.Ac,t.jb),m=!0):m&&(i.scissor(0,g-n,e,n),m=!1);const a=-2/n;i.uniform4f(s,t.ha[0]*(r=2/e)*t.Ba,t.ha[1]*a*t.Ca,t.ha[2]*r*t.Ba,t.ha[3]*a*t.Ca),i.uniform2f(o,t.ha[4]*r*t.Ba+r*(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*l),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,b),v+=4*t.Ta.length,b+=2*t.indices.length}console.assert(v==4*l),console.assert(b==2*p)}}},this.canvas=function(){return t()&&i.canvas}},c=s.onRuntimeInitialized;s.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<j.length&&(l.Qb($.drawWidth(),$.drawHeight(),j,_,C),j=[],C=_=0,$.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}c&&c();var n=s.RenderPaintStyle;const r=s.RenderPath,a=s.RenderPaint,u=s.Renderer,d=s.StrokeCap,f=s.StrokeJoin,p=s.BlendMode,v=n.fill,g=n.stroke,b=s.FillRule.evenOdd;let m=1;var w=s.RenderImage.extend("CanvasRenderImage",{__construct:function({la:t,xa:i}={}){this.__parent.__construct.call(this),this.Ka=m,m=m+1&2147483647||1,this.la=t,this.xa=i},__destruct:function(){this.Ja&&(l.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=l.Lb(e),i.size(e.width,e.height),i.la&&i.la(i)},e.src=i.Wa}}),y=r.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,s,o,r){var a=this.T,h=a.addPath;t=t.T;const l=new DOMMatrix;l.a=i,l.b=e,l.c=n,l.d=s,l.e=o,l.f=r,h.call(a,t,l)},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,s,o){this.T.bezierCurveTo(t,i,e,n,s,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 s=this.Hb;var o=this.Xa,r=this.ja;if(t.globalCompositeOperation=this.Eb,null!=r){o=r.yb;var a=r.zb;const e=r.bb;var h=r.cb;const n=r.Ra;r.ec?(r=e-o,h-=a,o=t.createRadialGradient(o,a,0,o,a,Math.sqrt(r*r+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(s){case g: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,j=[],_=0,C=0;var S=s.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,s,o){const r=this.S,a=r.length-6;r.splice(a,6,r[a]*t+r[a+2]*i,r[a+1]*t+r[a+3]*i,r[a]*e+r[a+2]*n,r[a+1]*e+r[a+3]*n,r[a]*s+r[a+2]*o+r[a+4],r[a+1]*s+r[a+3]*o+r[a+5]),this.H.push(this.C.transform.bind(this.C,t,i,e,n,s,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===b?"evenodd":"nonzero"))},_drawRiveImage:function(i,e,n){var s=i.Fb;if(s){var o=this.C,r=t(e);this.H.push((function(){o.globalCompositeOperation=r,o.globalAlpha=n,o.drawImage(s,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,r,a,h,c,u,d,f){var p=this.C.canvas.width,v=this.C.canvas.height;const g=d-c,b=f-u;c=Math.max(c,0),u=Math.max(u,0),d=Math.min(d,p),f=Math.min(f,v);const m=d-c,w=f-u;if(console.assert(m<=Math.min(g,p)),console.assert(w<=Math.min(b,v)),!(0>=m||0>=w)){d=m<g||w<b,p=f=1;var y=Math.ceil(m*f),x=Math.ceil(w*p);v=l.hc(),y>v&&(f*=v/y,y=v),x>v&&(p*=v/x,x=v),$||($=new s.DynamicRectanizer(v),$.reset(512,512)),0>(v=$.addRect(y,x))&&(e(),k.add(this),v=$.addRect(y,x),console.assert(0<=v));var S=65535&v,O=v>>16;j.push({ha:this.S.slice(this.S.length-6),image:i,Ya:S,Za:O,ic:c,jc:u,Ac:y,jb:x,Ba:f,Ca:p,Ta:new Float32Array(r),Db:new Float32Array(a),indices:new Uint16Array(h),mc:d,wb:i.Ka<<1|(d?1:0)}),_+=r.length,C+=h.length;var M=this.C,T=t(n);this.H.push((function(){M.save(),M.resetTransform(),M.globalCompositeOperation=T,M.globalAlpha=o;const t=l.canvas();t&&M.drawImage(t,S,O,y,x,c,u,m,w),M.restore()}))}},_clipPath:function(t){this.H.push(this.C.clip.bind(this.C,t.T,t.Va===b?"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)}});s.makeRenderer=function(t){const i=new S(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,s){if(n in e)return i.H.push((()=>{e[n]=s})),!0}})},s.decodeImage=function(t,i){new w({la:i}).decode(t)},s.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=M;return new w({xa:()=>{t.total++},la:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let O=s.load,M=null;s.load=function(t,i,e=!0){const n=new s.FallbackFileAssetLoader;return void 0!==i&&n.addLoader(i),e&&(i=new s.CDNFileAssetLoader,n.addLoader(i)),new Promise((function(i){let e=null;M={total:0,loaded:0,ready:function(){i(e)}},e=O(t,n),0==M.total&&i(e)}))};let T=s.RendererWrapper.prototype.align;s.RendererWrapper.prototype.align=function(t,i,e,n,s=1){T.call(this,t,i,e,n,s)},n=new o,s.requestAnimationFrame=n.requestAnimationFrame.bind(n),s.cancelAnimationFrame=n.cancelAnimationFrame.bind(n),s.enableFPSCounter=n.Rb.bind(n),s.disableFPSCounter=n.Ob,n.ob=e,s.resolveAnimationFrame=e,s.cleanup=function(){$&&$.delete()}};var u,d,f=Object.assign({},s),p="./this.program",v="object"==typeof window,g="function"==typeof importScripts,b="";(v||g)&&(g?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),n&&(b=n),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",g&&(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 m,w=s.print||console.log.bind(console),y=s.printErr||console.error.bind(console);Object.assign(s,f),f=null,s.thisProgram&&(p=s.thisProgram),s.wasmBinary&&(m=s.wasmBinary),"object"!=typeof WebAssembly&&W("no native wasm support detected");var x,k,$,j,_,C,S,O,M,T,P=!1;function A(){var t=x.buffer;s.HEAP8=$=new Int8Array(t),s.HEAP16=_=new Int16Array(t),s.HEAP32=S=new Int32Array(t),s.HEAPU8=j=new Uint8Array(t),s.HEAPU16=C=new Uint16Array(t),s.HEAPU32=O=new Uint32Array(t),s.HEAPF32=M=new Float32Array(t),s.HEAPF64=T=new Float64Array(t)}var E,L=[],z=[],I=[];function D(){var t=s.preRun.shift();L.unshift(t)}var F,R=0,N=null;function W(t){throw s.onAbort&&s.onAbort(t),y(t="Aborted("+t+")"),P=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),e(t),t}function U(t){return t.startsWith("data:application/octet-stream;base64,")}if(!U(F="canvas_advanced.wasm")){var B=F;F=s.locateFile?s.locateFile(B,b):b+B}function V(t){if(t==F&&m)return new Uint8Array(m);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}function X(t,i,e){return function(t){if(!m&&(v||g)){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((()=>V(t)));if(u)return new Promise(((i,e)=>{u(t,(t=>i(new Uint8Array(t))),e)}))}return Promise.resolve().then((()=>V(t)))}(t).then((t=>WebAssembly.instantiate(t,i))).then((t=>t)).then(e,(t=>{y("failed to asynchronously prepare wasm: "+t),W(t)}))}var H,Y,G={446236:(t,i,e,n,s)=>{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=s;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((()=>{Oe(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,s,o)=>{if(void 0===window.h)return-1;var r={},a={};return t==window.h.I.ya&&0!=e&&(a.sampleRate=e),r.J=new(window.AudioContext||window.webkitAudioContext)(a),r.J.suspend(),r.state=window.h.ga.stopped,e=0,t!=window.h.I.ya&&(e=i),r.Z=r.J.createScriptProcessor(n,e,i),r.Z.onaudioprocess=function(e){if(null!=r.sa&&0!=r.sa.length||(r.sa=new Float32Array(M.buffer,s,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),l=r.sa,c=0;c<n;c+=1)l[c*i+a]=h[c];Te(o,n,s)}if(t==window.h.I.ya||t==window.h.I.La)for(Pe(o,n,s),a=0;a<e.outputBuffer.numberOfChannels;++a)for(h=e.outputBuffer.getChannelData(a),l=r.sa,c=0;c<n;c+=1)h[c]=l[c*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){r.Da=r.J.createMediaStreamSource(t),r.Da.connect(r.Z),r.Z.connect(r.J.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.ya&&r.Z.connect(r.J.destination),r.pb=o,window.h.yc(r)},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()(s)},K=(t,i)=>{for(var e=0,n=t.length-1;0<=n;n--){var s=t[n];"."===s?t.splice(n,1):".."===s?(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);W("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 s=t[i++];if(128&s){var o=63&t[i++];if(192==(224&s))n+=String.fromCharCode((31&s)<<6|o);else{var r=63&t[i++];65536>(s=224==(240&s)?(15&s)<<12|o<<6|r:(7&s)<<18|o<<12|r<<6|63&t[i++])?n+=String.fromCharCode(s):(s-=65536,n+=String.fromCharCode(55296|s>>10,56320|1023&s))}}else n+=String.fromCharCode(s)}return n},st=[],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},rt=(t,i,e,n)=>{if(!(0<n))return 0;var s=e;n=e+n-1;for(var o=0;o<t.length;++o){var r=t.charCodeAt(o);if(55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++o)),127>=r){if(e>=n)break;i[e++]=r}else{if(2047>=r){if(e+1>=n)break;i[e++]=192|r>>6}else{if(65535>=r){if(e+2>=n)break;i[e++]=224|r>>12}else{if(e+3>=n)break;i[e++]=240|r>>18,i[e++]=128|r>>12&63}i[e++]=128|r>>6&63}i[e++]=128|63&r}}return i[e]=0,e-s};function at(t,i){var e=Array(ot(t)+1);return t=rt(t,e,0,e.length),i&&(e.length=t),e}var ht=[];function lt(t,i){ht[t]={input:[],F:[],V:i},Ft(t,ct)}var ct={open:function(t){var i=ht[t.node.za];if(!i)throw new _t(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 _t(60);for(var s=0,o=0;o<n;o++){try{var r=t.s.V.ib(t.s)}catch(t){throw new _t(29)}if(void 0===r&&0===s)throw new _t(6);if(null==r)break;s++,i[e+o]=r}return s&&(t.node.timestamp=Date.now()),s},write:function(t,i,e,n){if(!t.s||!t.s.V.Oa)throw new _t(60);try{for(var s=0;s<n;s++)t.s.V.Oa(t.s,i[e+s])}catch(t){throw new _t(29)}return n&&(t.node.timestamp=Date.now()),s}},ut={ib:function(){t:{if(!st.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}st=at(t,!0)}t=st.shift()}return t},Oa:function(t,i){null===i||10===i?(w(nt(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(w(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,gt,bt,mt={O:null,U:()=>mt.createNode(null,"/",16895,0),createNode(t,i,e,n){if(24576==(61440&e)||4096==(61440&e))throw new _t(63);return mt.O||(mt.O={dir:{node:{Y:mt.l.Y,P:mt.l.P,ka:mt.l.ka,va:mt.l.va,ub:mt.l.ub,Ab:mt.l.Ab,vb:mt.l.vb,sb:mt.l.sb,Ea:mt.l.Ea},stream:{ba:mt.m.ba}},file:{node:{Y:mt.l.Y,P:mt.l.P},stream:{ba:mt.m.ba,read:mt.m.read,write:mt.m.write,pa:mt.m.pa,lb:mt.m.lb,nb:mt.m.nb}},link:{node:{Y:mt.l.Y,P:mt.l.P,ma:mt.l.ma},stream:{}},$a:{node:{Y:mt.l.Y,P:mt.l.P},stream:Dt}}),16384==(61440&(e=Pt(t,i,e,n)).mode)?(e.l=mt.O.dir.node,e.m=mt.O.dir.stream,e.j={}):32768==(61440&e.mode)?(e.l=mt.O.file.node,e.m=mt.O.file.stream,e.v=0,e.j=null):40960==(61440&e.mode)?(e.l=mt.O.link.node,e.m=mt.O.link.stream):8192==(61440&e.mode)&&(e.l=mt.O.$a.node,e.m=mt.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 Ct[44]},va:(t,i,e,n)=>mt.createNode(t,i,e,n),ub(t,i,e){if(16384==(61440&t.mode)){try{var n=Tt(i,e)}catch(t){}if(n)for(var s in n.j)throw new _t(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=Tt(t,i);for(e in n.j)throw new _t(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=mt.createNode(t,i,41471,0)).link=e,t),ma(t){if(40960!=(61440&t.mode))throw new _t(28);return t.link}},m:{read(t,i,e,n,s){var o=t.node.j;if(s>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-s,n))&&o.subarray)i.set(o.subarray(s,s+t),e);else for(n=0;n<t;n++)i[e+n]=o[s+n];return t},write(t,i,e,n,s,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===s)return t.j=i.slice(e,e+n),t.v=n;if(s+n<=t.v)return t.j.set(i.subarray(e,e+n),s),n}if(ft(t,s+n),t.j.subarray&&i.subarray)t.j.set(i.subarray(e,e+n),s);else for(o=0;o<n;o++)t.j[s+o]=i[e+o];return t.v=Math.max(t.v,s+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 _t(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,s){if(32768!=(61440&t.node.mode))throw new _t(43);if(t=t.node.j,2&s||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,W(),!(i=void 0))throw new _t(48);$.set(t,i)}else e=!1,i=t.byteOffset;return{o:i,M:e}},nb:(t,i,e,n)=>(mt.m.write(t,i,0,n,e,!1),0)}},wt=null,yt={},xt=[],kt=1,$t=null,jt=!0,_t=null,Ct={},St=(t,i={})=>{if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Qa:0},i)).Qa)throw new _t(32);t=t.split("/").filter((t=>!!t));for(var e=wt,n="/",s=0;s<t.length;s++){var o=s===t.length-1;if(o&&i.parent)break;if(e=Tt(e,t[s]),n=J(n+"/"+t[s]),e.wa&&(!o||o&&i.gb)&&(e=e.wa.root),!o||i.fb)for(o=0;40960==(61440&e.mode);)if(e=Bt(n),n=it(Q(n),e),e=St(n,{Qa:i.Qa+1}).node,40<o++)throw new _t(32)}return{path:n,node:e}},Ot=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}},Mt=(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},Tt=(t,i)=>{var e;if(e=(e=Et(t,"x"))?e:t.l.ka?0:2)throw new _t(e,t);for(e=$t[Mt(t.id,i)];e;e=e.lc)if(e.parent.id===t.id&&e.name===i)return e;return t.l.ka(t,i)},Pt=(t,i,e,n)=>(t=new ke(t,i,e,n),i=Mt(t.parent.id,t.name),t.lc=$t[i],$t[i]=t),At=t=>{var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i},Et=(t,i)=>jt?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2,Lt=(t,i)=>{try{return Tt(t,i),20}catch(t){}return Et(t,"wx")},zt=t=>{if(!(t=xt[t]))throw new _t(8);return t},It=(t,i=-1)=>(gt||((gt=function(){this.h={}}).prototype={},Object.defineProperties(gt.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 gt,t),-1==i&&(i=(()=>{for(var t=0;4096>=t;t++)if(!xt[t])return t;throw new _t(33)})()),t.X=i,xt[i]=t),Dt={open:t=>{t.m=yt[t.node.za].m,t.m.open&&t.m.open(t)},ba:()=>{throw new _t(70)}},Ft=(t,i)=>{yt[t]={m:i}},Rt=(t,i)=>{var e="/"===i,n=!i;if(e&&wt)throw new _t(10);if(!e&&!n){var s=St(i,{gb:!1});if(i=s.path,(s=s.node).wa)throw new _t(10);if(16384!=(61440&s.mode))throw new _t(54)}(t=t.U(i={type:t,Qc:{},mb:i,kc:[]})).U=i,i.root=t,e?wt=t:s&&(s.wa=i,s.U&&s.U.kc.push(i))},Nt=(t,i,e)=>{var n=St(t,{parent:!0}).node;if(!(t=Z(t))||"."===t||".."===t)throw new _t(28);var s=Lt(n,t);if(s)throw new _t(s);if(!n.l.va)throw new _t(63);return n.l.va(n,t,i,e)},Wt=(t,i,e)=>{void 0===e&&(e=i,i=438),Nt(t,8192|i,e)},Ut=(t,i)=>{if(!it(t))throw new _t(44);var e=St(i,{parent:!0}).node;if(!e)throw new _t(44);i=Z(i);var n=Lt(e,i);if(n)throw new _t(n);if(!e.l.Ea)throw new _t(63);e.l.Ea(e,i,t)},Bt=t=>{if(!(t=St(t).node))throw new _t(44);if(!t.l.ma)throw new _t(28);return it(Ot(t.parent),t.l.ma(t))},Vt=(t,i,e)=>{if(""===t)throw new _t(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=St(t,{fb:!(131072&i)}).node}catch(t){}}if(n=!1,64&i)if(o){if(128&i)throw new _t(20)}else o=Nt(t,e,0),n=!0;if(!o)throw new _t(44);if(8192==(61440&o.mode)&&(i&=-513),65536&i&&16384!=(61440&o.mode))throw new _t(54);if(!n&&(e=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==At(i)||512&i)?31:Et(o,At(i)):44))throw new _t(e);if(512&i&&!n){if(!(e="string"==typeof(e=o)?St(e,{fb:!0}).node:e).l.P)throw new _t(63);if(16384==(61440&e.mode))throw new _t(31);if(32768!=(61440&e.mode))throw new _t(28);if(n=Et(e,"w"))throw new _t(n);e.l.P(e,{size:0,timestamp:Date.now()})}return i&=-131713,(o=It({node:o,path:Ot(o),flags:i,seekable:!0,position:0,m:o.m,zc:[],error:!1})).m.open&&o.m.open(o),!s.logReadFiles||1&i||(bt||(bt={}),t in bt||(bt[t]=1)),o},Xt=(t,i,e)=>{if(null===t.X)throw new _t(8);if(!t.seekable||!t.m.ba)throw new _t(70);if(0!=e&&1!=e&&2!=e)throw new _t(28);t.position=t.m.ba(t,i,e),t.zc=[]},Ht=()=>{_t||((_t=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(),_t.prototype.constructor=_t,[44].forEach((t=>{Ct[t]=new _t(t),Ct[t].stack="<generic error, no stack>"})))},Yt=(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 s=vt++<<8;Ft(s,{open:t=>{t.seekable=!1},close:()=>{e&&e.buffer&&e.buffer.length&&e(10)},read:(t,e,n,s)=>{for(var o=0,r=0;r<s;r++){try{var a=i()}catch(t){throw new _t(29)}if(void 0===a&&0===o)throw new _t(6);if(null==a)break;o++,e[n+r]=a}return o&&(t.node.timestamp=Date.now()),o},write:(t,i,n,s)=>{for(var o=0;o<s;o++)try{e(i[n+o])}catch(t){throw new _t(29)}return s&&(t.node.timestamp=Date.now()),o}}),Wt(t,n,s)},Gt={},qt=void 0;function Kt(){return S[(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),si=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 ri=void 0,ai=void 0;function hi(t){for(var i="";j[t];)i+=ai[j[t++]];return i}var li=[];function ci(){for(;li.length;){var t=li.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 Ce(t),i}function gi(t,i){var e=pi[t];return void 0===e&&ei(i+" has unknown type "+vi(t)),e}function bi(){}var mi=!1;function wi(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 ji(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},_i(Object.create(t,{g:{value:i}}))}function _i(t){return"undefined"==typeof FinalizationRegistry?(_i=t=>t,t):(mi=new FinalizationRegistry((t=>{wi(t.g)})),bi=t=>{mi.unregister(t)},(_i=t=>{var i=t.g;return i.G&&mi.register(t,{g:i},t),t})(t))}var Ci={};function Si(t){for(;t.length;){var i=t.pop();t.pop()(i)}}function Oi(t){return this.fromWireType(S[t>>2])}var Mi={},Ti={};function Pi(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){Ti[t]=i}));var s=Array(i.length),o=[],r=0;i.forEach(((t,i)=>{pi.hasOwnProperty(t)?s[i]=pi[t]:(o.push(t),Mi.hasOwnProperty(t)||(Mi[t]=[]),Mi[t].push((()=>{s[i]=pi[t],++r===o.length&&n(s)})))})),0===o.length&&n(s)}function Ai(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 Ti[t],Mi.hasOwnProperty(t)&&(i=Mi[t],delete Mi[t],i.forEach((t=>t())))}(t,i,e)}function Li(t){ei(t.g.u.i.name+" instance already deleted")}function zi(){}function Ii(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 Di(t,i,e){s.hasOwnProperty(t)?((void 0===e||void 0!==s[t].B&&void 0!==s[t].B[e])&&ei(`Cannot register public name '${t}' twice`),Ii(s,t,t),s.hasOwnProperty(e)&&ei(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`),s[t].B[e]=i):(s[t]=i,void 0!==e&&(s[t].Pc=e))}function Fi(t,i,e,n,s,o,r,a){this.name=t,this.constructor=i,this.N=e,this.W=n,this.A=s,this.Ub=o,this.na=r,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 Ni(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 Wi(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,si((function(){n.delete()}))),null!==t&&t.push(this.W,e)}break;default:ei("Unsupporting sharing policy")}return e}function Ui(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 Bi(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=Wi:(this.toWireType=n?Ni:Ui,this.K=null)}function Vi(t,i,e){s.hasOwnProperty(t)||$i("Replacing nonexistant public symbol"),void 0!==s[t].B&&void 0!==e?s[t].B[e]=i:(s[t]=i,s[t].ea=e)}var Xi=[],Hi=t=>{var i=Xi[t];return i||(t>=Xi.length&&(Xi.length=t+1),Xi[t]=i=E.get(t)),i};function Yi(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=s["dynCall_"+t];n=e&&e.length?n.apply(null,[i].concat(e)):n.call(null,i)}else n=Hi(i).apply(null,e);return n}})(t,i):Hi(i);return"function"!=typeof e&&ei(`unknown function pointer with signature ${t}: ${i}`),e}var Gi=void 0;function qi(t,i){var e=[],n={};throw i.forEach((function t(i){n[i]||pi[i]||(Ti[i]?Ti[i].forEach(t):(e.push(i),n[i]=!0))})),new Gi(`${t}: `+e.map(vi).join([", "]))}function Ki(t,i,e,n,s){var o=i.length;2>o&&ei("argTypes array size mismatch! Must at least get return value and 'this' types!");var r=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,l=o-2,c=Array(l),u=[],d=[];return function(){if(arguments.length!==l&&ei(`function ${t} called with ${arguments.length} arguments, expected ${l} args!`),d.length=0,u.length=r?2:1,u[0]=s,r){var e=i[1].toWireType(d,this);u[1]=e}for(var o=0;o<l;++o)c[o]=i[o+2].toWireType(d,arguments[o]),u.push(c[o]);if(o=n.apply(null,u),a)Si(d);else for(var f=r?1:2;f<i.length;f++)null!==i[f].K&&i[f].K(1===f?e:c[f-2]);return h?i[0].fromWireType(o):void 0}}function Ji(t,i){for(var e=[],n=0;n<t;n++)e.push(O[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?$:j)[t])};case 1:return function(t){return this.fromWireType((e?_:C)[t>>1])};case 2:return function(t){return this.fromWireType((e?S:O)[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(M[t>>2])};case 3:return function(t){return this.fromWireType(T[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 j[t]};case 1:return e?function(t){return _[t>>1]}:function(t){return C[t>>1]};case 2:return e?function(t){return S[t>>2]}:function(t){return O[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var se="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,oe=(t,i)=>{for(var e=t>>1,n=e+i/2;!(e>=n)&&C[e];)++e;if(32<(e<<=1)-t&&se)return se.decode(j.subarray(t,e));for(e="",n=0;!(n>=i/2);++n){var s=_[t+2*n>>1];if(0==s)break;e+=String.fromCharCode(s)}return e},re=(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 s=0;s<e;++s)_[i>>1]=t.charCodeAt(s),i+=2;return _[i>>1]=0,i-n},ae=t=>2*t.length,he=(t,i)=>{for(var e=0,n="";!(e>=i/4);){var s=S[t+4*e>>2];if(0==s)break;++e,65536<=s?(s-=65536,n+=String.fromCharCode(55296|s>>10,56320|1023&s)):n+=String.fromCharCode(s)}return n},le=(t,i,e)=>{if(void 0===e&&(e=2147483647),4>e)return 0;var n=i;e=n+e-4;for(var s=0;s<t.length;++s){var o=t.charCodeAt(s);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++s)),S[i>>2]=o,(i+=4)+4>e)break}return S[i>>2]=0,i-n},ce=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=[],ge=[],be={},me=()=>{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 be)void 0===be[t]?delete i[t]:i[t]=be[t];var e=[];for(t in i)e.push(`${t}=${i[t]}`);fe=e}return fe},we=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}}}),Ht(),$t=Array(4096),Rt(mt,"/"),Nt("/tmp",16895,0),Nt("/home",16895,0),Nt("/home/web_user",16895,0),(()=>{Nt("/dev",16895,0),Ft(259,{read:()=>0,write:(t,i,e,n)=>n}),Wt("/dev/null",259),lt(1280,ut),lt(1536,dt),Wt("/dev/tty",1280),Wt("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,e=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Yt("random",e),Yt("urandom",e),Nt("/dev/shm",16895,0),Nt("/dev/shm/tmp",16895,0)})(),(()=>{Nt("/proc",16895,0);var t=Nt("/proc/self",16895,0);Nt("/proc/self/fd",16895,0),Rt({U:()=>{var i=Pt(t,"fd",16895,73);return i.l={ka:(t,i)=>{var e=zt(+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=s.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,s.count_emval_handles=function(){for(var t=0,i=ti.h;i<ti.M.length;++i)void 0!==ti.M[i]&&++t;return t},ri=s.PureVirtualError=oi("PureVirtualError");for(var $e=Array(256),je=0;256>je;++je)$e[je]=String.fromCharCode(je);ai=$e,s.getInheritedInstanceCount=function(){return Object.keys(di).length},s.getLiveInheritedInstances=function(){var t,i=[];for(t in di)di.hasOwnProperty(t)&&i.push(di[t]);return i},s.flushPendingDeletes=ci,s.setDelayFunction=function(t){ui=t,li.length&&ui&&ui(ci)},ki=s.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},zi.prototype.isAliasOf=function(t){if(!(this instanceof zi&&t instanceof zi))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},zi.prototype.clone=function(){if(this.g.o||Li(this),this.g.ia)return this.g.count.value+=1,this;var t=_i,i=Object,e=i.create,n=Object.getPrototypeOf(this),s=this.g;return(t=t(e.call(i,n,{g:{value:{count:s.count,fa:s.fa,ia:s.ia,o:s.o,u:s.u,G:s.G,L:s.L}}}))).g.count.value+=1,t.g.fa=!1,t},zi.prototype.delete=function(){this.g.o||Li(this),this.g.fa&&!this.g.ia&&ei("Object already scheduled for deletion"),bi(this),wi(this.g),this.g.ia||(this.g.G=void 0,this.g.o=void 0)},zi.prototype.isDeleted=function(){return!this.g.o},zi.prototype.deleteLater=function(){return this.g.o||Li(this),this.g.fa&&!this.g.ia&&ei("Object already scheduled for deletion"),li.push(this),1===li.length&&ui&&ui(ci),this.g.fa=!0,this},Bi.prototype.Vb=function(t){return this.rb&&(t=this.rb(t)),t},Bi.prototype.ab=function(t){this.W&&this.W(t)},Bi.prototype.argPackAdvance=8,Bi.prototype.readValueFromPointer=Oi,Bi.prototype.deleteObject=function(t){null!==t&&t.delete()},Bi.prototype.fromWireType=function(t){function i(){return ji(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 s=yi(e,this.i,(n=this.ta?n.Kb:n.pointerType).i);return null===s?i.call(this):ji(n.i.N,this.ua?{u:n,o:s,L:this,G:t}:{u:n,o:s})},Gi=s.UnboundTypeError=oi("UnboundTypeError");var _e={__syscall_fcntl64:function(t,i,e){qt=e;try{var n=zt(t);switch(i){case 0:var s=Kt();return 0>s?-28:It(n,s).X;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:return s=Kt(),n.flags|=s,0;case 5:return s=Kt(),_[s+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return S[Ae()>>2]=28,-1}}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_ioctl:function(t,i,e){qt=e;try{var n=zt(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 s=Kt();S[s>>2]=25856,S[s+4>>2]=5,S[s+8>>2]=191,S[s+12>>2]=35387;for(var o=0;32>o;o++)$[s+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(s=Kt(),i=[],o=0;32>o;o++)i.push($[s+o+17|0]);return 0;case 21519:return n.s?(s=Kt(),S[s>>2]=0):-59;case 21520:return n.s?-28:-59;case 21531:if(s=Kt(),!n.m.ac)throw new _t(59);return n.m.ac(n,i,s);case 21523:return n.s?(n.s.V.dc&&(o=[24,80],s=Kt(),_[s>>1]=o[0],_[s+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_openat:function(t,i,e,n){qt=n;try{var s=i=i?nt(j,i):"";if("/"===s.charAt(0))i=s;else{var o=-100===t?"/":zt(t).path;if(0==s.length)throw new _t(44);i=J(o+"/"+s)}var r=n?Kt():0;return Vt(i,e,r).X}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return-t.aa}},_embind_create_inheriting_constructor:function(t,i,e){t=hi(t),i=gi(i,"wrapper"),e=ni(e);var n=[].slice,s=i.i,o=s.N,r=s.A.N,a=s.A.constructor;for(var h in t=Qt(t,(function(){s.A.qb.forEach(function(t){if(this[t]===r[t])throw new ri(`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)));bi(t);var i=t.g;t.notifyOnDestruction(),i.ia=!0,Object.defineProperties(this,{g:{value:i}}),_i(this),t=fi(s,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"),bi(this);var t=this.g.o;t=fi(s,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 si(t)},_embind_finalize_value_object:function(t){var i=Ci[t];delete Ci[t];var e=i.Pa,n=i.W,s=i.eb;Pi([t],s.map((t=>t.Yb)).concat(s.map((t=>t.rc))),(t=>{var o={};return s.forEach(((i,e)=>{var n=t[e],r=i.Wb,a=i.Xb,h=t[e+s.length],l=i.qc,c=i.sc;o[i.Sb]={read:t=>n.fromWireType(r(a,t)),write:(t,i)=>{var e=[];l(c,t,h.toWireType(e,i)),Si(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 s in o)if(!(s in i))throw new TypeError(`Missing field: "${s}"`);var r=e();for(s in o)o[s].write(r,i[s]);return null!==t&&t.push(n,r),r},argPackAdvance:8,readValueFromPointer:Oi,K:n}]}))},_embind_register_bigint:function(){},_embind_register_bool:function(t,i,e,n,s){var o=Ai(e);Ei(t,{name:i=hi(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?n:s},argPackAdvance:8,readValueFromPointer:function(t){if(1===e)var n=$;else if(2===e)n=_;else{if(4!==e)throw new TypeError("Unknown boolean type size: "+i);n=S}return this.fromWireType(n[t>>o])},K:null})},_embind_register_class:function(t,i,e,n,s,o,r,a,h,l,c,u,d){c=hi(c),o=Yi(s,o),a&&(a=Yi(r,a)),l&&(l=Yi(h,l)),d=Yi(u,d);var f=Jt(c);Di(f,(function(){qi(`Cannot construct ${c} due to unbound types`,[n])})),Pi([t,i,e],n?[n]:[],(function(i){if(i=i[0],n)var e=i.i,s=e.N;else s=zi.prototype;i=Qt(f,(function(){if(Object.getPrototypeOf(this)!==r)throw new ii("Use 'new' to construct "+c);if(void 0===h.$)throw new ii(c+" has no accessible constructor");var t=h.$[arguments.length];if(void 0===t)throw new ii(`Tried to invoke ctor of ${c} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.$).toString()}) parameters instead!`);return t.apply(this,arguments)}));var r=Object.create(s,{constructor:{value:i}});i.prototype=r;var h=new Fi(c,i,r,d,e,o,a,l);h.A&&(void 0===h.A.oa&&(h.A.oa=[]),h.A.oa.push(h)),e=new Bi(c,h,!0,!1),s=new Bi(c+"*",h,!1,!1);var u=new Bi(c+" const*",h,!1,!0);return xi[t]={pointerType:s,Kb:u},Vi(f,i),[e,s,u]}))},_embind_register_class_class_function:function(t,i,e,n,s,o,r){var a=Ji(e,n);i=hi(i),o=Yi(s,o),Pi([],[t],(function(t){function n(){qi(`Cannot call ${s} due to unbound types`,a)}var s=`${(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):(Ii(h,i,s),h[i].B[e-1]=n),Pi([],a,(function(n){if(n=Ki(s,[n[0],null].concat(n.slice(1)),null,o,r),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,s,o,r,a){i=hi(i),o=Yi(s,o),Pi([],[t],(function(t){var s=`${(t=t[0]).name}.${i}`,h={get(){qi(`Cannot access ${s} due to unbound types`,[e])},enumerable:!0,configurable:!0};return h.set=a?()=>{qi(`Cannot access ${s} due to unbound types`,[e])}:()=>{ei(`${s} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Pi([],[e],(function(e){e=e[0];var s={get:()=>e.fromWireType(o(n)),enumerable:!0};return a&&(a=Yi(r,a),s.set=t=>{var i=[];a(n,e.toWireType(i,t)),Si(i)}),Object.defineProperty(t.i.constructor,i,s),[]})),[]}))},_embind_register_class_constructor:function(t,i,e,n,s,o){var r=Ji(i,e);s=Yi(n,s),Pi([],[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`,r)},Pi([],r,(function(n){return n.splice(1,0,null),t.i.$[i-1]=Ki(e,n,null,s,o),[]})),[]}))},_embind_register_class_function:function(t,i,e,n,s,o,r,a){var h=Ji(e,n);i=hi(i),o=Yi(s,o),Pi([],[t],(function(t){function n(){qi(`Cannot call ${s} due to unbound types`,h)}var s=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.qb.push(i);var l=t.i.N,c=l[i];return void 0===c||void 0===c.B&&c.className!==t.name&&c.ea===e-2?(n.ea=e-2,n.className=t.name,l[i]=n):(Ii(l,i,s),l[i].B[e-2]=n),Pi([],h,(function(n){return n=Ki(s,n,t,o,r),void 0===l[i].B?(n.ea=e-2,l[i]=n):l[i].B[e-2]=n,[]})),[]}))},_embind_register_class_property:function(t,i,e,n,s,o,r,a,h,l){i=hi(i),s=Yi(n,s),Pi([],[t],(function(t){var n=`${(t=t[0]).name}.${i}`,c={get(){qi(`Cannot access ${n} due to unbound types`,[e,r])},enumerable:!0,configurable:!0};return c.set=h?()=>{qi(`Cannot access ${n} due to unbound types`,[e,r])}:()=>{ei(n+" is a read-only property")},Object.defineProperty(t.i.N,i,c),Pi([],h?[e,r]:[e],(function(e){var r=e[0],c={get(){var i=Qi(this,t,n+" getter");return r.fromWireType(s(o,i))},enumerable:!0};if(h){h=Yi(a,h);var u=e[1];c.set=function(i){var e=Qi(this,t,n+" setter"),s=[];h(l,e,u.toWireType(s,i)),Si(s)}}return Object.defineProperty(t.i.N,i,c),[]})),[]}))},_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 si(i)},argPackAdvance:8,readValueFromPointer:Oi,K:null})},_embind_register_enum:function(t,i,e,n){function s(){}e=Ai(e),i=hi(i),s.values={},Ei(t,{name:i,constructor:s,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,i){return i.value},argPackAdvance:8,readValueFromPointer:te(i,e,n),K:null}),Di(i,s)},_embind_register_enum_value:function(t,i,e){var n=gi(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=Ai(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,s,o){var r=Ji(i,e);t=hi(t),s=Yi(n,s),Di(t,(function(){qi(`Cannot call ${t} due to unbound types`,r)}),i-1),Pi([],r,(function(e){return Vi(t,Ki(t,[e[0],null].concat(e.slice(1)),null,s,o),i-1),[]}))},_embind_register_integer:function(t,i,e,n,s){i=hi(i),-1===s&&(s=4294967295),s=Ai(e);var o=t=>t;if(0===n){var r=32-8*e;o=t=>t<<r>>>r}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,s,0!==n),K:null})},_embind_register_memory_view:function(t,i,e){function n(t){return new s(O.buffer,O[1+(t>>=2)],O[t])}var s=[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=O[t>>2],n=t+4;if(e)for(var s=n,o=0;o<=i;++o){var r=n+o;if(o==i||0==j[r]){if(s=s?nt(j,s,r-s):"",void 0===a)var a=s;else a+=String.fromCharCode(0),a+=s;s=r+1}}else{for(a=Array(i),o=0;o<i;++o)a[o]=String.fromCharCode(j[n+o]);a=a.join("")}return Ce(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 s=e&&n?ot(i):i.length,o=Se(4+s+1),r=o+4;if(O[o>>2]=s,e&&n)rt(i,j,r,s+1);else if(n)for(n=0;n<s;++n){var a=i.charCodeAt(n);255<a&&(Ce(r),ei("String has UTF-16 code units that do not fit in 8 bits")),j[r+n]=a}else for(n=0;n<s;++n)j[r+n]=i[n];return null!==t&&t.push(Ce,o),o},argPackAdvance:8,readValueFromPointer:Oi,K:function(t){Ce(t)}})},_embind_register_std_wstring:function(t,i,e){if(e=hi(e),2===i)var n=oe,s=re,o=ae,r=()=>C,a=1;else 4===i&&(n=he,s=le,o=ce,r=()=>O,a=2);Ei(t,{name:e,fromWireType:function(t){for(var e,s=O[t>>2],o=r(),h=t+4,l=0;l<=s;++l){var c=t+4+l*i;l!=s&&0!=o[c>>a]||(h=n(h,c-h),void 0===e?e=h:(e+=String.fromCharCode(0),e+=h),h=c+i)}return Ce(t),e},toWireType:function(t,n){"string"!=typeof n&&ei(`Cannot pass non-string to C++ string type ${e}`);var r=o(n),h=Se(4+r+i);return O[h>>2]=r>>a,s(n,h+4,r+i),null!==t&&t.push(Ce,h),h},argPackAdvance:8,readValueFromPointer:Oi,K:function(t){Ce(t)}})},_embind_register_value_object:function(t,i,e,n,s,o){Ci[t]={name:hi(i),Pa:Yi(e,n),W:Yi(s,o),eb:[]}},_embind_register_value_object_field:function(t,i,e,n,s,o,r,a,h,l){Ci[t].eb.push({Sb:hi(i),Yb:e,Wb:Yi(n,s),Xb:o,rc:r,qc:Yi(a,h),sc:l})},_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=gi(i,"emval::as");var n=[],s=si(n);return O[e>>2]=s,i.toWireType(n,t)},_emval_call_method:function(t,i,e,n,s){t=pe[t],i=ni(i),e=de(e);var o=[];return O[n>>2]=si(o),t(i,e,o,s)},_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]=gi(O[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 s=ve[i];if(void 0!==s)return s;var o=Array(t-1);return s=function(t){var i=pe.length;return pe.push(t),i}(((i,s,r,a)=>{for(var h=0,l=0;l<t-1;++l)o[l]=e[l+1].readValueFromPointer(a+h),h+=e[l+1].argPackAdvance;for(i=i[s].apply(i,o),l=0;l<t-1;++l)e[l+1].Nb&&e[l+1].Nb(o[l]);if(!n.fc)return n.toWireType(r,i)})),ve[i]=s},_emval_get_module_property:function(t){return t=de(t),si(s[t])},_emval_get_property:function(t,i){return t=ni(t),i=ni(i),si(t[i])},_emval_incref:function(t){4<t&&(ti.get(t).tb+=1)},_emval_new_cstring:function(t){return si(de(t))},_emval_new_object:function(){return si({})},_emval_run_destructors:function(t){Si(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=gi(t,"_emval_take_value")).readValueFromPointer(i),si(t)},abort:()=>{W("")},emscripten_asm_const_int:(t,i,e)=>{var n;for(ge.length=0,e>>=2;n=j[i++];)e+=105!=n&e,ge.push(105==n?S[e]:T[e++>>1]),++e;return G[t].apply(null,ge)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:()=>performance.now(),emscripten_memcpy_big:(t,i,e)=>j.copyWithin(t,i,i+e),emscripten_resize_heap:t=>{var i=j.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 s=Math;n=Math.max(t,n);t:{s=s.min.call(s,2147483648,n+(65536-n%65536)%65536)-x.buffer.byteLength+65535>>>16;try{x.grow(s),A();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,i)=>{var e=0;return me().forEach((function(n,s){var o=i+e;for(s=O[t+4*s>>2]=o,o=0;o<n.length;++o)$[0|s++]=n.charCodeAt(o);$[0|s]=0,e+=n.length+1})),0},environ_sizes_get:(t,i)=>{var e=me();O[t>>2]=e.length;var n=0;return e.forEach((function(t){n+=t.length+1})),O[i>>2]=n,0},fd_close:function(t){try{var i=zt(t);if(null===i.X)throw new _t(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===Gt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_read:function(t,i,e,n){try{t:{var s=zt(t);t=i;for(var o,r=i=0;r<e;r++){var a=O[t>>2],h=O[t+4>>2];t+=8;var l=s,c=a,u=h,d=o,f=$;if(0>u||0>d)throw new _t(28);if(null===l.X)throw new _t(8);if(1==(2097155&l.flags))throw new _t(8);if(16384==(61440&l.node.mode))throw new _t(31);if(!l.m.read)throw new _t(28);var p=void 0!==d;if(p){if(!l.seekable)throw new _t(70)}else d=l.position;var v=l.m.read(l,f,c,u,d);p||(l.position+=v);var g=v;if(0>g){var b=-1;break t}if(i+=g,g<h)break;void 0!==o&&(o+=g)}b=i}return O[n>>2]=b,0}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_seek:function(t,i,e,n,s){i=e+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*e:NaN;try{if(isNaN(i))return 61;var o=zt(t);return Xt(o,i,n),Y=[o.position>>>0,(H=o.position,1<=+Math.abs(H)?0<H?+Math.floor(H/4294967296)>>>0:~~+Math.ceil((H-+(~~H>>>0))/4294967296)>>>0:0)],S[s>>2]=Y[0],S[s+4>>2]=Y[1],o.Ma&&0===i&&0===n&&(o.Ma=null),0}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_write:function(t,i,e,n){try{t:{var s=zt(t);t=i;for(var o,r=i=0;r<e;r++){var a=O[t>>2],h=O[t+4>>2];t+=8;var l=s,c=a,u=h,d=o,f=$;if(0>u||0>d)throw new _t(28);if(null===l.X)throw new _t(8);if(!(2097155&l.flags))throw new _t(8);if(16384==(61440&l.node.mode))throw new _t(31);if(!l.m.write)throw new _t(28);l.seekable&&1024&l.flags&&Xt(l,0,2);var p=void 0!==d;if(p){if(!l.seekable)throw new _t(70)}else d=l.position;var v=l.m.write(l,f,c,u,d,void 0);p||(l.position+=v);var g=v;if(0>g){var b=-1;break t}i+=g,void 0!==o&&(o+=g)}b=i}return O[n>>2]=b,0}catch(t){if(void 0===Gt||"ErrnoError"!==t.name)throw t;return t.aa}},strftime_l:(t,i,e,n)=>((t,i,e,n)=>{function s(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 s(t,i,"0")}function r(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=(we(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>=r(i,t)?0>=r(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=S[n+40>>2];for(var c in n={wc:S[n>>2],vc:S[n+4>>2],Fa:S[n+8>>2],Sa:S[n+12>>2],Ga:S[n+16>>2],da:S[n+20>>2],R:S[n+24>>2],ca:S[n+28>>2],Rc:S[n+32>>2],uc:S[n+36>>2],xc:l&&l?nt(j,l):""},e=e?nt(j,e):"",l={"%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(c,"g"),l[c]);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(c in l={"%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=>s(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+=(we(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&&we(t.da)||(i=1));else{i=52;var e=(t.R+7-t.ca-1)%7;(4==e||5==e&&we(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"),l)e.includes(c)&&(e=e.replace(new RegExp(c,"g"),l[c](n)));return(c=at(e=e.replace(/\0\0/g,"%"),!1)).length>i?0:($.set(c,t),c.length-1)})(t,i,e,n)};!function(){function t(t){if(k=t=t.exports,x=k.memory,A(),E=k.__indirect_function_table,z.unshift(k.__wasm_call_ctors),R--,s.monitorRunDependencies&&s.monitorRunDependencies(R),0==R&&N){var i=N;N=null,i()}return t}var i={env:_e,wasi_snapshot_preview1:_e};if(R++,s.monitorRunDependencies&&s.monitorRunDependencies(R),s.instantiateWasm)try{return s.instantiateWasm(i,t)}catch(t){y("Module.instantiateWasm callback failed with error: "+t),e(t)}(function(t,i){var e=F;return m||"function"!=typeof WebAssembly.instantiateStreaming||U(e)||e.startsWith("file://")||"function"!=typeof fetch?X(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"),X(e,t,i)}))))})(i,(function(i){t(i.instance)})).catch(e)}();var Ce=t=>(Ce=k.free)(t),Se=t=>(Se=k.malloc)(t),Oe=s._ma_device__on_notification_unlocked=t=>(Oe=s._ma_device__on_notification_unlocked=k.ma_device__on_notification_unlocked)(t);s._ma_malloc_emscripten=(t,i)=>(s._ma_malloc_emscripten=k.ma_malloc_emscripten)(t,i),s._ma_free_emscripten=(t,i)=>(s._ma_free_emscripten=k.ma_free_emscripten)(t,i);var Me,Te=s._ma_device_process_pcm_frames_capture__webaudio=(t,i,e)=>(Te=s._ma_device_process_pcm_frames_capture__webaudio=k.ma_device_process_pcm_frames_capture__webaudio)(t,i,e),Pe=s._ma_device_process_pcm_frames_playback__webaudio=(t,i,e)=>(Pe=s._ma_device_process_pcm_frames_playback__webaudio=k.ma_device_process_pcm_frames_playback__webaudio)(t,i,e),Ae=()=>(Ae=k.__errno_location)(),Ee=t=>(Ee=k.__getTypeName)(t);function Le(){function t(){if(!Me&&(Me=!0,s.calledRun=!0,!P)){if(s.noFSInit||pt||(pt=!0,Ht(),s.stdin=s.stdin,s.stdout=s.stdout,s.stderr=s.stderr,s.stdin?Yt("stdin",s.stdin):Ut("/dev/tty","/dev/stdin"),s.stdout?Yt("stdout",null,s.stdout):Ut("/dev/tty","/dev/stdout"),s.stderr?Yt("stderr",null,s.stderr):Ut("/dev/tty1","/dev/stderr"),Vt("/dev/stdin",0),Vt("/dev/stdout",1),Vt("/dev/stderr",1)),jt=!1,q(z),i(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();I.unshift(t)}q(I)}}if(!(0<R)){if(s.preRun)for("function"==typeof s.preRun&&(s.preRun=[s.preRun]);s.preRun.length;)D();q(L),0<R||(s.setStatus?(s.setStatus("Running..."),setTimeout((function(){setTimeout((function(){s.setStatus("")}),1),t()}),1)):t())}}if(s.__embind_initialize_bindings=()=>(s.__embind_initialize_bindings=k._embind_initialize_bindings)(),s.dynCall_iiji=(t,i,e,n,o)=>(s.dynCall_iiji=k.dynCall_iiji)(t,i,e,n,o),s.dynCall_jiji=(t,i,e,n,o)=>(s.dynCall_jiji=k.dynCall_jiji)(t,i,e,n,o),s.dynCall_iiiji=(t,i,e,n,o,r)=>(s.dynCall_iiiji=k.dynCall_iiiji)(t,i,e,n,o,r),s.dynCall_iij=(t,i,e,n)=>(s.dynCall_iij=k.dynCall_iij)(t,i,e,n),s.dynCall_jii=(t,i,e)=>(s.dynCall_jii=k.dynCall_jii)(t,i,e),s.dynCall_viijii=(t,i,e,n,o,r,a)=>(s.dynCall_viijii=k.dynCall_viijii)(t,i,e,n,o,r,a),s.dynCall_iiiiij=(t,i,e,n,o,r,a)=>(s.dynCall_iiiiij=k.dynCall_iiiiij)(t,i,e,n,o,r,a),s.dynCall_iiiiijj=(t,i,e,n,o,r,a,h,l)=>(s.dynCall_iiiiijj=k.dynCall_iiiiijj)(t,i,e,n,o,r,a,h,l),s.dynCall_iiiiiijj=(t,i,e,n,o,r,a,h,l,c)=>(s.dynCall_iiiiiijj=k.dynCall_iiiiiijj)(t,i,e,n,o,r,a,h,l,c),N=function t(){Me||Le(),Me||(N=t)},s.preInit)for("function"==typeof s.preInit&&(s.preInit=[s.preInit]);0<s.preInit.length;)s.preInit.pop()();return Le(),t.ready});const o=s},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:()=>s.BLANK_URL,registerTouchInteractions:()=>n.registerTouchInteractions,sanitizeUrl:()=>s.sanitizeUrl});var n=e(6),s=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,s=void 0===n?[]:n,o=t.rive,r=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,l=void 0!==h&&h,c=t.layoutScaleFactor,u=void 0===c?1:c;if(!(i&&s.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=l&&"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,l),h=n.clientX,c=n.clientY;if(h||c){var p=h-i.left,v=c-i.top,g=o.computeAlignment(r,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},e.bounds,u),b=new o.Mat2D;g.invert(b);var m=new o.Vec2D(p,v),w=o.mapXY(b,m),y=w.x(),x=w.y();switch(w.delete(),b.delete(),m.delete(),g.delete(),t.type){case"mouseout":for(var k=0,$=s;k<$.length;k++)$[k].pointerMove(y,x);break;case"touchmove":case"mouseover":case"mousemove":for(var j=0,_=s;j<_.length;j++)_[j].pointerMove(y,x);break;case"touchstart":case"mousedown":for(var C=0,S=s;C<S.length;C++)S[C].pointerDown(y,x);break;case"touchend":case"mouseup":for(var O=0,M=s;O<M.length;O++)M[O].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:l}),i.addEventListener("touchstart",p,{passive:l}),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:()=>l,sanitizeUrl:()=>c});var n=/^([^\w]*)(javascript|data|vbscript)/im,s=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,h=[".","/"],l="about:blank";function c(t){if(!t)return l;var i,e=(i=t,i.replace(r,"").replace(s,(function(t,i){return String.fromCharCode(i)}))).replace(o,"").replace(r,"").trim();if(!e)return l;if(function(t){return h.indexOf(t[0])>-1}(e))return e;var c=e.match(a);return c&&n.test(c[0])?l:e}}],i={};function e(n){var s=i[n];if(void 0!==s)return s.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:()=>s,EventType:()=>b,Fit:()=>i,Layout:()=>f,LoopType:()=>m,Rive:()=>M,RiveEventType:()=>v,RiveFile:()=>O,RuntimeLoader:()=>p,StateMachineInput:()=>g,StateMachineInputType:()=>d,Testing:()=>A,decodeAudio:()=>E,decodeFont:()=>z,decodeImage:()=>L});var t,i,s,o=e(1),r=e(2),a=e(3),h=e(5),l=(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)}),c=function(t,i,e,n){return new(e||(e=Promise))((function(s,o){function r(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?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(r,a)}h((n=n.apply(t,i||[])).next())}))},u=function(t,i){var e,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=a(0),r.throw=a(1),r.return=a(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(h){return function(a){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=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(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(6===a[0]&&o.label<s[1]){o.label=s[1],s=a;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(a);break}s[2]&&o.ops.pop(),o.trys.pop();continue}a=i.call(t,o)}catch(t){a=[6,t],n=0}finally{e=s=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"}(s||(s={}));var d,f=function(){function t(t){var e,n,o,r,a,h,l;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:s.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(r=null==t?void 0:t.minX)&&void 0!==r?r: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!==(l=null==t?void 0:t.maxY)&&void 0!==l?l:0}return t.new=function(i){var e=i.fit,n=i.alignment,s=i.minX,o=i.minY,r=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:e,alignment:n,minX:s,minY:o,maxX:r,maxY:a})},t.prototype.copyWith=function(i){var e=i.fit,n=i.alignment,s=i.layoutScaleFactor,o=i.minX,r=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!=s?s:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=r?r: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===s.TopLeft?t.Alignment.topLeft:this.alignment===s.TopCenter?t.Alignment.topCenter:this.alignment===s.TopRight?t.Alignment.topRight:this.alignment===s.CenterLeft?t.Alignment.centerLeft:this.alignment===s.CenterRight?t.Alignment.centerRight:this.alignment===s.BottomLeft?t.Alignment.bottomLeft:this.alignment===s.BottomCenter?t.Alignment.bottomCenter:this.alignment===s.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(r.name,"@").concat(r.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 s=["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(s)}}))},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(r.name,"@").concat(r.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,g=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 b,m,w=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 g(d.Boolean,t.asBool()):t.type===i.SMIInput.number?new g(d.Number,t.asNumber()):t.type===i.SMIInput.trigger?new g(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,s){void 0===n&&(n=[]),void 0===s&&(s=[]),this.runtime=t,this.artboard=i,this.eventManager=e,this.animations=n,this.stateMachines=s}return t.prototype.add=function(t,i,e){if(void 0===e&&(e=!0),0===(t=P(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})),s=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var r=n.indexOf(t[o]),h=s.indexOf(t[o]);if(r>=0||h>=0)r>=0?this.animations[r].playing=i:this.stateMachines[h].playing=i;else{var l=this.artboard.animationByName(t[o]);if(l){var c=new a.Animation(l,this.artboard,this.runtime,i);c.advance(0),c.apply(1),this.animations.push(c)}else{var u=this.artboard.stateMachineByName(t[o]);if(u){var d=new w(u,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return e&&this.eventManager.fire(i?{type:b.Play,data:this.playing}:{type:b.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 s=e.indexOf(t[n]);if(s>=0)this.animations[s].playing=i;else{var o=this.artboard.animationByName(t[n]);if(o){var r=new a.Animation(o,this.artboard,this.runtime,i);r.advance(0),r.apply(1),this.animations.push(r)}}}},t.prototype.initStateMachines=function(t,i){for(var e=this.stateMachines.map((function(t){return t.name})),n=0;n<t.length;n++){var s=e.indexOf(t[n]);if(s>=0)this.stateMachines[s].playing=i;else{var o=this.artboard.stateMachineByName(t[n]);if(o){var r=new w(o,this.runtime,i,this.artboard);this.stateMachines.push(r)}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=P(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 s=this.stateMachines.filter((function(i){return t.includes(i.name)}));s.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),e=n.map((function(t){return t.name})).concat(s.map((function(t){return t.name})))}return this.eventManager.fire({type:b.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:b.Loop,data:{animation:e.name,type:m.Loop}}),e.loopCount=0):2===e.loopValue&&e.loopCount>1&&(this.eventManager.fire({type:b.Loop,data:{animation:e.name,type:m.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:b.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:b.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"}(b||(b={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(m||(m={}));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 j=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 l(i,t),i.prototype.delay=function(t){return c(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 c(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:b.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return c(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 c(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 c(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 c(t,void 0,void 0,(function(){return u(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return c(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)),_=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),C=globalThis.ResizeObserver||_,S=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 C(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}()),O=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(b.Load,t.onLoad),t.onLoadError&&this.on(b.LoadError,t.onLoadError)}return t.prototype.initData=function(){return c(this,void 0,void 0,(function(){var i,e,n;return u(this,(function(s){switch(s.label){case 0:return this.src?(i=this,[4,T(this.src)]):[3,2];case 1:i.buffer=s.sent(),s.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=s.sent(),null===this.file)throw this.eventManager.fire({type:b.LoadError,data:null}),new Error(t.fileLoadErrorMessage);return this.eventManager.fire({type:b.Load,data:this}),[2]}}))}))},t.prototype.init=function(){return c(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}(),M=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=S.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(b.Load,t.onLoad),t.onLoadError&&this.on(b.LoadError,t.onLoadError),t.onPlay&&this.on(b.Play,t.onPlay),t.onPause&&this.on(b.Pause,t.onPause),t.onStop&&this.on(b.Stop,t.onStop),t.onLoop&&this.on(b.Loop,t.onLoop),t.onStateChange&&this.on(b.StateChange,t.onStateChange),t.onAdvance&&this.on(b.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(b.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(b.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(b.Play,t.onplay),t.onpause&&!t.onPause&&this.on(b.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(b.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(b.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(b.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,s=i.riveFile,o=i.animations,r=i.stateMachines,a=i.artboard,h=i.autoplay,l=void 0!==h&&h,c=i.useOffscreenRenderer,u=void 0!==c&&c;if(this.src=i.src,this.buffer=n,this.riveFile=s,!this.src&&!this.buffer&&!this.riveFile)throw new Error(t.missingErrorMessage);var d=P(o),f=P(r);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,l).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;j.status==x.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:b.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},j.add(this._audioEventListener),j.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 c(this,void 0,void 0,(function(){var s,o;return u(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(this.riveFile=new O({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),[4,this.riveFile.init()]);case 1:r.sent(),r.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:b.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 r.sent(),s="Problem loading file; may be corrupt!",console.warn(s),this.eventManager.fire({type:b.LoadError,data:s}),[2,Promise.reject(s)];case 4:return[2]}}))}))},t.prototype.initArtboard=function(t,i,e,n){if(this.file){var s,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var r="Invalid artboard name or no default artboard";return console.warn(r),void this.eventManager.fire({type:b.LoadError,data:r})}if(this.artboard=o,o.volume=this._volume*j.systemVolume,this.artboard.animationCount()<1)throw this.eventManager.fire({type:b.LoadError,data:r="Artboard has no animations"}),r;this.animator=new y(this.runtime,this.artboard,this.eventManager),i.length>0||e.length>0?(s=i.concat(e),this.animator.initLinearAnimations(i,n),this.animator.initStateMachines(e,n)):s=[this.animator.atLeastOne(n,!1)],this.taskQueue.add({event:{type:n?b.Play:b.Pause,data:s}})}},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 s=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));s<o.length;s++){var r=o[s];r.advance(n),r.instance.didLoop&&(r.loopCount+=1),r.apply(1)}for(var a=0,l=this.animator.stateMachines.filter((function(t){return t.playing}));a<l.length;a++){var c=l[a],u=c.reportedEventCount();if(u)for(var d=0;d<u;d++){var f=c.reportedEventAt(d);if(f)if(f.type===v.OpenUrl){if(this.eventManager.fire({type:b.RiveEvent,data:f}),this.automaticallyHandleEvents){var p=document.createElement("a"),g=f.url,m=f.target,w=(0,h.sanitizeUrl)(g);g&&p.setAttribute("href",w),m&&p.setAttribute("target",m),w&&w!==h.BLANK_URL&&p.click()}}else this.eventManager.fire({type:b.RiveEvent,data:f})}c.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&&S.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&&(j.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=P(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=P(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=P(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=P(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=P(null==t?void 0:t.animations),s=P(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,s,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,s=e.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*n,this.canvas.height=o*s,this.startRendering(),this.resizeToCanvas(),this.layout.fit===i.Layout){var r=this._layout.layoutScaleFactor;this.artboard.width=n/r,this.artboard.height=s/r}}},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:[]},s=0;s<e.animationCount();s++){var o=e.animationByIndex(s);n.animations.push(o.name)}for(var r=0;r<e.stateMachineCount();r++){for(var a=e.stateMachineByIndex(r),h=a.name,l=new this.runtime.StateMachineInstance(a,e),c=[],u=0;u<l.inputCount();u++){var d=l.input(u);c.push({name:d.name,type:d.type})}n.stateMachines.push({name:h,inputs:c})}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*j.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}(),T=function(t){return c(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()]}}))}))},P=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},A={EventManager:k,TaskQueueManager:$},E=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeAudio(t,i)}))}))},L=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeImage(t,i)}))}))},z=function(t){return new Promise((function(i){return p.getInstance((function(e){e.decodeFont(t,i)}))}))}})(),n})(),q.exports=G();const K=class{constructor(i){t(this,i),this.initializeRive=t=>{const i=c.getInstance(),e=this.el.querySelector("canvas");this.riveInstance=new q.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(){q.exports.RuntimeLoader.setWasmUrl(i("./rive.wasm")),a(this.el,this.delayVisible),h(this.el,this.type),this.initializeRive(l(this.src))}render(){return e(n,{key:"8a31ce98213ff51bf7cfc776690b6770bbeae604",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:"922568310a3be177e3185f86c54df95d16a0e42b",class:"lido-canvas"}))}get el(){return s(this)}};K.style=".lido-canvas{height:100%;width:100%}";const J=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(){this.animateBalance(),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));await new Promise((t=>setTimeout(t,350))),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=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftParentEl.style.transform=`translateY(${-i}px)`,this.rightParentEl.style.transform=`translateY(${i}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:"d1da72f1bf298dd7c81b0cfefa0e9e563ccbfff1",id:"lido-balance","bg-color":"red",onEntry:this.onEntry,class:"lido-balance",tilt:this.tilt.toString(),style:this.style,operation:this.operation.toString()},e("div",{key:"737ab206a5156b402d4477a38567480f10419c14",innerHTML:this.pivotSvg,id:"pivotimg",class:"pivot"}),e("div",{key:"8bc60136950858d5d1b96c38ec4c0635024f8d24",innerHTML:this.scaleSvg,id:"scaleimg",class:"scale",ref:t=>this.scaleEl=t}),e("div",{key:"07049a6b5c8e75d831c9287b2b4a0e633791174b",innerHTML:this.handlerSvg,id:"handlerimg",class:"handler",ref:t=>this.leftHandleEl=t}),e("div",{key:"85361c27b1ab6fcc86969bfc9d4dff1df6040165",innerHTML:this.handlerSvg,id:"handimg",class:"hand",ref:t=>this.rightHandleEl=t}),e("div",{key:"c4208582bfa1b63e4381d44d9a95e9c537dfbc84",id:"balanceSymbol",class:"lido-balance-symbol","aria-hidden":!this.showSymbol},this.showSymbol?this.balanceSymbol:""))}get el(){return s(this)}static get watchers(){return{tilt:["tiltChanged"]}}};J.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){.lido-balance-shadow{height:100px;position:absolute;top:80%;left:28%}}@media (orientation: landscape){.lido-balance-shadow{height:100px;position:absolute;top:90%;left:33%}}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}#pivotimg::after{content:"";position:absolute;bottom:-30px;left:50%;transform:translateX(-50%);width:120%;height:60px;background-image:url("https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Shadow.svg");background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;z-index:10}@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 Q=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/penIcon.png",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<8&&(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&&""!=this.objective&&!this.objective.includes(","))console.log("hi iscorrect verified"),i=t===this.objective;else if(this.objective&&this.objective.includes(",")){const n="true"===e.getAttribute("is-continue-on-correct"),s=this.objective.split(",").map((t=>t.trim())),o=this.userAnswers.length;o<s.length&&Number(t)===Number(s[o])&&(i=!0),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),t.includes("scrollCellAfterEquationSolved")?0===this.objective.length&&(v(),window.dispatchEvent(new CustomEvent(g))):(v(),window.dispatchEvent(new CustomEvent(g)))}else{this.displayValue="",f(i);const t=(null==e?void 0:e.getAttribute("onInCorrect"))||"";await p(t,e)}}}render(){return e(n,{key:"394177b08965252a6008cce3284475c6176eca3d",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:"1c79a951e666ad4171b686400f0ba391783e693f",visible:"true",height:"94px",width:"60px"},e("lido-text",{key:"70da4a0990c7ae72367f8d61026c1d4e6f682d48",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"176%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},e("img",{key:"c510e7f1cc6ec5d34683030fff988054ac721225",src:this.penIcon,alt:"pen",style:{width:"100%",height:"100%"}}))),e("div",{key:"790d7bd307e296cc8e05e29705ebf4bfdda49906",class:"lido-calculator-displayParent"},e("div",{key:"f0195ce772bffdee06483da524f8a392dffdde38",class:"lido-calculator-display"},this.displayValue)),e("div",{key:"00fda79dab52a801acafe6006db0dd50923ea74b",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 s(this)}};Q.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 Z=class{constructor(i){t(this,i),this.drawing=!1,this.bgImage=void 0,this.width="800px",this.height="700px",this.x="0px",this.y="0px",this.onEntry="",this.style={}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={width:u(this.width,t),height:u(this.height,t),left:u(this.x,t),top:u(this.y,t),position:"absolute"},this.canvas&&(this.canvas.width=parseInt(u(this.width,t)),this.canvas.height=parseInt(u(this.height,t)),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.loadBackground())}componentDidLoad(){this.canvas=this.el.shadowRoot.querySelector("#lido-canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.updateStyles(),this.loadBackground(),this.canvas.addEventListener("pointerdown",(t=>this.start(t))),this.canvas.addEventListener("pointermove",(t=>this.move(t))),window.addEventListener("pointerup",(()=>this.stop())),window.addEventListener("resize",(()=>this.updateStyles()))}loadBackground(){if(!this.bgImage)return this.ctx.fillStyle="#fff",void this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);const t=new Image;t.crossOrigin="anonymous",t.src=this.bgImage,t.onload=()=>{this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height)}}getPos(t){const i=this.canvas.getBoundingClientRect();return{x:this.canvas.width/i.width*(t.clientX-i.left),y:this.canvas.height/i.height*(t.clientY-i.top)}}start(t){this.drawing=!0;const i=this.getPos(t);this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y)}move(t){if(!this.drawing)return;const i=this.getPos(t);this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}stop(){this.drawing=!1,this.ctx.closePath()}clearCanvas(){this.loadBackground()}render(){return e(n,{key:"6768ff870d132528267f2e824fdc6edf5a5fa2be",id:"lido-canvas",class:"lido-canvas",style:this.style},e("button",{key:"ba3d5456edfa4618b6c3f57b97fa18cef45f7ae9",id:"lido-exit-button",onClick:()=>this.clearCanvas()},e("lido-text",{key:"3484c9005819e3d08adf8d36b247d3c45610d0b5",visible:"true",height:"92px",width:"43px",id:"lido-exit-icon","font-color":"white",onEntry:"this.font-weight='900';","font-size":"96px",string:"X"})),e("canvas",{key:"cd4167cefde8d4cf159779c46283cafbc3b0afcc",id:"lido-canvas",style:{width:this.style.width,height:this.style.height}}))}get el(){return s(this)}};Z.style=":host{display:flex;justify-content:center;align-items:center}.lido-canvas{background:red;border:2px solid #ccc;border-radius:8px;display:flex;flex-direction:column;overflow:hidden;position:relative}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:relative;top:-43%;left:18%;z-index:10}canvas{touch-action:none;display:block}";const tt=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,s=n-t.offsetHeight,o=Math.random()*i,r=Math.random()*s;t.style.position="absolute",t.style.left=`${o}px`,t.style.top=`${r}px`}))}}),50),this.showSpeakIcon&&m(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:"0f7d35324da319917dec546cbb1f25065897bb02",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:"2a337b5fae7641bbe78c5f1aa1c96e12c1281f4a"}))}get el(){return s(this)}};tt.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 it=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&&m(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?l(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:"7845d3364dd13cb42959f67610254ee892119c39",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:"09a68a30534c5ea83d7166acd720b4b8f23f494e"}))}get el(){return s(this)}};it.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 et=t=>"string"==typeof t,nt=()=>{let t,i;const e=new Promise(((e,n)=>{t=e,i=n}));return e.resolve=t,e.reject=i,e},st=t=>null==t?"":""+t,ot=/###/g,rt=t=>t&&t.indexOf("###")>-1?t.replace(ot,"."):t,at=t=>!t||et(t),ht=(t,i,e)=>{const n=et(i)?i.split("."):i;let s=0;for(;s<n.length-1;){if(at(t))return{};const i=rt(n[s]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++s}return at(t)?{}:{obj:t,k:rt(n[s])}},lt=(t,i,e)=>{const{obj:n,k:s}=ht(t,i,Object);if(void 0!==n||1===i.length)return void(n[s]=e);let o=i[i.length-1],r=i.slice(0,i.length-1),a=ht(t,r,Object);for(;void 0===a.obj&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=ht(t,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=e},ct=(t,i)=>{const{obj:e,k:n}=ht(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n]},ut=(t,i,e)=>{for(const n in i)"__proto__"!==n&&"constructor"!==n&&(n in t?et(t[n])||t[n]instanceof String||et(i[n])||i[n]instanceof String?e&&(t[n]=i[n]):ut(t[n],i[n],e):t[n]=i[n]);return t},dt=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ft={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const pt=t=>et(t)?t.replace(/[&<>"'\/]/g,(t=>ft[t])):t,vt=[" ",",","?","!",";"],gt=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),bt=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const n=i.split(e);let s=t;for(let t=0;t<n.length;){if(!s||"object"!=typeof s)return;let i,o="";for(let r=t;r<n.length;++r)if(r!==t&&(o+=e),o+=n[r],i=s[o],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&r<n.length-1)continue;t+=r-t+1;break}s=i}return s},mt=t=>t?.replace("_","-"),wt={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class yt{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||wt,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,n){return n&&!this.debug?null:(et(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new yt(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new yt(this.logger,t)}}var xt=new yt;class kt{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let n=0;n<e;n++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,n])=>{for(let s=0;s<n;s++)e.apply(e,[t,...i])}))}}class $t extends kt{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,n={}){const s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;t.indexOf(".")>-1?r=t.split("."):(r=[t,i],e&&(Array.isArray(e)?r.push(...e):et(e)&&s?r.push(...e.split(s)):r.push(e)));const a=ct(this.data,r);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=r[0],i=r[1],e=r.slice(2).join(".")),!a&&o&&et(e)?bt(this.data?.[t]?.[i],e,s):a}addResource(t,i,e,n,s={silent:!1}){const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator;let r=[t,i];e&&(r=r.concat(o?e.split(o):e)),t.indexOf(".")>-1&&(r=t.split("."),n=i,i=r[1]),this.addNamespaces(i),lt(this.data,r,n),s.silent||this.emit("added",t,i,e,n)}addResources(t,i,e,n={silent:!1}){for(const n in e)(et(e[n])||Array.isArray(e[n]))&&this.addResource(t,i,n,e[n],{silent:!0});n.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,n,s,o={silent:!1,skipCopy:!1}){let r=[t,i];t.indexOf(".")>-1&&(r=t.split("."),n=e,e=i,i=r[1]),this.addNamespaces(i);let a=ct(this.data,r)||{};o.skipCopy||(e=JSON.parse(JSON.stringify(e))),n?ut(a,e,s):a={...a,...e},lt(this.data,r,a),o.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var jt={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,n,s){return t.forEach((t=>{i=this.processors[t]?.process(i,e,n,s)??i})),i}};const _t=Symbol("i18next/PATH_KEY");function Ct(t,i){const{[_t]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(n,s)=>(e?.revoke?.(),s===_t?t:(t.push(s),e=Proxy.revocable(n,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}());return e.join(i?.keySeparator??".")}const St={},Ot=t=>!et(t)&&"boolean"!=typeof t&&"number"!=typeof t;class Mt extends kt{constructor(t,i={}){var e,n;super(),e=t,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(n[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=xt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const n=this.resolve(t,e);if(void 0===n?.res)return!1;const s=Ot(n.res);return!1!==e.returnObjects||!s}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const n=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let s=i.ns||this.options.defaultNS||[];const o=e&&t.indexOf(e)>-1,r=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const n=vt.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===n.length)return!0;const s=gt.getRegExp(`(${n.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!s.test(t);if(!o){const i=t.indexOf(e);i>0&&!s.test(t.substring(0,i))&&(o=!0)}return o})(t,e,n));if(o&&!r){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:et(s)?[s]:s};const o=t.split(e);(e!==n||e===n&&this.options.ns.indexOf(o[0])>-1)&&(s=o.shift()),t=o.join(n)}return{key:t,namespaces:et(s)?[s]:s}}translate(t,i,e){let n="object"==typeof i?{...i}:i;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==t)return"";"function"==typeof t&&(t=Ct(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]);const s=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(t[t.length-1],n),h=a[a.length-1];let l=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===c?.toLowerCase())return u?s?{res:`${h}${l}${r}`,usedKey:r,exactUsedKey:r,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:`${h}${l}${r}`:s?{res:r,usedKey:r,exactUsedKey:r,usedLng:c,usedNS:h,usedParams:this.getUsedParamsDetails(n)}:r;const d=this.resolve(t,n);let f=d?.res;const p=d?.usedKey||r,v=d?.exactUsedKey||r,g=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,m=void 0!==n.count&&!et(n.count),w=Mt.hasDefaultValue(n),y=m?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&m?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",k=m&&!n.ordinal&&0===n.count,$=k&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${y}`]||n[`defaultValue${x}`]||n.defaultValue;let j=f;b&&!f&&w&&(j=$);const _=Ot(j),C=Object.prototype.toString.apply(j);if(!(b&&j&&_&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||et(g)&&Array.isArray(j))if(b&&et(g)&&Array.isArray(f))f=f.join(g),f&&(f=this.extendTranslation(f,t,n,e));else{let i=!1,s=!1;!this.isValidLookup(f)&&w&&(i=!0,f=$),this.isValidLookup(f)||(s=!0,f=r);const a=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&s?void 0:f,u=w&&$!==f&&this.options.updateMissing;if(s||i||u){if(this.logger.log(u?"updateKey":"missingKey",c,h,r,u?$:f),o){const t=this.resolve(r,{...n,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(n.lng||this.language):t.push(n.lng||this.language);const e=(t,i,e)=>{const s=w&&e!==f?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,s,u,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,s,u,n),this.emit("missingKey",t,h,i,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&m?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,n);k&&n[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],r+i,n[`defaultValue${i}`]||$)}))})):e(t,r,$))}f=this.extendTranslation(f,t,n,d,e),s&&f===r&&this.options.appendNamespaceToMissingKey&&(f=`${h}${l}${r}`),(s||i)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${l}${r}`:r,i?f:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,j,{...n,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return s?(d.res=t,d.usedParams=this.getUsedParamsDetails(n),d):t}if(o){const t=Array.isArray(j),i=t?[]:{},e=t?v:p;for(const t in j)if(Object.prototype.hasOwnProperty.call(j,t)){const s=`${e}${o}${t}`;i[t]=this.translate(s,w&&!f?{...n,defaultValue:Ot($)?$[t]:void 0,joinArrays:!1,ns:a}:{...n,joinArrays:!1,ns:a}),i[t]===s&&(i[t]=j[t])}f=i}}return s?(d.res=f,d.usedParams=this.getUsedParamsDetails(n),d):f}extendTranslation(t,i,e,n,s){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const o=et(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(o){const i=t.match(this.interpolator.nestingRegexp);r=i&&i.length}let a=e.replace&&!et(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||n.usedLng,e),o){const i=t.match(this.interpolator.nestingRegexp);r<(i&&i.length)&&(e.nest=!1)}!e.lng&&n&&n.res&&(e.lng=this.language||n.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>s?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const o=e.postProcess||this.options.postProcess,r=et(o)?[o]:o;return null!=t&&r?.length&&!1!==e.applyPostProcessor&&(t=jt.handle(r,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,n,s,o,r;return et(t)&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;n=h;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==i.count&&!et(i.count),u=c&&!i.ordinal&&0===i.count,d=void 0!==i.context&&(et(i.context)||"number"==typeof i.context)&&""!==i.context,f=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(r=t,St[`${f[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(St[`${f[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach((n=>{if(this.isValidLookup(e))return;o=n;const r=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,h,n,t,i);else{let t;c&&(t=this.pluralResolver.getSuffix(n,i.count,i));const e=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(i.ordinal&&0===t.indexOf(s)&&r.push(h+t.replace(s,this.options.pluralSeparator)),r.push(h+t),u&&r.push(h+e)),d){const n=`${h}${this.options.contextSeparator||"_"}${i.context}`;r.push(n),c&&(i.ordinal&&0===t.indexOf(s)&&r.push(n+t.replace(s,this.options.pluralSeparator)),r.push(n+t),u&&r.push(n+e))}}let a;for(;a=r.pop();)this.isValidLookup(e)||(s=a,e=this.getResource(n,t,a,i))})))}))})),{res:e,usedKey:n,exactUsedKey:s,usedLng:o,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,n):this.resourceStore.getResource(t,i,e,n)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!et(t.replace);let n=e?t.replace:t;if(e&&void 0!==t.count&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!e){n={...n};for(const t of i)delete n[t]}return n}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class Tt{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xt.create("languageUtils")}getScriptPartFromCode(t){if(!(t=mt(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=mt(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(et(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:t.indexOf("-")>0&&n.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===n||0===t.indexOf(n)&&n.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),et(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),n=[],s=t=>{t&&(this.isSupportedCode(t)?n.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return et(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(t))):et(t)&&s(this.formatLanguageCode(t)),e.forEach((t=>{n.indexOf(t)<0&&s(this.formatLanguageCode(t))})),n}}const Pt={zero:0,one:1,two:2,few:3,many:4,other:5},At={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Et{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=xt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,i){this.rules[t]=i}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=mt("dev"===t?"en":t),n=i.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:e,type:n});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let o;try{o=new Intl.PluralRules(e,{type:n})}catch(e){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),At;if(!t.match(/-|_/))return At;const n=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(n,i)}return this.pluralRulesCache[s]=o,o}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>Pt[t]-Pt[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const n=this.getRule(t,e);return n?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const Lt=(t,i,e,n=".",s=!0)=>{let o=((t,i,e)=>{const n=ct(t,e);return void 0!==n?n:ct(i,e)})(t,i,e);return!o&&s&&et(e)&&(o=bt(t,e,n),void 0===o&&(o=bt(i,e,n))),o},zt=t=>t.replace(/\$/g,"$$$$");class It{constructor(t={}){this.logger=xt.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:n,prefix:s,prefixEscaped:o,suffix:r,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:u,nestingPrefixEscaped:d,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:v,maxReplaces:g,alwaysFormat:b}=t.interpolation;this.escape=void 0!==i?i:pt,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==n&&n,this.prefix=s?dt(s):o||"{{",this.suffix=r?dt(r):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=u?dt(u):d||dt("$t("),this.nestingSuffix=f?dt(f):p||dt(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=g||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,n){let s,o,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const s=Lt(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(s,void 0,e,{...n,...i,interpolationkey:t}):s}const s=t.split(this.formatSeparator),o=s.shift().trim(),r=s.join(this.formatSeparator).trim();return this.format(Lt(i,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,e,{...n,...i,interpolationkey:o})};this.resetRegExp();const l=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>zt(t)},{regex:this.regexp,safeValue:t=>zt(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(r=0;s=i.regex.exec(t);){const e=s[1].trim();if(o=h(e),void 0===o)if("function"==typeof l){const i=l(t,s,n);o=et(i)?i:""}else if(n&&Object.prototype.hasOwnProperty.call(n,e))o="";else{if(c){o=s[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),o=""}else et(o)||this.useRawValueToEscape||(o=st(o));const a=i.safeValue(o);if(t=t.replace(s[0],a),c?(i.regex.lastIndex+=o.length,i.regex.lastIndex-=s[0].length):i.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,i,e={}){let n,s,o;const r=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const n=t.split(new RegExp(`${e}[ ]*{`));let s=`{${n[1]}`;t=n[0],s=this.interpolate(s,o);const r=s.match(/'/g),a=s.match(/"/g);((r?.length??0)%2==0&&!a||a.length%2!=0)&&(s=s.replace(/'/g,'"'));try{o=JSON.parse(s),i&&(o={...i,...o})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${s}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;n=this.nestingRegexp.exec(t);){let a=[];o={...e},o=o.replace&&!et(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const h=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==h&&(a=n[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),n[1]=n[1].slice(0,h)),s=i(r.call(this,n[1].trim(),o),o),s&&n[0]===t&&!et(s))return s;et(s)||(s=st(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),s=""),a.length&&(s=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:n[1].trim()})),s.trim())),t=t.replace(n[0],s),this.regexp.lastIndex=0}return t}}const Dt=t=>{const i={};return(e,n,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const r=n+JSON.stringify(o);let a=i[r];return a||(a=t(mt(n),s),i[r]=a),a(e)}},Ft=t=>(i,e,n)=>t(mt(e),n)(i);class Rt{constructor(t={}){this.logger=xt.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?Dt:Ft;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Dt(i)}format(t,i,e,n={}){const s=i.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find((t=>t.indexOf(")")>-1))){const t=s.findIndex((t=>t.indexOf(")")>-1));s[0]=[s[0],...s.splice(1,t)].join(this.formatSeparator)}return s.reduce(((t,i)=>{const{formatName:s,formatOptions:o}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const n=t.split("(");i=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);"currency"===i&&s.indexOf(":")<0?e.currency||(e.currency=s.trim()):"relativetime"===i&&s.indexOf(":")<0?e.range||(e.range=s.trim()):s.split(";").forEach((t=>{if(t){const[i,...n]=t.split(":"),s=n.join(":").trim().replace(/^'+|'+$/g,""),o=i.trim();e[o]||(e[o]=s),"false"===s&&(e[o]=!1),"true"===s&&(e[o]=!0),isNaN(s)||(e[o]=parseInt(s,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[s]){let i=t;try{const r=n?.formatParams?.[n.interpolationkey]||{};i=this.formats[s](t,r.locale||r.lng||n.locale||n.lng||e,{...o,...n,...r})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${s}`),t}),t)}}class Nt extends kt{constructor(t,i,e,n={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=n,this.logger=xt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,n.backend,n)}queueLoad(t,i,e,n){const s={},o={},r={},a={};return t.forEach((t=>{let n=!0;i.forEach((i=>{const r=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,n=!1,void 0===o[r]&&(o[r]=!0),void 0===s[r]&&(s[r]=!0),void 0===a[i]&&(a[i]=!0)))})),n||(r[t]=!0)})),(Object.keys(s).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(s),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const n=t.split("|"),s=n[0],o=n[1];i&&this.emit("failedLoading",s,o,i),!i&&e&&this.store.addResourceBundle(s,o,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const r={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:n,k:s}=ht(t,i,Object);n[s]=n[s]||[],n[s].push(e)})(e.loaded,[s],o),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{r[t]||(r[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===r[t][i]&&(r[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,n=0,s=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:n,wait:s,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&n<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,n+1,2*s,o)}),s):o(r,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,r);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>r(null,t))).catch(r):r(null,e)}catch(t){r(t)}}prepareLoading(t,i,e={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();et(t)&&(t=this.languageUtils.toResolveHierarchy(t)),et(i)&&(i=[i]);const s=this.queueLoad(t,i,e,n);if(!s.toLoad.length)return s.pending.length||n(),null;s.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),n=e[0],s=e[1];this.read(n,s,"read",void 0,void 0,((e,o)=>{e&&this.logger.warn(`${i}loading namespace ${s} for language ${n} failed`,e),!e&&o&&this.logger.log(`${i}loaded namespace ${s} for language ${n}`,o),this.loaded(t,e,o)}))}saveMissing(t,i,e,n,s,o={},r=(()=>{})){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...o,isUpdate:s},h=this.backend.create.bind(this.backend);if(h.length<6)try{let s;s=5===h.length?h(t,i,e,n,a):h(t,i,e,n),s&&"function"==typeof s.then?s.then((t=>r(null,t))).catch(r):r(null,s)}catch(t){r(t)}else h(t,i,e,n,r,a)}t&&t[0]&&this.store.addResource(t[0],i,e,n)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Wt=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),et(t[1])&&(i.defaultValue=t[1]),et(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ut=t=>(et(t.ns)&&(t.ns=[t.ns]),et(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),et(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),Bt=()=>{};class Vt extends kt{constructor(t={},i){var e;if(super(),this.options=Ut(t),this.services={},this.logger=xt,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(et(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=Wt();this.options={...e,...this.options,...Ut(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const n=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;xt.init(this.modules.logger?n(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Rt;const i=new Tt(this.options);this.store=new $t(this.options.resources,this.options);const s=this.services;s.logger=xt,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new Et(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(s.formatter=n(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new It(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Nt(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new Mt(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=Bt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const s=nt(),o=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),s}loadResources(t,i=Bt){let e=i;const n=et(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===n?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};n?i(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const n=nt();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=Bt),this.services.backendConnector.reload(t,i,(t=>{n.resolve(),e(t)})),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&jt.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=nt();this.emit("languageChanging",t);const n=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},s=(s,o)=>{o?this.isLanguageChangingTo===t&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(s,((...t)=>this.t(...t)))},o=i=>{t||i||!this.services.languageDetector||(i=[]);const e=et(i)?i:i&&i[0],o=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(et(i)?[i]:i);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,(t=>{s(t,o)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const n=(t,i,...s)=>{let o;o="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(s)):{...i},o.lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||e||n.keyPrefix);const r=this.options.keySeparator||".";let a;return o.keyPrefix&&Array.isArray(t)?a=t.map((t=>("function"==typeof t&&(t=Ct(t,{...this.options,...i})),`${o.keyPrefix}${r}${t}`))):("function"==typeof t&&(t=Ct(t,{...this.options,...i})),a=o.keyPrefix?`${o.keyPrefix}${r}${t}`:t),this.t(a,o)};return et(t)?n.lng=t:n.lngs=t,n.ns=i,n.keyPrefix=e,n}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const o=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(e,t)||n&&!o(s,t)))}loadNamespaces(t,i){const e=nt();return this.options.ns?(et(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=nt();et(t)&&(t=[t]);const n=this.options.preload||[],s=t.filter((t=>n.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return s.length?(this.options.preload=n.concat(s),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new Tt(Wt());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new Vt(t,i);return e.createInstance=Vt.createInstance,e}cloneInstance(t={},i=Bt){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},s=new Vt(n);if(void 0===t.debug&&void 0===t.prefix||(s.logger=s.logger.clone(t)),["store","services","language"].forEach((t=>{s[t]=this[t]})),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,n)=>(e[n]={...t[i][n]},e)),t[i]),t)),{});s.store=new $t(t,n),s.services.resourceStore=s.store}return s.translator=new Mt(s.services,n),s.translator.on("*",((t,...i)=>{s.emit(t,...i)})),s.init(n,i),s.translator.options=n,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Xt=Vt.createInstance(),{slice:Ht,forEach:Yt}=[],Gt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,qt={create(t,i,e,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+60*e*1e3)),n&&(s.domain=n),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let n=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");n+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!Gt.test(e.domain))throw new TypeError("option domain is invalid");n+=`; Domain=${e.domain}`}if(e.path){if(!Gt.test(e.path))throw new TypeError("option path is invalid");n+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");n+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(n+="; HttpOnly"),e.secure&&(n+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:n+="; SameSite=Strict";break;case"lax":n+="; SameSite=Lax";break;case"strict":n+="; SameSite=Strict";break;case"none":n+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(n+="; Partitioned"),n}(t,i,s)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let n=e[t];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(i))return n.substring(i.length,n.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var Kt={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return qt.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:n,cookieDomain:s,cookieOptions:o}=i;e&&"undefined"!=typeof document&&qt.create(e,t,n,s,o)}},Jt={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const n=t.substring(1).split("&");for(let t=0;t<n.length;t++){const s=n[t].indexOf("=");s>0&&n[t].substring(0,s)===e&&(i=n[t].substring(s+1))}}return i}},Qt={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:n}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const s=t.substring(1);if(e){const t=s.split("&");for(let n=0;n<t.length;n++){const s=t[n].indexOf("=");s>0&&t[n].substring(0,s)===e&&(i=t[n].substring(s+1))}}if(i)return i;if(!i&&n>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof n?n:0;return i[e]?.replace("/","")}}}return i}};let Zt=null;const ti=()=>{if(null!==Zt)return Zt;try{if(Zt="undefined"!=typeof window&&null!==window.localStorage,!Zt)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){Zt=!1}return Zt};var ii={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&ti())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&ti()&&window.localStorage.setItem(e,t)}};let ei=null;const ni=()=>{if(null!==ei)return ei;try{if(ei="undefined"!=typeof window&&null!==window.sessionStorage,!ei)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){ei=!1}return ei};var si={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&ni())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&ni()&&window.sessionStorage.setItem(e,t)}},oi={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:n}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),n&&i.push(n)}return i.length>0?i:void 0}},ri={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const n=e||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(i=n.getAttribute("lang")),i}},ai={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const n="number"==typeof i?i:0;return e[n]?.replace("/","")}},hi={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[e]}};let li=!1;try{li=!0}catch(t){}const ci=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];li||ci.splice(1,1);class ui{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return Yt.call(Ht.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:ci,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Kt),this.addDetector(Jt),this.addDetector(ii),this.addDetector(si),this.addDetector(oi),this.addDetector(ri),this.addDetector(ai),this.addDetector(hi),this.addDetector(Qt)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}ui.type="languageDetector";Xt.use(ui).init({resources:{en:{translation:{"Do you want to exit?":"Do you want to exit?",Exit:"Exit","Continue playing":"Continue playing","Drop the elements to match the given symbol order":"Drop the elements to match the given symbol order","Fill in the blanks":"Fill in the blanks"}},fr:{translation:{"Do you want to exit?":"Voulez-vous quitter?",Exit:"Quitter","Continue playing":"Continuer à jouer","Drop the elements to match the given symbol order":"Déposez les éléments pour correspondre au symbole donné","Fill in the blanks":"Remplissez les blancs"}},hi:{translation:{"Do you want to exit?":"क्या आप बाहर निकलना चाहते हैं?",Exit:"बाहर निकलें","Continue playing":"खेलना जारी रखें","Drop the elements to match the given symbol order":"दिए गए चिन्ह से मिलाने के लिए तत्वों को ड्रॉप करें","Fill in the blanks":"रिक्त स्थान भरें"}},ka:{translation:{"Do you want to exit?":"ನೀವು ನಿರ್ಗಮಿಸಲು ಬಯಸುವಿರಾ?",Exit:"ನಿರ್ಗಮಿಸು","Continue playing":"ಆಟವನ್ನು ಮುಂದುವರಿಸಿ","Drop the elements to match the given symbol order":"ನೀಡಿರುವ ಸಂಕೇತಕ್ಕೆ ಹೊಂದುವಂತೆ ಅಂಶಗಳನ್ನು ಬಿಡಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ"}},te:{translation:{"Do you want to exit?":"మీరు బయటకు వెళ్లాలనుకుంటున్నారా?",Exit:"బయటకు వెళ్ళు","Continue playing":"ఆటను కొనసాగించు","Drop the elements to match the given symbol order":"ఇచ్చిన చిహ్నానికి సరిపడేలా అంశాలను డ్రాప్ చేయండి","Fill in the blanks":"ఖాళీలను నింపండి"}},port:{translation:{"Do you want to exit?":"Você deseja sair?",Exit:"Sair","Continue playing":"Continuar jogando","Drop the elements to match the given symbol order":"Solte os elementos para corresponder à ordem dos símbolos fornecida","Fill in the blanks":"Preencha os espaços em branco"}}},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator","htmlTag"],caches:["localStorage"]}});const di=class{constructor(i){t(this,i),this.locale="",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}languageChanged(t){const i=t||this.resolveLanguage();this.updateChildTextLanguage(i)}componentWillLoad(){const t=this.resolveLanguage();this.updateChildTextLanguage(t)}resolveLanguage(){var t,i;const e=this.el.closest("lido-root"),n=(null==e?void 0:e.locale)||"";if(null==n?void 0:n.trim())return n;const s=this.el.closest("lido-home"),o=(null==s?void 0:s.locale)||"";if(null==o?void 0:o.trim())return o;if(null===(t=this.locale)||void 0===t?void 0:t.trim())return this.locale;const r=this.el.getAttribute("locale");return(null==r?void 0:r.trim())?r:null===(i=this.el.textContent)||void 0===i?void 0:i.trim()}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){const i=this.getClosestParentWithWidth();let e=0;i&&(e=Math.min(i.clientWidth/1600,i.clientHeight/900)),t.style.transform=`translate(-50%, -50%) scale(${0!=e?e:w()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}getClosestParentWithWidth(){let t=this.el.parentElement;for(;t;){if(t.offsetWidth>0)return t;t=t.parentElement}return null}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")}updateChildTextLanguage(t){const i=t||Xt.language||"en";Xt.changeLanguage(i),this.el.querySelectorAll("lido-text").forEach((t=>{t.locale=i,t.dispatchEvent(new CustomEvent("languageChanged",{bubbles:!0}))}))}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?l(this.bgImage):"";if(document.body.style.pointerEvents="auto",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)}const i=this.resolveLanguage();this.updateChildTextLanguage(i)}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:"338ef0be8cc9d052764785ce9314254be7c8a7f8",id:"lido-container",locale:this.locale,"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:"59d66b47f4749a99ece4da48dbaebaf720cb0b2b"}))}get el(){return s(this)}static get watchers(){return{locale:["languageChanged"]}}};di.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 fi=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:"b8f000d4e9d04d9954f81dc7e05b109dc16cb223",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:"cea63b67d1b6a925ab0520eaa7c5166288bcd71e",class:"card "+(this.flipped?"flipped":"")},e("div",{key:"3517e09bb91ac4c6fb2c066539f2d4f51436938f",class:"card-face card-front"},null!=this.front?this.front:e("slot",{name:"front"})),e("div",{key:"5a14a4ab70898852046f1128c99e5a285c1c37f7",class:"card-face card-back"},null!=this.back?this.back:e("slot",{name:"back"}))))}get el(){return s(this)}static get watchers(){return{flipped:["handleFlippedChange"]}}};fi.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 pi=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;y(i),t.addEventListener("click",(()=>{x(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:"e8bc37c1220b708872748bd49c2d7fc448bdd01c",class:"lido-float","float-direction":this.floatDirection,id:this.id,"tab-index":this.tabIndex,style:this.style,onEntry:this.onEntry},e("slot",{key:"991afa719c6fc35f489fae30f77bad81cf2b4c3e"}))}get el(){return s(this)}};pi.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 vi=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),k(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,k(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(localStorage.removeItem($),j(),this.currentContainerIndex=null),this.containers=[...this.containers],this.updateArrowVisibility()))},this.PrevContainerKey=t=>{console.log("👉 PrevContainerKey CALLED with index:",t),this.currentContainerIndex<=0||(this.currentContainerIndex--,k(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.updateArrowVisibility=()=>{this.showNav&&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",n.style.visibility="true"!==e?"hidden":"visible"}),100)},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(_(),C.getI().stop(),localStorage.removeItem($),i.remove(),this.currentContainerIndex=0):i.remove())},this.showNav=!0,this.activeContainerIndexes=[],this.locale="",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=S(),this.navBarIcons=void 0,this.currentContainerIndex=this.initialIndex,this.exitFlag=!1,this.containers=[],this.showDotsandbtn=!1}onLangChange(t){this.setLanguage(t),this.containers=[...this.containers]}setLanguage(t){Xt.changeLanguage(t||Xt.language),this.containers=[...this.containers]}componentWillLoad(){this.navBarIcons={exit:this.exitButtonUrl||O,prev:this.prevButtonUrl||M,next:this.nextButtonUrl||T,speak:this.speakerButtonUrl||P},0===this.currentContainerIndex&&localStorage.removeItem($),window.addEventListener(g,(()=>{this.NextContainerKey()})),window.addEventListener(A,(()=>{this.PrevContainerKey()})),window.addEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),this.parseXMLData(this.xmlData),window.addEventListener("beforeunload",(()=>{C.getI().stop(),localStorage.removeItem($)}))}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?l(t):i?l(i):null!=e&&e,e=document.getElementById(E),n=e.getAttribute("exit-button-url"),s=e.getAttribute("prev-button-url"),o=e.getAttribute("next-button-url"),r=null!==(t=e.getAttribute("speak-button-url"))&&void 0!==t?t:e.getAttribute("speaker-button-url");this.navBarIcons={exit:`${await i(this.exitButtonUrl,n,O)}`,prev:`${await i(this.prevButtonUrl,s,M)}`,next:`${await i(this.nextButtonUrl,o,T)}`,speak:`${await i(this.speakerButtonUrl,r,P)}`}}updateBackgroundImage(){const t=document.querySelector(E),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(g,(()=>{this.NextContainerKey()})),window.removeEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),window.removeEventListener(A,(()=>{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 s=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean);"lido-text"===i&&n.string&&(n.string=Xt.t(n.string)),"lido-text"===i&&n.string&&(n.string=Xt.t(n.string));const o={"lido-container":e("lido-container",Object.assign({},n,{canplay:this.canplay,baseUrl:this.baseUrl,height:this.height}),s),"lido-flash-card":e("lido-flash-card",Object.assign({},n),s),"lido-col":e("lido-col",Object.assign({},n),s),"lido-trace":e("lido-trace",Object.assign({},n),s),"lido-image":e("lido-image",Object.assign({},n),s),"lido-row":e("lido-row",Object.assign({},n),s),"lido-text":e("lido-text",Object.assign({},n),s),"lido-pos":e("lido-pos",Object.assign({},n),s),"lido-shape":e("lido-shape",Object.assign({},n),s),"lido-wrap":e("lido-wrap",Object.assign({},n),s),"lido-random":e("lido-random",Object.assign({},n),s),"lido-avatar":e("lido-avatar",Object.assign({},n),s),"lido-cell":e("lido-cell",Object.assign({},n),s),"lido-slide-fill":e("lido-slide-fill",Object.assign({},n),s),"lido-float":e("lido-float",Object.assign({},n),s),"lido-keyboard":e("lido-keyboard",Object.assign({},n),s),"lido-math-matrix":e("lido-math-matrix",Object.assign({},n),s),"lido-balance":e("lido-balance",Object.assign({},n),s),"lido-calculator":e("lido-calculator",Object.assign({},n),s),"lido-canvas":e("lido-canvas",Object.assign({},n),s)};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,i)=>{if(console.log("nammadhaaaaaaa",this.activeContainerIndexes.length&&!this.activeContainerIndexes.includes(i)),!this.activeContainerIndexes.length||this.activeContainerIndexes.includes(i))return()=>this.parseElement(t)})).filter(Boolean);this.containers=e,console.log("container :::",e)}areAllDropsFilled(){const t=Array.from(document.querySelectorAll('[type="drop"]')),i=Array.from(document.querySelectorAll('[type="drag"]')).filter((t=>t.getAttribute("drop-to")));return console.log("drops",t),console.log("drags",i),t.every((t=>{const e=t.id;return i.some((t=>t.getAttribute("drop-to")===e))}))}async btnpopup(){R(!1),await C.getI().stop();const t=document.getElementById(E),i=t.querySelectorAll("*");for(const t of Array.from(i)){if(L())break;const i=t.getAttribute("tab-index"),e=t;if(i&&Number(i)>0){if(await C.getI().play(e),L()){await C.getI().stop();break}await new Promise((t=>setTimeout(t,300)))}}if(this.areAllDropsFilled()){const i=t.objective,e=JSON.parse(localStorage.getItem(z)||"[]"),n=I(i,e);console.log("Resultt",n),n&&D()}else console.log("Not yet filled ")}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(${w()})`})),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\r\n -button",onClick:()=>{this.exitFlag=!0,C.getI().stop()},style:{visibility:this.showNav?"visible":"hidden"}},e("lido-image",{src:this.navBarIcons.exit})),e("div",{class:"lido-btn-dot-container"},e("div",{id:"lido-arrow-left",onClick:()=>{F()},style:{visibility:this.showNav?"visible":"hidden"}},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)},style:{visibility:this.showNav?"visible":"hidden"}},e("lido-image",{src:this.navBarIcons.next}))),e("div",{id:"main-audio",class:"popup-button",onClick:()=>this.btnpopup(),style:{visibility:this.showNav?"visible":"hidden"}},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:"Do you want to exit?",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:"Exit",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:"Continue playing",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 s(this)}static get watchers(){return{locale:["onLangChange"],xmlData:["onXmlDataChange"]}}};vi.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)\r\n drop-shadow(0 0 10px yellow)\r\n drop-shadow(0 0 20px yellow)\r\n drop-shadow(0 0 30px orange)}50%{filter:drop-shadow(0 0 10px yellow)\r\n drop-shadow(0 0 20px yellow)\r\n drop-shadow(0 0 40px yellow)\r\n drop-shadow(0 0 50px orange)}100%{filter:drop-shadow(0 0 5px yellow)\r\n drop-shadow(0 0 10px yellow)\r\n drop-shadow(0 0 20px yellow)\r\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}.parent_dots{pointer-events:none}";var gi,bi={exports:{}},mi={},wi={},yi={};gi=yi,Object.defineProperty(gi,"__esModule",{value:!0}),gi.MUST_INSTALL_PUPPETEER=gi.DEFAULT_CONVERSION_ERROR_MESSAGE=gi.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=gi.UNEXPECTED_ERROR_MESSAGE_LINK=gi.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,gi.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",gi.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",gi.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=gi.UNEXPECTED_ERROR_MESSAGE_PREFIX+gi.UNEXPECTED_ERROR_MESSAGE_LINK,gi.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",gi.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(wi,"__esModule",{value:!0}),wi.ErrorHandling=void 0;const xi=yi;class ki{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 ki.generateErrorResult(`${xi.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${t.message}`)}static hasError(t){return!!t.errorMessage}}wi.ErrorHandling=ki;var $i={};Object.defineProperty($i,"__esModule",{value:!0}),$i.SheenUtil=void 0;class ji{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}$i.SheenUtil=ji,ji.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)";var _i={};!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"}(_i);var Ci={},Si={},Oi={};Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.RgbColor=void 0,Oi.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(Si,"__esModule",{value:!0}),Si.RgbToFilterWorker=void 0;const Mi=$i,Ti=Oi;class Pi{constructor(t,i){this.targetRgbColor=t,this.reusedRgbColor=new Ti.RgbColor,this.addSheen=i}static fmt(t,i,e=1){return Math.round(t[i]*e)}generateCss(t){return`${this.addSheen?`${Mi.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${Pi.fmt(t,0)}%) sepia(${Pi.fmt(t,1)}%) saturate(${Pi.fmt(t,2)}%) hue-rotate(${Pi.fmt(t,3,3.6)}deg) brightness(${Pi.fmt(t,4)}%) contrast(${Pi.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,s){let o=[],r=1/0;const a=new Array(6),h=new Array(6),l=new Array(6);for(let c=0;c<s;c+=1){const s=e/Math.pow(c+1,.16666666666666666);for(let t=0;t<6;t+=1)a[t]=Math.random()>.5?1:-1,h[t]=n[t]+s*a[t],l[t]=n[t]-s*a[t];const u=this.loss(h)-this.loss(l);for(let e=0;e<6;e+=1){const o=u/(2*s)*a[e],r=i[e]/Math.pow(t+c+1,1);n[e]=Pi.fixSpsa(n[e]-r*o,e)}const d=this.loss(n);d<r&&(o=n.slice(0),r=d)}return{values:o,loss:r}}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)}}}Si.RgbToFilterWorker=Pi,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.RgbToFilter=void 0;const Ai=wi,Ei=yi,Li=Si,zi=Oi;class Ii{static generateConversionError(t){return Ai.ErrorHandling.generateErrorResult(t||Ei.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(t){return Ai.ErrorHandling.generateErrorResult(t)}static execute(t,i){const e=new zi.RgbColor(t);return new Li.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:s,addSheen:o}=t,r=i.trim().toLocaleLowerCase(),a=(null==e?void 0:e(r))||{color:r};if(Ai.ErrorHandling.hasError(a))return Ii.generateValidateAndParseError(a.errorMessage);const h=Ii.convertToRGB(a.color,n)||a.color;return h?Ii.execute(h,o):Ii.generateConversionError(s)}catch(t){return Ai.ErrorHandling.generateUnexpectedError(t)}}}Ci.RgbToFilter=Ii;var Di={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.MATCH_HEXADECIMAL=Fi.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,Fi.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,Fi.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.MAX_COLOR_INPUT_STRING_LENGTH=void 0,Ri.MAX_COLOR_INPUT_STRING_LENGTH=25;var Ni={};!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"}(Ni);var Wi={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]},Ui=r&&r.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Di,"__esModule",{value:!0}),Di.ColorParser=void 0;const Bi=Fi,Vi=wi,Xi=Ri,Hi=Ni,Yi=_i,Gi=Ui(Wi);class qi{static validateAndParseHex(t){return t.length<Xi.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(Bi.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:Vi.ErrorHandling.generateInputErrorMessage(Yi.ColorTypes.HEX,t,Hi.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<Xi.MAX_COLOR_INPUT_STRING_LENGTH){const i=t.match(Bi.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(Bi.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=qi.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:Vi.ErrorHandling.generateInputErrorMessage(Yi.ColorTypes.RGB,t,Hi.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=qi.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:Vi.ErrorHandling.generateInputErrorMessage(Yi.ColorTypes.HSL,t,Hi.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<Xi.MAX_COLOR_INPUT_STRING_LENGTH&&Gi.default[t]?{color:t}:{errorMessage:Vi.ErrorHandling.generateInputErrorMessage(Yi.ColorTypes.KEYWORD,t,Hi.ColorFormats.KEYWORD)}}}Di.ColorParser=qi;const Ki=Wi,Ji={};for(const t of Object.keys(Ki))Ji[Ki[t]]=t;const Qi={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 Zi=Qi;for(const t of Object.keys(Qi)){if(!("channels"in Qi[t]))throw new Error("missing channels property: "+t);if(!("labels"in Qi[t]))throw new Error("missing channel labels property: "+t);if(Qi[t].labels.length!==Qi[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:e}=Qi[t];delete Qi[t].channels,delete Qi[t].labels,Object.defineProperty(Qi[t],"channels",{value:i}),Object.defineProperty(Qi[t],"labels",{value:e})}Qi.rgb.hsl=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,s=Math.min(i,e,n),o=Math.max(i,e,n),r=o-s;let a,h;o===s?a=0:i===o?a=(e-n)/r:e===o?a=2+(n-i)/r:n===o&&(a=4+(i-e)/r),a=Math.min(60*a,360),a<0&&(a+=360);const l=(s+o)/2;return h=o===s?0:l<=.5?r/(o+s):r/(2-o-s),[a,100*h,100*l]},Qi.rgb.hsv=function(t){let i,e,n,s,o;const r=t[0]/255,a=t[1]/255,h=t[2]/255,l=Math.max(r,a,h),c=l-Math.min(r,a,h),u=function(t){return(l-t)/6/c+.5};return 0===c?(s=0,o=0):(o=c/l,i=u(r),e=u(a),n=u(h),r===l?s=n-e:a===l?s=1/3+i-n:h===l&&(s=2/3+e-i),s<0?s+=1:s>1&&(s-=1)),[360*s,100*o,100*l]},Qi.rgb.hwb=function(t){const i=t[0],e=t[1];let n=t[2];const s=Qi.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)),[s,100*o,100*n]},Qi.rgb.cmyk=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,s=Math.min(1-i,1-e,1-n);return[100*((1-i-s)/(1-s)||0),100*((1-e-s)/(1-s)||0),100*((1-n-s)/(1-s)||0),100*s]},Qi.rgb.keyword=function(t){const i=Ji[t];if(i)return i;let e,n=1/0;for(const i of Object.keys(Ki)){const r=((s=t)[0]-(o=Ki[i])[0])**2+(s[1]-o[1])**2+(s[2]-o[2])**2;r<n&&(n=r,e=i)}var s,o;return e},Qi.keyword.rgb=function(t){return Ki[t]},Qi.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)]},Qi.rgb.lab=function(t){const i=Qi.rgb.xyz(t);let e=i[0],n=i[1],s=i[2];return e/=95.047,n/=100,s/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,[116*n-16,500*(e-n),200*(n-s)]},Qi.hsl.rgb=function(t){const i=t[0]/360,e=t[1]/100,n=t[2]/100;let s,o,r;if(0===e)return r=255*n,[r,r,r];s=n<.5?n*(1+e):n+e-n*e;const a=2*n-s,h=[0,0,0];for(let t=0;t<3;t++)o=i+1/3*-(t-1),o<0&&o++,o>1&&o--,r=6*o<1?a+6*(s-a)*o:2*o<1?s:3*o<2?a+(s-a)*(2/3-o)*6:a,h[t]=255*r;return h},Qi.hsl.hsv=function(t){const i=t[0];let e=t[1]/100,n=t[2]/100,s=e;const o=Math.max(n,.01);return n*=2,e*=n<=1?n:2-n,s*=o<=1?o:2-o,[i,100*(0===n?2*s/(o+s):2*e/(n+e)),(n+e)/2*100]},Qi.hsv.rgb=function(t){const i=t[0]/60,e=t[1]/100;let n=t[2]/100;const s=Math.floor(i)%6,o=i-Math.floor(i),r=255*n*(1-e),a=255*n*(1-e*o),h=255*n*(1-e*(1-o));switch(n*=255,s){case 0:return[n,h,r];case 1:return[a,n,r];case 2:return[r,n,h];case 3:return[r,a,n];case 4:return[h,r,n];case 5:return[n,r,a]}},Qi.hsv.hsl=function(t){const i=t[0],e=t[1]/100,n=t[2]/100,s=Math.max(n,.01);let o,r;r=(2-e)*n;const a=(2-e)*s;return o=e*s,o/=a<=1?a:2-a,o=o||0,r/=2,[i,100*o,100*r]},Qi.hwb.rgb=function(t){const i=t[0]/360;let e=t[1]/100,n=t[2]/100;const s=e+n;let o;s>1&&(e/=s,n/=s);const r=Math.floor(6*i),a=1-n;o=6*i-r,1&r&&(o=1-o);const h=e+o*(a-e);let l,c,u;switch(r){default:case 6:case 0:l=a,c=h,u=e;break;case 1:l=h,c=a,u=e;break;case 2:l=e,c=a,u=h;break;case 3:l=e,c=h,u=a;break;case 4:l=h,c=e,u=a;break;case 5:l=a,c=e,u=h}return[255*l,255*c,255*u]},Qi.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))]},Qi.xyz.rgb=function(t){const i=t[0]/100,e=t[1]/100,n=t[2]/100;let s,o,r;return s=3.2406*i+-1.5372*e+-.4986*n,o=-.9689*i+1.8758*e+.0415*n,r=.0557*i+-.204*e+1.057*n,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),r=Math.min(Math.max(0,r),1),[255*s,255*o,255*r]},Qi.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)]},Qi.lab.xyz=function(t){let i,e,n;e=(t[0]+16)/116,i=t[1]/500+e,n=e-t[2]/200;const s=e**3,o=i**3,r=n**3;return e=s>.008856?s:(e-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,n=r>.008856?r:(n-16/116)/7.787,i*=95.047,e*=100,n*=108.883,[i,e,n]},Qi.lab.lch=function(t){const i=t[0],e=t[1],n=t[2];let s;return s=360*Math.atan2(n,e)/2/Math.PI,s<0&&(s+=360),[i,Math.sqrt(e*e+n*n),s]},Qi.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)]},Qi.rgb.ansi16=function(t,i=null){const[e,n,s]=t;let o=null===i?Qi.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let r=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===o&&(r+=60),r},Qi.hsv.ansi16=function(t){return Qi.rgb.ansi16(Qi.hsv.rgb(t),t[2])},Qi.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)},Qi.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]},Qi.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]},Qi.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},Qi.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]},Qi.rgb.hcg=function(t){const i=t[0]/255,e=t[1]/255,n=t[2]/255,s=Math.max(Math.max(i,e),n),o=Math.min(Math.min(i,e),n),r=s-o;let a,h;return a=r<1?o/(1-r):0,h=r<=0?0:s===i?(e-n)/r%6:s===e?2+(n-i)/r:4+(i-e)/r,h/=6,h%=1,[360*h,100*r,100*a]},Qi.hsl.hcg=function(t){const i=t[1]/100,e=t[2]/100,n=e<.5?2*i*e:2*i*(1-e);let s=0;return n<1&&(s=(e-.5*n)/(1-n)),[t[0],100*n,100*s]},Qi.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]},Qi.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],s=t[0]/360%1*6,o=s%1,r=1-o;let a=0;switch(Math.floor(s)){case 0:n[0]=1,n[1]=o,n[2]=0;break;case 1:n[0]=r,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]=r,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]=r}return a=(1-i)*e,[255*(i*n[0]+a),255*(i*n[1]+a),255*(i*n[2]+a)]},Qi.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]},Qi.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]},Qi.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)]},Qi.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]},Qi.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},Qi.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},Qi.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},Qi.gray.hsl=function(t){return[0,0,t[0]]},Qi.gray.hsv=Qi.gray.hsl,Qi.gray.hwb=function(t){return[0,100,t[0]]},Qi.gray.cmyk=function(t){return[0,0,0,t[0]]},Qi.gray.lab=function(t){return[t[0],0,0]},Qi.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},Qi.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const te=Zi;function ie(t,i){return function(e){return i(t(e))}}function ee(t,i){const e=[i[t].parent,t];let n=te[i[t].parent][t],s=i[t].parent;for(;i[s].parent;)e.unshift(i[s].parent),n=ie(te[i[s].parent][s],n),s=i[s].parent;return n.conversion=e,n}const ne=Zi,se=function(t){const i=function(t){const i=function(){const t={},i=Object.keys(te);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(te[t]);for(let s=n.length,o=0;o<s;o++){const s=n[o],r=i[s];-1===r.distance&&(r.distance=i[t].distance+1,r.parent=t,e.unshift(s))}}return i}(t),e={},n=Object.keys(i);for(let t=n.length,s=0;s<t;s++){const t=n[s];null!==i[t].parent&&(e[t]=ee(t,i))}return e},oe={};Object.keys(ne).forEach((t=>{oe[t]={},Object.defineProperty(oe[t],"channels",{value:ne[t].channels}),Object.defineProperty(oe[t],"labels",{value:ne[t].labels});const i=se(t);Object.keys(i).forEach((e=>{const n=i[e];oe[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),oe[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 re=oe,ae=r&&r.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mi,"__esModule",{value:!0}),mi.ColorToFilter=void 0;const he=wi,le=$i,ce=_i,ue=Ci,de=Di,fe=ae(re);mi.ColorToFilter=class{static rgbToFilter(t,i){return ue.RgbToFilter.convert({colorString:t,validateAndParse:de.ColorParser.validateAndParseRgb,addSheen:le.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return ue.RgbToFilter.convert({colorString:t,validateAndParse:de.ColorParser.validateAndParseHex,convertToRgb:fe.default.hex.rgb,addSheen:le.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return ue.RgbToFilter.convert({colorString:t,validateAndParse:de.ColorParser.validateAndParseHsl,convertToRgb:fe.default.hsl.rgb,addSheen:le.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,i){return ue.RgbToFilter.convert({colorString:t,validateAndParse:de.ColorParser.validateAndParseKeyword,convertToRgb:fe.default.keyword.rgb,conversionErrorMessage:he.ErrorHandling.generateInputErrorMessage(ce.ColorTypes.KEYWORD,t),addSheen:le.SheenUtil.parseSheenFromOptions(i)})}};var pe={},ve={},ge={},be={};Object.defineProperty(be,"__esModule",{value:!0}),be.FilterToHexShared=void 0;const me=wi,we=Ni,ye=_i;be.FilterToHexShared=class{static generateInputErrorMessage(t){return me.ErrorHandling.generateInputErrorMessage(ye.ColorTypes.FILTER,t,we.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 s=document.createElementNS(e,"rect");return s.setAttributeNS(null,"width",i.toString()),s.setAttributeNS(null,"height",i.toString()),n.appendChild(s),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 xe,ke={exports:{}};xe=ke,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,s=new Uint8Array(n),o=0;o<n;o++)s[o]=e.charCodeAt(o);i(new Blob([s],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var e=document.implementation.createHTMLDocument(),n=e.createElement("base");e.head.appendChild(n);var s=e.createElement("a");return e.body.appendChild(s),n.href=i,s.href=t,s.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 s=new FileReader;s.onloadend=function(){var t=s.result.split(/,/)[1];i(t)},s.readAsDataURL(n.response)}else e?i(e):r("cannot fetch resource: "+t+", status: "+n.status)},n.ontimeout=function(){e?i(e):r("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 s=o.impl.options.imagePlaceholder.split(/,/);s&&s[1]&&(e=s[1])}function r(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 s(e,t,i,o)}))})),n})):Promise.resolve(t)},shouldProcess:e,impl:{readUrls:n,inline:s}};function e(t){return-1!==t.search(i)}function n(e){for(var n,s=[];null!==(n=i.exec(e));)s.push(n[1]);return s.filter((function(i){return!t.isDataUrl(i)}))}function s(i,e,n,s){return Promise.resolve(e).then((function(i){return n?t.resolveUrl(i,n):i})).then(s||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(s){return s 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)}(s).then((function(){return s instanceof HTMLImageElement?e(s).inline():Promise.all(t.asArray(s.childNodes).map((function(t){return n(t)})))})):Promise.resolve(s)},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}))}))}}}}(),s={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:r,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 r(i,e){return function(t){o.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?s.imagePlaceholder:t.imagePlaceholder,o.impl.options.cacheBust=void 0===t.cacheBust?s.cacheBust:t.cacheBust}(e=e||{}),Promise.resolve(i).then((function(t){return h(t,e.filter,!0)})).then(l).then(c).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 r(i,e).then(t.makeImage).then(t.delay(100)).then((function(n){var s=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 s=n.getContext("2d");s.fillStyle=e.bgcolor,s.fillRect(0,0,n.width,n.height)}return n}(i);return s.getContext("2d").drawImage(n,0,0),s}))}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 s=i.childNodes;return 0===s.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(s),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),s=e.style,n.cssText?s.cssText=n.cssText:function(i,e){t.asArray(i).forEach((function(t){e.setProperty(t,i.getPropertyValue(t),i.getPropertyPriority(t))}))}(n,s);var n,s})).then((function(){[":before",":after"].forEach((function(n){!function(n){var s=window.getComputedStyle(i,n),o=s.getPropertyValue("content");if(""!==o&&"none"!==o){var r=t.uid();e.className=e.className+" "+r;var a=document.createElement("style");a.appendChild(function(i,e,n){var s="."+i+":"+e,o=n.cssText?r(n):a(n);return document.createTextNode(s+"{"+o+"}");function r(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":"")}}}(r,n,s)),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 l(t){return e.resolveAll().then((function(i){var e=document.createElement("style");return t.appendChild(e),e.appendChild(document.createTextNode(i)),t}))}function c(t){return n.inlineAll(t).then((function(){return t}))}xe.exports=o}();var $e=r&&r.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var s=Object.getOwnPropertyDescriptor(i,e);s&&!("get"in s?!i.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,s)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),je=r&&r.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),_e=r&&r.__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)&&$e(i,t,e);return je(i,t),i};Object.defineProperty(ge,"__esModule",{value:!0}),ge.FilterToHexBrowser=void 0;const Ce=wi,Se=be;class Oe extends Se.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const e=Se.FilterToHexShared.generateInputErrorMessage(t),n=Ce.ErrorHandling.generateErrorResult(e);return Oe.cleanup(i),n}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>_e(ke.exports)))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:e}=Se.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return Oe.returnInputError(t,e);const n=await Oe.getImageBase64ViaSVG(e),s=await Se.FilterToHexShared.getColorViaImageDataURL(n);return Oe.cleanup(e),{color:s}}}ge.FilterToHexBrowser=Oe;var Me=r&&r.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e);var s=Object.getOwnPropertyDescriptor(i,e);s&&!("get"in s?!i.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return i[e]}}),Object.defineProperty(t,n,s)}:function(t,i,e,n){void 0===n&&(n=e),t[n]=i[e]}),Te=r&&r.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),Pe=r&&r.__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)&&Me(i,t,e);return Te(i,t),i};Object.defineProperty(ve,"__esModule",{value:!0}),ve.FilterToHex=void 0;const Ae=wi,Ee=ge;ve.FilterToHex=class{static async convert(t,i,e){try{let n;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>Pe(require("./workers/node"))));n=await i.convert(t)}else n=await Ee.FilterToHexBrowser.convert(t);return n.color&&i&&"string"==typeof n.color&&(n.color=i(n.color,e)),n}catch(t){return Ae.ErrorHandling.generateUnexpectedError(t)}}};var Le={},ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.ColorFormatter=void 0,ze.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 Ie=r&&r.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.HexToColor=void 0;const De=ze,Fe=Ie(re);Le.HexToColor=class{static convertToRgb(t,i){const e=Fe.default.hex.rgb(t);return"string"===(null==i?void 0:i.resultType)?De.ColorFormatter.arrayToRgbString(e):e}static convertToHsl(t,i){const e=Fe.default.hex.hsl(t);return"string"===(null==i?void 0:i.resultType)?De.ColorFormatter.arrayToHslString(e):e}},Object.defineProperty(pe,"__esModule",{value:!0}),pe.FilterToColor=void 0;const Re=ve,Ne=Le;pe.FilterToColor=class{static async filterToHex(t){const i=await Re.FilterToHex.convert(t);return i.color&&(i.color=i.color.toUpperCase()),i}static async filterToRgb(t,i){return Re.FilterToHex.convert(t,Ne.HexToColor.convertToRgb,i)}static async filterToHsl(t,i){return Re.FilterToHex.convert(t,Ne.HexToColor.convertToHsl,i)}},function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const e=mi,n=pe;class s{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=s,t.exports=s}(bi,bi.exports);const We=N(bi.exports),Ue=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=`${We.hexToFilter(W(this.filter).toHexString()).color}`)}this.showSpeakIcon&&m(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(${l(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(${l(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:l(this.src),alt:"",style:this.style}))}get el(){return s(this)}};Ue.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 Be=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(z))||"";i=this.inputString,localStorage.setItem(z,JSON.stringify(i));const e=document.getElementById(E),n=t.target.getAttribute("value"),s=e.querySelectorAll(`[value= '${n}']`),o=Array.from(s).find((t=>!t.className.includes("key-button")));let r;if(this.inputString=n,o){const t=document.body.getBoundingClientRect(),i=o.getBoundingClientRect();r=i.left<t.right&&i.right>t.left&&i.top<t.bottom&&i.bottom>t.top}if(r)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),D()}else y(o),f(!0);else{const t=e.getAttribute("onInCorrect");await p(t,this.el),f(!1)}}componentDidLoad(){if(document.getElementById(E).getAttribute("drop-action")===U.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(E).getAttribute("show-check");return e(n,{key:"030937c20c1e5652a528e9f5e3335faafe18fff1",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:"4c928db14ba00f8aa20dcdb9e220f0486949e861",class:"input-area"},e("input",{key:"f8db5e6f76aba08fb5893fd3fff7e6739dd5f854",type:"text",value:this.inputString,class:"input-area",readonly:!0,onInput:t=>this.inputString=t.target.value}),e("lido-text",{key:"58156eabbdd1fe9d06fa0ff3e192ab0f434fcd9e",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:"79538fe14d2645dc7ae62f4e24da2300a680b1cc",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:"0d09084f44fe8a69e19006daccd1029e291b43e5",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:"9b2686af38ffed8e792f93f8302f01d59dbd2748",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,s]=t.split("-"),o="disable"===s;let r="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+=r,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return s(this)}};Be.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 Ve=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.onCorrect=void 0,this.onInCorrect=void 0,this.onEntry=void 0,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(${l(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(${l(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()),B()}getSlotData(){const t={};return this.text?(this.text.split(",").forEach(((i,e)=>{const[n,s]=i.split("-"),o=parseInt(n.trim());isNaN(o)||(t[e]={text:n.trim(),color:null==s?void 0:s.trim()})})),t):t}render(){let t=1;const i=this.getSlotData();return e(n,{key:"8232965fc3fb0b298233d21d7f50412508dc2256",class:"math-matrix",style:{height:this.style.height,width:this.style.width,z:this.style.z,display:this.style.display,top:this.style.top,left:this.style.left},type:this.type,value:this.value,"tab-index":this.tabIndex,rows:this.style.rows,cols:this.style.cols,text:this.text,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},Array.from({length:parseInt(this.style.rows)+1},((n,s)=>e("div",{class:"slot-parent",key:`row-${s}`},e("div",{style:0===s&&{visibility:"hidden"},class:"topIndex"},s),Array.from({length:parseInt(this.style.cols)},((n,o)=>{var r,a;return 0===s?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-${s}-${o}`,style:{borderRadius:this.style.borderRadius,backgroundColor:(null===(r=i[t-1])||void 0===r?void 0:r.color)||""}},null===(a=i[t-1])||void 0===a?void 0:a.text,t++&&null)})),e("div",{style:0===s&&{visibility:"hidden"},class:"bottomIndex"},parseInt(this.style.cols)*s)))))}get el(){return s(this)}};Ve.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 Xe=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:"0eea8147ee3845668e83bed01164dce740aae785",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:"ca9378dc185eeb4d495ab3045d6b17424de908dc"}))}get el(){return s(this)}};Xe.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 He=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,s=t.offsetHeight;console.log("child width",n);const o=i-n,r=e-s,a=Math.random()*o,h=Math.random()*r;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&&m(this.el)}render(){return e(n,{key:"cc8bb9d31ff6c36201d266f5579288c92c05bf82",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:"d91a2403fa78320cbae40456dc0c86b44493bb5a"}))}get el(){return s(this)}};He.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const Ye=class{constructor(i){t(this,i),this.locale="",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}connectedCallback(){this.setLanguage(this.locale)}onLangChange(t){this.setLanguage(t)}setLanguage(t){Xt.changeLanguage(t||Xt.language)}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 s=await e.text();this.xmlData=s}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",{showNav:!0,activeContainerIndexes:[],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"]}static get watchers(){return{locale:["onLangChange"]}}},Ge=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&&m(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:"2d2f701dda922276d2485e91f15c8912c90d7b8d",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:"b00002ecc9d5de422094beffc33ae5137b958fa3"}))}get el(){return s(this)}};Ge.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const qe=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:"7a626d9f00854cf190c08524153086d0e9f139af",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 s(this)}};qe.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 Ke=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(l(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 s,o;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("height")||100,this.originalY=+e.getAttribute("y")||0),s=this.originalHeight,o=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+e.getAttribute("width")||100,this.originalY=+e.getAttribute("x")||0),s=this.originalHeight,o=this.originalY);const r=s,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 l=r*h,c="vertical"===n?a+(r-l):a;"vertical"===n?(e.setAttribute("height",l.toString()),e.setAttribute("y",c.toString())):(e.setAttribute("width",l.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,s=n+1,o=e.getTotalLength(),r=(this.max-this.min)/n;for(let t=0;t<s;t++){let s=0;"vertical"===this.fillDirection?s=this.max-t*r:"horizontal"===this.fillDirection&&(s=this.min+t*r);const a=e.getPointAtLength(o/n*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),l=V(s/this.max);s="integer"===this.numberType?Math.round(s):"decimal"===this.numberType?parseFloat(s.toFixed(1)):l.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=s.toString(),i.appendChild(h)}}render(){return e(n,{key:"3918ed476b3de4977c53ff0bf576253f68e8c84f",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:"8f54b0e5de490a162aaa1d7ac9ed485d1628c484",innerHTML:this.svgContent,class:"svg-element"}))}get el(){return s(this)}static get watchers(){return{src:["onSrcChange"],fill:["onPropChange"],division:["onPropChange"],fillDirection:["onPropChange"],numberType:["onPropChange"],min:["onPropChange"],max:["onPropChange"]}}};Ke.style=".svg-element,svg{width:100%;height:100%}";const Je=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&&m(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?l(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:"89ed432cbbf1f3ca2cdcaf4df80628350badef6d",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"}," ",Xt.t(this.string)):Xt.t(this.string))}get el(){return s(this)}};Je.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 Qe=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.freeTraceUpdateCounter=0,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:375,freeTraceProximityThreshold:350,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(l(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&&(H(this.el),this.el.append(H(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"),s=new Image;s.onload=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",l(this.fingerHintUrl))},s.onerror=()=>{n.setAttributeNS("http://www.w3.org/1999/xlink","href",l(Y))},s.src=l(this.fingerHintUrl||Y),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 r=document.createElementNS("http://www.w3.org/2000/svg","mpath");r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),o.appendChild(r),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,s=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let r=0;r<=100;r++){const a=t.getPointAtLength(r/100*i);a.x<e&&(e=a.x),a.y<n&&(n=a.y),a.x>s&&(s=a.x),a.y>o&&(o=a.y)}})),e-=i,n-=i,s+=i,o+=i,{minX:e,minY:n,maxX:s,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"),s=this.calculateBoundingBox(Array.from(n));e.setAttribute("viewBox",`${s.minX} ${s.minY} ${s.maxX-s.minX} ${s.maxY-s.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 s=e.querySelector("defs#lido-flow-defs");s||(s=document.createElementNS("http://www.w3.org/2000/svg","defs"),s.setAttribute("id","lido-flow-defs"),e.insertBefore(s,e.firstChild));const o=`arrow-${Math.random().toString(36)}`,r=document.createElementNS("http://www.w3.org/2000/svg","marker");r.setAttribute("id",o),r.setAttribute("markerWidth","10"),r.setAttribute("markerHeight","10"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("orient","auto"),r.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"),r.appendChild(a),s.appendChild(r),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 s=i.cloneNode();s.style.opacity="100",s.style["stroke-opacity"]="100";const o=i.style["stroke-width"]||i.getAttribute("stroke-width");s.setAttribute("stroke-width",o),s.setAttribute("stroke-dasharray",n.toString()),s.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(s,i),i.setAttribute("class","lido-trace-path"),s.setAttribute("class","lido-trace-path-green"),i.greenPath=s,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,s;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===(s=t.svg)||void 0===s||s.addEventListener("contextmenu",(t=>{t.preventDefault()}))}handlePointerMove(t){var i,e,n,s,o,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;this.hideFingerHint();const a=this.getPointerPosition(t.pointerMoveEvent,t.svg),h={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};if(t.lastPointerPos){const i=a.x-t.lastPointerPos.x,e=a.y-t.lastPointerPos.y;if(i*i+e*e<1)return}const l=t.paths[t.currentPathIndex];if(!l)return void console.error("No valid path found at the current index");let c;if(c=t.mode===X.FreeTrace||t.mode===X.BlindFreeTrace?t.freeTraceProximityThreshold*t.freeTraceProximityThreshold:t.proximityThreshold*t.proximityThreshold,this.getDistanceSquared(a,h)>c)return;const u=this.getClosestPointOnPath(l,a);if(!(this.getDistanceSquared(a,u)>c)){if(t.mode===X.FreeTrace||t.mode===X.BlindFreeTrace){if(this.freeTraceUpdateCounter=(this.freeTraceUpdateCounter||0)+1,this.freeTraceUpdateCounter%2!=0)return;if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","polyline"),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("points",`${a.x},${a.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.currentFreePolylinePoints=t.currentFreePolylinePoints||[],t.currentFreePolylinePoints[t.currentPathIndex]=[{x:a.x,y:a.y}],t.lastPointerPos=a,t.freeTracePointsCount=1}const s=10;if(t.freeTracePointsCount=(t.freeTracePointsCount||1)+1,t.freeTracePointsCount>s)return;t.currentFreePolylinePoints=t.currentFreePolylinePoints||[];let o=t.currentFreePolylinePoints[t.currentPathIndex]||[];o.push({x:a.x,y:a.y}),t.currentFreePolylinePoints[t.currentPathIndex]=o;const r=o.map((t=>`${t.x},${t.y}`)).join(" ");t.currentFreePath[t.currentPathIndex].setAttribute("points",r),t.circle.setAttribute("cx",a.x.toString()),t.circle.setAttribute("cy",a.y.toString());const h=null===(e=t.svg)||void 0===e?void 0:e.childNodes;let l=!1;for(let t=0;t<((null==h?void 0:h.length)||0);t++){const i=null==h?void 0:h.item(t);if(i&&"circle"===i.tagName){l=!0;break}}return!l&&t.circle&&(null===(n=t.svg)||void 0===n||n.appendChild(t.circle)),t.lastPointerPos=a,void(o.length>=s&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null,t.currentFreePolylinePoints[t.currentPathIndex]=[],t.freeTracePointsCount=0))}if(t.isDragging&&u.length>=t.lastLength){t.lastLength=u.length,(Math.abs(u.x-h.x)>1||Math.abs(u.y-h.y)>1)&&(t.circle.setAttribute("cx",u.x.toString()),t.circle.setAttribute("cy",u.y.toString()));const i=null===(s=t.svg)||void 0===s?void 0:s.childNodes;let e=!1;for(let t=0;t<((null==i?void 0:i.length)||0);t++){const n=null==i?void 0:i.item(t);if(n&&"circle"===n.tagName){e=!0;break}}!e&&t.circle&&(null===(o=t.svg)||void 0===o||o.appendChild(t.circle)),null===(r=l.greenPath)||void 0===r||r.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString());const n=.9;let a=t.lastLength/t.totalPathLength,c=l.getPointAtLength(0),d=l.getPointAtLength(l.getTotalLength());this.getDistanceSquared(c,d)<200&&t.totalPathLength>50?a>=n&&(t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer()):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()}}}async moveToNextContainer(){if(this.isDragging=!1,!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);console.log("onCorrect:",this.onCorrect),console.log("el :",this.el),this.el&&this.onCorrect&&await p(this.onCorrect,this.el),console.log("All SVGs completed, hiding component."),D()}}getPointerPosition(t,i){var e;const n=i.createSVGPoint();n.x=t.clientX,n.y=t.clientY;const s=null===(e=i.getScreenCTM())||void 0===e?void 0:e.inverse();return s?n.matrixTransform(s):{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},s=1/0,o={x:0,y:0,length:0},r=1/0;for(let n=0;n<=e;n+=40){const e=t.getPointAtLength(n),s=this.getDistanceSquared(i,e);s<r&&(r=s,o={x:e.x,y:e.y,length:n})}const a=Math.max(o.length-40,0),h=Math.min(o.length+40,e);for(let e=a;e<=h;e+=6){const o=t.getPointAtLength(e),r=this.getDistanceSquared(i,o);r<s&&(s=r,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(l(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 s=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",s.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",s.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(E))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 s=e.getAttribute("span-type");if(!s)return;const o=e.querySelector(".lido-text-content");if(o){if("letters"===s){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(l(this.audioUrls[this.currentSvgIndex]));await t.play()}}if("words"===s){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(l(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:"3f12119394502b6750874aaa50f43bf42e9f63cc",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:"4fddd90d12251c4020006690f8c769ab452c8f6a",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return s(this)}static get watchers(){return{svgSource:["initializeSVG"],mode:["initializeSVG"]}}};Qe.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 Ze=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&&m(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:"50bc5770105477d0ef7cb080957c8d00198c8b09",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:"fcd1f5801e34171d1925e39f6c543f229a5d42bd"}))}get el(){return s(this)}};Ze.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{K as lido_avatar,J as lido_balance,Q as lido_calculator,Z as lido_canvas,tt as lido_cell,it as lido_col,di as lido_container,fi as lido_flash_card,pi as lido_float,vi as lido_home,Ue as lido_image,Be as lido_keyboard,Ve as lido_math_matrix,Xe as lido_pos,He as lido_random,Ye as lido_root,Ge as lido_row,qe as lido_shape,Ke as lido_slide_fill,Je as lido_text,Qe as lido_trace,Ze as lido_wrap}
|