lido-player 0.0.2-alpha-21 → 0.0.2-alpha-23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/index.cjs.js +1 -1
  2. package/dist/cjs/lido-avatar_17.cjs.entry.js +2 -1
  3. package/dist/cjs/{utils-677af176.js → utils-62b0df5b.js} +15 -4
  4. package/dist/collection/components/home/lido-home.js +1 -0
  5. package/dist/collection/utils/utils.js +4 -0
  6. package/dist/collection/utils/utilsHandlers/dragDropHandler.js +11 -4
  7. package/dist/components/index.js +1 -1
  8. package/dist/components/lido-avatar.js +1 -1
  9. package/dist/components/lido-cell.js +1 -1
  10. package/dist/components/lido-col.js +1 -1
  11. package/dist/components/lido-container.js +1 -1
  12. package/dist/components/lido-flash-card.js +1 -1
  13. package/dist/components/lido-float.js +1 -1
  14. package/dist/components/lido-home.js +1 -1
  15. package/dist/components/lido-image.js +1 -1
  16. package/dist/components/lido-pos.js +1 -1
  17. package/dist/components/lido-random.js +1 -1
  18. package/dist/components/lido-root.js +17 -17
  19. package/dist/components/lido-row.js +1 -1
  20. package/dist/components/lido-shape.js +1 -1
  21. package/dist/components/lido-slide-fill.js +1 -1
  22. package/dist/components/lido-text.js +1 -1
  23. package/dist/components/lido-trace.js +1 -1
  24. package/dist/components/lido-wrap.js +1 -1
  25. package/dist/components/{p-f47d09ca.js → p-0a506ec7.js} +1 -1
  26. package/dist/components/{p-e5d3e84e.js → p-10b5bf17.js} +1 -1
  27. package/dist/components/{p-bcd6fcc5.js → p-21efe75a.js} +1 -1
  28. package/dist/components/{p-509e23d5.js → p-2a0f78da.js} +1 -1
  29. package/dist/components/{p-5dea6a86.js → p-7720988c.js} +1 -1
  30. package/dist/components/{p-4272a4b0.js → p-893266ae.js} +17 -16
  31. package/dist/components/{p-1bf7f8c5.js → p-92c44c3e.js} +1 -1
  32. package/dist/components/{p-cbc2a355.js → p-b720a4eb.js} +1 -1
  33. package/dist/components/{p-cb3950d0.js → p-bae44292.js} +1 -1
  34. package/dist/components/{p-a647a4fe.js → p-c35eb8eb.js} +1 -1
  35. package/dist/components/{p-8173be9b.js → p-c88253f5.js} +1 -1
  36. package/dist/components/{p-0846f16a.js → p-d458e85f.js} +1 -1
  37. package/dist/components/{p-4817b81a.js → p-d8604dea.js} +15 -4
  38. package/dist/components/{p-b145c3fa.js → p-da9ac604.js} +1 -1
  39. package/dist/components/{p-0c349e4c.js → p-e6ebeb10.js} +1 -1
  40. package/dist/components/{p-7f5a97ff.js → p-f1d4885a.js} +1 -1
  41. package/dist/components/{p-06f1ae64.js → p-f93449bf.js} +1 -1
  42. package/dist/esm/index.js +1 -1
  43. package/dist/esm/lido-avatar_17.entry.js +2 -1
  44. package/dist/esm/{utils-4008e3c6.js → utils-2183f4e9.js} +15 -4
  45. package/dist/lido-player/index.esm.js +1 -1
  46. package/dist/lido-player/lido-player.esm.js +1 -1
  47. package/dist/lido-player/{p-1e744f1d.js → p-458281d6.js} +1 -1
  48. package/dist/lido-player/{p-397463d6.entry.js → p-de90219f.entry.js} +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- import{r as t,h as i,H as n,a as e,g as r}from"./p-ddf627b0.js";import{c as o,s,i as a,a as h,R as c,h as u,b as l,p as d,d as f,e as p,g as v,j as w,k as m,l as b,m as g,N as y,P as x,L as k,A as _,n as M,t as j,o as C,q as T,r as $,u as P,v as O,T as A,w as E,x as S}from"./p-1e744f1d.js";var D,I={exports:{}};D=()=>(()=>{var t=[,(t,i,n)=>{var e;n.r(i),n.d(i,{default:()=>r});const r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var i,n,r=t;function o(){function t(t){const o=e;n=i=0,e=new Map,o.forEach((i=>{try{i(t)}catch(t){console.error(t)}})),this.ob(),r&&r.Tb()}let i=0,n=0,e=new Map,r=null,o=null;this.requestAnimationFrame=function(r){i||(i=requestAnimationFrame(t.bind(this)));const o=++n;return e.set(o,r),o},this.cancelAnimationFrame=function(t){e.delete(t),i&&0==e.size&&(cancelAnimationFrame(i),i=0)},this.Rb=function(t){o&&(document.body.remove(o),o=null),t||(o=document.createElement("div"),o.style.backgroundColor="black",o.style.position="fixed",o.style.right=0,o.style.top=0,o.style.color="white",o.style.padding="4px",o.innerHTML="RIVE FPS",t=function(t){o.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(o)),r=new function(){let i=0,n=0;this.Tb=function(){var e=performance.now();n?(++i,1e3<(e-=n)&&(t(1e3*i/e),i=n=0)):(n=e,i=0)}}},this.Ob=function(){o&&(document.body.remove(o),o=null),r=null},this.ob=function(){}}function s(t){console.assert(!0);const i=new Map;let n=-1/0;this.push=function(e){return i.has(e=e+((1<<t)-1)>>t)&&clearTimeout(i.get(e)),i.set(e,setTimeout((function(){i.delete(e),0==i.length?n=-1/0:e==n&&(n=Math.max(...i.keys()),console.assert(n<e))}),1e3)),n=Math.max(e,n),n<<t}}r.ready=new Promise(((t,e)=>{i=t,n=e}));const a=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){a&&a();let t=r.decodeAudio;r.decodeAudio=function(i,n){n(i=t(i))};let i=r.decodeFont;r.decodeFont=function(t,n){n(t=i(t))};const n=r.FileAssetLoader;r.ptrToAsset=t=>{let i=r.ptrToFileAsset(t);return i.isImage?r.ptrToImageAsset(t):i.isFont?r.ptrToFontAsset(t):i.isAudio?r.ptrToAudioAsset(t):i},r.CustomFileAssetLoader=n.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Gb=t},loadContents:function(t,i){return t=r.ptrToAsset(t),this.Gb(t,i)}}),r.CDNFileAssetLoader=n.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=r.ptrToAsset(t);return""!==(t=i.cdnUuid)&&(n=i.cdnBaseUrl+"/"+t,(e=new XMLHttpRequest).responseType="arraybuffer",e.onreadystatechange=function(){4==e.readyState&&200==e.status&&(t=>{i.decode(new Uint8Array(t.response))})(e)},e.open("GET",n,!0),e.send(null),!0);var n,e}}),r.FallbackFileAssetLoader=n.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.kb=[]},addLoader:function(t){this.kb.push(t)},loadContents:function(t,i){for(let n of this.kb)if(n.loadContents(t,i))return!0;return!1}});let e=r.computeAlignment;r.computeAlignment=function(t,i,n,r,o=1){return e.call(this,t,i,n,r,o)}};const h="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),c=new function(){function t(){if(!i){var t=document.createElement("canvas"),s={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let a;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(a=t.getContext("webgl",s),n=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",s))n=2;else{if(!(a=t.getContext("webgl",s)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;n=1}function h(t,i,n){if(i=a.createShader(i),a.shaderSource(i,n),a.compileShader(i),0<((n=a.getShaderInfoLog(i))||"").length)throw n;a.attachShader(t,i)}if(a=new Proxy(a,{get:(t,i)=>t.isContextLost()?(c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),c=!0),"function"==typeof t[i]?function(){}:void 0):"function"==typeof t[i]?function(...n){return t[i].apply(t,n)}:t[i],set(t,i,n){if(!t.isContextLost())return t[i]=n,!0;c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),c=!0)}}),e=Math.min(a.getParameter(a.MAX_RENDERBUFFER_SIZE),a.getParameter(a.MAX_TEXTURE_SIZE)),h(t=a.createProgram(),a.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }"),h(t,a.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),a.bindAttribLocation(t,0,"vertex"),a.bindAttribLocation(t,1,"uv"),a.linkProgram(t),0<((s=a.getProgramInfoLog(t))||"").trim().length)throw s;r=a.getUniformLocation(t,"mat"),o=a.getUniformLocation(t,"translate"),a.useProgram(t),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.enableVertexAttribArray(0),a.enableVertexAttribArray(1),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,a.createBuffer()),a.uniform1i(a.getUniformLocation(t,"image"),0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i=a}return!0}let i=null,n=0,e=0,r=null,o=null,a=0,h=0,c=!1;t(),this.hc=function(){return t(),e},this.Mb=function(t){i.deleteTexture&&i.deleteTexture(t)},this.Lb=function(e){if(!t())return null;const r=i.createTexture();return r?(i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),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==n?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.generateMipmap(i.TEXTURE_2D)):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),r):null};const u=new s(8),l=new s(8),d=new s(10),f=new s(10);this.Qb=function(n,e,s,c,p){if(t()){var v=u.push(n),w=l.push(e);if(i.canvas){for(var m of(i.canvas.width==v&&i.canvas.height==w||(i.canvas.width=v,i.canvas.height=w),i.viewport(0,w-e,n,e),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.SCISSOR_TEST),s.sort(((t,i)=>i.wb-t.wb)),v=d.push(c),a!=v&&(i.bufferData(i.ARRAY_BUFFER,8*v,i.DYNAMIC_DRAW),a=v),v=0,s))i.bufferSubData(i.ARRAY_BUFFER,v,m.Ta),v+=4*m.Ta.length;for(var b of(console.assert(v==4*c),s))i.bufferSubData(i.ARRAY_BUFFER,v,b.Db),v+=4*b.Db.length;for(var g of(console.assert(v==8*c),v=f.push(p),h!=v&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*v,i.DYNAMIC_DRAW),h=v),m=0,s))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,m,g.indices),m+=2*g.indices.length;console.assert(m==2*p),g=0,b=!0,v=m=0;for(const t of s){t.image.Ka!=g&&(i.bindTexture(i.TEXTURE_2D,t.image.Ja||null),g=t.image.Ka),t.mc?(i.scissor(t.Ya,w-t.Za-t.jb,t.Ac,t.jb),b=!0):b&&(i.scissor(0,w-e,n,e),b=!1);const a=-2/e;i.uniform4f(r,t.ha[0]*(s=2/n)*t.Ba,t.ha[1]*a*t.Ca,t.ha[2]*s*t.Ba,t.ha[3]*a*t.Ca),i.uniform2f(o,t.ha[4]*s*t.Ba+s*(t.Ya-t.ic*t.Ba)-1,t.ha[5]*a*t.Ca+a*(t.Za-t.jc*t.Ca)+1),i.vertexAttribPointer(0,2,i.FLOAT,!1,0,v),i.vertexAttribPointer(1,2,i.FLOAT,!1,0,v+4*c),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,m),v+=4*t.Ta.length,m+=2*t.indices.length}console.assert(v==4*c),console.assert(m==2*p)}}},this.canvas=function(){return t()&&i.canvas}},u=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function i(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function n(){0<M.length&&(c.Qb(_.drawWidth(),_.drawHeight(),M,j,C),M=[],C=j=0,_.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}u&&u();var e=r.RenderPaintStyle;const s=r.RenderPath,a=r.RenderPaint,l=r.Renderer,d=r.StrokeCap,f=r.StrokeJoin,p=r.BlendMode,v=e.fill,w=e.stroke,m=r.FillRule.evenOdd;let b=1;var g=r.RenderImage.extend("CanvasRenderImage",{__construct:function({la:t,xa:i}={}){this.__parent.__construct.call(this),this.Ka=b,b=b+1&2147483647||1,this.la=t,this.xa=i},__destruct:function(){this.Ja&&(c.Mb(this.Ja),URL.revokeObjectURL(this.Wa)),this.__parent.__destruct.call(this)},decode:function(t){var i=this;i.xa&&i.xa(i);var n=new Image;i.Wa=URL.createObjectURL(new Blob([t],{type:"image/png"})),n.onload=function(){i.Fb=n,i.Ja=c.Lb(n),i.size(n.width,n.height),i.la&&i.la(i)},n.src=i.Wa}}),y=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,i,n,e,r,o,s){var a=this.T,h=a.addPath;t=t.T;const c=new DOMMatrix;c.a=i,c.b=n,c.c=e,c.d=r,c.e=o,c.f=s,h.call(a,t,c)},fillRule:function(t){this.Va=t},moveTo:function(t,i){this.T.moveTo(t,i)},lineTo:function(t,i){this.T.lineTo(t,i)},cubicTo:function(t,i,n,e,r,o){this.T.bezierCurveTo(t,i,n,e,r,o)},close:function(){this.T.closePath()}}),x=a.extend("CanvasRenderPaint",{color:function(t){this.Xa=i(t)},thickness:function(t){this.Ib=t},join:function(t){switch(t){case f.miter:this.Ia="miter";break;case f.round:this.Ia="round";break;case f.bevel:this.Ia="bevel"}},cap:function(t){switch(t){case d.butt:this.Ha="butt";break;case d.round:this.Ha="round";break;case d.square:this.Ha="square"}},style:function(t){this.Hb=t},blendMode:function(i){this.Eb=t(i)},clearGradient:function(){this.ja=null},linearGradient:function(t,i,n,e){this.ja={yb:t,zb:i,bb:n,cb:e,Ra:[]}},radialGradient:function(t,i,n,e){this.ja={yb:t,zb:i,bb:n,cb:e,Ra:[],ec:!0}},addStop:function(t,i){this.ja.Ra.push({color:t,stop:i})},completeGradient:function(){},draw:function(t,n,e){let r=this.Hb;var o=this.Xa,s=this.ja;if(t.globalCompositeOperation=this.Eb,null!=s){o=s.yb;var a=s.zb;const n=s.bb;var h=s.cb;const e=s.Ra;s.ec?(s=n-o,h-=a,o=t.createRadialGradient(o,a,0,o,a,Math.sqrt(s*s+h*h))):o=t.createLinearGradient(o,a,n,h);for(let t=0,n=e.length;t<n;t++)o.addColorStop((a=e[t]).stop,i(a.color));this.Xa=o,this.ja=null}switch(r){case w:t.strokeStyle=o,t.lineWidth=this.Ib,t.lineCap=this.Ha,t.lineJoin=this.Ia,t.stroke(n);break;case v:t.fillStyle=o,t.fill(n,e)}}});const k=new Set;let _=null,M=[],j=0,C=0;var T=r.CanvasRenderer=l.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,n,e,r,o){const s=this.S,a=s.length-6;s.splice(a,6,s[a]*t+s[a+2]*i,s[a+1]*t+s[a+3]*i,s[a]*n+s[a+2]*e,s[a+1]*n+s[a+3]*e,s[a]*r+s[a+2]*o+s[a+4],s[a+1]*r+s[a+3]*o+s[a+5]),this.H.push(this.C.transform.bind(this.C,t,i,n,e,r,o))},rotate:function(t){const i=Math.sin(t);t=Math.cos(t),this.transform(t,i,-i,t,0,0)},_drawPath:function(t,i){this.H.push(i.draw.bind(i,this.C,t.T,t.Va===m?"evenodd":"nonzero"))},_drawRiveImage:function(i,n,e){var r=i.Fb;if(r){var o=this.C,s=t(n);this.H.push((function(){o.globalCompositeOperation=s,o.globalAlpha=e,o.drawImage(r,0,0),o.globalAlpha=1}))}},_getMatrix:function(t){const i=this.S,n=i.length-6;for(let e=0;6>e;++e)t[e]=i[n+e]},_drawImageMesh:function(i,e,o,s,a,h,u,l,d,f){var p=this.C.canvas.width,v=this.C.canvas.height;const w=d-u,m=f-l;u=Math.max(u,0),l=Math.max(l,0),d=Math.min(d,p),f=Math.min(f,v);const b=d-u,g=f-l;if(console.assert(b<=Math.min(w,p)),console.assert(g<=Math.min(m,v)),!(0>=b||0>=g)){d=b<w||g<m,p=f=1;var y=Math.ceil(b*f),x=Math.ceil(g*p);v=c.hc(),y>v&&(f*=v/y,y=v),x>v&&(p*=v/x,x=v),_||(_=new r.DynamicRectanizer(v),_.reset(512,512)),0>(v=_.addRect(y,x))&&(n(),k.add(this),v=_.addRect(y,x),console.assert(0<=v));var T=65535&v,$=v>>16;M.push({ha:this.S.slice(this.S.length-6),image:i,Ya:T,Za:$,ic:u,jc:l,Ac:y,jb:x,Ba:f,Ca:p,Ta:new Float32Array(s),Db:new Float32Array(a),indices:new Uint16Array(h),mc:d,wb:i.Ka<<1|(d?1:0)}),j+=s.length,C+=h.length;var P=this.C,O=t(e);this.H.push((function(){P.save(),P.resetTransform(),P.globalCompositeOperation=O,P.globalAlpha=o;const t=c.canvas();t&&P.drawImage(t,T,$,y,x,u,l,b,g),P.restore()}))}},_clipPath:function(t){this.H.push(this.C.clip.bind(this.C,t.T,t.Va===m?"evenodd":"nonzero"))},clear:function(){k.add(this),this.H.push(this.C.clearRect.bind(this.C,0,0,this.Ua.width,this.Ua.height))},flush:function(){},translate:function(t,i){this.transform(1,0,0,1,t,i)}});r.makeRenderer=function(t){const i=new T(t),n=i.C;return new Proxy(i,{get(t,e){if("function"==typeof t[e])return function(...i){return t[e].apply(t,i)};if("function"==typeof n[e]){if(-1<h.indexOf(e))throw Error("RiveException: Method call to '"+e+"()' 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(n[e].bind(n,...t))}}return t[e]},set(t,e,r){if(e in n)return i.H.push((()=>{n[e]=r})),!0}})},r.decodeImage=function(t,i){new g({la:i}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=P;return new g({xa:()=>{t.total++},la:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let $=r.load,P=null;r.load=function(t,i,n=!0){const e=new r.FallbackFileAssetLoader;return void 0!==i&&e.addLoader(i),n&&(i=new r.CDNFileAssetLoader,e.addLoader(i)),new Promise((function(i){let n=null;P={total:0,loaded:0,ready:function(){i(n)}},n=$(t,e),0==P.total&&i(n)}))};let O=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,i,n,e,r=1){O.call(this,t,i,n,e,r)},e=new o,r.requestAnimationFrame=e.requestAnimationFrame.bind(e),r.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),r.enableFPSCounter=e.Rb.bind(e),r.disableFPSCounter=e.Ob,e.ob=n,r.resolveAnimationFrame=n,r.cleanup=function(){_&&_.delete()}};var l,d,f=Object.assign({},r),p="./this.program",v="object"==typeof window,w="function"==typeof importScripts,m="";(v||w)&&(w?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w&&(d=t=>{var i=new XMLHttpRequest;return i.open("GET",t,!1),i.responseType="arraybuffer",i.send(null),new Uint8Array(i.response)}),l=(t,i,n)=>{var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{200==e.status||0==e.status&&e.response?i(e.response):n()},e.onerror=n,e.send(null)});var b,g=r.print||console.log.bind(console),y=r.printErr||console.error.bind(console);Object.assign(r,f),f=null,r.thisProgram&&(p=r.thisProgram),r.wasmBinary&&(b=r.wasmBinary),"object"!=typeof WebAssembly&&X("no native wasm support detected");var x,k,_,M,j,C,T,$,P,O,A=!1;function E(){var t=x.buffer;r.HEAP8=_=new Int8Array(t),r.HEAP16=j=new Int16Array(t),r.HEAP32=T=new Int32Array(t),r.HEAPU8=M=new Uint8Array(t),r.HEAPU16=C=new Uint16Array(t),r.HEAPU32=$=new Uint32Array(t),r.HEAPF32=P=new Float32Array(t),r.HEAPF64=O=new Float64Array(t)}var S,D=[],I=[],z=[];function F(){var t=r.preRun.shift();D.unshift(t)}var L,R=0,W=null;function X(t){throw r.onAbort&&r.onAbort(t),y(t="Aborted("+t+")"),A=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),n(t),t}function U(t){return t.startsWith("data:application/octet-stream;base64,")}if(!U(L="canvas_advanced.wasm")){var N=L;L=r.locateFile?r.locateFile(N,m):m+N}function Y(t){if(t==L&&b)return new Uint8Array(b);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}function B(t,i,n){return function(t){if(!b&&(v||w)){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((()=>Y(t)));if(l)return new Promise(((i,n)=>{l(t,(t=>i(new Uint8Array(t))),n)}))}return Promise.resolve().then((()=>Y(t)))}(t).then((t=>WebAssembly.instantiate(t,i))).then((t=>t)).then(n,(t=>{y("failed to asynchronously prepare wasm: "+t),X(t)}))}var H,G,V={446236:(t,i,n,e,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={Aa:0},window.h.I={},window.h.I.ya=t,window.h.I.capture=i,window.h.I.La=n,window.h.ga={},window.h.ga.stopped=e,window.h.ga.xb=r;let o=window.h;o.D=[],o.yc=function(t){for(var i=0;i<o.D.length;++i)if(null==o.D[i])return o.D[i]=t,i;return o.D.push(t),o.D.length-1},o.Cb=function(t){for(o.D[t]=null;0<o.D.length&&null==o.D[o.D.length-1];)o.D.pop()},o.Sc=function(t){for(var i=0;i<o.D.length;++i)if(o.D[i]==t)return o.Cb(i)},o.ra=function(t){return o.D[t]},o.Bb=["touchend","click"],o.unlock=function(){for(var t=0;t<o.D.length;++t){var i=o.D[t];null!=i&&null!=i.J&&i.state===o.ga.xb&&i.J.resume().then((()=>{Pn(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,n,e,r,o)=>{if(void 0===window.h)return-1;var s={},a={};return t==window.h.I.ya&&0!=n&&(a.sampleRate=n),s.J=new(window.AudioContext||window.webkitAudioContext)(a),s.J.suspend(),s.state=window.h.ga.stopped,n=0,t!=window.h.I.ya&&(n=i),s.Z=s.J.createScriptProcessor(e,n,i),s.Z.onaudioprocess=function(n){if(null!=s.sa&&0!=s.sa.length||(s.sa=new Float32Array(P.buffer,r,e*i)),t==window.h.I.capture||t==window.h.I.La){for(var a=0;a<i;a+=1)for(var h=n.inputBuffer.getChannelData(a),c=s.sa,u=0;u<e;u+=1)c[u*i+a]=h[u];An(o,e,r)}if(t==window.h.I.ya||t==window.h.I.La)for(En(o,e,r),a=0;a<n.outputBuffer.numberOfChannels;++a)for(h=n.outputBuffer.getChannelData(a),c=s.sa,u=0;u<e;u+=1)h[u]=c[u*i+a];else for(a=0;a<n.outputBuffer.numberOfChannels;++a)n.outputBuffer.getChannelData(a).fill(0)},t!=window.h.I.capture&&t!=window.h.I.La||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){s.Da=s.J.createMediaStreamSource(t),s.Da.connect(s.Z),s.Z.connect(s.J.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.ya&&s.Z.connect(s.J.destination),s.pb=o,window.h.yc(s)},451730:t=>window.h.ra(t).J.sampleRate,451803:t=>{void 0!==(t=window.h.ra(t)).Z&&(t.Z.onaudioprocess=function(){},t.Z.disconnect(),t.Z=void 0),void 0!==t.Da&&(t.Da.disconnect(),t.Da=void 0),t.J.close(),t.J=void 0,t.pb=void 0},452203:t=>{window.h.Cb(t)},452253:t=>{(t=window.h.ra(t)).J.resume(),t.state=window.h.ga.xb},452392:t=>{(t=window.h.ra(t)).J.suspend(),t.state=window.h.ga.stopped}},q=t=>{for(;0<t.length;)t.shift()(r)},K=(t,i)=>{for(var n=0,e=t.length-1;0<=e;e--){var r=t[e];"."===r?t.splice(e,1):".."===r?(t.splice(e,1),n++):n&&(t.splice(e,1),n--)}if(i)for(;n;n--)t.unshift("..");return t},J=t=>{var i="/"===t.charAt(0),n="/"===t.substr(-1);return(t=K(t.split("/").filter((t=>!!t)),!i).join("/"))||i||(t="."),t&&n&&(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);X("initRandomDevice")})())(t);function it(){for(var t="",i=!1,n=arguments.length-1;-1<=n&&!i;n--){if("string"!=typeof(i=0<=n?arguments[n]:"/"))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 nt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,et=(t,i,n)=>{var e=i+n;for(n=i;t[n]&&!(n>=e);)++n;if(16<n-i&&t.buffer&&nt)return nt.decode(t.subarray(i,n));for(e="";i<n;){var r=t[i++];if(128&r){var o=63&t[i++];if(192==(224&r))e+=String.fromCharCode((31&r)<<6|o);else{var s=63&t[i++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|s:(7&r)<<18|o<<12|s<<6|63&t[i++])?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else e+=String.fromCharCode(r)}return e},rt=[],ot=t=>{for(var i=0,n=0;n<t.length;++n){var e=t.charCodeAt(n);127>=e?i++:2047>=e?i+=2:55296<=e&&57343>=e?(i+=4,++n):i+=3}return i},st=(t,i,n,e)=>{if(!(0<e))return 0;var r=n;e=n+e-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(n>=e)break;i[n++]=s}else{if(2047>=s){if(n+1>=e)break;i[n++]=192|s>>6}else{if(65535>=s){if(n+2>=e)break;i[n++]=224|s>>12}else{if(n+3>=e)break;i[n++]=240|s>>18,i[n++]=128|s>>12&63}i[n++]=128|s>>6&63}i[n++]=128|63&s}}return i[n]=0,n-r};function at(t,i){var n=Array(ot(t)+1);return t=st(t,n,0,n.length),i&&(n.length=t),n}var ht=[];function ct(t,i){ht[t]={input:[],F:[],V:i},Lt(t,ut)}var ut={open:function(t){var i=ht[t.node.za];if(!i)throw new jt(43);t.s=i,t.seekable=!1},close:function(t){t.s.V.qa(t.s)},qa:function(t){t.s.V.qa(t.s)},read:function(t,i,n,e){if(!t.s||!t.s.V.ib)throw new jt(60);for(var r=0,o=0;o<e;o++){try{var s=t.s.V.ib(t.s)}catch(t){throw new jt(29)}if(void 0===s&&0===r)throw new jt(6);if(null==s)break;r++,i[n+o]=s}return r&&(t.node.timestamp=Date.now()),r},write:function(t,i,n,e){if(!t.s||!t.s.V.Oa)throw new jt(60);try{for(var r=0;r<e;r++)t.s.V.Oa(t.s,i[n+r])}catch(t){throw new jt(29)}return e&&(t.node.timestamp=Date.now()),r}},lt={ib:function(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t){t=null;break t}rt=at(t,!0)}t=rt.shift()}return t},Oa:function(t,i){null===i||10===i?(g(et(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(g(et(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(et(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(y(et(t.F,0)),t.F=[])}};function ft(t,i){var n=t.j?t.j.length:0;n>=i||(i=Math.max(i,n*(1048576>n?2:1.125)>>>0),0!=n&&(i=Math.max(i,256)),n=t.j,t.j=new Uint8Array(i),0<t.v&&t.j.set(n.subarray(0,t.v),0))}var pt,vt,wt,mt,bt={O:null,U:()=>bt.createNode(null,"/",16895,0),createNode(t,i,n,e){if(24576==(61440&n)||4096==(61440&n))throw new jt(63);return bt.O||(bt.O={dir:{node:{Y:bt.l.Y,P:bt.l.P,ka:bt.l.ka,va:bt.l.va,ub:bt.l.ub,Ab:bt.l.Ab,vb:bt.l.vb,sb:bt.l.sb,Ea:bt.l.Ea},stream:{ba:bt.m.ba}},file:{node:{Y:bt.l.Y,P:bt.l.P},stream:{ba:bt.m.ba,read:bt.m.read,write:bt.m.write,pa:bt.m.pa,lb:bt.m.lb,nb:bt.m.nb}},link:{node:{Y:bt.l.Y,P:bt.l.P,ma:bt.l.ma},stream:{}},$a:{node:{Y:bt.l.Y,P:bt.l.P},stream:Ft}}),16384==(61440&(n=At(t,i,n,e)).mode)?(n.l=bt.O.dir.node,n.m=bt.O.dir.stream,n.j={}):32768==(61440&n.mode)?(n.l=bt.O.file.node,n.m=bt.O.file.stream,n.v=0,n.j=null):40960==(61440&n.mode)?(n.l=bt.O.link.node,n.m=bt.O.link.stream):8192==(61440&n.mode)&&(n.l=bt.O.$a.node,n.m=bt.O.$a.stream),n.timestamp=Date.now(),t&&(t.j[i]=n,t.timestamp=n.timestamp),n},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 n=t.j;t.j=new Uint8Array(i),n&&t.j.set(n.subarray(0,Math.min(i,t.v))),t.v=i}},ka(){throw Ct[44]},va:(t,i,n,e)=>bt.createNode(t,i,n,e),ub(t,i,n){if(16384==(61440&t.mode)){try{var e=Ot(i,n)}catch(t){}if(e)for(var r in e.j)throw new jt(55)}delete t.parent.j[t.name],t.parent.timestamp=Date.now(),t.name=n,i.j[n]=t,i.timestamp=t.parent.timestamp,t.parent=i},Ab(t,i){delete t.j[i],t.timestamp=Date.now()},vb(t,i){var n,e=Ot(t,i);for(n in e.j)throw new jt(55);delete t.j[i],t.timestamp=Date.now()},sb(t){var i,n=[".",".."];for(i in t.j)t.j.hasOwnProperty(i)&&n.push(i);return n},Ea:(t,i,n)=>((t=bt.createNode(t,i,41471,0)).link=n,t),ma(t){if(40960!=(61440&t.mode))throw new jt(28);return t.link}},m:{read(t,i,n,e,r){var o=t.node.j;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,e))&&o.subarray)i.set(o.subarray(r,r+t),n);else for(e=0;e<t;e++)i[n+e]=o[r+e];return t},write(t,i,n,e,r,o){if(i.buffer===_.buffer&&(o=!1),!e)return 0;if((t=t.node).timestamp=Date.now(),i.subarray&&(!t.j||t.j.subarray)){if(o)return t.j=i.subarray(n,n+e),t.v=e;if(0===t.v&&0===r)return t.j=i.slice(n,n+e),t.v=e;if(r+e<=t.v)return t.j.set(i.subarray(n,n+e),r),e}if(ft(t,r+e),t.j.subarray&&i.subarray)t.j.set(i.subarray(n,n+e),r);else for(o=0;o<e;o++)t.j[r+o]=i[n+o];return t.v=Math.max(t.v,r+e),e},ba(t,i,n){if(1===n?i+=t.position:2===n&&32768==(61440&t.node.mode)&&(i+=t.node.v),0>i)throw new jt(28);return i},pa(t,i,n){ft(t.node,i+n),t.node.v=Math.max(t.node.v,i+n)},lb(t,i,n,e,r){if(32768!=(61440&t.node.mode))throw new jt(43);if(t=t.node.j,2&r||t.buffer!==_.buffer){if((0<n||n+i<t.length)&&(t=t.subarray?t.subarray(n,n+i):Array.prototype.slice.call(t,n,n+i)),n=!0,X(),!(i=void 0))throw new jt(48);_.set(t,i)}else n=!1,i=t.byteOffset;return{o:i,M:n}},nb:(t,i,n,e)=>(bt.m.write(t,i,0,e,n,!1),0)}},gt=null,yt={},xt=[],kt=1,_t=null,Mt=!0,jt=null,Ct={},Tt=(t,i={})=>{if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Qa:0},i)).Qa)throw new jt(32);t=t.split("/").filter((t=>!!t));for(var n=gt,e="/",r=0;r<t.length;r++){var o=r===t.length-1;if(o&&i.parent)break;if(n=Ot(n,t[r]),e=J(e+"/"+t[r]),n.wa&&(!o||o&&i.gb)&&(n=n.wa.root),!o||i.fb)for(o=0;40960==(61440&n.mode);)if(n=Nt(e),e=it(Q(e),n),n=Tt(e,{Qa:i.Qa+1}).node,40<o++)throw new jt(32)}return{path:e,node:n}},$t=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}},Pt=(t,i)=>{for(var n=0,e=0;e<i.length;e++)n=(n<<5)-n+i.charCodeAt(e)|0;return(t+n>>>0)%_t.length},Ot=(t,i)=>{var n;if(n=(n=St(t,"x"))?n:t.l.ka?0:2)throw new jt(n,t);for(n=_t[Pt(t.id,i)];n;n=n.lc)if(n.parent.id===t.id&&n.name===i)return n;return t.l.ka(t,i)},At=(t,i,n,e)=>(t=new _n(t,i,n,e),i=Pt(t.parent.id,t.name),t.lc=_t[i],_t[i]=t),Et=t=>{var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i},St=(t,i)=>Mt?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2,Dt=(t,i)=>{try{return Ot(t,i),20}catch(t){}return St(t,"wx")},It=t=>{if(!(t=xt[t]))throw new jt(8);return t},zt=(t,i=-1)=>(wt||((wt=function(){this.h={}}).prototype={},Object.defineProperties(wt.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 wt,t),-1==i&&(i=(()=>{for(var t=0;4096>=t;t++)if(!xt[t])return t;throw new jt(33)})()),t.X=i,xt[i]=t),Ft={open:t=>{t.m=yt[t.node.za].m,t.m.open&&t.m.open(t)},ba:()=>{throw new jt(70)}},Lt=(t,i)=>{yt[t]={m:i}},Rt=(t,i)=>{var n="/"===i,e=!i;if(n&&gt)throw new jt(10);if(!n&&!e){var r=Tt(i,{gb:!1});if(i=r.path,(r=r.node).wa)throw new jt(10);if(16384!=(61440&r.mode))throw new jt(54)}(t=t.U(i={type:t,Qc:{},mb:i,kc:[]})).U=i,i.root=t,n?gt=t:r&&(r.wa=i,r.U&&r.U.kc.push(i))},Wt=(t,i,n)=>{var e=Tt(t,{parent:!0}).node;if(!(t=Z(t))||"."===t||".."===t)throw new jt(28);var r=Dt(e,t);if(r)throw new jt(r);if(!e.l.va)throw new jt(63);return e.l.va(e,t,i,n)},Xt=(t,i,n)=>{void 0===n&&(n=i,i=438),Wt(t,8192|i,n)},Ut=(t,i)=>{if(!it(t))throw new jt(44);var n=Tt(i,{parent:!0}).node;if(!n)throw new jt(44);i=Z(i);var e=Dt(n,i);if(e)throw new jt(e);if(!n.l.Ea)throw new jt(63);n.l.Ea(n,i,t)},Nt=t=>{if(!(t=Tt(t).node))throw new jt(44);if(!t.l.ma)throw new jt(28);return it($t(t.parent),t.l.ma(t))},Yt=(t,i,n)=>{if(""===t)throw new jt(44);if("string"==typeof i){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[i];if(void 0===e)throw Error(`Unknown file open mode: ${i}`);i=e}if(n=64&i?4095&(void 0===n?438:n)|32768:0,"object"==typeof t)var o=t;else{t=J(t);try{o=Tt(t,{fb:!(131072&i)}).node}catch(t){}}if(e=!1,64&i)if(o){if(128&i)throw new jt(20)}else o=Wt(t,n,0),e=!0;if(!o)throw new jt(44);if(8192==(61440&o.mode)&&(i&=-513),65536&i&&16384!=(61440&o.mode))throw new jt(54);if(!e&&(n=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Et(i)||512&i)?31:St(o,Et(i)):44))throw new jt(n);if(512&i&&!e){if(!(n="string"==typeof(n=o)?Tt(n,{fb:!0}).node:n).l.P)throw new jt(63);if(16384==(61440&n.mode))throw new jt(31);if(32768!=(61440&n.mode))throw new jt(28);if(e=St(n,"w"))throw new jt(e);n.l.P(n,{size:0,timestamp:Date.now()})}return i&=-131713,(o=zt({node:o,path:$t(o),flags:i,seekable:!0,position:0,m:o.m,zc:[],error:!1})).m.open&&o.m.open(o),!r.logReadFiles||1&i||(mt||(mt={}),t in mt||(mt[t]=1)),o},Bt=(t,i,n)=>{if(null===t.X)throw new jt(8);if(!t.seekable||!t.m.ba)throw new jt(70);if(0!=n&&1!=n&&2!=n)throw new jt(28);t.position=t.m.ba(t,i,n),t.zc=[]},Ht=()=>{jt||((jt=function(t,i){this.name="ErrnoError",this.node=i,this.pc=function(t){this.aa=t},this.pc(t),this.message="FS error"}).prototype=Error(),jt.prototype.constructor=jt,[44].forEach((t=>{Ct[t]=new jt(t),Ct[t].stack="<generic error, no stack>"})))},Gt=(t,i,n)=>{t=J("/dev/"+t);var e=function(t,i){var n=0;return t&&(n|=365),i&&(n|=146),n}(!!i,!!n);vt||(vt=64);var r=vt++<<8;Lt(r,{open:t=>{t.seekable=!1},close:()=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,n,e,r)=>{for(var o=0,s=0;s<r;s++){try{var a=i()}catch(t){throw new jt(29)}if(void 0===a&&0===o)throw new jt(6);if(null==a)break;o++,n[e+s]=a}return o&&(t.node.timestamp=Date.now()),o},write:(t,i,e,r)=>{for(var o=0;o<r;o++)try{n(i[e+o])}catch(t){throw new jt(29)}return r&&(t.node.timestamp=Date.now()),o}}),Xt(t,e,r)},Vt={},qt=void 0;function Kt(){return T[(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 ni(t){throw new ii(t)}var ei=t=>(t||ni("Cannot use deleted val. handle = "+t),ti.get(t).value),ri=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ti.pa({tb:1,value:t})}};function oi(t){var i=Error,n=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 n.prototype=Object.create(i.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},n}var si=void 0,ai=void 0;function hi(t){for(var i="";M[t];)i+=ai[M[t++]];return i}var ci=[];function ui(){for(;ci.length;){var t=ci.pop();t.g.fa=!1,t.delete()}}var li=void 0,di={};function fi(t,i){for(void 0===i&&ni("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=Dn(t));return Tn(t),i}function wi(t,i){var n=pi[t];return void 0===n&&ni(i+" has unknown type "+vi(t)),n}function mi(){}var bi=!1;function gi(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,n){return i===n?t:void 0===n.A||null===(t=yi(t,i,n.A))?null:n.Pb(t)}var xi={},ki=void 0;function _i(t){throw new ki(t)}function Mi(t,i){return i.u&&i.o||_i("makeClassHandle requires ptr and ptrType"),!!i.L!=!!i.G&&_i("Both smartPtrType and smartPtr must be specified"),i.count={value:1},ji(Object.create(t,{g:{value:i}}))}function ji(t){return"undefined"==typeof FinalizationRegistry?(ji=t=>t,t):(bi=new FinalizationRegistry((t=>{gi(t.g)})),mi=t=>{bi.unregister(t)},(ji=t=>{var i=t.g;return i.G&&bi.register(t,{g:i},t),t})(t))}var Ci={};function Ti(t){for(;t.length;){var i=t.pop();t.pop()(i)}}function $i(t){return this.fromWireType(T[t>>2])}var Pi={},Oi={};function Ai(t,i,n){function e(i){(i=n(i)).length!==t.length&&_i("Mismatched type converter count");for(var e=0;e<t.length;++e)Si(t[e],i[e])}t.forEach((function(t){Oi[t]=i}));var r=Array(i.length),o=[],s=0;i.forEach(((t,i)=>{pi.hasOwnProperty(t)?r[i]=pi[t]:(o.push(t),Pi.hasOwnProperty(t)||(Pi[t]=[]),Pi[t].push((()=>{r[i]=pi[t],++s===o.length&&e(r)})))})),0===o.length&&e(r)}function Ei(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 Si(t,i,n={}){if(!("argPackAdvance"in i))throw new TypeError("registerType registeredInstance requires argPackAdvance");!function(t,i,n={}){var e=i.name;if(t||ni(`type "${e}" must have a positive integer typeid pointer`),pi.hasOwnProperty(t)){if(n.$b)return;ni(`Cannot register type '${e}' twice`)}pi[t]=i,delete Oi[t],Pi.hasOwnProperty(t)&&(i=Pi[t],delete Pi[t],i.forEach((t=>t())))}(t,i,n)}function Di(t){ni(t.g.u.i.name+" instance already deleted")}function Ii(){}function zi(t,i,n){if(void 0===t[i].B){var e=t[i];t[i]=function(){return t[i].B.hasOwnProperty(arguments.length)||ni(`Function '${n}' 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[e.ea]=e}}function Fi(t,i,n){r.hasOwnProperty(t)?((void 0===n||void 0!==r[t].B&&void 0!==r[t].B[n])&&ni(`Cannot register public name '${t}' twice`),zi(r,t,t),r.hasOwnProperty(n)&&ni(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),r[t].B[n]=i):(r[t]=i,void 0!==n&&(r[t].Pc=n))}function Li(t,i,n,e,r,o,s,a){this.name=t,this.constructor=i,this.N=n,this.W=e,this.A=r,this.Ub=o,this.na=s,this.Pb=a,this.qb=[]}function Ri(t,i,n){for(;i!==n;)i.na||ni(`Expected null or instance of ${n.name}, got an instance of ${i.name}`),t=i.na(t),i=i.A;return t}function Wi(t,i){return null===i?(this.Na&&ni(`null is not a valid ${this.name}`),0):(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),Ri(i.g.o,i.g.u.i,this.i))}function Xi(t,i){if(null===i){if(this.Na&&ni(`null is not a valid ${this.name}`),this.ua){var n=this.Pa();return null!==t&&t.push(this.W,n),n}return 0}if(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.ta&&i.g.u.ta&&ni(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`),n=Ri(i.g.o,i.g.u.i,this.i),this.ua)switch(void 0===i.g.G&&ni("Passing raw pointer to smart pointer is illegal"),this.tc){case 0:i.g.L===this?n=i.g.G:ni(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`);break;case 1:n=i.g.G;break;case 2:if(i.g.L===this)n=i.g.G;else{var e=i.clone();n=this.oc(n,ri((function(){e.delete()}))),null!==t&&t.push(this.W,n)}break;default:ni("Unsupporting sharing policy")}return n}function Ui(t,i){return null===i?(this.Na&&ni(`null is not a valid ${this.name}`),0):(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),i.g.u.ta&&ni(`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 Ni(t,i,n,e){this.name=t,this.i=i,this.Na=n,this.ta=e,this.ua=!1,this.W=this.oc=this.Pa=this.rb=this.tc=this.nc=void 0,void 0!==i.A?this.toWireType=Xi:(this.toWireType=e?Wi:Ui,this.K=null)}function Yi(t,i,n){r.hasOwnProperty(t)||_i("Replacing nonexistant public symbol"),void 0!==r[t].B&&void 0!==n?r[t].B[n]=i:(r[t]=i,r[t].ea=n)}var Bi=[],Hi=t=>{var i=Bi[t];return i||(t>=Bi.length&&(Bi.length=t+1),Bi[t]=i=S.get(t)),i};function Gi(t,i){var n=(t=hi(t)).includes("j")?((t,i)=>{var n=[];return function(){if(n.length=0,Object.assign(n,arguments),t.includes("j")){var e=r["dynCall_"+t];e=n&&n.length?e.apply(null,[i].concat(n)):e.call(null,i)}else e=Hi(i).apply(null,n);return e}})(t,i):Hi(i);return"function"!=typeof n&&ni(`unknown function pointer with signature ${t}: ${i}`),n}var Vi=void 0;function qi(t,i){var n=[],e={};throw i.forEach((function t(i){e[i]||pi[i]||(Oi[i]?Oi[i].forEach(t):(n.push(i),e[i]=!0))})),new Vi(`${t}: `+n.map(vi).join([", "]))}function Ki(t,i,n,e,r){var o=i.length;2>o&&ni("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==i[1]&&null!==n,a=!1;for(n=1;n<i.length;++n)if(null!==i[n]&&void 0===i[n].K){a=!0;break}var h="void"!==i[0].name,c=o-2,u=Array(c),l=[],d=[];return function(){if(arguments.length!==c&&ni(`function ${t} called with ${arguments.length} arguments, expected ${c} args!`),d.length=0,l.length=s?2:1,l[0]=r,s){var n=i[1].toWireType(d,this);l[1]=n}for(var o=0;o<c;++o)u[o]=i[o+2].toWireType(d,arguments[o]),l.push(u[o]);if(o=e.apply(null,l),a)Ti(d);else for(var f=s?1:2;f<i.length;f++)null!==i[f].K&&i[f].K(1===f?n:u[f-2]);return h?i[0].fromWireType(o):void 0}}function Ji(t,i){for(var n=[],e=0;e<t;e++)n.push($[i+4*e>>2]);return n}function Qi(t,i,n){return t instanceof Object||ni(`${n} with invalid "this": ${t}`),t instanceof i.i.constructor||ni(`${n} incompatible with "this" of type ${t.constructor.name}`),t.g.o||ni(`cannot call emscripten binding method ${n} 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 tn(t,i,n){switch(i){case 0:return function(t){return this.fromWireType((n?_:M)[t])};case 1:return function(t){return this.fromWireType((n?j:C)[t>>1])};case 2:return function(t){return this.fromWireType((n?T:$)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function nn(t){if(null===t)return"null";var i=typeof t;return"object"===i||"array"===i||"function"===i?t.toString():""+t}function en(t,i){switch(i){case 2:return function(t){return this.fromWireType(P[t>>2])};case 3:return function(t){return this.fromWireType(O[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function rn(t,i,n){switch(i){case 0:return n?function(t){return _[t]}:function(t){return M[t]};case 1:return n?function(t){return j[t>>1]}:function(t){return C[t>>1]};case 2:return n?function(t){return T[t>>2]}:function(t){return $[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var on="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,sn=(t,i)=>{for(var n=t>>1,e=n+i/2;!(n>=e)&&C[n];)++n;if(32<(n<<=1)-t&&on)return on.decode(M.subarray(t,n));for(n="",e=0;!(e>=i/2);++e){var r=j[t+2*e>>1];if(0==r)break;n+=String.fromCharCode(r)}return n},an=(t,i,n)=>{if(void 0===n&&(n=2147483647),2>n)return 0;var e=i;n=(n-=2)<2*t.length?n/2:t.length;for(var r=0;r<n;++r)j[i>>1]=t.charCodeAt(r),i+=2;return j[i>>1]=0,i-e},hn=t=>2*t.length,cn=(t,i)=>{for(var n=0,e="";!(n>=i/4);){var r=T[t+4*n>>2];if(0==r)break;++n,65536<=r?(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=String.fromCharCode(r)}return e},un=(t,i,n)=>{if(void 0===n&&(n=2147483647),4>n)return 0;var e=i;n=e+n-4;for(var r=0;r<t.length;++r){var o=t.charCodeAt(r);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++r)),T[i>>2]=o,(i+=4)+4>n)break}return T[i>>2]=0,i-e},ln=t=>{for(var i=0,n=0;n<t.length;++n){var e=t.charCodeAt(n);55296<=e&&57343>=e&&++n,i+=4}return i},dn={};function fn(t){var i=dn[t];return void 0===i?hi(t):i}var pn,vn=[],wn=[],mn=[],bn={},gn=()=>{if(!pn){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 bn)void 0===bn[t]?delete i[t]:i[t]=bn[t];var n=[];for(t in i)n.push(`${t}=${i[t]}`);pn=n}return pn},yn=t=>0==t%4&&(0!=t%100||0==t%400),xn=[31,29,31,30,31,30,31,31,30,31,30,31],kn=[31,28,31,30,31,30,31,31,30,31,30,31];function _n(t,i,n,e){t||(t=this),this.parent=t,this.U=t.U,this.wa=null,this.id=kt++,this.name=i,this.mode=n,this.l={},this.m={},this.za=e}Object.defineProperties(_n.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(bt,"/"),Wt("/tmp",16895,0),Wt("/home",16895,0),Wt("/home/web_user",16895,0),(()=>{Wt("/dev",16895,0),Lt(259,{read:()=>0,write:(t,i,n,e)=>e}),Xt("/dev/null",259),ct(1280,lt),ct(1536,dt),Xt("/dev/tty",1280),Xt("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,n=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Gt("random",n),Gt("urandom",n),Wt("/dev/shm",16895,0),Wt("/dev/shm/tmp",16895,0)})(),(()=>{Wt("/proc",16895,0);var t=Wt("/proc/self",16895,0);Wt("/proc/self/fd",16895,0),Rt({U:()=>{var i=At(t,"fd",16895,73);return i.l={ka:(t,i)=>{var n=It(+i);return(t={parent:null,U:{mb:"fake"},l:{ma:()=>n.path}}).parent=t}},i}},"/proc/self/fd")})(),Object.assign(Zt.prototype,{get(t){return this.M[t]},has(t){return void 0!==this.M[t]},pa(t){var i=this.hb.pop()||this.M.length;return this.M[i]=t,i},Zb(t){this.M[t]=void 0,this.hb.push(t)}}),ii=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ti.M.push({value:void 0},{value:null},{value:!0},{value:!1}),ti.h=ti.M.length,r.count_emval_handles=function(){for(var t=0,i=ti.h;i<ti.M.length;++i)void 0!==ti.M[i]&&++t;return t},si=r.PureVirtualError=oi("PureVirtualError");for(var Mn=Array(256),jn=0;256>jn;++jn)Mn[jn]=String.fromCharCode(jn);ai=Mn,r.getInheritedInstanceCount=function(){return Object.keys(di).length},r.getLiveInheritedInstances=function(){var t,i=[];for(t in di)di.hasOwnProperty(t)&&i.push(di[t]);return i},r.flushPendingDeletes=ui,r.setDelayFunction=function(t){li=t,ci.length&&li&&li(ui)},ki=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ii.prototype.isAliasOf=function(t){if(!(this instanceof Ii&&t instanceof Ii))return!1;var i=this.g.u.i,n=this.g.o,e=t.g.u.i;for(t=t.g.o;i.A;)n=i.na(n),i=i.A;for(;e.A;)t=e.na(t),e=e.A;return i===e&&n===t},Ii.prototype.clone=function(){if(this.g.o||Di(this),this.g.ia)return this.g.count.value+=1,this;var t=ji,i=Object,n=i.create,e=Object.getPrototypeOf(this),r=this.g;return(t=t(n.call(i,e,{g:{value:{count:r.count,fa:r.fa,ia:r.ia,o:r.o,u:r.u,G:r.G,L:r.L}}}))).g.count.value+=1,t.g.fa=!1,t},Ii.prototype.delete=function(){this.g.o||Di(this),this.g.fa&&!this.g.ia&&ni("Object already scheduled for deletion"),mi(this),gi(this.g),this.g.ia||(this.g.G=void 0,this.g.o=void 0)},Ii.prototype.isDeleted=function(){return!this.g.o},Ii.prototype.deleteLater=function(){return this.g.o||Di(this),this.g.fa&&!this.g.ia&&ni("Object already scheduled for deletion"),ci.push(this),1===ci.length&&li&&li(ui),this.g.fa=!0,this},Ni.prototype.Vb=function(t){return this.rb&&(t=this.rb(t)),t},Ni.prototype.ab=function(t){this.W&&this.W(t)},Ni.prototype.argPackAdvance=8,Ni.prototype.readValueFromPointer=$i,Ni.prototype.deleteObject=function(t){null!==t&&t.delete()},Ni.prototype.fromWireType=function(t){function i(){return Mi(this.i.N,this.ua?{u:this.nc,o:n,L:this,G:t}:{u:this,o:t})}var n=this.Vb(t);if(!n)return this.ab(t),null;var e=function(t,i){return i=fi(t,i),di[i]}(this.i,n);if(void 0!==e)return 0===e.g.count.value?(e.g.o=n,e.g.G=t,e.clone()):(e=e.clone(),this.ab(t),e);if(e=this.i.Ub(n),!(e=xi[e]))return i.call(this);var r=yi(n,this.i,(e=this.ta?e.Kb:e.pointerType).i);return null===r?i.call(this):Mi(e.i.N,this.ua?{u:e,o:r,L:this,G:t}:{u:e,o:r})},Vi=r.UnboundTypeError=oi("UnboundTypeError");var Cn={__syscall_fcntl64:function(t,i,n){qt=n;try{var e=It(t);switch(i){case 0:var r=Kt();return 0>r?-28:zt(e,r).X;case 1:case 2:case 6:case 7:return 0;case 3:return e.flags;case 4:return r=Kt(),e.flags|=r,0;case 5:return r=Kt(),j[r+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Sn()>>2]=28,-1}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_ioctl:function(t,i,n){qt=n;try{var e=It(t);switch(i){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return e.s?0:-59;case 21505:if(!e.s)return-59;if(e.s.V.bc){i=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Kt();T[r>>2]=25856,T[r+4>>2]=5,T[r+8>>2]=191,T[r+12>>2]=35387;for(var o=0;32>o;o++)_[r+o+17|0]=i[o]||0}return 0;case 21506:case 21507:case 21508:if(!e.s)return-59;if(e.s.V.cc)for(r=Kt(),i=[],o=0;32>o;o++)i.push(_[r+o+17|0]);return 0;case 21519:return e.s?(r=Kt(),T[r>>2]=0):-59;case 21520:return e.s?-28:-59;case 21531:if(r=Kt(),!e.m.ac)throw new jt(59);return e.m.ac(e,i,r);case 21523:return e.s?(e.s.V.dc&&(o=[24,80],r=Kt(),j[r>>1]=o[0],j[r+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_openat:function(t,i,n,e){qt=e;try{var r=i=i?et(M,i):"";if("/"===r.charAt(0))i=r;else{var o=-100===t?"/":It(t).path;if(0==r.length)throw new jt(44);i=J(o+"/"+r)}var s=e?Kt():0;return Yt(i,n,s).X}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},_embind_create_inheriting_constructor:function(t,i,n){t=hi(t),i=wi(i,"wrapper"),n=ei(n);var e=[].slice,r=i.i,o=r.N,s=r.A.N,a=r.A.constructor;for(var h in t=Qt(t,(function(){r.A.qb.forEach(function(t){if(this[t]===s[t])throw new si(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:o}),this.__construct.apply(this,e.call(arguments))})),o.__construct=function(){this===o&&ni("Pass correct 'this' to __construct");var t=a.implement.apply(void 0,[this].concat(e.call(arguments)));mi(t);var i=t.g;t.notifyOnDestruction(),i.ia=!0,Object.defineProperties(this,{g:{value:i}}),ji(this),t=fi(r,t=i.o),di.hasOwnProperty(t)?ni(`Tried to register registered instance: ${t}`):di[t]=this},o.__destruct=function(){this===o&&ni("Pass correct 'this' to __destruct"),mi(this);var t=this.g.o;t=fi(r,t),di.hasOwnProperty(t)?delete di[t]:ni(`Tried to unregister unregistered instance: ${t}`)},t.prototype=Object.create(o),n)t.prototype[h]=n[h];return ri(t)},_embind_finalize_value_object:function(t){var i=Ci[t];delete Ci[t];var n=i.Pa,e=i.W,r=i.eb;Ai([t],r.map((t=>t.Yb)).concat(r.map((t=>t.rc))),(t=>{var o={};return r.forEach(((i,n)=>{var e=t[n],s=i.Wb,a=i.Xb,h=t[n+r.length],c=i.qc,u=i.sc;o[i.Sb]={read:t=>e.fromWireType(s(a,t)),write:(t,i)=>{var n=[];c(u,t,h.toWireType(n,i)),Ti(n)}}})),[{name:i.name,fromWireType:function(t){var i,n={};for(i in o)n[i]=o[i].read(t);return e(t),n},toWireType:function(t,i){for(var r in o)if(!(r in i))throw new TypeError(`Missing field: "${r}"`);var s=n();for(r in o)o[r].write(s,i[r]);return null!==t&&t.push(e,s),s},argPackAdvance:8,readValueFromPointer:$i,K:e}]}))},_embind_register_bigint:function(){},_embind_register_bool:function(t,i,n,e,r){var o=Ei(n);Si(t,{name:i=hi(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?e:r},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var e=_;else if(2===n)e=j;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+i);e=T}return this.fromWireType(e[t>>o])},K:null})},_embind_register_class:function(t,i,n,e,r,o,s,a,h,c,u,l,d){u=hi(u),o=Gi(r,o),a&&(a=Gi(s,a)),c&&(c=Gi(h,c)),d=Gi(l,d);var f=Jt(u);Fi(f,(function(){qi(`Cannot construct ${u} due to unbound types`,[e])})),Ai([t,i,n],e?[e]:[],(function(i){if(i=i[0],e)var n=i.i,r=n.N;else r=Ii.prototype;i=Qt(f,(function(){if(Object.getPrototypeOf(this)!==s)throw new ii("Use 'new' to construct "+u);if(void 0===h.$)throw new ii(u+" has no accessible constructor");var t=h.$[arguments.length];if(void 0===t)throw new ii(`Tried to invoke ctor of ${u} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.$).toString()}) parameters instead!`);return t.apply(this,arguments)}));var s=Object.create(r,{constructor:{value:i}});i.prototype=s;var h=new Li(u,i,s,d,n,o,a,c);h.A&&(void 0===h.A.oa&&(h.A.oa=[]),h.A.oa.push(h)),n=new Ni(u,h,!0,!1),r=new Ni(u+"*",h,!1,!1);var l=new Ni(u+" const*",h,!1,!0);return xi[t]={pointerType:r,Kb:l},Yi(f,i),[n,r,l]}))},_embind_register_class_class_function:function(t,i,n,e,r,o,s){var a=Ji(n,e);i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){function e(){qi(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]);var h=t.i.constructor;return void 0===h[i]?(e.ea=n-1,h[i]=e):(zi(h,i,r),h[i].B[n-1]=e),Ai([],a,(function(e){if(e=Ki(r,[e[0],null].concat(e.slice(1)),null,o,s),void 0===h[i].B?(e.ea=n-1,h[i]=e):h[i].B[n-1]=e,t.i.oa)for(const n of t.i.oa)n.constructor.hasOwnProperty(i)||(n.constructor[i]=e);return[]})),[]}))},_embind_register_class_class_property:function(t,i,n,e,r,o,s,a){i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){var r=`${(t=t[0]).name}.${i}`,h={get(){qi(`Cannot access ${r} due to unbound types`,[n])},enumerable:!0,configurable:!0};return h.set=a?()=>{qi(`Cannot access ${r} due to unbound types`,[n])}:()=>{ni(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Ai([],[n],(function(n){n=n[0];var r={get:()=>n.fromWireType(o(e)),enumerable:!0};return a&&(a=Gi(s,a),r.set=t=>{var i=[];a(e,n.toWireType(i,t)),Ti(i)}),Object.defineProperty(t.i.constructor,i,r),[]})),[]}))},_embind_register_class_constructor:function(t,i,n,e,r,o){var s=Ji(i,n);r=Gi(e,r),Ai([],[t],(function(t){var n=`constructor ${(t=t[0]).name}`;if(void 0===t.i.$&&(t.i.$=[]),void 0!==t.i.$[i-1])throw new ii(`Cannot register multiple constructors with identical number of parameters (${i-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.$[i-1]=()=>{qi(`Cannot construct ${t.name} due to unbound types`,s)},Ai([],s,(function(e){return e.splice(1,0,null),t.i.$[i-1]=Ki(n,e,null,r,o),[]})),[]}))},_embind_register_class_function:function(t,i,n,e,r,o,s,a){var h=Ji(n,e);i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){function e(){qi(`Cannot call ${r} due to unbound types`,h)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.qb.push(i);var c=t.i.N,u=c[i];return void 0===u||void 0===u.B&&u.className!==t.name&&u.ea===n-2?(e.ea=n-2,e.className=t.name,c[i]=e):(zi(c,i,r),c[i].B[n-2]=e),Ai([],h,(function(e){return e=Ki(r,e,t,o,s),void 0===c[i].B?(e.ea=n-2,c[i]=e):c[i].B[n-2]=e,[]})),[]}))},_embind_register_class_property:function(t,i,n,e,r,o,s,a,h,c){i=hi(i),r=Gi(e,r),Ai([],[t],(function(t){var e=`${(t=t[0]).name}.${i}`,u={get(){qi(`Cannot access ${e} due to unbound types`,[n,s])},enumerable:!0,configurable:!0};return u.set=h?()=>{qi(`Cannot access ${e} due to unbound types`,[n,s])}:()=>{ni(e+" is a read-only property")},Object.defineProperty(t.i.N,i,u),Ai([],h?[n,s]:[n],(function(n){var s=n[0],u={get(){var i=Qi(this,t,e+" getter");return s.fromWireType(r(o,i))},enumerable:!0};if(h){h=Gi(a,h);var l=n[1];u.set=function(i){var n=Qi(this,t,e+" setter"),r=[];h(c,n,l.toWireType(r,i)),Ti(r)}}return Object.defineProperty(t.i.N,i,u),[]})),[]}))},_embind_register_emval:function(t,i){Si(t,{name:i=hi(i),fromWireType:function(t){var i=ei(t);return Zi(t),i},toWireType:function(t,i){return ri(i)},argPackAdvance:8,readValueFromPointer:$i,K:null})},_embind_register_enum:function(t,i,n,e){function r(){}n=Ei(n),i=hi(i),r.values={},Si(t,{name:i,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,i){return i.value},argPackAdvance:8,readValueFromPointer:tn(i,n,e),K:null}),Fi(i,r)},_embind_register_enum_value:function(t,i,n){var e=wi(t,"enum");i=hi(i),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:n},constructor:{value:Qt(`${e.name}_${i}`,(function(){}))}}),t.values[n]=e,t[i]=e},_embind_register_float:function(t,i,n){n=Ei(n),Si(t,{name:i=hi(i),fromWireType:function(t){return t},toWireType:function(t,i){return i},argPackAdvance:8,readValueFromPointer:en(i,n),K:null})},_embind_register_function:function(t,i,n,e,r,o){var s=Ji(i,n);t=hi(t),r=Gi(e,r),Fi(t,(function(){qi(`Cannot call ${t} due to unbound types`,s)}),i-1),Ai([],s,(function(n){return Yi(t,Ki(t,[n[0],null].concat(n.slice(1)),null,r,o),i-1),[]}))},_embind_register_integer:function(t,i,n,e,r){i=hi(i),-1===r&&(r=4294967295),r=Ei(n);var o=t=>t;if(0===e){var s=32-8*n;o=t=>t<<s>>>s}n=i.includes("unsigned")?function(t,i){return i>>>0}:function(t,i){return i},Si(t,{name:i,fromWireType:o,toWireType:n,argPackAdvance:8,readValueFromPointer:rn(i,r,0!==e),K:null})},_embind_register_memory_view:function(t,i,n){function e(t){return new r($.buffer,$[1+(t>>=2)],$[t])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][i];Si(t,{name:n=hi(n),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{$b:!0})},_embind_register_std_string:function(t,i){var n="std::string"===(i=hi(i));Si(t,{name:i,fromWireType:function(t){var i=$[t>>2],e=t+4;if(n)for(var r=e,o=0;o<=i;++o){var s=e+o;if(o==i||0==M[s]){if(r=r?et(M,r,s-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=s+1}}else{for(a=Array(i),o=0;o<i;++o)a[o]=String.fromCharCode(M[e+o]);a=a.join("")}return Tn(t),a},toWireType:function(t,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var e="string"==typeof i;e||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||ni("Cannot pass non-string to std::string");var r=n&&e?ot(i):i.length,o=$n(4+r+1),s=o+4;if($[o>>2]=r,n&&e)st(i,M,s,r+1);else if(e)for(e=0;e<r;++e){var a=i.charCodeAt(e);255<a&&(Tn(s),ni("String has UTF-16 code units that do not fit in 8 bits")),M[s+e]=a}else for(e=0;e<r;++e)M[s+e]=i[e];return null!==t&&t.push(Tn,o),o},argPackAdvance:8,readValueFromPointer:$i,K:function(t){Tn(t)}})},_embind_register_std_wstring:function(t,i,n){if(n=hi(n),2===i)var e=sn,r=an,o=hn,s=()=>C,a=1;else 4===i&&(e=cn,r=un,o=ln,s=()=>$,a=2);Si(t,{name:n,fromWireType:function(t){for(var n,r=$[t>>2],o=s(),h=t+4,c=0;c<=r;++c){var u=t+4+c*i;c!=r&&0!=o[u>>a]||(h=e(h,u-h),void 0===n?n=h:(n+=String.fromCharCode(0),n+=h),h=u+i)}return Tn(t),n},toWireType:function(t,e){"string"!=typeof e&&ni(`Cannot pass non-string to C++ string type ${n}`);var s=o(e),h=$n(4+s+i);return $[h>>2]=s>>a,r(e,h+4,s+i),null!==t&&t.push(Tn,h),h},argPackAdvance:8,readValueFromPointer:$i,K:function(t){Tn(t)}})},_embind_register_value_object:function(t,i,n,e,r,o){Ci[t]={name:hi(i),Pa:Gi(n,e),W:Gi(r,o),eb:[]}},_embind_register_value_object_field:function(t,i,n,e,r,o,s,a,h,c){Ci[t].eb.push({Sb:hi(i),Yb:n,Wb:Gi(e,r),Xb:o,rc:s,qc:Gi(a,h),sc:c})},_embind_register_void:function(t,i){Si(t,{fc:!0,name:i=hi(i),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},_emscripten_get_now_is_monotonic:()=>!0,_emval_as:function(t,i,n){t=ei(t),i=wi(i,"emval::as");var e=[],r=ri(e);return $[n>>2]=r,i.toWireType(e,t)},_emval_call_method:function(t,i,n,e,r){t=vn[t],i=ei(i),n=fn(n);var o=[];return $[e>>2]=ri(o),t(i,n,o,r)},_emval_call_void_method:function(t,i,n,e){(t=vn[t])(i=ei(i),n=fn(n),null,e)},_emval_decref:Zi,_emval_get_method_caller:function(t,i){var n=function(t,i){for(var n=Array(t),e=0;e<t;++e)n[e]=wi($[i+4*e>>2],"parameter "+e);return n}(t,i),e=n[0];i=e.name+"_$"+n.slice(1).map((function(t){return t.name})).join("_")+"$";var r=wn[i];if(void 0!==r)return r;var o=Array(t-1);return r=function(t){var i=vn.length;return vn.push(t),i}(((i,r,s,a)=>{for(var h=0,c=0;c<t-1;++c)o[c]=n[c+1].readValueFromPointer(a+h),h+=n[c+1].argPackAdvance;for(i=i[r].apply(i,o),c=0;c<t-1;++c)n[c+1].Nb&&n[c+1].Nb(o[c]);if(!e.fc)return e.toWireType(s,i)})),wn[i]=r},_emval_get_module_property:function(t){return t=fn(t),ri(r[t])},_emval_get_property:function(t,i){return t=ei(t),i=ei(i),ri(t[i])},_emval_incref:function(t){4<t&&(ti.get(t).tb+=1)},_emval_new_cstring:function(t){return ri(fn(t))},_emval_new_object:function(){return ri({})},_emval_run_destructors:function(t){Ti(ei(t)),Zi(t)},_emval_set_property:function(t,i,n){t=ei(t),i=ei(i),n=ei(n),t[i]=n},_emval_take_value:function(t,i){return t=(t=wi(t,"_emval_take_value")).readValueFromPointer(i),ri(t)},abort:()=>{X("")},emscripten_asm_const_int:(t,i,n)=>{var e;for(mn.length=0,n>>=2;e=M[i++];)n+=105!=e&n,mn.push(105==e?T[n]:O[n++>>1]),++n;return V[t].apply(null,mn)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:()=>performance.now(),emscripten_memcpy_big:(t,i,n)=>M.copyWithin(t,i,i+n),emscripten_resize_heap:t=>{var i=M.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var e=i*(1+.2/n);e=Math.min(e,t+100663296);var r=Math;e=Math.max(t,e);t:{r=r.min.call(r,2147483648,e+(65536-e%65536)%65536)-x.buffer.byteLength+65535>>>16;try{x.grow(r),E();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,i)=>{var n=0;return gn().forEach((function(e,r){var o=i+n;for(r=$[t+4*r>>2]=o,o=0;o<e.length;++o)_[0|r++]=e.charCodeAt(o);_[0|r]=0,n+=e.length+1})),0},environ_sizes_get:(t,i)=>{var n=gn();$[t>>2]=n.length;var e=0;return n.forEach((function(t){e+=t.length+1})),$[i>>2]=e,0},fd_close:function(t){try{var i=It(t);if(null===i.X)throw new jt(8);i.Ma&&(i.Ma=null);try{i.m.close&&i.m.close(i)}catch(t){throw t}finally{xt[i.X]=null}return i.X=null,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_read:function(t,i,n,e){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<n;s++){var a=$[t>>2],h=$[t+4>>2];t+=8;var c=r,u=a,l=h,d=o,f=_;if(0>l||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(1==(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.read)throw new jt(28);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.read(c,f,u,l,d);p||(c.position+=v);var w=v;if(0>w){var m=-1;break t}if(i+=w,w<h)break;void 0!==o&&(o+=w)}m=i}return $[e>>2]=m,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_seek:function(t,i,n,e,r){i=n+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*n:NaN;try{if(isNaN(i))return 61;var o=It(t);return Bt(o,i,e),G=[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)],T[r>>2]=G[0],T[r+4>>2]=G[1],o.Ma&&0===i&&0===e&&(o.Ma=null),0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_write:function(t,i,n,e){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<n;s++){var a=$[t>>2],h=$[t+4>>2];t+=8;var c=r,u=a,l=h,d=o,f=_;if(0>l||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(!(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.write)throw new jt(28);c.seekable&&1024&c.flags&&Bt(c,0,2);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.write(c,f,u,l,d,void 0);p||(c.position+=v);var w=v;if(0>w){var m=-1;break t}i+=w,void 0!==o&&(o+=w)}m=i}return $[e>>2]=m,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},strftime_l:(t,i,n,e)=>((t,i,n,e)=>{function r(t,i,n){for(t="number"==typeof t?t.toString():t||"";t.length<i;)t=n[0]+t;return t}function o(t,i){return r(t,i,"0")}function s(t,i){function n(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=n(t.getFullYear()-i.getFullYear()))&&0===(e=n(t.getMonth()-i.getMonth()))&&(e=n(t.getDate()-i.getDate())),e}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 n=t.getMonth(),e=(yn(t.getFullYear())?xn:kn)[n];if(!(i>e-t.getDate())){t.setDate(t.getDate()+i);break}i-=e-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),i=a(new Date(t.getFullYear(),0,4)),n=a(n),0>=s(i,t)?0>=s(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=T[e+40>>2];for(var u in e={wc:T[e>>2],vc:T[e+4>>2],Fa:T[e+8>>2],Sa:T[e+12>>2],Ga:T[e+16>>2],da:T[e+20>>2],R:T[e+24>>2],ca:T[e+28>>2],Rc:T[e+32>>2],uc:T[e+36>>2],xc:c&&c?et(M,c):""},n=n?et(M,n):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(u,"g"),c[u]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(u in c={"%a":t=>l[t.R].substring(0,3),"%A":t=>l[t.R],"%b":t=>d[t.Ga].substring(0,3),"%B":t=>d[t.Ga],"%C":t=>o((t.da+1900)/100|0,2),"%d":t=>o(t.Sa,2),"%e":t=>r(t.Sa,2," "),"%g":t=>h(t).toString().substring(2),"%G":t=>h(t),"%H":t=>o(t.Fa,2),"%I":t=>(0==(t=t.Fa)?t=12:12<t&&(t-=12),o(t,2)),"%j":t=>{for(var i=0,n=0;n<=t.Ga-1;i+=(yn(t.da+1900)?xn:kn)[n++]);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==(n=(t.R+371-t.ca)%7)||3==n&&yn(t.da)||(i=1));else{i=52;var n=(t.R+7-t.ca-1)%7;(4==n||5==n&&yn(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,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0"),c)n.includes(u)&&(n=n.replace(new RegExp(u,"g"),c[u](e)));return(u=at(n=n.replace(/\0\0/g,"%"),!1)).length>i?0:(_.set(u,t),u.length-1)})(t,i,n,e)};!function(){function t(t){if(k=t=t.exports,x=k.memory,E(),S=k.__indirect_function_table,I.unshift(k.__wasm_call_ctors),R--,r.monitorRunDependencies&&r.monitorRunDependencies(R),0==R&&W){var i=W;W=null,i()}return t}var i={env:Cn,wasi_snapshot_preview1:Cn};if(R++,r.monitorRunDependencies&&r.monitorRunDependencies(R),r.instantiateWasm)try{return r.instantiateWasm(i,t)}catch(t){y("Module.instantiateWasm callback failed with error: "+t),n(t)}(function(t,i){var n=L;return b||"function"!=typeof WebAssembly.instantiateStreaming||U(n)||n.startsWith("file://")||"function"!=typeof fetch?B(n,t,i):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(i,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),B(n,t,i)}))))})(i,(function(i){t(i.instance)})).catch(n)}();var Tn=t=>(Tn=k.free)(t),$n=t=>($n=k.malloc)(t),Pn=r._ma_device__on_notification_unlocked=t=>(Pn=r._ma_device__on_notification_unlocked=k.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,i)=>(r._ma_malloc_emscripten=k.ma_malloc_emscripten)(t,i),r._ma_free_emscripten=(t,i)=>(r._ma_free_emscripten=k.ma_free_emscripten)(t,i);var On,An=r._ma_device_process_pcm_frames_capture__webaudio=(t,i,n)=>(An=r._ma_device_process_pcm_frames_capture__webaudio=k.ma_device_process_pcm_frames_capture__webaudio)(t,i,n),En=r._ma_device_process_pcm_frames_playback__webaudio=(t,i,n)=>(En=r._ma_device_process_pcm_frames_playback__webaudio=k.ma_device_process_pcm_frames_playback__webaudio)(t,i,n),Sn=()=>(Sn=k.__errno_location)(),Dn=t=>(Dn=k.__getTypeName)(t);function In(){function t(){if(!On&&(On=!0,r.calledRun=!0,!A)){if(r.noFSInit||pt||(pt=!0,Ht(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Gt("stdin",r.stdin):Ut("/dev/tty","/dev/stdin"),r.stdout?Gt("stdout",null,r.stdout):Ut("/dev/tty","/dev/stdout"),r.stderr?Gt("stderr",null,r.stderr):Ut("/dev/tty1","/dev/stderr"),Yt("/dev/stdin",0),Yt("/dev/stdout",1),Yt("/dev/stderr",1)),Mt=!1,q(I),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();z.unshift(t)}q(z)}}if(!(0<R)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)F();q(D),0<R||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.__embind_initialize_bindings=()=>(r.__embind_initialize_bindings=k._embind_initialize_bindings)(),r.dynCall_iiji=(t,i,n,e,o)=>(r.dynCall_iiji=k.dynCall_iiji)(t,i,n,e,o),r.dynCall_jiji=(t,i,n,e,o)=>(r.dynCall_jiji=k.dynCall_jiji)(t,i,n,e,o),r.dynCall_iiiji=(t,i,n,e,o,s)=>(r.dynCall_iiiji=k.dynCall_iiiji)(t,i,n,e,o,s),r.dynCall_iij=(t,i,n,e)=>(r.dynCall_iij=k.dynCall_iij)(t,i,n,e),r.dynCall_jii=(t,i,n)=>(r.dynCall_jii=k.dynCall_jii)(t,i,n),r.dynCall_viijii=(t,i,n,e,o,s,a)=>(r.dynCall_viijii=k.dynCall_viijii)(t,i,n,e,o,s,a),r.dynCall_iiiiij=(t,i,n,e,o,s,a)=>(r.dynCall_iiiiij=k.dynCall_iiiiij)(t,i,n,e,o,s,a),r.dynCall_iiiiijj=(t,i,n,e,o,s,a,h,c)=>(r.dynCall_iiiiijj=k.dynCall_iiiiijj)(t,i,n,e,o,s,a,h,c),r.dynCall_iiiiiijj=(t,i,n,e,o,s,a,h,c,u)=>(r.dynCall_iiiiiijj=k.dynCall_iiiiiijj)(t,i,n,e,o,s,a,h,c,u),W=function t(){On||In(),On||(W=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return In(),t.ready})},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.25.7","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,i,n)=>{n.r(i),n.d(i,{Animation:()=>e.Animation});var e=n(4)},(t,i,n)=>{n.r(i),n.d(i,{Animation:()=>e});var e=function(){function t(t,i,n,e){this.animation=t,this.artboard=i,this.playing=e,this.loopCount=0,this.scrubTo=null,this.instance=new n.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,n)=>{n.r(i),n.d(i,{BLANK_URL:()=>r.BLANK_URL,registerTouchInteractions:()=>e.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var e=n(6),r=n(7)},(t,i,n)=>{n.r(i),n.d(i,{registerTouchInteractions:()=>e});var e=function(t){var i=t.canvas,n=t.artboard,e=t.stateMachines,r=void 0===e?[]:e,o=t.rive,s=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,c=void 0!==h&&h,u=t.layoutScaleFactor,l=void 0===u?1:u;if(!(i&&r.length&&t.renderer&&o&&n&&"undefined"!=typeof window))return null;var d=null,f=!1,p=function(t){if(f&&t instanceof MouseEvent)"mouseup"==t.type&&(f=!1);else{f=c&&"touchend"===t.type&&"touchstart"===d,d=t.type;var i=t.currentTarget.getBoundingClientRect(),e=function(t,i){var n,e;return["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(n=t.touches)||void 0===n?void 0:n.length)?(i||t.preventDefault(),{clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}):"touchend"===t.type&&(null===(e=t.changedTouches)||void 0===e?void 0:e.length)?{clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY}:{clientX:t.clientX,clientY:t.clientY}}(t,c),h=e.clientX,u=e.clientY;if(h||u){var p=h-i.left,v=u-i.top,w=o.computeAlignment(s,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},n.bounds,l),m=new o.Mat2D;w.invert(m);var b=new o.Vec2D(p,v),g=o.mapXY(m,b),y=g.x(),x=g.y();switch(g.delete(),m.delete(),b.delete(),w.delete(),t.type){case"mouseout":for(var k=0,_=r;k<_.length;k++)_[k].pointerMove(y,x);break;case"touchmove":case"mouseover":case"mousemove":for(var M=0,j=r;M<j.length;M++)j[M].pointerMove(y,x);break;case"touchstart":case"mousedown":for(var C=0,T=r;C<T.length;C++)T[C].pointerDown(y,x);break;case"touchend":case"mouseup":for(var $=0,P=r;$<P.length;$++)P[$].pointerUp(y,x)}}}}.bind(void 0);return i.addEventListener("mouseover",p),i.addEventListener("mouseout",p),i.addEventListener("mousemove",p),i.addEventListener("mousedown",p),i.addEventListener("mouseup",p),i.addEventListener("touchmove",p,{passive:c}),i.addEventListener("touchstart",p,{passive:c}),i.addEventListener("touchend",p),function(){i.removeEventListener("mouseover",p),i.removeEventListener("mouseout",p),i.removeEventListener("mousemove",p),i.removeEventListener("mousedown",p),i.removeEventListener("mouseup",p),i.removeEventListener("touchmove",p),i.removeEventListener("touchstart",p),i.removeEventListener("touchend",p)}}},(t,i,n)=>{n.r(i),n.d(i,{BLANK_URL:()=>c,sanitizeUrl:()=>u});var e=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,h=[".","/"],c="about:blank";function u(t){if(!t)return c;var i,n=(i=t,i.replace(s,"").replace(r,(function(t,i){return String.fromCharCode(i)}))).replace(o,"").replace(s,"").trim();if(!n)return c;if(function(t){return h.indexOf(t[0])>-1}(n))return n;var u=n.match(a);return u&&e.test(u[0])?c:n}}],i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.d=(t,i)=>{for(var e in i)n.o(i,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},n.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};return(()=>{n.r(e),n.d(e,{Alignment:()=>r,EventType:()=>m,Fit:()=>i,Layout:()=>f,LoopType:()=>b,Rive:()=>P,RiveEventType:()=>v,RiveFile:()=>$,RuntimeLoader:()=>p,StateMachineInput:()=>w,StateMachineInputType:()=>d,Testing:()=>E,decodeAudio:()=>S,decodeFont:()=>I,decodeImage:()=>D});var t,i,r,o=n(1),s=n(2),a=n(3),h=n(5),c=(t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},t(i,n)},function(i,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),u=function(t,i,n,e){return new(n||(n=Promise))((function(r,o){function s(t){try{h(e.next(t))}catch(t){o(t)}}function a(t){try{h(e.throw(t))}catch(t){o(t)}}function h(t){var i;t.done?r(t.value):(i=t.value,i instanceof n?i:new n((function(t){t(i)}))).then(s,a)}h((e=e.apply(t,i||[])).next())}))},l=function(t,i){var n,e,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(h){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,e&&(r=2&a[0]?e.return:a[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,a[1])).done)return r;switch(e=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,e=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=i.call(t,o)}catch(t){a=[6,t],e=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}};!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(i||(i={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var d,f=function(){function t(t){var n,e,o,s,a,h,c;this.fit=null!==(n=null==t?void 0:t.fit)&&void 0!==n?n:i.Contain,this.alignment=null!==(e=null==t?void 0:t.alignment)&&void 0!==e?e:r.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(s=null==t?void 0:t.minX)&&void 0!==s?s:0,this.minY=null!==(a=null==t?void 0:t.minY)&&void 0!==a?a:0,this.maxX=null!==(h=null==t?void 0:t.maxX)&&void 0!==h?h:0,this.maxY=null!==(c=null==t?void 0:t.maxY)&&void 0!==c?c:0}return t.new=function(i){var n=i.fit,e=i.alignment,r=i.minX,o=i.minY,s=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:n,alignment:e,minX:r,minY:o,maxX:s,maxY:a})},t.prototype.copyWith=function(i){var n=i.fit,e=i.alignment,r=i.layoutScaleFactor,o=i.minX,s=i.minY,a=i.maxX,h=i.maxY;return new t({fit:null!=n?n:this.fit,alignment:null!=e?e:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=s?s:this.minY,maxX:null!=a?a:this.maxX,maxY:null!=h?h:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=n=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,n);var n},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=i=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,i);var i},t}(),p=function(){function t(){}return t.loadRuntime=function(){o.default({locateFile:function(){return t.wasmURL}}).then((function(i){var n;for(t.runtime=i;t.callBackQueue.length>0;)null===(n=t.callBackQueue.shift())||void 0===n||n(t.runtime)})).catch((function(i){var n={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:",n);var e="https://cdn.jsdelivr.net/npm/".concat(s.name,"@").concat(s.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==e)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(n.message,"), trying jsdelivr as a backup")),t.setWasmUrl(e),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(e,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(n.type),"- Message: ".concat(n.message),"- WebAssembly-specific error: ".concat(n.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(i){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?i(t.runtime):t.callBackQueue.push(i)},t.awaitInstance=function(){return new Promise((function(i){return t.getInstance((function(t){return i(t)}))}))},t.setWasmUrl=function(i){t.wasmURL=i},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(s.name,"@").concat(s.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(d||(d={}));var v,w=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 m,b,g=function(){function t(t,i,n,e){this.stateMachine=t,this.playing=n,this.artboard=e,this.inputs=[],this.instance=new i.StateMachineInstance(t,e),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 n=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(n,t))}},t.prototype.mapRuntimeInput=function(t,i){return t.type===i.SMIInput.bool?new w(d.Boolean,t.asBool()):t.type===i.SMIInput.number?new w(d.Number,t.asNumber()):t.type===i.SMIInput.trigger?new w(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,n,e,r){void 0===e&&(e=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=i,this.eventManager=n,this.animations=e,this.stateMachines=r}return t.prototype.add=function(t,i,n){if(void 0===n&&(n=!0),0===(t=A(t)).length)this.animations.forEach((function(t){return t.playing=i})),this.stateMachines.forEach((function(t){return t.playing=i}));else for(var e=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var s=e.indexOf(t[o]),h=r.indexOf(t[o]);if(s>=0||h>=0)s>=0?this.animations[s].playing=i:this.stateMachines[h].playing=i;else{var c=this.artboard.animationByName(t[o]);if(c){var u=new a.Animation(c,this.artboard,this.runtime,i);u.advance(0),u.apply(1),this.animations.push(u)}else{var l=this.artboard.stateMachineByName(t[o]);if(l){var d=new g(l,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return n&&this.eventManager.fire(i?{type:m.Play,data:this.playing}:{type:m.Pause,data:this.paused}),i?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,i){for(var n=this.animations.map((function(t){return t.name})),e=0;e<t.length;e++){var r=n.indexOf(t[e]);if(r>=0)this.animations[r].playing=i;else{var o=this.artboard.animationByName(t[e]);if(o){var s=new a.Animation(o,this.artboard,this.runtime,i);s.advance(0),s.apply(1),this.animations.push(s)}}}},t.prototype.initStateMachines=function(t,i){for(var n=this.stateMachines.map((function(t){return t.name})),e=0;e<t.length;e++){var r=n.indexOf(t[e]);if(r>=0)this.stateMachines[r].playing=i;else{var o=this.artboard.stateMachineByName(t[e]);if(o){var s=new g(o,this.runtime,i,this.artboard);this.stateMachines.push(s)}else this.initLinearAnimations([t[e]],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 n=this.animations.filter((function(i){return t.includes(i.name)}));return n.forEach((function(t){return t.scrubTo=i})),n.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,n=[];if(0===(t=A(t)).length)n=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 e=this.animations.filter((function(i){return t.includes(i.name)}));e.forEach((function(t){t.cleanup(),i.animations.splice(i.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(i){return t.includes(i.name)}));r.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),n=e.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:m.Stop,data:n}),n},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 n;return void 0===i&&(i=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([n=this.artboard.animationByIndex(0).name],t,i):this.artboard.stateMachineCount()>0&&this.add([n=this.artboard.stateMachineByIndex(0).name],t,i)),n},t.prototype.handleLooping=function(){for(var t=0,i=this.animations.filter((function(t){return t.playing}));t<i.length;t++){var n=i[t];0===n.loopValue&&n.loopCount?(n.loopCount=0,this.stop(n.name)):1===n.loopValue&&n.loopCount?(this.eventManager.fire({type:m.Loop,data:{animation:n.name,type:b.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:m.Loop,data:{animation:n.name,type:b.PingPong}}),n.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],i=0,n=this.stateMachines.filter((function(t){return t.playing}));i<n.length;i++)t.push.apply(t,n[i].statesChanged);t.length>0&&this.eventManager.fire({type:m.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:m.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"}(m||(m={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(b||(b={}));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 n=this.listeners[i];if(n.type===t.type&&n.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 M=new(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=x.UNAVAILABLE,i}return c(i,t),i.prototype.delay=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(i){return setTimeout(i,t)}))]}))}))},i.prototype.timeout=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(t,i){return setTimeout(i,50)}))]}))}))},i.prototype.reportToListeners=function(){this.fire({type:m.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return this._enabled||(this._enabled=!0,this._status=x.AVAILABLE,this.reportToListeners()),[2]}))}))},i.prototype.testAudio=function(){return u(this,void 0,void 0,(function(){return l(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 u(this,void 0,void 0,(function(){return l(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 u(t,void 0,void 0,(function(){return l(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===x.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(k)),j=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),C=globalThis.ResizeObserver||j,T=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var n=t._elementsMap.get(i.target);null!==n?n.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 n={onResize:i,element:t};return this._elementsMap.set(t,n),this._resizeObserver.observe(t),n},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),$=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new k,t.onLoad&&this.on(m.Load,t.onLoad),t.onLoadError&&this.on(m.LoadError,t.onLoadError)}return t.prototype.initData=function(){return u(this,void 0,void 0,(function(){var i,n,e;return l(this,(function(r){switch(r.label){case 0:return this.src?(i=this,[4,O(this.src)]):[3,2];case 1:i.buffer=r.sent(),r.label=2;case 2:return this.assetLoader&&(n=new this.runtime.CustomFileAssetLoader({loadContents:this.assetLoader})),e=this,[4,this.runtime.load(new Uint8Array(this.buffer),n,this.enableRiveAssetCDN)];case 3:if(e.file=r.sent(),null===this.file)throw this.eventManager.fire({type:m.LoadError,data:null}),new Error(t.fileLoadErrorMessage);return this.eventManager.fire({type:m.Load,data:this}),[2]}}))}))},t.prototype.init=function(){return u(this,void 0,void 0,(function(){var i;return l(this,(function(n){switch(n.label){case 0:if(!this.src&&!this.buffer)throw new Error(t.missingErrorMessage);return i=this,[4,p.awaitInstance()];case 1:return i.runtime=n.sent(),[4,this.initData()];case 2:return n.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}(),P=function(){function t(t){var i,n=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){n._hasZeroSize=t,n._layout.maxX&&n._layout.maxY||n.resizeToCanvas()},this.renderSecondTimer=0,this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=T.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(m.Load,t.onLoad),t.onLoadError&&this.on(m.LoadError,t.onLoadError),t.onPlay&&this.on(m.Play,t.onPlay),t.onPause&&this.on(m.Pause,t.onPause),t.onStop&&this.on(m.Stop,t.onStop),t.onLoop&&this.on(m.Loop,t.onLoop),t.onStateChange&&this.on(m.StateChange,t.onStateChange),t.onAdvance&&this.on(m.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(m.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(m.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(m.Play,t.onplay),t.onpause&&!t.onPause&&this.on(m.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(m.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(m.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(m.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 n=this,e=i.buffer,r=i.riveFile,o=i.animations,s=i.stateMachines,a=i.artboard,h=i.autoplay,c=void 0!==h&&h,u=i.useOffscreenRenderer,l=void 0!==u&&u;if(this.src=i.src,this.buffer=e,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new Error(t.missingErrorMessage);var d=A(o),f=A(s);this.loaded=!1,this.readyForPlaying=!1,p.awaitInstance().then((function(t){n.runtime=t,n.removeRiveListeners(),n.deleteRiveRenderer(),n.renderer=n.runtime.makeRenderer(n.canvas,l),n.canvas.width||n.canvas.height||n.resizeDrawingSurfaceToCanvas(),n.initData(a,d,f,c).then((function(){return n.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 n=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&i.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),e=this.isTouchScrollEnabled;t&&"isTouchScrollEnabled"in t&&(e=t.isTouchScrollEnabled),this.eventCleanup=(0,h.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:n,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:e,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,i=this;M.status==x.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:m.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},M.add(this._audioEventListener),M.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,n,e){return u(this,void 0,void 0,(function(){var r,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(this.riveFile=new $({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),[4,this.riveFile.init()]);case 1:s.sent(),s.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,i,n,e),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:m.Load,data:null!==(o=this.src)&&void 0!==o?o:"buffer"}),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,Promise.resolve()];case 3:return s.sent(),r="Problem loading file; may be corrupt!",console.warn(r),this.eventManager.fire({type:m.LoadError,data:r}),[2,Promise.reject(r)];case 4:return[2]}}))}))},t.prototype.initArtboard=function(t,i,n,e){if(this.file){var r,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var s="Invalid artboard name or no default artboard";return console.warn(s),void this.eventManager.fire({type:m.LoadError,data:s})}if(this.artboard=o,o.volume=this._volume*M.systemVolume,this.artboard.animationCount()<1)throw this.eventManager.fire({type:m.LoadError,data:s="Artboard has no animations"}),s;this.animator=new y(this.runtime,this.artboard,this.eventManager),i.length>0||n.length>0?(r=i.concat(n),this.animator.initLinearAnimations(i,e),this.animator.initStateMachines(n,e)):r=[this.animator.atLeastOne(e,!1)],this.taskQueue.add({event:{type:e?m.Play:m.Pause,data:r}})}},t.prototype.drawFrame=function(){this.startRendering()},t.prototype.draw=function(t,i){this.frameRequestId=null;var n=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==i||i());var e=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var r=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));r<o.length;r++){var s=o[r];s.advance(e),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var a=0,c=this.animator.stateMachines.filter((function(t){return t.playing}));a<c.length;a++){var u=c[a],l=u.reportedEventCount();if(l)for(var d=0;d<l;d++){var f=u.reportedEventAt(d);if(f)if(f.type===v.OpenUrl){if(this.eventManager.fire({type:m.RiveEvent,data:f}),this.automaticallyHandleEvents){var p=document.createElement("a"),w=f.url,b=f.target,g=(0,h.sanitizeUrl)(w);w&&p.setAttribute("href",g),b&&p.setAttribute("target",b),g&&g!==h.BLANK_URL&&p.click()}}else this.eventManager.fire({type:m.RiveEvent,data:f})}u.advanceAndApply(e)}0==this.animator.stateMachines.length&&this.artboard.advance(e);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(e),this.frameCount++;var x=performance.now();for(this.frameTimes.push(x),this.durations.push(x-n);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,n=t._layout,e=t.artboard;t.renderer.align(n.runtimeFit(i),n.runtimeAlignment(i),{minX:n.minX,minY:n.minY,maxX:n.maxX,maxY:n.maxY},e.bounds,this._devicePixelRatioUsed*n.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&&T.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&&(M.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 n=this.artboard.textRun(t);if(n)return n;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 n=this.retrieveTextRun(t);n&&(n.text=i)},t.prototype.play=function(t,i){var n=this;t=A(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(t,i)}})},t.prototype.pause=function(t){var i=this;t=A(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 n=this;t=A(t),this.readyForPlaying?(this.animator.scrub(t,i||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(t,i)}})},t.prototype.stop=function(t){var i=this;t=A(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,n=null==t?void 0:t.artboard,e=A(null==t?void 0:t.animations),r=A(null==t?void 0:t.stateMachines),o=null!==(i=null==t?void 0:t.autoplay)&&void 0!==i&&i;this.cleanupInstances(),this.initArtboard(n,e,r,o),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),e=n.width,r=n.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*e,this.canvas.height=o*r,this.startRendering(),this.resizeToCanvas(),this.layout.fit===i.Layout){var s=this._layout.layoutScaleFactor;this.artboard.width=e/s,this.artboard.height=r/s}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.animationCount();i++)t.push(this.artboard.animationByIndex(i).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.stateMachineCount();i++)t.push(this.artboard.stateMachineByIndex(i).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var i=this.animator.stateMachines.find((function(i){return i.name===t}));return null==i?void 0:i.inputs}},t.prototype.retrieveInputAtPath=function(t,i){if(t)if(this.artboard){var n=this.artboard.inputByPath(t,i);if(n)return n;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,n){var e=this.retrieveInputAtPath(t,n);e&&(e.type===d.Boolean?e.asBool().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,i,n){var e=this.retrieveInputAtPath(t,n);e&&(e.type===d.Number?e.asNumber().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a number")))},t.prototype.fireStateAtPath=function(t,i){var n=this.retrieveInputAtPath(t,i);n&&(n.type===d.Trigger?n.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 n=this.artboard.textByPath(t,i);if(n)return n;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 n=this.retrieveTextAtPath(t,i);if(n)return n.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(i,"'"))},t.prototype.setTextRunValueAtPath=function(t,i,n){var e=this.retrieveTextAtPath(t,n);e?e.text=i:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(n,"'"))},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 n=this.file.artboardByIndex(i),e={name:n.name,animations:[],stateMachines:[]},r=0;r<n.animationCount();r++){var o=n.animationByIndex(r);e.animations.push(o.name)}for(var s=0;s<n.stateMachineCount();s++){for(var a=n.stateMachineByIndex(s),h=a.name,c=new this.runtime.StateMachineInstance(a,n),u=[],l=0;l<c.inputCount();l++){var d=c.input(l);u.push({name:d.name,type:d.type})}e.stateMachines.push({name:h,inputs:u})}t.artboards.push(e)}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*M.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.missingErrorMessage="Rive source file or data buffer required",t}(),O=function(t){return u(void 0,void 0,void 0,(function(){var i;return l(this,(function(n){switch(n.label){case 0:return i=new Request(t),[4,fetch(i)];case 1:return[4,n.sent().arrayBuffer()];case 2:return[2,n.sent()]}}))}))},A=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},E={EventManager:k,TaskQueueManager:_},S=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeAudio(t,i)}))}))},D=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeImage(t,i)}))}))},I=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeFont(t,i)}))}))}})(),e})(),I.exports=D();const z=class{constructor(i){t(this,i),this.initializeRive=t=>{const i=c.getInstance(),n=this.el.querySelector("canvas");this.riveInstance=new I.exports.Rive({src:t,canvas:n,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(){s(this.el,this.delayVisible),a(this.el,this.type),this.initializeRive(h(this.src))}render(){return i(n,{key:"54b86b9154855e156b6dd67c71eb4107b317b480",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},i("canvas",{key:"f9d352ac0f0ef41b155a1cfc7659bb44f628beb3",class:"lido-canvas"}))}get el(){return e(this)}};z.style=".lido-canvas{height:100%;width:100%}";const F=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type),u(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 n=i.offsetWidth,e=i.offsetHeight;Array.from(t.children).forEach((t=>{const i=n-t.offsetWidth,r=e-t.offsetHeight,o=Math.random()*i,s=Math.random()*r;t.style.position="absolute",t.style.left=`${o}px`,t.style.top=`${s}px`}))}}),50),this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,margin:d(this.margin,t),padding:d(this.padding,t),borderRadius:d(this.borderRadius,t),gap:d(this.gap,t),"--scrollbar-width":d(this.scrollbarWidth||"0px",t),display:JSON.parse(d(`${this.visible}`,t))?"wrap"===d(this.layout,t)?"grid":"pos"===d(this.layout,t)||"random"===d(this.layout,t)?"block":"flex":"none",flexDirection:this.flexDirection?d(this.flexDirection,t):"",alignItems:this.alignItems?d(this.alignItems,t):""},this.el.className=`lido-${d(this.layout,t)}`}render(){return i(n,{key:"9f65539e85d22f775f44c310ecd7accc5f599859",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},i("slot",{key:"1c81a23db893dfc3af36f0ed98f9d5ce3cafebf3"}))}get el(){return e(this)}};F.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 L=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(){a(this.el,this.type),u(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&l(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?h(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,i),width:d(this.width,i),backgroundColor:d(this.bgColor,i),top:d(this.y,i),left:d(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?d(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:d(this.margin,i)}}render(){return i(n,{key:"753487ca4817b020aaf7e34dadff00a61c826dfc",id:this.id,class:"lido-col",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"a9d9f0f2c30dc02e6468e597b5a02e032d786538"}))}get el(){return e(this)}};L.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 R=class{constructor(i){t(this,i),this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.showPrevButton="false",this.showNextButton="false",this.delayVisible=""}convertToPixels(t,i=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.height=t,i.appendChild(n);const e=n.offsetHeight;return i.removeChild(n),e}scaleContainer(t){t.style.transform=`translate(-50%, -50%) scale(${f()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?h(this.bgImage):"";if(document.body.style.backgroundColor=this.bgColor,document.body.style.backgroundImage=t?`url(${t})`:"none",document.body.style.backgroundPosition=t?"bottom":"none",window.addEventListener("resize",(()=>this.scaleContainer(this.el))),window.addEventListener("load",(()=>this.scaleContainer(this.el))),a(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}}disconnectedCallback(){window.removeEventListener("resize",(()=>this.scaleContainer(this.el))),window.removeEventListener("load",(()=>this.scaleContainer(this.el))),document.body.style.backgroundColor="",document.body.style.backgroundImage=""}render(){const t={backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin};return console.log("🚀 ~ LidoContainer ~ canplay:",this.canplay),i(n,{key:"7973350ab1163200af05910818e03001cd8a5ff9",id:"lido-container","tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:t,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,onTouch:this.onTouch,onInCorrect:this.onInCorrect,onCorrect:this.onCorrect,onEntry:this.onEntry,"show-check":`${this.showCheck}`,"is-continue-on-correct":`${this.isContinueOnCorrect}`,"is-allow-only-correct":`${this.isAllowOnlyCorrect}`,canplay:`${this.canplay}`,appendToDropOnCompletion:`${this.appendToDropOnCompletion}`,"show-prev-button":`${this.showPrevButton}`,"show-next-button":`${this.showNextButton}`,"show-drop-border":`${this.showDropBorder}`,"bg-image":this.bgImage},i("slot",{key:"4167e635d955bdd3bc713cf3eac79c437918bb3c"}))}get el(){return e(this)}};R.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 W=class{constructor(i){t(this,i),this.updateStyles=()=>{const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,t)||"200px",width:d(this.width,t)||"200px",backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:this.visible?this.display?d(this.display,t):"inline-block":"none",flexDirection:this.direction?d(this.direction,t):void 0,margin:d(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.style={},this.delayVisible=""}handleFlippedChange(){}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles),window.addEventListener("load",this.updateStyles)}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type)}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles),window.removeEventListener("load",this.updateStyles)}render(){return i(n,{key:"ab4549fc6dd8fcbd7d67e21433827bc87c1f2dbe",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},i("div",{key:"c8981d2f7c3f71b26402bfdab79f5da765b20e02",class:"card "+(this.flipped?"flipped":"")},i("div",{key:"78608648e93d368577a7c7c5a058ced227eafa44",class:"card-face card-front"},null!=this.front?this.front:i("slot",{name:"front"})),i("div",{key:"7eabba27269fb0cd827310cf4aab2d03c8031de1",class:"card-face card-back"},null!=this.back?this.back:i("slot",{name:"back"}))))}get el(){return e(this)}static get watchers(){return{flipped:["handleFlippedChange"]}}};W.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 X=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.delayVisible="",this.style=void 0}componentDidLoad(){s(this.el,this.delayVisible),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;p(i),t.addEventListener("click",(()=>{v(i)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return i(n,{key:"a0ff5cd4fad7b37b183bd555207ad54a9a03d26b",class:"lido-float",id:this.id,"tab-index":this.tabIndex,style:this.style},i("slot",{key:"994b173de0002b0438a84d35ad5143a83822b4e9"}))}get el(){return e(this)}};X.style=".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:900px}to{top:-400px;}}";const U=class{constructor(i){t(this,i),this.NextContainerKey=t=>{null!=t&&t==this.currentContainerIndex||(w(),null!=t&&t<this.containers.length?(this.currentContainerIndex=t,m(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,m(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(b(),this.currentContainerIndex=0),this.containers=[...this.containers],this.updateArrowVisibility())},this.PrevContainerKey=t=>{console.log("👉 PrevContainerKey CALLED with index:",t),this.currentContainerIndex<=0||(w(),this.currentContainerIndex--,m(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.updateArrowVisibility=()=>{setTimeout((()=>{const t=this.el.querySelector("lido-container"),i=t.getAttribute("show-prev-button"),n=t.getAttribute("show-next-button"),e=this.el.querySelector("#lido-arrow-right");this.el.querySelector("#lido-arrow-left").style.visibility="true"!==i?"hidden":"visible",e.style.visibility="true"!==n?"hidden":"visible"}),100)},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(g(),w(),i.remove()):i.remove())},this.xmlData="",this.initialIndex=0,this.canplay=!0,this.baseUrl="",this.height="",this.currentContainerIndex=this.initialIndex,this.exitFlag=!1,this.containers=[],this.showDotsandbtn=!1}componentWillLoad(){window.addEventListener(y,(()=>{this.NextContainerKey()})),window.addEventListener(x,(()=>{this.PrevContainerKey()})),window.addEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),this.parseXMLData(this.xmlData),window.addEventListener("beforeunload",(()=>{w()}))}componentDidLoad(){setTimeout((()=>{this.showDotsandbtn=!0}),10),this.updateArrowVisibility(),this.scaleNavbarContainer(),window.addEventListener("resize",(()=>{this.scaleNavbarContainer()}))}updateBackgroundImage(){const t=document.querySelector(k),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(y,(()=>{this.NextContainerKey()})),window.removeEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),window.removeEventListener(x,(()=>{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 n=t.nodeName.toLowerCase(),e={};Array.from(t.attributes).forEach((t=>{e[t.name]=t.value}));const r=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean),o={"lido-container":i("lido-container",Object.assign({},e,{canplay:this.canplay,baseUrl:this.baseUrl,height:this.height}),r),"lido-flash-card":i("lido-flash-card",Object.assign({},e),r),"lido-col":i("lido-col",Object.assign({},e),r),"lido-trace":i("lido-trace",Object.assign({},e),r),"lido-image":i("lido-image",Object.assign({},e),r),"lido-row":i("lido-row",Object.assign({},e),r),"lido-text":i("lido-text",Object.assign({},e),r),"lido-pos":i("lido-pos",Object.assign({},e),r),"lido-shape":i("lido-shape",Object.assign({},e),r),"lido-wrap":i("lido-wrap",Object.assign({},e),r),"lido-random":i("lido-random",Object.assign({},e),r),"lido-avatar":i("lido-avatar",Object.assign({},e),r),"lido-cell":i("lido-cell",Object.assign({},e),r),"lido-slide-fill":i("lido-slide-fill",Object.assign({},e),r),"lido-float":i("lido-float",Object.assign({},e),r)};return o[n]?o[n]:(console.warn(`Unknown tag: ${n}`),null)}parseContainers(t){const i=t.querySelectorAll("lido-container"),n=Array.from(i).map((t=>()=>this.parseElement(t)));this.containers=n}async btnpopup(){T(!1),await _.getI().stop();const t=document.getElementById(k).querySelectorAll("*");for(const i of Array.from(t)){if(M())break;const t=i.getAttribute("tab-index"),n=i;if(t&&Number(t)>0){if(await _.getI().play(n),M()){await _.getI().stop();break}await new Promise((t=>setTimeout(t,300)))}}}scaleNavbarContainer(){setTimeout((()=>{const t=document.querySelector(".lido-dot-container");t&&((1600===window.innerWidth&&900===window.innerHeight||900===window.innerWidth&&1600===window.innerHeight)&&document.querySelectorAll(".lido-exit-button, #main-audio").forEach((t=>{t.style.marginLeft="10px",t.style.marginRight="10px"})),t.style.top=window.innerWidth>window.innerHeight?"6%":"3.5%",t.style.transform="translate(-50%, -50%)",t.style.visibility="visible",Array.from(t.children).forEach((t=>{t.style.transform=`scale(${f()})`})),t.style.width=window.outerWidth+"px")}),700)}renderDots(){const t={pointerEvents:this.canplay?"none":""};return i("div",{id:"lido-dot-indicator",class:"lido-dot-container"},i("div",{class:"lido-exit-button popup\n -button",onClick:()=>{this.exitFlag=!0,_.getI().stop()}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.svg"})),i("div",{class:"lido-btn-dot-container"},i("div",{id:"lido-arrow-left",onClick:()=>{j()}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.svg"})),this.containers.map(((n,e)=>i("div",{class:"parent_dots"},i("span",{class:"lido-dot "+(e<this.currentContainerIndex?"completed":e===this.currentContainerIndex?"current":""),onClick:()=>this.jumpToContainer(e),style:t})))),i("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"),C("this.nextBtn='true'",t.currentTarget)}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.svg"}))),i("div",{id:"main-audio",class:"popup-button",onClick:()=>this.btnpopup()},i("lido-image",{visible:"true",src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Audio%20icon.svg"})))}jumpToContainer(t){this.NextContainerKey(t)}render(){var t,e;return console.log("🚀 ~ LidoHome ~ render ~ this.containers:",this),this.xmlData?i(n,{class:"lido-home",index:this.currentContainerIndex,totalIndex:this.containers.length},i("div",{key:this.currentContainerIndex},null===(e=(t=this.containers)[this.currentContainerIndex])||void 0===e?void 0:e.call(t)),this.renderDots(),this.exitFlag&&i("div",{class:"lido-alert-parent"},i("div",{class:"lido-alert-popup"},i("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)';"},i("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';"}),i("lido-cell",{visible:"true",layout:"row",width:"294px",class:"btn-cell"},i("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"}),i("lido-text",{visible:"true",string:"KEEP 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"})))))):i("div",null,"Please provide XML data.")}get el(){return e(this)}static get watchers(){return{xmlData:["onXmlDataChange"]}}};U.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}.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;gap:145px}.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}@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}}.lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active .lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";var N,Y={exports:{}},B={},H={},G={};N=G,Object.defineProperty(N,"__esModule",{value:!0}),N.MUST_INSTALL_PUPPETEER=N.DEFAULT_CONVERSION_ERROR_MESSAGE=N.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=N.UNEXPECTED_ERROR_MESSAGE_LINK=N.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,N.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",N.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",N.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=N.UNEXPECTED_ERROR_MESSAGE_PREFIX+N.UNEXPECTED_ERROR_MESSAGE_LINK,N.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",N.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(H,"__esModule",{value:!0}),H.ErrorHandling=void 0;const V=G;class q{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,i,n){const e=[`Input ${t} color string could not be parsed.`,`String received: ${i}.`];return n&&e.splice(1,0,`Expected format: ${n}.`),e.join(" ")}static generateUnexpectedError(t){return q.generateErrorResult(`${V.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${t.message}`)}static hasError(t){return!!t.errorMessage}}H.ErrorHandling=q;var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.SheenUtil=void 0;class J{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}K.SheenUtil=J,J.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)";var Q={};!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"}(Q);var Z={},tt={},it={};Object.defineProperty(it,"__esModule",{value:!0}),it.RgbColor=void 0,it.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,n){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(n)}multiply(t){const i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),n=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),e=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=n,this.b=e}hueRotate(t=0){t=t/180*Math.PI;const i=Math.sin(t),n=Math.cos(t);this.multiply([.213+.787*n-.213*i,.715-.715*n-.715*i,.072-.072*n+.928*i,.213-.213*n+.143*i,.715+.285*n+.14*i,.072-.072*n-.283*i,.213-.213*n-.787*i,.715-.715*n+.715*i,.072+.928*n+.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(tt,"__esModule",{value:!0}),tt.RgbToFilterWorker=void 0;const nt=K,et=it;class rt{constructor(t,i){this.targetRgbColor=t,this.reusedRgbColor=new et.RgbColor,this.addSheen=i}static fmt(t,i,n=1){return Math.round(t[i]*n)}generateCss(t){return`${this.addSheen?`${nt.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${rt.fmt(t,0)}%) sepia(${rt.fmt(t,1)}%) saturate(${rt.fmt(t,2)}%) hue-rotate(${rt.fmt(t,3,3.6)}deg) brightness(${rt.fmt(t,4)}%) contrast(${rt.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 n=100;return 2===i?n=7500:4!==i&&5!==i||(n=200),3===i?t>n?t%=n:t<0&&(t=n+t%n):t<0?t=0:t>n&&(t=n),t}spsa(t,i,n,e,r){let o=[],s=1/0;const a=new Array(6),h=new Array(6),c=new Array(6);for(let u=0;u<r;u+=1){const r=n/Math.pow(u+1,.16666666666666666);for(let t=0;t<6;t+=1)a[t]=Math.random()>.5?1:-1,h[t]=e[t]+r*a[t],c[t]=e[t]-r*a[t];const l=this.loss(h)-this.loss(c);for(let n=0;n<6;n+=1){const o=l/(2*r)*a[n],s=i[n]/Math.pow(t+u+1,1);e[n]=rt.fixSpsa(e[n]-s*o,n)}const d=this.loss(e);d<s&&(o=e.slice(0),s=d)}return{values:o,loss:s}}solveNarrow(t){const i=t.loss,n=i+1;return this.spsa(i,[.25*n,.25*n,n,.25*n,.2*n,.2*n],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let i={values:[],loss:1/0};for(let n=0;i.loss>25&&n<3;n+=1){const n=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);n.loss<i.loss&&(i=n)}return i}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}tt.RgbToFilterWorker=rt,Object.defineProperty(Z,"__esModule",{value:!0}),Z.RgbToFilter=void 0;const ot=H,st=G,at=tt,ht=it;class ct{static generateConversionError(t){return ot.ErrorHandling.generateErrorResult(t||st.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(t){return ot.ErrorHandling.generateErrorResult(t)}static execute(t,i){const n=new ht.RgbColor(t);return new at.RgbToFilterWorker(n,i).convert()}static convertToRGB(t,i){return t&&i?i(t):null}static convert(t){try{const{colorString:i,validateAndParse:n,convertToRgb:e,conversionErrorMessage:r,addSheen:o}=t,s=i.trim().toLocaleLowerCase(),a=(null==n?void 0:n(s))||{color:s};if(ot.ErrorHandling.hasError(a))return ct.generateValidateAndParseError(a.errorMessage);const h=ct.convertToRGB(a.color,e)||a.color;return h?ct.execute(h,o):ct.generateConversionError(r)}catch(t){return ot.ErrorHandling.generateUnexpectedError(t)}}}Z.RgbToFilter=ct;var ut={},lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.MATCH_HEXADECIMAL=lt.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,lt.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,lt.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.MAX_COLOR_INPUT_STRING_LENGTH=void 0,dt.MAX_COLOR_INPUT_STRING_LENGTH=25;var ft={};!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"}(ft);var pt={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]},vt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.ColorParser=void 0;const wt=lt,mt=H,bt=dt,gt=ft,yt=Q,xt=vt(pt);class kt{static validateAndParseHex(t){return t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(wt.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.HEX,t,gt.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH){const i=t.match(wt.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(wt.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=kt.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:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.RGB,t,gt.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=kt.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:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.HSL,t,gt.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH&&xt.default[t]?{color:t}:{errorMessage:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.KEYWORD,t,gt.ColorFormats.KEYWORD)}}}ut.ColorParser=kt;const _t=pt,Mt={};for(const t of Object.keys(_t))Mt[_t[t]]=t;const jt={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 Ct=jt;for(const t of Object.keys(jt)){if(!("channels"in jt[t]))throw new Error("missing channels property: "+t);if(!("labels"in jt[t]))throw new Error("missing channel labels property: "+t);if(jt[t].labels.length!==jt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:n}=jt[t];delete jt[t].channels,delete jt[t].labels,Object.defineProperty(jt[t],"channels",{value:i}),Object.defineProperty(jt[t],"labels",{value:n})}jt.rgb.hsl=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.min(i,n,e),o=Math.max(i,n,e),s=o-r;let a,h;o===r?a=0:i===o?a=(n-e)/s:n===o?a=2+(e-i)/s:e===o&&(a=4+(i-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+o)/2;return h=o===r?0:c<=.5?s/(o+r):s/(2-o-r),[a,100*h,100*c]},jt.rgb.hsv=function(t){let i,n,e,r,o;const s=t[0]/255,a=t[1]/255,h=t[2]/255,c=Math.max(s,a,h),u=c-Math.min(s,a,h),l=function(t){return(c-t)/6/u+.5};return 0===u?(r=0,o=0):(o=u/c,i=l(s),n=l(a),e=l(h),s===c?r=e-n:a===c?r=1/3+i-e:h===c&&(r=2/3+n-i),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*c]},jt.rgb.hwb=function(t){const i=t[0],n=t[1];let e=t[2];const r=jt.rgb.hsl(t)[0],o=1/255*Math.min(i,Math.min(n,e));return e=1-1/255*Math.max(i,Math.max(n,e)),[r,100*o,100*e]},jt.rgb.cmyk=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.min(1-i,1-n,1-e);return[100*((1-i-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*((1-e-r)/(1-r)||0),100*r]},jt.rgb.keyword=function(t){const i=Mt[t];if(i)return i;let n,e=1/0;for(const i of Object.keys(_t)){const s=((r=t)[0]-(o=_t[i])[0])**2+(r[1]-o[1])**2+(r[2]-o[2])**2;s<e&&(e=s,n=i)}var r,o;return n},jt.keyword.rgb=function(t){return _t[t]},jt.rgb.xyz=function(t){let i=t[0]/255,n=t[1]/255,e=t[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,[100*(.4124*i+.3576*n+.1805*e),100*(.2126*i+.7152*n+.0722*e),100*(.0193*i+.1192*n+.9505*e)]},jt.rgb.lab=function(t){const i=jt.rgb.xyz(t);let n=i[0],e=i[1],r=i[2];return n/=95.047,e/=100,r/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*e-16,500*(n-e),200*(e-r)]},jt.hsl.rgb=function(t){const i=t[0]/360,n=t[1]/100,e=t[2]/100;let r,o,s;if(0===n)return s=255*e,[s,s,s];r=e<.5?e*(1+n):e+n-e*n;const a=2*e-r,h=[0,0,0];for(let t=0;t<3;t++)o=i+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?a+6*(r-a)*o:2*o<1?r:3*o<2?a+(r-a)*(2/3-o)*6:a,h[t]=255*s;return h},jt.hsl.hsv=function(t){const i=t[0];let n=t[1]/100,e=t[2]/100,r=n;const o=Math.max(e,.01);return e*=2,n*=e<=1?e:2-e,r*=o<=1?o:2-o,[i,100*(0===e?2*r/(o+r):2*n/(e+n)),(e+n)/2*100]},jt.hsv.rgb=function(t){const i=t[0]/60,n=t[1]/100;let e=t[2]/100;const r=Math.floor(i)%6,o=i-Math.floor(i),s=255*e*(1-n),a=255*e*(1-n*o),h=255*e*(1-n*(1-o));switch(e*=255,r){case 0:return[e,h,s];case 1:return[a,e,s];case 2:return[s,e,h];case 3:return[s,a,e];case 4:return[h,s,e];case 5:return[e,s,a]}},jt.hsv.hsl=function(t){const i=t[0],n=t[1]/100,e=t[2]/100,r=Math.max(e,.01);let o,s;s=(2-n)*e;const a=(2-n)*r;return o=n*r,o/=a<=1?a:2-a,o=o||0,s/=2,[i,100*o,100*s]},jt.hwb.rgb=function(t){const i=t[0]/360;let n=t[1]/100,e=t[2]/100;const r=n+e;let o;r>1&&(n/=r,e/=r);const s=Math.floor(6*i),a=1-e;o=6*i-s,1&s&&(o=1-o);const h=n+o*(a-n);let c,u,l;switch(s){default:case 6:case 0:c=a,u=h,l=n;break;case 1:c=h,u=a,l=n;break;case 2:c=n,u=a,l=h;break;case 3:c=n,u=h,l=a;break;case 4:c=h,u=n,l=a;break;case 5:c=a,u=n,l=h}return[255*c,255*u,255*l]},jt.cmyk.rgb=function(t){const i=t[1]/100,n=t[2]/100,e=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-e)+e)),255*(1-Math.min(1,i*(1-e)+e)),255*(1-Math.min(1,n*(1-e)+e))]},jt.xyz.rgb=function(t){const i=t[0]/100,n=t[1]/100,e=t[2]/100;let r,o,s;return r=3.2406*i+-1.5372*n+-.4986*e,o=-.9689*i+1.8758*n+.0415*e,s=.0557*i+-.204*n+1.057*e,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[255*r,255*o,255*s]},jt.xyz.lab=function(t){let i=t[0],n=t[1],e=t[2];return i/=95.047,n/=100,e/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,[116*n-16,500*(i-n),200*(n-e)]},jt.lab.xyz=function(t){let i,n,e;n=(t[0]+16)/116,i=t[1]/500+n,e=n-t[2]/200;const r=n**3,o=i**3,s=e**3;return n=r>.008856?r:(n-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,i*=95.047,n*=100,e*=108.883,[i,n,e]},jt.lab.lch=function(t){const i=t[0],n=t[1],e=t[2];let r;return r=360*Math.atan2(e,n)/2/Math.PI,r<0&&(r+=360),[i,Math.sqrt(n*n+e*e),r]},jt.lch.lab=function(t){const i=t[1],n=t[2]/360*2*Math.PI;return[t[0],i*Math.cos(n),i*Math.sin(n)]},jt.rgb.ansi16=function(t,i=null){const[n,e,r]=t;let o=null===i?jt.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(r/255)<<2|Math.round(e/255)<<1|Math.round(n/255));return 2===o&&(s+=60),s},jt.hsv.ansi16=function(t){return jt.rgb.ansi16(jt.hsv.rgb(t),t[2])},jt.rgb.ansi256=function(t){const i=t[0],n=t[1],e=t[2];return i===n&&n===e?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(n/255*5)+Math.round(e/255*5)},jt.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 n=.5*(1+~~(t>50));return[(1&i)*n*255,(i>>1&1)*n*255,(i>>2&1)*n*255]},jt.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]},jt.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},jt.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 n=i[0];3===i[0].length&&(n=n.split("").map((t=>t+t)).join(""));const e=parseInt(n,16);return[e>>16&255,e>>8&255,255&e]},jt.rgb.hcg=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.max(Math.max(i,n),e),o=Math.min(Math.min(i,n),e),s=r-o;let a,h;return a=s<1?o/(1-s):0,h=s<=0?0:r===i?(n-e)/s%6:r===n?2+(e-i)/s:4+(i-n)/s,h/=6,h%=1,[360*h,100*s,100*a]},jt.hsl.hcg=function(t){const i=t[1]/100,n=t[2]/100,e=n<.5?2*i*n:2*i*(1-n);let r=0;return e<1&&(r=(n-.5*e)/(1-e)),[t[0],100*e,100*r]},jt.hsv.hcg=function(t){const i=t[2]/100,n=t[1]/100*i;let e=0;return n<1&&(e=(i-n)/(1-n)),[t[0],100*n,100*e]},jt.hcg.rgb=function(t){const i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];const e=[0,0,0],r=t[0]/360%1*6,o=r%1,s=1-o;let a=0;switch(Math.floor(r)){case 0:e[0]=1,e[1]=o,e[2]=0;break;case 1:e[0]=s,e[1]=1,e[2]=0;break;case 2:e[0]=0,e[1]=1,e[2]=o;break;case 3:e[0]=0,e[1]=s,e[2]=1;break;case 4:e[0]=o,e[1]=0,e[2]=1;break;default:e[0]=1,e[1]=0,e[2]=s}return a=(1-i)*n,[255*(i*e[0]+a),255*(i*e[1]+a),255*(i*e[2]+a)]},jt.hcg.hsv=function(t){const i=t[1]/100,n=i+t[2]/100*(1-i);let e=0;return n>0&&(e=i/n),[t[0],100*e,100*n]},jt.hcg.hsl=function(t){const i=t[1]/100,n=t[2]/100*(1-i)+.5*i;let e=0;return n>0&&n<.5?e=i/(2*n):n>=.5&&n<1&&(e=i/(2*(1-n))),[t[0],100*e,100*n]},jt.hcg.hwb=function(t){const i=t[1]/100,n=i+t[2]/100*(1-i);return[t[0],100*(n-i),100*(1-n)]},jt.hwb.hcg=function(t){const i=1-t[2]/100,n=i-t[1]/100;let e=0;return n<1&&(e=(i-n)/(1-n)),[t[0],100*n,100*e]},jt.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},jt.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},jt.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},jt.gray.hsl=function(t){return[0,0,t[0]]},jt.gray.hsv=jt.gray.hsl,jt.gray.hwb=function(t){return[0,100,t[0]]},jt.gray.cmyk=function(t){return[0,0,0,t[0]]},jt.gray.lab=function(t){return[t[0],0,0]},jt.gray.hex=function(t){const i=255&Math.round(t[0]/100*255),n=((i<<16)+(i<<8)+i).toString(16).toUpperCase();return"000000".substring(n.length)+n},jt.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const Tt=Ct;function $t(t,i){return function(n){return i(t(n))}}function Pt(t,i){const n=[i[t].parent,t];let e=Tt[i[t].parent][t],r=i[t].parent;for(;i[r].parent;)n.unshift(i[r].parent),e=$t(Tt[i[r].parent][r],e),r=i[r].parent;return e.conversion=n,e}const Ot=Ct,At=function(t){const i=function(t){const i=function(){const t={},i=Object.keys(Tt);for(let n=i.length,e=0;e<n;e++)t[i[e]]={distance:-1,parent:null};return t}(),n=[t];for(i[t].distance=0;n.length;){const t=n.pop(),e=Object.keys(Tt[t]);for(let r=e.length,o=0;o<r;o++){const r=e[o],s=i[r];-1===s.distance&&(s.distance=i[t].distance+1,s.parent=t,n.unshift(r))}}return i}(t),n={},e=Object.keys(i);for(let t=e.length,r=0;r<t;r++){const t=e[r];null!==i[t].parent&&(n[t]=Pt(t,i))}return n},Et={};Object.keys(Ot).forEach((t=>{Et[t]={},Object.defineProperty(Et[t],"channels",{value:Ot[t].channels}),Object.defineProperty(Et[t],"labels",{value:Ot[t].labels});const i=At(t);Object.keys(i).forEach((n=>{const e=i[n];Et[t][n]=function(t){const i=function(...i){const n=i[0];if(null==n)return n;n.length>1&&(i=n);const e=t(i);if("object"==typeof e)for(let t=e.length,i=0;i<t;i++)e[i]=Math.round(e[i]);return e};return"conversion"in t&&(i.conversion=t.conversion),i}(e),Et[t][n].raw=function(t){const i=function(...i){const n=i[0];return null==n?n:(n.length>1&&(i=n),t(i))};return"conversion"in t&&(i.conversion=t.conversion),i}(e)}))}));var St=Et,Dt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(B,"__esModule",{value:!0}),B.ColorToFilter=void 0;const It=H,zt=K,Ft=Q,Lt=Z,Rt=ut,Wt=Dt(St);B.ColorToFilter=class{static rgbToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseRgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseHex,convertToRgb:Wt.default.hex.rgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseHsl,convertToRgb:Wt.default.hsl.rgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseKeyword,convertToRgb:Wt.default.keyword.rgb,conversionErrorMessage:It.ErrorHandling.generateInputErrorMessage(Ft.ColorTypes.KEYWORD,t),addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}};var Xt={},Ut={},Nt={},Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.FilterToHexShared=void 0;const Bt=H,Ht=ft,Gt=Q;Yt.FilterToHexShared=class{static generateInputErrorMessage(t){return Bt.ErrorHandling.generateInputErrorMessage(Gt.ColorTypes.FILTER,t,Ht.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,i=1){const n=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}(),e=function(){const n="http://www.w3.org/2000/svg",e=document.createElementNS(n,"svg");e.style.height="inherit",e.style.width="inherit",e.style.float="left",e.style.filter=t;const r=document.createElementNS(n,"rect");return r.setAttributeNS(null,"width",i.toString()),r.setAttributeNS(null,"height",i.toString()),e.appendChild(r),e}();return""===e.style.filter?{errorMessage:"error indicator",svgContainerElement:n}:(n.appendChild(e),document.body.appendChild(n),{svgContainerElement:n})}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,n){if(t>255||i>255||n>255)throw new Error("Invalid color component");return(t<<16|i<<8|n).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 Vt,qt={exports:{}};Vt=qt,function(){var t=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:i,mimeType:function(t){var n,e;return(n="application/font-woff",e="image/jpeg",{woff:n,woff2:n,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:e,jpeg:e,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 n=window.atob(t.toDataURL().split(",")[1]),e=n.length,r=new Uint8Array(e),o=0;o<e;o++)r[o]=n.charCodeAt(o);i(new Blob([r],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var n=document.implementation.createHTMLDocument(),e=n.createElement("base");n.head.appendChild(e);var r=n.createElement("a");return n.body.appendChild(r),e.href=i,r.href=t,r.href},getAndEncode:function(t){return o.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(i){var n,e=new XMLHttpRequest;if(e.onreadystatechange=function(){if(4===e.readyState)if(200===e.status){var r=new FileReader;r.onloadend=function(){var t=r.result.split(/,/)[1];i(t)},r.readAsDataURL(e.response)}else n?i(n):s("cannot fetch resource: "+t+", status: "+e.status)},e.ontimeout=function(){n?i(n):s("timeout of 30000ms occured while fetching resource: "+t)},e.responseType="blob",e.timeout=3e4,e.open("GET",t,!0),e.send(),o.impl.options.imagePlaceholder){var r=o.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(n=r[1])}function s(t){console.error(t),i("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(i){return new Promise((function(n){setTimeout((function(){n(i)}),t)}))}},asArray:function(t){for(var i=[],n=t.length,e=0;e<n;e++)i.push(t[e]);return i},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(i,n){var e=new Image;e.onload=function(){i(e)},e.onerror=n,e.src=t}))},width:function(t){var i=n(t,"border-left-width"),e=n(t,"border-right-width");return t.scrollWidth+i+e},height:function(t){var i=n(t,"border-top-width"),e=n(t,"border-bottom-width");return t.scrollHeight+i+e}};var t;function i(t){var i=/\.([^\.\/]*?)$/g.exec(t);return i?i[1]:""}function n(t,i){var n=window.getComputedStyle(t).getPropertyValue(i);return parseFloat(n.replace("px",""))}}(),i=function(){var i=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,o){return n(t)?Promise.resolve(t).then(e).then((function(n){var e=Promise.resolve(t);return n.forEach((function(t){e=e.then((function(n){return r(n,t,i,o)}))})),e})):Promise.resolve(t)},shouldProcess:n,impl:{readUrls:e,inline:r}};function n(t){return-1!==t.search(i)}function e(n){for(var e,r=[];null!==(e=i.exec(n));)r.push(e[1]);return r.filter((function(i){return!t.isDataUrl(i)}))}function r(i,n,e,r){return Promise.resolve(n).then((function(i){return e?t.resolveUrl(i,e):i})).then(r||t.getAndEncode).then((function(i){return t.dataAsUrl(i,t.mimeType(n))})).then((function(e){return i.replace(function(i){return new RegExp("(url\\(['\"]?)("+t.escape(i)+")(['\"]?\\))","g")}(n),"$1"+e+"$3")}))}}(),n=function(){return{resolveAll:function(){return n().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:n}};function n(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(i){var n=[];return i.forEach((function(i){try{t.asArray(i.cssRules||[]).forEach(n.push.bind(n))}catch(t){console.log("Error while reading CSS rules from "+i.href,t.toString())}})),n})).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(n)}));function n(t){return{resolve:function(){return i.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),e=function(){return{inlineAll:function e(r){return r instanceof Element?function(t){var n=t.style.getPropertyValue("background");return n?i.inlineAll(n).then((function(i){t.style.setProperty("background",i,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(r).then((function(){return r instanceof HTMLImageElement?n(r).inline():Promise.all(t.asArray(r.childNodes).map((function(t){return e(t)})))})):Promise.resolve(r)},impl:{newImage:n}};function n(i){return{inline:function(n){return t.isDataUrl(i.src)?Promise.resolve():Promise.resolve(i.src).then(n||t.getAndEncode).then((function(n){return t.dataAsUrl(n,t.mimeType(i.src))})).then((function(t){return new Promise((function(n,e){i.onload=n,i.onerror=e,i.src=t}))}))}}}}(),r={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:s,toPng:function(t,i){return a(t,i||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,i){return a(t,i=i||{}).then((function(t){return t.toDataURL("image/jpeg",i.quality||1)}))},toBlob:function(i,n){return a(i,n||{}).then(t.canvasToBlob)},toPixelData:function(i,n){return a(i,n||{}).then((function(n){return n.getContext("2d").getImageData(0,0,t.width(i),t.height(i)).data}))},impl:{fontFaces:n,images:e,util:t,inliner:i,options:{}}};function s(i,n){return function(t){o.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?r.imagePlaceholder:t.imagePlaceholder,o.impl.options.cacheBust=void 0===t.cacheBust?r.cacheBust:t.cacheBust}(n=n||{}),Promise.resolve(i).then((function(t){return h(t,n.filter,!0)})).then(c).then(u).then((function(t){return n.bgcolor&&(t.style.backgroundColor=n.bgcolor),n.width&&(t.style.width=n.width+"px"),n.height&&(t.style.height=n.height+"px"),n.style&&Object.keys(n.style).forEach((function(i){t.style[i]=n.style[i]})),t})).then((function(e){return function(i,n,e){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="'+n+'" height="'+e+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(e,n.width||t.width(i),n.height||t.height(i))}))}function a(i,n){return s(i,n).then(t.makeImage).then(t.delay(100)).then((function(e){var r=function(i){var e=document.createElement("canvas");if(e.width=n.width||t.width(i),e.height=n.height||t.height(i),n.bgcolor){var r=e.getContext("2d");r.fillStyle=n.bgcolor,r.fillRect(0,0,e.width,e.height)}return e}(i);return r.getContext("2d").drawImage(e,0,0),r}))}function h(i,n,e){return e||!n||n(i)?Promise.resolve(i).then((function(i){return i instanceof HTMLCanvasElement?t.makeImage(i.toDataURL()):i.cloneNode(!1)})).then((function(e){return function(i,n,e){var r=i.childNodes;return 0===r.length?Promise.resolve(n):function(t,i,n){var e=Promise.resolve();return i.forEach((function(i){e=e.then((function(){return h(i,n)})).then((function(i){i&&t.appendChild(i)}))})),e}(n,t.asArray(r),e).then((function(){return n}))}(i,e,n)})).then((function(n){return function(i,n){return n instanceof Element?Promise.resolve().then((function(){e=window.getComputedStyle(i),r=n.style,e.cssText?r.cssText=e.cssText:function(i,n){t.asArray(i).forEach((function(t){n.setProperty(t,i.getPropertyValue(t),i.getPropertyPriority(t))}))}(e,r);var e,r})).then((function(){[":before",":after"].forEach((function(e){!function(e){var r=window.getComputedStyle(i,e),o=r.getPropertyValue("content");if(""!==o&&"none"!==o){var s=t.uid();n.className=n.className+" "+s;var a=document.createElement("style");a.appendChild(function(i,n,e){var r="."+i+":"+n,o=e.cssText?s(e):a(e);return document.createTextNode(r+"{"+o+"}");function s(t){var i=t.getPropertyValue("content");return t.cssText+" content: "+i+";"}function a(i){return t.asArray(i).map(n).join("; ")+";";function n(t){return t+": "+i.getPropertyValue(t)+(i.getPropertyPriority(t)?" !important":"")}}}(s,e,r)),n.appendChild(a)}}(e)}))})).then((function(){i instanceof HTMLTextAreaElement&&(n.innerHTML=i.value),i instanceof HTMLInputElement&&n.setAttribute("value",i.value)})).then((function(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach((function(t){var i=n.getAttribute(t);i&&n.style.setProperty(t,i)})))})).then((function(){return n})):n}(i,n)})):Promise.resolve()}function c(t){return n.resolveAll().then((function(i){var n=document.createElement("style");return t.appendChild(n),n.appendChild(document.createTextNode(i)),t}))}function u(t){return e.inlineAll(t).then((function(){return t}))}Vt.exports=o}();var Kt=o&&o.__createBinding||(Object.create?function(t,i,n,e){void 0===e&&(e=n);var r=Object.getOwnPropertyDescriptor(i,n);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(t,e,r)}:function(t,i,n,e){void 0===e&&(e=n),t[e]=i[n]}),Jt=o&&o.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),Qt=o&&o.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&Kt(i,t,n);return Jt(i,t),i};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.FilterToHexBrowser=void 0;const Zt=H,ti=Yt;class ii extends ti.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const n=ti.FilterToHexShared.generateInputErrorMessage(t),e=Zt.ErrorHandling.generateErrorResult(n);return ii.cleanup(i),e}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>Qt(qt.exports)))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:n}=ti.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return ii.returnInputError(t,n);const e=await ii.getImageBase64ViaSVG(n),r=await ti.FilterToHexShared.getColorViaImageDataURL(e);return ii.cleanup(n),{color:r}}}Nt.FilterToHexBrowser=ii;var ni=o&&o.__createBinding||(Object.create?function(t,i,n,e){void 0===e&&(e=n);var r=Object.getOwnPropertyDescriptor(i,n);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(t,e,r)}:function(t,i,n,e){void 0===e&&(e=n),t[e]=i[n]}),ei=o&&o.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),ri=o&&o.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&ni(i,t,n);return ei(i,t),i};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.FilterToHex=void 0;const oi=H,si=Nt;Ut.FilterToHex=class{static async convert(t,i,n){try{let e;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>ri(require("./workers/node"))));e=await i.convert(t)}else e=await si.FilterToHexBrowser.convert(t);return e.color&&i&&"string"==typeof e.color&&(e.color=i(e.color,n)),e}catch(t){return oi.ErrorHandling.generateUnexpectedError(t)}}};var ai={},hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.ColorFormatter=void 0,hi.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 ci=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0}),ai.HexToColor=void 0;const ui=hi,li=ci(St);ai.HexToColor=class{static convertToRgb(t,i){const n=li.default.hex.rgb(t);return"string"===(null==i?void 0:i.resultType)?ui.ColorFormatter.arrayToRgbString(n):n}static convertToHsl(t,i){const n=li.default.hex.hsl(t);return"string"===(null==i?void 0:i.resultType)?ui.ColorFormatter.arrayToHslString(n):n}},Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.FilterToColor=void 0;const di=Ut,fi=ai;Xt.FilterToColor=class{static async filterToHex(t){const i=await di.FilterToHex.convert(t);return i.color&&(i.color=i.color.toUpperCase()),i}static async filterToRgb(t,i){return di.FilterToHex.convert(t,fi.HexToColor.convertToRgb,i)}static async filterToHsl(t,i){return di.FilterToHex.convert(t,fi.HexToColor.convertToHsl,i)}},function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const n=B,e=Xt;class r{static rgbToFilter(t,i){return n.ColorToFilter.rgbToFilter(t,i)}static hexToFilter(t,i){return n.ColorToFilter.hexToFilter(t,i)}static hslToFilter(t,i){return n.ColorToFilter.hslToFilter(t,i)}static keywordToFilter(t,i){return n.ColorToFilter.keywordToFilter(t,i)}static async filterToHex(t){return e.FilterToColor.filterToHex(t)}static async filterToRgb(t,i){return e.FilterToColor.filterToRgb(t,i)}static async filterToHsl(t,i){return e.FilterToColor.filterToHsl(t,i)}}i.default=r,t.exports=r}(Y,Y.exports);const pi=$(Y.exports),vi=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=""}componentDidLoad(){if(s(this.el,this.delayVisible),a(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${pi.hexToFilter(P(this.filter).toHexString()).color}`)}this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:d(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:d(this.margin,t),padding:d(this.padding,t),transform:d(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${h(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(${h(this.src)})`:"none"}}render(){return"true"===this.isSlice?i(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}):i(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},i("img",{class:"lido-image",src:h(this.src),alt:"",style:this.style}))}get el(){return e(this)}};vi.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 wi=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(){a(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:JSON.parse(d(`${this.visible}`,t))?"block":"none",margin:d(this.margin,t)}}render(){return i(n,{key:"35e70ef17d6b0b3fa77c34b5d5eacc62408aa772",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},i("slot",{key:"37deeb60c7d5b8e5edf954f33ea0207deed93695"}))}get el(){return e(this)}};wi.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 mi=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,n=t.offsetHeight;Array.from(this.el.children).forEach((t=>{const e=t.offsetWidth,r=t.offsetHeight;console.log("child width",e);const o=i-e,s=n-r,a=Math.random()*o,h=Math.random()*s;console.log("randomleft",a),console.log("randomtop",h),t.style.position="absolute",t.style.left=`${a}px`,t.style.top=`${h}px`}))}),50),this.showSpeakIcon&&l(this.el)}render(){return i(n,{key:"229c4cba82bdb4501ee53c16f68407e5d01095a0",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},i("slot",{key:"fb10f2952956918e66a4bb5b110719caa4e41670"}))}get el(){return e(this)}};mi.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const bi=class{constructor(i){t(this,i),this.xmlPath="",this.initialIndex=0,this.margin="",this.canplay=!0,this.baseUrl="",this.xmlData=void 0}async componentWillLoad(){var t;const i=null!==(t=this.xmlPath)&&void 0!==t?t:this.baseUrl+"/index.xml";console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.baseUrl:",this.baseUrl),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.xmlPath:",this.xmlPath),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ xmlPath:",i);try{const t=i.startsWith("http")?i:r(i),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch XML data: ${n.statusText}`);const e=await n.text();this.xmlData=e}catch(t){console.error("Error fetching XML data:",t),this.xmlData=null}}render(){return void 0===this.xmlData?i("div",null,"Loading..."):null===this.xmlData?i("div",null,"Error loading XML data. Please check the path or URL."):i("lido-home",{initialIndex:this.initialIndex,canplay:this.canplay,xmlData:this.xmlData,baseUrl:this.baseUrl})}static get assetsDirs(){return["assets"]}},gi=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=""}componentDidLoad(){a(this.el,this.type),u(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:this.visible?this.display?d(this.display,t):"flex":"none",flexDirection:this.direction?d(this.direction,t):"row",gridTemplateColumns:this.display&&"grid"===d(this.display,t)?"repeat(auto-fill, minmax(186px, auto))":void 0,gap:this.display&&"grid"===d(this.display,t)?"20px":void 0,margin:d(this.margin,t)}}render(){return i(n,{key:"fd85fc603f1a8d1890984e08df7f627cc3840c24",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},i("slot",{key:"a614ca85c0ab0957e0b4150303036c513505e241"}))}get el(){return e(this)}};gi.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const yi=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type)}render(){return i(n,{key:"a70c88433f7024f327b7d3746fd705c75fa776f6",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})}get el(){return e(this)}};yi.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 xi=class{constructor(i){t(this,i),this.originalHeight=null,this.originalY=null,this.id="lido-slide-fill",this.width=void 0,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.svgContent="",this.delayVisible=""}async componentWillLoad(){await this.renderSVG()}async onSrcChange(){await this.renderSVG(),this.onPropChange()}async renderSVG(){const t=await fetch(h(this.src));if(t.ok){let i=await t.text(),n=0;i=i.replace(/<path([^>]*)>/g,((t,i)=>(n++,`<path id="${1===n?"glassPath":2===n?"rulerPath":`path${n}`}"${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(){s(this.el,this.delayVisible),this.updateFill(),this.addRulerNumbers()}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 n=i.querySelector("#fillArea");if(!n)return;const e=this.fillDirection;let r,o;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+n.getAttribute("height")||100,this.originalY=+n.getAttribute("y")||0),r=this.originalHeight,o=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+n.getAttribute("width")||100,this.originalY=+n.getAttribute("x")||0),r=this.originalHeight,o=this.originalY);const s=r,a=o;let h=0;if("string"==typeof this.fill){const t=this.fill.match(/^(\d+(?:\.\d+)?)%$/);if(t)h=Math.min(Math.max(parseFloat(t[1])/100,0),1);else{const t=this.fill.match(/^(\d+(?:\.\d+)?)$/);t&&(h=Math.min(Math.max(parseFloat(t[1])/100,0),1))}}const c=s*h,u="vertical"===e?a+(s-c):a;"vertical"===e?(n.setAttribute("height",c.toString()),n.setAttribute("y",u.toString())):(n.setAttribute("width",c.toString()),n.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 n=i.querySelector("#rulerPath");if(!n)return;i.querySelectorAll(".ruler-number").forEach((t=>t.remove()));const e=this.division,r=e+1,o=n.getTotalLength(),s=(this.max-this.min)/e;for(let t=0;t<r;t++){let r=0;"vertical"===this.fillDirection?r=this.max-t*s:"horizontal"===this.fillDirection&&(r=this.min+t*s);const a=n.getPointAtLength(o/e*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),c=O(r/this.max);r="integer"===this.numberType?Math.round(r):"decimal"===this.numberType?parseFloat(r.toFixed(1)):c.toFraction(!0),h.classList.add("ruler-number"),h.setAttribute("x",a.x.toString()),h.setAttribute("y",(a.y+15).toString()),h.setAttribute("text-anchor","end"),h.setAttribute("font-size","40"),h.setAttribute("fill","#333"),h.textContent=r.toString(),i.appendChild(h)}}render(){return i(n,{key:"8fbcce15c7af9525e912d10f504b192d4c2d325a",id:this.id,class:"lido-slide-fill",src:this.src,fill:this.fill,fillDirection:this.fillDirection,slider:this.slider,style:{width:this.width},min:this.min,max:this.max,division:this.division,numberType:this.numberType},i("div",{key:"294026ccc09d0145537c44f558dcfc8538ce2953",innerHTML:this.svgContent,class:"svg-element"}))}get el(){return e(this)}static get watchers(){return{src:["onSrcChange"],fill:["onPropChange"],division:["onPropChange"],fillDirection:["onPropChange"],numberType:["onPropChange"],min:["onPropChange"],max:["onPropChange"]}}};xi.style=".svg-element,svg{width:100%;height:100%}";const ki=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&l(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?h(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,i),width:d(this.width,i),backgroundColor:d(this.bgColor,i),top:d(this.y,i),left:d(this.x,i),zIndex:this.z,fontSize:d(this.fontSize,i),fontFamily:this.fontFamily,color:d(this.fontColor,i),display:d(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:d(this.margin,i),padding:d(this.padding,i),borderRadius:d(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 n=document.createElement("span");n.textContent=i,n.className="text-letters",t.appendChild(n)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const n=document.createElement("span");n.textContent=i,n.className="text-words",t.appendChild(n)}))}render(){return i(n,{key:"b20e7357057e57fd2b1763f9d2d711a1521af4cd",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},""!==this.spanType?i("div",{class:"lido-text-content"},this.string):this.string)}get el(){return e(this)}};ki.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 2', serif}.lido-text:hover{background-color:#f0f0f0}.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 _i=class{constructor(i){t(this,i),this.moving=!1,this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.currentSvgIndex=0,this.value="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=A.ShowFlow,this.fingerHintUrl="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/finger.png",this.onInCorrect=void 0,this.onCorrect=void 0,this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:100,freeTraceProximityThreshold:50,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null};const i=this.svgUrls[this.currentSvgIndex];await this.fetchSVG(i),await this.loadAnotherSVG(t,!0)}componentDidLoad(){s(this.el,this.delayVisible)}componentWillLoad(){this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.initializeSVG(),this.showSpeakIcon&&(E(this.el),this.el.append(E(this.el)))}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 n=t.paths[t.currentPathIndex];if(!n)return;const e=document.createElementNS("http://www.w3.org/2000/svg","image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",h(this.fingerHintUrl)),e.setAttribute("width","40"),e.setAttribute("height","40"),e.setAttribute("id","lido-finger-hint"),e.style.pointerEvents="none",e.style.opacity="0.8",e.setAttribute("x","0"),e.setAttribute("y","0");const r=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");r.setAttribute("dur","2s"),r.setAttribute("repeatCount","indefinite");const o=document.createElementNS("http://www.w3.org/2000/svg","mpath");o.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${n.id}`),r.appendChild(o),e.appendChild(r),null===(i=t.svg)||void 0===i||i.appendChild(e),this.fingerImg=e}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(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 n=1/0,e=1/0,r=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let s=0;s<=100;s++){const a=t.getPointAtLength(s/100*i);a.x<n&&(n=a.x),a.y<e&&(e=a.y),a.x>r&&(r=a.x),a.y>o&&(o=a.y)}})),n-=i,e-=i,r+=i,o+=i,{minX:n,minY:e,maxX:r,maxY:o}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const n=i.querySelector("svg");n.removeAttribute("width"),n.removeAttribute("height");const e=n.querySelectorAll("path, line"),r=this.calculateBoundingBox(Array.from(e));n.setAttribute("viewBox",`${r.minX} ${r.minY} ${r.maxX-r.minX} ${r.maxY-r.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t,i=10){var n;const e=t.getTotalLength()/(i+1),r=[];for(let o=1;o<=i;o++){const i=t.getPointAtLength(o*e),s=t.getPointAtLength((o+.5)*e),a=Math.atan2(s.y-i.y,s.x-i.x),h=document.createElementNS("http://www.w3.org/2000/svg","polygon");h.setAttribute("points","-5,-5 0,0 -5,5"),h.setAttribute("fill","blue"),h.setAttribute("transform",`translate(${i.x},${i.y}) rotate(${180*a/Math.PI})`),h.setAttribute("class","lido-flow-indicator"),r.push(h),null===(n=t.parentNode)||void 0===n||n.appendChild(h)}return r}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===A.NoFlow?i.style.display="none":t.mode===A.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,n)=>{const e=i.getTotalLength();i.setAttribute("id","lido-path-"+n);const r=i.cloneNode();r.style.opacity="100",r.style["stroke-opacity"]="100";const o=i.style["stroke-width"]||i.getAttribute("stroke-width");r.setAttribute("stroke-width",o),r.setAttribute("stroke-dasharray",e.toString()),r.setAttribute("stroke-dashoffset",e.toString()),i.parentNode.appendChild(r,i),i.setAttribute("class","lido-trace-path"),r.setAttribute("class","lido-trace-path-green"),i.greenPath=r,i.classList.add(t.mode),t.mode===A.BlindTracing||t.mode===A.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",o),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",e.toString()),i.setAttribute("stroke-dashoffset","0")),n===t.currentPathIndex&&t.mode===A.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const n=t.paths[0].getPointAtLength(0),e=document.createElementNS("http://www.w3.org/2000/svg","circle"),r=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("id","lido-draggableCircle"),e.setAttribute("cx",n.x.toString()),e.setAttribute("cy",n.y.toString()),e.setAttribute("r",`calc(${r||10} / 2)`),e.setAttribute("fill","red"),null===(i=t.svg)||void 0===i||i.appendChild(e),t.circle=e,this.resetIdleTimer(t)}addEventListeners(t){var i,n,e,r;if(!t.circle||!t.paths||0===t.paths.length)return;t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const n=this.getPointerPosition(i,t.svg),e={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};this.getDistanceSquared(n,e)<=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===(n=t.svg)||void 0===n||n.addEventListener("pointerup",o),null===(e=t.svg)||void 0===e||e.addEventListener("pointercancel",o),null===(r=t.svg)||void 0===r||r.addEventListener("contextmenu",(t=>{t.preventDefault()}))}handlePointerMove(t){var i,n,e,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;this.hideFingerHint();const o=this.getPointerPosition(t.pointerMoveEvent,t.svg),s={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},a=t.paths[t.currentPathIndex];if(!a)return void console.error("No valid path found at the current index");let h;if(h=t.mode===A.FreeTrace||t.mode===A.BlindFreeTrace?t.freeTraceProximityThreshold*t.freeTraceProximityThreshold:t.proximityThreshold*t.proximityThreshold,this.getDistanceSquared(o,s)>h)return;const c=this.getClosestPointOnPath(a,o);if(!(this.getDistanceSquared(o,c)>h))if(t.mode!==A.FreeTrace&&t.mode!==A.BlindFreeTrace)t.isDragging&&c.length>=t.lastLength&&(t.lastLength=c.length,t.circle.setAttribute("cx",c.x.toString()),t.circle.setAttribute("cy",c.y.toString()),null===(e=t.svg)||void 0===e||e.appendChild(t.circle),null===(r=a.greenPath)||void 0===r||r.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString())),t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer();else{if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const n=document.createElementNS("http://www.w3.org/2000/svg","path"),e=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");n.setAttribute("stroke-width",e),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke","lightgreen"),n.setAttribute("d",`M${o.x},${o.y}`),null===(i=t.svg)||void 0===i||i.appendChild(n),t.currentFreePath[t.currentPathIndex]=n,t.lastPointerPos=o}const e=t.lastPointerPos||o,r=t.currentFreePath[t.currentPathIndex].getAttribute("d");t.currentFreePath[t.currentPathIndex].setAttribute("d",`${r} Q ${e.x},${e.y} ${(e.x+o.x)/2},${(e.y+o.y)/2}`),t.circle.setAttribute("cx",o.x.toString()),t.circle.setAttribute("cy",o.y.toString()),null===(n=t.svg)||void 0===n||n.appendChild(t.circle),t.lastPointerPos=o,a.getTotalLength()-c.length<5&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null)}}async moveToNextContainer(){if(this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),this.currentSvgIndex<this.svgUrls.length-1)return this.currentSvgIndex++,await this.initializeSVG(),void(this.moving=!1);const t=document.getElementById(k);t&&this.onCorrect&&await C(this.onCorrect,t),S()}getPointerPosition(t,i){var n;const e=i.createSVGPoint();e.x=t.clientX,e.y=t.clientY;const r=null===(n=i.getScreenCTM())||void 0===n?void 0:n.inverse();return r?e.matrixTransform(r):{x:t.clientX,y:t.clientY}}getDistanceSquared(t,i){const n=t.x-i.x,e=t.y-i.y;return n*n+e*e}getClosestPointOnPath(t,i){const n=t.getTotalLength();let e={x:0,y:0,length:0},r=1/0,o={x:0,y:0,length:0},s=1/0;for(let e=0;e<=n;e+=20){const n=t.getPointAtLength(e),r=this.getDistanceSquared(i,n);r<s&&(s=r,o={x:n.x,y:n.y,length:e})}const a=Math.max(o.length-20,0),h=Math.min(o.length+20,n);for(let n=a;n<=h;n+=2){const o=t.getPointAtLength(n),s=this.getDistanceSquared(i,o);s<r&&(r=s,e={x:o.x,y:o.y,length:n})}return e}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(h(this.svgSource));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==A.BlindTracing&&this.mode!==A.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,n;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(n=t.svg)||void 0===n?void 0:n.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,n;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const e=t.paths[t.currentPathIndex];if(!e)return void console.error("No valid path found at the next index");t.totalPathLength=e.getTotalLength();const r=e.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",r.x.toString()),null===(n=t.circle)||void 0===n||n.setAttribute("cy",r.y.toString()),t.mode===A.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(e)),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(k))return;const i=this.highlightTextId;if(!i)return;const n=document.getElementById(i);if(!n)return;const e=n.getAttribute("span-type");if(!e)return;const r=n.querySelector(".lido-text-content");if(r){if("letters"===e){const i=r.querySelectorAll(".text-letters");if(t<0||t>=i.length)return;const n=i[t];n&&n.classList.add("letter-highlight")}if("words"===e){const i=r.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const n=i[t];n&&n.classList.add("word-highlight")}}}render(){return i(n,{key:"363897475f678b89b72bf19d76fcafcab8e1fd97",class:"lido-trace",id:this.id,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:{height:this.height,width:this.width,top:this.y,left:this.x,zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex},i("div",{key:"db92cddb2e7cf888a747c33b22a39c261beba7f4",style:{height:this.height,width:this.width},id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return e(this)}static get watchers(){return{svgSource:["initializeSVG"],mode:["initializeSVG"]}}};_i.style=":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}svg{width:100%;height:100%;max-height:calc(100vh - 50px);touch-action:none}#lido-draggableCircle{cursor:pointer;fill:red;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-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 Mi=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.style=void 0}componentDidLoad(){a(this.el,this.type),u(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&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:JSON.parse(d(`${this.visible}`,t))?"true"===this.flex?"flex":"grid":"none",margin:d(this.margin,t)}}render(){return i(n,{key:"f093d948bae3bd98d6c6a205b88ab2dcb6c809b3",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},i("slot",{key:"02e2e72ace7ca4eae384ed410cacc2e3a337b6f7"}))}get el(){return e(this)}};Mi.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{z as lido_avatar,F as lido_cell,L as lido_col,R as lido_container,W as lido_flash_card,X as lido_float,U as lido_home,vi as lido_image,wi as lido_pos,mi as lido_random,bi as lido_root,gi as lido_row,yi as lido_shape,xi as lido_slide_fill,ki as lido_text,_i as lido_trace,Mi as lido_wrap}
1
+ import{r as t,h as i,H as n,a as e,g as r}from"./p-ddf627b0.js";import{c as o,s,i as a,a as h,R as c,h as u,b as l,p as d,d as f,e as p,g as v,j as w,k as m,l as b,m as g,N as y,P as x,L as k,A as _,n as M,t as j,o as C,q as T,r as $,u as P,v as O,T as A,w as E,x as S}from"./p-458281d6.js";var D,I={exports:{}};D=()=>(()=>{var t=[,(t,i,n)=>{var e;n.r(i),n.d(i,{default:()=>r});const r=(e="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var i,n,r=t;function o(){function t(t){const o=e;n=i=0,e=new Map,o.forEach((i=>{try{i(t)}catch(t){console.error(t)}})),this.ob(),r&&r.Tb()}let i=0,n=0,e=new Map,r=null,o=null;this.requestAnimationFrame=function(r){i||(i=requestAnimationFrame(t.bind(this)));const o=++n;return e.set(o,r),o},this.cancelAnimationFrame=function(t){e.delete(t),i&&0==e.size&&(cancelAnimationFrame(i),i=0)},this.Rb=function(t){o&&(document.body.remove(o),o=null),t||(o=document.createElement("div"),o.style.backgroundColor="black",o.style.position="fixed",o.style.right=0,o.style.top=0,o.style.color="white",o.style.padding="4px",o.innerHTML="RIVE FPS",t=function(t){o.innerHTML="RIVE FPS "+t.toFixed(1)},document.body.appendChild(o)),r=new function(){let i=0,n=0;this.Tb=function(){var e=performance.now();n?(++i,1e3<(e-=n)&&(t(1e3*i/e),i=n=0)):(n=e,i=0)}}},this.Ob=function(){o&&(document.body.remove(o),o=null),r=null},this.ob=function(){}}function s(t){console.assert(!0);const i=new Map;let n=-1/0;this.push=function(e){return i.has(e=e+((1<<t)-1)>>t)&&clearTimeout(i.get(e)),i.set(e,setTimeout((function(){i.delete(e),0==i.length?n=-1/0:e==n&&(n=Math.max(...i.keys()),console.assert(n<e))}),1e3)),n=Math.max(e,n),n<<t}}r.ready=new Promise(((t,e)=>{i=t,n=e}));const a=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){a&&a();let t=r.decodeAudio;r.decodeAudio=function(i,n){n(i=t(i))};let i=r.decodeFont;r.decodeFont=function(t,n){n(t=i(t))};const n=r.FileAssetLoader;r.ptrToAsset=t=>{let i=r.ptrToFileAsset(t);return i.isImage?r.ptrToImageAsset(t):i.isFont?r.ptrToFontAsset(t):i.isAudio?r.ptrToAudioAsset(t):i},r.CustomFileAssetLoader=n.extend("CustomFileAssetLoader",{__construct:function({loadContents:t}){this.__parent.__construct.call(this),this.Gb=t},loadContents:function(t,i){return t=r.ptrToAsset(t),this.Gb(t,i)}}),r.CDNFileAssetLoader=n.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(t){let i=r.ptrToAsset(t);return""!==(t=i.cdnUuid)&&(n=i.cdnBaseUrl+"/"+t,(e=new XMLHttpRequest).responseType="arraybuffer",e.onreadystatechange=function(){4==e.readyState&&200==e.status&&(t=>{i.decode(new Uint8Array(t.response))})(e)},e.open("GET",n,!0),e.send(null),!0);var n,e}}),r.FallbackFileAssetLoader=n.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.kb=[]},addLoader:function(t){this.kb.push(t)},loadContents:function(t,i){for(let n of this.kb)if(n.loadContents(t,i))return!0;return!1}});let e=r.computeAlignment;r.computeAlignment=function(t,i,n,r,o=1){return e.call(this,t,i,n,r,o)}};const h="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),c=new function(){function t(){if(!i){var t=document.createElement("canvas"),s={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let a;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(a=t.getContext("webgl",s),n=1,!a)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(a=t.getContext("webgl2",s))n=2;else{if(!(a=t.getContext("webgl",s)))return console.log("No WebGL support. Image mesh will not be drawn."),!1;n=1}function h(t,i,n){if(i=a.createShader(i),a.shaderSource(i,n),a.compileShader(i),0<((n=a.getShaderInfoLog(i))||"").length)throw n;a.attachShader(t,i)}if(a=new Proxy(a,{get:(t,i)=>t.isContextLost()?(c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",i),c=!0),"function"==typeof t[i]?function(){}:void 0):"function"==typeof t[i]?function(...n){return t[i].apply(t,n)}:t[i],set(t,i,n){if(!t.isContextLost())return t[i]=n,!0;c||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+i),c=!0)}}),e=Math.min(a.getParameter(a.MAX_RENDERBUFFER_SIZE),a.getParameter(a.MAX_TEXTURE_SIZE)),h(t=a.createProgram(),a.VERTEX_SHADER,"attribute vec2 vertex;\n attribute vec2 uv;\n uniform vec4 mat;\n uniform vec2 translate;\n varying vec2 st;\n void main() {\n st = uv;\n gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);\n }"),h(t,a.FRAGMENT_SHADER,"precision highp float;\n uniform sampler2D image;\n varying vec2 st;\n void main() {\n gl_FragColor = texture2D(image, st);\n }"),a.bindAttribLocation(t,0,"vertex"),a.bindAttribLocation(t,1,"uv"),a.linkProgram(t),0<((s=a.getProgramInfoLog(t))||"").trim().length)throw s;r=a.getUniformLocation(t,"mat"),o=a.getUniformLocation(t,"translate"),a.useProgram(t),a.bindBuffer(a.ARRAY_BUFFER,a.createBuffer()),a.enableVertexAttribArray(0),a.enableVertexAttribArray(1),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,a.createBuffer()),a.uniform1i(a.getUniformLocation(t,"image"),0),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),i=a}return!0}let i=null,n=0,e=0,r=null,o=null,a=0,h=0,c=!1;t(),this.hc=function(){return t(),e},this.Mb=function(t){i.deleteTexture&&i.deleteTexture(t)},this.Lb=function(e){if(!t())return null;const r=i.createTexture();return r?(i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e),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==n?(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.generateMipmap(i.TEXTURE_2D)):i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),r):null};const u=new s(8),l=new s(8),d=new s(10),f=new s(10);this.Qb=function(n,e,s,c,p){if(t()){var v=u.push(n),w=l.push(e);if(i.canvas){for(var m of(i.canvas.width==v&&i.canvas.height==w||(i.canvas.width=v,i.canvas.height=w),i.viewport(0,w-e,n,e),i.disable(i.SCISSOR_TEST),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.SCISSOR_TEST),s.sort(((t,i)=>i.wb-t.wb)),v=d.push(c),a!=v&&(i.bufferData(i.ARRAY_BUFFER,8*v,i.DYNAMIC_DRAW),a=v),v=0,s))i.bufferSubData(i.ARRAY_BUFFER,v,m.Ta),v+=4*m.Ta.length;for(var b of(console.assert(v==4*c),s))i.bufferSubData(i.ARRAY_BUFFER,v,b.Db),v+=4*b.Db.length;for(var g of(console.assert(v==8*c),v=f.push(p),h!=v&&(i.bufferData(i.ELEMENT_ARRAY_BUFFER,2*v,i.DYNAMIC_DRAW),h=v),m=0,s))i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,m,g.indices),m+=2*g.indices.length;console.assert(m==2*p),g=0,b=!0,v=m=0;for(const t of s){t.image.Ka!=g&&(i.bindTexture(i.TEXTURE_2D,t.image.Ja||null),g=t.image.Ka),t.mc?(i.scissor(t.Ya,w-t.Za-t.jb,t.Ac,t.jb),b=!0):b&&(i.scissor(0,w-e,n,e),b=!1);const a=-2/e;i.uniform4f(r,t.ha[0]*(s=2/n)*t.Ba,t.ha[1]*a*t.Ca,t.ha[2]*s*t.Ba,t.ha[3]*a*t.Ca),i.uniform2f(o,t.ha[4]*s*t.Ba+s*(t.Ya-t.ic*t.Ba)-1,t.ha[5]*a*t.Ca+a*(t.Za-t.jc*t.Ca)+1),i.vertexAttribPointer(0,2,i.FLOAT,!1,0,v),i.vertexAttribPointer(1,2,i.FLOAT,!1,0,v+4*c),i.drawElements(i.TRIANGLES,t.indices.length,i.UNSIGNED_SHORT,m),v+=4*t.Ta.length,m+=2*t.indices.length}console.assert(v==4*c),console.assert(m==2*p)}}},this.canvas=function(){return t()&&i.canvas}},u=r.onRuntimeInitialized;r.onRuntimeInitialized=function(){function t(t){switch(t){case p.srcOver:return"source-over";case p.screen:return"screen";case p.overlay:return"overlay";case p.darken:return"darken";case p.lighten:return"lighten";case p.colorDodge:return"color-dodge";case p.colorBurn:return"color-burn";case p.hardLight:return"hard-light";case p.softLight:return"soft-light";case p.difference:return"difference";case p.exclusion:return"exclusion";case p.multiply:return"multiply";case p.hue:return"hue";case p.saturation:return"saturation";case p.color:return"color";case p.luminosity:return"luminosity"}}function i(t){return"rgba("+((16711680&t)>>>16)+","+((65280&t)>>>8)+","+((255&t)>>>0)+","+((4278190080&t)>>>24)/255+")"}function n(){0<M.length&&(c.Qb(_.drawWidth(),_.drawHeight(),M,j,C),M=[],C=j=0,_.reset(512,512));for(const t of k){for(const i of t.H)i();t.H=[]}k.clear()}u&&u();var e=r.RenderPaintStyle;const s=r.RenderPath,a=r.RenderPaint,l=r.Renderer,d=r.StrokeCap,f=r.StrokeJoin,p=r.BlendMode,v=e.fill,w=e.stroke,m=r.FillRule.evenOdd;let b=1;var g=r.RenderImage.extend("CanvasRenderImage",{__construct:function({la:t,xa:i}={}){this.__parent.__construct.call(this),this.Ka=b,b=b+1&2147483647||1,this.la=t,this.xa=i},__destruct:function(){this.Ja&&(c.Mb(this.Ja),URL.revokeObjectURL(this.Wa)),this.__parent.__destruct.call(this)},decode:function(t){var i=this;i.xa&&i.xa(i);var n=new Image;i.Wa=URL.createObjectURL(new Blob([t],{type:"image/png"})),n.onload=function(){i.Fb=n,i.Ja=c.Lb(n),i.size(n.width,n.height),i.la&&i.la(i)},n.src=i.Wa}}),y=s.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.T=new Path2D},rewind:function(){this.T=new Path2D},addPath:function(t,i,n,e,r,o,s){var a=this.T,h=a.addPath;t=t.T;const c=new DOMMatrix;c.a=i,c.b=n,c.c=e,c.d=r,c.e=o,c.f=s,h.call(a,t,c)},fillRule:function(t){this.Va=t},moveTo:function(t,i){this.T.moveTo(t,i)},lineTo:function(t,i){this.T.lineTo(t,i)},cubicTo:function(t,i,n,e,r,o){this.T.bezierCurveTo(t,i,n,e,r,o)},close:function(){this.T.closePath()}}),x=a.extend("CanvasRenderPaint",{color:function(t){this.Xa=i(t)},thickness:function(t){this.Ib=t},join:function(t){switch(t){case f.miter:this.Ia="miter";break;case f.round:this.Ia="round";break;case f.bevel:this.Ia="bevel"}},cap:function(t){switch(t){case d.butt:this.Ha="butt";break;case d.round:this.Ha="round";break;case d.square:this.Ha="square"}},style:function(t){this.Hb=t},blendMode:function(i){this.Eb=t(i)},clearGradient:function(){this.ja=null},linearGradient:function(t,i,n,e){this.ja={yb:t,zb:i,bb:n,cb:e,Ra:[]}},radialGradient:function(t,i,n,e){this.ja={yb:t,zb:i,bb:n,cb:e,Ra:[],ec:!0}},addStop:function(t,i){this.ja.Ra.push({color:t,stop:i})},completeGradient:function(){},draw:function(t,n,e){let r=this.Hb;var o=this.Xa,s=this.ja;if(t.globalCompositeOperation=this.Eb,null!=s){o=s.yb;var a=s.zb;const n=s.bb;var h=s.cb;const e=s.Ra;s.ec?(s=n-o,h-=a,o=t.createRadialGradient(o,a,0,o,a,Math.sqrt(s*s+h*h))):o=t.createLinearGradient(o,a,n,h);for(let t=0,n=e.length;t<n;t++)o.addColorStop((a=e[t]).stop,i(a.color));this.Xa=o,this.ja=null}switch(r){case w:t.strokeStyle=o,t.lineWidth=this.Ib,t.lineCap=this.Ha,t.lineJoin=this.Ia,t.stroke(n);break;case v:t.fillStyle=o,t.fill(n,e)}}});const k=new Set;let _=null,M=[],j=0,C=0;var T=r.CanvasRenderer=l.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,n,e,r,o){const s=this.S,a=s.length-6;s.splice(a,6,s[a]*t+s[a+2]*i,s[a+1]*t+s[a+3]*i,s[a]*n+s[a+2]*e,s[a+1]*n+s[a+3]*e,s[a]*r+s[a+2]*o+s[a+4],s[a+1]*r+s[a+3]*o+s[a+5]),this.H.push(this.C.transform.bind(this.C,t,i,n,e,r,o))},rotate:function(t){const i=Math.sin(t);t=Math.cos(t),this.transform(t,i,-i,t,0,0)},_drawPath:function(t,i){this.H.push(i.draw.bind(i,this.C,t.T,t.Va===m?"evenodd":"nonzero"))},_drawRiveImage:function(i,n,e){var r=i.Fb;if(r){var o=this.C,s=t(n);this.H.push((function(){o.globalCompositeOperation=s,o.globalAlpha=e,o.drawImage(r,0,0),o.globalAlpha=1}))}},_getMatrix:function(t){const i=this.S,n=i.length-6;for(let e=0;6>e;++e)t[e]=i[n+e]},_drawImageMesh:function(i,e,o,s,a,h,u,l,d,f){var p=this.C.canvas.width,v=this.C.canvas.height;const w=d-u,m=f-l;u=Math.max(u,0),l=Math.max(l,0),d=Math.min(d,p),f=Math.min(f,v);const b=d-u,g=f-l;if(console.assert(b<=Math.min(w,p)),console.assert(g<=Math.min(m,v)),!(0>=b||0>=g)){d=b<w||g<m,p=f=1;var y=Math.ceil(b*f),x=Math.ceil(g*p);v=c.hc(),y>v&&(f*=v/y,y=v),x>v&&(p*=v/x,x=v),_||(_=new r.DynamicRectanizer(v),_.reset(512,512)),0>(v=_.addRect(y,x))&&(n(),k.add(this),v=_.addRect(y,x),console.assert(0<=v));var T=65535&v,$=v>>16;M.push({ha:this.S.slice(this.S.length-6),image:i,Ya:T,Za:$,ic:u,jc:l,Ac:y,jb:x,Ba:f,Ca:p,Ta:new Float32Array(s),Db:new Float32Array(a),indices:new Uint16Array(h),mc:d,wb:i.Ka<<1|(d?1:0)}),j+=s.length,C+=h.length;var P=this.C,O=t(e);this.H.push((function(){P.save(),P.resetTransform(),P.globalCompositeOperation=O,P.globalAlpha=o;const t=c.canvas();t&&P.drawImage(t,T,$,y,x,u,l,b,g),P.restore()}))}},_clipPath:function(t){this.H.push(this.C.clip.bind(this.C,t.T,t.Va===m?"evenodd":"nonzero"))},clear:function(){k.add(this),this.H.push(this.C.clearRect.bind(this.C,0,0,this.Ua.width,this.Ua.height))},flush:function(){},translate:function(t,i){this.transform(1,0,0,1,t,i)}});r.makeRenderer=function(t){const i=new T(t),n=i.C;return new Proxy(i,{get(t,e){if("function"==typeof t[e])return function(...i){return t[e].apply(t,i)};if("function"==typeof n[e]){if(-1<h.indexOf(e))throw Error("RiveException: Method call to '"+e+"()' 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(n[e].bind(n,...t))}}return t[e]},set(t,e,r){if(e in n)return i.H.push((()=>{n[e]=r})),!0}})},r.decodeImage=function(t,i){new g({la:i}).decode(t)},r.renderFactory={makeRenderPaint:function(){return new x},makeRenderPath:function(){return new y},makeRenderImage:function(){let t=P;return new g({xa:()=>{t.total++},la:()=>{if(t.loaded++,t.loaded===t.total){const i=t.ready;i&&(i(),t.ready=null)}}})}};let $=r.load,P=null;r.load=function(t,i,n=!0){const e=new r.FallbackFileAssetLoader;return void 0!==i&&e.addLoader(i),n&&(i=new r.CDNFileAssetLoader,e.addLoader(i)),new Promise((function(i){let n=null;P={total:0,loaded:0,ready:function(){i(n)}},n=$(t,e),0==P.total&&i(n)}))};let O=r.RendererWrapper.prototype.align;r.RendererWrapper.prototype.align=function(t,i,n,e,r=1){O.call(this,t,i,n,e,r)},e=new o,r.requestAnimationFrame=e.requestAnimationFrame.bind(e),r.cancelAnimationFrame=e.cancelAnimationFrame.bind(e),r.enableFPSCounter=e.Rb.bind(e),r.disableFPSCounter=e.Ob,e.ob=n,r.resolveAnimationFrame=n,r.cleanup=function(){_&&_.delete()}};var l,d,f=Object.assign({},r),p="./this.program",v="object"==typeof window,w="function"==typeof importScripts,m="";(v||w)&&(w?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=0!==m.indexOf("blob:")?m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w&&(d=t=>{var i=new XMLHttpRequest;return i.open("GET",t,!1),i.responseType="arraybuffer",i.send(null),new Uint8Array(i.response)}),l=(t,i,n)=>{var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{200==e.status||0==e.status&&e.response?i(e.response):n()},e.onerror=n,e.send(null)});var b,g=r.print||console.log.bind(console),y=r.printErr||console.error.bind(console);Object.assign(r,f),f=null,r.thisProgram&&(p=r.thisProgram),r.wasmBinary&&(b=r.wasmBinary),"object"!=typeof WebAssembly&&X("no native wasm support detected");var x,k,_,M,j,C,T,$,P,O,A=!1;function E(){var t=x.buffer;r.HEAP8=_=new Int8Array(t),r.HEAP16=j=new Int16Array(t),r.HEAP32=T=new Int32Array(t),r.HEAPU8=M=new Uint8Array(t),r.HEAPU16=C=new Uint16Array(t),r.HEAPU32=$=new Uint32Array(t),r.HEAPF32=P=new Float32Array(t),r.HEAPF64=O=new Float64Array(t)}var S,D=[],I=[],z=[];function F(){var t=r.preRun.shift();D.unshift(t)}var L,R=0,W=null;function X(t){throw r.onAbort&&r.onAbort(t),y(t="Aborted("+t+")"),A=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),n(t),t}function U(t){return t.startsWith("data:application/octet-stream;base64,")}if(!U(L="canvas_advanced.wasm")){var N=L;L=r.locateFile?r.locateFile(N,m):m+N}function Y(t){if(t==L&&b)return new Uint8Array(b);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}function B(t,i,n){return function(t){if(!b&&(v||w)){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((()=>Y(t)));if(l)return new Promise(((i,n)=>{l(t,(t=>i(new Uint8Array(t))),n)}))}return Promise.resolve().then((()=>Y(t)))}(t).then((t=>WebAssembly.instantiate(t,i))).then((t=>t)).then(n,(t=>{y("failed to asynchronously prepare wasm: "+t),X(t)}))}var H,G,V={446236:(t,i,n,e,r)=>{if("undefined"==typeof window||void 0===(window.AudioContext||window.webkitAudioContext))return 0;if(void 0===window.h){window.h={Aa:0},window.h.I={},window.h.I.ya=t,window.h.I.capture=i,window.h.I.La=n,window.h.ga={},window.h.ga.stopped=e,window.h.ga.xb=r;let o=window.h;o.D=[],o.yc=function(t){for(var i=0;i<o.D.length;++i)if(null==o.D[i])return o.D[i]=t,i;return o.D.push(t),o.D.length-1},o.Cb=function(t){for(o.D[t]=null;0<o.D.length&&null==o.D[o.D.length-1];)o.D.pop()},o.Sc=function(t){for(var i=0;i<o.D.length;++i)if(o.D[i]==t)return o.Cb(i)},o.ra=function(t){return o.D[t]},o.Bb=["touchend","click"],o.unlock=function(){for(var t=0;t<o.D.length;++t){var i=o.D[t];null!=i&&null!=i.J&&i.state===o.ga.xb&&i.J.resume().then((()=>{Pn(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,n,e,r,o)=>{if(void 0===window.h)return-1;var s={},a={};return t==window.h.I.ya&&0!=n&&(a.sampleRate=n),s.J=new(window.AudioContext||window.webkitAudioContext)(a),s.J.suspend(),s.state=window.h.ga.stopped,n=0,t!=window.h.I.ya&&(n=i),s.Z=s.J.createScriptProcessor(e,n,i),s.Z.onaudioprocess=function(n){if(null!=s.sa&&0!=s.sa.length||(s.sa=new Float32Array(P.buffer,r,e*i)),t==window.h.I.capture||t==window.h.I.La){for(var a=0;a<i;a+=1)for(var h=n.inputBuffer.getChannelData(a),c=s.sa,u=0;u<e;u+=1)c[u*i+a]=h[u];An(o,e,r)}if(t==window.h.I.ya||t==window.h.I.La)for(En(o,e,r),a=0;a<n.outputBuffer.numberOfChannels;++a)for(h=n.outputBuffer.getChannelData(a),c=s.sa,u=0;u<e;u+=1)h[u]=c[u*i+a];else for(a=0;a<n.outputBuffer.numberOfChannels;++a)n.outputBuffer.getChannelData(a).fill(0)},t!=window.h.I.capture&&t!=window.h.I.La||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(t){s.Da=s.J.createMediaStreamSource(t),s.Da.connect(s.Z),s.Z.connect(s.J.destination)})).catch((function(t){console.log("Failed to get user media: "+t)})),t==window.h.I.ya&&s.Z.connect(s.J.destination),s.pb=o,window.h.yc(s)},451730:t=>window.h.ra(t).J.sampleRate,451803:t=>{void 0!==(t=window.h.ra(t)).Z&&(t.Z.onaudioprocess=function(){},t.Z.disconnect(),t.Z=void 0),void 0!==t.Da&&(t.Da.disconnect(),t.Da=void 0),t.J.close(),t.J=void 0,t.pb=void 0},452203:t=>{window.h.Cb(t)},452253:t=>{(t=window.h.ra(t)).J.resume(),t.state=window.h.ga.xb},452392:t=>{(t=window.h.ra(t)).J.suspend(),t.state=window.h.ga.stopped}},q=t=>{for(;0<t.length;)t.shift()(r)},K=(t,i)=>{for(var n=0,e=t.length-1;0<=e;e--){var r=t[e];"."===r?t.splice(e,1):".."===r?(t.splice(e,1),n++):n&&(t.splice(e,1),n--)}if(i)for(;n;n--)t.unshift("..");return t},J=t=>{var i="/"===t.charAt(0),n="/"===t.substr(-1);return(t=K(t.split("/").filter((t=>!!t)),!i).join("/"))||i||(t="."),t&&n&&(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);X("initRandomDevice")})())(t);function it(){for(var t="",i=!1,n=arguments.length-1;-1<=n&&!i;n--){if("string"!=typeof(i=0<=n?arguments[n]:"/"))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 nt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,et=(t,i,n)=>{var e=i+n;for(n=i;t[n]&&!(n>=e);)++n;if(16<n-i&&t.buffer&&nt)return nt.decode(t.subarray(i,n));for(e="";i<n;){var r=t[i++];if(128&r){var o=63&t[i++];if(192==(224&r))e+=String.fromCharCode((31&r)<<6|o);else{var s=63&t[i++];65536>(r=224==(240&r)?(15&r)<<12|o<<6|s:(7&r)<<18|o<<12|s<<6|63&t[i++])?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r))}}else e+=String.fromCharCode(r)}return e},rt=[],ot=t=>{for(var i=0,n=0;n<t.length;++n){var e=t.charCodeAt(n);127>=e?i++:2047>=e?i+=2:55296<=e&&57343>=e?(i+=4,++n):i+=3}return i},st=(t,i,n,e)=>{if(!(0<e))return 0;var r=n;e=n+e-1;for(var o=0;o<t.length;++o){var s=t.charCodeAt(o);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o)),127>=s){if(n>=e)break;i[n++]=s}else{if(2047>=s){if(n+1>=e)break;i[n++]=192|s>>6}else{if(65535>=s){if(n+2>=e)break;i[n++]=224|s>>12}else{if(n+3>=e)break;i[n++]=240|s>>18,i[n++]=128|s>>12&63}i[n++]=128|s>>6&63}i[n++]=128|63&s}}return i[n]=0,n-r};function at(t,i){var n=Array(ot(t)+1);return t=st(t,n,0,n.length),i&&(n.length=t),n}var ht=[];function ct(t,i){ht[t]={input:[],F:[],V:i},Lt(t,ut)}var ut={open:function(t){var i=ht[t.node.za];if(!i)throw new jt(43);t.s=i,t.seekable=!1},close:function(t){t.s.V.qa(t.s)},qa:function(t){t.s.V.qa(t.s)},read:function(t,i,n,e){if(!t.s||!t.s.V.ib)throw new jt(60);for(var r=0,o=0;o<e;o++){try{var s=t.s.V.ib(t.s)}catch(t){throw new jt(29)}if(void 0===s&&0===r)throw new jt(6);if(null==s)break;r++,i[n+o]=s}return r&&(t.node.timestamp=Date.now()),r},write:function(t,i,n,e){if(!t.s||!t.s.V.Oa)throw new jt(60);try{for(var r=0;r<e;r++)t.s.V.Oa(t.s,i[n+r])}catch(t){throw new jt(29)}return e&&(t.node.timestamp=Date.now()),r}},lt={ib:function(){t:{if(!rt.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t){t=null;break t}rt=at(t,!0)}t=rt.shift()}return t},Oa:function(t,i){null===i||10===i?(g(et(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(g(et(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(et(t.F,0)),t.F=[]):0!=i&&t.F.push(i)},qa:function(t){t.F&&0<t.F.length&&(y(et(t.F,0)),t.F=[])}};function ft(t,i){var n=t.j?t.j.length:0;n>=i||(i=Math.max(i,n*(1048576>n?2:1.125)>>>0),0!=n&&(i=Math.max(i,256)),n=t.j,t.j=new Uint8Array(i),0<t.v&&t.j.set(n.subarray(0,t.v),0))}var pt,vt,wt,mt,bt={O:null,U:()=>bt.createNode(null,"/",16895,0),createNode(t,i,n,e){if(24576==(61440&n)||4096==(61440&n))throw new jt(63);return bt.O||(bt.O={dir:{node:{Y:bt.l.Y,P:bt.l.P,ka:bt.l.ka,va:bt.l.va,ub:bt.l.ub,Ab:bt.l.Ab,vb:bt.l.vb,sb:bt.l.sb,Ea:bt.l.Ea},stream:{ba:bt.m.ba}},file:{node:{Y:bt.l.Y,P:bt.l.P},stream:{ba:bt.m.ba,read:bt.m.read,write:bt.m.write,pa:bt.m.pa,lb:bt.m.lb,nb:bt.m.nb}},link:{node:{Y:bt.l.Y,P:bt.l.P,ma:bt.l.ma},stream:{}},$a:{node:{Y:bt.l.Y,P:bt.l.P},stream:Ft}}),16384==(61440&(n=At(t,i,n,e)).mode)?(n.l=bt.O.dir.node,n.m=bt.O.dir.stream,n.j={}):32768==(61440&n.mode)?(n.l=bt.O.file.node,n.m=bt.O.file.stream,n.v=0,n.j=null):40960==(61440&n.mode)?(n.l=bt.O.link.node,n.m=bt.O.link.stream):8192==(61440&n.mode)&&(n.l=bt.O.$a.node,n.m=bt.O.$a.stream),n.timestamp=Date.now(),t&&(t.j[i]=n,t.timestamp=n.timestamp),n},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 n=t.j;t.j=new Uint8Array(i),n&&t.j.set(n.subarray(0,Math.min(i,t.v))),t.v=i}},ka(){throw Ct[44]},va:(t,i,n,e)=>bt.createNode(t,i,n,e),ub(t,i,n){if(16384==(61440&t.mode)){try{var e=Ot(i,n)}catch(t){}if(e)for(var r in e.j)throw new jt(55)}delete t.parent.j[t.name],t.parent.timestamp=Date.now(),t.name=n,i.j[n]=t,i.timestamp=t.parent.timestamp,t.parent=i},Ab(t,i){delete t.j[i],t.timestamp=Date.now()},vb(t,i){var n,e=Ot(t,i);for(n in e.j)throw new jt(55);delete t.j[i],t.timestamp=Date.now()},sb(t){var i,n=[".",".."];for(i in t.j)t.j.hasOwnProperty(i)&&n.push(i);return n},Ea:(t,i,n)=>((t=bt.createNode(t,i,41471,0)).link=n,t),ma(t){if(40960!=(61440&t.mode))throw new jt(28);return t.link}},m:{read(t,i,n,e,r){var o=t.node.j;if(r>=t.node.v)return 0;if(8<(t=Math.min(t.node.v-r,e))&&o.subarray)i.set(o.subarray(r,r+t),n);else for(e=0;e<t;e++)i[n+e]=o[r+e];return t},write(t,i,n,e,r,o){if(i.buffer===_.buffer&&(o=!1),!e)return 0;if((t=t.node).timestamp=Date.now(),i.subarray&&(!t.j||t.j.subarray)){if(o)return t.j=i.subarray(n,n+e),t.v=e;if(0===t.v&&0===r)return t.j=i.slice(n,n+e),t.v=e;if(r+e<=t.v)return t.j.set(i.subarray(n,n+e),r),e}if(ft(t,r+e),t.j.subarray&&i.subarray)t.j.set(i.subarray(n,n+e),r);else for(o=0;o<e;o++)t.j[r+o]=i[n+o];return t.v=Math.max(t.v,r+e),e},ba(t,i,n){if(1===n?i+=t.position:2===n&&32768==(61440&t.node.mode)&&(i+=t.node.v),0>i)throw new jt(28);return i},pa(t,i,n){ft(t.node,i+n),t.node.v=Math.max(t.node.v,i+n)},lb(t,i,n,e,r){if(32768!=(61440&t.node.mode))throw new jt(43);if(t=t.node.j,2&r||t.buffer!==_.buffer){if((0<n||n+i<t.length)&&(t=t.subarray?t.subarray(n,n+i):Array.prototype.slice.call(t,n,n+i)),n=!0,X(),!(i=void 0))throw new jt(48);_.set(t,i)}else n=!1,i=t.byteOffset;return{o:i,M:n}},nb:(t,i,n,e)=>(bt.m.write(t,i,0,e,n,!1),0)}},gt=null,yt={},xt=[],kt=1,_t=null,Mt=!0,jt=null,Ct={},Tt=(t,i={})=>{if(!(t=it(t)))return{path:"",node:null};if(8<(i=Object.assign({gb:!0,Qa:0},i)).Qa)throw new jt(32);t=t.split("/").filter((t=>!!t));for(var n=gt,e="/",r=0;r<t.length;r++){var o=r===t.length-1;if(o&&i.parent)break;if(n=Ot(n,t[r]),e=J(e+"/"+t[r]),n.wa&&(!o||o&&i.gb)&&(n=n.wa.root),!o||i.fb)for(o=0;40960==(61440&n.mode);)if(n=Nt(e),e=it(Q(e),n),n=Tt(e,{Qa:i.Qa+1}).node,40<o++)throw new jt(32)}return{path:e,node:n}},$t=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}},Pt=(t,i)=>{for(var n=0,e=0;e<i.length;e++)n=(n<<5)-n+i.charCodeAt(e)|0;return(t+n>>>0)%_t.length},Ot=(t,i)=>{var n;if(n=(n=St(t,"x"))?n:t.l.ka?0:2)throw new jt(n,t);for(n=_t[Pt(t.id,i)];n;n=n.lc)if(n.parent.id===t.id&&n.name===i)return n;return t.l.ka(t,i)},At=(t,i,n,e)=>(t=new _n(t,i,n,e),i=Pt(t.parent.id,t.name),t.lc=_t[i],_t[i]=t),Et=t=>{var i=["r","w","rw"][3&t];return 512&t&&(i+="w"),i},St=(t,i)=>Mt?0:!i.includes("r")||292&t.mode?i.includes("w")&&!(146&t.mode)||i.includes("x")&&!(73&t.mode)?2:0:2,Dt=(t,i)=>{try{return Ot(t,i),20}catch(t){}return St(t,"wx")},It=t=>{if(!(t=xt[t]))throw new jt(8);return t},zt=(t,i=-1)=>(wt||((wt=function(){this.h={}}).prototype={},Object.defineProperties(wt.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 wt,t),-1==i&&(i=(()=>{for(var t=0;4096>=t;t++)if(!xt[t])return t;throw new jt(33)})()),t.X=i,xt[i]=t),Ft={open:t=>{t.m=yt[t.node.za].m,t.m.open&&t.m.open(t)},ba:()=>{throw new jt(70)}},Lt=(t,i)=>{yt[t]={m:i}},Rt=(t,i)=>{var n="/"===i,e=!i;if(n&&gt)throw new jt(10);if(!n&&!e){var r=Tt(i,{gb:!1});if(i=r.path,(r=r.node).wa)throw new jt(10);if(16384!=(61440&r.mode))throw new jt(54)}(t=t.U(i={type:t,Qc:{},mb:i,kc:[]})).U=i,i.root=t,n?gt=t:r&&(r.wa=i,r.U&&r.U.kc.push(i))},Wt=(t,i,n)=>{var e=Tt(t,{parent:!0}).node;if(!(t=Z(t))||"."===t||".."===t)throw new jt(28);var r=Dt(e,t);if(r)throw new jt(r);if(!e.l.va)throw new jt(63);return e.l.va(e,t,i,n)},Xt=(t,i,n)=>{void 0===n&&(n=i,i=438),Wt(t,8192|i,n)},Ut=(t,i)=>{if(!it(t))throw new jt(44);var n=Tt(i,{parent:!0}).node;if(!n)throw new jt(44);i=Z(i);var e=Dt(n,i);if(e)throw new jt(e);if(!n.l.Ea)throw new jt(63);n.l.Ea(n,i,t)},Nt=t=>{if(!(t=Tt(t).node))throw new jt(44);if(!t.l.ma)throw new jt(28);return it($t(t.parent),t.l.ma(t))},Yt=(t,i,n)=>{if(""===t)throw new jt(44);if("string"==typeof i){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[i];if(void 0===e)throw Error(`Unknown file open mode: ${i}`);i=e}if(n=64&i?4095&(void 0===n?438:n)|32768:0,"object"==typeof t)var o=t;else{t=J(t);try{o=Tt(t,{fb:!(131072&i)}).node}catch(t){}}if(e=!1,64&i)if(o){if(128&i)throw new jt(20)}else o=Wt(t,n,0),e=!0;if(!o)throw new jt(44);if(8192==(61440&o.mode)&&(i&=-513),65536&i&&16384!=(61440&o.mode))throw new jt(54);if(!e&&(n=o?40960==(61440&o.mode)?32:16384==(61440&o.mode)&&("r"!==Et(i)||512&i)?31:St(o,Et(i)):44))throw new jt(n);if(512&i&&!e){if(!(n="string"==typeof(n=o)?Tt(n,{fb:!0}).node:n).l.P)throw new jt(63);if(16384==(61440&n.mode))throw new jt(31);if(32768!=(61440&n.mode))throw new jt(28);if(e=St(n,"w"))throw new jt(e);n.l.P(n,{size:0,timestamp:Date.now()})}return i&=-131713,(o=zt({node:o,path:$t(o),flags:i,seekable:!0,position:0,m:o.m,zc:[],error:!1})).m.open&&o.m.open(o),!r.logReadFiles||1&i||(mt||(mt={}),t in mt||(mt[t]=1)),o},Bt=(t,i,n)=>{if(null===t.X)throw new jt(8);if(!t.seekable||!t.m.ba)throw new jt(70);if(0!=n&&1!=n&&2!=n)throw new jt(28);t.position=t.m.ba(t,i,n),t.zc=[]},Ht=()=>{jt||((jt=function(t,i){this.name="ErrnoError",this.node=i,this.pc=function(t){this.aa=t},this.pc(t),this.message="FS error"}).prototype=Error(),jt.prototype.constructor=jt,[44].forEach((t=>{Ct[t]=new jt(t),Ct[t].stack="<generic error, no stack>"})))},Gt=(t,i,n)=>{t=J("/dev/"+t);var e=function(t,i){var n=0;return t&&(n|=365),i&&(n|=146),n}(!!i,!!n);vt||(vt=64);var r=vt++<<8;Lt(r,{open:t=>{t.seekable=!1},close:()=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(t,n,e,r)=>{for(var o=0,s=0;s<r;s++){try{var a=i()}catch(t){throw new jt(29)}if(void 0===a&&0===o)throw new jt(6);if(null==a)break;o++,n[e+s]=a}return o&&(t.node.timestamp=Date.now()),o},write:(t,i,e,r)=>{for(var o=0;o<r;o++)try{n(i[e+o])}catch(t){throw new jt(29)}return r&&(t.node.timestamp=Date.now()),o}}),Xt(t,e,r)},Vt={},qt=void 0;function Kt(){return T[(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 ni(t){throw new ii(t)}var ei=t=>(t||ni("Cannot use deleted val. handle = "+t),ti.get(t).value),ri=t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return ti.pa({tb:1,value:t})}};function oi(t){var i=Error,n=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 n.prototype=Object.create(i.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},n}var si=void 0,ai=void 0;function hi(t){for(var i="";M[t];)i+=ai[M[t++]];return i}var ci=[];function ui(){for(;ci.length;){var t=ci.pop();t.g.fa=!1,t.delete()}}var li=void 0,di={};function fi(t,i){for(void 0===i&&ni("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=Dn(t));return Tn(t),i}function wi(t,i){var n=pi[t];return void 0===n&&ni(i+" has unknown type "+vi(t)),n}function mi(){}var bi=!1;function gi(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,n){return i===n?t:void 0===n.A||null===(t=yi(t,i,n.A))?null:n.Pb(t)}var xi={},ki=void 0;function _i(t){throw new ki(t)}function Mi(t,i){return i.u&&i.o||_i("makeClassHandle requires ptr and ptrType"),!!i.L!=!!i.G&&_i("Both smartPtrType and smartPtr must be specified"),i.count={value:1},ji(Object.create(t,{g:{value:i}}))}function ji(t){return"undefined"==typeof FinalizationRegistry?(ji=t=>t,t):(bi=new FinalizationRegistry((t=>{gi(t.g)})),mi=t=>{bi.unregister(t)},(ji=t=>{var i=t.g;return i.G&&bi.register(t,{g:i},t),t})(t))}var Ci={};function Ti(t){for(;t.length;){var i=t.pop();t.pop()(i)}}function $i(t){return this.fromWireType(T[t>>2])}var Pi={},Oi={};function Ai(t,i,n){function e(i){(i=n(i)).length!==t.length&&_i("Mismatched type converter count");for(var e=0;e<t.length;++e)Si(t[e],i[e])}t.forEach((function(t){Oi[t]=i}));var r=Array(i.length),o=[],s=0;i.forEach(((t,i)=>{pi.hasOwnProperty(t)?r[i]=pi[t]:(o.push(t),Pi.hasOwnProperty(t)||(Pi[t]=[]),Pi[t].push((()=>{r[i]=pi[t],++s===o.length&&e(r)})))})),0===o.length&&e(r)}function Ei(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 Si(t,i,n={}){if(!("argPackAdvance"in i))throw new TypeError("registerType registeredInstance requires argPackAdvance");!function(t,i,n={}){var e=i.name;if(t||ni(`type "${e}" must have a positive integer typeid pointer`),pi.hasOwnProperty(t)){if(n.$b)return;ni(`Cannot register type '${e}' twice`)}pi[t]=i,delete Oi[t],Pi.hasOwnProperty(t)&&(i=Pi[t],delete Pi[t],i.forEach((t=>t())))}(t,i,n)}function Di(t){ni(t.g.u.i.name+" instance already deleted")}function Ii(){}function zi(t,i,n){if(void 0===t[i].B){var e=t[i];t[i]=function(){return t[i].B.hasOwnProperty(arguments.length)||ni(`Function '${n}' 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[e.ea]=e}}function Fi(t,i,n){r.hasOwnProperty(t)?((void 0===n||void 0!==r[t].B&&void 0!==r[t].B[n])&&ni(`Cannot register public name '${t}' twice`),zi(r,t,t),r.hasOwnProperty(n)&&ni(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),r[t].B[n]=i):(r[t]=i,void 0!==n&&(r[t].Pc=n))}function Li(t,i,n,e,r,o,s,a){this.name=t,this.constructor=i,this.N=n,this.W=e,this.A=r,this.Ub=o,this.na=s,this.Pb=a,this.qb=[]}function Ri(t,i,n){for(;i!==n;)i.na||ni(`Expected null or instance of ${n.name}, got an instance of ${i.name}`),t=i.na(t),i=i.A;return t}function Wi(t,i){return null===i?(this.Na&&ni(`null is not a valid ${this.name}`),0):(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),Ri(i.g.o,i.g.u.i,this.i))}function Xi(t,i){if(null===i){if(this.Na&&ni(`null is not a valid ${this.name}`),this.ua){var n=this.Pa();return null!==t&&t.push(this.W,n),n}return 0}if(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.ta&&i.g.u.ta&&ni(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`),n=Ri(i.g.o,i.g.u.i,this.i),this.ua)switch(void 0===i.g.G&&ni("Passing raw pointer to smart pointer is illegal"),this.tc){case 0:i.g.L===this?n=i.g.G:ni(`Cannot convert argument of type ${i.g.L?i.g.L.name:i.g.u.name} to parameter type ${this.name}`);break;case 1:n=i.g.G;break;case 2:if(i.g.L===this)n=i.g.G;else{var e=i.clone();n=this.oc(n,ri((function(){e.delete()}))),null!==t&&t.push(this.W,n)}break;default:ni("Unsupporting sharing policy")}return n}function Ui(t,i){return null===i?(this.Na&&ni(`null is not a valid ${this.name}`),0):(i.g||ni(`Cannot pass "${nn(i)}" as a ${this.name}`),i.g.o||ni(`Cannot pass deleted object as a pointer of type ${this.name}`),i.g.u.ta&&ni(`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 Ni(t,i,n,e){this.name=t,this.i=i,this.Na=n,this.ta=e,this.ua=!1,this.W=this.oc=this.Pa=this.rb=this.tc=this.nc=void 0,void 0!==i.A?this.toWireType=Xi:(this.toWireType=e?Wi:Ui,this.K=null)}function Yi(t,i,n){r.hasOwnProperty(t)||_i("Replacing nonexistant public symbol"),void 0!==r[t].B&&void 0!==n?r[t].B[n]=i:(r[t]=i,r[t].ea=n)}var Bi=[],Hi=t=>{var i=Bi[t];return i||(t>=Bi.length&&(Bi.length=t+1),Bi[t]=i=S.get(t)),i};function Gi(t,i){var n=(t=hi(t)).includes("j")?((t,i)=>{var n=[];return function(){if(n.length=0,Object.assign(n,arguments),t.includes("j")){var e=r["dynCall_"+t];e=n&&n.length?e.apply(null,[i].concat(n)):e.call(null,i)}else e=Hi(i).apply(null,n);return e}})(t,i):Hi(i);return"function"!=typeof n&&ni(`unknown function pointer with signature ${t}: ${i}`),n}var Vi=void 0;function qi(t,i){var n=[],e={};throw i.forEach((function t(i){e[i]||pi[i]||(Oi[i]?Oi[i].forEach(t):(n.push(i),e[i]=!0))})),new Vi(`${t}: `+n.map(vi).join([", "]))}function Ki(t,i,n,e,r){var o=i.length;2>o&&ni("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==i[1]&&null!==n,a=!1;for(n=1;n<i.length;++n)if(null!==i[n]&&void 0===i[n].K){a=!0;break}var h="void"!==i[0].name,c=o-2,u=Array(c),l=[],d=[];return function(){if(arguments.length!==c&&ni(`function ${t} called with ${arguments.length} arguments, expected ${c} args!`),d.length=0,l.length=s?2:1,l[0]=r,s){var n=i[1].toWireType(d,this);l[1]=n}for(var o=0;o<c;++o)u[o]=i[o+2].toWireType(d,arguments[o]),l.push(u[o]);if(o=e.apply(null,l),a)Ti(d);else for(var f=s?1:2;f<i.length;f++)null!==i[f].K&&i[f].K(1===f?n:u[f-2]);return h?i[0].fromWireType(o):void 0}}function Ji(t,i){for(var n=[],e=0;e<t;e++)n.push($[i+4*e>>2]);return n}function Qi(t,i,n){return t instanceof Object||ni(`${n} with invalid "this": ${t}`),t instanceof i.i.constructor||ni(`${n} incompatible with "this" of type ${t.constructor.name}`),t.g.o||ni(`cannot call emscripten binding method ${n} 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 tn(t,i,n){switch(i){case 0:return function(t){return this.fromWireType((n?_:M)[t])};case 1:return function(t){return this.fromWireType((n?j:C)[t>>1])};case 2:return function(t){return this.fromWireType((n?T:$)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function nn(t){if(null===t)return"null";var i=typeof t;return"object"===i||"array"===i||"function"===i?t.toString():""+t}function en(t,i){switch(i){case 2:return function(t){return this.fromWireType(P[t>>2])};case 3:return function(t){return this.fromWireType(O[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function rn(t,i,n){switch(i){case 0:return n?function(t){return _[t]}:function(t){return M[t]};case 1:return n?function(t){return j[t>>1]}:function(t){return C[t>>1]};case 2:return n?function(t){return T[t>>2]}:function(t){return $[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var on="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,sn=(t,i)=>{for(var n=t>>1,e=n+i/2;!(n>=e)&&C[n];)++n;if(32<(n<<=1)-t&&on)return on.decode(M.subarray(t,n));for(n="",e=0;!(e>=i/2);++e){var r=j[t+2*e>>1];if(0==r)break;n+=String.fromCharCode(r)}return n},an=(t,i,n)=>{if(void 0===n&&(n=2147483647),2>n)return 0;var e=i;n=(n-=2)<2*t.length?n/2:t.length;for(var r=0;r<n;++r)j[i>>1]=t.charCodeAt(r),i+=2;return j[i>>1]=0,i-e},hn=t=>2*t.length,cn=(t,i)=>{for(var n=0,e="";!(n>=i/4);){var r=T[t+4*n>>2];if(0==r)break;++n,65536<=r?(r-=65536,e+=String.fromCharCode(55296|r>>10,56320|1023&r)):e+=String.fromCharCode(r)}return e},un=(t,i,n)=>{if(void 0===n&&(n=2147483647),4>n)return 0;var e=i;n=e+n-4;for(var r=0;r<t.length;++r){var o=t.charCodeAt(r);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++r)),T[i>>2]=o,(i+=4)+4>n)break}return T[i>>2]=0,i-e},ln=t=>{for(var i=0,n=0;n<t.length;++n){var e=t.charCodeAt(n);55296<=e&&57343>=e&&++n,i+=4}return i},dn={};function fn(t){var i=dn[t];return void 0===i?hi(t):i}var pn,vn=[],wn=[],mn=[],bn={},gn=()=>{if(!pn){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 bn)void 0===bn[t]?delete i[t]:i[t]=bn[t];var n=[];for(t in i)n.push(`${t}=${i[t]}`);pn=n}return pn},yn=t=>0==t%4&&(0!=t%100||0==t%400),xn=[31,29,31,30,31,30,31,31,30,31,30,31],kn=[31,28,31,30,31,30,31,31,30,31,30,31];function _n(t,i,n,e){t||(t=this),this.parent=t,this.U=t.U,this.wa=null,this.id=kt++,this.name=i,this.mode=n,this.l={},this.m={},this.za=e}Object.defineProperties(_n.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(bt,"/"),Wt("/tmp",16895,0),Wt("/home",16895,0),Wt("/home/web_user",16895,0),(()=>{Wt("/dev",16895,0),Lt(259,{read:()=>0,write:(t,i,n,e)=>e}),Xt("/dev/null",259),ct(1280,lt),ct(1536,dt),Xt("/dev/tty",1280),Xt("/dev/tty1",1536);var t=new Uint8Array(1024),i=0,n=()=>(0===i&&(i=tt(t).byteLength),t[--i]);Gt("random",n),Gt("urandom",n),Wt("/dev/shm",16895,0),Wt("/dev/shm/tmp",16895,0)})(),(()=>{Wt("/proc",16895,0);var t=Wt("/proc/self",16895,0);Wt("/proc/self/fd",16895,0),Rt({U:()=>{var i=At(t,"fd",16895,73);return i.l={ka:(t,i)=>{var n=It(+i);return(t={parent:null,U:{mb:"fake"},l:{ma:()=>n.path}}).parent=t}},i}},"/proc/self/fd")})(),Object.assign(Zt.prototype,{get(t){return this.M[t]},has(t){return void 0!==this.M[t]},pa(t){var i=this.hb.pop()||this.M.length;return this.M[i]=t,i},Zb(t){this.M[t]=void 0,this.hb.push(t)}}),ii=r.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ti.M.push({value:void 0},{value:null},{value:!0},{value:!1}),ti.h=ti.M.length,r.count_emval_handles=function(){for(var t=0,i=ti.h;i<ti.M.length;++i)void 0!==ti.M[i]&&++t;return t},si=r.PureVirtualError=oi("PureVirtualError");for(var Mn=Array(256),jn=0;256>jn;++jn)Mn[jn]=String.fromCharCode(jn);ai=Mn,r.getInheritedInstanceCount=function(){return Object.keys(di).length},r.getLiveInheritedInstances=function(){var t,i=[];for(t in di)di.hasOwnProperty(t)&&i.push(di[t]);return i},r.flushPendingDeletes=ui,r.setDelayFunction=function(t){li=t,ci.length&&li&&li(ui)},ki=r.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ii.prototype.isAliasOf=function(t){if(!(this instanceof Ii&&t instanceof Ii))return!1;var i=this.g.u.i,n=this.g.o,e=t.g.u.i;for(t=t.g.o;i.A;)n=i.na(n),i=i.A;for(;e.A;)t=e.na(t),e=e.A;return i===e&&n===t},Ii.prototype.clone=function(){if(this.g.o||Di(this),this.g.ia)return this.g.count.value+=1,this;var t=ji,i=Object,n=i.create,e=Object.getPrototypeOf(this),r=this.g;return(t=t(n.call(i,e,{g:{value:{count:r.count,fa:r.fa,ia:r.ia,o:r.o,u:r.u,G:r.G,L:r.L}}}))).g.count.value+=1,t.g.fa=!1,t},Ii.prototype.delete=function(){this.g.o||Di(this),this.g.fa&&!this.g.ia&&ni("Object already scheduled for deletion"),mi(this),gi(this.g),this.g.ia||(this.g.G=void 0,this.g.o=void 0)},Ii.prototype.isDeleted=function(){return!this.g.o},Ii.prototype.deleteLater=function(){return this.g.o||Di(this),this.g.fa&&!this.g.ia&&ni("Object already scheduled for deletion"),ci.push(this),1===ci.length&&li&&li(ui),this.g.fa=!0,this},Ni.prototype.Vb=function(t){return this.rb&&(t=this.rb(t)),t},Ni.prototype.ab=function(t){this.W&&this.W(t)},Ni.prototype.argPackAdvance=8,Ni.prototype.readValueFromPointer=$i,Ni.prototype.deleteObject=function(t){null!==t&&t.delete()},Ni.prototype.fromWireType=function(t){function i(){return Mi(this.i.N,this.ua?{u:this.nc,o:n,L:this,G:t}:{u:this,o:t})}var n=this.Vb(t);if(!n)return this.ab(t),null;var e=function(t,i){return i=fi(t,i),di[i]}(this.i,n);if(void 0!==e)return 0===e.g.count.value?(e.g.o=n,e.g.G=t,e.clone()):(e=e.clone(),this.ab(t),e);if(e=this.i.Ub(n),!(e=xi[e]))return i.call(this);var r=yi(n,this.i,(e=this.ta?e.Kb:e.pointerType).i);return null===r?i.call(this):Mi(e.i.N,this.ua?{u:e,o:r,L:this,G:t}:{u:e,o:r})},Vi=r.UnboundTypeError=oi("UnboundTypeError");var Cn={__syscall_fcntl64:function(t,i,n){qt=n;try{var e=It(t);switch(i){case 0:var r=Kt();return 0>r?-28:zt(e,r).X;case 1:case 2:case 6:case 7:return 0;case 3:return e.flags;case 4:return r=Kt(),e.flags|=r,0;case 5:return r=Kt(),j[r+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return T[Sn()>>2]=28,-1}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_ioctl:function(t,i,n){qt=n;try{var e=It(t);switch(i){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return e.s?0:-59;case 21505:if(!e.s)return-59;if(e.s.V.bc){i=[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var r=Kt();T[r>>2]=25856,T[r+4>>2]=5,T[r+8>>2]=191,T[r+12>>2]=35387;for(var o=0;32>o;o++)_[r+o+17|0]=i[o]||0}return 0;case 21506:case 21507:case 21508:if(!e.s)return-59;if(e.s.V.cc)for(r=Kt(),i=[],o=0;32>o;o++)i.push(_[r+o+17|0]);return 0;case 21519:return e.s?(r=Kt(),T[r>>2]=0):-59;case 21520:return e.s?-28:-59;case 21531:if(r=Kt(),!e.m.ac)throw new jt(59);return e.m.ac(e,i,r);case 21523:return e.s?(e.s.V.dc&&(o=[24,80],r=Kt(),j[r>>1]=o[0],j[r+2>>1]=o[1]),0):-59;default:return-28}}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},__syscall_openat:function(t,i,n,e){qt=e;try{var r=i=i?et(M,i):"";if("/"===r.charAt(0))i=r;else{var o=-100===t?"/":It(t).path;if(0==r.length)throw new jt(44);i=J(o+"/"+r)}var s=e?Kt():0;return Yt(i,n,s).X}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return-t.aa}},_embind_create_inheriting_constructor:function(t,i,n){t=hi(t),i=wi(i,"wrapper"),n=ei(n);var e=[].slice,r=i.i,o=r.N,s=r.A.N,a=r.A.constructor;for(var h in t=Qt(t,(function(){r.A.qb.forEach(function(t){if(this[t]===s[t])throw new si(`Pure virtual function ${t} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:o}),this.__construct.apply(this,e.call(arguments))})),o.__construct=function(){this===o&&ni("Pass correct 'this' to __construct");var t=a.implement.apply(void 0,[this].concat(e.call(arguments)));mi(t);var i=t.g;t.notifyOnDestruction(),i.ia=!0,Object.defineProperties(this,{g:{value:i}}),ji(this),t=fi(r,t=i.o),di.hasOwnProperty(t)?ni(`Tried to register registered instance: ${t}`):di[t]=this},o.__destruct=function(){this===o&&ni("Pass correct 'this' to __destruct"),mi(this);var t=this.g.o;t=fi(r,t),di.hasOwnProperty(t)?delete di[t]:ni(`Tried to unregister unregistered instance: ${t}`)},t.prototype=Object.create(o),n)t.prototype[h]=n[h];return ri(t)},_embind_finalize_value_object:function(t){var i=Ci[t];delete Ci[t];var n=i.Pa,e=i.W,r=i.eb;Ai([t],r.map((t=>t.Yb)).concat(r.map((t=>t.rc))),(t=>{var o={};return r.forEach(((i,n)=>{var e=t[n],s=i.Wb,a=i.Xb,h=t[n+r.length],c=i.qc,u=i.sc;o[i.Sb]={read:t=>e.fromWireType(s(a,t)),write:(t,i)=>{var n=[];c(u,t,h.toWireType(n,i)),Ti(n)}}})),[{name:i.name,fromWireType:function(t){var i,n={};for(i in o)n[i]=o[i].read(t);return e(t),n},toWireType:function(t,i){for(var r in o)if(!(r in i))throw new TypeError(`Missing field: "${r}"`);var s=n();for(r in o)o[r].write(s,i[r]);return null!==t&&t.push(e,s),s},argPackAdvance:8,readValueFromPointer:$i,K:e}]}))},_embind_register_bigint:function(){},_embind_register_bool:function(t,i,n,e,r){var o=Ei(n);Si(t,{name:i=hi(i),fromWireType:function(t){return!!t},toWireType:function(t,i){return i?e:r},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var e=_;else if(2===n)e=j;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+i);e=T}return this.fromWireType(e[t>>o])},K:null})},_embind_register_class:function(t,i,n,e,r,o,s,a,h,c,u,l,d){u=hi(u),o=Gi(r,o),a&&(a=Gi(s,a)),c&&(c=Gi(h,c)),d=Gi(l,d);var f=Jt(u);Fi(f,(function(){qi(`Cannot construct ${u} due to unbound types`,[e])})),Ai([t,i,n],e?[e]:[],(function(i){if(i=i[0],e)var n=i.i,r=n.N;else r=Ii.prototype;i=Qt(f,(function(){if(Object.getPrototypeOf(this)!==s)throw new ii("Use 'new' to construct "+u);if(void 0===h.$)throw new ii(u+" has no accessible constructor");var t=h.$[arguments.length];if(void 0===t)throw new ii(`Tried to invoke ctor of ${u} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(h.$).toString()}) parameters instead!`);return t.apply(this,arguments)}));var s=Object.create(r,{constructor:{value:i}});i.prototype=s;var h=new Li(u,i,s,d,n,o,a,c);h.A&&(void 0===h.A.oa&&(h.A.oa=[]),h.A.oa.push(h)),n=new Ni(u,h,!0,!1),r=new Ni(u+"*",h,!1,!1);var l=new Ni(u+" const*",h,!1,!0);return xi[t]={pointerType:r,Kb:l},Yi(f,i),[n,r,l]}))},_embind_register_class_class_function:function(t,i,n,e,r,o,s){var a=Ji(n,e);i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){function e(){qi(`Cannot call ${r} due to unbound types`,a)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]);var h=t.i.constructor;return void 0===h[i]?(e.ea=n-1,h[i]=e):(zi(h,i,r),h[i].B[n-1]=e),Ai([],a,(function(e){if(e=Ki(r,[e[0],null].concat(e.slice(1)),null,o,s),void 0===h[i].B?(e.ea=n-1,h[i]=e):h[i].B[n-1]=e,t.i.oa)for(const n of t.i.oa)n.constructor.hasOwnProperty(i)||(n.constructor[i]=e);return[]})),[]}))},_embind_register_class_class_property:function(t,i,n,e,r,o,s,a){i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){var r=`${(t=t[0]).name}.${i}`,h={get(){qi(`Cannot access ${r} due to unbound types`,[n])},enumerable:!0,configurable:!0};return h.set=a?()=>{qi(`Cannot access ${r} due to unbound types`,[n])}:()=>{ni(`${r} is a read-only property`)},Object.defineProperty(t.i.constructor,i,h),Ai([],[n],(function(n){n=n[0];var r={get:()=>n.fromWireType(o(e)),enumerable:!0};return a&&(a=Gi(s,a),r.set=t=>{var i=[];a(e,n.toWireType(i,t)),Ti(i)}),Object.defineProperty(t.i.constructor,i,r),[]})),[]}))},_embind_register_class_constructor:function(t,i,n,e,r,o){var s=Ji(i,n);r=Gi(e,r),Ai([],[t],(function(t){var n=`constructor ${(t=t[0]).name}`;if(void 0===t.i.$&&(t.i.$=[]),void 0!==t.i.$[i-1])throw new ii(`Cannot register multiple constructors with identical number of parameters (${i-1}) for class '${t.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return t.i.$[i-1]=()=>{qi(`Cannot construct ${t.name} due to unbound types`,s)},Ai([],s,(function(e){return e.splice(1,0,null),t.i.$[i-1]=Ki(n,e,null,r,o),[]})),[]}))},_embind_register_class_function:function(t,i,n,e,r,o,s,a){var h=Ji(n,e);i=hi(i),o=Gi(r,o),Ai([],[t],(function(t){function e(){qi(`Cannot call ${r} due to unbound types`,h)}var r=`${(t=t[0]).name}.${i}`;i.startsWith("@@")&&(i=Symbol[i.substring(2)]),a&&t.i.qb.push(i);var c=t.i.N,u=c[i];return void 0===u||void 0===u.B&&u.className!==t.name&&u.ea===n-2?(e.ea=n-2,e.className=t.name,c[i]=e):(zi(c,i,r),c[i].B[n-2]=e),Ai([],h,(function(e){return e=Ki(r,e,t,o,s),void 0===c[i].B?(e.ea=n-2,c[i]=e):c[i].B[n-2]=e,[]})),[]}))},_embind_register_class_property:function(t,i,n,e,r,o,s,a,h,c){i=hi(i),r=Gi(e,r),Ai([],[t],(function(t){var e=`${(t=t[0]).name}.${i}`,u={get(){qi(`Cannot access ${e} due to unbound types`,[n,s])},enumerable:!0,configurable:!0};return u.set=h?()=>{qi(`Cannot access ${e} due to unbound types`,[n,s])}:()=>{ni(e+" is a read-only property")},Object.defineProperty(t.i.N,i,u),Ai([],h?[n,s]:[n],(function(n){var s=n[0],u={get(){var i=Qi(this,t,e+" getter");return s.fromWireType(r(o,i))},enumerable:!0};if(h){h=Gi(a,h);var l=n[1];u.set=function(i){var n=Qi(this,t,e+" setter"),r=[];h(c,n,l.toWireType(r,i)),Ti(r)}}return Object.defineProperty(t.i.N,i,u),[]})),[]}))},_embind_register_emval:function(t,i){Si(t,{name:i=hi(i),fromWireType:function(t){var i=ei(t);return Zi(t),i},toWireType:function(t,i){return ri(i)},argPackAdvance:8,readValueFromPointer:$i,K:null})},_embind_register_enum:function(t,i,n,e){function r(){}n=Ei(n),i=hi(i),r.values={},Si(t,{name:i,constructor:r,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,i){return i.value},argPackAdvance:8,readValueFromPointer:tn(i,n,e),K:null}),Fi(i,r)},_embind_register_enum_value:function(t,i,n){var e=wi(t,"enum");i=hi(i),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:n},constructor:{value:Qt(`${e.name}_${i}`,(function(){}))}}),t.values[n]=e,t[i]=e},_embind_register_float:function(t,i,n){n=Ei(n),Si(t,{name:i=hi(i),fromWireType:function(t){return t},toWireType:function(t,i){return i},argPackAdvance:8,readValueFromPointer:en(i,n),K:null})},_embind_register_function:function(t,i,n,e,r,o){var s=Ji(i,n);t=hi(t),r=Gi(e,r),Fi(t,(function(){qi(`Cannot call ${t} due to unbound types`,s)}),i-1),Ai([],s,(function(n){return Yi(t,Ki(t,[n[0],null].concat(n.slice(1)),null,r,o),i-1),[]}))},_embind_register_integer:function(t,i,n,e,r){i=hi(i),-1===r&&(r=4294967295),r=Ei(n);var o=t=>t;if(0===e){var s=32-8*n;o=t=>t<<s>>>s}n=i.includes("unsigned")?function(t,i){return i>>>0}:function(t,i){return i},Si(t,{name:i,fromWireType:o,toWireType:n,argPackAdvance:8,readValueFromPointer:rn(i,r,0!==e),K:null})},_embind_register_memory_view:function(t,i,n){function e(t){return new r($.buffer,$[1+(t>>=2)],$[t])}var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][i];Si(t,{name:n=hi(n),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{$b:!0})},_embind_register_std_string:function(t,i){var n="std::string"===(i=hi(i));Si(t,{name:i,fromWireType:function(t){var i=$[t>>2],e=t+4;if(n)for(var r=e,o=0;o<=i;++o){var s=e+o;if(o==i||0==M[s]){if(r=r?et(M,r,s-r):"",void 0===a)var a=r;else a+=String.fromCharCode(0),a+=r;r=s+1}}else{for(a=Array(i),o=0;o<i;++o)a[o]=String.fromCharCode(M[e+o]);a=a.join("")}return Tn(t),a},toWireType:function(t,i){i instanceof ArrayBuffer&&(i=new Uint8Array(i));var e="string"==typeof i;e||i instanceof Uint8Array||i instanceof Uint8ClampedArray||i instanceof Int8Array||ni("Cannot pass non-string to std::string");var r=n&&e?ot(i):i.length,o=$n(4+r+1),s=o+4;if($[o>>2]=r,n&&e)st(i,M,s,r+1);else if(e)for(e=0;e<r;++e){var a=i.charCodeAt(e);255<a&&(Tn(s),ni("String has UTF-16 code units that do not fit in 8 bits")),M[s+e]=a}else for(e=0;e<r;++e)M[s+e]=i[e];return null!==t&&t.push(Tn,o),o},argPackAdvance:8,readValueFromPointer:$i,K:function(t){Tn(t)}})},_embind_register_std_wstring:function(t,i,n){if(n=hi(n),2===i)var e=sn,r=an,o=hn,s=()=>C,a=1;else 4===i&&(e=cn,r=un,o=ln,s=()=>$,a=2);Si(t,{name:n,fromWireType:function(t){for(var n,r=$[t>>2],o=s(),h=t+4,c=0;c<=r;++c){var u=t+4+c*i;c!=r&&0!=o[u>>a]||(h=e(h,u-h),void 0===n?n=h:(n+=String.fromCharCode(0),n+=h),h=u+i)}return Tn(t),n},toWireType:function(t,e){"string"!=typeof e&&ni(`Cannot pass non-string to C++ string type ${n}`);var s=o(e),h=$n(4+s+i);return $[h>>2]=s>>a,r(e,h+4,s+i),null!==t&&t.push(Tn,h),h},argPackAdvance:8,readValueFromPointer:$i,K:function(t){Tn(t)}})},_embind_register_value_object:function(t,i,n,e,r,o){Ci[t]={name:hi(i),Pa:Gi(n,e),W:Gi(r,o),eb:[]}},_embind_register_value_object_field:function(t,i,n,e,r,o,s,a,h,c){Ci[t].eb.push({Sb:hi(i),Yb:n,Wb:Gi(e,r),Xb:o,rc:s,qc:Gi(a,h),sc:c})},_embind_register_void:function(t,i){Si(t,{fc:!0,name:i=hi(i),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},_emscripten_get_now_is_monotonic:()=>!0,_emval_as:function(t,i,n){t=ei(t),i=wi(i,"emval::as");var e=[],r=ri(e);return $[n>>2]=r,i.toWireType(e,t)},_emval_call_method:function(t,i,n,e,r){t=vn[t],i=ei(i),n=fn(n);var o=[];return $[e>>2]=ri(o),t(i,n,o,r)},_emval_call_void_method:function(t,i,n,e){(t=vn[t])(i=ei(i),n=fn(n),null,e)},_emval_decref:Zi,_emval_get_method_caller:function(t,i){var n=function(t,i){for(var n=Array(t),e=0;e<t;++e)n[e]=wi($[i+4*e>>2],"parameter "+e);return n}(t,i),e=n[0];i=e.name+"_$"+n.slice(1).map((function(t){return t.name})).join("_")+"$";var r=wn[i];if(void 0!==r)return r;var o=Array(t-1);return r=function(t){var i=vn.length;return vn.push(t),i}(((i,r,s,a)=>{for(var h=0,c=0;c<t-1;++c)o[c]=n[c+1].readValueFromPointer(a+h),h+=n[c+1].argPackAdvance;for(i=i[r].apply(i,o),c=0;c<t-1;++c)n[c+1].Nb&&n[c+1].Nb(o[c]);if(!e.fc)return e.toWireType(s,i)})),wn[i]=r},_emval_get_module_property:function(t){return t=fn(t),ri(r[t])},_emval_get_property:function(t,i){return t=ei(t),i=ei(i),ri(t[i])},_emval_incref:function(t){4<t&&(ti.get(t).tb+=1)},_emval_new_cstring:function(t){return ri(fn(t))},_emval_new_object:function(){return ri({})},_emval_run_destructors:function(t){Ti(ei(t)),Zi(t)},_emval_set_property:function(t,i,n){t=ei(t),i=ei(i),n=ei(n),t[i]=n},_emval_take_value:function(t,i){return t=(t=wi(t,"_emval_take_value")).readValueFromPointer(i),ri(t)},abort:()=>{X("")},emscripten_asm_const_int:(t,i,n)=>{var e;for(mn.length=0,n>>=2;e=M[i++];)n+=105!=e&n,mn.push(105==e?T[n]:O[n++>>1]),++n;return V[t].apply(null,mn)},emscripten_date_now:function(){return Date.now()},emscripten_get_now:()=>performance.now(),emscripten_memcpy_big:(t,i,n)=>M.copyWithin(t,i,i+n),emscripten_resize_heap:t=>{var i=M.length;if(2147483648<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var e=i*(1+.2/n);e=Math.min(e,t+100663296);var r=Math;e=Math.max(t,e);t:{r=r.min.call(r,2147483648,e+(65536-e%65536)%65536)-x.buffer.byteLength+65535>>>16;try{x.grow(r),E();var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},environ_get:(t,i)=>{var n=0;return gn().forEach((function(e,r){var o=i+n;for(r=$[t+4*r>>2]=o,o=0;o<e.length;++o)_[0|r++]=e.charCodeAt(o);_[0|r]=0,n+=e.length+1})),0},environ_sizes_get:(t,i)=>{var n=gn();$[t>>2]=n.length;var e=0;return n.forEach((function(t){e+=t.length+1})),$[i>>2]=e,0},fd_close:function(t){try{var i=It(t);if(null===i.X)throw new jt(8);i.Ma&&(i.Ma=null);try{i.m.close&&i.m.close(i)}catch(t){throw t}finally{xt[i.X]=null}return i.X=null,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_read:function(t,i,n,e){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<n;s++){var a=$[t>>2],h=$[t+4>>2];t+=8;var c=r,u=a,l=h,d=o,f=_;if(0>l||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(1==(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.read)throw new jt(28);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.read(c,f,u,l,d);p||(c.position+=v);var w=v;if(0>w){var m=-1;break t}if(i+=w,w<h)break;void 0!==o&&(o+=w)}m=i}return $[e>>2]=m,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_seek:function(t,i,n,e,r){i=n+2097152>>>0<4194305-!!i?(i>>>0)+4294967296*n:NaN;try{if(isNaN(i))return 61;var o=It(t);return Bt(o,i,e),G=[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)],T[r>>2]=G[0],T[r+4>>2]=G[1],o.Ma&&0===i&&0===e&&(o.Ma=null),0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},fd_write:function(t,i,n,e){try{t:{var r=It(t);t=i;for(var o,s=i=0;s<n;s++){var a=$[t>>2],h=$[t+4>>2];t+=8;var c=r,u=a,l=h,d=o,f=_;if(0>l||0>d)throw new jt(28);if(null===c.X)throw new jt(8);if(!(2097155&c.flags))throw new jt(8);if(16384==(61440&c.node.mode))throw new jt(31);if(!c.m.write)throw new jt(28);c.seekable&&1024&c.flags&&Bt(c,0,2);var p=void 0!==d;if(p){if(!c.seekable)throw new jt(70)}else d=c.position;var v=c.m.write(c,f,u,l,d,void 0);p||(c.position+=v);var w=v;if(0>w){var m=-1;break t}i+=w,void 0!==o&&(o+=w)}m=i}return $[e>>2]=m,0}catch(t){if(void 0===Vt||"ErrnoError"!==t.name)throw t;return t.aa}},strftime_l:(t,i,n,e)=>((t,i,n,e)=>{function r(t,i,n){for(t="number"==typeof t?t.toString():t||"";t.length<i;)t=n[0]+t;return t}function o(t,i){return r(t,i,"0")}function s(t,i){function n(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=n(t.getFullYear()-i.getFullYear()))&&0===(e=n(t.getMonth()-i.getMonth()))&&(e=n(t.getDate()-i.getDate())),e}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 n=t.getMonth(),e=(yn(t.getFullYear())?xn:kn)[n];if(!(i>e-t.getDate())){t.setDate(t.getDate()+i);break}i-=e-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),i=a(new Date(t.getFullYear(),0,4)),n=a(n),0>=s(i,t)?0>=s(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=T[e+40>>2];for(var u in e={wc:T[e>>2],vc:T[e+4>>2],Fa:T[e+8>>2],Sa:T[e+12>>2],Ga:T[e+16>>2],da:T[e+20>>2],R:T[e+24>>2],ca:T[e+28>>2],Rc:T[e+32>>2],uc:T[e+36>>2],xc:c&&c?et(M,c):""},n=n?et(M,n):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(u,"g"),c[u]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(u in c={"%a":t=>l[t.R].substring(0,3),"%A":t=>l[t.R],"%b":t=>d[t.Ga].substring(0,3),"%B":t=>d[t.Ga],"%C":t=>o((t.da+1900)/100|0,2),"%d":t=>o(t.Sa,2),"%e":t=>r(t.Sa,2," "),"%g":t=>h(t).toString().substring(2),"%G":t=>h(t),"%H":t=>o(t.Fa,2),"%I":t=>(0==(t=t.Fa)?t=12:12<t&&(t-=12),o(t,2)),"%j":t=>{for(var i=0,n=0;n<=t.Ga-1;i+=(yn(t.da+1900)?xn:kn)[n++]);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==(n=(t.R+371-t.ca)%7)||3==n&&yn(t.da)||(i=1));else{i=52;var n=(t.R+7-t.ca-1)%7;(4==n||5==n&&yn(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,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0"),c)n.includes(u)&&(n=n.replace(new RegExp(u,"g"),c[u](e)));return(u=at(n=n.replace(/\0\0/g,"%"),!1)).length>i?0:(_.set(u,t),u.length-1)})(t,i,n,e)};!function(){function t(t){if(k=t=t.exports,x=k.memory,E(),S=k.__indirect_function_table,I.unshift(k.__wasm_call_ctors),R--,r.monitorRunDependencies&&r.monitorRunDependencies(R),0==R&&W){var i=W;W=null,i()}return t}var i={env:Cn,wasi_snapshot_preview1:Cn};if(R++,r.monitorRunDependencies&&r.monitorRunDependencies(R),r.instantiateWasm)try{return r.instantiateWasm(i,t)}catch(t){y("Module.instantiateWasm callback failed with error: "+t),n(t)}(function(t,i){var n=L;return b||"function"!=typeof WebAssembly.instantiateStreaming||U(n)||n.startsWith("file://")||"function"!=typeof fetch?B(n,t,i):fetch(n,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(i,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),B(n,t,i)}))))})(i,(function(i){t(i.instance)})).catch(n)}();var Tn=t=>(Tn=k.free)(t),$n=t=>($n=k.malloc)(t),Pn=r._ma_device__on_notification_unlocked=t=>(Pn=r._ma_device__on_notification_unlocked=k.ma_device__on_notification_unlocked)(t);r._ma_malloc_emscripten=(t,i)=>(r._ma_malloc_emscripten=k.ma_malloc_emscripten)(t,i),r._ma_free_emscripten=(t,i)=>(r._ma_free_emscripten=k.ma_free_emscripten)(t,i);var On,An=r._ma_device_process_pcm_frames_capture__webaudio=(t,i,n)=>(An=r._ma_device_process_pcm_frames_capture__webaudio=k.ma_device_process_pcm_frames_capture__webaudio)(t,i,n),En=r._ma_device_process_pcm_frames_playback__webaudio=(t,i,n)=>(En=r._ma_device_process_pcm_frames_playback__webaudio=k.ma_device_process_pcm_frames_playback__webaudio)(t,i,n),Sn=()=>(Sn=k.__errno_location)(),Dn=t=>(Dn=k.__getTypeName)(t);function In(){function t(){if(!On&&(On=!0,r.calledRun=!0,!A)){if(r.noFSInit||pt||(pt=!0,Ht(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Gt("stdin",r.stdin):Ut("/dev/tty","/dev/stdin"),r.stdout?Gt("stdout",null,r.stdout):Ut("/dev/tty","/dev/stdout"),r.stderr?Gt("stderr",null,r.stderr):Ut("/dev/tty1","/dev/stderr"),Yt("/dev/stdin",0),Yt("/dev/stdout",1),Yt("/dev/stderr",1)),Mt=!1,q(I),i(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var t=r.postRun.shift();z.unshift(t)}q(z)}}if(!(0<R)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)F();q(D),0<R||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),t()}),1)):t())}}if(r.__embind_initialize_bindings=()=>(r.__embind_initialize_bindings=k._embind_initialize_bindings)(),r.dynCall_iiji=(t,i,n,e,o)=>(r.dynCall_iiji=k.dynCall_iiji)(t,i,n,e,o),r.dynCall_jiji=(t,i,n,e,o)=>(r.dynCall_jiji=k.dynCall_jiji)(t,i,n,e,o),r.dynCall_iiiji=(t,i,n,e,o,s)=>(r.dynCall_iiiji=k.dynCall_iiiji)(t,i,n,e,o,s),r.dynCall_iij=(t,i,n,e)=>(r.dynCall_iij=k.dynCall_iij)(t,i,n,e),r.dynCall_jii=(t,i,n)=>(r.dynCall_jii=k.dynCall_jii)(t,i,n),r.dynCall_viijii=(t,i,n,e,o,s,a)=>(r.dynCall_viijii=k.dynCall_viijii)(t,i,n,e,o,s,a),r.dynCall_iiiiij=(t,i,n,e,o,s,a)=>(r.dynCall_iiiiij=k.dynCall_iiiiij)(t,i,n,e,o,s,a),r.dynCall_iiiiijj=(t,i,n,e,o,s,a,h,c)=>(r.dynCall_iiiiijj=k.dynCall_iiiiijj)(t,i,n,e,o,s,a,h,c),r.dynCall_iiiiiijj=(t,i,n,e,o,s,a,h,c,u)=>(r.dynCall_iiiiiijj=k.dynCall_iiiiiijj)(t,i,n,e,o,s,a,h,c,u),W=function t(){On||In(),On||(W=t)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return In(),t.ready})},t=>{t.exports=JSON.parse('{"name":"@rive-app/canvas","version":"2.25.7","description":"Rive\'s canvas based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}')},(t,i,n)=>{n.r(i),n.d(i,{Animation:()=>e.Animation});var e=n(4)},(t,i,n)=>{n.r(i),n.d(i,{Animation:()=>e});var e=function(){function t(t,i,n,e){this.animation=t,this.artboard=i,this.playing=e,this.loopCount=0,this.scrubTo=null,this.instance=new n.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,n)=>{n.r(i),n.d(i,{BLANK_URL:()=>r.BLANK_URL,registerTouchInteractions:()=>e.registerTouchInteractions,sanitizeUrl:()=>r.sanitizeUrl});var e=n(6),r=n(7)},(t,i,n)=>{n.r(i),n.d(i,{registerTouchInteractions:()=>e});var e=function(t){var i=t.canvas,n=t.artboard,e=t.stateMachines,r=void 0===e?[]:e,o=t.rive,s=t.fit,a=t.alignment,h=t.isTouchScrollEnabled,c=void 0!==h&&h,u=t.layoutScaleFactor,l=void 0===u?1:u;if(!(i&&r.length&&t.renderer&&o&&n&&"undefined"!=typeof window))return null;var d=null,f=!1,p=function(t){if(f&&t instanceof MouseEvent)"mouseup"==t.type&&(f=!1);else{f=c&&"touchend"===t.type&&"touchstart"===d,d=t.type;var i=t.currentTarget.getBoundingClientRect(),e=function(t,i){var n,e;return["touchstart","touchmove"].indexOf(t.type)>-1&&(null===(n=t.touches)||void 0===n?void 0:n.length)?(i||t.preventDefault(),{clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}):"touchend"===t.type&&(null===(e=t.changedTouches)||void 0===e?void 0:e.length)?{clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY}:{clientX:t.clientX,clientY:t.clientY}}(t,c),h=e.clientX,u=e.clientY;if(h||u){var p=h-i.left,v=u-i.top,w=o.computeAlignment(s,a,{minX:0,minY:0,maxX:i.width,maxY:i.height},n.bounds,l),m=new o.Mat2D;w.invert(m);var b=new o.Vec2D(p,v),g=o.mapXY(m,b),y=g.x(),x=g.y();switch(g.delete(),m.delete(),b.delete(),w.delete(),t.type){case"mouseout":for(var k=0,_=r;k<_.length;k++)_[k].pointerMove(y,x);break;case"touchmove":case"mouseover":case"mousemove":for(var M=0,j=r;M<j.length;M++)j[M].pointerMove(y,x);break;case"touchstart":case"mousedown":for(var C=0,T=r;C<T.length;C++)T[C].pointerDown(y,x);break;case"touchend":case"mouseup":for(var $=0,P=r;$<P.length;$++)P[$].pointerUp(y,x)}}}}.bind(void 0);return i.addEventListener("mouseover",p),i.addEventListener("mouseout",p),i.addEventListener("mousemove",p),i.addEventListener("mousedown",p),i.addEventListener("mouseup",p),i.addEventListener("touchmove",p,{passive:c}),i.addEventListener("touchstart",p,{passive:c}),i.addEventListener("touchend",p),function(){i.removeEventListener("mouseover",p),i.removeEventListener("mouseout",p),i.removeEventListener("mousemove",p),i.removeEventListener("mousedown",p),i.removeEventListener("mouseup",p),i.removeEventListener("touchmove",p),i.removeEventListener("touchstart",p),i.removeEventListener("touchend",p)}}},(t,i,n)=>{n.r(i),n.d(i,{BLANK_URL:()=>c,sanitizeUrl:()=>u});var e=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,h=[".","/"],c="about:blank";function u(t){if(!t)return c;var i,n=(i=t,i.replace(s,"").replace(r,(function(t,i){return String.fromCharCode(i)}))).replace(o,"").replace(s,"").trim();if(!n)return c;if(function(t){return h.indexOf(t[0])>-1}(n))return n;var u=n.match(a);return u&&e.test(u[0])?c:n}}],i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.d=(t,i)=>{for(var e in i)n.o(i,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},n.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};return(()=>{n.r(e),n.d(e,{Alignment:()=>r,EventType:()=>m,Fit:()=>i,Layout:()=>f,LoopType:()=>b,Rive:()=>P,RiveEventType:()=>v,RiveFile:()=>$,RuntimeLoader:()=>p,StateMachineInput:()=>w,StateMachineInputType:()=>d,Testing:()=>E,decodeAudio:()=>S,decodeFont:()=>I,decodeImage:()=>D});var t,i,r,o=n(1),s=n(2),a=n(3),h=n(5),c=(t=function(i,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},t(i,n)},function(i,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=i}t(i,n),i.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),u=function(t,i,n,e){return new(n||(n=Promise))((function(r,o){function s(t){try{h(e.next(t))}catch(t){o(t)}}function a(t){try{h(e.throw(t))}catch(t){o(t)}}function h(t){var i;t.done?r(t.value):(i=t.value,i instanceof n?i:new n((function(t){t(i)}))).then(s,a)}h((e=e.apply(t,i||[])).next())}))},l=function(t,i){var n,e,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(h){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,e&&(r=2&a[0]?e.return:a[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,a[1])).done)return r;switch(e=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,e=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=i.call(t,o)}catch(t){a=[6,t],e=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,h])}}};!function(t){t.Cover="cover",t.Contain="contain",t.Fill="fill",t.FitWidth="fitWidth",t.FitHeight="fitHeight",t.None="none",t.ScaleDown="scaleDown",t.Layout="layout"}(i||(i={})),function(t){t.Center="center",t.TopLeft="topLeft",t.TopCenter="topCenter",t.TopRight="topRight",t.CenterLeft="centerLeft",t.CenterRight="centerRight",t.BottomLeft="bottomLeft",t.BottomCenter="bottomCenter",t.BottomRight="bottomRight"}(r||(r={}));var d,f=function(){function t(t){var n,e,o,s,a,h,c;this.fit=null!==(n=null==t?void 0:t.fit)&&void 0!==n?n:i.Contain,this.alignment=null!==(e=null==t?void 0:t.alignment)&&void 0!==e?e:r.Center,this.layoutScaleFactor=null!==(o=null==t?void 0:t.layoutScaleFactor)&&void 0!==o?o:1,this.minX=null!==(s=null==t?void 0:t.minX)&&void 0!==s?s:0,this.minY=null!==(a=null==t?void 0:t.minY)&&void 0!==a?a:0,this.maxX=null!==(h=null==t?void 0:t.maxX)&&void 0!==h?h:0,this.maxY=null!==(c=null==t?void 0:t.maxY)&&void 0!==c?c:0}return t.new=function(i){var n=i.fit,e=i.alignment,r=i.minX,o=i.minY,s=i.maxX,a=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new t({fit:n,alignment:e,minX:r,minY:o,maxX:s,maxY:a})},t.prototype.copyWith=function(i){var n=i.fit,e=i.alignment,r=i.layoutScaleFactor,o=i.minX,s=i.minY,a=i.maxX,h=i.maxY;return new t({fit:null!=n?n:this.fit,alignment:null!=e?e:this.alignment,layoutScaleFactor:null!=r?r:this.layoutScaleFactor,minX:null!=o?o:this.minX,minY:null!=s?s:this.minY,maxX:null!=a?a:this.maxX,maxY:null!=h?h:this.maxY})},t.prototype.runtimeFit=function(t){return this.cachedRuntimeFit?this.cachedRuntimeFit:(this.cachedRuntimeFit=n=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,n);var n},t.prototype.runtimeAlignment=function(t){return this.cachedRuntimeAlignment?this.cachedRuntimeAlignment:(this.cachedRuntimeAlignment=i=this.alignment===r.TopLeft?t.Alignment.topLeft:this.alignment===r.TopCenter?t.Alignment.topCenter:this.alignment===r.TopRight?t.Alignment.topRight:this.alignment===r.CenterLeft?t.Alignment.centerLeft:this.alignment===r.CenterRight?t.Alignment.centerRight:this.alignment===r.BottomLeft?t.Alignment.bottomLeft:this.alignment===r.BottomCenter?t.Alignment.bottomCenter:this.alignment===r.BottomRight?t.Alignment.bottomRight:t.Alignment.center,i);var i},t}(),p=function(){function t(){}return t.loadRuntime=function(){o.default({locateFile:function(){return t.wasmURL}}).then((function(i){var n;for(t.runtime=i;t.callBackQueue.length>0;)null===(n=t.callBackQueue.shift())||void 0===n||n(t.runtime)})).catch((function(i){var n={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:",n);var e="https://cdn.jsdelivr.net/npm/".concat(s.name,"@").concat(s.version,"/rive_fallback.wasm");if(t.wasmURL.toLowerCase()!==e)console.warn("Failed to load WASM from ".concat(t.wasmURL," (").concat(n.message,"), trying jsdelivr as a backup")),t.setWasmUrl(e),t.loadRuntime();else{var r=["Could not load Rive WASM file from ".concat(t.wasmURL," or ").concat(e,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible","\nError details:","- Type: ".concat(n.type),"- Message: ".concat(n.message),"- WebAssembly-specific error: ".concat(n.wasmError),"\nTo resolve, you may need to:","1. Check your network connection","2. Set a new WASM source via RuntimeLoader.setWasmUrl()","3. Call RuntimeLoader.loadRuntime() again"].join("\n");console.error(r)}}))},t.getInstance=function(i){t.isLoading||(t.isLoading=!0,t.loadRuntime()),t.runtime?i(t.runtime):t.callBackQueue.push(i)},t.awaitInstance=function(){return new Promise((function(i){return t.getInstance((function(t){return i(t)}))}))},t.setWasmUrl=function(i){t.wasmURL=i},t.getWasmUrl=function(){return t.wasmURL},t.isLoading=!1,t.callBackQueue=[],t.wasmURL="https://unpkg.com/".concat(s.name,"@").concat(s.version,"/rive.wasm"),t}();!function(t){t[t.Number=56]="Number",t[t.Trigger=58]="Trigger",t[t.Boolean=59]="Boolean"}(d||(d={}));var v,w=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 m,b,g=function(){function t(t,i,n,e){this.stateMachine=t,this.playing=n,this.artboard=e,this.inputs=[],this.instance=new i.StateMachineInstance(t,e),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 n=this.instance.input(i);this.inputs.push(this.mapRuntimeInput(n,t))}},t.prototype.mapRuntimeInput=function(t,i){return t.type===i.SMIInput.bool?new w(d.Boolean,t.asBool()):t.type===i.SMIInput.number?new w(d.Number,t.asNumber()):t.type===i.SMIInput.trigger?new w(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,n,e,r){void 0===e&&(e=[]),void 0===r&&(r=[]),this.runtime=t,this.artboard=i,this.eventManager=n,this.animations=e,this.stateMachines=r}return t.prototype.add=function(t,i,n){if(void 0===n&&(n=!0),0===(t=A(t)).length)this.animations.forEach((function(t){return t.playing=i})),this.stateMachines.forEach((function(t){return t.playing=i}));else for(var e=this.animations.map((function(t){return t.name})),r=this.stateMachines.map((function(t){return t.name})),o=0;o<t.length;o++){var s=e.indexOf(t[o]),h=r.indexOf(t[o]);if(s>=0||h>=0)s>=0?this.animations[s].playing=i:this.stateMachines[h].playing=i;else{var c=this.artboard.animationByName(t[o]);if(c){var u=new a.Animation(c,this.artboard,this.runtime,i);u.advance(0),u.apply(1),this.animations.push(u)}else{var l=this.artboard.stateMachineByName(t[o]);if(l){var d=new g(l,this.runtime,i,this.artboard);this.stateMachines.push(d)}}}}return n&&this.eventManager.fire(i?{type:m.Play,data:this.playing}:{type:m.Pause,data:this.paused}),i?this.playing:this.paused},t.prototype.initLinearAnimations=function(t,i){for(var n=this.animations.map((function(t){return t.name})),e=0;e<t.length;e++){var r=n.indexOf(t[e]);if(r>=0)this.animations[r].playing=i;else{var o=this.artboard.animationByName(t[e]);if(o){var s=new a.Animation(o,this.artboard,this.runtime,i);s.advance(0),s.apply(1),this.animations.push(s)}}}},t.prototype.initStateMachines=function(t,i){for(var n=this.stateMachines.map((function(t){return t.name})),e=0;e<t.length;e++){var r=n.indexOf(t[e]);if(r>=0)this.stateMachines[r].playing=i;else{var o=this.artboard.stateMachineByName(t[e]);if(o){var s=new g(o,this.runtime,i,this.artboard);this.stateMachines.push(s)}else this.initLinearAnimations([t[e]],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 n=this.animations.filter((function(i){return t.includes(i.name)}));return n.forEach((function(t){return t.scrubTo=i})),n.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,n=[];if(0===(t=A(t)).length)n=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 e=this.animations.filter((function(i){return t.includes(i.name)}));e.forEach((function(t){t.cleanup(),i.animations.splice(i.animations.indexOf(t),1)}));var r=this.stateMachines.filter((function(i){return t.includes(i.name)}));r.forEach((function(t){t.cleanup(),i.stateMachines.splice(i.stateMachines.indexOf(t),1)})),n=e.map((function(t){return t.name})).concat(r.map((function(t){return t.name})))}return this.eventManager.fire({type:m.Stop,data:n}),n},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 n;return void 0===i&&(i=!0),0===this.animations.length&&0===this.stateMachines.length&&(this.artboard.animationCount()>0?this.add([n=this.artboard.animationByIndex(0).name],t,i):this.artboard.stateMachineCount()>0&&this.add([n=this.artboard.stateMachineByIndex(0).name],t,i)),n},t.prototype.handleLooping=function(){for(var t=0,i=this.animations.filter((function(t){return t.playing}));t<i.length;t++){var n=i[t];0===n.loopValue&&n.loopCount?(n.loopCount=0,this.stop(n.name)):1===n.loopValue&&n.loopCount?(this.eventManager.fire({type:m.Loop,data:{animation:n.name,type:b.Loop}}),n.loopCount=0):2===n.loopValue&&n.loopCount>1&&(this.eventManager.fire({type:m.Loop,data:{animation:n.name,type:b.PingPong}}),n.loopCount=0)}},t.prototype.handleStateChanges=function(){for(var t=[],i=0,n=this.stateMachines.filter((function(t){return t.playing}));i<n.length;i++)t.push.apply(t,n[i].statesChanged);t.length>0&&this.eventManager.fire({type:m.StateChange,data:t})},t.prototype.handleAdvancing=function(t){this.eventManager.fire({type:m.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"}(m||(m={})),function(t){t.OneShot="oneshot",t.Loop="loop",t.PingPong="pingpong"}(b||(b={}));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 n=this.listeners[i];if(n.type===t.type&&n.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 M=new(function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i._started=!1,i._enabled=!1,i._status=x.UNAVAILABLE,i}return c(i,t),i.prototype.delay=function(t){return u(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(i){return setTimeout(i,t)}))]}))}))},i.prototype.timeout=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return[2,new Promise((function(t,i){return setTimeout(i,50)}))]}))}))},i.prototype.reportToListeners=function(){this.fire({type:m.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return this._enabled||(this._enabled=!0,this._status=x.AVAILABLE,this.reportToListeners()),[2]}))}))},i.prototype.testAudio=function(){return u(this,void 0,void 0,(function(){return l(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 u(this,void 0,void 0,(function(){return l(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 u(t,void 0,void 0,(function(){return l(this,(function(){return this.enableAudio(),[2]}))}))}),{once:!0})},i.prototype.establishAudio=function(){return u(this,void 0,void 0,(function(){return l(this,(function(){return this._establishAudio(),[2]}))}))},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===x.UNAVAILABLE?(this.testAudio(),0):1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(k)),j=function(){function t(){}return t.prototype.observe=function(){},t.prototype.unobserve=function(){},t.prototype.disconnect=function(){},t}(),C=globalThis.ResizeObserver||j,T=new(function(){function t(){var t=this;this._elementsMap=new Map,this._onObservedEntry=function(i){var n=t._elementsMap.get(i.target);null!==n?n.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 n={onResize:i,element:t};return this._elementsMap.set(t,n),this._resizeObserver.observe(t),n},t.prototype.remove=function(t){this._resizeObserver.unobserve(t.element),this._elementsMap.delete(t.element)},t}()),$=function(){function t(t){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.src=t.src,this.buffer=t.buffer,t.assetLoader&&(this.assetLoader=t.assetLoader),this.enableRiveAssetCDN="boolean"!=typeof t.enableRiveAssetCDN||t.enableRiveAssetCDN,this.eventManager=new k,t.onLoad&&this.on(m.Load,t.onLoad),t.onLoadError&&this.on(m.LoadError,t.onLoadError)}return t.prototype.initData=function(){return u(this,void 0,void 0,(function(){var i,n,e;return l(this,(function(r){switch(r.label){case 0:return this.src?(i=this,[4,O(this.src)]):[3,2];case 1:i.buffer=r.sent(),r.label=2;case 2:return this.assetLoader&&(n=new this.runtime.CustomFileAssetLoader({loadContents:this.assetLoader})),e=this,[4,this.runtime.load(new Uint8Array(this.buffer),n,this.enableRiveAssetCDN)];case 3:if(e.file=r.sent(),null===this.file)throw this.eventManager.fire({type:m.LoadError,data:null}),new Error(t.fileLoadErrorMessage);return this.eventManager.fire({type:m.Load,data:this}),[2]}}))}))},t.prototype.init=function(){return u(this,void 0,void 0,(function(){var i;return l(this,(function(n){switch(n.label){case 0:if(!this.src&&!this.buffer)throw new Error(t.missingErrorMessage);return i=this,[4,p.awaitInstance()];case 1:return i.runtime=n.sent(),[4,this.initData()];case 2:return n.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}(),P=function(){function t(t){var i,n=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){n._hasZeroSize=t,n._layout.maxX&&n._layout.maxY||n.resizeToCanvas()},this.renderSecondTimer=0,this.canvas=t.canvas,t.canvas.constructor===HTMLCanvasElement&&(this._observed=T.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(m.Load,t.onLoad),t.onLoadError&&this.on(m.LoadError,t.onLoadError),t.onPlay&&this.on(m.Play,t.onPlay),t.onPause&&this.on(m.Pause,t.onPause),t.onStop&&this.on(m.Stop,t.onStop),t.onLoop&&this.on(m.Loop,t.onLoop),t.onStateChange&&this.on(m.StateChange,t.onStateChange),t.onAdvance&&this.on(m.Advance,t.onAdvance),t.onload&&!t.onLoad&&this.on(m.Load,t.onload),t.onloaderror&&!t.onLoadError&&this.on(m.LoadError,t.onloaderror),t.onplay&&!t.onPlay&&this.on(m.Play,t.onplay),t.onpause&&!t.onPause&&this.on(m.Pause,t.onpause),t.onstop&&!t.onStop&&this.on(m.Stop,t.onstop),t.onloop&&!t.onLoop&&this.on(m.Loop,t.onloop),t.onstatechange&&!t.onStateChange&&this.on(m.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 n=this,e=i.buffer,r=i.riveFile,o=i.animations,s=i.stateMachines,a=i.artboard,h=i.autoplay,c=void 0!==h&&h,u=i.useOffscreenRenderer,l=void 0!==u&&u;if(this.src=i.src,this.buffer=e,this.riveFile=r,!this.src&&!this.buffer&&!this.riveFile)throw new Error(t.missingErrorMessage);var d=A(o),f=A(s);this.loaded=!1,this.readyForPlaying=!1,p.awaitInstance().then((function(t){n.runtime=t,n.removeRiveListeners(),n.deleteRiveRenderer(),n.renderer=n.runtime.makeRenderer(n.canvas,l),n.canvas.width||n.canvas.height||n.resizeDrawingSurfaceToCanvas(),n.initData(a,d,f,c).then((function(){return n.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 n=(this.animator.stateMachines||[]).filter((function(t){return t.playing&&i.runtime.hasListeners(t.instance)})).map((function(t){return t.instance})),e=this.isTouchScrollEnabled;t&&"isTouchScrollEnabled"in t&&(e=t.isTouchScrollEnabled),this.eventCleanup=(0,h.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:n,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:e,layoutScaleFactor:this._layout.layoutScaleFactor})}},t.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},t.prototype.initializeAudio=function(){var t,i=this;M.status==x.UNAVAILABLE&&(null===(t=this.artboard)||void 0===t?void 0:t.hasAudio)&&null===this._audioEventListener&&(this._audioEventListener={type:m.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},M.add(this._audioEventListener),M.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,n,e){return u(this,void 0,void 0,(function(){var r,o;return l(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),null!=this.riveFile?[3,2]:(this.riveFile=new $({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),[4,this.riveFile.init()]);case 1:s.sent(),s.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(t,i,n,e),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:m.Load,data:null!==(o=this.src)&&void 0!==o?o:"buffer"}),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,Promise.resolve()];case 3:return s.sent(),r="Problem loading file; may be corrupt!",console.warn(r),this.eventManager.fire({type:m.LoadError,data:r}),[2,Promise.reject(r)];case 4:return[2]}}))}))},t.prototype.initArtboard=function(t,i,n,e){if(this.file){var r,o=t?this.file.artboardByName(t):this.file.defaultArtboard();if(!o){var s="Invalid artboard name or no default artboard";return console.warn(s),void this.eventManager.fire({type:m.LoadError,data:s})}if(this.artboard=o,o.volume=this._volume*M.systemVolume,this.artboard.animationCount()<1)throw this.eventManager.fire({type:m.LoadError,data:s="Artboard has no animations"}),s;this.animator=new y(this.runtime,this.artboard,this.eventManager),i.length>0||n.length>0?(r=i.concat(n),this.animator.initLinearAnimations(i,e),this.animator.initStateMachines(n,e)):r=[this.animator.atLeastOne(e,!1)],this.taskQueue.add({event:{type:e?m.Play:m.Pause,data:r}})}},t.prototype.drawFrame=function(){this.startRendering()},t.prototype.draw=function(t,i){this.frameRequestId=null;var n=performance.now();this.lastRenderTime||(this.lastRenderTime=t),this.renderSecondTimer+=t-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,null==i||i());var e=(t-this.lastRenderTime)/1e3;this.lastRenderTime=t;for(var r=0,o=this.animator.animations.filter((function(t){return t.playing||t.needsScrub})).sort((function(t){return t.needsScrub?-1:1}));r<o.length;r++){var s=o[r];s.advance(e),s.instance.didLoop&&(s.loopCount+=1),s.apply(1)}for(var a=0,c=this.animator.stateMachines.filter((function(t){return t.playing}));a<c.length;a++){var u=c[a],l=u.reportedEventCount();if(l)for(var d=0;d<l;d++){var f=u.reportedEventAt(d);if(f)if(f.type===v.OpenUrl){if(this.eventManager.fire({type:m.RiveEvent,data:f}),this.automaticallyHandleEvents){var p=document.createElement("a"),w=f.url,b=f.target,g=(0,h.sanitizeUrl)(w);w&&p.setAttribute("href",g),b&&p.setAttribute("target",b),g&&g!==h.BLANK_URL&&p.click()}}else this.eventManager.fire({type:m.RiveEvent,data:f})}u.advanceAndApply(e)}0==this.animator.stateMachines.length&&this.artboard.advance(e);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(e),this.frameCount++;var x=performance.now();for(this.frameTimes.push(x),this.durations.push(x-n);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,n=t._layout,e=t.artboard;t.renderer.align(n.runtimeFit(i),n.runtimeAlignment(i),{minX:n.minX,minY:n.minY,maxX:n.maxX,maxY:n.maxY},e.bounds,this._devicePixelRatioUsed*n.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&&T.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&&(M.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 n=this.artboard.textRun(t);if(n)return n;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 n=this.retrieveTextRun(t);n&&(n.text=i)},t.prototype.play=function(t,i){var n=this;t=A(t),this.readyForPlaying?(this.animator.play(t),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()):this.taskQueue.add({action:function(){return n.play(t,i)}})},t.prototype.pause=function(t){var i=this;t=A(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 n=this;t=A(t),this.readyForPlaying?(this.animator.scrub(t,i||0),this.drawFrame()):this.taskQueue.add({action:function(){return n.scrub(t,i)}})},t.prototype.stop=function(t){var i=this;t=A(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,n=null==t?void 0:t.artboard,e=A(null==t?void 0:t.animations),r=A(null==t?void 0:t.stateMachines),o=null!==(i=null==t?void 0:t.autoplay)&&void 0!==i&&i;this.cleanupInstances(),this.initArtboard(n,e,r,o),this.taskQueue.process()},t.prototype.load=function(t){this.file=null,this.stop(),this.init(t)},Object.defineProperty(t.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout=t,t.maxX&&t.maxY||this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),t.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},t.prototype.resizeDrawingSurfaceToCanvas=function(t){if(this.canvas instanceof HTMLCanvasElement&&window){var n=this.canvas.getBoundingClientRect(),e=n.width,r=n.height,o=t||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=o,this.canvas.width=o*e,this.canvas.height=o*r,this.startRendering(),this.resizeToCanvas(),this.layout.fit===i.Layout){var s=this._layout.layoutScaleFactor;this.artboard.width=e/s,this.artboard.height=r/s}}},Object.defineProperty(t.prototype,"source",{get:function(){return this.src},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.animationCount();i++)t.push(this.artboard.animationByIndex(i).name);return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var t=[],i=0;i<this.artboard.stateMachineCount();i++)t.push(this.artboard.stateMachineByIndex(i).name);return t},enumerable:!1,configurable:!0}),t.prototype.stateMachineInputs=function(t){if(this.loaded){var i=this.animator.stateMachines.find((function(i){return i.name===t}));return null==i?void 0:i.inputs}},t.prototype.retrieveInputAtPath=function(t,i){if(t)if(this.artboard){var n=this.artboard.inputByPath(t,i);if(n)return n;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,n){var e=this.retrieveInputAtPath(t,n);e&&(e.type===d.Boolean?e.asBool().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a boolean")))},t.prototype.setNumberStateAtPath=function(t,i,n){var e=this.retrieveInputAtPath(t,n);e&&(e.type===d.Number?e.asNumber().value=i:console.warn("Input with name: '".concat(t,"', at path:'").concat(n,"' is not a number")))},t.prototype.fireStateAtPath=function(t,i){var n=this.retrieveInputAtPath(t,i);n&&(n.type===d.Trigger?n.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 n=this.artboard.textByPath(t,i);if(n)return n;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 n=this.retrieveTextAtPath(t,i);if(n)return n.text;console.warn("Could not get text with name: '".concat(t,"', at path:'").concat(i,"'"))},t.prototype.setTextRunValueAtPath=function(t,i,n){var e=this.retrieveTextAtPath(t,n);e?e.text=i:console.warn("Could not set text with name: '".concat(t,"', at path:'").concat(n,"'"))},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 n=this.file.artboardByIndex(i),e={name:n.name,animations:[],stateMachines:[]},r=0;r<n.animationCount();r++){var o=n.animationByIndex(r);e.animations.push(o.name)}for(var s=0;s<n.stateMachineCount();s++){for(var a=n.stateMachineByIndex(s),h=a.name,c=new this.runtime.StateMachineInstance(a,n),u=[],l=0;l<c.inputCount();l++){var d=c.input(l);u.push({name:d.name,type:d.type})}e.stateMachines.push({name:h,inputs:u})}t.artboards.push(e)}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*M.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardWidth",{get:function(){var t;return this.artboard?this.artboard.width:null!==(t=this._artboardWidth)&&void 0!==t?t:0},set:function(t){this._artboardWidth=t,this.artboard&&(this.artboard.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"artboardHeight",{get:function(){var t;return this.artboard?this.artboard.height:null!==(t=this._artboardHeight)&&void 0!==t?t:0},set:function(t){this._artboardHeight=t,this.artboard&&(this.artboard.height=t)},enumerable:!1,configurable:!0}),t.prototype.resetArtboardSize=function(){this.artboard?(this.artboard.resetArtboardSize(),this._artboardWidth=this.artboard.width,this._artboardHeight=this.artboard.height):(this._artboardWidth=void 0,this._artboardHeight=void 0)},Object.defineProperty(t.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(t){this._devicePixelRatioUsed=t},enumerable:!1,configurable:!0}),t.missingErrorMessage="Rive source file or data buffer required",t}(),O=function(t){return u(void 0,void 0,void 0,(function(){var i;return l(this,(function(n){switch(n.label){case 0:return i=new Request(t),[4,fetch(i)];case 1:return[4,n.sent().arrayBuffer()];case 2:return[2,n.sent()]}}))}))},A=function(t){return"string"==typeof t?[t]:t instanceof Array?t:[]},E={EventManager:k,TaskQueueManager:_},S=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeAudio(t,i)}))}))},D=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeImage(t,i)}))}))},I=function(t){return new Promise((function(i){return p.getInstance((function(n){n.decodeFont(t,i)}))}))}})(),e})(),I.exports=D();const z=class{constructor(i){t(this,i),this.initializeRive=t=>{const i=c.getInstance(),n=this.el.querySelector("canvas");this.riveInstance=new I.exports.Rive({src:t,canvas:n,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(){s(this.el,this.delayVisible),a(this.el,this.type),this.initializeRive(h(this.src))}render(){return i(n,{key:"54b86b9154855e156b6dd67c71eb4107b317b480",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},i("canvas",{key:"f9d352ac0f0ef41b155a1cfc7659bb44f628beb3",class:"lido-canvas"}))}get el(){return e(this)}};z.style=".lido-canvas{height:100%;width:100%}";const F=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type),u(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 n=i.offsetWidth,e=i.offsetHeight;Array.from(t.children).forEach((t=>{const i=n-t.offsetWidth,r=e-t.offsetHeight,o=Math.random()*i,s=Math.random()*r;t.style.position="absolute",t.style.left=`${o}px`,t.style.top=`${s}px`}))}}),50),this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,margin:d(this.margin,t),padding:d(this.padding,t),borderRadius:d(this.borderRadius,t),gap:d(this.gap,t),"--scrollbar-width":d(this.scrollbarWidth||"0px",t),display:JSON.parse(d(`${this.visible}`,t))?"wrap"===d(this.layout,t)?"grid":"pos"===d(this.layout,t)||"random"===d(this.layout,t)?"block":"flex":"none",flexDirection:this.flexDirection?d(this.flexDirection,t):"",alignItems:this.alignItems?d(this.alignItems,t):""},this.el.className=`lido-${d(this.layout,t)}`}render(){return i(n,{key:"9f65539e85d22f775f44c310ecd7accc5f599859",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},i("slot",{key:"1c81a23db893dfc3af36f0ed98f9d5ce3cafebf3"}))}get el(){return e(this)}};F.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 L=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(){a(this.el,this.type),u(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&l(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?h(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,i),width:d(this.width,i),backgroundColor:d(this.bgColor,i),top:d(this.y,i),left:d(this.x,i),zIndex:this.z,display:this.visible?"flex":"none",flexDirection:this.direction?d(this.direction,i):"column",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",boxShadow:this.boxShadow?this.boxShadow:"unset",margin:d(this.margin,i)}}render(){return i(n,{key:"753487ca4817b020aaf7e34dadff00a61c826dfc",id:this.id,class:"lido-col",type:this.type,"tab-index":this.tabIndex,value:this.value,style:this.style,minDrops:this.minDrops,maxDrops:this.maxDrops,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},i("slot",{key:"a9d9f0f2c30dc02e6468e597b5a02e032d786538"}))}get el(){return e(this)}};L.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 R=class{constructor(i){t(this,i),this.showDropBorder=!0,this.appendToDropOnCompletion=!1,this.id="",this.objective="",this.customStyle="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="auto",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.bgImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.canplay=!0,this.showCheck=!1,this.isContinueOnCorrect=!1,this.isAllowOnlyCorrect=!1,this.baseUrl="",this.margin="",this.showPrevButton="false",this.showNextButton="false",this.delayVisible=""}convertToPixels(t,i=document.body){if(!t)return 0;if(t.endsWith("px"))return parseFloat(t);const n=document.createElement("div");n.style.position="absolute",n.style.visibility="hidden",n.style.height=t,i.appendChild(n);const e=n.offsetHeight;return i.removeChild(n),e}scaleContainer(t){t.style.transform=`translate(-50%, -50%) scale(${f()})`,t.style.left="50%",t.style.top="50%",t.style.position="absolute",this.screenOrientation()}screenOrientation(){window.innerHeight>window.innerWidth?(this.el.style.height="1600px",this.el.style.width="900px"):(this.el.style.height="900px",this.el.style.width="1600px")}componentDidLoad(){this.scaleContainer(this.el);const t=this.bgImage?h(this.bgImage):"";if(document.body.style.backgroundColor=this.bgColor,document.body.style.backgroundImage=t?`url(${t})`:"none",document.body.style.backgroundPosition=t?"bottom":"none",window.addEventListener("resize",(()=>this.scaleContainer(this.el))),window.addEventListener("load",(()=>this.scaleContainer(this.el))),a(this.el,this.type),this.customStyle){const t=document.createElement("style");t.innerHTML=this.customStyle,document.head.appendChild(t)}}disconnectedCallback(){window.removeEventListener("resize",(()=>this.scaleContainer(this.el))),window.removeEventListener("load",(()=>this.scaleContainer(this.el))),document.body.style.backgroundColor="",document.body.style.backgroundImage=""}render(){const t={backgroundColor:this.bgColor,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",margin:this.margin};return console.log("🚀 ~ LidoContainer ~ canplay:",this.canplay),i(n,{key:"7973350ab1163200af05910818e03001cd8a5ff9",id:"lido-container","tab-index":0,class:"lido-container",objective:this.objective,baseUrl:this.baseUrl,style:t,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,onTouch:this.onTouch,onInCorrect:this.onInCorrect,onCorrect:this.onCorrect,onEntry:this.onEntry,"show-check":`${this.showCheck}`,"is-continue-on-correct":`${this.isContinueOnCorrect}`,"is-allow-only-correct":`${this.isAllowOnlyCorrect}`,canplay:`${this.canplay}`,appendToDropOnCompletion:`${this.appendToDropOnCompletion}`,"show-prev-button":`${this.showPrevButton}`,"show-next-button":`${this.showNextButton}`,"show-drop-border":`${this.showDropBorder}`,"bg-image":this.bgImage},i("slot",{key:"4167e635d955bdd3bc713cf3eac79c437918bb3c"}))}get el(){return e(this)}};R.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 W=class{constructor(i){t(this,i),this.updateStyles=()=>{const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,t)||"200px",width:d(this.width,t)||"200px",backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:this.visible?this.display?d(this.display,t):"inline-block":"none",flexDirection:this.direction?d(this.direction,t):void 0,margin:d(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.style={},this.delayVisible=""}handleFlippedChange(){}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.updateStyles),window.addEventListener("load",this.updateStyles)}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type)}disconnectedCallback(){window.removeEventListener("resize",this.updateStyles),window.removeEventListener("load",this.updateStyles)}render(){return i(n,{key:"ab4549fc6dd8fcbd7d67e21433827bc87c1f2dbe",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},i("div",{key:"c8981d2f7c3f71b26402bfdab79f5da765b20e02",class:"card "+(this.flipped?"flipped":"")},i("div",{key:"78608648e93d368577a7c7c5a058ced227eafa44",class:"card-face card-front"},null!=this.front?this.front:i("slot",{name:"front"})),i("div",{key:"7eabba27269fb0cd827310cf4aab2d03c8031de1",class:"card-face card-back"},null!=this.back?this.back:i("slot",{name:"back"}))))}get el(){return e(this)}static get watchers(){return{flipped:["handleFlippedChange"]}}};W.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 X=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.delayVisible="",this.style=void 0}componentDidLoad(){s(this.el,this.delayVisible),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;p(i),t.addEventListener("click",(()=>{v(i)}))}))}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),zIndex:this.z,display:this.visible?"flex":"none"}}render(){return i(n,{key:"a0ff5cd4fad7b37b183bd555207ad54a9a03d26b",class:"lido-float",id:this.id,"tab-index":this.tabIndex,style:this.style},i("slot",{key:"994b173de0002b0438a84d35ad5143a83822b4e9"}))}get el(){return e(this)}};X.style=".lido-float{position:relative}.lido-float>*{position:absolute;cursor:pointer}@keyframes float-up{from{top:900px}to{top:-400px;}}";const U=class{constructor(i){t(this,i),this.NextContainerKey=t=>{null!=t&&t==this.currentContainerIndex||(w(),null!=t&&t<this.containers.length?(this.currentContainerIndex=t,m(this.currentContainerIndex)):this.currentContainerIndex<this.containers.length-1?(this.currentContainerIndex++,m(this.currentContainerIndex)):this.currentContainerIndex>=this.containers.length-1&&(b(),this.currentContainerIndex=0),this.containers=[...this.containers],this.updateArrowVisibility())},this.PrevContainerKey=t=>{console.log("👉 PrevContainerKey CALLED with index:",t),this.currentContainerIndex<=0||(w(),this.currentContainerIndex--,m(this.currentContainerIndex),this.containers=[...this.containers],this.updateArrowVisibility())},this.updateArrowVisibility=()=>{setTimeout((()=>{const t=this.el.querySelector("lido-container"),i=t.getAttribute("show-prev-button"),n=t.getAttribute("show-next-button"),e=this.el.querySelector("#lido-arrow-right");this.el.querySelector("#lido-arrow-left").style.visibility="true"!==i?"hidden":"visible","true"!==n?e.style.visibility="hidden":(e.style.pointerEvents="auto",e.style.visibility="visible")}),100)},this.popUpClick=t=>{const i=this.el.querySelector(".lido-alert-popup");this.exitFlag=!1,i&&("exit"===t?(g(),w(),i.remove()):i.remove())},this.xmlData="",this.initialIndex=0,this.canplay=!0,this.baseUrl="",this.height="",this.currentContainerIndex=this.initialIndex,this.exitFlag=!1,this.containers=[],this.showDotsandbtn=!1}componentWillLoad(){window.addEventListener(y,(()=>{this.NextContainerKey()})),window.addEventListener(x,(()=>{this.PrevContainerKey()})),window.addEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),this.parseXMLData(this.xmlData),window.addEventListener("beforeunload",(()=>{w()}))}componentDidLoad(){setTimeout((()=>{this.showDotsandbtn=!0}),10),this.updateArrowVisibility(),this.scaleNavbarContainer(),window.addEventListener("resize",(()=>{this.scaleNavbarContainer()}))}updateBackgroundImage(){const t=document.querySelector(k),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(y,(()=>{this.NextContainerKey()})),window.removeEventListener("changeContainer",(t=>{this.NextContainerKey(t.detail.index)})),window.removeEventListener(x,(()=>{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 n=t.nodeName.toLowerCase(),e={};Array.from(t.attributes).forEach((t=>{e[t.name]=t.value}));const r=Array.from(t.childNodes).map((t=>1===t.nodeType?this.parseElement(t):3===t.nodeType&&""!==t.textContent.trim()?t.textContent:null)).filter(Boolean),o={"lido-container":i("lido-container",Object.assign({},e,{canplay:this.canplay,baseUrl:this.baseUrl,height:this.height}),r),"lido-flash-card":i("lido-flash-card",Object.assign({},e),r),"lido-col":i("lido-col",Object.assign({},e),r),"lido-trace":i("lido-trace",Object.assign({},e),r),"lido-image":i("lido-image",Object.assign({},e),r),"lido-row":i("lido-row",Object.assign({},e),r),"lido-text":i("lido-text",Object.assign({},e),r),"lido-pos":i("lido-pos",Object.assign({},e),r),"lido-shape":i("lido-shape",Object.assign({},e),r),"lido-wrap":i("lido-wrap",Object.assign({},e),r),"lido-random":i("lido-random",Object.assign({},e),r),"lido-avatar":i("lido-avatar",Object.assign({},e),r),"lido-cell":i("lido-cell",Object.assign({},e),r),"lido-slide-fill":i("lido-slide-fill",Object.assign({},e),r),"lido-float":i("lido-float",Object.assign({},e),r)};return o[n]?o[n]:(console.warn(`Unknown tag: ${n}`),null)}parseContainers(t){const i=t.querySelectorAll("lido-container"),n=Array.from(i).map((t=>()=>this.parseElement(t)));this.containers=n}async btnpopup(){T(!1),await _.getI().stop();const t=document.getElementById(k).querySelectorAll("*");for(const i of Array.from(t)){if(M())break;const t=i.getAttribute("tab-index"),n=i;if(t&&Number(t)>0){if(await _.getI().play(n),M()){await _.getI().stop();break}await new Promise((t=>setTimeout(t,300)))}}}scaleNavbarContainer(){setTimeout((()=>{const t=document.querySelector(".lido-dot-container");t&&((1600===window.innerWidth&&900===window.innerHeight||900===window.innerWidth&&1600===window.innerHeight)&&document.querySelectorAll(".lido-exit-button, #main-audio").forEach((t=>{t.style.marginLeft="10px",t.style.marginRight="10px"})),t.style.top=window.innerWidth>window.innerHeight?"6%":"3.5%",t.style.transform="translate(-50%, -50%)",t.style.visibility="visible",Array.from(t.children).forEach((t=>{t.style.transform=`scale(${f()})`})),t.style.width=window.outerWidth+"px")}),700)}renderDots(){const t={pointerEvents:this.canplay?"none":""};return i("div",{id:"lido-dot-indicator",class:"lido-dot-container"},i("div",{class:"lido-exit-button popup\n -button",onClick:()=>{this.exitFlag=!0,_.getI().stop()}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.svg"})),i("div",{class:"lido-btn-dot-container"},i("div",{id:"lido-arrow-left",onClick:()=>{j()}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.svg"})),this.containers.map(((n,e)=>i("div",{class:"parent_dots"},i("span",{class:"lido-dot "+(e<this.currentContainerIndex?"completed":e===this.currentContainerIndex?"current":""),onClick:()=>this.jumpToContainer(e),style:t})))),i("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"),C("this.nextBtn='true'",t.currentTarget)}},i("lido-image",{src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.svg"}))),i("div",{id:"main-audio",class:"popup-button",onClick:()=>this.btnpopup()},i("lido-image",{visible:"true",src:"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Audio%20icon.svg"})))}jumpToContainer(t){this.NextContainerKey(t)}render(){var t,e;return console.log("🚀 ~ LidoHome ~ render ~ this.containers:",this),this.xmlData?i(n,{class:"lido-home",index:this.currentContainerIndex,totalIndex:this.containers.length},i("div",{key:this.currentContainerIndex},null===(e=(t=this.containers)[this.currentContainerIndex])||void 0===e?void 0:e.call(t)),this.renderDots(),this.exitFlag&&i("div",{class:"lido-alert-parent"},i("div",{class:"lido-alert-popup"},i("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)';"},i("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';"}),i("lido-cell",{visible:"true",layout:"row",width:"294px",class:"btn-cell"},i("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"}),i("lido-text",{visible:"true",string:"KEEP 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"})))))):i("div",null,"Please provide XML data.")}get el(){return e(this)}static get watchers(){return{xmlData:["onXmlDataChange"]}}};U.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}.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;gap:145px}.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}@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}}.lido-snackbar{visibility:visible;min-width:250px;background-color:#333;color:#fff;text-align:center;border-radius:2px;padding:16px;position:fixed;z-index:1;bottom:30px;left:50%;transform:translateX(-50%);font-size:17px}.lido-dot-container{display:flex;justify-content:space-between;align-items:center;visibility:hidden;position:absolute;left:50%;padding:0 5px;z-index:1;width:100vw;max-width:100vw;box-sizing:border-box;height:0px}.lido-dot{height:18px;width:18px;margin:0 4px;background-color:#bbb;border-radius:50%;display:inline-block;transition:background-color 0.3s;cursor:pointer;z-index:1}.lido-btn-dot-container{flex-shrink:1;flex-grow:1;display:flex;justify-content:center;align-items:center;text-align:center;z-index:1;min-width:0;height:0px}.lido-dot.completed{background-color:grey}.lido-dot.current{background-color:green}.lido-dot:not(.completed):not(.current){background-color:#bbb}#lido-arrow-left,#lido-arrow-right{width:88px;height:88px;display:flex;align-items:center;justify-content:center;border-radius:12px;z-index:1000;box-shadow:0px 8px 0px 0px #8b310f;background-color:#f34d08;cursor:pointer;visibility:hidden;flex-shrink:0}#lido-arrow-left:active,#lido-arrow-right:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px}.navbar{display:flex;justify-content:center}.lido-exit-button,#main-audio{width:80px;height:80px;z-index:1000;cursor:pointer;background-color:white;display:flex;align-items:center;justify-content:center;border:4px solid #f34d08;border-radius:16px;box-shadow:0px 8px #f34d08;flex-shrink:0;}#main-audio:active,.popup-button:active .lido-exit-button:active{margin-bottom:-8px;box-shadow:0px 0px 0px 0px !important}.lido-alert-popup{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:1000}@media (max-width: 768px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0 8px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0 8px}.lido-dot{height:16px;width:16px;margin:0 2.5px}}@media (max-width: 480px){#lido-arrow-left,#lido-arrow-right{width:74px;height:74px;margin:0px 5px}.lido-exit-button,#main-audio{width:65px;height:65px;margin:0px 5px}.lido-dot{height:15px;width:15px;margin:0 1.5px}.lido-dot-container{padding:0 3px}}@media (max-width: 375px){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 3px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 3px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 2px}}@media (max-width: 320px){#lido-arrow-left,#lido-arrow-right,.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 2px}.lido-dot{height:12px;width:12px;margin:0 0.5px}.lido-dot-container{padding:0 2px}}@media (max-width: 900px) and (orientation: landscape){#lido-arrow-left,#lido-arrow-right{width:70px;height:70px;margin:0px 5px}.lido-exit-button,#main-audio{width:70px;height:70px;margin:0px 5px}.lido-dot{height:14px;width:14px;margin:0 1px}.lido-dot-container{padding:0 5px}}.popup-exit-text{white-space:nowrap;font-size:22px;font-weight:600;margin-top:-8%}.lido-alert-parent{z-index:10000 !important;position:absolute;top:0;left:0}.popup-button{width:80px;height:80px;z-index:1000;cursor:pointer;display:flex;align-items:center;justify-content:center;border:4px solid #F34D08;border-radius:16px;box-shadow:0 8px 0 #F34D08}.nav-for-lanai{position:absolute;top:0%;left:0%;max-width:none;width:100%;height:auto;visibility:visible}";var N,Y={exports:{}},B={},H={},G={};N=G,Object.defineProperty(N,"__esModule",{value:!0}),N.MUST_INSTALL_PUPPETEER=N.DEFAULT_CONVERSION_ERROR_MESSAGE=N.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=N.UNEXPECTED_ERROR_MESSAGE_LINK=N.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,N.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",N.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",N.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=N.UNEXPECTED_ERROR_MESSAGE_PREFIX+N.UNEXPECTED_ERROR_MESSAGE_LINK,N.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",N.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(H,"__esModule",{value:!0}),H.ErrorHandling=void 0;const V=G;class q{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,i,n){const e=[`Input ${t} color string could not be parsed.`,`String received: ${i}.`];return n&&e.splice(1,0,`Expected format: ${n}.`),e.join(" ")}static generateUnexpectedError(t){return q.generateErrorResult(`${V.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${t.message}`)}static hasError(t){return!!t.errorMessage}}H.ErrorHandling=q;var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.SheenUtil=void 0;class J{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}K.SheenUtil=J,J.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)";var Q={};!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"}(Q);var Z={},tt={},it={};Object.defineProperty(it,"__esModule",{value:!0}),it.RgbColor=void 0,it.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,n){this.r=this.clamp(t),this.g=this.clamp(i),this.b=this.clamp(n)}multiply(t){const i=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),n=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),e=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=i,this.g=n,this.b=e}hueRotate(t=0){t=t/180*Math.PI;const i=Math.sin(t),n=Math.cos(t);this.multiply([.213+.787*n-.213*i,.715-.715*n-.715*i,.072-.072*n+.928*i,.213-.213*n+.143*i,.715+.285*n+.14*i,.072-.072*n-.283*i,.213-.213*n-.787*i,.715-.715*n+.715*i,.072+.928*n+.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(tt,"__esModule",{value:!0}),tt.RgbToFilterWorker=void 0;const nt=K,et=it;class rt{constructor(t,i){this.targetRgbColor=t,this.reusedRgbColor=new et.RgbColor,this.addSheen=i}static fmt(t,i,n=1){return Math.round(t[i]*n)}generateCss(t){return`${this.addSheen?`${nt.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${rt.fmt(t,0)}%) sepia(${rt.fmt(t,1)}%) saturate(${rt.fmt(t,2)}%) hue-rotate(${rt.fmt(t,3,3.6)}deg) brightness(${rt.fmt(t,4)}%) contrast(${rt.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 n=100;return 2===i?n=7500:4!==i&&5!==i||(n=200),3===i?t>n?t%=n:t<0&&(t=n+t%n):t<0?t=0:t>n&&(t=n),t}spsa(t,i,n,e,r){let o=[],s=1/0;const a=new Array(6),h=new Array(6),c=new Array(6);for(let u=0;u<r;u+=1){const r=n/Math.pow(u+1,.16666666666666666);for(let t=0;t<6;t+=1)a[t]=Math.random()>.5?1:-1,h[t]=e[t]+r*a[t],c[t]=e[t]-r*a[t];const l=this.loss(h)-this.loss(c);for(let n=0;n<6;n+=1){const o=l/(2*r)*a[n],s=i[n]/Math.pow(t+u+1,1);e[n]=rt.fixSpsa(e[n]-s*o,n)}const d=this.loss(e);d<s&&(o=e.slice(0),s=d)}return{values:o,loss:s}}solveNarrow(t){const i=t.loss,n=i+1;return this.spsa(i,[.25*n,.25*n,n,.25*n,.2*n,.2*n],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let i={values:[],loss:1/0};for(let n=0;i.loss>25&&n<3;n+=1){const n=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);n.loss<i.loss&&(i=n)}return i}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}tt.RgbToFilterWorker=rt,Object.defineProperty(Z,"__esModule",{value:!0}),Z.RgbToFilter=void 0;const ot=H,st=G,at=tt,ht=it;class ct{static generateConversionError(t){return ot.ErrorHandling.generateErrorResult(t||st.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(t){return ot.ErrorHandling.generateErrorResult(t)}static execute(t,i){const n=new ht.RgbColor(t);return new at.RgbToFilterWorker(n,i).convert()}static convertToRGB(t,i){return t&&i?i(t):null}static convert(t){try{const{colorString:i,validateAndParse:n,convertToRgb:e,conversionErrorMessage:r,addSheen:o}=t,s=i.trim().toLocaleLowerCase(),a=(null==n?void 0:n(s))||{color:s};if(ot.ErrorHandling.hasError(a))return ct.generateValidateAndParseError(a.errorMessage);const h=ct.convertToRGB(a.color,e)||a.color;return h?ct.execute(h,o):ct.generateConversionError(r)}catch(t){return ot.ErrorHandling.generateUnexpectedError(t)}}}Z.RgbToFilter=ct;var ut={},lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.MATCH_HEXADECIMAL=lt.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,lt.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,lt.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i;var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.MAX_COLOR_INPUT_STRING_LENGTH=void 0,dt.MAX_COLOR_INPUT_STRING_LENGTH=25;var ft={};!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"}(ft);var pt={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]},vt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ut,"__esModule",{value:!0}),ut.ColorParser=void 0;const wt=lt,mt=H,bt=dt,gt=ft,yt=Q,xt=vt(pt);class kt{static validateAndParseHex(t){return t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(wt.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.HEX,t,gt.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH){const i=t.match(wt.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(wt.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=kt.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:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.RGB,t,gt.ColorFormats.RGB)}}static validateAndParseHsl(t){const i=kt.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:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.HSL,t,gt.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<bt.MAX_COLOR_INPUT_STRING_LENGTH&&xt.default[t]?{color:t}:{errorMessage:mt.ErrorHandling.generateInputErrorMessage(yt.ColorTypes.KEYWORD,t,gt.ColorFormats.KEYWORD)}}}ut.ColorParser=kt;const _t=pt,Mt={};for(const t of Object.keys(_t))Mt[_t[t]]=t;const jt={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 Ct=jt;for(const t of Object.keys(jt)){if(!("channels"in jt[t]))throw new Error("missing channels property: "+t);if(!("labels"in jt[t]))throw new Error("missing channel labels property: "+t);if(jt[t].labels.length!==jt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:i,labels:n}=jt[t];delete jt[t].channels,delete jt[t].labels,Object.defineProperty(jt[t],"channels",{value:i}),Object.defineProperty(jt[t],"labels",{value:n})}jt.rgb.hsl=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.min(i,n,e),o=Math.max(i,n,e),s=o-r;let a,h;o===r?a=0:i===o?a=(n-e)/s:n===o?a=2+(e-i)/s:e===o&&(a=4+(i-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+o)/2;return h=o===r?0:c<=.5?s/(o+r):s/(2-o-r),[a,100*h,100*c]},jt.rgb.hsv=function(t){let i,n,e,r,o;const s=t[0]/255,a=t[1]/255,h=t[2]/255,c=Math.max(s,a,h),u=c-Math.min(s,a,h),l=function(t){return(c-t)/6/u+.5};return 0===u?(r=0,o=0):(o=u/c,i=l(s),n=l(a),e=l(h),s===c?r=e-n:a===c?r=1/3+i-e:h===c&&(r=2/3+n-i),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*c]},jt.rgb.hwb=function(t){const i=t[0],n=t[1];let e=t[2];const r=jt.rgb.hsl(t)[0],o=1/255*Math.min(i,Math.min(n,e));return e=1-1/255*Math.max(i,Math.max(n,e)),[r,100*o,100*e]},jt.rgb.cmyk=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.min(1-i,1-n,1-e);return[100*((1-i-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*((1-e-r)/(1-r)||0),100*r]},jt.rgb.keyword=function(t){const i=Mt[t];if(i)return i;let n,e=1/0;for(const i of Object.keys(_t)){const s=((r=t)[0]-(o=_t[i])[0])**2+(r[1]-o[1])**2+(r[2]-o[2])**2;s<e&&(e=s,n=i)}var r,o;return n},jt.keyword.rgb=function(t){return _t[t]},jt.rgb.xyz=function(t){let i=t[0]/255,n=t[1]/255,e=t[2]/255;return i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,[100*(.4124*i+.3576*n+.1805*e),100*(.2126*i+.7152*n+.0722*e),100*(.0193*i+.1192*n+.9505*e)]},jt.rgb.lab=function(t){const i=jt.rgb.xyz(t);let n=i[0],e=i[1],r=i[2];return n/=95.047,e/=100,r/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*e-16,500*(n-e),200*(e-r)]},jt.hsl.rgb=function(t){const i=t[0]/360,n=t[1]/100,e=t[2]/100;let r,o,s;if(0===n)return s=255*e,[s,s,s];r=e<.5?e*(1+n):e+n-e*n;const a=2*e-r,h=[0,0,0];for(let t=0;t<3;t++)o=i+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?a+6*(r-a)*o:2*o<1?r:3*o<2?a+(r-a)*(2/3-o)*6:a,h[t]=255*s;return h},jt.hsl.hsv=function(t){const i=t[0];let n=t[1]/100,e=t[2]/100,r=n;const o=Math.max(e,.01);return e*=2,n*=e<=1?e:2-e,r*=o<=1?o:2-o,[i,100*(0===e?2*r/(o+r):2*n/(e+n)),(e+n)/2*100]},jt.hsv.rgb=function(t){const i=t[0]/60,n=t[1]/100;let e=t[2]/100;const r=Math.floor(i)%6,o=i-Math.floor(i),s=255*e*(1-n),a=255*e*(1-n*o),h=255*e*(1-n*(1-o));switch(e*=255,r){case 0:return[e,h,s];case 1:return[a,e,s];case 2:return[s,e,h];case 3:return[s,a,e];case 4:return[h,s,e];case 5:return[e,s,a]}},jt.hsv.hsl=function(t){const i=t[0],n=t[1]/100,e=t[2]/100,r=Math.max(e,.01);let o,s;s=(2-n)*e;const a=(2-n)*r;return o=n*r,o/=a<=1?a:2-a,o=o||0,s/=2,[i,100*o,100*s]},jt.hwb.rgb=function(t){const i=t[0]/360;let n=t[1]/100,e=t[2]/100;const r=n+e;let o;r>1&&(n/=r,e/=r);const s=Math.floor(6*i),a=1-e;o=6*i-s,1&s&&(o=1-o);const h=n+o*(a-n);let c,u,l;switch(s){default:case 6:case 0:c=a,u=h,l=n;break;case 1:c=h,u=a,l=n;break;case 2:c=n,u=a,l=h;break;case 3:c=n,u=h,l=a;break;case 4:c=h,u=n,l=a;break;case 5:c=a,u=n,l=h}return[255*c,255*u,255*l]},jt.cmyk.rgb=function(t){const i=t[1]/100,n=t[2]/100,e=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-e)+e)),255*(1-Math.min(1,i*(1-e)+e)),255*(1-Math.min(1,n*(1-e)+e))]},jt.xyz.rgb=function(t){const i=t[0]/100,n=t[1]/100,e=t[2]/100;let r,o,s;return r=3.2406*i+-1.5372*n+-.4986*e,o=-.9689*i+1.8758*n+.0415*e,s=.0557*i+-.204*n+1.057*e,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[255*r,255*o,255*s]},jt.xyz.lab=function(t){let i=t[0],n=t[1],e=t[2];return i/=95.047,n/=100,e/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,e=e>.008856?e**(1/3):7.787*e+16/116,[116*n-16,500*(i-n),200*(n-e)]},jt.lab.xyz=function(t){let i,n,e;n=(t[0]+16)/116,i=t[1]/500+n,e=n-t[2]/200;const r=n**3,o=i**3,s=e**3;return n=r>.008856?r:(n-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,i*=95.047,n*=100,e*=108.883,[i,n,e]},jt.lab.lch=function(t){const i=t[0],n=t[1],e=t[2];let r;return r=360*Math.atan2(e,n)/2/Math.PI,r<0&&(r+=360),[i,Math.sqrt(n*n+e*e),r]},jt.lch.lab=function(t){const i=t[1],n=t[2]/360*2*Math.PI;return[t[0],i*Math.cos(n),i*Math.sin(n)]},jt.rgb.ansi16=function(t,i=null){const[n,e,r]=t;let o=null===i?jt.rgb.hsv(t)[2]:i;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(r/255)<<2|Math.round(e/255)<<1|Math.round(n/255));return 2===o&&(s+=60),s},jt.hsv.ansi16=function(t){return jt.rgb.ansi16(jt.hsv.rgb(t),t[2])},jt.rgb.ansi256=function(t){const i=t[0],n=t[1],e=t[2];return i===n&&n===e?i<8?16:i>248?231:Math.round((i-8)/247*24)+232:16+36*Math.round(i/255*5)+6*Math.round(n/255*5)+Math.round(e/255*5)},jt.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 n=.5*(1+~~(t>50));return[(1&i)*n*255,(i>>1&1)*n*255,(i>>2&1)*n*255]},jt.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]},jt.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},jt.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 n=i[0];3===i[0].length&&(n=n.split("").map((t=>t+t)).join(""));const e=parseInt(n,16);return[e>>16&255,e>>8&255,255&e]},jt.rgb.hcg=function(t){const i=t[0]/255,n=t[1]/255,e=t[2]/255,r=Math.max(Math.max(i,n),e),o=Math.min(Math.min(i,n),e),s=r-o;let a,h;return a=s<1?o/(1-s):0,h=s<=0?0:r===i?(n-e)/s%6:r===n?2+(e-i)/s:4+(i-n)/s,h/=6,h%=1,[360*h,100*s,100*a]},jt.hsl.hcg=function(t){const i=t[1]/100,n=t[2]/100,e=n<.5?2*i*n:2*i*(1-n);let r=0;return e<1&&(r=(n-.5*e)/(1-e)),[t[0],100*e,100*r]},jt.hsv.hcg=function(t){const i=t[2]/100,n=t[1]/100*i;let e=0;return n<1&&(e=(i-n)/(1-n)),[t[0],100*n,100*e]},jt.hcg.rgb=function(t){const i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];const e=[0,0,0],r=t[0]/360%1*6,o=r%1,s=1-o;let a=0;switch(Math.floor(r)){case 0:e[0]=1,e[1]=o,e[2]=0;break;case 1:e[0]=s,e[1]=1,e[2]=0;break;case 2:e[0]=0,e[1]=1,e[2]=o;break;case 3:e[0]=0,e[1]=s,e[2]=1;break;case 4:e[0]=o,e[1]=0,e[2]=1;break;default:e[0]=1,e[1]=0,e[2]=s}return a=(1-i)*n,[255*(i*e[0]+a),255*(i*e[1]+a),255*(i*e[2]+a)]},jt.hcg.hsv=function(t){const i=t[1]/100,n=i+t[2]/100*(1-i);let e=0;return n>0&&(e=i/n),[t[0],100*e,100*n]},jt.hcg.hsl=function(t){const i=t[1]/100,n=t[2]/100*(1-i)+.5*i;let e=0;return n>0&&n<.5?e=i/(2*n):n>=.5&&n<1&&(e=i/(2*(1-n))),[t[0],100*e,100*n]},jt.hcg.hwb=function(t){const i=t[1]/100,n=i+t[2]/100*(1-i);return[t[0],100*(n-i),100*(1-n)]},jt.hwb.hcg=function(t){const i=1-t[2]/100,n=i-t[1]/100;let e=0;return n<1&&(e=(i-n)/(1-n)),[t[0],100*n,100*e]},jt.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},jt.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},jt.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},jt.gray.hsl=function(t){return[0,0,t[0]]},jt.gray.hsv=jt.gray.hsl,jt.gray.hwb=function(t){return[0,100,t[0]]},jt.gray.cmyk=function(t){return[0,0,0,t[0]]},jt.gray.lab=function(t){return[t[0],0,0]},jt.gray.hex=function(t){const i=255&Math.round(t[0]/100*255),n=((i<<16)+(i<<8)+i).toString(16).toUpperCase();return"000000".substring(n.length)+n},jt.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const Tt=Ct;function $t(t,i){return function(n){return i(t(n))}}function Pt(t,i){const n=[i[t].parent,t];let e=Tt[i[t].parent][t],r=i[t].parent;for(;i[r].parent;)n.unshift(i[r].parent),e=$t(Tt[i[r].parent][r],e),r=i[r].parent;return e.conversion=n,e}const Ot=Ct,At=function(t){const i=function(t){const i=function(){const t={},i=Object.keys(Tt);for(let n=i.length,e=0;e<n;e++)t[i[e]]={distance:-1,parent:null};return t}(),n=[t];for(i[t].distance=0;n.length;){const t=n.pop(),e=Object.keys(Tt[t]);for(let r=e.length,o=0;o<r;o++){const r=e[o],s=i[r];-1===s.distance&&(s.distance=i[t].distance+1,s.parent=t,n.unshift(r))}}return i}(t),n={},e=Object.keys(i);for(let t=e.length,r=0;r<t;r++){const t=e[r];null!==i[t].parent&&(n[t]=Pt(t,i))}return n},Et={};Object.keys(Ot).forEach((t=>{Et[t]={},Object.defineProperty(Et[t],"channels",{value:Ot[t].channels}),Object.defineProperty(Et[t],"labels",{value:Ot[t].labels});const i=At(t);Object.keys(i).forEach((n=>{const e=i[n];Et[t][n]=function(t){const i=function(...i){const n=i[0];if(null==n)return n;n.length>1&&(i=n);const e=t(i);if("object"==typeof e)for(let t=e.length,i=0;i<t;i++)e[i]=Math.round(e[i]);return e};return"conversion"in t&&(i.conversion=t.conversion),i}(e),Et[t][n].raw=function(t){const i=function(...i){const n=i[0];return null==n?n:(n.length>1&&(i=n),t(i))};return"conversion"in t&&(i.conversion=t.conversion),i}(e)}))}));var St=Et,Dt=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(B,"__esModule",{value:!0}),B.ColorToFilter=void 0;const It=H,zt=K,Ft=Q,Lt=Z,Rt=ut,Wt=Dt(St);B.ColorToFilter=class{static rgbToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseRgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static hexToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseHex,convertToRgb:Wt.default.hex.rgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static hslToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseHsl,convertToRgb:Wt.default.hsl.rgb,addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}static keywordToFilter(t,i){return Lt.RgbToFilter.convert({colorString:t,validateAndParse:Rt.ColorParser.validateAndParseKeyword,convertToRgb:Wt.default.keyword.rgb,conversionErrorMessage:It.ErrorHandling.generateInputErrorMessage(Ft.ColorTypes.KEYWORD,t),addSheen:zt.SheenUtil.parseSheenFromOptions(i)})}};var Xt={},Ut={},Nt={},Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.FilterToHexShared=void 0;const Bt=H,Ht=ft,Gt=Q;Yt.FilterToHexShared=class{static generateInputErrorMessage(t){return Bt.ErrorHandling.generateInputErrorMessage(Gt.ColorTypes.FILTER,t,Ht.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,i=1){const n=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}(),e=function(){const n="http://www.w3.org/2000/svg",e=document.createElementNS(n,"svg");e.style.height="inherit",e.style.width="inherit",e.style.float="left",e.style.filter=t;const r=document.createElementNS(n,"rect");return r.setAttributeNS(null,"width",i.toString()),r.setAttributeNS(null,"height",i.toString()),e.appendChild(r),e}();return""===e.style.filter?{errorMessage:"error indicator",svgContainerElement:n}:(n.appendChild(e),document.body.appendChild(n),{svgContainerElement:n})}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,n){if(t>255||i>255||n>255)throw new Error("Invalid color component");return(t<<16|i<<8|n).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 Vt,qt={exports:{}};Vt=qt,function(){var t=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:i,mimeType:function(t){var n,e;return(n="application/font-woff",e="image/jpeg",{woff:n,woff2:n,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:e,jpeg:e,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 n=window.atob(t.toDataURL().split(",")[1]),e=n.length,r=new Uint8Array(e),o=0;o<e;o++)r[o]=n.charCodeAt(o);i(new Blob([r],{type:"image/png"}))}))}(t)},resolveUrl:function(t,i){var n=document.implementation.createHTMLDocument(),e=n.createElement("base");n.head.appendChild(e);var r=n.createElement("a");return n.body.appendChild(r),e.href=i,r.href=t,r.href},getAndEncode:function(t){return o.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(i){var n,e=new XMLHttpRequest;if(e.onreadystatechange=function(){if(4===e.readyState)if(200===e.status){var r=new FileReader;r.onloadend=function(){var t=r.result.split(/,/)[1];i(t)},r.readAsDataURL(e.response)}else n?i(n):s("cannot fetch resource: "+t+", status: "+e.status)},e.ontimeout=function(){n?i(n):s("timeout of 30000ms occured while fetching resource: "+t)},e.responseType="blob",e.timeout=3e4,e.open("GET",t,!0),e.send(),o.impl.options.imagePlaceholder){var r=o.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(n=r[1])}function s(t){console.error(t),i("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(i){return new Promise((function(n){setTimeout((function(){n(i)}),t)}))}},asArray:function(t){for(var i=[],n=t.length,e=0;e<n;e++)i.push(t[e]);return i},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(i,n){var e=new Image;e.onload=function(){i(e)},e.onerror=n,e.src=t}))},width:function(t){var i=n(t,"border-left-width"),e=n(t,"border-right-width");return t.scrollWidth+i+e},height:function(t){var i=n(t,"border-top-width"),e=n(t,"border-bottom-width");return t.scrollHeight+i+e}};var t;function i(t){var i=/\.([^\.\/]*?)$/g.exec(t);return i?i[1]:""}function n(t,i){var n=window.getComputedStyle(t).getPropertyValue(i);return parseFloat(n.replace("px",""))}}(),i=function(){var i=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,i,o){return n(t)?Promise.resolve(t).then(e).then((function(n){var e=Promise.resolve(t);return n.forEach((function(t){e=e.then((function(n){return r(n,t,i,o)}))})),e})):Promise.resolve(t)},shouldProcess:n,impl:{readUrls:e,inline:r}};function n(t){return-1!==t.search(i)}function e(n){for(var e,r=[];null!==(e=i.exec(n));)r.push(e[1]);return r.filter((function(i){return!t.isDataUrl(i)}))}function r(i,n,e,r){return Promise.resolve(n).then((function(i){return e?t.resolveUrl(i,e):i})).then(r||t.getAndEncode).then((function(i){return t.dataAsUrl(i,t.mimeType(n))})).then((function(e){return i.replace(function(i){return new RegExp("(url\\(['\"]?)("+t.escape(i)+")(['\"]?\\))","g")}(n),"$1"+e+"$3")}))}}(),n=function(){return{resolveAll:function(){return n().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:n}};function n(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(i){var n=[];return i.forEach((function(i){try{t.asArray(i.cssRules||[]).forEach(n.push.bind(n))}catch(t){console.log("Error while reading CSS rules from "+i.href,t.toString())}})),n})).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(n)}));function n(t){return{resolve:function(){return i.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),e=function(){return{inlineAll:function e(r){return r instanceof Element?function(t){var n=t.style.getPropertyValue("background");return n?i.inlineAll(n).then((function(i){t.style.setProperty("background",i,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(r).then((function(){return r instanceof HTMLImageElement?n(r).inline():Promise.all(t.asArray(r.childNodes).map((function(t){return e(t)})))})):Promise.resolve(r)},impl:{newImage:n}};function n(i){return{inline:function(n){return t.isDataUrl(i.src)?Promise.resolve():Promise.resolve(i.src).then(n||t.getAndEncode).then((function(n){return t.dataAsUrl(n,t.mimeType(i.src))})).then((function(t){return new Promise((function(n,e){i.onload=n,i.onerror=e,i.src=t}))}))}}}}(),r={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:s,toPng:function(t,i){return a(t,i||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,i){return a(t,i=i||{}).then((function(t){return t.toDataURL("image/jpeg",i.quality||1)}))},toBlob:function(i,n){return a(i,n||{}).then(t.canvasToBlob)},toPixelData:function(i,n){return a(i,n||{}).then((function(n){return n.getContext("2d").getImageData(0,0,t.width(i),t.height(i)).data}))},impl:{fontFaces:n,images:e,util:t,inliner:i,options:{}}};function s(i,n){return function(t){o.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?r.imagePlaceholder:t.imagePlaceholder,o.impl.options.cacheBust=void 0===t.cacheBust?r.cacheBust:t.cacheBust}(n=n||{}),Promise.resolve(i).then((function(t){return h(t,n.filter,!0)})).then(c).then(u).then((function(t){return n.bgcolor&&(t.style.backgroundColor=n.bgcolor),n.width&&(t.style.width=n.width+"px"),n.height&&(t.style.height=n.height+"px"),n.style&&Object.keys(n.style).forEach((function(i){t.style[i]=n.style[i]})),t})).then((function(e){return function(i,n,e){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="'+n+'" height="'+e+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(e,n.width||t.width(i),n.height||t.height(i))}))}function a(i,n){return s(i,n).then(t.makeImage).then(t.delay(100)).then((function(e){var r=function(i){var e=document.createElement("canvas");if(e.width=n.width||t.width(i),e.height=n.height||t.height(i),n.bgcolor){var r=e.getContext("2d");r.fillStyle=n.bgcolor,r.fillRect(0,0,e.width,e.height)}return e}(i);return r.getContext("2d").drawImage(e,0,0),r}))}function h(i,n,e){return e||!n||n(i)?Promise.resolve(i).then((function(i){return i instanceof HTMLCanvasElement?t.makeImage(i.toDataURL()):i.cloneNode(!1)})).then((function(e){return function(i,n,e){var r=i.childNodes;return 0===r.length?Promise.resolve(n):function(t,i,n){var e=Promise.resolve();return i.forEach((function(i){e=e.then((function(){return h(i,n)})).then((function(i){i&&t.appendChild(i)}))})),e}(n,t.asArray(r),e).then((function(){return n}))}(i,e,n)})).then((function(n){return function(i,n){return n instanceof Element?Promise.resolve().then((function(){e=window.getComputedStyle(i),r=n.style,e.cssText?r.cssText=e.cssText:function(i,n){t.asArray(i).forEach((function(t){n.setProperty(t,i.getPropertyValue(t),i.getPropertyPriority(t))}))}(e,r);var e,r})).then((function(){[":before",":after"].forEach((function(e){!function(e){var r=window.getComputedStyle(i,e),o=r.getPropertyValue("content");if(""!==o&&"none"!==o){var s=t.uid();n.className=n.className+" "+s;var a=document.createElement("style");a.appendChild(function(i,n,e){var r="."+i+":"+n,o=e.cssText?s(e):a(e);return document.createTextNode(r+"{"+o+"}");function s(t){var i=t.getPropertyValue("content");return t.cssText+" content: "+i+";"}function a(i){return t.asArray(i).map(n).join("; ")+";";function n(t){return t+": "+i.getPropertyValue(t)+(i.getPropertyPriority(t)?" !important":"")}}}(s,e,r)),n.appendChild(a)}}(e)}))})).then((function(){i instanceof HTMLTextAreaElement&&(n.innerHTML=i.value),i instanceof HTMLInputElement&&n.setAttribute("value",i.value)})).then((function(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach((function(t){var i=n.getAttribute(t);i&&n.style.setProperty(t,i)})))})).then((function(){return n})):n}(i,n)})):Promise.resolve()}function c(t){return n.resolveAll().then((function(i){var n=document.createElement("style");return t.appendChild(n),n.appendChild(document.createTextNode(i)),t}))}function u(t){return e.inlineAll(t).then((function(){return t}))}Vt.exports=o}();var Kt=o&&o.__createBinding||(Object.create?function(t,i,n,e){void 0===e&&(e=n);var r=Object.getOwnPropertyDescriptor(i,n);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(t,e,r)}:function(t,i,n,e){void 0===e&&(e=n),t[e]=i[n]}),Jt=o&&o.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),Qt=o&&o.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&Kt(i,t,n);return Jt(i,t),i};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.FilterToHexBrowser=void 0;const Zt=H,ti=Yt;class ii extends ti.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,i){const n=ti.FilterToHexShared.generateInputErrorMessage(t),e=Zt.ErrorHandling.generateErrorResult(n);return ii.cleanup(i),e}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>Qt(qt.exports)))).toPng(t)}static async convert(t){const{errorMessage:i,svgContainerElement:n}=ti.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(i)return ii.returnInputError(t,n);const e=await ii.getImageBase64ViaSVG(n),r=await ti.FilterToHexShared.getColorViaImageDataURL(e);return ii.cleanup(n),{color:r}}}Nt.FilterToHexBrowser=ii;var ni=o&&o.__createBinding||(Object.create?function(t,i,n,e){void 0===e&&(e=n);var r=Object.getOwnPropertyDescriptor(i,n);r&&!("get"in r?!i.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return i[n]}}),Object.defineProperty(t,e,r)}:function(t,i,n,e){void 0===e&&(e=n),t[e]=i[n]}),ei=o&&o.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),ri=o&&o.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&ni(i,t,n);return ei(i,t),i};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.FilterToHex=void 0;const oi=H,si=Nt;Ut.FilterToHex=class{static async convert(t,i,n){try{let e;if("undefined"==typeof window){const{FilterToHexNode:i}=await Promise.resolve().then((()=>ri(require("./workers/node"))));e=await i.convert(t)}else e=await si.FilterToHexBrowser.convert(t);return e.color&&i&&"string"==typeof e.color&&(e.color=i(e.color,n)),e}catch(t){return oi.ErrorHandling.generateUnexpectedError(t)}}};var ai={},hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.ColorFormatter=void 0,hi.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 ci=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0}),ai.HexToColor=void 0;const ui=hi,li=ci(St);ai.HexToColor=class{static convertToRgb(t,i){const n=li.default.hex.rgb(t);return"string"===(null==i?void 0:i.resultType)?ui.ColorFormatter.arrayToRgbString(n):n}static convertToHsl(t,i){const n=li.default.hex.hsl(t);return"string"===(null==i?void 0:i.resultType)?ui.ColorFormatter.arrayToHslString(n):n}},Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.FilterToColor=void 0;const di=Ut,fi=ai;Xt.FilterToColor=class{static async filterToHex(t){const i=await di.FilterToHex.convert(t);return i.color&&(i.color=i.color.toUpperCase()),i}static async filterToRgb(t,i){return di.FilterToHex.convert(t,fi.HexToColor.convertToRgb,i)}static async filterToHsl(t,i){return di.FilterToHex.convert(t,fi.HexToColor.convertToHsl,i)}},function(t,i){Object.defineProperty(i,"__esModule",{value:!0});const n=B,e=Xt;class r{static rgbToFilter(t,i){return n.ColorToFilter.rgbToFilter(t,i)}static hexToFilter(t,i){return n.ColorToFilter.hexToFilter(t,i)}static hslToFilter(t,i){return n.ColorToFilter.hslToFilter(t,i)}static keywordToFilter(t,i){return n.ColorToFilter.keywordToFilter(t,i)}static async filterToHex(t){return e.FilterToColor.filterToHex(t)}static async filterToRgb(t,i){return e.FilterToColor.filterToRgb(t,i)}static async filterToHsl(t,i){return e.FilterToColor.filterToHsl(t,i)}}i.default=r,t.exports=r}(Y,Y.exports);const pi=$(Y.exports),vi=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=""}componentDidLoad(){if(s(this.el,this.delayVisible),a(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${pi.hexToFilter(P(this.filter).toHexString()).color}`)}this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:d(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:d(this.margin,t),padding:d(this.padding,t),transform:d(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${h(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(${h(this.src)})`:"none"}}render(){return"true"===this.isSlice?i(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}):i(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},i("img",{class:"lido-image",src:h(this.src),alt:"",style:this.style}))}get el(){return e(this)}};vi.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 wi=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(){a(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:JSON.parse(d(`${this.visible}`,t))?"block":"none",margin:d(this.margin,t)}}render(){return i(n,{key:"35e70ef17d6b0b3fa77c34b5d5eacc62408aa772",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},i("slot",{key:"37deeb60c7d5b8e5edf954f33ea0207deed93695"}))}get el(){return e(this)}};wi.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 mi=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,n=t.offsetHeight;Array.from(this.el.children).forEach((t=>{const e=t.offsetWidth,r=t.offsetHeight;console.log("child width",e);const o=i-e,s=n-r,a=Math.random()*o,h=Math.random()*s;console.log("randomleft",a),console.log("randomtop",h),t.style.position="absolute",t.style.left=`${a}px`,t.style.top=`${h}px`}))}),50),this.showSpeakIcon&&l(this.el)}render(){return i(n,{key:"229c4cba82bdb4501ee53c16f68407e5d01095a0",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},i("slot",{key:"fb10f2952956918e66a4bb5b110719caa4e41670"}))}get el(){return e(this)}};mi.style=".lido-random{position:relative;width:100%;height:100%}.lido-random>*{position:absolute}";const bi=class{constructor(i){t(this,i),this.xmlPath="",this.initialIndex=0,this.margin="",this.canplay=!0,this.baseUrl="",this.xmlData=void 0}async componentWillLoad(){var t;const i=null!==(t=this.xmlPath)&&void 0!==t?t:this.baseUrl+"/index.xml";console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.baseUrl:",this.baseUrl),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ this.xmlPath:",this.xmlPath),console.log("🚀 ~ LidoRoot ~ componentWillLoad ~ xmlPath:",i);try{const t=i.startsWith("http")?i:r(i),n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch XML data: ${n.statusText}`);const e=await n.text();this.xmlData=e}catch(t){console.error("Error fetching XML data:",t),this.xmlData=null}}render(){return void 0===this.xmlData?i("div",null,"Loading..."):null===this.xmlData?i("div",null,"Error loading XML data. Please check the path or URL."):i("lido-home",{initialIndex:this.initialIndex,canplay:this.canplay,xmlData:this.xmlData,baseUrl:this.baseUrl})}static get assetsDirs(){return["assets"]}},gi=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=""}componentDidLoad(){a(this.el,this.type),u(this.el,this.minLength,this.maxLength,this.childElementsLength),this.showSpeakIcon&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:this.visible?this.display?d(this.display,t):"flex":"none",flexDirection:this.direction?d(this.direction,t):"row",gridTemplateColumns:this.display&&"grid"===d(this.display,t)?"repeat(auto-fill, minmax(186px, auto))":void 0,gap:this.display&&"grid"===d(this.display,t)?"20px":void 0,margin:d(this.margin,t)}}render(){return i(n,{key:"fd85fc603f1a8d1890984e08df7f627cc3840c24",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},i("slot",{key:"a614ca85c0ab0957e0b4150303036c513505e241"}))}get el(){return e(this)}};gi.style=".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";const yi=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type)}render(){return i(n,{key:"a70c88433f7024f327b7d3746fd705c75fa776f6",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})}get el(){return e(this)}};yi.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 xi=class{constructor(i){t(this,i),this.originalHeight=null,this.originalY=null,this.id="lido-slide-fill",this.width=void 0,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.svgContent="",this.delayVisible=""}async componentWillLoad(){await this.renderSVG()}async onSrcChange(){await this.renderSVG(),this.onPropChange()}async renderSVG(){const t=await fetch(h(this.src));if(t.ok){let i=await t.text(),n=0;i=i.replace(/<path([^>]*)>/g,((t,i)=>(n++,`<path id="${1===n?"glassPath":2===n?"rulerPath":`path${n}`}"${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(){s(this.el,this.delayVisible),this.updateFill(),this.addRulerNumbers()}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 n=i.querySelector("#fillArea");if(!n)return;const e=this.fillDirection;let r,o;"vertical"===this.fillDirection?(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+n.getAttribute("height")||100,this.originalY=+n.getAttribute("y")||0),r=this.originalHeight,o=this.originalY):(null!==this.originalHeight&&null!==this.originalY||(this.originalHeight=+n.getAttribute("width")||100,this.originalY=+n.getAttribute("x")||0),r=this.originalHeight,o=this.originalY);const s=r,a=o;let h=0;if("string"==typeof this.fill){const t=this.fill.match(/^(\d+(?:\.\d+)?)%$/);if(t)h=Math.min(Math.max(parseFloat(t[1])/100,0),1);else{const t=this.fill.match(/^(\d+(?:\.\d+)?)$/);t&&(h=Math.min(Math.max(parseFloat(t[1])/100,0),1))}}const c=s*h,u="vertical"===e?a+(s-c):a;"vertical"===e?(n.setAttribute("height",c.toString()),n.setAttribute("y",u.toString())):(n.setAttribute("width",c.toString()),n.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 n=i.querySelector("#rulerPath");if(!n)return;i.querySelectorAll(".ruler-number").forEach((t=>t.remove()));const e=this.division,r=e+1,o=n.getTotalLength(),s=(this.max-this.min)/e;for(let t=0;t<r;t++){let r=0;"vertical"===this.fillDirection?r=this.max-t*s:"horizontal"===this.fillDirection&&(r=this.min+t*s);const a=n.getPointAtLength(o/e*t),h=document.createElementNS("http://www.w3.org/2000/svg","text"),c=O(r/this.max);r="integer"===this.numberType?Math.round(r):"decimal"===this.numberType?parseFloat(r.toFixed(1)):c.toFraction(!0),h.classList.add("ruler-number"),h.setAttribute("x",a.x.toString()),h.setAttribute("y",(a.y+15).toString()),h.setAttribute("text-anchor","end"),h.setAttribute("font-size","40"),h.setAttribute("fill","#333"),h.textContent=r.toString(),i.appendChild(h)}}render(){return i(n,{key:"8fbcce15c7af9525e912d10f504b192d4c2d325a",id:this.id,class:"lido-slide-fill",src:this.src,fill:this.fill,fillDirection:this.fillDirection,slider:this.slider,style:{width:this.width},min:this.min,max:this.max,division:this.division,numberType:this.numberType},i("div",{key:"294026ccc09d0145537c44f558dcfc8538ce2953",innerHTML:this.svgContent,class:"svg-element"}))}get el(){return e(this)}static get watchers(){return{src:["onSrcChange"],fill:["onPropChange"],division:["onPropChange"],fillDirection:["onPropChange"],numberType:["onPropChange"],min:["onPropChange"],max:["onPropChange"]}}};xi.style=".svg-element,svg{width:100%;height:100%}";const ki=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=""}componentDidLoad(){s(this.el,this.delayVisible),a(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&l(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?h(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:d(this.height,i),width:d(this.width,i),backgroundColor:d(this.bgColor,i),top:d(this.y,i),left:d(this.x,i),zIndex:this.z,fontSize:d(this.fontSize,i),fontFamily:this.fontFamily,color:d(this.fontColor,i),display:d(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:d(this.margin,i),padding:d(this.padding,i),borderRadius:d(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 n=document.createElement("span");n.textContent=i,n.className="text-letters",t.appendChild(n)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const n=document.createElement("span");n.textContent=i,n.className="text-words",t.appendChild(n)}))}render(){return i(n,{key:"b20e7357057e57fd2b1763f9d2d711a1521af4cd",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},""!==this.spanType?i("div",{class:"lido-text-content"},this.string):this.string)}get el(){return e(this)}};ki.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 2', serif}.lido-text:hover{background-color:#f0f0f0}.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 _i=class{constructor(i){t(this,i),this.moving=!1,this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.currentSvgIndex=0,this.value="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=A.ShowFlow,this.fingerHintUrl="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/finger.png",this.onInCorrect=void 0,this.onCorrect=void 0,this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:100,freeTraceProximityThreshold:50,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null};const i=this.svgUrls[this.currentSvgIndex];await this.fetchSVG(i),await this.loadAnotherSVG(t,!0)}componentDidLoad(){s(this.el,this.delayVisible)}componentWillLoad(){this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.initializeSVG(),this.showSpeakIcon&&(E(this.el),this.el.append(E(this.el)))}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 n=t.paths[t.currentPathIndex];if(!n)return;const e=document.createElementNS("http://www.w3.org/2000/svg","image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",h(this.fingerHintUrl)),e.setAttribute("width","40"),e.setAttribute("height","40"),e.setAttribute("id","lido-finger-hint"),e.style.pointerEvents="none",e.style.opacity="0.8",e.setAttribute("x","0"),e.setAttribute("y","0");const r=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");r.setAttribute("dur","2s"),r.setAttribute("repeatCount","indefinite");const o=document.createElementNS("http://www.w3.org/2000/svg","mpath");o.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${n.id}`),r.appendChild(o),e.appendChild(r),null===(i=t.svg)||void 0===i||i.appendChild(e),this.fingerImg=e}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(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 n=1/0,e=1/0,r=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let s=0;s<=100;s++){const a=t.getPointAtLength(s/100*i);a.x<n&&(n=a.x),a.y<e&&(e=a.y),a.x>r&&(r=a.x),a.y>o&&(o=a.y)}})),n-=i,e-=i,r+=i,o+=i,{minX:n,minY:e,maxX:r,maxY:o}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const n=i.querySelector("svg");n.removeAttribute("width"),n.removeAttribute("height");const e=n.querySelectorAll("path, line"),r=this.calculateBoundingBox(Array.from(e));n.setAttribute("viewBox",`${r.minX} ${r.minY} ${r.maxX-r.minX} ${r.maxY-r.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t,i=10){var n;const e=t.getTotalLength()/(i+1),r=[];for(let o=1;o<=i;o++){const i=t.getPointAtLength(o*e),s=t.getPointAtLength((o+.5)*e),a=Math.atan2(s.y-i.y,s.x-i.x),h=document.createElementNS("http://www.w3.org/2000/svg","polygon");h.setAttribute("points","-5,-5 0,0 -5,5"),h.setAttribute("fill","blue"),h.setAttribute("transform",`translate(${i.x},${i.y}) rotate(${180*a/Math.PI})`),h.setAttribute("class","lido-flow-indicator"),r.push(h),null===(n=t.parentNode)||void 0===n||n.appendChild(h)}return r}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===A.NoFlow?i.style.display="none":t.mode===A.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,n)=>{const e=i.getTotalLength();i.setAttribute("id","lido-path-"+n);const r=i.cloneNode();r.style.opacity="100",r.style["stroke-opacity"]="100";const o=i.style["stroke-width"]||i.getAttribute("stroke-width");r.setAttribute("stroke-width",o),r.setAttribute("stroke-dasharray",e.toString()),r.setAttribute("stroke-dashoffset",e.toString()),i.parentNode.appendChild(r,i),i.setAttribute("class","lido-trace-path"),r.setAttribute("class","lido-trace-path-green"),i.greenPath=r,i.classList.add(t.mode),t.mode===A.BlindTracing||t.mode===A.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",o),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",e.toString()),i.setAttribute("stroke-dashoffset","0")),n===t.currentPathIndex&&t.mode===A.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const n=t.paths[0].getPointAtLength(0),e=document.createElementNS("http://www.w3.org/2000/svg","circle"),r=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("id","lido-draggableCircle"),e.setAttribute("cx",n.x.toString()),e.setAttribute("cy",n.y.toString()),e.setAttribute("r",`calc(${r||10} / 2)`),e.setAttribute("fill","red"),null===(i=t.svg)||void 0===i||i.appendChild(e),t.circle=e,this.resetIdleTimer(t)}addEventListeners(t){var i,n,e,r;if(!t.circle||!t.paths||0===t.paths.length)return;t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const n=this.getPointerPosition(i,t.svg),e={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};this.getDistanceSquared(n,e)<=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===(n=t.svg)||void 0===n||n.addEventListener("pointerup",o),null===(e=t.svg)||void 0===e||e.addEventListener("pointercancel",o),null===(r=t.svg)||void 0===r||r.addEventListener("contextmenu",(t=>{t.preventDefault()}))}handlePointerMove(t){var i,n,e,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;this.hideFingerHint();const o=this.getPointerPosition(t.pointerMoveEvent,t.svg),s={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},a=t.paths[t.currentPathIndex];if(!a)return void console.error("No valid path found at the current index");let h;if(h=t.mode===A.FreeTrace||t.mode===A.BlindFreeTrace?t.freeTraceProximityThreshold*t.freeTraceProximityThreshold:t.proximityThreshold*t.proximityThreshold,this.getDistanceSquared(o,s)>h)return;const c=this.getClosestPointOnPath(a,o);if(!(this.getDistanceSquared(o,c)>h))if(t.mode!==A.FreeTrace&&t.mode!==A.BlindFreeTrace)t.isDragging&&c.length>=t.lastLength&&(t.lastLength=c.length,t.circle.setAttribute("cx",c.x.toString()),t.circle.setAttribute("cy",c.y.toString()),null===(e=t.svg)||void 0===e||e.appendChild(t.circle),null===(r=a.greenPath)||void 0===r||r.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString())),t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer();else{if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const n=document.createElementNS("http://www.w3.org/2000/svg","path"),e=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");n.setAttribute("stroke-width",e),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke","lightgreen"),n.setAttribute("d",`M${o.x},${o.y}`),null===(i=t.svg)||void 0===i||i.appendChild(n),t.currentFreePath[t.currentPathIndex]=n,t.lastPointerPos=o}const e=t.lastPointerPos||o,r=t.currentFreePath[t.currentPathIndex].getAttribute("d");t.currentFreePath[t.currentPathIndex].setAttribute("d",`${r} Q ${e.x},${e.y} ${(e.x+o.x)/2},${(e.y+o.y)/2}`),t.circle.setAttribute("cx",o.x.toString()),t.circle.setAttribute("cy",o.y.toString()),null===(n=t.svg)||void 0===n||n.appendChild(t.circle),t.lastPointerPos=o,a.getTotalLength()-c.length<5&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null)}}async moveToNextContainer(){if(this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),this.currentSvgIndex<this.svgUrls.length-1)return this.currentSvgIndex++,await this.initializeSVG(),void(this.moving=!1);const t=document.getElementById(k);t&&this.onCorrect&&await C(this.onCorrect,t),S()}getPointerPosition(t,i){var n;const e=i.createSVGPoint();e.x=t.clientX,e.y=t.clientY;const r=null===(n=i.getScreenCTM())||void 0===n?void 0:n.inverse();return r?e.matrixTransform(r):{x:t.clientX,y:t.clientY}}getDistanceSquared(t,i){const n=t.x-i.x,e=t.y-i.y;return n*n+e*e}getClosestPointOnPath(t,i){const n=t.getTotalLength();let e={x:0,y:0,length:0},r=1/0,o={x:0,y:0,length:0},s=1/0;for(let e=0;e<=n;e+=20){const n=t.getPointAtLength(e),r=this.getDistanceSquared(i,n);r<s&&(s=r,o={x:n.x,y:n.y,length:e})}const a=Math.max(o.length-20,0),h=Math.min(o.length+20,n);for(let n=a;n<=h;n+=2){const o=t.getPointAtLength(n),s=this.getDistanceSquared(i,o);s<r&&(r=s,e={x:o.x,y:o.y,length:n})}return e}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(h(this.svgSource));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==A.BlindTracing&&this.mode!==A.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,n;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(n=t.svg)||void 0===n?void 0:n.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,n;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const e=t.paths[t.currentPathIndex];if(!e)return void console.error("No valid path found at the next index");t.totalPathLength=e.getTotalLength();const r=e.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",r.x.toString()),null===(n=t.circle)||void 0===n||n.setAttribute("cy",r.y.toString()),t.mode===A.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(e)),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(k))return;const i=this.highlightTextId;if(!i)return;const n=document.getElementById(i);if(!n)return;const e=n.getAttribute("span-type");if(!e)return;const r=n.querySelector(".lido-text-content");if(r){if("letters"===e){const i=r.querySelectorAll(".text-letters");if(t<0||t>=i.length)return;const n=i[t];n&&n.classList.add("letter-highlight")}if("words"===e){const i=r.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const n=i[t];n&&n.classList.add("word-highlight")}}}render(){return i(n,{key:"363897475f678b89b72bf19d76fcafcab8e1fd97",class:"lido-trace",id:this.id,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:{height:this.height,width:this.width,top:this.y,left:this.x,zIndex:this.z},"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex},i("div",{key:"db92cddb2e7cf888a747c33b22a39c261beba7f4",style:{height:this.height,width:this.width},id:"lido-svgContainer"}))}static get assetsDirs(){return["svg","images"]}get el(){return e(this)}static get watchers(){return{svgSource:["initializeSVG"],mode:["initializeSVG"]}}};_i.style=":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}svg{width:100%;height:100%;max-height:calc(100vh - 50px);touch-action:none}#lido-draggableCircle{cursor:pointer;fill:red;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-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 Mi=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.style=void 0}componentDidLoad(){a(this.el,this.type),u(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&&l(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:d(this.height,t),width:d(this.width,t),backgroundColor:d(this.bgColor,t),top:d(this.y,t),left:d(this.x,t),zIndex:this.z,display:JSON.parse(d(`${this.visible}`,t))?"true"===this.flex?"flex":"grid":"none",margin:d(this.margin,t)}}render(){return i(n,{key:"f093d948bae3bd98d6c6a205b88ab2dcb6c809b3",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},i("slot",{key:"02e2e72ace7ca4eae384ed410cacc2e3a337b6f7"}))}get el(){return e(this)}};Mi.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{z as lido_avatar,F as lido_cell,L as lido_col,R as lido_container,W as lido_flash_card,X as lido_float,U as lido_home,vi as lido_image,wi as lido_pos,mi as lido_random,bi as lido_root,gi as lido_row,yi as lido_shape,xi as lido_slide_fill,ki as lido_text,_i as lido_trace,Mi as lido_wrap}