From 9841a6a8d1b3dbc2d96d39334a298fc357b6c141 Mon Sep 17 00:00:00 2001 From: eguneys Date: Tue, 30 Jan 2024 16:19:41 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20eguneys/?= =?UTF-8?q?solitaire23@ee9bf18c6a72a7723fa9428ee96b7bf85a53bf8c=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{index-575aad9a.js => index-d98b88af.js} | 36 +++++++++---------- index.html | 2 +- sw.js | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) rename assets/{index-575aad9a.js => index-d98b88af.js} (82%) diff --git a/assets/index-575aad9a.js b/assets/index-d98b88af.js similarity index 82% rename from assets/index-575aad9a.js rename to assets/index-d98b88af.js index 12084cd..a8590c9 100644 --- a/assets/index-575aad9a.js +++ b/assets/index-d98b88af.js @@ -1,4 +1,4 @@ -var Sa=Object.defineProperty;var Ma=(s,t,e)=>t in s?Sa(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var o=(s,t,e)=>(Ma(s,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const h of i)if(h.type==="childList")for(const n of h.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function e(i){const h={};return i.integrity&&(h.integrity=i.integrity),i.referrerPolicy&&(h.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?h.credentials="include":i.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function a(i){if(i.ep)return;i.ep=!0;const h=e(i);fetch(i.href,h)}})();var Fa=Object.defineProperty,za=(s,t,e)=>t in s?Fa(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,l=(s,t,e)=>(za(s,typeof t!="symbol"?t+"":t,e),e);const et={info(s){console.log(s)},warn(s){console.warn(s)},error(s){console.error(s)}},K=1e-6,Ds=1,Ps=4,Ls=8,$s=16,M=class{constructor(s,t){l(this,"x"),l(this,"y"),this.x=s,this.y=t}static get unit_x(){return M.make(1,0)}static get unit_y(){return M.make(0,1)}static get right(){return M.make(1,0)}static get up(){return M.make(0,-1)}static get down(){return M.make(0,1)}static get left(){return M.make(-1,0)}static get zero(){return M.make(0,0)}static get one(){return M.make(1,1)}add(s){return new M(this.x+s.x,this.y+s.y)}sub(s){return new M(this.x-s.x,this.y-s.y)}mul(s){return new M(this.x*s.x,this.y*s.y)}div(s){return new M(this.x/s.x,this.y/s.y)}scale(s){return new M(this.x*s,this.y*s)}add_in(s){return this.x+=s.x,this.y+=s.y,this}sub_in(s){return this.x-=s.x,this.y-=s.y,this}mul_in(s){return this.x*=s.x,this.y*=s.y,this}scale_in(s){return this.x*=s,this.y*=s,this}set_in(s){this.x=s.x,this.y=s.y}equals(s){return Math.abs(this.x-s.x)new M(s.x,s.y)),l(r,"make",(s,t)=>new M(s,t)),l(r,"dot",(s,t)=>s.x*t.x+s.y*t.y),l(r,"transform",(s,t)=>new M(s.x*t.m11+s.y*t.m21+t.m31,s.x*t.m12+s.y*t.m22+t.m32)),l(r,"transform_normal",(s,t)=>new M(s.x*t.m11+s.y*t.m21,s.x*t.m12+s.y*t.m22)),l(r,"from_angle",(s,t=1)=>new M(Math.cos(s)*t,Math.sin(s)*t)),l(r,"approach",(s,t,e)=>s.sub(t).length_squared<=e*e?t:s.add(t.sub(s).normal).scale(e)),l(r,"lerp",(s,t,e)=>e===0?s:e===1?t:s.add(t.sub(s).scale(e))),l(r,"lerp_bezier",(s,t,e,a)=>{let{lerp:i}=M;return i(i(s,t,a),i(t,e,a),a)}),l(r,"reflect",(s,t)=>{let e=s.x*t.x+s.y*t.y;return new M(s.x-2*e*t.x,s.y-2*e*t.y)}),l(r,"min",(s,t)=>new M(Math.min(s.x,t.x),Math.min(s.y,t.y))),l(r,"max",(s,t)=>new M(Math.max(s.x,t.x),Math.max(s.y,t.y)));const At=class{constructor(s,t,e){l(this,"x"),l(this,"y"),l(this,"z"),this.x=s,this.y=t,this.z=e}add(s){return new At(this.x+s.x,this.y+s.y,this.z+this.z)}sub(s){return new At(this.x-s.x,this.y-s.y,this.z-this.z)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}get normal(){let{length:s}=this;return new At(this.x/s,this.y/s,this.z/s)}};let ut=At;l(ut,"make",(s,t,e)=>new At(s,t,e)),l(ut,"dot",(s,t)=>s.x*t.x+s.y*t.y+s.z*t.z),l(ut,"cross",(s,t)=>new At(s.y*t.z-s.z*t.y,s.z*t.x-s.x*t.z,s.x*t.y-s.y*t.x));const Is=class{constructor(s,t,e,a){l(this,"x"),l(this,"y"),l(this,"z"),l(this,"w"),this.x=s,this.y=t,this.z=e,this.w=a}};let Ra=Is;l(Ra,"make",(s,t,e,a)=>new Is(s,t,e,a));const tt=class{constructor(s,t,e,a){l(this,"x"),l(this,"y"),l(this,"w"),l(this,"h"),this.x=s,this.y=t,this.w=e,this.h=a}add(s){return new tt(this.x+s.x,this.y+s.y,this.w,this.h)}sub(s){return new tt(this.x-s.x,this.y-s.y,this.w,this.h)}add_in(s){return this.x+=s.x,this.y+=s.y,this}sub_in(s){return this.x-=s.x,this.y-=s.y,this}equals(s){return Math.abs(this.x-s.x)=this.x&&s.x=this.y&&s.y=this.x&&s.x+s.w=this.y&&s.y+s.h=s.x&&this.y+this.h>=s.y&&this.x=s.x&&this.x=s.y&&this.y=this.right&&(t|=Ps),s.y=this.bottom&&(t|=$s),t}};let w=tt;l(w,"make",(s=0,t=0,e=0,a=0)=>new tt(s,t,e,a)),l(w,"transform",(s,t)=>new tt(s.x*t.m11+s.y*t.m21+t.m31,s.x*t.m12+s.y*t.m22+t.m32,s.w*t.m11+s.h*t.m21,s.w*t.m12+s.h*t.m22)),l(w,"from_points",(s,t)=>{let e=r.min(s,t),a=r.max(s,t);return new tt(e.x,e.y,a.x-e.x,a.y-e.y)});const Le=class{constructor(s,t){this.center=s,this.radius=t}project(s){let t=r.dot(this.center.sub(s.scale(this.radius)),s),e=r.dot(this.center.add(s.scale(this.radius)),s);return[t,e]}};let ps=Le;l(ps,"make_x",(s,t,e)=>new Le(r.make(s,t),e)),l(ps,"make",(s,t)=>new Le(s,t));const Wt=class{constructor(s,t){l(this,"a"),l(this,"b"),this.a=s,this.b=t}get bounds(){return w.from_points(this.a,this.b)}closest_point(s){let t=this.b.sub(this.a),e=s.sub(this.a),a=r.dot(e,t)/(t.x*t.x+t.y*t.y);return a<0?a=0:a>1&&(a=1),t.scale(a).add(this.a)}intersects_rect(s,t){let e=s.get_sector(this.a),a=s.get_sector(this.b);if(e==a||e&a)return!1;let i=e|a;return!!(i&Ls&&this.intersects_line(s.top_line,t)||i&$s&&this.intersects_line(s.bottom_line,t)||i&Ds&&this.intersects_line(s.left_line,t)||i&Ps&&this.intersects_line(s.right_line,t))}intersects_line(s,t){let e=this.b.sub(this.a),a=s.b.sub(s.a),i=e.x*a.y-e.y*a.x;if(i>-K&&i1)return!1;let _=(h.x*e.y-h.y*e.x)/i;return _<0||_>1?!1:(t&&t.set_in(e.scale(n).add(this.a)),!0)}project(s){let t=this.a.x*s.x+this.a.y*s.y,e=t,a=t;return t=this.b.x*s.x+this.b.y*s.y,e=ta?t:a,[e,a]}add(s){return new Wt(this.a.add(s),this.b.add(s))}sub(s){return new Wt(this.a.sub(s),this.b.sub(s))}};let lt=Wt;l(lt,"make_x",(s,t,e,a)=>new Wt(r.make(s,t),r.make(e,a))),l(lt,"make",(s,t)=>new Wt(s,t));const U=class{constructor(s,t,e,a,i,h){l(this,"m11"),l(this,"m12"),l(this,"m21"),l(this,"m22"),l(this,"m31"),l(this,"m32"),this.m11=s,this.m12=t,this.m21=e,this.m22=a,this.m31=i,this.m32=h}static get identity(){return new U(1,0,0,1,0,0)}mul(s){return U.mul(this,s)}add(s){return U.add(this,s)}sub(s){return U.sub(this,s)}mul_in(s){let t=U.mul(this,s);return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.m31=t.m31,this.m32=t.m32,this}get invert(){let{m11:s,m12:t,m21:e,m22:a,m31:i,m32:h}=this,n=1/(s*a-e*t);return new U(a*n,-t*n,-e*n,s*n,(e*h-i*a)*n,(i*t-s*h)*n)}get scaling_factor(){let{m11:s,m12:t,m21:e,m22:a,m31:i,m32:h}=this;return Math.sqrt(s*s+t*t)}equals(s){return Math.abs(this.m11-s.m11)new U(s,t,e,a,i,h)),l(A,"copy",s=>new U(s.m11,s.m12,s.m21,s.m22,s.m31,s.m32)),l(A,"create_translation",s=>new U(1,0,0,1,s.x,s.y)),l(A,"create_translation_x",(s,t)=>new U(1,0,0,1,s,t)),l(A,"create_scale",(s,t)=>{if(t){let e=t.x*(1-s),a=t.y*(1-s);return new U(s,0,0,s,e,a)}return new U(s,0,0,s,0,0)}),l(A,"create_scale_xy",(s,t,e)=>{if(e){let a=e.x*(1-s),i=e.y*(1-t);return new U(s,0,0,t,a,i)}return new U(s,0,0,t,0,0)}),l(A,"create_scale_v",(s,t)=>{if(t){let e=t.x*(1-s.x),a=t.y*(1-s.y);return new U(s.x,0,0,s.y,e,a)}return new U(s.x,0,0,s.y,0,0)}),l(A,"create_rotation",s=>{let t=Math.cos(s),e=Math.sin(s);return new U(t,e,-e,t,0,0)}),l(A,"create_transform",(s,t,e,a)=>{let i=U.identity;return(t.x!==0||t.y!==0)&&(i=U.create_translation_x(-t.x,-t.y)),(e.x!==1||e.y!==1)&&(i=i.mul(U.create_scale_v(e))),a!==0&&(i=i.mul(U.create_rotation(a))),(s.x!==0||s.y!==0)&&(i=i.mul(U.create_translation(s))),i}),l(A,"add",(s,t)=>new U(s.m11+t.m11,s.m12+t.m12,s.m21+t.m21,s.m22+t.m22,s.m31+t.m31,s.m32+t.m32)),l(A,"sub",(s,t)=>new U(s.m11-t.m11,s.m12-t.m12,s.m21-t.m21,s.m22-t.m22,s.m31-t.m31,s.m32-t.m32)),l(A,"mul",(s,t)=>new U(s.m11*t.m11+s.m12*t.m21,s.m11*t.m12+s.m12*t.m22,s.m21*t.m11+s.m22*t.m21,s.m21*t.m12+s.m22*t.m22,s.m31*t.m11+s.m32*t.m21+t.m31,s.m31*t.m12+s.m32*t.m22+t.m32));const _t=class{constructor(s,t,e,a,i,h,n,_,f,p,m,c,g,v,k,y){l(this,"m11"),l(this,"m12"),l(this,"m13"),l(this,"m14"),l(this,"m21"),l(this,"m22"),l(this,"m23"),l(this,"m24"),l(this,"m31"),l(this,"m32"),l(this,"m33"),l(this,"m34"),l(this,"m41"),l(this,"m42"),l(this,"m43"),l(this,"m44"),this.m11=s,this.m12=t,this.m13=e,this.m14=a,this.m21=i,this.m22=h,this.m23=n,this.m24=_,this.m31=f,this.m32=p,this.m33=m,this.m34=c,this.m41=g,this.m42=v,this.m43=k,this.m44=y}static get identity(){return new _t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}mul(s){let{m11:t,m12:e,m13:a,m14:i,m21:h,m22:n,m23:_,m24:f,m31:p,m32:m,m33:c,m34:g,m41:v,m42:k,m43:y,m44:b}=this,T=_t.identity;return T.m11=t*s.m11+e*s.m21+a*s.m31+i*s.m41,T.m12=t*s.m12+e*s.m22+a*s.m32+i*s.m42,T.m13=t*s.m13+e*s.m23+a*s.m33+i*s.m43,T.m14=t*s.m14+e*s.m24+a*s.m34+i*s.m44,T.m21=h*s.m11+n*s.m21+_*s.m31+f*s.m41,T.m22=h*s.m12+n*s.m22+_*s.m32+f*s.m42,T.m23=h*s.m13+n*s.m23+_*s.m33+f*s.m43,T.m24=h*s.m14+n*s.m24+_*s.m34+f*s.m44,T.m31=p*s.m11+m*s.m21+c*s.m31+g*s.m41,T.m32=p*s.m12+m*s.m22+c*s.m32+g*s.m42,T.m33=p*s.m13+m*s.m23+c*s.m33+g*s.m43,T.m34=p*s.m14+m*s.m24+c*s.m34+g*s.m44,T.m41=v*s.m11+k*s.m21+y*s.m31+b*s.m41,T.m42=v*s.m12+k*s.m22+y*s.m32+b*s.m42,T.m43=v*s.m13+k*s.m23+y*s.m33+b*s.m43,T.m44=v*s.m14+k*s.m24+y*s.m34+b*s.m44,T}};let ct=_t;l(ct,"create_ortho",(s,t,e,a)=>{let i=_t.identity;return i.m11=2/s,i.m12=i.m13=i.m14=0,i.m22=-2/t,i.m21=i.m23=i.m24=0,i.m33=1/(e-a),i.m31=i.m32=i.m34=0,i.m41=i.m42=0,i.m43=e/(e-a),i.m44=1,i}),l(ct,"create_ortho_offcenter",(s,t,e,a,i,h)=>{let n=_t.identity;return n.m11=2/(t-s),n.m12=n.m13=n.m14=0,n.m22=2/(a-e),n.m21=n.m23=n.m24=0,n.m33=1/(i-h),n.m31=n.m32=n.m34=0,n.m41=(s+t)/(s-t),n.m42=(a+e)/(e-a),n.m43=i/(i-h),n.m44=1,n}),l(ct,"create_perspective",(s,t,e,a)=>{let i=1/Math.tan(s*.5),h=i/t,n=_t.identity;return n.m11=h,n.m12=n.m13=n.m14=0,n.m22=i,n.m21=n.m23=n.m24=0,n.m31=n.m32=0,n.m33=a/(e-a),n.m34=-1,n.m41=n.m42=n.m44=0,n.m43=e*a/(e-a),n}),l(ct,"create_translation",(s,t,e)=>{let a=_t.identity;return a.m41=s,a.m42=t,a.m43=e,a}),l(ct,"create_scale",(s,t,e)=>{let a=_t.identity;return a.m11=s,a.m22=t,a.m33=e,a}),l(ct,"create_lookat",(s,t,e)=>{let a=s.sub(t).normal,i=ut.cross(e,a).normal,h=ut.cross(a,i),n=_t.identity;return n.m11=i.x,n.m12=h.x,n.m13=a.x,n.m14=0,n.m21=i.y,n.m22=h.y,n.m23=a.y,n.m24=0,n.m31=i.z,n.m32=h.z,n.m33=a.z,n.m34=0,n.m41=-ut.dot(i,s),n.m42=-ut.dot(h,s),n.m43=-ut.dot(a,s),n.m44=1,n});const Et=class{constructor(s,t,e,a){this.r=s,this.g=t,this.b=e,this.a=a}get rgb(){return this.r<<16|this.g<<8|this.b}};let u=Et;l(u,"hex",s=>new Et((s&16711680)>>16,(s&65280)>>8,s&255,255)),l(u,"lerp",(s,t,e)=>(e<0&&(e=0),e>1&&(e=1),new Et(s.r+(t.r-s.r)*e,s.g+(t.g-s.g)*e,s.b+(t.b-s.b)*e,s.a+(t.a-s.a)*e))),l(u,"white",new Et(255,255,255,255)),l(u,"black",new Et(0,0,0,255)),l(u,"red",new Et(255,0,0,255));const Ca=(s,t)=>s-Math.floor(s/t)*t;class Ua{constructor(){l(this,"ticks_per_second",1e3),l(this,"ticks",0),l(this,"seconds",0),l(this,"delta",0),l(this,"previous_ticks",0),l(this,"previous_seconds",0),l(this,"pause_timer",0)}pause_for(t){t>=this.pause_timer&&(this.pause_timer=t)}on_interval(t,e=0){let a=this.seconds,i=this.delta,h=Math.floor((a-e-i)/t),n=Math.floor((a-e)/t);return h=e&&a=t}}const S=new Ua,Bs=class{constructor(s){l(this,"canvas"),this.config=s}get get_draw_size(){return this.canvas?[this.canvas.width,this.canvas.height]:[this.config.width,this.config.height]}present(){}update(){}gl_context_create(){return this.canvas=document.createElement("canvas"),this.canvas.width=this.config.width,this.canvas.height=this.config.height,this.canvas.getContext("webgl2")}init(){}ready(){}};let Hs=Bs;l(Hs,"try_make_platform",s=>new Bs(s));var j=(s=>(s[s.Zero=0]="Zero",s[s.One=1]="One",s[s.SrcColor=2]="SrcColor",s[s.OneMinusSrcColor=3]="OneMinusSrcColor",s[s.DstColor=4]="DstColor",s[s.OneMinusDstColor=5]="OneMinusDstColor",s[s.SrcAlpha=6]="SrcAlpha",s[s.OneMinusSrcAlpha=7]="OneMinusSrcAlpha",s[s.DstAlpha=8]="DstAlpha",s[s.OneMinusDstAlpha=9]="OneMinusDstAlpha",s[s.ConstantColor=10]="ConstantColor",s[s.OneMinusConstantColor=11]="OneMinusConstantColor",s[s.ConstantAlpha=12]="ConstantAlpha",s[s.OneMinusConstantAlpha=13]="OneMinusConstantAlpha",s))(j||{}),It=(s=>(s[s.Add=0]="Add",s[s.Subtract=1]="Subtract",s[s.Min=2]="Min",s[s.Max=3]="Max",s))(It||{});const ie=class{constructor(s,t,e,a,i,h){this.color_op=s,this.color_src=t,this.color_dst=e,this.alpha_op=a,this.alpha_src=i,this.alpha_dst=h}};let he=ie;l(he,"Normal",new ie(0,1,7,0,1,7)),l(he,"NonPremultiplied",new ie(0,6,7,0,6,7)),l(he,"Additive",new ie(0,6,1,0,6,1));const Oa=s=>[s.m11,s.m12,s.m13,s.m14,s.m21,s.m22,s.m23,s.m24,s.m31,s.m32,s.m33,s.m34,s.m41,s.m42,s.m43,s.m44],fs=s=>{let t=0;switch(s.type){case D.Float:t=1;break;case D.Float2:t=2;break;case D.Float3:t=3;break;case D.Float4:t=4;break;case D.Mat3x2:t=9;break;case D.Mat4x4:t=16;break}return t*s.array_length};var D=(s=>(s[s.None=0]="None",s[s.Float=1]="Float",s[s.Float2=2]="Float2",s[s.Float3=3]="Float3",s[s.Float4=4]="Float4",s[s.Mat3x2=5]="Mat3x2",s[s.Mat4x4=6]="Mat4x4",s[s.Texture2D=7]="Texture2D",s[s.Sampler2D=8]="Sampler2D",s))(D||{}),re=(s=>(s[s.None=0]="None",s[s.Vertex=1]="Vertex",s[s.Fragment=2]="Fragment",s[s.Both=3]="Both",s))(re||{});class Ee{constructor(t,e,a,i=0,h=0,n=0){this.name=t,this.type=e,this.shader=a,this.register_index=i,this.buffer_index=h,this.array_length=n}}class Ye{constructor(t){l(this,"stride",0),this.attributes=t,t.forEach(e=>{switch(e.type){case L.Float:this.stride+=4;break;case L.Float2:this.stride+=8;break;case L.Float3:this.stride+=12;break;case L.Float4:this.stride+=16;break;case L.UByte4:this.stride+=4;break}})}}const js=class{constructor(){l(this,"index",0),l(this,"type",L.None),l(this,"normalized",!1)}};let ft=js;l(ft,"make",(s,t,e)=>{let a=new js;return a.index=s,a.type=t,a.normalized=e,a});var L=(s=>(s[s.None=0]="None",s[s.Float=1]="Float",s[s.Float2=2]="Float2",s[s.Float3=3]="Float3",s[s.Float4=4]="Float4",s[s.UByte4=5]="UByte4",s))(L||{}),ge=(s=>(s[s.None=0]="None",s[s.R=1]="R",s[s.RGBA=2]="RGBA",s[s.DepthStencil=3]="DepthStencil",s[s.Count=4]="Count",s))(ge||{}),Vt=(s=>(s[s.None=0]="None",s[s.Linear=1]="Linear",s[s.Nearest=2]="Nearest",s))(Vt||{}),Bt=(s=>(s[s.None=0]="None",s[s.Clamp=1]="Clamp",s[s.Repeat=2]="Repeat",s))(Bt||{});const Qe=class{constructor(s,t,e){this.filter=s,this.wrap_x=t,this.wrap_y=e}static get get_default(){return new Qe(1,2,2)}};let bt=Qe;l(bt,"make",(s=1,t=2,e=2)=>new Qe(s,t,e));const Xs=class{constructor(){}};let Ct=Xs;l(Ct,"from_image",s=>Xs.create(s.width,s.height,2,s)),l(Ct,"create",(s,t,e,a)=>{let i=d.renderer.create_texture(s,t,e);return i&&a&&i.set_data(a),i});class vt{get width(){return this.textures[0].width}get height(){return this.textures[0].height}texture(t){return this.textures[t]}}l(vt,"create",(s,t)=>d.renderer.create_target(s,t));class Qt{}l(Qt,"create",()=>d.renderer.create_mesh());class Jt{}l(Jt,"create",s=>d.renderer.create_shader(s));const Vs=class{constructor(s){l(this,"m_shader"),l(this,"m_textures",[]),l(this,"m_samplers",[]),l(this,"m_data"),this.m_shader=s;let t=s.uniforms,e=0;t.forEach(a=>{a.type!==0&&(a.type,a.type,e+=fs(a))}),this.m_data=new Float32Array(e)}get shader(){return this.m_shader}get data(){return this.m_data}get_sampler(s,t=0){}get_sampler_at(s){return this.m_samplers[s]}get_texture(s,t=0){}get_texture_at(s){return this.m_textures[s]}set_sampler_at_location(s,t){this.m_samplers[s]=t}set_texture_at_location(s,t){this.m_textures[s]=t}set_texture(s,t,e=0){let a=this.m_shader.uniforms.find(i=>i.type===7&&i.name===s);a&&(this.m_textures[a.register_index+e]=t)}set_sampler(s,t,e=0){let a=this.m_shader.uniforms.find(i=>i.type===8&&i.name===s);a&&(this.m_samplers[a.register_index+e]=t)}set_matrix(s,t){let e=0;this.m_shader.uniforms.find(a=>a.type===7||a.type===8||a.type===0?!1:a.name===s?(this.m_data.set(Oa(t),e),!0):(e+=fs(a),!1))||et.warn(`No uniform ${s} exists`)}has_value(s){return!!this.m_shader.uniforms.find(t=>t.name===s)}};let ye=Vs;l(ye,"create",s=>new Vs(s));class Je{constructor(){l(this,"target",d.backbuffer),l(this,"mesh"),l(this,"material"),l(this,"has_viewport",!1),l(this,"has_scissor",!1),l(this,"viewport",w.make()),l(this,"scissor",w.make()),l(this,"index_start",0),l(this,"index_count",0),l(this,"instance_count",0),l(this,"blend",he.Normal)}perform(){let t=this;t.target||(t.target=d.backbuffer,et.warn("Trying to draw with an invalid Target; falling back to back buffer"));let e=t.mesh.index_count;if(t.index_start+t.index_count>e){if(et.warn(`Trying to draw more indices than exists in the index buffer (${t.index_start}-${t.index_start+t.index_count} / ${e}; trimming extra indices`),t.index_start>t.index_count)return;t.index_count=t.index_count-t.index_start}let a=t.mesh.instance_count;t.instance_count>a&&(et.warn(`Trying to draw more instances than exists in the index buffer (${t.instance_count} / ${a}); trimming extra instances`),t.instance_count=a);let i=r.make(t.target.width,t.target.height);t.has_viewport?t.viewport=t.viewport.overlaps_rect(w.make(0,0,i.x,i.y)):(t.viewport.x=0,t.viewport.y=0,t.viewport.w=i.x,t.viewport.h=i.y),t.has_scissor&&(t.scissor=t.scissor.overlaps_rect(w.make(0,0,i.x,i.y))),d.renderer.render(t)}}var Na=`#version 300 es +var Aa=Object.defineProperty;var Sa=(s,t,e)=>t in s?Aa(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var o=(s,t,e)=>(Sa(s,typeof t!="symbol"?t+"":t,e),e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const h of i)if(h.type==="childList")for(const n of h.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function e(i){const h={};return i.integrity&&(h.integrity=i.integrity),i.referrerPolicy&&(h.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?h.credentials="include":i.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function a(i){if(i.ep)return;i.ep=!0;const h=e(i);fetch(i.href,h)}})();var Ma=Object.defineProperty,Fa=(s,t,e)=>t in s?Ma(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,l=(s,t,e)=>(Fa(s,typeof t!="symbol"?t+"":t,e),e);const et={info(s){console.log(s)},warn(s){console.warn(s)},error(s){console.error(s)}},K=1e-6,Ds=1,Ps=4,Ls=8,$s=16,M=class{constructor(s,t){l(this,"x"),l(this,"y"),this.x=s,this.y=t}static get unit_x(){return M.make(1,0)}static get unit_y(){return M.make(0,1)}static get right(){return M.make(1,0)}static get up(){return M.make(0,-1)}static get down(){return M.make(0,1)}static get left(){return M.make(-1,0)}static get zero(){return M.make(0,0)}static get one(){return M.make(1,1)}add(s){return new M(this.x+s.x,this.y+s.y)}sub(s){return new M(this.x-s.x,this.y-s.y)}mul(s){return new M(this.x*s.x,this.y*s.y)}div(s){return new M(this.x/s.x,this.y/s.y)}scale(s){return new M(this.x*s,this.y*s)}add_in(s){return this.x+=s.x,this.y+=s.y,this}sub_in(s){return this.x-=s.x,this.y-=s.y,this}mul_in(s){return this.x*=s.x,this.y*=s.y,this}scale_in(s){return this.x*=s,this.y*=s,this}set_in(s){this.x=s.x,this.y=s.y}equals(s){return Math.abs(this.x-s.x)new M(s.x,s.y)),l(r,"make",(s,t)=>new M(s,t)),l(r,"dot",(s,t)=>s.x*t.x+s.y*t.y),l(r,"transform",(s,t)=>new M(s.x*t.m11+s.y*t.m21+t.m31,s.x*t.m12+s.y*t.m22+t.m32)),l(r,"transform_normal",(s,t)=>new M(s.x*t.m11+s.y*t.m21,s.x*t.m12+s.y*t.m22)),l(r,"from_angle",(s,t=1)=>new M(Math.cos(s)*t,Math.sin(s)*t)),l(r,"approach",(s,t,e)=>s.sub(t).length_squared<=e*e?t:s.add(t.sub(s).normal).scale(e)),l(r,"lerp",(s,t,e)=>e===0?s:e===1?t:s.add(t.sub(s).scale(e))),l(r,"lerp_bezier",(s,t,e,a)=>{let{lerp:i}=M;return i(i(s,t,a),i(t,e,a),a)}),l(r,"reflect",(s,t)=>{let e=s.x*t.x+s.y*t.y;return new M(s.x-2*e*t.x,s.y-2*e*t.y)}),l(r,"min",(s,t)=>new M(Math.min(s.x,t.x),Math.min(s.y,t.y))),l(r,"max",(s,t)=>new M(Math.max(s.x,t.x),Math.max(s.y,t.y)));const At=class{constructor(s,t,e){l(this,"x"),l(this,"y"),l(this,"z"),this.x=s,this.y=t,this.z=e}add(s){return new At(this.x+s.x,this.y+s.y,this.z+this.z)}sub(s){return new At(this.x-s.x,this.y-s.y,this.z-this.z)}get length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}get normal(){let{length:s}=this;return new At(this.x/s,this.y/s,this.z/s)}};let ut=At;l(ut,"make",(s,t,e)=>new At(s,t,e)),l(ut,"dot",(s,t)=>s.x*t.x+s.y*t.y+s.z*t.z),l(ut,"cross",(s,t)=>new At(s.y*t.z-s.z*t.y,s.z*t.x-s.x*t.z,s.x*t.y-s.y*t.x));const Is=class{constructor(s,t,e,a){l(this,"x"),l(this,"y"),l(this,"z"),l(this,"w"),this.x=s,this.y=t,this.z=e,this.w=a}};let za=Is;l(za,"make",(s,t,e,a)=>new Is(s,t,e,a));const tt=class{constructor(s,t,e,a){l(this,"x"),l(this,"y"),l(this,"w"),l(this,"h"),this.x=s,this.y=t,this.w=e,this.h=a}add(s){return new tt(this.x+s.x,this.y+s.y,this.w,this.h)}sub(s){return new tt(this.x-s.x,this.y-s.y,this.w,this.h)}add_in(s){return this.x+=s.x,this.y+=s.y,this}sub_in(s){return this.x-=s.x,this.y-=s.y,this}equals(s){return Math.abs(this.x-s.x)=this.x&&s.x=this.y&&s.y=this.x&&s.x+s.w=this.y&&s.y+s.h=s.x&&this.y+this.h>=s.y&&this.x=s.x&&this.x=s.y&&this.y=this.right&&(t|=Ps),s.y=this.bottom&&(t|=$s),t}};let w=tt;l(w,"make",(s=0,t=0,e=0,a=0)=>new tt(s,t,e,a)),l(w,"transform",(s,t)=>new tt(s.x*t.m11+s.y*t.m21+t.m31,s.x*t.m12+s.y*t.m22+t.m32,s.w*t.m11+s.h*t.m21,s.w*t.m12+s.h*t.m22)),l(w,"from_points",(s,t)=>{let e=r.min(s,t),a=r.max(s,t);return new tt(e.x,e.y,a.x-e.x,a.y-e.y)});const Le=class{constructor(s,t){this.center=s,this.radius=t}project(s){let t=r.dot(this.center.sub(s.scale(this.radius)),s),e=r.dot(this.center.add(s.scale(this.radius)),s);return[t,e]}};let ps=Le;l(ps,"make_x",(s,t,e)=>new Le(r.make(s,t),e)),l(ps,"make",(s,t)=>new Le(s,t));const qt=class{constructor(s,t){l(this,"a"),l(this,"b"),this.a=s,this.b=t}get bounds(){return w.from_points(this.a,this.b)}closest_point(s){let t=this.b.sub(this.a),e=s.sub(this.a),a=r.dot(e,t)/(t.x*t.x+t.y*t.y);return a<0?a=0:a>1&&(a=1),t.scale(a).add(this.a)}intersects_rect(s,t){let e=s.get_sector(this.a),a=s.get_sector(this.b);if(e==a||e&a)return!1;let i=e|a;return!!(i&Ls&&this.intersects_line(s.top_line,t)||i&$s&&this.intersects_line(s.bottom_line,t)||i&Ds&&this.intersects_line(s.left_line,t)||i&Ps&&this.intersects_line(s.right_line,t))}intersects_line(s,t){let e=this.b.sub(this.a),a=s.b.sub(s.a),i=e.x*a.y-e.y*a.x;if(i>-K&&i1)return!1;let _=(h.x*e.y-h.y*e.x)/i;return _<0||_>1?!1:(t&&t.set_in(e.scale(n).add(this.a)),!0)}project(s){let t=this.a.x*s.x+this.a.y*s.y,e=t,a=t;return t=this.b.x*s.x+this.b.y*s.y,e=ta?t:a,[e,a]}add(s){return new qt(this.a.add(s),this.b.add(s))}sub(s){return new qt(this.a.sub(s),this.b.sub(s))}};let lt=qt;l(lt,"make_x",(s,t,e,a)=>new qt(r.make(s,t),r.make(e,a))),l(lt,"make",(s,t)=>new qt(s,t));const O=class{constructor(s,t,e,a,i,h){l(this,"m11"),l(this,"m12"),l(this,"m21"),l(this,"m22"),l(this,"m31"),l(this,"m32"),this.m11=s,this.m12=t,this.m21=e,this.m22=a,this.m31=i,this.m32=h}static get identity(){return new O(1,0,0,1,0,0)}mul(s){return O.mul(this,s)}add(s){return O.add(this,s)}sub(s){return O.sub(this,s)}mul_in(s){let t=O.mul(this,s);return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.m31=t.m31,this.m32=t.m32,this}get invert(){let{m11:s,m12:t,m21:e,m22:a,m31:i,m32:h}=this,n=1/(s*a-e*t);return new O(a*n,-t*n,-e*n,s*n,(e*h-i*a)*n,(i*t-s*h)*n)}get scaling_factor(){let{m11:s,m12:t,m21:e,m22:a,m31:i,m32:h}=this;return Math.sqrt(s*s+t*t)}equals(s){return Math.abs(this.m11-s.m11)new O(s,t,e,a,i,h)),l(A,"copy",s=>new O(s.m11,s.m12,s.m21,s.m22,s.m31,s.m32)),l(A,"create_translation",s=>new O(1,0,0,1,s.x,s.y)),l(A,"create_translation_x",(s,t)=>new O(1,0,0,1,s,t)),l(A,"create_scale",(s,t)=>{if(t){let e=t.x*(1-s),a=t.y*(1-s);return new O(s,0,0,s,e,a)}return new O(s,0,0,s,0,0)}),l(A,"create_scale_xy",(s,t,e)=>{if(e){let a=e.x*(1-s),i=e.y*(1-t);return new O(s,0,0,t,a,i)}return new O(s,0,0,t,0,0)}),l(A,"create_scale_v",(s,t)=>{if(t){let e=t.x*(1-s.x),a=t.y*(1-s.y);return new O(s.x,0,0,s.y,e,a)}return new O(s.x,0,0,s.y,0,0)}),l(A,"create_rotation",s=>{let t=Math.cos(s),e=Math.sin(s);return new O(t,e,-e,t,0,0)}),l(A,"create_transform",(s,t,e,a)=>{let i=O.identity;return(t.x!==0||t.y!==0)&&(i=O.create_translation_x(-t.x,-t.y)),(e.x!==1||e.y!==1)&&(i=i.mul(O.create_scale_v(e))),a!==0&&(i=i.mul(O.create_rotation(a))),(s.x!==0||s.y!==0)&&(i=i.mul(O.create_translation(s))),i}),l(A,"add",(s,t)=>new O(s.m11+t.m11,s.m12+t.m12,s.m21+t.m21,s.m22+t.m22,s.m31+t.m31,s.m32+t.m32)),l(A,"sub",(s,t)=>new O(s.m11-t.m11,s.m12-t.m12,s.m21-t.m21,s.m22-t.m22,s.m31-t.m31,s.m32-t.m32)),l(A,"mul",(s,t)=>new O(s.m11*t.m11+s.m12*t.m21,s.m11*t.m12+s.m12*t.m22,s.m21*t.m11+s.m22*t.m21,s.m21*t.m12+s.m22*t.m22,s.m31*t.m11+s.m32*t.m21+t.m31,s.m31*t.m12+s.m32*t.m22+t.m32));const _t=class{constructor(s,t,e,a,i,h,n,_,f,p,m,c,g,v,k,y){l(this,"m11"),l(this,"m12"),l(this,"m13"),l(this,"m14"),l(this,"m21"),l(this,"m22"),l(this,"m23"),l(this,"m24"),l(this,"m31"),l(this,"m32"),l(this,"m33"),l(this,"m34"),l(this,"m41"),l(this,"m42"),l(this,"m43"),l(this,"m44"),this.m11=s,this.m12=t,this.m13=e,this.m14=a,this.m21=i,this.m22=h,this.m23=n,this.m24=_,this.m31=f,this.m32=p,this.m33=m,this.m34=c,this.m41=g,this.m42=v,this.m43=k,this.m44=y}static get identity(){return new _t(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}mul(s){let{m11:t,m12:e,m13:a,m14:i,m21:h,m22:n,m23:_,m24:f,m31:p,m32:m,m33:c,m34:g,m41:v,m42:k,m43:y,m44:b}=this,T=_t.identity;return T.m11=t*s.m11+e*s.m21+a*s.m31+i*s.m41,T.m12=t*s.m12+e*s.m22+a*s.m32+i*s.m42,T.m13=t*s.m13+e*s.m23+a*s.m33+i*s.m43,T.m14=t*s.m14+e*s.m24+a*s.m34+i*s.m44,T.m21=h*s.m11+n*s.m21+_*s.m31+f*s.m41,T.m22=h*s.m12+n*s.m22+_*s.m32+f*s.m42,T.m23=h*s.m13+n*s.m23+_*s.m33+f*s.m43,T.m24=h*s.m14+n*s.m24+_*s.m34+f*s.m44,T.m31=p*s.m11+m*s.m21+c*s.m31+g*s.m41,T.m32=p*s.m12+m*s.m22+c*s.m32+g*s.m42,T.m33=p*s.m13+m*s.m23+c*s.m33+g*s.m43,T.m34=p*s.m14+m*s.m24+c*s.m34+g*s.m44,T.m41=v*s.m11+k*s.m21+y*s.m31+b*s.m41,T.m42=v*s.m12+k*s.m22+y*s.m32+b*s.m42,T.m43=v*s.m13+k*s.m23+y*s.m33+b*s.m43,T.m44=v*s.m14+k*s.m24+y*s.m34+b*s.m44,T}};let ct=_t;l(ct,"create_ortho",(s,t,e,a)=>{let i=_t.identity;return i.m11=2/s,i.m12=i.m13=i.m14=0,i.m22=-2/t,i.m21=i.m23=i.m24=0,i.m33=1/(e-a),i.m31=i.m32=i.m34=0,i.m41=i.m42=0,i.m43=e/(e-a),i.m44=1,i}),l(ct,"create_ortho_offcenter",(s,t,e,a,i,h)=>{let n=_t.identity;return n.m11=2/(t-s),n.m12=n.m13=n.m14=0,n.m22=2/(a-e),n.m21=n.m23=n.m24=0,n.m33=1/(i-h),n.m31=n.m32=n.m34=0,n.m41=(s+t)/(s-t),n.m42=(a+e)/(e-a),n.m43=i/(i-h),n.m44=1,n}),l(ct,"create_perspective",(s,t,e,a)=>{let i=1/Math.tan(s*.5),h=i/t,n=_t.identity;return n.m11=h,n.m12=n.m13=n.m14=0,n.m22=i,n.m21=n.m23=n.m24=0,n.m31=n.m32=0,n.m33=a/(e-a),n.m34=-1,n.m41=n.m42=n.m44=0,n.m43=e*a/(e-a),n}),l(ct,"create_translation",(s,t,e)=>{let a=_t.identity;return a.m41=s,a.m42=t,a.m43=e,a}),l(ct,"create_scale",(s,t,e)=>{let a=_t.identity;return a.m11=s,a.m22=t,a.m33=e,a}),l(ct,"create_lookat",(s,t,e)=>{let a=s.sub(t).normal,i=ut.cross(e,a).normal,h=ut.cross(a,i),n=_t.identity;return n.m11=i.x,n.m12=h.x,n.m13=a.x,n.m14=0,n.m21=i.y,n.m22=h.y,n.m23=a.y,n.m24=0,n.m31=i.z,n.m32=h.z,n.m33=a.z,n.m34=0,n.m41=-ut.dot(i,s),n.m42=-ut.dot(h,s),n.m43=-ut.dot(a,s),n.m44=1,n});const Et=class{constructor(s,t,e,a){this.r=s,this.g=t,this.b=e,this.a=a}get rgb(){return this.r<<16|this.g<<8|this.b}};let u=Et;l(u,"hex",s=>new Et((s&16711680)>>16,(s&65280)>>8,s&255,255)),l(u,"lerp",(s,t,e)=>(e<0&&(e=0),e>1&&(e=1),new Et(s.r+(t.r-s.r)*e,s.g+(t.g-s.g)*e,s.b+(t.b-s.b)*e,s.a+(t.a-s.a)*e))),l(u,"white",new Et(255,255,255,255)),l(u,"black",new Et(0,0,0,255)),l(u,"red",new Et(255,0,0,255));const Ra=(s,t)=>s-Math.floor(s/t)*t;class Ca{constructor(){l(this,"ticks_per_second",1e3),l(this,"ticks",0),l(this,"seconds",0),l(this,"delta",0),l(this,"previous_ticks",0),l(this,"previous_seconds",0),l(this,"pause_timer",0)}pause_for(t){t>=this.pause_timer&&(this.pause_timer=t)}on_interval(t,e=0){let a=this.seconds,i=this.delta,h=Math.floor((a-e-i)/t),n=Math.floor((a-e)/t);return h=e&&a=t}}const S=new Ca,Bs=class{constructor(s){l(this,"canvas"),this.config=s}get get_draw_size(){return this.canvas?[this.canvas.width,this.canvas.height]:[this.config.width,this.config.height]}present(){}update(){}gl_context_create(){return this.canvas=document.createElement("canvas"),this.canvas.width=this.config.width,this.canvas.height=this.config.height,this.canvas.getContext("webgl2")}init(){}ready(){}};let Hs=Bs;l(Hs,"try_make_platform",s=>new Bs(s));var j=(s=>(s[s.Zero=0]="Zero",s[s.One=1]="One",s[s.SrcColor=2]="SrcColor",s[s.OneMinusSrcColor=3]="OneMinusSrcColor",s[s.DstColor=4]="DstColor",s[s.OneMinusDstColor=5]="OneMinusDstColor",s[s.SrcAlpha=6]="SrcAlpha",s[s.OneMinusSrcAlpha=7]="OneMinusSrcAlpha",s[s.DstAlpha=8]="DstAlpha",s[s.OneMinusDstAlpha=9]="OneMinusDstAlpha",s[s.ConstantColor=10]="ConstantColor",s[s.OneMinusConstantColor=11]="OneMinusConstantColor",s[s.ConstantAlpha=12]="ConstantAlpha",s[s.OneMinusConstantAlpha=13]="OneMinusConstantAlpha",s))(j||{}),Bt=(s=>(s[s.Add=0]="Add",s[s.Subtract=1]="Subtract",s[s.Min=2]="Min",s[s.Max=3]="Max",s))(Bt||{});const ie=class{constructor(s,t,e,a,i,h){this.color_op=s,this.color_src=t,this.color_dst=e,this.alpha_op=a,this.alpha_src=i,this.alpha_dst=h}};let he=ie;l(he,"Normal",new ie(0,1,7,0,1,7)),l(he,"NonPremultiplied",new ie(0,6,7,0,6,7)),l(he,"Additive",new ie(0,6,1,0,6,1));const Ua=s=>[s.m11,s.m12,s.m13,s.m14,s.m21,s.m22,s.m23,s.m24,s.m31,s.m32,s.m33,s.m34,s.m41,s.m42,s.m43,s.m44],fs=s=>{let t=0;switch(s.type){case D.Float:t=1;break;case D.Float2:t=2;break;case D.Float3:t=3;break;case D.Float4:t=4;break;case D.Mat3x2:t=9;break;case D.Mat4x4:t=16;break}return t*s.array_length};var D=(s=>(s[s.None=0]="None",s[s.Float=1]="Float",s[s.Float2=2]="Float2",s[s.Float3=3]="Float3",s[s.Float4=4]="Float4",s[s.Mat3x2=5]="Mat3x2",s[s.Mat4x4=6]="Mat4x4",s[s.Texture2D=7]="Texture2D",s[s.Sampler2D=8]="Sampler2D",s))(D||{}),re=(s=>(s[s.None=0]="None",s[s.Vertex=1]="Vertex",s[s.Fragment=2]="Fragment",s[s.Both=3]="Both",s))(re||{});class Ee{constructor(t,e,a,i=0,h=0,n=0){this.name=t,this.type=e,this.shader=a,this.register_index=i,this.buffer_index=h,this.array_length=n}}class Ye{constructor(t){l(this,"stride",0),this.attributes=t,t.forEach(e=>{switch(e.type){case L.Float:this.stride+=4;break;case L.Float2:this.stride+=8;break;case L.Float3:this.stride+=12;break;case L.Float4:this.stride+=16;break;case L.UByte4:this.stride+=4;break}})}}const js=class{constructor(){l(this,"index",0),l(this,"type",L.None),l(this,"normalized",!1)}};let ft=js;l(ft,"make",(s,t,e)=>{let a=new js;return a.index=s,a.type=t,a.normalized=e,a});var L=(s=>(s[s.None=0]="None",s[s.Float=1]="Float",s[s.Float2=2]="Float2",s[s.Float3=3]="Float3",s[s.Float4=4]="Float4",s[s.UByte4=5]="UByte4",s))(L||{}),ge=(s=>(s[s.None=0]="None",s[s.R=1]="R",s[s.RGBA=2]="RGBA",s[s.DepthStencil=3]="DepthStencil",s[s.Count=4]="Count",s))(ge||{}),Kt=(s=>(s[s.None=0]="None",s[s.Linear=1]="Linear",s[s.Nearest=2]="Nearest",s))(Kt||{}),Ht=(s=>(s[s.None=0]="None",s[s.Clamp=1]="Clamp",s[s.Repeat=2]="Repeat",s))(Ht||{});const Qe=class{constructor(s,t,e){this.filter=s,this.wrap_x=t,this.wrap_y=e}static get get_default(){return new Qe(1,2,2)}};let bt=Qe;l(bt,"make",(s=1,t=2,e=2)=>new Qe(s,t,e));const Xs=class{constructor(){}};let Ct=Xs;l(Ct,"from_image",s=>Xs.create(s.width,s.height,2,s)),l(Ct,"create",(s,t,e,a)=>{let i=d.renderer.create_texture(s,t,e);return i&&a&&i.set_data(a),i});class vt{get width(){return this.textures[0].width}get height(){return this.textures[0].height}texture(t){return this.textures[t]}}l(vt,"create",(s,t)=>d.renderer.create_target(s,t));class Jt{}l(Jt,"create",()=>d.renderer.create_mesh());class Zt{}l(Zt,"create",s=>d.renderer.create_shader(s));const Vs=class{constructor(s){l(this,"m_shader"),l(this,"m_textures",[]),l(this,"m_samplers",[]),l(this,"m_data"),this.m_shader=s;let t=s.uniforms,e=0;t.forEach(a=>{a.type!==0&&(a.type,a.type,e+=fs(a))}),this.m_data=new Float32Array(e)}get shader(){return this.m_shader}get data(){return this.m_data}get_sampler(s,t=0){}get_sampler_at(s){return this.m_samplers[s]}get_texture(s,t=0){}get_texture_at(s){return this.m_textures[s]}set_sampler_at_location(s,t){this.m_samplers[s]=t}set_texture_at_location(s,t){this.m_textures[s]=t}set_texture(s,t,e=0){let a=this.m_shader.uniforms.find(i=>i.type===7&&i.name===s);a&&(this.m_textures[a.register_index+e]=t)}set_sampler(s,t,e=0){let a=this.m_shader.uniforms.find(i=>i.type===8&&i.name===s);a&&(this.m_samplers[a.register_index+e]=t)}set_matrix(s,t){let e=0;this.m_shader.uniforms.find(a=>a.type===7||a.type===8||a.type===0?!1:a.name===s?(this.m_data.set(Ua(t),e),!0):(e+=fs(a),!1))||et.warn(`No uniform ${s} exists`)}has_value(s){return!!this.m_shader.uniforms.find(t=>t.name===s)}};let ye=Vs;l(ye,"create",s=>new Vs(s));class Je{constructor(){l(this,"target",d.backbuffer),l(this,"mesh"),l(this,"material"),l(this,"has_viewport",!1),l(this,"has_scissor",!1),l(this,"viewport",w.make()),l(this,"scissor",w.make()),l(this,"index_start",0),l(this,"index_count",0),l(this,"instance_count",0),l(this,"blend",he.Normal)}perform(){let t=this;t.target||(t.target=d.backbuffer,et.warn("Trying to draw with an invalid Target; falling back to back buffer"));let e=t.mesh.index_count;if(t.index_start+t.index_count>e){if(et.warn(`Trying to draw more indices than exists in the index buffer (${t.index_start}-${t.index_start+t.index_count} / ${e}; trimming extra indices`),t.index_start>t.index_count)return;t.index_count=t.index_count-t.index_start}let a=t.mesh.instance_count;t.instance_count>a&&(et.warn(`Trying to draw more instances than exists in the index buffer (${t.instance_count} / ${a}); trimming extra instances`),t.instance_count=a);let i=r.make(t.target.width,t.target.height);t.has_viewport?t.viewport=t.viewport.overlaps_rect(w.make(0,0,i.x,i.y)):(t.viewport.x=0,t.viewport.y=0,t.viewport.w=i.x,t.viewport.h=i.y),t.has_scissor&&(t.scissor=t.scissor.overlaps_rect(w.make(0,0,i.x,i.y))),d.renderer.render(t)}}var Oa=`#version 300 es uniform mat4 u_matrix; layout(location=0) in vec2 a_position; layout(location=1) in vec2 a_tex; @@ -13,7 +13,7 @@ void main(void) { v_tex = a_tex; v_col = a_color; v_type = a_type; -}`,Da=`#version 300 es +}`,Na=`#version 300 es precision mediump float; uniform sampler2D u_texture; @@ -28,11 +28,11 @@ void main(void) { v_type.x * color * v_col + v_type.y * color.a * v_col + v_type.z * v_col; -}`;const Pa=[Na,Da];class La extends Jt{constructor(t){super(),l(this,"m_id"),l(this,"m_uniforms",[]),l(this,"uniform_locations",[]),this.data=t;let e=d.renderer.gl.createShader(d.renderer.gl.VERTEX_SHADER);{d.renderer.gl.shaderSource(e,t[0]),d.renderer.gl.compileShader(e);let n=d.renderer.gl.getShaderInfoLog(e);if(n){et.error(n);return}}let a=d.renderer.gl.createShader(d.renderer.gl.FRAGMENT_SHADER);{d.renderer.gl.shaderSource(a,t[1]),d.renderer.gl.compileShader(a);let n=d.renderer.gl.getShaderInfoLog(a);if(n&&n.length>0){et.error(n);return}}let i=d.renderer.gl.createProgram();d.renderer.gl.attachShader(i,e),d.renderer.gl.attachShader(i,a),d.renderer.gl.linkProgram(i);let h=d.renderer.gl.getProgramInfoLog(i);if(d.renderer.gl.deleteShader(e),d.renderer.gl.deleteShader(a),h&&h.length>0){et.error(h);return}{let n=d.renderer.gl.getProgramParameter(i,d.renderer.gl.ACTIVE_UNIFORMS),_=0;for(let f=0;f{let _=d.renderer.gl.UNSIGNED_BYTE,f=0,p=1;n.type===L.Float&&(_=d.renderer.gl.FLOAT,f=4,p=1),n.type===L.Float2&&(_=d.renderer.gl.FLOAT,f=4,p=2),n.type===L.Float3&&(_=d.renderer.gl.FLOAT,f=4,p=3),n.type===L.Float4&&(_=d.renderer.gl.FLOAT,f=4,p=4),n.type===L.UByte4&&(_=d.renderer.gl.UNSIGNED_BYTE,f=1,p=4);let m=n.index;d.renderer.gl.enableVertexAttribArray(m),d.renderer.gl.vertexAttribPointer(m,p,_,n.normalized,a.stride,h),d.renderer.gl.vertexAttribDivisor(m,i),h+=p*f}),a.stride}}class Ia extends vt{constructor(t,e,a){super(),l(this,"m_id"),l(this,"m_attachments"),l(this,"m_width"),l(this,"m_height"),this.m_attachments=[],this.m_id=d.renderer.gl.createFramebuffer(),this.m_width=t,this.m_height=e,d.renderer.gl.bindFramebuffer(d.renderer.gl.FRAMEBUFFER,this.m_id),a.forEach((i,h)=>{let n=Ct.create(t,e,i);n.framebuffer_parent=!0,this.m_attachments.push(n),i!==ge.DepthStencil?d.renderer.gl.framebufferTexture2D(d.renderer.gl.FRAMEBUFFER,d.renderer.gl.COLOR_ATTACHMENT0+h,d.renderer.gl.TEXTURE_2D,n.gl_id,0):d.renderer.gl.framebufferTexture2D(d.renderer.gl.FRAMEBUFFER,d.renderer.gl.DEPTH_STENCIL_ATTACHMENT,d.renderer.gl.TEXTURE_2D,n.gl_id,0)})}get gl_id(){return this.m_id}get textures(){return this.m_attachments}clear(t,e=1,a=0){d.renderer.clear_backbuffer(t,e,a,this.m_id)}}class Ba extends Ct{constructor(t,e,a){super(),l(this,"m_id"),l(this,"m_width"),l(this,"m_height"),l(this,"m_sampler"),l(this,"m_format"),l(this,"m_gl_internal_format"),l(this,"m_gl_format"),l(this,"m_gl_type"),l(this,"framebuffer_parent"),this.m_id=0,this.m_width=t,this.m_height=e,this.m_sampler=new bt(Vt.None,Bt.None,Bt.None),this.m_format=a,this.framebuffer_parent=!1,this.m_gl_internal_format=d.renderer.gl.RED,this.m_gl_format=d.renderer.gl.RED,this.m_gl_type=d.renderer.gl.UNSIGNED_BYTE,a===ge.RGBA?(this.m_gl_internal_format=d.renderer.gl.RGBA,this.m_gl_format=d.renderer.gl.RGBA,this.m_gl_type=d.renderer.gl.UNSIGNED_BYTE):et.error(`Unsupported Texture format ${a}`),this.m_id=d.renderer.gl.createTexture(),d.renderer.gl.activeTexture(d.renderer.gl.TEXTURE0),d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texImage2D(d.renderer.gl.TEXTURE_2D,0,this.m_gl_internal_format,t,e,0,this.m_gl_format,this.m_gl_type,null)}get is_framebuffer(){return this.framebuffer_parent}get width(){return this.m_width}get height(){return this.m_height}set_data(t){d.renderer.gl.activeTexture(d.renderer.gl.TEXTURE0),d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texImage2D(d.renderer.gl.TEXTURE_2D,0,this.m_gl_internal_format,this.m_width,this.m_height,0,this.m_gl_format,this.m_gl_type,t)}update_sampler(t){this.m_sampler!==t&&(this.m_sampler=t,d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_MIN_FILTER,this.m_sampler.filter===Vt.Nearest?d.renderer.gl.NEAREST:d.renderer.gl.LINEAR),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_MAG_FILTER,this.m_sampler.filter===Vt.Nearest?d.renderer.gl.NEAREST:d.renderer.gl.LINEAR),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_WRAP_S,this.m_sampler.wrap_x===Bt.Clamp?d.renderer.gl.CLAMP_TO_EDGE:d.renderer.gl.REPEAT),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_WRAP_T,this.m_sampler.wrap_y===Bt.Clamp?d.renderer.gl.CLAMP_TO_EDGE:d.renderer.gl.REPEAT))}get gl_id(){return this.m_id}}const Ks=class{constructor(){l(this,"origin_bottom_left",!0),l(this,"gl"),l(this,"default_batcher_shader")}get get_draw_size(){}create_shader(s){return new La(s)}create_target(s,t){return new Ia(s,t,[ge.RGBA])}create_texture(s,t,e){return new Ba(s,t,e)}create_mesh(){return new $a}update(){}init(){let s=d.platform.gl_context_create();return s===null?(et.error("Failed to create WebGL Context"),!1):(this.gl=s,et.info("WebGL2"),this.gl.pixelStorei(this.gl.PACK_ALIGNMENT,1),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1),this.default_batcher_shader=Jt.create(Pa),!0)}render(s){if(s.target===d.backbuffer)this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null);else if(s.target){let p=s.target;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,p.gl_id)}let t=r.make(s.target.width,s.target.height),e=s.material.shader,a=s.mesh;this.gl.useProgram(e.gl_id);let i=0,h=[],n=e.uniforms,_=s.material.data,f=0;n.forEach((p,m)=>{let c=e.uniform_locations[m];if(p.type!==D.Sampler2D){if(p.type===D.Texture2D){for(let g=0;g0?this.gl.drawElementsInstanced(this.gl.TRIANGLES,s.index_count,p,m*s.index_start,s.instance_count):this.gl.drawElements(this.gl.TRIANGLES,s.index_count,p,m*s.index_start)}this.gl.bindVertexArray(null)}clear_backbuffer(s,t,e,a=null){this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a),this.gl.disable(this.gl.SCISSOR_TEST);let i=0;i|=this.gl.COLOR_BUFFER_BIT,this.gl.colorMask(!0,!0,!0,!0),this.gl.clearColor(s.r/255,s.g/255,s.b/255,s.a/255),this.gl.clear(i)}before_render(){}after_render(){}};let Ws=Ks;l(Ws,"try_make_renderer",()=>new Ks);const ms=s=>{switch(s){case It.Add:return d.renderer.gl.FUNC_ADD;case It.Subtract:return d.renderer.gl.FUNC_SUBTRACT;case It.Min:return d.renderer.gl.MIN;case It.Max:return d.renderer.gl.MAX;default:return d.renderer.gl.FUNC_ADD}},se=s=>{switch(s){case j.Zero:return d.renderer.gl.ZERO;case j.One:return d.renderer.gl.ONE;case j.SrcColor:return d.renderer.gl.SRC_COLOR;case j.OneMinusSrcColor:return d.renderer.gl.ONE_MINUS_SRC_COLOR;case j.DstColor:return d.renderer.gl.DST_COLOR;case j.OneMinusDstColor:return d.renderer.gl.ONE_MINUS_DST_COLOR;case j.SrcAlpha:return d.renderer.gl.SRC_ALPHA;case j.OneMinusSrcAlpha:return d.renderer.gl.ONE_MINUS_SRC_ALPHA;case j.DstAlpha:return d.renderer.gl.DST_ALPHA;case j.OneMinusDstAlpha:return d.renderer.gl.ONE_MINUS_DST_ALPHA;case j.ConstantColor:return d.renderer.gl.CONSTANT_COLOR;case j.ConstantAlpha:return d.renderer.gl.CONSTANT_ALPHA;case j.OneMinusConstantColor:return d.renderer.gl.ONE_MINUS_CONSTANT_COLOR;case j.OneMinusConstantAlpha:return d.renderer.gl.ONE_MINUS_CONSTANT_ALPHA;default:return d.renderer.gl.ZERO}},gs=()=>d.renderer.get_draw_size||d.platform.get_draw_size,qs=class extends vt{get width(){return gs()[0]}get height(){return gs()[1]}get textures(){return qs.empty_textures}clear(s,t,e){d.renderer.clear_backbuffer(s,t,e)}};let Gs=qs;l(Gs,"empty_textures",[]);class Ha{constructor(){l(this,"platform"),l(this,"renderer"),l(this,"backbuffer"),l(this,"config"),l(this,"app_time_last",0),l(this,"app_time_accumulator",0)}get canvas(){return this.platform.canvas}run(t){var e,a;this.config=t,this.backbuffer=new Gs,this.platform=Hs.try_make_platform(this.config),this.platform.init(),this.renderer=Ws.try_make_renderer(),this.renderer.init(),this.platform.update(),(a=(e=this.config).on_startup)==null||a.call(e),this.app_time_accumulator=0,this.platform.ready(),this.begin_iterate()}begin_iterate(){const t=()=>{var a,i;this.platform.update(),this.renderer.update(),(i=(a=this.config).on_update)==null||i.call(a)},e=a=>{var i,h;let n=.016666666666666666*S.ticks_per_second,_=a-this.app_time_last;for(this.app_time_last=a,this.app_time_accumulator+=_;this.app_time_accumulator>=n;){if(this.app_time_accumulator-=n,S.delta=.016666666666666666,S.pause_timer>0)if(S.pause_timer-=S.delta,S.pause_timer<=-1e-4)S.delta=-S.pause_timer;else continue;S.previous_ticks=S.ticks,S.ticks+=n,S.previous_seconds=S.seconds,S.seconds+=S.delta,t()}this.renderer.before_render(),(h=(i=this.config).on_render)==null||h.call(i),this.renderer.after_render(),this.platform.present(),requestAnimationFrame(e)};requestAnimationFrame(e)}}const d=new Ha,ys="u_texture",us="u_texture_sampler",ja="u_matrix",ws=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1),ft.make(2,L.UByte4,!0),ft.make(3,L.UByte4,!0)]);class Ze{constructor(){l(this,"layer",0),l(this,"offset",0),l(this,"elements",0),l(this,"material"),l(this,"texture"),l(this,"sampler",bt.get_default),l(this,"scissor",w.make(0,0,-1,-1)),l(this,"flip_vertically",!1)}get clone(){let t=new Ze;return t.layer=this.layer,t.offset=this.offset,t.elements=this.elements,t.material=this.material,t.texture=this.texture,t.sampler=this.sampler,t.scissor=this.scissor,t.flip_vertically=this.flip_vertically,t}}class Xa{constructor(){l(this,"m_default_material"),l(this,"m_mesh"),l(this,"m_batch",new Ze),l(this,"m_matrix",A.identity),l(this,"m_tex_mult",255),l(this,"m_tex_wash",0),l(this,"m_vertices",[]),l(this,"m_indices",[]),l(this,"m_matrix_stack",[]),l(this,"m_scissor_stack",[]),l(this,"m_material_stack",[]),l(this,"m_batches",[]),l(this,"m_batch_insert",0),l(this,"integerize",!1),l(this,"default_sampler",bt.get_default)}push_matrix(t,e=!1){this.m_matrix_stack.push(this.m_matrix),e?this.m_matrix=t:this.m_matrix=t.mul(this.m_matrix)}pop_matrix(){let t=this.m_matrix;return this.m_matrix=this.m_matrix_stack.pop(),t}peek_matrix(){return this.m_matrix}push_scissor(t){this.m_scissor_stack.push(this.m_batch.scissor),this.m_batch.elements>0&&t!==this.m_batch.scissor&&this.INSERT_BATCH(),this.m_batch.scissor=t}pop_scissor(){let t=this.m_batch.scissor,e=this.m_scissor_stack.pop();return this.m_batch.elements>0&&e!==this.m_batch.scissor&&this.INSERT_BATCH(),this.m_batch.scissor=e??w.make(0,0,-1,-1),t}peek_scissor(){}push_material(t){}pop_material(){}peek_material(){}set_texture(t){this.m_batch.elements>0&&t!==this.m_batch.texture&&this.INSERT_BATCH(),this.m_batch.texture!==t&&(this.m_batch.texture=t,this.m_batch.flip_vertically=d.renderer.origin_bottom_left&&t&&t.is_framebuffer)}set_sampler(t){console.log(t)}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){if(this.m_batches.length<=0&&this.m_batch.elements<=0||this.m_indices.length<=0)return;this.m_mesh||(this.m_mesh=Qt.create()),this.m_default_material||(this.m_default_material=ye.create(d.renderer.default_batcher_shader));let a=ws.stride,i=new ArrayBuffer(a*this.m_vertices.length),h=new DataView(i);this.m_vertices.reduce((_,f)=>f.push_to(h,_),0),this.m_mesh.index_data(this.m_indices),this.m_mesh.vertex_data(ws,i);let n=new Je;n.target=t,n.mesh=this.m_mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,this.m_batches.forEach((_,f)=>{this.render_single_batch(n,_,e)}),this.m_batch.elements>0&&this.render_single_batch(n,this.m_batch,e)}render_single_batch(t,e,a){e.material?t.material=e.material:t.material=this.m_default_material,t.material.has_value(ys)?t.material.set_texture(ys,e.texture):t.material.set_texture_at_location(0,e.texture),t.material.has_value(us)?t.material.set_sampler(us,e.sampler):t.material.set_sampler_at_location(0,e.sampler),t.material.set_matrix(ja,a),t.has_scissor=e.scissor.w>=0&&e.scissor.h>=0,t.scissor=e.scissor,t.index_start=e.offset*3,t.index_count=e.elements*3,t.perform()}clear(){this.m_matrix=A.identity,this.m_tex_mult=255,this.m_tex_wash=0,this.m_vertices=[],this.m_indices=[],this.m_batch.layer=0,this.m_batch.elements=0,this.m_batch.offset=0,this.m_batch.material=void 0,this.m_batch.texture=void 0,this.m_batch.sampler=this.default_sampler,this.m_batch.scissor.w=this.m_batch.scissor.h=-1,this.m_batch.flip_vertically=!1,this.m_matrix_stack=[],this.m_scissor_stack=[],this.m_material_stack=[],this.m_batches=[],this.m_batch_insert=0}line(t,e,a,i){}rect(t,e){this.PUSH_QUAD(t.x,t.y,t.x+t.w,t.y,t.x+t.w,t.y+t.h,t.x,t.y+t.h,0,0,0,0,0,0,0,0,e,e,e,e,0,0,255)}rect_line(t,e,a){e>=t.w||e>=t.h?this.rect(t,a):(this.PUSH_QUAD(t.x,t.y,t.x+t.w-e,t.y,t.x+t.w-e,t.y+e,t.x,t.y+e,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x+t.w-e,t.y,t.x+t.w,t.y,t.x+t.w,t.y+t.h-e,t.x+t.w-e,t.y+t.h-e,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x+e,t.y+t.h-e,t.x+t.w,t.y+t.h-e,t.x+t.w,t.y+t.h,t.x,t.y+t.h,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x,t.y+e,t.x+e,t.y+e,t.x+e,t.y+t.h-e,t.x,t.y+t.h,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255))}circle(t,e,a,i){}circle_line(t,e,a,i,h){}quad(t,e,a,i,h){}quad_line(t,e,a,i,h,n){}tex(t,e=r.zero,a=u.white){this.set_texture(t);let i=t.width,h=t.height,{m_tex_mult:n,m_tex_wash:_}=this;this.PUSH_QUAD(e.x,e.y,e.x+i,e.y,e.x+i,e.y+h,e.x,e.y+h,0,0,1,0,1,1,0,1,a,a,a,a,n,_,0)}tex_o(t,e,a,i,h,n){}tex_c(t,e,a,i,h,n,_){}stex(t,e=r.zero,a=u.white){let{m_tex_mult:i,m_tex_wash:h}=this;this.set_texture(t.texture),this.PUSH_QUAD(e.x+t.draw_coords[0].x,e.y+t.draw_coords[0].y,e.x+t.draw_coords[1].x,e.y+t.draw_coords[1].y,e.x+t.draw_coords[2].x,e.y+t.draw_coords[2].y,e.x+t.draw_coords[3].x,e.y+t.draw_coords[3].y,t.tex_coords[0].x,t.tex_coords[0].y,t.tex_coords[1].x,t.tex_coords[1].y,t.tex_coords[2].x,t.tex_coords[2].y,t.tex_coords[3].x,t.tex_coords[3].y,a,a,a,a,i,h,0)}stex_o(t,e,a,i,h,n){let{m_tex_mult:_,m_tex_wash:f}=this;this.push_matrix(A.create_transform(e,a,i,h)),this.set_texture(t.texture),this.PUSH_QUAD(t.draw_coords[0].x,t.draw_coords[0].y,t.draw_coords[1].x,t.draw_coords[1].y,t.draw_coords[2].x,t.draw_coords[2].y,t.draw_coords[3].x,t.draw_coords[3].y,t.tex_coords[0].x,t.tex_coords[0].y,t.tex_coords[1].x,t.tex_coords[1].y,t.tex_coords[2].x,t.tex_coords[2].y,t.tex_coords[3].x,t.tex_coords[3].y,n,n,n,n,_,f,0),this.pop_matrix()}stex_c(t,e,a,i,h,n,_){}str(t,e,a,i){this.str_j(t,e,a,r.zero,t.size,i)}str_j(t,e,a,i,h,n){this.push_matrix(A.create_scale(h/t.size).mul(A.create_translation(a)));let _=r.make(0,t.ascent+t.descent);i.x!==0&&(_.x-=t.width_of_line(e)*i.x),i.y!==0&&(_.y-=t.height_of(e)*i.y);let f=0,p=0;for(let m of e){if(m===` -`)_.x=0,_.y+=t.line_height,i.x!==0&&(_.x-=t.width_of_line(e,p+1)*i.x),f=0;else{let c=t.get_character(m.charCodeAt(0));if(c.subtexture.texture){let g=_.add(c.offset);f&&(g.x+=t.get_kerning(f,m.charCodeAt(0))),this.stex(c.subtexture,g,n)}_.x+=c.advance,f=m.charCodeAt(0)}p++}this.pop_matrix()}INSERT_BATCH(){this.m_batches.push(this.m_batch.clone),this.m_batch.offset+=this.m_batch.elements,this.m_batch.elements=0}PUSH_QUAD(t,e,a,i,h,n,_,f,p,m,c,g,v,k,y,b,T,R,C,I,H,mt,ee){this.m_batch.elements+=2,this.m_indices.push(this.m_vertices.length+0),this.m_indices.push(this.m_vertices.length+1),this.m_indices.push(this.m_vertices.length+2),this.m_indices.push(this.m_vertices.length+0),this.m_indices.push(this.m_vertices.length+2),this.m_indices.push(this.m_vertices.length+3),this.MAKE_VERTEX(t,e,p,m,T,H,ee,mt),this.MAKE_VERTEX(a,i,c,g,R,H,ee,mt),this.MAKE_VERTEX(h,n,v,k,C,H,ee,mt),this.MAKE_VERTEX(_,f,y,b,I,H,ee,mt)}MAKE_VERTEX(t,e,a,i,h,n,_,f){let p=this.m_matrix;this.m_vertices.push(new Va(r.make(t*p.m11+e*p.m21+p.m31,t*p.m12+e*p.m22+p.m32),r.make(a,this.m_batch.flip_vertically?1-i:i),h,n,f,_))}}const wt=new Xa;class Va{constructor(t,e,a,i,h,n){this.pos=t,this.tex=e,this.col=a,this.mult=i,this.wash=h,this.fill=n}push_to(t,e){let{pos:a,tex:i,col:h,mult:n,wash:_,fill:f}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),t.setUint8(e+16,h.r),t.setUint8(e+17,h.g),t.setUint8(e+18,h.b),t.setUint8(e+19,h.a),t.setUint8(e+20,n),t.setUint8(e+21,_),t.setUint8(e+22,f),e+24}}const Ys=class{constructor(s){l(this,"pixels"),this.data=s,this.pixels=[];for(let t=0;t{let t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0),new Ys(e.getImageData(0,0,s.width,s.height))});const ts=class{constructor(s,t,e){l(this,"draw_coords"),l(this,"tex_coords"),this.texture=s,this.source=t,this.frame=e,this.draw_coords=[r.zero,r.zero,r.zero,r.zero],this.tex_coords=[r.zero,r.zero,r.zero,r.zero],this.update()}get width(){return this.frame.w}get height(){return this.frame.h}update(){let{draw_coords:s,tex_coords:t,texture:e,frame:a,source:i}=this;if(s[0].x=-a.x,s[0].y=-a.y,s[1].x=-a.x+i.w,s[1].y=-a.y,s[2].x=-a.x+i.w,s[2].y=-a.y+i.h,s[3].x=-a.x,s[3].y=-a.y+i.h,e){let h=1/e.width,n=1/e.height;t[0].x=i.x*h,t[0].y=i.y*n,t[1].x=(i.x+i.w)*h,t[1].y=i.y*n,t[2].x=(i.x+i.w)*h,t[2].y=(i.y+i.h)*n,t[3].x=i.x*h,t[3].y=(i.y+i.h)*n}}crop_info(s){let{source:t,frame:e}=this,a=s.add(t.top_left).add(e.top_left).overlaps_rect(t),i=w.make(Math.min(0,e.x,+s.x),Math.min(0,e.y+s.y),s.w,s.h);return[a,i]}crop(s){let{texture:t}=this,[e,a]=this.crop_info(s);return new ts(t,e,a)}};let qt=ts;l(qt,"make",(s,t=w.make(0,0,s.width,s.height),e=w.make(0,0,t.w,t.h))=>new ts(s,t,e));const Qs=class{constructor(){l(this,"scale"),l(this,"characters"),l(this,"glyphs"),l(this,"kernings"),l(this,"packs"),l(this,"_descent"),l(this,"_ascent"),l(this,"_line_gap"),l(this,"family_name"),l(this,"texture")}get ascent(){return this._ascent*this.scale}get descent(){return this._descent*this.scale}get line_gap(){return this._line_gap*this.scale}get_character(s){return this.characters.get(s)}get_kerning(s,t){var e;return(e=this.kernings.get(s))==null?void 0:e.get(t)}get_glyph(s){return this.glyphs.get(s)}get_subtexture(s){let t=this.packs.get(s);if(!t)return new qt(this.texture,w.make(0,0,0,0),w.make(0,0,0,0));let{packed:e,frame:a}=t;return new qt(this.texture,w.make(e.x,e.y,e.w,e.h),w.make(a.x,a.y,a.w,a.h))}};let Js=Qs;l(Js,"make",(s,t)=>{let e=new Qs;e.scale=s.meta.scale;let a=new Map(s.chars.map(_=>[_.glyph,{..._,has_glyph:_.has_glyph!==0}])),i=new Map(s.glyphs.map(_=>[_.codepoint,_.glyph])),h=new Map;s.kernings.forEach(_=>{h.get(_.glyph1)||h.set(_.glyph1,new Map),h.get(_.glyph1).set(_.glyph2,_.kerning)});let n=new Map(s.colors.map(_=>[_.glyph,{frame:_.frame,packed:_.packed}]));return e._descent=s.meta.descent,e._ascent=s.meta.ascent,e._line_gap=s.meta.line_gap,e.family_name=s.meta.name,e.texture=t,e.packs=n,e.kernings=h,e.glyphs=i,e.characters=a,e.scale=s.meta.scale,e});const $e=class{constructor(){l(this,"_characters"),l(this,"_kerning"),l(this,"_atlas"),l(this,"name"),l(this,"size",0),l(this,"ascent",0),l(this,"descent",0),l(this,"line_gap",0)}clear(){this._atlas=[],this._characters=[],this._kerning=[],this.name=""}get height(){return this.ascent-this.descent}get line_height(){return this.ascent-this.descent+this.line_gap}get textures(){return this._atlas}width_of(s){let t=0,e=0,a=0;for(let i of s)i===` +}`;const Da=[Oa,Na];class Pa extends Zt{constructor(t){super(),l(this,"m_id"),l(this,"m_uniforms",[]),l(this,"uniform_locations",[]),this.data=t;let e=d.renderer.gl.createShader(d.renderer.gl.VERTEX_SHADER);{d.renderer.gl.shaderSource(e,t[0]),d.renderer.gl.compileShader(e);let n=d.renderer.gl.getShaderInfoLog(e);if(n){et.error(n);return}}let a=d.renderer.gl.createShader(d.renderer.gl.FRAGMENT_SHADER);{d.renderer.gl.shaderSource(a,t[1]),d.renderer.gl.compileShader(a);let n=d.renderer.gl.getShaderInfoLog(a);if(n&&n.length>0){et.error(n);return}}let i=d.renderer.gl.createProgram();d.renderer.gl.attachShader(i,e),d.renderer.gl.attachShader(i,a),d.renderer.gl.linkProgram(i);let h=d.renderer.gl.getProgramInfoLog(i);if(d.renderer.gl.deleteShader(e),d.renderer.gl.deleteShader(a),h&&h.length>0){et.error(h);return}{let n=d.renderer.gl.getProgramParameter(i,d.renderer.gl.ACTIVE_UNIFORMS),_=0;for(let f=0;f{let _=d.renderer.gl.UNSIGNED_BYTE,f=0,p=1;n.type===L.Float&&(_=d.renderer.gl.FLOAT,f=4,p=1),n.type===L.Float2&&(_=d.renderer.gl.FLOAT,f=4,p=2),n.type===L.Float3&&(_=d.renderer.gl.FLOAT,f=4,p=3),n.type===L.Float4&&(_=d.renderer.gl.FLOAT,f=4,p=4),n.type===L.UByte4&&(_=d.renderer.gl.UNSIGNED_BYTE,f=1,p=4);let m=n.index;d.renderer.gl.enableVertexAttribArray(m),d.renderer.gl.vertexAttribPointer(m,p,_,n.normalized,a.stride,h),d.renderer.gl.vertexAttribDivisor(m,i),h+=p*f}),a.stride}}class $a extends vt{constructor(t,e,a){super(),l(this,"m_id"),l(this,"m_attachments"),l(this,"m_width"),l(this,"m_height"),this.m_attachments=[],this.m_id=d.renderer.gl.createFramebuffer(),this.m_width=t,this.m_height=e,d.renderer.gl.bindFramebuffer(d.renderer.gl.FRAMEBUFFER,this.m_id),a.forEach((i,h)=>{let n=Ct.create(t,e,i);n.framebuffer_parent=!0,this.m_attachments.push(n),i!==ge.DepthStencil?d.renderer.gl.framebufferTexture2D(d.renderer.gl.FRAMEBUFFER,d.renderer.gl.COLOR_ATTACHMENT0+h,d.renderer.gl.TEXTURE_2D,n.gl_id,0):d.renderer.gl.framebufferTexture2D(d.renderer.gl.FRAMEBUFFER,d.renderer.gl.DEPTH_STENCIL_ATTACHMENT,d.renderer.gl.TEXTURE_2D,n.gl_id,0)})}get gl_id(){return this.m_id}get textures(){return this.m_attachments}clear(t,e=1,a=0){d.renderer.clear_backbuffer(t,e,a,this.m_id)}}class Ia extends Ct{constructor(t,e,a){super(),l(this,"m_id"),l(this,"m_width"),l(this,"m_height"),l(this,"m_sampler"),l(this,"m_format"),l(this,"m_gl_internal_format"),l(this,"m_gl_format"),l(this,"m_gl_type"),l(this,"framebuffer_parent"),this.m_id=0,this.m_width=t,this.m_height=e,this.m_sampler=new bt(Kt.None,Ht.None,Ht.None),this.m_format=a,this.framebuffer_parent=!1,this.m_gl_internal_format=d.renderer.gl.RED,this.m_gl_format=d.renderer.gl.RED,this.m_gl_type=d.renderer.gl.UNSIGNED_BYTE,a===ge.RGBA?(this.m_gl_internal_format=d.renderer.gl.RGBA,this.m_gl_format=d.renderer.gl.RGBA,this.m_gl_type=d.renderer.gl.UNSIGNED_BYTE):et.error(`Unsupported Texture format ${a}`),this.m_id=d.renderer.gl.createTexture(),d.renderer.gl.activeTexture(d.renderer.gl.TEXTURE0),d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texImage2D(d.renderer.gl.TEXTURE_2D,0,this.m_gl_internal_format,t,e,0,this.m_gl_format,this.m_gl_type,null)}get is_framebuffer(){return this.framebuffer_parent}get width(){return this.m_width}get height(){return this.m_height}set_data(t){d.renderer.gl.activeTexture(d.renderer.gl.TEXTURE0),d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texImage2D(d.renderer.gl.TEXTURE_2D,0,this.m_gl_internal_format,this.m_width,this.m_height,0,this.m_gl_format,this.m_gl_type,t)}update_sampler(t){this.m_sampler!==t&&(this.m_sampler=t,d.renderer.gl.bindTexture(d.renderer.gl.TEXTURE_2D,this.m_id),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_MIN_FILTER,this.m_sampler.filter===Kt.Nearest?d.renderer.gl.NEAREST:d.renderer.gl.LINEAR),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_MAG_FILTER,this.m_sampler.filter===Kt.Nearest?d.renderer.gl.NEAREST:d.renderer.gl.LINEAR),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_WRAP_S,this.m_sampler.wrap_x===Ht.Clamp?d.renderer.gl.CLAMP_TO_EDGE:d.renderer.gl.REPEAT),d.renderer.gl.texParameteri(d.renderer.gl.TEXTURE_2D,d.renderer.gl.TEXTURE_WRAP_T,this.m_sampler.wrap_y===Ht.Clamp?d.renderer.gl.CLAMP_TO_EDGE:d.renderer.gl.REPEAT))}get gl_id(){return this.m_id}}const Ks=class{constructor(){l(this,"origin_bottom_left",!0),l(this,"gl"),l(this,"default_batcher_shader")}get get_draw_size(){}create_shader(s){return new Pa(s)}create_target(s,t){return new $a(s,t,[ge.RGBA])}create_texture(s,t,e){return new Ia(s,t,e)}create_mesh(){return new La}update(){}init(){let s=d.platform.gl_context_create();return s===null?(et.error("Failed to create WebGL Context"),!1):(this.gl=s,et.info("WebGL2"),this.gl.pixelStorei(this.gl.PACK_ALIGNMENT,1),this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1),this.default_batcher_shader=Zt.create(Da),!0)}render(s){if(s.target===d.backbuffer)this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null);else if(s.target){let p=s.target;this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,p.gl_id)}let t=r.make(s.target.width,s.target.height),e=s.material.shader,a=s.mesh;this.gl.useProgram(e.gl_id);let i=0,h=[],n=e.uniforms,_=s.material.data,f=0;n.forEach((p,m)=>{let c=e.uniform_locations[m];if(p.type!==D.Sampler2D){if(p.type===D.Texture2D){for(let g=0;g0?this.gl.drawElementsInstanced(this.gl.TRIANGLES,s.index_count,p,m*s.index_start,s.instance_count):this.gl.drawElements(this.gl.TRIANGLES,s.index_count,p,m*s.index_start)}this.gl.bindVertexArray(null)}clear_backbuffer(s,t,e,a=null){this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,a),this.gl.disable(this.gl.SCISSOR_TEST);let i=0;i|=this.gl.COLOR_BUFFER_BIT,this.gl.colorMask(!0,!0,!0,!0),this.gl.clearColor(s.r/255,s.g/255,s.b/255,s.a/255),this.gl.clear(i)}before_render(){}after_render(){}};let Ws=Ks;l(Ws,"try_make_renderer",()=>new Ks);const ms=s=>{switch(s){case Bt.Add:return d.renderer.gl.FUNC_ADD;case Bt.Subtract:return d.renderer.gl.FUNC_SUBTRACT;case Bt.Min:return d.renderer.gl.MIN;case Bt.Max:return d.renderer.gl.MAX;default:return d.renderer.gl.FUNC_ADD}},se=s=>{switch(s){case j.Zero:return d.renderer.gl.ZERO;case j.One:return d.renderer.gl.ONE;case j.SrcColor:return d.renderer.gl.SRC_COLOR;case j.OneMinusSrcColor:return d.renderer.gl.ONE_MINUS_SRC_COLOR;case j.DstColor:return d.renderer.gl.DST_COLOR;case j.OneMinusDstColor:return d.renderer.gl.ONE_MINUS_DST_COLOR;case j.SrcAlpha:return d.renderer.gl.SRC_ALPHA;case j.OneMinusSrcAlpha:return d.renderer.gl.ONE_MINUS_SRC_ALPHA;case j.DstAlpha:return d.renderer.gl.DST_ALPHA;case j.OneMinusDstAlpha:return d.renderer.gl.ONE_MINUS_DST_ALPHA;case j.ConstantColor:return d.renderer.gl.CONSTANT_COLOR;case j.ConstantAlpha:return d.renderer.gl.CONSTANT_ALPHA;case j.OneMinusConstantColor:return d.renderer.gl.ONE_MINUS_CONSTANT_COLOR;case j.OneMinusConstantAlpha:return d.renderer.gl.ONE_MINUS_CONSTANT_ALPHA;default:return d.renderer.gl.ZERO}},gs=()=>d.renderer.get_draw_size||d.platform.get_draw_size,qs=class extends vt{get width(){return gs()[0]}get height(){return gs()[1]}get textures(){return qs.empty_textures}clear(s,t,e){d.renderer.clear_backbuffer(s,t,e)}};let Gs=qs;l(Gs,"empty_textures",[]);class Ba{constructor(){l(this,"platform"),l(this,"renderer"),l(this,"backbuffer"),l(this,"config"),l(this,"app_time_last",0),l(this,"app_time_accumulator",0)}get canvas(){return this.platform.canvas}run(t){var e,a;this.config=t,this.backbuffer=new Gs,this.platform=Hs.try_make_platform(this.config),this.platform.init(),this.renderer=Ws.try_make_renderer(),this.renderer.init(),this.platform.update(),(a=(e=this.config).on_startup)==null||a.call(e),this.app_time_accumulator=0,this.platform.ready(),this.begin_iterate()}begin_iterate(){const t=()=>{var a,i;this.platform.update(),this.renderer.update(),(i=(a=this.config).on_update)==null||i.call(a)},e=a=>{var i,h;let n=.016666666666666666*S.ticks_per_second,_=a-this.app_time_last;for(this.app_time_last=a,this.app_time_accumulator+=_;this.app_time_accumulator>=n;){if(this.app_time_accumulator-=n,S.delta=.016666666666666666,S.pause_timer>0)if(S.pause_timer-=S.delta,S.pause_timer<=-1e-4)S.delta=-S.pause_timer;else continue;S.previous_ticks=S.ticks,S.ticks+=n,S.previous_seconds=S.seconds,S.seconds+=S.delta,t()}this.renderer.before_render(),(h=(i=this.config).on_render)==null||h.call(i),this.renderer.after_render(),this.platform.present(),requestAnimationFrame(e)};requestAnimationFrame(e)}}const d=new Ba,ys="u_texture",us="u_texture_sampler",Ha="u_matrix",ws=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1),ft.make(2,L.UByte4,!0),ft.make(3,L.UByte4,!0)]);class Ze{constructor(){l(this,"layer",0),l(this,"offset",0),l(this,"elements",0),l(this,"material"),l(this,"texture"),l(this,"sampler",bt.get_default),l(this,"scissor",w.make(0,0,-1,-1)),l(this,"flip_vertically",!1)}get clone(){let t=new Ze;return t.layer=this.layer,t.offset=this.offset,t.elements=this.elements,t.material=this.material,t.texture=this.texture,t.sampler=this.sampler,t.scissor=this.scissor,t.flip_vertically=this.flip_vertically,t}}class ja{constructor(){l(this,"m_default_material"),l(this,"m_mesh"),l(this,"m_batch",new Ze),l(this,"m_matrix",A.identity),l(this,"m_tex_mult",255),l(this,"m_tex_wash",0),l(this,"m_vertices",[]),l(this,"m_indices",[]),l(this,"m_matrix_stack",[]),l(this,"m_scissor_stack",[]),l(this,"m_material_stack",[]),l(this,"m_batches",[]),l(this,"m_batch_insert",0),l(this,"integerize",!1),l(this,"default_sampler",bt.get_default)}push_matrix(t,e=!1){this.m_matrix_stack.push(this.m_matrix),e?this.m_matrix=t:this.m_matrix=t.mul(this.m_matrix)}pop_matrix(){let t=this.m_matrix;return this.m_matrix=this.m_matrix_stack.pop(),t}peek_matrix(){return this.m_matrix}push_scissor(t){this.m_scissor_stack.push(this.m_batch.scissor),this.m_batch.elements>0&&t!==this.m_batch.scissor&&this.INSERT_BATCH(),this.m_batch.scissor=t}pop_scissor(){let t=this.m_batch.scissor,e=this.m_scissor_stack.pop();return this.m_batch.elements>0&&e!==this.m_batch.scissor&&this.INSERT_BATCH(),this.m_batch.scissor=e??w.make(0,0,-1,-1),t}peek_scissor(){}push_material(t){}pop_material(){}peek_material(){}set_texture(t){this.m_batch.elements>0&&t!==this.m_batch.texture&&this.INSERT_BATCH(),this.m_batch.texture!==t&&(this.m_batch.texture=t,this.m_batch.flip_vertically=d.renderer.origin_bottom_left&&t&&t.is_framebuffer)}set_sampler(t){console.log(t)}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){if(this.m_batches.length<=0&&this.m_batch.elements<=0||this.m_indices.length<=0)return;this.m_mesh||(this.m_mesh=Jt.create()),this.m_default_material||(this.m_default_material=ye.create(d.renderer.default_batcher_shader));let a=ws.stride,i=new ArrayBuffer(a*this.m_vertices.length),h=new DataView(i);this.m_vertices.reduce((_,f)=>f.push_to(h,_),0),this.m_mesh.index_data(this.m_indices),this.m_mesh.vertex_data(ws,i);let n=new Je;n.target=t,n.mesh=this.m_mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,this.m_batches.forEach((_,f)=>{this.render_single_batch(n,_,e)}),this.m_batch.elements>0&&this.render_single_batch(n,this.m_batch,e)}render_single_batch(t,e,a){e.material?t.material=e.material:t.material=this.m_default_material,t.material.has_value(ys)?t.material.set_texture(ys,e.texture):t.material.set_texture_at_location(0,e.texture),t.material.has_value(us)?t.material.set_sampler(us,e.sampler):t.material.set_sampler_at_location(0,e.sampler),t.material.set_matrix(Ha,a),t.has_scissor=e.scissor.w>=0&&e.scissor.h>=0,t.scissor=e.scissor,t.index_start=e.offset*3,t.index_count=e.elements*3,t.perform()}clear(){this.m_matrix=A.identity,this.m_tex_mult=255,this.m_tex_wash=0,this.m_vertices=[],this.m_indices=[],this.m_batch.layer=0,this.m_batch.elements=0,this.m_batch.offset=0,this.m_batch.material=void 0,this.m_batch.texture=void 0,this.m_batch.sampler=this.default_sampler,this.m_batch.scissor.w=this.m_batch.scissor.h=-1,this.m_batch.flip_vertically=!1,this.m_matrix_stack=[],this.m_scissor_stack=[],this.m_material_stack=[],this.m_batches=[],this.m_batch_insert=0}line(t,e,a,i){}rect(t,e){this.PUSH_QUAD(t.x,t.y,t.x+t.w,t.y,t.x+t.w,t.y+t.h,t.x,t.y+t.h,0,0,0,0,0,0,0,0,e,e,e,e,0,0,255)}rect_line(t,e,a){e>=t.w||e>=t.h?this.rect(t,a):(this.PUSH_QUAD(t.x,t.y,t.x+t.w-e,t.y,t.x+t.w-e,t.y+e,t.x,t.y+e,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x+t.w-e,t.y,t.x+t.w,t.y,t.x+t.w,t.y+t.h-e,t.x+t.w-e,t.y+t.h-e,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x+e,t.y+t.h-e,t.x+t.w,t.y+t.h-e,t.x+t.w,t.y+t.h,t.x,t.y+t.h,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255),this.PUSH_QUAD(t.x,t.y+e,t.x+e,t.y+e,t.x+e,t.y+t.h-e,t.x,t.y+t.h,0,0,0,0,0,0,0,0,a,a,a,a,0,0,255))}circle(t,e,a,i){}circle_line(t,e,a,i,h){}quad(t,e,a,i,h){}quad_line(t,e,a,i,h,n){}tex(t,e=r.zero,a=u.white){this.set_texture(t);let i=t.width,h=t.height,{m_tex_mult:n,m_tex_wash:_}=this;this.PUSH_QUAD(e.x,e.y,e.x+i,e.y,e.x+i,e.y+h,e.x,e.y+h,0,0,1,0,1,1,0,1,a,a,a,a,n,_,0)}tex_o(t,e,a,i,h,n){}tex_c(t,e,a,i,h,n,_){}stex(t,e=r.zero,a=u.white){let{m_tex_mult:i,m_tex_wash:h}=this;this.set_texture(t.texture),this.PUSH_QUAD(e.x+t.draw_coords[0].x,e.y+t.draw_coords[0].y,e.x+t.draw_coords[1].x,e.y+t.draw_coords[1].y,e.x+t.draw_coords[2].x,e.y+t.draw_coords[2].y,e.x+t.draw_coords[3].x,e.y+t.draw_coords[3].y,t.tex_coords[0].x,t.tex_coords[0].y,t.tex_coords[1].x,t.tex_coords[1].y,t.tex_coords[2].x,t.tex_coords[2].y,t.tex_coords[3].x,t.tex_coords[3].y,a,a,a,a,i,h,0)}stex_o(t,e,a,i,h,n){let{m_tex_mult:_,m_tex_wash:f}=this;this.push_matrix(A.create_transform(e,a,i,h)),this.set_texture(t.texture),this.PUSH_QUAD(t.draw_coords[0].x,t.draw_coords[0].y,t.draw_coords[1].x,t.draw_coords[1].y,t.draw_coords[2].x,t.draw_coords[2].y,t.draw_coords[3].x,t.draw_coords[3].y,t.tex_coords[0].x,t.tex_coords[0].y,t.tex_coords[1].x,t.tex_coords[1].y,t.tex_coords[2].x,t.tex_coords[2].y,t.tex_coords[3].x,t.tex_coords[3].y,n,n,n,n,_,f,0),this.pop_matrix()}stex_c(t,e,a,i,h,n,_){}str(t,e,a,i){this.str_j(t,e,a,r.zero,t.size,i)}str_j(t,e,a,i,h,n){this.push_matrix(A.create_scale(h/t.size).mul(A.create_translation(a)));let _=r.make(0,t.ascent+t.descent);i.x!==0&&(_.x-=t.width_of_line(e)*i.x),i.y!==0&&(_.y-=t.height_of(e)*i.y);let f=0,p=0;for(let m of e){if(m===` +`)_.x=0,_.y+=t.line_height,i.x!==0&&(_.x-=t.width_of_line(e,p+1)*i.x),f=0;else{let c=t.get_character(m.charCodeAt(0));if(c.subtexture.texture){let g=_.add(c.offset);f&&(g.x+=t.get_kerning(f,m.charCodeAt(0))),this.stex(c.subtexture,g,n)}_.x+=c.advance,f=m.charCodeAt(0)}p++}this.pop_matrix()}INSERT_BATCH(){this.m_batches.push(this.m_batch.clone),this.m_batch.offset+=this.m_batch.elements,this.m_batch.elements=0}PUSH_QUAD(t,e,a,i,h,n,_,f,p,m,c,g,v,k,y,b,T,C,U,I,H,mt,ee){this.m_batch.elements+=2,this.m_indices.push(this.m_vertices.length+0),this.m_indices.push(this.m_vertices.length+1),this.m_indices.push(this.m_vertices.length+2),this.m_indices.push(this.m_vertices.length+0),this.m_indices.push(this.m_vertices.length+2),this.m_indices.push(this.m_vertices.length+3),this.MAKE_VERTEX(t,e,p,m,T,H,ee,mt),this.MAKE_VERTEX(a,i,c,g,C,H,ee,mt),this.MAKE_VERTEX(h,n,v,k,U,H,ee,mt),this.MAKE_VERTEX(_,f,y,b,I,H,ee,mt)}MAKE_VERTEX(t,e,a,i,h,n,_,f){let p=this.m_matrix;this.m_vertices.push(new Xa(r.make(t*p.m11+e*p.m21+p.m31,t*p.m12+e*p.m22+p.m32),r.make(a,this.m_batch.flip_vertically?1-i:i),h,n,f,_))}}const wt=new ja;class Xa{constructor(t,e,a,i,h,n){this.pos=t,this.tex=e,this.col=a,this.mult=i,this.wash=h,this.fill=n}push_to(t,e){let{pos:a,tex:i,col:h,mult:n,wash:_,fill:f}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),t.setUint8(e+16,h.r),t.setUint8(e+17,h.g),t.setUint8(e+18,h.b),t.setUint8(e+19,h.a),t.setUint8(e+20,n),t.setUint8(e+21,_),t.setUint8(e+22,f),e+24}}const Ys=class{constructor(s){l(this,"pixels"),this.data=s,this.pixels=[];for(let t=0;t{let t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0),new Ys(e.getImageData(0,0,s.width,s.height))});const ts=class{constructor(s,t,e){l(this,"draw_coords"),l(this,"tex_coords"),this.texture=s,this.source=t,this.frame=e,this.draw_coords=[r.zero,r.zero,r.zero,r.zero],this.tex_coords=[r.zero,r.zero,r.zero,r.zero],this.update()}get width(){return this.frame.w}get height(){return this.frame.h}update(){let{draw_coords:s,tex_coords:t,texture:e,frame:a,source:i}=this;if(s[0].x=-a.x,s[0].y=-a.y,s[1].x=-a.x+i.w,s[1].y=-a.y,s[2].x=-a.x+i.w,s[2].y=-a.y+i.h,s[3].x=-a.x,s[3].y=-a.y+i.h,e){let h=1/e.width,n=1/e.height;t[0].x=i.x*h,t[0].y=i.y*n,t[1].x=(i.x+i.w)*h,t[1].y=i.y*n,t[2].x=(i.x+i.w)*h,t[2].y=(i.y+i.h)*n,t[3].x=i.x*h,t[3].y=(i.y+i.h)*n}}crop_info(s){let{source:t,frame:e}=this,a=s.add(t.top_left).add(e.top_left).overlaps_rect(t),i=w.make(Math.min(0,e.x,+s.x),Math.min(0,e.y+s.y),s.w,s.h);return[a,i]}crop(s){let{texture:t}=this,[e,a]=this.crop_info(s);return new ts(t,e,a)}};let Gt=ts;l(Gt,"make",(s,t=w.make(0,0,s.width,s.height),e=w.make(0,0,t.w,t.h))=>new ts(s,t,e));const Qs=class{constructor(){l(this,"scale"),l(this,"characters"),l(this,"glyphs"),l(this,"kernings"),l(this,"packs"),l(this,"_descent"),l(this,"_ascent"),l(this,"_line_gap"),l(this,"family_name"),l(this,"texture")}get ascent(){return this._ascent*this.scale}get descent(){return this._descent*this.scale}get line_gap(){return this._line_gap*this.scale}get_character(s){return this.characters.get(s)}get_kerning(s,t){var e;return(e=this.kernings.get(s))==null?void 0:e.get(t)}get_glyph(s){return this.glyphs.get(s)}get_subtexture(s){let t=this.packs.get(s);if(!t)return new Gt(this.texture,w.make(0,0,0,0),w.make(0,0,0,0));let{packed:e,frame:a}=t;return new Gt(this.texture,w.make(e.x,e.y,e.w,e.h),w.make(a.x,a.y,a.w,a.h))}};let Js=Qs;l(Js,"make",(s,t)=>{let e=new Qs;e.scale=s.meta.scale;let a=new Map(s.chars.map(_=>[_.glyph,{..._,has_glyph:_.has_glyph!==0}])),i=new Map(s.glyphs.map(_=>[_.codepoint,_.glyph])),h=new Map;s.kernings.forEach(_=>{h.get(_.glyph1)||h.set(_.glyph1,new Map),h.get(_.glyph1).set(_.glyph2,_.kerning)});let n=new Map(s.colors.map(_=>[_.glyph,{frame:_.frame,packed:_.packed}]));return e._descent=s.meta.descent,e._ascent=s.meta.ascent,e._line_gap=s.meta.line_gap,e.family_name=s.meta.name,e.texture=t,e.packs=n,e.kernings=h,e.glyphs=i,e.characters=a,e.scale=s.meta.scale,e});const $e=class{constructor(){l(this,"_characters"),l(this,"_kerning"),l(this,"_atlas"),l(this,"name"),l(this,"size",0),l(this,"ascent",0),l(this,"descent",0),l(this,"line_gap",0)}clear(){this._atlas=[],this._characters=[],this._kerning=[],this.name=""}get height(){return this.ascent-this.descent}get line_height(){return this.ascent-this.descent+this.line_gap}get textures(){return this._atlas}width_of(s){let t=0,e=0,a=0;for(let i of s)i===` `?e=0:(e+=this.get_character(i.charCodeAt(0)).advance,a&&(e+=this.get_kerning(a,i.charCodeAt(0))),e>t&&(t=e),a=i.charCodeAt(0));return t}width_of_line(s,t=0){if(t<0||t>=s.length)return 0;let e=0,a=0;for(let i of s){if(i===` `)break;e+=this.get_character(i.charCodeAt(0)).advance,a&&(e+=this.get_kerning(a,i.charCodeAt(0))),a=i.charCodeAt(0)}return e}height_of(s){if(s.length<=0)return 0;let t=this.line_height;for(let e of s)e===` -`&&(t+=this.line_height);return t-this.line_gap}rebuild(s,t,e){this.clear(),this.name=s.family_name,this.ascent=s.ascent,this.descent=s.descent,this.line_gap=s.line_gap,this.size=t;for(let a of e){let{from:i,to:h}=a;for(let n=i;n<=h;n++){let _=s.get_glyph(n);if(_===void 0)continue;let f=s.get_character(_),p=s.get_subtexture(f.glyph),m={glyph:_,codepoint:n,advance:f.advance,offset:r.make(f.offset_x,f.offset_y),subtexture:p};this._characters.push(m)}}for(let a of this._characters)for(let i of this._characters){let h=s.get_kerning(a.glyph,i.glyph);h!==void 0&&this.set_kerning(a.codepoint,i.codepoint,h)}}get_kerning(s,t){let e=xs(this._kerning,s,t);return e!==-1?this._kerning[e].value:0}set_kerning(s,t,e){let a=xs(this._kerning,s,t);a!==-1?this._kerning[a].value=e:this._kerning.push({a:s,b:t,value:e})}get_character(s){let t=Wa(this._characters,s);return t!==-1?this._characters[t]:this._characters[0]}};let Ie=$e;l(Ie,"make",(s,t)=>{let e=Ct.from_image(t),a=Js.make(s,e);return $e.make_from_font(a,s.size)}),l(Ie,"make_from_font",(s,t)=>{let e=[{from:32,to:127},{from:161,to:355}],a=new $e;return a.rebuild(s,t,e),a});function Wa(s,t){let e=0,a=s.length-1;for(;e<=a;){let i=Math.round((a+e)/2);if(s[i].codepoint===t)return i;s[i].codepointe.name===t)}}class Ya{constructor(t,e){this.name=t,this.frames=e}}const Qa=""+new URL("out_0-253f9001.png",import.meta.url).href,Ja=[{name:"arrow_up_fire",tags:[{from:0,to:2,name:"idle"}],packs:[{frame:{x:4,y:4,w:48,h:48},packed:{x:3226,y:2728,w:56,h:56},meta:{duration:100}},{frame:{x:4,y:4,w:48,h:48},packed:{x:3226,y:2656,w:56,h:56},meta:{duration:100}},{frame:{x:4,y:4,w:48,h:48},packed:{x:3225,y:3377,w:56,h:56},meta:{duration:100}}]},{name:"button_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"click"},{from:3,to:3,name:"disabled"}],packs:[{frame:{x:4,y:4,w:366,h:200},packed:{x:2592,y:2656,w:374,h:208},meta:{duration:100}},{frame:{x:4,y:4,w:366,h:200},packed:{x:0,y:2909,w:374,h:208},meta:{duration:100}},{frame:{x:4,y:4,w:366,h:200},packed:{x:374,y:2909,w:374,h:208},meta:{duration:300}},{frame:{x:4,y:4,w:366,h:200},packed:{x:748,y:2909,w:374,h:208},meta:{duration:100}}]},{name:"card",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:4,name:"click"},{from:5,to:7,name:"flip"},{from:8,to:8,name:"back_idle"},{from:9,to:9,name:"back_hover"},{from:10,to:10,name:"back_click"},{from:11,to:13,name:"back_flip"},{from:14,to:15,name:"drag"},{from:16,to:17,name:"back_drag"},{from:18,to:18,name:"wait"},{from:19,to:19,name:"shadow"},{from:20,to:20,name:"highlight"}],packs:[{frame:{x:4,y:4,w:204,h:245},packed:{x:2897,y:1909,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:0,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:0,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:253,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:253,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:506,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:506,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1578,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1790,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2002,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2214,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2426,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2638,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2850,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3062,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:0,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:212,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:424,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:636,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:848,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1060,y:2656,w:212,h:253},meta:{duration:100}}]},{name:"confbar",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:360,h:320},packed:{x:2529,y:1909,w:368,h:328},meta:{duration:100}}]},{name:"confetti",tags:[{from:0,to:6,name:"idle"}],packs:[{frame:{x:4,y:4,w:180,h:180},packed:{x:1122,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1310,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1498,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1686,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1874,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2062,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2250,y:2909,w:188,h:188},meta:{duration:200}}]},{name:"confetti2",tags:[{from:0,to:6,name:"idle"}],packs:[{frame:{x:4,y:4,w:180,h:180},packed:{x:2438,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2626,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2814,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:3002,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2966,y:2656,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:0,y:3117,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:188,y:3117,w:188,h:188},meta:{duration:300}}]},{name:"dropdown_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:510,h:172},packed:{x:376,y:3117,w:518,h:180},meta:{duration:100}},{frame:{x:4,y:4,w:510,h:172},packed:{x:894,y:3117,w:518,h:180},meta:{duration:100}}]},{name:"hmg_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"open"},{from:3,to:3,name:"open_hover"}],packs:[{frame:{x:4,y:4,w:240,h:140},packed:{x:1945,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2193,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2441,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2689,y:3305,w:248,h:148},meta:{duration:100}}]},{name:"main_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:1570,h:1080},packed:{x:0,y:0,w:1578,h:1088},meta:{duration:100}}]},{name:"main_card_bg",tags:[{from:0,to:0,name:"solitaire"},{from:1,to:1,name:"solitaire_hover"},{from:2,to:2,name:"fourtimes"},{from:3,to:3,name:"fourtimes_hover"},{from:4,to:4,name:"octopus"},{from:5,to:5,name:"octopus_hover"}],packs:[{frame:{x:4,y:4,w:481,h:739},packed:{x:1271,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:1760,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:2249,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:2738,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:0,y:1909,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:489,y:1909,w:489,h:747},meta:{duration:100}}]},{name:"main_settings_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:652,h:223},packed:{x:1272,y:2656,w:660,h:231},meta:{duration:100}},{frame:{x:4,y:4,w:652,h:223},packed:{x:1932,y:2656,w:660,h:231},meta:{duration:100}}]},{name:"main_title_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:780,h:560},packed:{x:1333,y:1909,w:788,h:568},meta:{duration:100}}]},{name:"menu_bar",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:240,h:160},packed:{x:1412,y:3117,w:248,h:168},meta:{duration:100}}]},{name:"navigation_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:593,h:157},packed:{x:2224,y:3117,w:601,h:165},meta:{duration:100}},{frame:{x:4,y:4,w:593,h:157},packed:{x:0,y:3305,w:601,h:165},meta:{duration:100}}]},{name:"panel_bg_nine_slice",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:400,h:400},packed:{x:2121,y:1909,w:408,h:408},meta:{duration:100}}]},{name:"rank",tags:[{from:0,to:0,name:"a"},{from:1,to:1,name:"2"},{from:2,to:2,name:"3"},{from:3,to:3,name:"4"},{from:4,to:4,name:"5"},{from:5,to:5,name:"6"},{from:6,to:6,name:"7"},{from:7,to:7,name:"8"},{from:8,to:8,name:"9"},{from:9,to:9,name:"t"},{from:10,to:10,name:"j"},{from:11,to:11,name:"q"},{from:12,to:12,name:"k"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:2937,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3009,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3081,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3153,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2937,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3009,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3081,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3153,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2825,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2897,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2969,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3041,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3113,y:3117,w:72,h:72},meta:{duration:100}}]},{name:"rank_2",tags:[{from:0,to:0,name:"a"},{from:1,to:1,name:"2"},{from:2,to:2,name:"3"},{from:3,to:3,name:"4"},{from:4,to:4,name:"5"},{from:5,to:5,name:"6"},{from:6,to:6,name:"7"},{from:7,to:7,name:"8"},{from:8,to:8,name:"9"},{from:9,to:9,name:"t"},{from:10,to:10,name:"j"},{from:11,to:11,name:"q"},{from:12,to:12,name:"k"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:3185,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2825,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2897,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2969,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3041,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3113,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3185,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3154,y:2656,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3154,y:2728,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3190,y:2909,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3190,y:2981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:1909,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:1909,w:72,h:72},meta:{duration:100}}]},{name:"recycle",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"disabled"}],packs:[{frame:{x:4,y:4,w:180,h:160},packed:{x:1660,y:3117,w:188,h:168},meta:{duration:100}},{frame:{x:4,y:4,w:180,h:160},packed:{x:1848,y:3117,w:188,h:168},meta:{duration:100}},{frame:{x:4,y:4,w:180,h:160},packed:{x:2036,y:3117,w:188,h:168},meta:{duration:100}}]},{name:"side_menu_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:347,h:659},packed:{x:978,y:1909,w:355,h:667},meta:{duration:100}}]},{name:"suit",tags:[{from:0,to:0,name:"spades"},{from:1,to:1,name:"hearts"},{from:2,to:2,name:"diamonds"},{from:3,to:3,name:"clubs"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:1981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:1981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:2053,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:2053,w:72,h:72},meta:{duration:100}}]},{name:"swiggle",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"small"}],packs:[{frame:{x:4,y:4,w:1263,h:813},packed:{x:1578,y:0,w:1271,h:821},meta:{duration:100}},{frame:{x:4,y:4,w:1263,h:813},packed:{x:0,y:1088,w:1271,h:821},meta:{duration:100}}]},{name:"tab3_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"active"}],packs:[{frame:{x:4,y:4,w:440,h:150},packed:{x:601,y:3305,w:448,h:158},meta:{duration:100}},{frame:{x:4,y:4,w:440,h:150},packed:{x:1049,y:3305,w:448,h:158},meta:{duration:100}},{frame:{x:4,y:4,w:440,h:150},packed:{x:1497,y:3305,w:448,h:158},meta:{duration:100}}]}],Za={sprites:Ja},ti=""+new URL("out_0-1e3dd4e6.png",import.meta.url).href,ei=[],si={scale:.0625,descent:-568,ascent:1992,line_gap:0,name:"Capriola"},ai=[{glyph:22,width:0,height:0,advance:32.0625,offset_x:0,offset_y:0,scale:.0625,has_glyph:0},{glyph:23,width:23,height:102,advance:42.75,offset_x:10.9375,offset_y:-100,scale:.0625,has_glyph:1},{glyph:24,width:42,height:40,advance:53.1875,offset_x:6.3125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:25,width:77,height:87,advance:85.125,offset_x:3.5,offset_y:-89,scale:.0625,has_glyph:1},{glyph:26,width:57,height:127,advance:64,offset_x:3.4375,offset_y:-107,scale:.0625,has_glyph:1},{glyph:27,width:118,height:103,advance:127.6875,offset_x:5.875,offset_y:-101,scale:.0625,has_glyph:1},{glyph:28,width:71,height:94,advance:85.0625,offset_x:9.3125,offset_y:-92,scale:.0625,has_glyph:1},{glyph:29,width:16,height:40,advance:31.9375,offset_x:8.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:30,width:35,height:141,advance:53.375,offset_x:10.25,offset_y:-120,scale:.0625,has_glyph:1},{glyph:31,width:36,height:141,advance:53.375,offset_x:8.3125,offset_y:-120,scale:.0625,has_glyph:1},{glyph:32,width:73,height:67,advance:85.1875,offset_x:6.3125,offset_y:-119,scale:.0625,has_glyph:1},{glyph:33,width:69,height:69,advance:85.1875,offset_x:8.25,offset_y:-72,scale:.0625,has_glyph:1},{glyph:34,width:23,height:47,advance:32.0625,offset_x:4,offset_y:-21,scale:.0625,has_glyph:1},{glyph:35,width:46,height:13,advance:74.5625,offset_x:14.8125,offset_y:-44,scale:.0625,has_glyph:1},{glyph:36,width:22,height:23,advance:32.0625,offset_x:5.375,offset_y:-21,scale:.0625,has_glyph:1},{glyph:37,width:40,height:111,advance:53.3125,offset_x:9.375,offset_y:-102,scale:.0625,has_glyph:1},{glyph:38,width:71,height:79,advance:85.1875,offset_x:7.5625,offset_y:-77,scale:.0625,has_glyph:1},{glyph:39,width:35,height:76,advance:53.0625,offset_x:3.9375,offset_y:-76,scale:.0625,has_glyph:1},{glyph:40,width:59,height:77,advance:74.625,offset_x:8,offset_y:-77,scale:.0625,has_glyph:1},{glyph:41,width:61,height:94,advance:74.625,offset_x:5.9375,offset_y:-77,scale:.0625,has_glyph:1},{glyph:42,width:69,height:94,advance:74.0625,offset_x:5.4375,offset_y:-79,scale:.0625,has_glyph:1},{glyph:43,width:65,height:92,advance:74.5625,offset_x:7.6875,offset_y:-75,scale:.0625,has_glyph:1},{glyph:44,width:65,height:93,advance:74.5625,offset_x:5.9375,offset_y:-91,scale:.0625,has_glyph:1},{glyph:45,width:57,height:92,advance:63.8125,offset_x:3.125,offset_y:-75,scale:.0625,has_glyph:1},{glyph:46,width:64,height:93,advance:74.5625,offset_x:5.8125,offset_y:-91,scale:.0625,has_glyph:1},{glyph:47,width:65,height:94,advance:74.5625,offset_x:3.625,offset_y:-77,scale:.0625,has_glyph:1},{glyph:48,width:23,height:72,advance:31.9375,offset_x:4.9375,offset_y:-70,scale:.0625,has_glyph:1},{glyph:49,width:23,height:96,advance:32.0625,offset_x:4.1875,offset_y:-70,scale:.0625,has_glyph:1},{glyph:50,width:65,height:62,advance:85.25,offset_x:9.3125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:51,width:67,height:41,advance:85.1875,offset_x:9.8125,offset_y:-58,scale:.0625,has_glyph:1},{glyph:52,width:65,height:62,advance:85.25,offset_x:11.8125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:53,width:59,height:103,advance:74.9375,offset_x:8.375,offset_y:-101,scale:.0625,has_glyph:1},{glyph:54,width:94,height:106,advance:106.3125,offset_x:7.5,offset_y:-82,scale:.0625,has_glyph:1},{glyph:55,width:88,height:96,advance:96,offset_x:4.25,offset_y:-96,scale:.0625,has_glyph:1},{glyph:56,width:73,height:96,advance:95.0625,offset_x:14.875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:57,width:77,height:100,advance:85.125,offset_x:6.9375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:58,width:76,height:96,advance:95.8125,offset_x:14.875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:59,width:63,height:96,advance:85.125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:60,width:59,height:96,advance:74.375,offset_x:14.75,offset_y:-96,scale:.0625,has_glyph:1},{glyph:61,width:82,height:100,advance:95.8125,offset_x:8.6875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:62,width:79,height:96,advance:106.1875,offset_x:14.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:63,width:17,height:96,advance:42.6875,offset_x:13.5,offset_y:-96,scale:.0625,has_glyph:1},{glyph:64,width:41,height:98,advance:53.125,offset_x:1.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:65,width:74,height:102,advance:85.25,offset_x:13.5,offset_y:-97,scale:.0625,has_glyph:1},{glyph:66,width:54,height:96,advance:74.6875,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:67,width:113,height:96,advance:127.4375,offset_x:8.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:68,width:77,height:96,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:69,width:93,height:100,advance:106.8125,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:70,width:68,height:96,advance:85,offset_x:14.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:71,width:98,height:118,advance:106.4375,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:72,width:76,height:98,advance:95.8125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:73,width:63,height:100,advance:74.625,offset_x:6.875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:74,width:70,height:96,advance:74.5,offset_x:2.75,offset_y:-96,scale:.0625,has_glyph:1},{glyph:75,width:77,height:98,advance:95.5625,offset_x:9.6875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:76,width:83,height:96,advance:85.25,offset_x:1.5625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:77,width:126,height:96,advance:138.3125,offset_x:6.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:78,width:78,height:96,advance:85.1875,offset_x:4,offset_y:-96,scale:.0625,has_glyph:1},{glyph:79,width:84,height:96,advance:84.6875,offset_x:1,offset_y:-96,scale:.0625,has_glyph:1},{glyph:80,width:67,height:96,advance:74.5625,offset_x:4.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:81,width:33,height:140,advance:53.375,offset_x:12.9375,offset_y:-119,scale:.0625,has_glyph:1},{glyph:82,width:40,height:111,advance:53.3125,offset_x:4.0625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:83,width:33,height:140,advance:53.375,offset_x:8.5,offset_y:-119,scale:.0625,has_glyph:1},{glyph:84,width:60,height:65,advance:63.875,offset_x:2.5625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:85,width:104,height:13,advance:95.8125,offset_x:-3.625,offset_y:10,scale:.0625,has_glyph:1},{glyph:86,width:33,height:28,advance:42.9375,offset_x:.875,offset_y:-108,scale:.0625,has_glyph:1},{glyph:87,width:63,height:75,advance:74.6875,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:88,width:67,height:113,advance:85.3125,offset_x:12.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:89,width:61,height:77,advance:74.5625,offset_x:7.5625,offset_y:-73,scale:.0625,has_glyph:1},{glyph:90,width:70,height:113,advance:85.25,offset_x:6.9375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:91,width:61,height:75,advance:74.6875,offset_x:7.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:92,width:54,height:112,advance:53.1875,offset_x:4.75,offset_y:-112,scale:.0625,has_glyph:1},{glyph:93,width:66,height:120,advance:74.5625,offset_x:6.8125,offset_y:-84,scale:.0625,has_glyph:1},{glyph:94,width:62,height:111,advance:85.25,offset_x:13.375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:95,width:32,height:105,advance:42.6875,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:96,width:36,height:139,advance:42.6875,offset_x:-3.625,offset_y:-103,scale:.0625,has_glyph:1},{glyph:97,width:62,height:113,advance:74.75,offset_x:11.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:98,width:30,height:113,advance:42.6875,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:99,width:106,height:73,advance:127.6875,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:100,width:63,height:73,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:101,width:71,height:75,advance:85.375,offset_x:7.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:102,width:69,height:109,advance:85.3125,offset_x:10.3125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:103,width:66,height:109,advance:85.3125,offset_x:7.4375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:104,width:45,height:73,advance:53.3125,offset_x:9.9375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:105,width:51,height:75,advance:64,offset_x:7.25,offset_y:-73,scale:.0625,has_glyph:1},{glyph:106,width:50,height:91,advance:53.1875,offset_x:3.9375,offset_y:-89,scale:.0625,has_glyph:1},{glyph:107,width:64,height:73,advance:85.25,offset_x:11.8125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:108,width:66,height:72,advance:74.75,offset_x:4.4375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:109,width:107,height:72,advance:116.9375,offset_x:4.5,offset_y:-71,scale:.0625,has_glyph:1},{glyph:110,width:61,height:71,advance:63.9375,offset_x:1.5625,offset_y:-71,scale:.0625,has_glyph:1},{glyph:111,width:66,height:107,advance:74.5625,offset_x:4.5,offset_y:-71,scale:.0625,has_glyph:1},{glyph:112,width:54,height:71,advance:63.9375,offset_x:5.4375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:113,width:42,height:144,advance:64,offset_x:15,offset_y:-120,scale:.0625,has_glyph:1},{glyph:114,width:14,height:139,advance:42.6875,offset_x:14.6875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:115,width:42,height:144,advance:64,offset_x:7.8125,offset_y:-120,scale:.0625,has_glyph:1},{glyph:116,width:78,height:27,advance:106.6875,offset_x:15.375,offset_y:-53,scale:.0625,has_glyph:1},{glyph:118,width:23,height:102,advance:42.75,offset_x:10.875,offset_y:-70,scale:.0625,has_glyph:1},{glyph:119,width:61,height:112,advance:74.5625,offset_x:7.5625,offset_y:-92,scale:.0625,has_glyph:1},{glyph:120,width:56,height:91,advance:63.6875,offset_x:6.9375,offset_y:-91,scale:.0625,has_glyph:1},{glyph:121,width:66,height:66,advance:74.5625,offset_x:4.3125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:122,width:79,height:90,advance:85.1875,offset_x:3.0625,offset_y:-90,scale:.0625,has_glyph:1},{glyph:123,width:14,height:138,advance:42.6875,offset_x:14.6875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:124,width:66,height:142,advance:85.1875,offset_x:9.3125,offset_y:-113,scale:.0625,has_glyph:1},{glyph:125,width:51,height:20,advance:65,offset_x:7.75,offset_y:-102,scale:.0625,has_glyph:1},{glyph:126,width:97,height:97,advance:106.5,offset_x:5.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:127,width:51,height:61,advance:74.6875,offset_x:7.4375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:128,width:77,height:63,advance:95.875,offset_x:9.8125,offset_y:-67,scale:.0625,has_glyph:1},{glyph:129,width:75,height:40,advance:95.8125,offset_x:8.25,offset_y:-54,scale:.0625,has_glyph:1},{glyph:130,width:0,height:0,advance:106.6875,offset_x:0,offset_y:0,scale:.0625,has_glyph:0},{glyph:131,width:97,height:97,advance:106.5,offset_x:5.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:132,width:39,height:14,advance:42.6875,offset_x:2.4375,offset_y:-99,scale:.0625,has_glyph:1},{glyph:133,width:47,height:49,advance:53.3125,offset_x:3.1875,offset_y:-105,scale:.0625,has_glyph:1},{glyph:134,width:69,height:77,advance:85.1875,offset_x:8.25,offset_y:-77,scale:.0625,has_glyph:1},{glyph:135,width:49,height:64,advance:63.6875,offset_x:6.25,offset_y:-117,scale:.0625,has_glyph:1},{glyph:136,width:49,height:66,advance:63.75,offset_x:6.9375,offset_y:-117,scale:.0625,has_glyph:1},{glyph:137,width:34,height:28,advance:42.9375,offset_x:10.875,offset_y:-108,scale:.0625,has_glyph:1},{glyph:138,width:64,height:105,advance:85.25,offset_x:11.8125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:139,width:69,height:96,advance:96,offset_x:13.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:140,width:22,height:23,advance:32.0625,offset_x:5.375,offset_y:-49,scale:.0625,has_glyph:1},{glyph:141,width:32,height:33,advance:31.6875,offset_x:-11.4375,offset_y:-3,scale:.0625,has_glyph:1},{glyph:142,width:31,height:64,advance:42.4375,offset_x:1.8125,offset_y:-117,scale:.0625,has_glyph:1},{glyph:143,width:54,height:61,advance:63.9375,offset_x:5.3125,offset_y:-98,scale:.0625,has_glyph:1},{glyph:144,width:78,height:63,advance:95.875,offset_x:9.3125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:145,width:121,height:105,advance:138.3125,offset_x:9.3125,offset_y:-103,scale:.0625,has_glyph:1},{glyph:146,width:122,height:105,advance:148.8125,offset_x:9.3125,offset_y:-103,scale:.0625,has_glyph:1},{glyph:147,width:134,height:105,advance:148.9375,offset_x:6.9375,offset_y:-103,scale:.0625,has_glyph:1},{glyph:148,width:59,height:103,advance:74.9375,offset_x:8.3125,offset_y:-70,scale:.0625,has_glyph:1},{glyph:149,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:150,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:151,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:152,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:153,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:154,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:155,width:105,height:96,advance:117.0625,offset_x:4.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:156,width:77,height:128,advance:95.6875,offset_x:6.9375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:157,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:158,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:159,width:63,height:124,advance:85.125,offset_x:14.625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:160,width:63,height:124,advance:85.125,offset_x:14.625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:161,width:35,height:125,advance:42.6875,offset_x:-.75,offset_y:-125,scale:.0625,has_glyph:1},{glyph:162,width:36,height:125,advance:42.6875,offset_x:10.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:163,width:45,height:124,advance:42.6875,offset_x:-.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:164,width:51,height:124,advance:42.6875,offset_x:-3.75,offset_y:-124,scale:.0625,has_glyph:1},{glyph:165,width:87,height:96,advance:95.8125,offset_x:3.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:166,width:77,height:125,advance:106.3125,offset_x:15.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:167,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:168,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:169,width:93,height:126,advance:106.8125,offset_x:7.1875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:170,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:171,width:93,height:126,advance:106.8125,offset_x:7.1875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:172,width:55,height:55,advance:74.5625,offset_x:10.625,offset_y:-65,scale:.0625,has_glyph:1},{glyph:173,width:93,height:108,advance:106.8125,offset_x:7.1875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:174,width:77,height:127,advance:106.125,offset_x:15,offset_y:-125,scale:.0625,has_glyph:1},{glyph:175,width:77,height:127,advance:106.125,offset_x:15,offset_y:-125,scale:.0625,has_glyph:1},{glyph:176,width:77,height:126,advance:106.125,offset_x:15,offset_y:-124,scale:.0625,has_glyph:1},{glyph:177,width:77,height:126,advance:106.125,offset_x:15,offset_y:-124,scale:.0625,has_glyph:1},{glyph:178,width:84,height:125,advance:84.6875,offset_x:1,offset_y:-125,scale:.0625,has_glyph:1},{glyph:179,width:68,height:96,advance:85,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:180,width:77,height:114,advance:95.8125,offset_x:14.6875,offset_y:-112,scale:.0625,has_glyph:1},{glyph:181,width:63,height:110,advance:74.6875,offset_x:6.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:182,width:63,height:110,advance:74.6875,offset_x:6.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:183,width:63,height:109,advance:74.6875,offset_x:6.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:184,width:63,height:106,advance:74.6875,offset_x:6.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:185,width:63,height:104,advance:74.6875,offset_x:6.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:186,width:63,height:115,advance:74.6875,offset_x:6.125,offset_y:-113,scale:.0625,has_glyph:1},{glyph:187,width:104,height:75,advance:117.125,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:188,width:61,height:103,advance:74.5625,offset_x:7.5625,offset_y:-73,scale:.0625,has_glyph:1},{glyph:189,width:61,height:110,advance:74.6875,offset_x:7.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:190,width:61,height:110,advance:74.6875,offset_x:7.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:191,width:61,height:109,advance:74.6875,offset_x:7.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:192,width:61,height:104,advance:74.6875,offset_x:7.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:193,width:42,height:110,advance:42.6875,offset_x:-1.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:194,width:33,height:110,advance:42.6875,offset_x:9.4375,offset_y:-108,scale:.0625,has_glyph:1},{glyph:195,width:44,height:109,advance:42.6875,offset_x:-2,offset_y:-107,scale:.0625,has_glyph:1},{glyph:196,width:51,height:104,advance:42.6875,offset_x:-5.5625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:197,width:71,height:120,advance:85.1875,offset_x:8.1875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:198,width:63,height:104,advance:85.25,offset_x:11.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:199,width:71,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:200,width:71,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:201,width:71,height:109,advance:85.375,offset_x:7.5,offset_y:-107,scale:.0625,has_glyph:1},{glyph:202,width:71,height:106,advance:85.375,offset_x:7.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:203,width:71,height:104,advance:85.375,offset_x:7.5,offset_y:-102,scale:.0625,has_glyph:1},{glyph:204,width:69,height:72,advance:85.1875,offset_x:8.1875,offset_y:-73,scale:.0625,has_glyph:1},{glyph:205,width:71,height:85,advance:85.375,offset_x:7.5,offset_y:-78,scale:.0625,has_glyph:1},{glyph:206,width:64,height:110,advance:85.25,offset_x:11.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:207,width:64,height:110,advance:85.25,offset_x:11.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:208,width:64,height:109,advance:85.25,offset_x:11.8125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:209,width:64,height:104,advance:85.25,offset_x:11.8125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:210,width:66,height:144,advance:74.5625,offset_x:4.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:211,width:67,height:147,advance:85.5,offset_x:12.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:212,width:66,height:138,advance:74.5625,offset_x:4.6875,offset_y:-102,scale:.0625,has_glyph:1},{glyph:213,width:88,height:121,advance:96,offset_x:4.25,offset_y:-121,scale:.0625,has_glyph:1},{glyph:214,width:63,height:101,advance:74.6875,offset_x:6.125,offset_y:-99,scale:.0625,has_glyph:1},{glyph:215,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:216,width:63,height:106,advance:74.6875,offset_x:6.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:217,width:91,height:126,advance:96,offset_x:4.25,offset_y:-96,scale:.0625,has_glyph:1},{glyph:218,width:64,height:103,advance:74.6875,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:219,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:220,width:61,height:112,advance:74.5625,offset_x:7.5625,offset_y:-108,scale:.0625,has_glyph:1},{glyph:221,width:77,height:126,advance:85.125,offset_x:6.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:222,width:61,height:111,advance:74.5625,offset_x:7.5625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:223,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:224,width:61,height:106,advance:74.5625,offset_x:7.5625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:225,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:226,width:61,height:111,advance:74.5625,offset_x:7.5625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:227,width:76,height:125,advance:95.8125,offset_x:14.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:228,width:95,height:114,advance:95.8125,offset_x:6.9375,offset_y:-112,scale:.0625,has_glyph:1},{glyph:229,width:87,height:96,advance:95.8125,offset_x:3.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:230,width:78,height:113,advance:85.25,offset_x:6.9375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:231,width:63,height:121,advance:85.125,offset_x:14.625,offset_y:-121,scale:.0625,has_glyph:1},{glyph:232,width:61,height:101,advance:74.6875,offset_x:7.125,offset_y:-99,scale:.0625,has_glyph:1},{glyph:233,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:234,width:61,height:106,advance:74.6875,offset_x:7.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:235,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:236,width:61,height:104,advance:74.6875,offset_x:7.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:237,width:63,height:126,advance:85.125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:238,width:61,height:103,advance:74.6875,offset_x:7.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:239,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:240,width:61,height:109,advance:74.6875,offset_x:7.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:241,width:82,height:126,advance:95.8125,offset_x:8.6875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:242,width:66,height:143,advance:74.5625,offset_x:6.8125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:243,width:82,height:127,advance:95.8125,offset_x:8.6875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:244,width:66,height:140,advance:74.5625,offset_x:6.8125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:245,width:82,height:127,advance:95.8125,offset_x:8.6875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:246,width:66,height:138,advance:74.5625,offset_x:6.8125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:247,width:82,height:134,advance:95.8125,offset_x:8.6875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:248,width:66,height:146,advance:74.5625,offset_x:6.8125,offset_y:-110,scale:.0625,has_glyph:1},{glyph:249,width:79,height:124,advance:106.1875,offset_x:14.125,offset_y:-124,scale:.0625,has_glyph:1},{glyph:250,width:62,height:124,advance:85.25,offset_x:13.375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:251,width:95,height:96,advance:106.1875,offset_x:5.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:252,width:74,height:111,advance:85.25,offset_x:1.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:253,width:49,height:125,advance:42.6875,offset_x:-2.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:254,width:49,height:106,advance:42.6875,offset_x:-3.3125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:255,width:39,height:121,advance:42.6875,offset_x:2.375,offset_y:-121,scale:.0625,has_glyph:1},{glyph:256,width:40,height:101,advance:42.6875,offset_x:.1875,offset_y:-99,scale:.0625,has_glyph:1},{glyph:257,width:43,height:125,advance:42.6875,offset_x:0,offset_y:-125,scale:.0625,has_glyph:1},{glyph:258,width:44,height:106,advance:42.6875,offset_x:-1.75,offset_y:-104,scale:.0625,has_glyph:1},{glyph:259,width:29,height:126,advance:42.6875,offset_x:7.8125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:260,width:32,height:133,advance:42.6875,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:261,width:21,height:125,advance:42.6875,offset_x:11.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:262,width:29,height:73,advance:42.6875,offset_x:11.375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:263,width:72,height:98,advance:95.8125,offset_x:13.5,offset_y:-96,scale:.0625,has_glyph:1},{glyph:264,width:67,height:139,advance:85.375,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:265,width:55,height:126,advance:53.125,offset_x:1.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:266,width:47,height:143,advance:42.6875,offset_x:-3.625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:267,width:74,height:133,advance:85.25,offset_x:13.5,offset_y:-97,scale:.0625,has_glyph:1},{glyph:268,width:62,height:147,advance:74.75,offset_x:11.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:269,width:62,height:75,advance:74.75,offset_x:11.875,offset_y:-73,scale:.0625,has_glyph:1},{glyph:270,width:54,height:125,advance:74.6875,offset_x:14.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:271,width:36,height:127,advance:42.6875,offset_x:10.75,offset_y:-125,scale:.0625,has_glyph:1},{glyph:272,width:54,height:132,advance:74.6875,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:273,width:30,height:147,advance:42.6875,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:274,width:54,height:97,advance:74.6875,offset_x:14.9375,offset_y:-97,scale:.0625,has_glyph:1},{glyph:275,width:43,height:114,advance:53.5625,offset_x:11.6875,offset_y:-112,scale:.0625,has_glyph:1},{glyph:276,width:55,height:96,advance:74.6875,offset_x:15,offset_y:-96,scale:.0625,has_glyph:1},{glyph:277,width:56,height:113,advance:74.75,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:278,width:64,height:96,advance:74.6875,offset_x:4.375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:279,width:41,height:113,advance:42.6875,offset_x:1.5,offset_y:-111,scale:.0625,has_glyph:1},{glyph:280,width:77,height:125,advance:106.3125,offset_x:15.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:281,width:63,height:108,advance:85.25,offset_x:11.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:282,width:77,height:132,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:283,width:63,height:109,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:284,width:77,height:124,advance:106.3125,offset_x:15.0625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:285,width:63,height:107,advance:85.25,offset_x:11.5,offset_y:-107,scale:.0625,has_glyph:1},{glyph:286,width:77,height:132,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:287,width:63,height:109,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:288,width:93,height:123,advance:106.8125,offset_x:7.1875,offset_y:-121,scale:.0625,has_glyph:1},{glyph:289,width:71,height:101,advance:85.375,offset_x:7.5,offset_y:-99,scale:.0625,has_glyph:1},{glyph:290,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:291,width:71,height:106,advance:85.375,offset_x:7.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:292,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:293,width:73,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:294,width:123,height:100,advance:138.3125,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:295,width:114,height:75,advance:127.75,offset_x:7.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:296,width:76,height:127,advance:95.8125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:297,width:45,height:108,advance:53.3125,offset_x:9.9375,offset_y:-108,scale:.0625,has_glyph:1},{glyph:298,width:76,height:132,advance:95.8125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:299,width:45,height:109,advance:53.3125,offset_x:9.9375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:300,width:76,height:127,advance:95.8125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:301,width:46,height:107,advance:53.3125,offset_x:8.375,offset_y:-107,scale:.0625,has_glyph:1},{glyph:302,width:63,height:127,advance:74.625,offset_x:6.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:303,width:51,height:110,advance:64,offset_x:7.25,offset_y:-108,scale:.0625,has_glyph:1},{glyph:304,width:63,height:126,advance:74.625,offset_x:6.875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:305,width:51,height:109,advance:64,offset_x:7.25,offset_y:-107,scale:.0625,has_glyph:1},{glyph:306,width:63,height:128,advance:74.625,offset_x:6.875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:307,width:51,height:103,advance:64,offset_x:7.25,offset_y:-73,scale:.0625,has_glyph:1},{glyph:308,width:63,height:127,advance:74.625,offset_x:6.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:309,width:51,height:109,advance:64,offset_x:7.25,offset_y:-107,scale:.0625,has_glyph:1},{glyph:310,width:70,height:132,advance:74.5,offset_x:2.75,offset_y:-96,scale:.0625,has_glyph:1}],ii=[{glyph:22,codepoint:32},{glyph:23,codepoint:33},{glyph:24,codepoint:34},{glyph:25,codepoint:35},{glyph:26,codepoint:36},{glyph:27,codepoint:37},{glyph:28,codepoint:38},{glyph:29,codepoint:39},{glyph:30,codepoint:40},{glyph:31,codepoint:41},{glyph:32,codepoint:42},{glyph:33,codepoint:43},{glyph:34,codepoint:44},{glyph:35,codepoint:45},{glyph:36,codepoint:46},{glyph:37,codepoint:47},{glyph:38,codepoint:48},{glyph:39,codepoint:49},{glyph:40,codepoint:50},{glyph:41,codepoint:51},{glyph:42,codepoint:52},{glyph:43,codepoint:53},{glyph:44,codepoint:54},{glyph:45,codepoint:55},{glyph:46,codepoint:56},{glyph:47,codepoint:57},{glyph:48,codepoint:58},{glyph:49,codepoint:59},{glyph:50,codepoint:60},{glyph:51,codepoint:61},{glyph:52,codepoint:62},{glyph:53,codepoint:63},{glyph:54,codepoint:64},{glyph:55,codepoint:65},{glyph:56,codepoint:66},{glyph:57,codepoint:67},{glyph:58,codepoint:68},{glyph:59,codepoint:69},{glyph:60,codepoint:70},{glyph:61,codepoint:71},{glyph:62,codepoint:72},{glyph:63,codepoint:73},{glyph:64,codepoint:74},{glyph:65,codepoint:75},{glyph:66,codepoint:76},{glyph:67,codepoint:77},{glyph:68,codepoint:78},{glyph:69,codepoint:79},{glyph:70,codepoint:80},{glyph:71,codepoint:81},{glyph:72,codepoint:82},{glyph:73,codepoint:83},{glyph:74,codepoint:84},{glyph:75,codepoint:85},{glyph:76,codepoint:86},{glyph:77,codepoint:87},{glyph:78,codepoint:88},{glyph:79,codepoint:89},{glyph:80,codepoint:90},{glyph:81,codepoint:91},{glyph:82,codepoint:92},{glyph:83,codepoint:93},{glyph:84,codepoint:94},{glyph:85,codepoint:95},{glyph:86,codepoint:96},{glyph:87,codepoint:97},{glyph:88,codepoint:98},{glyph:89,codepoint:99},{glyph:90,codepoint:100},{glyph:91,codepoint:101},{glyph:92,codepoint:102},{glyph:93,codepoint:103},{glyph:94,codepoint:104},{glyph:95,codepoint:105},{glyph:96,codepoint:106},{glyph:97,codepoint:107},{glyph:98,codepoint:108},{glyph:99,codepoint:109},{glyph:100,codepoint:110},{glyph:101,codepoint:111},{glyph:102,codepoint:112},{glyph:103,codepoint:113},{glyph:104,codepoint:114},{glyph:105,codepoint:115},{glyph:106,codepoint:116},{glyph:107,codepoint:117},{glyph:108,codepoint:118},{glyph:109,codepoint:119},{glyph:110,codepoint:120},{glyph:111,codepoint:121},{glyph:112,codepoint:122},{glyph:113,codepoint:123},{glyph:114,codepoint:124},{glyph:115,codepoint:125},{glyph:116,codepoint:126},{glyph:118,codepoint:161},{glyph:119,codepoint:162},{glyph:120,codepoint:163},{glyph:121,codepoint:164},{glyph:122,codepoint:165},{glyph:123,codepoint:166},{glyph:124,codepoint:167},{glyph:125,codepoint:168},{glyph:126,codepoint:169},{glyph:127,codepoint:170},{glyph:128,codepoint:171},{glyph:129,codepoint:172},{glyph:130,codepoint:173},{glyph:131,codepoint:174},{glyph:132,codepoint:175},{glyph:133,codepoint:176},{glyph:134,codepoint:177},{glyph:135,codepoint:178},{glyph:136,codepoint:179},{glyph:137,codepoint:180},{glyph:138,codepoint:181},{glyph:139,codepoint:182},{glyph:140,codepoint:183},{glyph:141,codepoint:184},{glyph:142,codepoint:185},{glyph:143,codepoint:186},{glyph:144,codepoint:187},{glyph:145,codepoint:188},{glyph:146,codepoint:189},{glyph:147,codepoint:190},{glyph:148,codepoint:191},{glyph:149,codepoint:192},{glyph:150,codepoint:193},{glyph:151,codepoint:194},{glyph:152,codepoint:195},{glyph:153,codepoint:196},{glyph:154,codepoint:197},{glyph:155,codepoint:198},{glyph:156,codepoint:199},{glyph:157,codepoint:200},{glyph:158,codepoint:201},{glyph:159,codepoint:202},{glyph:160,codepoint:203},{glyph:161,codepoint:204},{glyph:162,codepoint:205},{glyph:163,codepoint:206},{glyph:164,codepoint:207},{glyph:165,codepoint:208},{glyph:166,codepoint:209},{glyph:167,codepoint:210},{glyph:168,codepoint:211},{glyph:169,codepoint:212},{glyph:170,codepoint:213},{glyph:171,codepoint:214},{glyph:172,codepoint:215},{glyph:173,codepoint:216},{glyph:174,codepoint:217},{glyph:175,codepoint:218},{glyph:176,codepoint:219},{glyph:177,codepoint:220},{glyph:178,codepoint:221},{glyph:179,codepoint:222},{glyph:180,codepoint:223},{glyph:181,codepoint:224},{glyph:182,codepoint:225},{glyph:183,codepoint:226},{glyph:184,codepoint:227},{glyph:185,codepoint:228},{glyph:186,codepoint:229},{glyph:187,codepoint:230},{glyph:188,codepoint:231},{glyph:189,codepoint:232},{glyph:190,codepoint:233},{glyph:191,codepoint:234},{glyph:192,codepoint:235},{glyph:193,codepoint:236},{glyph:194,codepoint:237},{glyph:195,codepoint:238},{glyph:196,codepoint:239},{glyph:197,codepoint:240},{glyph:198,codepoint:241},{glyph:199,codepoint:242},{glyph:200,codepoint:243},{glyph:201,codepoint:244},{glyph:202,codepoint:245},{glyph:203,codepoint:246},{glyph:204,codepoint:247},{glyph:205,codepoint:248},{glyph:206,codepoint:249},{glyph:207,codepoint:250},{glyph:208,codepoint:251},{glyph:209,codepoint:252},{glyph:210,codepoint:253},{glyph:211,codepoint:254},{glyph:212,codepoint:255},{glyph:213,codepoint:256},{glyph:214,codepoint:257},{glyph:215,codepoint:258},{glyph:216,codepoint:259},{glyph:217,codepoint:260},{glyph:218,codepoint:261},{glyph:219,codepoint:262},{glyph:220,codepoint:263},{glyph:221,codepoint:264},{glyph:222,codepoint:265},{glyph:223,codepoint:266},{glyph:224,codepoint:267},{glyph:225,codepoint:268},{glyph:226,codepoint:269},{glyph:227,codepoint:270},{glyph:228,codepoint:271},{glyph:229,codepoint:272},{glyph:230,codepoint:273},{glyph:231,codepoint:274},{glyph:232,codepoint:275},{glyph:233,codepoint:276},{glyph:234,codepoint:277},{glyph:235,codepoint:278},{glyph:236,codepoint:279},{glyph:237,codepoint:280},{glyph:238,codepoint:281},{glyph:239,codepoint:282},{glyph:240,codepoint:283},{glyph:241,codepoint:284},{glyph:242,codepoint:285},{glyph:243,codepoint:286},{glyph:244,codepoint:287},{glyph:245,codepoint:288},{glyph:246,codepoint:289},{glyph:247,codepoint:290},{glyph:248,codepoint:291},{glyph:249,codepoint:292},{glyph:250,codepoint:293},{glyph:251,codepoint:294},{glyph:252,codepoint:295},{glyph:253,codepoint:296},{glyph:254,codepoint:297},{glyph:255,codepoint:298},{glyph:256,codepoint:299},{glyph:257,codepoint:300},{glyph:258,codepoint:301},{glyph:259,codepoint:302},{glyph:260,codepoint:303},{glyph:261,codepoint:304},{glyph:262,codepoint:305},{glyph:263,codepoint:306},{glyph:264,codepoint:307},{glyph:265,codepoint:308},{glyph:266,codepoint:309},{glyph:267,codepoint:310},{glyph:268,codepoint:311},{glyph:269,codepoint:312},{glyph:270,codepoint:313},{glyph:271,codepoint:314},{glyph:272,codepoint:315},{glyph:273,codepoint:316},{glyph:274,codepoint:317},{glyph:275,codepoint:318},{glyph:276,codepoint:319},{glyph:277,codepoint:320},{glyph:278,codepoint:321},{glyph:279,codepoint:322},{glyph:280,codepoint:323},{glyph:281,codepoint:324},{glyph:282,codepoint:325},{glyph:283,codepoint:326},{glyph:284,codepoint:327},{glyph:285,codepoint:328},{glyph:286,codepoint:330},{glyph:287,codepoint:331},{glyph:288,codepoint:332},{glyph:289,codepoint:333},{glyph:290,codepoint:334},{glyph:291,codepoint:335},{glyph:292,codepoint:336},{glyph:293,codepoint:337},{glyph:294,codepoint:338},{glyph:295,codepoint:339},{glyph:296,codepoint:340},{glyph:297,codepoint:341},{glyph:298,codepoint:342},{glyph:299,codepoint:343},{glyph:300,codepoint:344},{glyph:301,codepoint:345},{glyph:302,codepoint:346},{glyph:303,codepoint:347},{glyph:304,codepoint:348},{glyph:305,codepoint:349},{glyph:306,codepoint:350},{glyph:307,codepoint:351},{glyph:308,codepoint:352},{glyph:309,codepoint:353},{glyph:310,codepoint:354}],hi=[{glyph:23,frame:{x:2,y:2,w:23,h:102},packed:{x:253,y:1014,w:27,h:106}},{glyph:24,frame:{x:2,y:2,w:42,h:40},packed:{x:1354,y:1413,w:46,h:44}},{glyph:25,frame:{x:2,y:2,w:77,h:87},packed:{x:0,y:1322,w:81,h:91}},{glyph:26,frame:{x:2,y:2,w:57,h:127},packed:{x:383,y:151,w:61,h:131}},{glyph:27,frame:{x:2,y:2,w:118,h:103},packed:{x:1196,y:904,w:122,h:107}},{glyph:28,frame:{x:2,y:2,w:71,h:94},packed:{x:733,y:1222,w:75,h:98}},{glyph:29,frame:{x:2,y:2,w:16,h:40},packed:{x:1400,y:1413,w:20,h:44}},{glyph:30,frame:{x:2,y:2,w:35,h:141},packed:{x:594,y:0,w:39,h:145}},{glyph:31,frame:{x:2,y:2,w:36,h:141},packed:{x:633,y:0,w:40,h:145}},{glyph:32,frame:{x:2,y:2,w:73,h:67},packed:{x:380,y:1413,w:77,h:71}},{glyph:33,frame:{x:2,y:2,w:69,h:69},packed:{x:307,y:1413,w:73,h:73}},{glyph:34,frame:{x:2,y:2,w:23,h:47},packed:{x:1256,y:1413,w:27,h:51}},{glyph:35,frame:{x:2,y:2,w:46,h:13},packed:{x:232,y:1489,w:50,h:17}},{glyph:36,frame:{x:2,y:2,w:22,h:23},packed:{x:82,y:1489,w:26,h:27}},{glyph:37,frame:{x:2,y:2,w:40,h:111},packed:{x:188,y:675,w:44,h:115}},{glyph:38,frame:{x:2,y:2,w:71,h:79},packed:{x:156,y:1322,w:75,h:83}},{glyph:39,frame:{x:2,y:2,w:35,h:76},packed:{x:432,y:1322,w:39,h:80}},{glyph:40,frame:{x:2,y:2,w:59,h:77},packed:{x:231,y:1322,w:63,h:81}},{glyph:41,frame:{x:2,y:2,w:61,h:94},packed:{x:808,y:1222,w:65,h:98}},{glyph:42,frame:{x:2,y:2,w:69,h:94},packed:{x:873,y:1222,w:73,h:98}},{glyph:43,frame:{x:2,y:2,w:65,h:92},packed:{x:1152,y:1222,w:69,h:96}},{glyph:44,frame:{x:2,y:2,w:65,h:93},packed:{x:1015,y:1222,w:69,h:97}},{glyph:45,frame:{x:2,y:2,w:57,h:92},packed:{x:1221,y:1222,w:61,h:96}},{glyph:46,frame:{x:2,y:2,w:64,h:93},packed:{x:1084,y:1222,w:68,h:97}},{glyph:47,frame:{x:2,y:2,w:65,h:94},packed:{x:946,y:1222,w:69,h:98}},{glyph:48,frame:{x:2,y:2,w:23,h:72},packed:{x:1352,y:1322,w:27,h:76}},{glyph:49,frame:{x:2,y:2,w:23,h:96},packed:{x:159,y:1121,w:27,h:100}},{glyph:50,frame:{x:2,y:2,w:65,h:62},packed:{x:895,y:1413,w:69,h:66}},{glyph:51,frame:{x:2,y:2,w:67,h:41},packed:{x:1283,y:1413,w:71,h:45}},{glyph:52,frame:{x:2,y:2,w:65,h:62},packed:{x:964,y:1413,w:69,h:66}},{glyph:53,frame:{x:2,y:2,w:59,h:103},packed:{x:1318,y:904,w:63,h:107}},{glyph:54,frame:{x:2,y:2,w:94,h:106},packed:{x:1081,y:791,w:98,h:110}},{glyph:55,frame:{x:2,y:2,w:88,h:96},packed:{x:186,y:1121,w:92,h:100}},{glyph:56,frame:{x:2,y:2,w:73,h:96},packed:{x:278,y:1121,w:77,h:100}},{glyph:57,frame:{x:2,y:2,w:77,h:100},packed:{x:636,y:1014,w:81,h:104}},{glyph:58,frame:{x:2,y:2,w:76,h:96},packed:{x:355,y:1121,w:80,h:100}},{glyph:59,frame:{x:2,y:2,w:63,h:96},packed:{x:435,y:1121,w:67,h:100}},{glyph:60,frame:{x:2,y:2,w:59,h:96},packed:{x:502,y:1121,w:63,h:100}},{glyph:61,frame:{x:2,y:2,w:82,h:100},packed:{x:717,y:1014,w:86,h:104}},{glyph:62,frame:{x:2,y:2,w:79,h:96},packed:{x:565,y:1121,w:83,h:100}},{glyph:63,frame:{x:2,y:2,w:17,h:96},packed:{x:648,y:1121,w:21,h:100}},{glyph:64,frame:{x:2,y:2,w:41,h:98},packed:{x:1094,y:1014,w:45,h:102}},{glyph:65,frame:{x:2,y:2,w:74,h:102},packed:{x:280,y:1014,w:78,h:106}},{glyph:66,frame:{x:2,y:2,w:54,h:96},packed:{x:669,y:1121,w:58,h:100}},{glyph:67,frame:{x:2,y:2,w:113,h:96},packed:{x:727,y:1121,w:117,h:100}},{glyph:68,frame:{x:2,y:2,w:77,h:96},packed:{x:844,y:1121,w:81,h:100}},{glyph:69,frame:{x:2,y:2,w:93,h:100},packed:{x:803,y:1014,w:97,h:104}},{glyph:70,frame:{x:2,y:2,w:68,h:96},packed:{x:925,y:1121,w:72,h:100}},{glyph:71,frame:{x:2,y:2,w:98,h:118},packed:{x:674,y:547,w:102,h:122}},{glyph:72,frame:{x:2,y:2,w:76,h:98},packed:{x:1139,y:1014,w:80,h:102}},{glyph:73,frame:{x:2,y:2,w:63,h:100},packed:{x:900,y:1014,w:67,h:104}},{glyph:74,frame:{x:2,y:2,w:70,h:96},packed:{x:997,y:1121,w:74,h:100}},{glyph:75,frame:{x:2,y:2,w:77,h:98},packed:{x:1219,y:1014,w:81,h:102}},{glyph:76,frame:{x:2,y:2,w:83,h:96},packed:{x:1071,y:1121,w:87,h:100}},{glyph:77,frame:{x:2,y:2,w:126,h:96},packed:{x:1158,y:1121,w:130,h:100}},{glyph:78,frame:{x:2,y:2,w:78,h:96},packed:{x:1288,y:1121,w:82,h:100}},{glyph:79,frame:{x:2,y:2,w:84,h:96},packed:{x:1370,y:1121,w:88,h:100}},{glyph:80,frame:{x:2,y:2,w:67,h:96},packed:{x:0,y:1222,w:71,h:100}},{glyph:81,frame:{x:2,y:2,w:33,h:140},packed:{x:673,y:0,w:37,h:144}},{glyph:82,frame:{x:2,y:2,w:40,h:111},packed:{x:232,y:675,w:44,h:115}},{glyph:83,frame:{x:2,y:2,w:33,h:140},packed:{x:710,y:0,w:37,h:144}},{glyph:84,frame:{x:2,y:2,w:60,h:65},packed:{x:580,y:1413,w:64,h:69}},{glyph:85,frame:{x:2,y:2,w:104,h:13},packed:{x:282,y:1489,w:108,h:17}},{glyph:86,frame:{x:2,y:2,w:33,h:28},packed:{x:1449,y:1359,w:37,h:32}},{glyph:87,frame:{x:2,y:2,w:63,h:75},packed:{x:471,y:1322,w:67,h:79}},{glyph:88,frame:{x:2,y:2,w:67,h:113},packed:{x:1070,y:547,w:71,h:117}},{glyph:89,frame:{x:2,y:2,w:61,h:77},packed:{x:294,y:1322,w:65,h:81}},{glyph:90,frame:{x:2,y:2,w:70,h:113},packed:{x:1141,y:547,w:74,h:117}},{glyph:91,frame:{x:2,y:2,w:61,h:75},packed:{x:538,y:1322,w:65,h:79}},{glyph:92,frame:{x:2,y:2,w:54,h:112},packed:{x:0,y:675,w:58,h:116}},{glyph:93,frame:{x:2,y:2,w:66,h:120},packed:{x:529,y:547,w:70,h:124}},{glyph:94,frame:{x:2,y:2,w:62,h:111},packed:{x:276,y:675,w:66,h:115}},{glyph:95,frame:{x:2,y:2,w:32,h:105},packed:{x:241,y:904,w:36,h:109}},{glyph:96,frame:{x:2,y:2,w:36,h:139},packed:{x:817,y:0,w:40,h:143}},{glyph:97,frame:{x:2,y:2,w:62,h:113},packed:{x:1215,y:547,w:66,h:117}},{glyph:98,frame:{x:2,y:2,w:30,h:113},packed:{x:1281,y:547,w:34,h:117}},{glyph:99,frame:{x:2,y:2,w:106,h:73},packed:{x:1025,y:1322,w:110,h:77}},{glyph:100,frame:{x:2,y:2,w:63,h:73},packed:{x:1135,y:1322,w:67,h:77}},{glyph:101,frame:{x:2,y:2,w:71,h:75},packed:{x:603,y:1322,w:75,h:79}},{glyph:102,frame:{x:2,y:2,w:69,h:109},packed:{x:1315,y:675,w:73,h:113}},{glyph:103,frame:{x:2,y:2,w:66,h:109},packed:{x:1388,y:675,w:70,h:113}},{glyph:104,frame:{x:2,y:2,w:45,h:73},packed:{x:1202,y:1322,w:49,h:77}},{glyph:105,frame:{x:2,y:2,w:51,h:75},packed:{x:678,y:1322,w:55,h:79}},{glyph:106,frame:{x:2,y:2,w:50,h:91},packed:{x:1282,y:1222,w:54,h:95}},{glyph:107,frame:{x:2,y:2,w:64,h:73},packed:{x:1251,y:1322,w:68,h:77}},{glyph:108,frame:{x:2,y:2,w:66,h:72},packed:{x:1379,y:1322,w:70,h:76}},{glyph:109,frame:{x:2,y:2,w:107,h:72},packed:{x:0,y:1413,w:111,h:76}},{glyph:110,frame:{x:2,y:2,w:61,h:71},packed:{x:184,y:1413,w:65,h:75}},{glyph:111,frame:{x:2,y:2,w:66,h:107},packed:{x:894,y:791,w:70,h:111}},{glyph:112,frame:{x:2,y:2,w:54,h:71},packed:{x:249,y:1413,w:58,h:75}},{glyph:113,frame:{x:2,y:2,w:42,h:144},packed:{x:241,y:0,w:46,h:148}},{glyph:114,frame:{x:2,y:2,w:14,h:139},packed:{x:857,y:0,w:18,h:143}},{glyph:115,frame:{x:2,y:2,w:42,h:144},packed:{x:287,y:0,w:46,h:148}},{glyph:116,frame:{x:2,y:2,w:78,h:27},packed:{x:0,y:1489,w:82,h:31}},{glyph:118,frame:{x:2,y:2,w:23,h:102},packed:{x:358,y:1014,w:27,h:106}},{glyph:119,frame:{x:2,y:2,w:61,h:112},packed:{x:58,y:675,w:65,h:116}},{glyph:120,frame:{x:2,y:2,w:56,h:91},packed:{x:1336,y:1222,w:60,h:95}},{glyph:121,frame:{x:2,y:2,w:66,h:66},packed:{x:457,y:1413,w:70,h:70}},{glyph:122,frame:{x:2,y:2,w:79,h:90},packed:{x:1396,y:1222,w:83,h:94}},{glyph:123,frame:{x:2,y:2,w:14,h:138},packed:{x:946,y:0,w:18,h:142}},{glyph:124,frame:{x:2,y:2,w:66,h:142},packed:{x:524,y:0,w:70,h:146}},{glyph:125,frame:{x:2,y:2,w:51,h:20},packed:{x:134,y:1489,w:55,h:24}},{glyph:126,frame:{x:2,y:2,w:97,h:97},packed:{x:1376,y:1014,w:101,h:101}},{glyph:127,frame:{x:2,y:2,w:51,h:61},packed:{x:1033,y:1413,w:55,h:65}},{glyph:128,frame:{x:2,y:2,w:77,h:63},packed:{x:732,y:1413,w:81,h:67}},{glyph:129,frame:{x:2,y:2,w:75,h:40},packed:{x:1420,y:1413,w:79,h:44}},{glyph:131,frame:{x:2,y:2,w:97,h:97},packed:{x:0,y:1121,w:101,h:101}},{glyph:132,frame:{x:2,y:2,w:39,h:14},packed:{x:189,y:1489,w:43,h:18}},{glyph:133,frame:{x:2,y:2,w:47,h:49},packed:{x:1205,y:1413,w:51,h:53}},{glyph:134,frame:{x:2,y:2,w:69,h:77},packed:{x:359,y:1322,w:73,h:81}},{glyph:135,frame:{x:2,y:2,w:49,h:64},packed:{x:644,y:1413,w:53,h:68}},{glyph:136,frame:{x:2,y:2,w:49,h:66},packed:{x:527,y:1413,w:53,h:70}},{glyph:137,frame:{x:2,y:2,w:34,h:28},packed:{x:1458,y:1121,w:38,h:32}},{glyph:138,frame:{x:2,y:2,w:64,h:105},packed:{x:277,y:904,w:68,h:109}},{glyph:139,frame:{x:2,y:2,w:69,h:96},packed:{x:71,y:1222,w:73,h:100}},{glyph:140,frame:{x:2,y:2,w:22,h:23},packed:{x:108,y:1489,w:26,h:27}},{glyph:141,frame:{x:2,y:2,w:32,h:33},packed:{x:1449,y:1322,w:36,h:37}},{glyph:142,frame:{x:2,y:2,w:31,h:64},packed:{x:697,y:1413,w:35,h:68}},{glyph:143,frame:{x:2,y:2,w:54,h:61},packed:{x:1088,y:1413,w:58,h:65}},{glyph:144,frame:{x:2,y:2,w:78,h:63},packed:{x:813,y:1413,w:82,h:67}},{glyph:145,frame:{x:2,y:2,w:121,h:105},packed:{x:345,y:904,w:125,h:109}},{glyph:146,frame:{x:2,y:2,w:122,h:105},packed:{x:470,y:904,w:126,h:109}},{glyph:147,frame:{x:2,y:2,w:134,h:105},packed:{x:596,y:904,w:138,h:109}},{glyph:148,frame:{x:2,y:2,w:59,h:103},packed:{x:1381,y:904,w:63,h:107}},{glyph:149,frame:{x:2,y:2,w:88,h:125},packed:{x:1235,y:287,w:92,h:129}},{glyph:150,frame:{x:2,y:2,w:88,h:125},packed:{x:1327,y:287,w:92,h:129}},{glyph:151,frame:{x:2,y:2,w:88,h:124},packed:{x:1111,y:418,w:92,h:128}},{glyph:152,frame:{x:2,y:2,w:88,h:125},packed:{x:0,y:418,w:92,h:129}},{glyph:153,frame:{x:2,y:2,w:88,h:124},packed:{x:1203,y:418,w:92,h:128}},{glyph:154,frame:{x:2,y:2,w:88,h:124},packed:{x:1295,y:418,w:92,h:128}},{glyph:155,frame:{x:2,y:2,w:105,h:96},packed:{x:144,y:1222,w:109,h:100}},{glyph:156,frame:{x:2,y:2,w:77,h:128},packed:{x:235,y:151,w:81,h:132}},{glyph:157,frame:{x:2,y:2,w:63,h:125},packed:{x:92,y:418,w:67,h:129}},{glyph:158,frame:{x:2,y:2,w:63,h:125},packed:{x:159,y:418,w:67,h:129}},{glyph:159,frame:{x:2,y:2,w:63,h:124},packed:{x:1387,y:418,w:67,h:128}},{glyph:160,frame:{x:2,y:2,w:63,h:124},packed:{x:1419,y:287,w:67,h:128}},{glyph:161,frame:{x:2,y:2,w:35,h:125},packed:{x:226,y:418,w:39,h:129}},{glyph:162,frame:{x:2,y:2,w:36,h:125},packed:{x:265,y:418,w:40,h:129}},{glyph:163,frame:{x:2,y:2,w:45,h:124},packed:{x:1449,y:151,w:49,h:128}},{glyph:164,frame:{x:2,y:2,w:51,h:124},packed:{x:1443,y:0,w:55,h:128}},{glyph:165,frame:{x:2,y:2,w:87,h:96},packed:{x:253,y:1222,w:91,h:100}},{glyph:166,frame:{x:2,y:2,w:77,h:125},packed:{x:305,y:418,w:81,h:129}},{glyph:167,frame:{x:2,y:2,w:93,h:127},packed:{x:444,y:151,w:97,h:131}},{glyph:168,frame:{x:2,y:2,w:93,h:127},packed:{x:541,y:151,w:97,h:131}},{glyph:169,frame:{x:2,y:2,w:93,h:126},packed:{x:391,y:287,w:97,h:130}},{glyph:170,frame:{x:2,y:2,w:93,h:127},packed:{x:638,y:151,w:97,h:131}},{glyph:171,frame:{x:2,y:2,w:93,h:126},packed:{x:488,y:287,w:97,h:130}},{glyph:172,frame:{x:2,y:2,w:55,h:55},packed:{x:1146,y:1413,w:59,h:59}},{glyph:173,frame:{x:2,y:2,w:93,h:108},packed:{x:681,y:791,w:97,h:112}},{glyph:174,frame:{x:2,y:2,w:77,h:127},packed:{x:735,y:151,w:81,h:131}},{glyph:175,frame:{x:2,y:2,w:77,h:127},packed:{x:816,y:151,w:81,h:131}},{glyph:176,frame:{x:2,y:2,w:77,h:126},packed:{x:585,y:287,w:81,h:130}},{glyph:177,frame:{x:2,y:2,w:77,h:126},packed:{x:666,y:287,w:81,h:130}},{glyph:178,frame:{x:2,y:2,w:84,h:125},packed:{x:386,y:418,w:88,h:129}},{glyph:179,frame:{x:2,y:2,w:68,h:96},packed:{x:344,y:1222,w:72,h:100}},{glyph:180,frame:{x:2,y:2,w:77,h:114},packed:{x:843,y:547,w:81,h:118}},{glyph:181,frame:{x:2,y:2,w:63,h:110},packed:{x:550,y:675,w:67,h:114}},{glyph:182,frame:{x:2,y:2,w:63,h:110},packed:{x:617,y:675,w:67,h:114}},{glyph:183,frame:{x:2,y:2,w:63,h:109},packed:{x:0,y:791,w:67,h:113}},{glyph:184,frame:{x:2,y:2,w:63,h:106},packed:{x:1179,y:791,w:67,h:110}},{glyph:185,frame:{x:2,y:2,w:63,h:104},packed:{x:734,y:904,w:67,h:108}},{glyph:186,frame:{x:2,y:2,w:63,h:115},packed:{x:776,y:547,w:67,h:119}},{glyph:187,frame:{x:2,y:2,w:104,h:75},packed:{x:733,y:1322,w:108,h:79}},{glyph:188,frame:{x:2,y:2,w:61,h:103},packed:{x:0,y:1014,w:65,h:107}},{glyph:189,frame:{x:2,y:2,w:61,h:110},packed:{x:684,y:675,w:65,h:114}},{glyph:190,frame:{x:2,y:2,w:61,h:110},packed:{x:749,y:675,w:65,h:114}},{glyph:191,frame:{x:2,y:2,w:61,h:109},packed:{x:67,y:791,w:65,h:113}},{glyph:192,frame:{x:2,y:2,w:61,h:104},packed:{x:801,y:904,w:65,h:108}},{glyph:193,frame:{x:2,y:2,w:42,h:110},packed:{x:814,y:675,w:46,h:114}},{glyph:194,frame:{x:2,y:2,w:33,h:110},packed:{x:860,y:675,w:37,h:114}},{glyph:195,frame:{x:2,y:2,w:44,h:109},packed:{x:132,y:791,w:48,h:113}},{glyph:196,frame:{x:2,y:2,w:51,h:104},packed:{x:866,y:904,w:55,h:108}},{glyph:197,frame:{x:2,y:2,w:71,h:120},packed:{x:599,y:547,w:75,h:124}},{glyph:198,frame:{x:2,y:2,w:63,h:104},packed:{x:921,y:904,w:67,h:108}},{glyph:199,frame:{x:2,y:2,w:71,h:110},packed:{x:897,y:675,w:75,h:114}},{glyph:200,frame:{x:2,y:2,w:71,h:110},packed:{x:972,y:675,w:75,h:114}},{glyph:201,frame:{x:2,y:2,w:71,h:109},packed:{x:180,y:791,w:75,h:113}},{glyph:202,frame:{x:2,y:2,w:71,h:106},packed:{x:1246,y:791,w:75,h:110}},{glyph:203,frame:{x:2,y:2,w:71,h:104},packed:{x:988,y:904,w:75,h:108}},{glyph:204,frame:{x:2,y:2,w:69,h:72},packed:{x:111,y:1413,w:73,h:76}},{glyph:205,frame:{x:2,y:2,w:71,h:85},packed:{x:81,y:1322,w:75,h:89}},{glyph:206,frame:{x:2,y:2,w:64,h:110},packed:{x:1047,y:675,w:68,h:114}},{glyph:207,frame:{x:2,y:2,w:64,h:110},packed:{x:1115,y:675,w:68,h:114}},{glyph:208,frame:{x:2,y:2,w:64,h:109},packed:{x:255,y:791,w:68,h:113}},{glyph:209,frame:{x:2,y:2,w:64,h:104},packed:{x:1063,y:904,w:68,h:108}},{glyph:210,frame:{x:2,y:2,w:66,h:144},packed:{x:333,y:0,w:70,h:148}},{glyph:211,frame:{x:2,y:2,w:67,h:147},packed:{x:0,y:0,w:71,h:151}},{glyph:212,frame:{x:2,y:2,w:66,h:138},packed:{x:964,y:0,w:70,h:142}},{glyph:213,frame:{x:2,y:2,w:88,h:121},packed:{x:327,y:547,w:92,h:125}},{glyph:214,frame:{x:2,y:2,w:63,h:101},packed:{x:385,y:1014,w:67,h:105}},{glyph:215,frame:{x:2,y:2,w:88,h:125},packed:{x:474,y:418,w:92,h:129}},{glyph:216,frame:{x:2,y:2,w:63,h:106},packed:{x:1321,y:791,w:67,h:110}},{glyph:217,frame:{x:2,y:2,w:91,h:126},packed:{x:747,y:287,w:95,h:130}},{glyph:218,frame:{x:2,y:2,w:64,h:103},packed:{x:65,y:1014,w:68,h:107}},{glyph:219,frame:{x:2,y:2,w:77,h:127},packed:{x:897,y:151,w:81,h:131}},{glyph:220,frame:{x:2,y:2,w:61,h:112},packed:{x:123,y:675,w:65,h:116}},{glyph:221,frame:{x:2,y:2,w:77,h:126},packed:{x:842,y:287,w:81,h:130}},{glyph:222,frame:{x:2,y:2,w:61,h:111},packed:{x:342,y:675,w:65,h:115}},{glyph:223,frame:{x:2,y:2,w:77,h:127},packed:{x:978,y:151,w:81,h:131}},{glyph:224,frame:{x:2,y:2,w:61,h:106},packed:{x:1388,y:791,w:65,h:110}},{glyph:225,frame:{x:2,y:2,w:77,h:127},packed:{x:1059,y:151,w:81,h:131}},{glyph:226,frame:{x:2,y:2,w:61,h:111},packed:{x:407,y:675,w:65,h:115}},{glyph:227,frame:{x:2,y:2,w:76,h:125},packed:{x:566,y:418,w:80,h:129}},{glyph:228,frame:{x:2,y:2,w:95,h:114},packed:{x:924,y:547,w:99,h:118}},{glyph:229,frame:{x:2,y:2,w:87,h:96},packed:{x:416,y:1222,w:91,h:100}},{glyph:230,frame:{x:2,y:2,w:78,h:113},packed:{x:1315,y:547,w:82,h:117}},{glyph:231,frame:{x:2,y:2,w:63,h:121},packed:{x:419,y:547,w:67,h:125}},{glyph:232,frame:{x:2,y:2,w:61,h:101},packed:{x:452,y:1014,w:65,h:105}},{glyph:233,frame:{x:2,y:2,w:63,h:125},packed:{x:646,y:418,w:67,h:129}},{glyph:234,frame:{x:2,y:2,w:61,h:106},packed:{x:0,y:904,w:65,h:110}},{glyph:235,frame:{x:2,y:2,w:63,h:125},packed:{x:713,y:418,w:67,h:129}},{glyph:236,frame:{x:2,y:2,w:61,h:104},packed:{x:1131,y:904,w:65,h:108}},{glyph:237,frame:{x:2,y:2,w:63,h:126},packed:{x:923,y:287,w:67,h:130}},{glyph:238,frame:{x:2,y:2,w:61,h:103},packed:{x:133,y:1014,w:65,h:107}},{glyph:239,frame:{x:2,y:2,w:63,h:125},packed:{x:780,y:418,w:67,h:129}},{glyph:240,frame:{x:2,y:2,w:61,h:109},packed:{x:323,y:791,w:65,h:113}},{glyph:241,frame:{x:2,y:2,w:82,h:126},packed:{x:990,y:287,w:86,h:130}},{glyph:242,frame:{x:2,y:2,w:66,h:143},packed:{x:403,y:0,w:70,h:147}},{glyph:243,frame:{x:2,y:2,w:82,h:127},packed:{x:1140,y:151,w:86,h:131}},{glyph:244,frame:{x:2,y:2,w:66,h:140},packed:{x:747,y:0,w:70,h:144}},{glyph:245,frame:{x:2,y:2,w:82,h:127},packed:{x:1226,y:151,w:86,h:131}},{glyph:246,frame:{x:2,y:2,w:66,h:138},packed:{x:1034,y:0,w:70,h:142}},{glyph:247,frame:{x:2,y:2,w:82,h:134},packed:{x:1104,y:0,w:86,h:138}},{glyph:248,frame:{x:2,y:2,w:66,h:146},packed:{x:171,y:0,w:70,h:150}},{glyph:249,frame:{x:2,y:2,w:79,h:124},packed:{x:0,y:547,w:83,h:128}},{glyph:250,frame:{x:2,y:2,w:62,h:124},packed:{x:83,y:547,w:66,h:128}},{glyph:251,frame:{x:2,y:2,w:95,h:96},packed:{x:507,y:1222,w:99,h:100}},{glyph:252,frame:{x:2,y:2,w:74,h:111},packed:{x:472,y:675,w:78,h:115}},{glyph:253,frame:{x:2,y:2,w:49,h:125},packed:{x:847,y:418,w:53,h:129}},{glyph:254,frame:{x:2,y:2,w:49,h:106},packed:{x:65,y:904,w:53,h:110}},{glyph:255,frame:{x:2,y:2,w:39,h:121},packed:{x:486,y:547,w:43,h:125}},{glyph:256,frame:{x:2,y:2,w:40,h:101},packed:{x:517,y:1014,w:44,h:105}},{glyph:257,frame:{x:2,y:2,w:43,h:125},packed:{x:900,y:418,w:47,h:129}},{glyph:258,frame:{x:2,y:2,w:44,h:106},packed:{x:118,y:904,w:48,h:110}},{glyph:259,frame:{x:2,y:2,w:29,h:126},packed:{x:1076,y:287,w:33,h:130}},{glyph:260,frame:{x:2,y:2,w:32,h:133},packed:{x:1190,y:0,w:36,h:137}},{glyph:261,frame:{x:2,y:2,w:21,h:125},packed:{x:947,y:418,w:25,h:129}},{glyph:262,frame:{x:2,y:2,w:29,h:73},packed:{x:1319,y:1322,w:33,h:77}},{glyph:263,frame:{x:2,y:2,w:72,h:98},packed:{x:1300,y:1014,w:76,h:102}},{glyph:264,frame:{x:2,y:2,w:67,h:139},packed:{x:875,y:0,w:71,h:143}},{glyph:265,frame:{x:2,y:2,w:55,h:126},packed:{x:1109,y:287,w:59,h:130}},{glyph:266,frame:{x:2,y:2,w:47,h:143},packed:{x:473,y:0,w:51,h:147}},{glyph:267,frame:{x:2,y:2,w:74,h:133},packed:{x:1226,y:0,w:78,h:137}},{glyph:268,frame:{x:2,y:2,w:62,h:147},packed:{x:71,y:0,w:66,h:151}},{glyph:269,frame:{x:2,y:2,w:62,h:75},packed:{x:841,y:1322,w:66,h:79}},{glyph:270,frame:{x:2,y:2,w:54,h:125},packed:{x:972,y:418,w:58,h:129}},{glyph:271,frame:{x:2,y:2,w:36,h:127},packed:{x:1312,y:151,w:40,h:131}},{glyph:272,frame:{x:2,y:2,w:54,h:132},packed:{x:1304,y:0,w:58,h:136}},{glyph:273,frame:{x:2,y:2,w:30,h:147},packed:{x:137,y:0,w:34,h:151}},{glyph:274,frame:{x:2,y:2,w:54,h:97},packed:{x:101,y:1121,w:58,h:101}},{glyph:275,frame:{x:2,y:2,w:43,h:114},packed:{x:1023,y:547,w:47,h:118}},{glyph:276,frame:{x:2,y:2,w:55,h:96},packed:{x:606,y:1222,w:59,h:100}},{glyph:277,frame:{x:2,y:2,w:56,h:113},packed:{x:1397,y:547,w:60,h:117}},{glyph:278,frame:{x:2,y:2,w:64,h:96},packed:{x:665,y:1222,w:68,h:100}},{glyph:279,frame:{x:2,y:2,w:41,h:113},packed:{x:1454,y:418,w:45,h:117}},{glyph:280,frame:{x:2,y:2,w:77,h:125},packed:{x:1030,y:418,w:81,h:129}},{glyph:281,frame:{x:2,y:2,w:63,h:108},packed:{x:778,y:791,w:67,h:112}},{glyph:282,frame:{x:2,y:2,w:77,h:132},packed:{x:1362,y:0,w:81,h:136}},{glyph:283,frame:{x:2,y:2,w:63,h:109},packed:{x:388,y:791,w:67,h:113}},{glyph:284,frame:{x:2,y:2,w:77,h:124},packed:{x:149,y:547,w:81,h:128}},{glyph:285,frame:{x:2,y:2,w:63,h:107},packed:{x:964,y:791,w:67,h:111}},{glyph:286,frame:{x:2,y:2,w:77,h:132},packed:{x:0,y:151,w:81,h:136}},{glyph:287,frame:{x:2,y:2,w:63,h:109},packed:{x:455,y:791,w:67,h:113}},{glyph:288,frame:{x:2,y:2,w:93,h:123},packed:{x:230,y:547,w:97,h:127}},{glyph:289,frame:{x:2,y:2,w:71,h:101},packed:{x:561,y:1014,w:75,h:105}},{glyph:290,frame:{x:2,y:2,w:93,h:127},packed:{x:1352,y:151,w:97,h:131}},{glyph:291,frame:{x:2,y:2,w:71,h:106},packed:{x:166,y:904,w:75,h:110}},{glyph:292,frame:{x:2,y:2,w:93,h:127},packed:{x:0,y:287,w:97,h:131}},{glyph:293,frame:{x:2,y:2,w:73,h:110},packed:{x:1183,y:675,w:77,h:114}},{glyph:294,frame:{x:2,y:2,w:123,h:100},packed:{x:967,y:1014,w:127,h:104}},{glyph:295,frame:{x:2,y:2,w:114,h:75},packed:{x:907,y:1322,w:118,h:79}},{glyph:296,frame:{x:2,y:2,w:76,h:127},packed:{x:97,y:287,w:80,h:131}},{glyph:297,frame:{x:2,y:2,w:45,h:108},packed:{x:845,y:791,w:49,h:112}},{glyph:298,frame:{x:2,y:2,w:76,h:132},packed:{x:81,y:151,w:80,h:136}},{glyph:299,frame:{x:2,y:2,w:45,h:109},packed:{x:522,y:791,w:49,h:113}},{glyph:300,frame:{x:2,y:2,w:76,h:127},packed:{x:177,y:287,w:80,h:131}},{glyph:301,frame:{x:2,y:2,w:46,h:107},packed:{x:1031,y:791,w:50,h:111}},{glyph:302,frame:{x:2,y:2,w:63,h:127},packed:{x:257,y:287,w:67,h:131}},{glyph:303,frame:{x:2,y:2,w:51,h:110},packed:{x:1260,y:675,w:55,h:114}},{glyph:304,frame:{x:2,y:2,w:63,h:126},packed:{x:1168,y:287,w:67,h:130}},{glyph:305,frame:{x:2,y:2,w:51,h:109},packed:{x:571,y:791,w:55,h:113}},{glyph:306,frame:{x:2,y:2,w:63,h:128},packed:{x:316,y:151,w:67,h:132}},{glyph:307,frame:{x:2,y:2,w:51,h:103},packed:{x:198,y:1014,w:55,h:107}},{glyph:308,frame:{x:2,y:2,w:63,h:127},packed:{x:324,y:287,w:67,h:131}},{glyph:309,frame:{x:2,y:2,w:51,h:109},packed:{x:626,y:791,w:55,h:113}},{glyph:310,frame:{x:2,y:2,w:70,h:132},packed:{x:161,y:151,w:74,h:136}}],ri={kernings:ei,meta:si,chars:ai,glyphs:ii,colors:hi};function vs(s){return new Promise(t=>{let e=new Image;e.onload=()=>t(e),e.src=s})}const _e=class _e{constructor(){o(this,"load",async()=>{let[t,e]=await Promise.all([vs(Qa),vs(ti)]),a=Ct.from_image(t);this.sprites=[],this.nine_slice=[],Za.sprites.forEach(h=>{let{name:n,packs:_,tags:f}=h;if(n.match(/nine_slice/)){this.nine_slice.push(_e.make_nine_slice(a,h));return}let p=r.zero,m=[];f.forEach(g=>{let v=[];for(let y=g.from;y<=g.to;y++){let b=_[y],T=b.meta.duration/1e3,R=w.make(b.frame.x,b.frame.y,b.frame.w,b.frame.h),C=w.make(b.packed.x,b.packed.y,b.packed.w,b.packed.h),I=new ks(qt.make(a,C,R),T);v.push(I)}let k=new qa(g.name,v);m.push(k)});let c=new Ga(n,p,m);this.sprites.push(c)});let i={...ri,size:128};this.sp_font=Ie.make(i,e)});o(this,"sp_font");o(this,"sprites");o(this,"nine_slice")}find_sprite(t){return this.sprites.find(e=>e.name===t)}find_nine(t){return this.nine_slice.find(e=>e.name===t)}};o(_e,"make_nine_slice",(t,e)=>{let{name:a,packs:i,_tags:h}=e,n=[];for(let _=0;_<3;_++)for(let f=0;f<3;f++){let p=i[0],m=1,c=_*p.frame.w/3,g=f*p.frame.h/3,v=w.make(p.frame.x,p.frame.y,p.frame.w/3,p.frame.h/3),k=w.make(c+p.packed.x,g+p.packed.y,4+400/3,4+400/3),y=new ks(qt.make(t,k,v),m);n.push(y)}return new Ya(a,n)});let Be=_e;const Ut=new Be;function ni(s){var t;return s.clientX!==void 0&&s.clientY!==void 0?[s.clientX,s.clientY]:(t=s.targetTouches)!=null&&t[0]?[s.targetTouches[0].clientX,s.targetTouches[0].clientY]:[0,0]}class Zs{}o(Zs,"init",(t,e=document)=>{const a=k=>{let y=ni(k);return y?r.make(y[0],y[1]):r.zero};let{_onDragStart:i,_onDragMove:h,_onDragEnd:n,_onContextMenu:_,_onWheel:f}=t;const p=k=>{var y;k.preventDefault(),!(((y=k.touches)==null?void 0:y.length)>1)&&(i==null||i(a(k),k.buttons===2||k.button===2))},m=k=>{h==null||h(a(k))},c=k=>{n==null||n(a(k))},g=k=>{_&&(k.preventDefault(),_())},v=k=>{f&&(f(Math.sign(k.deltaY),a(k)),k.preventDefault())};return e.addEventListener("wheel",v,{passive:!1}),e.addEventListener("touchstart",p,{capture:!0,passive:!1}),e.addEventListener("mousedown",p,{capture:!0,passive:!1}),e.addEventListener("contextmenu",g),document.addEventListener("mousemove",m),document.addEventListener("mouseup",c),document.addEventListener("touchmove",m),document.addEventListener("touchend",c),()=>{e.removeEventListener("wheel",v),e.removeEventListener("touchstart",p),e.removeEventListener("mousedown",p),e.removeEventListener("contextmenu",g),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",c)}});class oi{constructor(){o(this,"_on_update");o(this,"_hooks",[])}register(t){return this._hooks.push(t),()=>{this._hooks.splice(this._hooks.indexOf(t),1)}}get hooks(){return this._hooks}_sort_hooks(){this._hooks.sort((t,e)=>(e.priority??0)-(t.priority??0))}_on_hover(t){var i,h;let e=this.hooks,a=e.findIndex(n=>{var _;return(_=n.on_hover)==null?void 0:_.call(n,t)});if(a!==-1)for(let n=a+1;n{var h;return(h=i.on_up)==null?void 0:h.call(i,t,e,a)})}_on_click(t,e){this.hooks.find(a=>{var i;return(i=a.on_click)==null?void 0:i.call(a,t,e)})}_on_click_begin(t,e){this.hooks.find(a=>{var i;return(i=a.on_click_begin)==null?void 0:i.call(a,t,e)})}_on_drag(t,e){this.hooks.find(a=>{var i;return(i=a.on_drag)==null?void 0:i.call(a,t,e)})}_on_context(){this.hooks.find(t=>{var e;return(e=t.on_context)==null?void 0:e.call(t)})}_on_wheel(t,e){this.hooks.find(a=>{var i;return(i=a.on_wheel)==null?void 0:i.call(a,t,e)})}listen(t){let e;const a=()=>{e=t.getBoundingClientRect()};a();const i=m=>{let c=r.make(e.x,e.y),g=r.make(e.width,e.height);return m.sub(c).div(g)};let h=m=>m&&{...m},n,_,f,p=this;Zs.init({_onDragStart(m,c){if(c)return;let g=i(m);_=h(n),n={e:g,_right:c},p._on_update=()=>{n?((n.m||f&&n.e.distance(f)>16/1080)&&(n.m=f),p._on_drag(n,_),_=h(n)):p._on_update=void 0},p._on_click_begin(g,c)},_onDragMove(m){let c=i(m);f=c,n||p._on_hover(c)},_onDragEnd(){n&&(n.m||p._on_click(n.e,n._right),p._on_up(n.e,n._right,n.m),p._on_update=void 0,n=void 0,f=void 0)},_onWheel(m,c){var g;(g=p._on_wheel)==null||g.call(p,m,i(c))},_onContextMenu(){}},t),document.addEventListener("scroll",()=>{a()},{capture:!0,passive:!0}),window.addEventListener("resize",()=>{a()},{passive:!0})}update(){var t;(t=this._on_update)==null||t.call(this)}}const oe=new oi;var li=`#version 300 es +`&&(t+=this.line_height);return t-this.line_gap}rebuild(s,t,e){this.clear(),this.name=s.family_name,this.ascent=s.ascent,this.descent=s.descent,this.line_gap=s.line_gap,this.size=t;for(let a of e){let{from:i,to:h}=a;for(let n=i;n<=h;n++){let _=s.get_glyph(n);if(_===void 0)continue;let f=s.get_character(_),p=s.get_subtexture(f.glyph),m={glyph:_,codepoint:n,advance:f.advance,offset:r.make(f.offset_x,f.offset_y),subtexture:p};this._characters.push(m)}}for(let a of this._characters)for(let i of this._characters){let h=s.get_kerning(a.glyph,i.glyph);h!==void 0&&this.set_kerning(a.codepoint,i.codepoint,h)}}get_kerning(s,t){let e=xs(this._kerning,s,t);return e!==-1?this._kerning[e].value:0}set_kerning(s,t,e){let a=xs(this._kerning,s,t);a!==-1?this._kerning[a].value=e:this._kerning.push({a:s,b:t,value:e})}get_character(s){let t=Ka(this._characters,s);return t!==-1?this._characters[t]:this._characters[0]}};let Ie=$e;l(Ie,"make",(s,t)=>{let e=Ct.from_image(t),a=Js.make(s,e);return $e.make_from_font(a,s.size)}),l(Ie,"make_from_font",(s,t)=>{let e=[{from:32,to:127},{from:161,to:355}],a=new $e;return a.rebuild(s,t,e),a});function Ka(s,t){let e=0,a=s.length-1;for(;e<=a;){let i=Math.round((a+e)/2);if(s[i].codepoint===t)return i;s[i].codepointe.name===t)}}class Ga{constructor(t,e){this.name=t,this.frames=e}}const Ya=""+new URL("out_0-253f9001.png",import.meta.url).href,Qa=[{name:"arrow_up_fire",tags:[{from:0,to:2,name:"idle"}],packs:[{frame:{x:4,y:4,w:48,h:48},packed:{x:3226,y:2728,w:56,h:56},meta:{duration:100}},{frame:{x:4,y:4,w:48,h:48},packed:{x:3226,y:2656,w:56,h:56},meta:{duration:100}},{frame:{x:4,y:4,w:48,h:48},packed:{x:3225,y:3377,w:56,h:56},meta:{duration:100}}]},{name:"button_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"click"},{from:3,to:3,name:"disabled"}],packs:[{frame:{x:4,y:4,w:366,h:200},packed:{x:2592,y:2656,w:374,h:208},meta:{duration:100}},{frame:{x:4,y:4,w:366,h:200},packed:{x:0,y:2909,w:374,h:208},meta:{duration:100}},{frame:{x:4,y:4,w:366,h:200},packed:{x:374,y:2909,w:374,h:208},meta:{duration:300}},{frame:{x:4,y:4,w:366,h:200},packed:{x:748,y:2909,w:374,h:208},meta:{duration:100}}]},{name:"card",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:4,name:"click"},{from:5,to:7,name:"flip"},{from:8,to:8,name:"back_idle"},{from:9,to:9,name:"back_hover"},{from:10,to:10,name:"back_click"},{from:11,to:13,name:"back_flip"},{from:14,to:15,name:"drag"},{from:16,to:17,name:"back_drag"},{from:18,to:18,name:"wait"},{from:19,to:19,name:"shadow"},{from:20,to:20,name:"highlight"}],packs:[{frame:{x:4,y:4,w:204,h:245},packed:{x:2897,y:1909,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:0,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:0,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:253,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:253,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2849,y:506,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3061,y:506,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1578,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1790,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2002,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2214,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2426,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2638,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:2850,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:3062,y:821,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:0,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:212,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:424,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:636,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:848,y:2656,w:212,h:253},meta:{duration:100}},{frame:{x:4,y:4,w:204,h:245},packed:{x:1060,y:2656,w:212,h:253},meta:{duration:100}}]},{name:"confbar",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:360,h:320},packed:{x:2529,y:1909,w:368,h:328},meta:{duration:100}}]},{name:"confetti",tags:[{from:0,to:6,name:"idle"}],packs:[{frame:{x:4,y:4,w:180,h:180},packed:{x:1122,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1310,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1498,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1686,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:1874,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2062,y:2909,w:188,h:188},meta:{duration:200}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2250,y:2909,w:188,h:188},meta:{duration:200}}]},{name:"confetti2",tags:[{from:0,to:6,name:"idle"}],packs:[{frame:{x:4,y:4,w:180,h:180},packed:{x:2438,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2626,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2814,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:3002,y:2909,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:2966,y:2656,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:0,y:3117,w:188,h:188},meta:{duration:300}},{frame:{x:4,y:4,w:180,h:180},packed:{x:188,y:3117,w:188,h:188},meta:{duration:300}}]},{name:"dropdown_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:510,h:172},packed:{x:376,y:3117,w:518,h:180},meta:{duration:100}},{frame:{x:4,y:4,w:510,h:172},packed:{x:894,y:3117,w:518,h:180},meta:{duration:100}}]},{name:"hmg_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"open"},{from:3,to:3,name:"open_hover"}],packs:[{frame:{x:4,y:4,w:240,h:140},packed:{x:1945,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2193,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2441,y:3305,w:248,h:148},meta:{duration:100}},{frame:{x:4,y:4,w:240,h:140},packed:{x:2689,y:3305,w:248,h:148},meta:{duration:100}}]},{name:"main_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:1570,h:1080},packed:{x:0,y:0,w:1578,h:1088},meta:{duration:100}}]},{name:"main_card_bg",tags:[{from:0,to:0,name:"solitaire"},{from:1,to:1,name:"solitaire_hover"},{from:2,to:2,name:"fourtimes"},{from:3,to:3,name:"fourtimes_hover"},{from:4,to:4,name:"octopus"},{from:5,to:5,name:"octopus_hover"}],packs:[{frame:{x:4,y:4,w:481,h:739},packed:{x:1271,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:1760,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:2249,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:2738,y:1088,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:0,y:1909,w:489,h:747},meta:{duration:100}},{frame:{x:4,y:4,w:481,h:739},packed:{x:489,y:1909,w:489,h:747},meta:{duration:100}}]},{name:"main_settings_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:652,h:223},packed:{x:1272,y:2656,w:660,h:231},meta:{duration:100}},{frame:{x:4,y:4,w:652,h:223},packed:{x:1932,y:2656,w:660,h:231},meta:{duration:100}}]},{name:"main_title_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:780,h:560},packed:{x:1333,y:1909,w:788,h:568},meta:{duration:100}}]},{name:"menu_bar",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:240,h:160},packed:{x:1412,y:3117,w:248,h:168},meta:{duration:100}}]},{name:"navigation_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"}],packs:[{frame:{x:4,y:4,w:593,h:157},packed:{x:2224,y:3117,w:601,h:165},meta:{duration:100}},{frame:{x:4,y:4,w:593,h:157},packed:{x:0,y:3305,w:601,h:165},meta:{duration:100}}]},{name:"panel_bg_nine_slice",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:400,h:400},packed:{x:2121,y:1909,w:408,h:408},meta:{duration:100}}]},{name:"rank",tags:[{from:0,to:0,name:"a"},{from:1,to:1,name:"2"},{from:2,to:2,name:"3"},{from:3,to:3,name:"4"},{from:4,to:4,name:"5"},{from:5,to:5,name:"6"},{from:6,to:6,name:"7"},{from:7,to:7,name:"8"},{from:8,to:8,name:"9"},{from:9,to:9,name:"t"},{from:10,to:10,name:"j"},{from:11,to:11,name:"q"},{from:12,to:12,name:"k"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:2937,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3009,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3081,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3153,y:3305,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2937,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3009,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3081,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3153,y:3377,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2825,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2897,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2969,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3041,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3113,y:3117,w:72,h:72},meta:{duration:100}}]},{name:"rank_2",tags:[{from:0,to:0,name:"a"},{from:1,to:1,name:"2"},{from:2,to:2,name:"3"},{from:3,to:3,name:"4"},{from:4,to:4,name:"5"},{from:5,to:5,name:"6"},{from:6,to:6,name:"7"},{from:7,to:7,name:"8"},{from:8,to:8,name:"9"},{from:9,to:9,name:"t"},{from:10,to:10,name:"j"},{from:11,to:11,name:"q"},{from:12,to:12,name:"k"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:3185,y:3117,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2825,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2897,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:2969,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3041,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3113,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3185,y:3189,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3154,y:2656,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3154,y:2728,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3190,y:2909,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3190,y:2981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:1909,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:1909,w:72,h:72},meta:{duration:100}}]},{name:"recycle",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"disabled"}],packs:[{frame:{x:4,y:4,w:180,h:160},packed:{x:1660,y:3117,w:188,h:168},meta:{duration:100}},{frame:{x:4,y:4,w:180,h:160},packed:{x:1848,y:3117,w:188,h:168},meta:{duration:100}},{frame:{x:4,y:4,w:180,h:160},packed:{x:2036,y:3117,w:188,h:168},meta:{duration:100}}]},{name:"side_menu_bg",tags:[{from:0,to:0,name:"idle"}],packs:[{frame:{x:4,y:4,w:347,h:659},packed:{x:978,y:1909,w:355,h:667},meta:{duration:100}}]},{name:"suit",tags:[{from:0,to:0,name:"spades"},{from:1,to:1,name:"hearts"},{from:2,to:2,name:"diamonds"},{from:3,to:3,name:"clubs"}],packs:[{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:1981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:1981,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3109,y:2053,w:72,h:72},meta:{duration:100}},{frame:{x:4,y:4,w:64,h:64},packed:{x:3181,y:2053,w:72,h:72},meta:{duration:100}}]},{name:"swiggle",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"small"}],packs:[{frame:{x:4,y:4,w:1263,h:813},packed:{x:1578,y:0,w:1271,h:821},meta:{duration:100}},{frame:{x:4,y:4,w:1263,h:813},packed:{x:0,y:1088,w:1271,h:821},meta:{duration:100}}]},{name:"tab3_bg",tags:[{from:0,to:0,name:"idle"},{from:1,to:1,name:"hover"},{from:2,to:2,name:"active"}],packs:[{frame:{x:4,y:4,w:440,h:150},packed:{x:601,y:3305,w:448,h:158},meta:{duration:100}},{frame:{x:4,y:4,w:440,h:150},packed:{x:1049,y:3305,w:448,h:158},meta:{duration:100}},{frame:{x:4,y:4,w:440,h:150},packed:{x:1497,y:3305,w:448,h:158},meta:{duration:100}}]}],Ja={sprites:Qa},Za=""+new URL("out_0-1e3dd4e6.png",import.meta.url).href,ti=[],ei={scale:.0625,descent:-568,ascent:1992,line_gap:0,name:"Capriola"},si=[{glyph:22,width:0,height:0,advance:32.0625,offset_x:0,offset_y:0,scale:.0625,has_glyph:0},{glyph:23,width:23,height:102,advance:42.75,offset_x:10.9375,offset_y:-100,scale:.0625,has_glyph:1},{glyph:24,width:42,height:40,advance:53.1875,offset_x:6.3125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:25,width:77,height:87,advance:85.125,offset_x:3.5,offset_y:-89,scale:.0625,has_glyph:1},{glyph:26,width:57,height:127,advance:64,offset_x:3.4375,offset_y:-107,scale:.0625,has_glyph:1},{glyph:27,width:118,height:103,advance:127.6875,offset_x:5.875,offset_y:-101,scale:.0625,has_glyph:1},{glyph:28,width:71,height:94,advance:85.0625,offset_x:9.3125,offset_y:-92,scale:.0625,has_glyph:1},{glyph:29,width:16,height:40,advance:31.9375,offset_x:8.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:30,width:35,height:141,advance:53.375,offset_x:10.25,offset_y:-120,scale:.0625,has_glyph:1},{glyph:31,width:36,height:141,advance:53.375,offset_x:8.3125,offset_y:-120,scale:.0625,has_glyph:1},{glyph:32,width:73,height:67,advance:85.1875,offset_x:6.3125,offset_y:-119,scale:.0625,has_glyph:1},{glyph:33,width:69,height:69,advance:85.1875,offset_x:8.25,offset_y:-72,scale:.0625,has_glyph:1},{glyph:34,width:23,height:47,advance:32.0625,offset_x:4,offset_y:-21,scale:.0625,has_glyph:1},{glyph:35,width:46,height:13,advance:74.5625,offset_x:14.8125,offset_y:-44,scale:.0625,has_glyph:1},{glyph:36,width:22,height:23,advance:32.0625,offset_x:5.375,offset_y:-21,scale:.0625,has_glyph:1},{glyph:37,width:40,height:111,advance:53.3125,offset_x:9.375,offset_y:-102,scale:.0625,has_glyph:1},{glyph:38,width:71,height:79,advance:85.1875,offset_x:7.5625,offset_y:-77,scale:.0625,has_glyph:1},{glyph:39,width:35,height:76,advance:53.0625,offset_x:3.9375,offset_y:-76,scale:.0625,has_glyph:1},{glyph:40,width:59,height:77,advance:74.625,offset_x:8,offset_y:-77,scale:.0625,has_glyph:1},{glyph:41,width:61,height:94,advance:74.625,offset_x:5.9375,offset_y:-77,scale:.0625,has_glyph:1},{glyph:42,width:69,height:94,advance:74.0625,offset_x:5.4375,offset_y:-79,scale:.0625,has_glyph:1},{glyph:43,width:65,height:92,advance:74.5625,offset_x:7.6875,offset_y:-75,scale:.0625,has_glyph:1},{glyph:44,width:65,height:93,advance:74.5625,offset_x:5.9375,offset_y:-91,scale:.0625,has_glyph:1},{glyph:45,width:57,height:92,advance:63.8125,offset_x:3.125,offset_y:-75,scale:.0625,has_glyph:1},{glyph:46,width:64,height:93,advance:74.5625,offset_x:5.8125,offset_y:-91,scale:.0625,has_glyph:1},{glyph:47,width:65,height:94,advance:74.5625,offset_x:3.625,offset_y:-77,scale:.0625,has_glyph:1},{glyph:48,width:23,height:72,advance:31.9375,offset_x:4.9375,offset_y:-70,scale:.0625,has_glyph:1},{glyph:49,width:23,height:96,advance:32.0625,offset_x:4.1875,offset_y:-70,scale:.0625,has_glyph:1},{glyph:50,width:65,height:62,advance:85.25,offset_x:9.3125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:51,width:67,height:41,advance:85.1875,offset_x:9.8125,offset_y:-58,scale:.0625,has_glyph:1},{glyph:52,width:65,height:62,advance:85.25,offset_x:11.8125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:53,width:59,height:103,advance:74.9375,offset_x:8.375,offset_y:-101,scale:.0625,has_glyph:1},{glyph:54,width:94,height:106,advance:106.3125,offset_x:7.5,offset_y:-82,scale:.0625,has_glyph:1},{glyph:55,width:88,height:96,advance:96,offset_x:4.25,offset_y:-96,scale:.0625,has_glyph:1},{glyph:56,width:73,height:96,advance:95.0625,offset_x:14.875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:57,width:77,height:100,advance:85.125,offset_x:6.9375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:58,width:76,height:96,advance:95.8125,offset_x:14.875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:59,width:63,height:96,advance:85.125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:60,width:59,height:96,advance:74.375,offset_x:14.75,offset_y:-96,scale:.0625,has_glyph:1},{glyph:61,width:82,height:100,advance:95.8125,offset_x:8.6875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:62,width:79,height:96,advance:106.1875,offset_x:14.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:63,width:17,height:96,advance:42.6875,offset_x:13.5,offset_y:-96,scale:.0625,has_glyph:1},{glyph:64,width:41,height:98,advance:53.125,offset_x:1.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:65,width:74,height:102,advance:85.25,offset_x:13.5,offset_y:-97,scale:.0625,has_glyph:1},{glyph:66,width:54,height:96,advance:74.6875,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:67,width:113,height:96,advance:127.4375,offset_x:8.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:68,width:77,height:96,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:69,width:93,height:100,advance:106.8125,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:70,width:68,height:96,advance:85,offset_x:14.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:71,width:98,height:118,advance:106.4375,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:72,width:76,height:98,advance:95.8125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:73,width:63,height:100,advance:74.625,offset_x:6.875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:74,width:70,height:96,advance:74.5,offset_x:2.75,offset_y:-96,scale:.0625,has_glyph:1},{glyph:75,width:77,height:98,advance:95.5625,offset_x:9.6875,offset_y:-96,scale:.0625,has_glyph:1},{glyph:76,width:83,height:96,advance:85.25,offset_x:1.5625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:77,width:126,height:96,advance:138.3125,offset_x:6.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:78,width:78,height:96,advance:85.1875,offset_x:4,offset_y:-96,scale:.0625,has_glyph:1},{glyph:79,width:84,height:96,advance:84.6875,offset_x:1,offset_y:-96,scale:.0625,has_glyph:1},{glyph:80,width:67,height:96,advance:74.5625,offset_x:4.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:81,width:33,height:140,advance:53.375,offset_x:12.9375,offset_y:-119,scale:.0625,has_glyph:1},{glyph:82,width:40,height:111,advance:53.3125,offset_x:4.0625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:83,width:33,height:140,advance:53.375,offset_x:8.5,offset_y:-119,scale:.0625,has_glyph:1},{glyph:84,width:60,height:65,advance:63.875,offset_x:2.5625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:85,width:104,height:13,advance:95.8125,offset_x:-3.625,offset_y:10,scale:.0625,has_glyph:1},{glyph:86,width:33,height:28,advance:42.9375,offset_x:.875,offset_y:-108,scale:.0625,has_glyph:1},{glyph:87,width:63,height:75,advance:74.6875,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:88,width:67,height:113,advance:85.3125,offset_x:12.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:89,width:61,height:77,advance:74.5625,offset_x:7.5625,offset_y:-73,scale:.0625,has_glyph:1},{glyph:90,width:70,height:113,advance:85.25,offset_x:6.9375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:91,width:61,height:75,advance:74.6875,offset_x:7.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:92,width:54,height:112,advance:53.1875,offset_x:4.75,offset_y:-112,scale:.0625,has_glyph:1},{glyph:93,width:66,height:120,advance:74.5625,offset_x:6.8125,offset_y:-84,scale:.0625,has_glyph:1},{glyph:94,width:62,height:111,advance:85.25,offset_x:13.375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:95,width:32,height:105,advance:42.6875,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:96,width:36,height:139,advance:42.6875,offset_x:-3.625,offset_y:-103,scale:.0625,has_glyph:1},{glyph:97,width:62,height:113,advance:74.75,offset_x:11.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:98,width:30,height:113,advance:42.6875,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:99,width:106,height:73,advance:127.6875,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:100,width:63,height:73,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:101,width:71,height:75,advance:85.375,offset_x:7.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:102,width:69,height:109,advance:85.3125,offset_x:10.3125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:103,width:66,height:109,advance:85.3125,offset_x:7.4375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:104,width:45,height:73,advance:53.3125,offset_x:9.9375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:105,width:51,height:75,advance:64,offset_x:7.25,offset_y:-73,scale:.0625,has_glyph:1},{glyph:106,width:50,height:91,advance:53.1875,offset_x:3.9375,offset_y:-89,scale:.0625,has_glyph:1},{glyph:107,width:64,height:73,advance:85.25,offset_x:11.8125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:108,width:66,height:72,advance:74.75,offset_x:4.4375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:109,width:107,height:72,advance:116.9375,offset_x:4.5,offset_y:-71,scale:.0625,has_glyph:1},{glyph:110,width:61,height:71,advance:63.9375,offset_x:1.5625,offset_y:-71,scale:.0625,has_glyph:1},{glyph:111,width:66,height:107,advance:74.5625,offset_x:4.5,offset_y:-71,scale:.0625,has_glyph:1},{glyph:112,width:54,height:71,advance:63.9375,offset_x:5.4375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:113,width:42,height:144,advance:64,offset_x:15,offset_y:-120,scale:.0625,has_glyph:1},{glyph:114,width:14,height:139,advance:42.6875,offset_x:14.6875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:115,width:42,height:144,advance:64,offset_x:7.8125,offset_y:-120,scale:.0625,has_glyph:1},{glyph:116,width:78,height:27,advance:106.6875,offset_x:15.375,offset_y:-53,scale:.0625,has_glyph:1},{glyph:118,width:23,height:102,advance:42.75,offset_x:10.875,offset_y:-70,scale:.0625,has_glyph:1},{glyph:119,width:61,height:112,advance:74.5625,offset_x:7.5625,offset_y:-92,scale:.0625,has_glyph:1},{glyph:120,width:56,height:91,advance:63.6875,offset_x:6.9375,offset_y:-91,scale:.0625,has_glyph:1},{glyph:121,width:66,height:66,advance:74.5625,offset_x:4.3125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:122,width:79,height:90,advance:85.1875,offset_x:3.0625,offset_y:-90,scale:.0625,has_glyph:1},{glyph:123,width:14,height:138,advance:42.6875,offset_x:14.6875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:124,width:66,height:142,advance:85.1875,offset_x:9.3125,offset_y:-113,scale:.0625,has_glyph:1},{glyph:125,width:51,height:20,advance:65,offset_x:7.75,offset_y:-102,scale:.0625,has_glyph:1},{glyph:126,width:97,height:97,advance:106.5,offset_x:5.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:127,width:51,height:61,advance:74.6875,offset_x:7.4375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:128,width:77,height:63,advance:95.875,offset_x:9.8125,offset_y:-67,scale:.0625,has_glyph:1},{glyph:129,width:75,height:40,advance:95.8125,offset_x:8.25,offset_y:-54,scale:.0625,has_glyph:1},{glyph:130,width:0,height:0,advance:106.6875,offset_x:0,offset_y:0,scale:.0625,has_glyph:0},{glyph:131,width:97,height:97,advance:106.5,offset_x:5.3125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:132,width:39,height:14,advance:42.6875,offset_x:2.4375,offset_y:-99,scale:.0625,has_glyph:1},{glyph:133,width:47,height:49,advance:53.3125,offset_x:3.1875,offset_y:-105,scale:.0625,has_glyph:1},{glyph:134,width:69,height:77,advance:85.1875,offset_x:8.25,offset_y:-77,scale:.0625,has_glyph:1},{glyph:135,width:49,height:64,advance:63.6875,offset_x:6.25,offset_y:-117,scale:.0625,has_glyph:1},{glyph:136,width:49,height:66,advance:63.75,offset_x:6.9375,offset_y:-117,scale:.0625,has_glyph:1},{glyph:137,width:34,height:28,advance:42.9375,offset_x:10.875,offset_y:-108,scale:.0625,has_glyph:1},{glyph:138,width:64,height:105,advance:85.25,offset_x:11.8125,offset_y:-71,scale:.0625,has_glyph:1},{glyph:139,width:69,height:96,advance:96,offset_x:13.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:140,width:22,height:23,advance:32.0625,offset_x:5.375,offset_y:-49,scale:.0625,has_glyph:1},{glyph:141,width:32,height:33,advance:31.6875,offset_x:-11.4375,offset_y:-3,scale:.0625,has_glyph:1},{glyph:142,width:31,height:64,advance:42.4375,offset_x:1.8125,offset_y:-117,scale:.0625,has_glyph:1},{glyph:143,width:54,height:61,advance:63.9375,offset_x:5.3125,offset_y:-98,scale:.0625,has_glyph:1},{glyph:144,width:78,height:63,advance:95.875,offset_x:9.3125,offset_y:-68,scale:.0625,has_glyph:1},{glyph:145,width:121,height:105,advance:138.3125,offset_x:9.3125,offset_y:-103,scale:.0625,has_glyph:1},{glyph:146,width:122,height:105,advance:148.8125,offset_x:9.3125,offset_y:-103,scale:.0625,has_glyph:1},{glyph:147,width:134,height:105,advance:148.9375,offset_x:6.9375,offset_y:-103,scale:.0625,has_glyph:1},{glyph:148,width:59,height:103,advance:74.9375,offset_x:8.3125,offset_y:-70,scale:.0625,has_glyph:1},{glyph:149,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:150,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:151,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:152,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:153,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:154,width:88,height:124,advance:96,offset_x:4.25,offset_y:-124,scale:.0625,has_glyph:1},{glyph:155,width:105,height:96,advance:117.0625,offset_x:4.125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:156,width:77,height:128,advance:95.6875,offset_x:6.9375,offset_y:-98,scale:.0625,has_glyph:1},{glyph:157,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:158,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:159,width:63,height:124,advance:85.125,offset_x:14.625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:160,width:63,height:124,advance:85.125,offset_x:14.625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:161,width:35,height:125,advance:42.6875,offset_x:-.75,offset_y:-125,scale:.0625,has_glyph:1},{glyph:162,width:36,height:125,advance:42.6875,offset_x:10.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:163,width:45,height:124,advance:42.6875,offset_x:-.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:164,width:51,height:124,advance:42.6875,offset_x:-3.75,offset_y:-124,scale:.0625,has_glyph:1},{glyph:165,width:87,height:96,advance:95.8125,offset_x:3.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:166,width:77,height:125,advance:106.3125,offset_x:15.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:167,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:168,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:169,width:93,height:126,advance:106.8125,offset_x:7.1875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:170,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:171,width:93,height:126,advance:106.8125,offset_x:7.1875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:172,width:55,height:55,advance:74.5625,offset_x:10.625,offset_y:-65,scale:.0625,has_glyph:1},{glyph:173,width:93,height:108,advance:106.8125,offset_x:7.1875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:174,width:77,height:127,advance:106.125,offset_x:15,offset_y:-125,scale:.0625,has_glyph:1},{glyph:175,width:77,height:127,advance:106.125,offset_x:15,offset_y:-125,scale:.0625,has_glyph:1},{glyph:176,width:77,height:126,advance:106.125,offset_x:15,offset_y:-124,scale:.0625,has_glyph:1},{glyph:177,width:77,height:126,advance:106.125,offset_x:15,offset_y:-124,scale:.0625,has_glyph:1},{glyph:178,width:84,height:125,advance:84.6875,offset_x:1,offset_y:-125,scale:.0625,has_glyph:1},{glyph:179,width:68,height:96,advance:85,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:180,width:77,height:114,advance:95.8125,offset_x:14.6875,offset_y:-112,scale:.0625,has_glyph:1},{glyph:181,width:63,height:110,advance:74.6875,offset_x:6.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:182,width:63,height:110,advance:74.6875,offset_x:6.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:183,width:63,height:109,advance:74.6875,offset_x:6.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:184,width:63,height:106,advance:74.6875,offset_x:6.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:185,width:63,height:104,advance:74.6875,offset_x:6.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:186,width:63,height:115,advance:74.6875,offset_x:6.125,offset_y:-113,scale:.0625,has_glyph:1},{glyph:187,width:104,height:75,advance:117.125,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:188,width:61,height:103,advance:74.5625,offset_x:7.5625,offset_y:-73,scale:.0625,has_glyph:1},{glyph:189,width:61,height:110,advance:74.6875,offset_x:7.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:190,width:61,height:110,advance:74.6875,offset_x:7.125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:191,width:61,height:109,advance:74.6875,offset_x:7.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:192,width:61,height:104,advance:74.6875,offset_x:7.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:193,width:42,height:110,advance:42.6875,offset_x:-1.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:194,width:33,height:110,advance:42.6875,offset_x:9.4375,offset_y:-108,scale:.0625,has_glyph:1},{glyph:195,width:44,height:109,advance:42.6875,offset_x:-2,offset_y:-107,scale:.0625,has_glyph:1},{glyph:196,width:51,height:104,advance:42.6875,offset_x:-5.5625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:197,width:71,height:120,advance:85.1875,offset_x:8.1875,offset_y:-118,scale:.0625,has_glyph:1},{glyph:198,width:63,height:104,advance:85.25,offset_x:11.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:199,width:71,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:200,width:71,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:201,width:71,height:109,advance:85.375,offset_x:7.5,offset_y:-107,scale:.0625,has_glyph:1},{glyph:202,width:71,height:106,advance:85.375,offset_x:7.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:203,width:71,height:104,advance:85.375,offset_x:7.5,offset_y:-102,scale:.0625,has_glyph:1},{glyph:204,width:69,height:72,advance:85.1875,offset_x:8.1875,offset_y:-73,scale:.0625,has_glyph:1},{glyph:205,width:71,height:85,advance:85.375,offset_x:7.5,offset_y:-78,scale:.0625,has_glyph:1},{glyph:206,width:64,height:110,advance:85.25,offset_x:11.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:207,width:64,height:110,advance:85.25,offset_x:11.8125,offset_y:-108,scale:.0625,has_glyph:1},{glyph:208,width:64,height:109,advance:85.25,offset_x:11.8125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:209,width:64,height:104,advance:85.25,offset_x:11.8125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:210,width:66,height:144,advance:74.5625,offset_x:4.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:211,width:67,height:147,advance:85.5,offset_x:12.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:212,width:66,height:138,advance:74.5625,offset_x:4.6875,offset_y:-102,scale:.0625,has_glyph:1},{glyph:213,width:88,height:121,advance:96,offset_x:4.25,offset_y:-121,scale:.0625,has_glyph:1},{glyph:214,width:63,height:101,advance:74.6875,offset_x:6.125,offset_y:-99,scale:.0625,has_glyph:1},{glyph:215,width:88,height:125,advance:96,offset_x:4.25,offset_y:-125,scale:.0625,has_glyph:1},{glyph:216,width:63,height:106,advance:74.6875,offset_x:6.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:217,width:91,height:126,advance:96,offset_x:4.25,offset_y:-96,scale:.0625,has_glyph:1},{glyph:218,width:64,height:103,advance:74.6875,offset_x:6.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:219,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:220,width:61,height:112,advance:74.5625,offset_x:7.5625,offset_y:-108,scale:.0625,has_glyph:1},{glyph:221,width:77,height:126,advance:85.125,offset_x:6.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:222,width:61,height:111,advance:74.5625,offset_x:7.5625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:223,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:224,width:61,height:106,advance:74.5625,offset_x:7.5625,offset_y:-102,scale:.0625,has_glyph:1},{glyph:225,width:77,height:127,advance:85.125,offset_x:6.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:226,width:61,height:111,advance:74.5625,offset_x:7.5625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:227,width:76,height:125,advance:95.8125,offset_x:14.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:228,width:95,height:114,advance:95.8125,offset_x:6.9375,offset_y:-112,scale:.0625,has_glyph:1},{glyph:229,width:87,height:96,advance:95.8125,offset_x:3.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:230,width:78,height:113,advance:85.25,offset_x:6.9375,offset_y:-111,scale:.0625,has_glyph:1},{glyph:231,width:63,height:121,advance:85.125,offset_x:14.625,offset_y:-121,scale:.0625,has_glyph:1},{glyph:232,width:61,height:101,advance:74.6875,offset_x:7.125,offset_y:-99,scale:.0625,has_glyph:1},{glyph:233,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:234,width:61,height:106,advance:74.6875,offset_x:7.125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:235,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:236,width:61,height:104,advance:74.6875,offset_x:7.125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:237,width:63,height:126,advance:85.125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:238,width:61,height:103,advance:74.6875,offset_x:7.125,offset_y:-73,scale:.0625,has_glyph:1},{glyph:239,width:63,height:125,advance:85.125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:240,width:61,height:109,advance:74.6875,offset_x:7.125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:241,width:82,height:126,advance:95.8125,offset_x:8.6875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:242,width:66,height:143,advance:74.5625,offset_x:6.8125,offset_y:-107,scale:.0625,has_glyph:1},{glyph:243,width:82,height:127,advance:95.8125,offset_x:8.6875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:244,width:66,height:140,advance:74.5625,offset_x:6.8125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:245,width:82,height:127,advance:95.8125,offset_x:8.6875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:246,width:66,height:138,advance:74.5625,offset_x:6.8125,offset_y:-102,scale:.0625,has_glyph:1},{glyph:247,width:82,height:134,advance:95.8125,offset_x:8.6875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:248,width:66,height:146,advance:74.5625,offset_x:6.8125,offset_y:-110,scale:.0625,has_glyph:1},{glyph:249,width:79,height:124,advance:106.1875,offset_x:14.125,offset_y:-124,scale:.0625,has_glyph:1},{glyph:250,width:62,height:124,advance:85.25,offset_x:13.375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:251,width:95,height:96,advance:106.1875,offset_x:5.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:252,width:74,height:111,advance:85.25,offset_x:1.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:253,width:49,height:125,advance:42.6875,offset_x:-2.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:254,width:49,height:106,advance:42.6875,offset_x:-3.3125,offset_y:-104,scale:.0625,has_glyph:1},{glyph:255,width:39,height:121,advance:42.6875,offset_x:2.375,offset_y:-121,scale:.0625,has_glyph:1},{glyph:256,width:40,height:101,advance:42.6875,offset_x:.1875,offset_y:-99,scale:.0625,has_glyph:1},{glyph:257,width:43,height:125,advance:42.6875,offset_x:0,offset_y:-125,scale:.0625,has_glyph:1},{glyph:258,width:44,height:106,advance:42.6875,offset_x:-1.75,offset_y:-104,scale:.0625,has_glyph:1},{glyph:259,width:29,height:126,advance:42.6875,offset_x:7.8125,offset_y:-96,scale:.0625,has_glyph:1},{glyph:260,width:32,height:133,advance:42.6875,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:261,width:21,height:125,advance:42.6875,offset_x:11.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:262,width:29,height:73,advance:42.6875,offset_x:11.375,offset_y:-71,scale:.0625,has_glyph:1},{glyph:263,width:72,height:98,advance:95.8125,offset_x:13.5,offset_y:-96,scale:.0625,has_glyph:1},{glyph:264,width:67,height:139,advance:85.375,offset_x:8.875,offset_y:-103,scale:.0625,has_glyph:1},{glyph:265,width:55,height:126,advance:53.125,offset_x:1.9375,offset_y:-124,scale:.0625,has_glyph:1},{glyph:266,width:47,height:143,advance:42.6875,offset_x:-3.625,offset_y:-107,scale:.0625,has_glyph:1},{glyph:267,width:74,height:133,advance:85.25,offset_x:13.5,offset_y:-97,scale:.0625,has_glyph:1},{glyph:268,width:62,height:147,advance:74.75,offset_x:11.875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:269,width:62,height:75,advance:74.75,offset_x:11.875,offset_y:-73,scale:.0625,has_glyph:1},{glyph:270,width:54,height:125,advance:74.6875,offset_x:14.9375,offset_y:-125,scale:.0625,has_glyph:1},{glyph:271,width:36,height:127,advance:42.6875,offset_x:10.75,offset_y:-125,scale:.0625,has_glyph:1},{glyph:272,width:54,height:132,advance:74.6875,offset_x:14.9375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:273,width:30,height:147,advance:42.6875,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:274,width:54,height:97,advance:74.6875,offset_x:14.9375,offset_y:-97,scale:.0625,has_glyph:1},{glyph:275,width:43,height:114,advance:53.5625,offset_x:11.6875,offset_y:-112,scale:.0625,has_glyph:1},{glyph:276,width:55,height:96,advance:74.6875,offset_x:15,offset_y:-96,scale:.0625,has_glyph:1},{glyph:277,width:56,height:113,advance:74.75,offset_x:11.6875,offset_y:-111,scale:.0625,has_glyph:1},{glyph:278,width:64,height:96,advance:74.6875,offset_x:4.375,offset_y:-96,scale:.0625,has_glyph:1},{glyph:279,width:41,height:113,advance:42.6875,offset_x:1.5,offset_y:-111,scale:.0625,has_glyph:1},{glyph:280,width:77,height:125,advance:106.3125,offset_x:15.0625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:281,width:63,height:108,advance:85.25,offset_x:11.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:282,width:77,height:132,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:283,width:63,height:109,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:284,width:77,height:124,advance:106.3125,offset_x:15.0625,offset_y:-124,scale:.0625,has_glyph:1},{glyph:285,width:63,height:107,advance:85.25,offset_x:11.5,offset_y:-107,scale:.0625,has_glyph:1},{glyph:286,width:77,height:132,advance:106.3125,offset_x:15.0625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:287,width:63,height:109,advance:85.25,offset_x:11.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:288,width:93,height:123,advance:106.8125,offset_x:7.1875,offset_y:-121,scale:.0625,has_glyph:1},{glyph:289,width:71,height:101,advance:85.375,offset_x:7.5,offset_y:-99,scale:.0625,has_glyph:1},{glyph:290,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:291,width:71,height:106,advance:85.375,offset_x:7.5,offset_y:-104,scale:.0625,has_glyph:1},{glyph:292,width:93,height:127,advance:106.8125,offset_x:7.1875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:293,width:73,height:110,advance:85.375,offset_x:7.5,offset_y:-108,scale:.0625,has_glyph:1},{glyph:294,width:123,height:100,advance:138.3125,offset_x:7.1875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:295,width:114,height:75,advance:127.75,offset_x:7.5,offset_y:-73,scale:.0625,has_glyph:1},{glyph:296,width:76,height:127,advance:95.8125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:297,width:45,height:108,advance:53.3125,offset_x:9.9375,offset_y:-108,scale:.0625,has_glyph:1},{glyph:298,width:76,height:132,advance:95.8125,offset_x:14.625,offset_y:-96,scale:.0625,has_glyph:1},{glyph:299,width:45,height:109,advance:53.3125,offset_x:9.9375,offset_y:-73,scale:.0625,has_glyph:1},{glyph:300,width:76,height:127,advance:95.8125,offset_x:14.625,offset_y:-125,scale:.0625,has_glyph:1},{glyph:301,width:46,height:107,advance:53.3125,offset_x:8.375,offset_y:-107,scale:.0625,has_glyph:1},{glyph:302,width:63,height:127,advance:74.625,offset_x:6.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:303,width:51,height:110,advance:64,offset_x:7.25,offset_y:-108,scale:.0625,has_glyph:1},{glyph:304,width:63,height:126,advance:74.625,offset_x:6.875,offset_y:-124,scale:.0625,has_glyph:1},{glyph:305,width:51,height:109,advance:64,offset_x:7.25,offset_y:-107,scale:.0625,has_glyph:1},{glyph:306,width:63,height:128,advance:74.625,offset_x:6.875,offset_y:-98,scale:.0625,has_glyph:1},{glyph:307,width:51,height:103,advance:64,offset_x:7.25,offset_y:-73,scale:.0625,has_glyph:1},{glyph:308,width:63,height:127,advance:74.625,offset_x:6.875,offset_y:-125,scale:.0625,has_glyph:1},{glyph:309,width:51,height:109,advance:64,offset_x:7.25,offset_y:-107,scale:.0625,has_glyph:1},{glyph:310,width:70,height:132,advance:74.5,offset_x:2.75,offset_y:-96,scale:.0625,has_glyph:1}],ai=[{glyph:22,codepoint:32},{glyph:23,codepoint:33},{glyph:24,codepoint:34},{glyph:25,codepoint:35},{glyph:26,codepoint:36},{glyph:27,codepoint:37},{glyph:28,codepoint:38},{glyph:29,codepoint:39},{glyph:30,codepoint:40},{glyph:31,codepoint:41},{glyph:32,codepoint:42},{glyph:33,codepoint:43},{glyph:34,codepoint:44},{glyph:35,codepoint:45},{glyph:36,codepoint:46},{glyph:37,codepoint:47},{glyph:38,codepoint:48},{glyph:39,codepoint:49},{glyph:40,codepoint:50},{glyph:41,codepoint:51},{glyph:42,codepoint:52},{glyph:43,codepoint:53},{glyph:44,codepoint:54},{glyph:45,codepoint:55},{glyph:46,codepoint:56},{glyph:47,codepoint:57},{glyph:48,codepoint:58},{glyph:49,codepoint:59},{glyph:50,codepoint:60},{glyph:51,codepoint:61},{glyph:52,codepoint:62},{glyph:53,codepoint:63},{glyph:54,codepoint:64},{glyph:55,codepoint:65},{glyph:56,codepoint:66},{glyph:57,codepoint:67},{glyph:58,codepoint:68},{glyph:59,codepoint:69},{glyph:60,codepoint:70},{glyph:61,codepoint:71},{glyph:62,codepoint:72},{glyph:63,codepoint:73},{glyph:64,codepoint:74},{glyph:65,codepoint:75},{glyph:66,codepoint:76},{glyph:67,codepoint:77},{glyph:68,codepoint:78},{glyph:69,codepoint:79},{glyph:70,codepoint:80},{glyph:71,codepoint:81},{glyph:72,codepoint:82},{glyph:73,codepoint:83},{glyph:74,codepoint:84},{glyph:75,codepoint:85},{glyph:76,codepoint:86},{glyph:77,codepoint:87},{glyph:78,codepoint:88},{glyph:79,codepoint:89},{glyph:80,codepoint:90},{glyph:81,codepoint:91},{glyph:82,codepoint:92},{glyph:83,codepoint:93},{glyph:84,codepoint:94},{glyph:85,codepoint:95},{glyph:86,codepoint:96},{glyph:87,codepoint:97},{glyph:88,codepoint:98},{glyph:89,codepoint:99},{glyph:90,codepoint:100},{glyph:91,codepoint:101},{glyph:92,codepoint:102},{glyph:93,codepoint:103},{glyph:94,codepoint:104},{glyph:95,codepoint:105},{glyph:96,codepoint:106},{glyph:97,codepoint:107},{glyph:98,codepoint:108},{glyph:99,codepoint:109},{glyph:100,codepoint:110},{glyph:101,codepoint:111},{glyph:102,codepoint:112},{glyph:103,codepoint:113},{glyph:104,codepoint:114},{glyph:105,codepoint:115},{glyph:106,codepoint:116},{glyph:107,codepoint:117},{glyph:108,codepoint:118},{glyph:109,codepoint:119},{glyph:110,codepoint:120},{glyph:111,codepoint:121},{glyph:112,codepoint:122},{glyph:113,codepoint:123},{glyph:114,codepoint:124},{glyph:115,codepoint:125},{glyph:116,codepoint:126},{glyph:118,codepoint:161},{glyph:119,codepoint:162},{glyph:120,codepoint:163},{glyph:121,codepoint:164},{glyph:122,codepoint:165},{glyph:123,codepoint:166},{glyph:124,codepoint:167},{glyph:125,codepoint:168},{glyph:126,codepoint:169},{glyph:127,codepoint:170},{glyph:128,codepoint:171},{glyph:129,codepoint:172},{glyph:130,codepoint:173},{glyph:131,codepoint:174},{glyph:132,codepoint:175},{glyph:133,codepoint:176},{glyph:134,codepoint:177},{glyph:135,codepoint:178},{glyph:136,codepoint:179},{glyph:137,codepoint:180},{glyph:138,codepoint:181},{glyph:139,codepoint:182},{glyph:140,codepoint:183},{glyph:141,codepoint:184},{glyph:142,codepoint:185},{glyph:143,codepoint:186},{glyph:144,codepoint:187},{glyph:145,codepoint:188},{glyph:146,codepoint:189},{glyph:147,codepoint:190},{glyph:148,codepoint:191},{glyph:149,codepoint:192},{glyph:150,codepoint:193},{glyph:151,codepoint:194},{glyph:152,codepoint:195},{glyph:153,codepoint:196},{glyph:154,codepoint:197},{glyph:155,codepoint:198},{glyph:156,codepoint:199},{glyph:157,codepoint:200},{glyph:158,codepoint:201},{glyph:159,codepoint:202},{glyph:160,codepoint:203},{glyph:161,codepoint:204},{glyph:162,codepoint:205},{glyph:163,codepoint:206},{glyph:164,codepoint:207},{glyph:165,codepoint:208},{glyph:166,codepoint:209},{glyph:167,codepoint:210},{glyph:168,codepoint:211},{glyph:169,codepoint:212},{glyph:170,codepoint:213},{glyph:171,codepoint:214},{glyph:172,codepoint:215},{glyph:173,codepoint:216},{glyph:174,codepoint:217},{glyph:175,codepoint:218},{glyph:176,codepoint:219},{glyph:177,codepoint:220},{glyph:178,codepoint:221},{glyph:179,codepoint:222},{glyph:180,codepoint:223},{glyph:181,codepoint:224},{glyph:182,codepoint:225},{glyph:183,codepoint:226},{glyph:184,codepoint:227},{glyph:185,codepoint:228},{glyph:186,codepoint:229},{glyph:187,codepoint:230},{glyph:188,codepoint:231},{glyph:189,codepoint:232},{glyph:190,codepoint:233},{glyph:191,codepoint:234},{glyph:192,codepoint:235},{glyph:193,codepoint:236},{glyph:194,codepoint:237},{glyph:195,codepoint:238},{glyph:196,codepoint:239},{glyph:197,codepoint:240},{glyph:198,codepoint:241},{glyph:199,codepoint:242},{glyph:200,codepoint:243},{glyph:201,codepoint:244},{glyph:202,codepoint:245},{glyph:203,codepoint:246},{glyph:204,codepoint:247},{glyph:205,codepoint:248},{glyph:206,codepoint:249},{glyph:207,codepoint:250},{glyph:208,codepoint:251},{glyph:209,codepoint:252},{glyph:210,codepoint:253},{glyph:211,codepoint:254},{glyph:212,codepoint:255},{glyph:213,codepoint:256},{glyph:214,codepoint:257},{glyph:215,codepoint:258},{glyph:216,codepoint:259},{glyph:217,codepoint:260},{glyph:218,codepoint:261},{glyph:219,codepoint:262},{glyph:220,codepoint:263},{glyph:221,codepoint:264},{glyph:222,codepoint:265},{glyph:223,codepoint:266},{glyph:224,codepoint:267},{glyph:225,codepoint:268},{glyph:226,codepoint:269},{glyph:227,codepoint:270},{glyph:228,codepoint:271},{glyph:229,codepoint:272},{glyph:230,codepoint:273},{glyph:231,codepoint:274},{glyph:232,codepoint:275},{glyph:233,codepoint:276},{glyph:234,codepoint:277},{glyph:235,codepoint:278},{glyph:236,codepoint:279},{glyph:237,codepoint:280},{glyph:238,codepoint:281},{glyph:239,codepoint:282},{glyph:240,codepoint:283},{glyph:241,codepoint:284},{glyph:242,codepoint:285},{glyph:243,codepoint:286},{glyph:244,codepoint:287},{glyph:245,codepoint:288},{glyph:246,codepoint:289},{glyph:247,codepoint:290},{glyph:248,codepoint:291},{glyph:249,codepoint:292},{glyph:250,codepoint:293},{glyph:251,codepoint:294},{glyph:252,codepoint:295},{glyph:253,codepoint:296},{glyph:254,codepoint:297},{glyph:255,codepoint:298},{glyph:256,codepoint:299},{glyph:257,codepoint:300},{glyph:258,codepoint:301},{glyph:259,codepoint:302},{glyph:260,codepoint:303},{glyph:261,codepoint:304},{glyph:262,codepoint:305},{glyph:263,codepoint:306},{glyph:264,codepoint:307},{glyph:265,codepoint:308},{glyph:266,codepoint:309},{glyph:267,codepoint:310},{glyph:268,codepoint:311},{glyph:269,codepoint:312},{glyph:270,codepoint:313},{glyph:271,codepoint:314},{glyph:272,codepoint:315},{glyph:273,codepoint:316},{glyph:274,codepoint:317},{glyph:275,codepoint:318},{glyph:276,codepoint:319},{glyph:277,codepoint:320},{glyph:278,codepoint:321},{glyph:279,codepoint:322},{glyph:280,codepoint:323},{glyph:281,codepoint:324},{glyph:282,codepoint:325},{glyph:283,codepoint:326},{glyph:284,codepoint:327},{glyph:285,codepoint:328},{glyph:286,codepoint:330},{glyph:287,codepoint:331},{glyph:288,codepoint:332},{glyph:289,codepoint:333},{glyph:290,codepoint:334},{glyph:291,codepoint:335},{glyph:292,codepoint:336},{glyph:293,codepoint:337},{glyph:294,codepoint:338},{glyph:295,codepoint:339},{glyph:296,codepoint:340},{glyph:297,codepoint:341},{glyph:298,codepoint:342},{glyph:299,codepoint:343},{glyph:300,codepoint:344},{glyph:301,codepoint:345},{glyph:302,codepoint:346},{glyph:303,codepoint:347},{glyph:304,codepoint:348},{glyph:305,codepoint:349},{glyph:306,codepoint:350},{glyph:307,codepoint:351},{glyph:308,codepoint:352},{glyph:309,codepoint:353},{glyph:310,codepoint:354}],ii=[{glyph:23,frame:{x:2,y:2,w:23,h:102},packed:{x:253,y:1014,w:27,h:106}},{glyph:24,frame:{x:2,y:2,w:42,h:40},packed:{x:1354,y:1413,w:46,h:44}},{glyph:25,frame:{x:2,y:2,w:77,h:87},packed:{x:0,y:1322,w:81,h:91}},{glyph:26,frame:{x:2,y:2,w:57,h:127},packed:{x:383,y:151,w:61,h:131}},{glyph:27,frame:{x:2,y:2,w:118,h:103},packed:{x:1196,y:904,w:122,h:107}},{glyph:28,frame:{x:2,y:2,w:71,h:94},packed:{x:733,y:1222,w:75,h:98}},{glyph:29,frame:{x:2,y:2,w:16,h:40},packed:{x:1400,y:1413,w:20,h:44}},{glyph:30,frame:{x:2,y:2,w:35,h:141},packed:{x:594,y:0,w:39,h:145}},{glyph:31,frame:{x:2,y:2,w:36,h:141},packed:{x:633,y:0,w:40,h:145}},{glyph:32,frame:{x:2,y:2,w:73,h:67},packed:{x:380,y:1413,w:77,h:71}},{glyph:33,frame:{x:2,y:2,w:69,h:69},packed:{x:307,y:1413,w:73,h:73}},{glyph:34,frame:{x:2,y:2,w:23,h:47},packed:{x:1256,y:1413,w:27,h:51}},{glyph:35,frame:{x:2,y:2,w:46,h:13},packed:{x:232,y:1489,w:50,h:17}},{glyph:36,frame:{x:2,y:2,w:22,h:23},packed:{x:82,y:1489,w:26,h:27}},{glyph:37,frame:{x:2,y:2,w:40,h:111},packed:{x:188,y:675,w:44,h:115}},{glyph:38,frame:{x:2,y:2,w:71,h:79},packed:{x:156,y:1322,w:75,h:83}},{glyph:39,frame:{x:2,y:2,w:35,h:76},packed:{x:432,y:1322,w:39,h:80}},{glyph:40,frame:{x:2,y:2,w:59,h:77},packed:{x:231,y:1322,w:63,h:81}},{glyph:41,frame:{x:2,y:2,w:61,h:94},packed:{x:808,y:1222,w:65,h:98}},{glyph:42,frame:{x:2,y:2,w:69,h:94},packed:{x:873,y:1222,w:73,h:98}},{glyph:43,frame:{x:2,y:2,w:65,h:92},packed:{x:1152,y:1222,w:69,h:96}},{glyph:44,frame:{x:2,y:2,w:65,h:93},packed:{x:1015,y:1222,w:69,h:97}},{glyph:45,frame:{x:2,y:2,w:57,h:92},packed:{x:1221,y:1222,w:61,h:96}},{glyph:46,frame:{x:2,y:2,w:64,h:93},packed:{x:1084,y:1222,w:68,h:97}},{glyph:47,frame:{x:2,y:2,w:65,h:94},packed:{x:946,y:1222,w:69,h:98}},{glyph:48,frame:{x:2,y:2,w:23,h:72},packed:{x:1352,y:1322,w:27,h:76}},{glyph:49,frame:{x:2,y:2,w:23,h:96},packed:{x:159,y:1121,w:27,h:100}},{glyph:50,frame:{x:2,y:2,w:65,h:62},packed:{x:895,y:1413,w:69,h:66}},{glyph:51,frame:{x:2,y:2,w:67,h:41},packed:{x:1283,y:1413,w:71,h:45}},{glyph:52,frame:{x:2,y:2,w:65,h:62},packed:{x:964,y:1413,w:69,h:66}},{glyph:53,frame:{x:2,y:2,w:59,h:103},packed:{x:1318,y:904,w:63,h:107}},{glyph:54,frame:{x:2,y:2,w:94,h:106},packed:{x:1081,y:791,w:98,h:110}},{glyph:55,frame:{x:2,y:2,w:88,h:96},packed:{x:186,y:1121,w:92,h:100}},{glyph:56,frame:{x:2,y:2,w:73,h:96},packed:{x:278,y:1121,w:77,h:100}},{glyph:57,frame:{x:2,y:2,w:77,h:100},packed:{x:636,y:1014,w:81,h:104}},{glyph:58,frame:{x:2,y:2,w:76,h:96},packed:{x:355,y:1121,w:80,h:100}},{glyph:59,frame:{x:2,y:2,w:63,h:96},packed:{x:435,y:1121,w:67,h:100}},{glyph:60,frame:{x:2,y:2,w:59,h:96},packed:{x:502,y:1121,w:63,h:100}},{glyph:61,frame:{x:2,y:2,w:82,h:100},packed:{x:717,y:1014,w:86,h:104}},{glyph:62,frame:{x:2,y:2,w:79,h:96},packed:{x:565,y:1121,w:83,h:100}},{glyph:63,frame:{x:2,y:2,w:17,h:96},packed:{x:648,y:1121,w:21,h:100}},{glyph:64,frame:{x:2,y:2,w:41,h:98},packed:{x:1094,y:1014,w:45,h:102}},{glyph:65,frame:{x:2,y:2,w:74,h:102},packed:{x:280,y:1014,w:78,h:106}},{glyph:66,frame:{x:2,y:2,w:54,h:96},packed:{x:669,y:1121,w:58,h:100}},{glyph:67,frame:{x:2,y:2,w:113,h:96},packed:{x:727,y:1121,w:117,h:100}},{glyph:68,frame:{x:2,y:2,w:77,h:96},packed:{x:844,y:1121,w:81,h:100}},{glyph:69,frame:{x:2,y:2,w:93,h:100},packed:{x:803,y:1014,w:97,h:104}},{glyph:70,frame:{x:2,y:2,w:68,h:96},packed:{x:925,y:1121,w:72,h:100}},{glyph:71,frame:{x:2,y:2,w:98,h:118},packed:{x:674,y:547,w:102,h:122}},{glyph:72,frame:{x:2,y:2,w:76,h:98},packed:{x:1139,y:1014,w:80,h:102}},{glyph:73,frame:{x:2,y:2,w:63,h:100},packed:{x:900,y:1014,w:67,h:104}},{glyph:74,frame:{x:2,y:2,w:70,h:96},packed:{x:997,y:1121,w:74,h:100}},{glyph:75,frame:{x:2,y:2,w:77,h:98},packed:{x:1219,y:1014,w:81,h:102}},{glyph:76,frame:{x:2,y:2,w:83,h:96},packed:{x:1071,y:1121,w:87,h:100}},{glyph:77,frame:{x:2,y:2,w:126,h:96},packed:{x:1158,y:1121,w:130,h:100}},{glyph:78,frame:{x:2,y:2,w:78,h:96},packed:{x:1288,y:1121,w:82,h:100}},{glyph:79,frame:{x:2,y:2,w:84,h:96},packed:{x:1370,y:1121,w:88,h:100}},{glyph:80,frame:{x:2,y:2,w:67,h:96},packed:{x:0,y:1222,w:71,h:100}},{glyph:81,frame:{x:2,y:2,w:33,h:140},packed:{x:673,y:0,w:37,h:144}},{glyph:82,frame:{x:2,y:2,w:40,h:111},packed:{x:232,y:675,w:44,h:115}},{glyph:83,frame:{x:2,y:2,w:33,h:140},packed:{x:710,y:0,w:37,h:144}},{glyph:84,frame:{x:2,y:2,w:60,h:65},packed:{x:580,y:1413,w:64,h:69}},{glyph:85,frame:{x:2,y:2,w:104,h:13},packed:{x:282,y:1489,w:108,h:17}},{glyph:86,frame:{x:2,y:2,w:33,h:28},packed:{x:1449,y:1359,w:37,h:32}},{glyph:87,frame:{x:2,y:2,w:63,h:75},packed:{x:471,y:1322,w:67,h:79}},{glyph:88,frame:{x:2,y:2,w:67,h:113},packed:{x:1070,y:547,w:71,h:117}},{glyph:89,frame:{x:2,y:2,w:61,h:77},packed:{x:294,y:1322,w:65,h:81}},{glyph:90,frame:{x:2,y:2,w:70,h:113},packed:{x:1141,y:547,w:74,h:117}},{glyph:91,frame:{x:2,y:2,w:61,h:75},packed:{x:538,y:1322,w:65,h:79}},{glyph:92,frame:{x:2,y:2,w:54,h:112},packed:{x:0,y:675,w:58,h:116}},{glyph:93,frame:{x:2,y:2,w:66,h:120},packed:{x:529,y:547,w:70,h:124}},{glyph:94,frame:{x:2,y:2,w:62,h:111},packed:{x:276,y:675,w:66,h:115}},{glyph:95,frame:{x:2,y:2,w:32,h:105},packed:{x:241,y:904,w:36,h:109}},{glyph:96,frame:{x:2,y:2,w:36,h:139},packed:{x:817,y:0,w:40,h:143}},{glyph:97,frame:{x:2,y:2,w:62,h:113},packed:{x:1215,y:547,w:66,h:117}},{glyph:98,frame:{x:2,y:2,w:30,h:113},packed:{x:1281,y:547,w:34,h:117}},{glyph:99,frame:{x:2,y:2,w:106,h:73},packed:{x:1025,y:1322,w:110,h:77}},{glyph:100,frame:{x:2,y:2,w:63,h:73},packed:{x:1135,y:1322,w:67,h:77}},{glyph:101,frame:{x:2,y:2,w:71,h:75},packed:{x:603,y:1322,w:75,h:79}},{glyph:102,frame:{x:2,y:2,w:69,h:109},packed:{x:1315,y:675,w:73,h:113}},{glyph:103,frame:{x:2,y:2,w:66,h:109},packed:{x:1388,y:675,w:70,h:113}},{glyph:104,frame:{x:2,y:2,w:45,h:73},packed:{x:1202,y:1322,w:49,h:77}},{glyph:105,frame:{x:2,y:2,w:51,h:75},packed:{x:678,y:1322,w:55,h:79}},{glyph:106,frame:{x:2,y:2,w:50,h:91},packed:{x:1282,y:1222,w:54,h:95}},{glyph:107,frame:{x:2,y:2,w:64,h:73},packed:{x:1251,y:1322,w:68,h:77}},{glyph:108,frame:{x:2,y:2,w:66,h:72},packed:{x:1379,y:1322,w:70,h:76}},{glyph:109,frame:{x:2,y:2,w:107,h:72},packed:{x:0,y:1413,w:111,h:76}},{glyph:110,frame:{x:2,y:2,w:61,h:71},packed:{x:184,y:1413,w:65,h:75}},{glyph:111,frame:{x:2,y:2,w:66,h:107},packed:{x:894,y:791,w:70,h:111}},{glyph:112,frame:{x:2,y:2,w:54,h:71},packed:{x:249,y:1413,w:58,h:75}},{glyph:113,frame:{x:2,y:2,w:42,h:144},packed:{x:241,y:0,w:46,h:148}},{glyph:114,frame:{x:2,y:2,w:14,h:139},packed:{x:857,y:0,w:18,h:143}},{glyph:115,frame:{x:2,y:2,w:42,h:144},packed:{x:287,y:0,w:46,h:148}},{glyph:116,frame:{x:2,y:2,w:78,h:27},packed:{x:0,y:1489,w:82,h:31}},{glyph:118,frame:{x:2,y:2,w:23,h:102},packed:{x:358,y:1014,w:27,h:106}},{glyph:119,frame:{x:2,y:2,w:61,h:112},packed:{x:58,y:675,w:65,h:116}},{glyph:120,frame:{x:2,y:2,w:56,h:91},packed:{x:1336,y:1222,w:60,h:95}},{glyph:121,frame:{x:2,y:2,w:66,h:66},packed:{x:457,y:1413,w:70,h:70}},{glyph:122,frame:{x:2,y:2,w:79,h:90},packed:{x:1396,y:1222,w:83,h:94}},{glyph:123,frame:{x:2,y:2,w:14,h:138},packed:{x:946,y:0,w:18,h:142}},{glyph:124,frame:{x:2,y:2,w:66,h:142},packed:{x:524,y:0,w:70,h:146}},{glyph:125,frame:{x:2,y:2,w:51,h:20},packed:{x:134,y:1489,w:55,h:24}},{glyph:126,frame:{x:2,y:2,w:97,h:97},packed:{x:1376,y:1014,w:101,h:101}},{glyph:127,frame:{x:2,y:2,w:51,h:61},packed:{x:1033,y:1413,w:55,h:65}},{glyph:128,frame:{x:2,y:2,w:77,h:63},packed:{x:732,y:1413,w:81,h:67}},{glyph:129,frame:{x:2,y:2,w:75,h:40},packed:{x:1420,y:1413,w:79,h:44}},{glyph:131,frame:{x:2,y:2,w:97,h:97},packed:{x:0,y:1121,w:101,h:101}},{glyph:132,frame:{x:2,y:2,w:39,h:14},packed:{x:189,y:1489,w:43,h:18}},{glyph:133,frame:{x:2,y:2,w:47,h:49},packed:{x:1205,y:1413,w:51,h:53}},{glyph:134,frame:{x:2,y:2,w:69,h:77},packed:{x:359,y:1322,w:73,h:81}},{glyph:135,frame:{x:2,y:2,w:49,h:64},packed:{x:644,y:1413,w:53,h:68}},{glyph:136,frame:{x:2,y:2,w:49,h:66},packed:{x:527,y:1413,w:53,h:70}},{glyph:137,frame:{x:2,y:2,w:34,h:28},packed:{x:1458,y:1121,w:38,h:32}},{glyph:138,frame:{x:2,y:2,w:64,h:105},packed:{x:277,y:904,w:68,h:109}},{glyph:139,frame:{x:2,y:2,w:69,h:96},packed:{x:71,y:1222,w:73,h:100}},{glyph:140,frame:{x:2,y:2,w:22,h:23},packed:{x:108,y:1489,w:26,h:27}},{glyph:141,frame:{x:2,y:2,w:32,h:33},packed:{x:1449,y:1322,w:36,h:37}},{glyph:142,frame:{x:2,y:2,w:31,h:64},packed:{x:697,y:1413,w:35,h:68}},{glyph:143,frame:{x:2,y:2,w:54,h:61},packed:{x:1088,y:1413,w:58,h:65}},{glyph:144,frame:{x:2,y:2,w:78,h:63},packed:{x:813,y:1413,w:82,h:67}},{glyph:145,frame:{x:2,y:2,w:121,h:105},packed:{x:345,y:904,w:125,h:109}},{glyph:146,frame:{x:2,y:2,w:122,h:105},packed:{x:470,y:904,w:126,h:109}},{glyph:147,frame:{x:2,y:2,w:134,h:105},packed:{x:596,y:904,w:138,h:109}},{glyph:148,frame:{x:2,y:2,w:59,h:103},packed:{x:1381,y:904,w:63,h:107}},{glyph:149,frame:{x:2,y:2,w:88,h:125},packed:{x:1235,y:287,w:92,h:129}},{glyph:150,frame:{x:2,y:2,w:88,h:125},packed:{x:1327,y:287,w:92,h:129}},{glyph:151,frame:{x:2,y:2,w:88,h:124},packed:{x:1111,y:418,w:92,h:128}},{glyph:152,frame:{x:2,y:2,w:88,h:125},packed:{x:0,y:418,w:92,h:129}},{glyph:153,frame:{x:2,y:2,w:88,h:124},packed:{x:1203,y:418,w:92,h:128}},{glyph:154,frame:{x:2,y:2,w:88,h:124},packed:{x:1295,y:418,w:92,h:128}},{glyph:155,frame:{x:2,y:2,w:105,h:96},packed:{x:144,y:1222,w:109,h:100}},{glyph:156,frame:{x:2,y:2,w:77,h:128},packed:{x:235,y:151,w:81,h:132}},{glyph:157,frame:{x:2,y:2,w:63,h:125},packed:{x:92,y:418,w:67,h:129}},{glyph:158,frame:{x:2,y:2,w:63,h:125},packed:{x:159,y:418,w:67,h:129}},{glyph:159,frame:{x:2,y:2,w:63,h:124},packed:{x:1387,y:418,w:67,h:128}},{glyph:160,frame:{x:2,y:2,w:63,h:124},packed:{x:1419,y:287,w:67,h:128}},{glyph:161,frame:{x:2,y:2,w:35,h:125},packed:{x:226,y:418,w:39,h:129}},{glyph:162,frame:{x:2,y:2,w:36,h:125},packed:{x:265,y:418,w:40,h:129}},{glyph:163,frame:{x:2,y:2,w:45,h:124},packed:{x:1449,y:151,w:49,h:128}},{glyph:164,frame:{x:2,y:2,w:51,h:124},packed:{x:1443,y:0,w:55,h:128}},{glyph:165,frame:{x:2,y:2,w:87,h:96},packed:{x:253,y:1222,w:91,h:100}},{glyph:166,frame:{x:2,y:2,w:77,h:125},packed:{x:305,y:418,w:81,h:129}},{glyph:167,frame:{x:2,y:2,w:93,h:127},packed:{x:444,y:151,w:97,h:131}},{glyph:168,frame:{x:2,y:2,w:93,h:127},packed:{x:541,y:151,w:97,h:131}},{glyph:169,frame:{x:2,y:2,w:93,h:126},packed:{x:391,y:287,w:97,h:130}},{glyph:170,frame:{x:2,y:2,w:93,h:127},packed:{x:638,y:151,w:97,h:131}},{glyph:171,frame:{x:2,y:2,w:93,h:126},packed:{x:488,y:287,w:97,h:130}},{glyph:172,frame:{x:2,y:2,w:55,h:55},packed:{x:1146,y:1413,w:59,h:59}},{glyph:173,frame:{x:2,y:2,w:93,h:108},packed:{x:681,y:791,w:97,h:112}},{glyph:174,frame:{x:2,y:2,w:77,h:127},packed:{x:735,y:151,w:81,h:131}},{glyph:175,frame:{x:2,y:2,w:77,h:127},packed:{x:816,y:151,w:81,h:131}},{glyph:176,frame:{x:2,y:2,w:77,h:126},packed:{x:585,y:287,w:81,h:130}},{glyph:177,frame:{x:2,y:2,w:77,h:126},packed:{x:666,y:287,w:81,h:130}},{glyph:178,frame:{x:2,y:2,w:84,h:125},packed:{x:386,y:418,w:88,h:129}},{glyph:179,frame:{x:2,y:2,w:68,h:96},packed:{x:344,y:1222,w:72,h:100}},{glyph:180,frame:{x:2,y:2,w:77,h:114},packed:{x:843,y:547,w:81,h:118}},{glyph:181,frame:{x:2,y:2,w:63,h:110},packed:{x:550,y:675,w:67,h:114}},{glyph:182,frame:{x:2,y:2,w:63,h:110},packed:{x:617,y:675,w:67,h:114}},{glyph:183,frame:{x:2,y:2,w:63,h:109},packed:{x:0,y:791,w:67,h:113}},{glyph:184,frame:{x:2,y:2,w:63,h:106},packed:{x:1179,y:791,w:67,h:110}},{glyph:185,frame:{x:2,y:2,w:63,h:104},packed:{x:734,y:904,w:67,h:108}},{glyph:186,frame:{x:2,y:2,w:63,h:115},packed:{x:776,y:547,w:67,h:119}},{glyph:187,frame:{x:2,y:2,w:104,h:75},packed:{x:733,y:1322,w:108,h:79}},{glyph:188,frame:{x:2,y:2,w:61,h:103},packed:{x:0,y:1014,w:65,h:107}},{glyph:189,frame:{x:2,y:2,w:61,h:110},packed:{x:684,y:675,w:65,h:114}},{glyph:190,frame:{x:2,y:2,w:61,h:110},packed:{x:749,y:675,w:65,h:114}},{glyph:191,frame:{x:2,y:2,w:61,h:109},packed:{x:67,y:791,w:65,h:113}},{glyph:192,frame:{x:2,y:2,w:61,h:104},packed:{x:801,y:904,w:65,h:108}},{glyph:193,frame:{x:2,y:2,w:42,h:110},packed:{x:814,y:675,w:46,h:114}},{glyph:194,frame:{x:2,y:2,w:33,h:110},packed:{x:860,y:675,w:37,h:114}},{glyph:195,frame:{x:2,y:2,w:44,h:109},packed:{x:132,y:791,w:48,h:113}},{glyph:196,frame:{x:2,y:2,w:51,h:104},packed:{x:866,y:904,w:55,h:108}},{glyph:197,frame:{x:2,y:2,w:71,h:120},packed:{x:599,y:547,w:75,h:124}},{glyph:198,frame:{x:2,y:2,w:63,h:104},packed:{x:921,y:904,w:67,h:108}},{glyph:199,frame:{x:2,y:2,w:71,h:110},packed:{x:897,y:675,w:75,h:114}},{glyph:200,frame:{x:2,y:2,w:71,h:110},packed:{x:972,y:675,w:75,h:114}},{glyph:201,frame:{x:2,y:2,w:71,h:109},packed:{x:180,y:791,w:75,h:113}},{glyph:202,frame:{x:2,y:2,w:71,h:106},packed:{x:1246,y:791,w:75,h:110}},{glyph:203,frame:{x:2,y:2,w:71,h:104},packed:{x:988,y:904,w:75,h:108}},{glyph:204,frame:{x:2,y:2,w:69,h:72},packed:{x:111,y:1413,w:73,h:76}},{glyph:205,frame:{x:2,y:2,w:71,h:85},packed:{x:81,y:1322,w:75,h:89}},{glyph:206,frame:{x:2,y:2,w:64,h:110},packed:{x:1047,y:675,w:68,h:114}},{glyph:207,frame:{x:2,y:2,w:64,h:110},packed:{x:1115,y:675,w:68,h:114}},{glyph:208,frame:{x:2,y:2,w:64,h:109},packed:{x:255,y:791,w:68,h:113}},{glyph:209,frame:{x:2,y:2,w:64,h:104},packed:{x:1063,y:904,w:68,h:108}},{glyph:210,frame:{x:2,y:2,w:66,h:144},packed:{x:333,y:0,w:70,h:148}},{glyph:211,frame:{x:2,y:2,w:67,h:147},packed:{x:0,y:0,w:71,h:151}},{glyph:212,frame:{x:2,y:2,w:66,h:138},packed:{x:964,y:0,w:70,h:142}},{glyph:213,frame:{x:2,y:2,w:88,h:121},packed:{x:327,y:547,w:92,h:125}},{glyph:214,frame:{x:2,y:2,w:63,h:101},packed:{x:385,y:1014,w:67,h:105}},{glyph:215,frame:{x:2,y:2,w:88,h:125},packed:{x:474,y:418,w:92,h:129}},{glyph:216,frame:{x:2,y:2,w:63,h:106},packed:{x:1321,y:791,w:67,h:110}},{glyph:217,frame:{x:2,y:2,w:91,h:126},packed:{x:747,y:287,w:95,h:130}},{glyph:218,frame:{x:2,y:2,w:64,h:103},packed:{x:65,y:1014,w:68,h:107}},{glyph:219,frame:{x:2,y:2,w:77,h:127},packed:{x:897,y:151,w:81,h:131}},{glyph:220,frame:{x:2,y:2,w:61,h:112},packed:{x:123,y:675,w:65,h:116}},{glyph:221,frame:{x:2,y:2,w:77,h:126},packed:{x:842,y:287,w:81,h:130}},{glyph:222,frame:{x:2,y:2,w:61,h:111},packed:{x:342,y:675,w:65,h:115}},{glyph:223,frame:{x:2,y:2,w:77,h:127},packed:{x:978,y:151,w:81,h:131}},{glyph:224,frame:{x:2,y:2,w:61,h:106},packed:{x:1388,y:791,w:65,h:110}},{glyph:225,frame:{x:2,y:2,w:77,h:127},packed:{x:1059,y:151,w:81,h:131}},{glyph:226,frame:{x:2,y:2,w:61,h:111},packed:{x:407,y:675,w:65,h:115}},{glyph:227,frame:{x:2,y:2,w:76,h:125},packed:{x:566,y:418,w:80,h:129}},{glyph:228,frame:{x:2,y:2,w:95,h:114},packed:{x:924,y:547,w:99,h:118}},{glyph:229,frame:{x:2,y:2,w:87,h:96},packed:{x:416,y:1222,w:91,h:100}},{glyph:230,frame:{x:2,y:2,w:78,h:113},packed:{x:1315,y:547,w:82,h:117}},{glyph:231,frame:{x:2,y:2,w:63,h:121},packed:{x:419,y:547,w:67,h:125}},{glyph:232,frame:{x:2,y:2,w:61,h:101},packed:{x:452,y:1014,w:65,h:105}},{glyph:233,frame:{x:2,y:2,w:63,h:125},packed:{x:646,y:418,w:67,h:129}},{glyph:234,frame:{x:2,y:2,w:61,h:106},packed:{x:0,y:904,w:65,h:110}},{glyph:235,frame:{x:2,y:2,w:63,h:125},packed:{x:713,y:418,w:67,h:129}},{glyph:236,frame:{x:2,y:2,w:61,h:104},packed:{x:1131,y:904,w:65,h:108}},{glyph:237,frame:{x:2,y:2,w:63,h:126},packed:{x:923,y:287,w:67,h:130}},{glyph:238,frame:{x:2,y:2,w:61,h:103},packed:{x:133,y:1014,w:65,h:107}},{glyph:239,frame:{x:2,y:2,w:63,h:125},packed:{x:780,y:418,w:67,h:129}},{glyph:240,frame:{x:2,y:2,w:61,h:109},packed:{x:323,y:791,w:65,h:113}},{glyph:241,frame:{x:2,y:2,w:82,h:126},packed:{x:990,y:287,w:86,h:130}},{glyph:242,frame:{x:2,y:2,w:66,h:143},packed:{x:403,y:0,w:70,h:147}},{glyph:243,frame:{x:2,y:2,w:82,h:127},packed:{x:1140,y:151,w:86,h:131}},{glyph:244,frame:{x:2,y:2,w:66,h:140},packed:{x:747,y:0,w:70,h:144}},{glyph:245,frame:{x:2,y:2,w:82,h:127},packed:{x:1226,y:151,w:86,h:131}},{glyph:246,frame:{x:2,y:2,w:66,h:138},packed:{x:1034,y:0,w:70,h:142}},{glyph:247,frame:{x:2,y:2,w:82,h:134},packed:{x:1104,y:0,w:86,h:138}},{glyph:248,frame:{x:2,y:2,w:66,h:146},packed:{x:171,y:0,w:70,h:150}},{glyph:249,frame:{x:2,y:2,w:79,h:124},packed:{x:0,y:547,w:83,h:128}},{glyph:250,frame:{x:2,y:2,w:62,h:124},packed:{x:83,y:547,w:66,h:128}},{glyph:251,frame:{x:2,y:2,w:95,h:96},packed:{x:507,y:1222,w:99,h:100}},{glyph:252,frame:{x:2,y:2,w:74,h:111},packed:{x:472,y:675,w:78,h:115}},{glyph:253,frame:{x:2,y:2,w:49,h:125},packed:{x:847,y:418,w:53,h:129}},{glyph:254,frame:{x:2,y:2,w:49,h:106},packed:{x:65,y:904,w:53,h:110}},{glyph:255,frame:{x:2,y:2,w:39,h:121},packed:{x:486,y:547,w:43,h:125}},{glyph:256,frame:{x:2,y:2,w:40,h:101},packed:{x:517,y:1014,w:44,h:105}},{glyph:257,frame:{x:2,y:2,w:43,h:125},packed:{x:900,y:418,w:47,h:129}},{glyph:258,frame:{x:2,y:2,w:44,h:106},packed:{x:118,y:904,w:48,h:110}},{glyph:259,frame:{x:2,y:2,w:29,h:126},packed:{x:1076,y:287,w:33,h:130}},{glyph:260,frame:{x:2,y:2,w:32,h:133},packed:{x:1190,y:0,w:36,h:137}},{glyph:261,frame:{x:2,y:2,w:21,h:125},packed:{x:947,y:418,w:25,h:129}},{glyph:262,frame:{x:2,y:2,w:29,h:73},packed:{x:1319,y:1322,w:33,h:77}},{glyph:263,frame:{x:2,y:2,w:72,h:98},packed:{x:1300,y:1014,w:76,h:102}},{glyph:264,frame:{x:2,y:2,w:67,h:139},packed:{x:875,y:0,w:71,h:143}},{glyph:265,frame:{x:2,y:2,w:55,h:126},packed:{x:1109,y:287,w:59,h:130}},{glyph:266,frame:{x:2,y:2,w:47,h:143},packed:{x:473,y:0,w:51,h:147}},{glyph:267,frame:{x:2,y:2,w:74,h:133},packed:{x:1226,y:0,w:78,h:137}},{glyph:268,frame:{x:2,y:2,w:62,h:147},packed:{x:71,y:0,w:66,h:151}},{glyph:269,frame:{x:2,y:2,w:62,h:75},packed:{x:841,y:1322,w:66,h:79}},{glyph:270,frame:{x:2,y:2,w:54,h:125},packed:{x:972,y:418,w:58,h:129}},{glyph:271,frame:{x:2,y:2,w:36,h:127},packed:{x:1312,y:151,w:40,h:131}},{glyph:272,frame:{x:2,y:2,w:54,h:132},packed:{x:1304,y:0,w:58,h:136}},{glyph:273,frame:{x:2,y:2,w:30,h:147},packed:{x:137,y:0,w:34,h:151}},{glyph:274,frame:{x:2,y:2,w:54,h:97},packed:{x:101,y:1121,w:58,h:101}},{glyph:275,frame:{x:2,y:2,w:43,h:114},packed:{x:1023,y:547,w:47,h:118}},{glyph:276,frame:{x:2,y:2,w:55,h:96},packed:{x:606,y:1222,w:59,h:100}},{glyph:277,frame:{x:2,y:2,w:56,h:113},packed:{x:1397,y:547,w:60,h:117}},{glyph:278,frame:{x:2,y:2,w:64,h:96},packed:{x:665,y:1222,w:68,h:100}},{glyph:279,frame:{x:2,y:2,w:41,h:113},packed:{x:1454,y:418,w:45,h:117}},{glyph:280,frame:{x:2,y:2,w:77,h:125},packed:{x:1030,y:418,w:81,h:129}},{glyph:281,frame:{x:2,y:2,w:63,h:108},packed:{x:778,y:791,w:67,h:112}},{glyph:282,frame:{x:2,y:2,w:77,h:132},packed:{x:1362,y:0,w:81,h:136}},{glyph:283,frame:{x:2,y:2,w:63,h:109},packed:{x:388,y:791,w:67,h:113}},{glyph:284,frame:{x:2,y:2,w:77,h:124},packed:{x:149,y:547,w:81,h:128}},{glyph:285,frame:{x:2,y:2,w:63,h:107},packed:{x:964,y:791,w:67,h:111}},{glyph:286,frame:{x:2,y:2,w:77,h:132},packed:{x:0,y:151,w:81,h:136}},{glyph:287,frame:{x:2,y:2,w:63,h:109},packed:{x:455,y:791,w:67,h:113}},{glyph:288,frame:{x:2,y:2,w:93,h:123},packed:{x:230,y:547,w:97,h:127}},{glyph:289,frame:{x:2,y:2,w:71,h:101},packed:{x:561,y:1014,w:75,h:105}},{glyph:290,frame:{x:2,y:2,w:93,h:127},packed:{x:1352,y:151,w:97,h:131}},{glyph:291,frame:{x:2,y:2,w:71,h:106},packed:{x:166,y:904,w:75,h:110}},{glyph:292,frame:{x:2,y:2,w:93,h:127},packed:{x:0,y:287,w:97,h:131}},{glyph:293,frame:{x:2,y:2,w:73,h:110},packed:{x:1183,y:675,w:77,h:114}},{glyph:294,frame:{x:2,y:2,w:123,h:100},packed:{x:967,y:1014,w:127,h:104}},{glyph:295,frame:{x:2,y:2,w:114,h:75},packed:{x:907,y:1322,w:118,h:79}},{glyph:296,frame:{x:2,y:2,w:76,h:127},packed:{x:97,y:287,w:80,h:131}},{glyph:297,frame:{x:2,y:2,w:45,h:108},packed:{x:845,y:791,w:49,h:112}},{glyph:298,frame:{x:2,y:2,w:76,h:132},packed:{x:81,y:151,w:80,h:136}},{glyph:299,frame:{x:2,y:2,w:45,h:109},packed:{x:522,y:791,w:49,h:113}},{glyph:300,frame:{x:2,y:2,w:76,h:127},packed:{x:177,y:287,w:80,h:131}},{glyph:301,frame:{x:2,y:2,w:46,h:107},packed:{x:1031,y:791,w:50,h:111}},{glyph:302,frame:{x:2,y:2,w:63,h:127},packed:{x:257,y:287,w:67,h:131}},{glyph:303,frame:{x:2,y:2,w:51,h:110},packed:{x:1260,y:675,w:55,h:114}},{glyph:304,frame:{x:2,y:2,w:63,h:126},packed:{x:1168,y:287,w:67,h:130}},{glyph:305,frame:{x:2,y:2,w:51,h:109},packed:{x:571,y:791,w:55,h:113}},{glyph:306,frame:{x:2,y:2,w:63,h:128},packed:{x:316,y:151,w:67,h:132}},{glyph:307,frame:{x:2,y:2,w:51,h:103},packed:{x:198,y:1014,w:55,h:107}},{glyph:308,frame:{x:2,y:2,w:63,h:127},packed:{x:324,y:287,w:67,h:131}},{glyph:309,frame:{x:2,y:2,w:51,h:109},packed:{x:626,y:791,w:55,h:113}},{glyph:310,frame:{x:2,y:2,w:70,h:132},packed:{x:161,y:151,w:74,h:136}}],hi={kernings:ti,meta:ei,chars:si,glyphs:ai,colors:ii};function vs(s){return new Promise(t=>{let e=new Image;e.onload=()=>t(e),e.src=s})}const _e=class _e{constructor(){o(this,"load",async()=>{let[t,e]=await Promise.all([vs(Ya),vs(Za)]),a=Ct.from_image(t);this.sprites=[],this.nine_slice=[],Ja.sprites.forEach(h=>{let{name:n,packs:_,tags:f}=h;if(n.match(/nine_slice/)){this.nine_slice.push(_e.make_nine_slice(a,h));return}let p=r.zero,m=[];f.forEach(g=>{let v=[];for(let y=g.from;y<=g.to;y++){let b=_[y],T=b.meta.duration/1e3,C=w.make(b.frame.x,b.frame.y,b.frame.w,b.frame.h),U=w.make(b.packed.x,b.packed.y,b.packed.w,b.packed.h),I=new ks(Gt.make(a,U,C),T);v.push(I)}let k=new Wa(g.name,v);m.push(k)});let c=new qa(n,p,m);this.sprites.push(c)});let i={...hi,size:128};this.sp_font=Ie.make(i,e)});o(this,"sp_font");o(this,"sprites");o(this,"nine_slice")}find_sprite(t){return this.sprites.find(e=>e.name===t)}find_nine(t){return this.nine_slice.find(e=>e.name===t)}};o(_e,"make_nine_slice",(t,e)=>{let{name:a,packs:i,_tags:h}=e,n=[];for(let _=0;_<3;_++)for(let f=0;f<3;f++){let p=i[0],m=1,c=_*p.frame.w/3,g=f*p.frame.h/3,v=w.make(p.frame.x,p.frame.y,p.frame.w/3,p.frame.h/3),k=w.make(c+p.packed.x,g+p.packed.y,4+400/3,4+400/3),y=new ks(Gt.make(t,k,v),m);n.push(y)}return new Ga(a,n)});let Be=_e;const Ut=new Be;function ri(s){var t;return s.clientX!==void 0&&s.clientY!==void 0?[s.clientX,s.clientY]:(t=s.targetTouches)!=null&&t[0]?[s.targetTouches[0].clientX,s.targetTouches[0].clientY]:[0,0]}class Zs{}o(Zs,"init",(t,e=document)=>{const a=k=>{let y=ri(k);return y?r.make(y[0],y[1]):r.zero};let{_onDragStart:i,_onDragMove:h,_onDragEnd:n,_onContextMenu:_,_onWheel:f}=t;const p=k=>{var y;k.preventDefault(),!(((y=k.touches)==null?void 0:y.length)>1)&&(i==null||i(a(k),k.buttons===2||k.button===2))},m=k=>{h==null||h(a(k))},c=k=>{n==null||n(a(k))},g=k=>{_&&(k.preventDefault(),_())},v=k=>{f&&(f(Math.sign(k.deltaY),a(k)),k.preventDefault())};return e.addEventListener("wheel",v,{passive:!1}),e.addEventListener("touchstart",p,{capture:!0,passive:!1}),e.addEventListener("mousedown",p,{capture:!0,passive:!1}),e.addEventListener("contextmenu",g),document.addEventListener("mousemove",m),document.addEventListener("mouseup",c),document.addEventListener("touchmove",m),document.addEventListener("touchend",c),()=>{e.removeEventListener("wheel",v),e.removeEventListener("touchstart",p),e.removeEventListener("mousedown",p),e.removeEventListener("contextmenu",g),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",c)}});class ni{constructor(){o(this,"_on_update");o(this,"_hooks",[])}register(t){return this._hooks.push(t),()=>{this._hooks.splice(this._hooks.indexOf(t),1)}}get hooks(){return this._hooks}_sort_hooks(){this._hooks.sort((t,e)=>(e.priority??0)-(t.priority??0))}_on_hover(t){var i,h;let e=this.hooks,a=e.findIndex(n=>{var _;return(_=n.on_hover)==null?void 0:_.call(n,t)});if(a!==-1)for(let n=a+1;n{var h;return(h=i.on_up)==null?void 0:h.call(i,t,e,a)})}_on_click(t,e){this.hooks.find(a=>{var i;return(i=a.on_click)==null?void 0:i.call(a,t,e)})}_on_click_begin(t,e){this.hooks.find(a=>{var i;return(i=a.on_click_begin)==null?void 0:i.call(a,t,e)})}_on_drag(t,e){this.hooks.find(a=>{var i;return(i=a.on_drag)==null?void 0:i.call(a,t,e)})}_on_context(){this.hooks.find(t=>{var e;return(e=t.on_context)==null?void 0:e.call(t)})}_on_wheel(t,e){this.hooks.find(a=>{var i;return(i=a.on_wheel)==null?void 0:i.call(a,t,e)})}listen(t){let e;const a=()=>{e=t.getBoundingClientRect()};a();const i=m=>{let c=r.make(e.x,e.y),g=r.make(e.width,e.height);return m.sub(c).div(g)};let h=m=>m&&{...m},n,_,f,p=this;Zs.init({_onDragStart(m,c){if(c)return;let g=i(m);_=h(n),n={e:g,_right:c},p._on_update=()=>{n?((n.m||f&&n.e.distance(f)>16/1080)&&(n.m=f),p._on_drag(n,_),_=h(n)):p._on_update=void 0},p._on_click_begin(g,c)},_onDragMove(m){let c=i(m);f=c,n||p._on_hover(c)},_onDragEnd(){n&&(n.m||p._on_click(n.e,n._right),p._on_up(n.e,n._right,n.m),p._on_update=void 0,n=void 0,f=void 0)},_onWheel(m,c){var g;(g=p._on_wheel)==null||g.call(p,m,i(c))},_onContextMenu(){}},t),document.addEventListener("scroll",()=>{a()},{capture:!0,passive:!0}),window.addEventListener("resize",()=>{a()},{passive:!0})}update(){var t;(t=this._on_update)==null||t.call(this)}}const oe=new ni;var oi=`#version 300 es uniform mat4 u_matrix; layout(location=0) in vec2 a_position; layout(location=1) in vec2 a_tex; @@ -47,7 +47,7 @@ void main(void) { v_tex = a_tex; v_col = a_color; v_type = a_type; -}`,_i=`#version 300 es +}`,li=`#version 300 es precision mediump float; uniform sampler2D u_texture; @@ -67,7 +67,7 @@ void main(void) { vec4 t1 = texture(u_texture2, v_tex); o_color = color == red ? t0 : color == green ? t1 : color; -}`;let Ae;const bs=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1)]),ci="u_texture",di="u_texture2",pi="u_mask_texture",fi="u_matrix";let J=w.make(0,0,1,1);const mi=J.x,gi=J.y,yi=J.x+J.w,ui=J.y,wi=J.x+J.w,xi=J.x+J.h,ki=J.x,vi=J.x+J.h,[bi,Ti,Ei,Ai,Si,Mi,Fi,zi]=[0,0,1,0,1,1,0,1];class Ri{constructor(){o(this,"texture2");o(this,"texture");o(this,"mask_texture");o(this,"mesh");o(this,"material");o(this,"indices",[0,1,2,0,2,3]);o(this,"vertices",[]);o(this,"matrix");o(this,"sampler",bt.get_default)}set_matrix(t){this.matrix=t,this.vertices=[],this.PUSH_VERTEX(mi,gi,bi,Ti),this.PUSH_VERTEX(yi,ui,Ei,Ai),this.PUSH_VERTEX(wi,xi,Si,Mi),this.PUSH_VERTEX(ki,vi,Fi,zi)}PUSH_VERTEX(t,e,a,i){let h=this.matrix;this.vertices.push(new Ci(r.make(t*h.m11+e*h.m21+h.m31,t*h.m12+e*h.m22+h.m32),r.make(a,1-i)))}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){Ae||(Ae=Jt.create([li,_i])),this.mesh||(this.mesh=Qt.create()),this.material||(this.material=ye.create(Ae));let a=bs.stride,i=new ArrayBuffer(a*this.vertices.length),h=new DataView(i);this.vertices.reduce((_,f)=>f.push_to(h,_),0),this.mesh.index_data(this.indices),this.mesh.vertex_data(bs,i);let n=new Je;n.target=t,n.mesh=this.mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,n.material=this.material,n.material.set_texture(ci,this.texture),n.material.set_texture(di,this.texture2),n.material.set_texture(pi,this.mask_texture),n.material.set_sampler_at_location(0,this.sampler),n.material.set_sampler_at_location(1,this.sampler),n.material.set_sampler_at_location(2,this.sampler),n.material.set_matrix(fi,e),n.index_start=0,n.index_count=this.indices.length,n.perform()}}let Ci=class{constructor(t,e){this.pos=t,this.tex=e}push_to(t,e){let{pos:a,tex:i}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),e+16}};const Dt=new Ri;var Ui=`#version 300 es +}`;let Ae;const bs=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1)]),_i="u_texture",ci="u_texture2",di="u_mask_texture",pi="u_matrix";let J=w.make(0,0,1,1);const fi=J.x,mi=J.y,gi=J.x+J.w,yi=J.y,ui=J.x+J.w,wi=J.x+J.h,xi=J.x,ki=J.x+J.h,[vi,bi,Ti,Ei,Ai,Si,Mi,Fi]=[0,0,1,0,1,1,0,1];class zi{constructor(){o(this,"texture2");o(this,"texture");o(this,"mask_texture");o(this,"mesh");o(this,"material");o(this,"indices",[0,1,2,0,2,3]);o(this,"vertices",[]);o(this,"matrix");o(this,"sampler",bt.get_default)}set_matrix(t){this.matrix=t,this.vertices=[],this.PUSH_VERTEX(fi,mi,vi,bi),this.PUSH_VERTEX(gi,yi,Ti,Ei),this.PUSH_VERTEX(ui,wi,Ai,Si),this.PUSH_VERTEX(xi,ki,Mi,Fi)}PUSH_VERTEX(t,e,a,i){let h=this.matrix;this.vertices.push(new Ri(r.make(t*h.m11+e*h.m21+h.m31,t*h.m12+e*h.m22+h.m32),r.make(a,1-i)))}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){Ae||(Ae=Zt.create([oi,li])),this.mesh||(this.mesh=Jt.create()),this.material||(this.material=ye.create(Ae));let a=bs.stride,i=new ArrayBuffer(a*this.vertices.length),h=new DataView(i);this.vertices.reduce((_,f)=>f.push_to(h,_),0),this.mesh.index_data(this.indices),this.mesh.vertex_data(bs,i);let n=new Je;n.target=t,n.mesh=this.mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,n.material=this.material,n.material.set_texture(_i,this.texture),n.material.set_texture(ci,this.texture2),n.material.set_texture(di,this.mask_texture),n.material.set_sampler_at_location(0,this.sampler),n.material.set_sampler_at_location(1,this.sampler),n.material.set_sampler_at_location(2,this.sampler),n.material.set_matrix(pi,e),n.index_start=0,n.index_count=this.indices.length,n.perform()}}let Ri=class{constructor(t,e){this.pos=t,this.tex=e}push_to(t,e){let{pos:a,tex:i}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),e+16}};const Pt=new zi;var Ci=`#version 300 es uniform mat4 u_matrix; layout(location=0) in vec2 a_position; layout(location=1) in vec2 a_tex; @@ -82,7 +82,7 @@ void main(void) { v_tex = a_tex; v_col = a_color; v_type = a_type; -}`,Oi=`#version 300 es +}`,Ui=`#version 300 es precision mediump float; uniform sampler2D u_texture; @@ -95,7 +95,7 @@ void main(void) { vec4 color = texture(u_texture, v_tex); o_color = color; -}`;let Se;const Ts=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1)]),Ni="u_texture",Di="u_matrix";let Z=w.make(0,0,1,1);const Pi=Z.x,Li=Z.y,$i=Z.x+Z.w,Ii=Z.y,Bi=Z.x+Z.w,Hi=Z.x+Z.h,ji=Z.x,Xi=Z.x+Z.h,[Vi,Ki,Wi,qi,Gi,Yi,Qi,Ji]=[0,0,1,0,1,1,0,1];class Zi{constructor(){o(this,"texture");o(this,"mesh");o(this,"material");o(this,"indices",[0,1,2,0,2,3]);o(this,"vertices",[]);o(this,"matrix");o(this,"sampler",bt.get_default)}set_matrix(t){this.matrix=t,this.vertices=[],this.PUSH_VERTEX(Pi,Li,Vi,Ki),this.PUSH_VERTEX($i,Ii,Wi,qi),this.PUSH_VERTEX(Bi,Hi,Gi,Yi),this.PUSH_VERTEX(ji,Xi,Qi,Ji)}PUSH_VERTEX(t,e,a,i){let h=this.matrix;this.vertices.push(new th(r.make(t*h.m11+e*h.m21+h.m31,t*h.m12+e*h.m22+h.m32),r.make(a,1-i)))}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){Se||(Se=Jt.create([Ui,Oi])),this.mesh||(this.mesh=Qt.create()),this.material||(this.material=ye.create(Se));let a=Ts.stride,i=new ArrayBuffer(a*this.vertices.length),h=new DataView(i);this.vertices.reduce((_,f)=>f.push_to(h,_),0),this.mesh.index_data(this.indices),this.mesh.vertex_data(Ts,i);let n=new Je;n.target=t,n.mesh=this.mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,n.material=this.material,n.material.set_texture(Ni,this.texture),n.material.set_sampler_at_location(0,this.sampler),n.material.set_matrix(Di,e),n.index_start=0,n.index_count=this.indices.length,n.perform()}}class th{constructor(t,e){this.pos=t,this.tex=e}push_to(t,e){let{pos:a,tex:i}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),e+16}}const Me=new Zi;function dt(s,t,e){return s+(t-s)*e}function He(s,t,e){return s=e.length-1&&(this.loop===1?(this._i=0,this._values.reverse(),this._durations.reverse()):this._completed=!0))}init(){return this._i=0,this._t=0,this._completed=!1,this._value=this._values[0],this}};o(ce,"make",(t,e,a=!1)=>new ce(t.slice(0),[e],a?1:0).init());let je=ce;u.hex(2106417);const ah=u.hex(4895437),de=class de{constructor(){o(this,"_render_order",0);o(this,"visible",!0);o(this,"g_position");o(this,"position");o(this,"rotation");o(this,"origin",r.zero);o(this,"scale",r.one);o(this,"hit_area");o(this,"debug_hit",!1);o(this,"coroutines",[]);o(this,"_data");o(this,"_disposes");o(this,"objects");o(this,"parent");o(this,"g_scissor");o(this,"_tweens",[]);o(this,"_tween")}get ghit_area(){var t;return(t=this.hit_area)==null?void 0:t.add(this.g_position)}routine(t){this.coroutines.push(t)}*wait_for(t){let e=0;for(;ee[0]!==t)}tween_single(t,e,a,i,h=0,n){return t&&this.cancel(t),this.tween(e,a,i,h,n)}make(t,e=r.zero,a={}){let i=this._make(t,e,a);return this._add_object(i),i}init(){return this._disposes=[],this.objects=[],this._init(),this}update(){this.coroutines=this.coroutines.filter(t=>!t.next().done),this.objects.forEach(t=>t.update()),this._tweens=this._tweens.filter(([t,e,a])=>(t.update(S.delta),e(t.value),t.completed&&a&&a(),!t.completed)),this._update()}draw(t){this.visible&&(this._render_order=de.next_render_order++,this._draw(t))}_draw_children(t){this.objects.forEach(e=>e.draw(t))}dispose(){this.objects.slice(0).forEach(t=>t.dispose()),this._dispose(),this._disposes.forEach(t=>t()),this.parent&&this.parent.objects.splice(this.parent.objects.indexOf(this),1)}_init(){}_update(){}_draw(t){t.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,t.m_matrix),this._draw_children(t),this.hit_area&&this.debug_hit&&t.rect(this.hit_area,u.red),t.pop_matrix()}_dispose(){}};o(de,"next_render_order",0);let x=de;class Zt extends x{get data(){return this._data}get nine(){return Ut.find_nine(this.data.name)}_draw(t){let{frames:e}=this.nine,a=400/3,i=(this.data.h-a*2)/a,h=(this.data.w-a*2)/a;t.push_matrix(A.create_transform(this.position,r.zero,r.one,0)),this.g_position=r.transform(r.zero,t.m_matrix),t.stex(e[0].image,r.make(0,0),u.white),t.stex_o(e[1].image,r.make(0,a),r.zero,r.make(1,i),0,u.white),t.stex(e[2].image,r.make(0,a+i*a),u.white),t.stex_o(e[3].image,r.make(a,0),r.zero,r.make(h,1),0,u.white),t.stex_o(e[4].image,r.make(a,a),r.zero,r.make(h,i),0,u.white),t.stex_o(e[5].image,r.make(a,a+i*a),r.zero,r.make(h,1),0,u.white),t.stex(e[6].image,r.make(a+h*a,0),u.white),t.stex_o(e[7].image,r.make(a+h*a,a),r.zero,r.make(1,i),0,u.white),t.stex(e[8].image,r.make(a+h*a,a+i*a),u.white),t.pop_matrix()}}class N extends x{constructor(){super(...arguments);o(this,"alpha",255);o(this,"_animation","idle");o(this,"_frame_counter",0);o(this,"_frame",0);o(this,"_loop",!1);o(this,"_reverse",!1);o(this,"_on_complete");o(this,"will_play")}get data(){return this._data}get sprite(){return Ut.find_sprite(this.data.name)}get alpha_color(){return new u(this.alpha,this.alpha,this.alpha,this.alpha)}get animation(){return this.sprite.get(this._animation)}get frame(){var e;return(e=this.animation)==null?void 0:e.frames[this._frame]}get subtexture(){var e;return(e=this.frame)==null?void 0:e.image}get duration(){var e;return(e=this.frame)==null?void 0:e.duration}play_now(e,a,i=!1){var h;if(this._on_complete=a,this._animation=e,this._frame=0,i){let n=((h=this.animation)==null?void 0:h.frames.length)||0;this._frame=n-1}this._reverse=i}play(e,a,i=!1){this.will_play=()=>this.play_now(e,a,i)}play_o(e,a){this._loop=a.loop??!1,this.play_now(e)}_update(){var i,h;const e=(i=this.animation)==null?void 0:i.frames.length,a=(h=this.frame)==null?void 0:h.duration;e&&a&&(this._frame_counter+=S.delta,this._frame_counter>=a&&(this._frame_counter-=a,this._reverse?(this._frame--,this._frame<0&&(this._loop?this._frame=e-1:this._frame=0,this._on_complete&&this._on_complete(),this.will_play&&(this.will_play(),this.will_play=void 0))):(this._frame++,this._frame>=e&&(this._loop?this._frame=0:this._frame=e-1,this._on_complete&&this._on_complete(),this.will_play&&(this.will_play(),this.will_play=void 0)))))}_draw(e){this.subtexture&&(e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),e.stex(this.subtexture,r.zero,this.alpha_color),e.pop_matrix())}}const ih=s=>s!==void 0,hh=s=>{const t={get:e=>s.getItem(e),set:(e,a)=>s.setItem(e,a),remove:e=>s.removeItem(e),make:e=>({get:()=>t.get(e),set:a=>t.set(e,a),remove:()=>t.remove(e)}),makeBoolean:e=>({get:()=>t.get(e)=="1",set:a=>t.set(e,a?"1":"0"),toggle:()=>t.set(e,t.get(e)=="1"?"0":"1")})};return t},Es=hh(window.localStorage),St=(s,t)=>e=>{if(ih(e))return Es.set(s,JSON.stringify(e)),e;const a=JSON.parse(Es.get(s));return a!==null?a:t()},As={threecards:1,onecard:1.5,nolimit:1,threepass:1.5,onepass:2.2},yt=class yt{constructor(t,e,a,i){this.win=t,this.score=e,this.turning_cards=a,this.turning_limit=i}get turning_cards_multiplier(){return As[this.turning_cards]}get turning_limit_multiplier(){return As[this.turning_limit]}get multiplied_score(){return this.score*(this.turning_cards_multiplier+this.turning_limit_multiplier)}get fen(){return[this.win,this.score,this.turning_cards,this.turning_limit].join("/")}};o(yt,"from_fen",t=>{let[e,a,i,h]=t.split("/");return new yt(e==="true",parseInt(a),i,h)}),o(yt,"from_win",(t,e)=>new yt(!0,e,t.cards,t.limit)),o(yt,"from_loss",(t,e)=>new yt(!1,e,t.cards,t.limit));let Gt=yt;const pe=class pe{constructor(t){this.list=t}get fen(){return this.list.map(t=>t.fen).join("$")}push(t){this.list.push(t)}clear(){this.list.length=0}get total_wins(){return this.list.filter(t=>t.win).length}get total_played(){return this.list.length}get top_5_highscores(){return this.list.sort((t,e)=>e.multiplied_score-t.multiplied_score).slice(0,5)}};o(pe,"from_fen",(t,e)=>new pe(t===""?[]:t.split("$").map(a=>e(a))));let Ot=pe;class rh{constructor(t,e,a){this.solitaire=t,this.freecell=e,this.spider=a}get total_wins(){return this.freecell_total_wins+this.spider_total_wins+this.solitaire_total_wins}get total_played(){return this.freecell_total_played+this.spider_total_played+this.solitaire_total_played}get top_5_highscores(){return[...this.freecell_top_5_highscores,...this.spider_top_5_highscores,...this.solitaire_top_5_highscores].sort((t,e)=>e.multiplied_score-t.multiplied_score).slice(0,5)}get freecell_total_wins(){return this.freecell.total_wins}get freecell_total_played(){return this.freecell.total_played}get freecell_top_5_highscores(){return this.freecell.top_5_highscores}get spider_total_wins(){return this.spider.total_wins}get spider_total_played(){return this.spider.total_played}get spider_top_5_highscores(){return this.spider.top_5_highscores}get solitaire_total_wins(){return this.solitaire.total_wins}get solitaire_total_played(){return this.solitaire.total_played}get solitaire_top_5_highscores(){return this.solitaire.top_5_highscores}}let Ss=["nolimit","threepass","onepass"],Ms=["threecards","onecard"];class nh{constructor(){o(this,"_cards");o(this,"_limit");let t="threecards";this._cards=St("cards",()=>t);let e="nolimit";this._limit=St("limit",()=>e)}get cards(){return this._cards()}set cards(t){this._cards(t)}get limit(){return this._limit()}set limit(t){this._limit(t)}get general_settings(){let{limit:t,cards:e}=this;return{limit:t,cards:e}}}class oh{constructor(){o(this,"_music");o(this,"_sound");o(this,"_language");let t="en";this._language=St("language",()=>t),this._sound=St("sound",()=>!0),this._music=St("music",()=>!0)}get music(){return this._music()}set music(t){this._music(t)}get sound(){return this._sound()}set sound(t){this._sound(t)}get language(){return this._language()}set language(t){this._language(t)}}let Ht=new nh,it=new oh;class lh{constructor(){o(this,"_results");this._results=St("solitaire_results",()=>new Ot([]).fen)}set results(t){this._results(t.fen)}get results(){return Ot.from_fen(this._results(),Gt.from_fen)}add_result(t){let e=this.results;e.push(t),this.results=e}clear_results(){let t=this.results;t.clear(),this.results=t}}let Nt=new lh;function Fs(s){return new Audio(s)}let _h=["Win","new_game","auto_flip","drag1","drag2","drag3","cancel","drop","hit","recycle","undo2"];class ch{constructor(){o(this,"audios");o(this,"musics");o(this,"load",async()=>{this.audios={},_h.forEach(t=>this.audios[t]=[...Array(4).keys()].map(()=>Fs(`./audio/${t}.wav`))),this.musics={},this.musics.main=Fs("./music/SoundBox-music.wav")})}play(t){if(!it.sound)return;let e=this.audios[t],a=e.pop();e.unshift(a),a.play()}stop_music(){this.musics.main.pause()}music(t){if(!it.music)return;let e=this.musics[t];e.loop=!0,e.play()}}const V=new ch,gt=1/60,P={seconds:60*gt,half:30*gt,thirds:20*gt,lengths:15*gt,sixth:10*gt,five:5*gt,three:3*gt,one:1*gt},Q=r.make(1920,1080),dh=(s=1)=>()=>{var t=Math.sin(s++)*1e4;return t-Math.floor(t)},es=dh();function ph(s,t=es){return Math.floor(t()*s)}function fh(s,t=es){return s[ph(s.length,t)]}const $=(s=es)=>r.make(s(),s());function mh(s){for(var t=s.length-1;t>0;t--){var e=Math.floor(Math.random()*(t+1)),a=s[t];s[t]=s[e],s[e]=a}return s}class ss extends x{get data(){return this._data}_init(){let t=this.make(N,r.make(0,0),{name:"button_bg"});t.origin=r.make(366,200).scale(1/2),this.make(z,r.make(0,-30),{width:360,height:100,key:this.data.text,center:!0});let e=this;this.make(B,r.make(-366+80,-200+80).scale(1/2),{rect:w.make(0,0,366-80,200-80),on_hover(){t.play_o("hover",{loop:!1})},on_hover_end(){t.play("hover",()=>{t.play("idle")},!0)},on_click_begin(){t.play_o("click",{loop:!1})},on_click(){e.data.on_click()}})}}let Xe=[1,2,3,4,5,6,7],zs=[1,2,3,4];const ta=["d","c","h","s"],gh=["A","K","Q","J","T","9","8","7","6","5","4","3","2"],Ve=["A","2","3","4","5","6","7","8","9","T","J","Q","K"],yh=ta.flatMap(s=>gh.map(t=>`${s}${t}`));function Rs(s){switch(s[0]){case"d":case"h":return"red";default:return"black"}}function uh(s,t){return Ve[Ve.indexOf(t[1])-1]===s[1]}function wh(s,t){return Rs(s)!=Rs(t)}function xh(s){return s[1]==="K"}function kh(s){return s[1]==="A"}let vh=class{static get deck(){return yh.slice(0)}};function bh(s){let t=[];for(let e=0;e=0;e--)this.cards.unshift(t[e])}remove_cards(t){return this.cards.splice(-t)}remove_all(){return this.remove_cards(this.cards.length)}},o(ht,"take_n",(t,e)=>new ht(t.splice(0,e))),o(ht,"from_fen",t=>new ht(bh(t))),ht);const at={Recycle:-10,HitStock:0,WasteToTableu:10,WasteToFoundation:30,FoundationToTableu:-5,Undo:-20,TableuToFoundationFlip:35,TableuToFoundationNoFlip:20,TableuToTableuFlip:10,TableuToTableuNoFlip:0};class as{constructor(t){this.score=t}static empty(){return new as(0)}}let Th=class ea{constructor(t,e){this.back=t,this.front=e}can_drag(t){let a=this.front.clone.remove_cards(t);if(a.length===t)return a}can_drop(t){let e=t[0];return e?this.front.length>0?wh(e,this.front.top_card)&&uh(e,this.front.top_card):xh(e):!1}undo_from_tableu(t){if(t[1]){let e=this.front.remove_cards(1);this.back.add_cards(e)}this.front.add_cards(t[0])}undo_to_tableu(t){this.front.remove_cards(t.length)}to_tableu(t){this.front.add_cards(t)}from_tableu(t){let e=this.front.remove_cards(t);if(this.front.length===0){let[a]=this.back.remove_cards(1);if(a)return this.front.add_cards([a]),[e,a]}return[e,void 0]}static make(t,e){return new ea(Mt.take_n(t,e),Mt.take_n(t,1))}},Eh=class sa{constructor(t){this.foundation=t}get suit(){var t;return(t=this.foundation.top_card)==null?void 0:t[0]}get next_top(){if(!this.suit)return;let t=this.suit,e=Ve[this.foundation.length];return`${t}${e}`}can_drop(t){let[e]=t;return t.length===1&&(this.next_top?e===this.next_top:kh(e))}can_drag(){return this.foundation.top_card}get is_finished(){return this.foundation.length===13}undo_from_foundation(t){this.foundation.add_cards(t)}undo_to_foundation(t){this.foundation.remove_cards(t.length)}from_foundation(){return this.foundation.remove_cards(1)}to_foundation(t){this.foundation.add_cards(t)}static make(){return new sa(Mt.empty)}},Ah=class aa{constructor(t,e,a){this.stock=t,this.waste=e,this.hidden=a}can_drag(){return this.waste.top_card}can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}can_hit_stock(){return this.stock.length>0}hit(t){let e=this.stock.remove_cards(t),a=this.waste.remove_all();return this.hidden.unshift_cards(a),this.waste.add_cards(e),[a,e]}undo_hit(t){let[e,a]=t,i=this.waste.remove_cards(a.length),h=this.hidden.shift_cards(e.length);this.waste.add_cards(h),this.stock.add_cards(i)}recycle(){let t=this.waste.remove_all();return this.hidden.unshift_cards(t),this.stock.add_cards(this.hidden.remove_all()),t}undo_recycle(t){this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}undo_from_waste(t){this.waste.add_cards(t)}from_waste(){return this.waste.remove_cards(1)}static make(t){return new aa(Mt.take_n(t,t.length),Mt.empty,Mt.empty)}},Pt=class{constructor(t,e,a){o(this,"cards");o(this,"flip");this.from=t,this.to=e,this.i=a}can(t){return t.can_tableu_to_tableu(this.from,this.to,this.i)}apply(t){let[e,a]=t.tableu_to_tableu(this.from,this.to,this.i);this.cards=e,this.flip=a}undo(t){t.undo_tableu_to_tableu(this.from,this.to,this.i,[this.cards,this.flip])}},nt=class ia{constructor(t,e,a){o(this,"cards");o(this,"flip");this.from=t,this.to=e,this.i=a}static auto_can(t,e){for(let a=0;a<4;a++)if(ia.can(t,e,a))return[e,a]}static can(t,e,a){return t.can_tableu_to_foundation(e,a,1)}can(t){return t.can_tableu_to_foundation(this.from,this.to,this.i)}apply(t){let[e,a]=t.tableu_to_foundation(this.from,this.to,this.i);this.cards=e,this.flip=a}undo(t){t.undo_tableu_to_foundation(this.from,this.to,this.i,[this.cards,this.flip])}},Lt=class{constructor(t){o(this,"card");this.to=t}can(t){return t.can_waste_to_tableu(this.to)}apply(t){this.card=t.waste_to_tableu(this.to)[0]}undo(t){t.undo_waste_to_tableu(this.to,[this.card])}},ot=class ha{constructor(t){o(this,"card");this.to=t}static auto_can(t){for(let e=0;e<4;e++)if(ha.can(t,e))return e}static can(t,e){return t.can_waste_to_foundation(e)}can(t){return t.can_waste_to_foundation(this.to)}apply(t){this.card=t.waste_to_foundation(this.to)[0]}undo(t){t.undo_waste_to_foundation(this.to,[this.card])}},Fe=class{constructor(t,e){o(this,"card");this.from=t,this.to=e}can(t){return t.can_foundation_to_tableu(this.from,this.to)}apply(t){this.card=t.foundation_to_tableu(this.from,this.to)[0]}undo(t){t.undo_foundation_to_tableu(this.from,this.to,[this.card])}},ze=class{constructor(){o(this,"hit_data")}can(t){return t.can_hit_stock()}apply(t){this.hit_data=t.hit_stock()}undo(t){t.undo_hit_stock(this.hit_data)}};class Re{constructor(){o(this,"data")}can(t){return t.can_hit_recycle()}apply(t){this.data=t.hit_recycle()}undo(t){t.undo_hit_recycle(this.data)}}var Rt;let Sh=(Rt=class{constructor(t,e,a,i,h,n,_){this.nb_recycles=t,this.moves=e,this.stats=a,this.settings=i,this.tableus=h,this.foundations=n,this.stock=_}get is_finished(){return this.foundations.every(t=>t.is_finished)}get score(){return this.stats.score}get hit_n(){return this.settings.cards==="threecards"?3:1}apply(t){t.apply(this),this.moves.push(t)}undo(){let t=this.moves.pop();if(t)return this.stats.score+=at.Undo,t.undo(this),t}tableu_to_tableu(t,e,a){let[i,h]=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i),h!==void 0?this.stats.score+=at.TableuToTableuFlip:this.stats.score+=at.TableuToTableuNoFlip,[i,h]}tableu_to_foundation(t,e,a){let[i,h]=this.tableus[t].from_tableu(a);return this.foundations[e].to_foundation(i),h!==void 0?this.stats.score+=at.TableuToFoundationFlip:this.stats.score+=at.TableuToFoundationNoFlip,[i,h]}waste_to_tableu(t){let e=this.stock.from_waste();return this.tableus[t].to_tableu(e),this.stats.score+=at.WasteToTableu,e}waste_to_foundation(t){let e=this.stock.from_waste();return this.foundations[t].to_foundation(e),this.stats.score+=at.WasteToFoundation,e}foundation_to_tableu(t,e){let a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a),this.stats.score+=at.FoundationToTableu,a}undo_tableu_to_tableu(t,e,a,i){this.tableus[e].undo_to_tableu(i[0]),this.tableus[t].undo_from_tableu(i)}undo_tableu_to_foundation(t,e,a,i){this.foundations[e].undo_to_foundation(i[0]),this.tableus[t].undo_from_tableu(i)}undo_waste_to_tableu(t,e){this.tableus[t].undo_to_tableu(e),this.stock.undo_from_waste(e)}undo_waste_to_foundation(t,e){this.foundations[t].undo_to_foundation(e),this.stock.undo_from_waste(e)}undo_foundation_to_tableu(t,e,a){this.tableus[e].undo_to_tableu(a),this.foundations[t].undo_from_foundation(a)}hit_stock(){let t=this.stock.hit(this.hit_n);return this.stats.score+=at.HitStock,t}hit_recycle(){return this.nb_recycles+=1,this.stats.score+=at.Recycle,this.stock.recycle()}undo_hit_stock(t){this.stock.undo_hit(t)}undo_hit_recycle(t){this.nb_recycles-=1,this.stock.undo_recycle(t)}can_tableu_to_tableu(t,e,a){let i=this.tableus[t].can_drag(a);return i!==void 0&&this.tableus[e].can_drop(i)}can_tableu_to_foundation(t,e,a){let i=this.tableus[t].can_drag(a);return i!==void 0&&i.length===1&&this.foundations[e].can_drop(i)}can_waste_to_tableu(t){let e=this.stock.can_drag();return e!==void 0&&this.tableus[t].can_drop([e])}can_waste_to_foundation(t){let e=this.stock.can_drag();return e!==void 0&&this.foundations[t].can_drop([e])}can_foundation_to_tableu(t,e){let a=this.foundations[t].can_drag();return a!==void 0&&this.tableus[e].can_drop([a])}can_hit_stock(){return this.stock.can_hit_stock()}can_hit_recycle(){return this.has_recycle_limit&&this.stock.can_recycle()}get recycle_n(){return this.settings.limit==="nolimit"?999:this.settings.limit==="threepass"?3:1}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}},o(Rt,"make",(t,e)=>{let a=ta.map(p=>Eh.make()),i=Xe.map(p=>Th.make(e,p-1)),h=Ah.make(e),n=0,_=[],f=as.empty();return new Rt(n,_,f,t,i,a,h)}),Rt);var Mh=Object.defineProperty,Fh=(s,t,e)=>t in s?Mh(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,F=(s,t,e)=>(Fh(s,typeof t!="symbol"?t+"":t,e),e),ra=["d","c","h","s"],zh=["A","K","Q","J","T","9","8","7","6","5","4","3","2"],Ke=["A","2","3","4","5","6","7","8","9","T","J","Q","K"],Rh=ra.flatMap(s=>zh.map(t=>`${s}${t}`));function Cs(s){switch(s[0]){case"d":case"h":return"red";default:return"black"}}function Ch(s,t){return Ke[Ke.indexOf(t[1])-1]===s[1]}function Uh(s,t){return Cs(s)!=Cs(t)}function Oh(s){return s[1]==="K"}function Nh(s){return s[1]==="A"}var Dh=class{static get deck(){return Rh.slice(0)}};function Ph(s){let t=[];for(let e=0;e=0;t--)this.cards.unshift(s[t])}remove_cards(s){return this.cards.splice(-s)}remove_all(){return this.remove_cards(this.cards.length)}},q=Yt;F(q,"take_n",(s,t)=>new Yt(s.splice(0,t)));F(q,"from_fen",s=>new Yt(Ph(s)));var is="??",ue=class{constructor(s){this.cards=s}get fen(){return this.cards.join(" ")}get clone(){return new ue(this.cards.slice(0))}get length(){return this.cards.length}get top_card(){return this.cards[this.cards.length-1]}unshift_cards(s){for(let t=s.length-1;t>=0;t--)this.cards.push(s[t])}shift_cards(s){return this.cards.splice(0,s)}add_cards(s){this.cards.push(...s)}remove_cards(s){return this.cards.splice(-s)}remove_all(){return this.remove_cards(this.cards.length)}},le=ue;F(le,"from_fen",s=>new ue(s===""?[]:s.split(" ")));F(le,"backs",s=>new ue([...Array(s).keys()].map(t=>is)));var Tt=class{constructor(s){o(this,"_data");this.game=s}_set_data(s){return this._data=s,this}},na=class{constructor(s,t,e){this.game=s,this.stats=t,this.history=e}get nb_moves(){return this.stats.nb_moves}set nb_moves(s){this.stats.nb_moves=s}get score(){return this.stats.score}set score(s){this.stats.score=s}get pov(){return new oa(this.game.pov,this.stats,this.history.length)}apply(s,t){let e=new s(this.game)._set_data(t);if(!s.can(this.game.pov,t))return;let a=e.apply();return this.score+=a,this.nb_moves++,this.history.push(e),e}get can_undo(){return this.history.length>0}undo(){if(!this.can_undo)return;let s=this.history.pop(),t=s.undo();return this.score+=t,this.nb_moves++,s}},Lh=na;F(Lh,"make",s=>new na(s,{score:0,nb_moves:0},[]));var oa=class{constructor(s,t,e){o(this,"history");this.game=s,this.stats=t,this.history=e}finalize_apply_pov(s){this.game.finalize_apply_pov(s)}get clone(){let s=this.game.clone;return new oa(s,{...this.stats},this.history)}get nb_moves(){return this.stats.nb_moves}set nb_moves(s){this.stats.nb_moves=s}get score(){return this.stats.score}set score(s){this.stats.score=s}get can_undo(){return this.history>0}apply(s,t){s.apply(this.game,t),this.nb_moves++,this.history++}undo_pov(){this.nb_moves++,this.history--}undo(s){s.undo_pov(this.game)}},X={Recycle:-10,HitStock:0,WasteToTableu:10,WasteToFoundation:30,TableuToFoundation:20,FoundationToTableu:-30,Undo:-80,TableuToTableuFlip:10,TableuToTableuNoFlip:0};function $h(s){let[t,e]=s.split("$");return{cards:t,limit:e}}function Ih(s){return[s.cards,s.limit].join("$")}var hs=class{constructor(s,t,e){this.stock=s,this.waste=t,this.hidden=e}get fen(){return[this.stock.fen,this.waste.fen,this.hidden.fen].join("$")}get pov(){return new ma(this.stock.hidden_pov,this.waste,this.hidden.hidden_pov)}get can_hit(){return this.stock.length>0}get can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}from_waste(){return{cards:this.waste.remove_cards(1)}}undo_from_waste(s){this.waste.add_cards(s)}hit(s){let t=this.stock.remove_cards(s),e=this.waste.remove_all();return this.hidden.unshift_cards(e),this.waste.add_cards(t),{waste:e,cards:t}}undo_hit(s){let{cards:t,waste:e}=s,a=this.waste.remove_cards(t.length),i=this.hidden.shift_cards(e.length);this.waste.add_cards(i),this.stock.add_cards(a)}recycle(){let s=this.waste.remove_all();return this.hidden.unshift_cards(s),this.stock.add_cards(this.hidden.remove_all()),{waste:s}}undo_recycle(s){let{waste:t}=s;this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}},we=hs;F(we,"from_fen",s=>{let[t,e,a]=s.split("$"),i=q.from_fen(t),h=q.from_fen(e),n=q.from_fen(a);return new hs(i,h,n)});F(we,"make",s=>new hs(q.take_n(s,s.length),q.empty,q.empty));var rs=class{constructor(s,t){this.back=s,this.front=t}get fen(){return[this.back.fen,this.front.fen].join("$")}get pov(){return new ga(this.back.hidden_pov,this.front)}from_tableu(s){let t=this.front.remove_cards(s);if(this.front.length===0){let[e]=this.back.remove_cards(1);return e?(this.front.add_cards([e]),{flip:e,cards:t}):{cards:t}}return{cards:t}}undo_from_tableu(s){if(s.flip){let t=this.front.remove_cards(1);this.back.add_cards(t)}this.front.add_cards(s.cards)}to_tableu(s){this.front.add_cards(s)}undo_to_tableu(s){this.front.remove_cards(s.length)}},xe=rs;F(xe,"from_fen",s=>{let[t,e]=s.split("$");return new rs(q.from_fen(t),q.from_fen(e))});F(xe,"make",(s,t)=>new rs(q.take_n(s,t),q.take_n(s,1)));var ke=class{constructor(s){this.foundation=s}get fen(){return this.foundation.fen}get clone(){return new ke(this.foundation.clone)}get suit(){var s;return(s=this.foundation.top_card)==null?void 0:s[0]}get is_finished(){return this.foundation.length===13}get next_top(){if(!this.suit)return;let s=this.suit,t=Ke[this.foundation.length];return`${s}${t}`}get can_from(){let{top_card:s}=this.foundation;if(s)return{cards:[s]}}can_to(s){let[t]=s;return s.length===1&&(this.next_top?t===this.next_top:Nh(t))}to_foundation(s){this.foundation.add_cards(s)}undo_to_foundation(s){this.foundation.remove_cards(s.length)}from_foundation(){return{cards:this.foundation.remove_cards(1)}}undo_from_foundation(s){this.foundation.add_cards(s)}},ve=ke;F(ve,"from_fen",s=>{let t=s;return new ke(q.from_fen(t))});F(ve,"make",()=>new ke(q.empty));var Bh=[...Array(7).keys()];[...Array(4).keys()];var ns=class{constructor(s,t,e,a,i){this.settings=s,this.nb_recycles=t,this.stock=e,this.tableus=a,this.foundations=i}get fen(){let s=Ih(this.settings),t=this.stock.fen,e=this.tableus.map(h=>h.fen).join("/"),a=this.foundations.map(h=>h.fen).join("/"),i=this.nb_recycles;return[s,i,t,e,a].join(" ")}get hit_n(){return this.settings.cards==="threecards"?3:1}get pov(){return new ya(this.settings,this.nb_recycles,this.stock.pov,this.tableus.map(s=>s.pov),this.foundations)}get recycle_n(){return this.settings.limit==="nolimit"?9999:this.settings.limit==="threepass"?3:1}get can_hit(){return this.stock.can_hit}get can_recycle(){return this.has_recycle_limit&&this.stock.can_recycle}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}hit_stock(){return this.stock.hit(this.hit_n)}undo_hit_stock(s){this.stock.undo_hit(s)}recycle(){return this.nb_recycles++,this.stock.recycle()}undo_recycle(s){this.nb_recycles--,this.stock.undo_recycle(s)}tableu_to_tableu(s){let{from:t,to:e,i:a}=s,i=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i.cards),i}undo_tableu_to_tableu(s,t){let{from:e,to:a,i}=s;this.tableus[a].undo_to_tableu(t.cards),this.tableus[e].undo_from_tableu(t)}waste_to_tableu(s){let{to:t}=s,e=this.stock.from_waste();return this.tableus[t].to_tableu(e.cards),e}undo_waste_to_tableu(s,t){let{to:e}=s;this.tableus[e].undo_to_tableu(t.cards),this.stock.undo_from_waste(t.cards)}waste_to_foundation(s){let{to:t}=s,e=this.stock.from_waste();return this.foundations[t].to_foundation(e.cards),e}undo_waste_to_foundation(s,t){let{to:e}=s;this.foundations[e].undo_to_foundation(t.cards),this.stock.undo_from_waste(t.cards)}tableu_to_foundation(s){let{from:t,to:e}=s,a=this.tableus[t].from_tableu(1);return this.foundations[e].to_foundation(a.cards),a}undo_tableu_to_foundation(s,t){let{from:e,to:a}=s;this.foundations[a].undo_to_foundation(t.cards),this.tableus[e].undo_from_tableu(t)}foundation_to_tableu(s){let{from:t,to:e}=s,a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a.cards),a}undo_foundation_to_tableu(s,t){let{from:e,to:a}=s;this.tableus[a].undo_to_tableu(t.cards),this.foundations[e].undo_from_foundation(t.cards)}},la=ns;F(la,"from_fen",s=>{let[t,e,a,i,h]=s.split(" "),n=$h(t),_=parseInt(e),f=we.from_fen(a),p=i.split("/").map(c=>xe.from_fen(c)),m=h.split("/").map(c=>ve.from_fen(c));return new ns(n,_,f,p,m)});F(la,"make",(s,t)=>{let e=Bh.map(h=>xe.make(t,h)),a=we.make(t),i=0;return new ns(s,i,a,e,ra.map(h=>ve.make()))});var os=class extends Tt{constructor(){super(...arguments);o(this,"data")}get solitaire(){return this.game}apply(){return this.data=this.solitaire.hit_stock(),X.HitStock}undo(){return this.solitaire.undo_hit_stock(this.data),X.Undo}undo_pov(t){t.undo_hit_stock(this.data)}};F(os,"can",s=>s.can_hit);F(os,"apply",s=>{s.hit_stock()});var _a=class extends Tt{constructor(){super(...arguments);o(this,"data")}get solitaire(){return this.game}apply(){return this.data=this.solitaire.recycle(),X.Recycle}undo(){return this.solitaire.undo_recycle(this.data),X.Undo}undo_pov(t){t.undo_recycle(this.data)}};F(_a,"can",s=>s.can_recycle);F(_a,"apply",s=>{s.recycle()});var ls=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.tableu_to_tableu(this.data),this.res.flip?X.TableuToTableuFlip:X.TableuToTableuNoFlip}undo(){return this.solitaire.undo_tableu_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_tableu_to_tableu(this.data,this.res)}};F(ls,"can",(s,t)=>{let e=t,a=s.can_drag_tableu(e);return a?s.can_drop_tableu({...t,...a}):!1});F(ls,"apply",(s,t)=>{s.tableu_to_tableu(t)});var ca=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.waste_to_tableu(this.data),X.WasteToTableu}undo(){return this.solitaire.undo_waste_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_waste_to_tableu(this.data,this.res)}};F(ca,"can",(s,t)=>{const e=s.can_drag_waste;return e?s.can_drop_tableu({...t,...e}):!1});F(ca,"apply",(s,t)=>{s.waste_to_tableu(t)});var da=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.waste_to_foundation(this.data),X.WasteToFoundation}undo(){return this.solitaire.undo_waste_to_foundation(this.data,this.res),X.Undo}undo_pov(t){t.undo_waste_to_foundation(this.data,this.res)}},_s=da;F(_s,"auto_can",s=>{for(let t=0;t<4;t++)if(da.can(s,{to:t}))return{to:t}});F(_s,"can",(s,t)=>{const e=s.can_drag_waste;return e?s.can_drop_foundation({...t,...e}):!1});F(_s,"apply",(s,t)=>{s.waste_to_foundation(t)});var pa=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.tableu_to_foundation(this.data),X.TableuToFoundation}undo(){return this.solitaire.undo_tableu_to_foundation(this.data,this.res),X.Undo}undo_pov(t){t.undo_tableu_to_foundation(this.data,this.res)}},be=pa;F(be,"auto_can",(s,t)=>{let{tableu:e}=t;for(let a=0;a<4;a++)if(pa.can(s,{from:e,to:a}))return{from:e,to:a}});F(be,"can",(s,t)=>{const e=s.can_drag_tableu({...t,i:1});return e?s.can_drop_foundation({...t,...e}):!1});F(be,"apply",(s,t)=>{s.tableu_to_foundation(t)});var fa=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.foundation_to_tableu(this.data),X.FoundationToTableu}undo(){return this.solitaire.undo_foundation_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_foundation_to_tableu(this.data,this.res)}};F(fa,"can",(s,t)=>{const e=s.can_drag_foundation(t);return e?s.can_drop_tableu({...t,...e}):!1});F(fa,"apply",(s,t)=>{s.foundation_to_tableu(t)});var ma=class{constructor(s,t,e){this.stock=s,this.waste=t,this.hidden=e}pov_hit_stock(s){this.waste.remove_cards(s.length),this.waste.add_cards(s)}get can_hit(){return this.stock.length>0}get can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}get can_from_waste(){let{top_card:s}=this.waste;if(s)return{cards:[s]}}get clone(){return new ma(this.stock.clone,this.waste.clone,this.hidden.clone)}from_waste(){return{cards:this.waste.remove_cards(1)}}undo_from_waste(s){this.waste.add_cards(s)}hit(s){let t=this.stock.remove_cards(s),e=this.waste.remove_all();this.hidden.unshift_cards(e),this.waste.add_cards(t)}undo_hit(s){let{cards:t,waste:e}=s;this.waste.remove_cards(t.length),this.hidden.shift_cards(e.length),this.waste.add_cards(e),this.stock.add_cards(t)}recycle(){let s=this.waste.remove_all();return this.hidden.unshift_cards(s),this.stock.add_cards(this.hidden.remove_all()),{waste:s}}undo_recycle(s){let{waste:t}=s;this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}},ga=class{constructor(s,t){this.back=s,this.front=t}pov_flip(s){this.front.remove_cards(1),this.front.add_cards([s])}get clone(){return new ga(this.back.clone,this.front.clone)}can_from(s){let t=this.front.clone;this.back.clone;let e=t.remove_cards(s);if(e.length===s)return{cards:e}}can_to(s){let t=s[0];return t?this.front.length>0?Uh(t,this.front.top_card)&&Ch(t,this.front.top_card):Oh(t):!1}from_tableu(s){let t=this.front.remove_cards(s);if(this.front.length===0){let[e]=this.back.remove_cards(1);return e?(this.front.add_cards([e]),{flip:e,cards:t}):{cards:t}}return{cards:t}}undo_from_tableu(s){if(s.flip){let t=this.front.remove_cards(1);this.back.add_cards(t)}this.front.add_cards(s.cards)}to_tableu(s){this.front.add_cards(s)}undo_to_tableu(s){this.front.remove_cards(s.length)}},ya=class{constructor(s,t,e,a,i){this.settings=s,this.nb_recycles=t,this.stock=e,this.tableus=a,this.foundations=i}get clone(){return new ya(this.settings,this.nb_recycles,this.stock.clone,this.tableus.map(s=>s.clone),this.foundations.map(s=>s.clone))}get recycle_n(){return this.settings.limit==="nolimit"?9999:this.settings.limit==="threepass"?3:1}get hit_n(){return this.settings.cards==="threecards"?3:1}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}get can_hit(){return this.stock.can_hit}get can_recycle(){return this.has_recycle_limit&&this.stock.can_recycle}get is_finished(){return this.foundations.every(s=>s.is_finished)}can_drag_tableu(s){let{from:t,i:e}=s;return this.tableus[t].can_from(e)}can_drop_tableu(s){let{to:t,cards:e}=s;return this.tableus[t].can_to(e)}can_drop_foundation(s){let{to:t,cards:e}=s;return this.foundations[t].can_to(e)}get can_drag_waste(){return this.stock.can_from_waste}can_drag_foundation(s){let{from:t}=s;return this.foundations[t].can_from}hit_stock(){return this.stock.hit(this.hit_n)}undo_hit_stock(s){this.stock.undo_hit(s)}recycle(){return this.nb_recycles++,this.stock.recycle()}undo_recycle(s){this.nb_recycles--,this.stock.undo_recycle(s)}finalize_apply_pov(s){if(s instanceof ls&&s.res.flip){let{from:t}=s.data;this.tableus[t].pov_flip(s.res.flip)}if(s instanceof be&&s.res.flip){let{from:t}=s.data;this.tableus[t].pov_flip(s.res.flip)}s instanceof os&&this.stock.pov_hit_stock(s.data.cards)}tableu_to_tableu(s){let{from:t,to:e,i:a}=s,i=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i.cards),i}undo_tableu_to_tableu(s,t){let{from:e,to:a,i}=s;this.tableus[a].undo_to_tableu(t.cards),this.tableus[e].undo_from_tableu(t)}waste_to_tableu(s){let{to:t}=s,e=this.stock.from_waste();return this.tableus[t].to_tableu(e.cards),e}undo_waste_to_tableu(s,t){let{to:e}=s;this.tableus[e].undo_to_tableu(t.cards),this.stock.undo_from_waste(t.cards)}waste_to_foundation(s){let{to:t}=s,e=this.stock.from_waste();return this.foundations[t].to_foundation(e.cards),e}undo_waste_to_foundation(s,t){let{to:e}=s;this.foundations[e].undo_to_foundation(t.cards),this.stock.undo_from_waste(t.cards)}tableu_to_foundation(s){let{from:t,to:e}=s,a=this.tableus[t].from_tableu(1);return this.foundations[e].to_foundation(a.cards),a}undo_tableu_to_foundation(s,t){let{from:e,to:a}=s;this.foundations[a].undo_to_foundation(t.cards),this.tableus[e].undo_from_tableu(t)}foundation_to_tableu(s){let{from:t,to:e}=s,a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a.cards),a}undo_foundation_to_tableu(s,t){let{from:e,to:a}=s;this.tableus[a].undo_to_tableu(t.cards),this.foundations[e].undo_from_foundation(t.cards)}};const Ce={s:"spades",d:"diamonds",h:"hearts",c:"clubs"},Hh={A:"a",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",T:"t",J:"j",Q:"q",K:"k"};class jh extends x{constructor(){super(...arguments);o(this,"_card");o(this,"rank");o(this,"rsuit");o(this,"suit");o(this,"decsuit")}get waiting(){return this._card===is}get card(){return this._card}set card(e){this._card=e,this.rank.play_now(Hh[e[1]]),this.suit.play_now(Ce[e[0]]),this.rsuit.play_now(Ce[e[0]]),this.decsuit.forEach(a=>a.play_now(Ce[e[0]]))}_init(){let e=r.make(40,50);this.decsuit=[...Array(3).keys()].map(()=>e=e.add($().mul(r.make(4,30)).add(r.make(0,30)))).map(i=>{let h=this.make(N,i,{name:"suit"});return h.origin=r.make(32,32),h.play_now("spades"),h.scale=r.one.scale($().x*.2).add(r.make(.2,.2)),h});let a=[...Array(2).keys()].map(()=>e=e.sub($().mul(r.make(24,20)).add(r.make(0,30)))).map(i=>{i.x+=120;let h=this.make(N,i,{name:"suit"});return h.origin=r.make(32,32),h.play_now("spades"),h.scale=r.one.scale($().x*.2).add(r.make(.2,.2)),h});this.decsuit.push(...a),this.rank=this.make(N,r.make(140,32),{name:"rank_2"}),this.rank.origin=r.make(32,32),this.rank.play_now("a"),this.rank.scale=r.make(.6,.6),this.suit=this.make(N,r.make(30,32),{name:"suit"}),this.suit.origin=r.make(32,32),this.suit.play_now("spades"),this.suit.scale=r.make(.6,.6),this.rsuit=this.make(N,r.make(150,210),{name:"suit"}),this.rsuit.origin=r.make(32,32),this.rsuit.rotation=Math.PI,this.rsuit.play_now("spades"),this.rsuit.scale=r.make(.6,.6)}}class Xh extends x{constructor(){super(...arguments);o(this,"decoration");o(this,"_will_lerp_t");o(this,"_will_lerp_position");o(this,"_drop_rect");o(this,"_clickable");o(this,"_dragging");o(this,"_drag_decay",r.zero);o(this,"_on_drag");o(this,"_on_drop");o(this,"_on_hover");o(this,"_on_click");o(this,"facing");o(this,"anim");o(this,"shadow");o(this,"highlight");o(this,"_will_hover");o(this,"_will_hover_end");o(this,"_will_flip_back");o(this,"_will_flip_front");o(this,"lerp_hover_y");o(this,"_lerp_drag_shadow");o(this,"_tr");o(this,"_tx");o(this,"_ty");o(this,"_target_speed");o(this,"_speed");o(this,"_hover_time");o(this,"_after_ease")}release(){this.lerp_position(),this.unset_dragging(),this.set_highlight(!1),this.bind_click(void 0),this.bind_drag(void 0),this.bind_drop(void 0),this.bind_hover(void 0),this._after_ease=void 0}lerp_release(){this.lerp_position(),this.unset_dragging()}get waiting(){return this.decoration.waiting}get card(){return this.decoration.card}set card(e){this.decoration.card=e,this.waiting?this.anim._animation==="idle"&&(this.anim.play_now("wait"),this.decoration.visible=!1):this.anim._animation==="wait"&&(this.anim.play_now("idle"),this.decoration.visible=!0)}get flipping(){return this.anim._animation==="flip"||this.anim._animation==="back_flip"}get easing(){return!!this._tx||!!this._ty||!!this._tr}lerp_position(e,a){this._tx&&(this.cancel(this._tx),this._tx=void 0),this._ty&&(this.cancel(this._ty),this._ty=void 0),this._will_lerp_position=e,this._will_lerp_t=a,e?this._target_speed=(1-(a||.5))*.2:this._target_speed=0}bind_drop_rect(e){this._drop_rect=e}get drag_decay(){return this._drag_decay}bind_drag(e){this._on_drag=e}bind_drop(e){this._on_drop=e}bind_hover(e){this._on_hover=e}bind_click(e){this._on_click=e}get hover_time(){return this._hover_time??0}ease_rotation(e,a=P.half){this._tr=this.tween_single(this._tr,[this.rotation,e],i=>{this.rotation=i},a,0,()=>{this._tr=void 0})}ease_position(e,a=P.half){e.equals(this.position)||(this._target_speed=a/P.half*.2,this._tx=this.tween_single(this._tx,[this.position.x,e.x],i=>{this.position.x=i},a,0,()=>{this._tx=void 0,this._target_speed=0}),this._ty=this.tween_single(this._ty,[this.position.y,e.y],i=>{this.position.y=i},a,0,()=>{this._ty=void 0}))}set_highlight(e){this.highlight.visible=e}set_dragging(){this._lerp_drag_shadow=0,this._dragging=!0}unset_dragging(){this._dragging=!1}after_ease(e){this._after_ease=e}_init(){this.shadow=this._make(N,r.make(0,0),{name:"card"}),this.shadow.origin=r.make(88,120),this.shadow.play_now("shadow"),this.anim=this.make(N,r.make(0,0),{name:"card"}),this.anim.origin=r.make(88,120),this.facing=-1,this.anim.play_now("back_idle"),this.highlight=this.make(N,r.make(0,0),{name:"card"}),this.highlight.origin=r.make(88,120),this.highlight.play_now("highlight"),this.highlight.visible=!1,this.decoration=this.make(jh,r.make(-80,-120),{}),this.decoration.visible=!1,this.decoration.card=is,this._will_hover=!1,this._will_hover_end=!1,this._will_flip_back=!1,this._will_flip_front=!1,this.lerp_hover_y=0,this._dragging=!1,this._speed=0,this._target_speed=0,this.hit_area=w.make(16-this.anim.origin.x,16-this.anim.origin.y,170,210)}_update(){this._speed=dt(this._speed,this._target_speed,.2);let e=sh(Math.abs(Math.sin(S.seconds*3)))*this._speed;if(this.scale=r.make(1-e,1+e),this._will_lerp_position&&(this.position=r.lerp(this.position,this._will_lerp_position,this._will_lerp_t??.5)),this._lerp_drag_shadow!==void 0&&(this._dragging?this._lerp_drag_shadow=dt(this._lerp_drag_shadow,1,.2):(this._lerp_drag_shadow=dt(this._lerp_drag_shadow,0,.2),this._lerp_drag_shadow<.001&&(this._lerp_drag_shadow=void 0))),this._lerp_drag_shadow!==void 0){let a=this._lerp_drag_shadow*.05;this.shadow.scale=r.one.add(r.one.scale(a)),this.shadow.alpha=(1-this._lerp_drag_shadow)*100+155}if(this._after_ease&&!this.easing&&(this._after_ease(),this._after_ease=void 0),this.easing||(this.anim.position.y=dt(this.anim.position.y,this.lerp_hover_y,.2),this.decoration.position.y=dt(this.decoration.position.y,this.lerp_hover_y-120,.16),this.highlight.position.y=dt(this.highlight.position.y,this.lerp_hover_y,.16)),this._will_hover&&(this._will_hover=!1,!this.easing&&!this.flipping&&this._will_flip_back&&this._will_flip_front&&this.anim.play(this.facing===1?"hover":"back_hover"),this.lerp_hover_y=-6,this._hover_time=0),this._will_hover_end){this._will_hover_end=!1;let a=this.waiting?"wait":"idle";!this.easing&&!this.flipping&&this._will_flip_back&&this._will_flip_front&&this.anim.play(this.facing===1?a:"back_idle"),this.lerp_hover_y=0,this._hover_time=void 0}this._hover_time!==void 0&&this._hover_time>=0&&(this.easing&&(this._hover_time=0),this._hover_time+=S.delta),this._will_flip_back&&(this.easing||(this._will_flip_back=!1,this.shadow.visible=!1,this.decoration.visible=!1,this.anim.play_now("flip",()=>{this.facing=-1,this.anim.play("back_idle"),this.shadow.visible=!0}))),this._will_flip_front&&(this.easing||(this._will_flip_front=!1,this.shadow.visible=!1,this.decoration.visible=!1,this.anim.play_now("back_flip",()=>{this.facing=1,this.anim.play(this.waiting?"wait":"idle"),this.shadow.visible=!0,this.waiting||(this.decoration.visible=!0)})))}flip_back(){this._will_flip_front=!1,this._will_flip_back=this.facing!==-1||this.anim._animation==="back_flip"}flip_front(){this._will_flip_back=!1,this._will_flip_front=this.facing!==1||this.anim._animation==="flip"}_draw_shadow(e){e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),this.shadow.draw(e),e.pop_matrix()}}class Vh extends x{constructor(){super(...arguments);o(this,"frees");o(this,"used");o(this,"_shadow_group")}bind_drop_rect(e){this.used.forEach(a=>a.bind_drop_rect(e))}borrow(){let e=this.frees.shift();return this.used.push(e),e.visible=!0,e}release(e){e.visible=!1,this.used.splice(this.used.indexOf(e),1),e.release(),this.frees.push(e)}set shadow_group(e){this._shadow_group=e}_init(){this.frees=Dh.deck.map(e=>{let a=this.make(Xh,r.zero,{});return a.visible=!1,a}),this.used=[]}_draw(e){var a,i;e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),this._draw_children(e),(a=this._shadow_group)==null||a.forEach(h=>{h._draw_shadow(e)}),(i=this._shadow_group)==null||i.forEach(h=>{h.draw(e)}),e.pop_matrix()}}class Ft extends x{constructor(){super(...arguments);o(this,"_i_gap");o(this,"cards")}get data(){return this._data}get length(){return this.cards.length}get top_card(){return this.cards[this.cards.length-1]}get h(){let e=55*(1-this.cards.length/50);return this.data.h??e}get top_position(){return this.position.add(r.make(0,this.cards.length*this.h))}set_highlight(e,a){this.cards.slice(this.cards.length-e,this.cards.length).forEach(h=>h.set_highlight(a))}unshift_cards(e){e.forEach(a=>a.send_front());for(let a=e.length-1;a>=0;a--)this.cards.unshift(e[a]);this._reposition()}add_cards(e){e.forEach(a=>a.send_front()),this.cards.push(...e),this._reposition()}remove_cards(e){let a=this.cards.splice(-e);return this._reposition(),a}shift_cards(e){let a=this.cards.splice(0,e);return this._reposition(),a}set i_gap(e){this._i_gap!==e&&(this._i_gap=e,this._reposition())}_reposition(){this.cards.forEach((e,a)=>{let i=this._i_gap!==void 0&&a>this._i_gap?a+.5:a;e.ease_position(this.p_position.add(r.make(0,i*this.h)))})}ease_position(e){this.position=e,this._reposition()}_init(){this.cards=[]}}function Kh(s){return 1/(1+Math.exp(-s))}class Ue extends x{constructor(){super(...arguments);o(this,"_cards")}set cards(e){this._cards=e.slice(0),this._cards.forEach(a=>a.send_front()),this._cards.forEach(a=>a.set_dragging())}get drag_decay(){return this._cards[0].drag_decay}get h(){return 50}drag(e){this._cards.forEach((a,i)=>{let h=e.add(r.make(0,this.h*i).sub(this.drag_decay)),n=1-Kh(i/this._cards.length*2);a.lerp_position(h,n)})}lerp_release(){let e=this._cards.splice(0);return e.forEach(a=>a.lerp_release()),e}_init(){this._cards=[]}}class Wh extends x{constructor(){super(...arguments);o(this,"hit_area",w.make(-70,-70,170,210));o(this,"_hover_index");o(this,"backs");o(this,"fronts")}get data(){return this._data}get top_front_position(){return this.fronts.top_position}get top_back_position(){return this.backs.top_position}hover_end(){this._hover_index!==void 0&&(this.fronts.cards[this._hover_index]._will_hover_end=!0,this._hover_index=void 0)}hover_begin(e){this.fronts.cards[e]._will_hover=!0,this._hover_index=e}is_hovering_at(e){return this._hover_index===e}find_hover_begin(e){return this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)})}find_click_begin(e){this.hover_end();let a=this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)});if(a!==-1)return this.fronts.cards.length-a}find_drag_begin(e){this.hover_end();let a=this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)});if(a!==-1){let i=this.fronts.cards.length;return[this.fronts.cards.splice(a),i-a]}}release_all(){return this.free()}free(){return[...this.backs.remove_cards(this.backs.length),...this.fronts.remove_cards(this.fronts.length)]}add_backs(e){e.forEach(a=>a.flip_back()),this.backs.add_cards(e),this.fronts.ease_position(this.top_back_position)}add_fronts(e){this.fronts.add_cards(e),e.forEach(a=>a.flip_front())}remove_fronts(e){return this.fronts.remove_cards(e)}flip_front(e){let[a]=this.backs.remove_cards(1);a.card=e,a.flip_front(),this.fronts.ease_position(this.top_back_position),this.fronts.add_cards([a])}get empty(){return this.fronts.length===0&&this.backs.length===0}flip_back(){let[e]=this.fronts.remove_cards(1);e.flip_back(),this.backs.add_cards([e]),this.fronts.ease_position(this.top_back_position)}_init(){this.backs=this.make(Ft,r.make(0,0),{h:33}),this.fronts=this.make(Ft,r.make(0,0),{})}_update(){let e=this.fronts.cards.findIndex(a=>a.hover_time>P.thirds);e!==-1?this.fronts.i_gap=e:this.fronts.i_gap=void 0}}let O;function ua(){O=Sh.make(Ht.general_settings,mh(vh.deck))}ua();class qh extends x{constructor(){super(...arguments);o(this,"_on_score");o(this,"_on_new_game");o(this,"_on_game_over");o(this,"_on_init");o(this,"cards")}init_and_set_callbacks(e,a,i,h){this._on_score=e,this._on_new_game=a,this._on_game_over=i,this._on_init=h,this.collect_cards(),this._on_init(this.settings)}cmd(e){e.can(O)?(O.apply(e),this.apply(e),this._on_score(O.score),O.is_finished&&this._on_game_over(O.settings,O.score)):this.cant(e)}cmd_undo(){let e=O.undo();e?(this.undo(e),this._on_score(O.score)):this.cant_undo()}cant_undo(){throw new Error("Method not implemented.")}undo(e){this.cards.undo(e)}apply(e){this.cards.apply(e)}cant(e){this.cards.cant(e)}get settings(){return O.settings}collect_cards(){this.cards._collect_cards()}request_new_game(){let e=O.stats.score;e>0&&(O.is_finished||Nt.add_result(Gt.from_loss(O.settings,e))),ua(),this._on_score(O.score),this._on_new_game(O.settings),this.collect_cards()}request_undo(){this.cmd_undo()}_init(){let e=this;this.cards=this.make(Yh,r.zero,{on_cmd(a){setTimeout(()=>e.cmd(a))}})}}const Oe=s=>typeof s=="object"&&s.tableu!==void 0,Ne=s=>typeof s=="object"&&s.foundation!==void 0,Gh=s=>typeof s=="object"&&typeof s.tableu=="number";class Yh extends x{constructor(){super(...arguments);o(this,"cards");o(this,"tableus");o(this,"stock");o(this,"recycle_view");o(this,"foundations");o(this,"drag_stack");o(this,"drag_source");o(this,"click_source");o(this,"trigger_auto",-2)}get data(){return this._data}_init(){this.cards=this.make(Vh),this.recycle_view=this.make(Zh,r.make(40,200),{on_recycle(){O.can_hit_recycle()&&c.data.on_cmd(new Re)}});let e=120,a=320,i=340,h=200,n=200,_=1790,f=166,p=240;this.tableus=Xe.map(g=>this.make(Wh,r.make(i+h*(g-1),n))),this.stock=this.make(Jh,r.make(e,a)),this.foundations=zs.map(g=>this.make(Qh,r.make(_,f+p*(g-1))));let m,c=this;this.unbindable_input({on_click(g,v){if(g=g.mul(E.v_screen),c.stock.find_stock_hit(g))return c.data.on_cmd(new ze),!0;if(c.stock.find_click_begin(g)){if(c.click_source==="waste"){c._release_cancel_highlight();let y=ot.auto_can(O);if(y!==void 0){let b=y;c.trigger_auto=-1,c.data.on_cmd(new ot(b))}return!0}return c.stock.waste.top_card.set_highlight(!0),c.click_source="waste",!0}for(let y=0;y{this.tableus[e-1].release_all().forEach(i=>this.cards.release(i))}),this.stock.release_all().forEach(e=>this.cards.release(e)),zs.map(e=>{this.foundations[e-1].release_all().forEach(i=>this.cards.release(i))}),this._release_cancel_drag(),this._release_cancel_highlight(),this._refresh_recycle(),this.stock.add_waste_hidden(O.stock.hidden.cards.map(e=>this.cards.borrow())),this.stock.add_stocks(O.stock.stock.cards.map(e=>this.cards.borrow())),this.stock.add_waste(O.stock.waste.cards.map(e=>{let a=this.cards.borrow();return a.card=e,a})),this._refresh_recycle(),O.tableus.forEach((e,a)=>{let i=e.back.cards.map(n=>{let _=this.cards.borrow();return _.flip_back(),_}),h=e.front.cards.map(n=>{let _=this.cards.borrow();return _.card=n,_.flip_front(),_});this.tableus[a].add_backs(i),this.tableus[a].add_fronts(h)})}_release_cancel_drag(){if(this.drag_stack){let e=this.drag_stack.lerp_release();if(this.drag_source==="waste")this.stock.add_waste(e);else if(Ne(this.drag_source)){let{foundation:a}=this.drag_source;this.foundations[a].add_cards(e)}else{let{tableu:a,i}=this.drag_source;this.tableus[a].add_fronts(e)}V.play("cancel"),this.drag_stack.dispose(),this.drag_stack=void 0,this.drag_source=void 0,e[0].after_ease(()=>{this.cards.shadow_group=void 0})}}_release_cancel_highlight(){if(this.click_source)if(this.click_source==="waste")this.stock.waste.top_card.set_highlight(!1),this.click_source=void 0;else{let{tableu:e,i:a}=this.click_source;this.tableus[e].fronts.set_highlight(a,!1),this.click_source=void 0}else return}_refresh_recycle(){O.can_hit_stock()?this.recycle_view.visible=!1:this.recycle_view.visible=!0,O.can_hit_recycle()?this.recycle_view.enable():this.recycle_view.disable()}undo(e){if(V.play("undo2"),e instanceof ze)this.stock.undo_hit(e.hit_data[1],e.hit_data[0]),this._refresh_recycle();else if(e instanceof Re)this.stock.undo_recycle(e.data.length),this._refresh_recycle();else if(e instanceof Pt){let a=e.flip,{from:i,to:h,i:n}=e;a&&this.tableus[i].flip_back();let _=this.tableus[h].remove_fronts(n);this.tableus[i].add_fronts(_)}else if(e instanceof Lt){let{to:a}=e,i=this.tableus[a].remove_fronts(1);this.stock.add_waste(i)}else if(e instanceof nt){let a=e.flip,{from:i,to:h}=e;a&&this.tableus[i].flip_back();let n=this.foundations[h].remove_cards(1);this.tableus[i].add_fronts(n)}else if(e instanceof ot){let{to:a}=e,i=this.foundations[a].remove_cards(1);this.stock.add_waste(i)}else if(e instanceof Fe){let{from:a,to:i}=e,h=this.tableus[i].remove_fronts(1);this.foundations[a].add_cards(h)}}cant(e){this._release_cancel_drag(),this._release_cancel_highlight()}apply(e){let a;if(e instanceof Re)this.stock.recycle(),this._refresh_recycle();else if(e instanceof ze)this.stock.hit(e.hit_data[1]),this._refresh_recycle();else if(e instanceof Lt){let i=e.to;if(this.drag_stack){let h=this.drag_stack.lerp_release();this.tableus[i].add_fronts(h),a=h}else{this._release_cancel_highlight();let h=this.stock.remove_waste(1);this.tableus[i].add_fronts(h)}}else if(e instanceof ot){let{to:i}=e;if(this.drag_stack){let h=this.drag_stack.lerp_release();this.foundations[i].add_cards(h),a=h}else{this._release_cancel_highlight();let h=this.stock.remove_waste(1);this.foundations[i].add_cards(h)}}else if(e instanceof nt){let i=e.flip,{from:h,to:n}=e;if(this.drag_stack){let _=this.drag_stack.lerp_release();this.foundations[n].add_cards(_),a=_}else{this._release_cancel_highlight();let _=this.tableus[h].remove_fronts(1);this.foundations[n].add_cards(_)}i&&this.tableus[h].flip_front(i)}else if(e instanceof Fe){let{from:i,to:h}=e,n=this.drag_stack.lerp_release();this.tableus[h].add_fronts(n),a=n}else if(e instanceof Pt){let{flip:i}=e,{from:h,to:n,i:_}=e,f=[];if(this.drag_stack){let p=this.drag_stack.lerp_release();this.tableus[n].add_fronts(p),a=p}else if(this.click_source&&Gh(this.click_source)){let{tableu:p,i:m}=this.click_source;this._release_cancel_highlight();let c=this.tableus[p].remove_fronts(m);this.tableus[n].add_fronts(c),f=c}i&&(this.tableus[h].flip_front(i),f&&f.forEach(p=>p.send_front()))}a&&(this.drag_stack.dispose(),this.drag_stack=void 0,this.drag_source=void 0,a[0].after_ease(()=>{this.cards.shadow_group=void 0})),(e instanceof nt||e instanceof ot)&&(this.trigger_auto===-1&&V.play("auto_flip"),this.trigger_auto===-3&&(V.play("auto_flip"),this.trigger_auto=-1))}_update(){if(this.trigger_auto===-1)this.trigger_auto=P.thirds;else if(this.trigger_auto>0)this.trigger_auto=He(this.trigger_auto,0,S.delta);else if(this.trigger_auto===0){this.trigger_auto=-2;let e=ot.auto_can(O);if(e!==void 0){let a=e;this.data.on_cmd(new ot(a)),this.trigger_auto=-3}else for(let a=0;a<7;a++){let i=nt.auto_can(O,a);if(i!==void 0){let[h,n]=i;this.data.on_cmd(new nt(h,n,1)),this.trigger_auto=-3;break}}}}foundation_find_max_overlap(e){let a=-1,i=1920;return this.foundations.forEach((h,n)=>{if(h.ghit_area.overlaps(e.ghit_area)){let _=h.g_position.distance(e.g_position);_{if(_!==a){let f=n.fronts.top_card;if(f&&f.ghit_area.overlaps(e.ghit_area)){let p=f.g_position.distance(e.g_position);p{if(_!==a&&n.ghit_area.overlaps(e.ghit_area)){let f=n.g_position.distance(e.g_position);fa.flip_back()),this.waste_hidden.add_cards(e)}add_waste(e){this.waste.add_cards(e),e.forEach((a,i)=>a.flip_front())}add_stocks(e){e.forEach(a=>a.flip_back()),this.stock.add_cards(e)}remove_waste(e){return this.waste.remove_cards(e)}undo_hit(e,a){let i=this.waste.remove_cards(e.length),h=this.waste_hidden.remove_cards(a.length);this.waste.add_cards(h),h.forEach((n,_)=>{n.card=a[_],n.flip_front()}),i.forEach(n=>{n.flip_back()}),this.stock.add_cards(i)}hit(e){let a=this.stock.remove_cards(e.length);a.forEach((h,n)=>h.card=e[n]),a.forEach((h,n)=>h.flip_front());let i=this.waste.remove_cards(this.waste.cards.length);i.forEach(h=>{h.flip_back()}),this.waste_hidden.unshift_cards(i),this.waste.add_cards(a),V.play("hit")}recycle(){let e=this.waste.remove_cards(this.waste.length);this.waste_hidden.unshift_cards(e);let a=this.waste_hidden.remove_cards(this.waste_hidden.length);a.forEach(i=>i.flip_back()),a.forEach(i=>i.send_front()),this.stock.add_cards(a),V.play("recycle")}undo_recycle(e){let a=this.stock.remove_cards(this.stock.length);this.waste_hidden.add_cards(a);let i=this.waste_hidden.shift_cards(e);a.forEach(h=>h.flip_front()),i.forEach(h=>h.flip_front()),this.waste.add_cards(i)}_init(){this.stock=this.make(Ft,r.make(0,0),{h:1}),this.waste=this.make(Ft,r.make(0,260),{}),this.waste_hidden=this.make(Ft,r.make(0,300),{h:0})}}class Zh extends x{constructor(){super(...arguments);o(this,"anim")}get data(){return this._data}disable(){this.anim.play("disabled")}enable(){this.anim.play("idle")}_init(){let e=this.make(N,r.make(0,0),{name:"recycle"});this.anim=e;let a=this;this.make(B,r.make(20,20),{rect:w.make(0,0,140,160),on_hover(){e._animation!=="disabled"&&e.play("hover")},on_hover_end(){e._animation!=="disabled"&&e.play("idle")},on_click(){a.data.on_recycle()}})}}[...Array(50).keys()].map(()=>$().mul(Q.scale(.8)));class tr extends x{constructor(){super(...arguments);o(this,"_score");o(this,"score_text");o(this,"score_text_shadow")}set score(e){this._score=e,this.score_text.text=`${e}`,this.score_text_shadow.text=`${e}`}get score(){return this._score}_init(){this._score=0,this.make(z,r.make(0,25),{key:"score",width:80,height:100}),this.score_text_shadow=this.make(z,r.make(100,6),{no_trans:!0,key:`${this.score}`,width:180,height:100,color:u.black}),this.score_text=this.make(z,r.make(100,0),{no_trans:!0,key:`${this.score}`,width:180,height:100})}}class er extends x{get data(){return this._data}_init(){[$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q)].forEach(e=>{let a=this.make(N,e,{name:"swiggle"});a.origin=r.make(600,400),a.scale=r.one.scale(.5+$().x),$().y<.5&&a.play("small"),a.rotation=$().y*Math.PI});let t=this;this.make(B,r.zero,{rect:w.make(0,0,1920,1080),on_hover(){return!0},on_drag(){return!0},on_click(){return t.data.on_close(),!0}})}}class sr extends x{constructor(){super(...arguments);o(this,"cards");o(this,"limit")}set settings(e){this.cards.text=e.cards,this.limit.text=e.limit}_init(){this.make(z,r.make(0,0),{no_trans:!0,key:"Solitaire",width:350,height:64,color:u.white}),this.cards=this.make(z,r.make(350,5),{key:"one_pass",width:350,height:40,color:u.white}),this.limit=this.make(z,r.make(550,5),{key:"no_limit",width:350,height:40,color:u.white})}}class ar extends x{constructor(){super(...arguments);o(this,"ax",0);o(this,"ay",0);o(this,"vx",0);o(this,"vy",0)}get data(){return this._data}_init(){let e=Math.random()<.3?"2":"",a=this.make(N,r.make(0,0),{name:"confetti"+e});a.play_o("idle",{loop:!0});let i=.5+Math.random()*.8;a.scale=r.make(i,i),a.rotation=Math.PI*Math.random(),this.vx=100+Math.random()*100,this.vy=-100+Math.random()*100,this.vx*=this.data.sign,this.ax=this.vx*10,this.ay=this.vy*10}_update(){this.position.x+=this.vx*S.delta,this.position.y+=this.vy*S.delta,this.position.x+=this.ax*S.delta,this.position.y+=this.ay*S.delta,this.ax=He(this.ax,0,S.delta*1e3),this.ay=He(this.ay,0,S.delta*1e3),this.position.x>2e3&&this.dispose()}}class Us extends x{constructor(){super(...arguments);o(this,"life",0)}get data(){return this._data}_init(){if(this.pop_confetti(),this.data.sign<0){let e=this.make(N,r.make(0,700),{name:"confbar"});this.tween([Math.PI,0,Math.PI*.3,Math.PI*.16,0],a=>e.rotation=a,[P.half,P.lengths,P.thirds,P.thirds])}else{let e=this.make(N,r.make(1920,700),{name:"confbar"});e.scale=r.make(-1,1),this.tween([-Math.PI,0,-Math.PI*.3,-Math.PI*.16,0],a=>e.rotation=a,[P.half,P.lengths,P.thirds,P.thirds])}}_update(){this.life<6&&S.on_interval(P.seconds*2)&&(this.pop_confetti(),this.life++)}pop_confetti(){for(let e=0;e<6;e++)this.make(ar,r.make(this.data.sign>0?-500+e*100:1920-e*100,1080-e*300*Math.random()),{sign:this.data.sign})}}class Os extends x{pop(){V.play("Win"),this.make(Us,r.make(0,0),{sign:1}),this.make(Us,r.make(0,0),{sign:-1})}}class ir extends x{get data(){return this._data}_init(){let t=1200,e=300;this.make(Zt,r.make(1920/2-t/2,520),{name:"panel_bg_nine_slice",w:t,h:e}),this.make(z,r.make(1920/2,590),{key:"congratz",width:450,height:100,color:u.white,center:!0}),this.make(z,r.make(1920/2,700),{key:`you_finished_with_score%${this.data.score}%`,width:650,height:60,color:u.white,center:!0})}}class ne extends x{constructor(){super(...arguments);o(this,"hamburger");o(this,"sidebar");o(this,"overlay");o(this,"over_confetties",[])}set sidebar_open(e){this.sidebar.open=e,this.overlay.visible=e,this.hamburger.open=e}_init(){let e,a=this.make(gr,r.zero,void 0);this.over_confetties.push(this.make(Os,r.make(0,0),{}));let i=this.make(qh,r.make(0,0),{});this.over_confetties.push(this.make(Os,r.make(0,0),{})),this.make(ss,r.make(160,1e3),{text:"undo",on_click(){i.request_undo()}});let h=this.make(sr,r.make(640,16),{}),n=this.make(tr,r.make(16,860),{});const _=y=>{n.score=y};let f;const p=y=>{h.settings=y,f&&(f.dispose(),f=void 0),V.play("new_game"),a.change_poem()},m=(y,b)=>{this.game_over_confetti_pop(),f=this.make(ir,r.make(0,0),{score:b}),Nt.add_result(Gt.from_win(y,b))},c=y=>{V.music("main"),h.settings=y};i.init_and_set_callbacks(_,p,m,c);let g=this,v=this.make(er,r.zero,{on_close(){g.sidebar_open=!1,g.hamburger.open=!1}}),k=this.make(rr,r.make(2,2),{on_open:y=>{g.sidebar_open=y}});e=this.make(hr,r.make(-600,180),{on_new_game(){i.request_new_game(),g.sidebar_open=!1}}),this.sidebar=e,this.overlay=v,this.hamburger=k,this.sidebar_open=!1}game_over_confetti_pop(){this.over_confetties.forEach(e=>e.pop())}}class hr extends x{constructor(){super(...arguments);o(this,"_t_x");o(this,"_open")}get data(){return this._data}set open(e){this._open=e,this._t_x&&this.cancel(this._t_x),e?this._t_x=this.tween([this.position.x,0],a=>{this.position.x=a},P.sixth,0,()=>{this._t_x=void 0}):this._t_x=this.tween([this.position.x,-600],a=>{this.position.x=a},P.sixth,0,()=>{this._t_x=void 0})}_init(){this._open=!1;let e=this,a=this.make(N,r.make(0,-100),{name:"side_menu_bg"});a.scale=r.make(1.4,1.4);let i=20,h=60,n=160;this.make($t,r.make(i,h),{text:"main_menu",on_click(){W.next(te)}}),this.make($t,r.make(i,h+n),{text:"new_game",on_click(){e.data.on_new_game()}}),this.make($t,r.make(i,h+n*2),{text:"settings",on_click(){W.next(Aa,r.zero,{selected_index:1,on_back:ne})}}),this.make($t,r.make(i,h+n*3),{text:"how_to_play",on_click(){W.next(va,r.zero,{selected_index:0,on_back:ne})}}),this.make($t,r.make(i,h+n*4),{text:"about",on_click(){W.next(ka,r.zero,{on_back:ne})}})}}class $t extends x{constructor(){super(...arguments);o(this,"_t_color");o(this,"_i_color");o(this,"bg");o(this,"fg")}get data(){return this._data}get i_color(){return this._i_color}set i_color(e){this._i_color=e,this.bg.color=u.lerp(u.white,u.hex(2106417),this._i_color),this.fg.color=u.lerp(u.white,u.hex(2106417),1-this._i_color)}set hover(e){this._t_color&&this.cancel(this._t_color),e?this._t_color=this.tween([this.i_color,0],a=>{this.i_color=a},P.sixth,0,()=>{this._t_color=void 0}):this._t_color=this.tween([this.i_color,1],a=>{this.i_color=a},P.sixth,0,()=>{this._t_color=void 0})}_init(){this._i_color=0,this.bg=this.make(G,r.make(-20,-40),{w:412,h:120,color:u.hex(2106417)}),this.fg=this.make(z,r.make(0,0),{key:this.data.text,width:350,height:100,color:u.white});let e=360,a=120,i=this;this.make(B,r.make(-20,-40),{rect:w.make(0,0,e,a),on_hover(){i.hover=!0},on_hover_end(){i.hover=!1},on_click(){return i.data.on_click(),!0}})}}class rr extends x{constructor(){super(...arguments);o(this,"_open");o(this,"anim")}get data(){return this._data}set open(e){this._open=e,this._open?this.anim.play("open"):this.anim.play("idle")}_init(){this._open=!1;let e=this.make(N,r.make(0,0),{name:"hmg_bg"});this.anim=e;let a=200,i=100,h=this;this.make(B,r.make(20,20),{rect:w.make(0,0,a,i),on_hover(){e.play(h._open?"open_hover":"hover")},on_hover_end(){e.play(h._open?"open":"idle")},on_click(){return h.open=!h._open,h.data.on_open(h._open),!0}})}}const nr=`en=english +}`;let Se;const Ts=new Ye([ft.make(0,L.Float2,!1),ft.make(1,L.Float2,!1)]),Oi="u_texture",Ni="u_matrix";let Z=w.make(0,0,1,1);const Di=Z.x,Pi=Z.y,Li=Z.x+Z.w,$i=Z.y,Ii=Z.x+Z.w,Bi=Z.x+Z.h,Hi=Z.x,ji=Z.x+Z.h,[Xi,Vi,Ki,Wi,qi,Gi,Yi,Qi]=[0,0,1,0,1,1,0,1];class Ji{constructor(){o(this,"texture");o(this,"mesh");o(this,"material");o(this,"indices",[0,1,2,0,2,3]);o(this,"vertices",[]);o(this,"matrix");o(this,"sampler",bt.get_default)}set_matrix(t){this.matrix=t,this.vertices=[],this.PUSH_VERTEX(Di,Pi,Xi,Vi),this.PUSH_VERTEX(Li,$i,Ki,Wi),this.PUSH_VERTEX(Ii,Bi,qi,Gi),this.PUSH_VERTEX(Hi,ji,Yi,Qi)}PUSH_VERTEX(t,e,a,i){let h=this.matrix;this.vertices.push(new Zi(r.make(t*h.m11+e*h.m21+h.m31,t*h.m12+e*h.m22+h.m32),r.make(a,1-i)))}render(t=d.backbuffer){this.render_with_m(t,ct.create_ortho_offcenter(0,t.width,t.height,0,.01,1e3))}render_with_m(t,e){Se||(Se=Zt.create([Ci,Ui])),this.mesh||(this.mesh=Jt.create()),this.material||(this.material=ye.create(Se));let a=Ts.stride,i=new ArrayBuffer(a*this.vertices.length),h=new DataView(i);this.vertices.reduce((_,f)=>f.push_to(h,_),0),this.mesh.index_data(this.indices),this.mesh.vertex_data(Ts,i);let n=new Je;n.target=t,n.mesh=this.mesh,n.has_viewport=!1,n.viewport=w.make(0,0,0,0),n.instance_count=0,n.material=this.material,n.material.set_texture(Oi,this.texture),n.material.set_sampler_at_location(0,this.sampler),n.material.set_matrix(Ni,e),n.index_start=0,n.index_count=this.indices.length,n.perform()}}class Zi{constructor(t,e){this.pos=t,this.tex=e}push_to(t,e){let{pos:a,tex:i}=this;return t.setFloat32(e+0,a.x,!0),t.setFloat32(e+4,a.y,!0),t.setFloat32(e+8,i.x,!0),t.setFloat32(e+12,i.y,!0),e+16}}const Me=new Ji;function dt(s,t,e){return s+(t-s)*e}function He(s,t,e){return s=e.length-1&&(this.loop===1?(this._i=0,this._values.reverse(),this._durations.reverse()):this._completed=!0))}init(){return this._i=0,this._t=0,this._completed=!1,this._value=this._values[0],this}};o(ce,"make",(t,e,a=!1)=>new ce(t.slice(0),[e],a?1:0).init());let je=ce;u.hex(2106417);const sh=u.hex(4895437),de=class de{constructor(){o(this,"_render_order",0);o(this,"visible",!0);o(this,"g_position");o(this,"position");o(this,"rotation");o(this,"origin",r.zero);o(this,"scale",r.one);o(this,"hit_area");o(this,"debug_hit",!1);o(this,"coroutines",[]);o(this,"_data");o(this,"_disposes");o(this,"objects");o(this,"parent");o(this,"g_scissor");o(this,"_tweens",[]);o(this,"_tween")}get ghit_area(){var t;return(t=this.hit_area)==null?void 0:t.add(this.g_position)}routine(t){this.coroutines.push(t)}*wait_for(t){let e=0;for(;ee[0]!==t)}tween_single(t,e,a,i,h=0,n){return t&&this.cancel(t),this.tween(e,a,i,h,n)}make(t,e=r.zero,a={}){let i=this._make(t,e,a);return this._add_object(i),i}init(){return this._disposes=[],this.objects=[],this._init(),this}update(){this.coroutines=this.coroutines.filter(t=>!t.next().done),this.objects.forEach(t=>t.update()),this._tweens=this._tweens.filter(([t,e,a])=>(t.update(S.delta),e(t.value),t.completed&&a&&a(),!t.completed)),this._update()}draw(t){this.visible&&(this._render_order=de.next_render_order++,this._draw(t))}_draw_children(t){this.objects.forEach(e=>e.draw(t))}dispose(){this.objects.slice(0).forEach(t=>t.dispose()),this._dispose(),this._disposes.forEach(t=>t()),this.parent&&this.parent.objects.splice(this.parent.objects.indexOf(this),1)}_init(){}_update(){}_draw(t){t.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,t.m_matrix),this._draw_children(t),this.hit_area&&this.debug_hit&&t.rect(this.hit_area,u.red),t.pop_matrix()}_dispose(){}};o(de,"next_render_order",0);let x=de;class te extends x{get data(){return this._data}get nine(){return Ut.find_nine(this.data.name)}_draw(t){let{frames:e}=this.nine,a=400/3,i=(this.data.h-a*2)/a,h=(this.data.w-a*2)/a;t.push_matrix(A.create_transform(this.position,r.zero,r.one,0)),this.g_position=r.transform(r.zero,t.m_matrix),t.stex(e[0].image,r.make(0,0),u.white),t.stex_o(e[1].image,r.make(0,a),r.zero,r.make(1,i),0,u.white),t.stex(e[2].image,r.make(0,a+i*a),u.white),t.stex_o(e[3].image,r.make(a,0),r.zero,r.make(h,1),0,u.white),t.stex_o(e[4].image,r.make(a,a),r.zero,r.make(h,i),0,u.white),t.stex_o(e[5].image,r.make(a,a+i*a),r.zero,r.make(h,1),0,u.white),t.stex(e[6].image,r.make(a+h*a,0),u.white),t.stex_o(e[7].image,r.make(a+h*a,a),r.zero,r.make(1,i),0,u.white),t.stex(e[8].image,r.make(a+h*a,a+i*a),u.white),t.pop_matrix()}}class N extends x{constructor(){super(...arguments);o(this,"alpha",255);o(this,"_animation","idle");o(this,"_frame_counter",0);o(this,"_frame",0);o(this,"_loop",!1);o(this,"_reverse",!1);o(this,"_on_complete");o(this,"will_play")}get data(){return this._data}get sprite(){return Ut.find_sprite(this.data.name)}get alpha_color(){return new u(this.alpha,this.alpha,this.alpha,this.alpha)}get animation(){return this.sprite.get(this._animation)}get frame(){var e;return(e=this.animation)==null?void 0:e.frames[this._frame]}get subtexture(){var e;return(e=this.frame)==null?void 0:e.image}get duration(){var e;return(e=this.frame)==null?void 0:e.duration}play_now(e,a,i=!1){var h;if(this._on_complete=a,this._animation=e,this._frame=0,i){let n=((h=this.animation)==null?void 0:h.frames.length)||0;this._frame=n-1}this._reverse=i}play(e,a,i=!1){this.will_play=()=>this.play_now(e,a,i)}play_o(e,a){this._loop=a.loop??!1,this.play_now(e)}_update(){var i,h;const e=(i=this.animation)==null?void 0:i.frames.length,a=(h=this.frame)==null?void 0:h.duration;e&&a&&(this._frame_counter+=S.delta,this._frame_counter>=a&&(this._frame_counter-=a,this._reverse?(this._frame--,this._frame<0&&(this._loop?this._frame=e-1:this._frame=0,this._on_complete&&this._on_complete(),this.will_play&&(this.will_play(),this.will_play=void 0))):(this._frame++,this._frame>=e&&(this._loop?this._frame=0:this._frame=e-1,this._on_complete&&this._on_complete(),this.will_play&&(this.will_play(),this.will_play=void 0)))))}_draw(e){this.subtexture&&(e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),e.stex(this.subtexture,r.zero,this.alpha_color),e.pop_matrix())}}const ah=s=>s!==void 0,ih=s=>{const t={get:e=>s.getItem(e),set:(e,a)=>s.setItem(e,a),remove:e=>s.removeItem(e),make:e=>({get:()=>t.get(e),set:a=>t.set(e,a),remove:()=>t.remove(e)}),makeBoolean:e=>({get:()=>t.get(e)=="1",set:a=>t.set(e,a?"1":"0"),toggle:()=>t.set(e,t.get(e)=="1"?"0":"1")})};return t},Es=ih(window.localStorage),St=(s,t)=>e=>{if(ah(e))return Es.set(s,JSON.stringify(e)),e;const a=JSON.parse(Es.get(s));return a!==null?a:t()},As={threecards:1,onecard:1.5,nolimit:1,threepass:1.5,onepass:2.2},yt=class yt{constructor(t,e,a,i){this.win=t,this.score=e,this.turning_cards=a,this.turning_limit=i}get turning_cards_multiplier(){return As[this.turning_cards]}get turning_limit_multiplier(){return As[this.turning_limit]}get multiplied_score(){return this.score*(this.turning_cards_multiplier+this.turning_limit_multiplier)}get fen(){return[this.win,this.score,this.turning_cards,this.turning_limit].join("/")}};o(yt,"from_fen",t=>{let[e,a,i,h]=t.split("/");return new yt(e==="true",parseInt(a),i,h)}),o(yt,"from_win",(t,e)=>new yt(!0,e,t.cards,t.limit)),o(yt,"from_loss",(t,e)=>new yt(!1,e,t.cards,t.limit));let Yt=yt;const pe=class pe{constructor(t){this.list=t}get fen(){return this.list.map(t=>t.fen).join("$")}push(t){this.list.push(t)}clear(){this.list.length=0}get total_wins(){return this.list.filter(t=>t.win).length}get total_played(){return this.list.length}get top_5_highscores(){return this.list.sort((t,e)=>e.multiplied_score-t.multiplied_score).slice(0,5)}};o(pe,"from_fen",(t,e)=>new pe(t===""?[]:t.split("$").map(a=>e(a))));let Ot=pe;class hh{constructor(t,e,a){this.solitaire=t,this.freecell=e,this.spider=a}get total_wins(){return this.freecell_total_wins+this.spider_total_wins+this.solitaire_total_wins}get total_played(){return this.freecell_total_played+this.spider_total_played+this.solitaire_total_played}get top_5_highscores(){return[...this.freecell_top_5_highscores,...this.spider_top_5_highscores,...this.solitaire_top_5_highscores].sort((t,e)=>e.multiplied_score-t.multiplied_score).slice(0,5)}get freecell_total_wins(){return this.freecell.total_wins}get freecell_total_played(){return this.freecell.total_played}get freecell_top_5_highscores(){return this.freecell.top_5_highscores}get spider_total_wins(){return this.spider.total_wins}get spider_total_played(){return this.spider.total_played}get spider_top_5_highscores(){return this.spider.top_5_highscores}get solitaire_total_wins(){return this.solitaire.total_wins}get solitaire_total_played(){return this.solitaire.total_played}get solitaire_top_5_highscores(){return this.solitaire.top_5_highscores}}let Ss=["nolimit","threepass","onepass"],Ms=["threecards","onecard"];class rh{constructor(){o(this,"_cards");o(this,"_limit");let t="threecards";this._cards=St("cards",()=>t);let e="nolimit";this._limit=St("limit",()=>e)}get cards(){return this._cards()}set cards(t){this._cards(t)}get limit(){return this._limit()}set limit(t){this._limit(t)}get general_settings(){let{limit:t,cards:e}=this;return{limit:t,cards:e}}}class nh{constructor(){o(this,"_music");o(this,"_sound");o(this,"_language");let t="en";this._language=St("language",()=>t),this._sound=St("sound",()=>!0),this._music=St("music",()=>!0)}get music(){return this._music()}set music(t){this._music(t)}get sound(){return this._sound()}set sound(t){this._sound(t)}get language(){return this._language()}set language(t){this._language(t)}}let jt=new rh,it=new nh;class oh{constructor(){o(this,"_results");this._results=St("solitaire_results",()=>new Ot([]).fen)}set results(t){this._results(t.fen)}get results(){return Ot.from_fen(this._results(),Yt.from_fen)}add_result(t){let e=this.results;e.push(t),this.results=e}clear_results(){let t=this.results;t.clear(),this.results=t}}let Nt=new oh;function Fs(s){return new Audio(s)}let lh=["Win","new_game","auto_flip","drag1","drag2","drag3","cancel","drop","hit","recycle","undo2"];class _h{constructor(){o(this,"audios");o(this,"musics");o(this,"load",async()=>{this.audios={},lh.forEach(t=>this.audios[t]=[...Array(4).keys()].map(()=>Fs(`./audio/${t}.wav`))),this.musics={},this.musics.main=Fs("./music/SoundBox-music.wav")})}play(t){if(!it.sound)return;let e=this.audios[t],a=e.pop();e.unshift(a),a.play()}stop_music(){this.musics.main.pause()}music(t){if(!it.music)return;let e=this.musics[t];e.loop=!0,e.play()}}const V=new _h,gt=1/60,P={seconds:60*gt,half:30*gt,thirds:20*gt,lengths:15*gt,sixth:10*gt,five:5*gt,three:3*gt,one:1*gt},Q=r.make(1920,1080),ch=(s=1)=>()=>{var t=Math.sin(s++)*1e4;return t-Math.floor(t)},es=ch();function dh(s,t=es){return Math.floor(t()*s)}function ph(s,t=es){return s[dh(s.length,t)]}const $=(s=es)=>r.make(s(),s());function fh(s){for(var t=s.length-1;t>0;t--){var e=Math.floor(Math.random()*(t+1)),a=s[t];s[t]=s[e],s[e]=a}return s}class ss extends x{get data(){return this._data}_init(){let t=this.make(N,r.make(0,0),{name:"button_bg"});t.origin=r.make(366,200).scale(1/2),this.make(R,r.make(0,-30),{width:360,height:100,key:this.data.text,center:!0});let e=this;this.make(B,r.make(-366+80,-200+80).scale(1/2),{rect:w.make(0,0,366-80,200-80),on_hover(){t.play_o("hover",{loop:!1})},on_hover_end(){t.play("hover",()=>{t.play("idle")},!0)},on_click_begin(){t.play_o("click",{loop:!1})},on_click(){e.data.on_click()}})}}let Xe=[1,2,3,4,5,6,7],zs=[1,2,3,4];const ta=["d","c","h","s"],mh=["A","K","Q","J","T","9","8","7","6","5","4","3","2"],Ve=["A","2","3","4","5","6","7","8","9","T","J","Q","K"],gh=ta.flatMap(s=>mh.map(t=>`${s}${t}`));function Rs(s){switch(s[0]){case"d":case"h":return"red";default:return"black"}}function yh(s,t){return Ve[Ve.indexOf(t[1])-1]===s[1]}function uh(s,t){return Rs(s)!=Rs(t)}function wh(s){return s[1]==="K"}function xh(s){return s[1]==="A"}let kh=class{static get deck(){return gh.slice(0)}};function vh(s){let t=[];for(let e=0;e=0;e--)this.cards.unshift(t[e])}remove_cards(t){return this.cards.splice(-t)}remove_all(){return this.remove_cards(this.cards.length)}},o(ht,"take_n",(t,e)=>new ht(t.splice(0,e))),o(ht,"from_fen",t=>new ht(vh(t))),ht);const at={Recycle:-10,HitStock:0,WasteToTableu:10,WasteToFoundation:30,FoundationToTableu:-5,Undo:-20,TableuToFoundationFlip:35,TableuToFoundationNoFlip:20,TableuToTableuFlip:10,TableuToTableuNoFlip:0};class as{constructor(t){this.score=t}static empty(){return new as(0)}}let bh=class ea{constructor(t,e){this.back=t,this.front=e}can_drag(t){let a=this.front.clone.remove_cards(t);if(a.length===t)return a}can_drop(t){let e=t[0];return e?this.front.length>0?uh(e,this.front.top_card)&&yh(e,this.front.top_card):wh(e):!1}undo_from_tableu(t){if(t[1]){let e=this.front.remove_cards(1);this.back.add_cards(e)}this.front.add_cards(t[0])}undo_to_tableu(t){this.front.remove_cards(t.length)}to_tableu(t){this.front.add_cards(t)}from_tableu(t){let e=this.front.remove_cards(t);if(this.front.length===0){let[a]=this.back.remove_cards(1);if(a)return this.front.add_cards([a]),[e,a]}return[e,void 0]}static make(t,e){return new ea(Mt.take_n(t,e),Mt.take_n(t,1))}},Th=class sa{constructor(t){this.foundation=t}get suit(){var t;return(t=this.foundation.top_card)==null?void 0:t[0]}get next_top(){if(!this.suit)return;let t=this.suit,e=Ve[this.foundation.length];return`${t}${e}`}can_drop(t){let[e]=t;return t.length===1&&(this.next_top?e===this.next_top:xh(e))}can_drag(){return this.foundation.top_card}get is_finished(){return this.foundation.length===13}undo_from_foundation(t){this.foundation.add_cards(t)}undo_to_foundation(t){this.foundation.remove_cards(t.length)}from_foundation(){return this.foundation.remove_cards(1)}to_foundation(t){this.foundation.add_cards(t)}static make(){return new sa(Mt.empty)}},Eh=class aa{constructor(t,e,a){this.stock=t,this.waste=e,this.hidden=a}can_drag(){return this.waste.top_card}can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}can_hit_stock(){return this.stock.length>0}hit(t){let e=this.stock.remove_cards(t),a=this.waste.remove_all();return this.hidden.unshift_cards(a),this.waste.add_cards(e),[a,e]}undo_hit(t){let[e,a]=t,i=this.waste.remove_cards(a.length),h=this.hidden.shift_cards(e.length);this.waste.add_cards(h),this.stock.add_cards(i)}recycle(){let t=this.waste.remove_all();return this.hidden.unshift_cards(t),this.stock.add_cards(this.hidden.remove_all()),t}undo_recycle(t){this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}undo_from_waste(t){this.waste.add_cards(t)}from_waste(){return this.waste.remove_cards(1)}static make(t){return new aa(Mt.take_n(t,t.length),Mt.empty,Mt.empty)}},Lt=class{constructor(t,e,a){o(this,"cards");o(this,"flip");this.from=t,this.to=e,this.i=a}can(t){return t.can_tableu_to_tableu(this.from,this.to,this.i)}apply(t){let[e,a]=t.tableu_to_tableu(this.from,this.to,this.i);this.cards=e,this.flip=a}undo(t){t.undo_tableu_to_tableu(this.from,this.to,this.i,[this.cards,this.flip])}},nt=class ia{constructor(t,e,a){o(this,"cards");o(this,"flip");this.from=t,this.to=e,this.i=a}static auto_can(t,e){for(let a=0;a<4;a++)if(ia.can(t,e,a))return[e,a]}static can(t,e,a){return t.can_tableu_to_foundation(e,a,1)}can(t){return t.can_tableu_to_foundation(this.from,this.to,this.i)}apply(t){let[e,a]=t.tableu_to_foundation(this.from,this.to,this.i);this.cards=e,this.flip=a}undo(t){t.undo_tableu_to_foundation(this.from,this.to,this.i,[this.cards,this.flip])}},$t=class{constructor(t){o(this,"card");this.to=t}can(t){return t.can_waste_to_tableu(this.to)}apply(t){this.card=t.waste_to_tableu(this.to)[0]}undo(t){t.undo_waste_to_tableu(this.to,[this.card])}},ot=class ha{constructor(t){o(this,"card");this.to=t}static auto_can(t){for(let e=0;e<4;e++)if(ha.can(t,e))return e}static can(t,e){return t.can_waste_to_foundation(e)}can(t){return t.can_waste_to_foundation(this.to)}apply(t){this.card=t.waste_to_foundation(this.to)[0]}undo(t){t.undo_waste_to_foundation(this.to,[this.card])}},Fe=class{constructor(t,e){o(this,"card");this.from=t,this.to=e}can(t){return t.can_foundation_to_tableu(this.from,this.to)}apply(t){this.card=t.foundation_to_tableu(this.from,this.to)[0]}undo(t){t.undo_foundation_to_tableu(this.from,this.to,[this.card])}},ze=class{constructor(){o(this,"hit_data")}can(t){return t.can_hit_stock()}apply(t){this.hit_data=t.hit_stock()}undo(t){t.undo_hit_stock(this.hit_data)}};class Re{constructor(){o(this,"data")}can(t){return t.can_hit_recycle()}apply(t){this.data=t.hit_recycle()}undo(t){t.undo_hit_recycle(this.data)}}var Rt;let Ah=(Rt=class{constructor(t,e,a,i,h,n,_){this.nb_recycles=t,this.moves=e,this.stats=a,this.settings=i,this.tableus=h,this.foundations=n,this.stock=_}get is_finished(){return this.foundations.every(t=>t.is_finished)}get score(){return this.stats.score}get hit_n(){return this.settings.cards==="threecards"?3:1}apply(t){t.apply(this),this.moves.push(t)}undo(){let t=this.moves.pop();if(t)return this.stats.score+=at.Undo,t.undo(this),t}tableu_to_tableu(t,e,a){let[i,h]=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i),h!==void 0?this.stats.score+=at.TableuToTableuFlip:this.stats.score+=at.TableuToTableuNoFlip,[i,h]}tableu_to_foundation(t,e,a){let[i,h]=this.tableus[t].from_tableu(a);return this.foundations[e].to_foundation(i),h!==void 0?this.stats.score+=at.TableuToFoundationFlip:this.stats.score+=at.TableuToFoundationNoFlip,[i,h]}waste_to_tableu(t){let e=this.stock.from_waste();return this.tableus[t].to_tableu(e),this.stats.score+=at.WasteToTableu,e}waste_to_foundation(t){let e=this.stock.from_waste();return this.foundations[t].to_foundation(e),this.stats.score+=at.WasteToFoundation,e}foundation_to_tableu(t,e){let a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a),this.stats.score+=at.FoundationToTableu,a}undo_tableu_to_tableu(t,e,a,i){this.tableus[e].undo_to_tableu(i[0]),this.tableus[t].undo_from_tableu(i)}undo_tableu_to_foundation(t,e,a,i){this.foundations[e].undo_to_foundation(i[0]),this.tableus[t].undo_from_tableu(i)}undo_waste_to_tableu(t,e){this.tableus[t].undo_to_tableu(e),this.stock.undo_from_waste(e)}undo_waste_to_foundation(t,e){this.foundations[t].undo_to_foundation(e),this.stock.undo_from_waste(e)}undo_foundation_to_tableu(t,e,a){this.tableus[e].undo_to_tableu(a),this.foundations[t].undo_from_foundation(a)}hit_stock(){let t=this.stock.hit(this.hit_n);return this.stats.score+=at.HitStock,t}hit_recycle(){return this.nb_recycles+=1,this.stats.score+=at.Recycle,this.stock.recycle()}undo_hit_stock(t){this.stock.undo_hit(t)}undo_hit_recycle(t){this.nb_recycles-=1,this.stock.undo_recycle(t)}can_tableu_to_tableu(t,e,a){let i=this.tableus[t].can_drag(a);return i!==void 0&&this.tableus[e].can_drop(i)}can_tableu_to_foundation(t,e,a){let i=this.tableus[t].can_drag(a);return i!==void 0&&i.length===1&&this.foundations[e].can_drop(i)}can_waste_to_tableu(t){let e=this.stock.can_drag();return e!==void 0&&this.tableus[t].can_drop([e])}can_waste_to_foundation(t){let e=this.stock.can_drag();return e!==void 0&&this.foundations[t].can_drop([e])}can_foundation_to_tableu(t,e){let a=this.foundations[t].can_drag();return a!==void 0&&this.tableus[e].can_drop([a])}can_hit_stock(){return this.stock.can_hit_stock()}can_hit_recycle(){return this.has_recycle_limit&&this.stock.can_recycle()}get recycle_n(){return this.settings.limit==="nolimit"?999:this.settings.limit==="threepass"?3:1}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}},o(Rt,"make",(t,e)=>{let a=ta.map(p=>Th.make()),i=Xe.map(p=>bh.make(e,p-1)),h=Eh.make(e),n=0,_=[],f=as.empty();return new Rt(n,_,f,t,i,a,h)}),Rt);var Sh=Object.defineProperty,Mh=(s,t,e)=>t in s?Sh(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,F=(s,t,e)=>(Mh(s,typeof t!="symbol"?t+"":t,e),e),ra=["d","c","h","s"],Fh=["A","K","Q","J","T","9","8","7","6","5","4","3","2"],Ke=["A","2","3","4","5","6","7","8","9","T","J","Q","K"],zh=ra.flatMap(s=>Fh.map(t=>`${s}${t}`));function Cs(s){switch(s[0]){case"d":case"h":return"red";default:return"black"}}function Rh(s,t){return Ke[Ke.indexOf(t[1])-1]===s[1]}function Ch(s,t){return Cs(s)!=Cs(t)}function Uh(s){return s[1]==="K"}function Oh(s){return s[1]==="A"}var Nh=class{static get deck(){return zh.slice(0)}};function Dh(s){let t=[];for(let e=0;e=0;t--)this.cards.unshift(s[t])}remove_cards(s){return this.cards.splice(-s)}remove_all(){return this.remove_cards(this.cards.length)}},q=Qt;F(q,"take_n",(s,t)=>new Qt(s.splice(0,t)));F(q,"from_fen",s=>new Qt(Dh(s)));var is="??",ue=class{constructor(s){this.cards=s}get fen(){return this.cards.join(" ")}get clone(){return new ue(this.cards.slice(0))}get length(){return this.cards.length}get top_card(){return this.cards[this.cards.length-1]}unshift_cards(s){for(let t=s.length-1;t>=0;t--)this.cards.push(s[t])}shift_cards(s){return this.cards.splice(0,s)}add_cards(s){this.cards.push(...s)}remove_cards(s){return this.cards.splice(-s)}remove_all(){return this.remove_cards(this.cards.length)}},le=ue;F(le,"from_fen",s=>new ue(s===""?[]:s.split(" ")));F(le,"backs",s=>new ue([...Array(s).keys()].map(t=>is)));var Tt=class{constructor(s){o(this,"_data");this.game=s}_set_data(s){return this._data=s,this}},na=class{constructor(s,t,e){this.game=s,this.stats=t,this.history=e}get nb_moves(){return this.stats.nb_moves}set nb_moves(s){this.stats.nb_moves=s}get score(){return this.stats.score}set score(s){this.stats.score=s}get pov(){return new oa(this.game.pov,this.stats,this.history.length)}apply(s,t){let e=new s(this.game)._set_data(t);if(!s.can(this.game.pov,t))return;let a=e.apply();return this.score+=a,this.nb_moves++,this.history.push(e),e}get can_undo(){return this.history.length>0}undo(){if(!this.can_undo)return;let s=this.history.pop(),t=s.undo();return this.score+=t,this.nb_moves++,s}},Ph=na;F(Ph,"make",s=>new na(s,{score:0,nb_moves:0},[]));var oa=class{constructor(s,t,e){o(this,"history");this.game=s,this.stats=t,this.history=e}finalize_apply_pov(s){this.game.finalize_apply_pov(s)}get clone(){let s=this.game.clone;return new oa(s,{...this.stats},this.history)}get nb_moves(){return this.stats.nb_moves}set nb_moves(s){this.stats.nb_moves=s}get score(){return this.stats.score}set score(s){this.stats.score=s}get can_undo(){return this.history>0}apply(s,t){s.apply(this.game,t),this.nb_moves++,this.history++}undo_pov(){this.nb_moves++,this.history--}undo(s){s.undo_pov(this.game)}},X={Recycle:-10,HitStock:0,WasteToTableu:10,WasteToFoundation:30,TableuToFoundation:20,FoundationToTableu:-30,Undo:-80,TableuToTableuFlip:10,TableuToTableuNoFlip:0};function Lh(s){let[t,e]=s.split("$");return{cards:t,limit:e}}function $h(s){return[s.cards,s.limit].join("$")}var hs=class{constructor(s,t,e){this.stock=s,this.waste=t,this.hidden=e}get fen(){return[this.stock.fen,this.waste.fen,this.hidden.fen].join("$")}get pov(){return new ma(this.stock.hidden_pov,this.waste,this.hidden.hidden_pov)}get can_hit(){return this.stock.length>0}get can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}from_waste(){return{cards:this.waste.remove_cards(1)}}undo_from_waste(s){this.waste.add_cards(s)}hit(s){let t=this.stock.remove_cards(s),e=this.waste.remove_all();return this.hidden.unshift_cards(e),this.waste.add_cards(t),{waste:e,cards:t}}undo_hit(s){let{cards:t,waste:e}=s,a=this.waste.remove_cards(t.length),i=this.hidden.shift_cards(e.length);this.waste.add_cards(i),this.stock.add_cards(a)}recycle(){let s=this.waste.remove_all();return this.hidden.unshift_cards(s),this.stock.add_cards(this.hidden.remove_all()),{waste:s}}undo_recycle(s){let{waste:t}=s;this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}},we=hs;F(we,"from_fen",s=>{let[t,e,a]=s.split("$"),i=q.from_fen(t),h=q.from_fen(e),n=q.from_fen(a);return new hs(i,h,n)});F(we,"make",s=>new hs(q.take_n(s,s.length),q.empty,q.empty));var rs=class{constructor(s,t){this.back=s,this.front=t}get fen(){return[this.back.fen,this.front.fen].join("$")}get pov(){return new ga(this.back.hidden_pov,this.front)}from_tableu(s){let t=this.front.remove_cards(s);if(this.front.length===0){let[e]=this.back.remove_cards(1);return e?(this.front.add_cards([e]),{flip:e,cards:t}):{cards:t}}return{cards:t}}undo_from_tableu(s){if(s.flip){let t=this.front.remove_cards(1);this.back.add_cards(t)}this.front.add_cards(s.cards)}to_tableu(s){this.front.add_cards(s)}undo_to_tableu(s){this.front.remove_cards(s.length)}},xe=rs;F(xe,"from_fen",s=>{let[t,e]=s.split("$");return new rs(q.from_fen(t),q.from_fen(e))});F(xe,"make",(s,t)=>new rs(q.take_n(s,t),q.take_n(s,1)));var ke=class{constructor(s){this.foundation=s}get fen(){return this.foundation.fen}get clone(){return new ke(this.foundation.clone)}get suit(){var s;return(s=this.foundation.top_card)==null?void 0:s[0]}get is_finished(){return this.foundation.length===13}get next_top(){if(!this.suit)return;let s=this.suit,t=Ke[this.foundation.length];return`${s}${t}`}get can_from(){let{top_card:s}=this.foundation;if(s)return{cards:[s]}}can_to(s){let[t]=s;return s.length===1&&(this.next_top?t===this.next_top:Oh(t))}to_foundation(s){this.foundation.add_cards(s)}undo_to_foundation(s){this.foundation.remove_cards(s.length)}from_foundation(){return{cards:this.foundation.remove_cards(1)}}undo_from_foundation(s){this.foundation.add_cards(s)}},ve=ke;F(ve,"from_fen",s=>{let t=s;return new ke(q.from_fen(t))});F(ve,"make",()=>new ke(q.empty));var Ih=[...Array(7).keys()];[...Array(4).keys()];var ns=class{constructor(s,t,e,a,i){this.settings=s,this.nb_recycles=t,this.stock=e,this.tableus=a,this.foundations=i}get fen(){let s=$h(this.settings),t=this.stock.fen,e=this.tableus.map(h=>h.fen).join("/"),a=this.foundations.map(h=>h.fen).join("/"),i=this.nb_recycles;return[s,i,t,e,a].join(" ")}get hit_n(){return this.settings.cards==="threecards"?3:1}get pov(){return new ya(this.settings,this.nb_recycles,this.stock.pov,this.tableus.map(s=>s.pov),this.foundations)}get recycle_n(){return this.settings.limit==="nolimit"?9999:this.settings.limit==="threepass"?3:1}get can_hit(){return this.stock.can_hit}get can_recycle(){return this.has_recycle_limit&&this.stock.can_recycle}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}hit_stock(){return this.stock.hit(this.hit_n)}undo_hit_stock(s){this.stock.undo_hit(s)}recycle(){return this.nb_recycles++,this.stock.recycle()}undo_recycle(s){this.nb_recycles--,this.stock.undo_recycle(s)}tableu_to_tableu(s){let{from:t,to:e,i:a}=s,i=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i.cards),i}undo_tableu_to_tableu(s,t){let{from:e,to:a,i}=s;this.tableus[a].undo_to_tableu(t.cards),this.tableus[e].undo_from_tableu(t)}waste_to_tableu(s){let{to:t}=s,e=this.stock.from_waste();return this.tableus[t].to_tableu(e.cards),e}undo_waste_to_tableu(s,t){let{to:e}=s;this.tableus[e].undo_to_tableu(t.cards),this.stock.undo_from_waste(t.cards)}waste_to_foundation(s){let{to:t}=s,e=this.stock.from_waste();return this.foundations[t].to_foundation(e.cards),e}undo_waste_to_foundation(s,t){let{to:e}=s;this.foundations[e].undo_to_foundation(t.cards),this.stock.undo_from_waste(t.cards)}tableu_to_foundation(s){let{from:t,to:e}=s,a=this.tableus[t].from_tableu(1);return this.foundations[e].to_foundation(a.cards),a}undo_tableu_to_foundation(s,t){let{from:e,to:a}=s;this.foundations[a].undo_to_foundation(t.cards),this.tableus[e].undo_from_tableu(t)}foundation_to_tableu(s){let{from:t,to:e}=s,a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a.cards),a}undo_foundation_to_tableu(s,t){let{from:e,to:a}=s;this.tableus[a].undo_to_tableu(t.cards),this.foundations[e].undo_from_foundation(t.cards)}},la=ns;F(la,"from_fen",s=>{let[t,e,a,i,h]=s.split(" "),n=Lh(t),_=parseInt(e),f=we.from_fen(a),p=i.split("/").map(c=>xe.from_fen(c)),m=h.split("/").map(c=>ve.from_fen(c));return new ns(n,_,f,p,m)});F(la,"make",(s,t)=>{let e=Ih.map(h=>xe.make(t,h)),a=we.make(t),i=0;return new ns(s,i,a,e,ra.map(h=>ve.make()))});var os=class extends Tt{constructor(){super(...arguments);o(this,"data")}get solitaire(){return this.game}apply(){return this.data=this.solitaire.hit_stock(),X.HitStock}undo(){return this.solitaire.undo_hit_stock(this.data),X.Undo}undo_pov(t){t.undo_hit_stock(this.data)}};F(os,"can",s=>s.can_hit);F(os,"apply",s=>{s.hit_stock()});var _a=class extends Tt{constructor(){super(...arguments);o(this,"data")}get solitaire(){return this.game}apply(){return this.data=this.solitaire.recycle(),X.Recycle}undo(){return this.solitaire.undo_recycle(this.data),X.Undo}undo_pov(t){t.undo_recycle(this.data)}};F(_a,"can",s=>s.can_recycle);F(_a,"apply",s=>{s.recycle()});var ls=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.tableu_to_tableu(this.data),this.res.flip?X.TableuToTableuFlip:X.TableuToTableuNoFlip}undo(){return this.solitaire.undo_tableu_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_tableu_to_tableu(this.data,this.res)}};F(ls,"can",(s,t)=>{let e=t,a=s.can_drag_tableu(e);return a?s.can_drop_tableu({...t,...a}):!1});F(ls,"apply",(s,t)=>{s.tableu_to_tableu(t)});var ca=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.waste_to_tableu(this.data),X.WasteToTableu}undo(){return this.solitaire.undo_waste_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_waste_to_tableu(this.data,this.res)}};F(ca,"can",(s,t)=>{const e=s.can_drag_waste;return e?s.can_drop_tableu({...t,...e}):!1});F(ca,"apply",(s,t)=>{s.waste_to_tableu(t)});var da=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.waste_to_foundation(this.data),X.WasteToFoundation}undo(){return this.solitaire.undo_waste_to_foundation(this.data,this.res),X.Undo}undo_pov(t){t.undo_waste_to_foundation(this.data,this.res)}},_s=da;F(_s,"auto_can",s=>{for(let t=0;t<4;t++)if(da.can(s,{to:t}))return{to:t}});F(_s,"can",(s,t)=>{const e=s.can_drag_waste;return e?s.can_drop_foundation({...t,...e}):!1});F(_s,"apply",(s,t)=>{s.waste_to_foundation(t)});var pa=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.tableu_to_foundation(this.data),X.TableuToFoundation}undo(){return this.solitaire.undo_tableu_to_foundation(this.data,this.res),X.Undo}undo_pov(t){t.undo_tableu_to_foundation(this.data,this.res)}},be=pa;F(be,"auto_can",(s,t)=>{let{tableu:e}=t;for(let a=0;a<4;a++)if(pa.can(s,{from:e,to:a}))return{from:e,to:a}});F(be,"can",(s,t)=>{const e=s.can_drag_tableu({...t,i:1});return e?s.can_drop_foundation({...t,...e}):!1});F(be,"apply",(s,t)=>{s.tableu_to_foundation(t)});var fa=class extends Tt{constructor(){super(...arguments);o(this,"res")}get solitaire(){return this.game}get data(){return this._data}apply(){return this.res=this.solitaire.foundation_to_tableu(this.data),X.FoundationToTableu}undo(){return this.solitaire.undo_foundation_to_tableu(this.data,this.res),X.Undo}undo_pov(t){t.undo_foundation_to_tableu(this.data,this.res)}};F(fa,"can",(s,t)=>{const e=s.can_drag_foundation(t);return e?s.can_drop_tableu({...t,...e}):!1});F(fa,"apply",(s,t)=>{s.foundation_to_tableu(t)});var ma=class{constructor(s,t,e){this.stock=s,this.waste=t,this.hidden=e}pov_hit_stock(s){this.waste.remove_cards(s.length),this.waste.add_cards(s)}get can_hit(){return this.stock.length>0}get can_recycle(){return this.stock.length===0&&this.waste.length+this.hidden.length>0}get can_from_waste(){let{top_card:s}=this.waste;if(s)return{cards:[s]}}get clone(){return new ma(this.stock.clone,this.waste.clone,this.hidden.clone)}from_waste(){return{cards:this.waste.remove_cards(1)}}undo_from_waste(s){this.waste.add_cards(s)}hit(s){let t=this.stock.remove_cards(s),e=this.waste.remove_all();this.hidden.unshift_cards(e),this.waste.add_cards(t)}undo_hit(s){let{cards:t,waste:e}=s;this.waste.remove_cards(t.length),this.hidden.shift_cards(e.length),this.waste.add_cards(e),this.stock.add_cards(t)}recycle(){let s=this.waste.remove_all();return this.hidden.unshift_cards(s),this.stock.add_cards(this.hidden.remove_all()),{waste:s}}undo_recycle(s){let{waste:t}=s;this.hidden.add_cards(this.stock.remove_all());let e=this.hidden.shift_cards(t.length);this.waste.add_cards(e)}},ga=class{constructor(s,t){this.back=s,this.front=t}pov_flip(s){this.front.remove_cards(1),this.front.add_cards([s])}get clone(){return new ga(this.back.clone,this.front.clone)}can_from(s){let t=this.front.clone;this.back.clone;let e=t.remove_cards(s);if(e.length===s)return{cards:e}}can_to(s){let t=s[0];return t?this.front.length>0?Ch(t,this.front.top_card)&&Rh(t,this.front.top_card):Uh(t):!1}from_tableu(s){let t=this.front.remove_cards(s);if(this.front.length===0){let[e]=this.back.remove_cards(1);return e?(this.front.add_cards([e]),{flip:e,cards:t}):{cards:t}}return{cards:t}}undo_from_tableu(s){if(s.flip){let t=this.front.remove_cards(1);this.back.add_cards(t)}this.front.add_cards(s.cards)}to_tableu(s){this.front.add_cards(s)}undo_to_tableu(s){this.front.remove_cards(s.length)}},ya=class{constructor(s,t,e,a,i){this.settings=s,this.nb_recycles=t,this.stock=e,this.tableus=a,this.foundations=i}get clone(){return new ya(this.settings,this.nb_recycles,this.stock.clone,this.tableus.map(s=>s.clone),this.foundations.map(s=>s.clone))}get recycle_n(){return this.settings.limit==="nolimit"?9999:this.settings.limit==="threepass"?3:1}get hit_n(){return this.settings.cards==="threecards"?3:1}get has_recycle_limit(){return this.recycle_n-this.nb_recycles>0}get can_hit(){return this.stock.can_hit}get can_recycle(){return this.has_recycle_limit&&this.stock.can_recycle}get is_finished(){return this.foundations.every(s=>s.is_finished)}can_drag_tableu(s){let{from:t,i:e}=s;return this.tableus[t].can_from(e)}can_drop_tableu(s){let{to:t,cards:e}=s;return this.tableus[t].can_to(e)}can_drop_foundation(s){let{to:t,cards:e}=s;return this.foundations[t].can_to(e)}get can_drag_waste(){return this.stock.can_from_waste}can_drag_foundation(s){let{from:t}=s;return this.foundations[t].can_from}hit_stock(){return this.stock.hit(this.hit_n)}undo_hit_stock(s){this.stock.undo_hit(s)}recycle(){return this.nb_recycles++,this.stock.recycle()}undo_recycle(s){this.nb_recycles--,this.stock.undo_recycle(s)}finalize_apply_pov(s){if(s instanceof ls&&s.res.flip){let{from:t}=s.data;this.tableus[t].pov_flip(s.res.flip)}if(s instanceof be&&s.res.flip){let{from:t}=s.data;this.tableus[t].pov_flip(s.res.flip)}s instanceof os&&this.stock.pov_hit_stock(s.data.cards)}tableu_to_tableu(s){let{from:t,to:e,i:a}=s,i=this.tableus[t].from_tableu(a);return this.tableus[e].to_tableu(i.cards),i}undo_tableu_to_tableu(s,t){let{from:e,to:a,i}=s;this.tableus[a].undo_to_tableu(t.cards),this.tableus[e].undo_from_tableu(t)}waste_to_tableu(s){let{to:t}=s,e=this.stock.from_waste();return this.tableus[t].to_tableu(e.cards),e}undo_waste_to_tableu(s,t){let{to:e}=s;this.tableus[e].undo_to_tableu(t.cards),this.stock.undo_from_waste(t.cards)}waste_to_foundation(s){let{to:t}=s,e=this.stock.from_waste();return this.foundations[t].to_foundation(e.cards),e}undo_waste_to_foundation(s,t){let{to:e}=s;this.foundations[e].undo_to_foundation(t.cards),this.stock.undo_from_waste(t.cards)}tableu_to_foundation(s){let{from:t,to:e}=s,a=this.tableus[t].from_tableu(1);return this.foundations[e].to_foundation(a.cards),a}undo_tableu_to_foundation(s,t){let{from:e,to:a}=s;this.foundations[a].undo_to_foundation(t.cards),this.tableus[e].undo_from_tableu(t)}foundation_to_tableu(s){let{from:t,to:e}=s,a=this.foundations[t].from_foundation();return this.tableus[e].to_tableu(a.cards),a}undo_foundation_to_tableu(s,t){let{from:e,to:a}=s;this.tableus[a].undo_to_tableu(t.cards),this.foundations[e].undo_from_foundation(t.cards)}};const Ce={s:"spades",d:"diamonds",h:"hearts",c:"clubs"},Bh={A:"a",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",T:"t",J:"j",Q:"q",K:"k"};class Hh extends x{constructor(){super(...arguments);o(this,"_card");o(this,"rank");o(this,"rsuit");o(this,"suit");o(this,"decsuit")}get waiting(){return this._card===is}get card(){return this._card}set card(e){this._card=e,this.rank.play_now(Bh[e[1]]),this.suit.play_now(Ce[e[0]]),this.rsuit.play_now(Ce[e[0]]),this.decsuit.forEach(a=>a.play_now(Ce[e[0]]))}_init(){let e=r.make(40,50);this.decsuit=[...Array(3).keys()].map(()=>e=e.add($().mul(r.make(4,30)).add(r.make(0,30)))).map(i=>{let h=this.make(N,i,{name:"suit"});return h.origin=r.make(32,32),h.play_now("spades"),h.scale=r.one.scale($().x*.2).add(r.make(.2,.2)),h});let a=[...Array(2).keys()].map(()=>e=e.sub($().mul(r.make(24,20)).add(r.make(0,30)))).map(i=>{i.x+=120;let h=this.make(N,i,{name:"suit"});return h.origin=r.make(32,32),h.play_now("spades"),h.scale=r.one.scale($().x*.2).add(r.make(.2,.2)),h});this.decsuit.push(...a),this.rank=this.make(N,r.make(140,32),{name:"rank_2"}),this.rank.origin=r.make(32,32),this.rank.play_now("a"),this.rank.scale=r.make(.6,.6),this.suit=this.make(N,r.make(30,32),{name:"suit"}),this.suit.origin=r.make(32,32),this.suit.play_now("spades"),this.suit.scale=r.make(.6,.6),this.rsuit=this.make(N,r.make(150,210),{name:"suit"}),this.rsuit.origin=r.make(32,32),this.rsuit.rotation=Math.PI,this.rsuit.play_now("spades"),this.rsuit.scale=r.make(.6,.6)}}class jh extends x{constructor(){super(...arguments);o(this,"decoration");o(this,"_will_lerp_t");o(this,"_will_lerp_position");o(this,"_drop_rect");o(this,"_clickable");o(this,"_dragging");o(this,"_drag_decay",r.zero);o(this,"_on_drag");o(this,"_on_drop");o(this,"_on_hover");o(this,"_on_click");o(this,"facing");o(this,"anim");o(this,"shadow");o(this,"highlight");o(this,"_will_hover");o(this,"_will_hover_end");o(this,"_will_flip_back");o(this,"_will_flip_front");o(this,"lerp_hover_y");o(this,"_lerp_drag_shadow");o(this,"_tr");o(this,"_tx");o(this,"_ty");o(this,"_target_speed");o(this,"_speed");o(this,"_hover_time");o(this,"_after_ease")}release(){this.lerp_position(),this.unset_dragging(),this.set_highlight(!1),this.bind_click(void 0),this.bind_drag(void 0),this.bind_drop(void 0),this.bind_hover(void 0),this._after_ease=void 0}lerp_release(){this.lerp_position(),this.unset_dragging()}get waiting(){return this.decoration.waiting}get card(){return this.decoration.card}set card(e){this.decoration.card=e,this.waiting?this.anim._animation==="idle"&&(this.anim.play_now("wait"),this.decoration.visible=!1):this.anim._animation==="wait"&&(this.anim.play_now("idle"),this.decoration.visible=!0)}get flipping(){return this.anim._animation==="flip"||this.anim._animation==="back_flip"}get easing(){return!!this._tx||!!this._ty||!!this._tr}lerp_position(e,a){this._tx&&(this.cancel(this._tx),this._tx=void 0),this._ty&&(this.cancel(this._ty),this._ty=void 0),this._will_lerp_position=e,this._will_lerp_t=a,e?this._target_speed=(1-(a||.5))*.2:this._target_speed=0}bind_drop_rect(e){this._drop_rect=e}get drag_decay(){return this._drag_decay}bind_drag(e){this._on_drag=e}bind_drop(e){this._on_drop=e}bind_hover(e){this._on_hover=e}bind_click(e){this._on_click=e}get hover_time(){return this._hover_time??0}ease_rotation(e,a=P.half){this._tr=this.tween_single(this._tr,[this.rotation,e],i=>{this.rotation=i},a,0,()=>{this._tr=void 0})}ease_position(e,a=P.half){e.equals(this.position)||(this._target_speed=a/P.half*.2,this._tx=this.tween_single(this._tx,[this.position.x,e.x],i=>{this.position.x=i},a,0,()=>{this._tx=void 0,this._target_speed=0}),this._ty=this.tween_single(this._ty,[this.position.y,e.y],i=>{this.position.y=i},a,0,()=>{this._ty=void 0}))}set_highlight(e){this.highlight.visible=e}set_dragging(){this._lerp_drag_shadow=0,this._dragging=!0}unset_dragging(){this._dragging=!1}after_ease(e){this._after_ease=e}_init(){this.shadow=this._make(N,r.make(0,0),{name:"card"}),this.shadow.origin=r.make(88,120),this.shadow.play_now("shadow"),this.anim=this.make(N,r.make(0,0),{name:"card"}),this.anim.origin=r.make(88,120),this.facing=-1,this.anim.play_now("back_idle"),this.highlight=this.make(N,r.make(0,0),{name:"card"}),this.highlight.origin=r.make(88,120),this.highlight.play_now("highlight"),this.highlight.visible=!1,this.decoration=this.make(Hh,r.make(-80,-120),{}),this.decoration.visible=!1,this.decoration.card=is,this._will_hover=!1,this._will_hover_end=!1,this._will_flip_back=!1,this._will_flip_front=!1,this.lerp_hover_y=0,this._dragging=!1,this._speed=0,this._target_speed=0,this.hit_area=w.make(16-this.anim.origin.x,16-this.anim.origin.y,170,210)}_update(){this._speed=dt(this._speed,this._target_speed,.2);let e=eh(Math.abs(Math.sin(S.seconds*3)))*this._speed;if(this.scale=r.make(1-e,1+e),this._will_lerp_position&&(this.position=r.lerp(this.position,this._will_lerp_position,this._will_lerp_t??.5)),this._lerp_drag_shadow!==void 0&&(this._dragging?this._lerp_drag_shadow=dt(this._lerp_drag_shadow,1,.2):(this._lerp_drag_shadow=dt(this._lerp_drag_shadow,0,.2),this._lerp_drag_shadow<.001&&(this._lerp_drag_shadow=void 0))),this._lerp_drag_shadow!==void 0){let a=this._lerp_drag_shadow*.05;this.shadow.scale=r.one.add(r.one.scale(a)),this.shadow.alpha=(1-this._lerp_drag_shadow)*100+155}if(this._after_ease&&!this.easing&&(this._after_ease(),this._after_ease=void 0),this.easing||(this.anim.position.y=dt(this.anim.position.y,this.lerp_hover_y,.2),this.decoration.position.y=dt(this.decoration.position.y,this.lerp_hover_y-120,.16),this.highlight.position.y=dt(this.highlight.position.y,this.lerp_hover_y,.16)),this._will_hover&&(this._will_hover=!1,!this.easing&&!this.flipping&&this._will_flip_back&&this._will_flip_front&&this.anim.play(this.facing===1?"hover":"back_hover"),this.lerp_hover_y=-6,this._hover_time=0),this._will_hover_end){this._will_hover_end=!1;let a=this.waiting?"wait":"idle";!this.easing&&!this.flipping&&this._will_flip_back&&this._will_flip_front&&this.anim.play(this.facing===1?a:"back_idle"),this.lerp_hover_y=0,this._hover_time=void 0}this._hover_time!==void 0&&this._hover_time>=0&&(this.easing&&(this._hover_time=0),this._hover_time+=S.delta),this._will_flip_back&&(this.easing||(this._will_flip_back=!1,this.shadow.visible=!1,this.decoration.visible=!1,this.anim.play_now("flip",()=>{this.facing=-1,this.anim.play("back_idle"),this.shadow.visible=!0}))),this._will_flip_front&&(this.easing||(this._will_flip_front=!1,this.shadow.visible=!1,this.decoration.visible=!1,this.anim.play_now("back_flip",()=>{this.facing=1,this.anim.play(this.waiting?"wait":"idle"),this.shadow.visible=!0,this.waiting||(this.decoration.visible=!0)})))}flip_back(){this._will_flip_front=!1,this._will_flip_back=this.facing!==-1||this.anim._animation==="back_flip"}flip_front(){this._will_flip_back=!1,this._will_flip_front=this.facing!==1||this.anim._animation==="flip"}_draw_shadow(e){e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),this.shadow.draw(e),e.pop_matrix()}}class Xh extends x{constructor(){super(...arguments);o(this,"frees");o(this,"used");o(this,"_shadow_group")}bind_drop_rect(e){this.used.forEach(a=>a.bind_drop_rect(e))}borrow(){let e=this.frees.shift();return this.used.push(e),e.visible=!0,e}release(e){e.visible=!1,this.used.splice(this.used.indexOf(e),1),e.release(),this.frees.push(e)}set shadow_group(e){this._shadow_group=e}_init(){this.frees=Nh.deck.map(e=>{let a=this.make(jh,r.zero,{});return a.visible=!1,a}),this.used=[]}_draw(e){var a,i;e.push_matrix(A.create_transform(this.position,this.origin,this.scale,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),this._draw_children(e),(a=this._shadow_group)==null||a.forEach(h=>{h._draw_shadow(e)}),(i=this._shadow_group)==null||i.forEach(h=>{h.draw(e)}),e.pop_matrix()}}class Ft extends x{constructor(){super(...arguments);o(this,"_i_gap");o(this,"cards")}get data(){return this._data}get length(){return this.cards.length}get top_card(){return this.cards[this.cards.length-1]}get h(){let e=55*(1-this.cards.length/50);return this.data.h??e}get top_position(){return this.position.add(r.make(0,this.cards.length*this.h))}set_highlight(e,a){this.cards.slice(this.cards.length-e,this.cards.length).forEach(h=>h.set_highlight(a))}unshift_cards(e){e.forEach(a=>a.send_front());for(let a=e.length-1;a>=0;a--)this.cards.unshift(e[a]);this._reposition()}add_cards(e){e.forEach(a=>a.send_front()),this.cards.push(...e),this._reposition()}remove_cards(e){let a=this.cards.splice(-e);return this._reposition(),a}shift_cards(e){let a=this.cards.splice(0,e);return this._reposition(),a}set i_gap(e){this._i_gap!==e&&(this._i_gap=e,this._reposition())}_reposition(){this.cards.forEach((e,a)=>{let i=this._i_gap!==void 0&&a>this._i_gap?a+.5:a;e.ease_position(this.p_position.add(r.make(0,i*this.h)))})}ease_position(e){this.position=e,this._reposition()}_init(){this.cards=[]}}function Vh(s){return 1/(1+Math.exp(-s))}class Ue extends x{constructor(){super(...arguments);o(this,"_cards")}set cards(e){this._cards=e.slice(0),this._cards.forEach(a=>a.send_front()),this._cards.forEach(a=>a.set_dragging())}get drag_decay(){return this._cards[0].drag_decay}get h(){return 50}drag(e){this._cards.forEach((a,i)=>{let h=e.add(r.make(0,this.h*i).sub(this.drag_decay)),n=1-Vh(i/this._cards.length*2);a.lerp_position(h,n)})}lerp_release(){let e=this._cards.splice(0);return e.forEach(a=>a.lerp_release()),e}_init(){this._cards=[]}}class Kh extends x{constructor(){super(...arguments);o(this,"hit_area",w.make(-70,-70,170,210));o(this,"_hover_index");o(this,"backs");o(this,"fronts")}get data(){return this._data}get top_front_position(){return this.fronts.top_position}get top_back_position(){return this.backs.top_position}hover_end(){this._hover_index!==void 0&&(this.fronts.cards[this._hover_index]._will_hover_end=!0,this._hover_index=void 0)}hover_begin(e){this.fronts.cards[e]._will_hover=!0,this._hover_index=e}is_hovering_at(e){return this._hover_index===e}find_hover_begin(e){return this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)})}find_click_begin(e){this.hover_end();let a=this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)});if(a!==-1)return this.fronts.cards.length-a}find_drag_begin(e){this.hover_end();let a=this.fronts.cards.findLastIndex(i=>{var h;return(h=i.ghit_area)==null?void 0:h.contains_point(e)});if(a!==-1){let i=this.fronts.cards.length;return[this.fronts.cards.splice(a),i-a]}}release_all(){return this.free()}free(){return[...this.backs.remove_cards(this.backs.length),...this.fronts.remove_cards(this.fronts.length)]}add_backs(e){e.forEach(a=>a.flip_back()),this.backs.add_cards(e),this.fronts.ease_position(this.top_back_position)}add_fronts(e){this.fronts.add_cards(e),e.forEach(a=>a.flip_front())}remove_fronts(e){return this.hover_end(),this.fronts.remove_cards(e)}flip_front(e){let[a]=this.backs.remove_cards(1);a.card=e,a.flip_front(),this.fronts.ease_position(this.top_back_position),this.fronts.add_cards([a])}get empty(){return this.fronts.length===0&&this.backs.length===0}flip_back(){let[e]=this.fronts.remove_cards(1);e.flip_back(),this.backs.add_cards([e]),this.fronts.ease_position(this.top_back_position)}_init(){this.backs=this.make(Ft,r.make(0,0),{h:33}),this.fronts=this.make(Ft,r.make(0,0),{})}_update(){let e=this.fronts.cards.findIndex(a=>a.hover_time>P.thirds);e!==-1?this.fronts.i_gap=e:this.fronts.i_gap=void 0}}let z;function ua(){z=Ah.make(jt.general_settings,fh(kh.deck))}ua();class Wh extends x{constructor(){super(...arguments);o(this,"_on_score");o(this,"_on_new_game");o(this,"_on_game_over");o(this,"_on_init");o(this,"cards")}init_and_set_callbacks(e,a,i,h){this._on_score=e,this._on_new_game=a,this._on_game_over=i,this._on_init=h,this.collect_cards(),this._on_init(this.settings)}cmd(e){e.can(z)?(z.apply(e),this.apply(e),this._on_score(z.score),z.is_finished&&this._on_game_over(z.settings,z.score)):this.cant(e)}cmd_undo(){let e=z.undo();e?(this.undo(e),this._on_score(z.score)):this.cant_undo()}cant_undo(){}undo(e){this.cards.undo(e)}apply(e){this.cards.apply(e)}cant(e){this.cards.cant(e)}get settings(){return z.settings}collect_cards(){this.cards._collect_cards()}request_new_game(){let e=z.stats.score;e>0&&(z.is_finished||Nt.add_result(Yt.from_loss(z.settings,e))),ua(),this._on_score(z.score),this._on_new_game(z.settings),this.collect_cards()}request_undo(){this.cmd_undo()}_init(){let e=this;this.cards=this.make(Gh,r.zero,{on_cmd(a){setTimeout(()=>e.cmd(a))}})}}const Oe=s=>typeof s=="object"&&s.tableu!==void 0,Ne=s=>typeof s=="object"&&s.foundation!==void 0,qh=s=>typeof s=="object"&&typeof s.tableu=="number";class Gh extends x{constructor(){super(...arguments);o(this,"cards");o(this,"tableus");o(this,"stock");o(this,"recycle_view");o(this,"foundations");o(this,"drag_stack");o(this,"drag_source");o(this,"click_source");o(this,"trigger_auto",-2)}get data(){return this._data}_init(){this.cards=this.make(Xh),this.recycle_view=this.make(Jh,r.make(40,200),{on_recycle(){z.can_hit_recycle()&&c.data.on_cmd(new Re)}});let e=120,a=320,i=340,h=200,n=200,_=1790,f=166,p=240;this.tableus=Xe.map(g=>this.make(Kh,r.make(i+h*(g-1),n))),this.stock=this.make(Qh,r.make(e,a)),this.foundations=zs.map(g=>this.make(Yh,r.make(_,f+p*(g-1))));let m,c=this;this.unbindable_input({on_click(g,v){if(g=g.mul(E.v_screen),c.stock.find_stock_hit(g))return c.data.on_cmd(new ze),!0;if(c.stock.find_click_begin(g)){if(c.click_source==="waste"){c._release_cancel_highlight();let y=ot.auto_can(z);if(y!==void 0){let b=y;c.trigger_auto=-1,c.data.on_cmd(new ot(b))}return!0}return c.stock.waste.top_card.set_highlight(!0),c.click_source="waste",!0}for(let y=0;y{this.tableus[e-1].release_all().forEach(i=>this.cards.release(i))}),this.stock.release_all().forEach(e=>this.cards.release(e)),zs.map(e=>{this.foundations[e-1].release_all().forEach(i=>this.cards.release(i))}),this._release_cancel_drag(),this._release_cancel_highlight(),this._refresh_recycle(),this.stock.add_waste_hidden(z.stock.hidden.cards.map(e=>this.cards.borrow())),this.stock.add_stocks(z.stock.stock.cards.map(e=>this.cards.borrow())),this.stock.add_waste(z.stock.waste.cards.map(e=>{let a=this.cards.borrow();return a.card=e,a})),this._refresh_recycle(),z.tableus.forEach((e,a)=>{let i=e.back.cards.map(n=>{let _=this.cards.borrow();return _.flip_back(),_}),h=e.front.cards.map(n=>{let _=this.cards.borrow();return _.card=n,_.flip_front(),_});this.tableus[a].add_backs(i),this.tableus[a].add_fronts(h)}),z.foundations.forEach((e,a)=>{let i=e.foundation.cards.map(h=>{let n=this.cards.borrow();return n.card=h,n.flip_front(),n});this.foundations[a].add_cards(i)})}_release_cancel_drag(){if(this.drag_stack){let e=this.drag_stack.lerp_release();if(this.drag_source==="waste")this.stock.add_waste(e);else if(Ne(this.drag_source)){let{foundation:a}=this.drag_source;this.foundations[a].add_cards(e)}else{let{tableu:a,i}=this.drag_source;this.tableus[a].add_fronts(e)}V.play("cancel"),this.drag_stack.dispose(),this.drag_stack=void 0,this.drag_source=void 0,e[0].after_ease(()=>{this.cards.shadow_group=void 0})}}_release_cancel_highlight(){if(this.click_source)if(this.click_source==="waste")this.stock.waste.top_card.set_highlight(!1),this.click_source=void 0;else{let{tableu:e,i:a}=this.click_source;this.tableus[e].fronts.set_highlight(a,!1),this.click_source=void 0}else return}_refresh_recycle(){z.can_hit_stock()?this.recycle_view.visible=!1:this.recycle_view.visible=!0,z.can_hit_recycle()?this.recycle_view.enable():this.recycle_view.disable()}undo(e){if(V.play("undo2"),e instanceof ze)this.stock.undo_hit(e.hit_data[1],e.hit_data[0]),this._refresh_recycle();else if(e instanceof Re)this.stock.undo_recycle(e.data.length),this._refresh_recycle();else if(e instanceof Lt){let a=e.flip,{from:i,to:h,i:n}=e;a&&this.tableus[i].flip_back();let _=this.tableus[h].remove_fronts(n);this.tableus[i].add_fronts(_)}else if(e instanceof $t){let{to:a}=e,i=this.tableus[a].remove_fronts(1);this.stock.add_waste(i)}else if(e instanceof nt){let a=e.flip,{from:i,to:h}=e;a&&this.tableus[i].flip_back();let n=this.foundations[h].remove_cards(1);this.tableus[i].add_fronts(n)}else if(e instanceof ot){let{to:a}=e,i=this.foundations[a].remove_cards(1);this.stock.add_waste(i)}else if(e instanceof Fe){let{from:a,to:i}=e,h=this.tableus[i].remove_fronts(1);this.foundations[a].add_cards(h)}}cant(e){this._release_cancel_drag(),this._release_cancel_highlight()}apply(e){let a;if(e instanceof Re)this.stock.recycle(),this._refresh_recycle();else if(e instanceof ze)this.stock.hit(e.hit_data[1]),this._refresh_recycle();else if(e instanceof $t){let i=e.to;if(this.drag_stack){let h=this.drag_stack.lerp_release();this.tableus[i].add_fronts(h),a=h}else{this._release_cancel_highlight();let h=this.stock.remove_waste(1);this.tableus[i].add_fronts(h)}}else if(e instanceof ot){let{to:i}=e;if(this.drag_stack){let h=this.drag_stack.lerp_release();this.foundations[i].add_cards(h),a=h}else{this._release_cancel_highlight();let h=this.stock.remove_waste(1);this.foundations[i].add_cards(h)}}else if(e instanceof nt){let i=e.flip,{from:h,to:n}=e;if(this.drag_stack){let _=this.drag_stack.lerp_release();this.foundations[n].add_cards(_),a=_}else{this._release_cancel_highlight();let _=this.tableus[h].remove_fronts(1);this.foundations[n].add_cards(_)}i&&this.tableus[h].flip_front(i)}else if(e instanceof Fe){let{from:i,to:h}=e,n=this.drag_stack.lerp_release();this.tableus[h].add_fronts(n),a=n}else if(e instanceof Lt){let{flip:i}=e,{from:h,to:n,i:_}=e,f=[];if(this.drag_stack){let p=this.drag_stack.lerp_release();this.tableus[n].add_fronts(p),a=p}else if(this.click_source&&qh(this.click_source)){let{tableu:p,i:m}=this.click_source;this._release_cancel_highlight();let c=this.tableus[p].remove_fronts(m);this.tableus[n].add_fronts(c),f=c}i&&(this.tableus[h].flip_front(i),f&&f.forEach(p=>p.send_front()))}a&&(this.drag_stack.dispose(),this.drag_stack=void 0,this.drag_source=void 0,a[0].after_ease(()=>{this.cards.shadow_group=void 0})),(e instanceof nt||e instanceof ot)&&(this.trigger_auto===-1&&V.play("auto_flip"),this.trigger_auto===-3&&(V.play("auto_flip"),this.trigger_auto=-1))}_update(){if(this.trigger_auto===-1)this.trigger_auto=P.thirds;else if(this.trigger_auto>0)this.trigger_auto=He(this.trigger_auto,0,S.delta);else if(this.trigger_auto===0){this.trigger_auto=-2;let e=ot.auto_can(z);if(e!==void 0){let a=e;this.data.on_cmd(new ot(a)),this.trigger_auto=-3}else for(let a=0;a<7;a++){let i=nt.auto_can(z,a);if(i!==void 0){let[h,n]=i;this.data.on_cmd(new nt(h,n,1)),this.trigger_auto=-3;break}}}}foundation_find_max_overlap(e){let a=-1,i=1920;return this.foundations.forEach((h,n)=>{if(h.ghit_area.overlaps(e.ghit_area)){let _=h.g_position.distance(e.g_position);_{if(_!==a){let f=n.fronts.top_card;if(f&&f.ghit_area.overlaps(e.ghit_area)){let p=f.g_position.distance(e.g_position);p{if(_!==a&&n.ghit_area.overlaps(e.ghit_area)){let f=n.g_position.distance(e.g_position);fa.flip_back()),this.waste_hidden.add_cards(e)}add_waste(e){this.waste.add_cards(e),e.forEach((a,i)=>a.flip_front())}add_stocks(e){e.forEach(a=>a.flip_back()),this.stock.add_cards(e)}remove_waste(e){return this.waste.remove_cards(e)}undo_hit(e,a){let i=this.waste.remove_cards(e.length),h=this.waste_hidden.remove_cards(a.length);this.waste.add_cards(h),h.forEach((n,_)=>{n.card=a[_],n.flip_front()}),i.forEach(n=>{n.flip_back()}),this.stock.add_cards(i)}hit(e){let a=this.stock.remove_cards(e.length);a.forEach((h,n)=>h.card=e[n]),a.forEach((h,n)=>h.flip_front());let i=this.waste.remove_cards(this.waste.cards.length);i.forEach(h=>{h.flip_back()}),this.waste_hidden.unshift_cards(i),this.waste.add_cards(a),V.play("hit")}recycle(){let e=this.waste.remove_cards(this.waste.length);this.waste_hidden.unshift_cards(e);let a=this.waste_hidden.remove_cards(this.waste_hidden.length);a.forEach(i=>i.flip_back()),a.forEach(i=>i.send_front()),this.stock.add_cards(a),V.play("recycle")}undo_recycle(e){let a=this.stock.remove_cards(this.stock.length);this.waste_hidden.add_cards(a);let i=this.waste_hidden.shift_cards(e);a.forEach(h=>h.flip_front()),i.forEach(h=>h.flip_front()),this.waste.add_cards(i)}_init(){this.stock=this.make(Ft,r.make(0,0),{h:1}),this.waste=this.make(Ft,r.make(0,260),{}),this.waste_hidden=this.make(Ft,r.make(0,300),{h:0})}}class Jh extends x{constructor(){super(...arguments);o(this,"anim")}get data(){return this._data}disable(){this.anim.play("disabled")}enable(){this.anim.play("idle")}_init(){let e=this.make(N,r.make(0,0),{name:"recycle"});this.anim=e;let a=this;this.make(B,r.make(20,20),{rect:w.make(0,0,140,160),on_hover(){e._animation!=="disabled"&&e.play("hover")},on_hover_end(){e._animation!=="disabled"&&e.play("idle")},on_click(){a.data.on_recycle()}})}}[...Array(50).keys()].map(()=>$().mul(Q.scale(.8)));class Zh extends x{constructor(){super(...arguments);o(this,"_score");o(this,"score_text");o(this,"score_text_shadow")}set score(e){this._score=e,this.score_text.text=`${e}`,this.score_text_shadow.text=`${e}`}get score(){return this._score}_init(){this._score=0,this.make(R,r.make(0,25),{key:"score",width:80,height:100}),this.score_text_shadow=this.make(R,r.make(100,6),{no_trans:!0,key:`${this.score}`,width:180,height:100,color:u.black}),this.score_text=this.make(R,r.make(100,0),{no_trans:!0,key:`${this.score}`,width:180,height:100})}}class tr extends x{get data(){return this._data}_init(){[$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q),$().mul(Q)].forEach(e=>{let a=this.make(N,e,{name:"swiggle"});a.origin=r.make(600,400),a.scale=r.one.scale(.5+$().x),$().y<.5&&a.play("small"),a.rotation=$().y*Math.PI});let t=this;this.make(B,r.zero,{rect:w.make(0,0,1920,1080),on_hover(){return!0},on_drag(){return!0},on_click(){return t.data.on_close(),!0}})}}class er extends x{constructor(){super(...arguments);o(this,"cards");o(this,"limit")}set settings(e){this.cards.text=e.cards,this.limit.text=e.limit}_init(){this.make(R,r.make(0,0),{no_trans:!0,key:"Solitaire",width:350,height:64,color:u.white}),this.cards=this.make(R,r.make(350,5),{key:"one_pass",width:350,height:40,color:u.white}),this.limit=this.make(R,r.make(550,5),{key:"no_limit",width:350,height:40,color:u.white})}}class sr extends x{constructor(){super(...arguments);o(this,"ax",0);o(this,"ay",0);o(this,"vx",0);o(this,"vy",0)}get data(){return this._data}_init(){let e=Math.random()<.3?"2":"",a=this.make(N,r.make(0,0),{name:"confetti"+e});a.play_o("idle",{loop:!0});let i=.5+Math.random()*.8;a.scale=r.make(i,i),a.rotation=Math.PI*Math.random(),this.vx=100+Math.random()*100,this.vy=-100+Math.random()*100,this.vx*=this.data.sign,this.ax=this.vx*10,this.ay=this.vy*10}_update(){this.position.x+=this.vx*S.delta,this.position.y+=this.vy*S.delta,this.position.x+=this.ax*S.delta,this.position.y+=this.ay*S.delta,this.ax=He(this.ax,0,S.delta*1e3),this.ay=He(this.ay,0,S.delta*1e3),this.position.x>2e3&&this.dispose()}}class Us extends x{constructor(){super(...arguments);o(this,"life",0)}get data(){return this._data}_init(){if(this.pop_confetti(),this.data.sign<0){let e=this.make(N,r.make(0,700),{name:"confbar"});this.tween([Math.PI,0,Math.PI*.3,Math.PI*.16,0],a=>e.rotation=a,[P.half,P.lengths,P.thirds,P.thirds])}else{let e=this.make(N,r.make(1920,700),{name:"confbar"});e.scale=r.make(-1,1),this.tween([-Math.PI,0,-Math.PI*.3,-Math.PI*.16,0],a=>e.rotation=a,[P.half,P.lengths,P.thirds,P.thirds])}}_update(){this.life<6&&S.on_interval(P.seconds*2)&&(this.pop_confetti(),this.life++)}pop_confetti(){for(let e=0;e<6;e++)this.make(sr,r.make(this.data.sign>0?-500+e*100:1920-e*100,1080-e*300*Math.random()),{sign:this.data.sign})}}class Os extends x{pop(){V.play("Win"),this.make(Us,r.make(0,0),{sign:1}),this.make(Us,r.make(0,0),{sign:-1})}}class ar extends x{get data(){return this._data}_init(){let t=1200,e=300;this.make(te,r.make(1920/2-t/2,520),{name:"panel_bg_nine_slice",w:t,h:e}),this.make(R,r.make(1920/2,590),{key:"congratz",width:450,height:100,color:u.white,center:!0}),this.make(R,r.make(1920/2,700),{key:`you_finished_with_score%${this.data.score}%`,width:650,height:60,color:u.white,center:!0})}}class ne extends x{constructor(){super(...arguments);o(this,"hamburger");o(this,"sidebar");o(this,"overlay");o(this,"over_confetties",[])}set sidebar_open(e){this.sidebar.open=e,this.overlay.visible=e,this.hamburger.open=e}_init(){let e,a=this.make(mr,r.zero,void 0);this.over_confetties.push(this.make(Os,r.make(0,0),{}));let i=this.make(Wh,r.make(0,0),{});this.over_confetties.push(this.make(Os,r.make(0,0),{})),this.make(ss,r.make(160,1e3),{text:"undo",on_click(){i.request_undo()}});let h=this.make(er,r.make(640,16),{}),n=this.make(Zh,r.make(16,860),{});const _=y=>{n.score=y};let f;const p=y=>{h.settings=y,f&&(f.dispose(),f=void 0),V.play("new_game"),a.change_poem()},m=(y,b)=>{this.game_over_confetti_pop(),f=this.make(ar,r.make(0,0),{score:b}),Nt.add_result(Yt.from_win(y,b))},c=y=>{V.music("main"),h.settings=y};i.init_and_set_callbacks(_,p,m,c);let g=this,v=this.make(tr,r.zero,{on_close(){g.sidebar_open=!1,g.hamburger.open=!1}}),k=this.make(hr,r.make(2,2),{on_open:y=>{g.sidebar_open=y}});e=this.make(ir,r.make(-600,180),{on_new_game(){i.request_new_game(),g.sidebar_open=!1}}),this.sidebar=e,this.overlay=v,this.hamburger=k,this.sidebar_open=!1}game_over_confetti_pop(){this.over_confetties.forEach(e=>e.pop())}}class ir extends x{constructor(){super(...arguments);o(this,"_t_x");o(this,"_open")}get data(){return this._data}set open(e){this._open=e,this._t_x&&this.cancel(this._t_x),e?this._t_x=this.tween([this.position.x,0],a=>{this.position.x=a},P.sixth,0,()=>{this._t_x=void 0}):this._t_x=this.tween([this.position.x,-600],a=>{this.position.x=a},P.sixth,0,()=>{this._t_x=void 0})}_init(){this._open=!1;let e=this,a=this.make(N,r.make(0,-100),{name:"side_menu_bg"});a.scale=r.make(1.4,1.4);let i=20,h=60,n=160;this.make(It,r.make(i,h),{text:"main_menu",on_click(){W.next(Dt)}}),this.make(It,r.make(i,h+n),{text:"new_game",on_click(){e.data.on_new_game()}}),this.make(It,r.make(i,h+n*2),{text:"settings",on_click(){W.next(Ea,r.zero,{selected_index:1,on_back:ne})}}),this.make(It,r.make(i,h+n*3),{text:"how_to_play",on_click(){W.next(va,r.zero,{selected_index:0,on_back:ne})}}),this.make(It,r.make(i,h+n*4),{text:"about",on_click(){W.next(ka,r.zero,{on_back:ne})}})}}class It extends x{constructor(){super(...arguments);o(this,"_t_color");o(this,"_i_color");o(this,"bg");o(this,"fg")}get data(){return this._data}get i_color(){return this._i_color}set i_color(e){this._i_color=e,this.bg.color=u.lerp(u.white,u.hex(2106417),this._i_color),this.fg.color=u.lerp(u.white,u.hex(2106417),1-this._i_color)}set hover(e){this._t_color&&this.cancel(this._t_color),e?this._t_color=this.tween([this.i_color,0],a=>{this.i_color=a},P.sixth,0,()=>{this._t_color=void 0}):this._t_color=this.tween([this.i_color,1],a=>{this.i_color=a},P.sixth,0,()=>{this._t_color=void 0})}_init(){this._i_color=0,this.bg=this.make(G,r.make(-20,-40),{w:412,h:120,color:u.hex(2106417)}),this.fg=this.make(R,r.make(0,0),{key:this.data.text,width:350,height:100,color:u.white});let e=360,a=120,i=this;this.make(B,r.make(-20,-40),{rect:w.make(0,0,e,a),on_hover(){i.hover=!0},on_hover_end(){i.hover=!1},on_click(){return i.data.on_click(),!0}})}}class hr extends x{constructor(){super(...arguments);o(this,"_open");o(this,"anim")}get data(){return this._data}set open(e){this._open=e,this._open?this.anim.play("open"):this.anim.play("idle")}_init(){this._open=!1;let e=this.make(N,r.make(0,0),{name:"hmg_bg"});this.anim=e;let a=200,i=100,h=this;this.make(B,r.make(20,20),{rect:w.make(0,0,a,i),on_hover(){e.play(h._open?"open_hover":"hover")},on_hover_end(){e.play(h._open?"open":"idle")},on_click(){return h.open=!h._open,h.data.on_open(h._open),!0}})}}const rr=`en=english how_to_play=how to play statistics=statistics settings=settings @@ -140,7 +140,7 @@ general_settings=General Settings solitaire_settings=Solitaire Settings overall_statistics=Overall Statistics solitaire_statistics=Solitaire Statistics -clear_statistics=Clear`,or=`tr=türkçe +clear_statistics=Clear`,nr=`tr=türkçe how_to_play=nasıl oynanır statistics=istatistikler settings=ayarlar @@ -175,7 +175,7 @@ onepass=1 geçiş you_finished_with_score=%d Puan ile bitirdiniz congratz=Tebrikler -`,lr=`fr=française +`,or=`fr=française how_to_play=comment jouer statistics=statistiques settings=paramètres @@ -188,7 +188,7 @@ blue=bleu orange=orange on=sur off=éteint -`,_r=`# octopus +`,lr=`# octopus Octopus is played with 2 52-card playing decks. Initially 54 cards are dealt to the tableu in ten piles, face down except for the top cards. The tableu piles are build down by rank. In-suit sequences can be moved together. The 50 remaining cards can be dealt to the tableu 10 at a time when none of the piles are empty. The aim of the game Octopus is to remove all cards from the table. Assembling a tableu will remove it. The tableu piles build down by rank, and in suit sequences can be moved together. @@ -293,7 +293,7 @@ A fun way to pass time with 3 solitaire games. [Solitaire]"https://en.wikipedia. - Contribute translating at [Translation]"https://github.com/eguneys/solitaire23/blob/master/TRANSLATE.md" -`,cr=`# octopus +`,_r=`# octopus Octopus 52-kart oyun destesiyle oynanır. Başlangıçta 54 kart 10 yığın halinde tablolara, en üst kart hariç üstü kapalı şekilde dağıtılır. Kalan 50 kart tablolara boş yığın olmadığı taktirde, 10 ar şekilde dağıtılabilir. Octopus oyunun amacı bütün kartları masadan kaldırmaktır. Bir tablo oluşturmak o kartları kaldırır. Tablo yığınları sayıya göre kurulur. Aynı sembol serileri beraber hareket ettirilebilir. @@ -399,10 +399,10 @@ Eğlenceli bir şekilde zaman geçirmek için 3 solitaire oyunu. [Solitaire]"htt - İş teklifleri için lütfen twitter dan [@eguneys]"https://twitter.com/eguneys?lang=en" iletişime geçin. - Çeviri için katkıda bulunmak için [Translation]"https://github.com/eguneys/solitaire23/blob/master/TRANSLATE.md". -`;let wa={en:_r,tr:cr},xa={en:nr,tr:or,fr:lr};const jt=Object.keys(xa),dr=Object.keys(wa);let Xt={},We={};jt.forEach(s=>Xt[s]=pr(xa[s]));dr.forEach(s=>We[s]=fr(wa[s]));function pr(s){let t={};return s.trim().split(` -`).map(e=>{let[a,i]=e.split("=");t[a]=i}),t}function fr(s){let t={},e,a="";return s.split(` +`;let wa={en:lr,tr:_r},xa={en:rr,tr:nr,fr:or};const Xt=Object.keys(xa),cr=Object.keys(wa);let Vt={},We={};Xt.forEach(s=>Vt[s]=dr(xa[s]));cr.forEach(s=>We[s]=pr(wa[s]));function dr(s){let t={};return s.trim().split(` +`).map(e=>{let[a,i]=e.split("=");t[a]=i}),t}function pr(s){let t={},e,a="";return s.split(` `).forEach(i=>{let h=i.match(/^# (.*)/);h?(e&&(t[e]=a,a=""),e=h[1]):a+=i+` -`}),t[e]=a,t}const xt=class xt{constructor(){o(this,"_language",xt.default_language);o(this,"hooks",[])}get default_language(){return xt.default_language}get language(){return this._language}set language(t){this._language=t,this.hooks.forEach(e=>e())}get default_trans2_map(){return We[xt.default_language]}get trans2_map(){return We[this.language]}get default_trans_map(){return Xt[xt.default_language]}get trans_map(){return Xt[this.language]}lang_key(t){return Xt[t][t]}key(t,e){let a=t.match(/([^%]*)%([^%]*)%$/);if(a!==null){let[i,h,n]=a;return this.trans_map_with_key(h,e).replace("%d",n)}else return this.trans_map_with_key(t,e)}trans_map_with_key(t,e){return e?Xt[e][t]||this.default_trans_map[t]:this.trans_map[t]||this.default_trans_map[t]}key2(t){var e;return((e=this.trans2_map)==null?void 0:e[t])||this.default_trans2_map[t]}register(t){return this.hooks.push(t),()=>{this.hooks.splice(this.hooks.indexOf(t),1)}}};o(xt,"default_language","en");let qe=xt;const rt=new qe,mr=`Shimzy stars, let be yours, +`}),t[e]=a,t}const xt=class xt{constructor(){o(this,"_language",xt.default_language);o(this,"hooks",[])}get default_language(){return xt.default_language}get language(){return this._language}set language(t){this._language=t,this.hooks.forEach(e=>e())}get default_trans2_map(){return We[xt.default_language]}get trans2_map(){return We[this.language]}get default_trans_map(){return Vt[xt.default_language]}get trans_map(){return Vt[this.language]}lang_key(t){return Vt[t][t]}key(t,e){let a=t.match(/([^%]*)%([^%]*)%$/);if(a!==null){let[i,h,n]=a;return this.trans_map_with_key(h,e).replace("%d",n)}else return this.trans_map_with_key(t,e)}trans_map_with_key(t,e){return e?Vt[e][t]||this.default_trans_map[t]:this.trans_map[t]||this.default_trans_map[t]}key2(t){var e;return((e=this.trans2_map)==null?void 0:e[t])||this.default_trans2_map[t]}register(t){return this.hooks.push(t),()=>{this.hooks.splice(this.hooks.indexOf(t),1)}}};o(xt,"default_language","en");let qe=xt;const rt=new qe,fr=`Shimzy stars, let be yours, But don’t fall in love little one, Let it crack the fires beneath you. You might as well catch one. @@ -459,5 +459,5 @@ Words are referencing your dogs.” “Symbolism is effective. Interaction into the wild oaks. They tell me your stories. -Inside the joke teller’s guide to the galaxy.”`,fe=class fe{constructor(t){this.verses=t}one(){return fh(this.verses,Math.random)}};o(fe,"load",()=>{let t=mr.split(/\r?\n\r?\n/);return new fe(t)});let Ge=fe,Ns=Ge.load();class G extends x{constructor(){super(...arguments);o(this,"_color")}get data(){return this._data}set color(e){this._color=e}get color(){return this._color}set height(e){this.data.h=e}_init(){this.color=this.data.color??u.white}_draw(e){e.rect(w.make(this.position.x,this.position.y,this.data.w,this.data.h),this.color)}}class gr extends x{constructor(){super(...arguments);o(this,"poem_text");o(this,"_will_change_poem",!1);o(this,"life",0)}change_poem(){this._will_change_poem=!0}_init(){this.make(G,r.make(0,0),{w:E.width,h:E.height,color:u.hex(2236962)});let e=Ns.one();this.poem_text=this.make(z,r.make(1920/2,1080),{no_trans:!0,width:1e3,height:700,key:e,center:!0,color:u.hex(11845300)})}_update(){this.life+=S.delta,this.poem_text.position.y=900+Math.cos(this.life*.2)*400,this._will_change_poem&&this.poem_text.position.y>1100&&(this._will_change_poem=!1,this.poem_text.text=Ns.one()),S.on_interval(P.seconds*3)}}class B extends x{constructor(){super(...arguments);o(this,"_scaled_rect")}get data(){return this._data}get width(){return this._scaled_rect.w}get height(){return this._scaled_rect.h}get _rect(){return this.data.abs?w.make(this.position.x,this.position.y,this.width,this.height):this._scaled_rect}get rect(){let{p_scissor:e}=this;return e?this._rect.overlaps_rect(e):this._rect}_init(){this._scaled_rect=this.data.rect;let e=!1,a=!1,i=this;this.unbindable_input({on_click_begin(h,n){var m,c;if(n||!i.p_visible)return!1;let _=h.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_click_begin)==null?void 0:c.call(m))??!1:!1},on_drag(h,n){var _,f,p,m;if(h._right||!i.p_visible)return!1;if(e){let c=h.m.mul(E.v_screen);return((f=(_=i.data).on_drag)==null?void 0:f.call(_,c))??!1}if(h.m&&(!n||!n.m)){let c=h.e.mul(E.v_screen),g=w.make(c.x-4,c.y-4,8,8);return i.rect.overlaps(g)?(e=!0,((m=(p=i.data).on_drag_begin)==null?void 0:m.call(p,c))??!1):!1}return!1},on_up(h,n,_){var p,m,c,g,v,k,y,b,T,R;if(n||!i.p_visible)return!1;let f=h.mul(E.v_screen);if(e&&(e=!1,(m=(p=i.data).on_drag_end)==null||m.call(p,f)),(g=(c=i.data).on_up)==null||g.call(c,h,n),_){let C=_.mul(E.v_screen),I=w.make(C.x-4,C.y-4,8,8);I=((k=(v=i.data).get_drop_rect)==null?void 0:k.call(v,C))??I;let H=i.rect;(b=(y=i.data).get_drop_rect)!=null&&b.call(y,C)&&console.log(H,I,H.overlaps(I)),H.overlaps(I)&&((R=(T=i.data).on_drop)==null||R.call(T,_))}return!1},on_hover(h){var p,m,c,g;if(!i.data.on_hover||!i.p_visible)return!1;let n=h.mul(E.v_screen),_=w.make(n.x-4,n.y-4,8,8);if(i.rect.overlaps(_)){if(!a)return a=!0,((m=(p=i.data).on_hover)==null?void 0:m.call(p))??!1}else a&&(a=!1,(g=(c=i.data).on_hover_end)==null||g.call(c));return a},on_hover_clear(){var h,n;return i.data.on_hover_end?a?(a=!1,(n=(h=i.data).on_hover_end)==null?void 0:n.call(h)):(i.p_visible,!1):!1},on_click(h,n){var m,c;if(!i.p_visible)return!1;let _=h.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_click)==null?void 0:c.call(m))??!1:!1},on_wheel(h,n){var m,c;if(!i.p_visible)return!1;let _=n.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_wheel)==null?void 0:c.call(m,h))??!1:!1}})}_draw(){wt.push_matrix(A.create_translation(this.position)),this.g_position=r.transform(r.zero,wt.m_matrix),this._scaled_rect=w.transform(this.data.rect,wt.m_matrix),this.data.debug&&wt.rect(w.make(0,0,this.width,this.height),u.hex(65280)),wt.pop_matrix()}}class ka extends x{get data(){return this._data}_init(){this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let t=this;this.make(Te,r.zero,{key:"about",on_back(){W.next(t.data.on_back??te)}});let e=1880,a=940;this.make(Zt,r.make(20,120),{name:"panel_bg_nine_slice",w:e,h:a});let i=this._make(zt,r.make(0,0),{width:1880-100,content:rt.key2("about")});this.make(Y,r.make(60,160),{w:e-100,h:a-80,content:i})}}const me=class me extends x{constructor(){super(...arguments);o(this,"height")}get data(){return this._data}_init(){let e=60,a=this._make(pt,r.zero,{size:e,text:" "}),i=a.width,h=a.height,n=0,_=0;this.data.content.trim().split(` -`).forEach(f=>{me.parse(f).forEach(p=>{let m;p.link?m=this.make(yr,r.zero,{size:e,text:p.text,color:ah,on_click(){window.open(p.link,"_blank")}}):m=this.make(pt,r.zero,{size:e,text:p.text}),n+m.width>this.data.width&&(n=0,_+=m.height),m.position=r.make(n,_),n+=m.width+i}),n=0,_+=h}),this.height=_+h}};o(me,"parse",e=>{let a=/\[([^\]]*)\]\"([^\"]*)\"/g,i=0,h=[],n;for(;(n=a.exec(e))!==null;){let[_,f,p]=n,m=n.index,c=m+_.length;m>i&&e.slice(i,m).split(" ").filter(g=>!!g).forEach(g=>h.push({text:g})),h.push({text:f,link:p}),i=c}return i!!_).forEach(_=>h.push({text:_})),h});let zt=me;class cs extends x{constructor(){super(...arguments);o(this,"_selected_index")}get data(){return this._data}on_click(e){this.selected_index=this.data.tabs.indexOf(e)}get selected_index(){return this._selected_index}set selected_index(e){this._selected_index=e,this.data.tabs.forEach((a,i)=>a.set_active(e===i)),this.data.on_selected_index(e)}_init(){this._selected_index=this.data.selected_index,this.data.tabs.forEach((i,h)=>i.set_active(this._selected_index===h));let e=this.data.tabs.length===4?.63:1,a=this.data.tabs.reduce((i,h)=>i+h.width*e,0);this.make(G,r.make(10,130),{w:a,h:10,color:u.hex(1052737)}),this.data.tabs.forEach(i=>i.parent=this),this.data.tabs.forEach(i=>{this.data.tabs.length===4&&(i.scale=r.one.scale(.6),i.position.y+=50)})}_update(){this.data.tabs.forEach(e=>e.update())}_draw(e){e.push_matrix(A.create_translation(this.position)),this._draw_children(e),this.data.tabs.forEach(a=>a.draw(e)),e.pop_matrix()}_dispose(){this.data.tabs.forEach(e=>e.dispose())}}class z extends x{constructor(){super(...arguments);o(this,"_text");o(this,"_text_view");o(this,"dispose_trans")}get data(){return this._data}set color(e){this._text_view.color=e}get height(){return this._text_view.height}set text(e){this._text=e,this._text_view.text=this.text,this._text_view.size=this.size}get text(){return this.data.no_trans?this._text:rt.key(this._text)}get size(){let e=Ut.sp_font.width_of(this.text),a=128,i=a*this.data.width/e,h=Ut.sp_font.height_of(this.text),n=a*this.data.height/h;return Math.min(i,n)}_init(){let e=this.data.center,a=this.data.color;this._text=this.data.key,this._text_view=this.make(pt,r.make(0,0),{size:this.size,text:this.text,center:e,color:a}),this.data.no_trans||(this.dispose_trans=rt.register(()=>{this._text_view.text=rt.key(this._text),this._text_view.size=this.size}))}_dispose(){var e;(e=this.dispose_trans)==null||e.call(this)}}class pt extends x{constructor(){super(...arguments);o(this,"_color");o(this,"_size")}get data(){return this._data}get justify(){return this.data.center?r.make(0,0):r.zero}get color(){return this._color}set color(e){this._color=e}get text(){return this.data.text}set text(e){this.data.text=e}get size(){return this._size}set size(e){this._size=e}get width(){return this.font.width_of(this.text)/this.font.size*this.size}get height(){return this.font.height_of(this.text)/this.font.size*this.size}_init(){this.color=this.data.color??u.white,this._size=this.data.size??128,this.rotation=this.data.rotation??0,this.origin=this.data.center?r.make(this.width/2,0):r.zero}_draw(e){e.push_matrix(A.create_transform(this.position,this.origin,r.one,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),e.str_j(this.font,this.text,r.zero,this.justify,this.size,this.color),e.pop_matrix()}}class yr extends x{constructor(){super(...arguments);o(this,"text_view")}get data(){return this._data}set color(e){this.text_view.color=e}get width(){return this.text_view.width}get height(){return this.text_view.height}_init(){this.text_view=this.make(pt,r.zero,this.data);let e=this;this.make(B,r.make(0,-this.text_view.height/3),{rect:w.make(0,0,this.text_view.width,this.text_view.height),on_hover(){e.color=u.red},on_hover_end(){e.color=e.data.color??u.white},on_click(){e.data.on_click()}})}}class st extends x{constructor(){super(...arguments);o(this,"_active");o(this,"anim")}get data(){return this._data}get width(){return this.data.w}get height(){return 32+64}set_active(e){this._active=e,e?this.anim.play("active"):this.anim.play("idle")}_init(){let e=this.make(N,r.zero,{name:"tab3_bg"});this.anim=e,this.make(z,r.make(this.width/2,this.height/2),{no_trans:this.data.no_trans,width:this.width-80,height:this.height,key:this.data.text,center:!0});let a=this;this.make(B,r.make(32,32),{rect:w.make(0,0,360,90),on_hover(){a._active||e.play("hover")},on_hover_end(){e.play(a._active?"active":"idle")},on_click(){a.parent.on_click(a)}})}}class ds extends x{constructor(){super(...arguments);o(this,"_selected_index")}get data(){return this._data}get selected_index(){return this._selected_index}set selected_index(e){this._selected_index=e,this.data.panels.forEach((a,i)=>a.visible=e===i)}get active_panel(){return this.data.panels[this.selected_index]}_init(){this.selected_index=this.data.selected_index}_update(){this.active_panel.update()}_draw(e){e.push_matrix(A.create_translation(this.position)),this._draw_children(e),this.active_panel.draw(e),e.pop_matrix()}_dispose(){this.data.panels.forEach(e=>e.dispose())}}class Y extends x{constructor(){super(...arguments);o(this,"scroll_y");o(this,"scroll_off");o(this,"scroll_edge_off");o(this,"target_scroll_y");o(this,"thumb");o(this,"content_base_position")}get data(){return this._data}get content(){return this.data.content}get width(){return this.data.w}get height(){return this.data.h}_init(){this.data.content.parent=this,this.content_base_position=r.copy(this.data.content.position),this.scroll_y=0,this.scroll_off=0,this.scroll_edge_off=0,this.target_scroll_y=0,this.make(G,r.make(this.data.w-20-8,8),{w:20,h:this.data.h-16,color:u.black});let e=this.height*(this.height/this.content.height);this.thumb=this._make(G,r.make(this.data.w-20-8+4,8+4),{w:20-8,h:e,color:u.white});let a,i=this;this.make(B,r.zero,{rect:w.make(0,0,this.width,this.height),on_drag_begin(h){var n,_;return(_=(n=i.data).on_scroll)==null||_.call(n),a=h,!0},on_drag(h){return i.scroll_off=h.y-a.y,!0},on_up(h,n){if(i.scroll_y+=i.scroll_off,i.scroll_off=0,i.target_scroll_y=i.scroll_y,i.scroll_y>0)i.scroll_edge_off=i.scroll_y,i.scroll_y=0;else{let _=-i.content.height+i.data.h;i.content.height{this.t=e},P.half,0,()=>{this._t=void 0})}get done(){return!this._t}_draw(e){e.push_matrix(A.create_transform(r.make(this.t,E.height/2),r.make(160,90),r.make(13,13),Math.PI*.25)),e.rect(w.make(0,0,320,180),u.hex(65280)),e.pop_matrix(),e.push_matrix(A.create_transform(r.make(this.t-1820,E.height/2),r.make(80,10),r.make(13,13),Math.PI*.25)),e.rect(w.make(0,0,160,10),u.hex(0)),e.pop_matrix()}}class ae extends x{get data(){return this._data}_init(){let t=this.make(N,r.zero,{name:"main_settings_bg"});this.make(z,r.make(320,86),{key:this.data.text,center:!0,width:400,height:100,color:u.black});let e=this.make(z,r.make(320,86),{key:this.data.text,center:!0,width:400,height:100}),a=e.position.y,i=this;this.make(B,r.make(100,50),{rect:w.make(0,0,440,120),on_hover(){t.play("hover"),i.tween([e.position.y,a-2],h=>{e.position.y=h},P.lengths)},on_hover_end(){t.play("idle"),i.tween([e.position.y,a+2],h=>{e.position.y=h},P.lengths)},on_click(){i.data.on_click()}})}}class wr extends x{get data(){return this._data}_init(){let t=this.make(N,r.zero,{name:this.data.name}),e=this;this.make(B,r.make(this.data.rect.x,this.data.rect.y),{debug:this.data.debug,rect:w.make(0,0,this.data.rect.w,this.data.rect.h),on_hover(){t.play("hover")},on_hover_end(){t.play("idle")},on_click(){e.data.on_click()}})}}class Te extends x{get data(){return this._data}_init(){let t=this;this.make(wr,r.zero,{name:"navigation_bg",rect:w.make(30,30,540,100),on_click(){t.data.on_back()}}),this.make(z,r.make(112,54),{key:this.data.key,width:400,height:96})}}class va extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"how_to_play",on_back(){W.next(e.data.on_back??te)}}),this.make(Zt,r.make(20,180),{name:"panel_bg_nine_slice",w:1860,h:860});let a=410,i=[this._make(st,r.make(2,2),{no_trans:!0,text:"solitaire",w:a}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"fourtimes",w:a}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"octopus",w:a})],h=40,n=780,_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("solitaire")}),f=this._make(Y,r.make(20,h),{w:1800,h:n,content:_});_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("fourtimes")});let p=this._make(Y,r.make(20,h),{w:1800,h:n,content:_});_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("octopus")});let m=this._make(Y,r.make(20,h),{w:1800,h:n,content:_}),c=[f,p,m],g=this.make(ds,r.make(20,180),{w:1860,h:860,panels:c,selected_index:t});this.make(cs,r.make(600,8),{tabs:i,selected_index:t,on_selected_index(v){g.selected_index=v}})}}class xr extends x{constructor(){super(...arguments);o(this,"box");o(this,"selected_text")}get data(){return this._data}set selected_index(e){this.box.selected_index=e,this.selected_text.text=this.data.items[e]}_init(){let e=this.make(N,r.zero,{name:"dropdown_bg"});this.selected_text=this.make(z,r.make(32,60),{no_trans:this.data.no_trans,key:this.data.items[this.data.selected_index],width:250,height:100});let a=this;this.make(B,r.make(0,0),{abs:!0,rect:w.make(0,0,1920,1080),on_click(){let i=a.box.visible;return a.box.visible=!1,i},on_drag_begin(){return a.box.visible=!1,!1}}),this.make(B,r.make(16,32),{rect:w.make(0,0,480,112),on_hover(){e.play("hover")},on_hover_end(){e.play("idle")},on_click(){return a.box.visible?!1:(a.box.visible=!0,!0)}})}}class ba extends x{constructor(){super(...arguments);o(this,"dropdown_list")}get data(){return this._data}set selected_index(e){this.dropdown_list.selected_index=e}_init(){let e=this.make(G,r.make(0,0),{w:500,h:500,color:u.hex(3233172)}),a=this,i=this._make(kr,r.make(0,0),{no_trans:this.data.no_trans,items:this.data.items,selected_index:this.data.selected_index,on_selected(h){a.data.on_selected(h)}});e.height=Math.min(500,i.height),this.dropdown_list=i,this.make(Y,r.make(0,0),{w:500,h:Math.min(500,i.height),content:i})}}class kr extends x{constructor(){super(...arguments);o(this,"height");o(this,"_selected_index");o(this,"items")}get data(){return this._data}set selected_index(e){this._selected_index=e,this._color_items(),this.data.on_selected(e)}get selected_index(){return this._selected_index}_init(){let e=140,a=0,i=this;this.items=this.data.items.map((h,n)=>{let _=this.make(vr,r.make(0,a),{no_trans:this.data.no_trans,item:h,on_selected(){i.selected_index=n}});return a+=e,_}),this.height=a+30,this._selected_index=this.data.selected_index}_color_items(){this.items.forEach((e,a)=>{e.selected=this.selected_index===a})}}class vr extends x{constructor(){super(...arguments);o(this,"bg");o(this,"text")}get data(){return this._data}set selected(e){e?(this.bg.color=u.white,this.text.color=u.hex(3233172)):(this.text.color=u.white,this.bg.color=u.hex(3233172))}_init(){this.bg=this.make(G,r.make(-40,-30),{w:470,h:140,color:u.hex(3233172)}),this.text=this.make(z,r.make(0,0),{no_trans:this.data.no_trans,width:340,height:140,key:this.data.item});let e=this;this.make(B,r.make(-40,-30),{rect:w.make(0,0,470,140),on_click(){return e.data.on_selected(),!0}})}}class br extends x{constructor(){super(...arguments);o(this,"height")}_init(){this.make(z,r.make(280,20),{key:"solitaire_settings",width:820,height:200});let e=220,a=this.make(Kt,r.make(40,e),{name:"turning_cards",items:["three_cards","one_card"],selected_index:Ms.indexOf(Ht.cards),on_selected(h){Ht.cards=Ms[h]}}),i=this.make(Kt,r.make(40,e*2),{name:"turning_limit",items:["no_limit","three_passes","one_pass"],selected_index:Ss.indexOf(Ht.limit),on_selected(h){Ht.limit=Ss[h]}});this.make_box(a),this.make_box(i),this.height=e*3+500}make_box(e,a){let i=this.make(ba,r.make(e.position.x+e.dropdown.position.x,e.position.y+e.dropdown.position.y+160),{no_trans:a,items:e.data.items,selected_index:e.data.selected_index,on_selected(h){i.visible=!1,e.dropdown.data.on_selected(h),e.dropdown.selected_text.text=e.data.items[h]}});e.dropdown.box=i,i.visible=!1}}class De extends x{constructor(){super(...arguments);o(this,"height")}_init(){this.make(z,r.make(280,20),{key:"general_settings",width:820,height:200});let e=220,a=this.make(Kt,r.make(40,e*1),{no_trans:!0,name:"language",items:jt.map(f=>rt.lang_key(f)),selected_index:jt.indexOf(it.language),on_selected(f){rt.language=jt[f],it.language=jt[f]}}),i=["on","off"],h=this.make(Kt,r.make(40,e*2),{name:"sounds",items:["on","off"],selected_index:it.sound?0:1,on_selected(f){it.sound=i[f]==="on"}}),n=["on","off"],_=this.make(Kt,r.make(40,e*3),{name:"music",items:["on","off"],selected_index:it.music?0:1,on_selected(f){it.music=n[f]==="on",it.music||V.stop_music()}});this.make_box(a,!0),this.make_box(h),this.make_box(_),this.height=e*3+500}make_box(e,a){let i=this.make(ba,r.make(e.position.x+e.dropdown.position.x,e.position.y+e.dropdown.position.y+160),{no_trans:a,items:e.data.items,selected_index:e.data.selected_index,on_selected(h){i.visible=!1,e.dropdown.data.on_selected(h),e.dropdown.selected_text.text=e.data.items[h]}});e.dropdown.box=i,i.visible=!1}}class Kt extends x{constructor(){super(...arguments);o(this,"dropdown")}get data(){return this._data}_init(){this.make(G,r.make(0,0),{w:1300,h:200,color:u.hex(2106433)}),this.make(z,r.make(50,60),{key:this.data.name,width:420,height:200});let e=this;this.dropdown=this.make(xr,r.make(720,8),{no_trans:this.data.no_trans,items:this.data.items,selected_index:this.data.selected_index,on_selected(a){e.data.on_selected(a)}})}}class Pe extends x{constructor(){super(...arguments);o(this,"height");o(this,"table_view")}_init(){this.make(z,r.make(700,0),{key:"overall_statistics",width:820,height:200,center:!0});let e=this;this.make(ss,r.make(700,1600),{text:"clear_statistics",on_click(){Nt.clear_results(),e._load_results()}}),this.height=2e3,this._load_results()}_load_results(){var a;(a=this.table_view)==null||a.dispose();let e=new rh(Nt.results,new Ot([]),new Ot([]));this.table_view=this.make(Ta,r.make(0,0),{total_played:e.total_played,total_wins:e.total_wins,top_5_highscores:e.top_5_highscores.map(i=>i.multiplied_score)})}}class Ta extends x{get data(){return this._data}_init(){let{total_played:t,total_wins:e,top_5_highscores:a}=this.data,i=100;this.make(z,r.make(700,200),{key:`total_games_played%${t}%`,width:820,height:200,center:!0}),this.make(z,r.make(700,200+i*1.2),{key:`games_won%${e}%`,width:820,height:200,center:!0}),this.make(z,r.make(700,200+i*3),{key:"top5_highscores",width:820,height:200,center:!0}),a.forEach((n,_)=>{this.make(z,r.make(200,200+i*4+i*_*1.5+80),{key:`${_+1}.`,width:80,height:100,no_trans:!0}),this.make(z,r.make(700,200+i*4+i*_*1.5+80),{key:`${n}`,width:80,height:100,no_trans:!0,center:!0}),this.make(G,r.make(200,100+200+i*4+i*_*1.5+80),{w:1e3,h:20,color:u.white})})}}class Tr extends x{constructor(){super(...arguments);o(this,"height");o(this,"table_view")}_init(){this.make(z,r.make(700,0),{key:"solitaire_statistics",width:820,height:200,center:!0});let e=this;this.make(ss,r.make(700,1600),{text:"clear_statistics",on_click(){Nt.clear_results(),e._load_results()}}),this.height=2e3,this._load_results()}_load_results(){var a;(a=this.table_view)==null||a.dispose();let e=Nt.results;this.table_view=this.make(Ta,r.make(0,0),{total_played:e.total_played,total_wins:e.total_wins,top_5_highscores:e.top_5_highscores.map(i=>i.multiplied_score)})}}class Ea extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"statistics",on_back(){W.next(e.data.on_back??te)}}),this.make(Zt,r.make(220,150),{name:"panel_bg_nine_slice",w:1480,h:910});let a=1e3/4,i=a*1.6,h=[this._make(st,r.make(2,2),{text:"overall",w:i}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"solitaire",w:i}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"fourtimes",w:i}),this._make(st,r.make(2+(a+4)*3,2),{no_trans:!0,text:"octopus",w:i})],n;this.make(cs,r.make(600,8),{tabs:h,selected_index:t,on_selected_index(v){n.selected_index=v}});let _=this._make(Pe,r.make(0,0),{}),f=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(Tr,r.make(0,0),{});let p=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(Pe,r.make(0,0),{});let m=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(Pe,r.make(0,0),{});let c=this._make(Y,r.make(0,0),{w:1450,h:850,content:_}),g=[f,p,m,c];n=this.make(ds,r.make(220,180),{w:1050,h:850,panels:g,selected_index:t})}}class Aa extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"settings",on_back(){W.next(e.data.on_back??te)}}),this.make(Zt,r.make(220,150),{name:"panel_bg_nine_slice",w:1480,h:910});let a=1e3/4,i=a*1.6,h=[this._make(st,r.make(2,2),{text:"general",w:i}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"solitaire",w:i}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"fourtimes",w:i}),this._make(st,r.make(2+(a+4)*3,2),{no_trans:!0,text:"octopus",w:i})],n;this.make(cs,r.make(600,8),{tabs:h,selected_index:t,on_selected_index(v){n.selected_index=v}});let _=this._make(De,r.make(0,0),{}),f=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(br,r.make(0,0),{});let p=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(De,r.make(0,0),{});let m=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(De,r.make(0,0),{});let c=this._make(Y,r.make(0,0),{w:1450,h:850,content:_}),g=[f,p,m,c];n=this.make(ds,r.make(220,180),{w:1050,h:850,panels:g,selected_index:t})}}class te extends x{_init(){this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let t=this.make(N,r.zero,{name:"main_title_bg"});t.scale=r.make(2,2),t=this.make(N,r.make(200,150),{name:"main_bg"});let e=this.make(pt,r.make(16,32),{text:"sofo",color:u.hex(2106417)});this.make(pt,r.make(16+e.width,32),{text:".demo",color:u.hex(11845300)});let a=200,i=320,h=this.make(N,r.make(a,250),{name:"main_card_bg"});h.play_now("solitaire"),this.make(B,r.make(a+120,350),{rect:w.make(0,0,220,500),on_hover(){h.play("solitaire_hover")},on_hover_end(){h.play("solitaire")},on_click(){W.next(ne)}});let n=this.make(pt,r.make(a+120+140,350+250),{text:"solitaire",center:!0,size:98});n.rotation=Math.PI/2;let _=this.make(N,r.make(a+i,250),{name:"main_card_bg"});_.play_now("fourtimes"),this.make(B,r.make(a+i+120,350),{rect:w.make(0,0,220,500),on_hover(){_.play("fourtimes_hover")},on_hover_end(){_.play("fourtimes")},on_click(){}});let f=this.make(pt,r.make(a+i+120+140,350+250),{text:"fourtimes",center:!0,size:82});f.rotation=Math.PI/2;let p=this.make(N,r.make(a+i*2,250),{name:"main_card_bg"});p.play_now("octopus"),this.make(B,r.make(a+i*2+120,350),{rect:w.make(0,0,220,500),on_hover(){p.play("octopus_hover")},on_hover_end(){p.play("octopus")},on_click(){}});let m=this.make(pt,r.make(a+i*2+120+140,350+250),{text:"octopus",center:!0,size:96});m.rotation=Math.PI/2;let c=180,g=200;this.make(ae,r.make(1300,g),{text:"how_to_play",on_click(){W.next(va)}}),this.make(ae,r.make(1300,g+c),{text:"statistics",on_click(){W.next(Ea)}}),this.make(ae,r.make(1300,g+c*2),{text:"settings",on_click(){W.next(Aa)}}),this.make(ae,r.make(1300,g+c*3),{text:"about",on_click(){W.next(ka)}})}}class Er extends x{constructor(){super(...arguments);o(this,"theme_target");o(this,"mask_target");o(this,"target");o(this,"target2");o(this,"mask");o(this,"current");o(this,"_next")}next(e,a=r.zero,i={}){this._next||(this._next=this._make(e,a,i),this.mask=this._make(ur,r.zero,{}))}_init(){this.target2=vt.create(E.width,E.height),this.target=vt.create(E.width,E.height),this.mask_target=vt.create(E.width,E.height),this.theme_target=vt.create(E.width,E.height),this.current=this._make(Ea,r.zero,{}),Dt.set_matrix(A.create_scale_v(E.v_screen)),Me.set_matrix(A.create_scale_v(E.v_screen))}_update(){var e,a,i;(e=this._next)==null||e.update(),this.current.update(),(a=this.mask)==null||a.update(),(i=this.mask)!=null&&i.done&&(this.current.dispose(),this.mask.dispose(),this.mask=void 0,this.current=this._next,this._next=void 0)}_draw(e){var a;this._next?(this.current.draw(e),e.render(this.target),e.clear(),this._next.draw(e),e.render(this.target2),e.clear(),this.mask_target.clear(u.hex(16711680)),(a=this.mask)==null||a.draw(e),e.render(this.mask_target),e.clear(),Dt.texture=this.target.texture(0),Dt.texture2=this.target2.texture(0),Dt.mask_texture=this.mask_target.texture(0),Dt.render(this.theme_target)):(this.current.draw(e),e.render(this.theme_target),e.clear()),Me.texture=this.theme_target.texture(0),Me.render()}}let W;const kt=class kt extends x{_init(){wt.default_sampler=bt.make(Vt.Linear),this.objects=[],V.load().then(()=>{}),Ut.load().then(()=>{rt.language=it.language,W=this.make(Er,r.zero,{})})}_update(){}_draw(){x.next_render_order=0,d.backbuffer.clear(u.black),this._draw_children(wt),oe._sort_hooks()}};o(kt,"width",1920),o(kt,"height",1080),o(kt,"v_screen",r.make(kt.width,kt.height));let E=kt;const Ar=s=>{let t=new E;d.run({name:"solitaire23",width:1920,height:1080,on_startup(){t.init()},on_update(){oe.update(),t.update()},on_render(){t.draw(wt)}}),d.canvas&&s.appendChild(d.canvas),oe.listen(s)};Ar(document.getElementById("app")); +Inside the joke teller’s guide to the galaxy.”`,fe=class fe{constructor(t){this.verses=t}one(){return ph(this.verses,Math.random)}};o(fe,"load",()=>{let t=fr.split(/\r?\n\r?\n/);return new fe(t)});let Ge=fe,Ns=Ge.load();class G extends x{constructor(){super(...arguments);o(this,"_color")}get data(){return this._data}set color(e){this._color=e}get color(){return this._color}set height(e){this.data.h=e}_init(){this.color=this.data.color??u.white}_draw(e){e.rect(w.make(this.position.x,this.position.y,this.data.w,this.data.h),this.color)}}class mr extends x{constructor(){super(...arguments);o(this,"poem_text");o(this,"_will_change_poem",!1);o(this,"life",0)}change_poem(){this._will_change_poem=!0}_init(){this.make(G,r.make(0,0),{w:E.width,h:E.height,color:u.hex(2236962)});let e=Ns.one();this.poem_text=this.make(R,r.make(1920/2,1080),{no_trans:!0,width:1e3,height:700,key:e,center:!0,color:u.hex(11845300)})}_update(){this.life+=S.delta,this.poem_text.position.y=900+Math.cos(this.life*.2)*400,this._will_change_poem&&this.poem_text.position.y>1100&&(this._will_change_poem=!1,this.poem_text.text=Ns.one()),S.on_interval(P.seconds*3)}}class B extends x{constructor(){super(...arguments);o(this,"_scaled_rect")}get data(){return this._data}get width(){return this._scaled_rect.w}get height(){return this._scaled_rect.h}get _rect(){return this.data.abs?w.make(this.position.x,this.position.y,this.width,this.height):this._scaled_rect}get rect(){let{p_scissor:e}=this;return e?this._rect.overlaps_rect(e):this._rect}_init(){this._scaled_rect=this.data.rect;let e=!1,a=!1,i=this;this.unbindable_input({on_click_begin(h,n){var m,c;if(n||!i.p_visible)return!1;let _=h.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_click_begin)==null?void 0:c.call(m))??!1:!1},on_drag(h,n){var _,f,p,m;if(h._right||!i.p_visible)return!1;if(e){let c=h.m.mul(E.v_screen);return((f=(_=i.data).on_drag)==null?void 0:f.call(_,c))??!1}if(h.m&&(!n||!n.m)){let c=h.e.mul(E.v_screen),g=w.make(c.x-4,c.y-4,8,8);return i.rect.overlaps(g)?(e=!0,((m=(p=i.data).on_drag_begin)==null?void 0:m.call(p,c))??!1):!1}return!1},on_up(h,n,_){var p,m,c,g,v,k,y,b,T,C;if(n||!i.p_visible)return!1;let f=h.mul(E.v_screen);if(e&&(e=!1,(m=(p=i.data).on_drag_end)==null||m.call(p,f)),(g=(c=i.data).on_up)==null||g.call(c,h,n),_){let U=_.mul(E.v_screen),I=w.make(U.x-4,U.y-4,8,8);I=((k=(v=i.data).get_drop_rect)==null?void 0:k.call(v,U))??I;let H=i.rect;(b=(y=i.data).get_drop_rect)!=null&&b.call(y,U)&&console.log(H,I,H.overlaps(I)),H.overlaps(I)&&((C=(T=i.data).on_drop)==null||C.call(T,_))}return!1},on_hover(h){var p,m,c,g;if(!i.data.on_hover||!i.p_visible)return!1;let n=h.mul(E.v_screen),_=w.make(n.x-4,n.y-4,8,8);if(i.rect.overlaps(_)){if(!a)return a=!0,((m=(p=i.data).on_hover)==null?void 0:m.call(p))??!1}else a&&(a=!1,(g=(c=i.data).on_hover_end)==null||g.call(c));return a},on_hover_clear(){var h,n;return i.data.on_hover_end?a?(a=!1,(n=(h=i.data).on_hover_end)==null?void 0:n.call(h)):(i.p_visible,!1):!1},on_click(h,n){var m,c;if(!i.p_visible)return!1;let _=h.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_click)==null?void 0:c.call(m))??!1:!1},on_wheel(h,n){var m,c;if(!i.p_visible)return!1;let _=n.mul(E.v_screen),f=w.make(_.x-4,_.y-4,8,8);return i.rect.overlaps(f)?((c=(m=i.data).on_wheel)==null?void 0:c.call(m,h))??!1:!1}})}_draw(){wt.push_matrix(A.create_translation(this.position)),this.g_position=r.transform(r.zero,wt.m_matrix),this._scaled_rect=w.transform(this.data.rect,wt.m_matrix),this.data.debug&&wt.rect(w.make(0,0,this.width,this.height),u.hex(65280)),wt.pop_matrix()}}class ka extends x{get data(){return this._data}_init(){this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let t=this;this.make(Te,r.zero,{key:"about",on_back(){W.next(t.data.on_back??Dt)}});let e=1880,a=940;this.make(te,r.make(20,120),{name:"panel_bg_nine_slice",w:e,h:a});let i=this._make(zt,r.make(0,0),{width:1880-100,content:rt.key2("about")});this.make(Y,r.make(60,160),{w:e-100,h:a-80,content:i})}}const me=class me extends x{constructor(){super(...arguments);o(this,"height")}get data(){return this._data}_init(){let e=60,a=this._make(pt,r.zero,{size:e,text:" "}),i=a.width,h=a.height,n=0,_=0;this.data.content.trim().split(` +`).forEach(f=>{me.parse(f).forEach(p=>{let m;p.link?m=this.make(gr,r.zero,{size:e,text:p.text,color:sh,on_click(){window.open(p.link,"_blank")}}):m=this.make(pt,r.zero,{size:e,text:p.text}),n+m.width>this.data.width&&(n=0,_+=m.height),m.position=r.make(n,_),n+=m.width+i}),n=0,_+=h}),this.height=_+h}};o(me,"parse",e=>{let a=/\[([^\]]*)\]\"([^\"]*)\"/g,i=0,h=[],n;for(;(n=a.exec(e))!==null;){let[_,f,p]=n,m=n.index,c=m+_.length;m>i&&e.slice(i,m).split(" ").filter(g=>!!g).forEach(g=>h.push({text:g})),h.push({text:f,link:p}),i=c}return i!!_).forEach(_=>h.push({text:_})),h});let zt=me;class cs extends x{constructor(){super(...arguments);o(this,"_selected_index")}get data(){return this._data}on_click(e){this.selected_index=this.data.tabs.indexOf(e)}get selected_index(){return this._selected_index}set selected_index(e){this._selected_index=e,this.data.tabs.forEach((a,i)=>a.set_active(e===i)),this.data.on_selected_index(e)}_init(){this._selected_index=this.data.selected_index,this.data.tabs.forEach((i,h)=>i.set_active(this._selected_index===h));let e=this.data.tabs.length===4?.63:1,a=this.data.tabs.reduce((i,h)=>i+h.width*e,0);this.make(G,r.make(10,130),{w:a,h:10,color:u.hex(1052737)}),this.data.tabs.forEach(i=>i.parent=this),this.data.tabs.forEach(i=>{this.data.tabs.length===4&&(i.scale=r.one.scale(.6),i.position.y+=50)})}_update(){this.data.tabs.forEach(e=>e.update())}_draw(e){e.push_matrix(A.create_translation(this.position)),this._draw_children(e),this.data.tabs.forEach(a=>a.draw(e)),e.pop_matrix()}_dispose(){this.data.tabs.forEach(e=>e.dispose())}}class R extends x{constructor(){super(...arguments);o(this,"_text");o(this,"_text_view");o(this,"dispose_trans")}get data(){return this._data}set color(e){this._text_view.color=e}get height(){return this._text_view.height}set text(e){this._text=e,this._text_view.text=this.text,this._text_view.size=this.size}get text(){return this.data.no_trans?this._text:rt.key(this._text)}get size(){let e=Ut.sp_font.width_of(this.text),a=128,i=a*this.data.width/e,h=Ut.sp_font.height_of(this.text),n=a*this.data.height/h;return Math.min(i,n)}_init(){let e=this.data.center,a=this.data.color;this._text=this.data.key,this._text_view=this.make(pt,r.make(0,0),{size:this.size,text:this.text,center:e,color:a}),this.data.no_trans||(this.dispose_trans=rt.register(()=>{this._text_view.text=rt.key(this._text),this._text_view.size=this.size}))}_dispose(){var e;(e=this.dispose_trans)==null||e.call(this)}}class pt extends x{constructor(){super(...arguments);o(this,"_color");o(this,"_size")}get data(){return this._data}get justify(){return this.data.center?r.make(0,0):r.zero}get color(){return this._color}set color(e){this._color=e}get text(){return this.data.text}set text(e){this.data.text=e}get size(){return this._size}set size(e){this._size=e}get width(){return this.font.width_of(this.text)/this.font.size*this.size}get height(){return this.font.height_of(this.text)/this.font.size*this.size}_init(){this.color=this.data.color??u.white,this._size=this.data.size??128,this.rotation=this.data.rotation??0,this.origin=this.data.center?r.make(this.width/2,0):r.zero}_draw(e){e.push_matrix(A.create_transform(this.position,this.origin,r.one,this.rotation)),this.g_position=r.transform(r.zero,e.m_matrix),e.str_j(this.font,this.text,r.zero,this.justify,this.size,this.color),e.pop_matrix()}}class gr extends x{constructor(){super(...arguments);o(this,"text_view")}get data(){return this._data}set color(e){this.text_view.color=e}get width(){return this.text_view.width}get height(){return this.text_view.height}_init(){this.text_view=this.make(pt,r.zero,this.data);let e=this;this.make(B,r.make(0,-this.text_view.height/3),{rect:w.make(0,0,this.text_view.width,this.text_view.height),on_hover(){e.color=u.red},on_hover_end(){e.color=e.data.color??u.white},on_click(){e.data.on_click()}})}}class st extends x{constructor(){super(...arguments);o(this,"_active");o(this,"anim")}get data(){return this._data}get width(){return this.data.w}get height(){return 32+64}set_active(e){this._active=e,e?this.anim.play("active"):this.anim.play("idle")}_init(){let e=this.make(N,r.zero,{name:"tab3_bg"});this.anim=e,this.make(R,r.make(this.width/2,this.height/2),{no_trans:this.data.no_trans,width:this.width-80,height:this.height,key:this.data.text,center:!0});let a=this;this.make(B,r.make(32,32),{rect:w.make(0,0,360,90),on_hover(){a._active||e.play("hover")},on_hover_end(){e.play(a._active?"active":"idle")},on_click(){a.parent.on_click(a)}})}}class ds extends x{constructor(){super(...arguments);o(this,"_selected_index")}get data(){return this._data}get selected_index(){return this._selected_index}set selected_index(e){this._selected_index=e,this.data.panels.forEach((a,i)=>a.visible=e===i)}get active_panel(){return this.data.panels[this.selected_index]}_init(){this.selected_index=this.data.selected_index}_update(){this.active_panel.update()}_draw(e){e.push_matrix(A.create_translation(this.position)),this._draw_children(e),this.active_panel.draw(e),e.pop_matrix()}_dispose(){this.data.panels.forEach(e=>e.dispose())}}class Y extends x{constructor(){super(...arguments);o(this,"scroll_y");o(this,"scroll_off");o(this,"scroll_edge_off");o(this,"target_scroll_y");o(this,"thumb");o(this,"content_base_position")}get data(){return this._data}get content(){return this.data.content}get width(){return this.data.w}get height(){return this.data.h}_init(){this.data.content.parent=this,this.content_base_position=r.copy(this.data.content.position),this.scroll_y=0,this.scroll_off=0,this.scroll_edge_off=0,this.target_scroll_y=0,this.make(G,r.make(this.data.w-20-8,8),{w:20,h:this.data.h-16,color:u.black});let e=this.height*(this.height/this.content.height);this.thumb=this._make(G,r.make(this.data.w-20-8+4,8+4),{w:20-8,h:e,color:u.white});let a,i=this;this.make(B,r.zero,{rect:w.make(0,0,this.width,this.height),on_drag_begin(h){var n,_;return(_=(n=i.data).on_scroll)==null||_.call(n),a=h,!0},on_drag(h){return i.scroll_off=h.y-a.y,!0},on_up(h,n){if(i.scroll_y+=i.scroll_off,i.scroll_off=0,i.target_scroll_y=i.scroll_y,i.scroll_y>0)i.scroll_edge_off=i.scroll_y,i.scroll_y=0;else{let _=-i.content.height+i.data.h;i.content.height{this.t=e},P.half,0,()=>{this._t=void 0})}get done(){return!this._t}_draw(e){e.push_matrix(A.create_transform(r.make(this.t,E.height/2),r.make(160,90),r.make(13,13),Math.PI*.25)),e.rect(w.make(0,0,320,180),u.hex(65280)),e.pop_matrix(),e.push_matrix(A.create_transform(r.make(this.t-1820,E.height/2),r.make(80,10),r.make(13,13),Math.PI*.25)),e.rect(w.make(0,0,160,10),u.hex(0)),e.pop_matrix()}}class ae extends x{get data(){return this._data}_init(){let t=this.make(N,r.zero,{name:"main_settings_bg"});this.make(R,r.make(320,86),{key:this.data.text,center:!0,width:400,height:100,color:u.black});let e=this.make(R,r.make(320,86),{key:this.data.text,center:!0,width:400,height:100}),a=e.position.y,i=this;this.make(B,r.make(100,50),{rect:w.make(0,0,440,120),on_hover(){t.play("hover"),i.tween([e.position.y,a-2],h=>{e.position.y=h},P.lengths)},on_hover_end(){t.play("idle"),i.tween([e.position.y,a+2],h=>{e.position.y=h},P.lengths)},on_click(){i.data.on_click()}})}}class ur extends x{get data(){return this._data}_init(){let t=this.make(N,r.zero,{name:this.data.name}),e=this;this.make(B,r.make(this.data.rect.x,this.data.rect.y),{debug:this.data.debug,rect:w.make(0,0,this.data.rect.w,this.data.rect.h),on_hover(){t.play("hover")},on_hover_end(){t.play("idle")},on_click(){e.data.on_click()}})}}class Te extends x{get data(){return this._data}_init(){let t=this;this.make(ur,r.zero,{name:"navigation_bg",rect:w.make(30,30,540,100),on_click(){t.data.on_back()}}),this.make(R,r.make(112,54),{key:this.data.key,width:400,height:96})}}class va extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"how_to_play",on_back(){W.next(e.data.on_back??Dt)}}),this.make(te,r.make(20,180),{name:"panel_bg_nine_slice",w:1860,h:860});let a=410,i=[this._make(st,r.make(2,2),{no_trans:!0,text:"solitaire",w:a}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"fourtimes",w:a}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"octopus",w:a})],h=40,n=780,_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("solitaire")}),f=this._make(Y,r.make(20,h),{w:1800,h:n,content:_});_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("fourtimes")});let p=this._make(Y,r.make(20,h),{w:1800,h:n,content:_});_=this._make(zt,r.make(0,0),{width:1800-80,content:rt.key2("octopus")});let m=this._make(Y,r.make(20,h),{w:1800,h:n,content:_}),c=[f,p,m],g=this.make(ds,r.make(20,180),{w:1860,h:860,panels:c,selected_index:t});this.make(cs,r.make(600,8),{tabs:i,selected_index:t,on_selected_index(v){g.selected_index=v}})}}class wr extends x{constructor(){super(...arguments);o(this,"box");o(this,"selected_text")}get data(){return this._data}set selected_index(e){this.box.selected_index=e,this.selected_text.text=this.data.items[e]}_init(){let e=this.make(N,r.zero,{name:"dropdown_bg"});this.selected_text=this.make(R,r.make(32,60),{no_trans:this.data.no_trans,key:this.data.items[this.data.selected_index],width:250,height:100});let a=this;this.make(B,r.make(0,0),{abs:!0,rect:w.make(0,0,1920,1080),on_click(){let i=a.box.visible;return a.box.visible=!1,i},on_drag_begin(){return a.box.visible=!1,!1}}),this.make(B,r.make(16,32),{rect:w.make(0,0,480,112),on_hover(){e.play("hover")},on_hover_end(){e.play("idle")},on_click(){return a.box.visible?!1:(a.box.visible=!0,!0)}})}}class ba extends x{constructor(){super(...arguments);o(this,"dropdown_list")}get data(){return this._data}set selected_index(e){this.dropdown_list.selected_index=e}_init(){let e=this.make(G,r.make(0,0),{w:500,h:500,color:u.hex(3233172)}),a=this,i=this._make(xr,r.make(0,0),{no_trans:this.data.no_trans,items:this.data.items,selected_index:this.data.selected_index,on_selected(h){a.data.on_selected(h)}});e.height=Math.min(500,i.height),this.dropdown_list=i,this.make(Y,r.make(0,0),{w:500,h:Math.min(500,i.height),content:i})}}class xr extends x{constructor(){super(...arguments);o(this,"height");o(this,"_selected_index");o(this,"items")}get data(){return this._data}set selected_index(e){this._selected_index=e,this._color_items(),this.data.on_selected(e)}get selected_index(){return this._selected_index}_init(){let e=140,a=0,i=this;this.items=this.data.items.map((h,n)=>{let _=this.make(kr,r.make(0,a),{no_trans:this.data.no_trans,item:h,on_selected(){i.selected_index=n}});return a+=e,_}),this.height=a+30,this._selected_index=this.data.selected_index}_color_items(){this.items.forEach((e,a)=>{e.selected=this.selected_index===a})}}class kr extends x{constructor(){super(...arguments);o(this,"bg");o(this,"text")}get data(){return this._data}set selected(e){e?(this.bg.color=u.white,this.text.color=u.hex(3233172)):(this.text.color=u.white,this.bg.color=u.hex(3233172))}_init(){this.bg=this.make(G,r.make(-40,-30),{w:470,h:140,color:u.hex(3233172)}),this.text=this.make(R,r.make(0,0),{no_trans:this.data.no_trans,width:340,height:140,key:this.data.item});let e=this;this.make(B,r.make(-40,-30),{rect:w.make(0,0,470,140),on_click(){return e.data.on_selected(),!0}})}}class vr extends x{constructor(){super(...arguments);o(this,"height")}_init(){this.make(R,r.make(280,20),{key:"solitaire_settings",width:820,height:200});let e=220,a=this.make(Wt,r.make(40,e),{name:"turning_cards",items:["three_cards","one_card"],selected_index:Ms.indexOf(jt.cards),on_selected(h){jt.cards=Ms[h]}}),i=this.make(Wt,r.make(40,e*2),{name:"turning_limit",items:["no_limit","three_passes","one_pass"],selected_index:Ss.indexOf(jt.limit),on_selected(h){jt.limit=Ss[h]}});this.make_box(a),this.make_box(i),this.height=e*3+500}make_box(e,a){let i=this.make(ba,r.make(e.position.x+e.dropdown.position.x,e.position.y+e.dropdown.position.y+160),{no_trans:a,items:e.data.items,selected_index:e.data.selected_index,on_selected(h){i.visible=!1,e.dropdown.data.on_selected(h),e.dropdown.selected_text.text=e.data.items[h]}});e.dropdown.box=i,i.visible=!1}}class De extends x{constructor(){super(...arguments);o(this,"height")}_init(){this.make(R,r.make(280,20),{key:"general_settings",width:820,height:200});let e=220,a=this.make(Wt,r.make(40,e*1),{no_trans:!0,name:"language",items:Xt.map(f=>rt.lang_key(f)),selected_index:Xt.indexOf(it.language),on_selected(f){rt.language=Xt[f],it.language=Xt[f]}}),i=["on","off"],h=this.make(Wt,r.make(40,e*2),{name:"sounds",items:["on","off"],selected_index:it.sound?0:1,on_selected(f){it.sound=i[f]==="on"}}),n=["on","off"],_=this.make(Wt,r.make(40,e*3),{name:"music",items:["on","off"],selected_index:it.music?0:1,on_selected(f){it.music=n[f]==="on",it.music||V.stop_music()}});this.make_box(a,!0),this.make_box(h),this.make_box(_),this.height=e*3+500}make_box(e,a){let i=this.make(ba,r.make(e.position.x+e.dropdown.position.x,e.position.y+e.dropdown.position.y+160),{no_trans:a,items:e.data.items,selected_index:e.data.selected_index,on_selected(h){i.visible=!1,e.dropdown.data.on_selected(h),e.dropdown.selected_text.text=e.data.items[h]}});e.dropdown.box=i,i.visible=!1}}class Wt extends x{constructor(){super(...arguments);o(this,"dropdown")}get data(){return this._data}_init(){this.make(G,r.make(0,0),{w:1300,h:200,color:u.hex(2106433)}),this.make(R,r.make(50,60),{key:this.data.name,width:420,height:200});let e=this;this.dropdown=this.make(wr,r.make(720,8),{no_trans:this.data.no_trans,items:this.data.items,selected_index:this.data.selected_index,on_selected(a){e.data.on_selected(a)}})}}class Pe extends x{constructor(){super(...arguments);o(this,"height");o(this,"table_view")}_init(){this.make(R,r.make(700,0),{key:"overall_statistics",width:820,height:200,center:!0});let e=this;this.make(ss,r.make(700,1600),{text:"clear_statistics",on_click(){Nt.clear_results(),e._load_results()}}),this.height=2e3,this._load_results()}_load_results(){var a;(a=this.table_view)==null||a.dispose();let e=new hh(Nt.results,new Ot([]),new Ot([]));this.table_view=this.make(Ta,r.make(0,0),{total_played:e.total_played,total_wins:e.total_wins,top_5_highscores:e.top_5_highscores.map(i=>i.multiplied_score)})}}class Ta extends x{get data(){return this._data}_init(){let{total_played:t,total_wins:e,top_5_highscores:a}=this.data,i=100;this.make(R,r.make(700,200),{key:`total_games_played%${t}%`,width:820,height:200,center:!0}),this.make(R,r.make(700,200+i*1.2),{key:`games_won%${e}%`,width:820,height:200,center:!0}),this.make(R,r.make(700,200+i*3),{key:"top5_highscores",width:820,height:200,center:!0}),a.forEach((n,_)=>{this.make(R,r.make(200,200+i*4+i*_*1.5+80),{key:`${_+1}.`,width:80,height:100,no_trans:!0}),this.make(R,r.make(700,200+i*4+i*_*1.5+80),{key:`${n}`,width:80,height:100,no_trans:!0,center:!0}),this.make(G,r.make(200,100+200+i*4+i*_*1.5+80),{w:1e3,h:20,color:u.white})})}}class br extends x{constructor(){super(...arguments);o(this,"height");o(this,"table_view")}_init(){this.make(R,r.make(700,0),{key:"solitaire_statistics",width:820,height:200,center:!0});let e=this;this.make(ss,r.make(700,1600),{text:"clear_statistics",on_click(){Nt.clear_results(),e._load_results()}}),this.height=2e3,this._load_results()}_load_results(){var a;(a=this.table_view)==null||a.dispose();let e=Nt.results;this.table_view=this.make(Ta,r.make(0,0),{total_played:e.total_played,total_wins:e.total_wins,top_5_highscores:e.top_5_highscores.map(i=>i.multiplied_score)})}}class Tr extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"statistics",on_back(){W.next(e.data.on_back??Dt)}}),this.make(te,r.make(220,150),{name:"panel_bg_nine_slice",w:1480,h:910});let a=1e3/4,i=a*1.6,h=[this._make(st,r.make(2,2),{text:"overall",w:i}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"solitaire",w:i}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"fourtimes",w:i}),this._make(st,r.make(2+(a+4)*3,2),{no_trans:!0,text:"octopus",w:i})],n;this.make(cs,r.make(600,8),{tabs:h,selected_index:t,on_selected_index(v){n.selected_index=v}});let _=this._make(Pe,r.make(0,0),{}),f=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(br,r.make(0,0),{});let p=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(Pe,r.make(0,0),{});let m=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(Pe,r.make(0,0),{});let c=this._make(Y,r.make(0,0),{w:1450,h:850,content:_}),g=[f,p,m,c];n=this.make(ds,r.make(220,180),{w:1050,h:850,panels:g,selected_index:t})}}class Ea extends x{get data(){return this._data}_init(){let t=this.data.selected_index??0;this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let e=this;this.make(Te,r.zero,{key:"settings",on_back(){W.next(e.data.on_back??Dt)}}),this.make(te,r.make(220,150),{name:"panel_bg_nine_slice",w:1480,h:910});let a=1e3/4,i=a*1.6,h=[this._make(st,r.make(2,2),{text:"general",w:i}),this._make(st,r.make(2+a+4,2),{no_trans:!0,text:"solitaire",w:i}),this._make(st,r.make(2+(a+4)*2,2),{no_trans:!0,text:"fourtimes",w:i}),this._make(st,r.make(2+(a+4)*3,2),{no_trans:!0,text:"octopus",w:i})],n;this.make(cs,r.make(600,8),{tabs:h,selected_index:t,on_selected_index(v){n.selected_index=v}});let _=this._make(De,r.make(0,0),{}),f=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(vr,r.make(0,0),{});let p=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(De,r.make(0,0),{});let m=this._make(Y,r.make(0,0),{w:1450,h:850,content:_});_=this._make(De,r.make(0,0),{});let c=this._make(Y,r.make(0,0),{w:1450,h:850,content:_}),g=[f,p,m,c];n=this.make(ds,r.make(220,180),{w:1050,h:850,panels:g,selected_index:t})}}class Dt extends x{_init(){this.make(G,r.zero,{w:1920,h:1080,color:u.hex(11845300)});let t=this.make(N,r.zero,{name:"main_title_bg"});t.scale=r.make(2,2),t=this.make(N,r.make(200,150),{name:"main_bg"});let e=this.make(pt,r.make(16,32),{text:"sofo",color:u.hex(2106417)});this.make(pt,r.make(16+e.width,32),{text:".demo",color:u.hex(11845300)});let a=200,i=320,h=this.make(N,r.make(a,250),{name:"main_card_bg"});h.play_now("solitaire"),this.make(B,r.make(a+120,350),{rect:w.make(0,0,220,500),on_hover(){h.play("solitaire_hover")},on_hover_end(){h.play("solitaire")},on_click(){W.next(ne)}});let n=this.make(pt,r.make(a+120+140,350+250),{text:"solitaire",center:!0,size:98});n.rotation=Math.PI/2;let _=this.make(N,r.make(a+i,250),{name:"main_card_bg"});_.play_now("fourtimes"),this.make(B,r.make(a+i+120,350),{rect:w.make(0,0,220,500),on_hover(){_.play("fourtimes_hover")},on_hover_end(){_.play("fourtimes")},on_click(){}});let f=this.make(pt,r.make(a+i+120+140,350+250),{text:"fourtimes",center:!0,size:82});f.rotation=Math.PI/2;let p=this.make(N,r.make(a+i*2,250),{name:"main_card_bg"});p.play_now("octopus"),this.make(B,r.make(a+i*2+120,350),{rect:w.make(0,0,220,500),on_hover(){p.play("octopus_hover")},on_hover_end(){p.play("octopus")},on_click(){}});let m=this.make(pt,r.make(a+i*2+120+140,350+250),{text:"octopus",center:!0,size:96});m.rotation=Math.PI/2;let c=180,g=200;this.make(ae,r.make(1300,g),{text:"how_to_play",on_click(){W.next(va)}}),this.make(ae,r.make(1300,g+c),{text:"statistics",on_click(){W.next(Tr)}}),this.make(ae,r.make(1300,g+c*2),{text:"settings",on_click(){W.next(Ea)}}),this.make(ae,r.make(1300,g+c*3),{text:"about",on_click(){W.next(ka)}})}}class Er extends x{constructor(){super(...arguments);o(this,"theme_target");o(this,"mask_target");o(this,"target");o(this,"target2");o(this,"mask");o(this,"current");o(this,"_next")}next(e,a=r.zero,i={}){this._next||(this._next=this._make(e,a,i),this.mask=this._make(yr,r.zero,{}))}_init(){this.target2=vt.create(E.width,E.height),this.target=vt.create(E.width,E.height),this.mask_target=vt.create(E.width,E.height),this.theme_target=vt.create(E.width,E.height),this.current=this._make(Dt,r.zero,{}),Pt.set_matrix(A.create_scale_v(E.v_screen)),Me.set_matrix(A.create_scale_v(E.v_screen))}_update(){var e,a,i;(e=this._next)==null||e.update(),this.current.update(),(a=this.mask)==null||a.update(),(i=this.mask)!=null&&i.done&&(this.current.dispose(),this.mask.dispose(),this.mask=void 0,this.current=this._next,this._next=void 0)}_draw(e){var a;this._next?(this.current.draw(e),e.render(this.target),e.clear(),this._next.draw(e),e.render(this.target2),e.clear(),this.mask_target.clear(u.hex(16711680)),(a=this.mask)==null||a.draw(e),e.render(this.mask_target),e.clear(),Pt.texture=this.target.texture(0),Pt.texture2=this.target2.texture(0),Pt.mask_texture=this.mask_target.texture(0),Pt.render(this.theme_target)):(this.current.draw(e),e.render(this.theme_target),e.clear()),Me.texture=this.theme_target.texture(0),Me.render()}}let W;const kt=class kt extends x{_init(){wt.default_sampler=bt.make(Kt.Linear),this.objects=[],V.load().then(()=>{}),Ut.load().then(()=>{rt.language=it.language,W=this.make(Er,r.zero,{})})}_update(){}_draw(){x.next_render_order=0,d.backbuffer.clear(u.black),this._draw_children(wt),oe._sort_hooks()}};o(kt,"width",1920),o(kt,"height",1080),o(kt,"v_screen",r.make(kt.width,kt.height));let E=kt;const Ar=s=>{let t=new E;d.run({name:"solitaire23",width:1920,height:1080,on_startup(){t.init()},on_update(){oe.update(),t.update()},on_render(){t.draw(wt)}}),d.canvas&&s.appendChild(d.canvas),oe.listen(s)};Ar(document.getElementById("app")); diff --git a/index.html b/index.html index 1461817..25c3a67 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@ } - +
diff --git a/sw.js b/sw.js index a747921..24d8cbe 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,t)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const d=e=>i(e,r),f={module:{uri:r},exports:o,require:d};s[r]=Promise.all(n.map((e=>f[e]||d(e)))).then((e=>(t(...e),o)))}}define(["./workbox-cd63daf5"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-575aad9a.js",revision:null},{url:"index.html",revision:"14a0d89b80806d00a73605fb69b14626"},{url:"images/touch/homescreen192.png",revision:"48f136f03e7dc851daa21d13136f7521"},{url:"manifest.webmanifest",revision:"0d8a266cfe5f72753fad66c529a635ab"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(n,t)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const f=e=>i(e,r),d={module:{uri:r},exports:o,require:f};s[r]=Promise.all(n.map((e=>d[e]||f(e)))).then((e=>(t(...e),o)))}}define(["./workbox-cd63daf5"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-d98b88af.js",revision:null},{url:"index.html",revision:"9f9f7a27997e3078e280b6ac835328b0"},{url:"images/touch/homescreen192.png",revision:"48f136f03e7dc851daa21d13136f7521"},{url:"manifest.webmanifest",revision:"0d8a266cfe5f72753fad66c529a635ab"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));