@mustib/web-components 0.0.0-alpha.6 → 0.0.0-alpha.8

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.
@@ -0,0 +1,604 @@
1
+ const capitalizeFirst = (str) => str[0].toUpperCase().concat(str.slice(1).toLowerCase());
2
+ /**
3
+ * Capitalizes the first letter of a string or each word in a string.
4
+ *
5
+ * @param {string} str - The string to capitalize.
6
+ * @param {object} [options] - Optional parameters.
7
+ * @param {boolean} [options.onlyFirstWord=false] - Whether to capitalize only the first word (default: false).
8
+ * @param {string} [options.splitter=' '] - The delimiter to split the string into words (default: ' ').
9
+ * @param {string} [options.joiner=options.splitter] - The delimiter to join the capitalized words (default: options.splitter).
10
+ * @returns {string} The capitalized string.
11
+ */
12
+ function capitalize(str, options) {
13
+ const { onlyFirstWord: onlyFirst = false, splitter = ' ', joiner = splitter, } = options || {};
14
+ if (typeof str !== 'string' || str === '')
15
+ return str;
16
+ return (onlyFirst ? [str] : str.split(splitter))
17
+ .map(capitalizeFirst)
18
+ .join(joiner);
19
+ }
20
+
21
+ class AppError extends Error {
22
+ options;
23
+ static throw(type, error, options) {
24
+ return new AppError(options)
25
+ .push(type, error, options?.pushOptions)
26
+ .throw();
27
+ }
28
+ static async aggregate(aggregateFunc, options) {
29
+ const appError = new AppError(options);
30
+ try {
31
+ await aggregateFunc(appError);
32
+ appError.end();
33
+ }
34
+ catch (error) {
35
+ if (error instanceof Error) {
36
+ Error.captureStackTrace(error, options?.stackTraceConstructor ?? AppError.aggregate);
37
+ }
38
+ throw error;
39
+ }
40
+ }
41
+ length = 0;
42
+ errors = {};
43
+ get message() {
44
+ return this.toString();
45
+ }
46
+ constructor(options) {
47
+ super();
48
+ this.options = options;
49
+ }
50
+ async catch(catchFunc) {
51
+ try {
52
+ await catchFunc();
53
+ }
54
+ catch (error) {
55
+ if (error instanceof AppError) {
56
+ for (const [type, errors] of Object.entries(error.errors)) {
57
+ if (errors)
58
+ errors.forEach((err) => this.push(type, err.message, { scope: err.scope }));
59
+ }
60
+ }
61
+ else {
62
+ if (error instanceof Error) {
63
+ Error.captureStackTrace(error, this.catch);
64
+ }
65
+ throw error;
66
+ }
67
+ }
68
+ }
69
+ toString(options) {
70
+ const formattedErrors = [];
71
+ Object.keys(this.errors).forEach((errorType) => {
72
+ const rawErrors = this.errors[errorType];
73
+ if (!rawErrors)
74
+ return;
75
+ const { indentation = 4 } = this.options || {};
76
+ const formattedErrorType = rawErrors.reduce((result, err) => {
77
+ const hasMatchedScope = this.matchesScope({
78
+ errScope: err.scope,
79
+ includesScope: options?.includesScope,
80
+ excludesScope: options?.excludesScope,
81
+ });
82
+ if (hasMatchedScope) {
83
+ result.push(`${result.length + 1}- ${err.message}.`);
84
+ }
85
+ return result;
86
+ }, []);
87
+ const hasManyErrors = formattedErrorType.length > 1;
88
+ const indentationPrefix = `${' '.repeat(indentation)}`;
89
+ if (formattedErrorType.length > 0)
90
+ formattedErrors.push(`${errorType} Error${hasManyErrors ? 's' : ''}:\n${indentationPrefix}${formattedErrorType.join(`\n${indentationPrefix}`)}`);
91
+ });
92
+ return formattedErrors.join('\n');
93
+ }
94
+ matchesScope({ errScope, includesScope, excludesScope, }) {
95
+ if (includesScope === undefined && excludesScope === undefined)
96
+ return true;
97
+ if (errScope === undefined)
98
+ return false;
99
+ if (excludesScope) {
100
+ return !excludesScope.some((scope) => errScope.includes(scope));
101
+ }
102
+ if (includesScope) {
103
+ return includesScope.some((scope) => errScope.includes(scope));
104
+ }
105
+ return false;
106
+ }
107
+ push(type, error, options) {
108
+ const errorType = capitalize(type, { onlyFirstWord: true });
109
+ const errors = this.errors[errorType];
110
+ const newError = Array.isArray(error)
111
+ ? error.map((err) => ({ message: err, scope: options?.scope }))
112
+ : [{ message: error, scope: options?.scope }];
113
+ if (Array.isArray(errors)) {
114
+ errors.push(...newError);
115
+ }
116
+ else {
117
+ this.errors[errorType] = newError;
118
+ this.length++;
119
+ }
120
+ return this;
121
+ }
122
+ throw() {
123
+ Error.captureStackTrace(this, this.options?.stackTraceConstructor || this.throw);
124
+ throw this;
125
+ }
126
+ end() {
127
+ if (this.length > 0)
128
+ this.throw();
129
+ }
130
+ }
131
+
132
+ const LIBRARY_ERROR_SCOPE = Symbol('@mustib/utils');
133
+
134
+ const EVENT_TYPES_PRIORITIES = ['prepend', 'normal'];
135
+ const customEventEmitterErrorScope = [Symbol('@mustib/utils/CustomEventEmitter'), LIBRARY_ERROR_SCOPE];
136
+ class CustomEventEmitter {
137
+ debugListeners;
138
+ events = {};
139
+ constructor(events) {
140
+ const appError = new AppError();
141
+ Object.keys(events).forEach((name) => {
142
+ const { destructible = false, dispatchable = true, listener, lockSymbol, afterAll, beforeAll, prepare, prepend, runningBehavior = 'sync', } = events[name];
143
+ let hasError = false;
144
+ if (lockSymbol !== undefined && typeof lockSymbol !== 'symbol') {
145
+ appError.push('Invalid', `lockSymbol must be of type (symbol)`, { scope: customEventEmitterErrorScope });
146
+ hasError = true;
147
+ }
148
+ if (!dispatchable && !lockSymbol) {
149
+ appError.push('Invalid', `non dispatchable event (${name}) must have lockSymbol`, { scope: customEventEmitterErrorScope });
150
+ hasError = true;
151
+ }
152
+ if (destructible && !lockSymbol) {
153
+ appError.push('Invalid', `destructible event (${name}) must have lockSymbol`, { scope: customEventEmitterErrorScope });
154
+ hasError = true;
155
+ }
156
+ if (!hasError) {
157
+ this.events[name] = {
158
+ prepare,
159
+ listeners: { all: new Map(), normal: new Set(), prepend: new Set() },
160
+ destructed: false,
161
+ destructible,
162
+ dispatchable,
163
+ lockSymbol,
164
+ afterAllCallback: afterAll,
165
+ beforeAllCallback: beforeAll,
166
+ runningBehavior,
167
+ };
168
+ if (listener)
169
+ if (typeof listener === 'function')
170
+ this.addListener(name, listener);
171
+ else
172
+ this.addListener(name, listener.listener, listener.options);
173
+ if (prepend)
174
+ if (typeof prepend === 'function')
175
+ this.prependListener(name, prepend);
176
+ else
177
+ this.prependListener(name, prepend.listener, prepend.options);
178
+ }
179
+ });
180
+ appError.end();
181
+ }
182
+ hasEvent(name) {
183
+ return Reflect.has(this.events, name);
184
+ }
185
+ destruct(name, lockSymbol) {
186
+ if (!this.hasEvent(name))
187
+ this.throwInvalidEventNameAction(name, 'destruct');
188
+ const event = this.events[name];
189
+ if (event.destructed)
190
+ return this;
191
+ if (!event.destructible)
192
+ this.throwInvalidEventNameAction(name, 'destruct', ', because it is not destructible');
193
+ if (event.lockSymbol !== lockSymbol)
194
+ this.throwInvalidEventNameAction(name, 'destruct', ', because wrong lockSymbol provided');
195
+ setTimeout(() => {
196
+ event.listeners.all.clear();
197
+ event.listeners.normal.clear();
198
+ event.listeners.prepend.clear();
199
+ event.destructed = true;
200
+ event.prepare = undefined;
201
+ if (this.debugListeners)
202
+ this.debugListeners.forEach((listener) => listener(name.toString(), 'destructed', undefined));
203
+ });
204
+ return this;
205
+ }
206
+ debug(listener) {
207
+ if (!this.debugListeners)
208
+ this.debugListeners = new Set([listener]);
209
+ else
210
+ this.debugListeners.add(listener);
211
+ }
212
+ insertListenerPriority({ name, listener, listenerOptions, priority, }) {
213
+ if (!this.hasEvent(name))
214
+ this.throwInvalidEventNameAction(name, priority === 'normal' ? 'add' : 'prepend');
215
+ const event = this.events[name];
216
+ if (event.destructed)
217
+ return;
218
+ const listenerData = {
219
+ isOnce: !!listenerOptions?.once,
220
+ listener,
221
+ priority,
222
+ };
223
+ event.listeners[priority].add(listener);
224
+ event.listeners.all.set(listener, listenerData);
225
+ if (this.debugListeners) {
226
+ this.debugListeners.forEach((debugListener) => debugListener(name.toString(), `${priority === 'prepend' ? 'prepended' : 'added'} listener`, {
227
+ once: listenerData.isOnce,
228
+ }));
229
+ }
230
+ }
231
+ prependListener(name, listener, listenerOptions) {
232
+ this.insertListenerPriority({
233
+ name,
234
+ listener,
235
+ listenerOptions,
236
+ priority: 'prepend',
237
+ });
238
+ return this;
239
+ }
240
+ addListener(name, listener, listenerOptions) {
241
+ this.insertListenerPriority({
242
+ name,
243
+ listener,
244
+ listenerOptions,
245
+ priority: 'normal',
246
+ });
247
+ return this;
248
+ }
249
+ *getListenersGenerator(name) {
250
+ const event = this.events[name];
251
+ if (!event) {
252
+ this.throwInvalidEventNameAction(name.toString(), 'get', ', because it does not exist');
253
+ return;
254
+ }
255
+ for (const priority of EVENT_TYPES_PRIORITIES) {
256
+ for (const listener of event.listeners[priority]) {
257
+ const listenerData = event.listeners.all.get(listener);
258
+ if (!listenerData)
259
+ continue;
260
+ yield listenerData;
261
+ }
262
+ }
263
+ }
264
+ dispatch(...args) {
265
+ const [name, value, options] = args;
266
+ if (!this.hasEvent(name))
267
+ this.throwInvalidEventNameAction(name, 'dispatch');
268
+ const event = this.events[name];
269
+ if (event.destructed)
270
+ return this;
271
+ if (!event.dispatchable && options?.lockSymbol !== event.lockSymbol)
272
+ this.throwInvalidEventNameAction(name, 'dispatch', ', wrong lockSymbol provided');
273
+ const listenerValue = event.prepare ? event.prepare(value) : value;
274
+ if (this.debugListeners)
275
+ this.debugListeners.forEach((debugListener) => debugListener(name.toString(), 'dispatched', listenerValue));
276
+ const listenersData = this.getListenersGenerator(name);
277
+ const callListener = (listenerData) => {
278
+ listenerData.listener(listenerValue);
279
+ if (listenerData.isOnce) {
280
+ this.removeListener(name, listenerData.listener);
281
+ }
282
+ };
283
+ const callListenerAsync = async (listenerData) => {
284
+ await listenerData.listener(listenerValue);
285
+ if (listenerData.isOnce) {
286
+ this.removeListener(name, listenerData.listener);
287
+ }
288
+ };
289
+ switch (event.runningBehavior) {
290
+ case 'sync': {
291
+ let i = 0;
292
+ event.beforeAllCallback?.({
293
+ dispatchValue: value,
294
+ listenerValue,
295
+ listenerCount: event.listeners.all.size
296
+ });
297
+ for (const listenerData of listenersData) {
298
+ callListener(listenerData);
299
+ i++;
300
+ }
301
+ event.afterAllCallback?.({
302
+ dispatchValue: value,
303
+ listenerCount: i,
304
+ listenerValue,
305
+ });
306
+ break;
307
+ }
308
+ case 'async': {
309
+ queueMicrotask(() => {
310
+ let i = 0;
311
+ event.beforeAllCallback?.({
312
+ dispatchValue: value,
313
+ listenerValue,
314
+ listenerCount: event.listeners.all.size
315
+ });
316
+ for (const listenerData of listenersData) {
317
+ callListener(listenerData);
318
+ i++;
319
+ }
320
+ event.afterAllCallback?.({
321
+ dispatchValue: value,
322
+ listenerCount: i,
323
+ listenerValue,
324
+ });
325
+ });
326
+ break;
327
+ }
328
+ case 'async-sequential': {
329
+ queueMicrotask(async () => {
330
+ let i = 0;
331
+ await event.beforeAllCallback?.({
332
+ dispatchValue: value,
333
+ listenerValue,
334
+ listenerCount: event.listeners.all.size
335
+ });
336
+ for (const listenerData of listenersData) {
337
+ await callListenerAsync(listenerData);
338
+ i++;
339
+ }
340
+ event.afterAllCallback?.({
341
+ dispatchValue: value,
342
+ listenerCount: i,
343
+ listenerValue,
344
+ });
345
+ });
346
+ break;
347
+ }
348
+ default: {
349
+ event.runningBehavior;
350
+ break;
351
+ }
352
+ }
353
+ return this;
354
+ }
355
+ removeListener(name, listener) {
356
+ if (!this.hasEvent(name))
357
+ this.throwInvalidEventNameAction(name, 'remove', ', because it does not exist');
358
+ const allListeners = this.events[name].listeners.all;
359
+ if (this.debugListeners) {
360
+ const listenerData = allListeners.get(listener);
361
+ const status = allListeners.delete(listener);
362
+ if (listenerData && status)
363
+ this.debugListeners.forEach((debugListener) => debugListener(name.toString(), 'removed listener', {
364
+ priority: listenerData.priority,
365
+ }));
366
+ }
367
+ else
368
+ allListeners.delete(listener);
369
+ return this;
370
+ }
371
+ throwInvalidEventNameAction(name, action, reason = '') {
372
+ AppError.throw('Invalid', `(${name}) is not a valid listener name to ${action}${reason}`, {
373
+ stackTraceConstructor: this.throwInvalidEventNameAction,
374
+ pushOptions: {
375
+ scope: customEventEmitterErrorScope
376
+ }
377
+ });
378
+ }
379
+ }
380
+
381
+ const deferredValueErrorScope = [Symbol('@mustib/utils/DeferredValue'), LIBRARY_ERROR_SCOPE];
382
+ /**
383
+ * A utility class that represents a value that will be available at some point in the future.
384
+ * It encapsulates a Promise and provides methods to resolve, reject, and reset the Promise.
385
+ *
386
+ * @template T The type of the value that the DeferredValue will hold.
387
+ */
388
+ class DeferredValue {
389
+ /**
390
+ * The Promise that this DeferredValue encapsulates.
391
+ */
392
+ _promise;
393
+ /**
394
+ * The function to resolve the Promise.
395
+ * @private
396
+ */
397
+ _resolve;
398
+ /**
399
+ * The function to reject the Promise.
400
+ * @private
401
+ */
402
+ _reject;
403
+ /**
404
+ * The current status of the DeferredValue.
405
+ * - `pending`: The DeferredValue is waiting to be resolved or rejected.
406
+ * - `resolved`: The DeferredValue has been resolved.
407
+ * - `rejected`: The DeferredValue has been rejected.
408
+ *
409
+ * @private
410
+ */
411
+ _status = 'pending';
412
+ _resolvedValue;
413
+ get current() {
414
+ return this._promise;
415
+ }
416
+ /**
417
+ * Gets the resolved value of the DeferredValue.
418
+ * @returns {T} The resolved value.
419
+ * @throws {AppError<ErrorTypes>} If the DeferredValue is not yet resolved.
420
+ */
421
+ get resolvedValue() {
422
+ if (!this.isResolved) {
423
+ AppError.throw('Invalid', 'cannot get resolvedValue, DeferredValue is not resolved yet', {
424
+ pushOptions: {
425
+ scope: deferredValueErrorScope
426
+ }
427
+ });
428
+ }
429
+ return this._resolvedValue;
430
+ }
431
+ /**
432
+ * Gets whether the DeferredValue is pending.
433
+ * @returns {boolean} True if the DeferredValue is pending, false otherwise.
434
+ */
435
+ get isPending() {
436
+ return this._status === 'pending';
437
+ }
438
+ /**
439
+ * Gets whether the DeferredValue is resolved.
440
+ * @returns {boolean} True if the DeferredValue is resolved, false otherwise.
441
+ */
442
+ get isResolved() {
443
+ return this._status === 'resolved';
444
+ }
445
+ /**
446
+ * Gets whether the DeferredValue is rejected.
447
+ * @returns {boolean} True if the DeferredValue is rejected, false otherwise.
448
+ */
449
+ get isRejected() {
450
+ return this._status === 'rejected';
451
+ }
452
+ /**
453
+ * Gets whether the DeferredValue is fulfilled (resolved or rejected).
454
+ * @returns {boolean} True if the DeferredValue is fulfilled, false otherwise.
455
+ */
456
+ get isFulfilled() {
457
+ return this.isResolved || this.isRejected;
458
+ }
459
+ /**
460
+ * Creates a new DeferredValue.
461
+ */
462
+ constructor() {
463
+ this._reset();
464
+ }
465
+ /**
466
+ * Resolves the DeferredValue with the given value.
467
+ * @param {T} v The value to resolve the DeferredValue with.
468
+ * @returns {void}
469
+ */
470
+ resolve(v) {
471
+ if (this.isFulfilled) {
472
+ AppError.throw('Invalid', 'cannot resolve, DeferredValue is already fulfilled — call reset() first', {
473
+ stackTraceConstructor: this.resolve,
474
+ pushOptions: {
475
+ scope: deferredValueErrorScope
476
+ }
477
+ });
478
+ }
479
+ this._resolvedValue = v;
480
+ this._status = 'resolved';
481
+ this._resolve(v);
482
+ }
483
+ /**
484
+ * Rejects the DeferredValue with the given reason.
485
+ * @param {Error} reason The reason to reject the DeferredValue with.
486
+ * @returns {void}
487
+ */
488
+ reject(reason) {
489
+ if (this.isFulfilled) {
490
+ AppError.throw('Invalid', 'cannot reject, DeferredValue is already fulfilled — call reset() first', {
491
+ stackTraceConstructor: this.reject,
492
+ pushOptions: {
493
+ scope: deferredValueErrorScope
494
+ }
495
+ });
496
+ }
497
+ this._status = 'rejected';
498
+ this._resolvedValue = undefined;
499
+ this._reject(reason);
500
+ }
501
+ /**
502
+ * Aborts the DeferredValue, rejecting it with an AppError if it is still pending.
503
+ * @returns {void}
504
+ */
505
+ abort() {
506
+ if (this.isPending) {
507
+ this.reject(new AppError({ stackTraceConstructor: this.abort })
508
+ .push('Abort', 'DeferredValue was aborted', {
509
+ scope: deferredValueErrorScope
510
+ }));
511
+ }
512
+ this._reset();
513
+ }
514
+ /**
515
+ * Resets the DeferredValue to its initial state.
516
+ * @returns {void}
517
+ */
518
+ reset() {
519
+ if (this.isPending) {
520
+ AppError.throw('Invalid', 'cannot reset, DeferredValue is already pending — call abort() instead', {
521
+ stackTraceConstructor: this.reset,
522
+ pushOptions: {
523
+ scope: deferredValueErrorScope
524
+ }
525
+ });
526
+ }
527
+ this._reset();
528
+ }
529
+ /**
530
+ * Resets the DeferredValue to its initial state.
531
+ * @private
532
+ */
533
+ _reset() {
534
+ this._status = 'pending';
535
+ this._resolvedValue = undefined;
536
+ this._promise = new Promise((res, rej) => {
537
+ this._resolve = res;
538
+ this._reject = rej;
539
+ });
540
+ }
541
+ }
542
+
543
+ /**
544
+ * Creates a debounced version of the provided function that delays its execution until after
545
+ * a specified number of milliseconds have elapsed since the last time it was invoked.
546
+ *
547
+ * @param func - The function to debounce.
548
+ * @param ms - The number of milliseconds to delay; defaults to 100ms.
549
+ * @returns A debounced version of the input function.
550
+ */
551
+ function debounce(func, ms = 100) {
552
+ let timeoutId;
553
+ return function debounced(...args) {
554
+ clearTimeout(timeoutId);
555
+ timeoutId = setTimeout(() => func(...args), ms);
556
+ };
557
+ }
558
+
559
+ /**
560
+ * Returns a promise that resolves after a specified number of milliseconds.
561
+ *
562
+ * @param milliseconds - The number of milliseconds to wait before resolving the promise. Defaults to 0.
563
+ * @returns A promise that resolves after the specified delay.
564
+ */
565
+ function wait(milliseconds = 0) {
566
+ return new Promise(r => { setTimeout(r, milliseconds); });
567
+ }
568
+
569
+ /**
570
+ * Creates a throttled version of the given function that, when invoked repeatedly,
571
+ * will only call the original function at most once every `ms` milliseconds.
572
+ *
573
+ * @param func - The function to throttle.
574
+ * @param ms - The number of milliseconds to throttle invocations to. Defaults to 100ms.
575
+ * @returns A throttled version of the input function.
576
+ */
577
+ function throttle(func, ms = 100) {
578
+ let isThrottled = false;
579
+ return function throttled(...args) {
580
+ if (isThrottled)
581
+ return;
582
+ isThrottled = true;
583
+ func(...args);
584
+ setTimeout(() => { isThrottled = false; }, ms);
585
+ };
586
+ }
587
+
588
+ /**
589
+ * Parses a string as JSON and returns the parsed value. If the string cannot be parsed as JSON,
590
+ * it returns undefined.
591
+ *
592
+ * @param {string} value - The string to parse as JSON.
593
+ * @return {T | undefined} - The parsed JSON value or undefined (since undefined is not a valid JSON).
594
+ */
595
+ function parseJson(value) {
596
+ try {
597
+ return JSON.parse(value);
598
+ }
599
+ catch (error) {
600
+ return undefined;
601
+ }
602
+ }
603
+
604
+ export { AppError as A, CustomEventEmitter as C, DeferredValue as D, LIBRARY_ERROR_SCOPE as L, debounce as d, parseJson as p, throttle as t, wait as w };
@@ -26,7 +26,9 @@ type Elements = [
26
26
  'mu-icon',
27
27
  'mu-sortable',
28
28
  'mu-sortable-item',
29
- 'mu-sortable-trigger'
29
+ 'mu-sortable-trigger',
30
+ 'mu-toast',
31
+ 'mu-toast-item'
30
32
  ];
