lido-player 0.0.2-beta-15 → 0.0.2-beta-15-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cjs/{decode-xNTgi2vl.js → decode-Xh5IDmFh.js} +1 -1
  2. package/dist/cjs/{index-BFTVvr1n.js → index-B9AON0kM.js} +114 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/lido-avatar_22.cjs.entry.js +52 -29
  5. package/dist/cjs/lido-player.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/calculator/lido-calculator.css +12 -12
  8. package/dist/collection/components/canvas/lido-canvas.css +32 -32
  9. package/dist/collection/components/canvas/lido-canvas.js +1 -1
  10. package/dist/collection/components/cell/lido-cell.js +1 -1
  11. package/dist/collection/components/column/lido-col.js +1 -1
  12. package/dist/collection/components/container/lido-container.js +2 -2
  13. package/dist/collection/components/float/lido-float.js +1 -1
  14. package/dist/collection/components/position/lido-pos.js +1 -1
  15. package/dist/collection/components/row/lido-row.js +1 -1
  16. package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
  17. package/dist/collection/components/text/lido-text.js +25 -1
  18. package/dist/collection/components/wrap/lido-wrap.js +1 -1
  19. package/dist/collection/utils/utils.js +4 -0
  20. package/dist/collection/utils/utilsHandlers/moveHandler.js +111 -0
  21. package/dist/components/index.js +1 -1
  22. package/dist/components/lido-calculator.js +1 -1
  23. package/dist/components/lido-canvas.js +1 -1
  24. package/dist/components/lido-cell.js +1 -1
  25. package/dist/components/lido-col.js +1 -1
  26. package/dist/components/lido-container.js +1 -1
  27. package/dist/components/lido-float.js +1 -1
  28. package/dist/components/lido-home.js +1 -1
  29. package/dist/components/lido-image.js +1 -1
  30. package/dist/components/lido-keyboard.js +1 -1
  31. package/dist/components/lido-pos.js +1 -1
  32. package/dist/components/lido-root.js +1 -1
  33. package/dist/components/lido-row.js +1 -1
  34. package/dist/components/lido-slide-fill.js +1 -1
  35. package/dist/components/lido-text.js +1 -1
  36. package/dist/components/lido-wrap.js +1 -1
  37. package/dist/components/{p-kmKkLN_7.js → p-BE25wHoo.js} +1 -1
  38. package/dist/components/p-BfwUqpXc.js +1 -0
  39. package/dist/components/{p-CDhOF-lb.js → p-Bw-OC9iR.js} +1 -1
  40. package/dist/components/{p-DVn4BL1l.js → p-C2p0KZh4.js} +1 -1
  41. package/dist/components/p-C5jvgiPE.js +1 -0
  42. package/dist/components/{p-CFNRhdZZ.js → p-CPYnt0P-.js} +1 -1
  43. package/dist/components/{p-B8USa8EO.js → p-CS6iRQJh.js} +1 -1
  44. package/dist/components/{p-DflRPD3L.js → p-CyGxEcn7.js} +1 -1
  45. package/dist/components/{p-BP79Al--.js → p-D-IYWSAa.js} +1 -1
  46. package/dist/components/{p-CbZUFX8q.js → p-DGvzMlyn.js} +2 -2
  47. package/dist/components/p-DbR5sNOj.js +1 -0
  48. package/dist/components/{p-D2RiLzSu.js → p-Sl9R-E6h.js} +1 -1
  49. package/dist/components/p-Uluc7jQ7.js +1 -0
  50. package/dist/components/{p-CLX-8DBk.js → p-useuhkjH.js} +1 -1
  51. package/dist/esm/{decode-DyBLrL5N.js → decode-C-vVYHke.js} +1 -1
  52. package/dist/esm/{index-B7s7KKj1.js → index-BswlHnsY.js} +114 -0
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/lido-avatar_22.entry.js +52 -29
  55. package/dist/esm/lido-player.js +1 -1
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/lido-player/index.esm.js +1 -1
  58. package/dist/lido-player/lido-player.esm.js +1 -1
  59. package/dist/lido-player/{p-CofY42mG.js → p-0l6uR1lH.js} +1 -1
  60. package/dist/lido-player/{p-Detap4vV.js → p-CYMdg2_E.js} +1 -1
  61. package/dist/lido-player/{p-05fff653.entry.js → p-b2c60372.entry.js} +2 -2
  62. package/dist/types/components/text/lido-text.d.ts +4 -0
  63. package/dist/types/components.d.ts +11 -0
  64. package/dist/types/utils/utilsHandlers/moveHandler.d.ts +1 -0
  65. package/package.json +1 -1
  66. package/dist/components/p-BJ4H1UxZ.js +0 -1
  67. package/dist/components/p-BiNO9454.js +0 -1
  68. package/dist/components/p-DH6lvh19.js +0 -1
  69. package/dist/components/p-DbDgJi-A.js +0 -1
