text: import{S as e,i as t,s,T as l,R as n,U as c,e as a,a as o,c as r,b as h,g as u,f as i,h as p,j as f,k as v,J as k,I as y,v as d,w as g,x as m,V as z,y as T,z as b,C as E,W as $,o as B,t as N,d as U,X as O,Y as x,H as I,Z as P}from"./client.61e270f9.js";function w(e,t,s){const l=e.slice();return l[27]=t[s],l}function C(e,t,s){const l=e.slice();return l[24]=t[s],l}function V(e){let t,s,l,n,c,o=e[27]+"";function u(...t){return e[22](e[27],...t)}return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(e,l){f(e,t,l),v(t,s),n||(c=x(t,"click",u),n=!0)},p(n,c){e=n,1&c&&o!==(o=e[27]+"")&&I(s,o),1&c&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function A(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[21]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function S(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[20]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function j(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[19]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function D(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[18]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function K(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[17]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function M(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[16]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function R(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[15]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function H(e){let t,s,l,n,c,o=e[27]+"";return{c(){t=a("button"),s=N(o),this.h()},l(e){t=r(e,"BUTTON",{class:!0,style:!0});var l=h(t);s=U(l,o),l.forEach(i),this.h()},h(){p(t,"class",l=O("key key-"+e[27])+" svelte-1nvoz3p"),P(t,"width","40%")},m(l,a){f(l,t,a),v(t,s),n||(c=x(t,"click",e[14]),n=!0)},p(e,n){1&n&&o!==(o=e[27]+"")&&I(s,o),1&n&&l!==(l=O("key key-"+e[27])+" svelte-1nvoz3p")&&p(t,"class",l)},d(e){e&&i(t),n=!1,c()}}}function J(e){let t;function s(e,t){return"space"===e[27]?H:"⇧"===e[27]?R:"⇪"===e[27]?M:"123"===e[27]?K:"ABC"===e[27]?D:"#+="===e[27]?j:"↵"===e[27]?S:"⌫"===e[27]?A:V}let l=s(e),n=l(e);return{c(){n.c(),t=k()},l(e){n.l(e),t=k()},m(e,s){n.m(e,s),f(e,t,s)},p(e,c){l===(l=s(e))&&n?n.p(e,c):(n.d(1),n=l(e),n&&(n.c(),n.m(t.parentNode,t)))},d(e){n.d(e),e&&i(t)}}}function W(e){let t,s,l=e[24],n=[];for(let t=0;t<l.length;t+=1)n[t]=J(w(e,l,t));return{c(){t=a("div");for(let e=0;e<n.length;e+=1)n[e].c();s=o(),this.h()},l(e){t=r(e,"DIV",{class:!0});var l=h(t);for(let e=0;e<n.length;e+=1)n[e].l(l);s=u(l),l.forEach(i),this.h()},h(){p(t,"class","row svelte-1nvoz3p")},m(e,l){f(e,t,l);for(let e=0;e<n.length;e+=1)n[e].m(t,null);v(t,s)},p(e,c){if(185&c){let a;for(l=e[24],a=0;a<l.length;a+=1){const o=w(e,l,a);n[a]?n[a].p(o,c):(n[a]=J(o),n[a].c(),n[a].m(t,s))}for(;a<n.length;a+=1)n[a].d(1);n.length=l.length}},d(e){e&&i(t),y(n,e)}}}function X(e){let t,s,v,k,$,B;function N(t){e[12].call(null,t)}function U(t){e[13].call(null,t)}let O={};void 0!==e[2]&&(O.a=e[2]),void 0!==e[1]&&(O.InputEl=e[1]),t=new l({props:O}),n.push(()=>c(t,"a",N)),n.push(()=>c(t,"InputEl",U)),t.$on("click",e[6]),t.$on("focus",e[6]),t.$on("input",e[6]),t.$on("keydown",e[6]);let x=e[3][e[0]],I=[];for(let t=0;t<x.length;t+=1)I[t]=W(C(e,x,t));return{c(){d(t.$$.fragment),k=o(),$=a("div");for(let e=0;e<I.length;e+=1)I[e].c();this.h()},l(e){g(t.$$.fragment,e),k=u(e),$=r(e,"DIV",{class:!0});var s=h($);for(let e=0;e<I.length;e+=1)I[e].l(s);s.forEach(i),this.h()},h(){p($,"class","keyboard svelte-1nvoz3p")},m(e,s){m(t,e,s),f(e,k,s),f(e,$,s);for(let e=0;e<I.length;e+=1)I[e].m($,null);B=!0},p(e,[l]){const n={};if(!s&&4&l&&(s=!0,n.a=e[2],z(()=>s=!1)),!v&&2&l&&(v=!0,n.InputEl=e[1],z(()=>v=!1)),t.$set(n),185&l){let t;for(x=e[3][e[0]],t=0;t<x.length;t+=1){const s=C(e,x,t);I[t]?I[t].p(s,l):(I[t]=W(s),I[t].c(),I[t].m($,null))}for(;t<I.length;t+=1)I[t].d(1);I.length=x.length}},i(e){B||(T(t.$$.fragment,e),B=!0)},o(e){b(t.$$.fragment,e),B=!1},d(e){E(t,e),e&&i(k),e&&i($),y(I,e)}}}function Y(e,t,s){let{page:l={}}=t,{data:n={}}=t;const c=$();let a,o="default";String.prototype.splice=function(e,t,s){return this.slice(0,e)+s+this.slice(e+Math.abs(t))};let{placeholder:r="Enter text"}=t,{text:h="fsdfsd"}=t,u={variant:"text",placeholder:r,value:h,currPos:h.length,grow:!0};function i(e){s(2,u.value=u.value.splice(s(2,u.currPos++,u),0,e),u)}function p(e){let t=u.value,l=u.value;const n=u.currPos;t=t.slice(0,n-1),l=l.slice(n),console.log("REMOVE",n,t,l),s(2,u.value=t+l,u),u.currPos>1&&s(2,u.currPos-=1,u)}async function f(){console.log("[Keyboard] 🎹  keyboard entered:",u.value),c("submit",u.value)}B(async()=>{console.log("INPUT",u,h)});return e.$$set=e=>{"page"in e&&s(8,l=e.page),"data"in e&&s(9,n=e.data),"placeholder"in e&&s(10,r=e.placeholder),"text"in e&&s(11,h=e.text)},[o,a,u,{default:[["q","w","e","r","t","y","u","i","o","p"],["a","s","d","f","g","h","j","k","l"],["⇧","z","x","c","v","b","n","m","⌫"],["123","space","↵"]],uppercase:[["Q","W","E","R","T","Y","U","I","O","P"],["A","S","D","F","G","H","J","K","L"],["⇪","Z","X","C","V","B","N","M","⌫"],["123","space","↵"]],numbers:[["1","2","3","4","5","6","7","8","9","0"],["-","/",":",";","(",")","$","&","@",'"'],["#+=",".",",","?","!","'","⌫"],["ABC","space","↵"]],symbols:[["[","]","{","}","#","%","^","*","+","="],["_","'","|","~","<",">","€","&","@",'"'],["123",".",",","?","!","'","⌫"],["ABC","space","↵"]]},i,p,function(){s(2,u.currPos=a.selectionStart,u)},f,l,n,r,h,function(e){u=e,s(2,u)},function(e){a=e,s(1,a)},e=>i(" "),e=>s(0,o="uppercase"),e=>s(0,o="default"),e=>s(0,o="numbers"),e=>s(0,o="default"),e=>s(0,o="symbols"),e=>f(),e=>p(),(e,t)=>i(e)]}class Z extends e{constructor(e){super(),t(this,e,Y,X,s,{page:8,data:9,placeholder:10,text:11})}}export{Z as K};
  