var kr=Object.defineProperty;var Yt=Object.getOwnPropertySymbols;var xr=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable;var Wt=(n,e,t)=>e in n?kr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Gt=(n,e)=>{for(var t in e||(e={}))xr.call(e,t)&&Wt(n,t,e[t]);if(Yt)for(var t of Yt(e))Pr.call(e,t)&&Wt(n,t,e[t]);return n};import{S as ct,i as ut,s as ft,e as g,k as z,c as v,a as _,m as F,d as f,b as u,g as ce,J as i,K as Ve,L as Ae,n as Ge,M as xt,t as K,h as Z,N as at,O as st,P as Sr,x as qe,y as ht,z as Xe,o as Ke,p as we,C as Ze,q as Je,r as fe,Q as Pt,R as Oe,T as ze,l as lt,j as Qe,U as wr,w as _r,V as br,W as kt,f as We,X as Ar,Y as Tr}from"../chunks/index-7118b6c4.js";import{_ as Re,b as qt}from"../chunks/preload-helper-fca94356.js";var be=(n=>(n.INITIAL="",n.CORRECT="correct",n.PRESENT="present",n.ABSENT="absent",n))(be||{}),ye=(n=>(n[n.PLAYING=0]="PLAYING",n[n.SUCESS=1]="SUCESS",n[n.FAIL=2]="FAIL",n))(ye||{});function Ir(n,e){const t=[...n],r=t[e];for(const a of[...r].reverse())if(a.letter){a.letter="";break}return t}function jr(n,e,t){const r=[...n],a=r[e];for(const s of a)if(s.correct===" "&&(s.letter=" "),!s.letter){s.letter=t;break}return r}const Xt={[be.CORRECT]:"#00b81a",[be.PRESENT]:"#ffc80a",[be.ABSENT]:"#d9d9d9",[be.INITIAL]:"#5d5d5d"},ot={2:"two",5:"five",10:"ten",15:"fifteen",20:"twenty",35:"thirtyfive",50:"fifty"},Rr=["\u{1F917} Hugging \u{1F917}","\u{1F9DE} Genius \u{1F9DE}","\u{1F929} Magnificent \u{1F929}","\u{1F632} Impressive \u{1F632}","\u{1F9DA} Splendid \u{1F9DA}","\u2733 Great \u2733","\u{1F361} Phew \u{1F361}"];function Kt(n,e,t){const r=n.slice();return r[4]=e[t],r[6]=t,r}function Zt(n,e,t){const r=n.slice();return r[7]=e[t],r}function Dr(n){let e;return{c(){e=g("div"),this.h()},l(t){e=v(t,"DIV",{class:!0}),_(e).forEach(f),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){ce(t,e,r)},d(t){t&&f(e)}}}function Lr(n){let e,t=n[7]+"",r;return{c(){e=g("span"),r=K(t)},l(a){e=v(a,"SPAN",{});var s=_(e);r=Z(s,t),s.forEach(f)},m(a,s){ce(a,e,s),i(e,r)},p:Ge,d(a){a&&f(e)}}}function Cr(n){let e,t;return{c(){e=at("svg"),t=at("path"),this.h()},l(r){e=st(r,"svg",{xmlns:!0,height:!0,viewBox:!0,width:!0});var a=_(e);t=st(a,"path",{fill:!0,d:!0}),_(t).forEach(f),a.forEach(f),this.h()},h(){u(t,"fill","currentColor"),u(t,"d","M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14zm-11.59-2L14 13.41 17.59 17 19 15.59 15.41 12 19 8.41 17.59 7 14 10.59 10.41 7 9 8.41 12.59 12 9 15.59z"),u(e,"xmlns","http://www.w3.org/2000/svg"),u(e,"height","24"),u(e,"viewBox","0 0 24 24"),u(e,"width","24")},m(r,a){ce(r,e,a),i(e,t)},p:Ge,d(r){r&&f(e)}}}function Jt(n){let e,t,r,a;function s(w,I){return w[7]==="Backspace"?Cr:Lr}let o=s(n)(n);function c(){return n[3](n[7])}return{c(){e=g("button"),o.c(),this.h()},l(w){e=v(w,"BUTTON",{class:!0});var I=_(e);o.l(I),I.forEach(f),this.h()},h(){u(e,"class",t=(n[0][n[7]]===void 0?"":n[0][n[7]])+" "+(n[7].length>1&&"big")+" svelte-2ngxdh")},m(w,I){ce(w,e,I),o.m(e,null),r||(a=Ve(e,"click",c),r=!0)},p(w,I){n=w,o.p(n,I),I&1&&t!==(t=(n[0][n[7]]===void 0?"":n[0][n[7]])+" "+(n[7].length>1&&"big")+" svelte-2ngxdh")&&u(e,"class",t)},d(w){w&&f(e),o.d(),r=!1,a()}}}function Nr(n){let e;return{c(){e=g("div"),this.h()},l(t){e=v(t,"DIV",{class:!0}),_(e).forEach(f),this.h()},h(){u(e,"class","spacer svelte-2ngxdh")},m(t,r){ce(t,e,r)},d(t){t&&f(e)}}}function Qt(n){let e,t,r,a,s=n[6]===1&&Dr(),l=n[4],o=[];for(let w=0;wa("keyup",o);return n.$$set=o=>{"letterStates"in o&&t(0,r=o.letterStates)},[r,a,s,l]}class Vr extends ct{constructor(e){super(),ut(this,e,Br,Ur,ft,{letterStates:0})}}function Or(n){const e=n-1;return e*e*e+1}function it(n,{delay:e=0,duration:t=400,easing:r=Sr}={}){const a=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:r,css:s=>`opacity: ${s*a}`}}function $t(n,{delay:e=0,duration:t=400,easing:r=Or,start:a=0,opacity:s=0}={}){const l=getComputedStyle(n),o=+l.opacity,c=l.transform==="none"?"":l.transform,w=1-a,I=o*(1-s);return{delay:e,duration:t,easing:r,css:(j,O)=>` transform: ${c} scale(${1-w*O}); opacity: ${o-I*O} `}}var yr={exports:{}};(function(n){(function(e){var t=ae(),r=pe(),a=D(),s=$(),l={imagePlaceholder:void 0,cacheBust:!1},o={toSvg:c,toPng:I,toJpeg:j,toBlob:O,toPixelData:w,impl:{fontFaces:a,images:s,util:t,inliner:r,options:{}}};n.exports=o;function c(h,p){return p=p||{},U(p),Promise.resolve(h).then(function(E){return Y(E,p.filter,!0)}).then(J).then(oe).then(A).then(function(E){return Q(E,p.width||t.width(h),p.height||t.height(h))});function A(E){return p.bgcolor&&(E.style.backgroundColor=p.bgcolor),p.width&&(E.style.width=p.width+"px"),p.height&&(E.style.height=p.height+"px"),p.style&&Object.keys(p.style).forEach(function(x){E.style[x]=p.style[x]}),E}}function w(h,p){return B(h,p||{}).then(function(A){return A.getContext("2d").getImageData(0,0,t.width(h),t.height(h)).data})}function I(h,p){return B(h,p||{}).then(function(A){return A.toDataURL()})}function j(h,p){return p=p||{},B(h,p).then(function(A){return A.toDataURL("image/jpeg",p.quality||1)})}function O(h,p){return B(h,p||{}).then(t.canvasToBlob)}function U(h){typeof h.imagePlaceholder=="undefined"?o.impl.options.imagePlaceholder=l.imagePlaceholder:o.impl.options.imagePlaceholder=h.imagePlaceholder,typeof h.cacheBust=="undefined"?o.impl.options.cacheBust=l.cacheBust:o.impl.options.cacheBust=h.cacheBust}function B(h,p){return c(h,p).then(t.makeImage).then(t.delay(100)).then(function(E){var x=A(h);return x.getContext("2d").drawImage(E,0,0),x});function A(E){var x=document.createElement("canvas");if(x.width=p.width||t.width(E),x.height=p.height||t.height(E),p.bgcolor){var S=x.getContext("2d");S.fillStyle=p.bgcolor,S.fillRect(0,0,x.width,x.height)}return x}}function Y(h,p,A){if(!A&&p&&!p(h))return Promise.resolve();return Promise.resolve(h).then(E).then(function(k){return x(h,k,p)}).then(function(k){return S(h,k)});function E(k){return k instanceof HTMLCanvasElement?t.makeImage(k.toDataURL()):k.cloneNode(!1)}function x(k,d,M){var T=k.childNodes;if(T.length===0)return Promise.resolve(d);return C(d,t.asArray(T),M).then(function(){return d});function C(b,G,N){var y=Promise.resolve();return G.forEach(function(W){y=y.then(function(){return Y(W,N)}).then(function(P){P&&b.appendChild(P)})}),y}}function S(k,d){if(!(d instanceof Element))return d;return Promise.resolve().then(M).then(T).then(C).then(b).then(function(){return d});function M(){G(window.getComputedStyle(k),d.style);function G(N,y){N.cssText?y.cssText=N.cssText:W(N,y);function W(P,ee){t.asArray(P).forEach(function(m){ee.setProperty(m,P.getPropertyValue(m),P.getPropertyPriority(m))})}}}function T(){[":before",":after"].forEach(function(N){G(N)});function G(N){var y=window.getComputedStyle(k,N),W=y.getPropertyValue("content");if(W===""||W==="none")return;var P=t.uid();d.className=d.className+" "+P;var ee=document.createElement("style");ee.appendChild(m(P,N,y)),d.appendChild(ee);function m(L,H,V){var re="."+L+":"+H,ie=V.cssText?ve(V):_e(V);return document.createTextNode(re+"{"+ie+"}");function ve(he){var te=he.getPropertyValue("content");return he.cssText+" content: "+te+";"}function _e(he){return t.asArray(he).map(te).join("; ")+";";function te(ue){return ue+": "+he.getPropertyValue(ue)+(he.getPropertyPriority(ue)?" !important":"")}}}}}function C(){k instanceof HTMLTextAreaElement&&(d.innerHTML=k.value),k instanceof HTMLInputElement&&d.setAttribute("value",k.value)}function b(){d instanceof SVGElement&&(d.setAttribute("xmlns","http://www.w3.org/2000/svg"),d instanceof SVGRectElement&&["width","height"].forEach(function(G){var N=d.getAttribute(G);!N||d.style.setProperty(G,N)}))}}}function J(h){return a.resolveAll().then(function(p){var A=document.createElement("style");return h.appendChild(A),A.appendChild(document.createTextNode(p)),h})}function oe(h){return s.inlineAll(h).then(function(){return h})}function Q(h,p,A){return Promise.resolve(h).then(function(E){return E.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(E)}).then(t.escapeXhtml).then(function(E){return''+E+""}).then(function(E){return''+E+""}).then(function(E){return"data:image/svg+xml;charset=utf-8,"+E})}function ae(){return{escape:b,parseExtension:p,mimeType:A,dataAsUrl:C,isDataUrl:E,canvasToBlob:S,resolveUrl:k,getAndEncode:T,uid:d(),delay:G,asArray:N,escapeXhtml:y,makeImage:M,width:W,height:P};function h(){var m="application/font-woff",L="image/jpeg";return{woff:m,woff2:m,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:L,jpeg:L,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function p(m){var L=/\.([^\.\/]*?)$/g.exec(m);return L?L[1]:""}function A(m){var L=p(m).toLowerCase();return h()[L]||""}function E(m){return m.search(/^(data:)/)!==-1}function x(m){return new Promise(function(L){for(var H=window.atob(m.toDataURL().split(",")[1]),V=H.length,re=new Uint8Array(V),ie=0;ieimport("../chunks/fifteen-6ece83ce.js"),["chunks/fifteen-6ece83ce.js","chunks/index-7118b6c4.js"]);case"./badges/fifty.svelte":return Re(()=>import("../chunks/fifty-230cfc24.js"),["chunks/fifty-230cfc24.js","chunks/index-7118b6c4.js"]);case"./badges/five.svelte":return Re(()=>import("../chunks/five-e7ec1bc4.js"),["chunks/five-e7ec1bc4.js","chunks/index-7118b6c4.js"]);case"./badges/ten.svelte":return Re(()=>import("../chunks/ten-7c9c0a66.js"),["chunks/ten-7c9c0a66.js","chunks/index-7118b6c4.js"]);case"./badges/thirtyfive.svelte":return Re(()=>import("../chunks/thirtyfive-d3270980.js"),["chunks/thirtyfive-d3270980.js","chunks/index-7118b6c4.js"]);case"./badges/twenty.svelte":return Re(()=>import("../chunks/twenty-97dd6623.js"),["chunks/twenty-97dd6623.js","chunks/index-7118b6c4.js"]);case"./badges/two.svelte":return Re(()=>import("../chunks/two-09cc56a1.js"),["chunks/two-09cc56a1.js","chunks/index-7118b6c4.js"]);default:return new Promise(function(e,t){(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+n)))})}}function er(n,e,t){const r=n.slice();return r[18]=e[t],r[20]=t,r}function tr(n,e,t){const r=n.slice();return r[21]=e[t],r[23]=t,r}function rr(n,e,t){const r=n.slice();return r[24]=e[t],r}function nr(n){let e,t,r,a;var s=n[6];function l(o){return{props:{classNames:"w-full max-w-[180px]"}}}return s&&(t=new s(l())),{c(){e=g("div"),t&&qe(t.$$.fragment),this.h()},l(o){e=v(o,"DIV",{class:!0});var c=_(e);t&&ht(t.$$.fragment,c),c.forEach(f),this.h()},h(){u(e,"class","absolute left-0 right-0 top-0 bottom-0 flex place-content-center place-items-center")},m(o,c){ce(o,e,c),t&&Xe(t,e,null),a=!0},p(o,c){if(s!==(s=o[6])){if(t){Ke();const w=t;we(w.$$.fragment,1,0,()=>{Ze(w,1)}),Je()}s?(t=new s(l()),qe(t.$$.fragment),fe(t.$$.fragment,1),Xe(t,e,null)):t=null}},i(o){a||(t&&fe(t.$$.fragment,o),Pt(()=>{r||(r=Oe(e,$t,{duration:500},!0)),r.run(1)}),a=!0)},o(o){t&&we(t.$$.fragment,o),r||(r=Oe(e,$t,{duration:500},!1)),r.run(0),a=!1},d(o){o&&f(e),t&&Ze(t),o&&r&&r.end()}}}function ar(n){let e,t,r,a;return{c(){e=g("div"),t=g("img"),a=z(),this.h()},l(s){e=v(s,"DIV",{});var l=_(e);t=v(l,"IMG",{src:!0,alt:!0,class:!0}),a=F(l),l.forEach(f),this.h()},h(){ze(t.src,r=n[9]+n[24])||u(t,"src",r),u(t,"alt",""),u(t,"class","aspect-square w-full h-full")},m(s,l){ce(s,e,l),i(e,t),i(e,a)},p(s,l){l&2&&!ze(t.src,r=s[9]+s[24])&&u(t,"src",r)},d(s){s&&f(e)}}}function sr(n){let e,t;return{c(){e=at("rect"),this.h()},l(r){e=st(r,"rect",{fill:!0,x:!0,y:!0,width:!0,height:!0,rx:!0}),_(e).forEach(f),this.h()},h(){u(e,"fill",t=Xt[n[21].state]),u(e,"x",n[23]*(xe+ke)),u(e,"y",n[20]*(xe+ke)),u(e,"width",xe),u(e,"height",xe),u(e,"rx",n[11])},m(r,a){ce(r,e,a)},p(r,a){a&1&&t!==(t=Xt[r[21].state])&&u(e,"fill",t)},d(r){r&&f(e)}}}function lr(n){let e,t=n[18],r=[];for(let a=0;a{T=null}),Je()),W&514){C=y[1];let P;for(P=0;P{S||(S=Oe(e,it,{},!0)),S.run(1)}),k=!0)},o(y){we(T),S||(S=Oe(e,it,{},!1)),S.run(0),k=!1},d(y){y&&f(e),T&&T.d(),Ae(b,y),Ae(N,y),n[13](null),n[16](null),y&&S&&S.end(),d=!1,wr(M)}}}const xe=10,ke=1;function Hr(n,e,t){const r=xt();let{board:a}=e,{currentRowIndex:s}=e,{imagePaths:l}=e,{totalStreaks:o}=e;const c=Rr[s],w="";let I,j,O=!1;async function U(D){t(5,O=!0);try{const $=await zr.toBlob(D,{bgcolor:"#000"}),h=document.createElement("a");h.download=`sucess-${Date.now()}.png`,h.target="_self",h.onclick=async p=>{if(t(5,O=!0),h.href){URL.revokeObjectURL(h.href),t(5,O=!1);return}h.href=URL.createObjectURL($),t(5,O=!1)},h.click(),console.log("Downloding image.")}catch($){console.log($.name,$.message)}}const B=D=>{D.key==="Escape"?r("restart"):D.key===" "&&U(j)};let Y;_r(async()=>{if(o in ot){const D=ot[o];t(6,Y=(await Fr(`./badges/${D}.svelte`)).default)}window.addEventListener("keyup",B,!0)}),br(()=>{window.removeEventListener("keyup",B,!0)});const J=xe/10;function oe(D){kt[D?"unshift":"push"](()=>{j=D,t(4,j)})}const Q=()=>U(j),ae=()=>r("restart");function pe(D){kt[D?"unshift":"push"](()=>{I=D,t(3,I)})}return n.$$set=D=>{"board"in D&&t(0,a=D.board),"currentRowIndex"in D&&t(12,s=D.currentRowIndex),"imagePaths"in D&&t(1,l=D.imagePaths),"totalStreaks"in D&&t(2,o=D.totalStreaks)},[a,l,o,I,j,O,Y,r,c,w,U,J,s,oe,Q,ae,pe]}class Yr extends ct{constructor(e){super(),ut(this,e,Hr,Mr,ft,{board:0,currentRowIndex:12,imagePaths:1,totalStreaks:2})}}function or(n){let e,t,r,a,s;return{c(){e=g("div"),t=g("button"),r=K("Try Again"),this.h()},l(l){e=v(l,"DIV",{class:!0});var o=_(e);t=v(o,"BUTTON",{class:!0});var c=_(t);r=Z(c,"Try Again"),c.forEach(f),o.forEach(f),this.h()},h(){u(t,"class","hover:no-underline underline underline-offset-2 hover:scale-105 transition-all duration-200 ease-in-out"),u(e,"class","font-light flex-1 text-xs sm:text-base text-center")},m(l,o){ce(l,e,o),i(e,t),i(t,r),a||(s=Ve(t,"click",n[3]),a=!0)},p:Ge,d(l){l&&f(e),a=!1,s()}}}function Wr(n){let e,t,r,a,s,l=n[0]===ye.FAIL&&or(n);return{c(){e=g("div"),t=K(n[1]),r=z(),l&&l.c(),this.h()},l(o){e=v(o,"DIV",{class:!0});var c=_(e);t=Z(c,n[1]),r=F(c),l&&l.l(c),c.forEach(f),this.h()},h(){u(e,"class","message svelte-1sv0qpd")},m(o,c){ce(o,e,c),i(e,t),i(e,r),l&&l.m(e,null),s=!0},p(o,[c]){(!s||c&2)&&Qe(t,o[1]),o[0]===ye.FAIL?l?l.p(o,c):(l=or(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i(o){s||(Pt(()=>{a||(a=Oe(e,it,{},!0)),a.run(1)}),s=!0)},o(o){a||(a=Oe(e,it,{},!1)),a.run(0),s=!1},d(o){o&&f(e),l&&l.d(),o&&a&&a.end()}}}function Gr(n,e,t){const r=xt();let{gameState:a}=e,{message:s=null}=e;const l=()=>r("restart");return n.$$set=o=>{"gameState"in o&&t(0,a=o.gameState),"message"in o&&t(1,s=o.message)},[a,s,r,l]}class qr extends ct{constructor(e){super(),ut(this,e,Gr,Wr,ft,{gameState:0,message:1})}}function ir(n,e,t){const r=n.slice();return r[27]=e[t],r[29]=t,r}function cr(n,e,t){const r=n.slice();return r[30]=e[t],r[29]=t,r}function ur(n,e,t){const r=n.slice();return r[32]=e[t],r}function fr(n){let e,t,r,a,s,l,o,c,w,I,j,O,U,B,Y,J,oe,Q,ae,pe,D,$,h,p,A,E,x,S,k,d,M,T,C,b,G,N,y,W,P,ee,m,L,H,V,re,ie,ve,_e,he,te,ue,De,St,dt,Le,At,mt,Ee,Ce,Fe,pt,gt,Me,vt,wt,Pe,Te,_t,Ie,bt,$e,He,yt,Tt,se=n[7]&&hr(n),le=n[9]===ye.SUCESS&&dr(n),Ne=n[2],de=[];for(let R=0;RTr(h,"letterStates",Er)),h.$on("keyup",n[15]),{c(){e=g("div"),se&&se.c(),t=z(),le&&le.c(),r=z(),a=g("header"),s=g("span"),l=K("Guess the prompt!"),o=z(),c=g("span"),w=z(),I=g("h1"),j=K("\u{1F951} WORDALLE \u{1F951}"),O=z(),U=g("span"),B=z(),Y=g("span"),J=g("button"),oe=K("Skip to next"),Q=z(),ae=g("div");for(let R=0;R