@tolki/str 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ascii/index.js +24 -39
- package/dist/base64/index.js +90 -118
- package/dist/convertcase/index.js +29 -44
- package/dist/index.js +14 -141
- package/dist/markdown/index.js +29 -31
- package/dist/pluralizer/index.js +30 -93
- package/dist/random/index.js +30 -42
- package/dist/replacer/index.js +39 -60
- package/dist/str.js +692 -1006
- package/dist/stringable/index.js +462 -1329
- package/dist/transliterate/index.js +5 -6
- package/dist/trimmer/index.js +83 -88
- package/dist/ulid/index.js +42 -52
- package/dist/uuid/index.js +33 -43
- package/package.json +35 -22
package/dist/str.js
CHANGED
|
@@ -1,1006 +1,692 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
function
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
function
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
}
|
|
680
|
-
function
|
|
681
|
-
|
|
682
|
-
}
|
|
683
|
-
function
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
const n = String(t).trim();
|
|
694
|
-
if (n === "")
|
|
695
|
-
return "";
|
|
696
|
-
let e = n.split(/\s+/u);
|
|
697
|
-
return e.length > 1 ? e = e.map((s) => G(s)) : e = yt(e.join("_")).map((s) => G(s)), e.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
|
|
698
|
-
}
|
|
699
|
-
function wn(t, n = !1) {
|
|
700
|
-
const r = t.split(/\s+/u).filter((s) => s.length > 0).map((s) => [...s][0]).join("");
|
|
701
|
-
return n ? J(r) : r;
|
|
702
|
-
}
|
|
703
|
-
function Sn(t) {
|
|
704
|
-
if (t.trim() === "")
|
|
705
|
-
return t;
|
|
706
|
-
const n = /* @__PURE__ */ new Set([
|
|
707
|
-
"and",
|
|
708
|
-
"as",
|
|
709
|
-
"but",
|
|
710
|
-
"for",
|
|
711
|
-
"if",
|
|
712
|
-
"nor",
|
|
713
|
-
"or",
|
|
714
|
-
"so",
|
|
715
|
-
"yet",
|
|
716
|
-
"a",
|
|
717
|
-
"an",
|
|
718
|
-
"the",
|
|
719
|
-
"at",
|
|
720
|
-
"by",
|
|
721
|
-
"for",
|
|
722
|
-
"in",
|
|
723
|
-
"of",
|
|
724
|
-
"off",
|
|
725
|
-
"on",
|
|
726
|
-
"per",
|
|
727
|
-
"to",
|
|
728
|
-
"up",
|
|
729
|
-
"via",
|
|
730
|
-
"et",
|
|
731
|
-
"ou",
|
|
732
|
-
"un",
|
|
733
|
-
"une",
|
|
734
|
-
"la",
|
|
735
|
-
"le",
|
|
736
|
-
"les",
|
|
737
|
-
"de",
|
|
738
|
-
"du",
|
|
739
|
-
"des",
|
|
740
|
-
"par",
|
|
741
|
-
"à"
|
|
742
|
-
]), e = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (i) => {
|
|
743
|
-
if (!i) return i;
|
|
744
|
-
const o = Array.from(i), c = o[0].toLocaleUpperCase(), f = o.slice(1).join("");
|
|
745
|
-
return c + f;
|
|
746
|
-
};
|
|
747
|
-
for (let i = 0; i < r.length; i++) {
|
|
748
|
-
const o = r[i].toLocaleLowerCase();
|
|
749
|
-
if (o.includes("-")) {
|
|
750
|
-
const f = o.split("-").map((l) => n.has(l) && l.length <= 3 ? l : s(l));
|
|
751
|
-
r[i] = f.join("-");
|
|
752
|
-
} else {
|
|
753
|
-
const c = i > 0 ? r[i - 1] : "", f = c ? Array.from(c).slice(-1)[0] : void 0, l = i === 0 || f !== void 0 && e.has(f);
|
|
754
|
-
n.has(o) && o.length <= 3 && !l ? r[i] = o : r[i] = s(o);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
return r.join(" ");
|
|
758
|
-
}
|
|
759
|
-
function ht(t, n = "_") {
|
|
760
|
-
const r = `${t}|${n}`;
|
|
761
|
-
if (F.has(r))
|
|
762
|
-
return F.get(r);
|
|
763
|
-
let s = t;
|
|
764
|
-
return /^[a-z]+$/.test(t) || (s = wt(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${n}`), s = V(s)), F.set(r, s), s;
|
|
765
|
-
}
|
|
766
|
-
function xn(t) {
|
|
767
|
-
return rt(t).replace(/[\s\u3164\u1160]+/gu, " ");
|
|
768
|
-
}
|
|
769
|
-
function j(t, n) {
|
|
770
|
-
if (t == null || n == null)
|
|
771
|
-
return !1;
|
|
772
|
-
let e;
|
|
773
|
-
S(n) || v(n) ? e = [n] : Symbol.iterator in Object(n) ? e = Array.from(n) : e = [n];
|
|
774
|
-
const r = String(t);
|
|
775
|
-
for (const s of e) {
|
|
776
|
-
if (s == null)
|
|
777
|
-
continue;
|
|
778
|
-
const i = String(s);
|
|
779
|
-
if (i !== "" && r.startsWith(i))
|
|
780
|
-
return !0;
|
|
781
|
-
}
|
|
782
|
-
return !1;
|
|
783
|
-
}
|
|
784
|
-
function An(t, n) {
|
|
785
|
-
return !j(t, n);
|
|
786
|
-
}
|
|
787
|
-
function X(t, n = !1) {
|
|
788
|
-
let e = t;
|
|
789
|
-
n && (e = t.replace(
|
|
790
|
-
/(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu,
|
|
791
|
-
(f, l, m) => l + m.toLowerCase()
|
|
792
|
-
));
|
|
793
|
-
const r = e;
|
|
794
|
-
if (_.has(r))
|
|
795
|
-
return _.get(r);
|
|
796
|
-
const s = String(e).replace(/[-_]+/g, " "), i = s.trim() === "" ? [] : s.split(/\s+/u), o = (f) => {
|
|
797
|
-
if (!f) return f;
|
|
798
|
-
const l = Array.from(f), m = l[0].toUpperCase(), a = l.slice(1).join("");
|
|
799
|
-
return m + a;
|
|
800
|
-
}, c = i.map(o).join("");
|
|
801
|
-
return _.set(r, c), c;
|
|
802
|
-
}
|
|
803
|
-
function kn(t, n = !1) {
|
|
804
|
-
return X(t, n);
|
|
805
|
-
}
|
|
806
|
-
function $n(t, n) {
|
|
807
|
-
if (!t || Object.keys(t).length === 0)
|
|
808
|
-
return n;
|
|
809
|
-
const e = Object.keys(t).filter((i) => i !== "");
|
|
810
|
-
if (e.length === 0)
|
|
811
|
-
return n;
|
|
812
|
-
e.sort((i, o) => o.length - i.length);
|
|
813
|
-
const r = (i) => i.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(e.map(r).join("|"), "gu");
|
|
814
|
-
return n.replace(s, (i) => t[i]);
|
|
815
|
-
}
|
|
816
|
-
function bn(t, n) {
|
|
817
|
-
return n < 0 ? A(t, n) : A(t, 0, n);
|
|
818
|
-
}
|
|
819
|
-
function dt(t) {
|
|
820
|
-
return V(A(t, 0, 1)) + A(t, 1);
|
|
821
|
-
}
|
|
822
|
-
function Cn(t) {
|
|
823
|
-
return J(A(t, 0, 1)) + A(t, 1);
|
|
824
|
-
}
|
|
825
|
-
function yt(t) {
|
|
826
|
-
return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
|
|
827
|
-
}
|
|
828
|
-
function wt(t, n = ` \r
|
|
829
|
-
\f\v`) {
|
|
830
|
-
const e = x(n) ? n.join("") : n, r = (c) => c.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = e.length ? r(e) : "", i = s.length ? `(?:\\s|[${s}])` : "\\s", o = new RegExp(`(^|${i})(\\p{Ll})`, "gu");
|
|
831
|
-
return t.replace(o, (c, f, l) => f + l.toUpperCase());
|
|
832
|
-
}
|
|
833
|
-
function En(t, n = null) {
|
|
834
|
-
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);
|
|
835
|
-
return s ? s.length : 0;
|
|
836
|
-
}
|
|
837
|
-
function M(t) {
|
|
838
|
-
return t.trim() === "";
|
|
839
|
-
}
|
|
840
|
-
function H(t, n, e) {
|
|
841
|
-
let r = n;
|
|
842
|
-
for (; r < e && M(t[r]); )
|
|
843
|
-
r++;
|
|
844
|
-
return r;
|
|
845
|
-
}
|
|
846
|
-
function St(t, n, e) {
|
|
847
|
-
let r = e;
|
|
848
|
-
for (; r > n && M(t[r - 1]); )
|
|
849
|
-
r--;
|
|
850
|
-
return r;
|
|
851
|
-
}
|
|
852
|
-
function Ln(t, n = 75, e = `
|
|
853
|
-
`, r = !1) {
|
|
854
|
-
if (t.length === 0 || n < 1 || e === "")
|
|
855
|
-
return t;
|
|
856
|
-
const s = t.split(/\r\n|\n|\r/), i = [];
|
|
857
|
-
for (const o of s) {
|
|
858
|
-
const c = [...o], f = c.length;
|
|
859
|
-
if (f === 0) {
|
|
860
|
-
i.push("");
|
|
861
|
-
continue;
|
|
862
|
-
}
|
|
863
|
-
let l = 0;
|
|
864
|
-
if (r) {
|
|
865
|
-
for (; l < f && (l = H(c, l, f), l !== f); ) {
|
|
866
|
-
if (f - l <= n) {
|
|
867
|
-
i.push(c.slice(l, f).join(""));
|
|
868
|
-
break;
|
|
869
|
-
}
|
|
870
|
-
const m = St(
|
|
871
|
-
c,
|
|
872
|
-
l,
|
|
873
|
-
l + n
|
|
874
|
-
);
|
|
875
|
-
i.push(c.slice(l, m).join("")), l += n;
|
|
876
|
-
}
|
|
877
|
-
continue;
|
|
878
|
-
}
|
|
879
|
-
for (; f - l > n; ) {
|
|
880
|
-
const m = H(c, l, f);
|
|
881
|
-
if (m !== l && (l = m, f - l <= n))
|
|
882
|
-
break;
|
|
883
|
-
const a = Math.min(f, l + n + 1);
|
|
884
|
-
let p = -1;
|
|
885
|
-
for (let u = a - 1; u >= l; u--)
|
|
886
|
-
if (M(c[u])) {
|
|
887
|
-
p = u;
|
|
888
|
-
break;
|
|
889
|
-
}
|
|
890
|
-
if (p > l) {
|
|
891
|
-
i.push(c.slice(l, p).join("")), l = p + 1;
|
|
892
|
-
continue;
|
|
893
|
-
}
|
|
894
|
-
let g = -1;
|
|
895
|
-
for (let u = l; u < f; u++)
|
|
896
|
-
if (M(c[u])) {
|
|
897
|
-
g = u;
|
|
898
|
-
break;
|
|
899
|
-
}
|
|
900
|
-
if (g >= 0) {
|
|
901
|
-
i.push(c.slice(l, g).join("")), l = g + 1;
|
|
902
|
-
continue;
|
|
903
|
-
}
|
|
904
|
-
i.push(c.slice(l, f).join("")), l = f;
|
|
905
|
-
break;
|
|
906
|
-
}
|
|
907
|
-
f - l > 0 && i.push(c.slice(l, f).join(""));
|
|
908
|
-
}
|
|
909
|
-
return i.join(e);
|
|
910
|
-
}
|
|
911
|
-
function Rn() {
|
|
912
|
-
return F.size;
|
|
913
|
-
}
|
|
914
|
-
function Fn() {
|
|
915
|
-
return N.size;
|
|
916
|
-
}
|
|
917
|
-
function Nn() {
|
|
918
|
-
return _.size;
|
|
919
|
-
}
|
|
920
|
-
function _n() {
|
|
921
|
-
F.clear(), N.clear(), _.clear();
|
|
922
|
-
}
|
|
923
|
-
function zn() {
|
|
924
|
-
ut(), st(), it();
|
|
925
|
-
}
|
|
926
|
-
export {
|
|
927
|
-
Z as after,
|
|
928
|
-
Rt as afterLast,
|
|
929
|
-
Sn as apa,
|
|
930
|
-
ot as before,
|
|
931
|
-
ct as beforeLast,
|
|
932
|
-
Ft as between,
|
|
933
|
-
Nt as betweenFirst,
|
|
934
|
-
_t as camel,
|
|
935
|
-
Fn as camelCacheSize,
|
|
936
|
-
zt as charAt,
|
|
937
|
-
Ot as chopEnd,
|
|
938
|
-
Wt as chopStart,
|
|
939
|
-
K as contains,
|
|
940
|
-
Ut as containsAll,
|
|
941
|
-
ut as createRandomStringsNormally,
|
|
942
|
-
at as createRandomStringsUsing,
|
|
943
|
-
on as createRandomStringsUsingSequence,
|
|
944
|
-
Pt as deduplicate,
|
|
945
|
-
It as doesntContain,
|
|
946
|
-
jt as doesntEndWith,
|
|
947
|
-
An as doesntStartWith,
|
|
948
|
-
P as endsWith,
|
|
949
|
-
Mt as excerpt,
|
|
950
|
-
Tt as finish,
|
|
951
|
-
_n as flushCache,
|
|
952
|
-
yn as headline,
|
|
953
|
-
wn as initials,
|
|
954
|
-
Bt as is,
|
|
955
|
-
lt as isAscii,
|
|
956
|
-
Dt as isJson,
|
|
957
|
-
Xt as isMatch,
|
|
958
|
-
Ht as isUrl,
|
|
959
|
-
Jt as kebab,
|
|
960
|
-
dt as lcfirst,
|
|
961
|
-
W as length,
|
|
962
|
-
Zt as limit,
|
|
963
|
-
V as lower,
|
|
964
|
-
O as makePad,
|
|
965
|
-
Vt as mask,
|
|
966
|
-
Qt as match,
|
|
967
|
-
Yt as matchAll,
|
|
968
|
-
vt as numbers,
|
|
969
|
-
tn as padBoth,
|
|
970
|
-
nn as padLeft,
|
|
971
|
-
en as padRight,
|
|
972
|
-
kn as pascal,
|
|
973
|
-
rn as password,
|
|
974
|
-
sn as position,
|
|
975
|
-
ft as random,
|
|
976
|
-
gn as remove,
|
|
977
|
-
cn as repeat,
|
|
978
|
-
an as replace,
|
|
979
|
-
ln as replaceArray,
|
|
980
|
-
pn as replaceEnd,
|
|
981
|
-
pt as replaceFirst,
|
|
982
|
-
mt as replaceLast,
|
|
983
|
-
mn as replaceMatches,
|
|
984
|
-
un as replaceStart,
|
|
985
|
-
zn as resetFactoryState,
|
|
986
|
-
hn as reverse,
|
|
987
|
-
ht as snake,
|
|
988
|
-
Rn as snakeCacheSize,
|
|
989
|
-
xn as squish,
|
|
990
|
-
dn as start,
|
|
991
|
-
j as startsWith,
|
|
992
|
-
gt as stripTags,
|
|
993
|
-
X as studly,
|
|
994
|
-
Nn as studlyCacheSize,
|
|
995
|
-
$n as swap,
|
|
996
|
-
bn as take,
|
|
997
|
-
fn as toStringOr,
|
|
998
|
-
Cn as ucfirst,
|
|
999
|
-
yt as ucsplit,
|
|
1000
|
-
wt as ucwords,
|
|
1001
|
-
qt as unwrap,
|
|
1002
|
-
En as wordCount,
|
|
1003
|
-
Ln as wordWrap,
|
|
1004
|
-
Kt as words,
|
|
1005
|
-
Gt as wrap
|
|
1006
|
-
};
|
|
1
|
+
import { title as e, upper as t } from "./convertcase/index.js";
|
|
2
|
+
import { randomInt as n, randomString as r } from "./random/index.js";
|
|
3
|
+
import { substr as i } from "./replacer/index.js";
|
|
4
|
+
import { ltrim as a, rtrim as o, trim as s } from "./trimmer/index.js";
|
|
5
|
+
import { createUlidsNormally as c } from "./ulid/index.js";
|
|
6
|
+
import { createUuidsNormally as l } from "./uuid/index.js";
|
|
7
|
+
import { isArray as u, isFunction as d, isNull as f, isNumber as p, isString as m, isUndefined as h, phpStringCast as g, toLower as _ } from "@tolki/utils";
|
|
8
|
+
// src/str.ts
|
|
9
|
+
var v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), x = null;
|
|
10
|
+
function S(e, t) {
|
|
11
|
+
if (t === "") return e;
|
|
12
|
+
let n = String(t), r = e.indexOf(n);
|
|
13
|
+
return r === -1 ? e : e.slice(r + n.length);
|
|
14
|
+
}
|
|
15
|
+
function ee(e, t) {
|
|
16
|
+
if (t === "") return e;
|
|
17
|
+
let n = e.lastIndexOf(String(t));
|
|
18
|
+
return n === -1 ? e : e.slice(n + String(t).length);
|
|
19
|
+
}
|
|
20
|
+
function C(e, t) {
|
|
21
|
+
if (t === "") return e;
|
|
22
|
+
let n = e.indexOf(String(t));
|
|
23
|
+
return n === -1 ? e : e.slice(0, n);
|
|
24
|
+
}
|
|
25
|
+
function w(e, t) {
|
|
26
|
+
if (t === "") return e;
|
|
27
|
+
let n = e.lastIndexOf(String(t));
|
|
28
|
+
return n === -1 ? e : i(e, 0, n);
|
|
29
|
+
}
|
|
30
|
+
function te(e, t, n) {
|
|
31
|
+
return t === "" || n === "" ? e : w(S(e, t), n);
|
|
32
|
+
}
|
|
33
|
+
function ne(e, t, n) {
|
|
34
|
+
return t === "" || n === "" ? e : C(S(e, t), n);
|
|
35
|
+
}
|
|
36
|
+
function re(e) {
|
|
37
|
+
if (y.has(e)) return y.get(e);
|
|
38
|
+
let t = Y(J(e));
|
|
39
|
+
return y.set(e, t), t;
|
|
40
|
+
}
|
|
41
|
+
function ie(e, t) {
|
|
42
|
+
let n = e.length;
|
|
43
|
+
return !(t < 0 ? t < -n : t > n - 1) && (t < 0 && (t += n), e.charAt(t));
|
|
44
|
+
}
|
|
45
|
+
function ae(e, t) {
|
|
46
|
+
for (let n of u(t) ? t : [t]) if (n !== "" && e.startsWith(n)) {
|
|
47
|
+
let t = [...e], r = [...n];
|
|
48
|
+
return t.slice(r.length).join("");
|
|
49
|
+
}
|
|
50
|
+
return e;
|
|
51
|
+
}
|
|
52
|
+
function oe(e, t) {
|
|
53
|
+
for (let n of u(t) ? t : [t]) if (n !== "" && e.endsWith(n)) {
|
|
54
|
+
let t = [...e], r = [...n];
|
|
55
|
+
return t.slice(0, -r.length).join("");
|
|
56
|
+
}
|
|
57
|
+
return e;
|
|
58
|
+
}
|
|
59
|
+
function T(e, t, n = !1) {
|
|
60
|
+
n && (e = e.toLowerCase());
|
|
61
|
+
let r;
|
|
62
|
+
r = typeof t == "string" ? [t] : Array.from(t);
|
|
63
|
+
for (let t of r) if (n && (t = t.toLowerCase()), t !== "" && e.includes(t)) return !0;
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
function se(e, t = "", n = {}) {
|
|
67
|
+
let { radius: r = 100, omission: s = "..." } = n, c = String(e ?? ""), l = RegExp(`^(.*?)(${((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))(t ?? "")})(.*)$`, "iu").exec(c);
|
|
68
|
+
if (!l) return null;
|
|
69
|
+
let u = String(l[1]), d = String(l[2]), f = String(l[3]), p = a(u), m = Array.from(p).length, h = i(p, Math.max(m - r, 0), r), g = a(h);
|
|
70
|
+
g !== p && (g = s + g);
|
|
71
|
+
let _ = o(f), v = i(_, 0, r), y = o(v);
|
|
72
|
+
return y !== _ && (y += s), g + d + y;
|
|
73
|
+
}
|
|
74
|
+
function ce(e, t, n = !1) {
|
|
75
|
+
let r = !1;
|
|
76
|
+
for (let i of t) if (r = !0, !T(e, i, n)) return !1;
|
|
77
|
+
return r;
|
|
78
|
+
}
|
|
79
|
+
function le(e, t, n = !1) {
|
|
80
|
+
return !T(e, t, n);
|
|
81
|
+
}
|
|
82
|
+
function ue(e, t = " ") {
|
|
83
|
+
return u(t) ? (t.forEach((t) => {
|
|
84
|
+
e = e.replace(RegExp(`${t}+`, "g"), t);
|
|
85
|
+
}), e) : e.replace(RegExp(`${t}+`, "g"), t);
|
|
86
|
+
}
|
|
87
|
+
function E(e, t) {
|
|
88
|
+
if (e === null) return !1;
|
|
89
|
+
e = String(e), t = u(t) ? Array.from(t) : [String(t)];
|
|
90
|
+
for (let n of t) if (n !== "" && e.endsWith(n)) return !0;
|
|
91
|
+
return !1;
|
|
92
|
+
}
|
|
93
|
+
function de(e, t) {
|
|
94
|
+
return !E(e, t);
|
|
95
|
+
}
|
|
96
|
+
function fe(e, t) {
|
|
97
|
+
let n = g(e), r = g(t);
|
|
98
|
+
if (r === "") return n;
|
|
99
|
+
let i = n.length;
|
|
100
|
+
for (; n.endsWith(r, i);) i -= r.length;
|
|
101
|
+
return `${n.slice(0, i)}${r}`;
|
|
102
|
+
}
|
|
103
|
+
function pe(e, t, n = null) {
|
|
104
|
+
return t + e + (n ?? t);
|
|
105
|
+
}
|
|
106
|
+
function me(e, t, n = null) {
|
|
107
|
+
return q(e, t) && (e = i(e, O(t))), E(e, n ??= t) && (e = i(e, 0, -O(n))), e;
|
|
108
|
+
}
|
|
109
|
+
function he(e, t, n = !1) {
|
|
110
|
+
t = String(t);
|
|
111
|
+
let r;
|
|
112
|
+
r = typeof e == "string" ? [e] : Array.from(e);
|
|
113
|
+
for (let e of r) {
|
|
114
|
+
if (e = String(e), e === t || n && _(e) === _(t)) return !0;
|
|
115
|
+
e = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), e = e.replace(/\\\*/g, ".*");
|
|
116
|
+
let r = n ? "iu" : "u";
|
|
117
|
+
if (RegExp(`^${e}$`, r).test(t)) return !0;
|
|
118
|
+
}
|
|
119
|
+
return !1;
|
|
120
|
+
}
|
|
121
|
+
function D(e) {
|
|
122
|
+
for (let t = 0; t < e.length; t++) if (e.charCodeAt(t) > 127) return !1;
|
|
123
|
+
return !0;
|
|
124
|
+
}
|
|
125
|
+
function ge(e) {
|
|
126
|
+
if (!m(e)) return !1;
|
|
127
|
+
try {
|
|
128
|
+
JSON.parse(e);
|
|
129
|
+
} catch {
|
|
130
|
+
return !1;
|
|
131
|
+
}
|
|
132
|
+
return !0;
|
|
133
|
+
}
|
|
134
|
+
function _e(e, t = []) {
|
|
135
|
+
if (!m(e)) return !1;
|
|
136
|
+
let n = (t.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" : t.join("|")).split("|").map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
137
|
+
try {
|
|
138
|
+
let t = new URL(e), r = t.protocol.replace(":", ""), i = t.hostname, a = e.slice(e.indexOf("://") + 3).startsWith("/"), o = i.length > 0 && !/^\.+$/.test(i) && !a, s = r === "file" && a;
|
|
139
|
+
if (n.split("|").includes(r) && (o || s)) return !0;
|
|
140
|
+
} catch {}
|
|
141
|
+
let r = [
|
|
142
|
+
"^(",
|
|
143
|
+
n,
|
|
144
|
+
"):\\/\\/",
|
|
145
|
+
"(?:((?:[_.\\p{L}\\p{N}-]|%[0-9A-Fa-f]{2})+:)?((?:[_.\\p{L}\\p{N}-]|%[0-9A-Fa-f]{2})+)@)?",
|
|
146
|
+
"(",
|
|
147
|
+
"(?:(?:[\\p{L}\\p{N}\\p{S}\\p{M}_-]+\\.)+(?:xn--[a-z0-9-]+|[\\p{L}\\p{N}\\p{M}]+)|[a-z0-9_-]+)\\.?",
|
|
148
|
+
"|",
|
|
149
|
+
"(?:\\d{1,3}\\.){3}\\d{1,3}",
|
|
150
|
+
"|",
|
|
151
|
+
"\\[(?:[0-9A-Fa-f:.]+)\\]",
|
|
152
|
+
")",
|
|
153
|
+
"(?::[0-9]+)?",
|
|
154
|
+
"(?:/(?:[\\p{L}\\p{N}\\-._~!$&\"()*,;=:@]|%[0-9A-Fa-f]{2})*)*",
|
|
155
|
+
"(?:\\?(?:[\\p{L}\\p{N}\\-._~!$&\"()*,;=:@/?\\[\\]]|%[0-9A-Fa-f]{2})*)?",
|
|
156
|
+
"(?:#(?:[\\p{L}\\p{N}\\-._~!$&\"()*,;=:@/?]|%[0-9A-Fa-f]{2})*)?",
|
|
157
|
+
"$"
|
|
158
|
+
].join("");
|
|
159
|
+
return new RegExp(r, "iu").test(e);
|
|
160
|
+
}
|
|
161
|
+
function ve(e) {
|
|
162
|
+
return K(e, "-");
|
|
163
|
+
}
|
|
164
|
+
function O(e) {
|
|
165
|
+
return e.length;
|
|
166
|
+
}
|
|
167
|
+
function ye(e, t = 100, n = "...", r = !1) {
|
|
168
|
+
if (e.length <= t) return e;
|
|
169
|
+
if (!r) return e.slice(0, t).trimEnd() + n;
|
|
170
|
+
e = G(e).replace(/[\n\r]+/g, " ").trim();
|
|
171
|
+
let i = e.slice(0, t).trimEnd();
|
|
172
|
+
return e.substring(t, t + 1) === " " || !/\s/.test(i) ? i + n : i.replace(/(.*)\s.*/, "$1") + n;
|
|
173
|
+
}
|
|
174
|
+
function k(e) {
|
|
175
|
+
return _(e);
|
|
176
|
+
}
|
|
177
|
+
function A(e, t = 100, n = "...") {
|
|
178
|
+
if (t <= 0) return e;
|
|
179
|
+
let r = RegExp(`^\\s*(?:\\S+\\s*){1,${t}}`, "u"), i = e.match(r);
|
|
180
|
+
return !i || O(e) === O(i[0]) ? e : i[0].trimEnd() + n;
|
|
181
|
+
}
|
|
182
|
+
function j(e, t, n, r = null) {
|
|
183
|
+
if (t === "") return e;
|
|
184
|
+
let i = e.length, a = n;
|
|
185
|
+
n < 0 && (a = n < -i ? 0 : i + n);
|
|
186
|
+
let o = e.slice(a, r === null ? void 0 : a + r);
|
|
187
|
+
if (o === "") return e;
|
|
188
|
+
let s = e.slice(0, a), c = o.length, l = e.slice(a + c);
|
|
189
|
+
return s + t.slice(0, 1).repeat(c) + l;
|
|
190
|
+
}
|
|
191
|
+
function M(e, t) {
|
|
192
|
+
let n = "u", r = e;
|
|
193
|
+
if (e.length >= 2 && e[0] === "/") {
|
|
194
|
+
let t = -1;
|
|
195
|
+
for (let n = e.length - 1; n > 0; n--) if (e[n] === "/") {
|
|
196
|
+
let r = 0;
|
|
197
|
+
for (let t = n - 1; t >= 0 && e[t] === "\\"; t--) r++;
|
|
198
|
+
if (r % 2 == 0) {
|
|
199
|
+
t = n;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (t > 0) {
|
|
204
|
+
r = e.slice(1, t);
|
|
205
|
+
let i = e.slice(t + 1);
|
|
206
|
+
if (i) for (let e of i) /[imsuy]/.test(e) && !n.includes(e) && (n += e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
try {
|
|
210
|
+
let e = new RegExp(r, n).exec(t);
|
|
211
|
+
return e ? e[1] === void 0 ? e[0] : e[1] : "";
|
|
212
|
+
} catch {
|
|
213
|
+
return "";
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function N(e, t) {
|
|
217
|
+
t = String(t);
|
|
218
|
+
let n = typeof e == "string" ? [e] : Array.from(e);
|
|
219
|
+
for (let e of n) {
|
|
220
|
+
if (typeof e != "string" || e === "") continue;
|
|
221
|
+
let n = "u", r = e;
|
|
222
|
+
if (e.length >= 2 && e[0] === "/") {
|
|
223
|
+
let t = -1;
|
|
224
|
+
for (let n = e.length - 1; n > 0; n--) if (e[n] === "/") {
|
|
225
|
+
let r = 0;
|
|
226
|
+
for (let t = n - 1; t >= 0 && e[t] === "\\"; t--) r++;
|
|
227
|
+
if (r % 2 == 0) {
|
|
228
|
+
t = n;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (t > 0) {
|
|
233
|
+
r = e.slice(1, t);
|
|
234
|
+
let i = e.slice(t + 1);
|
|
235
|
+
if (i) for (let e of i) /[imsuy]/.test(e) && !n.includes(e) && (n += e);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
try {
|
|
239
|
+
if (new RegExp(r, n).test(t)) return !0;
|
|
240
|
+
} catch {}
|
|
241
|
+
}
|
|
242
|
+
return !1;
|
|
243
|
+
}
|
|
244
|
+
function P(e, t) {
|
|
245
|
+
let n = "u", r = e;
|
|
246
|
+
if (e.length >= 2 && e[0] === "/") {
|
|
247
|
+
let t = -1;
|
|
248
|
+
for (let n = e.length - 1; n > 0; n--) if (e[n] === "/") {
|
|
249
|
+
let r = 0;
|
|
250
|
+
for (let t = n - 1; t >= 0 && e[t] === "\\"; t--) r++;
|
|
251
|
+
if (r % 2 == 0) {
|
|
252
|
+
t = n;
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (t > 0) {
|
|
257
|
+
r = e.slice(1, t);
|
|
258
|
+
let i = e.slice(t + 1);
|
|
259
|
+
if (i) for (let e of i) /[gimsuy]/.test(e) && !n.includes(e) && (n += e);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
n.includes("g") || (n += "g");
|
|
263
|
+
let i = [];
|
|
264
|
+
try {
|
|
265
|
+
let e = new RegExp(r, n), a;
|
|
266
|
+
for (; (a = e.exec(t)) !== null;) i.push(a[1] === void 0 ? a[0] : a[1]), a[0] === "" && e.lastIndex++;
|
|
267
|
+
} catch {
|
|
268
|
+
i = [];
|
|
269
|
+
}
|
|
270
|
+
return i;
|
|
271
|
+
}
|
|
272
|
+
function be(e) {
|
|
273
|
+
return u(e) ? e.map((e) => e.replace(/\D/g, "")) : e.replace(/\D/g, "");
|
|
274
|
+
}
|
|
275
|
+
function xe(e, t, n = " ") {
|
|
276
|
+
let r = e.length;
|
|
277
|
+
if (t <= r || n === "") return e;
|
|
278
|
+
let i = t - r, a = Math.floor(i / 2), o = i - a;
|
|
279
|
+
return F(n, a) + e + F(n, o);
|
|
280
|
+
}
|
|
281
|
+
function Se(e, t, n = " ") {
|
|
282
|
+
let r = e.length;
|
|
283
|
+
return t <= r || n === "" ? e : F(n, t - r) + e;
|
|
284
|
+
}
|
|
285
|
+
function Ce(e, t, n = " ") {
|
|
286
|
+
let r = e.length;
|
|
287
|
+
return t <= r || n === "" ? e : e + F(n, t - r);
|
|
288
|
+
}
|
|
289
|
+
function F(e, t) {
|
|
290
|
+
if (t <= 0 || e.length === 0) return "";
|
|
291
|
+
let n = Math.ceil(t / e.length);
|
|
292
|
+
return e.repeat(n).slice(0, t);
|
|
293
|
+
}
|
|
294
|
+
function we(e = 32, t = !0, r = !0, i = !0, a = !1) {
|
|
295
|
+
let o = [
|
|
296
|
+
t ? /* @__PURE__ */ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split("") : null,
|
|
297
|
+
r ? [
|
|
298
|
+
"0",
|
|
299
|
+
"1",
|
|
300
|
+
"2",
|
|
301
|
+
"3",
|
|
302
|
+
"4",
|
|
303
|
+
"5",
|
|
304
|
+
"6",
|
|
305
|
+
"7",
|
|
306
|
+
"8",
|
|
307
|
+
"9"
|
|
308
|
+
] : null,
|
|
309
|
+
i ? /* @__PURE__ */ "~!#$%^&*()-_.,<>?/\\{}[]|:;".split("") : null,
|
|
310
|
+
a ? [" "] : null
|
|
311
|
+
].filter((e) => u(e));
|
|
312
|
+
if (o.length === 0) throw Error("At least one character pool must be enabled.");
|
|
313
|
+
let s = o.flat(), c = I(o).slice(0, Math.max(0, e)).map((e) => e[n(0, e.length - 1)]), l = Array.from({ length: Math.max(0, e - c.length) }, () => s[n(0, s.length - 1)]);
|
|
314
|
+
return I([...c, ...l]).join("");
|
|
315
|
+
}
|
|
316
|
+
function I(e) {
|
|
317
|
+
let t = [...e];
|
|
318
|
+
for (let e = t.length - 1; e > 0; e--) {
|
|
319
|
+
let r = n(0, e);
|
|
320
|
+
[t[e], t[r]] = [t[r], t[e]];
|
|
321
|
+
}
|
|
322
|
+
return t;
|
|
323
|
+
}
|
|
324
|
+
function Te(e, t, n = 0) {
|
|
325
|
+
if (t === "") return !1;
|
|
326
|
+
let r = Array.from(e), i = Array.from(t), a = n >= 0 ? n : r.length + n;
|
|
327
|
+
if (a < 0 && (a = 0), a >= r.length) return !1;
|
|
328
|
+
let o = r.length - i.length;
|
|
329
|
+
for (let e = a; e <= o; e++) {
|
|
330
|
+
let t = !0;
|
|
331
|
+
for (let n = 0; n < i.length; n++) if (r[e + n] !== i[n]) {
|
|
332
|
+
t = !1;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
if (t) return e;
|
|
336
|
+
}
|
|
337
|
+
return !1;
|
|
338
|
+
}
|
|
339
|
+
function L(e = 16) {
|
|
340
|
+
return (x ?? ((e) => r(e)))(e);
|
|
341
|
+
}
|
|
342
|
+
function R(e) {
|
|
343
|
+
x = e;
|
|
344
|
+
}
|
|
345
|
+
function Ee(e, t) {
|
|
346
|
+
let n = 0, r = t ?? function(e) {
|
|
347
|
+
let t = x;
|
|
348
|
+
x = null;
|
|
349
|
+
let r = L(e);
|
|
350
|
+
return x = t, n++, r;
|
|
351
|
+
};
|
|
352
|
+
R((t) => n < e.length ? String(e[n++]) : r(t));
|
|
353
|
+
}
|
|
354
|
+
function z() {
|
|
355
|
+
x = null;
|
|
356
|
+
}
|
|
357
|
+
function De(e, t) {
|
|
358
|
+
return t <= 0 ? "" : e.repeat(t);
|
|
359
|
+
}
|
|
360
|
+
function Oe(e, t, n) {
|
|
361
|
+
let r;
|
|
362
|
+
r = typeof t == "object" && !u(t) ? Object.values(t) : u(t) ? [...t] : Array.from(t);
|
|
363
|
+
let i = n.split(e);
|
|
364
|
+
if (i.length === 1) return n;
|
|
365
|
+
let a = i[0];
|
|
366
|
+
for (let t = 1; t < i.length; t++) {
|
|
367
|
+
let n = r.length ? r.shift() : e;
|
|
368
|
+
a += n + i[t];
|
|
369
|
+
}
|
|
370
|
+
return String(a);
|
|
371
|
+
}
|
|
372
|
+
function ke(e, t) {
|
|
373
|
+
try {
|
|
374
|
+
let t = String(e);
|
|
375
|
+
if (t.length) return t;
|
|
376
|
+
throw Error("Failed to convert value to string");
|
|
377
|
+
} catch {
|
|
378
|
+
return t;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function Ae(e, t, n, r = !0) {
|
|
382
|
+
if (m(e) && !m(t)) throw TypeError("The replacement must be a string when the search term is a string.");
|
|
383
|
+
let i = m(n) ? n : Array.from(n, (e) => V(e));
|
|
384
|
+
if (!r) return B(e, t, i);
|
|
385
|
+
let a = m(e) ? [e] : Array.from(e, (e) => V(e)), o = m(t) ? a.map(() => t) : Array.from(t, (e) => V(e)), s = (e) => a.reduce((e, t, n) => t === "" ? e : e.split(t).join(o[n] ?? ""), e);
|
|
386
|
+
return m(i) ? s(i) : i.map(s);
|
|
387
|
+
}
|
|
388
|
+
function B(e, t, n) {
|
|
389
|
+
let r = m(e) ? [e] : Array.from(e, (e) => V(e)), i = m(t) ? r.map(() => t) : Array.from(t, (e) => V(e)), a = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (e) => r.reduce((e, t, n) => {
|
|
390
|
+
if (t === "") return e;
|
|
391
|
+
let r = i[n] ?? "", o = new RegExp(a(t), D(t) ? "gi" : "giu");
|
|
392
|
+
return e.replace(o, () => r);
|
|
393
|
+
}, e);
|
|
394
|
+
return m(n) ? o(n) : n.map(o);
|
|
395
|
+
}
|
|
396
|
+
function V(e) {
|
|
397
|
+
return f(e) || h(e) ? "" : String(e);
|
|
398
|
+
}
|
|
399
|
+
function H(e, t, n) {
|
|
400
|
+
if (e = String(e), e === "") return n;
|
|
401
|
+
let r = n.indexOf(e);
|
|
402
|
+
return r === -1 ? n : n.slice(0, r) + t + n.slice(r + e.length);
|
|
403
|
+
}
|
|
404
|
+
function U(e, t, n) {
|
|
405
|
+
return e = String(e), e === "" ? n : q(n, e) ? H(e, t, n) : n;
|
|
406
|
+
}
|
|
407
|
+
function W(e, t, n) {
|
|
408
|
+
if (e = String(e), e === "") return n;
|
|
409
|
+
let r = n.lastIndexOf(e);
|
|
410
|
+
return r === -1 ? n : n.slice(0, r) + t + n.slice(r + e.length);
|
|
411
|
+
}
|
|
412
|
+
function je(e, t, n) {
|
|
413
|
+
return e = String(e), e === "" ? n : E(n, e) ? W(e, t, n) : n;
|
|
414
|
+
}
|
|
415
|
+
function Me(e, t, n, r = -1) {
|
|
416
|
+
let i = (e) => u(e) ? e : [e], a = i(e);
|
|
417
|
+
function o(e) {
|
|
418
|
+
try {
|
|
419
|
+
if (e instanceof RegExp) {
|
|
420
|
+
let t = e.flags;
|
|
421
|
+
return t.includes("g") || (t += "g"), t.includes("u") || (t += "u"), new RegExp(e.source, t);
|
|
422
|
+
}
|
|
423
|
+
let t = e, n = "gu";
|
|
424
|
+
if (e.length >= 2 && e[0] === "/") {
|
|
425
|
+
let r = -1;
|
|
426
|
+
for (let t = e.length - 1; t > 0; t--) if (e[t] === "/") {
|
|
427
|
+
let n = 0;
|
|
428
|
+
for (let r = t - 1; r >= 0 && e[r] === "\\"; r--) n++;
|
|
429
|
+
if (n % 2 == 0) {
|
|
430
|
+
r = t;
|
|
431
|
+
break;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
if (r > 1) {
|
|
435
|
+
t = e.slice(1, r);
|
|
436
|
+
let i = e.slice(r + 1);
|
|
437
|
+
if (i) for (let e of i) /[imsuy]/.test(e) && !n.includes(e) && (n += e);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return new RegExp(t, Array.from(new Set(n.split(""))).join(""));
|
|
441
|
+
} catch {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
let s = [];
|
|
446
|
+
for (let e of a) {
|
|
447
|
+
let t = o(e);
|
|
448
|
+
if (!t) return null;
|
|
449
|
+
s.push(t);
|
|
450
|
+
}
|
|
451
|
+
let c = d(t), l = c ? [] : i(t), f = (e) => {
|
|
452
|
+
let n = e;
|
|
453
|
+
for (let e = 0; e < s.length; e++) {
|
|
454
|
+
let i = s[e];
|
|
455
|
+
if (c) {
|
|
456
|
+
let e = 0, a = t;
|
|
457
|
+
n = n.replace(i, (t, ...n) => {
|
|
458
|
+
if (r >= 0 && e >= r) return t;
|
|
459
|
+
e++;
|
|
460
|
+
let i = n.length > 0 && n[n.length - 1] !== null && typeof n[n.length - 1] == "object" ? n.length - 3 : n.length - 2, o = [];
|
|
461
|
+
for (let e = 0; e < i; e++) o.push(n[e]);
|
|
462
|
+
let s = [t, ...o];
|
|
463
|
+
return a(s);
|
|
464
|
+
});
|
|
465
|
+
} else {
|
|
466
|
+
let t = l[e] ?? (l.length === 1 ? l[0] : "");
|
|
467
|
+
if (r < 0) n = n.replace(i, (e, ...n) => {
|
|
468
|
+
let r = n.length > 0 && n[n.length - 1] !== null && typeof n[n.length - 1] == "object" ? n.length - 3 : n.length - 2, i = n.slice(0, r).map((e) => String(e));
|
|
469
|
+
return t.replace(/\$(\d{1,2})/g, (e, t) => (i[parseInt(t, 10) - 1] ?? "").toUpperCase());
|
|
470
|
+
});
|
|
471
|
+
else {
|
|
472
|
+
let e = 0;
|
|
473
|
+
n = n.replace(i, (n, ...i) => {
|
|
474
|
+
if (e >= r) return n;
|
|
475
|
+
e++;
|
|
476
|
+
let a = i.length > 0 && i[i.length - 1] !== null && typeof i[i.length - 1] == "object" ? i.length - 3 : i.length - 2, o = i.slice(0, a).map((e) => String(e));
|
|
477
|
+
return t.replace(/\$(\d{1,2})/g, (e, t) => (o[parseInt(t, 10) - 1] ?? "").toUpperCase());
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return n;
|
|
483
|
+
};
|
|
484
|
+
return u(n) ? n.map(f) : f(n);
|
|
485
|
+
}
|
|
486
|
+
function G(e) {
|
|
487
|
+
let t = "", n = !1;
|
|
488
|
+
for (let r = 0; r < e.length; r++) {
|
|
489
|
+
let i = e[r];
|
|
490
|
+
i === "<" ? n = !0 : i === ">" ? n = !1 : n || (t += i);
|
|
491
|
+
}
|
|
492
|
+
return t;
|
|
493
|
+
}
|
|
494
|
+
function Ne(e, t, n = !0) {
|
|
495
|
+
let r = m(t) ? t : Array.from(t, (e) => V(e));
|
|
496
|
+
if (!n) return B(e, "", r);
|
|
497
|
+
let i = m(e) ? [e] : Array.from(e, (e) => V(e)), a = (e) => {
|
|
498
|
+
let t = e;
|
|
499
|
+
for (let e of i) e !== "" && (t = t.split(e).join(""));
|
|
500
|
+
return t;
|
|
501
|
+
};
|
|
502
|
+
return m(r) ? a(r) : r.map(a);
|
|
503
|
+
}
|
|
504
|
+
function Pe(e) {
|
|
505
|
+
return Array.from(e).reverse().join("");
|
|
506
|
+
}
|
|
507
|
+
function Fe(e, t) {
|
|
508
|
+
let n = g(e), r = g(t);
|
|
509
|
+
if (r === "") return n;
|
|
510
|
+
let i = 0;
|
|
511
|
+
for (; n.startsWith(r, i);) i += r.length;
|
|
512
|
+
return `${r}${n.slice(i)}`;
|
|
513
|
+
}
|
|
514
|
+
function Ie(t) {
|
|
515
|
+
let n = String(t).trim();
|
|
516
|
+
if (n === "") return "";
|
|
517
|
+
let r = n.split(/\s+/u);
|
|
518
|
+
return r = r.length > 1 ? r.map((t) => e(t)) : X(r.join("_")).map((t) => e(t)), r.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((e) => e.length > 0).join(" ");
|
|
519
|
+
}
|
|
520
|
+
function Le(e, n = !1) {
|
|
521
|
+
let r = e.split(/\s+/u).filter((e) => e.length > 0).map((e) => [...e][0]).join("");
|
|
522
|
+
return n ? t(r) : r;
|
|
523
|
+
}
|
|
524
|
+
function Re(e) {
|
|
525
|
+
if (e.trim() === "") return e;
|
|
526
|
+
let t = /* @__PURE__ */ new Set(/* @__PURE__ */ "and.as.but.for.if.nor.or.so.yet.a.an.the.at.by.for.in.of.off.on.per.to.up.via.et.ou.un.une.la.le.les.de.du.des.par.à".split(".")), n = /* @__PURE__ */ new Set([
|
|
527
|
+
".",
|
|
528
|
+
"!",
|
|
529
|
+
"?",
|
|
530
|
+
":",
|
|
531
|
+
"—",
|
|
532
|
+
","
|
|
533
|
+
]), r = e.split(/\s+/u), i = (e) => {
|
|
534
|
+
if (!e) return e;
|
|
535
|
+
let t = Array.from(e);
|
|
536
|
+
return t[0].toLocaleUpperCase() + t.slice(1).join("");
|
|
537
|
+
};
|
|
538
|
+
for (let e = 0; e < r.length; e++) {
|
|
539
|
+
let a = r[e].toLocaleLowerCase();
|
|
540
|
+
if (a.includes("-")) {
|
|
541
|
+
let n = a.split("-").map((e) => t.has(e) && e.length <= 3 ? e : i(e));
|
|
542
|
+
r[e] = n.join("-");
|
|
543
|
+
} else {
|
|
544
|
+
let o = e > 0 ? r[e - 1] : "", s = o ? Array.from(o).slice(-1)[0] : void 0, c = e === 0 || s !== void 0 && n.has(s);
|
|
545
|
+
t.has(a) && a.length <= 3 && !c ? r[e] = a : r[e] = i(a);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return r.join(" ");
|
|
549
|
+
}
|
|
550
|
+
function K(e, t = "_") {
|
|
551
|
+
let n = `${e}|${t}`;
|
|
552
|
+
if (v.has(n)) return v.get(n);
|
|
553
|
+
let r = e;
|
|
554
|
+
return /^[a-z]+$/.test(e) || (r = Z(e).replace(/\s+/gu, ""), r = r.replace(/(.)(?=[A-Z])/g, `$1${t}`), r = k(r)), v.set(n, r), r;
|
|
555
|
+
}
|
|
556
|
+
function ze(e) {
|
|
557
|
+
return s(e).replace(/[\s\u3164\u1160]+/gu, " ");
|
|
558
|
+
}
|
|
559
|
+
function q(e, t) {
|
|
560
|
+
if (e == null || t == null) return !1;
|
|
561
|
+
let n;
|
|
562
|
+
n = m(t) || p(t) ? [t] : Symbol.iterator in Object(t) ? Array.from(t) : [t];
|
|
563
|
+
let r = String(e);
|
|
564
|
+
for (let e of n) {
|
|
565
|
+
if (e == null) continue;
|
|
566
|
+
let t = String(e);
|
|
567
|
+
if (t !== "" && r.startsWith(t)) return !0;
|
|
568
|
+
}
|
|
569
|
+
return !1;
|
|
570
|
+
}
|
|
571
|
+
function Be(e, t) {
|
|
572
|
+
return !q(e, t);
|
|
573
|
+
}
|
|
574
|
+
function J(e, t = !1) {
|
|
575
|
+
let n = e;
|
|
576
|
+
t && (n = e.replace(/(^|[-_ \s])([A-Z]+)(?=[-_ \s]|$)/gu, (e, t, n) => t + n.toLowerCase()));
|
|
577
|
+
let r = n;
|
|
578
|
+
if (b.has(r)) return b.get(r);
|
|
579
|
+
let i = String(n).replace(/[-_]+/g, " "), a = (i.trim() === "" ? [] : i.split(/\s+/u)).map((e) => {
|
|
580
|
+
if (!e) return e;
|
|
581
|
+
let t = Array.from(e);
|
|
582
|
+
return t[0].toUpperCase() + t.slice(1).join("");
|
|
583
|
+
}).join("");
|
|
584
|
+
return b.set(r, a), a;
|
|
585
|
+
}
|
|
586
|
+
function Ve(e, t = !1) {
|
|
587
|
+
return J(e, t);
|
|
588
|
+
}
|
|
589
|
+
function He(e, t) {
|
|
590
|
+
if (!e || Object.keys(e).length === 0) return t;
|
|
591
|
+
let n = Object.keys(e).filter((e) => e !== "");
|
|
592
|
+
if (n.length === 0) return t;
|
|
593
|
+
n.sort((e, t) => t.length - e.length);
|
|
594
|
+
let r = new RegExp(n.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"), "gu");
|
|
595
|
+
return t.replace(r, (t) => e[t]);
|
|
596
|
+
}
|
|
597
|
+
function Ue(e, t) {
|
|
598
|
+
return t < 0 ? i(e, t) : i(e, 0, t);
|
|
599
|
+
}
|
|
600
|
+
function Y(e) {
|
|
601
|
+
return k(i(e, 0, 1)) + i(e, 1);
|
|
602
|
+
}
|
|
603
|
+
function We(e) {
|
|
604
|
+
return t(i(e, 0, 1)) + i(e, 1);
|
|
605
|
+
}
|
|
606
|
+
function X(e) {
|
|
607
|
+
return e.split(/(?=\p{Lu})/u).filter(Boolean);
|
|
608
|
+
}
|
|
609
|
+
function Z(e, t = " \r\n\f\v") {
|
|
610
|
+
let n = u(t) ? t.join("") : t, r = n.length ? ((e) => e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"))(n) : "", i = r.length ? `(?:\\s|[${r}])` : "\\s", a = RegExp(`(^|${i})(\\p{Ll})`, "gu");
|
|
611
|
+
return e.replace(a, (e, t, n) => t + n.toUpperCase());
|
|
612
|
+
}
|
|
613
|
+
function Ge(e, t = null) {
|
|
614
|
+
let n = t && t.length > 0 ? t.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, i = e.match(r);
|
|
615
|
+
return i ? i.length : 0;
|
|
616
|
+
}
|
|
617
|
+
function Q(e) {
|
|
618
|
+
return e.trim() === "";
|
|
619
|
+
}
|
|
620
|
+
function $(e, t, n) {
|
|
621
|
+
let r = t;
|
|
622
|
+
for (; r < n && Q(e[r]);) r++;
|
|
623
|
+
return r;
|
|
624
|
+
}
|
|
625
|
+
function Ke(e, t, n) {
|
|
626
|
+
let r = n;
|
|
627
|
+
for (; r > t && Q(e[r - 1]);) r--;
|
|
628
|
+
return r;
|
|
629
|
+
}
|
|
630
|
+
function qe(e, t = 75, n = "\n", r = !1) {
|
|
631
|
+
if (e.length === 0 || t < 1 || n === "") return e;
|
|
632
|
+
let i = e.split(/\r\n|\n|\r/), a = [];
|
|
633
|
+
for (let e of i) {
|
|
634
|
+
let n = [...e], i = n.length;
|
|
635
|
+
if (i === 0) {
|
|
636
|
+
a.push("");
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
let o = 0;
|
|
640
|
+
if (r) for (; o < i && (o = $(n, o, i), o !== i);) {
|
|
641
|
+
if (i - o <= t) {
|
|
642
|
+
a.push(n.slice(o, i).join(""));
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
let e = Ke(n, o, o + t);
|
|
646
|
+
a.push(n.slice(o, e).join("")), o += t;
|
|
647
|
+
}
|
|
648
|
+
else {
|
|
649
|
+
for (; i - o > t;) {
|
|
650
|
+
let e = $(n, o, i);
|
|
651
|
+
if (e !== o && (o = e, i - o <= t)) break;
|
|
652
|
+
let r = Math.min(i, o + t + 1), s = -1;
|
|
653
|
+
for (let e = r - 1; e >= o; e--) if (Q(n[e])) {
|
|
654
|
+
s = e;
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
if (s > o) {
|
|
658
|
+
a.push(n.slice(o, s).join("")), o = s + 1;
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
let c = -1;
|
|
662
|
+
for (let e = o; e < i; e++) if (Q(n[e])) {
|
|
663
|
+
c = e;
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
if (c >= 0) a.push(n.slice(o, c).join("")), o = c + 1;
|
|
667
|
+
else {
|
|
668
|
+
a.push(n.slice(o, i).join("")), o = i;
|
|
669
|
+
break;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
i - o > 0 && a.push(n.slice(o, i).join(""));
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return a.join(n);
|
|
676
|
+
}
|
|
677
|
+
function Je() {
|
|
678
|
+
return v.size;
|
|
679
|
+
}
|
|
680
|
+
function Ye() {
|
|
681
|
+
return y.size;
|
|
682
|
+
}
|
|
683
|
+
function Xe() {
|
|
684
|
+
return b.size;
|
|
685
|
+
}
|
|
686
|
+
function Ze() {
|
|
687
|
+
v.clear(), y.clear(), b.clear();
|
|
688
|
+
}
|
|
689
|
+
function Qe() {
|
|
690
|
+
z(), c(), l();
|
|
691
|
+
}
|
|
692
|
+
export { S as after, ee as afterLast, Re as apa, C as before, w as beforeLast, te as between, ne as betweenFirst, re as camel, Ye as camelCacheSize, ie as charAt, oe as chopEnd, ae as chopStart, T as contains, ce as containsAll, z as createRandomStringsNormally, R as createRandomStringsUsing, Ee as createRandomStringsUsingSequence, ue as deduplicate, le as doesntContain, de as doesntEndWith, Be as doesntStartWith, E as endsWith, se as excerpt, fe as finish, Ze as flushCache, Ie as headline, Le as initials, he as is, D as isAscii, ge as isJson, N as isMatch, _e as isUrl, ve as kebab, Y as lcfirst, O as length, ye as limit, k as lower, F as makePad, j as mask, M as match, P as matchAll, be as numbers, xe as padBoth, Se as padLeft, Ce as padRight, Ve as pascal, we as password, Te as position, L as random, Ne as remove, De as repeat, Ae as replace, Oe as replaceArray, je as replaceEnd, H as replaceFirst, W as replaceLast, Me as replaceMatches, U as replaceStart, Qe as resetFactoryState, Pe as reverse, K as snake, Je as snakeCacheSize, ze as squish, Fe as start, q as startsWith, G as stripTags, J as studly, Xe as studlyCacheSize, He as swap, Ue as take, ke as toStringOr, We as ucfirst, X as ucsplit, Z as ucwords, me as unwrap, Ge as wordCount, qe as wordWrap, A as words, pe as wrap };
|