@@ -0,0 +1 @@
1
+ import{I as t,t as e,p as n,H as r,k as i,i as o,a4 as s,m as a,c as u,a as c,h as l,b as h}from"./index.js";function f(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var d,g,b={exports:{}},m={},v={},p={};function w(){return d||(d=1,t=p,Object.defineProperty(t,"__esModule",{value:!0}),t.MUST_INSTALL_PUPPETEER=t.DEFAULT_CONVERSION_ERROR_MESSAGE=t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_LINK=t.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,t.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",t.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=t.UNEXPECTED_ERROR_MESSAGE_PREFIX+t.UNEXPECTED_ERROR_MESSAGE_LINK,t.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",t.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer"),p;var t}function y(){if(g)return v;g=1,Object.defineProperty(v,"__esModule",{value:!0}),v.ErrorHandling=void 0;const t=w();class e{static generateErrorResult(t){return{color:null,error:{message:t}}}static generateInputErrorMessage(t,e,n){const r=[`Input ${t} color string could not be parsed.`,`String received: ${e}.`];return n&&r.splice(1,0,`Expected format: ${n}.`),r.join(" ")}static generateUnexpectedError(n){return e.generateErrorResult(`${t.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${n.message}`)}static hasError(t){return!!t.errorMessage}}return v.ErrorHandling=e,v}var M,k={};function j(){if(M)return k;M=1,Object.defineProperty(k,"__esModule",{value:!0}),k.SheenUtil=void 0;class t{static parseSheenFromOptions(t){return!t||"boolean"!=typeof t.sheen||t.sheen}}return k.SheenUtil=t,t.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)",k}var x,O={};function P(){return x||(x=1,t=O,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorTypes=void 0,(e=t.ColorTypes||(t.ColorTypes={})).HEX="hex",e.RGB="rgb",e.HSL="hsl",e.KEYWORD="keyword",e.FILTER="filter"),O;var t,e}var E,T,_,$={},S={},I={};function A(){return E||(E=1,Object.defineProperty(I,"__esModule",{value:!0}),I.RgbColor=void 0,I.RgbColor=class{constructor(t=[0,0,0],e=!1){this.roundChannels=e,this.r=this.clamp(t[0]),this.g=this.clamp(t[1]),this.b=this.clamp(t[2])}clamp(t){return t>255?t=255:t<0&&(t=0),this.roundChannels?Math.round(t):t}setRgb(t,e,n){this.r=this.clamp(t),this.g=this.clamp(e),this.b=this.clamp(n)}multiply(t){const e=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),n=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),r=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=e,this.g=n,this.b=r}hueRotate(t=0){t=t/180*Math.PI;const e=Math.sin(t),n=Math.cos(t);this.multiply([.213+.787*n-.213*e,.715-.715*n-.715*e,.072-.072*n+.928*e,.213-.213*n+.143*e,.715+.285*n+.14*e,.072-.072*n-.283*e,.213-.213*n-.787*e,.715-.715*n+.715*e,.072+.928*n+.072*e])}sepia(t=1){this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])}saturate(t=1){this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])}linear(t=1,e=0){this.r=this.clamp(this.r*t+255*e),this.g=this.clamp(this.g*t+255*e),this.b=this.clamp(this.b*t+255*e)}brightness(t=1){this.linear(t)}contrast(t=1){this.linear(t,-.5*t+.5)}invert(t=1){this.r=this.clamp(255*(t+this.r/255*(1-2*t))),this.g=this.clamp(255*(t+this.g/255*(1-2*t))),this.b=this.clamp(255*(t+this.b/255*(1-2*t)))}}),I}var R,C,F,H,q,D,V,L,z,G,U,B,N,W={},X={},J={},K={};function Q(){return F||(F=1,t=K,Object.defineProperty(t,"__esModule",{value:!0}),t.ColorFormats=void 0,(e=t.ColorFormats||(t.ColorFormats={})).HEX="#ffffff or #fff",e.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",e.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",e.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",e.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"),K;var t,e}function Y(){return q?H:(q=1,H={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}function Z(){if(L)return V;L=1;const t=Y(),e={};for(const n of Object.keys(t))e[t[n]]=n;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};V=n;for(const t of Object.keys(n)){if(!("channels"in n[t]))throw new Error("missing channels property: "+t);if(!("labels"in n[t]))throw new Error("missing channel labels property: "+t);if(n[t].labels.length!==n[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:r}=n[t];delete n[t].channels,delete n[t].labels,Object.defineProperty(n[t],"channels",{value:e}),Object.defineProperty(n[t],"labels",{value:r})}return n.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=o-i;let a,u;o===i?a=0:e===o?a=(n-r)/s:n===o?a=2+(r-e)/s:r===o&&(a=4+(e-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(i+o)/2;return u=o===i?0:c<=.5?s/(o+i):s/(2-o-i),[a,100*u,100*c]},n.rgb.hsv=function(t){let e,n,r,i,o;const s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),h=function(t){return(c-t)/6/l+.5};return 0===l?(i=0,o=0):(o=l/c,e=h(s),n=h(a),r=h(u),s===c?i=r-n:a===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},n.rgb.hwb=function(t){const e=t[0],r=t[1];let i=t[2];const o=n.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[o,100*s,100*i]},n.rgb.cmyk=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(1-e,1-n,1-r);return[100*((1-e-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},n.rgb.keyword=function(n){const r=e[n];if(r)return r;let i,o=1/0;for(const e of Object.keys(t)){const r=((s=n)[0]-(a=t[e])[0])**2+(s[1]-a[1])**2+(s[2]-a[2])**2;r<o&&(o=r,i=e)}var s,a;return i},n.keyword.rgb=function(e){return t[e]},n.rgb.xyz=function(t){let e=t[0]/255,n=t[1]/255,r=t[2]/255;return e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*e+.3576*n+.1805*r),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},n.rgb.lab=function(t){const e=n.rgb.xyz(t);let r=e[0],i=e[1],o=e[2];return r/=95.047,i/=100,o/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,[116*i-16,500*(r-i),200*(i-o)]},n.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100;let i,o,s;if(0===n)return s=255*r,[s,s,s];i=r<.5?r*(1+n):r+n-r*n;const a=2*r-i,u=[0,0,0];for(let t=0;t<3;t++)o=e+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?a+6*(i-a)*o:2*o<1?i:3*o<2?a+(i-a)*(2/3-o)*6:a,u[t]=255*s;return u},n.hsl.hsv=function(t){const e=t[0];let n=t[1]/100,r=t[2]/100,i=n;const o=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},n.hsv.rgb=function(t){const e=t[0]/60,n=t[1]/100;let r=t[2]/100;const i=Math.floor(e)%6,o=e-Math.floor(e),s=255*r*(1-n),a=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,s];case 1:return[a,r,s];case 2:return[s,r,u];case 3:return[s,a,r];case 4:return[u,s,r];case 5:return[r,s,a]}},n.hsv.hsl=function(t){const e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01);let o,s;s=(2-n)*r;const a=(2-n)*i;return o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,100*o,100*s]},n.hwb.rgb=function(t){const e=t[0]/360;let n=t[1]/100,r=t[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const s=Math.floor(6*e),a=1-r;o=6*e-s,1&s&&(o=1-o);const u=n+o*(a-n);let c,l,h;switch(s){default:case 6:case 0:c=a,l=u,h=n;break;case 1:c=u,l=a,h=n;break;case 2:c=n,l=a,h=u;break;case 3:c=n,l=u,h=a;break;case 4:c=u,l=n,h=a;break;case 5:c=a,l=n,h=u}return[255*c,255*l,255*h]},n.cmyk.rgb=function(t){const e=t[1]/100,n=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,t[0]/100*(1-r)+r)),255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},n.xyz.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100;let i,o,s;return i=3.2406*e+-1.5372*n+-.4986*r,o=-.9689*e+1.8758*n+.0415*r,s=.0557*e+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[255*i,255*o,255*s]},n.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];return e/=95.047,n/=100,r/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(e-n),200*(n-r)]},n.lab.xyz=function(t){let e,n,r;n=(t[0]+16)/116,e=t[1]/500+n,r=n-t[2]/200;const i=n**3,o=e**3,s=r**3;return n=i>.008856?i:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,e*=95.047,n*=100,r*=108.883,[e,n,r]},n.lab.lch=function(t){const e=t[0],n=t[1],r=t[2];let i;return i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360),[e,Math.sqrt(n*n+r*r),i]},n.lch.lab=function(t){const e=t[1],n=t[2]/360*2*Math.PI;return[t[0],e*Math.cos(n),e*Math.sin(n)]},n.rgb.ansi16=function(t,e=null){const[r,i,o]=t;let s=null===e?n.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(o/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return 2===s&&(a+=60),a},n.hsv.ansi16=function(t){return n.rgb.ansi16(n.hsv.rgb(t),t[2])},n.rgb.ansi256=function(t){const e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(t){let e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},n.ansi256.rgb=function(t){if(t>=232){const e=10*(t-232)+8;return[e,e,e]}let e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},n.rgb.hex=function(t){const e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},n.hex.rgb=function(t){const e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let n=e[0];3===e[0].length&&(n=n.split("").map((t=>t+t)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),o=Math.min(Math.min(e,n),r),s=i-o;let a,u;return a=s<1?o/(1-s):0,u=s<=0?0:i===e?(n-r)/s%6:i===n?2+(r-e)/s:4+(e-n)/s,u/=6,u%=1,[360*u,100*s,100*a]},n.hsl.hcg=function(t){const e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},n.hsv.hcg=function(t){const e=t[2]/100,n=t[1]/100*e;let r=0;return n<1&&(r=(e-n)/(1-n)),[t[0],100*n,100*r]},n.hcg.rgb=function(t){const e=t[1]/100,n=t[2]/100;if(0===e)return[255*n,255*n,255*n];const r=[0,0,0],i=t[0]/360%1*6,o=i%1,s=1-o;let a=0;switch(Math.floor(i)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return a=(1-e)*n,[255*(e*r[0]+a),255*(e*r[1]+a),255*(e*r[2]+a)]},n.hcg.hsv=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);let r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},n.hcg.hsl=function(t){const e=t[1]/100,n=t[2]/100*(1-e)+.5*e;let r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},n.hcg.hwb=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},n.hwb.hcg=function(t){const e=1-t[2]/100,n=e-t[1]/100;let r=0;return n<1&&(r=(e-n)/(1-n)),[t[0],100*n,100*r]},n.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},n.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},n.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},n.gray.hsl=function(t){return[0,0,t[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(t){return[0,100,t[0]]},n.gray.cmyk=function(t){return[0,0,0,t[0]]},n.gray.lab=function(t){return[t[0],0,0]},n.gray.hex=function(t){const e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]},V}function tt(){if(G)return z;G=1;const t=Z();function e(t,e){return function(n){return e(t(n))}}function n(n,r){const i=[r[n].parent,n];let o=t[r[n].parent][n],s=r[n].parent;for(;r[s].parent;)i.unshift(r[s].parent),o=e(t[r[s].parent][s],o),s=r[s].parent;return o.conversion=i,o}return z=function(e){const r=function(e){const n=function(){const e={},n=Object.keys(t);for(let t=n.length,r=0;r<t;r++)e[n[r]]={distance:-1,parent:null};return e}(),r=[e];for(n[e].distance=0;r.length;){const e=r.pop(),i=Object.keys(t[e]);for(let t=i.length,o=0;o<t;o++){const t=i[o],s=n[t];-1===s.distance&&(s.distance=n[e].distance+1,s.parent=e,r.unshift(t))}}return n}(e),i={},o=Object.keys(r);for(let t=o.length,e=0;e<t;e++){const t=o[e];null!==r[t].parent&&(i[t]=n(t,r))}return i}}function et(){if(B)return U;B=1;const t=Z(),e=tt(),n={};return Object.keys(t).forEach((r=>{n[r]={},Object.defineProperty(n[r],"channels",{value:t[r].channels}),Object.defineProperty(n[r],"labels",{value:t[r].labels});const i=e(r);Object.keys(i).forEach((t=>{const e=i[t];n[r][t]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const r=t(e);if("object"==typeof r)for(let t=r.length,e=0;e<t;e++)r[e]=Math.round(r[e]);return r};return"conversion"in t&&(e.conversion=t.conversion),e}(e),n[r][t].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(e)}))})),U=n}var nt,rt={},it={},ot={},st={};function at(){if(nt)return st;nt=1,Object.defineProperty(st,"__esModule",{value:!0}),st.FilterToHexShared=void 0;const t=y(),e=Q(),n=P();return st.FilterToHexShared=class{static generateInputErrorMessage(r){return t.ErrorHandling.generateInputErrorMessage(n.ColorTypes.FILTER,r,e.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(t,e=1){const n=function(){const t=document.createElement("div");return t.style.height=`${e}px`,t.style.width=`${e}px`,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t}(),r=function(){const n="http://www.w3.org/2000/svg",r=document.createElementNS(n,"svg");r.style.height="inherit",r.style.width="inherit",r.style.float="left",r.style.filter=t;const i=document.createElementNS(n,"rect");return i.setAttributeNS(null,"width",e.toString()),i.setAttributeNS(null,"height",e.toString()),r.appendChild(i),r}();return""===r.style.filter?{errorMessage:"error indicator",svgContainerElement:n}:(n.appendChild(r),document.body.appendChild(n),{svgContainerElement:n})}static async getColorViaImageDataURL(t){return function(t){const e=function(t){const e=t.width;return t.getContext("2d").getImageData(0,0,e,e).data}(t);return`#${`000000${function(t,e,n){if(t>255||e>255||n>255)throw new Error("Invalid color component");return(t<<16|e<<8|n).toString(16)}(e[0],e[1],e[2])}`.slice(-6)}`}(function(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height),e}(await async function(){const e=new Image;return new Promise(((n,r)=>{e.onload=()=>n(e),e.onerror=()=>r(new Error("Failed to load the SVG image data URL")),e.src=t}))}()))}},st}var ut,ct,lt={exports:{}};function ht(){return ut||(ut=1,t=lt,function(){var e=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:e,mimeType:function(t){var n,r;return(n="application/font-woff",r="image/jpeg",{woff:n,woff2:n,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:r,jpeg:r,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[e(t).toLowerCase()]||""},dataAsUrl:function(t,e){return"data:"+e+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(e){t.toBlob(e)})):function(t){return new Promise((function(e){for(var n=window.atob(t.toDataURL().split(",")[1]),r=n.length,i=new Uint8Array(r),o=0;o<r;o++)i[o]=n.charCodeAt(o);e(new Blob([i],{type:"image/png"}))}))}(t)},resolveUrl:function(t,e){var n=document.implementation.createHTMLDocument(),r=n.createElement("base");n.head.appendChild(r);var i=n.createElement("a");return n.body.appendChild(i),r.href=e,i.href=t,i.href},getAndEncode:function(t){return a.impl.options.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()),new Promise((function(e){var n,r=new XMLHttpRequest;if(r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var i=new FileReader;i.onloadend=function(){var t=i.result.split(/,/)[1];e(t)},i.readAsDataURL(r.response)}else n?e(n):o("cannot fetch resource: "+t+", status: "+r.status)},r.ontimeout=function(){n?e(n):o("timeout of 30000ms occured while fetching resource: "+t)},r.responseType="blob",r.timeout=3e4,r.open("GET",t,!0),r.send(),a.impl.options.imagePlaceholder){var i=a.impl.options.imagePlaceholder.split(/,/);i&&i[1]&&(n=i[1])}function o(t){console.error(t),e("")}}))},uid:(t=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)+t++}),delay:function(t){return function(e){return new Promise((function(n){setTimeout((function(){n(e)}),t)}))}},asArray:function(t){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e},escapeXhtml:function(t){return t.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(t){return new Promise((function(e,n){var r=new Image;r.onload=function(){e(r)},r.onerror=n,r.src=t}))},width:function(t){var e=n(t,"border-left-width"),r=n(t,"border-right-width");return t.scrollWidth+e+r},height:function(t){var e=n(t,"border-top-width"),r=n(t,"border-bottom-width");return t.scrollHeight+e+r}};var t;function e(t){var e=/\.([^\.\/]*?)$/g.exec(t);return e?e[1]:""}function n(t,e){var n=window.getComputedStyle(t).getPropertyValue(e);return parseFloat(n.replace("px",""))}}(),n=function(){var t=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(t,e,o){return n(t)?Promise.resolve(t).then(r).then((function(n){var r=Promise.resolve(t);return n.forEach((function(t){r=r.then((function(n){return i(n,t,e,o)}))})),r})):Promise.resolve(t)},shouldProcess:n,impl:{readUrls:r,inline:i}};function n(e){return-1!==e.search(t)}function r(n){for(var r,i=[];null!==(r=t.exec(n));)i.push(r[1]);return i.filter((function(t){return!e.isDataUrl(t)}))}function i(t,n,r,i){return Promise.resolve(n).then((function(t){return r?e.resolveUrl(t,r):t})).then(i||e.getAndEncode).then((function(t){return e.dataAsUrl(t,e.mimeType(n))})).then((function(r){return t.replace(function(t){return new RegExp("(url\\(['\"]?)("+e.escape(t)+")(['\"]?\\))","g")}(n),"$1"+r+"$3")}))}}(),r=function(){return{resolveAll:function(){return t().then((function(t){return Promise.all(t.map((function(t){return t.resolve()})))})).then((function(t){return t.join("\n")}))},impl:{readAll:t}};function t(){return Promise.resolve(e.asArray(document.styleSheets)).then((function(t){var n=[];return t.forEach((function(t){try{e.asArray(t.cssRules||[]).forEach(n.push.bind(n))}catch(e){console.log("Error while reading CSS rules from "+t.href,e.toString())}})),n})).then((function(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return n.shouldProcess(t.style.getPropertyValue("src"))}))})).then((function(e){return e.map(t)}));function t(t){return{resolve:function(){return n.inlineAll(t.cssText,(t.parentStyleSheet||{}).href)},src:function(){return t.style.getPropertyValue("src")}}}}}(),i=function(){return{inlineAll:function r(i){return i instanceof Element?function(t){var e=t.style.getPropertyValue("background");return e?n.inlineAll(e).then((function(e){t.style.setProperty("background",e,t.style.getPropertyPriority("background"))})).then((function(){return t})):Promise.resolve(t)}(i).then((function(){return i instanceof HTMLImageElement?t(i).inline():Promise.all(e.asArray(i.childNodes).map((function(t){return r(t)})))})):Promise.resolve(i)},impl:{newImage:t}};function t(t){return{inline:function(n){return e.isDataUrl(t.src)?Promise.resolve():Promise.resolve(t.src).then(n||e.getAndEncode).then((function(n){return e.dataAsUrl(n,e.mimeType(t.src))})).then((function(e){return new Promise((function(n,r){t.onload=n,t.onerror=r,t.src=e}))}))}}}}(),o=void 0,s=!1,a={toSvg:u,toPng:function(t,e){return c(t,e||{}).then((function(t){return t.toDataURL()}))},toJpeg:function(t,e){return c(t,e=e||{}).then((function(t){return t.toDataURL("image/jpeg",e.quality||1)}))},toBlob:function(t,n){return c(t,n||{}).then(e.canvasToBlob)},toPixelData:function(t,n){return c(t,n||{}).then((function(n){return n.getContext("2d").getImageData(0,0,e.width(t),e.height(t)).data}))},impl:{fontFaces:r,images:i,util:e,inliner:n,options:{}}};function u(t,n){return function(t){a.impl.options.imagePlaceholder=void 0===t.imagePlaceholder?o:t.imagePlaceholder,a.impl.options.cacheBust=void 0===t.cacheBust?s:t.cacheBust}(n=n||{}),Promise.resolve(t).then((function(t){return l(t,n.filter,!0)})).then(h).then(f).then((function(t){return n.bgcolor&&(t.style.backgroundColor=n.bgcolor),n.width&&(t.style.width=n.width+"px"),n.height&&(t.style.height=n.height+"px"),n.style&&Object.keys(n.style).forEach((function(e){t.style[e]=n.style[e]})),t})).then((function(r){return function(t,n,r){return Promise.resolve(t).then((function(t){return t.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(t)})).then(e.escapeXhtml).then((function(t){return'<foreignObject x="0" y="0" width="100%" height="100%">'+t+"</foreignObject>"})).then((function(t){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+n+'" height="'+r+'">'+t+"</svg>"})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(r,n.width||e.width(t),n.height||e.height(t))}))}function c(t,n){return u(t,n).then(e.makeImage).then(e.delay(100)).then((function(r){var i=function(t){var r=document.createElement("canvas");if(r.width=n.width||e.width(t),r.height=n.height||e.height(t),n.bgcolor){var i=r.getContext("2d");i.fillStyle=n.bgcolor,i.fillRect(0,0,r.width,r.height)}return r}(t);return i.getContext("2d").drawImage(r,0,0),i}))}function l(t,n,r){return r||!n||n(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?e.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(r){return function(t,n,r){var i=t.childNodes;return 0===i.length?Promise.resolve(n):function(t,e,n){var r=Promise.resolve();return e.forEach((function(e){r=r.then((function(){return l(e,n)})).then((function(e){e&&t.appendChild(e)}))})),r}(n,e.asArray(i),r).then((function(){return n}))}(t,r,n)})).then((function(n){return function(t,n){return n instanceof Element?Promise.resolve().then((function(){r=window.getComputedStyle(t),i=n.style,r.cssText?i.cssText=r.cssText:function(t,n){e.asArray(t).forEach((function(e){n.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e))}))}(r,i);var r,i})).then((function(){[":before",":after"].forEach((function(r){!function(r){var i=window.getComputedStyle(t,r),o=i.getPropertyValue("content");if(""!==o&&"none"!==o){var s=e.uid();n.className=n.className+" "+s;var a=document.createElement("style");a.appendChild(function(t,n,r){var i="."+t+":"+n,o=r.cssText?s(r):a(r);return document.createTextNode(i+"{"+o+"}");function s(t){var e=t.getPropertyValue("content");return t.cssText+" content: "+e+";"}function a(t){return e.asArray(t).map(n).join("; ")+";";function n(e){return e+": "+t.getPropertyValue(e)+(t.getPropertyPriority(e)?" !important":"")}}}(s,r,i)),n.appendChild(a)}}(r)}))})).then((function(){t instanceof HTMLTextAreaElement&&(n.innerHTML=t.value),t instanceof HTMLInputElement&&n.setAttribute("value",t.value)})).then((function(){n instanceof SVGElement&&(n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n instanceof SVGRectElement&&["width","height"].forEach((function(t){var e=n.getAttribute(t);e&&n.style.setProperty(t,e)})))})).then((function(){return n})):n}(t,n)})):Promise.resolve()}function h(t){return r.resolveAll().then((function(e){var n=document.createElement("style");return t.appendChild(n),n.appendChild(document.createTextNode(e)),t}))}function f(t){return i.inlineAll(t).then((function(){return t}))}t.exports=a}()),lt.exports;var t}var ft,dt,gt={};var bt,mt,vt,pt,wt={},yt={};var Mt=t((pt||(pt=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=function(){if(N)return m;N=1;var t=m&&m.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(m,"__esModule",{value:!0}),m.ColorToFilter=void 0;const e=y(),n=j(),r=P(),i=function(){if(_)return $;_=1,Object.defineProperty($,"__esModule",{value:!0}),$.RgbToFilter=void 0;const t=y(),e=w(),n=function(){if(T)return S;T=1,Object.defineProperty(S,"__esModule",{value:!0}),S.RgbToFilterWorker=void 0;const t=j(),e=A();class n{constructor(t,n){this.targetRgbColor=t,this.reusedRgbColor=new e.RgbColor,this.reusedRoundedRgbColor=new e.RgbColor([0,0,0],!0),this.addSheen=n}static fmt(t,e,n=1){return Math.round(t[e]*n)}generateCss(e){return`${this.addSheen?`${t.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${n.fmt(e,0)}%) sepia(${n.fmt(e,1)}%) saturate(${n.fmt(e,2)}%) hue-rotate(${n.fmt(e,3,3.6)}deg) brightness(${n.fmt(e,4)}%) contrast(${n.fmt(e,5)}%)`}applyFilters(t,e,n){return t.setRgb(0,0,0),t.invert(e[0]/100),t.sepia(e[1]/100),t.saturate(e[2]/100),t.hueRotate(n),t.brightness(e[4]/100),t.contrast(e[5]/100),Math.abs(t.r-this.targetRgbColor.r)+Math.abs(t.g-this.targetRgbColor.g)+Math.abs(t.b-this.targetRgbColor.b)}loss(t){return this.applyFilters(this.reusedRgbColor,t,3.6*t[3])}serializedLoss(t){const e=t.map(((e,r)=>n.fmt(t,r))),r=n.fmt(t,3,3.6),i=this.applyFilters(this.reusedRgbColor,e,r),o=this.applyFilters(this.reusedRoundedRgbColor,e,r);return Math.max(i,o)}static fixSpsa(t,e){let n=100;return 2===e?n=7500:4!==e&&5!==e||(n=200),3===e?t>n?t%=n:t<0&&(t=n+t%n):t<0?t=0:t>n&&(t=n),t}spsa(t,e,r,i,o){let s=[],a=1/0;const u=new Array(6),c=new Array(6),l=new Array(6);for(let h=0;h<o;h+=1){const o=r/Math.pow(h+1,.16666666666666666);for(let t=0;t<6;t+=1)u[t]=Math.random()>.5?1:-1,c[t]=i[t]+o*u[t],l[t]=i[t]-o*u[t];const f=this.loss(c)-this.loss(l);for(let r=0;r<6;r+=1){const s=f/(2*o)*u[r],a=e[r]/Math.pow(t+h+1,1);i[r]=n.fixSpsa(i[r]-a*s,r)}const d=this.serializedLoss(i);d<a&&(s=i.slice(0),a=d)}return{values:s,loss:a}}solveNarrow(t){const e=t.loss,n=e+1;return this.spsa(e,[.25*n,.25*n,n,.25*n,.2*n,.2*n],2,t.values,500)}solveWide(){const t=[60,180,18e3,600,1.2,1.2];let e={values:[],loss:1/0};for(let n=0;e.loss>25&&n<3;n+=1){const n=this.spsa(5,t,15,[50,20,3750,50,100,100],1e3);n.loss<e.loss&&(e=n)}return e}convert(){const t=this.solveNarrow(this.solveWide());return{loss:t.loss,color:this.generateCss(t.values)}}}return S.RgbToFilterWorker=n,S}(),r=A();class i{static generateConversionError(n){return t.ErrorHandling.generateErrorResult(n||e.DEFAULT_CONVERSION_ERROR_MESSAGE)}static generateValidateAndParseError(e){return t.ErrorHandling.generateErrorResult(e)}static execute(t,e){const i=new r.RgbColor(t);return new n.RgbToFilterWorker(i,e).convert()}static convertToRGB(t,e){return t&&e?e(t):null}static convert(e){try{const{colorString:n,validateAndParse:r,convertToRgb:o,conversionErrorMessage:s,addSheen:a}=e,u=n.trim().toLocaleLowerCase(),c=(null==r?void 0:r(u))||{color:u};if(t.ErrorHandling.hasError(c))return i.generateValidateAndParseError(c.errorMessage);const l=i.convertToRGB(c.color,o)||c.color;return l?i.execute(l,a):i.generateConversionError(s)}catch(e){return t.ErrorHandling.generateUnexpectedError(e)}}}return $.RgbToFilter=i,$}(),o=function(){if(D)return W;D=1;var t=W&&W.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0}),W.ColorParser=void 0;const e=(R||(R=1,Object.defineProperty(X,"__esModule",{value:!0}),X.MATCH_HEXADECIMAL=X.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,X.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,X.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i),X),n=y(),r=(C||(C=1,Object.defineProperty(J,"__esModule",{value:!0}),J.MAX_COLOR_INPUT_STRING_LENGTH=void 0,J.MAX_COLOR_INPUT_STRING_LENGTH=25),J),i=Q(),o=P(),s=t(Y());class a{static validateAndParseHex(t){return t.length<r.MAX_COLOR_INPUT_STRING_LENGTH&&t.match(e.MATCH_HEXADECIMAL)?{color:t}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(o.ColorTypes.HEX,t,i.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(t){if(t.length<r.MAX_COLOR_INPUT_STRING_LENGTH){const n=t.match(e.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(e.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,n&&n.length>=3)return n.slice(0,3).map((t=>Number.parseInt(t)))}return null}static validateAndParseRgb(t){const e=a.parseFirstThreeIntegersFromString(t);return e&&e[0]>=0&&e[0]<=255&&e[1]>=0&&e[1]<=255&&e[2]>=0&&e[2]<=255?{color:e}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(o.ColorTypes.RGB,t,i.ColorFormats.RGB)}}static validateAndParseHsl(t){const e=a.parseFirstThreeIntegersFromString(t);return e&&e[0]>=0&&e[0]<=360&&e[1]>=0&&e[1]<=100&&e[2]>=0&&e[2]<=100?{color:e}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(o.ColorTypes.HSL,t,i.ColorFormats.HSL)}}static validateAndParseKeyword(t){return t.length<r.MAX_COLOR_INPUT_STRING_LENGTH&&s.default[t]?{color:t}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(o.ColorTypes.KEYWORD,t,i.ColorFormats.KEYWORD)}}}return W.ColorParser=a,W}(),s=t(et());return m.ColorToFilter=class{static rgbToFilter(t,e){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseRgb,addSheen:n.SheenUtil.parseSheenFromOptions(e)})}static hexToFilter(t,e){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseHex,convertToRgb:s.default.hex.rgb,addSheen:n.SheenUtil.parseSheenFromOptions(e)})}static hslToFilter(t,e){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseHsl,convertToRgb:s.default.hsl.rgb,addSheen:n.SheenUtil.parseSheenFromOptions(e)})}static keywordToFilter(t,a){return i.RgbToFilter.convert({colorString:t,validateAndParse:o.ColorParser.validateAndParseKeyword,convertToRgb:s.default.keyword.rgb,conversionErrorMessage:e.ErrorHandling.generateInputErrorMessage(r.ColorTypes.KEYWORD,t),addSheen:n.SheenUtil.parseSheenFromOptions(a)})}},m}(),r=function(){if(vt)return rt;vt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.FilterToColor=void 0;const t=function(){if(dt)return it;dt=1;var t=it&&it.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),e=it&&it.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=it&&it.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&t(r,n,i);return e(r,n),r};Object.defineProperty(it,"__esModule",{value:!0}),it.FilterToHex=void 0;const r=y(),i=function(){if(ct)return ot;ct=1;var t=ot&&ot.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),e=ot&&ot.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n=ot&&ot.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(null!=n)for(var i in n)"default"!==i&&Object.prototype.hasOwnProperty.call(n,i)&&t(r,n,i);return e(r,n),r};Object.defineProperty(ot,"__esModule",{value:!0}),ot.FilterToHexBrowser=void 0;const r=y(),i=at();class o extends i.FilterToHexShared{static cleanup(t){t.remove()}static returnInputError(t,e){const n=i.FilterToHexShared.generateInputErrorMessage(t),s=r.ErrorHandling.generateErrorResult(n);return o.cleanup(e),s}static async getImageBase64ViaSVG(t){return(await Promise.resolve().then((()=>n(ht())))).toPng(t)}static async convert(t){const{errorMessage:e,svgContainerElement:n}=i.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(t);if(e)return o.returnInputError(t,n);const r=await o.getImageBase64ViaSVG(n),s=await i.FilterToHexShared.getColorViaImageDataURL(r);return o.cleanup(n),{color:s}}}return ot.FilterToHexBrowser=o,ot}();return it.FilterToHex=class{static async convert(t,e,o){try{let r;if("undefined"==typeof window){const{FilterToHexNode:e}=await Promise.resolve().then((()=>n(function(){if(ft)return gt;ft=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.FilterToHexNode=void 0;const t=y(),e=w(),n=Q(),r=P(),i=at();class o extends i.FilterToHexShared{static cleanup(t){o.IS_HEADLESS&&(null==t||t.close())}static returnError(e,n){const r=t.ErrorHandling.generateErrorResult(e);return o.cleanup(n),r}static async getImageBase64ViaSVG(t){const e=await t.screenshot({encoding:o.BASE_64_ENCODING});return`${o.ENCODED_DATA_URL_PREFIX}${e}`}static async openBrowserPage(t){const e=await t.newPage();return await e.setViewport({width:o.SVG_SIDE_LENGTH_PX,height:o.SVG_SIDE_LENGTH_PX}),e}static async addSVGAndValidateFilter(e,s){const a=await e.evaluate(i.FilterToHexShared.addSVGElementsToDOMAndValidateFilter,s,o.SVG_SIDE_LENGTH_PX);return a.errorMessage?{errorMessage:t.ErrorHandling.generateInputErrorMessage(r.ColorTypes.FILTER,s,n.ColorFormats.FILTER)}:a}static async getPuppeteerDependency(){try{return f("puppeteer")}catch(t){return{errorMessage:e.MUST_INSTALL_PUPPETEER}}}static async preparePuppeteerBrowser(){const e=await o.getPuppeteerDependency();return t.ErrorHandling.hasError(e)?e:e.launch({headless:o.IS_HEADLESS})}static async convert(e){const n=await o.preparePuppeteerBrowser();if(t.ErrorHandling.hasError(n))return o.returnError(n.errorMessage);const r=await o.openBrowserPage(n),s=await o.addSVGAndValidateFilter(r,e);if(t.ErrorHandling.hasError(s))return o.returnError(s.errorMessage,n);const a=await o.getImageBase64ViaSVG(r),u=await r.evaluate(i.FilterToHexShared.getColorViaImageDataURL,a);return o.cleanup(n),{color:u}}}return gt.FilterToHexNode=o,o.BASE_64_ENCODING="base64",o.ENCODED_DATA_URL_PREFIX=`data:image/png;${o.BASE_64_ENCODING},`,o.IS_HEADLESS=!0,o.SVG_SIDE_LENGTH_PX=2,gt}())));r=await e.convert(t)}else r=await i.FilterToHexBrowser.convert(t);return r.color&&e&&"string"==typeof r.color&&(r.color=e(r.color,o)),r}catch(t){return r.ErrorHandling.generateUnexpectedError(t)}}},it}(),e=function(){if(mt)return wt;mt=1;var t=wt&&wt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.HexToColor=void 0;const e=(bt||(bt=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.ColorFormatter=void 0,yt.ColorFormatter=class{static arrayToRgbString(t){return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}static arrayToHslString(t){return`hsl(${t[0]}deg, ${t[1]}%, ${t[2]}%)`}}),yt),n=t(et());return wt.HexToColor=class{static convertToRgb(t,r){const i=n.default.hex.rgb(t);return"string"===(null==r?void 0:r.resultType)?e.ColorFormatter.arrayToRgbString(i):i}static convertToHsl(t,r){const i=n.default.hex.hsl(t);return"string"===(null==r?void 0:r.resultType)?e.ColorFormatter.arrayToHslString(i):i}},wt}();return rt.FilterToColor=class{static async filterToHex(e){const n=await t.FilterToHex.convert(e);return n.color&&(n.color=n.color.toUpperCase()),n}static async filterToRgb(n,r){return t.FilterToHex.convert(n,e.HexToColor.convertToRgb,r)}static async filterToHsl(n,r){return t.FilterToHex.convert(n,e.HexToColor.convertToHsl,r)}},rt}();class i{static rgbToFilter(t,e){return n.ColorToFilter.rgbToFilter(t,e)}static hexToFilter(t,e){return n.ColorToFilter.hexToFilter(t,e)}static hslToFilter(t,e){return n.ColorToFilter.hslToFilter(t,e)}static keywordToFilter(t,e){return n.ColorToFilter.keywordToFilter(t,e)}static async filterToHex(t){return r.FilterToColor.filterToHex(t)}static async filterToRgb(t,e){return r.FilterToColor.filterToRgb(t,e)}static async filterToHsl(t,e){return r.FilterToColor.filterToHsl(t,e)}}e.default=i,t.exports=i}(b,b.exports)),b.exports));const kt=n(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.sliceWidth="30px",this.minDrops=1,this.maxDrops=1,this.margin="",this.padding="",this.filter="",this.borderRadius="0px",this.transform="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(i(this.el,this.delayVisible),o(this.el,this.type),""!==this.filter){const t=this.el.getElementsByTagName("img")[0];t&&(t.style.filter=`${Mt.hexToFilter(s(this.filter).toHexString()).color}`)}this.showSpeakIcon&&a(this.el)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:c(this.height,t),width:c(this.width,t),backgroundColor:c(this.bgColor,t),top:c(this.y,t),left:c(this.x,t),zIndex:this.z,display:c(`${this.visible}`,t)?"flex":"none",alignItems:"center",justifyContent:"center",margin:c(this.margin,t),padding:c(this.padding,t),transform:c(this.transform,t),borderRadius:this.borderRadius,borderImageSource:"true"===this.isSlice?`url(${u(this.src)})`:"none",borderImageSlice:"true"===this.isSlice?`${parseInt(this.sliceWidth)} fill`:"unset",borderImageRepeat:"true"===this.isSlice?"round":"unset",borderImageWidth:"true"===this.isSlice?`${this.sliceWidth}`:"unset",backgroundImage:"true"===this.isSlice?`url(${u(this.src)})`:"none"}}render(){return"true"===this.isSlice?l(h,{class:"slice",id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry}):l(h,{id:this.id,type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,value:this.value,minDrops:this.minDrops,maxDrops:this.maxDrops,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,"disable-speak":this.disableSpeak},l("img",{class:"lido-image",src:u(this.src),alt:"",style:this.style}))}get el(){return this}static get style(){return".lido-image{user-select:none;-webkit-user-drag:none;object-fit:contain;width:100% !important;height:100% !important;aspect-ratio:1 / 1;transform:rotate(0) !important;margin:0 !important}.slice{background-repeat:no-repeat;background-position:center;background-size:100% 100%}"}},[0,"lido-image",{showSpeakIcon:[4,"show-speak-icon"],id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],src:[1],isSlice:[1,"is-slice"],sliceWidth:[1,"slice-width"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],margin:[1],padding:[1],filter:[1],borderRadius:[1,"border-radius"],transform:[1],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],style:[32]}]);function jt(){"undefined"!=typeof customElements&&["lido-image"].forEach((t=>{"lido-image"===t&&(customElements.get(e(t))||customElements.define(e(t),kt))}))}jt();export{kt as L,f as c,jt as d}
@@ -1 +1 @@
1
- import{t,p as i,H as s,a as o,h as n,b as e}from"./index.js";const h=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.width="800px",this.height="700px",this.visible=!1,this.z="0",this.x="0px",this.y="0px",this.onEntry="",this.drawing=!1,this.style={},this.handleWindowPointerUp=()=>this.stop(),this.handleWindowResize=()=>this.updateStyles()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={width:o(this.width,t),height:o(this.height,t),left:o(this.x,t),top:o(this.y,t),zIndex:this.z,display:"true"===o(`${this.visible}`,t)?"block":"none",position:"absolute"},this.canvas&&(this.canvas.width=parseInt(o(this.width,t)),this.canvas.height=parseInt(o(this.height,t)),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round")}componentDidLoad(){this.canvas=this.el.shadowRoot.querySelector("#lido-canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.updateStyles(),this.canvas.addEventListener("pointerdown",(t=>this.start(t))),this.canvas.addEventListener("pointermove",(t=>this.move(t))),window.addEventListener("pointerup",this.handleWindowPointerUp),window.addEventListener("resize",this.handleWindowResize)}disconnectedCallback(){window.removeEventListener("pointerup",this.handleWindowPointerUp),window.removeEventListener("resize",this.handleWindowResize)}loadBackground(){if(!this.bgImage)return this.ctx.fillStyle="#fff",void this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);const t=new Image;t.crossOrigin="anonymous",t.src=this.bgImage,t.onload=()=>{this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height)}}getPos(t){const i=this.canvas.getBoundingClientRect();return{x:this.canvas.width/i.width*(t.clientX-i.left),y:this.canvas.height/i.height*(t.clientY-i.top)}}start(t){this.drawing=!0;const i=this.getPos(t);this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y)}move(t){if(!this.drawing)return;const i=this.getPos(t);this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}stop(){this.drawing=!1,this.ctx.closePath()}clearCanvas(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}render(){return n(e,{key:"ebf767a3c0cf33104428fba8fe21be6e76fa44c2",id:"lido-canvas",class:"lido-canvas",style:this.style},n("button",{key:"e5f247157140b9038d7b207bf71bba0b5e05978c",id:"lido-exit-button",onClick:()=>this.clearCanvas()}),n("canvas",{key:"ac5cbd11a9bd0bb22ac88ca7781994ce52309d52",id:"lido-canvas"}))}get el(){return this}static get style(){return":host{box-sizing:border-box}.lido-canvas{background:transparent;border:none;border-radius:0;overflow:hidden;box-sizing:border-box}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:absolute;top:0;right:0;z-index:15}canvas{touch-action:none;display:block;width:100%;height:100%;z-index:10}"}},[1,"lido-canvas",{bgImage:[1,"bg-image"],width:[1],height:[1],visible:[8],z:[1],x:[1],y:[1],onEntry:[1,"on-entry"],style:[32]}]);function a(){"undefined"!=typeof customElements&&["lido-canvas"].forEach((i=>{"lido-canvas"===i&&(customElements.get(t(i))||customElements.define(t(i),h))}))}a();export{h as L,a as d}
1
+ import{t,p as i,H as s,a as o,h as n,b as e}from"./index.js";const h=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.width="800px",this.height="700px",this.visible=!1,this.z="0",this.x="0px",this.y="0px",this.onEntry="",this.drawing=!1,this.style={},this.handleWindowPointerUp=()=>this.stop(),this.handleWindowResize=()=>this.updateStyles()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={width:o(this.width,t),height:o(this.height,t),left:o(this.x,t),top:o(this.y,t),zIndex:this.z,display:"true"===o(`${this.visible}`,t)?"block":"none",position:"absolute"},this.canvas&&(this.canvas.width=parseInt(o(this.width,t)),this.canvas.height=parseInt(o(this.height,t)),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round")}componentDidLoad(){this.canvas=this.el.shadowRoot.querySelector("#lido-canvas"),this.ctx=this.canvas.getContext("2d"),this.ctx.strokeStyle="#000",this.ctx.lineWidth=10,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.updateStyles(),this.canvas.addEventListener("pointerdown",(t=>this.start(t))),this.canvas.addEventListener("pointermove",(t=>this.move(t))),window.addEventListener("pointerup",this.handleWindowPointerUp),window.addEventListener("resize",this.handleWindowResize)}disconnectedCallback(){window.removeEventListener("pointerup",this.handleWindowPointerUp),window.removeEventListener("resize",this.handleWindowResize)}loadBackground(){if(!this.bgImage)return this.ctx.fillStyle="#fff",void this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);const t=new Image;t.crossOrigin="anonymous",t.src=this.bgImage,t.onload=()=>{this.ctx.drawImage(t,0,0,this.canvas.width,this.canvas.height)}}getPos(t){const i=this.canvas.getBoundingClientRect();return{x:this.canvas.width/i.width*(t.clientX-i.left),y:this.canvas.height/i.height*(t.clientY-i.top)}}start(t){this.drawing=!0;const i=this.getPos(t);this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y)}move(t){if(!this.drawing)return;const i=this.getPos(t);this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}stop(){this.drawing=!1,this.ctx.closePath()}clearCanvas(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}render(){return n(e,{key:"6bb47f06656ce667d23236e9f3c3a8f383885a43",id:"lido-canvas",class:"lido-canvas",style:this.style},n("button",{key:"fd0d1217bda63071fbf6496c2538c2a944b14181",id:"lido-exit-button",onClick:()=>this.clearCanvas()}),n("canvas",{key:"ed0333972bb7ce0fc4e14c81bb466ea895ce65e0",id:"lido-canvas"}))}get el(){return this}static get style(){return":host{box-sizing:border-box}.lido-canvas{background:transparent;border:none;border-radius:0;overflow:hidden;box-sizing:border-box}#lido-exit-button{padding:6px 14px;border:none;background:transparent;color:#fff;border-radius:6px;cursor:pointer;font-size:14px;position:absolute;top:0;right:0;z-index:15}canvas{touch-action:none;display:block;width:100%;height:100%;z-index:10}"}},[1,"lido-canvas",{bgImage:[1,"bg-image"],width:[1],height:[1],visible:[8],z:[1],x:[1],y:[1],onEntry:[1,"on-entry"],style:[32]}]);function a(){"undefined"!=typeof customElements&&["lido-canvas"].forEach((i=>{"lido-canvas"===i&&(customElements.get(t(i))||customElements.define(t(i),h))}))}a();export{h as L,a as d}
@@ -1 +1 @@
1
- import{t,p as i,H as o,d as e,e as s,S as a,s as l,C as r,A as n,f as c,g as d,j as h,h as p,c as u,b}from"./index.js";import{d as f}from"./p-CDhOF-lb.js";import{d as m}from"./p-DVn4BL1l.js";const x=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.onOk=e(this,"onOk"),this.width="479px",this.visible=!1,this.height="711px",this.objective="",this.onEntry="",this.x="0px",this.y="0px",this.bgColor="#60DADA",this.penIcon="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png",this.displayValue="",this.style={},this.userAnswers=[],this.tempInputs=[]}updateValueAttr(){this.el.setAttribute("value",this.displayValue)}componentWillLoad(){if(!this.objective){const t=this.el.closest("lido-container");t&&(this.objective=(t.getAttribute("objective")||"").replace("=","").trim())}this.updateValueAttr()}handleClick(t){"OK"===t?this.verifyAnswer():"←"===t?this.displayValue=this.displayValue.slice(0,-1):this.displayValue.length<8&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){var t;const i=this.displayValue.trim();if(!i)return;let o=!1;const e=this.el.closest("lido-container");if(!e)return;if(this.objective&&""!=this.objective&&!this.objective.includes(","))o=Number(i)===Number(this.objective);else if(this.objective&&this.objective.includes(",")){const t="true"===e.getAttribute("is-continue-on-correct"),s=this.objective.split(",").map((t=>t.trim())),a=this.userAnswers.length;a<s.length&&Number(i)===Number(s[a])&&(o=!0),t?o&&this.userAnswers.push(Number(i)):this.userAnswers.push(Number(i))}else if(""===this.objective){const t=e.getAttribute("equationCheck")||"";if(!t)return;try{const e=s(t);o=Number(e)===Number(i.trim())}catch(t){console.error("Error evaluating equation:",t),o=!1}}this.onOk.emit(o);const p=document.getElementById("btn-11");if(o){const s="nimbleTable"===e.getAttribute("template-id"),u=this.objective.includes(",");s&&u||e.setAttribute("game-completed","true"),this.tempInputs.push(i);const b=JSON.parse(null!==(t=e.getAttribute(a))&&void 0!==t?t:"[]"),f=Array.isArray(b)?b.filter((t=>""!==String(t).trim())):[],m=this.tempInputs[this.tempInputs.length-1];if(""!==String(m).trim()&&f.push(m),e.setAttribute(a,JSON.stringify(f)),p.style.pointerEvents="none",this.displayValue="",l(o,r),s&&u){const t=e.querySelector("[type='calculate']");t&&(t.getAttribute("audio")||"").trim()&&(t.style.boxShadow="none !important",t.setAttribute("onCorrect","this.speak='true'"),n.getI().play(t))}const x=(null==e?void 0:e.getAttribute("onCorrect"))||"";if(await c(x,e),!x.includes("scrollCellAfterEquationSolved"))if(u){const t=this.objective.split(",").map((t=>t.trim()));this.userAnswers.length>=t.length&&(e.setAttribute("game-completed","true"),d(),h())}else d(),h()}else{p.style.pointerEvents="none",this.displayValue="",l(o,r);const t=(null==e?void 0:e.getAttribute("onInCorrect"))||"",i=(null==e?void 0:e.getAttribute("onCorrect"))||"",s="true"===e.getAttribute("is-continue-on-correct");s?await c(t,e):await c(i,e),s||(e.setAttribute("game-completed","true"),d(),h())}p.style.pointerEvents="auto"}render(){return p(b,{key:"63cfc3e353a89b76ad809a921cc7b51ce6d06e93",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},p("lido-cell",{key:"66cc572079209533f8fd4f6c4ca76fdb9435b3b8",visible:"true",height:"94px",width:"60px"},p("lido-text",{key:"aca3392da8c74ab136268296f2ff584bf5cacd61",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"204%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},p("img",{key:"46275d788f7bb3132e657d4902d4471cc7928b39",src:u(this.penIcon),alt:"pen",style:{width:"100%",height:"100%"}}))),p("div",{key:"5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e",class:"lido-calculator-displayParent"},p("div",{key:"cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052",class:"lido-calculator-display"},this.displayValue)),p("div",{key:"64b70b100e8165dfe6d0dd9522b0362f12856a9e",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,i)=>p("lido-text",{id:`btn-${i}`,string:t,visible:"true",type:"click",class:{"lido-calculator-btn-special":"←"===t||"OK"===t,"lido-calculator-btn-default":"←"!==t&&"OK"!==t},onClick:()=>this.handleClick(t)})))))}get el(){return this}static get style(){return"#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{--btn-bg-color:#014D4D !important;background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{--btn-bg-color:#029A9A !important;background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:100px !important;height:88px !important;font-size:80px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}"}},[0,"lido-calculator",{width:[1],visible:[8],height:[1],objective:[1],onEntry:[1,"on-entry"],x:[1],y:[1],bgColor:[1,"bg-color"],penIcon:[1,"pen-icon"],displayValue:[32],style:[32]}]);function g(){"undefined"!=typeof customElements&&["lido-calculator","lido-cell","lido-text"].forEach((i=>{switch(i){case"lido-calculator":customElements.get(t(i))||customElements.define(t(i),x);break;case"lido-cell":customElements.get(t(i))||f();break;case"lido-text":customElements.get(t(i))||m()}}))}g();export{x as L,g as d}
1
+ import{t,p as i,H as o,d as e,e as s,S as a,s as l,C as r,A as n,f as c,g as d,j as h,h as p,c as u,b}from"./index.js";import{d as f}from"./p-Bw-OC9iR.js";import{d as m}from"./p-C2p0KZh4.js";const x=i(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.onOk=e(this,"onOk"),this.width="479px",this.visible=!1,this.height="711px",this.objective="",this.onEntry="",this.x="0px",this.y="0px",this.bgColor="#60DADA",this.penIcon="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/calculator/penIcon.png",this.displayValue="",this.style={},this.userAnswers=[],this.tempInputs=[]}updateValueAttr(){this.el.setAttribute("value",this.displayValue)}componentWillLoad(){if(!this.objective){const t=this.el.closest("lido-container");t&&(this.objective=(t.getAttribute("objective")||"").replace("=","").trim())}this.updateValueAttr()}handleClick(t){"OK"===t?this.verifyAnswer():"←"===t?this.displayValue=this.displayValue.slice(0,-1):this.displayValue.length<8&&(this.displayValue+=t),this.updateValueAttr()}async verifyAnswer(){var t;const i=this.displayValue.trim();if(!i)return;let o=!1;const e=this.el.closest("lido-container");if(!e)return;if(this.objective&&""!=this.objective&&!this.objective.includes(","))o=Number(i)===Number(this.objective);else if(this.objective&&this.objective.includes(",")){const t="true"===e.getAttribute("is-continue-on-correct"),s=this.objective.split(",").map((t=>t.trim())),a=this.userAnswers.length;a<s.length&&Number(i)===Number(s[a])&&(o=!0),t?o&&this.userAnswers.push(Number(i)):this.userAnswers.push(Number(i))}else if(""===this.objective){const t=e.getAttribute("equationCheck")||"";if(!t)return;try{const e=s(t);o=Number(e)===Number(i.trim())}catch(t){console.error("Error evaluating equation:",t),o=!1}}this.onOk.emit(o);const p=document.getElementById("btn-11");if(o){const s="nimbleTable"===e.getAttribute("template-id"),u=this.objective.includes(",");s&&u||e.setAttribute("game-completed","true"),this.tempInputs.push(i);const b=JSON.parse(null!==(t=e.getAttribute(a))&&void 0!==t?t:"[]"),f=Array.isArray(b)?b.filter((t=>""!==String(t).trim())):[],m=this.tempInputs[this.tempInputs.length-1];if(""!==String(m).trim()&&f.push(m),e.setAttribute(a,JSON.stringify(f)),p.style.pointerEvents="none",this.displayValue="",l(o,r),s&&u){const t=e.querySelector("[type='calculate']");t&&(t.getAttribute("audio")||"").trim()&&(t.style.boxShadow="none !important",t.setAttribute("onCorrect","this.speak='true'"),n.getI().play(t))}const x=(null==e?void 0:e.getAttribute("onCorrect"))||"";if(await c(x,e),!x.includes("scrollCellAfterEquationSolved"))if(u){const t=this.objective.split(",").map((t=>t.trim()));this.userAnswers.length>=t.length&&(e.setAttribute("game-completed","true"),d(),h())}else d(),h()}else{p.style.pointerEvents="none",this.displayValue="",l(o,r);const t=(null==e?void 0:e.getAttribute("onInCorrect"))||"",i=(null==e?void 0:e.getAttribute("onCorrect"))||"",s="true"===e.getAttribute("is-continue-on-correct");s?await c(t,e):await c(i,e),s||(e.setAttribute("game-completed","true"),d(),h())}p.style.pointerEvents="auto"}render(){return p(b,{key:"63cfc3e353a89b76ad809a921cc7b51ce6d06e93",onEntry:this.onEntry,id:"lidoCalculator",style:{width:this.width,height:this.height,backgroundColor:this.bgColor,left:this.x,top:this.y}},p("lido-cell",{key:"66cc572079209533f8fd4f6c4ca76fdb9435b3b8",visible:"true",height:"94px",width:"60px"},p("lido-text",{key:"aca3392da8c74ab136268296f2ff584bf5cacd61",visible:"true",id:"lido-calculator-penIcon",type:"click",height:"80px",x:"204%",width:"89px",onEntry:"this.position='relative';",class:"top-icon"},p("img",{key:"46275d788f7bb3132e657d4902d4471cc7928b39",src:u(this.penIcon),alt:"pen",style:{width:"100%",height:"100%"}}))),p("div",{key:"5adb6fbdefa7d9d8c4bd2ada68f580c8c1af298e",class:"lido-calculator-displayParent"},p("div",{key:"cca5a9c232f9d4dfa31e193e8d9eaddcd83a5052",class:"lido-calculator-display"},this.displayValue)),p("div",{key:"64b70b100e8165dfe6d0dd9522b0362f12856a9e",class:"lido-calculator-buttons"},["1","2","3","4","5","6","7","8","9","←","0","OK"].map(((t,i)=>p("lido-text",{id:`btn-${i}`,string:t,visible:"true",type:"click",class:{"lido-calculator-btn-special":"←"===t||"OK"===t,"lido-calculator-btn-default":"←"!==t&&"OK"!==t},onClick:()=>this.handleClick(t)})))))}get el(){return this}static get style(){return"#lidoCalculator{border-radius:19px;border:5px solid #029A9A;position:relative;display:flex;flex-direction:column;padding:2%;box-sizing:border-box}.lido-calculator-btn-special{--btn-bg-color:#014D4D !important;background-color:#014D4D !important;--btn-shadow-color:#0a2f2f !important}.lido-calculator-btn-default{--btn-bg-color:#029A9A !important;background-color:#029A9A !important;color:#000;--btn-shadow-color:#0f4242 !important}#lido-calculator-penIcon{--btn-bg-color:#FB7038 !important;--btn-shadow-px:0 8px 0 !important;--btn-shadow-color:#D74B12 !important;border-radius:5px !important}.lido-calculator-displayParent{width:89%;height:107px;background-color:rgb(68, 186, 186);border-radius:5px;margin:14px auto 17px auto;overflow:hidden;display:flex;align-items:end}.lido-calculator-display{width:97%;height:94px;background:#029A9A;color:#fff;text-align:right;display:flex;justify-content:flex-end;align-items:center;font-size:72px;font-weight:700;font-family:'Baloo Bhai 2', serif;border-radius:5px 0px 0px 5px;box-sizing:border-box;margin:0 0px -6px auto}.lido-calculator-buttons{flex:1;display:grid;grid-template-columns:repeat(3, 1fr);grid-auto-rows:1fr;gap:0%;width:100%;justify-items:center;align-items:center;position:relative;top:-1%}.lido-calculator-buttons lido-text{display:flex !important;justify-content:center;align-items:center;width:100px !important;height:88px !important;font-size:80px !important;font-weight:700 !important;color:#fff;border-radius:5px !important;cursor:pointer;text-align:center;line-height:1;box-sizing:border-box;transition:transform 0.1s}.lido-calculator-buttons lido-text:active{transform:scale(0.95)}"}},[0,"lido-calculator",{width:[1],visible:[8],height:[1],objective:[1],onEntry:[1,"on-entry"],x:[1],y:[1],bgColor:[1,"bg-color"],penIcon:[1,"pen-icon"],displayValue:[32],style:[32]}]);function g(){"undefined"!=typeof customElements&&["lido-calculator","lido-cell","lido-text"].forEach((i=>{switch(i){case"lido-calculator":customElements.get(t(i))||customElements.define(t(i),x);break;case"lido-cell":customElements.get(t(i))||f();break;case"lido-text":customElements.get(t(i))||m()}}))}g();export{x as L,g as d}
@@ -1 +1 @@
1
- import{t,p as i,H as s,i as o,a as e,h,b as a}from"./index.js";const n=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){o(this.el,this.type)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:e(this.height,t),width:e(this.width,t),backgroundColor:e(this.bgColor,t),top:e(this.y,t),left:e(this.x,t),zIndex:this.z,display:JSON.parse(e(`${this.visible}`,t))?"block":"none",margin:e(this.margin,t)}}render(){return h(a,{key:"6fe74859974f9ef71853a7cae126cc04108fcf75",id:this.id,class:"lido-pos",type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,value:this.value,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},h("slot",{key:"fab9cfb298d95a5899cadfa330ef44ba6057c5ad"}))}get el(){return this}static get style(){return".lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}"}},[260,"lido-pos",{id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],margin:[1],style:[32]}]);function r(){"undefined"!=typeof customElements&&["lido-pos"].forEach((i=>{"lido-pos"===i&&(customElements.get(t(i))||customElements.define(t(i),n))}))}r();export{n as L,r as d}
1
+ import{t,p as i,H as s,i as o,a as e,h,b as n}from"./index.js";const a=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.id="",this.value="",this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.onEntry="",this.minDrops=1,this.maxDrops=1,this.margin="",this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}componentDidLoad(){o(this.el,this.type)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:e(this.height,t),width:e(this.width,t),backgroundColor:e(this.bgColor,t),top:e(this.y,t),left:e(this.x,t),zIndex:this.z,display:JSON.parse(e(`${this.visible}`,t))?"block":"none",margin:e(this.margin,t)}}render(){return h(n,{key:"cfd38900b31991e89c21a099fc4f91f77663ae94",id:this.id,class:"lido-pos",type:this.type,"tab-index":this.tabIndex,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,minDrops:this.minDrops,maxDrops:this.maxDrops,value:this.value,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry},h("slot",{key:"73f7bfe2d8214693d6f40a4dab6d735906ad4eaa"}))}get el(){return this}static get style(){return".lido-pos{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);display:flex;justify-content:space-around;flex-direction:column;position:fixed}.lido-pos>*{position:absolute}"}},[260,"lido-pos",{id:[1],value:[1],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],onEntry:[1,"on-entry"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],margin:[1],style:[32]}]);function r(){"undefined"!=typeof customElements&&["lido-pos"].forEach((i=>{"lido-pos"===i&&(customElements.get(t(i))||customElements.define(t(i),a))}))}r();export{a as L,r as d}
@@ -1 +1 @@
1
- import{t,p as e,H as i,w as s,S as o,s as n,A as a,x as r,f as d,g as l,j as h,u as c,D as p,a as u,h as b,b as f}from"./index.js";import{d as y}from"./p-DVn4BL1l.js";const g=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.keys="",this.gap="10px",this.bgColor="",this.borderRadius="",this.keyboardInput=!1,this.columns="10",this.disableSpeak=!1,this.numberOfClick=0,this.inputString="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}async inputValidation(t){if("click"!==this.type)return;const e=document.getElementById(s);if(!t.target.getAttribute("value"))return;let i=JSON.parse(localStorage.getItem(o))||"";localStorage.setItem(o,JSON.stringify(i));const p=document.body.getBoundingClientRect(),u=Array.from(e.querySelectorAll(".bubble-element")).filter((t=>{const e=t.getBoundingClientRect();return e.left<p.right&&e.right>p.left&&e.top<p.bottom&&e.bottom>p.top})).find((t=>{const e=t.getAttribute("value");return(null==e?void 0:e.startsWith(this.inputString.toLowerCase()))?t:null}));if(u){if(this.inputString.toLowerCase()===u.getAttribute("value").toLowerCase()){n(!0),a.getI().play(u),r(u),setTimeout((()=>{this.inputString=""}),1e3);const t=u.getAttribute("onCorrect");if(await d(t,u),u.style.animation="none",u.style.pointerEvents="none",this.numberOfClick++,localStorage.removeItem(o),this.numberOfClick===this.letterLength){const t=e.getAttribute("onCorrect");e.style.pointerEvents="none",await d(t,this.el),l(),h()}else c(u)}}else{n(!1),setTimeout((()=>{this.inputString=""}),1e3),localStorage.removeItem(o);const t=e.getAttribute("onInCorrect");await d(t,this.el)}}componentDidLoad(){if(document.getElementById(s).getAttribute("drop-action")===p.InfiniteDrop){const t=this.el.querySelectorAll(".key-button"),e=t[0];t.forEach((t=>{t.style.width=e.offsetWidth+"px",t.style.height=e.offsetHeight+"px"}))}}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,fontSize:u(this.fontSize,t),fontFamily:this.fontFamily,color:u(this.fontColor,t),display:"true"===u(`${this.visible}`,t)?"flex":"none",margin:u(this.margin,t),padding:u(this.padding,t),borderRadius:u(this.borderRadius,t),columns:u(`${this.columns}`,t),gap:u(this.gap,t)}}render(){const t=this.keys.split(",").map((t=>t.trim())),e="true"===document.getElementById(s).getAttribute("show-check");return b(f,{key:"4de3b75fa2905744ad610d147d9b4fe9912dd732",class:"lido-keyboard",style:{width:this.style.width,height:this.style.height,position:"relative",margin:this.style.margin,zIndex:this.z}},this.keyboardInput&&b("div",{key:"7b5d293c52747700cde9c1069cfbbdae065e64f9",class:"input-area"},b("input",{key:"03a91cd87e6bb4f09bf698087258426dd9232f67",type:"text",value:this.inputString,class:"input-area",readonly:!0}),b("lido-text",{key:"d30e033a055df52b30b2f2775c2b3410ee37df63",visible:e?"true":"false",string:"<<","bg-color":"black","font-color":"white","border-radius":"20px","font-size":"30px",width:"100px",height:"70px",type:"click",onClick:()=>{this.inputString=this.inputString.slice(0,-1),this.inputValidation(event)}}),b("lido-text",{key:"70d78aed7dedbe7d03a05c13c4c320029280bb03",visible:e?"true":"false",id:"lido-checkButton",string:"Enter","bg-color":"green","font-color":"white","border-radius":"20px","font-size":"30px",width:"150px",height:"70px",type:"click"})),this.letterLength&&b("lido-text",{key:"19306cd12bd98dc8dc7b54b20bad3f2f0318116f",visible:"true",string:`${this.numberOfClick}/${this.letterLength}`,"font-size":"60px","font-color":"white",onEntry:"this.position='absolute'; this.right='0'; this.fontWeight='800';",x:"unset"}),b("div",{key:"826900d6ba26175eb45d2e7e4c02fccce2004db3",class:"keyboard-wrapper",style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"stretch",gap:this.gap,width:"100%",height:"100%"}},t.map(((t,e)=>{const[i,s]=t.split("-"),o="disable"===s;let n="Space"===i?" ":i;return b("lido-text",{id:"key-button-"+e,style:{flex:`0 0 calc(${100/parseInt(this.style.columns)}% - ${this.style.gap})`},visible:"true","font-size":this.style.fontSize,"font-color":this.fontColor,"font-family":this.fontFamily,"bg-color":this.bgColor,string:i,onEntry:this.onEntry,"border-radius":this.style.borderRadius,value:i.toLowerCase(),type:this.type,class:"key-button"+(o?" disabled":""),onClick:()=>{this.inputString+=n,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return this}static get style(){return'.lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type="text"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}'}},[0,"lido-keyboard",{keys:[1],width:[1],height:[1],fontSize:[1,"font-size"],fontColor:[1,"font-color"],fontFamily:[1,"font-family"],gap:[1],bgColor:[1,"bg-color"],borderRadius:[1,"border-radius"],y:[1],x:[1],z:[1],margin:[1],padding:[1],visible:[1],onEntry:[1,"on-entry"],type:[1],keyboardInput:[4,"keyboard-input"],columns:[1],letterLength:[2,"letter-length"],disableSpeak:[4,"disable-speak"],numberOfClick:[32],inputString:[32],style:[32]}]);function x(){"undefined"!=typeof customElements&&["lido-keyboard","lido-text"].forEach((e=>{switch(e){case"lido-keyboard":customElements.get(t(e))||customElements.define(t(e),g);break;case"lido-text":customElements.get(t(e))||y()}}))}x();export{g as L,x as d}
1
+ import{t,p as e,H as i,w as s,S as o,s as n,A as a,x as r,f as d,g as l,j as h,u as c,D as p,a as u,h as b,b as f}from"./index.js";import{d as y}from"./p-C2p0KZh4.js";const g=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.keys="",this.gap="10px",this.bgColor="",this.borderRadius="",this.keyboardInput=!1,this.columns="10",this.disableSpeak=!1,this.numberOfClick=0,this.inputString="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles()}async inputValidation(t){if("click"!==this.type)return;const e=document.getElementById(s);if(!t.target.getAttribute("value"))return;let i=JSON.parse(localStorage.getItem(o))||"";localStorage.setItem(o,JSON.stringify(i));const p=document.body.getBoundingClientRect(),u=Array.from(e.querySelectorAll(".bubble-element")).filter((t=>{const e=t.getBoundingClientRect();return e.left<p.right&&e.right>p.left&&e.top<p.bottom&&e.bottom>p.top})).find((t=>{const e=t.getAttribute("value");return(null==e?void 0:e.startsWith(this.inputString.toLowerCase()))?t:null}));if(u){if(this.inputString.toLowerCase()===u.getAttribute("value").toLowerCase()){n(!0),a.getI().play(u),r(u),setTimeout((()=>{this.inputString=""}),1e3);const t=u.getAttribute("onCorrect");if(await d(t,u),u.style.animation="none",u.style.pointerEvents="none",this.numberOfClick++,localStorage.removeItem(o),this.numberOfClick===this.letterLength){const t=e.getAttribute("onCorrect");e.style.pointerEvents="none",await d(t,this.el),l(),h()}else c(u)}}else{n(!1),setTimeout((()=>{this.inputString=""}),1e3),localStorage.removeItem(o);const t=e.getAttribute("onInCorrect");await d(t,this.el)}}componentDidLoad(){if(document.getElementById(s).getAttribute("drop-action")===p.InfiniteDrop){const t=this.el.querySelectorAll(".key-button"),e=t[0];t.forEach((t=>{t.style.width=e.offsetWidth+"px",t.style.height=e.offsetHeight+"px"}))}}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:u(this.height,t),width:u(this.width,t),backgroundColor:u(this.bgColor,t),top:u(this.y,t),left:u(this.x,t),zIndex:this.z,fontSize:u(this.fontSize,t),fontFamily:this.fontFamily,color:u(this.fontColor,t),display:"true"===u(`${this.visible}`,t)?"flex":"none",margin:u(this.margin,t),padding:u(this.padding,t),borderRadius:u(this.borderRadius,t),columns:u(`${this.columns}`,t),gap:u(this.gap,t)}}render(){const t=this.keys.split(",").map((t=>t.trim())),e="true"===document.getElementById(s).getAttribute("show-check");return b(f,{key:"4de3b75fa2905744ad610d147d9b4fe9912dd732",class:"lido-keyboard",style:{width:this.style.width,height:this.style.height,position:"relative",margin:this.style.margin,zIndex:this.z}},this.keyboardInput&&b("div",{key:"7b5d293c52747700cde9c1069cfbbdae065e64f9",class:"input-area"},b("input",{key:"03a91cd87e6bb4f09bf698087258426dd9232f67",type:"text",value:this.inputString,class:"input-area",readonly:!0}),b("lido-text",{key:"d30e033a055df52b30b2f2775c2b3410ee37df63",visible:e?"true":"false",string:"<<","bg-color":"black","font-color":"white","border-radius":"20px","font-size":"30px",width:"100px",height:"70px",type:"click",onClick:()=>{this.inputString=this.inputString.slice(0,-1),this.inputValidation(event)}}),b("lido-text",{key:"70d78aed7dedbe7d03a05c13c4c320029280bb03",visible:e?"true":"false",id:"lido-checkButton",string:"Enter","bg-color":"green","font-color":"white","border-radius":"20px","font-size":"30px",width:"150px",height:"70px",type:"click"})),this.letterLength&&b("lido-text",{key:"19306cd12bd98dc8dc7b54b20bad3f2f0318116f",visible:"true",string:`${this.numberOfClick}/${this.letterLength}`,"font-size":"60px","font-color":"white",onEntry:"this.position='absolute'; this.right='0'; this.fontWeight='800';",x:"unset"}),b("div",{key:"826900d6ba26175eb45d2e7e4c02fccce2004db3",class:"keyboard-wrapper",style:{display:"flex",flexWrap:"wrap",justifyContent:"center",alignContent:"stretch",gap:this.gap,width:"100%",height:"100%"}},t.map(((t,e)=>{const[i,s]=t.split("-"),o="disable"===s;let n="Space"===i?" ":i;return b("lido-text",{id:"key-button-"+e,style:{flex:`0 0 calc(${100/parseInt(this.style.columns)}% - ${this.style.gap})`},visible:"true","font-size":this.style.fontSize,"font-color":this.fontColor,"font-family":this.fontFamily,"bg-color":this.bgColor,string:i,onEntry:this.onEntry,"border-radius":this.style.borderRadius,value:i.toLowerCase(),type:this.type,class:"key-button"+(o?" disabled":""),onClick:()=>{this.inputString+=n,this.inputValidation(event)},"disable-speak":this.disableSpeak})}))))}get el(){return this}static get style(){return'.lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type="text"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}'}},[0,"lido-keyboard",{keys:[1],width:[1],height:[1],fontSize:[1,"font-size"],fontColor:[1,"font-color"],fontFamily:[1,"font-family"],gap:[1],bgColor:[1,"bg-color"],borderRadius:[1,"border-radius"],y:[1],x:[1],z:[1],margin:[1],padding:[1],visible:[1],onEntry:[1,"on-entry"],type:[1],keyboardInput:[4,"keyboard-input"],columns:[1],letterLength:[2,"letter-length"],disableSpeak:[4,"disable-speak"],numberOfClick:[32],inputString:[32],style:[32]}]);function x(){"undefined"!=typeof customElements&&["lido-keyboard","lido-text"].forEach((e=>{switch(e){case"lido-keyboard":customElements.get(t(e))||customElements.define(t(e),g);break;case"lido-text":customElements.get(t(e))||y()}}))}x();export{g as L,x as d}