buzzcasting-utils 1.3.10 → 1.3.11
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 +15 -0
- package/dist/buzzcasting-utils.esm.js +100 -79
- package/package.json +10 -10
|
@@ -135,6 +135,9 @@ export { CSS_2 as CSS }
|
|
|
135
135
|
|
|
136
136
|
export declare function deepMerge(objs: any): void;
|
|
137
137
|
|
|
138
|
+
declare const escape_2: (htmlStr: string) => string;
|
|
139
|
+
export { escape_2 as escape }
|
|
140
|
+
|
|
138
141
|
export declare enum EVENTS {
|
|
139
142
|
ADD_SLIDE = "addSlide",
|
|
140
143
|
APP_READY = "appReady",
|
|
@@ -308,6 +311,8 @@ export declare interface ICloudBubbles {
|
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
export declare interface ICloudConfig {
|
|
314
|
+
items?: number;
|
|
315
|
+
chunck?: number;
|
|
311
316
|
fixed?: number;
|
|
312
317
|
abbreviate?: boolean;
|
|
313
318
|
}
|
|
@@ -1202,6 +1207,14 @@ export declare function moderation(options: IStorageOptions, query: IQuery): IQu
|
|
|
1202
1207
|
|
|
1203
1208
|
export declare function numberFormatter(num: number, digits: number): string;
|
|
1204
1209
|
|
|
1210
|
+
export declare const randomColor: () => string;
|
|
1211
|
+
|
|
1212
|
+
export declare const randomRGB: () => string;
|
|
1213
|
+
|
|
1214
|
+
export declare const randomRGBA: () => string;
|
|
1215
|
+
|
|
1216
|
+
export declare const randomRGBAfull: () => string;
|
|
1217
|
+
|
|
1205
1218
|
/**
|
|
1206
1219
|
* Get a random item from an array
|
|
1207
1220
|
* @param array
|
|
@@ -1209,6 +1222,8 @@ export declare function numberFormatter(num: number, digits: number): string;
|
|
|
1209
1222
|
*/
|
|
1210
1223
|
export declare function randomValue(array: string | any[]): number;
|
|
1211
1224
|
|
|
1225
|
+
export declare const RGBAchangeA: (str: string, opacity: string) => string;
|
|
1226
|
+
|
|
1212
1227
|
export declare function rtl(message: IMessage): {
|
|
1213
1228
|
[key: string]: string;
|
|
1214
1229
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var m = /* @__PURE__ */ ((e) => (e.MESSAGES = "messages", e.CLOUD = "cloud", e.SERIES = "series", e.TOPICS = "topics", e.WIDGET = "widget", e.WIDGETS = "widgets", e.DASHBOARD = "dashboard", e.DASHBOARDS = "dashboards", e.SLIDE = "slide", e.SLIDES = "slides", e.PRESENTATION = "presentation", e.PRESENTATIONS = "presentations", e.PREFERENCE = "preference", e.PREFERENCES = "preferences", e))(m || {}), h = /* @__PURE__ */ ((e) => (e.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", e.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", e.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", e.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", e.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", e.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", e.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", e.NONE = "color:transparent;background-color:transparent;", e.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", e.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", e.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", e.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", e.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", e.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", e.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", e))(h || {}),
|
|
1
|
+
var m = /* @__PURE__ */ ((e) => (e.MESSAGES = "messages", e.CLOUD = "cloud", e.SERIES = "series", e.TOPICS = "topics", e.WIDGET = "widget", e.WIDGETS = "widgets", e.DASHBOARD = "dashboard", e.DASHBOARDS = "dashboards", e.SLIDE = "slide", e.SLIDES = "slides", e.PRESENTATION = "presentation", e.PRESENTATIONS = "presentations", e.PREFERENCE = "preference", e.PREFERENCES = "preferences", e))(m || {}), h = /* @__PURE__ */ ((e) => (e.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", e.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", e.BROADCAST = "color:navy;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", e.CLOUD = "color:purple;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", e.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", e.ERROR = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.KO = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", e.MESSAGES = "color:white;background-color:darkslateblue;padding:0 4px 0 4px;border-radius:5px;", e.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", e.NONE = "color:transparent;background-color:transparent;", e.OK = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", e.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", e.SERIES = "color:purple;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", e.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", e.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", e.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", e.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", e.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", e))(h || {}), v = /* @__PURE__ */ ((e) => (e.ADD_SLIDE = "addSlide", e.APP_READY = "appReady", e.API_UPDATE = "apiUpdate", e.WS_API_REQUEST = "wsApiRequest", e.WS_API_RESPONSE = "wsApiResponse", e.WS_API_UPDATE = "wsApiRUpdate", e.APPROVE_MESSAGE = "approveMessage", e.CHANNEL = "channel", e.CLEAN_MESSAGES = "cleanMessages", e.CLOSE_MODAL = "closeModal", e.CLOSE_BUILDER_MODAL = "closeBuilderModal", e.DASHBOARD_LOAD = "loadDashboard", e.DASHBOARD_STORE = "storeDashboard", e.ERROR = "error", e.HIDE_MESSAGE = "hideMessage", e.HIDE_LABELS = "hideLabels", e.MAUPPUT_UPDATE = "layoutUpdate", e.PREV_SLIDE = "prevSlide", e.RELOAD_PRESENTATION = "reloadPresentation", e.SHOW_MODAL = "showModal", e.STAR_MESSAGE = "starMessage", e.GOTO_SLIDE = "gotoSlide", e.NEXT_SLIDE = "nextSlide", e.PREFERENCE_LOAD = "loadPreference", e.PREFERENCE_STORE = "storePreference", e.PAUSE_PRESENTATION = "pausePresentation", e.PRESENTATION_READY = "presentationReady", e.PRESENTATION_LOAD = "loadPresentation", e.PRESENTATION_STORE = "storePresentation", e.SHOW_BUILDER_MODAL = "showBuilderModal", e.SLIDE_DID_LOAD = "slideDidLoad", e.SLIDE_GOTO = "slideGoto", e.SLIDE_READY = "slideReady", e.SLIDE_LOAD = "loadSlide", e.SLIDE_STORE = "storeSlide", e.SLIDE_TRANSITIONER = "slideTransitioner", e.START_TRANSITIONER = "startTransitioner", e.STORAGE_INIT = "storageInit", e.SUBSCRIBE = "subscribe", e.SUSPEND_ACCOUNT = "suspendAccount", e.SWITCH_PRESENTATION = "switchPresentation", e.REMOVE_CLOUD = "removeCloud", e.UPDATE = "update", e.VERSION = "version", e.WIDGETS_CLEAR = "widgetsClear", e.WIDGET_LOAD = "widgetLoad", e.WIDGET_STORE = "widgetStore", e.WIDGET_UPDATE = "widgetUpdate", e))(v || {}), x = /* @__PURE__ */ ((e) => (e.APPROVED = "approved", e.BEFORE = "before", e.DELAYED = "delayed", e.NONE = "none", e.REALTIME = "realtime", e))(x || {}), P = /* @__PURE__ */ ((e) => (e.KEYVAL = "keyval", e.LOCAL = "local", e.SESSION = "session", e.DEXIE = "dexie", e.WINDOW = "window", e))(P || {});
|
|
2
2
|
function J(e) {
|
|
3
3
|
const t = e.toUpperCase().split(/[\s_-]+/);
|
|
4
4
|
return t.length > 0 ? (t.forEach((r, n) => {
|
|
@@ -39,7 +39,7 @@ function V(e) {
|
|
|
39
39
|
const t = {};
|
|
40
40
|
for (let r = 0; r < e.length; r++) {
|
|
41
41
|
const n = e[r];
|
|
42
|
-
n.name !== "class" && (t[n.name] =
|
|
42
|
+
n.name !== "class" && (t[n.name] = k(n.value));
|
|
43
43
|
}
|
|
44
44
|
return t;
|
|
45
45
|
}
|
|
@@ -90,7 +90,7 @@ function ee(e, t) {
|
|
|
90
90
|
function te(e) {
|
|
91
91
|
return e.replace(/^\w|[A-Z]|\b\w/g, (t, r) => r === 0 ? t.toLowerCase() : t.toUpperCase()).replace(/\s+/g, "");
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function k(e) {
|
|
94
94
|
return e.toLowerCase().split("-").reduce((t, r) => t + (r.charAt(0).toUpperCase() + r.slice(1)));
|
|
95
95
|
}
|
|
96
96
|
const re = (e) => e.charAt(0).toUpperCase() + e.slice(1);
|
|
@@ -98,29 +98,44 @@ function ne(e) {
|
|
|
98
98
|
const t = document.createRange();
|
|
99
99
|
t.selectNodeContents(e), t.deleteContents();
|
|
100
100
|
}
|
|
101
|
-
|
|
101
|
+
const oe = () => Math.floor(Math.random() * 16777215).toString(16), ae = () => {
|
|
102
|
+
var e = Math.round, t = Math.random, r = 255;
|
|
103
|
+
return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + "," + t().toFixed(1) + ")";
|
|
104
|
+
}, ie = () => {
|
|
105
|
+
var e = Math.round, t = Math.random, r = 255;
|
|
106
|
+
return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + ", 0)";
|
|
107
|
+
}, se = () => {
|
|
108
|
+
var e = Math.round, t = Math.random, r = 255;
|
|
109
|
+
return "rgba(" + e(t() * r) + "," + e(t() * r) + "," + e(t() * r) + ")";
|
|
110
|
+
}, le = (e, t) => {
|
|
111
|
+
e = e.substring(e.indexOf("(") + 1, e.indexOf(")"));
|
|
112
|
+
let r = e.split(",");
|
|
113
|
+
return r = r.map((n) => parseFloat(n.trim()).toString()), e = "background-color: rgba(" + parseInt(r[0]) + "," + parseInt(r[1]) + "," + parseInt(r[2]) + "," + t + ");", e;
|
|
114
|
+
};
|
|
115
|
+
function L(e) {
|
|
102
116
|
e.reduce(
|
|
103
117
|
(t, r) => Object.keys(r).reduce(
|
|
104
118
|
(n, o) => ({
|
|
105
119
|
...n,
|
|
106
|
-
[o]: o in t && typeof t[o] == "object" && t[o] !== null && typeof r[o] == "object" && r[o] !== null ?
|
|
120
|
+
[o]: o in t && typeof t[o] == "object" && t[o] !== null && typeof r[o] == "object" && r[o] !== null ? L([t[o], r[o]]) : r[o]
|
|
107
121
|
}),
|
|
108
122
|
t
|
|
109
123
|
),
|
|
110
124
|
{}
|
|
111
125
|
);
|
|
112
126
|
}
|
|
113
|
-
|
|
127
|
+
const ce = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
128
|
+
function de(e, t = "font-bold") {
|
|
114
129
|
return `${(e == null ? void 0 : e.title.length) > 0 ? `<div class="${t}">${e.title}</div>` : ""}${e != null && e.content ? e.content.replace(/\n\n/g, `
|
|
115
130
|
`).replace(/\n/g, "<br/>") : ""}`;
|
|
116
131
|
}
|
|
117
|
-
const
|
|
132
|
+
const ue = () => [b(2), b(1), b(1), b(1), b(3)].join("-"), b = (e) => {
|
|
118
133
|
let t = "";
|
|
119
134
|
for (let r = 0; r < e; r++)
|
|
120
135
|
t += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
121
136
|
return t;
|
|
122
137
|
};
|
|
123
|
-
function
|
|
138
|
+
function $(e, t) {
|
|
124
139
|
for (; e.length < t; )
|
|
125
140
|
e = `0${e}`;
|
|
126
141
|
return e;
|
|
@@ -140,7 +155,7 @@ function I(e, t, r) {
|
|
|
140
155
|
}
|
|
141
156
|
}
|
|
142
157
|
function _(e, t, r, n) {
|
|
143
|
-
const o = f(f(f(e, r),
|
|
158
|
+
const o = f(f(f(e, r), M(t)), typeof t);
|
|
144
159
|
if (t === null)
|
|
145
160
|
return f(o, "null");
|
|
146
161
|
if (t === void 0)
|
|
@@ -160,13 +175,13 @@ function _(e, t, r, n) {
|
|
|
160
175
|
}
|
|
161
176
|
return f(o, t.toString());
|
|
162
177
|
}
|
|
163
|
-
function
|
|
178
|
+
function M(e) {
|
|
164
179
|
return Object.prototype.toString.call(e);
|
|
165
180
|
}
|
|
166
|
-
function
|
|
167
|
-
return
|
|
181
|
+
function fe(e) {
|
|
182
|
+
return $(_(0, e, "", []).toString(16), 8);
|
|
168
183
|
}
|
|
169
|
-
const
|
|
184
|
+
const pe = (e) => {
|
|
170
185
|
let t = "";
|
|
171
186
|
return D(e, {
|
|
172
187
|
start: function(r, n, o) {
|
|
@@ -185,7 +200,7 @@ const se = (e) => {
|
|
|
185
200
|
t += `<!-- ${r} -->`;
|
|
186
201
|
}
|
|
187
202
|
}), t;
|
|
188
|
-
},
|
|
203
|
+
}, ge = (e, t) => {
|
|
189
204
|
const r = g("html,head,body,title"), n = { link: "head", base: "head" };
|
|
190
205
|
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));
|
|
191
206
|
const o = [];
|
|
@@ -219,15 +234,15 @@ const se = (e) => {
|
|
|
219
234
|
let t = {}, r = e.split(",");
|
|
220
235
|
for (let n = 0; n < r.length; n++) t[r[n]] = !0;
|
|
221
236
|
return t;
|
|
222
|
-
}, R = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, E = /^<\/([-A-Za-z0-9_]+)[^>]*>/,
|
|
237
|
+
}, R = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/, E = /^<\/([-A-Za-z0-9_]+)[^>]*>/, y = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g, S = g(
|
|
223
238
|
"area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"
|
|
224
|
-
),
|
|
239
|
+
), C = g(
|
|
225
240
|
"a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"
|
|
226
241
|
), U = g(
|
|
227
242
|
"abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"
|
|
228
|
-
),
|
|
243
|
+
), B = g("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), T = g(
|
|
229
244
|
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
|
|
230
|
-
),
|
|
245
|
+
), G = g("script,style"), D = (e, t) => {
|
|
231
246
|
let r, n, o, a = [], l = e;
|
|
232
247
|
const i = (c, s) => {
|
|
233
248
|
let d;
|
|
@@ -242,7 +257,7 @@ const se = (e) => {
|
|
|
242
257
|
}
|
|
243
258
|
};
|
|
244
259
|
for (; e; ) {
|
|
245
|
-
if (n = !0, !a.at(-1) || !
|
|
260
|
+
if (n = !0, !a.at(-1) || !G[a.at(-1)]) {
|
|
246
261
|
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 ? (o = e.match(E), o && (e = e.substring(o[0].length), o[0].replace(E, i), n = !1)) : e.indexOf("<") == 0 && (o = e.match(R), o && (e = e.substring(o[0].length), o[0].replace(R, u), n = !1)), n) {
|
|
247
262
|
r = e.indexOf("<");
|
|
248
263
|
let c = r < 0 ? e : e.substring(0, r);
|
|
@@ -264,13 +279,13 @@ const se = (e) => {
|
|
|
264
279
|
}
|
|
265
280
|
i();
|
|
266
281
|
function u(c, s, d, p) {
|
|
267
|
-
if (s = s.toLowerCase(),
|
|
282
|
+
if (s = s.toLowerCase(), C[s])
|
|
268
283
|
for (; a.at(-1) && U[a.at(-1)]; )
|
|
269
284
|
i("", a.at(-1));
|
|
270
|
-
if (
|
|
285
|
+
if (B[s] && a.at(-1) == s && i("", s), p = S[s] || !!p, p || a.push(s), t.start) {
|
|
271
286
|
const w = [];
|
|
272
|
-
d.replace(
|
|
273
|
-
let O = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] :
|
|
287
|
+
d.replace(y, function(j, A) {
|
|
288
|
+
let O = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : T[A] ? A : "";
|
|
274
289
|
w.push({
|
|
275
290
|
name: A,
|
|
276
291
|
value: O,
|
|
@@ -281,13 +296,13 @@ const se = (e) => {
|
|
|
281
296
|
}
|
|
282
297
|
}
|
|
283
298
|
};
|
|
284
|
-
function
|
|
299
|
+
function H(e) {
|
|
285
300
|
return `"${e}"`;
|
|
286
301
|
}
|
|
287
302
|
function W(e) {
|
|
288
303
|
return e.replace(/<\?xml.*\?>\n/, "").replace(/<!doctype.*\>\n/, "").replace(/<!DOCTYPE.*\>\n/, "");
|
|
289
304
|
}
|
|
290
|
-
const
|
|
305
|
+
const be = (e) => {
|
|
291
306
|
e = W(e);
|
|
292
307
|
const t = [], r = {
|
|
293
308
|
node: "root",
|
|
@@ -363,7 +378,7 @@ const ce = (e) => {
|
|
|
363
378
|
let n = "";
|
|
364
379
|
if (e.attr && (n = Object.keys(e.attr).map(function(o) {
|
|
365
380
|
let a = e.attr[o];
|
|
366
|
-
return Array.isArray(a) && (a = a.join(" ")), `${o}=${
|
|
381
|
+
return Array.isArray(a) && (a = a.join(" ")), `${o}=${H(a)}`;
|
|
367
382
|
}).join(" "), n !== "" && (n = ` ${n}`)), e.node === "element") {
|
|
368
383
|
let o = e.tag;
|
|
369
384
|
if (t.indexOf(o) > -1)
|
|
@@ -377,7 +392,7 @@ const ce = (e) => {
|
|
|
377
392
|
return `<!-- ${e.text} -->`;
|
|
378
393
|
if (e.node === "root")
|
|
379
394
|
return r;
|
|
380
|
-
},
|
|
395
|
+
}, he = (e, t = 0, r = !0, n = "en") => {
|
|
381
396
|
if (e = typeof e == "string" || e instanceof String ? parseFloat(e.replace(/[^0-9.]/g, "")) : e, r === !1)
|
|
382
397
|
return e.toLocaleString(n);
|
|
383
398
|
if (e < 1e3)
|
|
@@ -394,7 +409,7 @@ const ce = (e) => {
|
|
|
394
409
|
for (a = o.length - 1; a > 0 && !(e >= o[a].v); a--)
|
|
395
410
|
;
|
|
396
411
|
return (e / o[a].v).toFixed(t).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + o[a].s;
|
|
397
|
-
},
|
|
412
|
+
}, me = (e = 0, t) => {
|
|
398
413
|
switch (!0) {
|
|
399
414
|
case e > 3:
|
|
400
415
|
console.debug(...t);
|
|
@@ -409,14 +424,14 @@ const ce = (e) => {
|
|
|
409
424
|
console.error(...t);
|
|
410
425
|
break;
|
|
411
426
|
}
|
|
412
|
-
},
|
|
413
|
-
<`),
|
|
427
|
+
}, xe = (e) => e.replace(/\<\!--\s*?[^\s?\[][\s\S]*?--\>/g, "").replace(/\>\s*\</g, "><").replace(/\t/g, ""), Ae = (e) => e.replace(/\>\</g, `>
|
|
428
|
+
<`), De = (e) => {
|
|
414
429
|
e.replace(/\/\*.*\*\/|\/\*[\s\S]*?\*\/|\n|\t|\v|\s{2,}/g, "").replace(/\s*\{\s*/g, "{").replace(/\s*\}\s*/g, "}").replace(/\s*\:\s*/g, ":").replace(/\s*\;\s*/g, ";").replace(/\s*\,\s*/g, ",").replace(/\s*\~\s*/g, "~").replace(/\s*\>\s*/g, ">").replace(/\s*\+\s*/g, "+").replace(/\s*\!\s*/g, "!");
|
|
415
|
-
},
|
|
430
|
+
}, we = (e) => e.replace(/\,/g, ", ").replace(/\{/g, ` {
|
|
416
431
|
`).replace(/\}/g, `}
|
|
417
432
|
`).replace(/\;/g, `;
|
|
418
433
|
`);
|
|
419
|
-
function
|
|
434
|
+
function Oe(e, t) {
|
|
420
435
|
const r = [
|
|
421
436
|
{ value: 1, symbol: "" },
|
|
422
437
|
{ value: 1e3, symbol: "K" },
|
|
@@ -431,18 +446,18 @@ function he(e, t) {
|
|
|
431
446
|
;
|
|
432
447
|
return (e / r[o].value).toFixed(t).replace(n, "$1") + r[o].symbol;
|
|
433
448
|
}
|
|
434
|
-
function
|
|
449
|
+
function Re(e) {
|
|
435
450
|
const t = RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);
|
|
436
451
|
return t && decodeURIComponent(t[1].replace(/\+/g, " ")) || null;
|
|
437
452
|
}
|
|
438
|
-
const
|
|
453
|
+
const Ee = (e) => new Proxy(new URLSearchParams(window.location.search), {
|
|
439
454
|
// @ts-ignore
|
|
440
455
|
get: (r, n) => r.get(n)
|
|
441
456
|
})[e];
|
|
442
|
-
function
|
|
457
|
+
function _e(e) {
|
|
443
458
|
return e[Math.floor(Math.random() * e.length)];
|
|
444
459
|
}
|
|
445
|
-
function
|
|
460
|
+
function ve(e) {
|
|
446
461
|
switch (e.language) {
|
|
447
462
|
case "ar":
|
|
448
463
|
return {
|
|
@@ -453,7 +468,7 @@ function De(e) {
|
|
|
453
468
|
return {};
|
|
454
469
|
}
|
|
455
470
|
}
|
|
456
|
-
function
|
|
471
|
+
function Pe(e) {
|
|
457
472
|
const t = window.BuzzCasting.getOptions().suspended ?? !1;
|
|
458
473
|
return e.forEach((r) => {
|
|
459
474
|
var n;
|
|
@@ -494,13 +509,13 @@ function we(e) {
|
|
|
494
509
|
}
|
|
495
510
|
}), e;
|
|
496
511
|
}
|
|
497
|
-
function
|
|
512
|
+
function ke(e, t, r, n) {
|
|
498
513
|
e.stopPropagation(), t.showModal({
|
|
499
514
|
showComponent: "card-modal",
|
|
500
515
|
props: { data: r, options: n }
|
|
501
516
|
});
|
|
502
517
|
}
|
|
503
|
-
function
|
|
518
|
+
function Le(e) {
|
|
504
519
|
const t = [...e];
|
|
505
520
|
for (let r = t.length - 1; r > 0; r--) {
|
|
506
521
|
const n = Math.floor(Math.random() * (r + 1));
|
|
@@ -508,13 +523,13 @@ function Re(e) {
|
|
|
508
523
|
}
|
|
509
524
|
return t;
|
|
510
525
|
}
|
|
511
|
-
function
|
|
526
|
+
function $e() {
|
|
512
527
|
let e = "";
|
|
513
528
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
514
529
|
for (let r = 0; r < 7; r++) e += t.charAt(Math.floor(Math.random() * t.length));
|
|
515
530
|
return e;
|
|
516
531
|
}
|
|
517
|
-
const
|
|
532
|
+
const Ie = (e) => {
|
|
518
533
|
switch (e == null ? void 0 : e.type) {
|
|
519
534
|
case m.MESSAGES:
|
|
520
535
|
return h.MESSAGES;
|
|
@@ -527,12 +542,12 @@ const _e = (e) => {
|
|
|
527
542
|
}
|
|
528
543
|
}, Y = (e = 6) => Math.random().toString(36).substring(2, e + 2), K = (e, t = []) => !t.find(function(n) {
|
|
529
544
|
return n === e;
|
|
530
|
-
}),
|
|
545
|
+
}), Me = (e, t = []) => {
|
|
531
546
|
let n = 0, o = "";
|
|
532
547
|
for (; o == "" && n < 100; )
|
|
533
548
|
o = Y(e), K(o, t) || (o = "", n++);
|
|
534
549
|
return o;
|
|
535
|
-
},
|
|
550
|
+
}, ye = (e) => {
|
|
536
551
|
switch (!0) {
|
|
537
552
|
case e < 0:
|
|
538
553
|
return "text-down text-xs";
|
|
@@ -541,12 +556,12 @@ const _e = (e) => {
|
|
|
541
556
|
default:
|
|
542
557
|
return "text-white text-xs";
|
|
543
558
|
}
|
|
544
|
-
},
|
|
545
|
-
function
|
|
559
|
+
}, Se = (e, t, r) => Promise.race([e, Z(t, r)]), Z = (e, t) => new Promise((r, n) => setTimeout(() => t === void 0 ? r("ok") : n(t), e));
|
|
560
|
+
function Ce(e) {
|
|
546
561
|
let t = `${e.type}.${e.topics}`;
|
|
547
562
|
return e.order && (t += `.${e.order}`), e.period && (t += `.${e.period}`), t;
|
|
548
563
|
}
|
|
549
|
-
function
|
|
564
|
+
function Ue(e) {
|
|
550
565
|
var t;
|
|
551
566
|
if (e.widget === void 0) {
|
|
552
567
|
const r = (t = e.topics) == null ? void 0 : t.split("-");
|
|
@@ -554,7 +569,7 @@ function ve(e) {
|
|
|
554
569
|
}
|
|
555
570
|
return e;
|
|
556
571
|
}
|
|
557
|
-
function
|
|
572
|
+
function Be(e, t) {
|
|
558
573
|
var i;
|
|
559
574
|
let r, n, o, a, l;
|
|
560
575
|
switch (e.moderation) {
|
|
@@ -576,50 +591,56 @@ var X = /* @__PURE__ */ ((e) => (e.MultiPolygon = "MultiPolygon", e.Polygon = "P
|
|
|
576
591
|
export {
|
|
577
592
|
m as API,
|
|
578
593
|
h as CSS,
|
|
579
|
-
|
|
594
|
+
v as EVENTS,
|
|
580
595
|
D as HTMLParser,
|
|
581
|
-
|
|
582
|
-
|
|
596
|
+
ge as HTMLtoDOM,
|
|
597
|
+
pe as HTMLtoXML,
|
|
583
598
|
x as MODERATION,
|
|
584
|
-
|
|
599
|
+
le as RGBAchangeA,
|
|
600
|
+
P as STORAGE,
|
|
585
601
|
Q as ShapeType,
|
|
586
602
|
X as Type,
|
|
587
603
|
J as anonymize,
|
|
588
604
|
z as attachedMedia,
|
|
589
605
|
N as attrs,
|
|
590
606
|
ee as brandLogo,
|
|
591
|
-
|
|
607
|
+
k as camelCase,
|
|
592
608
|
V as camelCasedProps,
|
|
593
609
|
te as camelize,
|
|
594
610
|
re as capitalizeFirstLetter,
|
|
595
611
|
ne as clearContents,
|
|
596
|
-
|
|
612
|
+
L as deepMerge,
|
|
613
|
+
ce as escape,
|
|
597
614
|
q as filterAttributes,
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
615
|
+
de as formatContent,
|
|
616
|
+
ue as getGuid,
|
|
617
|
+
Ce as getKey,
|
|
618
|
+
Re as getParameterByName,
|
|
619
|
+
Ee as getQueryParam,
|
|
620
|
+
fe as hashSum,
|
|
621
|
+
be as html2json,
|
|
622
|
+
he as intToString,
|
|
606
623
|
F as json2html,
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
624
|
+
me as log,
|
|
625
|
+
we as maxifyCss,
|
|
626
|
+
Ae as maxifyHtml,
|
|
627
|
+
De as minifyCss,
|
|
628
|
+
xe as minifyHtml,
|
|
629
|
+
Be as moderation,
|
|
630
|
+
Oe as numberFormatter,
|
|
631
|
+
oe as randomColor,
|
|
632
|
+
se as randomRGB,
|
|
633
|
+
ie as randomRGBA,
|
|
634
|
+
ae as randomRGBAfull,
|
|
635
|
+
_e as randomValue,
|
|
636
|
+
ve as rtl,
|
|
637
|
+
Pe as sanitize,
|
|
638
|
+
ke as showModal,
|
|
639
|
+
Le as shuffleMessages,
|
|
640
|
+
$e as stringGen,
|
|
641
|
+
Ie as typeCss,
|
|
642
|
+
Me as uniq,
|
|
643
|
+
ye as upDownColor,
|
|
644
|
+
Ue as widgetParams,
|
|
645
|
+
Se as wrapPromise
|
|
625
646
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buzzcasting-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.11",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Mark Tamis, TouchFlows SAS",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@antfu/eslint-config": "^4.
|
|
32
|
+
"@antfu/eslint-config": "^4.12.0",
|
|
33
33
|
"@commitlint/cli": "^19.8.0",
|
|
34
34
|
"@commitlint/config-conventional": "^19.8.0",
|
|
35
|
-
"@types/node": "^22.
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
37
|
-
"@typescript-eslint/parser": "^8.
|
|
38
|
-
"@vitest/coverage-v8": "^3.1.
|
|
35
|
+
"@types/node": "^22.15.3",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
|
37
|
+
"@typescript-eslint/parser": "^8.31.1",
|
|
38
|
+
"@vitest/coverage-v8": "^3.1.2",
|
|
39
39
|
"camelcase": "^8.0.0",
|
|
40
40
|
"changelogen": "^0.6.1",
|
|
41
|
-
"eslint": "^9.
|
|
42
|
-
"lint-staged": "^15.5.
|
|
41
|
+
"eslint": "^9.25.1",
|
|
42
|
+
"lint-staged": "^15.5.1",
|
|
43
43
|
"typescript": "^5.8.3",
|
|
44
|
-
"vite": "^6.
|
|
44
|
+
"vite": "^6.3.3",
|
|
45
45
|
"vite-plugin-dts": "^4.5.3",
|
|
46
|
-
"vitest": "^3.1.
|
|
46
|
+
"vitest": "^3.1.2"
|
|
47
47
|
},
|
|
48
48
|
"lint-staged": {
|
|
49
49
|
"*.ts": "npm run lint"
|