PageSourceSearch

https://vialet.eu/app/themes/neat-theme/public/build/vendor-CHKLyZdt.js

js vialet.eu collected 2026-10-05 21:35:20 UTC 205,553 bytes, 20 lines download raw bytes

1var Fo=Object.defineProperty;var So=(s,o,h)=>o in s?Fo(s,o,{enumerable:!0,configurable:!0,writable:!0,value:h}):s[o]=h;var J=(s,o,h)=>So(s,typeof o!="symbol"?o+"":o,h);var Mo="1.3.17";function Lr(s,o,h){return Math.max(s,Math.min(o,h))}function Lo(s,o,h){return(1-h)*s+h*o}function Io(s,o,h,u){return Lo(s,o,1-Math.exp(-h*u))}function To(s,o){return(s%o+o)%o}var Po=class{constructor(){J(this,"isRunning",!1);J(this,"value",0);J(this,"from",0);J(this,"to",0);J(this,"currentTime",0);J(this,"lerp");J(this,"duration");J(this,"easing");J(this,"onUpdate")}advance(s){var h;if(!this.isRunning)return;let o=!1;if(this.duration&&this.easing){this.currentTime+=s;const u=Lr(0,this.currentTime/this.duration,1);o=u>=1;const f=o?1:this.easing(u);this.value=this.from+(this.to-this.from)*f}else this.lerp?(this.value=Io(this.value,this.to,this.lerp*60,s),Math.round(this.value)===this.to&&(this.value=this.to,o=!0)):(this.value=this.to,o=!0);o&&this.stop(),(h=this.onUpdate)==null||h.call(this,this.value,o)}stop(){this.isRunning=!1}fromTo(s,o,{lerp:h,duration:u,easing:f,onStart:g,onUpdate:v}){this.from=this.value=s,this.to=o,this.lerp=h,this.duration=u,this.easing=f,this.currentTime=0,this.isRunning=!0,g==null||g(),this.onUpdate=v}};function Oo(s,o){let h;return function(...u){let f=this;clearTimeout(h),h=setTimeout(()=>{h=void 0,s.apply(f,u)},o)}}var xo=class{constructor(s,o,{autoResize:h=!0,debounce:u=250}={}){J(this,"width",0);J(this,"height",0);J(this,"scrollHeight",0);J(this,"scrollWidth",0);J(this,"debouncedResize");J(this,"wrapperResizeObserver");J(this,"contentResizeObserver");J(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});J(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});J(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=s,this.content=o,h&&(this.debouncedResize=Oo(this.resize,u),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var s,o;(s=this.wrapperResizeObserver)==null||s.disconnect(),(o=this.contentResizeObserver)==null||o.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},Ir=class{constructor(){J(this,"events",{})}emit(s,...o){var u;let h=this.events[s]||[];for(let f=0,g=h.length;f<g;f++)(u=h[f])==null||u.call(h,...o)}on(s,o){var h;return(h=this.events[s])!=null&&h.push(o)||(this.events[s]=[o]),()=>{var u;this.events[s]=(u=this.events[s])==null?void 0:u.filter(f=>o!==f)}}off(s,o){var h;this.events[s]=(h=this.events[s])==null?void 0:h.filter(u=>o!==u)}destroy(){this.events={}}},vr=100/6,Dt={passive:!1},Ro=class{constructor(s,o={wheelMultiplier:1,touchMultiplier:1}){J(this,"touchStart",{x:0,y:0});J(this,"lastDelta",{x:0,y:0});J(this,"window",{width:0,height:0});J(this,"emitter",new Ir);J(this,"onTouchStart",s=>{const{clientX:o,clientY:h}=s.targetTouches?s.targetTouches[0]:s;this.touchStart.x=o,this.touchStart.y=h,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:s})});J(this,"onTouchMove",s=>{const{clientX:o,clientY:h}=s.targetTouches?s.targetTouches[0]:s,u=-(o-this.touchStart.x)*this.options.touchMultiplier,f=-(h-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=o,this.touchStart.y=h,this.lastDelta={x:u,y:f},this.emitter.emit("scroll",{deltaX:u,deltaY:f,event:s})});J(this,"onTouchEnd",s=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:s})});J(this,"onWheel",s=>{let{deltaX:o,deltaY:h,deltaMode:u}=s;const f=u===1?vr:u===2?this.window.width:1,g=u===1?vr:u===2?this.window.height:1;o*=f,h*=g,o*=this.options.wheelMultiplier,h*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:o,deltaY:h,event:s})});J(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=s,this.options=o,window.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,Dt),this.element.addEventListener("touchstart",this.onTouchStart,Dt),this.element.addEventListener("touchmove",this.onTouchMove,Dt),this.element.addEventListener("touchend",this.onTouchEnd,Dt)}on(s,o){return this.emitter.on(s,o)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel,Dt),this.element.removeEventListener("touchstart",this.onTouchStart,Dt),this.element.removeEventListener("touchmove",this.onTouchMove,Dt),this.element.removeEventListener("touchend",this.onTouchEnd,Dt)}},mr=s=>Math.min(1,1.001-Math.pow(2,-10*s)),$s=class{constructor({wrapper:s=window,content:o=document.documentElement,eventsTarget:h=s,smoothWheel:u=!0,syncTouch:f=!1,syncTouchLerp:g=.075,touchInertiaExponent:v=1.7,duration:y,easing:E,lerp:A=.1,infinite:M=!1,orientation:T="vertical",gestureOrientation:I=T==="horizontal"?"both":"vertical",touchMultiplier:x=1,wheelMultiplier:z=1,autoResize:m=!0,prevent:B,virtualScroll:H,overscroll:q=!0,autoRaf:ee=!1,anchors:te=!1,autoToggle:ye=!1,allowNestedScroll:se=!1,__experimental__naiveDimensions:Ve=!1,naiveDimensions:Ye=Ve,stopInertiaOnNavigate:k=!1}
1={}){J(this,"_isScrolling",!1);J(this,"_isStopped",!1);J(this,"_isLocked",!1);J(this,"_preventNextNativeScrollEvent",!1);J(this,"_resetVelocityTimeout",null);J(this,"_rafId",null);J(this,"isTouching");J(this,"time",0);J(this,"userData",{});J(this,"lastVelocity",0);J(this,"velocity",0);J(this,"direction",0);J(this,"options");J(this,"targetScroll");J(this,"animatedScroll");J(this,"animate",new Po);J(this,"emitter",new Ir);J(this,"dimensions");J(this,"virtualScroll");J(this,"onScrollEnd",s=>{s instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&s.stopPropagation()});J(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});J(this,"onTransitionEnd",s=>{s.propertyName.includes("overflow")&&this.checkOverflow()});J(this,"onClick",s=>{const h=s.composedPath().filter(u=>u instanceof HTMLAnchorElement&&u.getAttribute("href"));if(this.options.anchors){const u=h.find(f=>{var g;return(g=f.getAttribute("href"))==null?void 0:g.includes("#")});if(u){const f=u.getAttribute("href");if(f){const g=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,v=`#${f.split("#")[1]}`;this.scrollTo(v,g)}}}this.options.stopInertiaOnNavigate&&h.find(f=>f.host===window.location.host)&&this.reset()});J(this,"onPointerDown",s=>{s.button===1&&this.reset()});J(this,"onVirtualScroll",s=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(s)===!1)return;const{deltaX:o,deltaY:h,event:u}=s;if(this.emitter.emit("virtual-scroll",{deltaX:o,deltaY:h,event:u}),u.ctrlKey||u.lenisStopPropagation)return;const f=u.type.includes("touch"),g=u.type.includes("wheel");this.isTouching=u.type==="touchstart"||u.type==="touchmove";const v=o===0&&h===0;if(this.options.syncTouch&&f&&u.type==="touchstart"&&v&&!this.isStopped&&!this.isLocked){this.reset();return}const E=this.options.gestureOrientation==="vertical"&&h===0||this.options.gestureOrientation==="horizontal"&&o===0;if(v||E)return;let A=u.composedPath();A=A.slice(0,A.indexOf(this.rootElement));const M=this.options.prevent;if(A.find(B=>{var H,q,ee;return B instanceof HTMLElement&&(typeof M=="function"&&(M==null?void 0:M(B))||((H=B.hasAttribute)==null?void 0:H.call(B,"data-lenis-prevent"))||f&&((q=B.hasAttribute)==null?void 0:q.call(B,"data-lenis-prevent-touch"))||g&&((ee=B.hasAttribute)==null?void 0:ee.call(B,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.checkNestedScroll(B,{deltaX:o,deltaY:h}))}))return;if(this.isStopped||this.isLocked){u.cancelable&&u.preventDefault();return}if(!(this.options.syncTouch&&f||this.options.smoothWheel&&g)){this.isScrolling="native",this.animate.stop(),u.lenisStopPropagation=!0;return}let I=h;this.options.gestureOrientation==="both"?I=Math.abs(h)>Math.abs(o)?h:o:this.options.gestureOrientation==="horizontal"&&(I=o),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&h>0||this.animatedScroll===this.limit&&h<0))&&(u.lenisStopPropagation=!0),u.cancelable&&u.preventDefault();const x=f&&this.options.syncTouch,m=f&&u.type==="touchend";m&&(I=Math.sign(this.velocity)*Math.pow(Math.abs(this.velocity),this.options.touchInertiaExponent)),this.scrollTo(this.targetScroll+I,{programmatic:!1,...x?{lerp:m?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});J(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const s=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-s,this.direction=Math.sign(this.animatedScroll-s),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit
1()},400))}});J(this,"raf",s=>{const o=s-(this.time||s);this.time=s,this.animate.advance(o*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=Mo,(!s||s===document.documentElement)&&(s=window),typeof y=="number"&&typeof E!="function"?E=mr:typeof E=="function"&&typeof y!="number"&&(y=1),this.options={wrapper:s,content:o,eventsTarget:h,smoothWheel:u,syncTouch:f,syncTouchLerp:g,touchInertiaExponent:v,duration:y,easing:E,lerp:A,infinite:M,gestureOrientation:I,orientation:T,touchMultiplier:x,wheelMultiplier:z,autoResize:m,prevent:B,virtualScroll:H,overscroll:q,autoRaf:ee,anchors:te,autoToggle:ye,allowNestedScroll:se,naiveDimensions:Ye,stopInertiaOnNavigate:k},this.dimensions=new xo(s,o,{autoResize:m}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new Ro(h,{touchMultiplier:x,wheelMultiplier:z}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd,{passive:!0})),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(s,o){return this.emitter.on(s,o)}off(s,o){return this.emitter.off(s,o)}get overflow(){const s=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[s]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(s){this.isHorizontal?this.options.wrapper.scrollTo({left:s,behavior:"instant"}):this.options.wrapper.scrollTo({top:s,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(s,{offset:o=0,immediate:h=!1,lock:u=!1,programmatic:f=!0,lerp:g=f?this.options.lerp:void 0,duration:v=f?this.options.duration:void 0,easing:y=f?this.options.easing:void 0,onStart:E,onComplete:A,force:M=!1,userData:T}={}){if(!((this.isStopped||this.isLocked)&&!M)){if(typeof s=="string"&&["top","left","start","#"].includes(s))s=0;else if(typeof s=="string"&&["bottom","right","end"].includes(s))s=this.limit;else{let I;if(typeof s=="string"?(I=document.querySelector(s),I||(s==="#top"?s=0:console.warn("Lenis: Target not found",s))):s instanceof HTMLElement&&(s!=null&&s.nodeType)&&(I=s),I){if(this.options.wrapper!==window){const z=this.rootElement.getBoundingClientRect();o-=this.isHorizontal?z.left:z.top}const x=I.getBoundingClientRect();s=(this.isHorizontal?x.left:x.top)+this.animatedScroll}}if(typeof s=="number"){if(s+=o,s=Math.round(s),this.options.infinite){if(f){this.targetScroll=this.animatedScroll=this.scroll;const I=s-this.animatedScroll;I>this.limit/2?s=s-this.limit:I<-this.limit/2&&(s=s+this.limit)}}else s=Lr(0,s,this.limit);if(s===this.targetScroll){E==null||E(this),A==null||A(this);return}if(this.userData=T??{},h){this.animatedScroll=this.targetScroll=s,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit
1(),A==null||A(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}f||(this.targetScroll=s),typeof v=="number"&&typeof y!="function"?y=mr:typeof y=="function"&&typeof v!="number"&&(v=1),this.animate.fromTo(this.animatedScroll,s,{duration:v,easing:y,lerp:g,onStart:()=>{u&&(this.isLocked=!0),this.isScrolling="smooth",E==null||E(this)},onUpdate:(I,x)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=I-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=I,this.setScroll(this.scroll),f&&(this.targetScroll=I),x||this.emit(),x&&(this.reset(),this.emit(),A==null||A(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}checkNestedScroll(s,{deltaX:o,deltaY:h}){const u=Date.now(),f=s._lenis??(s._lenis={});let g,v,y,E,A,M,T,I;const x=this.options.gestureOrientation;if(u-(f.time??0)>2e3){f.time=Date.now();const ye=window.getComputedStyle(s);f.computedStyle=ye;const se=ye.overflowX,Ve=ye.overflowY;if(g=["auto","overlay","scroll"].includes(se),v=["auto","overlay","scroll"].includes(Ve),f.hasOverflowX=g,f.hasOverflowY=v,!g&&!v||x==="vertical"&&!v||x==="horizontal"&&!g)return!1;A=s.scrollWidth,M=s.scrollHeight,T=s.clientWidth,I=s.clientHeight,y=A>T,E=M>I,f.isScrollableX=y,f.isScrollableY=E,f.scrollWidth=A,f.scrollHeight=M,f.clientWidth=T,f.clientHeight=I}else y=f.isScrollableX,E=f.isScrollableY,g=f.hasOverflowX,v=f.hasOverflowY,A=f.scrollWidth,M=f.scrollHeight,T=f.clientWidth,I=f.clientHeight;if(!g&&!v||!y&&!E||x==="vertical"&&(!v||!E)||x==="horizontal"&&(!g||!y))return!1;let z;if(x==="horizontal")z="x";else if(x==="vertical")z="y";else{const ye=o!==0,se=h!==0;ye&&g&&y&&(z="x"),se&&v&&E&&(z="y")}if(!z)return!1;let m,B,H,q,ee;if(z==="x")m=s.scrollLeft,B=A-T,H=o,q=g,ee=y;else if(z==="y")m=s.scrollTop,B=M-I,H=h,q=v,ee=E;else return!1;return(H>0?m<B:m>0)&&q&&ee}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const s=this.options.wrapper;return this.isHorizontal?s.scrollX??s.scrollLeft:s.scrollY??s.scrollTop}get scroll(){return this.options.infinite?To(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(s){this._isScrolling!==s&&(this._isScrolling=s,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(s){this._isStopped!==s&&(this._isStopped=s,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(s){this._isLocked!==s&&(this._isLocked=s,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let s="lenis";return this.options.autoToggle&&(s+=" lenis-autoToggle"),this.isStopped&&(s+=" lenis-stopped"),this.isLocked&&(s+=" lenis-locked"),this.isScrolling&&(s+=" lenis-scrolling"),this.isScrolling==="smooth"&&(s+=" lenis-smooth"),s}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};function jo(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var zi={exports:{}},Vo=zi.exports,gr;function ko(){return gr||(gr=1,function(s,o){(function(u,f){s.exports=f()})(Vo,()=>(()=>{var h=[,(v,y,E)=>{E.r(y),E.d(y,{default:()=>M});var A=(()=>{var I;var T=typeof document<"u"?(I=document.currentScript)==null?void 0:I.src:void 0;return function(x={}){var z,m=x,B,H,q=new Promise((e,t)=>{B=e,H=t}),ee=typeof window=="object",te=typeof importScripts=="function";function ye(){function e(w){const b=a;n=t=0,a=new Map,b.forEach(L=>{try{L(w)}catch(F){console.error(F)}}),this.ob(),c&&c.Qb()}let t=0,n=0,a=new Map,c=null,p=null;this.requestAnimationFrame=function(w){t||(t=requestAnimationFrame(e.bind(this)));const b=++n;return a.set(b,w),b},this.cancelAnimationFrame=function(w){a.delete(w),t&&a.size==0&&(cancelAnimationFrame(t),t=0)},this.Ob=function(w){p&&(document.body.remove(p),p=null),w||(p=document.createElement("div"),p.style.backgroundColor="black",p.style.position="fixed",p.style.right=0,p.style.top=0,p.style.color="white",p.style.padding="4px",p.innerHTML="RIVE FPS",w=function(b){p.innerHTML="RIVE FPS "+b.toFixed(1)},document.body.appendChild(p)),c=new function(){let b=0,L=0;this.Qb=function(){var F=performance.now();L?(++b,F-=L,1e3<F&&(w(1e3*b/F),b=L=0)):(L=F,b=0)}}},this.Lb=function(){p&&(document.body.remove(p),p=null),c=null},this.ob=function(){}}function se(e){console.assert(!0);const t=new Map;let n=-1/0;this.push=function(a){return a=a+((1<<e)-1)>>e,t.has(a)&&clearTimeout(t.get(a)),t.set(a,setTimeout(function(){t.delete(a),t.length==0?n=-1/0:a==n&&(n=Math.max(...t.ke
1ys()),console.assert(n<a))},1e3)),n=Math.max(a,n),n<<e}}const Ve=m.onRuntimeInitialized;m.onRuntimeInitialized=function(){Ve&&Ve();let e=m.decodeAudio;m.decodeAudio=function(c,p){c=e(c),p(c)};let t=m.decodeFont;m.decodeFont=function(c,p){c=t(c),p(c)};const n=m.FileAssetLoader;m.ptrToAsset=c=>{let p=m.ptrToFileAsset(c);return p.isImage?m.ptrToImageAsset(c):p.isFont?m.ptrToFontAsset(c):p.isAudio?m.ptrToAudioAsset(c):p},m.CustomFileAssetLoader=n.extend("CustomFileAssetLoader",{__construct:function({loadContents:c}){this.__parent.__construct.call(this),this.Eb=c},loadContents:function(c,p){return c=m.ptrToAsset(c),this.Eb(c,p)}}),m.CDNFileAssetLoader=n.extend("CDNFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this)},loadContents:function(c){let p=m.ptrToAsset(c);return c=p.cdnUuid,c===""?!1:(function(w,b){var L=new XMLHttpRequest;L.responseType="arraybuffer",L.onreadystatechange=function(){L.readyState==4&&L.status==200&&b(L)},L.open("GET",w,!0),L.send(null)}(p.cdnBaseUrl+"/"+c,w=>{p.decode(new Uint8Array(w.response))}),!0)}}),m.FallbackFileAssetLoader=n.extend("FallbackFileAssetLoader",{__construct:function(){this.__parent.__construct.call(this),this.kb=[]},addLoader:function(c){this.kb.push(c)},loadContents:function(c,p){for(let w of this.kb)if(w.loadContents(c,p))return!0;return!1}});let a=m.computeAlignment;m.computeAlignment=function(c,p,w,b,L=1){return a.call(this,c,p,w,b,L)}};const Ye="createConicGradient createImageData createLinearGradient createPattern createRadialGradient getContextAttributes getImageData getLineDash getTransform isContextLost isPointInPath isPointInStroke measureText".split(" "),k=new function(){function e(){if(!t){let ae=function(de,N,Me){if(N=O.createShader(N),O.shaderSource(N,Me),O.compileShader(N),Me=O.getShaderInfoLog(N),0<(Me||"").length)throw Me;O.attachShader(de,N)};var C=document.createElement("canvas"),V={alpha:1,depth:0,stencil:0,antialias:0,premultipliedAlpha:1,preserveDrawingBuffer:0,powerPreference:"high-performance",failIfMajorPerformanceCaveat:0,enableExtensionsByDefault:1,explicitSwapControl:1,renderViaOffscreenBackBuffer:1};let O;if(/iPhone|iPad|iPod/i.test(navigator.userAgent)){if(O=C.getContext("webgl",V),n=1,!O)return console.log("No WebGL support. Image mesh will not be drawn."),!1}else if(O=C.getContext("webgl2",V))n=2;else if(O=C.getContext("webgl",V))n=1;else return console.log("No WebGL support. Image mesh will not be drawn."),!1;if(O=new Proxy(O,{get(de,N){if(de.isContextLost()){if(L||(console.error("Cannot render the mesh because the GL Context was lost. Tried to invoke ",N),L=!0),typeof de[N]=="function")return function(){}}else return typeof de[N]=="function"?function(...Me){return de[N].apply(de,Me)}:de[N]},set(de,N,Me){if(de.isContextLost())L||(console.error("Cannot render the mesh because the GL Context was lost. Tried to set property "+N),L=!0);else return de[N]=Me,!0}}),a=Math.min(O.getParameter(O.MAX_RENDERBUFFER_SIZE),O.getParameter(O.MAX_TEXTURE_SIZE)),C=O.createProgram(),ae(C,O.VERTEX_SHADER,`attribute vec2 vertex;
2                attribute vec2 uv;
3                uniform vec4 mat;
4                uniform vec2 translate;
5                varying vec2 st;
6                void main() {
7                    st = uv;
8                    gl_Position = vec4(mat2(mat) * vertex + translate, 0, 1);
9                }`),ae(C,O.FRAGMENT_SHADER,`precision highp float;
10                uniform sampler2D image;
11                varying vec2 st;
12                void main() {
13                    gl_FragColor = texture2D(image, st);
14                }`),O.bindAttribLocation(C,0,"vertex"),O.bindAttribLocation(C,1,"uv"),O.linkProgram(C),V=O.getProgramInfoLog(C),0<(V||"").trim().length)throw V;c=O.getUniformLocation(C,"mat"),p=O.getUniformLocation(C,"translate"),O.useProgram(C),O.bindBuffer(O.ARRAY_BUFFER,O.createBuffer()),O.enableVertexAttribArray(0),O.enableVertexAttribArray(1),O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,O.createBuffer()),O.uniform1i(O.getUniformLocation(C,"image"),0),O.pixelStorei(O.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t=O}return!0}let t=null,n=0,a=0,c=null,p=null,w=0,b=0,L=!1;e(),this.bc=function(){return e(),a},this.Kb=function(C){t.deleteTexture&&t.deleteTexture(C)},this.Jb=function(C){if(!e())return null;const V=t.createTexture();return V?(t.bindTexture(t.TEXTURE_2D,V),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,C),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),n==2?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.generateMipmap(t.TEXTURE_2D)):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),V):null};
14const F=new se(8),j=new se(8),U=new se(10),Y=new se(10);this.Nb=function(C,V,O,ae,de){if(e()){var N=F.push(C),Me=j.push(V);if(t.canvas){(t.canvas.width!=N||t.canvas.height!=Me)&&(t.canvas.width=N,t.canvas.height=Me),t.viewport(0,Me-V,C,V),t.disable(t.SCISSOR_TEST),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.enable(t.SCISSOR_TEST),O.sort((we,gt)=>gt.vb-we.vb),N=U.push(ae),w!=N&&(t.bufferData(t.ARRAY_BUFFER,8*N,t.DYNAMIC_DRAW),w=N),N=0;for(var We of O)t.bufferSubData(t.ARRAY_BUFFER,N,We.Ta),N+=4*We.Ta.length;console.assert(N==4*ae);for(var Ze of O)t.bufferSubData(t.ARRAY_BUFFER,N,Ze.Bb),N+=4*Ze.Bb.length;console.assert(N==8*ae),N=Y.push(de),b!=N&&(t.bufferData(t.ELEMENT_ARRAY_BUFFER,2*N,t.DYNAMIC_DRAW),b=N),We=0;for(var Ht of O)t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,We,Ht.indices),We+=2*Ht.indices.length;console.assert(We==2*de),Ht=0,Ze=!0,N=We=0;for(const we of O){we.image.Ja!=Ht&&(t.bindTexture(t.TEXTURE_2D,we.image.Ia||null),Ht=we.image.Ja),we.hc?(t.scissor(we.Za,Me-we.$a-we.jb,we.uc,we.jb),Ze=!0):Ze&&(t.scissor(0,Me-V,C,V),Ze=!1),O=2/C;const gt=-2/V;t.uniform4f(c,we.ha[0]*O*we.Aa,we.ha[1]*gt*we.Ba,we.ha[2]*O*we.Aa,we.ha[3]*gt*we.Ba),t.uniform2f(p,we.ha[4]*O*we.Aa+O*(we.Za-we.cc*we.Aa)-1,we.ha[5]*gt*we.Ba+gt*(we.$a-we.dc*we.Ba)+1),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,N),t.vertexAttribPointer(1,2,t.FLOAT,!1,0,N+4*ae),t.drawElements(t.TRIANGLES,we.indices.length,t.UNSIGNED_SHORT,We),N+=4*we.Ta.length,We+=2*we.indices.length}console.assert(N==4*ae),console.assert(We==2*de)}}},this.canvas=function(){return e()&&t.canvas}},$=m.onRuntimeInitialized;m.onRuntimeInitialized=function(){function e(P){switch(P){case F.srcOver:return"source-over";case F.screen:return"screen";case F.overlay:return"overlay";case F.darken:return"darken";case F.lighten:return"lighten";case F.colorDodge:return"color-dodge";case F.colorBurn:return"color-burn";case F.hardLight:return"hard-light";case F.softLight:return"soft-light";case F.difference:return"difference";case F.exclusion:return"exclusion";case F.multiply:return"multiply";case F.hue:return"hue";case F.saturation:return"saturation";case F.color:return"color";case F.luminosity:return"luminosity"}}function t(P){return"rgba("+((16711680&P)>>>16)+","+((65280&P)>>>8)+","+((255&P)>>>0)+","+((4278190080&P)>>>24)/255+")"}function n(){0<Me.length&&(k.Nb(N.drawWidth(),N.drawHeight(),Me,We,Ze),Me=[],Ze=We=0,N.reset(512,512));for(const P of de){for(const D of P.I)D();P.I=[]}de.clear()}$&&$();var a=m.RenderPaintStyle;const c=m.RenderPath,p=m.RenderPaint,w=m.Renderer,b=m.StrokeCap,L=m.StrokeJoin,F=m.BlendMode,j=a.fill,U=a.stroke,Y=m.FillRule.evenOdd;let C=1;var V=m.RenderImage.extend("CanvasRenderImage",{__construct:function({la:P,wa:D}={}){this.__parent.__construct.call(this),this.Ja=C,C=C+1&2147483647||1,this.la=P,this.wa=D},__destruct:function(){this.Ia&&(k.Kb(this.Ia),URL.revokeObjectURL(this.Wa)),this.__parent.__destruct.call(this)},decode:function(P){var D=this;D.wa&&D.wa(D);var pe=new Image;D.Wa=URL.createObjectURL(new Blob([P],{type:"image/png"})),pe.onload=function(){D.Db=pe,D.Ia=k.Jb(pe),D.size(pe.width,pe.height),D.la&&D.la(D)},pe.src=D.Wa}}),O=c.extend("CanvasRenderPath",{__construct:function(){this.__parent.__construct.call(this),this.U=new Path2D},rewind:function(){this.U=new Path2D},addPath:function(P,D,pe,ce,be,ve,he){var Ee=this.U,yt=Ee.addPath;P=P.U;const je=new DOMMatrix;je.a=D,je.b=pe,je.c=ce,je.d=be,je.e=ve,je.f=he,yt.call(Ee,P,je)},fillRule:function(P){this.Va=P},moveTo:function(P,D){this.U.moveTo(P,D)},lineTo:function(P,D){this.U.lineTo(P,D)},cubicTo:function(P,D,pe,ce,be,ve){this.U.bezierCurveTo(P,D,pe,ce,be,ve)},close:function(){this.U.closePath()}}),ae=p.extend("CanvasRenderPaint",{color:function(P){this.Xa=t(P)},thickness:function(P){this.Gb=P},join:function(P){switch(P){case L.miter:this.Ha="miter";break;case L.round:this.Ha="round";break;case L.bevel:this.Ha="bevel"}},cap:function(P){switch(P){case b.butt:this.Ga="butt";break;case b.round:this.Ga="round";break;case b.square:this.Ga="square"}},style:function(P){this.Fb=P},blendMode:function(P){this.Cb=e(P)},clearGradient:function(){this.ja=null},linearGradient:function(P,D,pe,ce){this.ja={xb:P,yb:D,cb:pe,eb:ce,Qa:[]}},radialGradient:function(P,D,pe,ce){this.ja={xb:P,yb:D,cb:pe,eb:ce,Qa:[],ac:!0}},addStop:function(P,D){this.ja.Qa.push({color:P,stop:D})},completeGradient:function(){},draw:function(P,D,pe,ce){let be=this.Fb;var ve=this.Xa,he=this.ja;const Ee=P.globalCompositeOperation,yt=P.globalAlpha;if(P.globalCompositeOperation=this.Cb,P.globalAlpha=ce,he!=null){ve=he.xb;const et=he.yb,De=he.cb;var je=he.eb;ce=he.Qa,he.ac?(he=De-ve,je-=et,ve=P.createRadialGradient(ve,et,0,ve,et,Math.sqrt(he*he+je*je))):ve=P.createLinearGradient(ve,et,De,je);for(let Qt=0,Bi=ce.length;Qt<Bi;Qt++)he=ce[Qt],ve.addColorStop(he.stop,t(he.color));this.Xa=ve,this.ja=null}switch(be){case U:P.strokeStyle=ve,P.lineWidth=this.Gb,P.lineCap=this.Ga,P.lineJoin=this.Ha,P.stroke(D);break;case j:P.fillStyle=ve,P.fill(D,pe)}P.globalCompositeOperation=Ee,P.globalAlpha=yt}});const de=new Set;let N=null,Me=[],We=0,Ze=0;var Ht=m.CanvasRenderer=w.extend("Renderer",{__construct:function(P){this.__parent.__construct.call(this),this.T=[1,0,0,1,0,0],this.G=[1],this.B=P.getContext("2d"),this.Ua=P,this.I=[]},save:function(){this.T.push(...this.T.slice(this.T.length-6)),this.G.push(this.G[this.G.length-1]),this.I.push(this.B.save.bind(this.B))},restore:function(){const P=this.T.length-6;if(6>
14P)throw"restore() called without matching save().";this.T.splice(P),this.G.pop(),this.I.push(this.B.restore.bind(this.B))},transform:function(P,D,pe,ce,be,ve){const he=this.T,Ee=he.length-6;he.splice(Ee,6,he[Ee]*P+he[Ee+2]*D,he[Ee+1]*P+he[Ee+3]*D,he[Ee]*pe+he[Ee+2]*ce,he[Ee+1]*pe+he[Ee+3]*ce,he[Ee]*be+he[Ee+2]*ve+he[Ee+4],he[Ee+1]*be+he[Ee+3]*ve+he[Ee+5]),this.I.push(this.B.transform.bind(this.B,P,D,pe,ce,be,ve))},rotate:function(P){const D=Math.sin(P);P=Math.cos(P),this.transform(P,D,-D,P,0,0)},modulateOpacity:function(P){this.G[this.G.length-1]*=P},_drawPath:function(P,D){this.I.push(D.draw.bind(D,this.B,P.U,P.Va===Y?"evenodd":"nonzero",Math.max(0,this.G[this.G.length-1])))},_drawRiveImage:function(P,D,pe,ce){var be=P.Db;if(be){var ve=this.B,he=e(pe),Ee=Math.max(0,ce*this.G[this.G.length-1]);this.I.push(function(){ve.globalCompositeOperation=he,ve.globalAlpha=Ee,ve.drawImage(be,0,0),ve.globalAlpha=1})}},_getMatrix:function(P){const D=this.T,pe=D.length-6;for(let ce=0;6>ce;++ce)P[ce]=D[pe+ce]},_drawImageMesh:function(P,D,pe,ce,be,ve,he,Ee,yt,je,et){D=this.B.canvas.width;var De=this.B.canvas.height;const Qt=je-Ee,Bi=et-yt;Ee=Math.max(Ee,0),yt=Math.max(yt,0),je=Math.min(je,D),et=Math.min(et,De);const gi=je-Ee,yi=et-yt;if(console.assert(gi<=Math.min(Qt,D)),console.assert(yi<=Math.min(Bi,De)),!(0>=gi||0>=yi)){je=gi<Qt||yi<Bi,D=et=1;var Yt=Math.ceil(gi*et),Xt=Math.ceil(yi*D);De=k.bc(),Yt>De&&(et*=De/Yt,Yt=De),Xt>De&&(D*=De/Xt,Xt=De),N||(N=new m.DynamicRectanizer(De),N.reset(512,512)),De=N.addRect(Yt,Xt),0>De&&(n(),de.add(this),De=N.addRect(Yt,Xt),console.assert(0<=De));var fr=De&65535,dr=De>>16;Me.push({ha:this.T.slice(this.T.length-6),image:P,Za:fr,$a:dr,cc:Ee,dc:yt,uc:Yt,jb:Xt,Aa:et,Ba:D,Ta:new Float32Array(be),Bb:new Float32Array(ve),indices:new Uint16Array(he),hc:je,vb:P.Ja<<1|(je?1:0)}),We+=be.length,Ze+=he.length;var Zt=this.B,Ao=e(pe),Eo=Math.max(0,ce*this.G[this.G.length-1]);this.I.push(function(){Zt.save(),Zt.resetTransform(),Zt.globalCompositeOperation=Ao,Zt.globalAlpha=Eo;const pr=k.canvas();pr&&Zt.drawImage(pr,fr,dr,Yt,Xt,Ee,yt,gi,yi),Zt.restore()})}},_clipPath:function(P){this.I.push(this.B.clip.bind(this.B,P.U,P.Va===Y?"evenodd":"nonzero"))},clear:function(){de.add(this),this.I.push(this.B.clearRect.bind(this.B,0,0,this.Ua.width,this.Ua.height))},flush:function(){},translate:function(P,D){this.transform(1,0,0,1,P,D)}});m.makeRenderer=function(P){const D=new Ht(P),pe=D.B;return new Proxy(D,{get(ce,be){if(typeof ce[be]=="function")return function(...ve){return ce[be].apply(ce,ve)};if(typeof pe[be]=="function"){if(-1<Ye.indexOf(be))throw Error("RiveException: Method call to '"+be+"()' is not allowed, as the renderer cannot immediately pass through the return                 values of any canvas 2d context methods.");return function(...ve){D.I.push(pe[be].bind(pe,...ve))}}return ce[be]},set(ce,be,ve){if(be in pe)return D.I.push(()=>{pe[be]=ve}),!0}})},m.decodeImage=function(P,D){new V({la:D}).decode(P)},m.renderFactory={makeRenderPaint:function(){return new ae},makeRenderPath:function(){return new O},makeRenderImage:function(){let P=gt;return new V({wa:()=>{P.total++},la:()=>{if(P.loaded++,P.loaded===P.total){const D=P.ready;D&&(D(),P.ready=null)}}})}};let we=m.load,gt=null;m.load=function(P,D,pe=!0){const ce=new m.FallbackFileAssetLoader;return D!==void 0&&ce.addLoader(D),pe&&(D=new m.CDNFileAssetLoader,ce.addLoader(D)),new Promise(function(be){let ve=null;gt={total:0,loaded:0,ready:function(){be(ve)}},ve=we(P,ce),gt.total==0&&be(ve)})};let Co=m.RendererWrapper.prototype.align;m.RendererWrapper.prototype.align=function(P,D,pe,ce,be=1){Co.call(this,P,D,pe,ce,be)},a=new ye,m.requestAnimationFrame=a.requestAnimationFrame.bind(a),m.cancelAnimationFrame=a.cancelAnimationFrame.bind(a),m.enableFPSCounter=a.Ob.bind(a),m.disableFPSCounter=a.Lb,a.ob=n,m.resolveAnimationFrame=n,m.cleanup=function(){N&&N.delete()}};var le=Object.assign({},m),_e="./this.program",W="",Q,Ne;(ee||te)&&(te?W=self.location.href:typeof document<"u"&&document.currentScript&&(W=document.currentScript.src),T&&(W=T),W.startsWith("blob:")?W="":W=W.substr(0,W.replace(/[?#].*/,"").lastIndexOf("/")+1),te&&(Ne=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Q=(e,t,n)=>{if(Oe(e)){var a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer",a.onload=()=>{a.status==200||a.status==0&&a.response?t(a.response):n()},a.onerror=n,a.send(null)}else fetch(e,{credentials:"same-origin"}).then(c=>c.ok?c.arrayBuffer():Promise.reject(Error(c.status+" : "+c.url))).then(t,n)});var ue=m.print||console.log.bind(console),Ie=m.printErr||console.error.bind(console);Object.assign(m,le),le=null,m.thisProgram&&(_e=m.thisProgram);var ke;m.wasmBinary&&(ke=m.wasmBinary);var Xe,it=!1,Re,Le,$e,at,K,Ce,nt,Ct;function Te(){var e=Xe.buffer;m.HEAP8=Re=new Int8Array(e),m.HEAP16=$e=new Int16Array(e),m.HEAPU8=Le=new Uint8Array(e),m.HEAPU16=at=new Uint16Array(e),m.HEAP32=K=new Int32Array(e),m.HEAPU32
14=Ce=new Uint32Array(e),m.HEAPF32=nt=new Float32Array(e),m.HEAPF64=Ct=new Float64Array(e)}var Ge=[],Ue=[],Nt=[];function xt(){var e=m.preRun.shift();Ge.unshift(e)}var Ke=0,ft=null;function lt(e){var t;throw(t=m.onAbort)==null||t.call(m,e),e="Aborted("+e+")",Ie(e),it=!0,e=new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info."),H(e),e}var Rt=e=>e.startsWith("data:application/octet-stream;base64,"),Oe=e=>e.startsWith("file://"),fe;function jt(e){if(e==fe&&ke)return new Uint8Array(ke);if(Ne)return Ne(e);throw"both async and sync fetching of the wasm failed"}function ri(e){return ke?Promise.resolve().then(()=>jt(e)):new Promise((t,n)=>{Q(e,a=>t(new Uint8Array(a)),()=>{try{t(jt(e))}catch(a){n(a)}})})}function He(e,t,n){return ri(e).then(a=>WebAssembly.instantiate(a,t)).then(n,a=>{Ie(`failed to asynchronously prepare wasm: ${a}`),lt(a)})}function Gt(e,t){var n=fe;return ke||typeof WebAssembly.instantiateStreaming!="function"||Rt(n)||Oe(n)||typeof fetch!="function"?He(n,e,t):fetch(n,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,e).then(t,function(c){return Ie(`wasm streaming compile failed: ${c}`),Ie("falling back to ArrayBuffer instantiation"),He(n,e,t)}))}var rt,Bt,oi={490114:(e,t,n,a,c)=>{if(typeof window>"u"||(window.AudioContext||window.webkitAudioContext)===void 0)return 0;if(typeof window.h>"u"){window.h={za:0},window.h.J={},window.h.J.xa=e,window.h.J.capture=t,window.h.J.Ka=n,window.h.ga={},window.h.ga.stopped=a,window.h.ga.wb=c;let p=window.h;p.D=[],p.sc=function(w){for(var b=0;b<p.D.length;++b)if(p.D[b]==null)return p.D[b]=w,b;return p.D.push(w),p.D.length-1},p.Ab=function(w){for(p.D[w]=null;0<p.D.length&&p.D[p.D.length-1]==null;)p.D.pop()},p.Pc=function(w){for(var b=0;b<p.D.length;++b)if(p.D[b]==w)return p.Ab(b)},p.qa=function(w){return p.D[w]},p.Sa=["touchend","click"],p.unlock=function(){for(var w=0;w<p.D.length;++w){var b=p.D[w];b!=null&&b.L!=null&&b.state===p.ga.wb&&b.L.resume().then(()=>{or(b.pb)},L=>{console.error("Failed to resume audiocontext",L)})}p.Sa.map(function(L){document.removeEventListener(L,p.unlock,!0)})},p.Sa.map(function(w){document.addEventListener(w,p.unlock,!0)})}return window.h.za+=1,1},492292:()=>{typeof window.h<"u"&&(window.h.Sa.map(function(e){document.removeEventListener(e,window.h.unlock,!0)}),--window.h.za,window.h.za===0&&delete window.h)},492596:()=>navigator.mediaDevices!==void 0&&navigator.mediaDevices.getUserMedia!==void 0,492700:()=>{try{var e=new(window.AudioContext||window.webkitAudioContext),t=e.sampleRate;return e.close(),t}catch{return 0}},492871:(e,t,n,a,c,p)=>{if(typeof window.h>"u")return-1;var w={},b={};return e==window.h.J.xa&&n!=0&&(b.sampleRate=n),w.L=new(window.AudioContext||window.webkitAudioContext)(b),w.L.suspend(),w.state=window.h.ga.stopped,n=0,e!=window.h.J.xa&&(n=t),w.Z=w.L.createScriptProcessor(a,n,t),w.Z.onaudioprocess=function(L){if((w.ra==null||w.ra.length==0)&&(w.ra=new Float32Array(nt.buffer,c,a*t)),e==window.h.J.capture||e==window.h.J.Ka){for(var F=0;F<t;F+=1)for(var j=L.inputBuffer.getChannelData(F),U=w.ra,Y=0;Y<a;Y+=1)U[Y*t+F]=j[Y];sr(p,a,c)}if(e==window.h.J.xa||e==window.h.J.Ka)for(ar(p,a,c),F=0;F<L.outputBuffer.numberOfChannels;++F)for(j=L.outputBuffer.getChannelData(F),U=w.ra,Y=0;Y<a;Y+=1)j[Y]=U[Y*t+F];else for(F=0;F<L.outputBuffer.numberOfChannels;++F)L.outputBuffer.getChannelData(F).fill(0)},e!=window.h.J.capture&&e!=window.h.J.Ka||navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(function(L){w.Ca=w.L.createMediaStreamSource(L),w.Ca.connect(w.Z),w.Z.connect(w.L.destination)}).catch(function(L){console.log("Failed to get user media: "+L)}),e==window.h.J.xa&&w.Z.connect(w.L.destination),w.pb=p,window.h.sc(w)},495748:e=>window.h.qa(e).L.sampleRate,495821:e=>{e=window.h.qa(e),e.Z!==void 0&&(e.Z.onaudioprocess=function(){},e.Z.disconnect(),e.Z=void 0),e.Ca!==void 0&&(e.Ca.disconnect(),e.Ca=void 0),e.L.close(),e.L=void 0,e.pb=void 0},496221:e=>{window.h.Ab(e)},496271:e=>{e=window.h.qa(e),e.L.resume(),e.state=window.h.ga.wb},496410:e=>{e=window.h.qa(e),e.L.suspend(),e.state=window.h.ga.stopped}},l=e=>{for(;0<e.length;)e.shift()(m)};function i(){var e=K[+ui>>2];return ui+=4,e}var r=(e,t)=>{for(var n=0,a=e.length-1;0<=a;a--){var c=e[a];c==="."?e.splice(a,1):c===".."?(e.splice(a,1),n++):n&&(e.splice(a,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},d=e=>{var t=e.charAt(0)==="/",n=e.substr(-1)==="/";return(e=r(e.split("/").filter(a=>!!a),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},_=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],!e&&!t?".":(t&&(t=t.substr(0,t.length-1)),e+t)},S=e=>{if(e==="/")return"/";e=d(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},R=()=>
14{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);lt("initRandomDevice")},Z=e=>(Z=R())(e),ie=(...e)=>{for(var t="",n=!1,a=e.length-1;-1<=a&&!n;a--){if(n=0<=a?e[a]:"/",typeof n!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,n=n.charAt(0)==="/"}return t=r(t.split("/").filter(c=>!!c),!n).join("/"),(n?"/":"")+t||"."},G=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,oe=(e,t,n)=>{var a=t+n;for(n=t;e[n]&&!(n>=a);)++n;if(16<n-t&&e.buffer&&G)return G.decode(e.subarray(t,n));for(a="";t<n;){var c=e[t++];if(c&128){var p=e[t++]&63;if((c&224)==192)a+=String.fromCharCode((c&31)<<6|p);else{var w=e[t++]&63;c=(c&240)==224?(c&15)<<12|p<<6|w:(c&7)<<18|p<<12|w<<6|e[t++]&63,65536>c?a+=String.fromCharCode(c):(c-=65536,a+=String.fromCharCode(55296|c>>10,56320|c&1023))}}else a+=String.fromCharCode(c)}return a},Fe=[],Be=e=>{for(var t=0,n=0;n<e.length;++n){var a=e.charCodeAt(n);127>=a?t++:2047>=a?t+=2:55296<=a&&57343>=a?(t+=4,++n):t+=3}return t},Se=(e,t,n,a)=>{if(!(0<a))return 0;var c=n;a=n+a-1;for(var p=0;p<e.length;++p){var w=e.charCodeAt(p);if(55296<=w&&57343>=w){var b=e.charCodeAt(++p);w=65536+((w&1023)<<10)|b&1023}if(127>=w){if(n>=a)break;t[n++]=w}else{if(2047>=w){if(n+1>=a)break;t[n++]=192|w>>6}else{if(65535>=w){if(n+2>=a)break;t[n++]=224|w>>12}else{if(n+3>=a)break;t[n++]=240|w>>18,t[n++]=128|w>>12&63}t[n++]=128|w>>6&63}t[n++]=128|w&63}}return t[n]=0,n-c};function ut(e,t){var n=Array(Be(e)+1);return e=Se(e,n,0,n.length),t&&(n.length=e),n}var ot=[];function qe(e,t){ot[e]={input:[],H:[],W:t},Zi(e,Je)}var Je={open(e){var t=ot[e.node.ya];if(!t)throw new X(43);e.s=t,e.seekable=!1},close(e){e.s.W.pa(e.s)},pa(e){e.s.W.pa(e.s)},read(e,t,n,a){if(!e.s||!e.s.W.ib)throw new X(60);for(var c=0,p=0;p<a;p++){try{var w=e.s.W.ib(e.s)}catch{throw new X(29)}if(w===void 0&&c===0)throw new X(6);if(w==null)break;c++,t[n+p]=w}return c&&(e.node.timestamp=Date.now()),c},write(e,t,n,a){if(!e.s||!e.s.W.Na)throw new X(60);try{for(var c=0;c<a;c++)e.s.W.Na(e.s,t[n+c])}catch{throw new X(29)}return a&&(e.node.timestamp=Date.now()),c}},st={ib(){e:{if(!Fe.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
15`)),!e){e=null;break e}Fe=ut(e,!0)}e=Fe.shift()}return e},Na(e,t){t===null||t===10?(ue(oe(e.H,0)),e.H=[]):t!=0&&e.H.push(t)},pa(e){e.H&&0<e.H.length&&(ue(oe(e.H,0)),e.H=[])},Yb(){return{Ac:25856,Cc:5,zc:191,Bc:35387,yc:[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]}},Zb(){return 0},$b(){return[24,80]}},Vt={Na(e,t){t===null||t===10?(Ie(oe(e.H,0)),e.H=[]):t!=0&&e.H.push(t)},pa(e){e.H&&0<e.H.length&&(Ie(oe(e.H,0)),e.H=[])}};function At(e,t){var n=e.l?e.l.length:0;n>=t||(t=Math.max(t,n*(1048576>n?2:1.125)>>>0),n!=0&&(t=Math.max(t,256)),n=e.l,e.l=new Uint8Array(t),0<e.v&&e.l.set(n.subarray(0,e.v),0))}var ne={O:null,V(){return ne.createNode(null,"/",16895,0)},createNode(e,t,n,a){if((n&61440)===24576||(n&61440)===4096)throw new X(63);return ne.O||(ne.O={dir:{node:{Y:ne.j.Y,R:ne.j.R,ka:ne.j.ka,ua:ne.j.ua,tb:ne.j.tb,zb:ne.j.zb,ub:ne.j.ub,sb:ne.j.sb,Da:ne.j.Da},stream:{ba:ne.m.ba}},file:{node:{Y:ne.j.Y,R:ne.j.R},stream:{ba:ne.m.ba,read:ne.m.read,write:ne.m.write,Ya:ne.m.Ya,lb:ne.m.lb,nb:ne.m.nb}},link:{node:{Y:ne.j.Y,R:ne.j.R,ma:ne.j.ma},stream:{}},ab:{node:{Y:ne.j.Y,R:ne.j.R},stream:Yr}}),n=On(e,t,n,a),(n.mode&61440)===16384?(n.j=ne.O.dir.node,n.m=ne.O.dir.stream,n.l={}):(n.mode&61440)===32768?(n.j=ne.O.file.node,n.m=ne.O.file.stream,n.v=0,n.l=null):(n.mode&61440)===40960?(n.j=ne.O.link.node,n.m=ne.O.link.stream):(n.mode&61440)===8192&&(n.j=ne.O.ab.node,n.m=ne.O.ab.stream),n.timestamp=Date.now(),e&&(e.l[t]=n,e.timestamp=n.timestamp),n},Gc(e){return e.l?e.l.subarray?e.l.subarray(0,e.v):new Uint8Array(e.l):new Uint8Array(0)},j:{Y(e){var t={};return t.Ec=(e.mode&61440)===8192?e.id:1,t.Ic=e.id,t.mode=e.mode,t.Lc=1,t.uid=0,t.Hc=0,t.ya=e.ya,(e.mode&61440)===16384?t.size=4096:(e.mode&61440)===32768?t.size=e.v:(e.mode&61440)===40960?t.size=e.link.length:t.size=0,t.wc=new Date(e.timestamp),t.Kc=new Date(e.timestamp),t.Dc=new Date(e.timestamp),t.Hb=4096,t.xc=Math.ceil(t.size/t.Hb),t},R(e,t){if(t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&(t=t.size,e.v!=t))if(t==0)e.l=null,e.v=0;else{var n=e.l;e.l=new Uint8Array(t),n&&e.l.set(n.subarray(0,Math.min(t,e.v))),e.v=t}},ka(){throw Qi[44]},ua(e,t,n,a){return ne.createNode(e,t,n,a)},tb(e,t,n){if((e.mode&61440)===16384){try{var a=Fi(t,n)}catch{}if(a)for(var c in a.l)throw new X(55)}delete e.parent.l[e.name],e.parent.timestamp=Date.now(),e.name=n,t.l[n]=e,t.timestamp=e.parent.timestamp},zb(e,t){delete e.l[t],e.timestamp=Date.now()},ub(e,t){var n=Fi(e,t),a;for(a in n.l)throw new X(55);delete e.l[t],e.timestamp=Date.now()},sb(e){var t=[".",".."],n;for(n of Object.keys(e.l))t.push(n);return t}
15,Da(e,t,n){return e=ne.createNode(e,t,41471,0),e.link=n,e},ma(e){if((e.mode&61440)!==40960)throw new X(28);return e.link}},m:{read(e,t,n,a,c){var p=e.node.l;if(c>=e.node.v)return 0;if(e=Math.min(e.node.v-c,a),8<e&&p.subarray)t.set(p.subarray(c,c+e),n);else for(a=0;a<e;a++)t[n+a]=p[c+a];return e},write(e,t,n,a,c,p){if(t.buffer===Re.buffer&&(p=!1),!a)return 0;if(e=e.node,e.timestamp=Date.now(),t.subarray&&(!e.l||e.l.subarray)){if(p)return e.l=t.subarray(n,n+a),e.v=a;if(e.v===0&&c===0)return e.l=t.slice(n,n+a),e.v=a;if(c+a<=e.v)return e.l.set(t.subarray(n,n+a),c),a}if(At(e,c+a),e.l.subarray&&t.subarray)e.l.set(t.subarray(n,n+a),c);else for(p=0;p<a;p++)e.l[c+p]=t[n+p];return e.v=Math.max(e.v,c+a),a},ba(e,t,n){if(n===1?t+=e.position:n===2&&(e.node.mode&61440)===32768&&(t+=e.node.v),0>t)throw new X(28);return t},Ya(e,t,n){At(e.node,t+n),e.node.v=Math.max(e.node.v,t+n)},lb(e,t,n,a,c){if((e.node.mode&61440)!==32768)throw new X(43);if(e=e.node.l,c&2||e.buffer!==Re.buffer){if((0<n||n+t<e.length)&&(e.subarray?e=e.subarray(n,n+t):e=Array.prototype.slice.call(e,n,n+t)),n=!0,lt(),t=void 0,!t)throw new X(48);Re.set(e,t)}else n=!1,t=e.byteOffset;return{o:t,vc:n}},nb(e,t,n,a){return ne.m.write(e,t,0,a,n,!1),0}}},dt=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},me=null,Et={},si=[],Ur=1,ai=null,In=!0,X=class{constructor(e){this.name="ErrnoError",this.aa=e}},Qi={},zr=class{constructor(){this.h={},this.node=null}get flags(){return this.h.flags}set flags(e){this.h.flags=e}get position(){return this.h.position}set position(e){this.h.position=e}},$r=class{constructor(e,t,n,a){e||(e=this),this.parent=e,this.V=e.V,this.va=null,this.id=Ur++,this.name=t,this.mode=n,this.j={},this.m={},this.ya=a}get read(){return(this.mode&365)===365}set read(e){e?this.mode|=365:this.mode&=-366}get write(){return(this.mode&146)===146}set write(e){e?this.mode|=146:this.mode&=-147}};function Ut(e,t={}){if(e=ie(e),!e)return{path:"",node:null};if(t=Object.assign({hb:!0,Pa:0},t),8<t.Pa)throw new X(32);e=e.split("/").filter(w=>!!w);for(var n=me,a="/",c=0;c<e.length;c++){var p=c===e.length-1;if(p&&t.parent)break;if(n=Fi(n,e[c]),a=d(a+"/"+e[c]),n.va&&(!p||p&&t.hb)&&(n=n.va.root),!p||t.gb){for(p=0;(n.mode&61440)===40960;)if(n=Xr(a),a=ie(_(a),n),n=Ut(a,{Pa:t.Pa+1}).node,40<p++)throw new X(32)}}return{path:a,node:n}}function Tn(e){for(var t;;){if(e===e.parent)return e=e.V.mb,t?e[e.length-1]!=="/"?`${e}/${t}`:e+t:e;t=t?`${e.name}/${t}`:e.name,e=e.parent}}function Pn(e,t){for(var n=0,a=0;a<t.length;a++)n=(n<<5)-n+t.charCodeAt(a)|0;return(e+n>>>0)%ai.length}function Fi(e,t){var n=(e.mode&61440)===16384?(n=Si(e,"x"))?n:e.j.ka?0:2:54;if(n)throw new X(n);for(n=ai[Pn(e.id,t)];n;n=n.fc){var a=n.name;if(n.parent.id===e.id&&a===t)return n}return e.j.ka(e,t)}function On(e,t,n,a){return e=new $r(e,t,n,a),t=Pn(e.parent.id,e.name),e.fc=ai[t],ai[t]=e}function xn(e){var t=["r","w","rw"][e&3];return e&512&&(t+="w"),t}function Si(e,t){if(In)return 0;if(!t.includes("r")||e.mode&292){if(t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73))return 2}else return 2;return 0}function Rn(e,t){try{return Fi(e,t),20}catch{}return Si(e,"wx")}function kt(e){if(e=si[e],!e)throw new X(8);return e}function jn(e,t=-1){if(e=Object.assign(new zr,e),t==-1)e:{for(t=0;4096>=t;t++)if(!si[t])break e;throw new X(33)}return e.X=t,si[t]=e}function Hr(e,t=-1){var n,a;return e=jn(e,t),(a=(n=e.m)==null?void 0:n.Fc)==null||a.call(n,e),e}var Yr={open(e){var t,n;e.m=Et[e.node.ya].m,(n=(t=e.m).open)==null||n.call(t,e)},ba(){throw new X(70)}};function Zi(e,t){Et[e]={m:t}}function Vn(e,t){var n=t==="/";if(n&&me)throw new X(10);if(!n&&t){var a=Ut(t,{hb:!1});if(t=a.path,a=a.node,a.va)throw new X(10);if((a.mode&61440)!==16384)throw new X(54)}t={type:e,Nc:{},mb:t,ec:[]},e=e.V(t),e.V=t,t.root=e,n?me=e:a&&(a.va=t,a.V&&a.V.ec.push(t))}function en(e,t,n){var a=Ut(e,{parent:!0}).node;if(e=S(e),!e||e==="."||e==="..")throw new X(28);var c=Rn(a,e);if(c)throw new X(c);if(!a.j.ua)throw new X(63);return a.j.ua(a,e,t,n)}function Ft(e){return en(e,16895,0)}function Mi(e,t,n){typeof n>"u"&&(n=t,t=438),en(e,t|8192,n)}function tn(e,t){if(!ie(e))throw new X(44);var n=Ut(t,{parent:!0}).node;if(!n)throw new X(44);t=S(t);var a=Rn(n,t);if(a)throw new X(a);if(!n.j.Da)throw new X(63);n.j.Da(n,t,e)}function Xr(e){if(e=Ut(e).node,!e)throw new X(44);if(!e.j.ma)throw new X(28);return ie(Tn(e.parent),e.j.ma(e))}function Li(e,t,n){if(e==="")throw new X(44);if(typeof t=="string"){var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(typeof a>"u")throw Error(`Unknown file open mode: ${t}`);t=a}if(n=t&64?(typeof n>"u"?438:n)&4095|32768:0,typeof e=="object")var c=e;else{e=d(e);try{c=Ut(e,{gb:!(t&131072)}).node}catch{}}if(a=!1,t&64)if(c){if(t&128)throw new X(20)}else c=en(e,n,0),a=!0;if(!c)throw new X(44);if((c.mode&61440)===8192&&(t&=-513),t&65536&&(c.mode&61440)!==16384)throw new X(54);if(!a&&(n=c?(c.mode&61440)===40960?32:(c.mode&61440)===16384&&(xn(t)!=="r"||t&512)?31:Si(c,xn(t)):44))throw new X(n);if(t&512&&!a){if(n=c,n=typeof n=="string"?Ut(n,{gb:!0}).node:n,!n.j.R)throw new X(63);if((n.mode&61440)===16384)throw new X(31);if((n.mode&61440)!==32768)throw new X(28);if(a=Si(n,"w"))throw new X(a);n.j.R(n,{size:0,timestamp:Date.now()})}return t&=-131713,c=jn({node:c,path:Tn(c),flags:t,seekable:!0,position:0,m:c.m,tc:[],error:!1}),c.m.open&&c.m.open(c),!m.logReadFiles||t&1||(nn||(nn={}),e in nn||(nn[e]=1)),c}function kn(e,t,n){if(e.X===null)throw new X(8);if(!e.seekable||!e.m.ba)throw new X(70);if(n!=0&&n!=1&&n!=2)throw new X(28);e.position=e.m.ba(e,t,n),e.tc=[]}var Dn;
15function li(e,t,n){e=d("/dev/"+e);var a=dt(!!t,!!n);Wn||(Wn=64);var c=Wn++<<8|0;Zi(c,{open(p){p.seekable=!1},close(){var p;(p=n==null?void 0:n.buffer)!=null&&p.length&&n(10)},read(p,w,b,L){for(var F=0,j=0;j<L;j++){try{var U=t()}catch{throw new X(29)}if(U===void 0&&F===0)throw new X(6);if(U==null)break;F++,w[b+j]=U}return F&&(p.node.timestamp=Date.now()),F},write(p,w,b,L){for(var F=0;F<L;F++)try{n(w[b+F])}catch{throw new X(29)}return L&&(p.node.timestamp=Date.now()),F}}),Mi(e,a,c)}var Wn,zt={},nn,ui=void 0,qt=(e,t)=>Object.defineProperty(t,"name",{value:e}),rn=[],St=[],re,pt=e=>{if(!e)throw new re("Cannot use deleted val. handle = "+e);return St[e]},vt=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const t=rn.pop()||St.length;return St[t]=e,St[t+1]=1,t}},Nn=e=>{var t=Error,n=qt(e,function(a){this.name=e,this.message=a,a=Error(a).stack,a!==void 0&&(this.stack=this.toString()+`
16`+a.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},n},Bn,Un,xe=e=>{for(var t="";Le[e];)t+=Un[Le[e++]];return t},ci=[],on=()=>{for(;ci.length;){var e=ci.pop();e.g.fa=!1,e.delete()}},hi,Mt={},sn=(e,t)=>{if(t===void 0)throw new re("ptr should not be undefined");for(;e.C;)t=e.na(t),e=e.C;return t},$t={},zn=e=>{e=rr(e);var t=xe(e);return It(e),t},fi=(e,t)=>{var n=$t[e];if(n===void 0)throw e=`${t} has unknown type ${zn(e)}`,new re(e);return n},Ii=()=>{},an=!1,$n=(e,t,n)=>t===n?e:n.C===void 0?null:(e=$n(e,t,n.C),e===null?null:n.Mb(e)),Hn={},Gr=(e,t)=>(t=sn(e,t),Mt[t]),di,Ti=(e,t)=>{if(!t.u||!t.o)throw new di("makeClassHandle requires ptr and ptrType");if(!!t.K!=!!t.F)throw new di("Both smartPtrType and smartPtr must be specified");return t.count={value:1},Kt(Object.create(e,{g:{value:t,writable:!0}}))},Kt=e=>typeof FinalizationRegistry>"u"?(Kt=t=>t,e):(an=new FinalizationRegistry(t=>{t=t.g,--t.count.value,t.count.value===0&&(t.F?t.K.P(t.F):t.u.i.P(t.o))}),Kt=t=>{var n=t.g;return n.F&&an.register(t,{g:n},t),t},Ii=t=>{an.unregister(t)},Kt(e)),Pi={},pi=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function vi(e){return this.fromWireType(Ce[e>>2])}var Jt={},Oi={},Qe=(e,t,n)=>{function a(b){if(b=n(b),b.length!==e.length)throw new di("Mismatched type converter count");for(var L=0;L<e.length;++L)mt(e[L],b[L])}e.forEach(function(b){Oi[b]=t});var c=Array(t.length),p=[],w=0;t.forEach((b,L)=>{$t.hasOwnProperty(b)?c[L]=$t[b]:(p.push(b),Jt.hasOwnProperty(b)||(Jt[b]=[]),Jt[b].push(()=>{c[L]=$t[b],++w,w===p.length&&a(c)}))}),p.length===0&&a(c)};function qr(e,t,n={}){var a=t.name;if(!e)throw new re(`type "${a}" must have a positive integer typeid pointer`);if($t.hasOwnProperty(e)){if(n.Wb)return;throw new re(`Cannot register type '${a}' twice`)}$t[e]=t,delete Oi[e],Jt.hasOwnProperty(e)&&(t=Jt[e],delete Jt[e],t.forEach(c=>c()))}function mt(e,t,n={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return qr(e,t,n)}var ln=e=>{throw new re(e.g.u.i.name+" instance already deleted")};function xi(){}var un=(e,t,n)=>{if(e[t].A===void 0){var a=e[t];e[t]=function(...c){if(!e[t].A.hasOwnProperty(c.length))throw new re(`Function '${n}' called with an invalid number of arguments (${c.length}) - expects one of (${e[t].A})!`);return e[t].A[c.length].apply(this,c)},e[t].A=[],e[t].A[a.ea]=a}},cn=(e,t,n)=>{if(m.hasOwnProperty(e)){if(n===void 0||m[e].A!==void 0&&m[e].A[n]!==void 0)throw new re(`Cannot register public name '${e}' twice`);if(un(m,e,e),m.hasOwnProperty(n))throw new re(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`);m[e].A[n]=t}else m[e]=t,n!==void 0&&(m[e].Mc=n)},Kr=e=>{if(e===void 0)return"_unknown";e=e.replace(/[^a-zA-Z0-9_]/g,"$");var t=e.charCodeAt(0);return 48<=t&&57>=t?`_${e}`:e};function Jr(e,t,n,a,c,p,w,b){this.name=e,this.constructor=t,this.N=n,this.P=a,this.C=c,this.Rb=p,this.na=w,this.Mb=b,this.qb=[]}var Ri=(e,t,n)=>{for(;t!==n;){if(!t.na)throw new re(`Expected null or instance of ${n.name}, got an instance of ${t.name}`);e=t.na(e),t=t.C}return e};function Qr(e,t){if(t===null){if(this.Ma)throw new re(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new re(`Cannot pass "${pn(t)}" as a ${this.name}`);if(!t.g.o)throw new re(`Cannot pass deleted object as a pointer of type ${this.name}`);return Ri(t.g.o,t.g.u.i,this.i)}function Zr(e,t){if(t===null){if(this.Ma)throw new re(`null is not a valid ${this.name}`);if(this.ta){var n=this.Oa();return e!==null&&e.push(this.P,n),n}return 0}if(!t||!t.g)throw new re(`Cannot pass "${pn(t)}" as a ${this.name}`);if(!t.g.o)throw new re(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.sa&&t.g.u.sa)throw new re(`Cannot convert argument of type ${t.g.K?t.g.K.name:t.g.u.name} to parameter type ${this.name}`);if(n=Ri(t.g.o,t.g.u.i,this.i),this.ta){if(t.g.F===void 0)throw new re("Passing raw pointer to smart pointer is illegal");
vendor: 4,511 bytes, line 16
16switch(this.nc){case 0:if(t.g.K===this)n=t.g.F;else throw new re(`Cannot convert argument of type ${t.g.K?t.g.K.name:t.g.u.name} to parameter type ${this.name}`);break;case 1:n=t.g.F;break;case 2:if(t.g.K===this)n=t.g.F;else{var a=t.clone();n=this.jc(n,vt(()=>a.delete())),e!==null&&e.push(this.P,n)}break;default:throw new re("Unsupporting sharing policy")}}return n}function eo(e,t){if(t===null){if(this.Ma)throw new re(`null is not a valid ${this.name}`);return 0}if(!t.g)throw new re(`Cannot pass "${pn(t)}" as a ${this.name}`);if(!t.g.o)throw new re(`Cannot pass deleted object as a pointer of type ${this.name}`);if(t.g.u.sa)throw new re(`Cannot convert argument of type ${t.g.u.name} to parameter type ${this.name}`);return Ri(t.g.o,t.g.u.i,this.i)}function ji(e,t,n,a,c,p,w,b,L,F,j){this.name=e,this.i=t,this.Ma=n,this.sa=a,this.ta=c,this.ic=p,this.nc=w,this.rb=b,this.Oa=L,this.jc=F,this.P=j,c||t.C!==void 0?this.toWireType=Zr:(this.toWireType=a?Qr:eo,this.M=null)}var Yn=(e,t,n)=>{if(!m.hasOwnProperty(e))throw new di("Replacing nonexistent public symbol");m[e].A!==void 0&&n!==void 0?m[e].A[n]=t:(m[e]=t,m[e].ea=n)},Vi=[],Xn,hn=e=>{var t=Vi[e];return t||(e>=Vi.length&&(Vi.length=e+1),Vi[e]=t=Xn.get(e)),t},to=(e,t,n=[])=>(e.includes("j")?(e=e.replace(/p/g,"i"),t=(0,m["dynCall_"+e])(t,...n)):t=hn(t)(...n),t),io=(e,t)=>(...n)=>to(e,t,n),ze=(e,t)=>{e=xe(e);var n=e.includes("j")?io(e,t):hn(t);if(typeof n!="function")throw new re(`unknown function pointer with signature ${e}: ${t}`);return n},Gn,Lt=(e,t)=>{function n(p){c[p]||$t[p]||(Oi[p]?Oi[p].forEach(n):(a.push(p),c[p]=!0))}var a=[],c={};throw t.forEach(n),new Gn(`${e}: `+a.map(zn).join([", "]))};function no(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].M===void 0)return!0;return!1}function ki(e,t,n,a,c){var p=t.length;if(2>p)throw new re("argTypes array size mismatch! Must at least get return value and 'this' types!");var w=t[1]!==null&&n!==null,b=no(t),L=t[0].name!=="void",F=p-2,j=Array(F),U=[],Y=[];return qt(e,function(...C){if(C.length!==F)throw new re(`function ${e} called with ${C.length} arguments, expected ${F}`);if(Y.length=0,U.length=w?2:1,U[0]=c,w){var V=t[1].toWireType(Y,this);U[1]=V}for(var O=0;O<F;++O)j[O]=t[O+2].toWireType(Y,C[O]),U.push(j[O]);if(C=a(...U),b)pi(Y);else for(O=w?1:2;O<t.length;O++){var ae=O===1?V:j[O-2];t[O].M!==null&&t[O].M(ae)}return V=L?t[0].fromWireType(C):void 0,V})}var Di=(e,t)=>{for(var n=[],a=0;a<e;a++)n.push(Ce[t+4*a>>2]);return n},fn=e=>{e=e.trim();const t=e.indexOf("(");return t!==-1?e.substr(0,t):e},qn=(e,t,n)=>{if(!(e instanceof Object))throw new re(`${n} with invalid "this": ${e}`);if(!(e instanceof t.i.constructor))throw new re(`${n} incompatible with "this" of type ${e.constructor.name}`);if(!e.g.o)throw new re(`cannot call emscripten binding method ${n} on deleted object`);return Ri(e.g.o,e.g.u.i,t.i)},dn=e=>{9<e&&--St[e+1]===0&&(St[e]=void 0,rn.push(e))},ro={name:"emscripten::val",fromWireType:e=>{var t=pt(e);return dn(e),t},toWireType:(e,t)=>vt(t),argPackAdvance:8,readValueFromPointer:vi,M:null},oo=(e,t,n)=>{switch(t){case 1:return n?function(a){return this.fromWireType(Re[a])}:function(a){return this.fromWireType(Le[a])};case 2:return n?function(a){return this.fromWireType($e[a>>1])}:function(a){return this.fromWireType(at[a>>1])};case 4:return n?function(a){return this.fromWireType(K[a>>2])}:function(a){return this.fromWireType(Ce[a>>2])};default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},pn=e=>{if(e===null)return"null";var t=typeof e;return t==="object"||t==="array"||t==="function"?e.toString():""+e},so=(e,t)=>{switch(t){case 4:return function(n){return this.fromWireType(nt[n>>2])};case 8:return function(n){return this.fromWireType(Ct[n>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},ao=(e,t,n)=>{switch(t){case 1:return n?a=>Re[a]:a=>Le[a];case 2:return n?a=>$e[a>>1]:a=>at[a>>1];case 4:return n?a=>K[a>>2]:a=>Ce[a>>2];default:throw new TypeError(`invalid integer width (${t}): ${e}`)}},Kn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,lo=(e,t)=>{for(var n=e>>1,a=n+t/2;!(n>=a)&&at[n];)++n;if(n<<=1,32<n-e&&Kn)return Kn.decode(Le.subarray(e,n));for(n="",a=0;!(a>=t/2);++a){var c=$e[e+2*a>>1];if(c==0)break;n+=String.fromCharCode(c)}return n},uo=(e,t,n)=>{if(n??(n=2147483647),2>n)return 0;n-=2;var a=t;n=n<2*e.length?n/2:e.length;for(var c=0;c<n;++c)$e[t>>1]=e.charCodeAt(c),t+=2;return $e[t>>1]=0,t-a},co=e=>2*e.length,ho=(e,t)=>{for(var n=0,a="";!(n>=t/4);){var c=K[e+4*n>>2];if(c==0)break;
vendor: 4,386 bytes, lines 16-17
16++n,65536<=c?(c-=65536,a+=String.fromCharCode(55296|c>>10,56320|c&1023)):a+=String.fromCharCode(c)}return a},fo=(e,t,n)=>{if(n??(n=2147483647),4>n)return 0;var a=t;n=a+n-4;for(var c=0;c<e.length;++c){var p=e.charCodeAt(c);if(55296<=p&&57343>=p){var w=e.charCodeAt(++c);p=65536+((p&1023)<<10)|w&1023}if(K[t>>2]=p,t+=4,t+4>n)break}return K[t>>2]=0,t-a},po=e=>{for(var t=0,n=0;n<e.length;++n){var a=e.charCodeAt(n);55296<=a&&57343>=a&&++n,t+=4}return t},Jn=(e,t,n)=>{var a=[];return e=e.toWireType(a,n),a.length&&(Ce[t>>2]=vt(a)),e},vo={},vn=e=>{var t=vo[e];return t===void 0?xe(e):t},mn=[],mo=e=>{var t=mn.length;return mn.push(e),t},go=(e,t)=>{for(var n=Array(e),a=0;a<e;++a)n[a]=fi(Ce[t+4*a>>2],"parameter "+a);return n},yo=Reflect.construct,mi=e=>e%4===0&&(e%100!==0||e%400===0),wo=[0,31,60,91,121,152,182,213,244,274,305,335],bo=[0,31,59,90,120,151,181,212,243,273,304,334],gn=[],yn={},Qn=()=>{if(!wn){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:_e||"./this.program"},t;for(t in yn)yn[t]===void 0?delete e[t]:e[t]=yn[t];var n=[];for(t in e)n.push(`${t}=${e[t]}`);wn=n}return wn},wn,Zn=[31,29,31,30,31,30,31,31,30,31,30,31],er=[31,28,31,30,31,30,31,31,30,31,30,31],tr=(e,t,n,a)=>{function c(C,V,O){for(C=typeof C=="number"?C.toString():C||"";C.length<V;)C=O[0]+C;return C}function p(C,V){return c(C,V,"0")}function w(C,V){function O(de){return 0>de?-1:0<de?1:0}var ae;return(ae=O(C.getFullYear()-V.getFullYear()))===0&&(ae=O(C.getMonth()-V.getMonth()))===0&&(ae=O(C.getDate()-V.getDate())),ae}function b(C){switch(C.getDay()){case 0:return new Date(C.getFullYear()-1,11,29);case 1:return C;case 2:return new Date(C.getFullYear(),0,3);case 3:return new Date(C.getFullYear(),0,2);case 4:return new Date(C.getFullYear(),0,1);case 5:return new Date(C.getFullYear()-1,11,31);case 6:return new Date(C.getFullYear()-1,11,30)}}function L(C){var V=C.ca;for(C=new Date(new Date(C.da+1900,0,1).getTime());0<V;){var O=C.getMonth(),ae=(mi(C.getFullYear())?Zn:er)[O];if(V>ae-C.getDate())V-=ae-C.getDate()+1,C.setDate(1),11>O?C.setMonth(O+1):(C.setMonth(0),C.setFullYear(C.getFullYear()+1));else{C.setDate(C.getDate()+V);break}}return O=new Date(C.getFullYear()+1,0,4),V=b(new Date(C.getFullYear(),0,4)),O=b(O),0>=w(V,C)?0>=w(O,C)?C.getFullYear()+1:C.getFullYear():C.getFullYear()-1}var F=Ce[a+40>>2];a={qc:K[a>>2],pc:K[a+4>>2],Ea:K[a+8>>2],Ra:K[a+12>>2],Fa:K[a+16>>2],da:K[a+20>>2],S:K[a+24>>2],ca:K[a+28>>2],Oc:K[a+32>>2],oc:K[a+36>>2],rc:F&&F?oe(Le,F):""},n=n?oe(Le,n):"",F={"%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"};for(var j in F)n=n.replace(new RegExp(j,"g"),F[j]);var U="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Y="January February March April May June July August September October November December".split(" ");F={"%a":C=>U[C.S].substring(0,3),"%A":C=>U[C.S],"%b":C=>Y[C.Fa].substring(0,3),"%B":C=>Y[C.Fa],"%C":C=>p((C.da+1900)/100|0,2),"%d":C=>p(C.Ra,2),"%e":C=>c(C.Ra,2," "),"%g":C=>L(C).toString().substring(2),"%G":L,"%H":C=>p(C.Ea,2),"%I":C=>(C=C.Ea,C==0?C=12:12<C&&(C-=12),p(C,2)),"%j":C=>{for(var V=0,O=0;O<=C.Fa-1;V+=(mi(C.da+1900)?Zn:er)[O++]);return p(C.Ra+V,3)},"%m":C=>p(C.Fa+1,2),"%M":C=>p(C.pc,2),"%n":()=>`
17`,"%p":C=>0<=C.Ea&&12>C.Ea?"AM":"PM","%S":C=>p(C.qc,2),"%t":()=>"	","%u":C=>C.S||7,"%U":C=>p(Math.floor((C.ca+7-C.S)/7),2),"%V":C=>{var V=Math.floor((C.ca+7-(C.S+6)%7)/7);if(2>=(C.S+371-C.ca-2)%7&&V++,V)V==53&&(O=(C.S+371-C.ca)%7,O==4||O==3&&mi(C.da)||(V=1));else{V=52;var O=(C.S+7-C.ca-1)%7;(O==4||O==5&&mi(C.da%400-1))&&V++}return p(V,2)},"%w":C=>C.S,"%W":C=>p(Math.floor((C.ca+7-(C.S+6)%7)/7),2),"%y":C=>(C.da+1900).toString().substring(2),"%Y":C=>C.da+1900,"%z":C=>{C=C.oc;var V=0<=C;return C=Math.abs(C)/60,(V?"+":"-")+("0000"+(C/60*100+C%60)).slice(-4)},"%Z":C=>C.rc,"%%":()=>"%"},n=n.replace(/%%/g,"\0\0");for(j in F)n.includes(j)&&(n=n.replace(new RegExp(j,"g"),F[j](a)));return n=n.replace(/\0\0/g,"%"),j=ut(n,!1),j.length>t?0:(Re.set(j,e),j.length-1)};
17[44].forEach(e=>{Qi[e]=new X(e),Qi[e].stack="<generic error, no stack>"}),ai=Array(4096),Vn(ne,"/"),Ft("/tmp"),Ft("/home"),Ft("/home/web_user"),function(){Ft("/dev"),Zi(259,{read:()=>0,write:(a,c,p,w)=>w}),Mi("/dev/null",259),qe(1280,st),qe(1536,Vt),Mi("/dev/tty",1280),Mi("/dev/tty1",1536);var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(t=Z(e).byteLength),e[--t]);li("random",n),li("urandom",n),Ft("/dev/shm"),Ft("/dev/shm/tmp")}(),function(){Ft("/proc");var e=Ft("/proc/self");Ft("/proc/self/fd"),Vn({V(){var t=On(e,"fd",16895,73);return t.j={ka(n,a){var c=kt(+a);return n={parent:null,V:{mb:"fake"},j:{ma:()=>c.path}},n.parent=n}},t}},"/proc/self/fd")}(),re=m.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},St.push(0,1,void 0,1,null,1,!0,1,!1,1),m.count_emval_handles=()=>St.length/2-5-rn.length,Bn=m.PureVirtualError=Nn("PureVirtualError");for(var ir=Array(256),Wi=0;256>Wi;++Wi)ir[Wi]=String.fromCharCode(Wi);Un=ir,m.getInheritedInstanceCount=()=>Object.keys(Mt).length,m.getLiveInheritedInstances=()=>{var e=[],t;for(t in Mt)Mt.hasOwnProperty(t)&&e.push(Mt[t]);return e},m.flushPendingDeletes=on,m.setDelayFunction=e=>{hi=e,ci.length&&hi&&hi(on)},di=m.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(xi.prototype,{isAliasOf:function(e){if(!(this instanceof xi&&e instanceof xi))return!1;var t=this.g.u.i,n=this.g.o;e.g=e.g;var a=e.g.u.i;for(e=e.g.o;t.C;)n=t.na(n),t=t.C;for(;a.C;)e=a.na(e),a=a.C;return t===a&&n===e},clone:function(){if(this.g.o||ln(this),this.g.ia)return this.g.count.value+=1,this;var e=Kt,t=Object,n=t.create,a=Object.getPrototypeOf(this),c=this.g;return e=e(n.call(t,a,{g:{value:{count:c.count,fa:c.fa,ia:c.ia,o:c.o,u:c.u,F:c.F,K:c.K}}})),e.g.count.value+=1,e.g.fa=!1,e},delete(){if(this.g.o||ln(this),this.g.fa&&!this.g.ia)throw new re("Object already scheduled for deletion");Ii(this);var e=this.g;--e.count.value,e.count.value===0&&(e.F?e.K.P(e.F):e.u.i.P(e.o)),this.g.ia||(this.g.F=void 0,this.g.o=void 0)},isDeleted:function(){return!this.g.o},deleteLater:function(){if(this.g.o||ln(this),this.g.fa&&!this.g.ia)throw new re("Object already scheduled for deletion");return ci.push(this),ci.length===1&&hi&&hi(on),this.g.fa=!0,this}}),Object.assign(ji.prototype,{Sb(e){return this.rb&&(e=this.rb(e)),e},bb(e){var t;(t=this.P)==null||t.call(this,e)},argPackAdvance:8,readValueFromPointer:vi,fromWireType:function(e){function t(){return this.ta?Ti(this.i.N,{u:this.ic,o:n,K:this,F:e}):Ti(this.i.N,{u:this,o:e})}var n=this.Sb(e);if(!n)return this.bb(e),null;var a=Gr(this.i,n);if(a!==void 0)return a.g.count.value===0?(a.g.o=n,a.g.F=e,a.clone()):(a=a.clone(),this.bb(e),a);if(a=this.i.Rb(n),a=Hn[a],!a)return t.call(this);a=this.sa?a.Ib:a.pointerType;var c=$n(n,this.i,a.i);return c===null?t.call(this):this.ta?Ti(a.i.N,{u:a,o:c,K:this,F:e}):Ti(a.i.N,{u:a,o:c})}}),Gn=m.UnboundTypeError=Nn("UnboundTypeError");var nr={__syscall_fcntl64:function(e,t,n){ui=n;try{var a=kt(e);switch(t){case 0:var c=i();if(0>c)break;for(;si[c];)c++;return Hr(a,c).X;case 1:case 2:return 0;case 3:return a.flags;case 4:return c=i(),a.flags|=c,0;case 12:return c=i(),$e[c+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(p){if(typeof zt>"u"||p.name!=="ErrnoError")throw p;return-p.aa}},__syscall_ioctl:function(e,t,n){ui=n;try{var a=kt(e);switch(t){case 21509:return a.s?0:-59;case 21505:if(!a.s)return-59;if(a.s.W.Yb){e=[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 c=i();K[c>>2]=25856,K[c+4>>2]=5,K[c+8>>2]=191,K[c+12>>2]=35387;for(var p=0;32>p;p++)Re[c+p+17]=e[p]||0}return 0;case 21510:case 21511:case 21512:return a.s?0:-59;case 21506:case 21507:case 21508:if(!a.s)return-59;if(a.s.W.Zb)for(c=i(),e=[],p=0;32>p;p++)e.push(Re[c+p+17]);return 0;case 21519:return a.s?(c=i(),K[c>>2]=0):-59;case 21520:return a.s?-28:-59;case 21531:if(c=i(),!a.m.Xb)throw new X(59);return a.m.Xb(a,t,c);case 21523:return a.s?(a.s.W.$b&&(p=[24,80],c=i(),$e[c>>1]=p[0],$e[c+2>>1]=p[1]),0):-59;case 21524:return a.s?0:-59;case 21515:return a.s?0:-59;default:return-28}}catch(w){if(typeof zt>"u"||w.name!=="ErrnoError")throw w;return-w.aa}}
17,__syscall_openat:function(e,t,n,a){ui=a;try{t=t?oe(Le,t):"";var c=t;if(c.charAt(0)==="/")t=c;else{var p=e===-100?"/":kt(e).path;if(c.length==0)throw new X(44);t=d(p+"/"+c)}var w=a?i():0;return Li(t,n,w).X}catch(b){if(typeof zt>"u"||b.name!=="ErrnoError")throw b;return-b.aa}},_abort_js:()=>{lt("")},_embind_create_inheriting_constructor:(e,t,n)=>{e=xe(e),t=fi(t,"wrapper"),n=pt(n);var a=t.i,c=a.N,p=a.C.N,w=a.C.constructor;return e=qt(e,function(...b){a.C.qb.forEach((function(L){if(this[L]===p[L])throw new Bn(`Pure virtual function ${L} must be implemented in JavaScript`)}).bind(this)),Object.defineProperty(this,"__parent",{value:c}),this.__construct(...b)}),c.__construct=function(...b){if(this===c)throw new re("Pass correct 'this' to __construct");b=w.implement(this,...b),Ii(b);var L=b.g;if(b.notifyOnDestruction(),L.ia=!0,Object.defineProperties(this,{g:{value:L}}),Kt(this),b=L.o,b=sn(a,b),Mt.hasOwnProperty(b))throw new re(`Tried to register registered instance: ${b}`);Mt[b]=this},c.__destruct=function(){if(this===c)throw new re("Pass correct 'this' to __destruct");Ii(this);var b=this.g.o;if(b=sn(a,b),Mt.hasOwnProperty(b))delete Mt[b];else throw new re(`Tried to unregister unregistered instance: ${b}`)},e.prototype=Object.create(c),Object.assign(e.prototype,n),vt(e)},_embind_finalize_value_object:e=>{var t=Pi[e];delete Pi[e];var n=t.Oa,a=t.P,c=t.fb,p=c.map(w=>w.Vb).concat(c.map(w=>w.lc));Qe([e],p,w=>{var b={};return c.forEach((L,F)=>{var j=w[F],U=L.Tb,Y=L.Ub,C=w[F+c.length],V=L.kc,O=L.mc;b[L.Pb]={read:ae=>j.fromWireType(U(Y,ae)),write:(ae,de)=>{var N=[];V(O,ae,C.toWireType(N,de)),pi(N)}}}),[{name:t.name,fromWireType:L=>{var F={},j;for(j in b)F[j]=b[j].read(L);return a(L),F},toWireType:(L,F)=>{for(var j in b)if(!(j in F))throw new TypeError(`Missing field: "${j}"`);var U=n();for(j in b)b[j].write(U,F[j]);return L!==null&&L.push(a,U),U},argPackAdvance:8,readValueFromPointer:vi,M:a}]})},_embind_register_bigint:()=>{},_embind_register_bool:(e,t,n,a)=>{t=xe(t),mt(e,{name:t,fromWireType:function(c){return!!c},toWireType:function(c,p){return p?n:a},argPackAdvance:8,readValueFromPointer:function(c){return this.fromWireType(Le[c])},M:null})},_embind_register_class:(e,t,n,a,c,p,w,b,L,F,j,U,Y)=>{j=xe(j),p=ze(c,p),b&&(b=ze(w,b)),F&&(F=ze(L,F)),Y=ze(U,Y);var C=Kr(j);cn(C,function(){Lt(`Cannot construct ${j} due to unbound types`,[a])}),Qe([e,t,n],a?[a]:[],V=>{if(V=V[0],a)var O=V.i,ae=O.N;else ae=xi.prototype;V=qt(j,function(...We){if(Object.getPrototypeOf(this)!==de)throw new re("Use 'new' to construct "+j);if(N.$===void 0)throw new re(j+" has no accessible constructor");var Ze=N.$[We.length];if(Ze===void 0)throw new re(`Tried to invoke ctor of ${j} with invalid number of parameters (${We.length}) - expected (${Object.keys(N.$).toString()}) parameters instead!`);return Ze.apply(this,We)});var de=Object.create(ae,{constructor:{value:V}});V.prototype=de;var N=new Jr(j,V,de,Y,O,p,b,F);if(N.C){var Me;(Me=N.C).oa??(Me.oa=[]),N.C.oa.push(N)}return O=new ji(j,N,!0,!1,!1),Me=new ji(j+"*",N,!1,!1,!1),ae=new ji(j+" const*",N,!1,!0,!1),Hn[e]={pointerType:Me,Ib:ae},Yn(C,V),[O,Me,ae]})},_embind_register_class_class_function:(e,t,n,a,c,p,w)=>{var b=Di(n,a);t=xe(t),t=fn(t),p=ze(c,p),Qe([],[e],L=>{function F(){Lt(`Cannot call ${j} due to unbound types`,b)}L=L[0];var j=`${L.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var U=L.i.constructor;return U[t]===void 0?(F.ea=n-1,U[t]=F):(un(U,t,j),U[t].A[n-1]=F),Qe([],b,Y=>{if(Y=ki(j,[Y[0],null].concat(Y.slice(1)),null,p,w),U[t].A===void 0?(Y.ea=n-1,U[t]=Y):U[t].A[n-1]=Y,L.i.oa)for(const C of L.i.oa)C.constructor.hasOwnProperty(t)||(C.constructor[t]=Y);return[]}),[]})},_embind_register_class_class_property:(e,t,n,a,c,p,w,b)=>{t=xe(t),p=ze(c,p),Qe([],[e],L=>{L=L[0];var F=`${L.name}.${t}`,j={get(){Lt(`Cannot access ${F} due to unbound types`,[n])},enumerable:!0,configurable:!0};return j.set=b?()=>{Lt(`Cannot access ${F} due to unbound types`,[n])}:()=>{throw new re(`${F} is a read-only property`)},Object.defineProperty(L.i.constructor,t,j),Qe([],[n],U=>{U=U[0];var Y={get(){return U.fromWireType(p(a))},enumerable:!0};return b&&(b=ze(w,b),Y.set=C=>{var V=[];b(a,U.toWireType(V,C)),pi(V)}),Object.defineProperty(L.i.constructor,t,Y),[]}),[]})},_embind_register_class_constructor:(e,t,n,a,c,p)=>{var w=Di(t,n);c=ze(a,c),Qe([],[e],b=>{b=b[0];
vendor: 4,186 bytes, line 17
17var L=`constructor ${b.name}`;if(b.i.$===void 0&&(b.i.$=[]),b.i.$[t-1]!==void 0)throw new re(`Cannot register multiple constructors with identical number of parameters (${t-1}) for class '${b.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return b.i.$[t-1]=()=>{Lt(`Cannot construct ${b.name} due to unbound types`,w)},Qe([],w,F=>(F.splice(1,0,null),b.i.$[t-1]=ki(L,F,null,c,p),[])),[]})},_embind_register_class_function:(e,t,n,a,c,p,w,b)=>{var L=Di(n,a);t=xe(t),t=fn(t),p=ze(c,p),Qe([],[e],F=>{function j(){Lt(`Cannot call ${U} due to unbound types`,L)}F=F[0];var U=`${F.name}.${t}`;t.startsWith("@@")&&(t=Symbol[t.substring(2)]),b&&F.i.qb.push(t);var Y=F.i.N,C=Y[t];return C===void 0||C.A===void 0&&C.className!==F.name&&C.ea===n-2?(j.ea=n-2,j.className=F.name,Y[t]=j):(un(Y,t,U),Y[t].A[n-2]=j),Qe([],L,V=>(V=ki(U,V,F,p,w),Y[t].A===void 0?(V.ea=n-2,Y[t]=V):Y[t].A[n-2]=V,[])),[]})},_embind_register_class_property:(e,t,n,a,c,p,w,b,L,F)=>{t=xe(t),c=ze(a,c),Qe([],[e],j=>{j=j[0];var U=`${j.name}.${t}`,Y={get(){Lt(`Cannot access ${U} due to unbound types`,[n,w])},enumerable:!0,configurable:!0};return Y.set=L?()=>Lt(`Cannot access ${U} due to unbound types`,[n,w]):()=>{throw new re(U+" is a read-only property")},Object.defineProperty(j.i.N,t,Y),Qe([],L?[n,w]:[n],C=>{var V=C[0],O={get(){var de=qn(this,j,U+" getter");return V.fromWireType(c(p,de))},enumerable:!0};if(L){L=ze(b,L);var ae=C[1];O.set=function(de){var N=qn(this,j,U+" setter"),Me=[];L(F,N,ae.toWireType(Me,de)),pi(Me)}}return Object.defineProperty(j.i.N,t,O),[]}),[]})},_embind_register_emval:e=>mt(e,ro),_embind_register_enum:(e,t,n,a)=>{function c(){}t=xe(t),c.values={},mt(e,{name:t,constructor:c,fromWireType:function(p){return this.constructor.values[p]},toWireType:(p,w)=>w.value,argPackAdvance:8,readValueFromPointer:oo(t,n,a),M:null}),cn(t,c)},_embind_register_enum_value:(e,t,n)=>{var a=fi(e,"enum");t=xe(t),e=a.constructor,a=Object.create(a.constructor.prototype,{value:{value:n},constructor:{value:qt(`${a.name}_${t}`,function(){})}}),e.values[n]=a,e[t]=a},_embind_register_float:(e,t,n)=>{t=xe(t),mt(e,{name:t,fromWireType:a=>a,toWireType:(a,c)=>c,argPackAdvance:8,readValueFromPointer:so(t,n),M:null})},_embind_register_function:(e,t,n,a,c,p)=>{var w=Di(t,n);e=xe(e),e=fn(e),c=ze(a,c),cn(e,function(){Lt(`Cannot call ${e} due to unbound types`,w)},t-1),Qe([],w,b=>(Yn(e,ki(e,[b[0],null].concat(b.slice(1)),null,c,p),t-1),[]))},_embind_register_integer:(e,t,n,a,c)=>{if(t=xe(t),c===-1&&(c=4294967295),c=b=>b,a===0){var p=32-8*n;c=b=>b<<p>>>p}var w=t.includes("unsigned")?function(b,L){return L>>>0}:function(b,L){return L};mt(e,{name:t,fromWireType:c,toWireType:w,argPackAdvance:8,readValueFromPointer:ao(t,n,a!==0),M:null})},_embind_register_memory_view:(e,t,n)=>{function a(p){return new c(Re.buffer,Ce[p+4>>2],Ce[p>>2])}var c=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];n=xe(n),mt(e,{name:n,fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{Wb:!0})},_embind_register_std_string:(e,t)=>{t=xe(t);var n=t==="std::string";mt(e,{name:t,fromWireType:function(a){var c=Ce[a>>2],p=a+4;if(n)for(var w=p,b=0;b<=c;++b){var L=p+b;if(b==c||Le[L]==0){if(w=w?oe(Le,w,L-w):"",F===void 0)var F=w;else F+="\0",F+=w;w=L+1}}else{for(F=Array(c),b=0;b<c;++b)F[b]=String.fromCharCode(Le[p+b]);F=F.join("")}return It(a),F},toWireType:function(a,c){c instanceof ArrayBuffer&&(c=new Uint8Array(c));var p=typeof c=="string";if(!(p||c instanceof Uint8Array||c instanceof Uint8ClampedArray||c instanceof Int8Array))throw new re("Cannot pass non-string to std::string");var w=n&&p?Be(c):c.length,b=bn(4+w+1),L=b+4;if(Ce[b>>2]=w,n&&p)Se(c,Le,L,w+1);else if(p)for(p=0;p<w;++p){var F=c.charCodeAt(p);if(255<F)throw It(L),new re("String has UTF-16 code units that do not fit in 8 bits");Le[L+p]=F}else for(p=0;p<w;++p)Le[L+p]=c[p];return a!==null&&a.push(It,b),b},argPackAdvance:8,readValueFromPointer:vi,M(a){It(a)}})},_embind_register_std_wstring:(e,t,n)=>{if(n=xe(n),t===2)var a=lo,c=uo,p=co,w=b=>at[b>>1];else t===4&&(a=ho,c=fo,p=po,w=b=>Ce[b>>2]);mt(e,{name:n,fromWireType:b=>{for(var L=Ce[b>>2],F,j=b+4,U=0;U<=L;
17++U){var Y=b+4+U*t;(U==L||w(Y)==0)&&(j=a(j,Y-j),F===void 0?F=j:(F+="\0",F+=j),j=Y+t)}return It(b),F},toWireType:(b,L)=>{if(typeof L!="string")throw new re(`Cannot pass non-string to C++ string type ${n}`);var F=p(L),j=bn(4+F+t);return Ce[j>>2]=F/t,c(L,j+4,F+t),b!==null&&b.push(It,j),j},argPackAdvance:8,readValueFromPointer:vi,M(b){It(b)}})},_embind_register_value_object:(e,t,n,a,c,p)=>{Pi[e]={name:xe(t),Oa:ze(n,a),P:ze(c,p),fb:[]}},_embind_register_value_object_field:(e,t,n,a,c,p,w,b,L,F)=>{Pi[e].fb.push({Pb:xe(t),Vb:n,Tb:ze(a,c),Ub:p,lc:w,kc:ze(b,L),mc:F})},_embind_register_void:(e,t)=>{t=xe(t),mt(e,{Jc:!0,name:t,argPackAdvance:0,fromWireType:()=>{},toWireType:()=>{}})},_emscripten_get_now_is_monotonic:()=>1,_emscripten_memcpy_js:(e,t,n)=>Le.copyWithin(e,t,t+n),_emscripten_throw_longjmp:()=>{throw 1/0},_emval_as:(e,t,n)=>(e=pt(e),t=fi(t,"emval::as"),Jn(t,n,e)),_emval_call_method:(e,t,n,a,c)=>(e=mn[e],t=pt(t),n=vn(n),e(t,t[n],a,c)),_emval_decref:dn,_emval_get_method_caller:(e,t,n)=>{var a=go(e,t),c=a.shift();e--;var p=Array(e);return t=`methodCaller<(${a.map(w=>w.name).join(", ")}) => ${c.name}>`,mo(qt(t,(w,b,L,F)=>{for(var j=0,U=0;U<e;++U)p[U]=a[U].readValueFromPointer(F+j),j+=a[U].argPackAdvance;return w=n===1?yo(b,p):b.apply(w,p),Jn(c,L,w)}))},_emval_get_module_property:e=>(e=vn(e),vt(m[e])),_emval_get_property:(e,t)=>(e=pt(e),t=pt(t),vt(e[t])),_emval_incref:e=>{9<e&&(St[e+1]+=1)},_emval_new_array:()=>vt([]),_emval_new_cstring:e=>vt(vn(e)),_emval_new_object:()=>vt({}),_emval_run_destructors:e=>{var t=pt(e);pi(t),dn(e)},_emval_set_property:(e,t,n)=>{e=pt(e),t=pt(t),n=pt(n),e[t]=n},_emval_take_value:(e,t)=>(e=fi(e,"_emval_take_value"),e=e.readValueFromPointer(t),vt(e)),_gmtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),K[n>>2]=e.getUTCSeconds(),K[n+4>>2]=e.getUTCMinutes(),K[n+8>>2]=e.getUTCHours(),K[n+12>>2]=e.getUTCDate(),K[n+16>>2]=e.getUTCMonth(),K[n+20>>2]=e.getUTCFullYear()-1900,K[n+24>>2]=e.getUTCDay(),K[n+28>>2]=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},_localtime_js:function(e,t,n){e=new Date(1e3*(t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN)),K[n>>2]=e.getSeconds(),K[n+4>>2]=e.getMinutes(),K[n+8>>2]=e.getHours(),K[n+12>>2]=e.getDate(),K[n+16>>2]=e.getMonth(),K[n+20>>2]=e.getFullYear()-1900,K[n+24>>2]=e.getDay(),K[n+28>>2]=(mi(e.getFullYear())?wo:bo)[e.getMonth()]+e.getDate()-1|0,K[n+36>>2]=-(60*e.getTimezoneOffset()),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var a=new Date(e.getFullYear(),0,1).getTimezoneOffset();K[n+32>>2]=(t!=a&&e.getTimezoneOffset()==Math.min(a,t))|0},_tzset_js:(e,t,n,a)=>{var c=new Date().getFullYear(),p=new Date(c,0,1),w=new Date(c,6,1);c=p.getTimezoneOffset();var b=w.getTimezoneOffset();Ce[e>>2]=60*Math.max(c,b),K[t>>2]=+(c!=b),e=L=>L.toLocaleTimeString(void 0,{hour12:!1,timeZoneName:"short"}).split(" ")[1],p=e(p),w=e(w),b<c?(Se(p,Le,n,17),Se(w,Le,a,17)):(Se(p,Le,a,17),Se(w,Le,n,17))},emscripten_asm_const_int:(e,t,n)=>{gn.length=0;for(var a;a=Le[t++];){var c=a!=105;c&=a!=112,n+=c&&n%8?4:0,gn.push(a==112?Ce[n>>2]:a==105?K[n>>2]:Ct[n>>3]),n+=c?8:4}return oi[e](...gn)},emscripten_date_now:()=>Date.now(),emscripten_get_now:()=>performance.now(),emscripten_resize_heap:e=>{var t=Le.length;if(e>>>=0,2147483648<e)return!1;for(var n=1;4>=n;n*=2){var a=t*(1+.2/n);a=Math.min(a,e+100663296);var c=Math;a=Math.max(e,a);e:{c=(c.min.call(c,2147483648,a+(65536-a%65536)%65536)-Xe.buffer.byteLength+65535)/65536;try{Xe.grow(c),Te();var p=1;break e}catch{}p=void 0}if(p)return!0}return!1},environ_get:(e,t)=>{var n=0;return Qn().forEach((a,c)=>{var p=t+n;for(c=Ce[e+4*c>>2]=p,p=0;p<a.length;++p)Re[c++]=a.charCodeAt(p);Re[c]=0,n+=a.length+1}),0},environ_sizes_get:(e,t)=>{var n=Qn();Ce[e>>2]=n.length;var a=0;return n.forEach(c=>a+=c.length+1),Ce[t>>2]=a,0},fd_close:function(e){try{var t=kt(e);if(t.X===null)throw new X(8);t.La&&(t.La=null);try{t.m.close&&t.m.close(t)}catch(n){throw n}finally{si[t.X]=null}return t.X=null,0}catch(n){if(typeof zt>"u"||n.name!=="ErrnoError")throw n;return n.aa}},fd_read:function(e,t,n,a){try{e:{var c=kt(e);e=t;for(var p,w=t=0;w<n;w++){var b=Ce[e>>2],L=Ce[e+4>>2];e+=8;var F=c,j=p,U=Re;if(0>L||0>j)throw new X(28);if(F.X===null)throw new X(8);if((F.flags&2097155)===1)throw new X(8);if((F.node.mode&61440)===16384)throw new X(31);if(!F.m.read)throw new X(28);var Y=typeof j<"u";if(!Y)j=F.position;else if(!F.seekable)throw new X(70);
17var C=F.m.read(F,U,b,L,j);Y||(F.position+=C);var V=C;if(0>V){var O=-1;break e}if(t+=V,V<L)break;typeof p<"u"&&(p+=V)}O=t}return Ce[a>>2]=O,0}catch(ae){if(typeof zt>"u"||ae.name!=="ErrnoError")throw ae;return ae.aa}},fd_seek:function(e,t,n,a,c){t=n+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*n:NaN;try{if(isNaN(t))return 61;var p=kt(e);return kn(p,t,a),Bt=[p.position>>>0,(rt=p.position,1<=+Math.abs(rt)?0<rt?+Math.floor(rt/4294967296)>>>0:~~+Math.ceil((rt-+(~~rt>>>0))/4294967296)>>>0:0)],K[c>>2]=Bt[0],K[c+4>>2]=Bt[1],p.La&&t===0&&a===0&&(p.La=null),0}catch(w){if(typeof zt>"u"||w.name!=="ErrnoError")throw w;return w.aa}},fd_write:function(e,t,n,a){try{e:{var c=kt(e);e=t;for(var p,w=t=0;w<n;w++){var b=Ce[e>>2],L=Ce[e+4>>2];e+=8;var F=c,j=b,U=L,Y=p,C=Re;if(0>U||0>Y)throw new X(28);if(F.X===null)throw new X(8);if((F.flags&2097155)===0)throw new X(8);if((F.node.mode&61440)===16384)throw new X(31);if(!F.m.write)throw new X(28);F.seekable&&F.flags&1024&&kn(F,0,2);var V=typeof Y<"u";if(!V)Y=F.position;else if(!F.seekable)throw new X(70);var O=F.m.write(F,C,j,U,Y,void 0);V||(F.position+=O);var ae=O;if(0>ae){var de=-1;break e}t+=ae,typeof p<"u"&&(p+=ae)}de=t}return Ce[a>>2]=de,0}catch(N){if(typeof zt>"u"||N.name!=="ErrnoError")throw N;return N.aa}},invoke_vii:_o,isWindowsBrowser:function(){return-1<navigator.platform.indexOf("Win")},strftime:tr,strftime_l:(e,t,n,a)=>tr(e,t,n,a)},Pe=function(){var n;function e(a){var c;return Pe=a.exports,Xe=Pe.memory,Te(),Xn=Pe.__indirect_function_table,Ue.unshift(Pe.__wasm_call_ctors),Ke--,(c=m.monitorRunDependencies)==null||c.call(m,Ke),Ke==0&&ft&&(a=ft,ft=null,a()),Pe}var t={env:nr,wasi_snapshot_preview1:nr};if(Ke++,(n=m.monitorRunDependencies)==null||n.call(m,Ke),m.instantiateWasm)try{return m.instantiateWasm(t,e)}catch(a){Ie(`Module.instantiateWasm callback failed with error: ${a}`),H(a)}return fe||(fe=Rt("canvas_advanced.wasm")?"canvas_advanced.wasm":m.locateFile?m.locateFile("canvas_advanced.wasm",W):W+"canvas_advanced.wasm"),Gt(t,function(a){e(a.instance)}).catch(H),{}}(),It=e=>(It=Pe.free)(e),bn=e=>(bn=Pe.malloc)(e),rr=e=>(rr=Pe.__getTypeName)(e),or=m._ma_device__on_notification_unlocked=e=>(or=m._ma_device__on_notification_unlocked=Pe.ma_device__on_notification_unlocked)(e);m._ma_malloc_emscripten=(e,t)=>(m._ma_malloc_emscripten=Pe.ma_malloc_emscripten)(e,t),m._ma_free_emscripten=(e,t)=>(m._ma_free_emscripten=Pe.ma_free_emscripten)(e,t);var sr=m._ma_device_process_pcm_frames_capture__webaudio=(e,t,n)=>(sr=m._ma_device_process_pcm_frames_capture__webaudio=Pe.ma_device_process_pcm_frames_capture__webaudio)(e,t,n),ar=m._ma_device_process_pcm_frames_playback__webaudio=(e,t,n)=>(ar=m._ma_device_process_pcm_frames_playback__webaudio=Pe.ma_device_process_pcm_frames_playback__webaudio)(e,t,n),lr=(e,t)=>(lr=Pe.setThrew)(e,t),ur=e=>(ur=Pe._emscripten_stack_restore)(e),cr=()=>(cr=Pe.emscripten_stack_get_current)();m.dynCall_iiji=(e,t,n,a,c)=>(m.dynCall_iiji=Pe.dynCall_iiji)(e,t,n,a,c),m.dynCall_jiji=(e,t,n,a,c)=>(m.dynCall_jiji=Pe.dynCall_jiji)(e,t,n,a,c),m.dynCall_iiiji=(e,t,n,a,c,p)=>(m.dynCall_iiiji=Pe.dynCall_iiiji)(e,t,n,a,c,p),m.dynCall_iij=(e,t,n,a)=>(m.dynCall_iij=Pe.dynCall_iij)(e,t,n,a),m.dynCall_jii=(e,t,n)=>(m.dynCall_jii=Pe.dynCall_jii)(e,t,n),m.dynCall_viijii=(e,t,n,a,c,p,w)=>(m.dynCall_viijii=Pe.dynCall_viijii)(e,t,n,a,c,p,w),m.dynCall_iiiiij=(e,t,n,a,c,p,w)=>(m.dynCall_iiiiij=Pe.dynCall_iiiiij)(e,t,n,a,c,p,w),m.dynCall_iiiiijj=(e,t,n,a,c,p,w,b,L)=>(m.dynCall_iiiiijj=Pe.dynCall_iiiiijj)(e,t,n,a,c,p,w,b,L),m.dynCall_iiiiiijj=(e,t,n,a,c,p,w,b,L,F)=>(m.dynCall_iiiiiijj=Pe.dynCall_iiiiiijj)(e,t,n,a,c,p,w,b,L,F);function _o(e,t,n){var a=cr();try{hn(e)(t,n)}catch(c){if(ur(a),c!==c+0)throw c;lr(1,0)}}var Ni;ft=function e(){Ni||hr(),Ni||(ft=e)};function hr(){function e(){if(!Ni&&(Ni=!0,m.calledRun=!0,!it)){if(m.noFSInit||Dn||(Dn=!0,m.stdin=m.stdin,m.stdout=m.stdout,m.stderr=m.stderr,m.stdin?li("stdin",m.stdin):tn("/dev/tty","/dev/stdin"),m.stdout?li("stdout",null,m.stdout):tn("/dev/tty","/dev/stdout"),m.stderr?li("stderr",null,m.stderr):tn("/dev/tty1","/dev/stderr"),Li("/dev/stdin",0),Li("/dev/stdout",1),Li("/dev/stderr",1)),In=!1,l(Ue),B(m),m.onRuntimeInitialized&&m.onRuntimeInitialized(),m.postRun)for(typeof m.postRun=="function"&&(m.postRun=[m.postRun]);m.postRun.length;){var t=m.postRun.shift();
17Nt.unshift(t)}l(Nt)}}if(!(0<Ke)){if(m.preRun)for(typeof m.preRun=="function"&&(m.preRun=[m.preRun]);m.preRun.length;)xt();l(Ge),0<Ke||(m.setStatus?(m.setStatus("Running..."),setTimeout(function(){setTimeout(function(){m.setStatus("")},1),e()},1)):e())}}if(m.preInit)for(typeof m.preInit=="function"&&(m.preInit=[m.preInit]);0<m.preInit.length;)m.preInit.pop()();return hr(),z=q,z}})();const M=A},v=>{v.exports=JSON.parse(`{"name":"@rive-app/canvas","version":"2.34.0","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 <[email protected]> (https://rive.app)","Maxwell Talbot <[email protected]> (https://rive.app)","Arthur Vivian <[email protected]> (https://rive.app)","Umberto Sonnino <[email protected]> (https://rive.app)","Matthew Sullivan <[email protected]> (mailto:[email protected])"],"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}}`)},(v,y,E)=>{E.r(y),E.d(y,{Animation:()=>A.Animation});var A=E(4)},(v,y,E)=>{E.r(y),E.d(y,{Animation:()=>A});var A=function(){function M(T,I,x,z){this.animation=T,this.artboard=I,this.playing=z,this.loopCount=0,this.scrubTo=null,this.instance=new x.LinearAnimationInstance(T,I)}return Object.defineProperty(M.prototype,"name",{get:function(){return this.animation.name},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"time",{get:function(){return this.instance.time},set:function(T){this.instance.time=T},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"loopValue",{get:function(){return this.animation.loopValue},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"needsScrub",{get:function(){return this.scrubTo!==null},enumerable:!1,configurable:!0}),M.prototype.advance=function(T){this.scrubTo===null?this.instance.advance(T):(this.instance.time=0,this.instance.advance(this.scrubTo),this.scrubTo=null)},M.prototype.apply=function(T){this.instance.apply(T)},M.prototype.cleanup=function(){this.instance.delete()},M}()},(v,y,E)=>{E.r(y),E.d(y,{AudioAssetWrapper:()=>T.AudioAssetWrapper,AudioWrapper:()=>T.AudioWrapper,BLANK_URL:()=>M.BLANK_URL,CustomFileAssetLoaderWrapper:()=>T.CustomFileAssetLoaderWrapper,FileAssetWrapper:()=>T.FileAssetWrapper,FileFinalizer:()=>T.FileFinalizer,FontAssetWrapper:()=>T.FontAssetWrapper,FontWrapper:()=>T.FontWrapper,ImageAssetWrapper:()=>T.ImageAssetWrapper,ImageWrapper:()=>T.ImageWrapper,createFinalization:()=>T.createFinalization,finalizationRegistry:()=>T.finalizationRegistry,registerTouchInteractions:()=>A.registerTouchInteractions,sanitizeUrl:()=>M.sanitizeUrl});var A=E(6),M=E(7),T=E(8)},(v,y,E)=>{E.r(y),E.d(y,{registerTouchInteractions:()=>T});var A=void 0,M=function(I,x,z){var m,B,H=[];if(["touchstart","touchmove"].indexOf(I.type)>-1&&(!((m=I.changedTouches)===null||m===void 0)&&m.length)){x||I.preventDefault();for(var q=0,ee=z?I.changedTouches.length:1;q<ee;){var te=I.changedTouches[q];H.push({clientX:te.clientX,clientY:te.clientY,identifier:te.identifier}),q++}}else if(I.type==="touchend"&&(!((B=I.changedTouches)===null||B===void 0)&&B.length))for(var q=0,ee=z?I.changedTouches.length:1;q<ee;){var te=I.changedTouches[q];H.push({clientX:te.clientX,clientY:te.clientY,identifier:te.identifier}),q++}else H.push({clientX:I.clientX,clientY:I.clientY,identifier:0});return H},T=function(I){var x=I.canvas,z=I.artboard,m=I.stateMachines,B=m===void 0?[]:m,H=I.renderer,q=I.rive,ee=I.fit,te=I.alignment,ye=I.isTouchScrollEnabled,se=ye===void 0?!1:ye,Ve=I.dispatchPointerExit,Ye=Ve===void 0?!0:Ve,k=I.enableMultiTouch,$=k===void 0?!1:k,le=I.layoutScaleFactor,_e=le===void 0?1:le;if(!x||!B.length||!H||!q||!z||typeof window>"u")return null;var W=null,Q=!1,Ne=function(Ie){if(Q&&Ie instanceof MouseEvent){Ie.type=="mouseup"&&(Q=!1);return}Q=se&&Ie.type==="touchend"&&W==="touchstart",W=Ie.type;var ke=Ie.currentTarget.getBoundingClientRect(),Xe=M(Ie,se,$),it=q.computeAlignment(ee,te,{minX:0,minY:0,maxX:ke.width,maxY:ke.height},z.bounds,_e),Re=new q.Mat2D;switch(it.invert(Re),Xe.forEach(function(Oe){var fe=Oe.clientX,jt=Oe.clientY;if(!(!fe&&!jt)){var ri=fe-ke.left,He=jt-ke.top,Gt=new q.Vec2D(ri,He),rt=q.mapXY(Re,Gt),Bt=rt.x(),oi=rt.y();Oe.transformedX=Bt,Oe.transformedY=oi,rt.delete(),Gt.delete()}}),Re.delete(),it.delete(),Ie.type){case"mouseout":for(var Le=function(Oe){Ye?Xe.forEach(function(fe){Oe.pointerExit(fe.transformedX,fe.transformedY,fe.identifier)}):Xe.forEach(function(fe){Oe.pointerMove(fe.transformedX,fe.transformedY,fe.identifier)})},$e=0,at=B;$e<at.length;$e++){var K=at[$e];Le(K)}break;case"touchmove":case"mouseover":case"mousemove":{for(var Ce=function(Oe){Xe.forEach(function(fe){Oe.pointerMove(fe.transformedX,fe.transformedY,fe.identifier)})},nt=0,Ct=B;nt<Ct.length;nt++){var K=Ct[nt];Ce(K)}break}case"touchstart":case"mousedown":{for(var Te=function(Oe){Xe.forEach(function(fe){Oe.pointerDown(fe.transformedX,fe.transformedY,fe.identifier)})},Ge=0,Ue=B;Ge<Ue.length;Ge++){var K=Ue[Ge];Te(K)}break}case"touchend":{for(var Nt=function(Oe){Xe.forEach(function(fe){Oe.pointerUp(fe.transformedX,fe.transformedY,fe.identifier),Oe.pointerExit(fe.transformedX,fe.transformedY,fe.identifier)})},xt=0,Ke=B;xt<Ke.length;xt++){var K=Ke[xt];Nt(K)}break}case"mouseup":{for(var ft=function(Oe){Xe.forEach(function(fe){Oe.pointerUp(fe.transformedX,fe.transformedY,fe.identifier)})},lt=0,Rt=B;lt<Rt.length;lt++){var K=Rt[lt];ft(K)}break}}},ue=Ne.bind(A);return x.addEventListener("mouseover",ue),x.addEventListener("mouseout",ue),x.addEventListener("mousemove",ue),x.addEventListener("mousedown",ue),x.addEventListener("mouseup",ue),x.addEventListener("touchmove",ue,{passive:se}),x.addEventListener("touchstart",ue,{passive:se}),x.addEventListener("touchend",ue),function(){x.removeEventListener("mouseover",ue),x.removeEventListener("mouseout",ue),x.removeEventListener("mousemove",ue),x.removeEventListener("mousedown",ue),x.removeEventListener("mouseup",ue),x.removeEventListener("touchmove",ue),x.removeEventListener("touchstart",ue),x.removeEventListener("touchend",ue)}}},(v,y,E)=>{E.r(y),E.d(y,{BLANK_URL:()=>m,sanitizeUrl:()=>q});var A=/^([^\w]*)(javascript|data|vbscript)/im,M=/&#(\w+)(^\w|;)?/g,T=/&(newline|tab);/gi,I=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,x=/^.+(:|&colon;)/gim,z=[".","/"],m="about:blank";function B(ee){return z.indexOf(ee[0])>-1}function H(ee){var te=ee.replace(I,"");return te.replace(M,function(ye,se){return String.fromCharCode(se)})}function q(ee){if(!ee)return m;var te=H(ee).replace(T,"").replace(I,"").trim();if(!te)return m;if(B(te))return te;var ye=te.match(x);if(!ye)return te;var se=ye[0];return A.test(se)?m:te}},(v,y,E)=>{E.r(y),E.d(y,{AudioAssetWrapper:()=>ee,AudioWrapper:()=>z,CustomFileAssetLoaderWrapper:()=>B,FileAssetWrapper:()=>H,FileFinalizer:()=>M,FontAssetWrapper:()=>te,FontWrapper:()=>m,ImageAssetWrapper:()=>q,ImageWrapper:()=>x,createFinalization:()=>Ye,finalizationRegistry:()=>Ve});
17var A=function(){var k=function($,le){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_e,W){_e.__proto__=W}||function(_e,W){for(var Q in W)Object.prototype.hasOwnProperty.call(W,Q)&&(_e[Q]=W[Q])},k($,le)};return function($,le){if(typeof le!="function"&&le!==null)throw new TypeError("Class extends value "+String(le)+" is not a constructor or null");k($,le);function _e(){this.constructor=$}$.prototype=le===null?Object.create(le):(_e.prototype=le.prototype,new _e)}}(),M=function(){function k($){this.selfUnref=!1,this._file=$}return k.prototype.unref=function(){this._file&&this._file.unref()},k}(),T=function(){function k($){this._finalizableObject=$}return k.prototype.unref=function(){this._finalizableObject.unref()},k}(),I=function(){function k(){this.selfUnref=!1}return k.prototype.unref=function(){},k}(),x=function(k){A($,k);function $(le){var _e=k.call(this)||this;return _e._nativeImage=le,_e}return Object.defineProperty($.prototype,"nativeImage",{get:function(){return this._nativeImage},enumerable:!1,configurable:!0}),$.prototype.unref=function(){this.selfUnref&&this._nativeImage.unref()},$}(I),z=function(k){A($,k);function $(le){var _e=k.call(this)||this;return _e._nativeAudio=le,_e}return Object.defineProperty($.prototype,"nativeAudio",{get:function(){return this._nativeAudio},enumerable:!1,configurable:!0}),$.prototype.unref=function(){this.selfUnref&&this._nativeAudio.unref()},$}(I),m=function(k){A($,k);function $(le){var _e=k.call(this)||this;return _e._nativeFont=le,_e}return Object.defineProperty($.prototype,"nativeFont",{get:function(){return this._nativeFont},enumerable:!1,configurable:!0}),$.prototype.unref=function(){this.selfUnref&&this._nativeFont.unref()},$}(I),B=function(){function k($,le){this._assetLoaderCallback=le,this.assetLoader=new $.CustomFileAssetLoader({loadContents:this.loadContents.bind(this)})}return k.prototype.loadContents=function($,le){var _e;return $.isImage?_e=new q($):$.isAudio?_e=new ee($):$.isFont&&(_e=new te($)),this._assetLoaderCallback(_e,le)},k}(),H=function(){function k($){this._nativeFileAsset=$}return k.prototype.decode=function($){this._nativeFileAsset.decode($)},Object.defineProperty(k.prototype,"name",{get:function(){return this._nativeFileAsset.name},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"fileExtension",{get:function(){return this._nativeFileAsset.fileExtension},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"uniqueFilename",{get:function(){return this._nativeFileAsset.uniqueFilename},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isAudio",{get:function(){return this._nativeFileAsset.isAudio},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isImage",{get:function(){return this._nativeFileAsset.isImage},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"isFont",{get:function(){return this._nativeFileAsset.isFont},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"cdnUuid",{get:function(){return this._nativeFileAsset.cdnUuid},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"nativeFileAsset",{get:function(){return this._nativeFileAsset},enumerable:!1,configurable:!0}),k}(),q=function(k){A($,k);function $(){return k!==null&&k.apply(this,arguments)||this}return $.prototype.setRenderImage=function(le){this._nativeFileAsset.setRenderImage(le.nativeImage)},$}(H),ee=function(k){A($,k);function $(){return k!==null&&k.apply(this,arguments)||this}return $.prototype.setAudioSource=function(le){this._nativeFileAsset.setAudioSource(le.nativeAudio)},$}(H),te=function(k){A($,k);function $(){return k!==null&&k.apply(this,arguments)||this}return $.prototype.setFont=function(le){this._nativeFileAsset.setFont(le.nativeFont)},$}(H),ye=function(){function k($){}return k.prototype.register=function($){$.selfUnref=!0},k.prototype.unregister=function($){},k}(),se=typeof FinalizationRegistry<"u"?FinalizationRegistry:ye,Ve=new se(function(k){k==null||k.unref()}),Ye=function(k,$){var le=new T($);Ve.register(k,le)}}],u={};function f(v){var y=u[v];
17if(y!==void 0)return y.exports;var E=u[v]={exports:{}};return h[v](E,E.exports,f),E.exports}f.d=(v,y)=>{for(var E in y)f.o(y,E)&&!f.o(v,E)&&Object.defineProperty(v,E,{enumerable:!0,get:y[E]})},f.o=(v,y)=>Object.prototype.hasOwnProperty.call(v,y),f.r=v=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(v,"__esModule",{value:!0})};var g={};return(()=>{f.r(g),f.d(g,{Alignment:()=>q,DataEnum:()=>Ct,DrawOptimizationOptions:()=>ee,EventType:()=>Q,Fit:()=>H,Layout:()=>te,LoopType:()=>Ne,Rive:()=>Ce,RiveEventType:()=>Ye,RiveFile:()=>K,RuntimeLoader:()=>ye,StateMachineInput:()=>Ve,StateMachineInputType:()=>se,Testing:()=>Gt,ViewModel:()=>nt,ViewModelInstance:()=>Ge,ViewModelInstanceArtboard:()=>jt,ViewModelInstanceAssetImage:()=>fe,ViewModelInstanceBoolean:()=>Ke,ViewModelInstanceColor:()=>Oe,ViewModelInstanceEnum:()=>lt,ViewModelInstanceList:()=>Rt,ViewModelInstanceNumber:()=>xt,ViewModelInstanceString:()=>Nt,ViewModelInstanceTrigger:()=>ft,ViewModelInstanceValue:()=>Ue,decodeAudio:()=>rt,decodeFont:()=>oi,decodeImage:()=>Bt});var v=f(1),y=f(2),E=f(3),A=f(5),M=function(){var l=function(i,r){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(d[S]=_[S])},l(i,r)};return function(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");l(i,r);function d(){this.constructor=i}i.prototype=r===null?Object.create(r):(d.prototype=r.prototype,new d)}}(),T=function(){return T=Object.assign||function(l){for(var i,r=1,d=arguments.length;r<d;r++){i=arguments[r];for(var _ in i)Object.prototype.hasOwnProperty.call(i,_)&&(l[_]=i[_])}return l},T.apply(this,arguments)},I=function(l,i,r,d){function _(S){return S instanceof r?S:new r(function(R){R(S)})}return new(r||(r=Promise))(function(S,R){function Z(oe){try{G(d.next(oe))}catch(Fe){R(Fe)}}function ie(oe){try{G(d.throw(oe))}catch(Fe){R(Fe)}}function G(oe){oe.done?S(oe.value):_(oe.value).then(Z,ie)}G((d=d.apply(l,i||[])).next())})},x=function(l,i){var r={label:0,sent:function(){if(S[0]&1)throw S[1];return S[1]},trys:[],ops:[]},d,_,S,R=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return R.next=Z(0),R.throw=Z(1),R.return=Z(2),typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function Z(G){return function(oe){return ie([G,oe])}}function ie(G){if(d)throw new TypeError("Generator is already executing.");for(;R&&(R=0,G[0]&&(r=0)),r;)try{if(d=1,_&&(S=G[0]&2?_.return:G[0]?_.throw||((S=_.return)&&S.call(_),0):_.next)&&!(S=S.call(_,G[1])).done)return S;switch(_=0,S&&(G=[G[0]&2,S.value]),G[0]){case 0:case 1:S=G;break;case 4:return r.label++,{value:G[1],done:!1};case 5:r.label++,_=G[1],G=[0];continue;case 7:G=r.ops.pop(),r.trys.pop();continue;default:if(S=r.trys,!(S=S.length>0&&S[S.length-1])&&(G[0]===6||G[0]===2)){r=0;continue}if(G[0]===3&&(!S||G[1]>S[0]&&G[1]<S[3])){r.label=G[1];break}if(G[0]===6&&r.label<S[1]){r.label=S[1],S=G;break}if(S&&r.label<S[2]){r.label=S[2],r.ops.push(G);break}S[2]&&r.ops.pop(),r.trys.pop();continue}G=i.call(l,r)}catch(oe){G=[6,oe],_=0}finally{d=S=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},z=function(l,i,r){if(r||arguments.length===2)for(var d=0,_=i.length,S;d<_;d++)(S||!(d in i))&&(S||(S=Array.prototype.slice.call(i,0,d)),S[d]=i[d]);return l.concat(S||Array.prototype.slice.call(i))},m=function(l){M(i,l);function i(){var r=l!==null&&l.apply(this,arguments)||this;return r.isHandledError=!0,r}return i}(Error),B=function(l){return l&&l.isHandledError?l.message:"Problem loading file; may be corrupt!"},H;(function(l){l.Cover="cover",l.Contain="contain",l.Fill="fill",l.FitWidth="fitWidth",l.FitHeight="fitHeight",l.None="none",l.ScaleDown="scaleDown",l.Layout="layout"})(H||(H={}));var q;(function(l){l.Center="center",l.TopLeft="topLeft",l.TopCenter="topCenter",l.TopRight="topRight",l.CenterLeft="centerLeft",l.CenterRight="centerRight",l.BottomLeft="bottomLeft",l.BottomCenter="bottomCenter",l.BottomRight="bottomRight"})(q||(q={}));var ee;(function(l){l.AlwaysDraw="alwaysDraw",l.DrawOnChanged="drawOnChanged"})(ee||(ee={}));var te=function(){function l(i){var r,d,_,S,R,Z,ie;this.fit=(r=i==null?void 0:i.fit)!==null&&r!==void 0?r:H.Contain,this.alignment=(d=i==null?void 0:i.alignment)!==null&&d!==void 0?d:q.Center,this.layoutScaleFactor=(_=i==null?void 0:i.layoutScaleFactor)!==null&&_!==void 0?_:1,this.minX=(S=i==null?void 0:i.minX)!==null&&S!==void 0?S:0,this.minY=(R=i==null?void 0:i.minY)!==null&&R!==void 0?R:0,this.maxX=(Z=i==null?void 0:i.maxX)!==null&&Z!==void 0?Z:0,this.maxY=(ie=i==null?void 0:i.maxY)!==null&&ie!==void 0?ie:0}return l.new=function(i){var r=i.fit,d=i.alignment,_=i.minX,S=i.minY,R=i.maxX,Z=i.maxY;return console.warn("This function is deprecated: please use `new Layout({})` instead"),new l({fit:r,alignment:d,minX:_,minY:S,maxX:R,maxY:Z})},l.prototype.copyWith=function(i){var r=i.fit,d=i.alignment,_=i.layoutScaleFactor,S=i.minX,R=i.minY,Z=i.maxX,ie=i.maxY;return new l({fit:r??this.fit,alignment:d??this.alignment,layoutScaleFactor:_??this.layoutScaleFactor,minX:S??this.minX,minY:R??this.minY,maxX:Z??this.maxX,maxY:ie??this.maxY})},l.prototype.runtimeFit=function(i){if(this.cachedRuntimeFit)return this.cachedRuntimeFit;var r;return this.fit===H.Cover?r=i.Fit.cover:this.fit===H.Contain?r=i.Fit.contain:this.fit===H.Fill?r=i.Fit.fill:this.fit===H.FitWidth?r=i.Fit.fitWidth:this.fit===H.FitHeight?r=i.Fit.fitHeight:this.fit===H.ScaleDown?r=i.Fit.scaleDown:this.fit===H.Layout?r=i.Fit.layout:r=i.Fit.none,this.cachedRuntimeFit=r,r},l.prototype.runtimeAlignment=function(i){if(this.cachedRuntimeAlignment)return this.cachedRuntimeAlignment;var r;return this.alignment===q.TopLeft?r=i.Alignment.topLeft:this.alignment===q.TopCenter?r=i.Alignment.topCenter:this.alignment===q.TopRight?r=i.Alignment.topRight:this.alignment===q.CenterLeft?r=i.Alignment.centerLeft:this.alignment===q.CenterRight?r=i.Alignment.centerRight:this.alignment===q.BottomLeft?r=i.Alignment.bottomLeft:this.alignment===q.BottomCenter?r=i.Alignment.bottomCenter:this.alignment===q.BottomRight?r=i.Alignment.bottomRight:r=i.Alignment.center,this.cachedRuntimeAlignment=r,r},l}(),ye=function(){function l(){}return l.loadRuntime=function(){v.default({locateFile:function(){return l.wasmURL}
17}).then(function(i){var r;for(l.runtime=i;l.callBackQueue.length>0;)(r=l.callBackQueue.shift())===null||r===void 0||r(l.runtime)}).catch(function(i){var r={message:(i==null?void 0:i.message)||"Unknown error",type:(i==null?void 0:i.name)||"Error",wasmError:i instanceof WebAssembly.CompileError||i instanceof WebAssembly.RuntimeError,originalError:i};console.debug("Rive WASM load error details:",r);var d="https://cdn.jsdelivr.net/npm/".concat(y.name,"@").concat(y.version,"/rive_fallback.wasm");if(l.wasmURL.toLowerCase()!==d)console.warn("Failed to load WASM from ".concat(l.wasmURL," (").concat(r.message,"), trying jsdelivr as a backup")),l.setWasmUrl(d),l.loadRuntime();else{var _=["Could not load Rive WASM file from ".concat(l.wasmURL," or ").concat(d,"."),"Possible reasons:","- Network connection is down","- WebAssembly is not supported in this environment","- The WASM file is corrupted or incompatible",`
18Error details:`,"- Type: ".concat(r.type),"- Message: ".concat(r.message),"- WebAssembly-specific error: ".concat(r.wasmError),`
19To 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(`
20`);console.error(_)}})},l.getInstance=function(i){l.isLoading||(l.isLoading=!0,l.loadRuntime()),l.runtime?i(l.runtime):l.callBackQueue.push(i)},l.awaitInstance=function(){return new Promise(function(i){return l.getInstance(function(r){return i(r)})})},l.setWasmUrl=function(i){l.wasmURL=i},l.getWasmUrl=function(){return l.wasmURL},l.isLoading=!1,l.callBackQueue=[],l.wasmURL="https://unpkg.com/".concat(y.name,"@").concat(y.version,"/rive.wasm"),l}(),se;(function(l){l[l.Number=56]="Number",l[l.Trigger=58]="Trigger",l[l.Boolean=59]="Boolean"})(se||(se={}));var Ve=function(){function l(i,r){this.type=i,this.runtimeInput=r}return Object.defineProperty(l.prototype,"name",{get:function(){return this.runtimeInput.name},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"value",{get:function(){return this.runtimeInput.value},set:function(i){this.runtimeInput.value=i},enumerable:!1,configurable:!0}),l.prototype.fire=function(){this.type===se.Trigger&&this.runtimeInput.fire()},l.prototype.delete=function(){this.runtimeInput=null},l}(),Ye;(function(l){l[l.General=128]="General",l[l.OpenUrl=131]="OpenUrl"})(Ye||(Ye={}));var k=function(){function l(i){this.isBindableArtboard=!1,this.isBindableArtboard=i}return l}(),$=function(l){M(i,l);function i(r,d){var _=l.call(this,!1)||this;return _.nativeArtboard=r,_.file=d,_}return i}(k),le=function(l){M(i,l);function i(r){var d=l.call(this,!0)||this;return d.selfUnref=!1,d.nativeArtboard=r,d}return Object.defineProperty(i.prototype,"viewModel",{set:function(r){this.nativeViewModel=r.nativeInstance},enumerable:!1,configurable:!0}),i.prototype.destroy=function(){var r;this.selfUnref&&(this.nativeArtboard.unref(),(r=this.nativeViewModel)===null||r===void 0||r.unref())},i}(k),_e=function(){function l(i,r,d,_){this.stateMachine=i,this.playing=d,this.artboard=_,this.inputs=[],this.instance=new r.StateMachineInstance(i,_),this.initInputs(r)}return Object.defineProperty(l.prototype,"name",{get:function(){return this.stateMachine.name},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"statesChanged",{get:function(){for(var i=[],r=0;r<this.instance.stateChangedCount();r++)i.push(this.instance.stateChangedNameByIndex(r));return i},enumerable:!1,configurable:!0}),l.prototype.advance=function(i){this.instance.advance(i)},l.prototype.advanceAndApply=function(i){this.instance.advanceAndApply(i)},l.prototype.reportedEventCount=function(){return this.instance.reportedEventCount()},l.prototype.reportedEventAt=function(i){return this.instance.reportedEventAt(i)},l.prototype.initInputs=function(i){for(var r=0;r<this.instance.inputCount();r++){var d=this.instance.input(r);
20this.inputs.push(this.mapRuntimeInput(d,i))}},l.prototype.mapRuntimeInput=function(i,r){if(i.type===r.SMIInput.bool)return new Ve(se.Boolean,i.asBool());if(i.type===r.SMIInput.number)return new Ve(se.Number,i.asNumber());if(i.type===r.SMIInput.trigger)return new Ve(se.Trigger,i.asTrigger())},l.prototype.cleanup=function(){this.inputs.forEach(function(i){i.delete()}),this.inputs.length=0,this.instance.delete()},l.prototype.bindViewModelInstance=function(i){i.runtimeInstance!=null&&this.instance.bindViewModelInstance(i.runtimeInstance)},l}(),W=function(){function l(i,r,d,_,S){_===void 0&&(_=[]),S===void 0&&(S=[]),this.runtime=i,this.artboard=r,this.eventManager=d,this.animations=_,this.stateMachines=S}return l.prototype.add=function(i,r,d){if(d===void 0&&(d=!0),i=He(i),i.length===0)this.animations.forEach(function(Se){return Se.playing=r}),this.stateMachines.forEach(function(Se){return Se.playing=r});else for(var _=this.animations.map(function(Se){return Se.name}),S=this.stateMachines.map(function(Se){return Se.name}),R=0;R<i.length;R++){var Z=_.indexOf(i[R]),ie=S.indexOf(i[R]);if(Z>=0||ie>=0)Z>=0?this.animations[Z].playing=r:this.stateMachines[ie].playing=r;else{var G=this.artboard.animationByName(i[R]);if(G){var oe=new E.Animation(G,this.artboard,this.runtime,r);oe.advance(0),oe.apply(1),this.animations.push(oe)}else{var Fe=this.artboard.stateMachineByName(i[R]);if(Fe){var Be=new _e(Fe,this.runtime,r,this.artboard);this.stateMachines.push(Be)}}}}return d&&(r?this.eventManager.fire({type:Q.Play,data:this.playing}):this.eventManager.fire({type:Q.Pause,data:this.paused})),r?this.playing:this.paused},l.prototype.initLinearAnimations=function(i,r){for(var d=this.animations.map(function(ie){return ie.name}),_=0;_<i.length;_++){var S=d.indexOf(i[_]);if(S>=0)this.animations[S].playing=r;else{var R=this.artboard.animationByName(i[_]);if(R){var Z=new E.Animation(R,this.artboard,this.runtime,r);Z.advance(0),Z.apply(1),this.animations.push(Z)}else console.error("Animation with name ".concat(i[_]," not found."))}}},l.prototype.initStateMachines=function(i,r){for(var d=this.stateMachines.map(function(ie){return ie.name}),_=0;_<i.length;_++){var S=d.indexOf(i[_]);if(S>=0)this.stateMachines[S].playing=r;else{var R=this.artboard.stateMachineByName(i[_]);if(R){var Z=new _e(R,this.runtime,r,this.artboard);this.stateMachines.push(Z)}else console.warn("State Machine with name ".concat(i[_]," not found.")),this.initLinearAnimations([i[_]],r)}}},l.prototype.play=function(i){return this.add(i,!0)},l.prototype.advanceIfPaused=function(){this.stateMachines.forEach(function(i){i.playing||i.advanceAndApply(0)})},l.prototype.pause=function(i){return this.add(i,!1)},l.prototype.scrub=function(i,r){var d=this.animations.filter(function(_){return i.includes(_.name)});return d.forEach(function(_){return _.scrubTo=r}),d.map(function(_){return _.name})},Object.defineProperty(l.prototype,"playing",{get:function(){return this.animations.filter(function(i){return i.playing}).map(function(i){return i.name}).concat(this.stateMachines.filter(function(i){return i.playing}).map(function(i){return i.name}))},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"paused",{get:function(){return this.animations.filter(function(i){return!i.playing}).map(function(i){return i.name}).concat(this.stateMachines.filter(function(i){return!i.playing}).map(function(i){return i.name}))},enumerable:!1,configurable:!0}),l.prototype.stop=function(i){var r=this;i=He(i);var d=[];if(i.length===0)d=this.animations.map(function(R){return R.name}).concat(this.stateMachines.map(function(R){return R.name})),this.animations.forEach(function(R){return R.cleanup()}),this.stateMachines.forEach(function(R){return R.cleanup()}),this.animations.splice(0,this.animations.length),this.stateMachines.splice(0,this.stateMachines.length);else{var _=this.animations.filter(function(R){return i.includes(R.name)});_.forEach(function(R){R.cleanup(),r.animations.splice(r.animations.indexOf(R),1)});var S=this.stateMachines.filter(function(R){return i.includes(R.name)});S.forEach(function(R){R.cleanup(),r.stateMachines.splice(r.stateMachines.indexOf(R),1)}),d=_.map(function(R){return R.name}).concat(S.map(function(R){return R.name}))}return this.eventManager.fire({type:Q.Stop,data:d}),d},Object.defineProperty(l.prototype,"isPlaying",{get:function(){return this.animations.reduce(function(i,r){return i||r.playing},!1)||this.stateMachines.reduce(function(i,r){return i||r.playing},!1)}
20,enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isPaused",{get:function(){return!this.isPlaying&&(this.animations.length>0||this.stateMachines.length>0)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isStopped",{get:function(){return this.animations.length===0&&this.stateMachines.length===0},enumerable:!1,configurable:!0}),l.prototype.atLeastOne=function(i,r){r===void 0&&(r=!0);var d;return this.animations.length===0&&this.stateMachines.length===0&&(this.artboard.animationCount()>0?this.add([d=this.artboard.animationByIndex(0).name],i,r):this.artboard.stateMachineCount()>0&&this.add([d=this.artboard.stateMachineByIndex(0).name],i,r)),d},l.prototype.handleLooping=function(){for(var i=0,r=this.animations.filter(function(_){return _.playing});i<r.length;i++){var d=r[i];d.loopValue===0&&d.loopCount?(d.loopCount=0,this.stop(d.name)):d.loopValue===1&&d.loopCount?(this.eventManager.fire({type:Q.Loop,data:{animation:d.name,type:Ne.Loop}}),d.loopCount=0):d.loopValue===2&&d.loopCount>1&&(this.eventManager.fire({type:Q.Loop,data:{animation:d.name,type:Ne.PingPong}}),d.loopCount=0)}},l.prototype.handleStateChanges=function(){for(var i=[],r=0,d=this.stateMachines.filter(function(S){return S.playing});r<d.length;r++){var _=d[r];i.push.apply(i,_.statesChanged)}i.length>0&&this.eventManager.fire({type:Q.StateChange,data:i})},l.prototype.handleAdvancing=function(i){this.eventManager.fire({type:Q.Advance,data:i})},l}(),Q;(function(l){l.Load="load",l.LoadError="loaderror",l.Play="play",l.Pause="pause",l.Stop="stop",l.Loop="loop",l.Draw="draw",l.Advance="advance",l.StateChange="statechange",l.RiveEvent="riveevent",l.AudioStatusChange="audiostatuschange"})(Q||(Q={}));var Ne;(function(l){l.OneShot="oneshot",l.Loop="loop",l.PingPong="pingpong"})(Ne||(Ne={}));var ue=function(){function l(i){i===void 0&&(i=[]),this.listeners=i}return l.prototype.getListeners=function(i){return this.listeners.filter(function(r){return r.type===i})},l.prototype.add=function(i){this.listeners.includes(i)||this.listeners.push(i)},l.prototype.remove=function(i){for(var r=0;r<this.listeners.length;r++){var d=this.listeners[r];if(d.type===i.type&&d.callback===i.callback){this.listeners.splice(r,1);break}}},l.prototype.removeAll=function(i){var r=this;i?this.listeners.filter(function(d){return d.type===i}).forEach(function(d){return r.remove(d)}):this.listeners.splice(0,this.listeners.length)},l.prototype.fire=function(i){var r=this.getListeners(i.type);r.forEach(function(d){return d.callback(i)})},l}(),Ie=function(){function l(i){this.eventManager=i,this.queue=[]}return l.prototype.add=function(i){this.queue.push(i)},l.prototype.process=function(){for(;this.queue.length>0;){var i=this.queue.shift();i!=null&&i.action&&i.action(),i!=null&&i.event&&this.eventManager.fire(i.event)}},l}(),ke;(function(l){l[l.AVAILABLE=0]="AVAILABLE",l[l.UNAVAILABLE=1]="UNAVAILABLE"})(ke||(ke={}));var Xe=function(l){M(i,l);function i(){var r=l!==null&&l.apply(this,arguments)||this;return r._started=!1,r._enabled=!1,r._status=ke.UNAVAILABLE,r}return i.prototype.delay=function(r){return I(this,void 0,void 0,function(){return x(this,function(d){return[2,new Promise(function(_){return setTimeout(_,r)})]})})},i.prototype.timeout=function(){return I(this,void 0,void 0,function(){return x(this,function(r){return[2,new Promise(function(d,_){return setTimeout(_,50)})]})})},i.prototype.reportToListeners=function(){this.fire({type:Q.AudioStatusChange}),this.removeAll()},i.prototype.enableAudio=function(){return I(this,void 0,void 0,function(){return x(this,function(r){return this._enabled||(this._enabled=!0,this._status=ke.AVAILABLE,this.reportToListeners()),[2]})})},i.prototype.testAudio=function(){return I(this,void 0,void 0,function(){return x(this,function(r){switch(r.label){case 0:if(!(this._status===ke.UNAVAILABLE&&this._audioContext!==null))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,Promise.race([this._audioContext.resume(),this.timeout()])];case 2:return r.sent(),this.enableAudio(),[3,4];case 3:return r.sent(),[3,4];case 4:return[2]}})})},i.prototype._establishAudio=function(){return I(this,void 0,void 0,function(){return x(this,function(r){switch(r.label){case 0:return this._started?[3,5]:(this._started=!0,typeof window>"u"?(this.enableAudio(),[3,5]):[3,1]);case 1:this._audioContext=new AudioContext,this.listenForUserAction(),r.label=2;case 2:return this._status!==ke.UNAVAILABLE?[3,5]:[4,this.testAudio()];case 3:return r.sent(),[4,this.delay(1e3)];case 4:return r.sent(),[3,2];case 5:return[2]}})})},i.prototype.listenForUserAction=function(){var r=this,d=function(){return I(r,void 0,void 0,function(){return x(this,function(_){return this.enableAudio(),[2]})})};document.addEventListener("pointerdown",d,{once:!0})},i.prototype.establishAudio=function(){return I(this,void 0,void 0,function(){return x(this,function(r){return this._establishAudio(),[2]})})},Object.defineProperty(i.prototype,"systemVolume",{get:function(){return this._status===ke.UNAVAILABLE?(this.testAudio(),0):1}
20,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),i}(ue),it=new Xe,Re=function(){function l(){}return l.prototype.observe=function(){},l.prototype.unobserve=function(){},l.prototype.disconnect=function(){},l}(),Le=globalThis.ResizeObserver||Re,$e=function(){function l(){var i=this;this._elementsMap=new Map,this._onObservedEntry=function(r){var d=i._elementsMap.get(r.target);d!==null?d.onResize(r.target.clientWidth==0||r.target.clientHeight==0):i._resizeObserver.unobserve(r.target)},this._onObserved=function(r){r.forEach(i._onObservedEntry)},this._resizeObserver=new Le(this._onObserved)}return l.prototype.add=function(i,r){var d={onResize:r,element:i};return this._elementsMap.set(i,d),this._resizeObserver.observe(i),d},l.prototype.remove=function(i){this._resizeObserver.unobserve(i.element),this._elementsMap.delete(i.element)},l}(),at=new $e,K=function(){function l(i){this.enableRiveAssetCDN=!0,this.referenceCount=0,this.destroyed=!1,this.selfUnref=!1,this.bindableArtboards=[],this.src=i.src,this.buffer=i.buffer,i.assetLoader&&(this.assetLoader=i.assetLoader),this.enableRiveAssetCDN=typeof i.enableRiveAssetCDN=="boolean"?i.enableRiveAssetCDN:!0,this.eventManager=new ue,i.onLoad&&this.on(Q.Load,i.onLoad),i.onLoadError&&this.on(Q.LoadError,i.onLoadError)}return l.prototype.releaseFile=function(){var i;this.selfUnref&&((i=this.file)===null||i===void 0||i.unref()),this.file=null},l.prototype.releaseBindableArtboards=function(){this.bindableArtboards.forEach(function(i){return i.destroy()})},l.prototype.initData=function(){return I(this,void 0,void 0,function(){var i,r,d,_,S;return x(this,function(R){switch(R.label){case 0:return this.src?(i=this,[4,ri(this.src)]):[3,2];case 1:i.buffer=R.sent(),R.label=2;case 2:return this.destroyed?[2]:(this.assetLoader&&(d=new A.CustomFileAssetLoaderWrapper(this.runtime,this.assetLoader),r=d.assetLoader),_=this,[4,this.runtime.load(new Uint8Array(this.buffer),r,this.enableRiveAssetCDN)]);case 3:return _.file=R.sent(),S=new A.FileFinalizer(this.file),A.finalizationRegistry.register(this,S),this.destroyed?(this.releaseFile(),[2]):(this.file!==null?this.eventManager.fire({type:Q.Load,data:this}):this.fireLoadError(l.fileLoadErrorMessage),[2])}})})},l.prototype.init=function(){return I(this,void 0,void 0,function(){var i,r;return x(this,function(d){switch(d.label){case 0:if(!this.src&&!this.buffer)return this.fireLoadError(l.missingErrorMessage),[2];d.label=1;case 1:return d.trys.push([1,4,,5]),i=this,[4,ye.awaitInstance()];case 2:return i.runtime=d.sent(),this.destroyed?[2]:[4,this.initData()];case 3:return d.sent(),[3,5];case 4:return r=d.sent(),this.fireLoadError(r instanceof Error?r.message:l.fileLoadErrorMessage),[3,5];case 5:return[2]}})})},l.prototype.fireLoadError=function(i){throw this.eventManager.fire({type:Q.LoadError,data:i}),new Error(i)},l.prototype.on=function(i,r){this.eventManager.add({type:i,callback:r})},l.prototype.off=function(i,r){this.eventManager.remove({type:i,callback:r})},l.prototype.cleanup=function(){this.referenceCount-=1,this.referenceCount<=0&&(this.removeAllRiveEventListeners(),this.releaseFile(),this.releaseBindableArtboards(),this.destroyed=!0)},l.prototype.removeAllRiveEventListeners=function(i){this.eventManager.removeAll(i)},l.prototype.getInstance=function(){if(this.file!==null)return this.referenceCount+=1,this.file},l.prototype.destroyIfUnused=function(){this.referenceCount<=0&&this.cleanup()},l.prototype.createBindableArtboard=function(i){if(i!=null){var r=new le(i);return(0,A.createFinalization)(r,r.nativeArtboard),this.bindableArtboards.push(r),r}return null},l.prototype.getArtboard=function(i){var r=this.file.artboardByName(i);if(r!=null)return new $(r,this)},l.prototype.getBindableArtboard=function(i){var r=this.file.bindableArtboardByName(i);return this.createBindableArtboard(r)},l.prototype.getDefaultBindableArtboard=function(){var i=this.file.bindableArtboardDefault();return this.createBindableArtboard(i)},l.prototype.internalBindableArtboardFromArtboard=function(i){var r=this.file.internalBindableArtboardFromArtboard(i);return this.createBindableArtboard(r)},l.prototype.viewModelByName=function(i){var r=this.file.viewModelByName(i);return r!==null?new nt(r):null},l.missingErrorMessage="Rive source file or data buffer required",l.fileLoadErrorMessage="The file failed to load",l}(),Ce=function(){function l(i){var r=this,d,_;this.loaded=!1,this.destroyed=!1,this._observed=null,this.readyForPlaying=!1,this.artboard=null,this.eventCleanup=null,this.shouldDisableRiveListeners=!1,this.automaticallyHandleEvents=!1,this.dispatchPointerExit=!0,this.enableMultiTouch=!1,this.enableRiveAssetCDN=!0,this._volume=1,this._artboardWidth=void 0,this._artboardHeight=void 0,this._devicePixelRatioUsed=1,this._hasZeroSize=!1,this._needsRedraw=!1,this._audioEventListener=null,this._boundDraw=null,this._viewModelInstance=null,this._dataEnums=null,this.drawOptimization=ee.DrawOnChanged,this.durations=[],this.frameTimes=[],this.frameCount=0,this.isTouchScrollEnabled=!1,this.onCanvasResize=function(S){var R=r._hasZeroSize!==S;r._hasZeroSize=S,S?(!r._layout.maxX||!r._layout.maxY)&&r.resizeToCanvas():R&&r.resizeDrawingSurfaceToCanvas()},this.renderSecondTimer=0,this._boundDraw=this.draw.bind(this),this.canvas=i.canvas,i.canvas.constructor===HTMLCanvasElement&&(this._observed=at.add(this.canvas,this.onCanvasResize)),this.src=i.src,this.buffer=i.buffer,this.riveFile=i.riveFile,this.layout=(d=i.layout)!==null&&d!==void 0?d:new te,this.shouldDisableRiveListeners=!!i.shouldDisableRiveListeners,this.isTouchScrollEnabled=!!i.isTouchScrollEnabled,this.automaticallyHandleEvents=!!i.automaticallyHandleEvents,this.dispatchPointerExit=i.dispatchPointerExit===!1?i.dispatchPointerExit:this.dispatchPointerExit,this.enableMultiTouch=!!i.enableMultiTouch,this.drawOptimization=(_=i.drawingOptions)!==null&&_!==void 0?_:this.drawOptimization,this.enableRiveAssetCDN=i.enableRiveAssetCDN===void 0?!0:i.enableRiveAssetCDN,this.eventManager=new ue,i.onLoad&&this.on(Q.Load,i.onLoad),i.onLoadError&&this.on(Q.LoadError,i.onLoadError),i.onPlay&&this.on(Q.Play,i.onPlay),i.onPause&&this.on(Q.Pause,i.onPause),i.onStop&&this.on(Q.Stop,i.onStop),i.onLoop&&this.on(Q.Loop,i.onLoop),i.onStateChange&&this.on(Q.StateChange,i.onStateChange),i.onAdvance&&this.on(Q.Advance,i.onAdvance),i.onload&&!i.onLoad&&this.on(Q.Load,i.onload),i.onloaderror&&!i.onLoadError&&this.on(Q.LoadError,i.onloaderror),i.onplay&&!i.onPlay&&this.on(Q.Play,i.onplay),i.onpause&&!i.onPause&&this.on(Q.Pause,i.onpause),i.onstop&&!i.onStop&&this.on(Q.Stop,i.onstop),i.onloop&&!i.onLoop&&this.on(Q.Loop,i.onloop),i.onstatechange&&!i.onStateChange&&this.on(Q.StateChange,i.onstatechange),i.assetLoader&&(this.assetLoader=i.assetLoader),this.taskQueue=new Ie(this.eventManager),this.init({src:this.src,buffer:this.buffer,riveFile:this.riveFile,autoplay:i.autoplay,autoBind:i.autoBind,animations:i.animations,stateMachines:i.stateMachines,artboard:i.artboard,useOffscreenRenderer:i.useOffscreenRenderer})}return Object.defineProperty(l.prototype,"viewModelCount",{get:function(){return this.file.viewModelCount()}
20,enumerable:!1,configurable:!0}),l.new=function(i){return console.warn("This function is deprecated: please use `new Rive({})` instead"),new l(i)},l.prototype.onSystemAudioChanged=function(){this.volume=this._volume},l.prototype.init=function(i){var r=this,d=i.src,_=i.buffer,S=i.riveFile,R=i.animations,Z=i.stateMachines,ie=i.artboard,G=i.autoplay,oe=G===void 0?!1:G,Fe=i.useOffscreenRenderer,Be=Fe===void 0?!1:Fe,Se=i.autoBind,ut=Se===void 0?!1:Se;if(!this.destroyed){if(this.src=d,this.buffer=_,this.riveFile=S,!this.src&&!this.buffer&&!this.riveFile)throw new m(l.missingErrorMessage);var ot=He(R),qe=He(Z);this.loaded=!1,this.readyForPlaying=!1,ye.awaitInstance().then(function(Je){r.destroyed||(r.runtime=Je,r.removeRiveListeners(),r.deleteRiveRenderer(),r.renderer=r.runtime.makeRenderer(r.canvas,Be),r.canvas.width||r.canvas.height||r.resizeDrawingSurfaceToCanvas(),r.initData(ie,ot,qe,oe,ut).then(function(st){if(st)return r.setupRiveListeners()}).catch(function(st){console.error(st)}))}).catch(function(Je){console.error(Je)})}},l.prototype.setupRiveListeners=function(i){var r=this;if(this.eventCleanup&&this.eventCleanup(),!this.shouldDisableRiveListeners){var d=(this.animator.stateMachines||[]).filter(function(Z){return Z.playing&&r.runtime.hasListeners(Z.instance)}).map(function(Z){return Z.instance}),_=this.isTouchScrollEnabled,S=this.dispatchPointerExit,R=this.enableMultiTouch;i&&"isTouchScrollEnabled"in i&&(_=i.isTouchScrollEnabled),this.eventCleanup=(0,A.registerTouchInteractions)({canvas:this.canvas,artboard:this.artboard,stateMachines:d,renderer:this.renderer,rive:this.runtime,fit:this._layout.runtimeFit(this.runtime),alignment:this._layout.runtimeAlignment(this.runtime),isTouchScrollEnabled:_,dispatchPointerExit:S,enableMultiTouch:R,layoutScaleFactor:this._layout.layoutScaleFactor})}},l.prototype.removeRiveListeners=function(){this.eventCleanup&&(this.eventCleanup(),this.eventCleanup=null)},l.prototype.initializeAudio=function(){var i=this,r;it.status==ke.UNAVAILABLE&&!((r=this.artboard)===null||r===void 0)&&r.hasAudio&&this._audioEventListener===null&&(this._audioEventListener={type:Q.AudioStatusChange,callback:function(){return i.onSystemAudioChanged()}},it.add(this._audioEventListener),it.establishAudio())},l.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)},l.prototype.initData=function(i,r,d,_,S){return I(this,void 0,void 0,function(){var R,Z,ie,G;return x(this,function(oe){switch(oe.label){case 0:return oe.trys.push([0,3,,4]),this.riveFile!=null?[3,2]:(R=new K({src:this.src,buffer:this.buffer,enableRiveAssetCDN:this.enableRiveAssetCDN,assetLoader:this.assetLoader}),this.riveFile=R,[4,R.init()]);case 1:if(oe.sent(),this.destroyed)return R.destroyIfUnused(),[2,!1];oe.label=2;case 2:return this.file=this.riveFile.getInstance(),this.initArtboard(i,r,d,_,S),this.initArtboardSize(),this.initializeAudio(),this.loaded=!0,this.eventManager.fire({type:Q.Load,data:(G=this.src)!==null&&G!==void 0?G:"buffer"}),this.animator.advanceIfPaused(),this.readyForPlaying=!0,this.taskQueue.process(),this.drawFrame(),[2,!0];case 3:return Z=oe.sent(),ie=B(Z),console.warn(ie),this.eventManager.fire({type:Q.LoadError,data:ie}),[2,Promise.reject(ie)];case 4:return[2]}})})},l.prototype.initArtboard=function(i,r,d,_,S){if(this.file){var R=i?this.file.artboardByName(i):this.file.defaultArtboard();if(!R){var Z="Invalid artboard name or no default artboard";console.warn(Z),this.eventManager.fire({type:Q.LoadError,data:Z});return}this.artboard=R,R.volume=this._volume*it.systemVolume,this.animator=new W(this.runtime,this.artboard,this.eventManager);var ie;if(r.length>0||d.length>0?(ie=r.concat(d),this.animator.initLinearAnimations(r,_),this.animator.initStateMachines(d,_)):ie=[this.animator.atLeastOne(_,!1)],this.taskQueue.add({event:{type:_?Q.Play:Q.Pause,data:ie}}),S){var G=this.file.defaultArtboardViewModel(R);if(G!==null){var oe=G.defaultInstance();if(oe!==null){var Fe=new Ge(oe,null);(0,A.createFinalization)(Fe,Fe.runtimeInstance),this.bindViewModelInstance(Fe)}}}}},l.prototype.drawFrame=function(){var i,r;!((i=document==null?void 0:document.timeline)===null||i===void 0)&&i.currentTime?this.loaded&&this.artboard&&!this.frameRequestId&&(this._boundDraw(document.timeline.currentTime),(r=this.runtime)===null||r===void 0||r.resolveAnimationFrame()):this.scheduleRendering()},l.prototype.draw=function(i,r){var d;this.frameRequestId=null;var _=performance.now();this.lastRenderTime||(this.lastRenderTime=i),this.renderSecondTimer+=i-this.lastRenderTime,this.renderSecondTimer>5e3&&(this.renderSecondTimer=0,r==null||r());var S=(i-this.lastRenderTime)/1e3;this.lastRenderTime=i;for(var R=this.animator.animations.filter(function(Et){return Et.playing||Et.needsScrub}).sort(function(Et){return Et.needsScrub?-1:1}),Z=0,ie=R;Z<ie.length;Z++){var G=ie[Z];G.advance(S),G.instance.didLoop&&(G.loopCount+=1),G.apply(1)}for(var oe=this.animator.stateMachines.filter(function(Et){return Et.playing}),Fe=0,Be=oe;Fe<Be.length;Fe++){var Se=Be[Fe],ut=Se.reportedEventCount();if(ut)for(var ot=0;ot<ut;ot++){var qe=Se.reportedEventAt(ot);if(qe)if(qe.type===Ye.OpenUrl){if(this.eventManager.fire({type:Q.RiveEvent,data:qe}),this.automaticallyHandleEvents){var Je=document.createElement("a"),st=qe,Vt=st.url,At=st.target,ne=(0,A.sanitizeUrl)(Vt);Vt&&Je.setAttribute("href",ne),At&&Je.setAttribute("target",At),ne&&ne!==A.BLANK_URL&&Je.click()}}else this.eventManager.fire({type:Q.RiveEvent,data:qe})}Se.advanceAndApply(S)}this.animator.stateMachines.length==0&&this.artboard.advance(S);var dt=this.renderer;this._hasZeroSize||(this.drawOptimization==ee.AlwaysDraw||this.artboard.didChange()||this._needsRedraw)&&(dt.clear(),dt.save(),this.alignRenderer(),this.artboard.draw(dt),dt.restore(
20),dt.flush(),this._needsRedraw=!1),this.animator.handleLooping(),this.animator.handleStateChanges(),this.animator.handleAdvancing(S),this.frameCount++;var me=performance.now();for(this.frameTimes.push(me),this.durations.push(me-_);this.frameTimes[0]<=me-1e3;)this.frameTimes.shift(),this.durations.shift();(d=this._viewModelInstance)===null||d===void 0||d.handleCallbacks(),this.animator.isPlaying?this.scheduleRendering():this.animator.isPaused?this.lastRenderTime=0:this.animator.isStopped&&(this.lastRenderTime=0)},l.prototype.alignRenderer=function(){var i=this,r=i.renderer,d=i.runtime,_=i._layout,S=i.artboard;r.align(_.runtimeFit(d),_.runtimeAlignment(d),{minX:_.minX,minY:_.minY,maxX:_.maxX,maxY:_.maxY},S.bounds,this._devicePixelRatioUsed*_.layoutScaleFactor)},Object.defineProperty(l.prototype,"fps",{get:function(){return this.durations.length},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"frameTime",{get:function(){return this.durations.length===0?0:(this.durations.reduce(function(i,r){return i+r},0)/this.durations.length).toFixed(4)},enumerable:!1,configurable:!0}),l.prototype.cleanup=function(){var i,r;this.destroyed=!0,this.stopRendering(),this.cleanupInstances(),this._observed!==null&&at.remove(this._observed),this.removeRiveListeners(),this.file&&((i=this.riveFile)===null||i===void 0||i.cleanup(),this.file=null),this.riveFile=null,this.deleteRiveRenderer(),this._audioEventListener!==null&&(it.remove(this._audioEventListener),this._audioEventListener=null),(r=this._viewModelInstance)===null||r===void 0||r.cleanup(),this._viewModelInstance=null,this._dataEnums=null},l.prototype.deleteRiveRenderer=function(){var i;(i=this.renderer)===null||i===void 0||i.delete(),this.renderer=null},l.prototype.cleanupInstances=function(){this.eventCleanup!==null&&this.eventCleanup(),this.stop(),this.artboard&&(this.artboard.delete(),this.artboard=null)},l.prototype.retrieveTextRun=function(i){var r;if(!i){console.warn("No text run name provided");return}if(!this.artboard){console.warn("Tried to access text run, but the Artboard is null");return}var d=this.artboard.textRun(i);if(!d){console.warn("Could not access a text run with name '".concat(i,"' in the '").concat((r=this.artboard)===null||r===void 0?void 0:r.name,"' Artboard. Note that you must rename a text run node in the Rive editor to make it queryable at runtime."));return}return d},l.prototype.getTextRunValue=function(i){var r=this.retrieveTextRun(i);return r?r.text:void 0},l.prototype.setTextRunValue=function(i,r){var d=this.retrieveTextRun(i);d&&(d.text=r)},l.prototype.play=function(i,r){var d=this;if(i=He(i),!this.readyForPlaying){this.taskQueue.add({action:function(){return d.play(i,r)}});return}this.animator.play(i),this.eventCleanup&&this.eventCleanup(),this.setupRiveListeners(),this.startRendering()},l.prototype.pause=function(i){var r=this;if(i=He(i),!this.readyForPlaying){this.taskQueue.add({action:function(){return r.pause(i)}});return}this.eventCleanup&&this.eventCleanup(),this.animator.pause(i)},l.prototype.scrub=function(i,r){var d=this;if(i=He(i),!this.readyForPlaying){this.taskQueue.add({action:function(){return d.scrub(i,r)}});return}this.animator.scrub(i,r||0),this.drawFrame()},l.prototype.stop=function(i){var r=this;if(i=He(i),!this.readyForPlaying){this.taskQueue.add({action:function(){return r.stop(i)}});return}this.animator&&this.animator.stop(i),this.eventCleanup&&this.eventCleanup()},l.prototype.reset=function(i){var r,d,_=i==null?void 0:i.artboard,S=He(i==null?void 0:i.animations),R=He(i==null?void 0:i.stateMachines),Z=(r=i==null?void 0:i.autoplay)!==null&&r!==void 0?r:!1,ie=(d=i==null?void 0:i.autoBind)!==null&&d!==void 0?d:!1;this.cleanupInstances(),this.initArtboard(_,S,R,Z,ie),this.taskQueue.process()},l.prototype.load=function(i){this.file=null,this.stop(),this.init(i)},Object.defineProperty(l.prototype,"layout",{get:function(){return this._layout},set:function(i){this._layout=i,(!i.maxX||!i.maxY)&&this.resizeToCanvas(),this.loaded&&!this.animator.isPlaying&&this.drawFrame()},enumerable:!1,configurable:!0}),l.prototype.resizeToCanvas=function(){this._layout=this.layout.copyWith({minX:0,minY:0,maxX:this.canvas.width,maxY:this.canvas.height})},l.prototype.resizeDrawingSurfaceToCanvas=function(i){if(this.canvas instanceof HTMLCanvasElement&&window){var r=this.canvas.getBoundingClientRect(),d=r.width,_=r.height,S=i||window.devicePixelRatio||1;if(this.devicePixelRatioUsed=S,this.canvas.width=S*d,this.canvas.height=S*_,this._needsRedraw=!0,this.resizeToCanvas(),this.drawFrame(),this.layout.fit===H.Layout){var R=this._layout.layoutScaleFactor;this.artboard.width=d/R,this.artboard.height=_/R}}},Object.defineProperty(l.prototype,"source",{get:function(){return this.src}
20,enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"activeArtboard",{get:function(){return this.artboard?this.artboard.name:""},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"animationNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var i=[],r=0;r<this.artboard.animationCount();r++)i.push(this.artboard.animationByIndex(r).name);return i},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"stateMachineNames",{get:function(){if(!this.loaded||!this.artboard)return[];for(var i=[],r=0;r<this.artboard.stateMachineCount();r++)i.push(this.artboard.stateMachineByIndex(r).name);return i},enumerable:!1,configurable:!0}),l.prototype.stateMachineInputs=function(i){if(this.loaded){var r=this.animator.stateMachines.find(function(d){return d.name===i});return r==null?void 0:r.inputs}},l.prototype.retrieveInputAtPath=function(i,r){if(!i){console.warn("No input name provided for path '".concat(r,"'"));return}if(!this.artboard){console.warn("Tried to access input: '".concat(i,"', at path: '").concat(r,"', but the Artboard is null"));return}var d=this.artboard.inputByPath(i,r);if(!d){console.warn("Could not access an input with name: '".concat(i,"', at path:'").concat(r,"'"));return}return d},l.prototype.setBooleanStateAtPath=function(i,r,d){var _=this.retrieveInputAtPath(i,d);_&&(_.type===se.Boolean?_.asBool().value=r:console.warn("Input with name: '".concat(i,"', at path:'").concat(d,"' is not a boolean")))},l.prototype.setNumberStateAtPath=function(i,r,d){var _=this.retrieveInputAtPath(i,d);_&&(_.type===se.Number?_.asNumber().value=r:console.warn("Input with name: '".concat(i,"', at path:'").concat(d,"' is not a number")))},l.prototype.fireStateAtPath=function(i,r){var d=this.retrieveInputAtPath(i,r);d&&(d.type===se.Trigger?d.asTrigger().fire():console.warn("Input with name: '".concat(i,"', at path:'").concat(r,"' is not a trigger")))},l.prototype.retrieveTextAtPath=function(i,r){if(!i){console.warn("No text name provided for path '".concat(r,"'"));return}if(!r){console.warn("No path provided for text '".concat(i,"'"));return}if(!this.artboard){console.warn("Tried to access text: '".concat(i,"', at path: '").concat(r,"', but the Artboard is null"));return}var d=this.artboard.textByPath(i,r);if(!d){console.warn("Could not access text with name: '".concat(i,"', at path:'").concat(r,"'"));return}return d},l.prototype.getTextRunValueAtPath=function(i,r){var d=this.retrieveTextAtPath(i,r);if(!d){console.warn("Could not get text with name: '".concat(i,"', at path:'").concat(r,"'"));return}return d.text},l.prototype.setTextRunValueAtPath=function(i,r,d){var _=this.retrieveTextAtPath(i,d);if(!_){console.warn("Could not set text with name: '".concat(i,"', at path:'").concat(d,"'"));return}_.text=r},Object.defineProperty(l.prototype,"playingStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(i){return i.playing}).map(function(i){return i.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"playingAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(i){return i.playing}).map(function(i){return i.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"pausedAnimationNames",{get:function(){return this.loaded?this.animator.animations.filter(function(i){return!i.playing}).map(function(i){return i.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"pausedStateMachineNames",{get:function(){return this.loaded?this.animator.stateMachines.filter(function(i){return!i.playing}).map(function(i){return i.name}):[]},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isPlaying",{get:function(){return this.animator.isPlaying},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isPaused",{get:function(){return this.animator.isPaused},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isStopped",{get:function(){return this.animator.isStopped},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"bounds",{get:function(){return this.artboard?this.artboard.bounds:void 0}
20,enumerable:!1,configurable:!0}),l.prototype.on=function(i,r){this.eventManager.add({type:i,callback:r})},l.prototype.off=function(i,r){this.eventManager.remove({type:i,callback:r})},l.prototype.unsubscribe=function(i,r){console.warn("This function is deprecated: please use `off()` instead."),this.off(i,r)},l.prototype.removeAllRiveEventListeners=function(i){this.eventManager.removeAll(i)},l.prototype.unsubscribeAll=function(i){console.warn("This function is deprecated: please use `removeAllRiveEventListeners()` instead."),this.removeAllRiveEventListeners(i)},l.prototype.stopRendering=function(){this.loaded&&this.frameRequestId&&(this.runtime.cancelAnimationFrame?this.runtime.cancelAnimationFrame(this.frameRequestId):cancelAnimationFrame(this.frameRequestId),this.frameRequestId=null)},l.prototype.startRendering=function(){this.drawFrame()},l.prototype.scheduleRendering=function(){this.loaded&&this.artboard&&!this.frameRequestId&&(this.runtime.requestAnimationFrame?this.frameRequestId=this.runtime.requestAnimationFrame(this._boundDraw):this.frameRequestId=requestAnimationFrame(this._boundDraw))},l.prototype.enableFPSCounter=function(i){this.runtime.enableFPSCounter(i)},l.prototype.disableFPSCounter=function(){this.runtime.disableFPSCounter()},Object.defineProperty(l.prototype,"contents",{get:function(){if(this.loaded){for(var i={artboards:[]},r=0;r<this.file.artboardCount();r++){for(var d=this.file.artboardByIndex(r),_={name:d.name,animations:[],stateMachines:[]},S=0;S<d.animationCount();S++){var R=d.animationByIndex(S);_.animations.push(R.name)}for(var Z=0;Z<d.stateMachineCount();Z++){for(var ie=d.stateMachineByIndex(Z),G=ie.name,oe=new this.runtime.StateMachineInstance(ie,d),Fe=[],Be=0;Be<oe.inputCount();Be++){var Se=oe.input(Be);Fe.push({name:Se.name,type:Se.type})}_.stateMachines.push({name:G,inputs:Fe})}i.artboards.push(_)}return i}},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"volume",{get:function(){return this.artboard&&this.artboard.volume!==this._volume&&(this._volume=this.artboard.volume),this._volume},set:function(i){this._volume=i,this.artboard&&(this.artboard.volume=i*it.systemVolume)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"artboardWidth",{get:function(){var i;return this.artboard?this.artboard.width:(i=this._artboardWidth)!==null&&i!==void 0?i:0},set:function(i){this._artboardWidth=i,this.artboard&&(this.artboard.width=i)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"artboardHeight",{get:function(){var i;return this.artboard?this.artboard.height:(i=this._artboardHeight)!==null&&i!==void 0?i:0},set:function(i){this._artboardHeight=i,this.artboard&&(this.artboard.height=i)},enumerable:!1,configurable:!0}),l.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(l.prototype,"devicePixelRatioUsed",{get:function(){return this._devicePixelRatioUsed},set:function(i){this._devicePixelRatioUsed=i},enumerable:!1,configurable:!0}),l.prototype.bindViewModelInstance=function(i){var r;this.artboard&&!this.destroyed&&i&&i.runtimeInstance&&(i.internalIncrementReferenceCount(),(r=this._viewModelInstance)===null||r===void 0||r.cleanup(),this._viewModelInstance=i,this.animator.stateMachines.length>0?this.animator.stateMachines.forEach(function(d){return d.bindViewModelInstance(i)}):this.artboard.bindViewModelInstance(i.runtimeInstance))},Object.defineProperty(l.prototype,"viewModelInstance",{get:function(){return this._viewModelInstance},enumerable:!1,configurable:!0}),l.prototype.viewModelByIndex=function(i){var r=this.file.viewModelByIndex(i);return r!==null?new nt(r):null},l.prototype.viewModelByName=function(i){var r;return(r=this.riveFile)===null||r===void 0?void 0:r.viewModelByName(i)},l.prototype.enums=function(){if(this._dataEnums===null){var i=this.file.enums();this._dataEnums=i.map(function(r){return new Ct(r)})}return this._dataEnums},l.prototype.defaultViewModel=function(){if(this.artboard){var i=this.file.defaultArtboardViewModel(this.artboard);if(i)return new nt(i)}return null},l.prototype.getArtboard=function(i){var r,d;return(d=(r=this.riveFile)===null||r===void 0?void 0:r.getArtboard(i))!==null&&d!==void 0?d:null},l.prototype.getBindableArtboard=function(i){var r,d;return(d=(r=this.riveFile)===null||r===void 0?void 0:r.getBindableArtboard(i))!==null&&d!==void 0?d:null},l.prototype.getDefaultBindableArtboard=function(){var i,r;return(r=(i=this.riveFile)===null||i===void 0?void 0:i.getDefaultBindableArtboard())!==null&&r!==void 0?r:null},l.missingErrorMessage="Rive source file or data buffer required",l.cleanupErrorMessage="Attempt to use file after calling cleanup.",l}(),nt=function(){function l(i){this._viewModel=i}return Object.defineProperty(l.prototype,"instanceCount",{get:function(){return this._viewModel.instanceCount}
20,enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"name",{get:function(){return this._viewModel.name},enumerable:!1,configurable:!0}),l.prototype.instanceByIndex=function(i){var r=this._viewModel.instanceByIndex(i);if(r!==null){var d=new Ge(r,null);return(0,A.createFinalization)(d,r),d}return null},l.prototype.instanceByName=function(i){var r=this._viewModel.instanceByName(i);if(r!==null){var d=new Ge(r,null);return(0,A.createFinalization)(d,r),d}return null},l.prototype.defaultInstance=function(){var i=this._viewModel.defaultInstance();if(i!==null){var r=new Ge(i,null);return(0,A.createFinalization)(r,i),r}return null},l.prototype.instance=function(){var i=this._viewModel.instance();if(i!==null){var r=new Ge(i,null);return(0,A.createFinalization)(r,i),r}return null},Object.defineProperty(l.prototype,"properties",{get:function(){return this._viewModel.getProperties()},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"instanceNames",{get:function(){return this._viewModel.getInstanceNames()},enumerable:!1,configurable:!0}),l}(),Ct=function(){function l(i){this._dataEnum=i}return Object.defineProperty(l.prototype,"name",{get:function(){return this._dataEnum.name},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"values",{get:function(){return this._dataEnum.values},enumerable:!1,configurable:!0}),l}(),Te;(function(l){l.Number="number",l.String="string",l.Boolean="boolean",l.Color="color",l.Trigger="trigger",l.Enum="enum",l.List="list",l.Image="image",l.Artboard="artboard"})(Te||(Te={}));var Ge=function(){function l(i,r){this._parents=[],this._children=[],this._viewModelInstances=new Map,this._propertiesWithCallbacks=[],this._referenceCount=0,this.selfUnref=!1,this._runtimeInstance=i,r!==null&&this._parents.push(r)}return Object.defineProperty(l.prototype,"runtimeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"nativeInstance",{get:function(){return this._runtimeInstance},enumerable:!1,configurable:!0}),l.prototype.handleCallbacks=function(){this._propertiesWithCallbacks.length!==0&&(this._propertiesWithCallbacks.forEach(function(i){i.handleCallbacks()}),this._propertiesWithCallbacks.forEach(function(i){i.clearChanges()})),this._children.forEach(function(i){return i.handleCallbacks()})},l.prototype.addParent=function(i){this._parents.includes(i)||(this._parents.push(i),(this._propertiesWithCallbacks.length>0||this._children.length>0)&&i.addToViewModelCallbacks(this))},l.prototype.removeParent=function(i){var r=this._parents.indexOf(i);if(r!==-1){var d=this._parents[r];d.removeFromViewModelCallbacks(this),this._parents.splice(r,1)}},l.prototype.addToPropertyCallbacks=function(i){var r=this;this._propertiesWithCallbacks.includes(i)||(this._propertiesWithCallbacks.push(i),this._propertiesWithCallbacks.length>0&&this._parents.forEach(function(d){d.addToViewModelCallbacks(r)}))},l.prototype.removeFromPropertyCallbacks=function(i){var r=this;this._propertiesWithCallbacks.includes(i)&&(this._propertiesWithCallbacks=this._propertiesWithCallbacks.filter(function(d){return d!==i}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(d){d.removeFromViewModelCallbacks(r)}))},l.prototype.addToViewModelCallbacks=function(i){var r=this;this._children.includes(i)||(this._children.push(i),this._parents.forEach(function(d){d.addToViewModelCallbacks(r)}))},l.prototype.removeFromViewModelCallbacks=function(i){var r=this;this._children.includes(i)&&(this._children=this._children.filter(function(d){return d!==i}),this._children.length===0&&this._propertiesWithCallbacks.length===0&&this._parents.forEach(function(d){d.removeFromViewModelCallbacks(r)}))},l.prototype.clearCallbacks=function(){this._propertiesWithCallbacks.forEach(function(i){i.clearCallbacks()})},l.prototype.propertyFromPath=function(i,r){var d=i.split("/");return this.propertyFromPathSegments(d,0,r)},l.prototype.viewModelFromPathSegments=function(i,r){var d=this.internalViewModelInstance(i[r]);return d!==null?r==i.length-1?d:d.viewModelFromPathSegments(i,r++):null},l.prototype.propertyFromPathSegments=function(i,r,d){var _,S,R,Z,ie,G,oe,Fe,Be,Se,ut,ot,qe,Je,st,Vt,At,ne;if(r<i.length-1){var dt=this.internalViewModelInstance(i[r]);return dt!==null?dt.propertyFromPathSegments(i,r+1,d):null}var me=null;switch(d){case Te.Number:if(me=(S=(_=this._runtimeInstance)===null||_===void 0?void 0:_.number(i[r]))!==null&&S!==void 0?S:null,me!==null)return new xt(me,this);break;case Te.String:if(me=(Z=(R=this._runtimeInstance)===null||R===void 0?void 0:R.string(i[r]))!==null&&Z!==void 0?Z:null,me!==null)return new Nt(me,this);break;case Te.Boolean:if(me=(G=(ie=this._runtimeInstance)===null||ie===void 0?void 0:ie.boolean(i[r]))!==null&&G!==void 0?G:null,me!==null)return new Ke(me,this);break;case Te.Color:if(me=(Fe=(oe=this._runtimeInstance)===null||oe===void 0?void 0:oe.color(i[r]))!==null&&Fe!==void 0?Fe:null,me!==null)return new Oe(me,this);break;case Te.Trigger:if(me=(Se=(Be=this._runtimeInstance)===null||Be===void 0?void 0:Be.trigger(i[r]))!==null&&Se!==void 0?Se:null,me!==null)return new ft(me,this);break;case Te.Enum:if(me=(ot=(ut=this._runtimeInstance)===null||ut===void 0?void 0:ut.enum(i[r]))!==null&&ot!==void 0?ot:null,me!==null)return new lt(me,this);break;case Te.List:if(me=(Je=(qe=this._runtimeInstance)===null||qe===void 0?void 0:qe.list(i[r]))!==null&&Je!==void 0?Je:null,me!==null)return new Rt(me,this);break;case Te.Image:if(me=(Vt=(st=this._runtimeInstance)===null||st===void 0?void 0:st.image(i[r]))!==null&&Vt!==void 0?Vt:null,me!==null)return new fe(me,this);break;case Te.Artboard:if(me=(ne=(At=this._runtimeInstance)===null||At===void 0?void 0:At.artboard(i[r]))!==null&&ne!==void 0?ne:null,me!==null)return new jt(me,this);break}return null},l.prototype.internalViewModelInstance=function(i){var r;if(this._viewModelInstances.has(i))return this._viewModelInstances.get(i);var d=(r=this._runtimeInstance)===null||r===void 0?void 0:r.viewModel(i);if(d!==null){var _=new l(d,this);return(0,A.createFinalization)(_,d),_.internalIncrementReferenceCount(),this._viewModelInstances.set(i,_),_}return null},l.prototype.number=function(i){var r=this.propertyFromPath(i,Te.Number);return r},l.prototype.string=function(i){var r=this.propertyFromPath(i,Te.String);return r},l.prototype.boolean=function(i){var r=this.propertyFromPath(i,Te.Boolean);return r},l.prototype.color=function(i){var r=this.propertyFromPath(i,Te.Color);return r},l.prototype.trigger=function(i){var r=this.propertyFromPath(i,Te.Trigger);return r},l.prototype.enum=function(i){var r=this.propertyFromPath(i,Te.Enum);return r},l.prototype.list=function(i){var r=this.propertyFromPath(i,Te.List);return r},l.prototype.image=function(i){var r=this.propertyFromPath(i,Te.Image);return r},l.prototype.artboard=function(i){var r=this.propertyFromPath(i,Te.Artboard);return r},l.prototype.viewModel=function(i){var r=i.split("/"),d=r.length>1?this.viewModelFromPathSegments(r.slice(0,r.length-1),0):this;return d!=null?d.internalViewModelInstance(r[r.length-1]):null},l.prototype.internalReplaceViewModel=function(i,r){var d;if(r.runtimeInstance!==null){var _=((d=this._runtimeInstance)===null||d===void 0?void 0:d.replaceViewModel(i,r.runtimeInstance))||!1;if(_){r.internalIncrementReferenceCount();var S=this.internalViewModelInstance(i);S!==null&&(S.removeParent(this),this._children.includes(S)&&(this._children=this._children.filter(function(R){return R!==S})),S.cleanup()),this._viewModelInstances.set(i,r),r.addParent(this)}return _}return!1},l.prototype.replaceViewModel=function(i,r){var d,_=i.split("/"),S=_.length>1?this.viewModelFromPathSegments(_.slice(0,_.length-1),0):this;return(d=S==null?void 0:S.internalReplaceViewModel(_[_.length-1],r))!==null&&d!==void 0?d:!1},l.prototype.incrementReferenceCount=function(){var i;this._referenceCount++,(i=this._runtimeInstance)===null||i===void 0||i.incrementReferenceCount()},l.prototype.decrementReferenceCount=function(){var i;this._referenceCount--,(i=this._runtimeInstance)===null||i===void 0||i.decrementReferenceCount()},Object.defineProperty(l.prototype,"properties",{get:function(){var i;return((i=this._runtimeInstance)===null||i===void 0?void 0:i.getProperties().map(function(r){return T({},r)}))||[]}
20,enumerable:!1,configurable:!0}),l.prototype.internalIncrementReferenceCount=function(){this._referenceCount++},l.prototype.cleanup=function(){var i=this,r;if(this._referenceCount--,this._referenceCount<=0){this.selfUnref&&((r=this._runtimeInstance)===null||r===void 0||r.unref()),this._runtimeInstance=null,this.clearCallbacks(),this._propertiesWithCallbacks=[],this._viewModelInstances.forEach(function(S){S.cleanup()}),this._viewModelInstances.clear();var d=z([],this._children,!0);this._children.length=0;var _=z([],this._parents,!0);this._parents.length=0,d.forEach(function(S){S.removeParent(i)}),_.forEach(function(S){S.removeFromViewModelCallbacks(i)})}},l}(),Ue=function(){function l(i,r){this.callbacks=[],this._viewModelInstanceValue=i,this._parentViewModel=r}return l.prototype.on=function(i){this.callbacks.length===0&&this._viewModelInstanceValue.clearChanges(),this.callbacks.includes(i)||(this.callbacks.push(i),this._parentViewModel.addToPropertyCallbacks(this))},l.prototype.off=function(i){i?this.callbacks=this.callbacks.filter(function(r){return r!==i}):this.callbacks.length=0,this.callbacks.length===0&&this._parentViewModel.removeFromPropertyCallbacks(this)},l.prototype.internalHandleCallback=function(i){},l.prototype.handleCallbacks=function(){var i=this;this._viewModelInstanceValue.hasChanged&&this.callbacks.forEach(function(r){i.internalHandleCallback(r)})},l.prototype.clearChanges=function(){this._viewModelInstanceValue.clearChanges()},l.prototype.clearCallbacks=function(){this.callbacks.length=0},Object.defineProperty(l.prototype,"name",{get:function(){return this._viewModelInstanceValue.name},enumerable:!1,configurable:!0}),l}(),Nt=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(r){this._viewModelInstanceValue.value=r},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r(this.value)},i}(Ue),xt=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(r){this._viewModelInstanceValue.value=r},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r(this.value)},i}(Ue),Ke=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(r){this._viewModelInstanceValue.value=r},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r(this.value)},i}(Ue),ft=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return i.prototype.trigger=function(){return this._viewModelInstanceValue.trigger()},i.prototype.internalHandleCallback=function(r){r()},i}(Ue),lt=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(r){this._viewModelInstanceValue.value=r},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"valueIndex",{get:function(){return this._viewModelInstanceValue.valueIndex},set:function(r){this._viewModelInstanceValue.valueIndex=r},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._viewModelInstanceValue.values},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r(this.value)},i}(Ue),Rt=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"length",{get:function(){return this._viewModelInstanceValue.size},enumerable:!1,configurable:!0}),i.prototype.addInstance=function(r){r.runtimeInstance!=null&&(this._viewModelInstanceValue.addInstance(r.runtimeInstance),r.addParent(this._parentViewModel))},i.prototype.addInstanceAt=function(r,d){return r.runtimeInstance!=null&&this._viewModelInstanceValue.addInstanceAt(r.runtimeInstance,d)?(r.addParent(this._parentViewModel),!0):!1},i.prototype.removeInstance=function(r){r.runtimeInstance!=null&&(this._viewModelInstanceValue.removeInstance(r.runtimeInstance),r.removeParent(this._parentViewModel))},i.prototype.removeInstanceAt=function(r){this._viewModelInstanceValue.removeInstanceAt(r)},i.prototype.instanceAt=function(r){var d=this._viewModelInstanceValue.instanceAt(r);if(d!=null){var _=new Ge(d,this._parentViewModel);return(0,A.createFinalization)(_,d),_}return null},i.prototype.swap=function(r,d){this._viewModelInstanceValue.swap(r,d)},i.prototype.internalHandleCallback=function(r){r()},i}(Ue),Oe=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{get:function(){return this._viewModelInstanceValue.value},set:function(r){this._viewModelInstanceValue.value=r}
20,enumerable:!1,configurable:!0}),i.prototype.rgb=function(r,d,_){this._viewModelInstanceValue.rgb(r,d,_)},i.prototype.rgba=function(r,d,_,S){this._viewModelInstanceValue.argb(S,r,d,_)},i.prototype.argb=function(r,d,_,S){this._viewModelInstanceValue.argb(r,d,_,S)},i.prototype.alpha=function(r){this._viewModelInstanceValue.alpha(r)},i.prototype.opacity=function(r){this._viewModelInstanceValue.alpha(Math.round(Math.max(0,Math.min(1,r))*255))},i.prototype.internalHandleCallback=function(r){r(this.value)},i}(Ue),fe=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{set:function(r){var d;this._viewModelInstanceValue.value((d=r==null?void 0:r.nativeImage)!==null&&d!==void 0?d:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r()},i}(Ue),jt=function(l){M(i,l);function i(r,d){return l.call(this,r,d)||this}return Object.defineProperty(i.prototype,"value",{set:function(r){var d,_,S;r.isBindableArtboard?S=r:S=r.file.internalBindableArtboardFromArtboard(r.nativeArtboard),this._viewModelInstanceValue.value((d=S==null?void 0:S.nativeArtboard)!==null&&d!==void 0?d:null),S!=null&&S.nativeViewModel&&this._viewModelInstanceValue.viewModelInstance((_=S==null?void 0:S.nativeViewModel)!==null&&_!==void 0?_:null)},enumerable:!1,configurable:!0}),i.prototype.internalHandleCallback=function(r){r()},i}(Ue),ri=function(l){return I(void 0,void 0,void 0,function(){var i,r,d;return x(this,function(_){switch(_.label){case 0:return i=new Request(l),[4,fetch(i)];case 1:return r=_.sent(),[4,r.arrayBuffer()];case 2:return d=_.sent(),[2,d]}})})},He=function(l){return typeof l=="string"?[l]:l instanceof Array?l:[]},Gt={EventManager:ue,TaskQueueManager:Ie},rt=function(l){return I(void 0,void 0,void 0,function(){var i,r,d;return x(this,function(_){switch(_.label){case 0:return i=new Promise(function(S){return ye.getInstance(function(R){R.decodeAudio(l,S)})}),[4,i];case 1:return r=_.sent(),d=new A.AudioWrapper(r),A.finalizationRegistry.register(d,r),[2,d]}})})},Bt=function(l){return I(void 0,void 0,void 0,function(){var i,r,d;return x(this,function(_){switch(_.label){case 0:return i=new Promise(function(S){return ye.getInstance(function(R){R.decodeImage(l,S)})}),[4,i];case 1:return r=_.sent(),d=new A.ImageWrapper(r),A.finalizationRegistry.register(d,r),[2,d]}})})},oi=function(l){return I(void 0,void 0,void 0,function(){var i,r,d;return x(this,function(_){switch(_.label){case 0:return i=new Promise(function(S){return ye.getInstance(function(R){R.decodeFont(l,S)})}),[4,i];case 1:return r=_.sent(),d=new A.FontWrapper(r),A.finalizationRegistry.register(d,r),[2,d]}})})}})(),g})())}(zi)),zi.exports}var Hs=ko(),Do=Object.defineProperty,Wo=(s,o,h)=>o in s?Do(s,o,{enumerable:!0,configurable:!0,writable:!0,value:h}):s[o]=h,Ae=(s,o,h)=>(Wo(s,typeof o!="symbol"?o+"":o,h),h);const No=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Bo=/^-?[0-9]\d*$/,Uo=/^(?=.*[A-Za-z])(?=.*\d).{8,}$/,zo=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,$o=s=>{let o=s;return typeof s=="string"&&(o=s.trim()),!o},Ho=s=>No.test(s),Yo=(s,o)=>s.length>o,Xo=(s,o)=>s.length<o,Go=s=>typeof s!="string"?!1:!isNaN(+s)&&!isNaN(parseFloat(s)),qo=s=>Bo.test(s),Ko=s=>Uo.test(s),Jo=s=>zo.test(s),Qo=(s,o)=>s>o,Zo=(s,o)=>s<o,Tt=s=>typeof s!="string"||s==="";var ge=(s=>(s.Required="required",s.Email="email",s.MinLength="minLength",s.MaxLength="maxLength",s.Password="password",s.Number="number",s.Integer="integer",s.MaxNumber="maxNumber",s.MinNumber="minNumber",s.StrongPassword="strongPassword",s.CustomRegexp="customRegexp",s.MinFilesCount="minFilesCount",s.MaxFilesCount="maxFilesCount",s.Files="files",s))(ge||{}),An=(s=>(s.Required="required",s))(An||{}),Tr=(s=>(s.Label="label",s.LabelArrow="labelArrow",s))(Tr||{});const yr=[{key:ge.Required,dict:{en:"The field is required"}},{key:ge.Email,dict:{en:"Email has invalid format"}},{key:ge.MaxLength,dict:{en:"The field must contain a maximum of :value characters"}},{key:ge.MinLength,dict:{en:"The field must contain a minimum of :value characters"}},{key:ge.Password,dict:{en:"Password must contain minimum eight characters, at least one letter and one number"}},{key:ge.StrongPassword,dict:{en:"Password should contain minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character"}},{key:ge.Number,dict:{en:"Value should be a number"}},{key:ge.MaxNumber,dict:{en:"Number should be less or equal than :value"}},{key:ge.MinNumber,dict:{en:"Number should be more or equal than :value"}},{key:ge.MinFilesCount,dict:{en:"Files count should be more or equal than :value"}},{key:ge.MaxFilesCount,dict:{en:"Files count should be less or equal than :value"}},{key:ge.Files,dict:{en:"Uploaded files have one or several invalid properties (extension/size/type etc)."}}],es="Value is incorrect",wi=s=>
vendor: 4,197 bytes, line 20
20typeof s=="object"&&s!==null&&"then"in s&&typeof s.then=="function",ts=s=>{let o=s;const h=[];for(;o;)h.unshift(o),o=o.parentNode;return h},is=(s,o)=>{const h=[...o].reverse();for(let u=0,f=h.length;u<f;++u){const g=h[u];for(const v in s){const y=s[v];if(y.groupElem===g)return[v,y]}}return null},wt=s=>Array.isArray(s)?s.filter(o=>o.length>0):typeof s=="string"&&s.trim()?[...s.split(" ").filter(o=>o.length>0)]:[],bi=s=>s instanceof Element||s instanceof HTMLDocument,ns=".just-validate-error-label[data-tooltip=true]{position:fixed;padding:4px 8px;background:#423f3f;color:#fff;white-space:nowrap;z-index:10;border-radius:4px;transform:translateY(-5px)}.just-validate-error-label[data-tooltip=true]:before{content:'';width:0;height:0;border-left:solid 5px transparent;border-right:solid 5px transparent;border-bottom:solid 5px #423f3f;position:absolute;z-index:3;display:block;bottom:-5px;transform:rotate(180deg);left:calc(50% - 5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]{transform:translateX(-5px)}.just-validate-error-label[data-tooltip=true][data-direction=left]:before{right:-7px;bottom:auto;left:auto;top:calc(50% - 2px);transform:rotate(90deg)}.just-validate-error-label[data-tooltip=true][data-direction=right]{transform:translateX(5px)}.just-validate-error-label[data-tooltip=true][data-direction=right]:before{right:auto;bottom:auto;left:-7px;top:calc(50% - 2px);transform:rotate(-90deg)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]{transform:translateY(5px)}.just-validate-error-label[data-tooltip=true][data-direction=bottom]:before{right:auto;bottom:auto;left:calc(50% - 5px);top:-5px;transform:rotate(0)}",Ui=5,_n={errorFieldStyle:{color:"#b81111",border:"1px solid #B81111"},errorFieldCssClass:"just-validate-error-field",successFieldCssClass:"just-validate-success-field",errorLabelStyle:{color:"#b81111"},errorLabelCssClass:"just-validate-error-label",successLabelCssClass:"just-validate-success-label",focusInvalidField:!0,lockForm:!0,testingMode:!1,validateBeforeSubmitting:!1,submitFormAutomatically:!1};class Ys{constructor(o,h,u){Ae(this,"form",null),Ae(this,"fields",{}),Ae(this,"groupFields",{}),Ae(this,"errors",{}),Ae(this,"isValid",!1),Ae(this,"isSubmitted",!1),Ae(this,"globalConfig",_n),Ae(this,"errorLabels",{}),Ae(this,"successLabels",{}),Ae(this,"eventListeners",[]),Ae(this,"dictLocale",yr),Ae(this,"currentLocale","en"),Ae(this,"customStyleTags",{}),Ae(this,"onSuccessCallback"),Ae(this,"onFailCallback"),Ae(this,"onValidateCallback"),Ae(this,"tooltips",[]),Ae(this,"lastScrollPosition"),Ae(this,"isScrollTick"),Ae(this,"fieldIds",new Map),Ae(this,"getKeyByFieldSelector",f=>this.fieldIds.get(f)),Ae(this,"getFieldSelectorByKey",f=>{for(const[g,v]of this.fieldIds)if(f===v)return g}),Ae(this,"getCompatibleFields",()=>{const f={};return Object.keys(this.fields).forEach(g=>{let v=g;const y=this.getFieldSelectorByKey(g);typeof y=="string"&&(v=y),f[v]={...this.fields[g]}}),f}),Ae(this,"setKeyByFieldSelector",f=>{if(this.fieldIds.has(f))return this.fieldIds.get(f);const g=String(this.fieldIds.size+1);return this.fieldIds.set(f,g),g}),Ae(this,"refreshAllTooltips",()=>{this.tooltips.forEach(f=>{f.refresh()})}),Ae(this,"handleDocumentScroll",()=>{this.lastScrollPosition=window.scrollY,this.isScrollTick||(window.requestAnimationFrame(()=>{this.refreshAllTooltips(),this.isScrollTick=!1}),this.isScrollTick=!0)}),Ae(this,"formSubmitHandler",f=>{f.preventDefault(),this.isSubmitted=!0,this.validateHandler(f)}),Ae(this,"handleFieldChange",f=>{let g;for(const v in this.fields)if(this.fields[v].elem===f){g=v;break}g&&(this.fields[g].touched=!0,this.validateField(g,!0))}),Ae(this,"handleGroupChange",f=>{let g;for(const v in this.groupFields)if(this.groupFields[v].elems.find(E=>E===f)){g=v;break}g&&(this.groupFields[g].touched=!0,this.validateGroup(g,!0))}),Ae(this,"handlerChange",f=>{f.target&&(this.handleFieldChange(f.target),this.handleGroupChange(f.target),this.renderErrors())}),this.initialize(o,h,u)}initialize(o,h,u){if(this.form=null,this.errors={},this.isValid=!1,this.isSubmitted=!1,this.globalConfig=_n,this.errorLabels={},this.successLabels={},this.eventListeners=[],this.customStyleTags={}
20,this.tooltips=[],this.currentLocale="en",typeof o=="string"){const f=document.querySelector(o);if(!f)throw Error(`Form with ${o} selector not found! Please check the form selector`);this.setForm(f)}else if(o instanceof HTMLFormElement)this.setForm(o);else throw Error("Form selector is not valid. Please specify a string selector or a DOM element.");if(this.globalConfig={..._n,...h},u&&(this.dictLocale=[...u,...yr]),this.isTooltip()){const f=document.createElement("style");f.textContent=ns,this.customStyleTags[Tr.Label]=document.head.appendChild(f),this.addListener("scroll",document,this.handleDocumentScroll)}}getLocalisedString(o,h,u){var f;const g=u??o;let v=(f=this.dictLocale.find(y=>y.key===g))==null?void 0:f.dict[this.currentLocale];if(v||u&&(v=u),v&&h!==void 0)switch(o){case ge.MaxLength:case ge.MinLength:case ge.MaxNumber:case ge.MinNumber:case ge.MinFilesCount:case ge.MaxFilesCount:v=v.replace(":value",String(h))}return v||u||es}getFieldErrorMessage(o,h){const u=typeof o.errorMessage=="function"?o.errorMessage(this.getElemValue(h),this.fields):o.errorMessage;return this.getLocalisedString(o.rule,o.value,u)}getFieldSuccessMessage(o,h){const u=typeof o=="function"?o(this.getElemValue(h),this.fields):o;return this.getLocalisedString(void 0,void 0,u)}getGroupErrorMessage(o){return this.getLocalisedString(o.rule,void 0,o.errorMessage)}getGroupSuccessMessage(o){if(o.successMessage)return this.getLocalisedString(void 0,void 0,o.successMessage)}setFieldInvalid(o,h){this.fields[o].isValid=!1,this.fields[o].errorMessage=this.getFieldErrorMessage(h,this.fields[o].elem)}setFieldValid(o,h){this.fields[o].isValid=!0,h!==void 0&&(this.fields[o].successMessage=this.getFieldSuccessMessage(h,this.fields[o].elem))}setGroupInvalid(o,h){this.groupFields[o].isValid=!1,this.groupFields[o].errorMessage=this.getGroupErrorMessage(h)}setGroupValid(o,h){this.groupFields[o].isValid=!0,this.groupFields[o].successMessage=this.getGroupSuccessMessage(h)}getElemValue(o){switch(o.type){case"checkbox":return o.checked;case"file":return o.files;default:return o.value}}validateGroupRule(o,h,u){switch(u.rule){case An.Required:h.every(f=>!f.checked)?this.setGroupInvalid(o,u):this.setGroupValid(o,u)}}validateFieldRule(o,h,u,f=!1){const g=u.value,v=this.getElemValue(h);if(u.plugin){u.plugin(v,this.getCompatibleFields())||this.setFieldInvalid(o,u);return}switch(u.rule){case ge.Required:{$o(v)&&this.setFieldInvalid(o,u);break}case ge.Email:{if(Tt(v))break;Ho(v)||this.setFieldInvalid(o,u);break}case ge.MaxLength:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Tt(v))break;Yo(v,g)&&this.setFieldInvalid(o,u);break}case ge.MinLength:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Tt(v))break;Xo(v,g)&&this.setFieldInvalid(o,u);break}case ge.Password:{if(Tt(v))break;Ko(v)||this.setFieldInvalid(o,u);break}case ge.StrongPassword:{if(Tt(v))break;Jo(v)||this.setFieldInvalid(o,u);break}case ge.Number:{if(Tt(v))break;Go(v)||this.setFieldInvalid(o,u);break}case ge.Integer:{if(Tt(v))break;qo(v)||this.setFieldInvalid(o,u);break}case ge.MaxNumber:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Tt(v))break;const y=+v;(Number.isNaN(y)||Qo(y,g))&&this.setFieldInvalid(o,u);break}case ge.MinNumber:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}
20] field is not defined. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Tt(v))break;const y=+v;(Number.isNaN(y)||Zo(y,g))&&this.setFieldInvalid(o,u);break}case ge.CustomRegexp:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(o,u);return}let y;try{y=new RegExp(g)}catch{console.error(`Value for ${u.rule} rule for [${o}] should be a valid regexp. This field will be always invalid.`),this.setFieldInvalid(o,u);break}const E=String(v);E!==""&&!y.test(E)&&this.setFieldInvalid(o,u);break}case ge.MinFilesCount:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Number.isFinite(v==null?void 0:v.length)&&v.length<g){this.setFieldInvalid(o,u);break}break}case ge.MaxFilesCount:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(o,u);break}if(typeof g!="number"){console.error(`Value for ${u.rule} rule for [${o}] field should be a number. The field will be always invalid.`),this.setFieldInvalid(o,u);break}if(Number.isFinite(v==null?void 0:v.length)&&v.length>g){this.setFieldInvalid(o,u);break}break}case ge.Files:{if(g===void 0){console.error(`Value for ${u.rule} rule for [${o}] field is not defined. This field will be always invalid.`),this.setFieldInvalid(o,u);return}if(typeof g!="object"){console.error(`Value for ${u.rule} rule for [${o}] field should be an object. This field will be always invalid.`),this.setFieldInvalid(o,u);return}const y=g.files;if(typeof y!="object"){console.error(`Value for ${u.rule} rule for [${o}] field should be an object with files array. This field will be always invalid.`),this.setFieldInvalid(o,u);return}const E=(A,M)=>{const T=Number.isFinite(M.minSize)&&A.size<M.minSize,I=Number.isFinite(M.maxSize)&&A.size>M.maxSize,x=Array.isArray(M.names)&&!M.names.includes(A.name),z=Array.isArray(M.extensions)&&!M.extensions.includes(A.name.split(".")[A.name.split(".").length-1]),m=Array.isArray(M.types)&&!M.types.includes(A.type);return T||I||x||z||m};if(typeof v=="object"&&v!==null)for(let A=0,M=v.length;A<M;++A){const T=v.item(A);if(!T){this.setFieldInvalid(o,u);break}if(E(T,y)){this.setFieldInvalid(o,u);break}}break}default:{if(typeof u.validator!="function"){console.error(`Validator for custom rule for [${o}] field should be a function. This field will be always invalid.`),this.setFieldInvalid(o,u);return}const y=u.validator(v,this.getCompatibleFields());if(typeof y!="boolean"&&typeof y!="function"&&console.error(`Validator return value for [${o}] field should be boolean or function. It will be cast to boolean.`),typeof y=="function")if(f)this.fields[o].asyncCheckPending=!0;else{this.fields[o].asyncCheckPending=!1;const E=y();if(!wi(E)){console.error(`Validator function for custom rule for [${o}] field should return a Promise. This field will be always invalid.`),this.setFieldInvalid(o,u);return}return E.then(A=>{A||this.setFieldInvalid(o,u)}).catch(()=>{this.setFieldInvalid(o,u)})}y||this.setFieldInvalid(o,u)}}}isFormValid(){let o=!0;for(let h=0,u=Object.values(this.fields).length;h<u;++h){const f=Object.values(this.fields)[h];if(f.isValid===void 0){o=void 0;break}if(f.isValid===!1){o=!1;break}}for(let h=0,u=Object.values(this.groupFields).length;h<u;++h){const f=Object.values(this.groupFields)[h];if(f.isValid===void 0){o=void 0;break}if(f.isValid===!1){o=!1;break}}return o}validateField(o,h=!1){var u;const f=this.fields[o];f.isValid=!0;const g=[];return[...f.rules].reverse().forEach(v=>{const y=this.validateFieldRule(o,f.elem,v,h);wi(y)&&g.push(y)}),f.isValid&&this.setFieldValid(o,(u=f.config)==null?void 0:u.successMessage),Promise.allSettled(g).finally(()=>{var v;h&&((v=this.onValidateCallback)==null||v.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))})}
20revalidateField(o){if(typeof o!="string"&&!bi(o))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const h=this.getKeyByFieldSelector(o);return!h||!this.fields[h]?(console.error("Field not found. Check the field selector."),Promise.reject()):new Promise(u=>{this.validateField(h,!0).finally(()=>{this.clearFieldStyle(h),this.clearFieldLabel(h),this.renderFieldError(h,!0),u(!!this.fields[h].isValid)})})}revalidateGroup(o){if(typeof o!="string"&&!bi(o))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");const h=this.getKeyByFieldSelector(o);return!h||!this.groupFields[h]?(console.error("Group not found. Check the group selector."),Promise.reject()):new Promise(u=>{this.validateGroup(h).finally(()=>{this.clearFieldLabel(h),this.renderGroupError(h,!0),u(!!this.groupFields[h].isValid)})})}validateGroup(o,h=!1){const u=this.groupFields[o],f=[];return[...u.rules].reverse().forEach(g=>{const v=this.validateGroupRule(o,u.elems,g);wi(v)&&f.push(v)}),Promise.allSettled(f).finally(()=>{var g;h&&((g=this.onValidateCallback)==null||g.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}))})}focusInvalidField(){for(const o in this.fields){const h=this.fields[o];if(!h.isValid){setTimeout(()=>h.elem.focus(),0);break}}}afterSubmitValidation(o=!1){this.renderErrors(o),this.globalConfig.focusInvalidField&&this.focusInvalidField()}validate(o=!1){return new Promise(h=>{const u=[];Object.keys(this.fields).forEach(f=>{const g=this.validateField(f);wi(g)&&u.push(g)}),Object.keys(this.groupFields).forEach(f=>{const g=this.validateGroup(f);wi(g)&&u.push(g)}),Promise.allSettled(u).then(()=>{var f;this.afterSubmitValidation(o),(f=this.onValidateCallback)==null||f.call(this,{isValid:this.isFormValid(),isSubmitted:this.isSubmitted,fields:this.getCompatibleFields(),groups:{...this.groupFields}}),h(!!u.length)})})}revalidate(){return new Promise(o=>{this.validateHandler(void 0,!0).finally(()=>{this.globalConfig.focusInvalidField&&this.focusInvalidField(),o(this.isValid)})})}validateHandler(o,h=!1){return this.globalConfig.lockForm&&this.lockForm(),this.validate(h).finally(()=>{var u,f,g;this.globalConfig.lockForm&&this.unlockForm(),this.isValid?((u=this.onSuccessCallback)==null||u.call(this,o),this.globalConfig.submitFormAutomatically&&((f=o==null?void 0:o.currentTarget)==null||f.submit())):(g=this.onFailCallback)==null||g.call(this,this.getCompatibleFields(),this.groupFields)})}setForm(o){this.form=o,this.form.setAttribute("novalidate","novalidate"),this.removeListener("submit",this.form,this.formSubmitHandler),this.addListener("submit",this.form,this.formSubmitHandler)}addListener(o,h,u){h.addEventListener(o,u),this.eventListeners.push({type:o,elem:h,func:u})}removeListener(o,h,u){h.removeEventListener(o,u),this.eventListeners=this.eventListeners.filter(f=>f.type!==o||f.elem!==h)}addField(o,h,u){if(typeof o!="string"&&!bi(o))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");let f;if(typeof o=="string"?f=this.form.querySelector(o):f=o,!f)throw Error("Field doesn't exist in the DOM! Please check the field selector.");if(!Array.isArray(h)||!h.length)throw Error("Rules argument should be an array and should contain at least 1 element.");h.forEach(v=>{if(!("rule"in v||"validator"in v||"plugin"in v))throw Error("Rules argument must contain at least one rule or validator property.");if(!v.validator&&!v.plugin&&(!v.rule||!Object.values(ge).includes(v.rule)))throw Error(`Rule should be one of these types: ${Object.values(ge).join(", ")}. Provided value: ${v.rule}`)});const g=this.setKeyByFieldSelector(o);return this.fields[g]={elem:f,rules:h,isValid:void 0,touched:!1,config:u},this.setListeners(f),(this.isSubmitted||this.globalConfig.validateBeforeSubmitting)&&this.validateField(g),this}removeField(o){if(typeof o!="string"&&!bi(o))throw Error("Field selector is not valid. Please specify a string selector or a valid DOM element.");const h=this.getKeyByFieldSelector(o);if(!h||!this.fields[h])return console.error("Field not found. Check the field selector."),this;const u=this.getListenerType(this.fields[h].elem.type);return this.removeListener(u,this.fields[h].elem,this.handlerChange),this.clearErrors(),delete this.fields[h],this}
20removeGroup(o){if(typeof o!="string")throw Error("Group selector is not valid. Please specify a string selector.");const h=this.getKeyByFieldSelector(o);return!h||!this.groupFields[h]?(console.error("Group not found. Check the group selector."),this):(this.groupFields[h].elems.forEach(u=>{const f=this.getListenerType(u.type);this.removeListener(f,u,this.handlerChange)}),this.clearErrors(),delete this.groupFields[h],this)}addRequiredGroup(o,h,u,f){if(typeof o!="string"&&!bi(o))throw Error("Group selector is not valid. Please specify a string selector or a valid DOM element.");let g;if(typeof o=="string"?g=this.form.querySelector(o):g=o,!g)throw Error("Group selector not found! Please check the group selector.");const v=g.querySelectorAll("input"),y=Array.from(v).filter(A=>{const M=is(this.groupFields,ts(A));return M?M[1].elems.find(T=>T!==A):!0}),E=this.setKeyByFieldSelector(o);return this.groupFields[E]={rules:[{rule:An.Required,errorMessage:h,successMessage:f}],groupElem:g,elems:y,touched:!1,isValid:void 0,config:u},v.forEach(A=>{this.setListeners(A)}),this}getListenerType(o){switch(o){case"checkbox":case"select-one":case"file":case"radio":return"change";default:return"input"}}setListeners(o){const h=this.getListenerType(o.type);this.removeListener(h,o,this.handlerChange),this.addListener(h,o,this.handlerChange)}clearFieldLabel(o){var h,u;(h=this.errorLabels[o])==null||h.remove(),(u=this.successLabels[o])==null||u.remove()}clearFieldStyle(o){var h,u,f,g;const v=this.fields[o],y=((h=v.config)==null?void 0:h.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(y).forEach(A=>{v.elem.style[A]=""});const E=((u=v.config)==null?void 0:u.successFieldStyle)||this.globalConfig.successFieldStyle||{};
20Object.keys(E).forEach(A=>{v.elem.style[A]=""}),v.elem.classList.remove(...wt(((f=v.config)==null?void 0:f.errorFieldCssClass)||this.globalConfig.errorFieldCssClass),...wt(((g=v.config)==null?void 0:g.successFieldCssClass)||this.globalConfig.successFieldCssClass))}clearErrors(){var o,h;Object.keys(this.errorLabels).forEach(u=>this.errorLabels[u].remove()),Object.keys(this.successLabels).forEach(u=>this.successLabels[u].remove());for(const u in this.fields)this.clearFieldStyle(u);for(const u in this.groupFields){const f=this.groupFields[u],g=((o=f.config)==null?void 0:o.errorFieldStyle)||this.globalConfig.errorFieldStyle;Object.keys(g).forEach(y=>{f.elems.forEach(E=>{var A;E.style[y]="",E.classList.remove(...wt(((A=f.config)==null?void 0:A.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))})});const v=((h=f.config)==null?void 0:h.successFieldStyle)||this.globalConfig.successFieldStyle||{};Object.keys(v).forEach(y=>{f.elems.forEach(E=>{var A;E.style[y]="",E.classList.remove(...wt(((A=f.config)==null?void 0:A.successFieldCssClass)||this.globalConfig.successFieldCssClass))})})}this.tooltips=[]}isTooltip(){return!!this.globalConfig.tooltip}lockForm(){const o=this.form.querySelectorAll("input, textarea, button, select");for(let h=0,u=o.length;h<u;++h)o[h].setAttribute("data-just-validate-fallback-disabled",o[h].disabled?"true":"false"),o[h].setAttribute("disabled","disabled"),o[h].style.pointerEvents="none",o[h].style.webkitFilter="grayscale(100%)",o[h].style.filter="grayscale(100%)"}unlockForm(){const o=this.form.querySelectorAll("input, textarea, button, select");for(let h=0,u=o.length;h<u;++h)o[h].getAttribute("data-just-validate-fallback-disabled")!=="true"&&o[h].removeAttribute("disabled"),o[h].style.pointerEvents="",o[h].style.webkitFilter="",o[h].style.filter=""}renderTooltip(o,h,u){var f;const{top:g,left:v,width:y,height:E}=o.getBoundingClientRect(),A=h.getBoundingClientRect(),M=u||((f=this.globalConfig.tooltip)==null?void 0:f.position);switch(M){case"left":{h.style.top=`${g+E/2-A.height/2}px`,h.style.left=`${v-A.width-Ui}px`;break}case"top":{h.style.top=`${g-A.height-Ui}px`,h.style.left=`${v+y/2-A.width/2}px`;break}case"right":{h.style.top=`${g+E/2-A.height/2}px`,h.style.left=`${v+y+Ui}px`;break}case"bottom":{h.style.top=`${g+E+Ui}px`,h.style.left=`${v+y/2-A.width/2}px`;break}}return h.dataset.direction=M,{refresh:()=>{this.renderTooltip(o,h,u)}}}createErrorLabelElem(o,h,u){const f=document.createElement("div");f.innerHTML=h;const g=this.isTooltip()?u==null?void 0:u.errorLabelStyle:(u==null?void 0:u.errorLabelStyle)||this.globalConfig.errorLabelStyle;return Object.assign(f.style,g),f.classList.add(...wt((u==null?void 0:u.errorLabelCssClass)||this.globalConfig.errorLabelCssClass),"just-validate-error-label"),this.isTooltip()&&(f.dataset.tooltip="true"),this.globalConfig.testingMode&&(f.dataset.testId=`error-label-${o}`),this.errorLabels[o]=f,f}createSuccessLabelElem(o,h,u){if(h===void 0)return null;const f=document.createElement("div");f.innerHTML=h;const g=(u==null?void 0:u.successLabelStyle)||this.globalConfig.successLabelStyle;return Object.assign(f.style,g),f.classList.add(...wt((u==null?void 0:u.successLabelCssClass)||this.globalConfig.successLabelCssClass),"just-validate-success-label"),this.globalConfig.testingMode&&(f.dataset.testId=`success-label-${o}`),this.successLabels[o]=f,f}renderErrorsContainer(o,h){const u=h||this.globalConfig.errorsContainer;if(typeof u=="string"){const f=this.form.querySelector(u);if(f)return f.appendChild(o),!0;console.error(`Error container with ${u} selector not found. Errors will be rendered as usual`)}return u instanceof Element?(u.appendChild(o),!0):(u!==void 0&&console.error("Error container not found. It should be a string or existing Element. Errors will be rendered as usual"),!1)}renderGroupLabel(o,h,u,f){!f&&this.renderErrorsContainer(h,u)||o.appendChild(h)}renderFieldLabel(o,h,u,f){var g,v,y,E,A,M,T;if(!(!f&&this.renderErrorsContainer(h,u)))if(o.type==="checkbox"||o.type==="radio"){const I=document.querySelector(`label[for="${o.getAttribute("id")}"]`);((v=(g=o.parentElement)==null?void 0:g.tagName)==null?void 0:v.toLowerCase())==="label"?(E=(y=o.parentElement)==null?void 0:y.parentElement)==null||E.appendChild(h):I?(A=I.parentElement)==null||A.appendChild(h):(M=o.parentElement)==null||M.appendChild(h)}else(T=o.parentElement)==null||T.appendChild(h)}
20showLabels(o,h){Object.keys(o).forEach((u,f)=>{const g=o[u],v=this.getKeyByFieldSelector(u);if(!v||!this.fields[v]){console.error("Field not found. Check the field selector.");return}const y=this.fields[v];y.isValid=!h,this.clearFieldStyle(v),this.clearFieldLabel(v),this.renderFieldError(v,!1,g),f===0&&this.globalConfig.focusInvalidField&&setTimeout(()=>y.elem.focus(),0)})}showErrors(o){if(typeof o!="object")throw Error("[showErrors]: Errors should be an object with key: value format");this.showLabels(o,!0)}showSuccessLabels(o){if(typeof o!="object")throw Error("[showSuccessLabels]: Labels should be an object with key: value format");this.showLabels(o,!1)}renderFieldError(o,h=!1,u){var f,g,v,y,E,A;const M=this.fields[o];if(M.isValid===!1&&(this.isValid=!1),M.isValid===void 0||!h&&!this.isSubmitted&&!M.touched&&u===void 0)return;if(M.isValid){if(!M.asyncCheckPending){const I=this.createSuccessLabelElem(o,u!==void 0?u:M.successMessage,M.config);I&&this.renderFieldLabel(M.elem,I,(f=M.config)==null?void 0:f.errorsContainer,!0),M.elem.classList.add(...wt(((g=M.config)==null?void 0:g.successFieldCssClass)||this.globalConfig.successFieldCssClass))}return}M.elem.classList.add(...wt(((v=M.config)==null?void 0:v.errorFieldCssClass)||this.globalConfig.errorFieldCssClass));const T=this.createErrorLabelElem(o,u!==void 0?u:M.errorMessage,M.config);this.renderFieldLabel(M.elem,T,(y=M.config)==null?void 0:y.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(M.elem,T,(A=(E=M.config)==null?void 0:E.tooltip)==null?void 0:A.position))}renderGroupError(o,h=!0){var u,f,g,v;const y=this.groupFields[o];if(y.isValid===!1&&(this.isValid=!1),y.isValid===void 0||!h&&!this.isSubmitted&&!y.touched)return;if(y.isValid){y.elems.forEach(M=>{var T,I;Object.assign(M.style,((T=y.config)==null?void 0:T.successFieldStyle)||this.globalConfig.successFieldStyle),M.classList.add(...wt(((I=y.config)==null?void 0:I.successFieldCssClass)||this.globalConfig.successFieldCssClass))});const A=this.createSuccessLabelElem(o,y.successMessage,y.config);A&&this.renderGroupLabel(y.groupElem,A,(u=y.config)==null?void 0:u.errorsContainer,!0);return}this.isValid=!1,y.elems.forEach(A=>{var M,T;Object.assign(A.style,((M=y.config)==null?void 0:M.errorFieldStyle)||this.globalConfig.errorFieldStyle),A.classList.add(...wt(((T=y.config)==null?void 0:T.errorFieldCssClass)||this.globalConfig.errorFieldCssClass))});const E=this.createErrorLabelElem(o,y.errorMessage,y.config);this.renderGroupLabel(y.groupElem,E,(f=y.config)==null?void 0:f.errorsContainer),this.isTooltip()&&this.tooltips.push(this.renderTooltip(y.groupElem,E,(v=(g=y.config)==null?void 0:g.tooltip)==null?void 0:v.position))}renderErrors(o=!1){if(!(!this.isSubmitted&&!o&&!this.globalConfig.validateBeforeSubmitting)){this.clearErrors(),this.isValid=!0;for(const h in this.groupFields)this.renderGroupError(h);for(const h in this.fields)this.renderFieldError(h)}}destroy(){this.eventListeners.forEach(o=>{this.removeListener(o.type,o.elem,o.func)}),Object.keys(this.customStyleTags).forEach(o=>{this.customStyleTags[o].remove()}),this.clearErrors(),this.globalConfig.lockForm&&this.unlockForm()}refresh(){this.destroy(),this.form?(this.initialize(this.form,this.globalConfig),Object.keys(this.fields).forEach(o=>{const h=this.getFieldSelectorByKey(o);h&&this.addField(h,[...this.fields[o].rules],this.fields[o].config)})):console.error("Cannot initialize the library! Form is not defined")}setCurrentLocale(o){if(typeof o!="string"&&o!==void 0){console.error("Current locale should be a string");return}this.currentLocale=o,this.isSubmitted&&this.validate()}onSuccess(o){return this.onSuccessCallback=o,this}onFail(o){return this.onFailCallback=o,this}onValidate(o){return this.onValidateCallback=o,this}}const En=Math.min,ei=Math.max,$i=Math.round,bt=s=>({x:s,y:s});function wr(s,o,h){return ei(s,En(o,h))}function Sn(s,o){return typeof s=="function"?s(o):s}function Yi(s){return s.split("-")[0]}function Pr(s){return s.split("-")[1]}function Or(s){return s==="x"?"y":"x"}function rs(s){return s==="y"?"height":"width"}const os=new Set(["top","bottom"]);function Xi(s){return os.has(Yi(s))?"y":"x"}function ss(s){return Or(Xi(s))}function as(s){return{top:0,right:0,bottom:0,left:0,...s}}
vendor: 6,272 bytes, line 20
20function ls(s){return typeof s!="number"?as(s):{top:s,right:s,bottom:s,left:s}}function Hi(s){const{x:o,y:h,width:u,height:f}=s;return{width:u,height:f,top:h,left:o,right:o+u,bottom:h+f,x:o,y:h}}function br(s,o,h){let{reference:u,floating:f}=s;const g=Xi(o),v=ss(o),y=rs(v),E=Yi(o),A=g==="y",M=u.x+u.width/2-f.width/2,T=u.y+u.height/2-f.height/2,I=u[y]/2-f[y]/2;let x;switch(E){case"top":x={x:M,y:u.y-f.height};break;case"bottom":x={x:M,y:u.y+u.height};break;case"right":x={x:u.x+u.width,y:T};break;case"left":x={x:u.x-f.width,y:T};break;default:x={x:u.x,y:u.y}}switch(Pr(o)){case"start":x[v]-=I*(h&&A?-1:1);break;case"end":x[v]+=I*(h&&A?-1:1);break}return x}async function us(s,o){var h;o===void 0&&(o={});const{x:u,y:f,platform:g,rects:v,elements:y,strategy:E}=s,{boundary:A="clippingAncestors",rootBoundary:M="viewport",elementContext:T="floating",altBoundary:I=!1,padding:x=0}=Sn(o,s),z=ls(x),B=y[I?T==="floating"?"reference":"floating":T],H=Hi(await g.getClippingRect({element:(h=await(g.isElement==null?void 0:g.isElement(B)))==null||h?B:B.contextElement||await(g.getDocumentElement==null?void 0:g.getDocumentElement(y.floating)),boundary:A,rootBoundary:M,strategy:E})),q=T==="floating"?{x:u,y:f,width:v.floating.width,height:v.floating.height}:v.reference,ee=await(g.getOffsetParent==null?void 0:g.getOffsetParent(y.floating)),te=await(g.isElement==null?void 0:g.isElement(ee))?await(g.getScale==null?void 0:g.getScale(ee))||{x:1,y:1}:{x:1,y:1},ye=Hi(g.convertOffsetParentRelativeRectToViewportRelativeRect?await g.convertOffsetParentRelativeRectToViewportRelativeRect({elements:y,rect:q,offsetParent:ee,strategy:E}):q);return{top:(H.top-ye.top+z.top)/te.y,bottom:(ye.bottom-H.bottom+z.bottom)/te.y,left:(H.left-ye.left+z.left)/te.x,right:(ye.right-H.right+z.right)/te.x}}const cs=async(s,o,h)=>{const{placement:u="bottom",strategy:f="absolute",middleware:g=[],platform:v}=h,y=g.filter(Boolean),E=await(v.isRTL==null?void 0:v.isRTL(o));let A=await v.getElementRects({reference:s,floating:o,strategy:f}),{x:M,y:T}=br(A,u,E),I=u,x={},z=0;for(let B=0;B<y.length;B++){var m;const{name:H,fn:q}=y[B],{x:ee,y:te,data:ye,reset:se}=await q({x:M,y:T,initialPlacement:u,placement:I,strategy:f,middlewareData:x,rects:A,platform:{...v,detectOverflow:(m=v.detectOverflow)!=null?m:us},elements:{reference:s,floating:o}});M=ee??M,T=te??T,x={...x,[H]:{...x[H],...ye}},se&&z<=50&&(z++,typeof se=="object"&&(se.placement&&(I=se.placement),se.rects&&(A=se.rects===!0?await v.getElementRects({reference:s,floating:o,strategy:f}):se.rects),{x:M,y:T}=br(A,I,E)),B=-1)}return{x:M,y:T,placement:I,strategy:f,middlewareData:x}},hs=new Set(["left","top"]);async function fs(s,o){const{placement:h,platform:u,elements:f}=s,g=await(u.isRTL==null?void 0:u.isRTL(f.floating)),v=Yi(h),y=Pr(h),E=Xi(h)==="y",A=hs.has(v)?-1:1,M=g&&E?-1:1,T=Sn(o,s);let{mainAxis:I,crossAxis:x,alignmentAxis:z}=typeof T=="number"?{mainAxis:T,crossAxis:0,alignmentAxis:null}:{mainAxis:T.mainAxis||0,crossAxis:T.crossAxis||0,alignmentAxis:T.alignmentAxis};return y&&typeof z=="number"&&(x=y==="end"?z*-1:z),E?{x:x*M,y:I*A}:{x:I*A,y:x*M}}const ds=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(o){var h,u;const{x:f,y:g,placement:v,middlewareData:y}=o,E=await fs(o,s);return v===((h=y.offset)==null?void 0:h.placement)&&(u=y.arrow)!=null&&u.alignmentOffset?{}:{x:f+E.x,y:g+E.y,data:{...E,placement:v}}}}},ps=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(o){const{x:h,y:u,placement:f,platform:g}=o,{mainAxis:v=!0,crossAxis:y=!1,limiter:E={fn:H=>{let{x:q,y:ee}=H;return{x:q,y:ee}}},...A}=Sn(s,o),M={x:h,y:u},T=await g.detectOverflow(o,A),I=Xi(Yi(f)),x=Or(I);let z=M[x],m=M[I];if(v){const H=x==="y"?"top":"left",q=x==="y"?"bottom":"right",ee=z+T[H],te=z-T[q];z=wr(ee,z,te)}if(y){const H=I==="y"?"top":"left",q=I==="y"?"bottom":"right",ee=m+T[H],te=m-T[q];m=wr(ee,m,te)}const B=E.fn({...o,[x]:z,[I]:m});return{...B,data:{x:B.x-h,y:B.y-u,enabled:{[x]:v,[I]:y}}}}}};function Gi(){return typeof window<"u"}function ni(s){return xr(s)?(s.nodeName||"").toLowerCase():"#document"}function tt(s){var o;return(s==null||(o=s.ownerDocument)==null?void 0:o.defaultView)||window}function Ot(s){var o;return(o=(xr(s)?s.ownerDocument:s.document)||window.document)==null?void 0:o.documentElement}function xr(s){return Gi()?s instanceof Node||s instanceof tt(s).Node:!1}function ct(s){return Gi()?s instanceof Element||s instanceof tt(s).Element:!1}function _t(s){return Gi()?s instanceof HTMLElement||s instanceof tt(s).HTMLElement:!1}function _r(s){return!Gi()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof tt(s).ShadowRoot}const vs=new Set(["inline","contents"]);function Ei(s){const{overflow:o,overflowX:h,overflowY:u,display:f}=ht(s);return/auto|scroll|overlay|hidden|clip/.test(o+u+h)&&!vs.has(f)}const ms=new Set(["table","td","th"]);function gs(s){return ms.has(ni(s))}const ys=[":popover-open",":modal"];function qi(s){return ys.some(o=>{try{return s.matches(o)}catch{return!1}})}const ws=["transform","translate","scale","rotate","perspective"],bs=["transform","translate","scale","rotate","perspective","filter"],_s=["paint","layout","strict","content"];function Mn(s){const o=Ln(),h=ct(s)?ht(s):s;return ws.some(u=>h[u]?h[u]!=="none":!1)||(h.containerType?h.containerType!=="normal":!1)||!o&&(h.backdropFilter?h.backdropFilter!=="none":!1)||!o&&(h.filter?h.filter!=="none":!1)||bs.some(u=>(h.willChange||"").includes(u))||_s.some(u=>(h.contain||"").includes(u))}function Cs(s){let o=Wt(s);for(;_t(o)&&!ii(o);){if(Mn(o))return o;if(qi(o))return null;o=Wt(o)}return null}function Ln(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const As=new Set(["html","body","#document"]);function ii(s){return As.has(ni(s))}function ht(s){return tt(s).getComputedStyle(s)}function Ki(s){return ct(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function Wt(s){if(ni(s)==="html")return s;const o=s.assignedSlot||s.parentNode||_r(s)&&s.host||Ot(s);return _r(o)?o.host:o}function Rr(s){const o=Wt(s);return ii(o)?s.ownerDocument?s.ownerDocument.body:s.body:_t(o)&&Ei(o)?o:Rr(o)}function jr(s,o,h){var u;o===void 0&&(o=[]);const f=Rr(s),g=f===((u=s.ownerDocument)==null?void 0:u.body),v=tt(f);
vendor: 6,190 bytes, line 20
20return g?(Fn(v),o.concat(v,v.visualViewport||[],Ei(f)?f:[],[])):o.concat(f,jr(f,[]))}function Fn(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function Vr(s){const o=ht(s);let h=parseFloat(o.width)||0,u=parseFloat(o.height)||0;const f=_t(s),g=f?s.offsetWidth:h,v=f?s.offsetHeight:u,y=$i(h)!==g||$i(u)!==v;return y&&(h=g,u=v),{width:h,height:u,$:y}}function kr(s){return ct(s)?s:s.contextElement}function ti(s){const o=kr(s);if(!_t(o))return bt(1);const h=o.getBoundingClientRect(),{width:u,height:f,$:g}=Vr(o);let v=(g?$i(h.width):h.width)/u,y=(g?$i(h.height):h.height)/f;return(!v||!Number.isFinite(v))&&(v=1),(!y||!Number.isFinite(y))&&(y=1),{x:v,y}}const Es=bt(0);function Dr(s){const o=tt(s);return!Ln()||!o.visualViewport?Es:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Fs(s,o,h){return o===void 0&&(o=!1),!h||o&&h!==tt(s)?!1:o}function Ai(s,o,h,u){o===void 0&&(o=!1),h===void 0&&(h=!1);const f=s.getBoundingClientRect(),g=kr(s);let v=bt(1);o&&(u?ct(u)&&(v=ti(u)):v=ti(s));const y=Fs(g,h,u)?Dr(g):bt(0);let E=(f.left+y.x)/v.x,A=(f.top+y.y)/v.y,M=f.width/v.x,T=f.height/v.y;if(g){const I=tt(g),x=u&&ct(u)?tt(u):u;let z=I,m=Fn(z);for(;m&&u&&x!==z;){const B=ti(m),H=m.getBoundingClientRect(),q=ht(m),ee=H.left+(m.clientLeft+parseFloat(q.paddingLeft))*B.x,te=H.top+(m.clientTop+parseFloat(q.paddingTop))*B.y;E*=B.x,A*=B.y,M*=B.x,T*=B.y,E+=ee,A+=te,z=tt(m),m=Fn(z)}}return Hi({width:M,height:T,x:E,y:A})}function Ji(s,o){const h=Ki(s).scrollLeft;return o?o.left+h:Ai(Ot(s)).left+h}function Wr(s,o){const h=s.getBoundingClientRect(),u=h.left+o.scrollLeft-Ji(s,h),f=h.top+o.scrollTop;return{x:u,y:f}}function Ss(s){let{elements:o,rect:h,offsetParent:u,strategy:f}=s;const g=f==="fixed",v=Ot(u),y=o?qi(o.floating):!1;if(u===v||y&&g)return h;let E={scrollLeft:0,scrollTop:0},A=bt(1);const M=bt(0),T=_t(u);if((T||!T&&!g)&&((ni(u)!=="body"||Ei(v))&&(E=Ki(u)),_t(u))){const x=Ai(u);A=ti(u),M.x=x.x+u.clientLeft,M.y=x.y+u.clientTop}const I=v&&!T&&!g?Wr(v,E):bt(0);return{width:h.width*A.x,height:h.height*A.y,x:h.x*A.x-E.scrollLeft*A.x+M.x+I.x,y:h.y*A.y-E.scrollTop*A.y+M.y+I.y}}function Ms(s){return Array.from(s.getClientRects())}function Ls(s){const o=Ot(s),h=Ki(s),u=s.ownerDocument.body,f=ei(o.scrollWidth,o.clientWidth,u.scrollWidth,u.clientWidth),g=ei(o.scrollHeight,o.clientHeight,u.scrollHeight,u.clientHeight);let v=-h.scrollLeft+Ji(s);const y=-h.scrollTop;return ht(u).direction==="rtl"&&(v+=ei(o.clientWidth,u.clientWidth)-f),{width:f,height:g,x:v,y}}const Cr=25;function Is(s,o){const h=tt(s),u=Ot(s),f=h.visualViewport;let g=u.clientWidth,v=u.clientHeight,y=0,E=0;if(f){g=f.width,v=f.height;const M=Ln();(!M||M&&o==="fixed")&&(y=f.offsetLeft,E=f.offsetTop)}const A=Ji(u);if(A<=0){const M=u.ownerDocument,T=M.body,I=getComputedStyle(T),x=M.compatMode==="CSS1Compat"&&parseFloat(I.marginLeft)+parseFloat(I.marginRight)||0,z=Math.abs(u.clientWidth-T.clientWidth-x);z<=Cr&&(g-=z)}else A<=Cr&&(g+=A);return{width:g,height:v,x:y,y:E}}const Ts=new Set(["absolute","fixed"]);function Ps(s,o){const h=Ai(s,!0,o==="fixed"),u=h.top+s.clientTop,f=h.left+s.clientLeft,g=_t(s)?ti(s):bt(1),v=s.clientWidth*g.x,y=s.clientHeight*g.y,E=f*g.x,A=u*g.y;return{width:v,height:y,x:E,y:A}}function Ar(s,o,h){let u;if(o==="viewport")u=Is(s,h);else if(o==="document")u=Ls(Ot(s));else if(ct(o))u=Ps(o,h);else{const f=Dr(s);u={x:o.x-f.x,y:o.y-f.y,width:o.width,height:o.height}}return Hi(u)}function Nr(s,o){const h=Wt(s);return h===o||!ct(h)||ii(h)?!1:ht(h).position==="fixed"||Nr(h,o)}function Os(s,o){const h=o.get(s);if(h)return h;let u=jr(s,[]).filter(y=>ct(y)&&ni(y)!=="body"),f=null;const g=ht(s).position==="fixed";let v=g?Wt(s):s;for(;ct(v)&&!ii(v);){const y=ht(v),E=Mn(v);!E&&y.position==="fixed"&&(f=null),(g?!E&&!f:!E&&y.position==="static"&&!!f&&Ts.has(f.position)||Ei(v)&&!E&&Nr(s,v))?u=u.filter(M=>M!==v):f=y,v=Wt(v)}return o.set(s,u),u}function xs(s){let{element:o,boundary:h,rootBoundary:u,strategy:f}=s;const v=[...h==="clippingAncestors"?qi(o)?[]:Os(o,this._c):[].concat(h),u],y=v[0],E=v.reduce((A,M)=>{const T=Ar(o,M,f);return A.top=ei(T.top,A.top),A.right=En(T.right,A.right),A.bottom=En(T.bottom,A.bottom),A.left=ei(T.left,A.left),A},Ar(o,y,f));return{width:E.right-E.left,height:E.bottom-E.top,x:E.left,y:E.top}}function Rs(s){const{width:o,height:h}=Vr(s);return{width:o,height:h}}function js(s,o,h){const u=_t(o),f=Ot(o),g=h==="fixed",v=Ai(s,!0,g,o);let y={scrollLeft:0,scrollTop:0};const E=bt(0);function A(){E.x=Ji(f)}if(u||!u&&!g)if((ni(o)!=="body"||Ei(f))&&(y=Ki(o)),u){const x=Ai(o,!0,g,o);E.x=x.x+o.clientLeft,E.y=x.y+o.clientTop}else f&&A();g&&!u&&f&&A();const M=f&&!u&&!g?Wr(f,y):bt(0),T=v.left+y.scrollLeft-E.x-M.x,I=v.top+y.scrollTop-E.y-M.y;return{x:T,y:I,width:v.width,height:v.height}}function Cn(s){return ht(s).position==="static"}function Er(s,o){if(!_t(s)||ht(s).position==="fixed")return null;if(o)return o(s);let h=s.offsetParent;return Ot(s)===h&&(h=h.ownerDocument.body),h}function Br(s,o){const h=tt(s);if(qi(s))return h;if(!_t(s)){let f=Wt(s);for(;f&&!ii(f);){if(ct(f)&&!Cn(f))return f;f=Wt(f)}return h}let u=Er(s,o);for(;u&&gs(u)&&Cn(u);)u=Er(u,o);return u&&ii(u)&&Cn(u)&&!Mn(u)?h:u||Cs(s)||h}const Vs=async function(s){const o=this.getOffsetParent||Br,h=this.getDimensions,u=await h(s.floating);return{reference:js(s.reference,await o(s.floating),s.strategy),floating:{x:0,y:0,width:u.width,height:u.height}}};function ks(s){return ht(s).direction==="rtl"}const Ds={convertOffsetParentRelativeRectToViewportRelativeRect:Ss,getDocumentElement:Ot,getClippingRect:xs,getOffsetParent:Br,getElementRects:Vs,getClientRects:Ms,getDimensions:Rs,getScale:ti,isElement:ct,isRTL:ks},Xs=ds,Gs=ps,qs=(s,o,h)=>{const u=new Map,f={platform:Ds,...h},g={...f.platform,_c:u};return cs(s,o,{...f,platform:g})};var _i={},Ci={},Fr;function Ws(){return Fr||(Fr=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.regionAPIs=void 0,Ci.regionAPIs=new Map([["us","https://api-iam.intercom.io"],["eu","https://api-iam.eu.intercom.io"],["ap","https://api-iam.au.intercom.io"]])),Ci}var Pt={},Sr;function Ns(){if(Sr)return Pt;Sr=1;var s=Pt&&Pt.__awaiter||function(v,y,E,A){function M(T){return T instanceof E?T:new E(function(I){I(T)})}
20return new(E||(E=Promise))(function(T,I){function x(B){try{m(A.next(B))}catch(H){I(H)}}function z(B){try{m(A.throw(B))}catch(H){I(H)}}function m(B){B.done?T(B.value):M(B.value).then(x,z)}m((A=A.apply(v,y||[])).next())})};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.ref=Pt.init=void 0;const o="_intercom_npm_loader",h=function(){h.loaderQueue(arguments)};h.q=[],h.loaderQueue=function(v){h.q.push(v)};const u=function(v){var y,E,A=document;if(!A.getElementById(o)){var M=A.createElement("script");M.type="text/javascript",M.async=!0,M.id=o,M.src=v||"https://widget.intercom.io/widget/"+((y=window.intercomSettings)===null||y===void 0?void 0:y.app_id);var T=A.getElementsByTagName("script")[0];(E=T.parentNode)===null||E===void 0||E.insertBefore(M,T)}},f=()=>document.readyState==="complete"||document.readyState==="interactive",g=(...v)=>s(void 0,[...v],void 0,function*(y={}){var E=window,A=E.Intercom;E.intercomSettings&&(E.intercomSettings.installation_type="npm-package"),typeof A=="function"?(A("reattach_activator"),A("update",E.intercomSettings)):(E.Intercom=h,f()?u(y.widgetUrl):(document.addEventListener("readystatechange",function(){f()&&u(y.widgetUrl)}),E.attachEvent?E.attachEvent("onload",()=>u(y.widgetUrl)):E.addEventListener("load",()=>u(y.widgetUrl),!1)))});return Pt.init=g,Pt.ref=void 0,Pt}var Mr;function Bs(){return Mr||(Mr=1,function(s){var o=_i&&_i.__rest||function(W,Q){var Ne={};for(var ue in W)Object.prototype.hasOwnProperty.call(W,ue)&&Q.indexOf(ue)<0&&(Ne[ue]=W[ue]);if(W!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,ue=Object.getOwnPropertySymbols(W);Ie<ue.length;Ie++)Q.indexOf(ue[Ie])<0&&Object.prototype.propertyIsEnumerable.call(W,ue[Ie])&&(Ne[ue[Ie]]=W[ue[Ie]]);return Ne};Object.defineProperty(s,"__esModule",{value:!0}),s.hideNotifications=s.onUserEmailSupplied=s.showConversation=s.showTicket=s.startChecklist=s.startSurvey=s.showNews=s.showArticle=s.startTour=s.whoami=s.getVisitorId=s.trackEvent=s.onUnreadCountChange=s.onShow=s.onHide=s.showNewMessage=s.showMessages=s.showSpace=s.show=s.hide=s.update=s.shutdown=s.boot=s.Intercom=void 0;const h=Ws(),u=Ns(),f=(W,...Q)=>{if(typeof window!==void 0&&window.Intercom)return window.Intercom(W,...Q);console.warn("Please ensure Intercom is setup and running on client-side!")},g=W=>{if(typeof W!="object"){console.warn("Intercom initialiser called with invalid parameters.");return}const{region:Q="us",widgetUrl:Ne}=W,ue=o(W,["region","widgetUrl"]);typeof window<"u"&&!u.ref&&(window.intercomSettings=Object.assign(Object.assign({},ue),{api_base:h.regionAPIs.get(Q)}),(0,u.init)({widgetUrl:Ne}))};s.Intercom=g,s.default=s.Intercom;const v=W=>f("boot",W);s.boot=v;const y=()=>f("shutdown");s.shutdown=y;const E=W=>f("update",W);s.update=E;const A=()=>f("hide");s.hide=A;const M=()=>f("show");s.show=M;const T=W=>f("showSpace",W);s.showSpace=T;const I=()=>f("showMessages");s.showMessages=I;const x=W=>f("showNewMessage",W);s.showNewMessage=x;const z=W=>f("onHide",W);s.onHide=z;const m=W=>f("onShow",W);s.onShow=m;const B=W=>f("onUnreadCountChange",W);s.onUnreadCountChange=B;const H=(...W)=>f("trackEvent",...W);s.trackEvent=H;const q=()=>f("getVisitorId");s.getVisitorId=q;const ee=()=>f("whoami");s.whoami=ee;const te=W=>f("startTour",W);s.startTour=te;const ye=W=>f("showArticle",W);s.showArticle=ye;const se=W=>f("showNews",W);s.showNews=se;const Ve=W=>f("startSurvey",W);s.startSurvey=Ve;const Ye=W=>f("startChecklist",W);s.startChecklist=Ye;const k=W=>f("showTicket",W);s.showTicket=k;const $=W=>f("showConversation",W);s.showConversation=$;const le=W=>f("onUserEmailSupplied",W);s.onUserEmailSupplied=le;const _e=W=>f("hideNotifications",W);s.hideNotifications=_e}(_i)),_i}var Us=Bs();const Ks=jo(Us);export{Ks as I,Ys as J,$s as L,qs as c,Xs as o,Hs as r,Gs as s};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.