@primoui/utils 1.2.2 → 1.3.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.
package/dist/index.js CHANGED
@@ -1,112 +1,115 @@
1
- import p from "@sindresorhus/slugify";
2
- const j = (t, e) => {
1
+ import d from "@sindresorhus/slugify";
2
+ const z = (t, e) => {
3
3
  const r = e - t + 1;
4
- return Array.from({ length: r }, (n, o) => o + t);
5
- }, f = async (t) => new Promise((e) => setTimeout(e, t)), C = ({ key: t, metaKey: e }) => `${e ? "⌘" : ""}${t.toUpperCase()}`, g = (t) => t.replace(/<[^>]*>?/gm, ""), d = (t, e = " ") => t.replace(/\n+/g, e), B = (t, e = 250) => {
4
+ return Array.from({ length: r }, (n, s) => s + t);
5
+ }, y = async (t) => new Promise((e) => setTimeout(e, t)), H = ({ key: t, metaKey: e }) => `${e ? "⌘" : ""}${t.toUpperCase()}`, w = (t) => t.replace(/<[^>]*>?/gm, ""), b = (t, e = " ") => t.replace(/\n+/g, e), J = (t, e = 250) => {
6
6
  if (!t)
7
7
  return null;
8
- const r = d(g(t)), n = r.slice(0, e).trim();
8
+ const r = b(w(t)), n = r.slice(0, e).trim();
9
9
  return n.length < r.length ? `${n}...` : n;
10
- }, L = (t, e = !1) => p(t, {
10
+ }, V = (t, e = !1) => d(t, {
11
11
  decamelize: e,
12
12
  customReplacements: [
13
13
  ["#", "sharp"],
14
14
  ["+", "plus"]
15
15
  ]
16
- }), F = (t) => t.length === 25 && t[0] === "c";
17
- function b(t) {
18
- return !!t;
19
- }
20
- const x = (t, e = 0) => {
16
+ }), K = (t) => t.length === 25 && t[0] === "c", U = (t) => !!t, Z = (t, e = 0) => {
21
17
  const r = (t || "").trim();
22
18
  if (r.length === 0 || r.length === 1 || r.length === 2)
23
19
  return r.toUpperCase();
24
- const o = r.split(" ").filter(b).map((s) => s.charAt(0).toUpperCase()).join("");
25
- return e > 0 ? o.slice(0, e) : o;
26
- }, k = (t) => new Promise((e, r) => {
20
+ const s = r.split(" ").filter(U).map((o) => o.charAt(0).toUpperCase()).join("");
21
+ return e > 0 ? s.slice(0, e) : s;
22
+ }, Q = (t) => new Promise((e, r) => {
27
23
  const n = new FileReader();
28
- n.readAsDataURL(t), n.onload = () => e(n.result), n.onerror = (o) => r(o);
29
- }), y = (t, e) => {
24
+ n.readAsDataURL(t), n.onload = () => e(n.result), n.onerror = (s) => r(s);
25
+ }), S = (t, e) => {
30
26
  const r = [];
31
27
  for (let n = 0; n < t.length; n += e)
32
28
  r.push(t.slice(n, n + e));
33
29
  return r;
34
- }, A = (t, e, r = !1) => {
30
+ }, _ = (t, e, r = !1) => {
35
31
  Object.getOwnPropertyDescriptor(
36
32
  HTMLInputElement.prototype,
37
33
  "value"
38
34
  )?.set?.call(t, e), r && t?.dispatchEvent(new Event("input", { bubbles: !0 }));
39
- }, H = (t, e = 3, r = "and") => t.slice(0, e).join(", ").replace(/, ([^,]*)$/, ` ${r} $1`), W = async (t) => {
35
+ }, G = (t, e = 3, r = "and") => t.slice(0, e).join(", ").replace(/, ([^,]*)$/, ` ${r} $1`), Y = async (t) => {
40
36
  try {
41
37
  return { data: await t, error: null };
42
38
  } catch (e) {
43
39
  return { data: null, error: e };
44
40
  }
45
- }, w = async (t, e, r) => {
46
- const { batchSize: n, concurrency: o = n, delay: s = 0 } = r;
41
+ }, M = (t) => {
42
+ if (t !== null) {
43
+ if (t?.constructor.name === "Object")
44
+ for (const e in t)
45
+ t[e] = M(t[e]);
46
+ return t;
47
+ }
48
+ }, P = async (t, e, r) => {
49
+ const { batchSize: n, concurrency: s = n, delay: o = 0 } = r;
47
50
  if (t.length === 0) return [];
48
- const a = [], c = y(t, n);
49
- for (const [u, i] of c.entries()) {
50
- console.log(`Processing batch ${u + 1}/${c.length} (${i.length} items)`);
51
- const h = await S(i, e, o);
52
- a.push(...h), s > 0 && u < c.length - 1 && (console.log(`Waiting ${s}ms before next batch...`), await f(s));
51
+ const a = [], c = S(t, n);
52
+ for (const [u, l] of c.entries()) {
53
+ console.log(`Processing batch ${u + 1}/${c.length} (${l.length} items)`);
54
+ const g = await E(l, e, s);
55
+ a.push(...g), o > 0 && u < c.length - 1 && (console.log(`Waiting ${o}ms before next batch...`), await y(o));
53
56
  }
54
57
  return a;
55
- }, J = async (t, e, r) => {
58
+ }, q = async (t, e, r) => {
56
59
  const { onError: n } = r;
57
- return w(t, async (s) => {
60
+ return P(t, async (o) => {
58
61
  try {
59
- return await e(s);
62
+ return await e(o);
60
63
  } catch (a) {
61
64
  const c = a instanceof Error ? a : new Error(String(a));
62
- return n?.(c, s), c;
65
+ return n?.(c, o), c;
63
66
  }
64
67
  }, r);
65
- }, S = async (t, e, r) => {
68
+ }, E = async (t, e, r) => {
66
69
  if (r >= t.length)
67
70
  return Promise.all(t.map(e));
68
- const n = [], o = [];
69
- for (const s of t) {
70
- const a = e(s).then((c) => {
71
+ const n = [], s = [];
72
+ for (const o of t) {
73
+ const a = e(o).then((c) => {
71
74
  n.push(c);
72
75
  });
73
- o.push(a), o.length >= r && (await Promise.race(o), o.splice(0, o.length - o.filter((c) => c !== a).length));
76
+ s.push(a), s.length >= r && (await Promise.race(s), s.splice(0, s.length - s.filter((c) => c !== a).length));
74
77
  }
75
- return await Promise.all(o), n;
76
- }, V = (t) => {
77
- const e = t.replace("#", "").substring(0, 6), r = Number.parseInt(e.substring(0, 2), 16), n = Number.parseInt(e.substring(2, 4), 16), o = Number.parseInt(e.substring(4, 6), 16);
78
- return r * 0.299 + n * 0.587 + o * 0.114 > 186;
79
- }, z = (t) => {
78
+ return await Promise.all(s), n;
79
+ }, X = (t) => {
80
+ const e = t.replace("#", "").substring(0, 6), r = Number.parseInt(e.substring(0, 2), 16), n = Number.parseInt(e.substring(2, 4), 16), s = Number.parseInt(e.substring(4, 6), 16);
81
+ return r * 0.299 + n * 0.587 + s * 0.114 > 186;
82
+ }, tt = (t) => {
80
83
  const e = document.getElementById(t || "");
81
84
  if (!e) return;
82
- const r = window.getComputedStyle(e), n = Number.parseFloat(r.scrollMarginTop), o = Math.floor(window.scrollY + e.getBoundingClientRect().top - n);
83
- return { id: t, top: o };
84
- }, M = (t) => typeof t == "object" && t !== null && "message" in t && typeof t.message == "string", E = (t) => {
85
- if (M(t)) return t;
85
+ const r = window.getComputedStyle(e), n = Number.parseFloat(r.scrollMarginTop), s = Math.floor(window.scrollY + e.getBoundingClientRect().top - n);
86
+ return { id: t, top: s };
87
+ }, R = (t) => typeof t == "object" && t !== null && "message" in t && typeof t.message == "string", v = (t) => {
88
+ if (R(t)) return t;
86
89
  try {
87
90
  return new Error(JSON.stringify(t));
88
91
  } catch {
89
92
  return new Error(String(t));
90
93
  }
91
- }, K = (t) => E(t).message, Y = (t, e) => {
94
+ }, et = (t) => v(t).message, rt = (t, e) => {
92
95
  document.addEventListener(t, e);
93
- }, G = (t, e) => {
96
+ }, nt = (t, e) => {
94
97
  document.removeEventListener(t, e);
95
- }, Z = (t, e) => {
98
+ }, st = (t, e) => {
96
99
  const r = new CustomEvent(t, { detail: e });
97
100
  document.dispatchEvent(r);
98
- }, q = () => {
101
+ }, ot = () => {
99
102
  const t = new KeyboardEvent("keydown", { key: "Escape" });
100
103
  document.dispatchEvent(t);
101
- }, Q = (t, e = "compact", r = "en-US") => new Intl.NumberFormat(r, { notation: e }).format(t), X = (t, e = "USD") => new Intl.NumberFormat("en-US", {
104
+ }, ct = (t, e = "compact", r = "en-US") => new Intl.NumberFormat(r, { notation: e }).format(t), at = (t, e = "USD") => new Intl.NumberFormat("en-US", {
102
105
  style: "currency",
103
106
  currency: e
104
- }).format(t).replace(/\D00(?=\D*$)/, ""), _ = (t, e = "month") => l(t / (e === "year" ? 12 : 1), 2), l = (t, e = 0) => t.toFixed(e < 0 ? 0 : e).replace(/\.0+$/, ""), tt = (t, e = 0) => {
107
+ }).format(t).replace(/\D00(?=\D*$)/, ""), it = (t, e = "month") => h(t / (e === "year" ? 12 : 1), 2), h = (t, e = 0) => t.toFixed(e < 0 ? 0 : e).replace(/\.0+$/, ""), ut = (t, e = 0) => {
105
108
  if (t === 0)
106
109
  return "0 Bytes";
107
110
  const r = 1024, n = Math.floor(Math.log(t) / Math.log(r));
108
- return `${l(t / r ** n, e)} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][n]}`;
109
- }, et = (t) => {
111
+ return `${h(t / r ** n, e)} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][n]}`;
112
+ }, lt = (t) => {
110
113
  const [, e] = t.split("/");
111
114
  let r;
112
115
  switch (e) {
@@ -116,141 +119,208 @@ const x = (t, e = 0) => {
116
119
  r = e;
117
120
  }
118
121
  return r?.toUpperCase();
119
- }, rt = (t) => t ? `${t.includes("localhost") ? "http" : "https"}://${t}` : "", nt = (t) => t ? t.replace(/^https?:\/\//, "") : "", ot = (t) => t ? t.replace(/\/$/, "") : "", st = (t) => t ? t.includes("http") : !1, ct = (t) => {
122
+ }, N = /^https?:\/\/(?:www\.)?(?:[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b|localhost(?::\d+)?|127\.0\.0\.1(?::\d+)?)(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/, D = (t) => {
123
+ if (!t || typeof t != "string" || !N.test(t)) return !1;
124
+ try {
125
+ return new URL(t), !0;
126
+ } catch {
127
+ return !1;
128
+ }
129
+ }, m = (t, e) => t ? t.startsWith("http://") || t.startsWith("https://") ? t : `${e !== void 0 ? e ? "https" : "http" : L(t) ? "http" : "https"}://${t}` : "", I = (t) => t?.replace(/^https?:\/\//, "") ?? "", i = (t) => {
130
+ if (!t) return "";
131
+ let e = t.trim();
132
+ if (e.includes("?") || e.includes("#"))
133
+ try {
134
+ const r = new URL(e);
135
+ return r.pathname.length > 1 && r.pathname.endsWith("/") && (r.pathname = r.pathname.slice(0, -1)), r.toString();
136
+ } catch {
137
+ return e.length > 1 && e.endsWith("/") ? e.slice(0, -1) : e;
138
+ }
139
+ return e.length > 1 && e.endsWith("/") && (e = e.slice(0, -1)), e;
140
+ }, O = (t) => {
120
141
  try {
121
142
  const e = new URL(t);
122
143
  return `${e.protocol}//${e.host}`;
123
- } catch (e) {
124
- return console.error(e), t;
144
+ } catch {
145
+ return t;
146
+ }
147
+ }, $ = (t) => {
148
+ try {
149
+ if (!D(t)) return t;
150
+ const e = new URL(t).hostname;
151
+ return e.startsWith("www.") ? e.slice(4) : e;
152
+ } catch {
153
+ return t;
125
154
  }
126
- }, at = (t) => N(t) ? new URL(t).hostname.replace("www.", "") : t, N = (t) => {
155
+ }, ht = (t) => t ? /^https?:\/\//.test(t) : !1, L = (t) => {
127
156
  if (!t) return !1;
128
157
  try {
129
- return new URL(t), !0;
158
+ const r = new URL(m(t)).hostname;
159
+ return r === "localhost" || r === "127.0.0.1" || r.endsWith(".localhost");
130
160
  } catch {
131
- return !1;
161
+ return t.includes("localhost") || t.includes("127.0.0.1");
162
+ }
163
+ }, mt = (t, ...e) => {
164
+ if (!t) return "";
165
+ let r = i(t);
166
+ for (const n of e) {
167
+ if (!n) continue;
168
+ const s = n.replace(/^\/+|\/+$/g, "");
169
+ s && (r += `/${s}`);
170
+ }
171
+ return r;
172
+ }, p = (t) => {
173
+ try {
174
+ const e = new URL(t), r = {};
175
+ return e.searchParams.forEach((n, s) => {
176
+ r[s] = n;
177
+ }), r;
178
+ } catch {
179
+ return {};
180
+ }
181
+ }, T = (t, e) => {
182
+ try {
183
+ const r = new URL(t);
184
+ Object.entries(e).forEach(([s, o]) => {
185
+ r.searchParams.set(s, String(o));
186
+ });
187
+ let n = r.toString();
188
+ return n = n.replace(/\/\?/, "?"), n;
189
+ } catch {
190
+ return t;
191
+ }
192
+ }, B = (t) => {
193
+ if (!t) return "";
194
+ try {
195
+ const e = new URL(t);
196
+ return e.search = "", i(e.toString());
197
+ } catch {
198
+ const e = t.indexOf("?");
199
+ return e !== -1 ? t.substring(0, e) : t;
132
200
  }
133
- }, ut = (t, e, r) => e !== void 0 && r !== void 0 ? Math.min(Math.max(t, e), r) : e !== void 0 ? Math.max(t, e) : r !== void 0 ? Math.min(t, r) : t, it = (t) => {
201
+ }, pt = m, ft = I, gt = i, dt = i, yt = O, wt = $, bt = B, Ut = p, St = T, Mt = (t, e, r) => e !== void 0 && r !== void 0 ? Math.min(Math.max(t, e), r) : e !== void 0 ? Math.max(t, e) : r !== void 0 ? Math.min(t, r) : t, Pt = (t) => {
134
202
  if (t == null) return;
135
203
  const e = Number.parseFloat(t.toString());
136
204
  return Number.isNaN(e) ? void 0 : e;
137
- }, lt = (t, e = 2) => {
205
+ }, Et = (t, e = 2) => {
138
206
  const r = Math.pow(10, e);
139
207
  return Math.round((t + Number.EPSILON) * r) / r;
140
- }, mt = (t = {}) => t.constructor === Object && !Object.entries(t).length, ht = (t) => (e, r) => {
141
- const n = t.indexOf(Object.keys(e)[0] ?? ""), o = t.indexOf(Object.keys(r)[0] ?? "");
142
- return n === -1 && o === -1 ? 0 : n === -1 ? 1 : o === -1 ? -1 : n - o;
143
- }, pt = (t, e) => Object.keys(t).sort(e).reduce((r, n) => ({ ...r, [n]: t[n] }), {});
144
- function ft(t, e) {
208
+ }, Rt = (t = {}) => t.constructor === Object && !Object.entries(t).length, vt = (t) => (e, r) => {
209
+ const n = t.indexOf(Object.keys(e)[0] ?? ""), s = t.indexOf(Object.keys(r)[0] ?? "");
210
+ return n === -1 && s === -1 ? 0 : n === -1 ? 1 : s === -1 ? -1 : n - s;
211
+ }, Nt = (t, e) => Object.keys(t).sort(e).reduce((r, n) => ({ ...r, [n]: t[n] }), {}), Dt = (t, e) => {
145
212
  const r = {};
146
213
  for (const n of e)
147
214
  n in t && (r[n] = t[n]);
148
215
  return r;
149
- }
150
- const P = (t) => Object.fromEntries(new URL(t).searchParams), U = (t, e) => {
151
- const r = new URLSearchParams(t);
152
- for (const [n, o] of Object.entries(e))
153
- o ? r.set(n, o) : r.delete(n);
154
- return r.toString();
155
- }, gt = (t, e) => {
156
- if (!t.startsWith("http")) return t;
157
- const r = new URL(t), n = U(r.search, e);
158
- return r.search = n, r.toString();
159
- }, R = (t) => Math.max(t && !Number.isNaN(Number(t)) ? Number.parseInt(t || "1", 10) : 1, 1), dt = (t, e) => {
160
- const { page: r, ...n } = P(t), s = (R(r) - 1) * e;
161
- return { take: e, skip: s, ...n };
162
- }, bt = (t, e, r) => (t.set("page", r.toString()), `${e}?${t.toString()}`), yt = (t) => {
216
+ }, C = (t) => Math.max(t && !Number.isNaN(Number(t)) ? Number.parseInt(t || "1", 10) : 1, 1), It = (t, e) => {
217
+ const { page: r, ...n } = p(t), o = (C(r) - 1) * e;
218
+ return { take: e, skip: o, ...n };
219
+ }, Ot = (t, e, r) => (t.set("page", r.toString()), `${e}?${t.toString()}`), $t = (t) => {
163
220
  try {
164
221
  return JSON.parse(t);
165
222
  } catch {
166
223
  return t;
167
224
  }
168
- }, wt = (t) => typeof t == "object" ? JSON.stringify(t) : t, St = () => Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), Mt = (t = 16) => {
225
+ }, Lt = (t) => typeof t == "object" ? JSON.stringify(t) : t, Tt = () => Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0"), Bt = (t = 16) => {
169
226
  const e = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
170
227
  return Array.from({ length: t }, () => e[Math.floor(Math.random() * e.length)]).join("");
171
- }, Et = (t, e) => Math.floor(Math.random() * (e - t + 1)) + t, Nt = (t) => Array.from({ length: t }, () => Math.floor(Math.random() * 10)).join(""), Pt = (t) => {
228
+ }, Ct = (t, e) => Math.floor(Math.random() * (e - t + 1)) + t, xt = (t) => Array.from({ length: t }, () => Math.floor(Math.random() * 10)).join(""), Ft = (t) => {
172
229
  const e = Math.floor(Math.random() * t.length);
173
230
  return t[e];
174
- }, Ut = (t) => {
231
+ }, jt = (t) => {
175
232
  const e = Object.keys(t), r = e[Math.floor(e.length * Math.random())];
176
233
  return t[r];
177
- }, Rt = (t) => typeof t != "string" ? "" : t.length === 0 ? t : t[0]?.toUpperCase() + t.slice(1), vt = (t) => typeof t != "string" ? "" : t.length === 0 ? t : t[0]?.toLowerCase() + t.slice(1), m = (t, e) => new Intl.DateTimeFormat(t, { dateStyle: e }), v = (t, e) => new Intl.DateTimeFormat(t, { timeStyle: e }), O = (t, e, r) => new Intl.DateTimeFormat(t, { dateStyle: e, timeStyle: r }), D = (t, e = "medium", r = "en-US") => m(r, e).format(new Date(t)), I = (t, e = "short", r = "en-US") => v(r, e).format(new Date(t)), $ = (t, e = "medium", r = "short", n = "en-US") => O(n, e, r).format(new Date(t)), Ot = (t, e, r = "medium", n = "short", o = "en-US") => {
234
+ }, kt = (t) => typeof t != "string" ? "" : t.length === 0 ? t : t[0]?.toUpperCase() + t.slice(1), Wt = (t) => typeof t != "string" ? "" : t.length === 0 ? t : t[0]?.toLowerCase() + t.slice(1), f = (t, e) => new Intl.DateTimeFormat(t, { dateStyle: e }), x = (t, e) => new Intl.DateTimeFormat(t, { timeStyle: e }), F = (t, e, r) => new Intl.DateTimeFormat(t, { dateStyle: e, timeStyle: r }), j = (t, e = "medium", r = "en-US") => f(r, e).format(new Date(t)), k = (t, e = "short", r = "en-US") => x(r, e).format(new Date(t)), W = (t, e = "medium", r = "short", n = "en-US") => F(n, e, r).format(new Date(t)), At = (t, e, r = "medium", n = "short", s = "en-US") => {
178
235
  switch (e) {
179
236
  case "date":
180
- return D(t, r, o);
237
+ return j(t, r, s);
181
238
  case "time":
182
- return I(t, n, o);
239
+ return k(t, n, s);
183
240
  default:
184
- return $(t, r, n, o);
241
+ return W(t, r, n, s);
185
242
  }
186
- }, Dt = (t, e, r = "medium", n = "en-US") => m(n, r).formatRange(new Date(t), new Date(e)), It = (t, e = 265) => t ? Math.ceil(t.trim().split(/\s+/).length / e) : 0;
243
+ }, zt = (t, e, r = "medium", n = "en-US") => f(n, r).formatRange(new Date(t), new Date(e)), Ht = (t, e = 265) => t ? Math.ceil(t.trim().split(/\s+/).length / e) : 0;
187
244
  export {
188
- rt as addHttp,
189
- gt as addSearchParams,
190
- d as convertNewlines,
191
- tt as formatBytes,
192
- X as formatCurrency,
193
- D as formatDate,
194
- Ot as formatDateOrTime,
195
- Dt as formatDateRange,
196
- $ as formatDateTime,
197
- _ as formatIntervalAmount,
198
- et as formatMimeType,
199
- Q as formatNumber,
200
- I as formatTime,
201
- l as formatToDecimals,
202
- R as getCurrentPage,
203
- z as getElementPosition,
204
- K as getErrorMessage,
205
- B as getExcerpt,
206
- x as getInitials,
207
- bt as getPageLink,
208
- dt as getPageParams,
209
- St as getRandomColor,
210
- Nt as getRandomDigits,
211
- Pt as getRandomElement,
212
- Et as getRandomNumber,
213
- Ut as getRandomProperty,
214
- Mt as getRandomString,
215
- It as getReadTime,
216
- P as getSearchParams,
217
- C as getShortcutLabel,
218
- at as getUrlHostname,
219
- F as isCuid,
220
- mt as isEmptyObject,
221
- M as isErrorWithMessage,
222
- st as isExternalUrl,
223
- V as isLightColor,
224
- b as isTruthy,
225
- N as isValidUrl,
226
- H as joinAsSentence,
227
- ut as keepNumberInRange,
228
- vt as lcFirst,
229
- yt as maybeParseJson,
230
- wt as maybeStringifyJson,
231
- it as parseNumericValue,
232
- ft as pickFromObject,
233
- lt as preciseRound,
234
- w as processBatch,
235
- J as processBatchWithErrorHandling,
236
- Z as publish,
237
- q as publishEscape,
238
- j as range,
239
- nt as removeHttp,
240
- ot as removeTrailingSlash,
241
- A as setInputValue,
242
- f as sleep,
243
- L as slugify,
244
- pt as sortObject,
245
- ht as sortObjectKeys,
246
- y as splitArrayIntoChunks,
247
- g as stripHtml,
248
- ct as stripURLSubpath,
249
- Y as subscribe,
250
- k as toBase64,
251
- E as toErrorWithMessage,
252
- W as tryCatch,
253
- Rt as ucFirst,
254
- G as unsubscribe
245
+ pt as addHttp,
246
+ m as addProtocol,
247
+ St as addSearchParams,
248
+ b as convertNewlines,
249
+ ut as formatBytes,
250
+ at as formatCurrency,
251
+ j as formatDate,
252
+ At as formatDateOrTime,
253
+ zt as formatDateRange,
254
+ W as formatDateTime,
255
+ it as formatIntervalAmount,
256
+ lt as formatMimeType,
257
+ ct as formatNumber,
258
+ k as formatTime,
259
+ h as formatToDecimals,
260
+ O as getBaseUrl,
261
+ C as getCurrentPage,
262
+ $ as getDomain,
263
+ tt as getElementPosition,
264
+ et as getErrorMessage,
265
+ J as getExcerpt,
266
+ Z as getInitials,
267
+ Ot as getPageLink,
268
+ It as getPageParams,
269
+ p as getQueryParams,
270
+ Tt as getRandomColor,
271
+ xt as getRandomDigits,
272
+ Ft as getRandomElement,
273
+ Ct as getRandomNumber,
274
+ jt as getRandomProperty,
275
+ Bt as getRandomString,
276
+ Ht as getReadTime,
277
+ Ut as getSearchParams,
278
+ H as getShortcutLabel,
279
+ wt as getUrlHostname,
280
+ K as isCuid,
281
+ Rt as isEmptyObject,
282
+ R as isErrorWithMessage,
283
+ ht as isExternalUrl,
284
+ X as isLightColor,
285
+ L as isLocalhostUrl,
286
+ U as isTruthy,
287
+ D as isValidUrl,
288
+ G as joinAsSentence,
289
+ mt as joinUrlPaths,
290
+ Mt as keepNumberInRange,
291
+ Wt as lcFirst,
292
+ $t as maybeParseJson,
293
+ Lt as maybeStringifyJson,
294
+ i as normalizeUrl,
295
+ M as nullsToUndefined,
296
+ Pt as parseNumericValue,
297
+ Dt as pickFromObject,
298
+ Et as preciseRound,
299
+ P as processBatch,
300
+ q as processBatchWithErrorHandling,
301
+ st as publish,
302
+ ot as publishEscape,
303
+ z as range,
304
+ ft as removeHttp,
305
+ I as removeProtocol,
306
+ B as removeQueryParams,
307
+ bt as removeSearchParams,
308
+ gt as removeTrailingSlash,
309
+ _ as setInputValue,
310
+ T as setQueryParams,
311
+ y as sleep,
312
+ V as slugify,
313
+ Nt as sortObject,
314
+ vt as sortObjectKeys,
315
+ S as splitArrayIntoChunks,
316
+ w as stripHtml,
317
+ dt as stripTrailingSlash,
318
+ yt as stripURLSubpath,
319
+ rt as subscribe,
320
+ Q as toBase64,
321
+ v as toErrorWithMessage,
322
+ Y as tryCatch,
323
+ kt as ucFirst,
324
+ nt as unsubscribe
255
325
  };
256
326
  //# sourceMappingURL=index.js.map