@visulima/html 1.0.0-alpha.2 → 1.0.0-alpha.3
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/CHANGELOG.md +10 -0
- package/LICENSE.md +27 -48
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -11
- package/dist/packem_shared/_commonjsHelpers-CV2jkJYL.js +1 -0
- package/dist/packem_shared/css-Dln-sxQh.js +1 -0
- package/dist/packem_shared/encode-CXgEtaTS.js +1 -0
- package/dist/packem_shared/escapeCss-oDJXzCKj.js +1 -0
- package/dist/packem_shared/escapeHtml-BGTH-nez.js +1 -0
- package/dist/packem_shared/escapeJs-BS03wnwB.js +1 -0
- package/dist/packem_shared/html-BiXubKfv.js +1 -0
- package/dist/packem_shared/htmlTags-sIGmCDBO.js +1 -0
- package/dist/packem_shared/isValidCustomElementName-gLEw9R2V.js +1 -0
- package/dist/packem_shared/stripHtmlDefaultOptions-C-cDIZNg.js +54 -0
- package/dist/packem_shared/voidHtmlTags-Bn-JBb1g.js +1 -0
- package/package.json +1 -47
- package/dist/packem_shared/_commonjsHelpers-B85MJLTf.js +0 -5
- package/dist/packem_shared/css-eLBFmNQq.js +0 -32
- package/dist/packem_shared/encode-jgknlkNE.js +0 -195
- package/dist/packem_shared/escapeCss-gSWL0xVj.js +0 -17
- package/dist/packem_shared/escapeHtml-Cztfu84O.js +0 -18
- package/dist/packem_shared/escapeJs-8hCFOEdN.js +0 -6
- package/dist/packem_shared/html-B-Khp3Xj.js +0 -24
- package/dist/packem_shared/htmlTags-CnZinEi6.js +0 -132
- package/dist/packem_shared/isValidCustomElementName-Czb_BiVq.js +0 -16
- package/dist/packem_shared/stripHtmlDefaultOptions-Dj_FII9M.js +0 -1331
- package/dist/packem_shared/voidHtmlTags-Db3mUI2j.js +0 -30
|
@@ -1,1331 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-B85MJLTf.js';
|
|
2
|
-
import { decode } from './encode-jgknlkNE.js';
|
|
3
|
-
|
|
4
|
-
var rfdc_1;
|
|
5
|
-
var hasRequiredRfdc;
|
|
6
|
-
|
|
7
|
-
function requireRfdc () {
|
|
8
|
-
if (hasRequiredRfdc) return rfdc_1;
|
|
9
|
-
hasRequiredRfdc = 1;
|
|
10
|
-
rfdc_1 = rfdc;
|
|
11
|
-
function copyBuffer(cur) {
|
|
12
|
-
if (cur instanceof Buffer) {
|
|
13
|
-
return Buffer.from(cur);
|
|
14
|
-
}
|
|
15
|
-
return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length);
|
|
16
|
-
}
|
|
17
|
-
function rfdc(opts) {
|
|
18
|
-
opts = opts || {};
|
|
19
|
-
if (opts.circles) return rfdcCircles(opts);
|
|
20
|
-
const constructorHandlers = /* @__PURE__ */ new Map();
|
|
21
|
-
constructorHandlers.set(Date, (o) => new Date(o));
|
|
22
|
-
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
|
23
|
-
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
|
24
|
-
if (opts.constructorHandlers) {
|
|
25
|
-
for (const handler2 of opts.constructorHandlers) {
|
|
26
|
-
constructorHandlers.set(handler2[0], handler2[1]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let handler = null;
|
|
30
|
-
return opts.proto ? cloneProto : clone;
|
|
31
|
-
function cloneArray(a, fn) {
|
|
32
|
-
const keys = Object.keys(a);
|
|
33
|
-
const a2 = new Array(keys.length);
|
|
34
|
-
for (let i = 0; i < keys.length; i++) {
|
|
35
|
-
const k = keys[i];
|
|
36
|
-
const cur = a[k];
|
|
37
|
-
if (typeof cur !== "object" || cur === null) {
|
|
38
|
-
a2[k] = cur;
|
|
39
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
40
|
-
a2[k] = handler(cur, fn);
|
|
41
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
42
|
-
a2[k] = copyBuffer(cur);
|
|
43
|
-
} else {
|
|
44
|
-
a2[k] = fn(cur);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return a2;
|
|
48
|
-
}
|
|
49
|
-
function clone(o) {
|
|
50
|
-
if (typeof o !== "object" || o === null) return o;
|
|
51
|
-
if (Array.isArray(o)) return cloneArray(o, clone);
|
|
52
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
|
|
53
|
-
return handler(o, clone);
|
|
54
|
-
}
|
|
55
|
-
const o2 = {};
|
|
56
|
-
for (const k in o) {
|
|
57
|
-
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
|
58
|
-
const cur = o[k];
|
|
59
|
-
if (typeof cur !== "object" || cur === null) {
|
|
60
|
-
o2[k] = cur;
|
|
61
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
62
|
-
o2[k] = handler(cur, clone);
|
|
63
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
64
|
-
o2[k] = copyBuffer(cur);
|
|
65
|
-
} else {
|
|
66
|
-
o2[k] = clone(cur);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return o2;
|
|
70
|
-
}
|
|
71
|
-
function cloneProto(o) {
|
|
72
|
-
if (typeof o !== "object" || o === null) return o;
|
|
73
|
-
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
|
74
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
|
|
75
|
-
return handler(o, cloneProto);
|
|
76
|
-
}
|
|
77
|
-
const o2 = {};
|
|
78
|
-
for (const k in o) {
|
|
79
|
-
const cur = o[k];
|
|
80
|
-
if (typeof cur !== "object" || cur === null) {
|
|
81
|
-
o2[k] = cur;
|
|
82
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
83
|
-
o2[k] = handler(cur, cloneProto);
|
|
84
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
85
|
-
o2[k] = copyBuffer(cur);
|
|
86
|
-
} else {
|
|
87
|
-
o2[k] = cloneProto(cur);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return o2;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function rfdcCircles(opts) {
|
|
94
|
-
const refs = [];
|
|
95
|
-
const refsNew = [];
|
|
96
|
-
const constructorHandlers = /* @__PURE__ */ new Map();
|
|
97
|
-
constructorHandlers.set(Date, (o) => new Date(o));
|
|
98
|
-
constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn)));
|
|
99
|
-
constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn)));
|
|
100
|
-
if (opts.constructorHandlers) {
|
|
101
|
-
for (const handler2 of opts.constructorHandlers) {
|
|
102
|
-
constructorHandlers.set(handler2[0], handler2[1]);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
let handler = null;
|
|
106
|
-
return opts.proto ? cloneProto : clone;
|
|
107
|
-
function cloneArray(a, fn) {
|
|
108
|
-
const keys = Object.keys(a);
|
|
109
|
-
const a2 = new Array(keys.length);
|
|
110
|
-
for (let i = 0; i < keys.length; i++) {
|
|
111
|
-
const k = keys[i];
|
|
112
|
-
const cur = a[k];
|
|
113
|
-
if (typeof cur !== "object" || cur === null) {
|
|
114
|
-
a2[k] = cur;
|
|
115
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
116
|
-
a2[k] = handler(cur, fn);
|
|
117
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
118
|
-
a2[k] = copyBuffer(cur);
|
|
119
|
-
} else {
|
|
120
|
-
const index = refs.indexOf(cur);
|
|
121
|
-
if (index !== -1) {
|
|
122
|
-
a2[k] = refsNew[index];
|
|
123
|
-
} else {
|
|
124
|
-
a2[k] = fn(cur);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return a2;
|
|
129
|
-
}
|
|
130
|
-
function clone(o) {
|
|
131
|
-
if (typeof o !== "object" || o === null) return o;
|
|
132
|
-
if (Array.isArray(o)) return cloneArray(o, clone);
|
|
133
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
|
|
134
|
-
return handler(o, clone);
|
|
135
|
-
}
|
|
136
|
-
const o2 = {};
|
|
137
|
-
refs.push(o);
|
|
138
|
-
refsNew.push(o2);
|
|
139
|
-
for (const k in o) {
|
|
140
|
-
if (Object.hasOwnProperty.call(o, k) === false) continue;
|
|
141
|
-
const cur = o[k];
|
|
142
|
-
if (typeof cur !== "object" || cur === null) {
|
|
143
|
-
o2[k] = cur;
|
|
144
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
145
|
-
o2[k] = handler(cur, clone);
|
|
146
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
147
|
-
o2[k] = copyBuffer(cur);
|
|
148
|
-
} else {
|
|
149
|
-
const i = refs.indexOf(cur);
|
|
150
|
-
if (i !== -1) {
|
|
151
|
-
o2[k] = refsNew[i];
|
|
152
|
-
} else {
|
|
153
|
-
o2[k] = clone(cur);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
refs.pop();
|
|
158
|
-
refsNew.pop();
|
|
159
|
-
return o2;
|
|
160
|
-
}
|
|
161
|
-
function cloneProto(o) {
|
|
162
|
-
if (typeof o !== "object" || o === null) return o;
|
|
163
|
-
if (Array.isArray(o)) return cloneArray(o, cloneProto);
|
|
164
|
-
if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) {
|
|
165
|
-
return handler(o, cloneProto);
|
|
166
|
-
}
|
|
167
|
-
const o2 = {};
|
|
168
|
-
refs.push(o);
|
|
169
|
-
refsNew.push(o2);
|
|
170
|
-
for (const k in o) {
|
|
171
|
-
const cur = o[k];
|
|
172
|
-
if (typeof cur !== "object" || cur === null) {
|
|
173
|
-
o2[k] = cur;
|
|
174
|
-
} else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) {
|
|
175
|
-
o2[k] = handler(cur, cloneProto);
|
|
176
|
-
} else if (ArrayBuffer.isView(cur)) {
|
|
177
|
-
o2[k] = copyBuffer(cur);
|
|
178
|
-
} else {
|
|
179
|
-
const i = refs.indexOf(cur);
|
|
180
|
-
if (i !== -1) {
|
|
181
|
-
o2[k] = refsNew[i];
|
|
182
|
-
} else {
|
|
183
|
-
o2[k] = cloneProto(cur);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
refs.pop();
|
|
188
|
-
refsNew.pop();
|
|
189
|
-
return o2;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
return rfdc_1;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
var rfdcExports = requireRfdc();
|
|
196
|
-
const I = /*@__PURE__*/getDefaultExportFromCjs(rfdcExports);
|
|
197
|
-
|
|
198
|
-
I();
|
|
199
|
-
function u(t) {
|
|
200
|
-
if (t == null || typeof t != "object") return false;
|
|
201
|
-
let e = Object.getPrototypeOf(t);
|
|
202
|
-
return e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null ? false : !(Symbol.iterator in t) && !(Symbol.toStringTag in t);
|
|
203
|
-
}
|
|
204
|
-
function r(t) {
|
|
205
|
-
return typeof t == "string";
|
|
206
|
-
}
|
|
207
|
-
function W(t) {
|
|
208
|
-
return Number.isFinite(t);
|
|
209
|
-
}
|
|
210
|
-
function q$1(t) {
|
|
211
|
-
return Number.isSafeInteger(t) && t >= 0;
|
|
212
|
-
}
|
|
213
|
-
function G$1(t) {
|
|
214
|
-
return t != null;
|
|
215
|
-
}
|
|
216
|
-
function v(t, e) {
|
|
217
|
-
return u(t) && r(e) && e in t;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
221
|
-
|
|
222
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
223
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
|
224
|
-
|
|
225
|
-
var Symbol$1 = root.Symbol;
|
|
226
|
-
|
|
227
|
-
var objectProto$4 = Object.prototype;
|
|
228
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
229
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
230
|
-
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
231
|
-
function getRawTag(value) {
|
|
232
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
233
|
-
try {
|
|
234
|
-
value[symToStringTag$1] = void 0;
|
|
235
|
-
var unmasked = true;
|
|
236
|
-
} catch (e) {
|
|
237
|
-
}
|
|
238
|
-
var result = nativeObjectToString$1.call(value);
|
|
239
|
-
if (unmasked) {
|
|
240
|
-
if (isOwn) {
|
|
241
|
-
value[symToStringTag$1] = tag;
|
|
242
|
-
} else {
|
|
243
|
-
delete value[symToStringTag$1];
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var objectProto$3 = Object.prototype;
|
|
250
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
251
|
-
function objectToString(value) {
|
|
252
|
-
return nativeObjectToString.call(value);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
var nullTag = "[object Null]";
|
|
256
|
-
var undefinedTag = "[object Undefined]";
|
|
257
|
-
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
258
|
-
function baseGetTag(value) {
|
|
259
|
-
if (value == null) {
|
|
260
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
261
|
-
}
|
|
262
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
function isObjectLike(value) {
|
|
266
|
-
return value != null && typeof value == "object";
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
var symbolTag = "[object Symbol]";
|
|
270
|
-
function isSymbol(value) {
|
|
271
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
function arrayMap(array, iteratee) {
|
|
275
|
-
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
276
|
-
while (++index < length) {
|
|
277
|
-
result[index] = iteratee(array[index], index, array);
|
|
278
|
-
}
|
|
279
|
-
return result;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
var isArray = Array.isArray;
|
|
283
|
-
|
|
284
|
-
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0;
|
|
285
|
-
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
286
|
-
function baseToString(value) {
|
|
287
|
-
if (typeof value == "string") {
|
|
288
|
-
return value;
|
|
289
|
-
}
|
|
290
|
-
if (isArray(value)) {
|
|
291
|
-
return arrayMap(value, baseToString) + "";
|
|
292
|
-
}
|
|
293
|
-
if (isSymbol(value)) {
|
|
294
|
-
return symbolToString ? symbolToString.call(value) : "";
|
|
295
|
-
}
|
|
296
|
-
var result = value + "";
|
|
297
|
-
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
var reWhitespace = /\s/;
|
|
301
|
-
function trimmedEndIndex(string) {
|
|
302
|
-
var index = string.length;
|
|
303
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
304
|
-
}
|
|
305
|
-
return index;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
var reTrimStart = /^\s+/;
|
|
309
|
-
function baseTrim(string) {
|
|
310
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function isObject(value) {
|
|
314
|
-
var type = typeof value;
|
|
315
|
-
return value != null && (type == "object" || type == "function");
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
function identity(value) {
|
|
319
|
-
return value;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
var asyncTag = "[object AsyncFunction]";
|
|
323
|
-
var funcTag = "[object Function]";
|
|
324
|
-
var genTag = "[object GeneratorFunction]";
|
|
325
|
-
var proxyTag = "[object Proxy]";
|
|
326
|
-
function isFunction(value) {
|
|
327
|
-
if (!isObject(value)) {
|
|
328
|
-
return false;
|
|
329
|
-
}
|
|
330
|
-
var tag = baseGetTag(value);
|
|
331
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
var coreJsData = root["__core-js_shared__"];
|
|
335
|
-
|
|
336
|
-
var maskSrcKey = (function() {
|
|
337
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
338
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
339
|
-
})();
|
|
340
|
-
function isMasked(func) {
|
|
341
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
var funcProto$1 = Function.prototype;
|
|
345
|
-
var funcToString$1 = funcProto$1.toString;
|
|
346
|
-
function toSource(func) {
|
|
347
|
-
if (func != null) {
|
|
348
|
-
try {
|
|
349
|
-
return funcToString$1.call(func);
|
|
350
|
-
} catch (e) {
|
|
351
|
-
}
|
|
352
|
-
try {
|
|
353
|
-
return func + "";
|
|
354
|
-
} catch (e) {
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
return "";
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
361
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
362
|
-
var funcProto = Function.prototype;
|
|
363
|
-
var objectProto$2 = Object.prototype;
|
|
364
|
-
var funcToString = funcProto.toString;
|
|
365
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
366
|
-
var reIsNative = RegExp(
|
|
367
|
-
"^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
368
|
-
);
|
|
369
|
-
function baseIsNative(value) {
|
|
370
|
-
if (!isObject(value) || isMasked(value)) {
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
374
|
-
return pattern.test(toSource(value));
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
function getValue(object, key) {
|
|
378
|
-
return object == null ? void 0 : object[key];
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function getNative(object, key) {
|
|
382
|
-
var value = getValue(object, key);
|
|
383
|
-
return baseIsNative(value) ? value : void 0;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
function apply(func, thisArg, args) {
|
|
387
|
-
switch (args.length) {
|
|
388
|
-
case 0:
|
|
389
|
-
return func.call(thisArg);
|
|
390
|
-
case 1:
|
|
391
|
-
return func.call(thisArg, args[0]);
|
|
392
|
-
case 2:
|
|
393
|
-
return func.call(thisArg, args[0], args[1]);
|
|
394
|
-
case 3:
|
|
395
|
-
return func.call(thisArg, args[0], args[1], args[2]);
|
|
396
|
-
}
|
|
397
|
-
return func.apply(thisArg, args);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
var HOT_COUNT = 800;
|
|
401
|
-
var HOT_SPAN = 16;
|
|
402
|
-
var nativeNow = Date.now;
|
|
403
|
-
function shortOut(func) {
|
|
404
|
-
var count = 0, lastCalled = 0;
|
|
405
|
-
return function() {
|
|
406
|
-
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
407
|
-
lastCalled = stamp;
|
|
408
|
-
if (remaining > 0) {
|
|
409
|
-
if (++count >= HOT_COUNT) {
|
|
410
|
-
return arguments[0];
|
|
411
|
-
}
|
|
412
|
-
} else {
|
|
413
|
-
count = 0;
|
|
414
|
-
}
|
|
415
|
-
return func.apply(void 0, arguments);
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
function constant(value) {
|
|
420
|
-
return function() {
|
|
421
|
-
return value;
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
var defineProperty = (function() {
|
|
426
|
-
try {
|
|
427
|
-
var func = getNative(Object, "defineProperty");
|
|
428
|
-
func({}, "", {});
|
|
429
|
-
return func;
|
|
430
|
-
} catch (e) {
|
|
431
|
-
}
|
|
432
|
-
})();
|
|
433
|
-
|
|
434
|
-
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
435
|
-
return defineProperty(func, "toString", {
|
|
436
|
-
"configurable": true,
|
|
437
|
-
"enumerable": false,
|
|
438
|
-
"value": constant(string),
|
|
439
|
-
"writable": true
|
|
440
|
-
});
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
var setToString = shortOut(baseSetToString);
|
|
444
|
-
|
|
445
|
-
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
446
|
-
var length = array.length, index = fromIndex + (-1);
|
|
447
|
-
while (++index < length) {
|
|
448
|
-
if (predicate(array[index], index, array)) {
|
|
449
|
-
return index;
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
return -1;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
function baseIsNaN(value) {
|
|
456
|
-
return value !== value;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
function strictIndexOf(array, value, fromIndex) {
|
|
460
|
-
var index = fromIndex - 1, length = array.length;
|
|
461
|
-
while (++index < length) {
|
|
462
|
-
if (array[index] === value) {
|
|
463
|
-
return index;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
return -1;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
function baseIndexOf(array, value, fromIndex) {
|
|
470
|
-
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
function arrayIncludes(array, value) {
|
|
474
|
-
var length = array == null ? 0 : array.length;
|
|
475
|
-
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
function eq(value, other) {
|
|
479
|
-
return value === other || value !== value && other !== other;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
var nativeMax = Math.max;
|
|
483
|
-
function overRest(func, start, transform) {
|
|
484
|
-
start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
|
|
485
|
-
return function() {
|
|
486
|
-
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
|
|
487
|
-
while (++index < length) {
|
|
488
|
-
array[index] = args[start + index];
|
|
489
|
-
}
|
|
490
|
-
index = -1;
|
|
491
|
-
var otherArgs = Array(start + 1);
|
|
492
|
-
while (++index < start) {
|
|
493
|
-
otherArgs[index] = args[index];
|
|
494
|
-
}
|
|
495
|
-
otherArgs[start] = transform(array);
|
|
496
|
-
return apply(func, this, otherArgs);
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
function baseRest(func, start) {
|
|
501
|
-
return setToString(overRest(func, start, identity), func + "");
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
505
|
-
function isLength(value) {
|
|
506
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
function isArrayLike(value) {
|
|
510
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
var nativeCreate = getNative(Object, "create");
|
|
514
|
-
|
|
515
|
-
function hashClear() {
|
|
516
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
517
|
-
this.size = 0;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
function hashDelete(key) {
|
|
521
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
522
|
-
this.size -= result ? 1 : 0;
|
|
523
|
-
return result;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
|
|
527
|
-
var objectProto$1 = Object.prototype;
|
|
528
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
529
|
-
function hashGet(key) {
|
|
530
|
-
var data = this.__data__;
|
|
531
|
-
if (nativeCreate) {
|
|
532
|
-
var result = data[key];
|
|
533
|
-
return result === HASH_UNDEFINED$2 ? void 0 : result;
|
|
534
|
-
}
|
|
535
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
var objectProto = Object.prototype;
|
|
539
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
540
|
-
function hashHas(key) {
|
|
541
|
-
var data = this.__data__;
|
|
542
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
546
|
-
function hashSet(key, value) {
|
|
547
|
-
var data = this.__data__;
|
|
548
|
-
this.size += this.has(key) ? 0 : 1;
|
|
549
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
|
|
550
|
-
return this;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
function Hash(entries) {
|
|
554
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
555
|
-
this.clear();
|
|
556
|
-
while (++index < length) {
|
|
557
|
-
var entry = entries[index];
|
|
558
|
-
this.set(entry[0], entry[1]);
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
Hash.prototype.clear = hashClear;
|
|
562
|
-
Hash.prototype["delete"] = hashDelete;
|
|
563
|
-
Hash.prototype.get = hashGet;
|
|
564
|
-
Hash.prototype.has = hashHas;
|
|
565
|
-
Hash.prototype.set = hashSet;
|
|
566
|
-
|
|
567
|
-
function listCacheClear() {
|
|
568
|
-
this.__data__ = [];
|
|
569
|
-
this.size = 0;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
function assocIndexOf(array, key) {
|
|
573
|
-
var length = array.length;
|
|
574
|
-
while (length--) {
|
|
575
|
-
if (eq(array[length][0], key)) {
|
|
576
|
-
return length;
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
return -1;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
var arrayProto = Array.prototype;
|
|
583
|
-
var splice = arrayProto.splice;
|
|
584
|
-
function listCacheDelete(key) {
|
|
585
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
586
|
-
if (index < 0) {
|
|
587
|
-
return false;
|
|
588
|
-
}
|
|
589
|
-
var lastIndex = data.length - 1;
|
|
590
|
-
if (index == lastIndex) {
|
|
591
|
-
data.pop();
|
|
592
|
-
} else {
|
|
593
|
-
splice.call(data, index, 1);
|
|
594
|
-
}
|
|
595
|
-
--this.size;
|
|
596
|
-
return true;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
function listCacheGet(key) {
|
|
600
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
601
|
-
return index < 0 ? void 0 : data[index][1];
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
function listCacheHas(key) {
|
|
605
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
function listCacheSet(key, value) {
|
|
609
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
610
|
-
if (index < 0) {
|
|
611
|
-
++this.size;
|
|
612
|
-
data.push([key, value]);
|
|
613
|
-
} else {
|
|
614
|
-
data[index][1] = value;
|
|
615
|
-
}
|
|
616
|
-
return this;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
function ListCache(entries) {
|
|
620
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
621
|
-
this.clear();
|
|
622
|
-
while (++index < length) {
|
|
623
|
-
var entry = entries[index];
|
|
624
|
-
this.set(entry[0], entry[1]);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
ListCache.prototype.clear = listCacheClear;
|
|
628
|
-
ListCache.prototype["delete"] = listCacheDelete;
|
|
629
|
-
ListCache.prototype.get = listCacheGet;
|
|
630
|
-
ListCache.prototype.has = listCacheHas;
|
|
631
|
-
ListCache.prototype.set = listCacheSet;
|
|
632
|
-
|
|
633
|
-
var Map$1 = getNative(root, "Map");
|
|
634
|
-
|
|
635
|
-
function mapCacheClear() {
|
|
636
|
-
this.size = 0;
|
|
637
|
-
this.__data__ = {
|
|
638
|
-
"hash": new Hash(),
|
|
639
|
-
"map": new (Map$1 || ListCache)(),
|
|
640
|
-
"string": new Hash()
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
function isKeyable(value) {
|
|
645
|
-
var type = typeof value;
|
|
646
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
function getMapData(map, key) {
|
|
650
|
-
var data = map.__data__;
|
|
651
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
function mapCacheDelete(key) {
|
|
655
|
-
var result = getMapData(this, key)["delete"](key);
|
|
656
|
-
this.size -= result ? 1 : 0;
|
|
657
|
-
return result;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
function mapCacheGet(key) {
|
|
661
|
-
return getMapData(this, key).get(key);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
function mapCacheHas(key) {
|
|
665
|
-
return getMapData(this, key).has(key);
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
function mapCacheSet(key, value) {
|
|
669
|
-
var data = getMapData(this, key), size = data.size;
|
|
670
|
-
data.set(key, value);
|
|
671
|
-
this.size += data.size == size ? 0 : 1;
|
|
672
|
-
return this;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
function MapCache(entries) {
|
|
676
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
677
|
-
this.clear();
|
|
678
|
-
while (++index < length) {
|
|
679
|
-
var entry = entries[index];
|
|
680
|
-
this.set(entry[0], entry[1]);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
684
|
-
MapCache.prototype["delete"] = mapCacheDelete;
|
|
685
|
-
MapCache.prototype.get = mapCacheGet;
|
|
686
|
-
MapCache.prototype.has = mapCacheHas;
|
|
687
|
-
MapCache.prototype.set = mapCacheSet;
|
|
688
|
-
|
|
689
|
-
function toString(value) {
|
|
690
|
-
return value == null ? "" : baseToString(value);
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
function baseSlice(array, start, end) {
|
|
694
|
-
var index = -1, length = array.length;
|
|
695
|
-
if (start < 0) {
|
|
696
|
-
start = -start > length ? 0 : length + start;
|
|
697
|
-
}
|
|
698
|
-
end = end > length ? length : end;
|
|
699
|
-
if (end < 0) {
|
|
700
|
-
end += length;
|
|
701
|
-
}
|
|
702
|
-
length = start > end ? 0 : end - start >>> 0;
|
|
703
|
-
start >>>= 0;
|
|
704
|
-
var result = Array(length);
|
|
705
|
-
while (++index < length) {
|
|
706
|
-
result[index] = array[index + start];
|
|
707
|
-
}
|
|
708
|
-
return result;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
function castSlice(array, start, end) {
|
|
712
|
-
var length = array.length;
|
|
713
|
-
end = end === void 0 ? length : end;
|
|
714
|
-
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
var rsAstralRange$1 = "\\ud800-\\udfff";
|
|
718
|
-
var rsComboMarksRange$1 = "\\u0300-\\u036f";
|
|
719
|
-
var reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f";
|
|
720
|
-
var rsComboSymbolsRange$1 = "\\u20d0-\\u20ff";
|
|
721
|
-
var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
722
|
-
var rsVarRange$1 = "\\ufe0e\\ufe0f";
|
|
723
|
-
var rsZWJ$1 = "\\u200d";
|
|
724
|
-
var reHasUnicode = RegExp("[" + rsZWJ$1 + rsAstralRange$1 + rsComboRange$1 + rsVarRange$1 + "]");
|
|
725
|
-
function hasUnicode(string) {
|
|
726
|
-
return reHasUnicode.test(string);
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
function asciiToArray(string) {
|
|
730
|
-
return string.split("");
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
var rsAstralRange = "\\ud800-\\udfff";
|
|
734
|
-
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
735
|
-
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
736
|
-
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
737
|
-
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
738
|
-
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
739
|
-
var rsAstral = "[" + rsAstralRange + "]";
|
|
740
|
-
var rsCombo = "[" + rsComboRange + "]";
|
|
741
|
-
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
742
|
-
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
743
|
-
var rsNonAstral = "[^" + rsAstralRange + "]";
|
|
744
|
-
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
745
|
-
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
746
|
-
var rsZWJ = "\\u200d";
|
|
747
|
-
var reOptMod = rsModifier + "?";
|
|
748
|
-
var rsOptVar = "[" + rsVarRange + "]?";
|
|
749
|
-
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
750
|
-
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
751
|
-
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
752
|
-
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
753
|
-
function unicodeToArray(string) {
|
|
754
|
-
return string.match(reUnicode) || [];
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
function stringToArray(string) {
|
|
758
|
-
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
762
|
-
function setCacheAdd(value) {
|
|
763
|
-
this.__data__.set(value, HASH_UNDEFINED);
|
|
764
|
-
return this;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
function setCacheHas(value) {
|
|
768
|
-
return this.__data__.has(value);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
function SetCache(values) {
|
|
772
|
-
var index = -1, length = values == null ? 0 : values.length;
|
|
773
|
-
this.__data__ = new MapCache();
|
|
774
|
-
while (++index < length) {
|
|
775
|
-
this.add(values[index]);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
779
|
-
SetCache.prototype.has = setCacheHas;
|
|
780
|
-
|
|
781
|
-
function cacheHas(cache, key) {
|
|
782
|
-
return cache.has(key);
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
function isArrayLikeObject(value) {
|
|
786
|
-
return isObjectLike(value) && isArrayLike(value);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
790
|
-
function baseDifference(array, values, iteratee, comparator) {
|
|
791
|
-
var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
|
|
792
|
-
if (!length) {
|
|
793
|
-
return result;
|
|
794
|
-
}
|
|
795
|
-
if (values.length >= LARGE_ARRAY_SIZE) {
|
|
796
|
-
includes = cacheHas;
|
|
797
|
-
isCommon = false;
|
|
798
|
-
values = new SetCache(values);
|
|
799
|
-
}
|
|
800
|
-
outer:
|
|
801
|
-
while (++index < length) {
|
|
802
|
-
var value = array[index], computed = value ;
|
|
803
|
-
value = value !== 0 ? value : 0;
|
|
804
|
-
if (isCommon && computed === computed) {
|
|
805
|
-
var valuesIndex = valuesLength;
|
|
806
|
-
while (valuesIndex--) {
|
|
807
|
-
if (values[valuesIndex] === computed) {
|
|
808
|
-
continue outer;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
result.push(value);
|
|
812
|
-
} else if (!includes(values, computed, comparator)) {
|
|
813
|
-
result.push(value);
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
return result;
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
function charsEndIndex(strSymbols, chrSymbols) {
|
|
820
|
-
var index = strSymbols.length;
|
|
821
|
-
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
822
|
-
}
|
|
823
|
-
return index;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
function charsStartIndex(strSymbols, chrSymbols) {
|
|
827
|
-
var index = -1, length = strSymbols.length;
|
|
828
|
-
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
829
|
-
}
|
|
830
|
-
return index;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
function trim(string, chars, guard) {
|
|
834
|
-
string = toString(string);
|
|
835
|
-
if (string && (chars === void 0)) {
|
|
836
|
-
return baseTrim(string);
|
|
837
|
-
}
|
|
838
|
-
if (!string || !(chars = baseToString(chars))) {
|
|
839
|
-
return string;
|
|
840
|
-
}
|
|
841
|
-
var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
|
842
|
-
return castSlice(strSymbols, start, end).join("");
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
var without = baseRest(function(array, values) {
|
|
846
|
-
return isArrayLikeObject(array) ? baseDifference(array, values) : [];
|
|
847
|
-
});
|
|
848
|
-
|
|
849
|
-
var c$1 = { strictlyTwoElementsInRangeArrays: false, progressFn: null };
|
|
850
|
-
function g(t, u) {
|
|
851
|
-
if (!Array.isArray(t) || !t.length) return t;
|
|
852
|
-
let n = { ...c$1, ...u }, s, o;
|
|
853
|
-
if (n.strictlyTwoElementsInRangeArrays && !t.every((e, r) => !Array.isArray(e) || e.length !== 2 ? (s = r, o = e.length, false) : true)) throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${s}th range (${JSON.stringify(t[s], null, 4)}) has not two but ${o} elements!`);
|
|
854
|
-
if (!t.every((e, r) => !Array.isArray(e) || !Number.isInteger(e[0]) || e[0] < 0 || !Number.isInteger(e[1]) || e[1] < 0 ? (s = r, false) : true)) throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${s}th range (${JSON.stringify(t[s], null, 4)}) does not consist of only natural numbers!`);
|
|
855
|
-
let p = t.length ** 2, i = 0;
|
|
856
|
-
return Array.from(t).sort((e, r) => (n.progressFn && (i += 1, n.progressFn(Math.floor(i * 100 / p))), e[0] === r[0] ? e[1] < r[1] ? -1 : e[1] > r[1] ? 1 : 0 : e[0] < r[0] ? -1 : 1));
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
var d = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: true };
|
|
860
|
-
function b(i, t) {
|
|
861
|
-
function l(e) {
|
|
862
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
863
|
-
}
|
|
864
|
-
if (!Array.isArray(i) || !i.length) return null;
|
|
865
|
-
let s;
|
|
866
|
-
if (t) if (l(t)) {
|
|
867
|
-
if (s = { ...d, ...t }, s.progressFn && l(s.progressFn) && !Object.keys(s.progressFn).length) s.progressFn = null;
|
|
868
|
-
else if (s.progressFn && typeof s.progressFn != "function") throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn, null, 4)}`);
|
|
869
|
-
if (![1, 2, "1", "2"].includes(s.mergeType)) throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType, null, 4)}`);
|
|
870
|
-
if (typeof s.joinRangesThatTouchEdges != "boolean") throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges, null, 4)}`);
|
|
871
|
-
} else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
872
|
-
${JSON.stringify(t, null, 4)} (type ${typeof t})`);
|
|
873
|
-
else s = { ...d };
|
|
874
|
-
let g$1 = i.filter((e) => Array.isArray(e)).map((e) => [...e]).filter((e) => e[2] !== void 0 || e[0] !== e[1]), n, o, r;
|
|
875
|
-
s.progressFn ? n = g(g$1, { progressFn: (e) => {
|
|
876
|
-
r = Math.floor(e / 5), r !== o && (o = r, s.progressFn(r));
|
|
877
|
-
} }) : n = g(g$1);
|
|
878
|
-
let a = n.length - 1;
|
|
879
|
-
for (let e = a; e > 0; e--) s.progressFn && (r = Math.floor((1 - e / a) * 78) + 21, r !== o && r > o && (o = r, s.progressFn(r))), (n[e][0] <= n[e - 1][0] || !s.joinRangesThatTouchEdges && n[e][0] < n[e - 1][1] || s.joinRangesThatTouchEdges && n[e][0] <= n[e - 1][1]) && (n[e - 1][0] = Math.min(n[e][0], n[e - 1][0]), n[e - 1][1] = Math.max(n[e][1], n[e - 1][1]), n[e][2] !== void 0 && (n[e - 1][0] >= n[e][0] || n[e - 1][1] <= n[e][1]) && n[e - 1][2] !== null && (n[e][2] === null && n[e - 1][2] !== null ? n[e - 1][2] = null : n[e - 1][2] != null ? +s.mergeType == 2 && n[e - 1][0] === n[e][0] ? n[e - 1][2] = n[e][2] : n[e - 1][2] += n[e][2] : n[e - 1][2] = n[e][2]), n.splice(e, 1), e = n.length);
|
|
880
|
-
return n.length ? n : null;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
var prefix = "Invariant failed";
|
|
884
|
-
function invariant(condition, message) {
|
|
885
|
-
if (condition) {
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
var value = prefix;
|
|
889
|
-
throw new Error(value);
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
function _(s, n, r) {
|
|
893
|
-
if (arguments.length === 0) throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
|
|
894
|
-
if (typeof s != "string") throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof s}, equal to: ${JSON.stringify(s, null, 4)}`);
|
|
895
|
-
if (n && !Array.isArray(n)) throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof n}, equal to: ${JSON.stringify(n, null, 4)}`);
|
|
896
|
-
if (!n?.filter((e) => e).length) return s;
|
|
897
|
-
let i;
|
|
898
|
-
Array.isArray(n) && Number.isInteger(n[0]) && Number.isInteger(n[1]) ? i = [Array.from(n)] : i = Array.from(n);
|
|
899
|
-
i.filter((e) => e).forEach((e, a) => {
|
|
900
|
-
if (!Array.isArray(e)) throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${a}th element not an array: ${JSON.stringify(e, null, 4)}, which is ${typeof e}`);
|
|
901
|
-
if (!Number.isInteger(e[0])) {
|
|
902
|
-
if (!Number.isInteger(+e[0]) || +e[0] < 0) throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(e, null, 0)}. Its first element is not an integer, string index, but ${typeof e[0]}, equal to: ${JSON.stringify(e[0], null, 4)}.`);
|
|
903
|
-
i[a][0] = +i[a][0];
|
|
904
|
-
}
|
|
905
|
-
if (!Number.isInteger(e[1])) {
|
|
906
|
-
if (!Number.isInteger(+e[1]) || +e[1] < 0) throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${a}th element, array ${JSON.stringify(e, null, 0)}. Its second element is not an integer, string index, but ${typeof e[1]}, equal to: ${JSON.stringify(e[1], null, 4)}.`);
|
|
907
|
-
i[a][1] = +i[a][1];
|
|
908
|
-
}
|
|
909
|
-
});
|
|
910
|
-
let l = b(i, { progressFn: (e) => {
|
|
911
|
-
} });
|
|
912
|
-
invariant(l);
|
|
913
|
-
let u = l.length;
|
|
914
|
-
if (u > 0) {
|
|
915
|
-
let e = s.slice(l[u - 1][1]);
|
|
916
|
-
s = l.reduce((a, $, o, y) => {
|
|
917
|
-
let f = o === 0 ? 0 : y[o - 1][1], d = y[o][0];
|
|
918
|
-
return `${a}${s.slice(f, d)}${y[o][2] || ""}`;
|
|
919
|
-
}, ""), s += e;
|
|
920
|
-
}
|
|
921
|
-
return s;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
function D$1(l, u = 1) {
|
|
925
|
-
let g = " ";
|
|
926
|
-
function $(e) {
|
|
927
|
-
return Array.from(e).reverse().join("");
|
|
928
|
-
}
|
|
929
|
-
function p(e, r, o) {
|
|
930
|
-
let t = o ? `
|
|
931
|
-
` : "\r", i = o ? "\r" : `
|
|
932
|
-
`;
|
|
933
|
-
if (!e) return e;
|
|
934
|
-
let c = 0, s = "";
|
|
935
|
-
for (let n = 0, f = e.length; n < f; n++) (e[n] === t || e[n] === i && e[n - 1] !== t) && c++, `\r
|
|
936
|
-
`.includes(e[n]) || e[n] === g ? (e[n] === g ? s += e[n] : e[n] === t ? c <= r && (s += e[n], e[n + 1] === i && (s += e[n + 1], n++)) : e[n] === i && e?.[n - 1] !== t && c <= r && (s += e[n])) : (!e[n + 1] && !c && (s += " "));
|
|
937
|
-
return s;
|
|
938
|
-
}
|
|
939
|
-
if (typeof l == "string" && l.length) {
|
|
940
|
-
let e = 1;
|
|
941
|
-
typeof +u == "number" && Number.isInteger(+u) && +u >= 0 && (e = +u);
|
|
942
|
-
let r = "", o = "";
|
|
943
|
-
if (!l.trim()) r = l;
|
|
944
|
-
else if (!l[0].trim()) {
|
|
945
|
-
for (let t = 0, i = l.length; t < i; t++) if (l[t].trim()) {
|
|
946
|
-
r = l.slice(0, t);
|
|
947
|
-
break;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
if (l.trim() && (l.slice(-1).trim() === "" || l.slice(-1) === g)) {
|
|
951
|
-
for (let t = l.length; t--; ) if (l[t].trim()) {
|
|
952
|
-
o = l.slice(t + 1);
|
|
953
|
-
break;
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
return `${p(r, e, false)}${l.trim()}${$(p($(o), e, true))}`;
|
|
957
|
-
}
|
|
958
|
-
return l;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
var y = { mergeType: 1, progressFn: null, joinRangesThatTouchEdges: true };
|
|
962
|
-
function f(p, t) {
|
|
963
|
-
function r(e) {
|
|
964
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
965
|
-
}
|
|
966
|
-
if (!Array.isArray(p) || !p.length) return null;
|
|
967
|
-
let n;
|
|
968
|
-
if (t) if (r(t)) {
|
|
969
|
-
if (n = { ...y, ...t }, n.progressFn && r(n.progressFn) && !Object.keys(n.progressFn).length) n.progressFn = null;
|
|
970
|
-
else if (n.progressFn && typeof n.progressFn != "function") throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn, null, 4)}`);
|
|
971
|
-
if (![1, 2, "1", "2"].includes(n.mergeType)) throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType, null, 4)}`);
|
|
972
|
-
if (typeof n.joinRangesThatTouchEdges != "boolean") throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges, null, 4)}`);
|
|
973
|
-
} else throw new Error(`ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
974
|
-
${JSON.stringify(t, null, 4)} (type ${typeof t})`);
|
|
975
|
-
else n = { ...y };
|
|
976
|
-
let i = p.filter((e) => Array.isArray(e)).map((e) => [...e]).filter((e) => e[2] !== void 0 || e[0] !== e[1]), s, o, l;
|
|
977
|
-
n.progressFn ? s = g(i, { progressFn: (e) => {
|
|
978
|
-
l = Math.floor(e / 5), l !== o && (o = l, n.progressFn != null && n.progressFn(l));
|
|
979
|
-
} }) : s = g(i);
|
|
980
|
-
let d = s.length - 1;
|
|
981
|
-
for (let e = d; e > 0; e--) n.progressFn && (l = Math.floor((1 - e / d) * 78) + 21, l !== o && l > o && (o = l, n.progressFn(l))), (s[e][0] <= s[e - 1][0] || !n.joinRangesThatTouchEdges && s[e][0] < s[e - 1][1] || n.joinRangesThatTouchEdges && s[e][0] <= s[e - 1][1]) && (s[e - 1][0] = Math.min(s[e][0], s[e - 1][0]), s[e - 1][1] = Math.max(s[e][1], s[e - 1][1]), s[e][2] !== void 0 && (s[e - 1][0] >= s[e][0] || s[e - 1][1] <= s[e][1]) && s[e - 1][2] !== null && (s[e][2] === null && s[e - 1][2] !== null ? s[e - 1][2] = null : s[e - 1][2] != null ? +(n || {})?.mergeType == 2 && s[e - 1][0] === s[e][0] ? s[e - 1][2] = s[e][2] : s[e - 1][2] += s[e][2] : s[e - 1][2] = s[e][2]), s.splice(e, 1), e = s.length);
|
|
982
|
-
return s.length ? s : null;
|
|
983
|
-
}
|
|
984
|
-
var R = { limitToBeAddedWhitespace: false, limitLinebreaksCount: 1, mergeType: 1 };
|
|
985
|
-
var $ = class {
|
|
986
|
-
constructor(t) {
|
|
987
|
-
let r$1 = { ...R, ...t };
|
|
988
|
-
if (r$1.mergeType && r$1.mergeType !== 1 && r$1.mergeType !== 2) if (r(r$1.mergeType) && r$1.mergeType.trim() === "1") r$1.mergeType = 1;
|
|
989
|
-
else if (r(r$1.mergeType) && r$1.mergeType.trim() === "2") r$1.mergeType = 2;
|
|
990
|
-
else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof r$1.mergeType}", equal to ${JSON.stringify(r$1.mergeType, null, 4)}`);
|
|
991
|
-
this.opts = r$1, this.ranges = [];
|
|
992
|
-
}
|
|
993
|
-
ranges;
|
|
994
|
-
opts;
|
|
995
|
-
add(t, r$1, n) {
|
|
996
|
-
if (t == null && r$1 == null) return;
|
|
997
|
-
if (G$1(t) && !G$1(r$1)) {
|
|
998
|
-
if (Array.isArray(t)) {
|
|
999
|
-
if (t.length) {
|
|
1000
|
-
if (t.some((o) => Array.isArray(o))) {
|
|
1001
|
-
t.forEach((o) => {
|
|
1002
|
-
Array.isArray(o) && this.add(...o);
|
|
1003
|
-
});
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
t.length && q$1(+t[0]) && q$1(+t[1]) && this.add(...t);
|
|
1007
|
-
}
|
|
1008
|
-
return;
|
|
1009
|
-
}
|
|
1010
|
-
throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(t, null, 0)}) but second-one, "to" is not (${JSON.stringify(r$1, null, 0)})`);
|
|
1011
|
-
} else if (!G$1(t) && G$1(r$1)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(r$1, null, 0)}) but first-one, "from" is not (${JSON.stringify(t, null, 0)})`);
|
|
1012
|
-
let i = +t, s = +r$1;
|
|
1013
|
-
if (q$1(i) && q$1(s)) {
|
|
1014
|
-
if (G$1(n) && !r(n) && !W(n)) throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof n}, equal to:
|
|
1015
|
-
${JSON.stringify(n, null, 4)}`);
|
|
1016
|
-
if (G$1(this.ranges) && Array.isArray(this.last()) && i === this.last()[1]) {
|
|
1017
|
-
if (this.last()[1] = s, this.last()[2], this.last()[2] !== null && G$1(n)) {
|
|
1018
|
-
let o = this.last()[2] && this.last()[2].length && (!this.opts?.mergeType || this.opts.mergeType === 1) ? `${this.last()[2]}${n}` : n;
|
|
1019
|
-
this.opts.limitToBeAddedWhitespace && (o = D$1(o, this.opts.limitLinebreaksCount)), r(o) && !o.length || (this.last()[2] = o);
|
|
1020
|
-
}
|
|
1021
|
-
} else {
|
|
1022
|
-
this.ranges || (this.ranges = []);
|
|
1023
|
-
let o = n !== void 0 && !(r(n) && !n.length) ? [i, s, n && this.opts.limitToBeAddedWhitespace ? D$1(n, this.opts.limitLinebreaksCount) : n] : [i, s];
|
|
1024
|
-
this.ranges.push(o);
|
|
1025
|
-
}
|
|
1026
|
-
} else throw q$1(i) && i >= 0 ? new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof s}" equal to: ${JSON.stringify(s, null, 4)}`) : new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof i}" equal to: ${JSON.stringify(i, null, 4)}`);
|
|
1027
|
-
}
|
|
1028
|
-
push(t, r, n) {
|
|
1029
|
-
this.add(t, r, n);
|
|
1030
|
-
}
|
|
1031
|
-
current() {
|
|
1032
|
-
return Array.isArray(this.ranges) && this.ranges.length ? (this.ranges = f(this.ranges, { mergeType: this.opts.mergeType }), this.ranges && this.opts.limitToBeAddedWhitespace ? this.ranges.map((t) => G$1(t[2]) ? [t[0], t[1], D$1(t[2], this.opts.limitLinebreaksCount)] : t) : this.ranges) : null;
|
|
1033
|
-
}
|
|
1034
|
-
wipe() {
|
|
1035
|
-
this.ranges = [];
|
|
1036
|
-
}
|
|
1037
|
-
replace(t) {
|
|
1038
|
-
if (Array.isArray(t) && t.length) if (Array.isArray(t[0]) && q$1(t[0][0])) this.ranges = Array.from(t);
|
|
1039
|
-
else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(t[0], null, 4)} should be an array and its first element should be an integer, a string index.`);
|
|
1040
|
-
else this.ranges = [];
|
|
1041
|
-
}
|
|
1042
|
-
last() {
|
|
1043
|
-
return Array.isArray(this.ranges) && this.ranges.length ? this.ranges[this.ranges.length - 1] : null;
|
|
1044
|
-
}
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
I();
|
|
1048
|
-
var c = " ";
|
|
1049
|
-
function D({ str: n, idx: e = 0, stopAtNewlines: l = false, stopAtRawNbsp: o = false }) {
|
|
1050
|
-
if (typeof n != "string" || !n.length || ((!e || typeof e != "number") && (e = 0), !n[e + 1])) return null;
|
|
1051
|
-
if (n[e + 1] && (n[e + 1].trim() || l && `
|
|
1052
|
-
\r`.includes(n[e + 1]) || o && n[e + 1] === c)) return e + 1;
|
|
1053
|
-
if (n[e + 2] && (n[e + 2].trim() || l && `
|
|
1054
|
-
\r`.includes(n[e + 2]) || o && n[e + 2] === c)) return e + 2;
|
|
1055
|
-
for (let t = e + 1, m = n.length; t < m; t++) if (n[t].trim() || l && `
|
|
1056
|
-
\r`.includes(n[t]) || o && n[t] === c) return t;
|
|
1057
|
-
return null;
|
|
1058
|
-
}
|
|
1059
|
-
function E(n, e = 0) {
|
|
1060
|
-
return D({ str: n, idx: e, stopAtNewlines: false, stopAtRawNbsp: false });
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
function ee(t) {
|
|
1064
|
-
return /[-_A-Za-z0-9]/.test(t);
|
|
1065
|
-
}
|
|
1066
|
-
function G(t, m) {
|
|
1067
|
-
if (!t) return [];
|
|
1068
|
-
if (Array.isArray(t)) return t.filter((y) => typeof y == "string" && y.trim());
|
|
1069
|
-
if (typeof t == "string") return t.trim() ? [t] : [];
|
|
1070
|
-
throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_05] ${m} must be array containing zero or more strings or something falsey. Currently it's equal to: ${t}, that a type of ${typeof t}.`);
|
|
1071
|
-
}
|
|
1072
|
-
function j(t, m, y, c) {
|
|
1073
|
-
for (let f = m, b = t.length; f < b; f++) {
|
|
1074
|
-
if (t.startsWith(y, f)) return true;
|
|
1075
|
-
if (t.startsWith(c, f)) return false;
|
|
1076
|
-
}
|
|
1077
|
-
return false;
|
|
1078
|
-
}
|
|
1079
|
-
function Y(t, m, y) {
|
|
1080
|
-
!!t?.quotes?.value && !j(m, y + 1, t.quotes.value, ">"); !j(m, t?.quotes?.next - 1, t?.quotes?.value, ">");
|
|
1081
|
-
return !t?.quotes || !j(m, y + 1, t.quotes.value, ">") && t?.quotes?.next !== -1 && j(m, t?.quotes?.next - 1, t?.quotes?.value, ">");
|
|
1082
|
-
}
|
|
1083
|
-
function ne(t, m) {
|
|
1084
|
-
return (m.match(new RegExp(t, "g")) || []).length;
|
|
1085
|
-
}
|
|
1086
|
-
var P = /* @__PURE__ */ new Set(["!doctype", "abbr", "address", "area", "article", "aside", "audio", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "doctype", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "param", "picture", "pre", "progress", "rb", "rp", "rt", "rtc", "ruby", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "ul", "var", "video", "wbr", "xml"]);
|
|
1087
|
-
var x = /* @__PURE__ */ new Set(["a", "b", "i", "p", "q", "s", "u"]);
|
|
1088
|
-
var q = /* @__PURE__ */ new Set([".", ",", ";", "!", "?"]);
|
|
1089
|
-
var Q = /* @__PURE__ */ new Set([".", ",", "?", ";", ")", "…", '"', "»"]);
|
|
1090
|
-
var te = /* @__PURE__ */ new Set(["a", "abbr", "acronym", "audio", "b", "bdi", "bdo", "big", "button", "canvas", "cite", "code", "data", "datalist", "del", "dfn", "em", "embed", "i", "iframe", "input", "ins", "kbd", "label", "map", "mark", "meter", "noscript", "object", "output", "picture", "progress", "q", "ruby", "s", "samp", "select", "slot", "small", "span", "strong", "sub", "sup", "svg", "template", "textarea", "time", "u", "tt", "var", "video", "wbr"]);
|
|
1091
|
-
var le = "13.5.0";
|
|
1092
|
-
var Ne = le;
|
|
1093
|
-
var ae = { ignoreTags: [], ignoreTagsWithTheirContents: [], onlyStripTags: [], stripTogetherWithTheirContents: ["script", "style", "xml"], skipHtmlDecoding: false, trimOnlySpaces: false, stripRecognisedHTMLOnly: false, dumpLinkHrefsNearby: { enabled: false, putOnNewLine: false, wrapHeads: "", wrapTails: "" }, ignoreIndentations: false, cb: null, reportProgressFunc: null, reportProgressFuncFrom: 0, reportProgressFuncTo: 100 };
|
|
1094
|
-
function fe(t, m) {
|
|
1095
|
-
let y = Date.now(), c = [], f = [], b = [], $$1 = [], n = {};
|
|
1096
|
-
function re() {
|
|
1097
|
-
n = { attributes: [] };
|
|
1098
|
-
}
|
|
1099
|
-
re();
|
|
1100
|
-
let V = null, w = null, N = null, J = false, o = {}, d = { tagName: "", hrefValue: "", openingTagEnds: void 0 }, E$1 = "", C = false, B = null, F = true;
|
|
1101
|
-
function v$1(e, s, a) {
|
|
1102
|
-
if (Array.isArray(s.stripTogetherWithTheirContents) && (s.stripTogetherWithTheirContents.includes(n.name) || s.stripTogetherWithTheirContents.includes("*"))) if (n.slashPresent && Array.isArray(c) && c.some((i) => i.name === n.name)) {
|
|
1103
|
-
for (let i = c.length; i--; ) if (c[i].name === n.name) {
|
|
1104
|
-
$$1 = $$1.filter(([u, p]) => (u < c[i].lastOpeningBracketAt || u >= e + 1) && (p <= c[i].lastOpeningBracketAt || p > e + 1));
|
|
1105
|
-
let g = e + 1;
|
|
1106
|
-
n.lastClosingBracketAt && (g = n.lastClosingBracketAt + 1), $$1.push([c[i].lastOpeningBracketAt, g]), Q.has(t[e]) && s.cb ? s.cb({ tag: n, deleteFrom: c[i].lastOpeningBracketAt, deleteTo: e + 1, insert: null, rangesArr: a, proposedReturn: [c[i].lastOpeningBracketAt, e, null] }) : s.cb && s.cb({ tag: n, deleteFrom: c[i].lastOpeningBracketAt, deleteTo: e, insert: "", rangesArr: a, proposedReturn: [c[i].lastOpeningBracketAt, e, ""] }), c.splice(i, 1);
|
|
1107
|
-
break;
|
|
1108
|
-
}
|
|
1109
|
-
} else n.slashPresent || c.push(n);
|
|
1110
|
-
else Array.isArray(s.ignoreTagsWithTheirContents) && M(e, s, n) && (F = false);
|
|
1111
|
-
}
|
|
1112
|
-
function L(e, s, a, i, g, u) {
|
|
1113
|
-
if (Array.isArray(r.current()) && typeof a == "number" && r.current()[0][0] === 0 && r.current()[0][1] >= a) return "";
|
|
1114
|
-
if (t.length === i && u && !l?.dumpLinkHrefsNearby?.enabled) return null;
|
|
1115
|
-
let p = "";
|
|
1116
|
-
if (Number.isInteger(a) && a < g && (p += e.slice(a, g)), Number.isInteger(i) && i > u + 1) {
|
|
1117
|
-
let D = e.slice(u + 1, i);
|
|
1118
|
-
i && !E(t, i - 1) && (D = D.trimEnd()), D.includes(`
|
|
1119
|
-
`) && S(i, e) ? p += " " : p += D;
|
|
1120
|
-
}
|
|
1121
|
-
let W = !Q.has(e[s]), Z = e[i - 1] !== ">" || !e[a].trim(), X = !['"', "("].includes(e[g - 1]), ge = ![";", ".", ":", "!"].includes(e[s]);
|
|
1122
|
-
if ((W || Z && X && ge) && (Z || X) && e[s] !== "!" && (!te.has(n.name) || typeof a == "number" && a < g || typeof i == "number" && i > u + 1)) {
|
|
1123
|
-
let D = p.match(/\n/g);
|
|
1124
|
-
return Array.isArray(D) && D.length ? D.length === 1 ? `
|
|
1125
|
-
` : D.length === 2 ? `
|
|
1126
|
-
|
|
1127
|
-
` : `
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
` : " ";
|
|
1131
|
-
}
|
|
1132
|
-
return "";
|
|
1133
|
-
}
|
|
1134
|
-
function U(e, s) {
|
|
1135
|
-
if (e.dumpLinkHrefsNearby?.enabled && d.tagName && d.tagName === n.name && n.lastOpeningBracketAt && (d.openingTagEnds && n.lastOpeningBracketAt > d.openingTagEnds || !d.openingTagEnds) && (C = true), C) {
|
|
1136
|
-
let a = e.dumpLinkHrefsNearby?.putOnNewLine ? `
|
|
1137
|
-
|
|
1138
|
-
` : "";
|
|
1139
|
-
E$1 = `${a}${d.hrefValue}`, (typeof s != "number" || E(t, s - 1)) && (E$1 += a);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
function S(e, s) {
|
|
1143
|
-
return s ? s[e] === "<" && s[e + 1] !== "%" : t[e] === "<" && t[e + 1] !== "%";
|
|
1144
|
-
}
|
|
1145
|
-
function A(e) {
|
|
1146
|
-
return t[e] === ">" && t[e - 1] !== "%";
|
|
1147
|
-
}
|
|
1148
|
-
function M(e, s, a) {
|
|
1149
|
-
if (s.ignoreTagsWithTheirContents.includes("*")) return true;
|
|
1150
|
-
let i = t.indexOf(`<${a.name}`, e), g = t.indexOf(`</${a.name}`, e);
|
|
1151
|
-
return !a.slashPresent && g === -1 || a.slashPresent && !f.some((u) => u.name === a.name) || g > -1 && i > -1 && i < g ? false : s.ignoreTagsWithTheirContents.includes(a.name);
|
|
1152
|
-
}
|
|
1153
|
-
if (typeof t != "string") throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_01] Input must be string! Currently it's: ${(typeof t).toLowerCase()}, equal to:
|
|
1154
|
-
${JSON.stringify(t, null, 4)}`);
|
|
1155
|
-
if (m) if (u(m)) {
|
|
1156
|
-
if (m.reportProgressFunc && typeof m.reportProgressFunc != "function") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_03] The Optional Options Object's key reportProgressFunc, callback function, should be a function but it was given as type ${typeof m.reportProgressFunc}, equal to ${JSON.stringify(m.reportProgressFunc, null, 4)}`);
|
|
1157
|
-
if (typeof m.dumpLinkHrefsNearby == "boolean" && m.dumpLinkHrefsNearby != null) throw new Error(`string-strip-html/stripHtml(): [THROW_ID_04] The Optional Options Object's key should be a plain object but it was given as type ${typeof m.dumpLinkHrefsNearby}, equal to ${JSON.stringify(m.dumpLinkHrefsNearby, null, 4)}`);
|
|
1158
|
-
} else throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_02] Optional Options Object must be a plain object! Currently it's: ${(typeof m).toLowerCase()}, equal to:
|
|
1159
|
-
${JSON.stringify(m, null, 4)}`);
|
|
1160
|
-
function _$1() {
|
|
1161
|
-
C && (d = { tagName: "", hrefValue: "", openingTagEnds: void 0 }, C = false);
|
|
1162
|
-
}
|
|
1163
|
-
let l = { ...ae, ...m, dumpLinkHrefsNearby: Object.assign({}, ae.dumpLinkHrefsNearby, m?.dumpLinkHrefsNearby) };
|
|
1164
|
-
if (v(l, "returnRangesOnly")) throw new TypeError("string-strip-html/stripHtml(): [THROW_ID_05] The Optional Options Object's key returnRangesOnly has been removed from the API since v.5 release.");
|
|
1165
|
-
if (l.reportProgressFunc) {
|
|
1166
|
-
if (typeof l.reportProgressFuncFrom != "number") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_06] The Optional Options Object's key reportProgressFuncFrom, callback function's "from" range, should be a number but it was given as type ${typeof l.reportProgressFuncFrom}, equal to ${JSON.stringify(l.reportProgressFuncFrom, null, 4)}`);
|
|
1167
|
-
if (typeof l.reportProgressFuncTo != "number") throw new Error(`string-strip-html/stripHtml(): [THROW_ID_07] The Optional Options Object's key reportProgressFuncTo, callback function's "to" range, should be a number but it was given as type ${typeof l.reportProgressFuncTo}, equal to ${JSON.stringify(l.reportProgressFuncTo, null, 4)}`);
|
|
1168
|
-
}
|
|
1169
|
-
l.ignoreTags = G(l.ignoreTags, "resolvedOpts.ignoreTags"), l.onlyStripTags = G(l.onlyStripTags, "resolvedOpts.onlyStripTags");
|
|
1170
|
-
let z = !!l.onlyStripTags.length;
|
|
1171
|
-
l.onlyStripTags.length && l.ignoreTags.length && (l.onlyStripTags = without(l.onlyStripTags, ...l.ignoreTags)), l.stripTogetherWithTheirContents ? typeof l.stripTogetherWithTheirContents == "string" && l.stripTogetherWithTheirContents.length && (l.stripTogetherWithTheirContents = [l.stripTogetherWithTheirContents]) : l.stripTogetherWithTheirContents = [];
|
|
1172
|
-
let I = {};
|
|
1173
|
-
if (l.stripTogetherWithTheirContents && Array.isArray(l.stripTogetherWithTheirContents) && l.stripTogetherWithTheirContents.length && !l.stripTogetherWithTheirContents.every((e, s) => typeof e != "string" ? (I.el = e, I.i = s, false) : true)) throw new TypeError(`string-strip-html/stripHtml(): [THROW_ID_08] Optional Options Object's key stripTogetherWithTheirContents was set to contain not just string elements! For example, element at index ${I.i} has a value ${I.el} which is not string but ${(typeof I.el).toLowerCase()}.`);
|
|
1174
|
-
l.cb || (l.cb = ({ rangesArr: e, proposedReturn: s }) => {
|
|
1175
|
-
s && e.push(...s);
|
|
1176
|
-
});
|
|
1177
|
-
let r = new $({ limitToBeAddedWhitespace: true, limitLinebreaksCount: 2 });
|
|
1178
|
-
if (!l.skipHtmlDecoding) for (; t !== decode(t, { scope: "strict" }); ) t = decode(t, { scope: "strict" });
|
|
1179
|
-
let R = false, k = false, H = 0, K = 0, h = t.length, ue = Math.floor(h / 2);
|
|
1180
|
-
for (let e = 0; e < h; e++) {
|
|
1181
|
-
if (l.reportProgressFunc && (h > 1e3 && h < 2e3 ? e === ue && l.reportProgressFunc(Math.floor((l.reportProgressFuncTo - l.reportProgressFuncFrom) / 2)) : h >= 2e3 && (H = l.reportProgressFuncFrom + Math.floor(e / h * (l.reportProgressFuncTo - l.reportProgressFuncFrom)), H !== K && (K = H, l.reportProgressFunc(H)))), Object.keys(n).length > 1 && n.lastClosingBracketAt && n.lastClosingBracketAt < e && t[e] !== " " && B === null && (B = e), !R && t[e] === "%" && t[e - 1] === "{" && t.includes("%}", e + 1)) {
|
|
1182
|
-
N = null;
|
|
1183
|
-
let s = t.indexOf("%}", e) - 1;
|
|
1184
|
-
if (s > e) {
|
|
1185
|
-
e = s;
|
|
1186
|
-
continue;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
if (!R && A(e) && (!n || Object.keys(n).length < 2) && e > 1) {
|
|
1190
|
-
for (let s = e; s--; ) if (t[s - 1] === void 0 || A(s)) {
|
|
1191
|
-
let a = t[s - 1] === void 0 ? s : s + 1, i = t.slice(a, e + 1) || "";
|
|
1192
|
-
if ((i.includes("/>") || i.includes("/ >") || i.includes('="') || i.includes("='")) && t !== `<${trim(i.trim(), "/>")}>` && [...P].some((g) => trim(i.trim().split(/\s+/).filter((u) => u.trim()).filter((u, p) => p === 0), "/>").toLowerCase() === g) && fe(`<${i.trim()}>`, l).result === "") {
|
|
1193
|
-
(!b.length || b[b.length - 1][0] !== n.lastOpeningBracketAt) && b.push([a, e + 1]), (!$$1.length || $$1[$$1.length - 1][0] !== n.lastOpeningBracketAt) && $$1.push([a, e + 1]);
|
|
1194
|
-
let g = L(t, e, a, e + 1, a, e + 1), u = e + 1;
|
|
1195
|
-
if (t[u] && !t[u].trim()) {
|
|
1196
|
-
for (let p = u; p < h; p++) if (t[p].trim()) {
|
|
1197
|
-
u = p;
|
|
1198
|
-
break;
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
l.cb({ tag: n, deleteFrom: a, deleteTo: u, insert: g, rangesArr: r, proposedReturn: [a, u, g] });
|
|
1202
|
-
}
|
|
1203
|
-
break;
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
if (!k && t[e] === "/" && !n.quotes?.value && Number.isInteger(n.lastOpeningBracketAt) && !Number.isInteger(n.lastClosingBracketAt) && (n.slashPresent = e), t[e] === '"' || t[e] === "'") if (!k && n.nameStarts && n?.quotes?.value === t[e]) if (o.valueStarts === void 0) o = {}, delete n.quotes;
|
|
1207
|
-
else {
|
|
1208
|
-
o.valueEnds = e, o.value = t.slice(o.valueStarts, e), n.attributes.push(o), o = {}, delete n.quotes;
|
|
1209
|
-
let s;
|
|
1210
|
-
l.dumpLinkHrefsNearby?.enabled && !c.length && n.attributes.some((a) => {
|
|
1211
|
-
if (typeof a.name == "string" && a.name.toLowerCase() === "href") return s = `${l.dumpLinkHrefsNearby?.wrapHeads || ""}${a.value}${l.dumpLinkHrefsNearby?.wrapTails || ""}`, true;
|
|
1212
|
-
}) && (d = { tagName: n.name, hrefValue: s, openingTagEnds: void 0 });
|
|
1213
|
-
}
|
|
1214
|
-
else !k && !n.quotes && n.nameStarts && (n.quotes = {}, n.quotes.value = t[e], n.quotes.start = e, n.quotes.next = t.indexOf(t[e], e + 1), o.nameStarts && o.nameEnds && o.nameEnds < e && o.nameStarts < e && !o.valueStarts && (o.name = t.slice(o.nameStarts, o.nameEnds)));
|
|
1215
|
-
if (n.nameStarts !== void 0 && n.nameEnds === void 0 && (!t[e].trim() || !ee(t[e]))) {
|
|
1216
|
-
if (n.nameEnds = e, n.name = t.slice(n.nameStarts, n.nameEnds + (!A(e) && t[e] !== "/" && t[e + 1] === void 0 ? 1 : 0)), t[n.nameStarts - 1] !== "!" && !n.name.replace(/-/g, "").length || /^\d+$/.test(n.name[0])) {
|
|
1217
|
-
n = {};
|
|
1218
|
-
continue;
|
|
1219
|
-
}
|
|
1220
|
-
if (typeof n.name == "string" && n.name.toLowerCase() === "doctype" && (k = true), S(e)) {
|
|
1221
|
-
U(l);
|
|
1222
|
-
let s = L(t, e, n.leftOuterWhitespace, e, n.lastOpeningBracketAt, e);
|
|
1223
|
-
(l.stripTogetherWithTheirContents.includes(n.name) || l.stripTogetherWithTheirContents.includes("*")) && ($$1 = $$1.filter(([a, i]) => !(a === n.leftOuterWhitespace && i === e))), l.cb({ tag: n, deleteFrom: n.leftOuterWhitespace, deleteTo: e, insert: `${s}${E$1}${s}`, rangesArr: r, proposedReturn: [n.leftOuterWhitespace, e, `${s}${E$1}${s}`] }), _$1(), v$1(e, l, r);
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
if (n.quotes?.start && n.quotes.start < e && !n.quotes.end && o.nameEnds && o.equalsAt && !o.valueStarts && (o.valueStarts = e), !n.quotes && o.nameEnds && t[e] === "=" && !o.valueStarts && !o.equalsAt && (o.equalsAt = e), !n.quotes && o.nameStarts && o.nameEnds && !o.valueStarts && t[e].trim() && t[e] !== "=" && (n.attributes.push(o), o = {}), !n.quotes && o.nameStarts && !o.nameEnds && (k && `'"`.includes(t[o.nameStarts]) ? o.nameStarts < e && t[e] === t[o.nameStarts] && (o.nameEnds = e + 1, o.name = t.slice(o.nameStarts, o.nameEnds)) : t[e].trim() ? t[e] === "=" ? o.equalsAt || (o.nameEnds = e, o.equalsAt = e, o.name = t.slice(o.nameStarts, o.nameEnds)) : t[e] === "/" || A(e) ? (o.nameEnds = e, o.name = t.slice(o.nameStarts, o.nameEnds), n.attributes.push(o), o = {}) : S(e) && (o.nameEnds = e, o.name = t.slice(o.nameStarts, o.nameEnds), n.attributes.push(o), o = {}) : (o.nameEnds = e, o.name = t.slice(o.nameStarts, o.nameEnds))), !n.quotes && n.nameEnds < e && !t[e - 1].trim() && t[e].trim() && !"<>/!".includes(t[e]) && !o.nameStarts && !n.lastClosingBracketAt && (o.nameStarts = e), n.lastOpeningBracketAt !== null && n.lastOpeningBracketAt < e && t[e] === "/" && n.onlyPlausible && (n.onlyPlausible = false), n.lastOpeningBracketAt !== null && n.lastOpeningBracketAt < e && t[e] !== "/" && (n.onlyPlausible === void 0 && ((!t[e].trim() || S(e)) && !n.slashPresent ? n.onlyPlausible = true : n.onlyPlausible = false), t[e].trim() && n.nameStarts === void 0 && !S(e) && t[e] !== "/" && !A(e) && t[e] !== "!" && (n.nameStarts = e, n.nameContainsLetters = false)), n.nameStarts && !n.quotes && typeof t[e] == "string" && t[e].toLowerCase() !== t[e].toUpperCase() && (n.nameContainsLetters = true), A(e) && (Y(n, t, e) || n.quotes.value && typeof n.lastOpeningBracketAt == "number" && ne(n.quotes.value, t.slice(n.lastOpeningBracketAt, e)) % 2 === 1 && !t.slice(n.lastOpeningBracketAt + 1, e).includes("<") && !t.slice(n.lastOpeningBracketAt + 1, e).includes(">")) && n.lastOpeningBracketAt !== void 0 && (n.lastClosingBracketAt = e, B = null, Object.keys(o).length && (n.attributes.push(o), o = {}), l.dumpLinkHrefsNearby?.enabled && d.tagName && !d.openingTagEnds && (d.openingTagEnds = e)), (!k || t[e] === ">") && n.lastOpeningBracketAt !== void 0) {
|
|
1227
|
-
if (n.lastClosingBracketAt === void 0) {
|
|
1228
|
-
if (n.lastOpeningBracketAt < e && !S(e) && (t[e + 1] === void 0 || S(e + 1) && !n?.quotes?.value) && n.nameContainsLetters && typeof n.nameStarts == "number") {
|
|
1229
|
-
if (n.name = t.slice(n.nameStarts, n.nameEnds || e + 1).toLowerCase(), (!b.length || b[b.length - 1][0] !== n.lastOpeningBracketAt) && b.push([n.lastOpeningBracketAt, e + 1]), l.ignoreTags.includes(n.name) || M(e, l, n) || !P.has(n.name) && (n.onlyPlausible || l.stripRecognisedHTMLOnly)) {
|
|
1230
|
-
n = {}, o = {};
|
|
1231
|
-
continue;
|
|
1232
|
-
}
|
|
1233
|
-
if ((P.has(n.name) || x.has(n.name)) && (n.onlyPlausible === false || n.onlyPlausible === true && n.attributes.length) || t[e + 1] === void 0) {
|
|
1234
|
-
U(l);
|
|
1235
|
-
let s = L(t, e, n.leftOuterWhitespace, e + 1, n.lastOpeningBracketAt, n.lastClosingBracketAt);
|
|
1236
|
-
R && n.name === "script" && n.slashPresent && (R = false);
|
|
1237
|
-
let a;
|
|
1238
|
-
s === null || E$1 === null ? a = null : a = `${s}${E$1}${s}`, l.cb({ tag: n, deleteFrom: n.leftOuterWhitespace, deleteTo: e + 1, insert: a, rangesArr: r, proposedReturn: [n.leftOuterWhitespace, e + 1, a] }), _$1(), v$1(e, l, r);
|
|
1239
|
-
}
|
|
1240
|
-
if (!$$1.length || $$1[$$1.length - 1][0] !== n.lastOpeningBracketAt && $$1[$$1.length - 1][1] !== e + 1) if (l.stripTogetherWithTheirContents.includes(n.name) || l.stripTogetherWithTheirContents.includes("*")) {
|
|
1241
|
-
let s;
|
|
1242
|
-
for (let a = c.length; a--; ) c[a].name === n.name && (s = c[a]);
|
|
1243
|
-
s ? ($$1 = $$1.filter(([a]) => a !== s.lastOpeningBracketAt), $$1.push([s.lastOpeningBracketAt, e + 1])) : $$1.push([n.lastOpeningBracketAt, e + 1]);
|
|
1244
|
-
} else $$1.push([n.lastOpeningBracketAt, e + 1]);
|
|
1245
|
-
}
|
|
1246
|
-
} else if (e > n.lastClosingBracketAt && t[e].trim() || t[e + 1] === void 0 || l.ignoreIndentations && `\r
|
|
1247
|
-
`.includes(t[e])) {
|
|
1248
|
-
let s = n.lastClosingBracketAt === e ? e + 1 : e;
|
|
1249
|
-
l.trimOnlySpaces && s === h - 1 && B !== null && B < e && (s = B), (!b.length || b[b.length - 1][0] !== n.lastOpeningBracketAt) && b.push([n.lastOpeningBracketAt, n.lastClosingBracketAt + 1]);
|
|
1250
|
-
let a = l.ignoreTags.includes(n.name), i = M(e, l, n);
|
|
1251
|
-
if (!F || l.stripRecognisedHTMLOnly && typeof n.name == "string" && !P.has(n.name.toLowerCase()) && !x.has(n.name.toLowerCase()) || !z && (a || i) || z && !l.onlyStripTags.includes(n.name) || l.ignoreTagsWithTheirContents.includes(n.name)) {
|
|
1252
|
-
if (i) if (n.slashPresent) {
|
|
1253
|
-
for (let g = f.length; g--; ) if (f[g].name === n.name) {
|
|
1254
|
-
f.splice(g, 1);
|
|
1255
|
-
break;
|
|
1256
|
-
}
|
|
1257
|
-
f.length || (F = true);
|
|
1258
|
-
} else F && (F = false), f.push(n);
|
|
1259
|
-
l.cb({ tag: n, deleteFrom: null, deleteTo: null, insert: null, rangesArr: r, proposedReturn: null }), n = {}, o = {};
|
|
1260
|
-
} else if (!n.onlyPlausible || n.attributes.length === 0 && n.name && (P.has(n.name.toLowerCase()) || x.has(n.name.toLowerCase())) || n.attributes?.some((g) => g.equalsAt)) {
|
|
1261
|
-
(!$$1.length || $$1[$$1.length - 1][0] !== n.lastOpeningBracketAt) && $$1.push([n.lastOpeningBracketAt, n.lastClosingBracketAt + 1]);
|
|
1262
|
-
let g = L(t, e, n.leftOuterWhitespace, s, n.lastOpeningBracketAt, n.lastClosingBracketAt);
|
|
1263
|
-
E$1 = "", C = false, U(l, s);
|
|
1264
|
-
let u;
|
|
1265
|
-
typeof E$1 == "string" && E$1.length ? (u = `${g}${E$1}${g === `
|
|
1266
|
-
|
|
1267
|
-
` ? `
|
|
1268
|
-
` : g}`, s === n.lastClosingBracketAt + 1 && (!t[s] || !q.has(t[s])) && (u += " "), n.leftOuterWhitespace === n.lastOpeningBracketAt && r.last() && r.last()[1] < n.lastOpeningBracketAt && (!l?.dumpLinkHrefsNearby?.putOnNewLine || !q.has(t[s])) && (u = " " + u)) : u = g, u !== null && (n.leftOuterWhitespace === 0 || !E(t, s - 1)) && (!l.dumpLinkHrefsNearby?.enabled || n.name !== "a") && (u = void 0);
|
|
1269
|
-
let p = 0;
|
|
1270
|
-
if (C && q.has(t[s])) {
|
|
1271
|
-
l.dumpLinkHrefsNearby?.putOnNewLine && (u = `${t[s]}${u || ""}`);
|
|
1272
|
-
let W = E(t, s);
|
|
1273
|
-
W && u?.endsWith(`
|
|
1274
|
-
`) ? p += W - e : (!W || W > e) && p++;
|
|
1275
|
-
}
|
|
1276
|
-
l.cb({ tag: n, deleteFrom: n.leftOuterWhitespace, deleteTo: s + p, insert: u, rangesArr: r, proposedReturn: [n.leftOuterWhitespace, s + p, u] }), _$1(), v$1(e, l, r);
|
|
1277
|
-
} else n = {};
|
|
1278
|
-
A(e) || (n = {});
|
|
1279
|
-
}
|
|
1280
|
-
k && (k = false);
|
|
1281
|
-
}
|
|
1282
|
-
if ((!R || t[e] === "<" && E(t, E(t, e)) && t[E(t, e)] === "/" && t.startsWith("script", E(t, E(t, e)))) && S(e) && !S(e - 1) && !`'"`.includes(t[e + 1]) && (!`'"`.includes(t[e + 2]) || /\w/.test(t[e + 1])) && !(t[e + 1] === "c" && t[e + 2] === ":") && !(t[e + 1] === "f" && t[e + 2] === "m" && t[e + 3] === "t" && t[e + 4] === ":") && !(t[e + 1] === "s" && t[e + 2] === "q" && t[e + 3] === "l" && t[e + 4] === ":") && !(t[e + 1] === "x" && t[e + 2] === ":") && !(t[e + 1] === "f" && t[e + 2] === "n" && t[e + 3] === ":") && Y(n, t, e)) {
|
|
1283
|
-
if (A(E(t, e))) continue;
|
|
1284
|
-
if (n.nameEnds && n.nameEnds < e && !n.lastClosingBracketAt && (n.onlyPlausible === true && n.attributes?.length || n.onlyPlausible === false)) {
|
|
1285
|
-
let s = L(t, e, n.leftOuterWhitespace, e, n.lastOpeningBracketAt, e);
|
|
1286
|
-
l.cb({ tag: n, deleteFrom: n.leftOuterWhitespace, deleteTo: e, insert: s, rangesArr: r, proposedReturn: [n.leftOuterWhitespace, e, s] }), v$1(e, l, r), n = {}, o = {};
|
|
1287
|
-
}
|
|
1288
|
-
if (n.lastOpeningBracketAt !== void 0 && n.onlyPlausible && n.name && !n.quotes && (n.lastOpeningBracketAt = void 0, n.name = void 0, n.onlyPlausible = false), (n.lastOpeningBracketAt === void 0 || !n.onlyPlausible) && !n.quotes && (n.lastOpeningBracketAt = e, n.slashPresent = false, n.attributes = [], V === null ? n.leftOuterWhitespace = e : l.trimOnlySpaces && V === 0 ? n.leftOuterWhitespace = w || e : n.leftOuterWhitespace = V, `${t[e + 1]}${t[e + 2]}${t[e + 3]}` == "!--" || `${t[e + 1]}${t[e + 2]}${t[e + 3]}${t[e + 4]}${t[e + 5]}${t[e + 6]}${t[e + 7]}${t[e + 8]}` == "![CDATA[")) {
|
|
1289
|
-
let s = true;
|
|
1290
|
-
t[e + 2] === "-" && (s = false);
|
|
1291
|
-
let a;
|
|
1292
|
-
for (let i = e; i < h; i++) if ((!a && s && `${t[i - 2]}${t[i - 1]}${t[i]}` == "]]>" || !s && `${t[i - 2]}${t[i - 1]}${t[i]}` == "-->") && (a = i), a && (a < i && t[i].trim() || t[i + 1] === void 0)) {
|
|
1293
|
-
let g = i;
|
|
1294
|
-
(t[i + 1] === void 0 && !t[i].trim() || t[i] === ">") && (g += 1), (!b.length || b[b.length - 1][0] !== n.lastOpeningBracketAt) && b.push([n.lastOpeningBracketAt, a + 1]), (!$$1.length || $$1[$$1.length - 1][0] !== n.lastOpeningBracketAt) && $$1.push([n.lastOpeningBracketAt, a + 1]);
|
|
1295
|
-
let u = L(t, i, n.leftOuterWhitespace, g, n.lastOpeningBracketAt, a);
|
|
1296
|
-
l.cb({ tag: n, deleteFrom: n.leftOuterWhitespace, deleteTo: g, insert: u, rangesArr: r, proposedReturn: [n.leftOuterWhitespace, g, u] }), e = i - 1, t[i] === ">" && (e = i), n = {}, o = {};
|
|
1297
|
-
break;
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
!t[e].trim() || t[e].charCodeAt(0) === 847 ? (V === null && (V = e, n.lastOpeningBracketAt !== void 0 && n.lastOpeningBracketAt < e && n.nameStarts && n.nameStarts < n.lastOpeningBracketAt && e === n.lastOpeningBracketAt + 1 && !c.some((s) => s.name === n.name) && (n.onlyPlausible = true, n.name = void 0, n.nameStarts = void 0)), (t[e] === `
|
|
1302
|
-
` || t[e] === "\r") && (N = e, J && (J = false))) : (V !== null && (!n.quotes && o.equalsAt > V - 1 && o.nameEnds && o.equalsAt > o.nameEnds && t[e] !== '"' && t[e] !== "'" && (u(o) && n.attributes.push(o), o = {}, n.equalsSpottedAt = void 0), V = null), J || (J = true, F && !R && typeof N == "number" && e && N < e - 1 && (t.slice(N + 1, e).trim() ? N = null : l.ignoreIndentations || r.push([N + 1, e])))), t[e] === " " ? w === null && (w = e) : w !== null && (w = null), n.name === "script" && (R = !n.slashPresent);
|
|
1303
|
-
}
|
|
1304
|
-
if (t && !l.ignoreIndentations && (l.trimOnlySpaces && t[0] === " " || !l.trimOnlySpaces && !t[0].trim())) for (let e = 0; e < h; e++) if (l.trimOnlySpaces && t[e] !== " " || !l.trimOnlySpaces && t[e].trim()) {
|
|
1305
|
-
r.push([0, e]);
|
|
1306
|
-
break;
|
|
1307
|
-
} else t[e + 1] || r.push([0, e + 1]);
|
|
1308
|
-
if (t && (l.trimOnlySpaces && t[~-t.length] === " " || !l.trimOnlySpaces && !t[~-t.length].trim())) {
|
|
1309
|
-
for (let e = t.length; e--; ) if (l.trimOnlySpaces && t[e] !== " " || !l.trimOnlySpaces && t[e].trim()) {
|
|
1310
|
-
r.push([e + 1, h]);
|
|
1311
|
-
break;
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
let O = r.current();
|
|
1315
|
-
if (!m?.cb && O) {
|
|
1316
|
-
if (O[0] && !O[0][0]) {
|
|
1317
|
-
r.ranges[0] = [r.ranges[0][0], r.ranges[0][1]];
|
|
1318
|
-
}
|
|
1319
|
-
if (O[O.length - 1] && O[O.length - 1][1] === t.length) {
|
|
1320
|
-
if (r.ranges) {
|
|
1321
|
-
let s = r.ranges[r.ranges.length - 1][0];
|
|
1322
|
-
t[s - 1] && (l.trimOnlySpaces && t[s - 1] === " " || !l.trimOnlySpaces && !t[s - 1].trim()) && (s -= 1);
|
|
1323
|
-
let a = r.ranges[r.ranges.length - 1][2];
|
|
1324
|
-
r.ranges[r.ranges.length - 1] = [s, r.ranges[r.ranges.length - 1][1]], a?.trim() && r.ranges[r.ranges.length - 1].push(a.trimEnd());
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
return { log: { timeTakenInMilliseconds: Date.now() - y }, result: _(t, r.current()), ranges: r.current(), allTagLocations: b, filteredTagLocations: $$1 };
|
|
1329
|
-
}
|
|
1330
|
-
|
|
1331
|
-
export { ae as defaults, fe as stripHtml, Ne as version };
|