31
33
  declare abstract class MuElement extends LitElement {
32
34
  #private;
@@ -1,3 +1,4 @@
1
- export { M as MuElement } from '../mu-element-CEvBHYiI.js';
1
+ export { M as MuElement } from '../mu-element-yEZ17QUl.js';
2
2
  import 'lit';
3
3
  import 'lit/decorators.js';
4
+ import '../common-BBjg-zl9.js';
@@ -17,6 +17,10 @@ declare class MuIcon extends MuElement {
17
17
  closeLine: any;
18
18
  noImage: any;
19
19
  dragVertical: any;
20
+ checkMark: any;
21
+ warning: any;
22
+ error: any;
23
+ info: any;
20
24
  };
21
25
  name?: keyof typeof MuIcon.icons;
22
26
  protected firstUpdated(_changedProperties: PropertyValues): void;
@@ -1,6 +1,7 @@
1
- import { M as MuElement, _ as __decorate } from '../mu-element-CEvBHYiI.js';
1
+ import { M as MuElement, _ as __decorate } from '../mu-element-yEZ17QUl.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property } from 'lit/decorators.js';
4
+ import '../common-BBjg-zl9.js';
4
5
 
5
6
  class MuIcon extends MuElement {
6
7
  constructor() {
@@ -64,6 +65,18 @@ MuIcon.icons = {
64
65
  dragVertical: html `
65
66
  <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="var(--icon-fill)" stroke-width="3"><circle cx="8" cy="4" r="1"/><circle cx="16" cy="4" r="1"/><circle cx="8" cy="12" r="1"/><circle cx="16" cy="12" r="1"/><circle cx="8" cy="20" r="1"/><circle cx="16" cy="20" r="1"/></svg>
66
67
  `,
68
+ checkMark: html `
69
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 122.877 101.052" enable-background="new 0 0 122.877 101.052" xml:space="preserve"><g><path d="M4.43,63.63c-2.869-2.755-4.352-6.42-4.427-10.11c-0.074-3.689,1.261-7.412,4.015-10.281 c2.752-2.867,6.417-4.351,10.106-4.425c3.691-0.076,7.412,1.255,10.283,4.012l24.787,23.851L98.543,3.989l1.768,1.349l-1.77-1.355 c0.141-0.183,0.301-0.339,0.479-0.466c2.936-2.543,6.621-3.691,10.223-3.495V0.018l0.176,0.016c3.623,0.24,7.162,1.85,9.775,4.766 c2.658,2.965,3.863,6.731,3.662,10.412h0.004l-0.016,0.176c-0.236,3.558-1.791,7.035-4.609,9.632l-59.224,72.09l0.004,0.004 c-0.111,0.141-0.236,0.262-0.372,0.368c-2.773,2.435-6.275,3.629-9.757,3.569c-3.511-0.061-7.015-1.396-9.741-4.016L4.43,63.63 L4.43,63.63z"/></g></svg>
70
+ `,
71
+ warning: html `
72
+ <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 463.43"><path d="M189.46 44.02c34.26-58.66 99.16-58.77 133.24.12l.97 1.81 175.27 304.4c33.71 56.4-1.2 113.76-66.17 112.96v.12H73.53c-.9 0-1.78-.04-2.66-.11-58.34-.79-86.64-54.22-61.9-106.84.39-.85.82-1.67 1.28-2.46l-.04-.03 179.3-309.94-.05-.03zm50.32 302.4c4.26-4.13 9.35-6.19 14.45-6.56 3.4-.24 6.8.29 9.94 1.48 3.13 1.19 6.01 3.03 8.39 5.41 6.92 6.91 8.72 17.38 4.64 26.16-2.69 5.8-7.08 9.7-12.11 11.78-3.03 1.27-6.3 1.84-9.56 1.76-3.27-.08-6.49-.82-9.41-2.18-5.02-2.33-9.3-6.43-11.7-12.2-2.65-6.36-2.27-12.96.63-19.15 1.15-2.46 2.75-4.81 4.73-6.5zm33.86-47.07c-.8 19.91-34.51 19.93-35.28-.01-3.41-34.1-12.13-110.53-11.85-142.58.28-9.87 8.47-15.72 18.94-17.95 3.23-.69 6.78-1.03 10.35-1.02 3.6.01 7.16.36 10.39 1.05 10.82 2.3 19.31 8.39 19.31 18.45l-.05 1-11.81 141.06z"/></svg>
73
+ `,
74
+ error: html `
75
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.45 2.15C14.992 4.05652 17.5866 5 20.25 5C20.6642 5 21 5.33579 21 5.75V11C21 16.0012 18.0424 19.6757 12.2749 21.9478C12.0982 22.0174 11.9018 22.0174 11.7251 21.9478C5.95756 19.6757 3 16.0012 3 11V5.75C3 5.33579 3.33579 5 3.75 5C6.41341 5 9.00797 4.05652 11.55 2.15C11.8167 1.95 12.1833 1.95 12.45 2.15ZM12 16C11.5858 16 11.25 16.3358 11.25 16.75C11.25 17.1642 11.5858 17.5 12 17.5C12.4142 17.5 12.75 17.1642 12.75 16.75C12.75 16.3358 12.4142 16 12 16ZM12 6.98211C11.6203 6.98211 11.3065 7.26427 11.2568 7.63034L11.25 7.73211V14.2321L11.2568 14.3339C11.3065 14.7 11.6203 14.9821 12 14.9821C12.3797 14.9821 12.6935 14.7 12.7432 14.3339L12.75 14.2321V7.73211L12.7432 7.63034C12.6935 7.26427 12.3797 6.98211 12 6.98211Z"></path></svg>
76
+ `,
77
+ info: html `
78
+ <svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 512"><path d="M256 0c70.689 0 134.692 28.656 181.02 74.98C483.344 121.308 512 185.311 512 256c0 70.689-28.656 134.692-74.98 181.016C390.692 483.344 326.689 512 256 512c-70.689 0-134.692-28.656-181.016-74.984C28.656 390.692 0 326.689 0 256S28.656 121.308 74.984 74.98C121.308 28.656 185.311 0 256 0zm-8.393 139.828c5.039-12.2 17.404-20.536 30.609-20.536 18.611 0 32.717 15.259 32.717 33.478 0 4.53-.796 8.776-2.407 12.704-6.902 16.91-26.09 25.405-43.082 18.302-16.871-7.122-24.821-27.096-17.837-43.948zm12.103 206.605c-.833 2.984-2.256 7.946-.674 10.725 4.22 7.45 16.459-6.058 19.036-8.97 8.307-9.414 15.461-20.475 21.905-31.229a1.506 1.506 0 012.061-.523l13.44 9.972c.641.473.789 1.363.367 2.03-6.18 10.743-12.426 20.124-18.744 28.129-10.452 13.234-23.595 25.852-39.583 32.065-9.918 3.842-22.817 5.363-34.144 2.829-10.506-2.353-19.66-8.206-23.822-18.946-5.464-14.092-.97-30.105 3.33-43.887l21.689-65.697c2.962-10.647 10.044-29.661-8.25-29.661H197.36c-1.56 0-1.596-1.402-1.297-2.484l4.858-17.685a1.5 1.5 0 011.463-1.103l96.89-3.038c1.409-.05 1.701 1.19 1.374 2.286L259.71 346.433z"/></svg>
79
+ `,
67
80
  };
68
81
  __decorate([
69
82
  property()
@@ -1,6 +1,7 @@
1
- import { M as MuElement, _ as __decorate } from '../mu-element-CEvBHYiI.js';
1
+ import { M as MuElement, _ as __decorate } from '../mu-element-yEZ17QUl.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property, query } from 'lit/decorators.js';
4
+ import '../common-BBjg-zl9.js';
4
5
 
5
6
  class MuRangeFill extends MuElement {
6
7
  constructor() {
@@ -1,6 +1,7 @@
1
- import { M as MuElement, _ as __decorate } from '../mu-element-CEvBHYiI.js';
1
+ import { M as MuElement, _ as __decorate } from '../mu-element-yEZ17QUl.js';
2
2
  import { css, html } from 'lit';
3
3
  import { property, query } from 'lit/decorators.js';
4
+ import '../common-BBjg-zl9.js';
4
5
 
5
6
  class MuRangeThumbValue extends MuElement {
6
7
  constructor() {