@tolki/str 1.2.1 → 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/str.js CHANGED
@@ -1,147 +1,147 @@
1
- import { isArray as S, toLower as U, isString as z, isFunction as K, isNumber as j } from "@tolki/utils";
2
- import { title as I, upper as T } from "./convertcase/index.js";
3
- import { randomInt as O, randomString as D } from "./random/index.js";
4
- import { substr as x } from "./replacer/index.js";
5
- import { ltrim as q, rtrim as G, trim as Q } from "./trimmer/index.js";
6
- import { createUlidsNormally as V } from "./ulid/index.js";
7
- import { createUuidsNormally as X } from "./uuid/index.js";
8
- const R = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
9
- let E = null;
10
- function B(t, e) {
11
- if (e === "")
1
+ import { isArray as x, toLower as M, isString as S, isFunction as Q, isNumber as X, isNull as Y, isUndefined as v } from "@tolki/utils";
2
+ import { title as T, upper as H } from "./convertcase/index.js";
3
+ import { randomInt as U, randomString as tt } from "./random/index.js";
4
+ import { substr as $ } from "./replacer/index.js";
5
+ import { ltrim as j, rtrim as G, trim as nt } from "./trimmer/index.js";
6
+ import { createUlidsNormally as et } from "./ulid/index.js";
7
+ import { createUuidsNormally as rt } from "./uuid/index.js";
8
+ const F = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
9
+ let R = null;
10
+ function J(t, n) {
11
+ if (n === "")
12
12
  return t;
13
- const n = String(e), r = t.indexOf(n);
14
- return r === -1 ? t : t.slice(r + n.length);
13
+ const e = String(n), r = t.indexOf(e);
14
+ return r === -1 ? t : t.slice(r + e.length);
15
15
  }
16
- function wt(t, e) {
17
- if (e === "")
16
+ function Et(t, n) {
17
+ if (n === "")
18
18
  return t;
19
- const n = t.lastIndexOf(String(e));
20
- return n === -1 ? t : t.slice(n + String(e).length);
19
+ const e = t.lastIndexOf(String(n));
20
+ return e === -1 ? t : t.slice(e + String(n).length);
21
21
  }
22
- function Y(t, e) {
23
- if (e === "")
22
+ function st(t, n) {
23
+ if (n === "")
24
24
  return t;
25
- const n = t.indexOf(String(e));
26
- return n === -1 ? t : t.slice(0, n);
25
+ const e = t.indexOf(String(n));
26
+ return e === -1 ? t : t.slice(0, e);
27
27
  }
28
- function v(t, e) {
29
- if (e === "")
28
+ function ot(t, n) {
29
+ if (n === "")
30
30
  return t;
31
- const n = t.lastIndexOf(String(e));
32
- return n === -1 ? t : x(t, 0, n);
31
+ const e = t.lastIndexOf(String(n));
32
+ return e === -1 ? t : $(t, 0, e);
33
33
  }
34
- function St(t, e, n) {
35
- return e === "" || n === "" ? t : v(B(t, e), n);
34
+ function Ct(t, n, e) {
35
+ return n === "" || e === "" ? t : ot(J(t, n), e);
36
36
  }
37
- function xt(t, e, n) {
38
- return e === "" || n === "" ? t : Y(B(t, e), n);
37
+ function Rt(t, n, e) {
38
+ return n === "" || e === "" ? t : st(J(t, n), e);
39
39
  }
40
- function $t(t) {
41
- if (C.has(t))
42
- return C.get(t);
43
- const e = ct(Z(t));
44
- return C.set(t, e), e;
40
+ function Ft(t) {
41
+ if (N.has(t))
42
+ return N.get(t);
43
+ const n = gt(D(t));
44
+ return N.set(t, n), n;
45
45
  }
46
- function At(t, e) {
47
- const n = t.length;
48
- return (e < 0 ? e < -n : e > n - 1) ? !1 : (e < 0 && (e += n), t.charAt(e));
46
+ function Nt(t, n) {
47
+ const e = t.length;
48
+ return (n < 0 ? n < -e : n > e - 1) ? !1 : (n < 0 && (n += e), t.charAt(n));
49
49
  }
50
- function kt(t, e) {
51
- for (const n of S(e) ? e : [e])
52
- if (n !== "" && t.startsWith(n)) {
53
- const r = [...t], s = [...n];
50
+ function _t(t, n) {
51
+ for (const e of x(n) ? n : [n])
52
+ if (e !== "" && t.startsWith(e)) {
53
+ const r = [...t], s = [...e];
54
54
  return r.slice(s.length).join("");
55
55
  }
56
56
  return t;
57
57
  }
58
- function bt(t, e) {
59
- for (const n of S(e) ? e : [e])
60
- if (n !== "" && t.endsWith(n)) {
61
- const r = [...t], s = [...n];
58
+ function zt(t, n) {
59
+ for (const e of x(n) ? n : [n])
60
+ if (e !== "" && t.endsWith(e)) {
61
+ const r = [...t], s = [...e];
62
62
  return r.slice(0, -s.length).join("");
63
63
  }
64
64
  return t;
65
65
  }
66
- function H(t, e, n = !1) {
67
- n && (t = t.toLowerCase());
66
+ function Z(t, n, e = !1) {
67
+ e && (t = t.toLowerCase());
68
68
  let r;
69
- typeof e == "string" ? r = [e] : r = Array.from(e);
69
+ typeof n == "string" ? r = [n] : r = Array.from(n);
70
70
  for (let s of r)
71
- if (n && (s = s.toLowerCase()), s !== "" && t.includes(s))
71
+ if (e && (s = s.toLowerCase()), s !== "" && t.includes(s))
72
72
  return !0;
73
73
  return !1;
74
74
  }
75
- function Lt(t, e = "", n = {}) {
76
- const { radius: r = 100, omission: s = "..." } = n, o = String(t ?? ""), c = e ?? "", i = ($) => $.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(o);
75
+ function Wt(t, n = "", e = {}) {
76
+ const { radius: r = 100, omission: s = "..." } = e, o = String(t ?? ""), i = n ?? "", c = (k) => k.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${c(i)})(.*)$`, "iu").exec(o);
77
77
  if (!l)
78
78
  return null;
79
- const u = String(l[1]), a = String(l[2]), g = String(l[3]), p = q(u), m = Array.from(p).length, y = x(p, Math.max(m - r, 0), r);
80
- let w = q(y);
79
+ const m = String(l[1]), a = String(l[2]), g = String(l[3]), p = j(m), u = Array.from(p).length, y = $(p, Math.max(u - r, 0), r);
80
+ let w = j(y);
81
81
  w !== p && (w = s + w);
82
- const h = G(g), d = x(h, 0, r);
82
+ const h = G(g), d = $(h, 0, r);
83
83
  let A = G(d);
84
84
  return A !== h && (A = A + s), w + a + A;
85
85
  }
86
- function Et(t, e, n = !1) {
86
+ function Ot(t, n, e = !1) {
87
87
  let r = !1;
88
- for (const s of e)
89
- if (r = !0, !H(t, s, n))
88
+ for (const s of n)
89
+ if (r = !0, !Z(t, s, e))
90
90
  return !1;
91
91
  return r;
92
92
  }
93
- function Rt(t, e, n = !1) {
94
- return !H(t, e, n);
93
+ function Ut(t, n, e = !1) {
94
+ return !Z(t, n, e);
95
95
  }
96
- function Ct(t, e = " ") {
97
- return S(e) ? (e.forEach((n) => {
98
- t = t.replace(new RegExp(`${n}+`, "g"), n);
99
- }), t) : t.replace(new RegExp(`${e}+`, "g"), e);
96
+ function Mt(t, n = " ") {
97
+ return x(n) ? (n.forEach((e) => {
98
+ t = t.replace(new RegExp(`${e}+`, "g"), e);
99
+ }), t) : t.replace(new RegExp(`${n}+`, "g"), n);
100
100
  }
101
- function W(t, e) {
101
+ function I(t, n) {
102
102
  if (t === null)
103
103
  return !1;
104
- t = String(t), S(e) ? e = Array.from(e) : e = [String(e)];
105
- for (const n of e)
106
- if (n !== "" && t.endsWith(n))
104
+ t = String(t), x(n) ? n = Array.from(n) : n = [String(n)];
105
+ for (const e of n)
106
+ if (e !== "" && t.endsWith(e))
107
107
  return !0;
108
108
  return !1;
109
109
  }
110
- function Ft(t, e) {
111
- return !W(t, e);
110
+ function It(t, n) {
111
+ return !I(t, n);
112
112
  }
113
- function _t(t, e) {
114
- const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
115
- return t.replace(new RegExp(`(?:${n})+$`, "u"), "") + e;
113
+ function Pt(t, n) {
114
+ const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
115
+ return t.replace(new RegExp(`(?:${e})+$`, "u"), "") + n;
116
116
  }
117
- function Nt(t, e, n = null) {
118
- return e + t + (n ?? e);
117
+ function qt(t, n, e = null) {
118
+ return n + t + (e ?? n);
119
119
  }
120
- function zt(t, e, n = null) {
121
- return M(t, e) && (t = x(t, _(e))), W(t, n ??= e) && (t = x(t, 0, -_(n))), t;
120
+ function Tt(t, n, e = null) {
121
+ return P(t, n) && (t = $(t, z(n))), I(t, e ??= n) && (t = $(t, 0, -z(e))), t;
122
122
  }
123
- function Ot(t, e, n = !1) {
124
- e = String(e);
123
+ function jt(t, n, e = !1) {
124
+ n = String(n);
125
125
  let r;
126
126
  typeof t == "string" ? r = [t] : r = Array.from(t);
127
127
  for (let s of r) {
128
- if (s = String(s), s === e || n && U(s) === U(e))
128
+ if (s = String(s), s === n || e && M(s) === M(n))
129
129
  return !0;
130
130
  s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
131
- const o = n ? "iu" : "u";
132
- if (new RegExp(`^${s}$`, o).test(e))
131
+ const o = e ? "iu" : "u";
132
+ if (new RegExp(`^${s}$`, o).test(n))
133
133
  return !0;
134
134
  }
135
135
  return !1;
136
136
  }
137
- function Ut(t) {
138
- for (let e = 0; e < t.length; e++)
139
- if (t.charCodeAt(e) > 127)
137
+ function it(t) {
138
+ for (let n = 0; n < t.length; n++)
139
+ if (t.charCodeAt(n) > 127)
140
140
  return !1;
141
141
  return !0;
142
142
  }
143
- function Wt(t) {
144
- if (!z(t))
143
+ function Gt(t) {
144
+ if (!S(t))
145
145
  return !1;
146
146
  try {
147
147
  JSON.parse(t);
@@ -150,13 +150,13 @@ function Wt(t) {
150
150
  }
151
151
  return !0;
152
152
  }
153
- function Mt(t, e = []) {
154
- if (!z(t))
153
+ function Bt(t, n = []) {
154
+ if (!S(t))
155
155
  return !1;
156
- const r = (e.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : e.join("|")).split("|").map((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
156
+ const r = (n.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : n.join("|")).split("|").map((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
157
157
  try {
158
- const o = new URL(t), c = o.protocol.replace(":", ""), i = o.hostname, l = t.slice(t.indexOf("://") + 3).startsWith("/"), u = i.length > 0 && !/^\.+$/.test(i) && !l, a = c === "file" && l;
159
- if (r.split("|").includes(c) && (u || a))
158
+ const o = new URL(t), i = o.protocol.replace(":", ""), c = o.hostname, l = t.slice(t.indexOf("://") + 3).startsWith("/"), m = c.length > 0 && !/^\.+$/.test(c) && !l, a = i === "file" && l;
159
+ if (r.split("|").includes(i) && (m || a))
160
160
  return !0;
161
161
  } catch {
162
162
  }
@@ -180,55 +180,55 @@ function Mt(t, e = []) {
180
180
  ].join("");
181
181
  return new RegExp(s, "iu").test(t);
182
182
  }
183
- function Pt(t) {
184
- return it(t, "-");
183
+ function Ht(t) {
184
+ return mt(t, "-");
185
185
  }
186
- function _(t) {
186
+ function z(t) {
187
187
  return t.length;
188
188
  }
189
- function It(t, e = 100, n = "...", r = !1) {
190
- if (t.length <= e)
189
+ function Jt(t, n = 100, e = "...", r = !1) {
190
+ if (t.length <= n)
191
191
  return t;
192
192
  if (!r)
193
- return t.slice(0, e).replace(/\s+$/, "") + n;
194
- t = ot(t).replace(/[\n\r]+/g, " ").trim();
195
- const s = t.slice(0, e).replace(/\s+$/, "");
196
- return t.substring(e, e + 1) === " " ? s + n : s.replace(/(.*)\s.*/, "$1") + n;
193
+ return t.slice(0, n).replace(/\s+$/, "") + e;
194
+ t = pt(t).replace(/[\n\r]+/g, " ").trim();
195
+ const s = t.slice(0, n).replace(/\s+$/, "");
196
+ return t.substring(n, n + 1) === " " ? s + e : s.replace(/(.*)\s.*/, "$1") + e;
197
197
  }
198
- function J(t) {
199
- return U(t);
198
+ function K(t) {
199
+ return M(t);
200
200
  }
201
- function qt(t, e = 100, n = "...") {
202
- if (e <= 0)
201
+ function Zt(t, n = 100, e = "...") {
202
+ if (n <= 0)
203
203
  return t;
204
- const r = e, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
205
- return !o || _(t) === _(o[0]) ? t : o[0].trimEnd() + n;
204
+ const r = n, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
205
+ return !o || z(t) === z(o[0]) ? t : o[0].trimEnd() + e;
206
206
  }
207
- function Gt(t, e, n, r = null) {
208
- if (e === "")
207
+ function Kt(t, n, e, r = null) {
208
+ if (n === "")
209
209
  return t;
210
210
  const s = t.length;
211
- let o = n;
212
- n < 0 && (o = n < -s ? 0 : s + n);
213
- const c = t.slice(
211
+ let o = e;
212
+ e < 0 && (o = e < -s ? 0 : s + e);
213
+ const i = t.slice(
214
214
  o,
215
215
  r !== null ? o + r : void 0
216
216
  );
217
- if (c === "")
217
+ if (i === "")
218
218
  return t;
219
- const i = t.slice(0, o), f = c.length, l = t.slice(o + f);
220
- return i + e.slice(0, 1).repeat(f) + l;
219
+ const c = t.slice(0, o), f = i.length, l = t.slice(o + f);
220
+ return c + n.slice(0, 1).repeat(f) + l;
221
221
  }
222
- function Tt(t, e) {
223
- let n = "u", r = t;
222
+ function Vt(t, n) {
223
+ let e = "u", r = t;
224
224
  if (t.length >= 2 && t[0] === "/") {
225
225
  let s = -1;
226
226
  for (let o = t.length - 1; o > 0; o--)
227
227
  if (t[o] === "/") {
228
- let c = 0;
229
- for (let i = o - 1; i >= 0 && t[i] === "\\"; i--)
230
- c++;
231
- if (c % 2 === 0) {
228
+ let i = 0;
229
+ for (let c = o - 1; c >= 0 && t[c] === "\\"; c--)
230
+ i++;
231
+ if (i % 2 === 0) {
232
232
  s = o;
233
233
  break;
234
234
  }
@@ -237,118 +237,118 @@ function Tt(t, e) {
237
237
  r = t.slice(1, s);
238
238
  const o = t.slice(s + 1);
239
239
  if (o)
240
- for (const c of o)
241
- /[imsuy]/.test(c) && !n.includes(c) && (n += c);
240
+ for (const i of o)
241
+ /[imsuy]/.test(i) && !e.includes(i) && (e += i);
242
242
  }
243
243
  }
244
244
  try {
245
- const o = new RegExp(r, n).exec(e);
245
+ const o = new RegExp(r, e).exec(n);
246
246
  return o ? o[1] !== void 0 ? o[1] : o[0] : "";
247
247
  } catch {
248
248
  return "";
249
249
  }
250
250
  }
251
- function Bt(t, e) {
252
- e = String(e);
253
- const n = typeof t == "string" ? [t] : Array.from(t);
254
- for (const r of n) {
251
+ function Dt(t, n) {
252
+ n = String(n);
253
+ const e = typeof t == "string" ? [t] : Array.from(t);
254
+ for (const r of e) {
255
255
  if (typeof r != "string" || r === "") continue;
256
256
  let s = "u", o = r;
257
257
  if (r.length >= 2 && r[0] === "/") {
258
- let c = -1;
259
- for (let i = r.length - 1; i > 0; i--)
260
- if (r[i] === "/") {
258
+ let i = -1;
259
+ for (let c = r.length - 1; c > 0; c--)
260
+ if (r[c] === "/") {
261
261
  let f = 0;
262
- for (let l = i - 1; l >= 0 && r[l] === "\\"; l--)
262
+ for (let l = c - 1; l >= 0 && r[l] === "\\"; l--)
263
263
  f++;
264
264
  if (f % 2 === 0) {
265
- c = i;
265
+ i = c;
266
266
  break;
267
267
  }
268
268
  }
269
- if (c > 0) {
270
- o = r.slice(1, c);
271
- const i = r.slice(c + 1);
272
- if (i)
273
- for (const f of i)
269
+ if (i > 0) {
270
+ o = r.slice(1, i);
271
+ const c = r.slice(i + 1);
272
+ if (c)
273
+ for (const f of c)
274
274
  /[imsuy]/.test(f) && !s.includes(f) && (s += f);
275
275
  }
276
276
  }
277
277
  try {
278
- if (new RegExp(o, s).test(e))
278
+ if (new RegExp(o, s).test(n))
279
279
  return !0;
280
280
  } catch {
281
281
  }
282
282
  }
283
283
  return !1;
284
284
  }
285
- function Ht(t, e) {
286
- let n = "u", r = t;
285
+ function Qt(t, n) {
286
+ let e = "u", r = t;
287
287
  if (t.length >= 2 && t[0] === "/") {
288
288
  let o = -1;
289
- for (let c = t.length - 1; c > 0; c--)
290
- if (t[c] === "/") {
291
- let i = 0;
292
- for (let f = c - 1; f >= 0 && t[f] === "\\"; f--)
293
- i++;
294
- if (i % 2 === 0) {
295
- o = c;
289
+ for (let i = t.length - 1; i > 0; i--)
290
+ if (t[i] === "/") {
291
+ let c = 0;
292
+ for (let f = i - 1; f >= 0 && t[f] === "\\"; f--)
293
+ c++;
294
+ if (c % 2 === 0) {
295
+ o = i;
296
296
  break;
297
297
  }
298
298
  }
299
299
  if (o > 0) {
300
300
  r = t.slice(1, o);
301
- const c = t.slice(o + 1);
302
- if (c)
303
- for (const i of c)
304
- /[gimsuy]/.test(i) && !n.includes(i) && (n += i);
301
+ const i = t.slice(o + 1);
302
+ if (i)
303
+ for (const c of i)
304
+ /[gimsuy]/.test(c) && !e.includes(c) && (e += c);
305
305
  }
306
306
  }
307
- n.includes("g") || (n += "g");
307
+ e.includes("g") || (e += "g");
308
308
  let s = [];
309
309
  try {
310
- const o = new RegExp(r, n);
311
- let c;
312
- for (; (c = o.exec(e)) !== null; )
313
- s.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && o.lastIndex++;
310
+ const o = new RegExp(r, e);
311
+ let i;
312
+ for (; (i = o.exec(n)) !== null; )
313
+ s.push(i[1] !== void 0 ? i[1] : i[0]), i[0] === "" && o.lastIndex++;
314
314
  } catch {
315
315
  s = [];
316
316
  }
317
317
  return s;
318
318
  }
319
- function Jt(t) {
320
- return S(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
319
+ function Xt(t) {
320
+ return x(t) ? t.map((n) => n.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
321
321
  }
322
- function Zt(t, e, n = " ") {
322
+ function Yt(t, n, e = " ") {
323
323
  const r = t.length;
324
- if (e <= r || n === "")
324
+ if (n <= r || e === "")
325
325
  return t;
326
- const s = e - r, o = Math.floor(s / 2), c = s - o;
327
- return N(n, o) + t + N(n, c);
326
+ const s = n - r, o = Math.floor(s / 2), i = s - o;
327
+ return W(e, o) + t + W(e, i);
328
328
  }
329
- function Kt(t, e, n = " ") {
329
+ function vt(t, n, e = " ") {
330
330
  const r = t.length;
331
- if (e <= r || n === "")
331
+ if (n <= r || e === "")
332
332
  return t;
333
- const o = e - r;
334
- return N(n, o) + t;
333
+ const o = n - r;
334
+ return W(e, o) + t;
335
335
  }
336
- function jt(t, e, n = " ") {
336
+ function tn(t, n, e = " ") {
337
337
  const r = t.length;
338
- if (e <= r || n === "")
338
+ if (n <= r || e === "")
339
339
  return t;
340
- const o = e - r;
341
- return t + N(n, o);
340
+ const o = n - r;
341
+ return t + W(e, o);
342
342
  }
343
- function N(t, e) {
344
- if (e <= 0 || t.length === 0)
343
+ function W(t, n) {
344
+ if (n <= 0 || t.length === 0)
345
345
  return "";
346
- const n = Math.ceil(e / t.length);
347
- return t.repeat(n).slice(0, e);
346
+ const e = Math.ceil(n / t.length);
347
+ return t.repeat(e).slice(0, n);
348
348
  }
349
- function Dt(t = 32, e = !0, n = !0, r = !0, s = !1) {
349
+ function nn(t = 32, n = !0, e = !0, r = !0, s = !1) {
350
350
  const l = [
351
- e ? [
351
+ n ? [
352
352
  "a",
353
353
  "b",
354
354
  "c",
@@ -402,7 +402,7 @@ function Dt(t = 32, e = !0, n = !0, r = !0, s = !1) {
402
402
  "Y",
403
403
  "Z"
404
404
  ] : null,
405
- n ? ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] : null,
405
+ e ? ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] : null,
406
406
  r ? [
407
407
  "~",
408
408
  "!",
@@ -432,143 +432,162 @@ function Dt(t = 32, e = !0, n = !0, r = !0, s = !1) {
432
432
  ";"
433
433
  ] : null,
434
434
  s ? [" "] : null
435
- ].filter((p) => S(p));
435
+ ].filter((p) => x(p));
436
436
  if (l.length === 0 || t <= 0)
437
437
  return "";
438
- const u = [];
438
+ const m = [];
439
439
  for (const p of l) {
440
- const m = O(0, p.length - 1);
441
- u.push(p[m]);
440
+ const u = U(0, p.length - 1);
441
+ m.push(p[u]);
442
442
  }
443
- const a = Math.max(0, t - u.length), g = l.flat();
443
+ const a = Math.max(0, t - m.length), g = l.flat();
444
444
  for (let p = 0; p < a; p++) {
445
- const m = O(0, g.length - 1);
446
- u.push(g[m]);
445
+ const u = U(0, g.length - 1);
446
+ m.push(g[u]);
447
447
  }
448
- for (let p = u.length - 1; p > 0; p--) {
449
- const m = O(0, p), y = u[p];
450
- u[p] = u[m], u[m] = y;
448
+ for (let p = m.length - 1; p > 0; p--) {
449
+ const u = U(0, p), y = m[p];
450
+ m[p] = m[u], m[u] = y;
451
451
  }
452
- return u.join("");
452
+ return m.join("");
453
453
  }
454
- function Qt(t, e, n = 0) {
455
- if (e === "")
454
+ function en(t, n, e = 0) {
455
+ if (n === "")
456
456
  return !1;
457
- const r = Array.from(t), s = Array.from(e);
458
- let o = n >= 0 ? n : r.length + n;
457
+ const r = Array.from(t), s = Array.from(n);
458
+ let o = e >= 0 ? e : r.length + e;
459
459
  if (o < 0 && (o = 0), o >= r.length)
460
460
  return !1;
461
- const c = r.length - s.length;
462
- for (let i = o; i <= c; i++) {
461
+ const i = r.length - s.length;
462
+ for (let c = o; c <= i; c++) {
463
463
  let f = !0;
464
464
  for (let l = 0; l < s.length; l++)
465
- if (r[i + l] !== s[l]) {
465
+ if (r[c + l] !== s[l]) {
466
466
  f = !1;
467
467
  break;
468
468
  }
469
469
  if (f)
470
- return i;
470
+ return c;
471
471
  }
472
472
  return !1;
473
473
  }
474
- function tt(t = 16) {
475
- return (E ?? ((n) => D(n)))(t);
476
- }
477
- function et(t) {
478
- E = t;
474
+ function ct(t = 16) {
475
+ return (R ?? ((e) => tt(e)))(t);
479
476
  }
480
- function Vt(t, e) {
481
- let n = 0;
482
- const r = e ?? function(s) {
483
- const o = E;
484
- E = null;
485
- const c = tt(s);
486
- return E = o, n++, c;
477
+ function lt(t) {
478
+ R = t;
479
+ }
480
+ function rn(t, n) {
481
+ let e = 0;
482
+ const r = n ?? function(s) {
483
+ const o = R;
484
+ R = null;
485
+ const i = ct(s);
486
+ return R = o, e++, i;
487
487
  };
488
- et((s) => n < t.length ? String(t[n++]) : r(s));
488
+ lt((s) => e < t.length ? String(t[e++]) : r(s));
489
489
  }
490
- function nt() {
491
- E = null;
490
+ function ft() {
491
+ R = null;
492
492
  }
493
- function Xt(t, e) {
494
- return e <= 0 ? "" : t.repeat(e);
493
+ function sn(t, n) {
494
+ return n <= 0 ? "" : t.repeat(n);
495
495
  }
496
- function Yt(t, e, n) {
496
+ function on(t, n, e) {
497
497
  let r;
498
- typeof e == "object" && !S(e) ? r = Object.values(e) : r = S(e) ? [...e] : Array.from(e);
499
- const s = n.split(t);
498
+ typeof n == "object" && !x(n) ? r = Object.values(n) : r = x(n) ? [...n] : Array.from(n);
499
+ const s = e.split(t);
500
500
  if (s.length === 1)
501
- return n;
501
+ return e;
502
502
  let o = s[0];
503
- for (let c = 1; c < s.length; c++) {
504
- const i = r.length ? r.shift() : t;
505
- o += i + s[c];
503
+ for (let i = 1; i < s.length; i++) {
504
+ const c = r.length ? r.shift() : t;
505
+ o += c + s[i];
506
506
  }
507
507
  return String(o);
508
508
  }
509
- function vt(t, e) {
509
+ function cn(t, n) {
510
510
  try {
511
- const n = String(t);
512
- if (n.length)
513
- return n;
511
+ const e = String(t);
512
+ if (e.length)
513
+ return e;
514
514
  throw new Error("Failed to convert value to string");
515
515
  } catch {
516
- return e;
516
+ return n;
517
517
  }
518
518
  }
519
- function te(t, e, n, r = !0) {
520
- const s = (l) => typeof l == "string" ? [l] : Array.from(l), o = s(t), c = s(e), i = (l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = (l) => o.reduce((u, a, g) => {
521
- if (a === "") return u;
522
- const p = c[g] ?? "";
523
- if (!r)
524
- return u.split(a).join(p);
525
- const m = new RegExp(i(a), "gi");
526
- return u.replace(m, () => p);
527
- }, l);
528
- return z(n) ? f(n) : Array.from(n).map(f);
529
- }
530
- function rt(t, e, n) {
519
+ function ln(t, n, e, r = !0) {
520
+ if (S(t) && !S(n))
521
+ throw new TypeError(
522
+ "The replacement must be a string when the search term is a string."
523
+ );
524
+ const s = S(e) ? e : Array.from(e, (f) => L(f));
525
+ if (!r)
526
+ return V(
527
+ t,
528
+ n,
529
+ s
530
+ );
531
+ const o = S(t) ? [t] : Array.from(t, (f) => L(f)), i = S(n) ? o.map(() => n) : Array.from(n, (f) => L(f)), c = (f) => o.reduce((l, m, a) => m === "" ? l : l.split(m).join(i[a] ?? ""), f);
532
+ return S(s) ? c(s) : s.map(c);
533
+ }
534
+ function V(t, n, e) {
535
+ const r = S(t) ? [t] : Array.from(t, (c) => L(c)), s = S(n) ? r.map(() => n) : Array.from(n, (c) => L(c)), o = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), i = (c) => r.reduce((f, l, m) => {
536
+ if (l === "")
537
+ return f;
538
+ const a = s[m] ?? "", g = new RegExp(
539
+ o(l),
540
+ it(l) ? "gi" : "giu"
541
+ );
542
+ return f.replace(g, () => a);
543
+ }, c);
544
+ return S(e) ? i(e) : e.map(i);
545
+ }
546
+ function L(t) {
547
+ return Y(t) || v(t) ? "" : String(t);
548
+ }
549
+ function at(t, n, e) {
531
550
  if (t = String(t), t === "")
532
- return n;
533
- const r = n.indexOf(t);
534
- return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
551
+ return e;
552
+ const r = e.indexOf(t);
553
+ return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
535
554
  }
536
- function ee(t, e, n) {
537
- return t = String(t), t === "" ? n : M(n, t) ? rt(t, e, n) : n;
555
+ function fn(t, n, e) {
556
+ return t = String(t), t === "" ? e : P(e, t) ? at(t, n, e) : e;
538
557
  }
539
- function st(t, e, n) {
558
+ function ut(t, n, e) {
540
559
  if (t = String(t), t === "")
541
- return n;
542
- const r = n.lastIndexOf(t);
543
- return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
560
+ return e;
561
+ const r = e.lastIndexOf(t);
562
+ return r !== -1 ? e.slice(0, r) + n + e.slice(r + t.length) : e;
544
563
  }
545
- function ne(t, e, n) {
546
- return t = String(t), t === "" ? n : W(n, t) ? st(t, e, n) : n;
564
+ function an(t, n, e) {
565
+ return t = String(t), t === "" ? e : I(e, t) ? ut(t, n, e) : e;
547
566
  }
548
- function re(t, e, n, r = -1) {
549
- const s = (a) => S(a) ? a : [a], o = s(t);
550
- function c(a) {
567
+ function un(t, n, e, r = -1) {
568
+ const s = (a) => x(a) ? a : [a], o = s(t);
569
+ function i(a) {
551
570
  try {
552
571
  if (a instanceof RegExp) {
553
- let m = a.flags;
554
- return m.includes("g") || (m += "g"), m.includes("u") || (m += "u"), new RegExp(a.source, m);
572
+ let u = a.flags;
573
+ return u.includes("g") || (u += "g"), u.includes("u") || (u += "u"), new RegExp(a.source, u);
555
574
  }
556
575
  let g = a, p = "gu";
557
576
  if (a.length >= 2 && a[0] === "/") {
558
- let m = -1;
577
+ let u = -1;
559
578
  for (let y = a.length - 1; y > 0; y--)
560
579
  if (a[y] === "/") {
561
580
  let w = 0;
562
581
  for (let h = y - 1; h >= 0 && a[h] === "\\"; h--)
563
582
  w++;
564
583
  if (w % 2 === 0) {
565
- m = y;
584
+ u = y;
566
585
  break;
567
586
  }
568
587
  }
569
- if (m > 1) {
570
- g = a.slice(1, m);
571
- const y = a.slice(m + 1);
588
+ if (u > 1) {
589
+ g = a.slice(1, u);
590
+ const y = a.slice(u + 1);
572
591
  if (y)
573
592
  for (const w of y)
574
593
  /[imsuy]/.test(w) && !p.includes(w) && (p += w);
@@ -582,50 +601,50 @@ function re(t, e, n, r = -1) {
582
601
  return null;
583
602
  }
584
603
  }
585
- const i = [];
604
+ const c = [];
586
605
  for (const a of o) {
587
- const g = c(a);
606
+ const g = i(a);
588
607
  if (!g) return null;
589
- i.push(g);
608
+ c.push(g);
590
609
  }
591
- const f = K(e), l = f ? [] : s(e), u = (a) => {
610
+ const f = Q(n), l = f ? [] : s(n), m = (a) => {
592
611
  let g = a;
593
- for (let p = 0; p < i.length; p++) {
594
- const m = i[p];
612
+ for (let p = 0; p < c.length; p++) {
613
+ const u = c[p];
595
614
  if (f) {
596
615
  let y = 0;
597
- const w = e;
616
+ const w = n;
598
617
  g = g.replace(
599
- m,
618
+ u,
600
619
  (h, ...d) => {
601
620
  if (r >= 0 && y >= r) return h;
602
621
  y++;
603
- const b = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, $ = [];
604
- for (let k = 0; k < b; k++)
605
- $.push(d[k]);
606
- const L = [h, ...$];
607
- return w(L);
622
+ const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = [];
623
+ for (let b = 0; b < E; b++)
624
+ k.push(d[b]);
625
+ const C = [h, ...k];
626
+ return w(C);
608
627
  }
609
628
  );
610
629
  } else {
611
630
  const y = l[p] ?? (l.length === 1 ? l[0] : "");
612
631
  if (r < 0)
613
- g = g.replace(m, (w, ...h) => {
614
- const A = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, b = h.slice(0, A).map(($) => String($));
615
- return y.replace(/\$(\d{1,2})/g, ($, L) => {
616
- const k = parseInt(L, 10);
617
- return (b[k - 1] ?? "").toUpperCase();
632
+ g = g.replace(u, (w, ...h) => {
633
+ const A = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, E = h.slice(0, A).map((k) => String(k));
634
+ return y.replace(/\$(\d{1,2})/g, (k, C) => {
635
+ const b = parseInt(C, 10);
636
+ return (E[b - 1] ?? "").toUpperCase();
618
637
  });
619
638
  });
620
639
  else {
621
640
  let w = 0;
622
- g = g.replace(m, (h, ...d) => {
641
+ g = g.replace(u, (h, ...d) => {
623
642
  if (w >= r) return h;
624
643
  w++;
625
- const b = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, $ = d.slice(0, b).map((L) => String(L));
626
- return y.replace(/\$(\d{1,2})/g, (L, k) => {
627
- const P = parseInt(k, 10);
628
- return ($[P - 1] ?? "").toUpperCase();
644
+ const E = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, k = d.slice(0, E).map((C) => String(C));
645
+ return y.replace(/\$(\d{1,2})/g, (C, b) => {
646
+ const q = parseInt(b, 10);
647
+ return (k[q - 1] ?? "").toUpperCase();
629
648
  });
630
649
  });
631
650
  }
@@ -633,53 +652,50 @@ function re(t, e, n, r = -1) {
633
652
  }
634
653
  return g;
635
654
  };
636
- return S(n) ? n.map(u) : u(n);
655
+ return x(e) ? e.map(m) : m(e);
637
656
  }
638
- function ot(t) {
639
- let e = "", n = !1;
657
+ function pt(t) {
658
+ let n = "", e = !1;
640
659
  for (let r = 0; r < t.length; r++) {
641
660
  const s = t[r];
642
- s === "<" ? n = !0 : s === ">" ? n = !1 : n || (e += s);
661
+ s === "<" ? e = !0 : s === ">" ? e = !1 : e || (n += s);
643
662
  }
644
- return e;
645
- }
646
- function se(t, e, n = !0) {
647
- const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => {
648
- let i = c;
649
- for (const f of r)
650
- if (f !== "")
651
- if (n)
652
- i = i.split(f).join("");
653
- else {
654
- const l = new RegExp(s(f), "gi");
655
- i = i.replace(l, "");
656
- }
657
- return i;
663
+ return n;
664
+ }
665
+ function pn(t, n, e = !0) {
666
+ const r = S(n) ? n : Array.from(n, (i) => L(i));
667
+ if (!e)
668
+ return V(t, "", r);
669
+ const s = S(t) ? [t] : Array.from(t, (i) => L(i)), o = (i) => {
670
+ let c = i;
671
+ for (const f of s)
672
+ f !== "" && (c = c.split(f).join(""));
673
+ return c;
658
674
  };
659
- return typeof e == "string" ? o(e) : Array.from(e, (c) => o(String(c)));
675
+ return S(r) ? o(r) : r.map(o);
660
676
  }
661
- function oe(t) {
677
+ function mn(t) {
662
678
  return Array.from(t).reverse().join("");
663
679
  }
664
- function ie(t, e) {
665
- const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
666
- return e + t.replace(new RegExp(`^(?:${n})+`, "u"), "");
680
+ function gn(t, n) {
681
+ const e = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
682
+ return n + t.replace(new RegExp(`^(?:${e})+`, "u"), "");
667
683
  }
668
- function ce(t) {
669
- const e = String(t).trim();
670
- if (e === "")
684
+ function hn(t) {
685
+ const n = String(t).trim();
686
+ if (n === "")
671
687
  return "";
672
- let n = e.split(/\s+/u);
673
- return n.length > 1 ? n = n.map((s) => I(s)) : n = lt(n.join("_")).map((s) => I(s)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
688
+ let e = n.split(/\s+/u);
689
+ return e.length > 1 ? e = e.map((s) => T(s)) : e = ht(e.join("_")).map((s) => T(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
674
690
  }
675
- function le(t, e = !1) {
691
+ function dn(t, n = !1) {
676
692
  const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
677
- return e ? T(r) : r;
693
+ return n ? H(r) : r;
678
694
  }
679
- function fe(t) {
695
+ function yn(t) {
680
696
  if (t.trim() === "")
681
697
  return t;
682
- const e = /* @__PURE__ */ new Set([
698
+ const n = /* @__PURE__ */ new Set([
683
699
  "and",
684
700
  "as",
685
701
  "but",
@@ -715,40 +731,40 @@ function fe(t) {
715
731
  "des",
716
732
  "par",
717
733
  "à"
718
- ]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
734
+ ]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
719
735
  if (!o) return o;
720
- const c = Array.from(o), i = c[0].toLocaleUpperCase(), f = c.slice(1).join("");
721
- return i + f;
736
+ const i = Array.from(o), c = i[0].toLocaleUpperCase(), f = i.slice(1).join("");
737
+ return c + f;
722
738
  };
723
739
  for (let o = 0; o < r.length; o++) {
724
- const c = r[o].toLocaleLowerCase();
725
- if (c.includes("-")) {
726
- const f = c.split("-").map((l) => e.has(l) && l.length <= 3 ? l : s(l));
740
+ const i = r[o].toLocaleLowerCase();
741
+ if (i.includes("-")) {
742
+ const f = i.split("-").map((l) => n.has(l) && l.length <= 3 ? l : s(l));
727
743
  r[o] = f.join("-");
728
744
  } else {
729
- const i = o > 0 ? r[o - 1] : "", f = i ? Array.from(i).slice(-1)[0] : void 0, l = o === 0 || f !== void 0 && n.has(f);
730
- e.has(c) && c.length <= 3 && !l ? r[o] = c : r[o] = s(c);
745
+ const c = o > 0 ? r[o - 1] : "", f = c ? Array.from(c).slice(-1)[0] : void 0, l = o === 0 || f !== void 0 && e.has(f);
746
+ n.has(i) && i.length <= 3 && !l ? r[o] = i : r[o] = s(i);
731
747
  }
732
748
  }
733
749
  return r.join(" ");
734
750
  }
735
- function it(t, e = "_") {
736
- const r = `${t}|${e}`;
737
- if (R.has(r))
738
- return R.get(r);
751
+ function mt(t, n = "_") {
752
+ const r = `${t}|${n}`;
753
+ if (F.has(r))
754
+ return F.get(r);
739
755
  let s = t;
740
- return /^[a-z]+$/.test(t) || (s = ft(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${e}`), s = J(s)), R.set(r, s), s;
756
+ return /^[a-z]+$/.test(t) || (s = dt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = K(s)), F.set(r, s), s;
741
757
  }
742
- function ae(t) {
743
- return Q(t).replace(/[\s\u3164\u1160]+/gu, " ");
758
+ function wn(t) {
759
+ return nt(t).replace(/[\s\u3164\u1160]+/gu, " ");
744
760
  }
745
- function M(t, e) {
746
- if (t == null || e == null)
761
+ function P(t, n) {
762
+ if (t == null || n == null)
747
763
  return !1;
748
- let n;
749
- z(e) || j(e) ? n = [e] : Symbol.iterator in Object(e) ? n = Array.from(e) : n = [e];
764
+ let e;
765
+ S(n) || X(n) ? e = [n] : Symbol.iterator in Object(n) ? e = Array.from(n) : e = [n];
750
766
  const r = String(t);
751
- for (const s of n) {
767
+ for (const s of e) {
752
768
  if (s == null)
753
769
  continue;
754
770
  const o = String(s);
@@ -757,201 +773,226 @@ function M(t, e) {
757
773
  }
758
774
  return !1;
759
775
  }
760
- function ue(t, e) {
761
- return !M(t, e);
776
+ function Sn(t, n) {
777
+ return !P(t, n);
762
778
  }
763
- function Z(t, e = !1) {
764
- let n = t;
765
- e && (n = t.replace(
779
+ function D(t, n = !1) {
780
+ let e = t;
781
+ n && (e = t.replace(
766
782
  /(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu,
767
- (f, l, u) => l + u.toLowerCase()
783
+ (f, l, m) => l + m.toLowerCase()
768
784
  ));
769
- const r = n;
770
- if (F.has(r))
771
- return F.get(r);
772
- const s = String(n).replace(/[-_]+/g, " "), o = s.trim() === "" ? [] : s.split(/\s+/u), c = (f) => {
785
+ const r = e;
786
+ if (_.has(r))
787
+ return _.get(r);
788
+ const s = String(e).replace(/[-_]+/g, " "), o = s.trim() === "" ? [] : s.split(/\s+/u), i = (f) => {
773
789
  if (!f) return f;
774
- const l = Array.from(f), u = l[0].toUpperCase(), a = l.slice(1).join("");
775
- return u + a;
776
- }, i = o.map(c).join("");
777
- return F.set(r, i), i;
790
+ const l = Array.from(f), m = l[0].toUpperCase(), a = l.slice(1).join("");
791
+ return m + a;
792
+ }, c = o.map(i).join("");
793
+ return _.set(r, c), c;
778
794
  }
779
- function pe(t, e = !1) {
780
- return Z(t, e);
795
+ function xn(t, n = !1) {
796
+ return D(t, n);
781
797
  }
782
- function ge(t, e) {
798
+ function $n(t, n) {
783
799
  if (!t || Object.keys(t).length === 0)
784
- return e;
785
- const n = Object.keys(t).filter((o) => o !== "");
786
- if (n.length === 0)
787
- return e;
788
- n.sort((o, c) => c.length - o.length);
789
- const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(n.map(r).join("|"), "gu");
790
- return e.replace(s, (o) => t[o]);
800
+ return n;
801
+ const e = Object.keys(t).filter((o) => o !== "");
802
+ if (e.length === 0)
803
+ return n;
804
+ e.sort((o, i) => i.length - o.length);
805
+ const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
806
+ return n.replace(s, (o) => t[o]);
791
807
  }
792
- function me(t, e) {
793
- return e < 0 ? x(t, e) : x(t, 0, e);
808
+ function kn(t, n) {
809
+ return n < 0 ? $(t, n) : $(t, 0, n);
794
810
  }
795
- function ct(t) {
796
- return J(x(t, 0, 1)) + x(t, 1);
811
+ function gt(t) {
812
+ return K($(t, 0, 1)) + $(t, 1);
797
813
  }
798
- function he(t) {
799
- return T(x(t, 0, 1)) + x(t, 1);
814
+ function An(t) {
815
+ return H($(t, 0, 1)) + $(t, 1);
800
816
  }
801
- function lt(t) {
817
+ function ht(t) {
802
818
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
803
819
  }
804
- function ft(t, e = ` \r
820
+ function dt(t, n = ` \r
805
821
  \f\v`) {
806
- const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = n.length ? r(n) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", c = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
807
- return t.replace(c, (i, f, l) => f + l.toUpperCase());
822
+ const e = x(n) ? n.join("") : n, r = (c) => c.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", i = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
823
+ return t.replace(i, (c, f, l) => f + l.toUpperCase());
808
824
  }
809
- function de(t, e = null) {
810
- const n = e && e.length > 0 ? e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? new RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, s = t.match(r);
825
+ function bn(t, n = null) {
826
+ const e = n && n.length > 0 ? n.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = e.length > 0 ? new RegExp(`[\\p{L}\\p{N}${e}]+`, "gu") : /[\p{L}\p{N}]+/gu, s = t.match(r);
811
827
  return s ? s.length : 0;
812
828
  }
813
- function ye(t, e = 75, n = `
829
+ function O(t) {
830
+ return t.trim() === "";
831
+ }
832
+ function B(t, n, e) {
833
+ let r = n;
834
+ for (; r < e && O(t[r]); )
835
+ r++;
836
+ return r;
837
+ }
838
+ function yt(t, n, e) {
839
+ let r = e;
840
+ for (; r > n && O(t[r - 1]); )
841
+ r--;
842
+ return r;
843
+ }
844
+ function Ln(t, n = 75, e = `
814
845
  `, r = !1) {
815
- if (t.length === 0 || e < 1 || n === "")
846
+ if (t.length === 0 || n < 1 || e === "")
816
847
  return t;
817
848
  const s = t.split(/\r\n|\n|\r/), o = [];
818
- for (const c of s) {
819
- let i = c;
820
- if (i.length === 0) {
849
+ for (const i of s) {
850
+ const c = [...i], f = c.length;
851
+ if (f === 0) {
821
852
  o.push("");
822
853
  continue;
823
854
  }
855
+ let l = 0;
824
856
  if (r) {
825
- for (; i.length > 0 && !(/^\s/u.test(i) && (i = i.replace(/^\s+/u, ""), i.length === 0)); ) {
826
- if (i.length <= e) {
827
- o.push(i);
857
+ for (; l < f && (l = B(c, l, f), l !== f); ) {
858
+ if (f - l <= n) {
859
+ o.push(c.slice(l, f).join(""));
828
860
  break;
829
861
  }
830
- let f = i.slice(0, e);
831
- f = f.replace(/\s+$/u, ""), o.push(f), i = i.slice(e).replace(/^\s+/u, "");
862
+ const m = yt(
863
+ c,
864
+ l,
865
+ l + n
866
+ );
867
+ o.push(c.slice(l, m).join("")), l += n;
832
868
  }
833
869
  continue;
834
870
  }
835
- for (; i.length > e; ) {
836
- const f = i.replace(/^\s+/u, "");
837
- if (f.length !== i.length && (i = f, i.length <= e))
871
+ for (; f - l > n; ) {
872
+ const m = B(c, l, f);
873
+ if (m !== l && (l = m, f - l <= n))
838
874
  break;
839
- const l = i.slice(0, e + 1);
840
- let u = -1;
841
- for (let g = l.length - 1; g >= 0; g--)
842
- if (/\s/u.test(l[g])) {
843
- u = g;
875
+ const a = Math.min(f, l + n + 1);
876
+ let g = -1;
877
+ for (let u = a - 1; u >= l; u--)
878
+ if (O(c[u])) {
879
+ g = u;
844
880
  break;
845
881
  }
846
- if (u > 0) {
847
- o.push(i.slice(0, u)), i = i.slice(u + 1);
882
+ if (g > l) {
883
+ o.push(c.slice(l, g).join("")), l = g + 1;
848
884
  continue;
849
885
  }
850
- const a = i.search(/\s/u);
851
- if (a >= 0) {
852
- o.push(i.slice(0, a)), i = i.slice(a + 1);
886
+ let p = -1;
887
+ for (let u = l; u < f; u++)
888
+ if (O(c[u])) {
889
+ p = u;
890
+ break;
891
+ }
892
+ if (p >= 0) {
893
+ o.push(c.slice(l, p).join("")), l = p + 1;
853
894
  continue;
854
895
  }
855
- o.push(i), i = "";
896
+ o.push(c.slice(l, f).join("")), l = f;
856
897
  break;
857
898
  }
858
- i.length > 0 && o.push(i);
899
+ f - l > 0 && o.push(c.slice(l, f).join(""));
859
900
  }
860
- return o.join(n);
901
+ return o.join(e);
861
902
  }
862
- function we() {
863
- return R.size;
903
+ function En() {
904
+ return F.size;
864
905
  }
865
- function Se() {
866
- return C.size;
906
+ function Cn() {
907
+ return N.size;
867
908
  }
868
- function xe() {
869
- return F.size;
909
+ function Rn() {
910
+ return _.size;
870
911
  }
871
- function $e() {
872
- R.clear(), C.clear(), F.clear();
912
+ function Fn() {
913
+ F.clear(), N.clear(), _.clear();
873
914
  }
874
- function Ae() {
875
- nt(), V(), X();
915
+ function Nn() {
916
+ ft(), et(), rt();
876
917
  }
877
918
  export {
878
- B as after,
879
- wt as afterLast,
880
- fe as apa,
881
- Y as before,
882
- v as beforeLast,
883
- St as between,
884
- xt as betweenFirst,
885
- $t as camel,
886
- Se as camelCacheSize,
887
- At as charAt,
888
- bt as chopEnd,
889
- kt as chopStart,
890
- H as contains,
891
- Et as containsAll,
892
- nt as createRandomStringsNormally,
893
- et as createRandomStringsUsing,
894
- Vt as createRandomStringsUsingSequence,
895
- Ct as deduplicate,
896
- Rt as doesntContain,
897
- Ft as doesntEndWith,
898
- ue as doesntStartWith,
899
- W as endsWith,
900
- Lt as excerpt,
901
- _t as finish,
902
- $e as flushCache,
903
- ce as headline,
904
- le as initials,
905
- Ot as is,
906
- Ut as isAscii,
907
- Wt as isJson,
908
- Bt as isMatch,
909
- Mt as isUrl,
910
- Pt as kebab,
911
- ct as lcfirst,
912
- _ as length,
913
- It as limit,
914
- J as lower,
915
- N as makePad,
916
- Gt as mask,
917
- Tt as match,
918
- Ht as matchAll,
919
- Jt as numbers,
920
- Zt as padBoth,
921
- Kt as padLeft,
922
- jt as padRight,
923
- pe as pascal,
924
- Dt as password,
925
- Qt as position,
926
- tt as random,
927
- se as remove,
928
- Xt as repeat,
929
- te as replace,
930
- Yt as replaceArray,
931
- ne as replaceEnd,
932
- rt as replaceFirst,
933
- st as replaceLast,
934
- re as replaceMatches,
935
- ee as replaceStart,
936
- Ae as resetFactoryState,
937
- oe as reverse,
938
- it as snake,
939
- we as snakeCacheSize,
940
- ae as squish,
941
- ie as start,
942
- M as startsWith,
943
- ot as stripTags,
944
- Z as studly,
945
- xe as studlyCacheSize,
946
- ge as swap,
947
- me as take,
948
- vt as toStringOr,
949
- he as ucfirst,
950
- lt as ucsplit,
951
- ft as ucwords,
952
- zt as unwrap,
953
- de as wordCount,
954
- ye as wordWrap,
955
- qt as words,
956
- Nt as wrap
919
+ J as after,
920
+ Et as afterLast,
921
+ yn as apa,
922
+ st as before,
923
+ ot as beforeLast,
924
+ Ct as between,
925
+ Rt as betweenFirst,
926
+ Ft as camel,
927
+ Cn as camelCacheSize,
928
+ Nt as charAt,
929
+ zt as chopEnd,
930
+ _t as chopStart,
931
+ Z as contains,
932
+ Ot as containsAll,
933
+ ft as createRandomStringsNormally,
934
+ lt as createRandomStringsUsing,
935
+ rn as createRandomStringsUsingSequence,
936
+ Mt as deduplicate,
937
+ Ut as doesntContain,
938
+ It as doesntEndWith,
939
+ Sn as doesntStartWith,
940
+ I as endsWith,
941
+ Wt as excerpt,
942
+ Pt as finish,
943
+ Fn as flushCache,
944
+ hn as headline,
945
+ dn as initials,
946
+ jt as is,
947
+ it as isAscii,
948
+ Gt as isJson,
949
+ Dt as isMatch,
950
+ Bt as isUrl,
951
+ Ht as kebab,
952
+ gt as lcfirst,
953
+ z as length,
954
+ Jt as limit,
955
+ K as lower,
956
+ W as makePad,
957
+ Kt as mask,
958
+ Vt as match,
959
+ Qt as matchAll,
960
+ Xt as numbers,
961
+ Yt as padBoth,
962
+ vt as padLeft,
963
+ tn as padRight,
964
+ xn as pascal,
965
+ nn as password,
966
+ en as position,
967
+ ct as random,
968
+ pn as remove,
969
+ sn as repeat,
970
+ ln as replace,
971
+ on as replaceArray,
972
+ an as replaceEnd,
973
+ at as replaceFirst,
974
+ ut as replaceLast,
975
+ un as replaceMatches,
976
+ fn as replaceStart,
977
+ Nn as resetFactoryState,
978
+ mn as reverse,
979
+ mt as snake,
980
+ En as snakeCacheSize,
981
+ wn as squish,
982
+ gn as start,
983
+ P as startsWith,
984
+ pt as stripTags,
985
+ D as studly,
986
+ Rn as studlyCacheSize,
987
+ $n as swap,
988
+ kn as take,
989
+ cn as toStringOr,
990
+ An as ucfirst,
991
+ ht as ucsplit,
992
+ dt as ucwords,
993
+ Tt as unwrap,
994
+ bn as wordCount,
995
+ Ln as wordWrap,
996
+ Zt as words,
997
+ qt as wrap
957
998
  };