import{s as le,e as w,a as S,y as R,c as E,l as Y,g as j,i as A,q as G,f as g,r as ie,k as ce,z as fe,A as ue,n as K,t as B,b as I,d as $,m as D,B as M,h as y,j as H,C as O,D as _e}from"../chunks/scheduler.CXEVs2ap.js";import{S as he,i as me,t as P,c as T,a as C,g as F,b as pe,d as de,e as ne,f as se,m as oe,h as re}from"../chunks/index.CTdcniaS.js";import{e as q}from"../chunks/each.CypvCfon.js";import{c as ve,A as ae}from"../chunks/Action.tNSJ0eLt.js";import{K as ge}from"../chunks/keymap-codes.DVdCLxHW.js";import{f as J}from"../chunks/index.C1YOBj0U.js";function L(h,e,n){const t=h.slice();return t[16]=e[n],t[18]=n,t}function Q(h,e,n){const t=h.slice();return t[19]=e[n],t}function U(h,e,n){const t=h.slice();return t[19]=e[n],t}function ke(h){let e,n="You don't have any chords";return{c(){e=w("p"),e.textContent=n},l(t){e=E(t,"P",{"data-svelte-h":!0}),Y(e)!=="svelte-16dajim"&&(e.textContent=n)},m(t,a){A(t,e,a)},p:K,i:K,o:K,d(t){t&&g(e)}}}function be(h){let e,n=h[4],t,a,r,f,s,c,o,k,p=Z(h),v=q(h[0][0].actions),l=[];for(let i=0;iP(l[i],1,1,()=>{l[i]=null});let b=q(h[0]),d=[];for(let i=0;iP(d[i],1,1,()=>{d[i]=null});return{c(){e=w("div"),p.c(),t=S(),a=w("div");for(let i=0;i3e3?1:0)},m(i,u){A(i,e,u),p.m(e,null),A(i,t,u),A(i,a,u);for(let _=0;_3e3?1:0),(!k||u&32)&&H(s,i[5]),u&1){b=q(i[0]);let _;for(_=0;_{r&&(a&&a.end(1),t=pe(e,J,{duration:300,x:-48}),t.start())}),r=!0)},o(c){t&&t.invalidate(),c&&(a=de(e,J,{duration:1e3,x:128})),r=!1},d(c){c&&g(e),f&&f.d(),s&&s.d(),c&&a&&a.end()}}}function x(h){let e,n;return e=new ae({props:{action:h[19],display:"keys"}}),{c(){ne(e.$$.fragment)},l(t){se(e.$$.fragment,t)},m(t,a){oe(e,t,a),n=!0},p(t,a){const r={};a&1&&(r.action=t[19]),e.$set(r)},i(t){n||(C(e.$$.fragment,t),n=!0)},o(t){P(e.$$.fragment,t),n=!1},d(t){re(e,t)}}}function ee(h){let e,n;return e=new ae({props:{action:h[19]}}),{c(){ne(e.$$.fragment)},l(t){se(e.$$.fragment,t)},m(t,a){oe(e,t,a),n=!0},p(t,a){const r={};a&1&&(r.action=t[19]),e.$set(r)},i(t){n||(C(e.$$.fragment,t),n=!0)},o(t){P(e.$$.fragment,t),n=!1},d(t){re(e,t)}}}function te(h){let e,n,t,a=q(h[16].phrase),r=[];for(let s=0;sP(r[s],1,1,()=>{r[s]=null});return{c(){e=w("div");for(let s=0;s{p[b]=null}),T(),r=p[a],r?r.p(l,m):(r=p[a]=k[a](l),r.c()),C(r,1),r.m(f.parentNode,f))},i(l){s||(C(r),s=!0)},o(l){P(r),s=!1},d(l){l&&(g(e),g(t),g(f)),p[a].d(l),c=!1,ie(o)}}}function Ce(h,e,n){let t;ce(h,ve,u=>n(12,t=u));const a=[[400,"+100","excited",!0],[700,"+50","satisfied",!0],[1400,"+25","neutral",!0],[3e3,"0","dissatisfied",!1],[1/0,"-50","sad",!1]],r=[[2,"+100","calm",!0],[3,"+50","content",!1],[5,"+25","stressed",!1],[7,"0","frustrated",!1],[14,"-25","very_dissatisfied",!1],[1/0,"-50","extremely_dissatisfied",!1]];let f=[],s,c,o=0,k,p,v=0,l=0,m="";fe(()=>{b()});function b(){c===void 0&&(c=performance.now(),n(1,o=0),l=0,n(5,m=""),f.length===0?n(0,f=Array.from({length:5},()=>t[Math.floor(Math.random()*t.length)])):(f.shift(),f.push(t[Math.floor(Math.random()*t.length)]),n(0,f))),m===f[0].phrase.map(u=>u===32?" ":ge.get(u).id).join("")+" "?(c=void 0,n(2,k=a.find(([u])=>o<=u)),n(3,p=r.find(([u])=>l<=u)),n(4,v++,v)):n(1,o=performance.now()-c),s=requestAnimationFrame(b)}let d=0;function z(u){u.code==="Backspace"&&n(5,m=m.slice(0,-1))}function i(u){const _=performance.now();_-d>50&&l++,d=_,n(5,m+=u.key)}return ue(()=>{s&&cancelAnimationFrame(s)}),[f,o,k,p,v,m,z,i]}class De extends he{constructor(e){super(),me(this,e,Ce,ye,le,{})}}export{De as component}; //# sourceMappingURL=12.4qmTQT-Y.js.map