@lukso/web-components 1.172.13 → 1.172.14

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 (126) hide show
  1. package/dist/chunks/cn-LM_JlZIN.js +36 -0
  2. package/dist/chunks/cn-zamUNFMe.js +39 -0
  3. package/dist/chunks/directive-CY66atYi.js +22 -0
  4. package/dist/chunks/directive-DUHAbymA.js +15 -0
  5. package/dist/chunks/index-BNt_JinF.js +212 -0
  6. package/dist/chunks/{index-DG4rMUh3.js → index-BOEPqh0N.js} +1 -1
  7. package/dist/chunks/{index-F8ll4iy2.js → index-C5S-_QDF.js} +1 -1
  8. package/dist/chunks/{index-B_H2eYG_.js → index-CA6SrfZ-.js} +9 -8
  9. package/dist/chunks/{index-CZGvLdJ0.js → index-CqZm8OfY.js} +1 -2
  10. package/dist/chunks/index-Cy2_2lFt.js +214 -0
  11. package/dist/chunks/{index-Dn2DJhID.js → index-Ds-r8fCt.js} +77 -74
  12. package/dist/chunks/{index-C5YyB6ug.js → index-DvLZWpq9.js} +2 -3
  13. package/dist/chunks/{index-D_5wz2k1.js → index-UVrFZqIM.js} +79 -76
  14. package/dist/chunks/{index-BHAtoIlu.js → index-cakeic-M.js} +9 -8
  15. package/dist/chunks/{style-map-B7XFhSOK.js → style-map-AEeBQfPb.js} +2 -3
  16. package/dist/chunks/{style-map-BPljJihp.js → style-map-auscxO0L.js} +1 -2
  17. package/dist/components/index.cjs +4 -5
  18. package/dist/components/index.js +4 -5
  19. package/dist/components/lukso-alert/index.cjs +16 -15
  20. package/dist/components/lukso-alert/index.js +16 -15
  21. package/dist/components/lukso-button/index.cjs +42 -40
  22. package/dist/components/lukso-button/index.js +39 -37
  23. package/dist/components/lukso-card/index.cjs +66 -71
  24. package/dist/components/lukso-card/index.js +48 -53
  25. package/dist/components/lukso-checkbox/index.cjs +27 -26
  26. package/dist/components/lukso-checkbox/index.js +27 -26
  27. package/dist/components/lukso-collapse/index.cjs +27 -26
  28. package/dist/components/lukso-collapse/index.js +26 -25
  29. package/dist/components/lukso-color-picker/index.cjs +33 -31
  30. package/dist/components/lukso-color-picker/index.js +32 -30
  31. package/dist/components/lukso-dropdown/index.cjs +20 -19
  32. package/dist/components/lukso-dropdown/index.js +20 -19
  33. package/dist/components/lukso-dropdown-option/index.cjs +12 -11
  34. package/dist/components/lukso-dropdown-option/index.js +12 -11
  35. package/dist/components/lukso-footer/index.cjs +5 -4
  36. package/dist/components/lukso-footer/index.js +5 -4
  37. package/dist/components/lukso-form-description/index.cjs +7 -6
  38. package/dist/components/lukso-form-description/index.js +7 -6
  39. package/dist/components/lukso-form-error/index.cjs +7 -6
  40. package/dist/components/lukso-form-error/index.js +7 -6
  41. package/dist/components/lukso-form-label/index.cjs +8 -7
  42. package/dist/components/lukso-form-label/index.js +8 -7
  43. package/dist/components/lukso-icon/index.cjs +268 -267
  44. package/dist/components/lukso-icon/index.js +268 -267
  45. package/dist/components/lukso-image/index.cjs +12 -12
  46. package/dist/components/lukso-image/index.js +12 -12
  47. package/dist/components/lukso-input/index.cjs +49 -47
  48. package/dist/components/lukso-input/index.js +48 -46
  49. package/dist/components/lukso-markdown/index.cjs +13 -83
  50. package/dist/components/lukso-markdown/index.js +13 -83
  51. package/dist/components/lukso-markdown-editor/index.cjs +68 -67
  52. package/dist/components/lukso-markdown-editor/index.js +67 -66
  53. package/dist/components/lukso-modal/index.cjs +12 -11
  54. package/dist/components/lukso-modal/index.js +11 -10
  55. package/dist/components/lukso-navbar/index.cjs +30 -30
  56. package/dist/components/lukso-navbar/index.js +30 -30
  57. package/dist/components/lukso-pagination/index.cjs +16 -16
  58. package/dist/components/lukso-pagination/index.js +16 -16
  59. package/dist/components/lukso-profile/index.cjs +162 -11
  60. package/dist/components/lukso-profile/index.js +165 -5
  61. package/dist/components/lukso-progress/index.cjs +16 -13
  62. package/dist/components/lukso-progress/index.js +13 -10
  63. package/dist/components/lukso-qr-code/index.cjs +17 -34
  64. package/dist/components/lukso-qr-code/index.js +16 -33
  65. package/dist/components/lukso-radio/index.cjs +27 -25
  66. package/dist/components/lukso-radio/index.js +25 -23
  67. package/dist/components/lukso-radio-group/index.cjs +9 -9
  68. package/dist/components/lukso-radio-group/index.js +9 -9
  69. package/dist/components/lukso-sanitize/index.cjs +5 -4
  70. package/dist/components/lukso-sanitize/index.js +5 -4
  71. package/dist/components/lukso-search/index.cjs +11 -8
  72. package/dist/components/lukso-search/index.js +11 -8
  73. package/dist/components/lukso-select/index.cjs +47 -46
  74. package/dist/components/lukso-select/index.js +46 -45
  75. package/dist/components/lukso-share/index.cjs +7 -6
  76. package/dist/components/lukso-share/index.js +7 -6
  77. package/dist/components/lukso-switch/index.cjs +16 -15
  78. package/dist/components/lukso-switch/index.js +16 -15
  79. package/dist/components/lukso-tag/index.cjs +13 -12
  80. package/dist/components/lukso-tag/index.js +12 -11
  81. package/dist/components/lukso-terms/index.cjs +9 -8
  82. package/dist/components/lukso-terms/index.js +9 -8
  83. package/dist/components/lukso-textarea/index.cjs +36 -34
  84. package/dist/components/lukso-textarea/index.js +35 -33
  85. package/dist/components/lukso-tooltip/index.cjs +27 -3461
  86. package/dist/components/lukso-tooltip/index.js +27 -3461
  87. package/dist/components/lukso-username/index.cjs +11 -7
  88. package/dist/components/lukso-username/index.js +11 -7
  89. package/dist/components/lukso-wizard/index.cjs +13 -12
  90. package/dist/components/lukso-wizard/index.js +11 -10
  91. package/dist/index.cjs +6 -6
  92. package/dist/index.js +5 -5
  93. package/dist/shared/tailwind-element/index.cjs +15 -3
  94. package/dist/shared/tailwind-element/index.js +17 -1
  95. package/dist/vite.full.config.d.ts.map +1 -1
  96. package/package.json +7 -1
  97. package/dist/chunks/_commonjsHelpers-B85MJLTf.js +0 -5
  98. package/dist/chunks/_commonjsHelpers-CFO10eej.js +0 -7
  99. package/dist/chunks/axe-DJKac19y.js +0 -35093
  100. package/dist/chunks/axe-MHuN9KU0.js +0 -35097
  101. package/dist/chunks/base-Bn-zDNuZ.js +0 -93
  102. package/dist/chunks/base-Cl6v8-BZ.js +0 -8
  103. package/dist/chunks/base-KJhhKWYy.js +0 -91
  104. package/dist/chunks/base-NFGX42U4.js +0 -10
  105. package/dist/chunks/chunk-LQIOVPBE-CGhQ79Di.js +0 -370
  106. package/dist/chunks/chunk-LQIOVPBE-kQFZF_OS.js +0 -372
  107. package/dist/chunks/directive-BKuZRRPO.js +0 -8
  108. package/dist/chunks/directive-DT5Y-Nw0.js +0 -12
  109. package/dist/chunks/index-5X9ujrWL.js +0 -41
  110. package/dist/chunks/index-B9iart53.js +0 -2545
  111. package/dist/chunks/index-BAf8Hzhe.js +0 -611
  112. package/dist/chunks/index-BBFSnMaE.js +0 -1345
  113. package/dist/chunks/index-BDyLu6M0.js +0 -609
  114. package/dist/chunks/index-BxQ_0s_1.js +0 -50
  115. package/dist/chunks/index-CaJky2qL.js +0 -2547
  116. package/dist/chunks/index-glHBylgQ.js +0 -1347
  117. package/dist/chunks/isAddress-B1R_6-uN.js +0 -745
  118. package/dist/chunks/isAddress-BUdSrCaY.js +0 -743
  119. package/dist/chunks/property-D6IL6zax.js +0 -11
  120. package/dist/chunks/property-DfumgIL6.js +0 -9
  121. package/dist/chunks/query-CHb9Ft_d.js +0 -9
  122. package/dist/chunks/query-D3HF7Pde.js +0 -11
  123. package/dist/chunks/state-CFjY89m3.js +0 -11
  124. package/dist/chunks/state-CaelFSbE.js +0 -9
  125. package/dist/chunks/unsafe-html-BHBLEMoa.js +0 -10
  126. package/dist/chunks/unsafe-html-DiwkOQlV.js +0 -12
