@dialpad/dialtone-vue 2.103.1 → 2.104.0

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 (46) hide show
  1. package/CHANGELOG.json +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/dist/component-documentation.json +1 -1
  4. package/dist/dialtone-vue.cjs +6 -6
  5. package/dist/dialtone-vue.js +1848 -3465
  6. package/dist/directives.cjs +1 -1
  7. package/dist/directives.js +4 -3
  8. package/dist/emoji-098966fd.js +911 -0
  9. package/dist/emoji-d5a5af5e.cjs +1 -0
  10. package/dist/emoji.cjs +1 -1
  11. package/dist/emoji.js +26 -24
  12. package/dist/style.css +1 -1
  13. package/dist/tooltip-da61b649.cjs +1 -0
  14. package/dist/tooltip-fceff4af.js +706 -0
  15. package/dist/types/common/storybook_utils.d.ts.map +1 -1
  16. package/dist/types/components/avatar/avatar.vue.d.ts +1 -1
  17. package/dist/types/components/button/button.vue.d.ts +1 -1
  18. package/dist/types/components/chip/chip.vue.d.ts +1 -1
  19. package/dist/types/components/description_list/description_list.vue.d.ts +98 -0
  20. package/dist/types/components/description_list/description_list.vue.d.ts.map +1 -0
  21. package/dist/types/components/description_list/description_list_constants.d.ts +2 -0
  22. package/dist/types/components/description_list/description_list_constants.d.ts.map +1 -0
  23. package/dist/types/components/description_list/description_list_validators.d.ts +2 -0
  24. package/dist/types/components/description_list/description_list_validators.d.ts.map +1 -0
  25. package/dist/types/components/description_list/index.d.ts +3 -0
  26. package/dist/types/components/description_list/index.d.ts.map +1 -0
  27. package/dist/types/components/icon/icon.vue.d.ts +16 -2
  28. package/dist/types/components/icon/icon.vue.d.ts.map +1 -1
  29. package/dist/types/components/icon/icon_constants.d.ts +0 -2
  30. package/dist/types/components/icon/icon_constants.d.ts.map +1 -1
  31. package/dist/types/components/input/input.vue.d.ts +1 -1
  32. package/dist/types/components/modal/modal.vue.d.ts +1 -1
  33. package/dist/types/components/root_layout/root_layout.vue.d.ts +2 -2
  34. package/dist/types/components/toast/toast.vue.d.ts +1 -1
  35. package/dist/types/components/tooltip/tooltip.vue.d.ts +2 -2
  36. package/dist/types/components/tooltip/tooltip_variants.vue.d.ts +1 -1
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts +1 -1
  39. package/dist/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -1
  40. package/package.json +8 -4
  41. package/dist/emoji-9ef04a92.cjs +0 -1
  42. package/dist/emoji-efd28b85.js +0 -58697
  43. package/dist/tooltip-92c086de.js +0 -2544
  44. package/dist/tooltip-9b93ec5a.cjs +0 -25
  45. package/dist/types/components/plugins/fixDefaultSlot.d.ts +0 -5
  46. package/dist/types/components/plugins/fixDefaultSlot.d.ts.map +0 -1
