buzzcasting-utils 1.11.0 → 1.12.1
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.
- package/dist/buzzcasting-utils.d.ts +30 -7
- package/dist/buzzcasting-utils.esm.js +118 -105
- package/package.json +8 -8
|
@@ -139,6 +139,8 @@ export declare interface Data {
|
|
|
139
139
|
|
|
140
140
|
export declare function deepMerge(objs: any): void;
|
|
141
141
|
|
|
142
|
+
export declare const dir: (message: IMessage) => "rtl" | "ltr";
|
|
143
|
+
|
|
142
144
|
declare const escape_2: (htmlStr: string) => string;
|
|
143
145
|
export { escape_2 as escape }
|
|
144
146
|
|
|
@@ -380,6 +382,7 @@ export declare interface ICardOptions {
|
|
|
380
382
|
debug?: boolean;
|
|
381
383
|
delay?: number;
|
|
382
384
|
globe?: IGlobe;
|
|
385
|
+
grid?: IGridLayout;
|
|
383
386
|
locale?: string;
|
|
384
387
|
show?: IShowCard;
|
|
385
388
|
}
|
|
@@ -507,6 +510,7 @@ export declare interface ICssCard {
|
|
|
507
510
|
date?: string;
|
|
508
511
|
dynamics?: string;
|
|
509
512
|
globe?: string;
|
|
513
|
+
grid?: string;
|
|
510
514
|
handle?: string;
|
|
511
515
|
heading?: string;
|
|
512
516
|
host?: string;
|
|
@@ -528,6 +532,7 @@ export declare interface ICssCloud {
|
|
|
528
532
|
arrowup: string;
|
|
529
533
|
arrowdown: string;
|
|
530
534
|
chart: string;
|
|
535
|
+
container: string;
|
|
531
536
|
backdrop: string;
|
|
532
537
|
body: string;
|
|
533
538
|
brand: string;
|
|
@@ -563,6 +568,7 @@ export declare interface ICssSeries {
|
|
|
563
568
|
count: string;
|
|
564
569
|
down: string;
|
|
565
570
|
host: string;
|
|
571
|
+
key: string;
|
|
566
572
|
label: string;
|
|
567
573
|
table: string;
|
|
568
574
|
title: string;
|
|
@@ -715,13 +721,13 @@ export declare interface IGeo {
|
|
|
715
721
|
}
|
|
716
722
|
|
|
717
723
|
declare interface IGlobe {
|
|
718
|
-
width
|
|
719
|
-
height
|
|
720
|
-
arc
|
|
721
|
-
border
|
|
722
|
-
country
|
|
723
|
-
land
|
|
724
|
-
sphere
|
|
724
|
+
width?: number;
|
|
725
|
+
height?: number;
|
|
726
|
+
arc?: IGlobeArc;
|
|
727
|
+
border?: IGlobeBorder;
|
|
728
|
+
country?: IGlobeCountry;
|
|
729
|
+
land?: IGlobeLand;
|
|
730
|
+
sphere?: IGlobeSphere;
|
|
725
731
|
}
|
|
726
732
|
|
|
727
733
|
declare interface IGlobeArc {
|
|
@@ -748,6 +754,11 @@ declare interface IGlobeSphere {
|
|
|
748
754
|
fill: string;
|
|
749
755
|
}
|
|
750
756
|
|
|
757
|
+
declare interface IGridLayout {
|
|
758
|
+
rows?: number;
|
|
759
|
+
cols?: number;
|
|
760
|
+
}
|
|
761
|
+
|
|
751
762
|
export declare interface IHighlight {
|
|
752
763
|
label?: string;
|
|
753
764
|
color?: string[];
|
|
@@ -1024,6 +1035,7 @@ export declare const intToString: (num: any, digits?: number, abbreviate?: boole
|
|
|
1024
1035
|
export declare interface IPie {
|
|
1025
1036
|
radius: IPieRadius;
|
|
1026
1037
|
animation: IPieAnimation;
|
|
1038
|
+
boder: IPieBorder;
|
|
1027
1039
|
}
|
|
1028
1040
|
|
|
1029
1041
|
/**
|
|
@@ -1033,10 +1045,18 @@ export declare interface IPieAnimation {
|
|
|
1033
1045
|
duration: number;
|
|
1034
1046
|
}
|
|
1035
1047
|
|
|
1048
|
+
export declare interface IPieBorder {
|
|
1049
|
+
radius: number;
|
|
1050
|
+
width: number;
|
|
1051
|
+
color: string;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1036
1054
|
/**
|
|
1037
1055
|
* inner and outer radius in px
|
|
1038
1056
|
*/
|
|
1039
1057
|
export declare interface IPieRadius {
|
|
1058
|
+
inside: number;
|
|
1059
|
+
outside: number;
|
|
1040
1060
|
inner: number;
|
|
1041
1061
|
outer: number;
|
|
1042
1062
|
}
|
|
@@ -1191,6 +1211,9 @@ export declare interface IShowCloud {
|
|
|
1191
1211
|
date: boolean;
|
|
1192
1212
|
gradient: boolean;
|
|
1193
1213
|
hashtags: boolean;
|
|
1214
|
+
labels: true;
|
|
1215
|
+
legend: true;
|
|
1216
|
+
title: true;
|
|
1194
1217
|
trend: boolean;
|
|
1195
1218
|
debug?: boolean;
|
|
1196
1219
|
}
|
|
@@ -9,10 +9,10 @@ function N(e) {
|
|
|
9
9
|
let t = "", r = "", n = {
|
|
10
10
|
backgroundImage: ""
|
|
11
11
|
};
|
|
12
|
-
return typeof e.media < "u" && e.media.forEach((
|
|
13
|
-
(
|
|
14
|
-
backgroundImage: `url(${
|
|
15
|
-
}, r =
|
|
12
|
+
return typeof e.media < "u" && e.media.forEach((a) => {
|
|
13
|
+
(a.type === "photo" || a.type === "image") && (n = {
|
|
14
|
+
backgroundImage: `url(${a.url})`
|
|
15
|
+
}, r = a.url), a.type === "video" && (t = a.url);
|
|
16
16
|
}), {
|
|
17
17
|
image: r,
|
|
18
18
|
background: n || null,
|
|
@@ -95,13 +95,13 @@ function ne(e, t) {
|
|
|
95
95
|
return "";
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function ae(e) {
|
|
99
99
|
return e.replace(/^\w|[A-Z]|\b\w/g, (t, r) => r === 0 ? t.toLowerCase() : t.toUpperCase()).replace(/\s+/g, "");
|
|
100
100
|
}
|
|
101
101
|
function y(e) {
|
|
102
102
|
return e.toLowerCase().split("-").reduce((t, r) => t + (r.charAt(0).toUpperCase() + r.slice(1)));
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const oe = (e) => e.replace(/([A-Z])/g, "-$1").toLowerCase(), ie = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
105
105
|
function se(e) {
|
|
106
106
|
const t = document.createRange();
|
|
107
107
|
t.selectNodeContents(e), t.deleteContents();
|
|
@@ -123,9 +123,9 @@ const le = () => Math.floor(Math.random() * 16777215).toString(16), ce = () => {
|
|
|
123
123
|
function E(e) {
|
|
124
124
|
e.reduce(
|
|
125
125
|
(t, r) => Object.keys(r).reduce(
|
|
126
|
-
(n,
|
|
126
|
+
(n, a) => ({
|
|
127
127
|
...n,
|
|
128
|
-
[
|
|
128
|
+
[a]: a in t && typeof t[a] == "object" && t[a] !== null && typeof r[a] == "object" && r[a] !== null ? E([t[a], r[a]]) : r[a]
|
|
129
129
|
}),
|
|
130
130
|
t
|
|
131
131
|
),
|
|
@@ -139,8 +139,8 @@ function be(e, t = "font-bold") {
|
|
|
139
139
|
}
|
|
140
140
|
const M = (e, t = {}, r = "") => {
|
|
141
141
|
for (let n in e) {
|
|
142
|
-
let
|
|
143
|
-
typeof e[n] == "object" && !Array.isArray(e[n]) ? M(e[n], t,
|
|
142
|
+
let a = r ? `${r}-${n}` : n;
|
|
143
|
+
typeof e[n] == "object" && !Array.isArray(e[n]) ? M(e[n], t, a) : e[n] !== "" && (t[a] = e[n]);
|
|
144
144
|
}
|
|
145
145
|
return t;
|
|
146
146
|
}, me = () => [m(2), m(1), m(1), m(1), m(3)].join("-"), m = (e) => {
|
|
@@ -155,39 +155,39 @@ function k(e, t) {
|
|
|
155
155
|
return e;
|
|
156
156
|
}
|
|
157
157
|
function p(e, t) {
|
|
158
|
-
let r, n,
|
|
158
|
+
let r, n, a;
|
|
159
159
|
if (t.length === 0)
|
|
160
160
|
return e;
|
|
161
|
-
for (r = 0,
|
|
161
|
+
for (r = 0, a = t.length; r < a; r++)
|
|
162
162
|
n = t.charCodeAt(r), e = (e << 5) - e + n, e |= 0;
|
|
163
163
|
return e < 0 ? e * -2 : e;
|
|
164
164
|
}
|
|
165
165
|
function $(e, t, r) {
|
|
166
166
|
return Object.keys(t).sort().reduce(n, e);
|
|
167
|
-
function n(
|
|
168
|
-
return v(
|
|
167
|
+
function n(a, o) {
|
|
168
|
+
return v(a, t[o], o, r);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
function v(e, t, r, n) {
|
|
172
|
-
const
|
|
172
|
+
const a = p(p(p(e, r), C(t)), typeof t);
|
|
173
173
|
if (t === null)
|
|
174
|
-
return p(
|
|
174
|
+
return p(a, "null");
|
|
175
175
|
if (t === void 0)
|
|
176
|
-
return p(
|
|
176
|
+
return p(a, "undefined");
|
|
177
177
|
if (typeof t == "object" || typeof t == "function") {
|
|
178
178
|
if (n.includes(t))
|
|
179
|
-
return p(
|
|
179
|
+
return p(a, `[Circular]${r}`);
|
|
180
180
|
n.push(t);
|
|
181
|
-
const
|
|
181
|
+
const o = $(a, t, n);
|
|
182
182
|
if (!("valueOf" in t) || typeof t.valueOf != "function")
|
|
183
|
-
return
|
|
183
|
+
return o;
|
|
184
184
|
try {
|
|
185
|
-
return p(
|
|
185
|
+
return p(o, String(t.valueOf()));
|
|
186
186
|
} catch (l) {
|
|
187
|
-
return p(
|
|
187
|
+
return p(o, `[valueOf exception]${l.stack || l.message}`);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
return p(
|
|
190
|
+
return p(a, t.toString());
|
|
191
191
|
}
|
|
192
192
|
function C(e) {
|
|
193
193
|
return Object.prototype.toString.call(e);
|
|
@@ -198,10 +198,10 @@ function he(e) {
|
|
|
198
198
|
const De = (e) => {
|
|
199
199
|
let t = "";
|
|
200
200
|
return O(e, {
|
|
201
|
-
start: function(r, n,
|
|
201
|
+
start: function(r, n, a) {
|
|
202
202
|
t += "<" + r;
|
|
203
|
-
for (let
|
|
204
|
-
t += ` ${n[
|
|
203
|
+
for (let o = 0; o < n.length; o++)
|
|
204
|
+
t += ` ${n[o].name}="${n[o].escaped}"`;
|
|
205
205
|
t += ">";
|
|
206
206
|
},
|
|
207
207
|
end: function(r) {
|
|
@@ -217,7 +217,7 @@ const De = (e) => {
|
|
|
217
217
|
}, Ae = (e, t) => {
|
|
218
218
|
const r = b("html,head,body,title"), n = { link: "head", base: "head" };
|
|
219
219
|
t ? t = t.ownerDocument || t.getOwnerDocument && t.getOwnerDocument() || t : typeof t < "u" ? t = new Document() : typeof document < "u" && document.implementation && document.implementation.createDocument && (t = document.implementation.createDocument("", "", null));
|
|
220
|
-
const
|
|
220
|
+
const a = [];
|
|
221
221
|
if (!(t.documentElement || t.getDocumentElement && t.getDocumentElement()) && t.createElement && (function() {
|
|
222
222
|
const i = t.createElement("html"), u = t.createElement("head");
|
|
223
223
|
u.appendChild(t.createElement("title")), i.appendChild(u), i.appendChild(t.createElement("body")), t.appendChild(i);
|
|
@@ -227,16 +227,16 @@ const De = (e) => {
|
|
|
227
227
|
return O(e, {
|
|
228
228
|
start: function(i, u, c) {
|
|
229
229
|
if (r[i]) {
|
|
230
|
-
l = r[i], c ||
|
|
230
|
+
l = r[i], c || a.push(l);
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
233
|
const s = t.createElement(i);
|
|
234
234
|
for (let d in u)
|
|
235
235
|
s.setAttribute(u[d].name, u[d].value);
|
|
236
|
-
n[i] && typeof r[n[i]] != "boolean" ? r[n[i]].appendChild(s) : l && l.appendChild && l.appendChild(s), c || (
|
|
236
|
+
n[i] && typeof r[n[i]] != "boolean" ? r[n[i]].appendChild(s) : l && l.appendChild && l.appendChild(s), c || (a.push(s), l = s);
|
|
237
237
|
},
|
|
238
238
|
end: function(i) {
|
|
239
|
-
|
|
239
|
+
a.length -= 1, l = a[a.length - 1];
|
|
240
240
|
},
|
|
241
241
|
chars: function(i) {
|
|
242
242
|
l.appendChild(t.createTextNode(i));
|
|
@@ -257,22 +257,22 @@ const De = (e) => {
|
|
|
257
257
|
), T = b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), H = b(
|
|
258
258
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
259
259
|
), W = b("script,style"), O = (e, t) => {
|
|
260
|
-
let r, n,
|
|
260
|
+
let r, n, a, o = [], l = e;
|
|
261
261
|
const i = (c, s) => {
|
|
262
262
|
let d;
|
|
263
263
|
if (!s) d = 0;
|
|
264
264
|
else
|
|
265
|
-
for (d =
|
|
265
|
+
for (d = o.length - 1; d >= 0 && o[d] != s; d--)
|
|
266
266
|
;
|
|
267
267
|
if (d >= 0) {
|
|
268
|
-
for (let f =
|
|
269
|
-
t.end && t.end(
|
|
270
|
-
|
|
268
|
+
for (let f = o.length - 1; f >= d; f--)
|
|
269
|
+
t.end && t.end(o[f]);
|
|
270
|
+
o.length = d;
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
for (; e; ) {
|
|
274
|
-
if (n = !0, !
|
|
275
|
-
if (e.indexOf("<!--") == 0 ? (r = e.indexOf("-->"), r >= 0 && (t.comment && t.comment(e.substring(4, r)), e = e.substring(r + 3), n = !1)) : e.indexOf("</") == 0 ? (
|
|
274
|
+
if (n = !0, !o.at(-1) || !W[o.at(-1)]) {
|
|
275
|
+
if (e.indexOf("<!--") == 0 ? (r = e.indexOf("-->"), r >= 0 && (t.comment && t.comment(e.substring(4, r)), e = e.substring(r + 3), n = !1)) : e.indexOf("</") == 0 ? (a = e.match(P), a && (e = e.substring(a[0].length), a[0].replace(P, i), n = !1)) : e.indexOf("<") == 0 && (a = e.match(R), a && (e = e.substring(a[0].length), a[0].replace(R, u), n = !1)), n) {
|
|
276
276
|
r = e.indexOf("<");
|
|
277
277
|
let c = r < 0 ? e : e.substring(0, r);
|
|
278
278
|
e = r < 0 ? "" : e.substring(r), t.chars && t.chars(c);
|
|
@@ -280,23 +280,23 @@ const De = (e) => {
|
|
|
280
280
|
} else
|
|
281
281
|
e = e.replace(
|
|
282
282
|
//@ts-ignore
|
|
283
|
-
new RegExp("([\\s\\S]*?)</" +
|
|
283
|
+
new RegExp("([\\s\\S]*?)</" + o.at(-1) + "[^>]*>"),
|
|
284
284
|
function(c, s) {
|
|
285
285
|
return s = s.replace(
|
|
286
286
|
/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,
|
|
287
287
|
"$1$2"
|
|
288
288
|
), t.chars && t.chars(s), "";
|
|
289
289
|
}
|
|
290
|
-
), i("",
|
|
290
|
+
), i("", o.at(-1));
|
|
291
291
|
if (e == l) throw "Parse Error: " + e;
|
|
292
292
|
l = e;
|
|
293
293
|
}
|
|
294
294
|
i();
|
|
295
295
|
function u(c, s, d, f) {
|
|
296
296
|
if (s = s.toLowerCase(), G[s])
|
|
297
|
-
for (;
|
|
298
|
-
i("",
|
|
299
|
-
if (T[s] &&
|
|
297
|
+
for (; o.at(-1) && B[o.at(-1)]; )
|
|
298
|
+
i("", o.at(-1));
|
|
299
|
+
if (T[s] && o.at(-1) == s && i("", s), f = S[s] || !!f, f || o.push(s), t.start) {
|
|
300
300
|
const _ = [];
|
|
301
301
|
d.replace(U, function(z, x) {
|
|
302
302
|
let w = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : H[x] ? x : "";
|
|
@@ -323,49 +323,49 @@ const xe = (e) => {
|
|
|
323
323
|
child: []
|
|
324
324
|
};
|
|
325
325
|
return O(e, {
|
|
326
|
-
start: function(n,
|
|
326
|
+
start: function(n, a, o) {
|
|
327
327
|
let l = {
|
|
328
328
|
node: "element",
|
|
329
329
|
tag: n
|
|
330
330
|
};
|
|
331
|
-
if (
|
|
331
|
+
if (a.length !== 0 && (l.attr = a.reduce(function(i, u) {
|
|
332
332
|
let c = u.name, s = u.value;
|
|
333
333
|
return s.match(/ /) && (["title", "transform", "viewBox", "widget"].includes(u.name) || (s = s.split(" "))), i[c] ? Array.isArray(i[c]) ? i[c].push(s) : i[c] = [i[c], s] : i[c] = s, i;
|
|
334
|
-
}, {})),
|
|
334
|
+
}, {})), o) {
|
|
335
335
|
const i = t[0] || r;
|
|
336
336
|
i.child === void 0 && (i.child = []), i.child.push(l);
|
|
337
337
|
} else
|
|
338
338
|
t.unshift(l);
|
|
339
339
|
},
|
|
340
340
|
end: function(n) {
|
|
341
|
-
const
|
|
342
|
-
if (
|
|
343
|
-
r.child.push(
|
|
341
|
+
const a = t.shift();
|
|
342
|
+
if (a.tag !== n && console.error("invalid state: mismatch end tag"), t.length === 0)
|
|
343
|
+
r.child.push(a);
|
|
344
344
|
else {
|
|
345
|
-
const
|
|
346
|
-
|
|
345
|
+
const o = t[0];
|
|
346
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
347
347
|
}
|
|
348
348
|
},
|
|
349
349
|
//@ts-ignore
|
|
350
350
|
chars: function(n) {
|
|
351
|
-
let
|
|
351
|
+
let a = {
|
|
352
352
|
node: "text",
|
|
353
353
|
text: n
|
|
354
354
|
};
|
|
355
355
|
if (t.length === 0)
|
|
356
|
-
r.child.push(
|
|
356
|
+
r.child.push(a);
|
|
357
357
|
else {
|
|
358
|
-
const
|
|
359
|
-
|
|
358
|
+
const o = t[0];
|
|
359
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
360
360
|
}
|
|
361
361
|
},
|
|
362
362
|
//@ts-ignore
|
|
363
363
|
comment: function(n) {
|
|
364
|
-
const
|
|
364
|
+
const a = {
|
|
365
365
|
node: "comment",
|
|
366
366
|
text: n
|
|
367
|
-
},
|
|
368
|
-
|
|
367
|
+
}, o = t[0];
|
|
368
|
+
o.child === void 0 && (o.child = []), o.child.push(a);
|
|
369
369
|
}
|
|
370
370
|
}), r;
|
|
371
371
|
}, Z = (e) => {
|
|
@@ -386,19 +386,19 @@ const xe = (e) => {
|
|
|
386
386
|
"embed"
|
|
387
387
|
];
|
|
388
388
|
let r = "";
|
|
389
|
-
e.child && (r = e.child.map(function(
|
|
390
|
-
return Z(
|
|
389
|
+
e.child && (r = e.child.map(function(a) {
|
|
390
|
+
return Z(a);
|
|
391
391
|
}).join(""));
|
|
392
392
|
let n = "";
|
|
393
|
-
if (e.attr && (n = Object.keys(e.attr).map(function(
|
|
394
|
-
let
|
|
395
|
-
return Array.isArray(
|
|
393
|
+
if (e.attr && (n = Object.keys(e.attr).map(function(a) {
|
|
394
|
+
let o = e.attr[a];
|
|
395
|
+
return Array.isArray(o) && (o = o.join(" ")), `${a}=${F(o)}`;
|
|
396
396
|
}).join(" "), n !== "" && (n = ` ${n}`)), e.node === "element") {
|
|
397
|
-
let
|
|
398
|
-
if (t.indexOf(
|
|
397
|
+
let a = e.tag;
|
|
398
|
+
if (t.indexOf(a) > -1)
|
|
399
399
|
return `<${e.tag}${n}/>`;
|
|
400
|
-
const
|
|
401
|
-
return `${
|
|
400
|
+
const o = `<${e.tag}${n}>`, l = `</${e.tag}>`;
|
|
401
|
+
return `${o}${r}${l}`;
|
|
402
402
|
}
|
|
403
403
|
if (e.node === "text")
|
|
404
404
|
return e.text;
|
|
@@ -417,9 +417,9 @@ const xe = (e) => {
|
|
|
417
417
|
if (e = typeof e == "string" || e instanceof String ? parseFloat(e.replace(/[^0-9.]/g, "")) : e, r === !1)
|
|
418
418
|
return e.toLocaleString(n);
|
|
419
419
|
if (e < 1e3)
|
|
420
|
-
return
|
|
420
|
+
return e;
|
|
421
421
|
e = e.toString().replace(/[^0-9.]/g, "");
|
|
422
|
-
let
|
|
422
|
+
let a = [
|
|
423
423
|
{ v: 1e3, s: "k" },
|
|
424
424
|
{ v: 1e6, s: "M" },
|
|
425
425
|
{ v: 1e9, s: "G" },
|
|
@@ -428,10 +428,10 @@ const xe = (e) => {
|
|
|
428
428
|
{ v: 1e18, s: "E" },
|
|
429
429
|
{ v: 1e21, s: "Z" },
|
|
430
430
|
{ v: 1e24, s: "Y" }
|
|
431
|
-
],
|
|
432
|
-
for (
|
|
431
|
+
], o;
|
|
432
|
+
for (o = a.length - 1; o > 0 && !(e >= a[o].v); o--)
|
|
433
433
|
;
|
|
434
|
-
return (e / o
|
|
434
|
+
return (e / a[o].v).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + a[o].s;
|
|
435
435
|
}, we = (e) => Object.keys(e).length === 0, h = new BroadcastChannel("logging"), Re = async (e = 0, t) => {
|
|
436
436
|
h.postMessage({ action: "log", level: e, message: t });
|
|
437
437
|
}, Pe = {
|
|
@@ -459,10 +459,10 @@ function Ee(e, t) {
|
|
|
459
459
|
{ value: 1e21, symbol: "Z" },
|
|
460
460
|
{ value: 1e24, symbol: "Y" }
|
|
461
461
|
], n = /\.0+$|(\.\d*[1-9])0+$/;
|
|
462
|
-
let
|
|
463
|
-
for (
|
|
462
|
+
let a;
|
|
463
|
+
for (a = r.length - 1; a > 0 && !(e >= r[a].value); a--)
|
|
464
464
|
;
|
|
465
|
-
return (e / r[
|
|
465
|
+
return (e / r[a].value).toFixed(t).replace(n, "$1") + r[a].symbol;
|
|
466
466
|
}
|
|
467
467
|
function Me(e) {
|
|
468
468
|
const t = RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);
|
|
@@ -479,9 +479,21 @@ function Ce(e) {
|
|
|
479
479
|
return e.language === "ar" ? {
|
|
480
480
|
direction: "rtl",
|
|
481
481
|
textAlign: "right"
|
|
482
|
-
} : {
|
|
482
|
+
} : {
|
|
483
|
+
direction: "ltr",
|
|
484
|
+
textAlign: "left"
|
|
485
|
+
};
|
|
483
486
|
}
|
|
484
|
-
|
|
487
|
+
const Ue = (e) => {
|
|
488
|
+
switch (e.language) {
|
|
489
|
+
case "ar":
|
|
490
|
+
case "ml":
|
|
491
|
+
return "rtl";
|
|
492
|
+
default:
|
|
493
|
+
return "ltr";
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
function Se(e) {
|
|
485
497
|
const t = e.filter(
|
|
486
498
|
(r) => r !== void 0
|
|
487
499
|
);
|
|
@@ -523,13 +535,13 @@ function Ue(e) {
|
|
|
523
535
|
}
|
|
524
536
|
}), t;
|
|
525
537
|
}
|
|
526
|
-
function
|
|
538
|
+
function Ge(e, t, r, n) {
|
|
527
539
|
e.stopPropagation(), t.showModal({
|
|
528
540
|
showComponent: "card-modal",
|
|
529
541
|
props: { data: r, options: n }
|
|
530
542
|
});
|
|
531
543
|
}
|
|
532
|
-
function
|
|
544
|
+
function Be(e) {
|
|
533
545
|
const t = [...e];
|
|
534
546
|
for (let r = t.length - 1; r > 0; r--) {
|
|
535
547
|
const n = Math.floor(Math.random() * (r + 1));
|
|
@@ -537,13 +549,13 @@ function Ge(e) {
|
|
|
537
549
|
}
|
|
538
550
|
return t;
|
|
539
551
|
}
|
|
540
|
-
function
|
|
552
|
+
function Te() {
|
|
541
553
|
let e = "";
|
|
542
554
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
543
555
|
for (let r = 0; r < 7; r++) e += t.charAt(Math.floor(Math.random() * t.length));
|
|
544
556
|
return e;
|
|
545
557
|
}
|
|
546
|
-
const
|
|
558
|
+
const He = (e) => {
|
|
547
559
|
switch (e?.type) {
|
|
548
560
|
case D.MESSAGES:
|
|
549
561
|
return g.MESSAGES;
|
|
@@ -556,12 +568,12 @@ const Te = (e) => {
|
|
|
556
568
|
}
|
|
557
569
|
}, K = (e = 6) => Math.random().toString(36).substring(2, e + 2), X = (e, t = []) => !t.find(function(n) {
|
|
558
570
|
return n === e;
|
|
559
|
-
}),
|
|
560
|
-
let n = 0,
|
|
561
|
-
for (;
|
|
562
|
-
|
|
563
|
-
return
|
|
564
|
-
},
|
|
571
|
+
}), We = (e, t = []) => {
|
|
572
|
+
let n = 0, a = "";
|
|
573
|
+
for (; a == "" && n < 100; )
|
|
574
|
+
a = K(e), X(a, t) || (a = "", n++);
|
|
575
|
+
return a;
|
|
576
|
+
}, Fe = (e) => {
|
|
565
577
|
switch (!0) {
|
|
566
578
|
case e < 0:
|
|
567
579
|
return "text-down text-xs";
|
|
@@ -570,23 +582,23 @@ const Te = (e) => {
|
|
|
570
582
|
default:
|
|
571
583
|
return "text-white text-xs";
|
|
572
584
|
}
|
|
573
|
-
},
|
|
574
|
-
function
|
|
585
|
+
}, Ye = (e, t, r) => Promise.race([e, Q(t, r)]), Q = (e, t) => new Promise((r, n) => setTimeout(() => t === void 0 ? r("ok") : n(t), e));
|
|
586
|
+
function Ze(e) {
|
|
575
587
|
let t = `${e.type}.${e.topics}`;
|
|
576
588
|
return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
|
|
577
589
|
}
|
|
578
|
-
function
|
|
590
|
+
function Ke(e) {
|
|
579
591
|
if (e.widget === void 0) {
|
|
580
592
|
const t = e.topics?.split("-");
|
|
581
593
|
t && t.length > 1 ? (e.dashboard = t ? t[0] : "", e.widget = t ? t[1] : "") : (e.widget = e.topics, e.dashboard = e.slide);
|
|
582
594
|
}
|
|
583
595
|
return e;
|
|
584
596
|
}
|
|
585
|
-
function
|
|
586
|
-
let r, n,
|
|
597
|
+
function Xe(e, t) {
|
|
598
|
+
let r, n, a, o, l;
|
|
587
599
|
switch (e.moderation) {
|
|
588
600
|
case A.BEFORE:
|
|
589
|
-
r = /* @__PURE__ */ new Date(), n = e.beforeTime?.split(":"),
|
|
601
|
+
r = /* @__PURE__ */ new Date(), n = e.beforeTime?.split(":"), a = Number.parseInt(n ? n[0] : "00"), o = Number.parseInt(n ? n[1] : "00"), l = Number.parseInt(n ? n[2] : "00"), t.before = r.setHours(a, o, l, 0) / 1e3, t.period || (t.period = r.getDay() === 1 ? 72 : 24);
|
|
590
602
|
break;
|
|
591
603
|
case A.DELAYED:
|
|
592
604
|
e.delay && e.delay > 0 && (t.delay = `${e.delay}`);
|
|
@@ -619,17 +631,18 @@ export {
|
|
|
619
631
|
ne as brandLogo,
|
|
620
632
|
y as camelCase,
|
|
621
633
|
te as camelCasedProps,
|
|
622
|
-
|
|
623
|
-
|
|
634
|
+
oe as camelToHyphen,
|
|
635
|
+
ae as camelize,
|
|
624
636
|
ie as capitalizeFirstLetter,
|
|
625
637
|
se as clearContents,
|
|
626
638
|
E as deepMerge,
|
|
639
|
+
Ue as dir,
|
|
627
640
|
ge as escape,
|
|
628
641
|
ee as filterAttributes,
|
|
629
642
|
M as flatten,
|
|
630
643
|
be as formatContent,
|
|
631
644
|
me as getGuid,
|
|
632
|
-
|
|
645
|
+
Ze as getKey,
|
|
633
646
|
Me as getParameterByName,
|
|
634
647
|
ke as getQueryParam,
|
|
635
648
|
Oe as hasHWA,
|
|
@@ -644,7 +657,7 @@ export {
|
|
|
644
657
|
Le as maxifyHtml,
|
|
645
658
|
Ie as minifyCss,
|
|
646
659
|
ve as minifyHtml,
|
|
647
|
-
|
|
660
|
+
Xe as moderation,
|
|
648
661
|
Ee as numberFormatter,
|
|
649
662
|
le as randomColor,
|
|
650
663
|
ue as randomRGB,
|
|
@@ -652,14 +665,14 @@ export {
|
|
|
652
665
|
ce as randomRGBAfull,
|
|
653
666
|
$e as randomValue,
|
|
654
667
|
Ce as rtl,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
Se as sanitize,
|
|
669
|
+
Ge as showModal,
|
|
670
|
+
Be as shuffleMessages,
|
|
671
|
+
Te as stringGen,
|
|
672
|
+
He as typeCss,
|
|
673
|
+
We as uniq,
|
|
661
674
|
fe as unique,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
675
|
+
Fe as upDownColor,
|
|
676
|
+
Ke as widgetParams,
|
|
677
|
+
Ye as wrapPromise
|
|
665
678
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzcasting-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.12.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Mark Tamis, TouchFlows SAS",
|
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@antfu/eslint-config": "^
|
|
35
|
-
"@commitlint/cli": "^20.
|
|
36
|
-
"@commitlint/config-conventional": "^20.
|
|
37
|
-
"@types/node": "^24.10.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
39
|
-
"@typescript-eslint/parser": "^8.
|
|
34
|
+
"@antfu/eslint-config": "^7.2.0",
|
|
35
|
+
"@commitlint/cli": "^20.4.1",
|
|
36
|
+
"@commitlint/config-conventional": "^20.4.1",
|
|
37
|
+
"@types/node": "^24.10.10",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
40
40
|
"@vitest/coverage-v8": "^4.0.1",
|
|
41
41
|
"camelcase": "^9.0.0",
|
|
42
42
|
"changelogen": "^0.6.2",
|
|
43
43
|
"eslint": "^9.39.2",
|
|
44
44
|
"lint-staged": "^16.2.7",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
|
-
"vite": "^7.3.
|
|
46
|
+
"vite": "^7.3.1",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4",
|
|
48
48
|
"vitest": "^4.0.1"
|
|
49
49
|
},
|