@@ -1,609 +0,0 @@
1
- import { T as TailwindElement, x } from './index-5X9ujrWL.js';
2
- import { n } from './property-DfumgIL6.js';
3
- import { g as getDefaultExportFromCjs } from './_commonjsHelpers-B85MJLTf.js';
4
- import { c as ce } from './index-B9iart53.js';
5
- import { s as safeCustomElement } from './safe-custom-element-qdGIR_v6.js';
6
- import '../components/lukso-image/index.js';
7
-
8
- var main$1 = {exports: {}};
9
-
10
- var main = main$1.exports;
11
-
12
- var hasRequiredMain;
13
-
14
- function requireMain () {
15
- if (hasRequiredMain) return main$1.exports;
16
- hasRequiredMain = 1;
17
- (function (module, exports) {
18
- (function webpackUniversalModuleDefinition(root, factory) {
19
- module.exports = factory();
20
- })(main, function() {
21
- return /******/ (function(modules) { // webpackBootstrap
22
- /******/ // The module cache
23
- /******/ var installedModules = {};
24
-
25
- /******/ // The require function
26
- /******/ function __webpack_require__(moduleId) {
27
-
28
- /******/ // Check if module is in cache
29
- /******/ if(installedModules[moduleId])
30
- /******/ return installedModules[moduleId].exports;
31
-
32
- /******/ // Create a new module (and put it into the cache)
33
- /******/ var module = installedModules[moduleId] = {
34
- /******/ exports: {},
35
- /******/ id: moduleId,
36
- /******/ loaded: false
37
- /******/ };
38
-
39
- /******/ // Execute the module function
40
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
41
-
42
- /******/ // Flag the module as loaded
43
- /******/ module.loaded = true;
44
-
45
- /******/ // Return the exports of the module
46
- /******/ return module.exports;
47
- /******/ }
48
-
49
-
50
- /******/ // expose the modules object (__webpack_modules__)
51
- /******/ __webpack_require__.m = modules;
52
-
53
- /******/ // expose the module cache
54
- /******/ __webpack_require__.c = installedModules;
55
-
56
- /******/ // __webpack_public_path__
57
- /******/ __webpack_require__.p = "";
58
-
59
- /******/ // Load entry module and return exports
60
- /******/ return __webpack_require__(0);
61
- /******/ })
62
- /************************************************************************/
63
- /******/ ([
64
- /* 0 */
65
- /***/ function(module, exports, __webpack_require__) {
66
-
67
- const pnglib = __webpack_require__(1);
68
- const hsl2rgb = __webpack_require__(2);
69
-
70
- // The random number is a js implementation of the Xorshift PRNG
71
- const randseed = new Array(4); // Xorshift: [x, y, z, w] 32 bit values
72
-
73
- function seedrand(seed) {
74
- for (let i = 0; i < randseed.length; i++) {
75
- randseed[i] = 0;
76
- }
77
- for (let i = 0; i < seed.length; i++) {
78
- randseed[i % 4] = (randseed[i % 4] << 5) - randseed[i % 4] + seed.charCodeAt(i);
79
- }
80
- }
81
-
82
- function rand() {
83
- // based on Java's String.hashCode(), expanded to 4 32bit values
84
- const t = randseed[0] ^ (randseed[0] << 11);
85
-
86
- randseed[0] = randseed[1];
87
- randseed[1] = randseed[2];
88
- randseed[2] = randseed[3];
89
- randseed[3] = randseed[3] ^ (randseed[3] >> 19) ^ t ^ (t >> 8);
90
-
91
- return (randseed[3] >>> 0) / (1 << 31 >>> 0);
92
- }
93
-
94
- function createColor() {
95
- //saturation is the whole color spectrum
96
- const h = Math.floor(rand() * 360);
97
- //saturation goes from 40 to 100, it avoids greyish colors
98
- const s = rand() * 60 + 40;
99
- //lightness can be anything from 0 to 100, but probabilities are a bell curve around 50%
100
- const l = (rand() + rand() + rand() + rand()) * 25 ;
101
-
102
- return [h / 360, s / 100, l / 100];
103
- }
104
-
105
- function createImageData(size) {
106
- const width = size; // Only support square icons for now
107
- const height = size;
108
-
109
- const dataWidth = Math.ceil(width / 2);
110
- const mirrorWidth = width - dataWidth;
111
-
112
- const data = [];
113
- for (let y = 0; y < height; y++) {
114
- let row = [];
115
- for (let x = 0; x < dataWidth; x++) {
116
- // this makes foreground and background color to have a 43% (1/2.3) probability
117
- // spot color has 13% chance
118
- row[x] = Math.floor(rand() * 2.3);
119
- }
120
- const r = row.slice(0, mirrorWidth).reverse();
121
- row = row.concat(r);
122
-
123
- for (let i = 0; i < row.length; i++) {
124
- data.push(row[i]);
125
- }
126
- }
127
-
128
- return data;
129
- }
130
-
131
- // Modifies the passed PNG to fill in a specified rectangle
132
- function fillRect(png, x, y, w, h, color) {
133
- for(let i = 0; i < w; i++) {
134
- for (let j = 0; j < h; j++) {
135
- png.buffer[png.index(x + i, y + j)] = color;
136
- }
137
- }
138
- }
139
-
140
- function buildOpts(opts) {
141
- if (!opts.seed) {
142
- throw new Error('No seed provided');
143
- }
144
-
145
- seedrand(opts.seed);
146
-
147
- return Object.assign({
148
- size: 8,
149
- scale: 16,
150
- color: createColor(),
151
- bgcolor: createColor(),
152
- spotcolor: createColor(),
153
- }, opts)
154
- }
155
-
156
- function makeBlockie(address) {
157
- const opts = buildOpts({ seed: address.toLowerCase() });
158
-
159
- const imageData = createImageData(opts.size);
160
- const width = Math.sqrt(imageData.length);
161
-
162
- const p = new pnglib(opts.size * opts.scale, opts.size * opts.scale, 3);
163
- p.color(...hsl2rgb(...opts.bgcolor));
164
- const color = p.color(...hsl2rgb(...opts.color));
165
- const spotcolor = p.color(...hsl2rgb(...opts.spotcolor));
166
-
167
- for (let i = 0; i < imageData.length; i++) {
168
- const row = Math.floor(i / width);
169
- const col = i % width;
170
- // if data is 0, leave the background
171
- if (imageData[i]) {
172
- // if data is 2, choose spot color, if 1 choose foreground
173
- const pngColor = imageData[i] == 1 ? color : spotcolor;
174
- fillRect(p, col * opts.scale, row * opts.scale, opts.scale, opts.scale, pngColor);
175
- }
176
- }
177
- return `data:image/png;base64,${p.getBase64()}`;
178
- }
179
-
180
- module.exports = makeBlockie;
181
-
182
-
183
- /***/ },
184
- /* 1 */
185
- /***/ function(module, exports) {
186
-
187
- /**
188
- * A handy class to calculate color values.
189
- *
190
- * @version 1.0
191
- * @author Robert Eisele <robert@xarg.org>
192
- * @copyright Copyright (c) 2010, Robert Eisele
193
- * @link http://www.xarg.org/2010/03/generate-client-side-png-files-using-javascript/
194
- * @license http://www.opensource.org/licenses/bsd-license.php BSD License
195
- *
196
- */
197
-
198
- // Modified by George Chan <gchan@21cn.com>
199
-
200
- // Further modified by Will O'B <@wbobeirne> to make it
201
- // UglifyJS and "use strict"; friendly
202
-
203
- module.exports = function(width,height,depth) {
204
-
205
-
206
- // helper functions for that ctx
207
- function write(buffer, offs) {
208
- for (var i = 2; i < arguments.length; i++) {
209
- for (var j = 0; j < arguments[i].length; j++) {
210
- buffer[offs++] = arguments[i].charAt(j);
211
- }
212
- }
213
- }
214
-
215
- function byte2(w) {
216
- return String.fromCharCode((w >> 8) & 255, w & 255);
217
- }
218
-
219
- function byte4(w) {
220
- return String.fromCharCode((w >> 24) & 255, (w >> 16) & 255, (w >> 8) & 255, w & 255);
221
- }
222
-
223
- function byte2lsb(w) {
224
- return String.fromCharCode(w & 255, (w >> 8) & 255);
225
- }
226
-
227
- this.width = width;
228
- this.height = height;
229
- this.depth = depth;
230
-
231
- // pixel data and row filter identifier size
232
- this.pix_size = height * (width + 1);
233
-
234
- // deflate header, pix_size, block headers, adler32 checksum
235
- this.data_size = 2 + this.pix_size + 5 * Math.floor((0xfffe + this.pix_size) / 0xffff) + 4;
236
-
237
- // offsets and sizes of Png chunks
238
- this.ihdr_offs = 0; // IHDR offset and size
239
- this.ihdr_size = 4 + 4 + 13 + 4;
240
- this.plte_offs = this.ihdr_offs + this.ihdr_size; // PLTE offset and size
241
- this.plte_size = 4 + 4 + 3 * depth + 4;
242
- this.trns_offs = this.plte_offs + this.plte_size; // tRNS offset and size
243
- this.trns_size = 4 + 4 + depth + 4;
244
- this.idat_offs = this.trns_offs + this.trns_size; // IDAT offset and size
245
- this.idat_size = 4 + 4 + this.data_size + 4;
246
- this.iend_offs = this.idat_offs + this.idat_size; // IEND offset and size
247
- this.iend_size = 4 + 4 + 4;
248
- this.buffer_size = this.iend_offs + this.iend_size; // total PNG size
249
-
250
- this.buffer = new Array();
251
- this.palette = new Object();
252
- this.pindex = 0;
253
-
254
- var _crc32 = new Array();
255
-
256
- // initialize buffer with zero bytes
257
- for (var i = 0; i < this.buffer_size; i++) {
258
- this.buffer[i] = "\x00";
259
- }
260
-
261
- // initialize non-zero elements
262
- write(this.buffer, this.ihdr_offs, byte4(this.ihdr_size - 12), 'IHDR', byte4(width), byte4(height), "\x08\x03");
263
- write(this.buffer, this.plte_offs, byte4(this.plte_size - 12), 'PLTE');
264
- write(this.buffer, this.trns_offs, byte4(this.trns_size - 12), 'tRNS');
265
- write(this.buffer, this.idat_offs, byte4(this.idat_size - 12), 'IDAT');
266
- write(this.buffer, this.iend_offs, byte4(this.iend_size - 12), 'IEND');
267
-
268
- // initialize deflate header
269
- var header = ((8 + (7 << 4)) << 8) | (3 << 6);
270
- header+= 31 - (header % 31);
271
-
272
- write(this.buffer, this.idat_offs + 8, byte2(header));
273
-
274
- // initialize deflate block headers
275
- for (var i = 0; (i << 16) - 1 < this.pix_size; i++) {
276
- var size, bits;
277
- if (i + 0xffff < this.pix_size) {
278
- size = 0xffff;
279
- bits = "\x00";
280
- } else {
281
- size = this.pix_size - (i << 16) - i;
282
- bits = "\x01";
283
- }
284
- write(this.buffer, this.idat_offs + 8 + 2 + (i << 16) + (i << 2), bits, byte2lsb(size), byte2lsb(~size));
285
- }
286
-
287
- /* Create crc32 lookup table */
288
- for (var i = 0; i < 256; i++) {
289
- var c = i;
290
- for (var j = 0; j < 8; j++) {
291
- if (c & 1) {
292
- c = -306674912 ^ ((c >> 1) & 0x7fffffff);
293
- } else {
294
- c = (c >> 1) & 0x7fffffff;
295
- }
296
- }
297
- _crc32[i] = c;
298
- }
299
-
300
- // compute the index into a png for a given pixel
301
- this.index = function(x,y) {
302
- var i = y * (this.width + 1) + x + 1;
303
- var j = this.idat_offs + 8 + 2 + 5 * Math.floor((i / 0xffff) + 1) + i;
304
- return j;
305
- };
306
-
307
- // convert a color and build up the palette
308
- this.color = function(red, green, blue, alpha) {
309
-
310
- alpha = alpha >= 0 ? alpha : 255;
311
- var color = (((((alpha << 8) | red) << 8) | green) << 8) | blue;
312
-
313
- if (typeof this.palette[color] == "undefined") {
314
- if (this.pindex == this.depth) return "\x00";
315
-
316
- var ndx = this.plte_offs + 8 + 3 * this.pindex;
317
-
318
- this.buffer[ndx + 0] = String.fromCharCode(red);
319
- this.buffer[ndx + 1] = String.fromCharCode(green);
320
- this.buffer[ndx + 2] = String.fromCharCode(blue);
321
- this.buffer[this.trns_offs+8+this.pindex] = String.fromCharCode(alpha);
322
-
323
- this.palette[color] = String.fromCharCode(this.pindex++);
324
- }
325
- return this.palette[color];
326
- };
327
-
328
- // output a PNG string, Base64 encoded
329
- this.getBase64 = function() {
330
-
331
- var s = this.getDump();
332
-
333
- var ch = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
334
- var c1, c2, c3, e1, e2, e3, e4;
335
- var l = s.length;
336
- var i = 0;
337
- var r = "";
338
-
339
- do {
340
- c1 = s.charCodeAt(i);
341
- e1 = c1 >> 2;
342
- c2 = s.charCodeAt(i+1);
343
- e2 = ((c1 & 3) << 4) | (c2 >> 4);
344
- c3 = s.charCodeAt(i+2);
345
- if (l < i+2) { e3 = 64; } else { e3 = ((c2 & 0xf) << 2) | (c3 >> 6); }
346
- if (l < i+3) { e4 = 64; } else { e4 = c3 & 0x3f; }
347
- r+= ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);
348
- } while ((i+= 3) < l);
349
- return r;
350
- };
351
-
352
- // output a PNG string
353
- this.getDump = function() {
354
- // compute adler32 of output pixels + row filter bytes
355
- var BASE = 65521; /* largest prime smaller than 65536 */
356
- var NMAX = 5552; /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
357
- var s1 = 1;
358
- var s2 = 0;
359
- var n = NMAX;
360
-
361
- for (var y = 0; y < this.height; y++) {
362
- for (var x = -1; x < this.width; x++) {
363
- s1+= this.buffer[this.index(x, y)].charCodeAt(0);
364
- s2+= s1;
365
- if ((n-= 1) == 0) {
366
- s1%= BASE;
367
- s2%= BASE;
368
- n = NMAX;
369
- }
370
- }
371
- }
372
- s1%= BASE;
373
- s2%= BASE;
374
- write(this.buffer, this.idat_offs + this.idat_size - 8, byte4((s2 << 16) | s1));
375
-
376
- // compute crc32 of the PNG chunks
377
- function crc32(png, offs, size) {
378
- var crc = -1;
379
- for (var i = 4; i < size-4; i += 1) {
380
- crc = _crc32[(crc ^ png[offs+i].charCodeAt(0)) & 0xff] ^ ((crc >> 8) & 0x00ffffff);
381
- }
382
- write(png, offs+size-4, byte4(crc ^ -1));
383
- }
384
-
385
- crc32(this.buffer, this.ihdr_offs, this.ihdr_size);
386
- crc32(this.buffer, this.plte_offs, this.plte_size);
387
- crc32(this.buffer, this.trns_offs, this.trns_size);
388
- crc32(this.buffer, this.idat_offs, this.idat_size);
389
- crc32(this.buffer, this.iend_offs, this.iend_size);
390
-
391
- // convert PNG to string
392
- return "\x89PNG\r\n\x1a\n" + this.buffer.join('');
393
- };
394
- };
395
-
396
-
397
- /***/ },
398
- /* 2 */
399
- /***/ function(module, exports) {
400
-
401
- // https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
402
- /**
403
- * Converts an HSL color value to RGB. Conversion formula
404
- * adapted from http://en.wikipedia.org/wiki/HSL_color_space.
405
- * Assumes h, s, and l are contained in the set [0, 1] and
406
- * returns r, g, and b in the set [0, 255].
407
- *
408
- * @param {number} h The hue
409
- * @param {number} s The saturation
410
- * @param {number} l The lightness
411
- * @return {Array} The RGB representation
412
- */
413
-
414
- function hue2rgb(p, q, t) {
415
- if(t < 0) t += 1;
416
- if(t > 1) t -= 1;
417
- if(t < 1/6) return p + (q - p) * 6 * t;
418
- if(t < 1/2) return q;
419
- if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
420
- return p;
421
- }
422
-
423
- function hsl2rgb(h, s, l){
424
- let r, g, b;
425
-
426
- if (s == 0) {
427
- r = g = b = l; // achromatic
428
- } else {
429
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
430
- const p = 2 * l - q;
431
- r = hue2rgb(p, q, h + 1/3);
432
- g = hue2rgb(p, q, h);
433
- b = hue2rgb(p, q, h - 1/3);
434
- }
435
-
436
- return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), 255];
437
- }
438
-
439
- module.exports = hsl2rgb;
440
-
441
-
442
- /***/ }
443
- /******/ ])
444
- });
445
- } (main$1));
446
- return main$1.exports;
447
- }
448
-
449
- var mainExports = requireMain();
450
- const makeBlockie = /*@__PURE__*/getDefaultExportFromCjs(mainExports);
451
-
452
- var __defProp = Object.defineProperty;
453
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
454
- var __decorateClass = (decorators, target, key, kind) => {
455
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
456
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
457
- if (decorator = decorators[i])
458
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
459
- if (kind && result) __defProp(target, key, result);
460
- return result;
461
- };
462
- let LuksoProfile = class extends TailwindElement {
463
- constructor() {
464
- super(...arguments);
465
- this.profileUrl = "";
466
- this.profileAddress = "";
467
- this.hasIdenticon = false;
468
- this.size = "large";
469
- this.isSquare = false;
470
- this.placeholder = "/assets/images/profile-default.svg";
471
- this.profileStyles = ce({
472
- slots: {
473
- wrapper: "outline outline-2 outline-neutral-100 relative",
474
- profile: "overflow-hidden",
475
- identicon: "absolute shadow-shadow-1xl rounded-full outline outline-neutral-100 right-0 bottom-0"
476
- },
477
- variants: {
478
- isSquare: {
479
- false: {
480
- wrapper: "rounded-full",
481
- profile: "rounded-full"
482
- }
483
- },
484
- size: {
485
- "2x-small": {
486
- wrapper: "w-4 h-4",
487
- profile: "w-4 h-4",
488
- identicon: "w-2 h-2 outline-1"
489
- },
490
- "x-small": {
491
- wrapper: "w-6 h-6",
492
- profile: "w-6 h-6",
493
- identicon: "w-3 h-3 outline-1"
494
- },
495
- small: {
496
- wrapper: "w-10 h-10",
497
- profile: "w-10 h-10",
498
- identicon: "w-4 h-4 outline-2"
499
- },
500
- medium: {
501
- wrapper: "w-14 h-14",
502
- profile: "w-14 h-14",
503
- identicon: "w-5 h-5 outline-2"
504
- },
505
- large: {
506
- wrapper: "w-20 h-20",
507
- profile: "w-20 h-20",
508
- identicon: "w-6 h-6 outline-2"
509
- },
510
- "x-large": {
511
- wrapper: "w-24 h-24",
512
- profile: "w-24 h-24",
513
- identicon: "w-7 h-7 outline-2"
514
- },
515
- "2x-large": {
516
- wrapper: "w-30 h-30",
517
- profile: "w-30 h-30",
518
- identicon: "w-9 h-9 outline-[2.5px]"
519
- }
520
- }
521
- },
522
- compoundVariants: [
523
- {
524
- isSquare: true,
525
- size: ["2x-small", "x-small"],
526
- class: {
527
- wrapper: "rounded-[2px]",
528
- profile: "rounded-[2px]"
529
- }
530
- },
531
- {
532
- isSquare: true,
533
- size: "small",
534
- class: {
535
- wrapper: "rounded-4",
536
- profile: "rounded-4"
537
- }
538
- },
539
- {
540
- isSquare: true,
541
- size: "medium",
542
- class: {
543
- wrapper: "rounded-8",
544
- profile: "rounded-8"
545
- }
546
- },
547
- {
548
- isSquare: true,
549
- size: "large",
550
- class: {
551
- wrapper: "rounded-[10px]",
552
- profile: "rounded-[10px]"
553
- }
554
- },
555
- {
556
- isSquare: true,
557
- size: ["2x-large", "x-large"],
558
- class: {
559
- wrapper: "rounded-12",
560
- profile: "rounded-12"
561
- }
562
- }
563
- ]
564
- });
565
- }
566
- identicon() {
567
- return this.hasIdenticon && this.profileAddress ? makeBlockie(this.profileAddress) : "";
568
- }
569
- render() {
570
- const { wrapper, profile, identicon } = this.profileStyles({
571
- size: this.size,
572
- isSquare: this.isSquare
573
- });
574
- return x`
575
- <div data-testid="profile" class=${wrapper()}>
576
- <div class=${profile()}>
577
- <lukso-image
578
- src=${this.profileUrl}
579
- placeholder=${this.placeholder}
580
- ></lukso-image>
581
- </div>
582
- ${this.identicon() ? x`<img src=${this.identicon()} class=${identicon()} alt="" />` : ""}
583
- </div>
584
- `;
585
- }
586
- };
587
- __decorateClass([
588
- n({ type: String, attribute: "profile-url", reflect: true })
589
- ], LuksoProfile.prototype, "profileUrl", 2);
590
- __decorateClass([
591
- n({ type: String, attribute: "profile-address", reflect: true })
592
- ], LuksoProfile.prototype, "profileAddress", 2);
593
- __decorateClass([
594
- n({ type: Boolean, attribute: "has-identicon", reflect: true })
595
- ], LuksoProfile.prototype, "hasIdenticon", 2);
596
- __decorateClass([
597
- n({ type: String, reflect: true })
598
- ], LuksoProfile.prototype, "size", 2);
599
- __decorateClass([
600
- n({ type: Boolean, attribute: "is-square" })
601
- ], LuksoProfile.prototype, "isSquare", 2);
602
- __decorateClass([
603
- n({ type: String })
604
- ], LuksoProfile.prototype, "placeholder", 2);
605
- LuksoProfile = __decorateClass([
606
- safeCustomElement("lukso-profile")
607
- ], LuksoProfile);
608
-
609
- export { LuksoProfile as L, makeBlockie as m };