@@ -0,0 +1,911 @@
1
+ import w from "/home/runner/work/dialtone-vue/dialtone-vue/node_modules/emoji-regex/index.mjs";
2
+ import $ from "/home/runner/work/dialtone-vue/dialtone-vue/node_modules/emoji-toolkit/emoji_strategy.json";
3
+ import { n as r } from "./_plugin-vue2_normalizer-71e2aa87.js";
4
+ const m = {
5
+ 100: "d-icon--size-100",
6
+ 200: "d-icon--size-200",
7
+ 300: "d-icon--size-300",
8
+ 400: "d-icon--size-400",
9
+ 500: "d-icon--size-500",
10
+ 600: "d-icon--size-600",
11
+ 700: "d-icon--size-700",
12
+ 800: "d-icon--size-800"
13
+ }, L = 3e6, u = {
14
+ circle: "d-bar-circle",
15
+ square: "d-bar2"
16
+ }, C = [
17
+ "body",
18
+ "heading"
19
+ ], z = {
20
+ sm: "24px",
21
+ md: "32px",
22
+ lg: "48px"
23
+ }, p = {
24
+ sm: "d-h16",
25
+ md: "d-h24",
26
+ lg: "d-h32"
27
+ }, _ = {
28
+ computed: {
29
+ skeletonOffset() {
30
+ const e = this.$refs.skeleton;
31
+ if (!e)
32
+ return this.offset;
33
+ const { top: t, height: n } = e.getBoundingClientRect();
34
+ return t + n / 2;
35
+ },
36
+ skeletonStyle() {
37
+ const e = {};
38
+ if (this.skeletonOffset === -1 || !this.animate && this.animationDuration === -1)
39
+ return e;
40
+ const t = this.skeletonOffset * L / 1e3, n = this.animationDuration === -1 ? 1e3 : this.animationDuration;
41
+ return e.animationDelay = `${t}ms`, e.animationDuration = `${n}ms`, e;
42
+ }
43
+ }
44
+ }, A = {
45
+ name: "DtSkeletonShape",
46
+ mixins: [_],
47
+ props: {
48
+ /**
49
+ * Defines the shape of the skeleton, accepts circle or square.
50
+ * @values circle, square
51
+ */
52
+ shape: {
53
+ type: String,
54
+ default: "circle",
55
+ validator: (e) => Object.keys(u).includes(e)
56
+ },
57
+ /**
58
+ * Size of the shape
59
+ * @values xs, sm, md, lg, xl
60
+ */
61
+ size: {
62
+ type: String,
63
+ default: "md"
64
+ },
65
+ /**
66
+ * Duration time of the animation (ms), set -1 for an infinite animation.
67
+ */
68
+ animationDuration: {
69
+ type: Number,
70
+ default: -1
71
+ },
72
+ /**
73
+ * This property has higher priority than "option.animate"
74
+ * @values true, false
75
+ */
76
+ animate: {
77
+ type: Boolean,
78
+ default: !0
79
+ },
80
+ /**
81
+ * RippleDuration controls how long the delay is for the animation of a
82
+ * placeholder 1000 pixels from the top of the page. Each placeholder
83
+ * from the top down will have a delay duration from 0 to this offset.
84
+ * The delay of each placeholder animation is based on how far down the page
85
+ * the placeholder is rendered. This is a linear relationship. The unit
86
+ * is milliseconds.
87
+ */
88
+ offset: {
89
+ type: Number,
90
+ default: 1
91
+ },
92
+ /**
93
+ * Additional class name for the content.
94
+ */
95
+ contentClass: {
96
+ type: [String, Object, Array],
97
+ default: ""
98
+ }
99
+ },
100
+ data() {
101
+ return {
102
+ SKELETON_SHAPES: u
103
+ };
104
+ },
105
+ computed: {
106
+ shapeStyles() {
107
+ const e = z[this.size] || this.size;
108
+ return {
109
+ ...this.skeletonStyle,
110
+ "min-width": e,
111
+ "max-width": e,
112
+ "min-height": e,
113
+ "max-height": e
114
+ };
115
+ }
116
+ }
117
+ };
118
+ var N = function() {
119
+ var t = this, n = t._self._c;
120
+ return n("div", { ref: "skeleton", class: [
121
+ "skeleton-placeholder",
122
+ t.SKELETON_SHAPES[t.shape],
123
+ {
124
+ "skeleton-placeholder--animate": t.animate
125
+ },
126
+ t.contentClass
127
+ ], style: t.shapeStyles, attrs: { "data-qa": "skeleton-shape" } });
128
+ }, I = [], T = /* @__PURE__ */ r(
129
+ A,
130
+ N,
131
+ I,
132
+ !1,
133
+ null,
134
+ null,
135
+ null,
136
+ null
137
+ );
138
+ const g = T.exports, P = {
139
+ name: "DtSkeletonText",
140
+ mixins: [_],
141
+ props: {
142
+ /**
143
+ * Skeleton type
144
+ * @values body, heading
145
+ */
146
+ type: {
147
+ type: String,
148
+ default: "body",
149
+ validator: (e) => C.includes(e)
150
+ },
151
+ /**
152
+ * Heading height
153
+ * @values sm, md, lg
154
+ */
155
+ headingHeight: {
156
+ type: String,
157
+ default: "md",
158
+ validator: (e) => Object.keys(p).includes(e)
159
+ },
160
+ /**
161
+ * Width of the skeleton
162
+ */
163
+ width: {
164
+ type: String,
165
+ default: "100%"
166
+ },
167
+ /**
168
+ * Duration time of the animation (ms), set -1 for an infinite animation.
169
+ */
170
+ animationDuration: {
171
+ type: Number,
172
+ default: -1
173
+ },
174
+ /**
175
+ * This property has higher priority than "option.animate"
176
+ * @values true, false
177
+ */
178
+ animate: {
179
+ type: Boolean,
180
+ default: !1
181
+ },
182
+ /**
183
+ * RippleDuration controls how long the delay is for the animation of a
184
+ * placeholder 1000 pixels from the top of the page. Each placeholder
185
+ * from the top down will have a delay duration from 0 to this offset.
186
+ * The delay of each placeholder animation is based on how far down the page
187
+ * the placeholder is rendered. This is a linear relationship. The unit
188
+ * is milliseconds.
189
+ */
190
+ offset: {
191
+ type: Number,
192
+ default: 1
193
+ },
194
+ /**
195
+ * Additional class name for the content.
196
+ */
197
+ contentClass: {
198
+ type: String,
199
+ default: ""
200
+ }
201
+ },
202
+ data() {
203
+ return {
204
+ SKELETON_HEADING_HEIGHTS: p
205
+ };
206
+ }
207
+ };
208
+ var R = function() {
209
+ var t = this, n = t._self._c;
210
+ return t.type === "body" ? n("div", { ref: "skeleton", class: [
211
+ "d-h8",
212
+ "d-bar2",
213
+ "skeleton-placeholder",
214
+ {
215
+ "skeleton-placeholder--animate": t.animate
216
+ },
217
+ t.contentClass
218
+ ], style: {
219
+ width: t.width,
220
+ ...t.skeletonStyle
221
+ }, attrs: { "data-qa": "skeleton-text-body" } }) : t.type === "heading" ? n("div", { ref: "skeleton", class: [
222
+ t.SKELETON_HEADING_HEIGHTS[t.headingHeight],
223
+ "d-bar2",
224
+ "skeleton-placeholder",
225
+ {
226
+ "skeleton-placeholder--animate": t.animate
227
+ },
228
+ t.contentClass
229
+ ], style: {
230
+ width: t.width,
231
+ ...t.skeletonStyle
232
+ }, attrs: { "data-qa": "skeleton-text-heading" } }) : t._e();
233
+ }, W = [], q = /* @__PURE__ */ r(
234
+ P,
235
+ R,
236
+ W,
237
+ !1,
238
+ null,
239
+ null,
240
+ null,
241
+ null
242
+ );
243
+ const y = q.exports, c = (e) => e !== "" && !Number.isNaN(Number(e)), B = {
244
+ name: "DtSkeletonParagraph",
245
+ components: {
246
+ DtSkeletonText: y
247
+ },
248
+ props: {
249
+ /**
250
+ * Quantity of rows to display
251
+ */
252
+ rows: {
253
+ type: [Number, String],
254
+ default: 3,
255
+ validator: c
256
+ },
257
+ /**
258
+ * This property has higher priority than "option.animate"
259
+ * @values true, false
260
+ */
261
+ animate: {
262
+ type: Boolean,
263
+ default: !0
264
+ },
265
+ /**
266
+ * Controls the min width of paragraphs
267
+ */
268
+ minWidth: {
269
+ type: [Number, String],
270
+ default: 30,
271
+ validator: c
272
+ },
273
+ /**
274
+ * Controls the max width of paragraphs
275
+ */
276
+ maxWidth: {
277
+ type: [Number, String],
278
+ default: 100,
279
+ validator: c
280
+ },
281
+ /**
282
+ * Controls the width of paragraphs
283
+ */
284
+ width: {
285
+ type: [String, Array],
286
+ default: null
287
+ },
288
+ /**
289
+ * If true, row widths will be random
290
+ * @values true, false
291
+ */
292
+ randomWidth: {
293
+ type: Boolean,
294
+ default: !1
295
+ },
296
+ /**
297
+ * RippleDuration controls how long the delay is for the animation of a
298
+ * placeholder 1000 pixels from the top of the page. Each placeholder
299
+ * from the top down will have a delay duration from 0 to this offset.
300
+ * The delay of each placeholder animation is based on how far down the page
301
+ * the placeholder is rendered. This is a linear relationship. The unit
302
+ * is milliseconds.
303
+ */
304
+ offset: {
305
+ type: Number,
306
+ default: 1
307
+ },
308
+ /**
309
+ * Duration time of the animation (ms), set -1 for an infinite animation.
310
+ */
311
+ animationDuration: {
312
+ type: Number,
313
+ default: -1
314
+ },
315
+ /**
316
+ * Additional class name for the content.
317
+ */
318
+ contentClass: {
319
+ type: String,
320
+ default: ""
321
+ },
322
+ /**
323
+ * Additional class name for the row.
324
+ */
325
+ rowClass: {
326
+ type: String,
327
+ default: ""
328
+ }
329
+ },
330
+ computed: {
331
+ integerRows() {
332
+ return Number(this.rows);
333
+ }
334
+ },
335
+ methods: {
336
+ randomWidthPercentage() {
337
+ const e = Math.min(this.minWidth, this.maxWidth), t = Math.max(this.minWidth, this.maxWidth);
338
+ return `${Math.round(Math.random() * (t - e)) + e}%`;
339
+ },
340
+ getSizeParagraphRow(e) {
341
+ const t = this.width, n = Array.isArray(t), a = t == null ? void 0 : t[e - 1], s = e === this.rows;
342
+ return this.randomWidth ? this.randomWidthPercentage() : t && !n ? t : t && n && a ? a : s ? "38%" : "100%";
343
+ }
344
+ }
345
+ };
346
+ var F = function() {
347
+ var t = this, n = t._self._c;
348
+ return n("div", { class: [
349
+ "d-w100p",
350
+ t.contentClass
351
+ ], attrs: { contentClass: "", "data-qa": "skeleton-paragraph" } }, t._l(t.integerRows, function(a) {
352
+ return n("dt-skeleton-text", { key: a, class: [
353
+ {
354
+ "d-mb12": a !== t.integerRows
355
+ }
356
+ ], attrs: { "data-qa": "skeleton-paragraph-row", "content-class": t.rowClass, animate: t.animate, offset: t.offset, "animation-duration": t.animationDuration, width: t.getSizeParagraphRow(a) } });
357
+ }), 1);
358
+ }, H = [], U = /* @__PURE__ */ r(
359
+ B,
360
+ F,
361
+ H,
362
+ !1,
363
+ null,
364
+ null,
365
+ null,
366
+ null
367
+ );
368
+ const S = U.exports, K = {
369
+ name: "DtSkeletonListItem",
370
+ components: {
371
+ DtSkeletonShape: g,
372
+ DtSkeletonParagraph: S
373
+ },
374
+ props: {
375
+ /**
376
+ * Defines the shape of the skeleton, accepts circle or square.
377
+ * @values circle, square
378
+ */
379
+ shape: {
380
+ type: String,
381
+ default: "circle",
382
+ validator: (e) => Object.keys(u).includes(e)
383
+ },
384
+ /**
385
+ * Size of the shape
386
+ * @values xs, sm, md, lg, xl
387
+ */
388
+ shapeSize: {
389
+ type: String,
390
+ default: "md"
391
+ },
392
+ /**
393
+ * Object containing quantity of paragraphs to display
394
+ * and a randomWidth boolean.
395
+ */
396
+ paragraphs: {
397
+ type: Object,
398
+ default: () => ({ rows: 3, randomWidth: !0 })
399
+ },
400
+ /**
401
+ * Duration time of the animation (ms), set -1 for an infinite animation.
402
+ */
403
+ animationDuration: {
404
+ type: Number,
405
+ default: -1
406
+ },
407
+ /**
408
+ * This property has higher priority than "option.animate"
409
+ * @values true, false
410
+ */
411
+ animate: {
412
+ type: Boolean,
413
+ default: !0
414
+ },
415
+ /**
416
+ * RippleDuration controls how long the delay is for the animation of a
417
+ * placeholder 1000 pixels from the top of the page. Each placeholder
418
+ * from the top down will have a delay duration from 0 to this offset.
419
+ * The delay of each placeholder animation is based on how far down the page
420
+ * the placeholder is rendered. This is a linear relationship. The unit
421
+ * is milliseconds.
422
+ */
423
+ offset: {
424
+ type: Number,
425
+ default: 1
426
+ },
427
+ /**
428
+ * Additional class name for the shape.
429
+ */
430
+ shapeClass: {
431
+ type: String,
432
+ default: ""
433
+ },
434
+ /**
435
+ * Additional class name for the content.
436
+ */
437
+ contentClass: {
438
+ type: String,
439
+ default: ""
440
+ }
441
+ }
442
+ };
443
+ var J = function() {
444
+ var t = this, n = t._self._c;
445
+ return n("div", { class: [
446
+ "d-d-flex",
447
+ {
448
+ "d-ai-center": t.paragraphs.rows === 1
449
+ },
450
+ t.contentClass
451
+ ], attrs: { "data-qa": "skeleton-list-item" } }, [n("dt-skeleton-shape", { staticClass: "d-mr8", attrs: { size: t.shapeSize, shape: t.shape, "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset, "content-class": t.shapeClass } }), n("div", { staticClass: "d-d-flex d-fd-column d-w100p" }, [n("dt-skeleton-paragraph", t._b({ attrs: { "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset } }, "dt-skeleton-paragraph", t.paragraphs, !1))], 1)], 1);
452
+ }, M = [], V = /* @__PURE__ */ r(
453
+ K,
454
+ J,
455
+ M,
456
+ !1,
457
+ null,
458
+ null,
459
+ null,
460
+ null
461
+ );
462
+ const G = V.exports;
463
+ const Z = {
464
+ name: "DtSkeleton",
465
+ components: {
466
+ DtSkeletonText: y,
467
+ DtSkeletonShape: g,
468
+ DtSkeletonListItem: G,
469
+ DtSkeletonParagraph: S
470
+ },
471
+ props: {
472
+ /**
473
+ * Set this prop to have the skeleton render as multiple lines of text.
474
+ * Set only one option prop at a time.
475
+ */
476
+ paragraphOption: {
477
+ type: [Object, Boolean],
478
+ default: null
479
+ },
480
+ /**
481
+ * Set this prop to have the skeleton render as a list item with an avatar and wrapping text.
482
+ * Set only one option prop at a time.
483
+ */
484
+ listItemOption: {
485
+ type: [Object, Boolean],
486
+ default: null
487
+ },
488
+ /**
489
+ * Set this prop to have the skeleton render as a single line of text.
490
+ * Set only one option prop at a time.
491
+ */
492
+ textOption: {
493
+ type: Object,
494
+ default: null
495
+ },
496
+ /**
497
+ * Set this prop to have the skeleton render as a specific shape.
498
+ * Set only one option prop at a time.
499
+ */
500
+ shapeOption: {
501
+ type: [Object, Boolean],
502
+ default: null
503
+ },
504
+ /**
505
+ * Duration time of the animation (ms), set -1 for an infinite animation.
506
+ */
507
+ animationDuration: {
508
+ type: Number,
509
+ default: -1
510
+ },
511
+ /**
512
+ * Descriptive label for the content.
513
+ */
514
+ ariaLabel: {
515
+ type: String,
516
+ default: ""
517
+ },
518
+ /**
519
+ * This property has higher priority than "option.animate"
520
+ * @values true, false
521
+ */
522
+ animate: {
523
+ type: Boolean,
524
+ default: !0
525
+ },
526
+ /**
527
+ * RippleDuration controls how long the delay is for the animation of a
528
+ * placeholder 1000 pixels from the top of the page. Each placeholder
529
+ * from the top down will have a delay duration from 0 to this offset.
530
+ * The delay of each placeholder animation is based on how far down the page
531
+ * the placeholder is rendered. This is a linear relationship. The unit
532
+ * is milliseconds.
533
+ */
534
+ offset: {
535
+ type: Number,
536
+ default: 1
537
+ }
538
+ },
539
+ computed: {
540
+ validationOptions() {
541
+ return {
542
+ paragraphOption: this.paragraphOption,
543
+ listItemOption: this.listItemOption,
544
+ textOption: this.textOption,
545
+ shapeOption: this.shapeOption
546
+ };
547
+ }
548
+ },
549
+ watch: {
550
+ $props: {
551
+ immediate: !0,
552
+ handler: "validator"
553
+ }
554
+ },
555
+ methods: {
556
+ validator() {
557
+ const e = Object.entries(this.validationOptions).filter(([t, n]) => n);
558
+ if (e.length >= 2) {
559
+ const t = `Use only one of ${e.map(([n]) => n).join(" | ")} options at the same time`;
560
+ console.error(t);
561
+ }
562
+ }
563
+ }
564
+ };
565
+ var X = function() {
566
+ var t = this, n = t._self._c;
567
+ return n("div", { attrs: { "aria-busy": "true", role: "status", "aria-label": t.ariaLabel } }, [t.listItemOption ? n("dt-skeleton-list-item", t._b({ attrs: { "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset } }, "dt-skeleton-list-item", t.listItemOption === !0 ? {} : t.listItemOption, !1)) : t.shapeOption ? n("dt-skeleton-shape", t._b({ attrs: { "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset } }, "dt-skeleton-shape", t.shapeOption === !0 ? {} : t.shapeOption, !1)) : t.paragraphOption ? n("dt-skeleton-paragraph", t._b({ attrs: { "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset } }, "dt-skeleton-paragraph", t.paragraphOption === !0 ? {} : t.paragraphOption, !1)) : n("dt-skeleton-text", t._b({ attrs: { "animation-duration": t.animationDuration, animate: t.animate, offset: t.offset } }, "dt-skeleton-text", t.textOption || {}, !1))], 1);
568
+ }, Y = [], Q = /* @__PURE__ */ r(
569
+ Z,
570
+ X,
571
+ Y,
572
+ !1,
573
+ null,
574
+ null,
575
+ null,
576
+ null
577
+ );
578
+ const tt = Q.exports, et = "6.6", j = "https://cdn.jsdelivr.net/joypixels/assets/" + et + "/png/unicode/32/";
579
+ let v = null, E = j, k = ".png", b = j, D = ".png";
580
+ const l = $;
581
+ function nt() {
582
+ return l;
583
+ }
584
+ function vt(e, t = ".png") {
585
+ e.endsWith("/") || (e = e + "/"), E = e, k = t;
586
+ }
587
+ function Et(e, t = ".svg") {
588
+ e.endsWith("/") || (e = e + "/"), b = e, D = t;
589
+ }
590
+ function kt(e) {
591
+ v = e;
592
+ }
593
+ function bt(e) {
594
+ at(e);
595
+ }
596
+ function at(e) {
597
+ const t = ["extension", "custom"], n = [
598
+ "name",
599
+ "category",
600
+ "shortname",
601
+ "extension",
602
+ "custom"
603
+ ], a = (s, i, o) => {
604
+ if (s[i] === void 0) {
605
+ if (!t.includes(i))
606
+ return;
607
+ s[i] = o;
608
+ } else
609
+ Array.isArray(s[i]) ? s[i] = s[i].concat(o) : s[i] = o;
610
+ };
611
+ Object.entries(e).forEach((s) => {
612
+ const [i, o] = s;
613
+ if (i in l) {
614
+ const f = l[i];
615
+ for (const d in o) {
616
+ const x = o[d];
617
+ a(f, d, x);
618
+ }
619
+ } else
620
+ (() => n.every((d) => o[d] !== void 0))() ? l[i] = o : console.error(
621
+ "The following custom emoji doesn't contain the required properties:",
622
+ o
623
+ );
624
+ });
625
+ }
626
+ function O(e) {
627
+ function t(a, s) {
628
+ if (!(!a || typeof a != "object")) {
629
+ if ("shortname" in a && (a.shortname === e || a.shortname_alternates.includes(e)))
630
+ return a.key = s, n = a, !0;
631
+ Object.keys(a).some(function(i) {
632
+ return t(a[i], i);
633
+ });
634
+ }
635
+ }
636
+ let n;
637
+ return t(nt(), null), n;
638
+ }
639
+ function st(e) {
640
+ let t = "";
641
+ for (const n of e) {
642
+ const a = n.codePointAt(0).toString(16);
643
+ ["200d", "fe0f"].includes(a) || (t !== "" && (t = t + "-"), t = t + n.codePointAt(0).toString(16));
644
+ }
645
+ return t;
646
+ }
647
+ function it(e) {
648
+ const t = e.split("-");
649
+ let n = "";
650
+ return t.forEach((a) => {
651
+ n = n + String.fromCodePoint(parseInt(a, 16));
652
+ }), n;
653
+ }
654
+ function ot(e) {
655
+ if (e.startsWith(":") && e.endsWith(":"))
656
+ return O(e);
657
+ {
658
+ const t = st(e), n = l[t];
659
+ return n && (n.key = t), n;
660
+ }
661
+ }
662
+ function rt(e) {
663
+ const t = e.match(/:\w+:/g);
664
+ return lt(t);
665
+ }
666
+ function lt(e) {
667
+ const t = e ? e.filter((n) => O(n)) : [];
668
+ return new Set(t);
669
+ }
670
+ function dt(e) {
671
+ const t = [...e.matchAll(w())], n = t.length ? t.map((a) => a[0]) : [];
672
+ return new Set(n);
673
+ }
674
+ const ct = {
675
+ name: "DtEmoji",
676
+ components: {
677
+ DtSkeleton: tt
678
+ },
679
+ props: {
680
+ /**
681
+ * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.
682
+ * <a class="d-link" href="https://emojipedia.org/joypixels/" target="_blank">JoyPixels</a>
683
+ * for all supported shortcode/unicode or the docs for setting up custom emojis.
684
+ */
685
+ code: {
686
+ type: String,
687
+ required: !0
688
+ },
689
+ /**
690
+ * The size of the emoji. Can be any of the icon size utility classes from
691
+ * <a class="d-link" href="https://dialpad.design/components/icon.html" target="_blank"> Dialpad Icon Size</a>
692
+ * @values 100, 200, 300, 400, 500, 600, 700, 800
693
+ */
694
+ size: {
695
+ type: String,
696
+ default: "500",
697
+ validator: (e) => Object.keys(m).includes(e)
698
+ },
699
+ /**
700
+ * Additional class name for the emoji img element.
701
+ * Can accept String, Object, and Array, i.e. has the
702
+ * same API as Vue's built-in handling of the class attribute.
703
+ */
704
+ imgClass: {
705
+ type: [String, Object, Array],
706
+ default: ""
707
+ },
708
+ /**
709
+ * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n
710
+ * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will
711
+ * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the
712
+ * getEmojiData() function
713
+ */
714
+ ariaLabel: {
715
+ type: String,
716
+ default: null
717
+ },
718
+ /**
719
+ * Shows a skeleton loader while the emoji asset is loading.
720
+ * @values true, false
721
+ */
722
+ showSkeleton: {
723
+ type: Boolean,
724
+ default: !0
725
+ }
726
+ },
727
+ data() {
728
+ return {
729
+ emojiData: null,
730
+ imgLoading: !1
731
+ };
732
+ },
733
+ computed: {
734
+ emojiDataValid() {
735
+ return !!this.emojiData;
736
+ },
737
+ emojiSrc() {
738
+ var e;
739
+ return this.emojiDataValid ? (e = this.emojiData) != null && e.custom ? v + this.emojiData.key + this.emojiData.extension : ["100", "200"].includes(this.size) ? E + this.emojiData.key + k : b + this.emojiData.key + D : "invalid";
740
+ },
741
+ emojiAlt() {
742
+ if (this.emojiDataValid)
743
+ return this.emojiData.unicode_output ? it(this.emojiData.unicode_output) : this.emojiData.name;
744
+ },
745
+ emojiLabel() {
746
+ return this.emojiDataValid ? this.ariaLabel ? this.ariaLabel : this.emojiData.name : "Invalid Emoji";
747
+ },
748
+ emojiSize() {
749
+ return m[this.size];
750
+ }
751
+ },
752
+ watch: {
753
+ code: {
754
+ handler: function() {
755
+ this.getEmojiData();
756
+ },
757
+ immediate: !0
758
+ },
759
+ emojiSrc: {
760
+ handler: async function() {
761
+ this.imgLoading = !0;
762
+ }
763
+ }
764
+ },
765
+ methods: {
766
+ getEmojiData() {
767
+ this.emojiData = ot(this.code);
768
+ },
769
+ imageLoaded() {
770
+ this.imgLoading = !1;
771
+ },
772
+ imageErrored() {
773
+ this.imgLoading = !1;
774
+ }
775
+ }
776
+ };
777
+ var mt = function() {
778
+ var t = this, n = t._self._c;
779
+ return n("span", { class: ["dt-emoji", "d-icon", t.emojiSize] }, [n("dt-skeleton", { directives: [{ name: "show", rawName: "v-show", value: t.imgLoading && t.showSkeleton, expression: "imgLoading && showSkeleton" }], class: t.emojiSize, attrs: { offset: 0, "shape-option": { shape: "square", contentClass: t.emojiSize, size: "auto" } } }), n("img", { directives: [{ name: "show", rawName: "v-show", value: !t.imgLoading, expression: "!imgLoading" }], ref: "emojiImg", class: ["d-icon", t.emojiSize, t.imgClass], attrs: { "aria-label": t.emojiLabel, alt: t.emojiAlt, title: t.emojiLabel, src: t.emojiSrc }, on: { load: t.imageLoaded, error: t.imageErrored } })], 1);
780
+ }, ut = [], ft = /* @__PURE__ */ r(
781
+ ct,
782
+ mt,
783
+ ut,
784
+ !1,
785
+ null,
786
+ "6ad3e149",
787
+ null,
788
+ null
789
+ );
790
+ const h = ft.exports, pt = {
791
+ name: "DtEmojiTextWrapper",
792
+ components: {
793
+ DtEmoji: h
794
+ },
795
+ inheritAttrs: !1,
796
+ props: {
797
+ /**
798
+ * Element type (tag name) to use for the wrapper.
799
+ */
800
+ elementType: {
801
+ type: String,
802
+ default: "div"
803
+ },
804
+ /**
805
+ * The icon size to render the emojis at: 100 to 800
806
+ */
807
+ size: {
808
+ type: String,
809
+ default: "500",
810
+ validator: (e) => Object.keys(m).includes(e)
811
+ }
812
+ },
813
+ data() {
814
+ return {
815
+ loadingEmojiJson: !0
816
+ };
817
+ },
818
+ async created() {
819
+ this.loadingEmojiJson = !1;
820
+ },
821
+ methods: {
822
+ /**
823
+ * Replaces the valid codes from the text content with a DtEmoji component.
824
+ * @returns {Array<VNode|string>}
825
+ */
826
+ replaceDtEmojis(e, t) {
827
+ const n = new RegExp(`(${e.join("|")})`, "g");
828
+ return t.split(n).map((s) => e.includes(s) ? this.$createElement(h, {
829
+ attrs: { class: "d-mx4 d-d-inline-block" },
830
+ props: { code: s, size: this.size, ...this.$attrs }
831
+ }) : s);
832
+ },
833
+ /**
834
+ * Recursively search the Vue virtual DOM to find text
835
+ * @param VNode
836
+ * @returns {VNode|*}
837
+ */
838
+ searchVNodes(e) {
839
+ if (!e.tag && e.text)
840
+ return this.searchCodes(e.text);
841
+ const t = e.children ? e.children.map((n) => this.searchVNodes(n)) : [];
842
+ return this.$createElement(e.tag, e.data, t);
843
+ },
844
+ // TODO: Find a way to crawl vue components
845
+ replaceVueComponentVNodeContent(e) {
846
+ },
847
+ /**
848
+ * Find codes in text.
849
+ * @param textContent string
850
+ * @returns {Array<VNode|string>|string}
851
+ */
852
+ searchCodes(e) {
853
+ const t = rt(e), n = dt(e), a = [...t, ...n];
854
+ return a.length === 0 ? e : this.replaceDtEmojis(a, e);
855
+ }
856
+ },
857
+ render(e) {
858
+ const t = this.$slots.default || [];
859
+ return e(
860
+ this.elementType,
861
+ this.loadingEmojiJson ? t : t.map((n) => this.searchVNodes(n))
862
+ );
863
+ }
864
+ }, ht = null, _t = null;
865
+ var gt = /* @__PURE__ */ r(
866
+ pt,
867
+ ht,
868
+ _t,
869
+ !1,
870
+ null,
871
+ null,
872
+ null,
873
+ null
874
+ );
875
+ const Dt = gt.exports;
876
+ export {
877
+ it as A,
878
+ ot as B,
879
+ rt as C,
880
+ tt as D,
881
+ lt as E,
882
+ dt as F,
883
+ m as I,
884
+ L as S,
885
+ Dt as a,
886
+ h as b,
887
+ G as c,
888
+ y as d,
889
+ g as e,
890
+ S as f,
891
+ u as g,
892
+ C as h,
893
+ z as i,
894
+ p as j,
895
+ et as k,
896
+ j as l,
897
+ v as m,
898
+ E as n,
899
+ k as o,
900
+ b as p,
901
+ D as q,
902
+ l as r,
903
+ nt as s,
904
+ vt as t,
905
+ Et as u,
906
+ kt as v,
907
+ bt as w,
908
+ at as x,
909
+ O as y,
910
+ st as z
911
+ };