jquery.dgtable 0.6.19 → 2.0.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/README.md +38 -70
- package/dist/lib.cjs.js +3935 -0
- package/dist/lib.cjs.js.map +1 -0
- package/dist/lib.cjs.min.js +3 -0
- package/dist/lib.cjs.min.js.map +1 -0
- package/dist/lib.es6.js +3933 -0
- package/dist/lib.es6.js.map +1 -0
- package/dist/lib.es6.min.js +3 -0
- package/dist/lib.es6.min.js.map +1 -0
- package/dist/lib.umd.js +1984 -0
- package/dist/lib.umd.js.map +1 -0
- package/dist/lib.umd.min.js +7 -0
- package/dist/lib.umd.min.js.map +1 -0
- package/index.js +27 -0
- package/package.json +47 -57
- package/scripts/build.js +162 -0
- package/LICENSE +0 -21
- package/dist/jquery.dgtable.cjs.js +0 -6389
- package/dist/jquery.dgtable.cjs.js.map +0 -1
- package/dist/jquery.dgtable.cjs.min.js +0 -7
- package/dist/jquery.dgtable.cjs.min.js.map +0 -1
- package/dist/jquery.dgtable.es6.js +0 -6387
- package/dist/jquery.dgtable.es6.js.map +0 -1
- package/dist/jquery.dgtable.es6.min.js +0 -7
- package/dist/jquery.dgtable.es6.min.js.map +0 -1
- package/dist/jquery.dgtable.umd.js +0 -4466
- package/dist/jquery.dgtable.umd.js.map +0 -1
- package/dist/jquery.dgtable.umd.min.js +0 -7
- package/dist/jquery.dgtable.umd.min.js.map +0 -1
- package/eslint.config.mjs +0 -133
- package/src/SelectionHelper.js +0 -65
- package/src/by_column_filter.js +0 -25
- package/src/column_collection.js +0 -153
- package/src/index.js +0 -4034
- package/src/row_collection.js +0 -183
- package/src/util.js +0 -23
package/dist/lib.cjs.js
ADDED
|
@@ -0,0 +1,3935 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jQuery = require('jquery');
|
|
4
|
+
|
|
5
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
|
+
|
|
7
|
+
var es_symbol_description = {};
|
|
8
|
+
|
|
9
|
+
var globalThis_1;
|
|
10
|
+
var hasRequiredGlobalThis;
|
|
11
|
+
|
|
12
|
+
function requireGlobalThis () {
|
|
13
|
+
if (hasRequiredGlobalThis) return globalThis_1;
|
|
14
|
+
hasRequiredGlobalThis = 1;
|
|
15
|
+
var check = function (it) {
|
|
16
|
+
return it && it.Math === Math && it;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
20
|
+
globalThis_1 =
|
|
21
|
+
// eslint-disable-next-line es/no-global-this -- safe
|
|
22
|
+
check(typeof globalThis == 'object' && globalThis) ||
|
|
23
|
+
check(typeof window == 'object' && window) ||
|
|
24
|
+
// eslint-disable-next-line no-restricted-globals -- safe
|
|
25
|
+
check(typeof self == 'object' && self) ||
|
|
26
|
+
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
27
|
+
check(typeof globalThis_1 == 'object' && globalThis_1) ||
|
|
28
|
+
// eslint-disable-next-line no-new-func -- fallback
|
|
29
|
+
(function () { return this; })() || Function('return this')();
|
|
30
|
+
return globalThis_1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var objectGetOwnPropertyDescriptor = {};
|
|
34
|
+
|
|
35
|
+
var fails;
|
|
36
|
+
var hasRequiredFails;
|
|
37
|
+
|
|
38
|
+
function requireFails () {
|
|
39
|
+
if (hasRequiredFails) return fails;
|
|
40
|
+
hasRequiredFails = 1;
|
|
41
|
+
fails = function (exec) {
|
|
42
|
+
try {
|
|
43
|
+
return !!exec();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return fails;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var descriptors;
|
|
52
|
+
var hasRequiredDescriptors;
|
|
53
|
+
|
|
54
|
+
function requireDescriptors () {
|
|
55
|
+
if (hasRequiredDescriptors) return descriptors;
|
|
56
|
+
hasRequiredDescriptors = 1;
|
|
57
|
+
var fails = requireFails();
|
|
58
|
+
|
|
59
|
+
// Detect IE8's incomplete defineProperty implementation
|
|
60
|
+
descriptors = !fails(function () {
|
|
61
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
62
|
+
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
|
63
|
+
});
|
|
64
|
+
return descriptors;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
var functionBindNative;
|
|
68
|
+
var hasRequiredFunctionBindNative;
|
|
69
|
+
|
|
70
|
+
function requireFunctionBindNative () {
|
|
71
|
+
if (hasRequiredFunctionBindNative) return functionBindNative;
|
|
72
|
+
hasRequiredFunctionBindNative = 1;
|
|
73
|
+
var fails = requireFails();
|
|
74
|
+
|
|
75
|
+
functionBindNative = !fails(function () {
|
|
76
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
77
|
+
var test = (function () { /* empty */ }).bind();
|
|
78
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
79
|
+
return typeof test != 'function' || test.hasOwnProperty('prototype');
|
|
80
|
+
});
|
|
81
|
+
return functionBindNative;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var functionCall;
|
|
85
|
+
var hasRequiredFunctionCall;
|
|
86
|
+
|
|
87
|
+
function requireFunctionCall () {
|
|
88
|
+
if (hasRequiredFunctionCall) return functionCall;
|
|
89
|
+
hasRequiredFunctionCall = 1;
|
|
90
|
+
var NATIVE_BIND = requireFunctionBindNative();
|
|
91
|
+
|
|
92
|
+
var call = Function.prototype.call;
|
|
93
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
94
|
+
functionCall = NATIVE_BIND ? call.bind(call) : function () {
|
|
95
|
+
return call.apply(call, arguments);
|
|
96
|
+
};
|
|
97
|
+
return functionCall;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var objectPropertyIsEnumerable = {};
|
|
101
|
+
|
|
102
|
+
var hasRequiredObjectPropertyIsEnumerable;
|
|
103
|
+
|
|
104
|
+
function requireObjectPropertyIsEnumerable () {
|
|
105
|
+
if (hasRequiredObjectPropertyIsEnumerable) return objectPropertyIsEnumerable;
|
|
106
|
+
hasRequiredObjectPropertyIsEnumerable = 1;
|
|
107
|
+
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
108
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
109
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
110
|
+
|
|
111
|
+
// Nashorn ~ JDK8 bug
|
|
112
|
+
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
113
|
+
|
|
114
|
+
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
115
|
+
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
116
|
+
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
117
|
+
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
118
|
+
return !!descriptor && descriptor.enumerable;
|
|
119
|
+
} : $propertyIsEnumerable;
|
|
120
|
+
return objectPropertyIsEnumerable;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var createPropertyDescriptor;
|
|
124
|
+
var hasRequiredCreatePropertyDescriptor;
|
|
125
|
+
|
|
126
|
+
function requireCreatePropertyDescriptor () {
|
|
127
|
+
if (hasRequiredCreatePropertyDescriptor) return createPropertyDescriptor;
|
|
128
|
+
hasRequiredCreatePropertyDescriptor = 1;
|
|
129
|
+
createPropertyDescriptor = function (bitmap, value) {
|
|
130
|
+
return {
|
|
131
|
+
enumerable: !(bitmap & 1),
|
|
132
|
+
configurable: !(bitmap & 2),
|
|
133
|
+
writable: !(bitmap & 4),
|
|
134
|
+
value: value
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
return createPropertyDescriptor;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
var functionUncurryThis;
|
|
141
|
+
var hasRequiredFunctionUncurryThis;
|
|
142
|
+
|
|
143
|
+
function requireFunctionUncurryThis () {
|
|
144
|
+
if (hasRequiredFunctionUncurryThis) return functionUncurryThis;
|
|
145
|
+
hasRequiredFunctionUncurryThis = 1;
|
|
146
|
+
var NATIVE_BIND = requireFunctionBindNative();
|
|
147
|
+
|
|
148
|
+
var FunctionPrototype = Function.prototype;
|
|
149
|
+
var call = FunctionPrototype.call;
|
|
150
|
+
// eslint-disable-next-line es/no-function-prototype-bind -- safe
|
|
151
|
+
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
|
|
152
|
+
|
|
153
|
+
functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
|
|
154
|
+
return function () {
|
|
155
|
+
return call.apply(fn, arguments);
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
return functionUncurryThis;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
var classofRaw;
|
|
162
|
+
var hasRequiredClassofRaw;
|
|
163
|
+
|
|
164
|
+
function requireClassofRaw () {
|
|
165
|
+
if (hasRequiredClassofRaw) return classofRaw;
|
|
166
|
+
hasRequiredClassofRaw = 1;
|
|
167
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
168
|
+
|
|
169
|
+
var toString = uncurryThis({}.toString);
|
|
170
|
+
var stringSlice = uncurryThis(''.slice);
|
|
171
|
+
|
|
172
|
+
classofRaw = function (it) {
|
|
173
|
+
return stringSlice(toString(it), 8, -1);
|
|
174
|
+
};
|
|
175
|
+
return classofRaw;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var indexedObject;
|
|
179
|
+
var hasRequiredIndexedObject;
|
|
180
|
+
|
|
181
|
+
function requireIndexedObject () {
|
|
182
|
+
if (hasRequiredIndexedObject) return indexedObject;
|
|
183
|
+
hasRequiredIndexedObject = 1;
|
|
184
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
185
|
+
var fails = requireFails();
|
|
186
|
+
var classof = requireClassofRaw();
|
|
187
|
+
|
|
188
|
+
var $Object = Object;
|
|
189
|
+
var split = uncurryThis(''.split);
|
|
190
|
+
|
|
191
|
+
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
192
|
+
indexedObject = fails(function () {
|
|
193
|
+
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
194
|
+
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
195
|
+
return !$Object('z').propertyIsEnumerable(0);
|
|
196
|
+
}) ? function (it) {
|
|
197
|
+
return classof(it) === 'String' ? split(it, '') : $Object(it);
|
|
198
|
+
} : $Object;
|
|
199
|
+
return indexedObject;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
var isNullOrUndefined;
|
|
203
|
+
var hasRequiredIsNullOrUndefined;
|
|
204
|
+
|
|
205
|
+
function requireIsNullOrUndefined () {
|
|
206
|
+
if (hasRequiredIsNullOrUndefined) return isNullOrUndefined;
|
|
207
|
+
hasRequiredIsNullOrUndefined = 1;
|
|
208
|
+
// we can't use just `it == null` since of `document.all` special case
|
|
209
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
|
|
210
|
+
isNullOrUndefined = function (it) {
|
|
211
|
+
return it === null || it === undefined;
|
|
212
|
+
};
|
|
213
|
+
return isNullOrUndefined;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
var requireObjectCoercible;
|
|
217
|
+
var hasRequiredRequireObjectCoercible;
|
|
218
|
+
|
|
219
|
+
function requireRequireObjectCoercible () {
|
|
220
|
+
if (hasRequiredRequireObjectCoercible) return requireObjectCoercible;
|
|
221
|
+
hasRequiredRequireObjectCoercible = 1;
|
|
222
|
+
var isNullOrUndefined = requireIsNullOrUndefined();
|
|
223
|
+
|
|
224
|
+
var $TypeError = TypeError;
|
|
225
|
+
|
|
226
|
+
// `RequireObjectCoercible` abstract operation
|
|
227
|
+
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
228
|
+
requireObjectCoercible = function (it) {
|
|
229
|
+
if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
|
|
230
|
+
return it;
|
|
231
|
+
};
|
|
232
|
+
return requireObjectCoercible;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var toIndexedObject;
|
|
236
|
+
var hasRequiredToIndexedObject;
|
|
237
|
+
|
|
238
|
+
function requireToIndexedObject () {
|
|
239
|
+
if (hasRequiredToIndexedObject) return toIndexedObject;
|
|
240
|
+
hasRequiredToIndexedObject = 1;
|
|
241
|
+
// toObject with fallback for non-array-like ES3 strings
|
|
242
|
+
var IndexedObject = requireIndexedObject();
|
|
243
|
+
var requireObjectCoercible = requireRequireObjectCoercible();
|
|
244
|
+
|
|
245
|
+
toIndexedObject = function (it) {
|
|
246
|
+
return IndexedObject(requireObjectCoercible(it));
|
|
247
|
+
};
|
|
248
|
+
return toIndexedObject;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
var isCallable;
|
|
252
|
+
var hasRequiredIsCallable;
|
|
253
|
+
|
|
254
|
+
function requireIsCallable () {
|
|
255
|
+
if (hasRequiredIsCallable) return isCallable;
|
|
256
|
+
hasRequiredIsCallable = 1;
|
|
257
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
258
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
259
|
+
|
|
260
|
+
// `IsCallable` abstract operation
|
|
261
|
+
// https://tc39.es/ecma262/#sec-iscallable
|
|
262
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
263
|
+
isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
264
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
265
|
+
} : function (argument) {
|
|
266
|
+
return typeof argument == 'function';
|
|
267
|
+
};
|
|
268
|
+
return isCallable;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
var isObject;
|
|
272
|
+
var hasRequiredIsObject;
|
|
273
|
+
|
|
274
|
+
function requireIsObject () {
|
|
275
|
+
if (hasRequiredIsObject) return isObject;
|
|
276
|
+
hasRequiredIsObject = 1;
|
|
277
|
+
var isCallable = requireIsCallable();
|
|
278
|
+
|
|
279
|
+
isObject = function (it) {
|
|
280
|
+
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
281
|
+
};
|
|
282
|
+
return isObject;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
var getBuiltIn;
|
|
286
|
+
var hasRequiredGetBuiltIn;
|
|
287
|
+
|
|
288
|
+
function requireGetBuiltIn () {
|
|
289
|
+
if (hasRequiredGetBuiltIn) return getBuiltIn;
|
|
290
|
+
hasRequiredGetBuiltIn = 1;
|
|
291
|
+
var globalThis = requireGlobalThis();
|
|
292
|
+
var isCallable = requireIsCallable();
|
|
293
|
+
|
|
294
|
+
var aFunction = function (argument) {
|
|
295
|
+
return isCallable(argument) ? argument : undefined;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
getBuiltIn = function (namespace, method) {
|
|
299
|
+
return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];
|
|
300
|
+
};
|
|
301
|
+
return getBuiltIn;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
var objectIsPrototypeOf;
|
|
305
|
+
var hasRequiredObjectIsPrototypeOf;
|
|
306
|
+
|
|
307
|
+
function requireObjectIsPrototypeOf () {
|
|
308
|
+
if (hasRequiredObjectIsPrototypeOf) return objectIsPrototypeOf;
|
|
309
|
+
hasRequiredObjectIsPrototypeOf = 1;
|
|
310
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
311
|
+
|
|
312
|
+
objectIsPrototypeOf = uncurryThis({}.isPrototypeOf);
|
|
313
|
+
return objectIsPrototypeOf;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
var environmentUserAgent;
|
|
317
|
+
var hasRequiredEnvironmentUserAgent;
|
|
318
|
+
|
|
319
|
+
function requireEnvironmentUserAgent () {
|
|
320
|
+
if (hasRequiredEnvironmentUserAgent) return environmentUserAgent;
|
|
321
|
+
hasRequiredEnvironmentUserAgent = 1;
|
|
322
|
+
var globalThis = requireGlobalThis();
|
|
323
|
+
|
|
324
|
+
var navigator = globalThis.navigator;
|
|
325
|
+
var userAgent = navigator && navigator.userAgent;
|
|
326
|
+
|
|
327
|
+
environmentUserAgent = userAgent ? String(userAgent) : '';
|
|
328
|
+
return environmentUserAgent;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
var environmentV8Version;
|
|
332
|
+
var hasRequiredEnvironmentV8Version;
|
|
333
|
+
|
|
334
|
+
function requireEnvironmentV8Version () {
|
|
335
|
+
if (hasRequiredEnvironmentV8Version) return environmentV8Version;
|
|
336
|
+
hasRequiredEnvironmentV8Version = 1;
|
|
337
|
+
var globalThis = requireGlobalThis();
|
|
338
|
+
var userAgent = requireEnvironmentUserAgent();
|
|
339
|
+
|
|
340
|
+
var process = globalThis.process;
|
|
341
|
+
var Deno = globalThis.Deno;
|
|
342
|
+
var versions = process && process.versions || Deno && Deno.version;
|
|
343
|
+
var v8 = versions && versions.v8;
|
|
344
|
+
var match, version;
|
|
345
|
+
|
|
346
|
+
if (v8) {
|
|
347
|
+
match = v8.split('.');
|
|
348
|
+
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
|
|
349
|
+
// but their correct versions are not interesting for us
|
|
350
|
+
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
|
|
354
|
+
// so check `userAgent` even if `.v8` exists, but 0
|
|
355
|
+
if (!version && userAgent) {
|
|
356
|
+
match = userAgent.match(/Edge\/(\d+)/);
|
|
357
|
+
if (!match || match[1] >= 74) {
|
|
358
|
+
match = userAgent.match(/Chrome\/(\d+)/);
|
|
359
|
+
if (match) version = +match[1];
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
environmentV8Version = version;
|
|
364
|
+
return environmentV8Version;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
var symbolConstructorDetection;
|
|
368
|
+
var hasRequiredSymbolConstructorDetection;
|
|
369
|
+
|
|
370
|
+
function requireSymbolConstructorDetection () {
|
|
371
|
+
if (hasRequiredSymbolConstructorDetection) return symbolConstructorDetection;
|
|
372
|
+
hasRequiredSymbolConstructorDetection = 1;
|
|
373
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
374
|
+
var V8_VERSION = requireEnvironmentV8Version();
|
|
375
|
+
var fails = requireFails();
|
|
376
|
+
var globalThis = requireGlobalThis();
|
|
377
|
+
|
|
378
|
+
var $String = globalThis.String;
|
|
379
|
+
|
|
380
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
381
|
+
symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
382
|
+
var symbol = Symbol('symbol detection');
|
|
383
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
|
384
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
385
|
+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
386
|
+
// of course, fail.
|
|
387
|
+
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
388
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
389
|
+
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
390
|
+
});
|
|
391
|
+
return symbolConstructorDetection;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
var useSymbolAsUid;
|
|
395
|
+
var hasRequiredUseSymbolAsUid;
|
|
396
|
+
|
|
397
|
+
function requireUseSymbolAsUid () {
|
|
398
|
+
if (hasRequiredUseSymbolAsUid) return useSymbolAsUid;
|
|
399
|
+
hasRequiredUseSymbolAsUid = 1;
|
|
400
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
|
401
|
+
var NATIVE_SYMBOL = requireSymbolConstructorDetection();
|
|
402
|
+
|
|
403
|
+
useSymbolAsUid = NATIVE_SYMBOL &&
|
|
404
|
+
!Symbol.sham &&
|
|
405
|
+
typeof Symbol.iterator == 'symbol';
|
|
406
|
+
return useSymbolAsUid;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
var isSymbol;
|
|
410
|
+
var hasRequiredIsSymbol;
|
|
411
|
+
|
|
412
|
+
function requireIsSymbol () {
|
|
413
|
+
if (hasRequiredIsSymbol) return isSymbol;
|
|
414
|
+
hasRequiredIsSymbol = 1;
|
|
415
|
+
var getBuiltIn = requireGetBuiltIn();
|
|
416
|
+
var isCallable = requireIsCallable();
|
|
417
|
+
var isPrototypeOf = requireObjectIsPrototypeOf();
|
|
418
|
+
var USE_SYMBOL_AS_UID = requireUseSymbolAsUid();
|
|
419
|
+
|
|
420
|
+
var $Object = Object;
|
|
421
|
+
|
|
422
|
+
isSymbol = USE_SYMBOL_AS_UID ? function (it) {
|
|
423
|
+
return typeof it == 'symbol';
|
|
424
|
+
} : function (it) {
|
|
425
|
+
var $Symbol = getBuiltIn('Symbol');
|
|
426
|
+
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
|
427
|
+
};
|
|
428
|
+
return isSymbol;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
var tryToString;
|
|
432
|
+
var hasRequiredTryToString;
|
|
433
|
+
|
|
434
|
+
function requireTryToString () {
|
|
435
|
+
if (hasRequiredTryToString) return tryToString;
|
|
436
|
+
hasRequiredTryToString = 1;
|
|
437
|
+
var $String = String;
|
|
438
|
+
|
|
439
|
+
tryToString = function (argument) {
|
|
440
|
+
try {
|
|
441
|
+
return $String(argument);
|
|
442
|
+
} catch (error) {
|
|
443
|
+
return 'Object';
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
return tryToString;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
var aCallable;
|
|
450
|
+
var hasRequiredACallable;
|
|
451
|
+
|
|
452
|
+
function requireACallable () {
|
|
453
|
+
if (hasRequiredACallable) return aCallable;
|
|
454
|
+
hasRequiredACallable = 1;
|
|
455
|
+
var isCallable = requireIsCallable();
|
|
456
|
+
var tryToString = requireTryToString();
|
|
457
|
+
|
|
458
|
+
var $TypeError = TypeError;
|
|
459
|
+
|
|
460
|
+
// `Assert: IsCallable(argument) is true`
|
|
461
|
+
aCallable = function (argument) {
|
|
462
|
+
if (isCallable(argument)) return argument;
|
|
463
|
+
throw new $TypeError(tryToString(argument) + ' is not a function');
|
|
464
|
+
};
|
|
465
|
+
return aCallable;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
var getMethod;
|
|
469
|
+
var hasRequiredGetMethod;
|
|
470
|
+
|
|
471
|
+
function requireGetMethod () {
|
|
472
|
+
if (hasRequiredGetMethod) return getMethod;
|
|
473
|
+
hasRequiredGetMethod = 1;
|
|
474
|
+
var aCallable = requireACallable();
|
|
475
|
+
var isNullOrUndefined = requireIsNullOrUndefined();
|
|
476
|
+
|
|
477
|
+
// `GetMethod` abstract operation
|
|
478
|
+
// https://tc39.es/ecma262/#sec-getmethod
|
|
479
|
+
getMethod = function (V, P) {
|
|
480
|
+
var func = V[P];
|
|
481
|
+
return isNullOrUndefined(func) ? undefined : aCallable(func);
|
|
482
|
+
};
|
|
483
|
+
return getMethod;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
var ordinaryToPrimitive;
|
|
487
|
+
var hasRequiredOrdinaryToPrimitive;
|
|
488
|
+
|
|
489
|
+
function requireOrdinaryToPrimitive () {
|
|
490
|
+
if (hasRequiredOrdinaryToPrimitive) return ordinaryToPrimitive;
|
|
491
|
+
hasRequiredOrdinaryToPrimitive = 1;
|
|
492
|
+
var call = requireFunctionCall();
|
|
493
|
+
var isCallable = requireIsCallable();
|
|
494
|
+
var isObject = requireIsObject();
|
|
495
|
+
|
|
496
|
+
var $TypeError = TypeError;
|
|
497
|
+
|
|
498
|
+
// `OrdinaryToPrimitive` abstract operation
|
|
499
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
|
500
|
+
ordinaryToPrimitive = function (input, pref) {
|
|
501
|
+
var fn, val;
|
|
502
|
+
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
|
503
|
+
if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
|
504
|
+
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
|
505
|
+
throw new $TypeError("Can't convert object to primitive value");
|
|
506
|
+
};
|
|
507
|
+
return ordinaryToPrimitive;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
var sharedStore = {exports: {}};
|
|
511
|
+
|
|
512
|
+
var isPure;
|
|
513
|
+
var hasRequiredIsPure;
|
|
514
|
+
|
|
515
|
+
function requireIsPure () {
|
|
516
|
+
if (hasRequiredIsPure) return isPure;
|
|
517
|
+
hasRequiredIsPure = 1;
|
|
518
|
+
isPure = false;
|
|
519
|
+
return isPure;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
var defineGlobalProperty;
|
|
523
|
+
var hasRequiredDefineGlobalProperty;
|
|
524
|
+
|
|
525
|
+
function requireDefineGlobalProperty () {
|
|
526
|
+
if (hasRequiredDefineGlobalProperty) return defineGlobalProperty;
|
|
527
|
+
hasRequiredDefineGlobalProperty = 1;
|
|
528
|
+
var globalThis = requireGlobalThis();
|
|
529
|
+
|
|
530
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
531
|
+
var defineProperty = Object.defineProperty;
|
|
532
|
+
|
|
533
|
+
defineGlobalProperty = function (key, value) {
|
|
534
|
+
try {
|
|
535
|
+
defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
|
|
536
|
+
} catch (error) {
|
|
537
|
+
globalThis[key] = value;
|
|
538
|
+
} return value;
|
|
539
|
+
};
|
|
540
|
+
return defineGlobalProperty;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
var hasRequiredSharedStore;
|
|
544
|
+
|
|
545
|
+
function requireSharedStore () {
|
|
546
|
+
if (hasRequiredSharedStore) return sharedStore.exports;
|
|
547
|
+
hasRequiredSharedStore = 1;
|
|
548
|
+
var IS_PURE = requireIsPure();
|
|
549
|
+
var globalThis = requireGlobalThis();
|
|
550
|
+
var defineGlobalProperty = requireDefineGlobalProperty();
|
|
551
|
+
|
|
552
|
+
var SHARED = '__core-js_shared__';
|
|
553
|
+
var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
|
554
|
+
|
|
555
|
+
(store.versions || (store.versions = [])).push({
|
|
556
|
+
version: '3.47.0',
|
|
557
|
+
mode: IS_PURE ? 'pure' : 'global',
|
|
558
|
+
copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)',
|
|
559
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE',
|
|
560
|
+
source: 'https://github.com/zloirock/core-js'
|
|
561
|
+
});
|
|
562
|
+
return sharedStore.exports;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
var shared;
|
|
566
|
+
var hasRequiredShared;
|
|
567
|
+
|
|
568
|
+
function requireShared () {
|
|
569
|
+
if (hasRequiredShared) return shared;
|
|
570
|
+
hasRequiredShared = 1;
|
|
571
|
+
var store = requireSharedStore();
|
|
572
|
+
|
|
573
|
+
shared = function (key, value) {
|
|
574
|
+
return store[key] || (store[key] = value || {});
|
|
575
|
+
};
|
|
576
|
+
return shared;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
var toObject;
|
|
580
|
+
var hasRequiredToObject;
|
|
581
|
+
|
|
582
|
+
function requireToObject () {
|
|
583
|
+
if (hasRequiredToObject) return toObject;
|
|
584
|
+
hasRequiredToObject = 1;
|
|
585
|
+
var requireObjectCoercible = requireRequireObjectCoercible();
|
|
586
|
+
|
|
587
|
+
var $Object = Object;
|
|
588
|
+
|
|
589
|
+
// `ToObject` abstract operation
|
|
590
|
+
// https://tc39.es/ecma262/#sec-toobject
|
|
591
|
+
toObject = function (argument) {
|
|
592
|
+
return $Object(requireObjectCoercible(argument));
|
|
593
|
+
};
|
|
594
|
+
return toObject;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
var hasOwnProperty_1;
|
|
598
|
+
var hasRequiredHasOwnProperty;
|
|
599
|
+
|
|
600
|
+
function requireHasOwnProperty () {
|
|
601
|
+
if (hasRequiredHasOwnProperty) return hasOwnProperty_1;
|
|
602
|
+
hasRequiredHasOwnProperty = 1;
|
|
603
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
604
|
+
var toObject = requireToObject();
|
|
605
|
+
|
|
606
|
+
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
|
607
|
+
|
|
608
|
+
// `HasOwnProperty` abstract operation
|
|
609
|
+
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
610
|
+
// eslint-disable-next-line es/no-object-hasown -- safe
|
|
611
|
+
hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
612
|
+
return hasOwnProperty(toObject(it), key);
|
|
613
|
+
};
|
|
614
|
+
return hasOwnProperty_1;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
var uid;
|
|
618
|
+
var hasRequiredUid;
|
|
619
|
+
|
|
620
|
+
function requireUid () {
|
|
621
|
+
if (hasRequiredUid) return uid;
|
|
622
|
+
hasRequiredUid = 1;
|
|
623
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
624
|
+
|
|
625
|
+
var id = 0;
|
|
626
|
+
var postfix = Math.random();
|
|
627
|
+
var toString = uncurryThis(1.1.toString);
|
|
628
|
+
|
|
629
|
+
uid = function (key) {
|
|
630
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
|
631
|
+
};
|
|
632
|
+
return uid;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
var wellKnownSymbol;
|
|
636
|
+
var hasRequiredWellKnownSymbol;
|
|
637
|
+
|
|
638
|
+
function requireWellKnownSymbol () {
|
|
639
|
+
if (hasRequiredWellKnownSymbol) return wellKnownSymbol;
|
|
640
|
+
hasRequiredWellKnownSymbol = 1;
|
|
641
|
+
var globalThis = requireGlobalThis();
|
|
642
|
+
var shared = requireShared();
|
|
643
|
+
var hasOwn = requireHasOwnProperty();
|
|
644
|
+
var uid = requireUid();
|
|
645
|
+
var NATIVE_SYMBOL = requireSymbolConstructorDetection();
|
|
646
|
+
var USE_SYMBOL_AS_UID = requireUseSymbolAsUid();
|
|
647
|
+
|
|
648
|
+
var Symbol = globalThis.Symbol;
|
|
649
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
650
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
|
|
651
|
+
|
|
652
|
+
wellKnownSymbol = function (name) {
|
|
653
|
+
if (!hasOwn(WellKnownSymbolsStore, name)) {
|
|
654
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
|
|
655
|
+
? Symbol[name]
|
|
656
|
+
: createWellKnownSymbol('Symbol.' + name);
|
|
657
|
+
} return WellKnownSymbolsStore[name];
|
|
658
|
+
};
|
|
659
|
+
return wellKnownSymbol;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
var toPrimitive;
|
|
663
|
+
var hasRequiredToPrimitive;
|
|
664
|
+
|
|
665
|
+
function requireToPrimitive () {
|
|
666
|
+
if (hasRequiredToPrimitive) return toPrimitive;
|
|
667
|
+
hasRequiredToPrimitive = 1;
|
|
668
|
+
var call = requireFunctionCall();
|
|
669
|
+
var isObject = requireIsObject();
|
|
670
|
+
var isSymbol = requireIsSymbol();
|
|
671
|
+
var getMethod = requireGetMethod();
|
|
672
|
+
var ordinaryToPrimitive = requireOrdinaryToPrimitive();
|
|
673
|
+
var wellKnownSymbol = requireWellKnownSymbol();
|
|
674
|
+
|
|
675
|
+
var $TypeError = TypeError;
|
|
676
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
677
|
+
|
|
678
|
+
// `ToPrimitive` abstract operation
|
|
679
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
|
680
|
+
toPrimitive = function (input, pref) {
|
|
681
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
|
682
|
+
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
683
|
+
var result;
|
|
684
|
+
if (exoticToPrim) {
|
|
685
|
+
if (pref === undefined) pref = 'default';
|
|
686
|
+
result = call(exoticToPrim, input, pref);
|
|
687
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
|
688
|
+
throw new $TypeError("Can't convert object to primitive value");
|
|
689
|
+
}
|
|
690
|
+
if (pref === undefined) pref = 'number';
|
|
691
|
+
return ordinaryToPrimitive(input, pref);
|
|
692
|
+
};
|
|
693
|
+
return toPrimitive;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
var toPropertyKey;
|
|
697
|
+
var hasRequiredToPropertyKey;
|
|
698
|
+
|
|
699
|
+
function requireToPropertyKey () {
|
|
700
|
+
if (hasRequiredToPropertyKey) return toPropertyKey;
|
|
701
|
+
hasRequiredToPropertyKey = 1;
|
|
702
|
+
var toPrimitive = requireToPrimitive();
|
|
703
|
+
var isSymbol = requireIsSymbol();
|
|
704
|
+
|
|
705
|
+
// `ToPropertyKey` abstract operation
|
|
706
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
|
707
|
+
toPropertyKey = function (argument) {
|
|
708
|
+
var key = toPrimitive(argument, 'string');
|
|
709
|
+
return isSymbol(key) ? key : key + '';
|
|
710
|
+
};
|
|
711
|
+
return toPropertyKey;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
var documentCreateElement;
|
|
715
|
+
var hasRequiredDocumentCreateElement;
|
|
716
|
+
|
|
717
|
+
function requireDocumentCreateElement () {
|
|
718
|
+
if (hasRequiredDocumentCreateElement) return documentCreateElement;
|
|
719
|
+
hasRequiredDocumentCreateElement = 1;
|
|
720
|
+
var globalThis = requireGlobalThis();
|
|
721
|
+
var isObject = requireIsObject();
|
|
722
|
+
|
|
723
|
+
var document = globalThis.document;
|
|
724
|
+
// typeof document.createElement is 'object' in old IE
|
|
725
|
+
var EXISTS = isObject(document) && isObject(document.createElement);
|
|
726
|
+
|
|
727
|
+
documentCreateElement = function (it) {
|
|
728
|
+
return EXISTS ? document.createElement(it) : {};
|
|
729
|
+
};
|
|
730
|
+
return documentCreateElement;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
var ie8DomDefine;
|
|
734
|
+
var hasRequiredIe8DomDefine;
|
|
735
|
+
|
|
736
|
+
function requireIe8DomDefine () {
|
|
737
|
+
if (hasRequiredIe8DomDefine) return ie8DomDefine;
|
|
738
|
+
hasRequiredIe8DomDefine = 1;
|
|
739
|
+
var DESCRIPTORS = requireDescriptors();
|
|
740
|
+
var fails = requireFails();
|
|
741
|
+
var createElement = requireDocumentCreateElement();
|
|
742
|
+
|
|
743
|
+
// Thanks to IE8 for its funny defineProperty
|
|
744
|
+
ie8DomDefine = !DESCRIPTORS && !fails(function () {
|
|
745
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
746
|
+
return Object.defineProperty(createElement('div'), 'a', {
|
|
747
|
+
get: function () { return 7; }
|
|
748
|
+
}).a !== 7;
|
|
749
|
+
});
|
|
750
|
+
return ie8DomDefine;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
var hasRequiredObjectGetOwnPropertyDescriptor;
|
|
754
|
+
|
|
755
|
+
function requireObjectGetOwnPropertyDescriptor () {
|
|
756
|
+
if (hasRequiredObjectGetOwnPropertyDescriptor) return objectGetOwnPropertyDescriptor;
|
|
757
|
+
hasRequiredObjectGetOwnPropertyDescriptor = 1;
|
|
758
|
+
var DESCRIPTORS = requireDescriptors();
|
|
759
|
+
var call = requireFunctionCall();
|
|
760
|
+
var propertyIsEnumerableModule = requireObjectPropertyIsEnumerable();
|
|
761
|
+
var createPropertyDescriptor = requireCreatePropertyDescriptor();
|
|
762
|
+
var toIndexedObject = requireToIndexedObject();
|
|
763
|
+
var toPropertyKey = requireToPropertyKey();
|
|
764
|
+
var hasOwn = requireHasOwnProperty();
|
|
765
|
+
var IE8_DOM_DEFINE = requireIe8DomDefine();
|
|
766
|
+
|
|
767
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
768
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
769
|
+
|
|
770
|
+
// `Object.getOwnPropertyDescriptor` method
|
|
771
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
772
|
+
objectGetOwnPropertyDescriptor.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
773
|
+
O = toIndexedObject(O);
|
|
774
|
+
P = toPropertyKey(P);
|
|
775
|
+
if (IE8_DOM_DEFINE) try {
|
|
776
|
+
return $getOwnPropertyDescriptor(O, P);
|
|
777
|
+
} catch (error) { /* empty */ }
|
|
778
|
+
if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
|
779
|
+
};
|
|
780
|
+
return objectGetOwnPropertyDescriptor;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
var objectDefineProperty = {};
|
|
784
|
+
|
|
785
|
+
var v8PrototypeDefineBug;
|
|
786
|
+
var hasRequiredV8PrototypeDefineBug;
|
|
787
|
+
|
|
788
|
+
function requireV8PrototypeDefineBug () {
|
|
789
|
+
if (hasRequiredV8PrototypeDefineBug) return v8PrototypeDefineBug;
|
|
790
|
+
hasRequiredV8PrototypeDefineBug = 1;
|
|
791
|
+
var DESCRIPTORS = requireDescriptors();
|
|
792
|
+
var fails = requireFails();
|
|
793
|
+
|
|
794
|
+
// V8 ~ Chrome 36-
|
|
795
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
|
796
|
+
v8PrototypeDefineBug = DESCRIPTORS && fails(function () {
|
|
797
|
+
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
798
|
+
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
|
|
799
|
+
value: 42,
|
|
800
|
+
writable: false
|
|
801
|
+
}).prototype !== 42;
|
|
802
|
+
});
|
|
803
|
+
return v8PrototypeDefineBug;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
var anObject;
|
|
807
|
+
var hasRequiredAnObject;
|
|
808
|
+
|
|
809
|
+
function requireAnObject () {
|
|
810
|
+
if (hasRequiredAnObject) return anObject;
|
|
811
|
+
hasRequiredAnObject = 1;
|
|
812
|
+
var isObject = requireIsObject();
|
|
813
|
+
|
|
814
|
+
var $String = String;
|
|
815
|
+
var $TypeError = TypeError;
|
|
816
|
+
|
|
817
|
+
// `Assert: Type(argument) is Object`
|
|
818
|
+
anObject = function (argument) {
|
|
819
|
+
if (isObject(argument)) return argument;
|
|
820
|
+
throw new $TypeError($String(argument) + ' is not an object');
|
|
821
|
+
};
|
|
822
|
+
return anObject;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
var hasRequiredObjectDefineProperty;
|
|
826
|
+
|
|
827
|
+
function requireObjectDefineProperty () {
|
|
828
|
+
if (hasRequiredObjectDefineProperty) return objectDefineProperty;
|
|
829
|
+
hasRequiredObjectDefineProperty = 1;
|
|
830
|
+
var DESCRIPTORS = requireDescriptors();
|
|
831
|
+
var IE8_DOM_DEFINE = requireIe8DomDefine();
|
|
832
|
+
var V8_PROTOTYPE_DEFINE_BUG = requireV8PrototypeDefineBug();
|
|
833
|
+
var anObject = requireAnObject();
|
|
834
|
+
var toPropertyKey = requireToPropertyKey();
|
|
835
|
+
|
|
836
|
+
var $TypeError = TypeError;
|
|
837
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
838
|
+
var $defineProperty = Object.defineProperty;
|
|
839
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
840
|
+
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
841
|
+
var ENUMERABLE = 'enumerable';
|
|
842
|
+
var CONFIGURABLE = 'configurable';
|
|
843
|
+
var WRITABLE = 'writable';
|
|
844
|
+
|
|
845
|
+
// `Object.defineProperty` method
|
|
846
|
+
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
847
|
+
objectDefineProperty.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
|
848
|
+
anObject(O);
|
|
849
|
+
P = toPropertyKey(P);
|
|
850
|
+
anObject(Attributes);
|
|
851
|
+
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
|
852
|
+
var current = $getOwnPropertyDescriptor(O, P);
|
|
853
|
+
if (current && current[WRITABLE]) {
|
|
854
|
+
O[P] = Attributes.value;
|
|
855
|
+
Attributes = {
|
|
856
|
+
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
|
857
|
+
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
|
858
|
+
writable: false
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
} return $defineProperty(O, P, Attributes);
|
|
862
|
+
} : $defineProperty : function defineProperty(O, P, Attributes) {
|
|
863
|
+
anObject(O);
|
|
864
|
+
P = toPropertyKey(P);
|
|
865
|
+
anObject(Attributes);
|
|
866
|
+
if (IE8_DOM_DEFINE) try {
|
|
867
|
+
return $defineProperty(O, P, Attributes);
|
|
868
|
+
} catch (error) { /* empty */ }
|
|
869
|
+
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
|
|
870
|
+
if ('value' in Attributes) O[P] = Attributes.value;
|
|
871
|
+
return O;
|
|
872
|
+
};
|
|
873
|
+
return objectDefineProperty;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
var createNonEnumerableProperty;
|
|
877
|
+
var hasRequiredCreateNonEnumerableProperty;
|
|
878
|
+
|
|
879
|
+
function requireCreateNonEnumerableProperty () {
|
|
880
|
+
if (hasRequiredCreateNonEnumerableProperty) return createNonEnumerableProperty;
|
|
881
|
+
hasRequiredCreateNonEnumerableProperty = 1;
|
|
882
|
+
var DESCRIPTORS = requireDescriptors();
|
|
883
|
+
var definePropertyModule = requireObjectDefineProperty();
|
|
884
|
+
var createPropertyDescriptor = requireCreatePropertyDescriptor();
|
|
885
|
+
|
|
886
|
+
createNonEnumerableProperty = DESCRIPTORS ? function (object, key, value) {
|
|
887
|
+
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
|
888
|
+
} : function (object, key, value) {
|
|
889
|
+
object[key] = value;
|
|
890
|
+
return object;
|
|
891
|
+
};
|
|
892
|
+
return createNonEnumerableProperty;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
var makeBuiltIn = {exports: {}};
|
|
896
|
+
|
|
897
|
+
var functionName;
|
|
898
|
+
var hasRequiredFunctionName;
|
|
899
|
+
|
|
900
|
+
function requireFunctionName () {
|
|
901
|
+
if (hasRequiredFunctionName) return functionName;
|
|
902
|
+
hasRequiredFunctionName = 1;
|
|
903
|
+
var DESCRIPTORS = requireDescriptors();
|
|
904
|
+
var hasOwn = requireHasOwnProperty();
|
|
905
|
+
|
|
906
|
+
var FunctionPrototype = Function.prototype;
|
|
907
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
908
|
+
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
|
909
|
+
|
|
910
|
+
var EXISTS = hasOwn(FunctionPrototype, 'name');
|
|
911
|
+
// additional protection from minified / mangled / dropped function names
|
|
912
|
+
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
|
913
|
+
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
|
914
|
+
|
|
915
|
+
functionName = {
|
|
916
|
+
EXISTS: EXISTS,
|
|
917
|
+
PROPER: PROPER,
|
|
918
|
+
CONFIGURABLE: CONFIGURABLE
|
|
919
|
+
};
|
|
920
|
+
return functionName;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
var inspectSource;
|
|
924
|
+
var hasRequiredInspectSource;
|
|
925
|
+
|
|
926
|
+
function requireInspectSource () {
|
|
927
|
+
if (hasRequiredInspectSource) return inspectSource;
|
|
928
|
+
hasRequiredInspectSource = 1;
|
|
929
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
930
|
+
var isCallable = requireIsCallable();
|
|
931
|
+
var store = requireSharedStore();
|
|
932
|
+
|
|
933
|
+
var functionToString = uncurryThis(Function.toString);
|
|
934
|
+
|
|
935
|
+
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
936
|
+
if (!isCallable(store.inspectSource)) {
|
|
937
|
+
store.inspectSource = function (it) {
|
|
938
|
+
return functionToString(it);
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
inspectSource = store.inspectSource;
|
|
943
|
+
return inspectSource;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
var weakMapBasicDetection;
|
|
947
|
+
var hasRequiredWeakMapBasicDetection;
|
|
948
|
+
|
|
949
|
+
function requireWeakMapBasicDetection () {
|
|
950
|
+
if (hasRequiredWeakMapBasicDetection) return weakMapBasicDetection;
|
|
951
|
+
hasRequiredWeakMapBasicDetection = 1;
|
|
952
|
+
var globalThis = requireGlobalThis();
|
|
953
|
+
var isCallable = requireIsCallable();
|
|
954
|
+
|
|
955
|
+
var WeakMap = globalThis.WeakMap;
|
|
956
|
+
|
|
957
|
+
weakMapBasicDetection = isCallable(WeakMap) && /native code/.test(String(WeakMap));
|
|
958
|
+
return weakMapBasicDetection;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
var sharedKey;
|
|
962
|
+
var hasRequiredSharedKey;
|
|
963
|
+
|
|
964
|
+
function requireSharedKey () {
|
|
965
|
+
if (hasRequiredSharedKey) return sharedKey;
|
|
966
|
+
hasRequiredSharedKey = 1;
|
|
967
|
+
var shared = requireShared();
|
|
968
|
+
var uid = requireUid();
|
|
969
|
+
|
|
970
|
+
var keys = shared('keys');
|
|
971
|
+
|
|
972
|
+
sharedKey = function (key) {
|
|
973
|
+
return keys[key] || (keys[key] = uid(key));
|
|
974
|
+
};
|
|
975
|
+
return sharedKey;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
var hiddenKeys;
|
|
979
|
+
var hasRequiredHiddenKeys;
|
|
980
|
+
|
|
981
|
+
function requireHiddenKeys () {
|
|
982
|
+
if (hasRequiredHiddenKeys) return hiddenKeys;
|
|
983
|
+
hasRequiredHiddenKeys = 1;
|
|
984
|
+
hiddenKeys = {};
|
|
985
|
+
return hiddenKeys;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
var internalState;
|
|
989
|
+
var hasRequiredInternalState;
|
|
990
|
+
|
|
991
|
+
function requireInternalState () {
|
|
992
|
+
if (hasRequiredInternalState) return internalState;
|
|
993
|
+
hasRequiredInternalState = 1;
|
|
994
|
+
var NATIVE_WEAK_MAP = requireWeakMapBasicDetection();
|
|
995
|
+
var globalThis = requireGlobalThis();
|
|
996
|
+
var isObject = requireIsObject();
|
|
997
|
+
var createNonEnumerableProperty = requireCreateNonEnumerableProperty();
|
|
998
|
+
var hasOwn = requireHasOwnProperty();
|
|
999
|
+
var shared = requireSharedStore();
|
|
1000
|
+
var sharedKey = requireSharedKey();
|
|
1001
|
+
var hiddenKeys = requireHiddenKeys();
|
|
1002
|
+
|
|
1003
|
+
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
1004
|
+
var TypeError = globalThis.TypeError;
|
|
1005
|
+
var WeakMap = globalThis.WeakMap;
|
|
1006
|
+
var set, get, has;
|
|
1007
|
+
|
|
1008
|
+
var enforce = function (it) {
|
|
1009
|
+
return has(it) ? get(it) : set(it, {});
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
var getterFor = function (TYPE) {
|
|
1013
|
+
return function (it) {
|
|
1014
|
+
var state;
|
|
1015
|
+
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
1016
|
+
throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
1017
|
+
} return state;
|
|
1018
|
+
};
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
if (NATIVE_WEAK_MAP || shared.state) {
|
|
1022
|
+
var store = shared.state || (shared.state = new WeakMap());
|
|
1023
|
+
/* eslint-disable no-self-assign -- prototype methods protection */
|
|
1024
|
+
store.get = store.get;
|
|
1025
|
+
store.has = store.has;
|
|
1026
|
+
store.set = store.set;
|
|
1027
|
+
/* eslint-enable no-self-assign -- prototype methods protection */
|
|
1028
|
+
set = function (it, metadata) {
|
|
1029
|
+
if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
1030
|
+
metadata.facade = it;
|
|
1031
|
+
store.set(it, metadata);
|
|
1032
|
+
return metadata;
|
|
1033
|
+
};
|
|
1034
|
+
get = function (it) {
|
|
1035
|
+
return store.get(it) || {};
|
|
1036
|
+
};
|
|
1037
|
+
has = function (it) {
|
|
1038
|
+
return store.has(it);
|
|
1039
|
+
};
|
|
1040
|
+
} else {
|
|
1041
|
+
var STATE = sharedKey('state');
|
|
1042
|
+
hiddenKeys[STATE] = true;
|
|
1043
|
+
set = function (it, metadata) {
|
|
1044
|
+
if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
1045
|
+
metadata.facade = it;
|
|
1046
|
+
createNonEnumerableProperty(it, STATE, metadata);
|
|
1047
|
+
return metadata;
|
|
1048
|
+
};
|
|
1049
|
+
get = function (it) {
|
|
1050
|
+
return hasOwn(it, STATE) ? it[STATE] : {};
|
|
1051
|
+
};
|
|
1052
|
+
has = function (it) {
|
|
1053
|
+
return hasOwn(it, STATE);
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
internalState = {
|
|
1058
|
+
set: set,
|
|
1059
|
+
get: get,
|
|
1060
|
+
has: has,
|
|
1061
|
+
enforce: enforce,
|
|
1062
|
+
getterFor: getterFor
|
|
1063
|
+
};
|
|
1064
|
+
return internalState;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
var hasRequiredMakeBuiltIn;
|
|
1068
|
+
|
|
1069
|
+
function requireMakeBuiltIn () {
|
|
1070
|
+
if (hasRequiredMakeBuiltIn) return makeBuiltIn.exports;
|
|
1071
|
+
hasRequiredMakeBuiltIn = 1;
|
|
1072
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1073
|
+
var fails = requireFails();
|
|
1074
|
+
var isCallable = requireIsCallable();
|
|
1075
|
+
var hasOwn = requireHasOwnProperty();
|
|
1076
|
+
var DESCRIPTORS = requireDescriptors();
|
|
1077
|
+
var CONFIGURABLE_FUNCTION_NAME = requireFunctionName().CONFIGURABLE;
|
|
1078
|
+
var inspectSource = requireInspectSource();
|
|
1079
|
+
var InternalStateModule = requireInternalState();
|
|
1080
|
+
|
|
1081
|
+
var enforceInternalState = InternalStateModule.enforce;
|
|
1082
|
+
var getInternalState = InternalStateModule.get;
|
|
1083
|
+
var $String = String;
|
|
1084
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
1085
|
+
var defineProperty = Object.defineProperty;
|
|
1086
|
+
var stringSlice = uncurryThis(''.slice);
|
|
1087
|
+
var replace = uncurryThis(''.replace);
|
|
1088
|
+
var join = uncurryThis([].join);
|
|
1089
|
+
|
|
1090
|
+
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
|
|
1091
|
+
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
var TEMPLATE = String(String).split('String');
|
|
1095
|
+
|
|
1096
|
+
var makeBuiltIn$1 = makeBuiltIn.exports = function (value, name, options) {
|
|
1097
|
+
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
1098
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
1099
|
+
}
|
|
1100
|
+
if (options && options.getter) name = 'get ' + name;
|
|
1101
|
+
if (options && options.setter) name = 'set ' + name;
|
|
1102
|
+
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
|
1103
|
+
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
|
|
1104
|
+
else value.name = name;
|
|
1105
|
+
}
|
|
1106
|
+
if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
|
|
1107
|
+
defineProperty(value, 'length', { value: options.arity });
|
|
1108
|
+
}
|
|
1109
|
+
try {
|
|
1110
|
+
if (options && hasOwn(options, 'constructor') && options.constructor) {
|
|
1111
|
+
if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
|
|
1112
|
+
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
|
|
1113
|
+
} else if (value.prototype) value.prototype = undefined;
|
|
1114
|
+
} catch (error) { /* empty */ }
|
|
1115
|
+
var state = enforceInternalState(value);
|
|
1116
|
+
if (!hasOwn(state, 'source')) {
|
|
1117
|
+
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
|
1118
|
+
} return value;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
1122
|
+
// eslint-disable-next-line no-extend-native -- required
|
|
1123
|
+
Function.prototype.toString = makeBuiltIn$1(function toString() {
|
|
1124
|
+
return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
|
1125
|
+
}, 'toString');
|
|
1126
|
+
return makeBuiltIn.exports;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
var defineBuiltIn;
|
|
1130
|
+
var hasRequiredDefineBuiltIn;
|
|
1131
|
+
|
|
1132
|
+
function requireDefineBuiltIn () {
|
|
1133
|
+
if (hasRequiredDefineBuiltIn) return defineBuiltIn;
|
|
1134
|
+
hasRequiredDefineBuiltIn = 1;
|
|
1135
|
+
var isCallable = requireIsCallable();
|
|
1136
|
+
var definePropertyModule = requireObjectDefineProperty();
|
|
1137
|
+
var makeBuiltIn = requireMakeBuiltIn();
|
|
1138
|
+
var defineGlobalProperty = requireDefineGlobalProperty();
|
|
1139
|
+
|
|
1140
|
+
defineBuiltIn = function (O, key, value, options) {
|
|
1141
|
+
if (!options) options = {};
|
|
1142
|
+
var simple = options.enumerable;
|
|
1143
|
+
var name = options.name !== undefined ? options.name : key;
|
|
1144
|
+
if (isCallable(value)) makeBuiltIn(value, name, options);
|
|
1145
|
+
if (options.global) {
|
|
1146
|
+
if (simple) O[key] = value;
|
|
1147
|
+
else defineGlobalProperty(key, value);
|
|
1148
|
+
} else {
|
|
1149
|
+
try {
|
|
1150
|
+
if (!options.unsafe) delete O[key];
|
|
1151
|
+
else if (O[key]) simple = true;
|
|
1152
|
+
} catch (error) { /* empty */ }
|
|
1153
|
+
if (simple) O[key] = value;
|
|
1154
|
+
else definePropertyModule.f(O, key, {
|
|
1155
|
+
value: value,
|
|
1156
|
+
enumerable: false,
|
|
1157
|
+
configurable: !options.nonConfigurable,
|
|
1158
|
+
writable: !options.nonWritable
|
|
1159
|
+
});
|
|
1160
|
+
} return O;
|
|
1161
|
+
};
|
|
1162
|
+
return defineBuiltIn;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
var objectGetOwnPropertyNames = {};
|
|
1166
|
+
|
|
1167
|
+
var mathTrunc;
|
|
1168
|
+
var hasRequiredMathTrunc;
|
|
1169
|
+
|
|
1170
|
+
function requireMathTrunc () {
|
|
1171
|
+
if (hasRequiredMathTrunc) return mathTrunc;
|
|
1172
|
+
hasRequiredMathTrunc = 1;
|
|
1173
|
+
var ceil = Math.ceil;
|
|
1174
|
+
var floor = Math.floor;
|
|
1175
|
+
|
|
1176
|
+
// `Math.trunc` method
|
|
1177
|
+
// https://tc39.es/ecma262/#sec-math.trunc
|
|
1178
|
+
// eslint-disable-next-line es/no-math-trunc -- safe
|
|
1179
|
+
mathTrunc = Math.trunc || function trunc(x) {
|
|
1180
|
+
var n = +x;
|
|
1181
|
+
return (n > 0 ? floor : ceil)(n);
|
|
1182
|
+
};
|
|
1183
|
+
return mathTrunc;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
var toIntegerOrInfinity;
|
|
1187
|
+
var hasRequiredToIntegerOrInfinity;
|
|
1188
|
+
|
|
1189
|
+
function requireToIntegerOrInfinity () {
|
|
1190
|
+
if (hasRequiredToIntegerOrInfinity) return toIntegerOrInfinity;
|
|
1191
|
+
hasRequiredToIntegerOrInfinity = 1;
|
|
1192
|
+
var trunc = requireMathTrunc();
|
|
1193
|
+
|
|
1194
|
+
// `ToIntegerOrInfinity` abstract operation
|
|
1195
|
+
// https://tc39.es/ecma262/#sec-tointegerorinfinity
|
|
1196
|
+
toIntegerOrInfinity = function (argument) {
|
|
1197
|
+
var number = +argument;
|
|
1198
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1199
|
+
return number !== number || number === 0 ? 0 : trunc(number);
|
|
1200
|
+
};
|
|
1201
|
+
return toIntegerOrInfinity;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
var toAbsoluteIndex;
|
|
1205
|
+
var hasRequiredToAbsoluteIndex;
|
|
1206
|
+
|
|
1207
|
+
function requireToAbsoluteIndex () {
|
|
1208
|
+
if (hasRequiredToAbsoluteIndex) return toAbsoluteIndex;
|
|
1209
|
+
hasRequiredToAbsoluteIndex = 1;
|
|
1210
|
+
var toIntegerOrInfinity = requireToIntegerOrInfinity();
|
|
1211
|
+
|
|
1212
|
+
var max = Math.max;
|
|
1213
|
+
var min = Math.min;
|
|
1214
|
+
|
|
1215
|
+
// Helper for a popular repeating case of the spec:
|
|
1216
|
+
// Let integer be ? ToInteger(index).
|
|
1217
|
+
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
1218
|
+
toAbsoluteIndex = function (index, length) {
|
|
1219
|
+
var integer = toIntegerOrInfinity(index);
|
|
1220
|
+
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
1221
|
+
};
|
|
1222
|
+
return toAbsoluteIndex;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
var toLength;
|
|
1226
|
+
var hasRequiredToLength;
|
|
1227
|
+
|
|
1228
|
+
function requireToLength () {
|
|
1229
|
+
if (hasRequiredToLength) return toLength;
|
|
1230
|
+
hasRequiredToLength = 1;
|
|
1231
|
+
var toIntegerOrInfinity = requireToIntegerOrInfinity();
|
|
1232
|
+
|
|
1233
|
+
var min = Math.min;
|
|
1234
|
+
|
|
1235
|
+
// `ToLength` abstract operation
|
|
1236
|
+
// https://tc39.es/ecma262/#sec-tolength
|
|
1237
|
+
toLength = function (argument) {
|
|
1238
|
+
var len = toIntegerOrInfinity(argument);
|
|
1239
|
+
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
1240
|
+
};
|
|
1241
|
+
return toLength;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
var lengthOfArrayLike;
|
|
1245
|
+
var hasRequiredLengthOfArrayLike;
|
|
1246
|
+
|
|
1247
|
+
function requireLengthOfArrayLike () {
|
|
1248
|
+
if (hasRequiredLengthOfArrayLike) return lengthOfArrayLike;
|
|
1249
|
+
hasRequiredLengthOfArrayLike = 1;
|
|
1250
|
+
var toLength = requireToLength();
|
|
1251
|
+
|
|
1252
|
+
// `LengthOfArrayLike` abstract operation
|
|
1253
|
+
// https://tc39.es/ecma262/#sec-lengthofarraylike
|
|
1254
|
+
lengthOfArrayLike = function (obj) {
|
|
1255
|
+
return toLength(obj.length);
|
|
1256
|
+
};
|
|
1257
|
+
return lengthOfArrayLike;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
var arrayIncludes;
|
|
1261
|
+
var hasRequiredArrayIncludes;
|
|
1262
|
+
|
|
1263
|
+
function requireArrayIncludes () {
|
|
1264
|
+
if (hasRequiredArrayIncludes) return arrayIncludes;
|
|
1265
|
+
hasRequiredArrayIncludes = 1;
|
|
1266
|
+
var toIndexedObject = requireToIndexedObject();
|
|
1267
|
+
var toAbsoluteIndex = requireToAbsoluteIndex();
|
|
1268
|
+
var lengthOfArrayLike = requireLengthOfArrayLike();
|
|
1269
|
+
|
|
1270
|
+
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
1271
|
+
var createMethod = function (IS_INCLUDES) {
|
|
1272
|
+
return function ($this, el, fromIndex) {
|
|
1273
|
+
var O = toIndexedObject($this);
|
|
1274
|
+
var length = lengthOfArrayLike(O);
|
|
1275
|
+
if (length === 0) return !IS_INCLUDES && -1;
|
|
1276
|
+
var index = toAbsoluteIndex(fromIndex, length);
|
|
1277
|
+
var value;
|
|
1278
|
+
// Array#includes uses SameValueZero equality algorithm
|
|
1279
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1280
|
+
if (IS_INCLUDES && el !== el) while (length > index) {
|
|
1281
|
+
value = O[index++];
|
|
1282
|
+
// eslint-disable-next-line no-self-compare -- NaN check
|
|
1283
|
+
if (value !== value) return true;
|
|
1284
|
+
// Array#indexOf ignores holes, Array#includes - not
|
|
1285
|
+
} else for (;length > index; index++) {
|
|
1286
|
+
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
1287
|
+
} return !IS_INCLUDES && -1;
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
arrayIncludes = {
|
|
1292
|
+
// `Array.prototype.includes` method
|
|
1293
|
+
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
1294
|
+
includes: createMethod(true),
|
|
1295
|
+
// `Array.prototype.indexOf` method
|
|
1296
|
+
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
1297
|
+
indexOf: createMethod(false)
|
|
1298
|
+
};
|
|
1299
|
+
return arrayIncludes;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
var objectKeysInternal;
|
|
1303
|
+
var hasRequiredObjectKeysInternal;
|
|
1304
|
+
|
|
1305
|
+
function requireObjectKeysInternal () {
|
|
1306
|
+
if (hasRequiredObjectKeysInternal) return objectKeysInternal;
|
|
1307
|
+
hasRequiredObjectKeysInternal = 1;
|
|
1308
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1309
|
+
var hasOwn = requireHasOwnProperty();
|
|
1310
|
+
var toIndexedObject = requireToIndexedObject();
|
|
1311
|
+
var indexOf = requireArrayIncludes().indexOf;
|
|
1312
|
+
var hiddenKeys = requireHiddenKeys();
|
|
1313
|
+
|
|
1314
|
+
var push = uncurryThis([].push);
|
|
1315
|
+
|
|
1316
|
+
objectKeysInternal = function (object, names) {
|
|
1317
|
+
var O = toIndexedObject(object);
|
|
1318
|
+
var i = 0;
|
|
1319
|
+
var result = [];
|
|
1320
|
+
var key;
|
|
1321
|
+
for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
|
1322
|
+
// Don't enum bug & hidden keys
|
|
1323
|
+
while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
|
1324
|
+
~indexOf(result, key) || push(result, key);
|
|
1325
|
+
}
|
|
1326
|
+
return result;
|
|
1327
|
+
};
|
|
1328
|
+
return objectKeysInternal;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
var enumBugKeys;
|
|
1332
|
+
var hasRequiredEnumBugKeys;
|
|
1333
|
+
|
|
1334
|
+
function requireEnumBugKeys () {
|
|
1335
|
+
if (hasRequiredEnumBugKeys) return enumBugKeys;
|
|
1336
|
+
hasRequiredEnumBugKeys = 1;
|
|
1337
|
+
// IE8- don't enum bug keys
|
|
1338
|
+
enumBugKeys = [
|
|
1339
|
+
'constructor',
|
|
1340
|
+
'hasOwnProperty',
|
|
1341
|
+
'isPrototypeOf',
|
|
1342
|
+
'propertyIsEnumerable',
|
|
1343
|
+
'toLocaleString',
|
|
1344
|
+
'toString',
|
|
1345
|
+
'valueOf'
|
|
1346
|
+
];
|
|
1347
|
+
return enumBugKeys;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
var hasRequiredObjectGetOwnPropertyNames;
|
|
1351
|
+
|
|
1352
|
+
function requireObjectGetOwnPropertyNames () {
|
|
1353
|
+
if (hasRequiredObjectGetOwnPropertyNames) return objectGetOwnPropertyNames;
|
|
1354
|
+
hasRequiredObjectGetOwnPropertyNames = 1;
|
|
1355
|
+
var internalObjectKeys = requireObjectKeysInternal();
|
|
1356
|
+
var enumBugKeys = requireEnumBugKeys();
|
|
1357
|
+
|
|
1358
|
+
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
1359
|
+
|
|
1360
|
+
// `Object.getOwnPropertyNames` method
|
|
1361
|
+
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
1362
|
+
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
1363
|
+
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
1364
|
+
return internalObjectKeys(O, hiddenKeys);
|
|
1365
|
+
};
|
|
1366
|
+
return objectGetOwnPropertyNames;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
var objectGetOwnPropertySymbols = {};
|
|
1370
|
+
|
|
1371
|
+
var hasRequiredObjectGetOwnPropertySymbols;
|
|
1372
|
+
|
|
1373
|
+
function requireObjectGetOwnPropertySymbols () {
|
|
1374
|
+
if (hasRequiredObjectGetOwnPropertySymbols) return objectGetOwnPropertySymbols;
|
|
1375
|
+
hasRequiredObjectGetOwnPropertySymbols = 1;
|
|
1376
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
1377
|
+
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
1378
|
+
return objectGetOwnPropertySymbols;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
var ownKeys;
|
|
1382
|
+
var hasRequiredOwnKeys;
|
|
1383
|
+
|
|
1384
|
+
function requireOwnKeys () {
|
|
1385
|
+
if (hasRequiredOwnKeys) return ownKeys;
|
|
1386
|
+
hasRequiredOwnKeys = 1;
|
|
1387
|
+
var getBuiltIn = requireGetBuiltIn();
|
|
1388
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1389
|
+
var getOwnPropertyNamesModule = requireObjectGetOwnPropertyNames();
|
|
1390
|
+
var getOwnPropertySymbolsModule = requireObjectGetOwnPropertySymbols();
|
|
1391
|
+
var anObject = requireAnObject();
|
|
1392
|
+
|
|
1393
|
+
var concat = uncurryThis([].concat);
|
|
1394
|
+
|
|
1395
|
+
// all object keys, includes non-enumerable and symbols
|
|
1396
|
+
ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
1397
|
+
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
1398
|
+
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
1399
|
+
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
|
1400
|
+
};
|
|
1401
|
+
return ownKeys;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
var copyConstructorProperties;
|
|
1405
|
+
var hasRequiredCopyConstructorProperties;
|
|
1406
|
+
|
|
1407
|
+
function requireCopyConstructorProperties () {
|
|
1408
|
+
if (hasRequiredCopyConstructorProperties) return copyConstructorProperties;
|
|
1409
|
+
hasRequiredCopyConstructorProperties = 1;
|
|
1410
|
+
var hasOwn = requireHasOwnProperty();
|
|
1411
|
+
var ownKeys = requireOwnKeys();
|
|
1412
|
+
var getOwnPropertyDescriptorModule = requireObjectGetOwnPropertyDescriptor();
|
|
1413
|
+
var definePropertyModule = requireObjectDefineProperty();
|
|
1414
|
+
|
|
1415
|
+
copyConstructorProperties = function (target, source, exceptions) {
|
|
1416
|
+
var keys = ownKeys(source);
|
|
1417
|
+
var defineProperty = definePropertyModule.f;
|
|
1418
|
+
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
1419
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1420
|
+
var key = keys[i];
|
|
1421
|
+
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
|
1422
|
+
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
};
|
|
1426
|
+
return copyConstructorProperties;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
var isForced_1;
|
|
1430
|
+
var hasRequiredIsForced;
|
|
1431
|
+
|
|
1432
|
+
function requireIsForced () {
|
|
1433
|
+
if (hasRequiredIsForced) return isForced_1;
|
|
1434
|
+
hasRequiredIsForced = 1;
|
|
1435
|
+
var fails = requireFails();
|
|
1436
|
+
var isCallable = requireIsCallable();
|
|
1437
|
+
|
|
1438
|
+
var replacement = /#|\.prototype\./;
|
|
1439
|
+
|
|
1440
|
+
var isForced = function (feature, detection) {
|
|
1441
|
+
var value = data[normalize(feature)];
|
|
1442
|
+
return value === POLYFILL ? true
|
|
1443
|
+
: value === NATIVE ? false
|
|
1444
|
+
: isCallable(detection) ? fails(detection)
|
|
1445
|
+
: !!detection;
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
var normalize = isForced.normalize = function (string) {
|
|
1449
|
+
return String(string).replace(replacement, '.').toLowerCase();
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
var data = isForced.data = {};
|
|
1453
|
+
var NATIVE = isForced.NATIVE = 'N';
|
|
1454
|
+
var POLYFILL = isForced.POLYFILL = 'P';
|
|
1455
|
+
|
|
1456
|
+
isForced_1 = isForced;
|
|
1457
|
+
return isForced_1;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
var _export;
|
|
1461
|
+
var hasRequired_export;
|
|
1462
|
+
|
|
1463
|
+
function require_export () {
|
|
1464
|
+
if (hasRequired_export) return _export;
|
|
1465
|
+
hasRequired_export = 1;
|
|
1466
|
+
var globalThis = requireGlobalThis();
|
|
1467
|
+
var getOwnPropertyDescriptor = requireObjectGetOwnPropertyDescriptor().f;
|
|
1468
|
+
var createNonEnumerableProperty = requireCreateNonEnumerableProperty();
|
|
1469
|
+
var defineBuiltIn = requireDefineBuiltIn();
|
|
1470
|
+
var defineGlobalProperty = requireDefineGlobalProperty();
|
|
1471
|
+
var copyConstructorProperties = requireCopyConstructorProperties();
|
|
1472
|
+
var isForced = requireIsForced();
|
|
1473
|
+
|
|
1474
|
+
/*
|
|
1475
|
+
options.target - name of the target object
|
|
1476
|
+
options.global - target is the global object
|
|
1477
|
+
options.stat - export as static methods of target
|
|
1478
|
+
options.proto - export as prototype methods of target
|
|
1479
|
+
options.real - real prototype method for the `pure` version
|
|
1480
|
+
options.forced - export even if the native feature is available
|
|
1481
|
+
options.bind - bind methods to the target, required for the `pure` version
|
|
1482
|
+
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
1483
|
+
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
1484
|
+
options.sham - add a flag to not completely full polyfills
|
|
1485
|
+
options.enumerable - export as enumerable property
|
|
1486
|
+
options.dontCallGetSet - prevent calling a getter on target
|
|
1487
|
+
options.name - the .name of the function if it does not match the key
|
|
1488
|
+
*/
|
|
1489
|
+
_export = function (options, source) {
|
|
1490
|
+
var TARGET = options.target;
|
|
1491
|
+
var GLOBAL = options.global;
|
|
1492
|
+
var STATIC = options.stat;
|
|
1493
|
+
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
1494
|
+
if (GLOBAL) {
|
|
1495
|
+
target = globalThis;
|
|
1496
|
+
} else if (STATIC) {
|
|
1497
|
+
target = globalThis[TARGET] || defineGlobalProperty(TARGET, {});
|
|
1498
|
+
} else {
|
|
1499
|
+
target = globalThis[TARGET] && globalThis[TARGET].prototype;
|
|
1500
|
+
}
|
|
1501
|
+
if (target) for (key in source) {
|
|
1502
|
+
sourceProperty = source[key];
|
|
1503
|
+
if (options.dontCallGetSet) {
|
|
1504
|
+
descriptor = getOwnPropertyDescriptor(target, key);
|
|
1505
|
+
targetProperty = descriptor && descriptor.value;
|
|
1506
|
+
} else targetProperty = target[key];
|
|
1507
|
+
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
1508
|
+
// contained in target
|
|
1509
|
+
if (!FORCED && targetProperty !== undefined) {
|
|
1510
|
+
if (typeof sourceProperty == typeof targetProperty) continue;
|
|
1511
|
+
copyConstructorProperties(sourceProperty, targetProperty);
|
|
1512
|
+
}
|
|
1513
|
+
// add a flag to not completely full polyfills
|
|
1514
|
+
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
1515
|
+
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
1516
|
+
}
|
|
1517
|
+
defineBuiltIn(target, key, sourceProperty, options);
|
|
1518
|
+
}
|
|
1519
|
+
};
|
|
1520
|
+
return _export;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
var toStringTagSupport;
|
|
1524
|
+
var hasRequiredToStringTagSupport;
|
|
1525
|
+
|
|
1526
|
+
function requireToStringTagSupport () {
|
|
1527
|
+
if (hasRequiredToStringTagSupport) return toStringTagSupport;
|
|
1528
|
+
hasRequiredToStringTagSupport = 1;
|
|
1529
|
+
var wellKnownSymbol = requireWellKnownSymbol();
|
|
1530
|
+
|
|
1531
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
1532
|
+
var test = {};
|
|
1533
|
+
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
|
|
1534
|
+
test[TO_STRING_TAG] = 'z';
|
|
1535
|
+
|
|
1536
|
+
toStringTagSupport = String(test) === '[object z]';
|
|
1537
|
+
return toStringTagSupport;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
var classof;
|
|
1541
|
+
var hasRequiredClassof;
|
|
1542
|
+
|
|
1543
|
+
function requireClassof () {
|
|
1544
|
+
if (hasRequiredClassof) return classof;
|
|
1545
|
+
hasRequiredClassof = 1;
|
|
1546
|
+
var TO_STRING_TAG_SUPPORT = requireToStringTagSupport();
|
|
1547
|
+
var isCallable = requireIsCallable();
|
|
1548
|
+
var classofRaw = requireClassofRaw();
|
|
1549
|
+
var wellKnownSymbol = requireWellKnownSymbol();
|
|
1550
|
+
|
|
1551
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
1552
|
+
var $Object = Object;
|
|
1553
|
+
|
|
1554
|
+
// ES3 wrong here
|
|
1555
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
1556
|
+
|
|
1557
|
+
// fallback for IE11 Script Access Denied error
|
|
1558
|
+
var tryGet = function (it, key) {
|
|
1559
|
+
try {
|
|
1560
|
+
return it[key];
|
|
1561
|
+
} catch (error) { /* empty */ }
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
1565
|
+
classof = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
1566
|
+
var O, tag, result;
|
|
1567
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
1568
|
+
// @@toStringTag case
|
|
1569
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
1570
|
+
// builtinTag case
|
|
1571
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
1572
|
+
// ES3 arguments fallback
|
|
1573
|
+
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
1574
|
+
};
|
|
1575
|
+
return classof;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
var toString;
|
|
1579
|
+
var hasRequiredToString;
|
|
1580
|
+
|
|
1581
|
+
function requireToString () {
|
|
1582
|
+
if (hasRequiredToString) return toString;
|
|
1583
|
+
hasRequiredToString = 1;
|
|
1584
|
+
var classof = requireClassof();
|
|
1585
|
+
|
|
1586
|
+
var $String = String;
|
|
1587
|
+
|
|
1588
|
+
toString = function (argument) {
|
|
1589
|
+
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1590
|
+
return $String(argument);
|
|
1591
|
+
};
|
|
1592
|
+
return toString;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
var defineBuiltInAccessor;
|
|
1596
|
+
var hasRequiredDefineBuiltInAccessor;
|
|
1597
|
+
|
|
1598
|
+
function requireDefineBuiltInAccessor () {
|
|
1599
|
+
if (hasRequiredDefineBuiltInAccessor) return defineBuiltInAccessor;
|
|
1600
|
+
hasRequiredDefineBuiltInAccessor = 1;
|
|
1601
|
+
var makeBuiltIn = requireMakeBuiltIn();
|
|
1602
|
+
var defineProperty = requireObjectDefineProperty();
|
|
1603
|
+
|
|
1604
|
+
defineBuiltInAccessor = function (target, name, descriptor) {
|
|
1605
|
+
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
|
1606
|
+
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
|
1607
|
+
return defineProperty.f(target, name, descriptor);
|
|
1608
|
+
};
|
|
1609
|
+
return defineBuiltInAccessor;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
var hasRequiredEs_symbol_description;
|
|
1613
|
+
|
|
1614
|
+
function requireEs_symbol_description () {
|
|
1615
|
+
if (hasRequiredEs_symbol_description) return es_symbol_description;
|
|
1616
|
+
hasRequiredEs_symbol_description = 1;
|
|
1617
|
+
var $ = require_export();
|
|
1618
|
+
var DESCRIPTORS = requireDescriptors();
|
|
1619
|
+
var globalThis = requireGlobalThis();
|
|
1620
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1621
|
+
var hasOwn = requireHasOwnProperty();
|
|
1622
|
+
var isCallable = requireIsCallable();
|
|
1623
|
+
var isPrototypeOf = requireObjectIsPrototypeOf();
|
|
1624
|
+
var toString = requireToString();
|
|
1625
|
+
var defineBuiltInAccessor = requireDefineBuiltInAccessor();
|
|
1626
|
+
var copyConstructorProperties = requireCopyConstructorProperties();
|
|
1627
|
+
|
|
1628
|
+
var NativeSymbol = globalThis.Symbol;
|
|
1629
|
+
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
|
1630
|
+
|
|
1631
|
+
if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
|
1632
|
+
// Safari 12 bug
|
|
1633
|
+
NativeSymbol().description !== undefined
|
|
1634
|
+
)) {
|
|
1635
|
+
var EmptyStringDescriptionStore = {};
|
|
1636
|
+
// wrap Symbol constructor for correct work with undefined description
|
|
1637
|
+
var SymbolWrapper = function Symbol() {
|
|
1638
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
|
1639
|
+
var result = isPrototypeOf(SymbolPrototype, this)
|
|
1640
|
+
// eslint-disable-next-line sonarjs/inconsistent-function-call -- ok
|
|
1641
|
+
? new NativeSymbol(description)
|
|
1642
|
+
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
1643
|
+
: description === undefined ? NativeSymbol() : NativeSymbol(description);
|
|
1644
|
+
if (description === '') EmptyStringDescriptionStore[result] = true;
|
|
1645
|
+
return result;
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
|
1649
|
+
SymbolWrapper.prototype = SymbolPrototype;
|
|
1650
|
+
SymbolPrototype.constructor = SymbolWrapper;
|
|
1651
|
+
|
|
1652
|
+
var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
|
|
1653
|
+
var thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
|
|
1654
|
+
var symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
|
|
1655
|
+
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
1656
|
+
var replace = uncurryThis(''.replace);
|
|
1657
|
+
var stringSlice = uncurryThis(''.slice);
|
|
1658
|
+
|
|
1659
|
+
defineBuiltInAccessor(SymbolPrototype, 'description', {
|
|
1660
|
+
configurable: true,
|
|
1661
|
+
get: function description() {
|
|
1662
|
+
var symbol = thisSymbolValue(this);
|
|
1663
|
+
if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
|
1664
|
+
var string = symbolDescriptiveString(symbol);
|
|
1665
|
+
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
|
1666
|
+
return desc === '' ? undefined : desc;
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
|
|
1670
|
+
$({ global: true, constructor: true, forced: true }, {
|
|
1671
|
+
Symbol: SymbolWrapper
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
return es_symbol_description;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
requireEs_symbol_description();
|
|
1678
|
+
|
|
1679
|
+
var es_array_sort = {};
|
|
1680
|
+
|
|
1681
|
+
var deletePropertyOrThrow;
|
|
1682
|
+
var hasRequiredDeletePropertyOrThrow;
|
|
1683
|
+
|
|
1684
|
+
function requireDeletePropertyOrThrow () {
|
|
1685
|
+
if (hasRequiredDeletePropertyOrThrow) return deletePropertyOrThrow;
|
|
1686
|
+
hasRequiredDeletePropertyOrThrow = 1;
|
|
1687
|
+
var tryToString = requireTryToString();
|
|
1688
|
+
|
|
1689
|
+
var $TypeError = TypeError;
|
|
1690
|
+
|
|
1691
|
+
deletePropertyOrThrow = function (O, P) {
|
|
1692
|
+
if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
|
1693
|
+
};
|
|
1694
|
+
return deletePropertyOrThrow;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
var arraySlice;
|
|
1698
|
+
var hasRequiredArraySlice;
|
|
1699
|
+
|
|
1700
|
+
function requireArraySlice () {
|
|
1701
|
+
if (hasRequiredArraySlice) return arraySlice;
|
|
1702
|
+
hasRequiredArraySlice = 1;
|
|
1703
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1704
|
+
|
|
1705
|
+
arraySlice = uncurryThis([].slice);
|
|
1706
|
+
return arraySlice;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
var arraySort;
|
|
1710
|
+
var hasRequiredArraySort;
|
|
1711
|
+
|
|
1712
|
+
function requireArraySort () {
|
|
1713
|
+
if (hasRequiredArraySort) return arraySort;
|
|
1714
|
+
hasRequiredArraySort = 1;
|
|
1715
|
+
var arraySlice = requireArraySlice();
|
|
1716
|
+
|
|
1717
|
+
var floor = Math.floor;
|
|
1718
|
+
|
|
1719
|
+
var sort = function (array, comparefn) {
|
|
1720
|
+
var length = array.length;
|
|
1721
|
+
|
|
1722
|
+
if (length < 8) {
|
|
1723
|
+
// insertion sort
|
|
1724
|
+
var i = 1;
|
|
1725
|
+
var element, j;
|
|
1726
|
+
|
|
1727
|
+
while (i < length) {
|
|
1728
|
+
j = i;
|
|
1729
|
+
element = array[i];
|
|
1730
|
+
while (j && comparefn(array[j - 1], element) > 0) {
|
|
1731
|
+
array[j] = array[--j];
|
|
1732
|
+
}
|
|
1733
|
+
if (j !== i++) array[j] = element;
|
|
1734
|
+
}
|
|
1735
|
+
} else {
|
|
1736
|
+
// merge sort
|
|
1737
|
+
var middle = floor(length / 2);
|
|
1738
|
+
var left = sort(arraySlice(array, 0, middle), comparefn);
|
|
1739
|
+
var right = sort(arraySlice(array, middle), comparefn);
|
|
1740
|
+
var llength = left.length;
|
|
1741
|
+
var rlength = right.length;
|
|
1742
|
+
var lindex = 0;
|
|
1743
|
+
var rindex = 0;
|
|
1744
|
+
|
|
1745
|
+
while (lindex < llength || rindex < rlength) {
|
|
1746
|
+
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
1747
|
+
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
1748
|
+
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
return array;
|
|
1753
|
+
};
|
|
1754
|
+
|
|
1755
|
+
arraySort = sort;
|
|
1756
|
+
return arraySort;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
var arrayMethodIsStrict;
|
|
1760
|
+
var hasRequiredArrayMethodIsStrict;
|
|
1761
|
+
|
|
1762
|
+
function requireArrayMethodIsStrict () {
|
|
1763
|
+
if (hasRequiredArrayMethodIsStrict) return arrayMethodIsStrict;
|
|
1764
|
+
hasRequiredArrayMethodIsStrict = 1;
|
|
1765
|
+
var fails = requireFails();
|
|
1766
|
+
|
|
1767
|
+
arrayMethodIsStrict = function (METHOD_NAME, argument) {
|
|
1768
|
+
var method = [][METHOD_NAME];
|
|
1769
|
+
return !!method && fails(function () {
|
|
1770
|
+
// eslint-disable-next-line no-useless-call -- required for testing
|
|
1771
|
+
method.call(null, argument || function () { return 1; }, 1);
|
|
1772
|
+
});
|
|
1773
|
+
};
|
|
1774
|
+
return arrayMethodIsStrict;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
var environmentFfVersion;
|
|
1778
|
+
var hasRequiredEnvironmentFfVersion;
|
|
1779
|
+
|
|
1780
|
+
function requireEnvironmentFfVersion () {
|
|
1781
|
+
if (hasRequiredEnvironmentFfVersion) return environmentFfVersion;
|
|
1782
|
+
hasRequiredEnvironmentFfVersion = 1;
|
|
1783
|
+
var userAgent = requireEnvironmentUserAgent();
|
|
1784
|
+
|
|
1785
|
+
var firefox = userAgent.match(/firefox\/(\d+)/i);
|
|
1786
|
+
|
|
1787
|
+
environmentFfVersion = !!firefox && +firefox[1];
|
|
1788
|
+
return environmentFfVersion;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
var environmentIsIeOrEdge;
|
|
1792
|
+
var hasRequiredEnvironmentIsIeOrEdge;
|
|
1793
|
+
|
|
1794
|
+
function requireEnvironmentIsIeOrEdge () {
|
|
1795
|
+
if (hasRequiredEnvironmentIsIeOrEdge) return environmentIsIeOrEdge;
|
|
1796
|
+
hasRequiredEnvironmentIsIeOrEdge = 1;
|
|
1797
|
+
var UA = requireEnvironmentUserAgent();
|
|
1798
|
+
|
|
1799
|
+
environmentIsIeOrEdge = /MSIE|Trident/.test(UA);
|
|
1800
|
+
return environmentIsIeOrEdge;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
var environmentWebkitVersion;
|
|
1804
|
+
var hasRequiredEnvironmentWebkitVersion;
|
|
1805
|
+
|
|
1806
|
+
function requireEnvironmentWebkitVersion () {
|
|
1807
|
+
if (hasRequiredEnvironmentWebkitVersion) return environmentWebkitVersion;
|
|
1808
|
+
hasRequiredEnvironmentWebkitVersion = 1;
|
|
1809
|
+
var userAgent = requireEnvironmentUserAgent();
|
|
1810
|
+
|
|
1811
|
+
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
|
1812
|
+
|
|
1813
|
+
environmentWebkitVersion = !!webkit && +webkit[1];
|
|
1814
|
+
return environmentWebkitVersion;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
var hasRequiredEs_array_sort;
|
|
1818
|
+
|
|
1819
|
+
function requireEs_array_sort () {
|
|
1820
|
+
if (hasRequiredEs_array_sort) return es_array_sort;
|
|
1821
|
+
hasRequiredEs_array_sort = 1;
|
|
1822
|
+
var $ = require_export();
|
|
1823
|
+
var uncurryThis = requireFunctionUncurryThis();
|
|
1824
|
+
var aCallable = requireACallable();
|
|
1825
|
+
var toObject = requireToObject();
|
|
1826
|
+
var lengthOfArrayLike = requireLengthOfArrayLike();
|
|
1827
|
+
var deletePropertyOrThrow = requireDeletePropertyOrThrow();
|
|
1828
|
+
var toString = requireToString();
|
|
1829
|
+
var fails = requireFails();
|
|
1830
|
+
var internalSort = requireArraySort();
|
|
1831
|
+
var arrayMethodIsStrict = requireArrayMethodIsStrict();
|
|
1832
|
+
var FF = requireEnvironmentFfVersion();
|
|
1833
|
+
var IE_OR_EDGE = requireEnvironmentIsIeOrEdge();
|
|
1834
|
+
var V8 = requireEnvironmentV8Version();
|
|
1835
|
+
var WEBKIT = requireEnvironmentWebkitVersion();
|
|
1836
|
+
|
|
1837
|
+
var test = [];
|
|
1838
|
+
var nativeSort = uncurryThis(test.sort);
|
|
1839
|
+
var push = uncurryThis(test.push);
|
|
1840
|
+
|
|
1841
|
+
// IE8-
|
|
1842
|
+
var FAILS_ON_UNDEFINED = fails(function () {
|
|
1843
|
+
test.sort(undefined);
|
|
1844
|
+
});
|
|
1845
|
+
// V8 bug
|
|
1846
|
+
var FAILS_ON_NULL = fails(function () {
|
|
1847
|
+
test.sort(null);
|
|
1848
|
+
});
|
|
1849
|
+
// Old WebKit
|
|
1850
|
+
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
1851
|
+
|
|
1852
|
+
var STABLE_SORT = !fails(function () {
|
|
1853
|
+
// feature detection can be too slow, so check engines versions
|
|
1854
|
+
if (V8) return V8 < 70;
|
|
1855
|
+
if (FF && FF > 3) return;
|
|
1856
|
+
if (IE_OR_EDGE) return true;
|
|
1857
|
+
if (WEBKIT) return WEBKIT < 603;
|
|
1858
|
+
|
|
1859
|
+
var result = '';
|
|
1860
|
+
var code, chr, value, index;
|
|
1861
|
+
|
|
1862
|
+
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
1863
|
+
for (code = 65; code < 76; code++) {
|
|
1864
|
+
chr = String.fromCharCode(code);
|
|
1865
|
+
|
|
1866
|
+
switch (code) {
|
|
1867
|
+
case 66: case 69: case 70: case 72: value = 3; break;
|
|
1868
|
+
case 68: case 71: value = 4; break;
|
|
1869
|
+
default: value = 2;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
for (index = 0; index < 47; index++) {
|
|
1873
|
+
test.push({ k: chr + index, v: value });
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
test.sort(function (a, b) { return b.v - a.v; });
|
|
1878
|
+
|
|
1879
|
+
for (index = 0; index < test.length; index++) {
|
|
1880
|
+
chr = test[index].k.charAt(0);
|
|
1881
|
+
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1884
|
+
return result !== 'DGBEFHACIJK';
|
|
1885
|
+
});
|
|
1886
|
+
|
|
1887
|
+
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
|
1888
|
+
|
|
1889
|
+
var getSortCompare = function (comparefn) {
|
|
1890
|
+
return function (x, y) {
|
|
1891
|
+
if (y === undefined) return -1;
|
|
1892
|
+
if (x === undefined) return 1;
|
|
1893
|
+
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
1894
|
+
return toString(x) > toString(y) ? 1 : -1;
|
|
1895
|
+
};
|
|
1896
|
+
};
|
|
1897
|
+
|
|
1898
|
+
// `Array.prototype.sort` method
|
|
1899
|
+
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
1900
|
+
$({ target: 'Array', proto: true, forced: FORCED }, {
|
|
1901
|
+
sort: function sort(comparefn) {
|
|
1902
|
+
if (comparefn !== undefined) aCallable(comparefn);
|
|
1903
|
+
|
|
1904
|
+
var array = toObject(this);
|
|
1905
|
+
|
|
1906
|
+
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
|
1907
|
+
|
|
1908
|
+
var items = [];
|
|
1909
|
+
var arrayLength = lengthOfArrayLike(array);
|
|
1910
|
+
var itemsLength, index;
|
|
1911
|
+
|
|
1912
|
+
for (index = 0; index < arrayLength; index++) {
|
|
1913
|
+
if (index in array) push(items, array[index]);
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
internalSort(items, getSortCompare(comparefn));
|
|
1917
|
+
|
|
1918
|
+
itemsLength = lengthOfArrayLike(items);
|
|
1919
|
+
index = 0;
|
|
1920
|
+
|
|
1921
|
+
while (index < itemsLength) array[index] = items[index++];
|
|
1922
|
+
while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
|
1923
|
+
|
|
1924
|
+
return array;
|
|
1925
|
+
}
|
|
1926
|
+
});
|
|
1927
|
+
return es_array_sort;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
requireEs_array_sort();
|
|
1931
|
+
|
|
1932
|
+
var esnext_globalThis = {};
|
|
1933
|
+
|
|
1934
|
+
var es_globalThis = {};
|
|
1935
|
+
|
|
1936
|
+
var hasRequiredEs_globalThis;
|
|
1937
|
+
|
|
1938
|
+
function requireEs_globalThis () {
|
|
1939
|
+
if (hasRequiredEs_globalThis) return es_globalThis;
|
|
1940
|
+
hasRequiredEs_globalThis = 1;
|
|
1941
|
+
var $ = require_export();
|
|
1942
|
+
var globalThis = requireGlobalThis();
|
|
1943
|
+
|
|
1944
|
+
// `globalThis` object
|
|
1945
|
+
// https://tc39.es/ecma262/#sec-globalthis
|
|
1946
|
+
$({ global: true, forced: globalThis.globalThis !== globalThis }, {
|
|
1947
|
+
globalThis: globalThis
|
|
1948
|
+
});
|
|
1949
|
+
return es_globalThis;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
var hasRequiredEsnext_globalThis;
|
|
1953
|
+
|
|
1954
|
+
function requireEsnext_globalThis () {
|
|
1955
|
+
if (hasRequiredEsnext_globalThis) return esnext_globalThis;
|
|
1956
|
+
hasRequiredEsnext_globalThis = 1;
|
|
1957
|
+
// TODO: Remove from `core-js@4`
|
|
1958
|
+
requireEs_globalThis();
|
|
1959
|
+
return esnext_globalThis;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
requireEsnext_globalThis();
|
|
1963
|
+
|
|
1964
|
+
let rtlScrollType;
|
|
1965
|
+
|
|
1966
|
+
const detectRtlScrollType = () => {
|
|
1967
|
+
const definer = document.createElement('div');
|
|
1968
|
+
definer.dir = 'rtl';
|
|
1969
|
+
Object.assign(definer.style, {
|
|
1970
|
+
direction: 'rtl',
|
|
1971
|
+
fontSize: '14px',
|
|
1972
|
+
width: '1px',
|
|
1973
|
+
height: '1px',
|
|
1974
|
+
position: 'absolute',
|
|
1975
|
+
top: '-1000px',
|
|
1976
|
+
overflow: 'scroll'
|
|
1977
|
+
});
|
|
1978
|
+
definer.textContent = 'A';
|
|
1979
|
+
document.body.appendChild(definer);
|
|
1980
|
+
|
|
1981
|
+
let type = 'reverse';
|
|
1982
|
+
|
|
1983
|
+
if (definer.scrollLeft > 0) {
|
|
1984
|
+
type = 'default';
|
|
1985
|
+
} else {
|
|
1986
|
+
definer.scrollLeft = 1;
|
|
1987
|
+
|
|
1988
|
+
// bug: on some machines, chrome will have a positive delta of less than 1.
|
|
1989
|
+
// a full scroll will still be in the negative direction.
|
|
1990
|
+
// let's use Math.floor() to account for that bug.
|
|
1991
|
+
if (Math.floor(definer.scrollLeft) === 0) {
|
|
1992
|
+
type = 'negative';
|
|
1993
|
+
}
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
definer.parentNode.removeChild(definer);
|
|
1997
|
+
|
|
1998
|
+
return type;
|
|
1999
|
+
};
|
|
2000
|
+
|
|
2001
|
+
/**
|
|
2002
|
+
* @param {Element} el
|
|
2003
|
+
* @param {number} left
|
|
2004
|
+
* @param {boolean|undefined} [rtl] if unspecified, then it's automatically detected.
|
|
2005
|
+
* @returns {number}
|
|
2006
|
+
*/
|
|
2007
|
+
function calculateNativeScrollLeftForLeft(el, left, rtl) {
|
|
2008
|
+
if (rtl === undefined) {
|
|
2009
|
+
rtl = getComputedStyle(el).direction === 'rtl';
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
if (rtl === true && rtlScrollType === undefined) {
|
|
2013
|
+
rtlScrollType = detectRtlScrollType();
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
if (rtl) {
|
|
2017
|
+
switch (rtlScrollType) {
|
|
2018
|
+
case 'negative':
|
|
2019
|
+
return left - el.scrollWidth + el.clientWidth;
|
|
2020
|
+
|
|
2021
|
+
case 'reverse':
|
|
2022
|
+
return el.scrollWidth - left - el.clientWidth;
|
|
2023
|
+
|
|
2024
|
+
default:
|
|
2025
|
+
return left;
|
|
2026
|
+
}
|
|
2027
|
+
} else {
|
|
2028
|
+
return left;
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
/**
|
|
2033
|
+
* @param {Element} el
|
|
2034
|
+
* @param {boolean|undefined} [rtl] if unspecified, then it's automatically detected.
|
|
2035
|
+
* @returns {number}
|
|
2036
|
+
*/
|
|
2037
|
+
function getScrollLeft(el, rtl) {
|
|
2038
|
+
if (rtl === undefined) {
|
|
2039
|
+
rtl = getComputedStyle(el).direction === 'rtl';
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
if (rtl === true && rtlScrollType === undefined) {
|
|
2043
|
+
rtlScrollType = detectRtlScrollType();
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
if (rtl) {
|
|
2047
|
+
switch (rtlScrollType) {
|
|
2048
|
+
case 'negative':
|
|
2049
|
+
return el.scrollLeft + el.scrollWidth - el.clientWidth;
|
|
2050
|
+
|
|
2051
|
+
case 'reverse':
|
|
2052
|
+
return el.scrollWidth - el.scrollLeft - el.clientWidth;
|
|
2053
|
+
|
|
2054
|
+
default:
|
|
2055
|
+
return el.scrollLeft;
|
|
2056
|
+
}
|
|
2057
|
+
} else {
|
|
2058
|
+
return el.scrollLeft;
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
/**
|
|
2063
|
+
* @param {Element} el
|
|
2064
|
+
* @param {number} value
|
|
2065
|
+
* @param {boolean|undefined} [rtl] if unspecified, then it's automatically detected.
|
|
2066
|
+
* @returns {number}
|
|
2067
|
+
*/
|
|
2068
|
+
function calculateNativeScrollLeftForHorz(el, value, rtl) {
|
|
2069
|
+
if (rtl === undefined) {
|
|
2070
|
+
rtl = getComputedStyle(el).direction === 'rtl';
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
if (rtl) {
|
|
2074
|
+
return calculateNativeScrollLeftForLeft(el, el.scrollWidth - el.clientWidth - value, rtl);
|
|
2075
|
+
} else {
|
|
2076
|
+
return calculateNativeScrollLeftForLeft(el, value, rtl);
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
/**
|
|
2081
|
+
* @param {Element} el
|
|
2082
|
+
* @param {boolean|undefined} [rtl] if unspecified, then it's automatically detected.
|
|
2083
|
+
* @returns {number}
|
|
2084
|
+
*/
|
|
2085
|
+
function getScrollHorz(el, rtl) {
|
|
2086
|
+
if (rtl === undefined) {
|
|
2087
|
+
rtl = getComputedStyle(el).direction === 'rtl';
|
|
2088
|
+
}
|
|
2089
|
+
if (rtl) {
|
|
2090
|
+
return el.scrollWidth - el.clientWidth - getScrollLeft(el, rtl);
|
|
2091
|
+
} else {
|
|
2092
|
+
return getScrollLeft(el, rtl);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* @param {Element} el
|
|
2098
|
+
* @param {number} horz
|
|
2099
|
+
* @param {boolean|undefined} [rtl] if unspecified, then it's automatically detected.
|
|
2100
|
+
*/
|
|
2101
|
+
function setScrollHorz(el, horz, rtl) {
|
|
2102
|
+
el.scrollLeft = calculateNativeScrollLeftForHorz(el, horz, rtl);
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* @param {Element} el
|
|
2107
|
+
* @param {string[]} props
|
|
2108
|
+
* @returns {Object<string, string>}
|
|
2109
|
+
*/
|
|
2110
|
+
|
|
2111
|
+
/**
|
|
2112
|
+
* @param {ElementCSSInlineStyle} el
|
|
2113
|
+
* @param {Object<string, string>} props
|
|
2114
|
+
*/
|
|
2115
|
+
const setCssProps = function (el, props) {
|
|
2116
|
+
for (let [key, value] of Object.entries(props))
|
|
2117
|
+
el.style[key] = value === undefined || value === null ? '' : String(value);
|
|
2118
|
+
};
|
|
2119
|
+
|
|
2120
|
+
const generateGetElementSizeFn = function (pseudo, dim, dimCased, startDim, endDim) {
|
|
2121
|
+
return (...args) => {
|
|
2122
|
+
let /**Element|ElementCSSInlineStyle*/el = args[0],
|
|
2123
|
+
/**string*/pseudoSelector,
|
|
2124
|
+
/**boolean*/paddings,
|
|
2125
|
+
/**boolean*/borders,
|
|
2126
|
+
/**boolean*/margins;
|
|
2127
|
+
|
|
2128
|
+
if (pseudo) {
|
|
2129
|
+
pseudoSelector = args[1];
|
|
2130
|
+
paddings = !!args[2];
|
|
2131
|
+
borders = !!args[3];
|
|
2132
|
+
margins = !!args[4];
|
|
2133
|
+
} else {
|
|
2134
|
+
paddings = !!args[1];
|
|
2135
|
+
borders = !!args[2];
|
|
2136
|
+
margins = !!args[3];
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
if ((/**@type Window*/el) === window) {
|
|
2140
|
+
return (/**@type Window*/el).document.documentElement[`client${dimCased}`];
|
|
2141
|
+
} else
|
|
2142
|
+
if (el.nodeType === 9) {// document
|
|
2143
|
+
const doc = (/**@type Document*/el).documentElement;
|
|
2144
|
+
const body = (/**@type Document*/el).body;
|
|
2145
|
+
|
|
2146
|
+
return Math.max(
|
|
2147
|
+
body[`scroll${dimCased}`],
|
|
2148
|
+
doc[`scroll${dimCased}`],
|
|
2149
|
+
body[`offset${dimCased}`],
|
|
2150
|
+
doc[`offset${dimCased}`],
|
|
2151
|
+
doc[`client${dimCased}`]
|
|
2152
|
+
);
|
|
2153
|
+
} else
|
|
2154
|
+
{
|
|
2155
|
+
let value;
|
|
2156
|
+
let style;
|
|
2157
|
+
let includesPadding = false,includesBorders = false;
|
|
2158
|
+
|
|
2159
|
+
if (!pseudo && 'getBoundingClientRect' in el) {
|
|
2160
|
+
value = el.getBoundingClientRect()[dim];
|
|
2161
|
+
includesPadding = true;
|
|
2162
|
+
includesBorders = true;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
if (value === undefined || margins || includesPadding !== paddings || includesBorders !== borders) {
|
|
2166
|
+
style = pseudo ? getComputedStyle(el, pseudoSelector) : getComputedStyle(el);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
if (value === undefined) {
|
|
2170
|
+
let raw = style[dim];
|
|
2171
|
+
if (raw === 'auto') {// computedStyle is no good here, probably an 'inline' element
|
|
2172
|
+
value = el[`client${dimCased}`]; // take clientWidth/clientHeight (damn it, it's rounded)
|
|
2173
|
+
includesPadding = true;
|
|
2174
|
+
} else {
|
|
2175
|
+
value = parseFloat(raw);
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
if (style.boxSizing === 'border-box') {
|
|
2179
|
+
includesPadding = true;
|
|
2180
|
+
includesBorders = true;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
if (paddings !== includesPadding) {
|
|
2185
|
+
let totalPadding = parseFloat(style[`padding-${startDim}`] || 0) +
|
|
2186
|
+
parseFloat(style[`padding-${endDim}`] || 0);
|
|
2187
|
+
if (paddings) value += totalPadding;else
|
|
2188
|
+
value -= totalPadding;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
if (borders !== includesBorders) {
|
|
2192
|
+
let totalBorders = parseFloat(style[`border-${startDim}-width`] || 0) +
|
|
2193
|
+
parseFloat(style[`border-${endDim}-width`] || 0);
|
|
2194
|
+
if (borders) value += totalBorders;else
|
|
2195
|
+
value -= totalBorders;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
if (value < 0)
|
|
2199
|
+
value = 0;
|
|
2200
|
+
|
|
2201
|
+
if (margins) {
|
|
2202
|
+
let totalMargins = parseFloat(style[`margin-${startDim}`] || 0) +
|
|
2203
|
+
parseFloat(style[`margin-${endDim}`] || 0);
|
|
2204
|
+
value += totalMargins;
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
return value;
|
|
2208
|
+
}
|
|
2209
|
+
};
|
|
2210
|
+
};
|
|
2211
|
+
|
|
2212
|
+
const generateSetElementSizeFn = (dim, dimCased, startDim, endDim) => {
|
|
2213
|
+
return (/**Element|ElementCSSInlineStyle*/el,
|
|
2214
|
+
/**number*/value,
|
|
2215
|
+
paddings = false, borders = false, margins = false) => {
|
|
2216
|
+
|
|
2217
|
+
if ((/**@type Window*/el) === window) {
|
|
2218
|
+
return;
|
|
2219
|
+
}
|
|
2220
|
+
|
|
2221
|
+
if (el.nodeType === 9) {// document
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
const style = getComputedStyle(el);
|
|
2226
|
+
|
|
2227
|
+
let includesPaddingAndBorders = false;
|
|
2228
|
+
|
|
2229
|
+
if (style.boxSizing === 'border-box') {
|
|
2230
|
+
includesPaddingAndBorders = true;
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
paddings = !!paddings;
|
|
2234
|
+
borders = !!borders;
|
|
2235
|
+
margins = !!margins;
|
|
2236
|
+
|
|
2237
|
+
if (margins)
|
|
2238
|
+
value -= (parseFloat(style[`margin-${startDim}`]) || 0) + (parseFloat(style[`margin-${endDim}`]) || 0);
|
|
2239
|
+
|
|
2240
|
+
if (paddings !== includesPaddingAndBorders) {
|
|
2241
|
+
let totalPadding = parseFloat(style[`padding-${startDim}`] || 0) +
|
|
2242
|
+
parseFloat(style[`padding-${endDim}`] || 0);
|
|
2243
|
+
if (paddings) value -= totalPadding;else
|
|
2244
|
+
value += totalPadding;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
if (borders !== includesPaddingAndBorders) {
|
|
2248
|
+
let totalBorders = (parseFloat(style[`border-${startDim}-width`]) || 0) + (
|
|
2249
|
+
parseFloat(style[`border-${endDim}-width`]) || 0);
|
|
2250
|
+
if (borders) value -= totalBorders;else
|
|
2251
|
+
value += totalBorders;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
if (value < 0)
|
|
2255
|
+
value = 0;
|
|
2256
|
+
|
|
2257
|
+
el.style[dim] = value + 'px';
|
|
2258
|
+
};
|
|
2259
|
+
};
|
|
2260
|
+
|
|
2261
|
+
/**
|
|
2262
|
+
* Gets the width of an element, with fractions
|
|
2263
|
+
* @function getElementWidth
|
|
2264
|
+
* @param {Element} el
|
|
2265
|
+
* @param {boolean} [paddings=false] - include paddings
|
|
2266
|
+
* @param {boolean} [borders=false] - include borders
|
|
2267
|
+
* @param {boolean} [margins=false] - include margins
|
|
2268
|
+
* @returns {number}
|
|
2269
|
+
*/
|
|
2270
|
+
const getElementWidth = generateGetElementSizeFn(false, 'width', 'Width', 'left', 'right');
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Gets the width of an element, with fractions
|
|
2274
|
+
* @function getElementHeight
|
|
2275
|
+
* @param {Element} el
|
|
2276
|
+
* @param {boolean} [paddings=false] - include paddings
|
|
2277
|
+
* @param {boolean} [borders=false] - include borders
|
|
2278
|
+
* @param {boolean} [margins=false] - include margins
|
|
2279
|
+
* @returns {number}
|
|
2280
|
+
*/
|
|
2281
|
+
const getElementHeight = generateGetElementSizeFn(false, 'height', 'Height', 'top', 'bottom');
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* Sets the width of an element
|
|
2285
|
+
* @function setElementWidth
|
|
2286
|
+
* @param {Element} el
|
|
2287
|
+
* @param {number} value
|
|
2288
|
+
* @param {boolean} [paddings=false] - include paddings
|
|
2289
|
+
* @param {boolean} [borders=false] - include borders
|
|
2290
|
+
* @param {boolean} [margins=false] - include margins
|
|
2291
|
+
*/
|
|
2292
|
+
const setElementWidth = generateSetElementSizeFn('width', 'Width', 'left', 'right');
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Find offset of an element relative to the document, considering scroll offsets
|
|
2296
|
+
* @param {Element} el
|
|
2297
|
+
* @returns {{top: number, left: number}}
|
|
2298
|
+
*/
|
|
2299
|
+
const getElementOffset = (el) => {
|
|
2300
|
+
if (!el.getClientRects().length) {
|
|
2301
|
+
return { top: 0, left: 0 };
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
let rect = el.getBoundingClientRect();
|
|
2305
|
+
let view = el.ownerDocument.defaultView;
|
|
2306
|
+
|
|
2307
|
+
return {
|
|
2308
|
+
top: rect.top + view.pageYOffset,
|
|
2309
|
+
left: rect.left + view.pageXOffset
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2313
|
+
/**
|
|
2314
|
+
* @param {Node} el
|
|
2315
|
+
* @returns {Node|null}
|
|
2316
|
+
*/
|
|
2317
|
+
|
|
2318
|
+
let hasScopedQuerySelector = null;
|
|
2319
|
+
|
|
2320
|
+
const detectScopedSelectorFeature = () => {
|
|
2321
|
+
try {
|
|
2322
|
+
document.createElement('div').querySelector(':scope > div');
|
|
2323
|
+
hasScopedQuerySelector = true;
|
|
2324
|
+
} catch (ignored) {
|
|
2325
|
+
hasScopedQuerySelector = false;
|
|
2326
|
+
}
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2329
|
+
/**
|
|
2330
|
+
* @param {Element} el
|
|
2331
|
+
* @param {string} selector
|
|
2332
|
+
* @returns {Element|null}
|
|
2333
|
+
*/
|
|
2334
|
+
const scopedSelector = function (el, selector) {
|
|
2335
|
+
if (hasScopedQuerySelector === null) {
|
|
2336
|
+
detectScopedSelectorFeature();
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
if (hasScopedQuerySelector === true) {
|
|
2340
|
+
return el.querySelector(selector.replace(/((?:^|,)\s*)/g, '$1:scope '));
|
|
2341
|
+
} else {
|
|
2342
|
+
let id = el.id;
|
|
2343
|
+
const uniqueId = 'ID_' + Date.now();
|
|
2344
|
+
el.id = uniqueId;
|
|
2345
|
+
selector = selector.replace(/((?:^|,)\s*)/g, '$1#' + uniqueId);
|
|
2346
|
+
try {
|
|
2347
|
+
return el.querySelector(selector);
|
|
2348
|
+
} finally {
|
|
2349
|
+
this.id = id;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
/**
|
|
2355
|
+
* @param {Element} el
|
|
2356
|
+
* @param {string} selector
|
|
2357
|
+
* @returns {NodeListOf<Element>}
|
|
2358
|
+
*/
|
|
2359
|
+
const scopedSelectorAll = function (el, selector) {
|
|
2360
|
+
if (hasScopedQuerySelector === null) {
|
|
2361
|
+
detectScopedSelectorFeature();
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
if (hasScopedQuerySelector === true) {
|
|
2365
|
+
return el.querySelectorAll(selector.replace(/((?:^|,)\s*)/g, '$1:scope '));
|
|
2366
|
+
} else {
|
|
2367
|
+
let id = el.id;
|
|
2368
|
+
const uniqueId = 'ID_' + Date.now();
|
|
2369
|
+
el.id = uniqueId;
|
|
2370
|
+
selector = selector.replace(/((?:^|,)\s*)/g, '$1#' + uniqueId);
|
|
2371
|
+
try {
|
|
2372
|
+
return el.querySelectorAll(selector);
|
|
2373
|
+
} finally {
|
|
2374
|
+
this.id = id;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
};
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2380
|
+
* @typedef {function(index: number):(number|undefined)} VirtualListHelper~ItemHeightEstimatorFunction
|
|
2381
|
+
*/
|
|
2382
|
+
|
|
2383
|
+
/**
|
|
2384
|
+
* @typedef {function():Element} VirtualListHelper~ItemElementCreatorFunction
|
|
2385
|
+
*/
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* @typedef {function(itemEl: Element, index: number)} VirtualListHelper~ItemRenderFunction
|
|
2389
|
+
*/
|
|
2390
|
+
|
|
2391
|
+
/**
|
|
2392
|
+
* @typedef {function(itemEl: Element)} VirtualListHelper~ItemUnrenderFunction
|
|
2393
|
+
*/
|
|
2394
|
+
|
|
2395
|
+
/**
|
|
2396
|
+
* @typedef {Object} VirtualListHelper~Options
|
|
2397
|
+
* @property {Element} list - the main element to operate inside of
|
|
2398
|
+
* @property {Element?} [itemsParent] - the element to use as parent for the items (automatically created in virtual mode, uses parent by default in non-virtual mode)
|
|
2399
|
+
* @property {boolean} [autoVirtualWrapperWidth=true] automatically set the width of the virtual wrapper
|
|
2400
|
+
* @property {boolean} [hookScrollEvent=true] automatically hook scroll event as needed
|
|
2401
|
+
* @property {number} [count=0] the item count
|
|
2402
|
+
* @property {boolean} [virtual=true] is virtual mode on?
|
|
2403
|
+
* @property {number} [estimatedItemHeight=20] estimated item height
|
|
2404
|
+
* @property {number} [buffer=5] the amount of buffer items to keep on each end of the list
|
|
2405
|
+
* @property {VirtualListHelper~ItemHeightEstimatorFunction} [itemHeightEstimatorFn] an optional function for providing item height estimations
|
|
2406
|
+
* @property {VirtualListHelper~ItemElementCreatorFunction} [itemElementCreatorFn] an optional function for providing fresh item elements (default creates `<li />`s)
|
|
2407
|
+
* @property {VirtualListHelper~ItemRenderFunction} [onItemRender] a function for rendering element content based on item index
|
|
2408
|
+
* @property {VirtualListHelper~ItemUnrenderFunction} [onItemUnrender] a function for freeing resources in an item element
|
|
2409
|
+
* @property {function(height: number)} [onScrollHeightChange] a function to be notified when scroll height changes
|
|
2410
|
+
*
|
|
2411
|
+
*/
|
|
2412
|
+
|
|
2413
|
+
/** */
|
|
2414
|
+
|
|
2415
|
+
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2416
|
+
|
|
2417
|
+
const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== undefined;
|
|
2418
|
+
|
|
2419
|
+
function insertBefore(el, before, parent) {
|
|
2420
|
+
if (!before)
|
|
2421
|
+
parent.appendChild(el);else
|
|
2422
|
+
if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
|
|
2423
|
+
parent.insertBefore(el, before);else
|
|
2424
|
+
before.insertAdjacentElement('beforebegin', el);
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
/**
|
|
2428
|
+
*
|
|
2429
|
+
* @param {Element} itemEl
|
|
2430
|
+
* @param {DocumentFragment|null} fragment
|
|
2431
|
+
* @param {Node|undefined} before
|
|
2432
|
+
* @param {Element} itemParent
|
|
2433
|
+
* @returns {DocumentFragment|null}
|
|
2434
|
+
*/
|
|
2435
|
+
function insertBeforeWithFragment(itemEl, fragment, before, itemParent) {
|
|
2436
|
+
if (itemEl.parentNode !== itemParent) {
|
|
2437
|
+
if (!fragment)
|
|
2438
|
+
fragment = document.createDocumentFragment();
|
|
2439
|
+
fragment.appendChild(itemEl);
|
|
2440
|
+
} else {
|
|
2441
|
+
// insert fragment
|
|
2442
|
+
if (fragment && fragment.childNodes.length > 0) {
|
|
2443
|
+
insertBefore(fragment, before, itemParent);
|
|
2444
|
+
fragment = null;
|
|
2445
|
+
}
|
|
2446
|
+
|
|
2447
|
+
// insert element
|
|
2448
|
+
if (itemEl.nextSibling !== before) {
|
|
2449
|
+
insertBefore(itemEl, before, itemParent);
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
return fragment;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
class VirtualListHelper {
|
|
2457
|
+
/**
|
|
2458
|
+
* @param {VirtualListHelper~Options} opts
|
|
2459
|
+
*/
|
|
2460
|
+
constructor(opts) {var _opts$autoVirtualWrap;
|
|
2461
|
+
/** @private */
|
|
2462
|
+
const p = this._p = {
|
|
2463
|
+
// these come from options:
|
|
2464
|
+
|
|
2465
|
+
list: opts.list || null,
|
|
2466
|
+
hookScrollEvent: opts.hookScrollEvent === undefined ? true : !!opts.hookScrollEvent,
|
|
2467
|
+
count: opts.count || 0,
|
|
2468
|
+
virtual: opts.virtual === undefined ? true : !!opts.virtual,
|
|
2469
|
+
userItemsParent: opts.itemsParent || null,
|
|
2470
|
+
setVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
|
|
2471
|
+
estimatedItemHeight: 20,
|
|
2472
|
+
buffer: 5,
|
|
2473
|
+
|
|
2474
|
+
/** @type VirtualListHelper~ItemHeightEstimatorFunction|null */
|
|
2475
|
+
itemHeightEstimatorFn: null,
|
|
2476
|
+
|
|
2477
|
+
/** @type VirtualListHelper~ItemElementCreatorFunction|null */
|
|
2478
|
+
itemElementCreatorFn: defaultElementCreator,
|
|
2479
|
+
|
|
2480
|
+
/** @type VirtualListHelper~ItemRenderFunction|null */
|
|
2481
|
+
onItemRender: null,
|
|
2482
|
+
|
|
2483
|
+
/** @type VirtualListHelper~ItemUnrenderFunction|null */
|
|
2484
|
+
onItemUnrender: null,
|
|
2485
|
+
|
|
2486
|
+
/** @type {function(height: number)|null} */
|
|
2487
|
+
onScrollHeightChange: null,
|
|
2488
|
+
|
|
2489
|
+
// internal:
|
|
2490
|
+
|
|
2491
|
+
/** @type Element|null */
|
|
2492
|
+
virtualWrapper: null,
|
|
2493
|
+
|
|
2494
|
+
/** @type Element|null */
|
|
2495
|
+
currentItemsParent: null,
|
|
2496
|
+
|
|
2497
|
+
/** @type {(number|undefined)[]} */
|
|
2498
|
+
cachedItemHeights: [],
|
|
2499
|
+
|
|
2500
|
+
/** @type {(number|undefined)[]} */
|
|
2501
|
+
cachedItemEstimatedHeights: [],
|
|
2502
|
+
|
|
2503
|
+
/** @type {(number|undefined)[]} */
|
|
2504
|
+
cachedItemPositions: [],
|
|
2505
|
+
|
|
2506
|
+
/** @type number */
|
|
2507
|
+
itemPositionsNeedsUpdate: 0,
|
|
2508
|
+
|
|
2509
|
+
/** @type function */
|
|
2510
|
+
boundRender: this.render.bind(this),
|
|
2511
|
+
|
|
2512
|
+
/** @type Element[] */
|
|
2513
|
+
existingEls: []
|
|
2514
|
+
};
|
|
2515
|
+
|
|
2516
|
+
p.currentItemsParent = p.userItemsParent || p.list;
|
|
2517
|
+
|
|
2518
|
+
this._hookEvents();
|
|
2519
|
+
|
|
2520
|
+
if (typeof opts.count === 'number')
|
|
2521
|
+
this.setCount(opts.count);
|
|
2522
|
+
|
|
2523
|
+
if (typeof opts.virtual === 'boolean')
|
|
2524
|
+
this.setVirtual(opts.virtual);
|
|
2525
|
+
|
|
2526
|
+
if (typeof opts.estimatedItemHeight === 'number')
|
|
2527
|
+
this.setEstimatedItemHeight(opts.estimatedItemHeight);
|
|
2528
|
+
|
|
2529
|
+
if (typeof opts.buffer === 'number')
|
|
2530
|
+
this.setBuffer(opts.buffer);
|
|
2531
|
+
|
|
2532
|
+
if (typeof opts.itemHeightEstimatorFn === 'function')
|
|
2533
|
+
this.setItemHeightEstimatorFn(opts.itemHeightEstimatorFn);
|
|
2534
|
+
|
|
2535
|
+
if (typeof opts.itemElementCreatorFn === 'function')
|
|
2536
|
+
this.setItemElementCreatorFn(opts.itemElementCreatorFn);
|
|
2537
|
+
|
|
2538
|
+
if (typeof opts.onItemRender === 'function')
|
|
2539
|
+
this.setOnItemRender(opts.onItemRender);
|
|
2540
|
+
|
|
2541
|
+
if (typeof opts.onItemUnrender === 'function')
|
|
2542
|
+
this.setOnItemUnrender(opts.onItemUnrender);
|
|
2543
|
+
|
|
2544
|
+
if (typeof opts.onScrollHeightChange === 'function')
|
|
2545
|
+
this.setOnScrollHeightChange(opts.onScrollHeightChange);
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
/**
|
|
2549
|
+
* Clean up and free up all resources.
|
|
2550
|
+
*/
|
|
2551
|
+
destroy() {
|
|
2552
|
+
this._unhookEvents().invalidate()._destroyElements();
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
/**
|
|
2556
|
+
* Sets whether 'scroll' event on the list should be hooked automatically.
|
|
2557
|
+
* @param {boolean} enabled
|
|
2558
|
+
* @returns {VirtualListHelper}
|
|
2559
|
+
*/
|
|
2560
|
+
setHookScrollEvent(enabled) {
|
|
2561
|
+
const p = this._p;
|
|
2562
|
+
enabled = enabled === undefined ? true : !!enabled;
|
|
2563
|
+
|
|
2564
|
+
if (p.hookScrollEvent === enabled)
|
|
2565
|
+
return this;
|
|
2566
|
+
|
|
2567
|
+
p.hookScrollEvent = enabled;
|
|
2568
|
+
|
|
2569
|
+
this._unhookEvents()._hookEvents();
|
|
2570
|
+
|
|
2571
|
+
return this;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* @returns {boolean} whether 'scroll' event on the list should be hooked automatically
|
|
2576
|
+
*/
|
|
2577
|
+
isHookScrollEventEnabled() {
|
|
2578
|
+
const p = this._p;
|
|
2579
|
+
return p.hookScrollEvent;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* Sets the list item count. <br />
|
|
2584
|
+
* You should probably call `render()` after this.
|
|
2585
|
+
* @param {number} count
|
|
2586
|
+
* @returns {VirtualListHelper}
|
|
2587
|
+
*/
|
|
2588
|
+
setCount(count) {
|
|
2589
|
+
const p = this._p;
|
|
2590
|
+
p.count = count;
|
|
2591
|
+
|
|
2592
|
+
return this.invalidate();
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
/**
|
|
2596
|
+
* @returns {number} current item count
|
|
2597
|
+
*/
|
|
2598
|
+
getCount() {
|
|
2599
|
+
const p = this._p;
|
|
2600
|
+
return p.count;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
/**
|
|
2604
|
+
* Switches between virtual and non-virtual mode. <br />
|
|
2605
|
+
* The list is invalidated automatically. <br />
|
|
2606
|
+
* You should call `render()` to update the view.
|
|
2607
|
+
* @param {boolean} enabled
|
|
2608
|
+
* @returns {VirtualListHelper}
|
|
2609
|
+
*/
|
|
2610
|
+
setVirtual(enabled) {
|
|
2611
|
+
const p = this._p;
|
|
2612
|
+
enabled = enabled === undefined ? true : !!enabled;
|
|
2613
|
+
|
|
2614
|
+
if (p.virtual === enabled)
|
|
2615
|
+
return this;
|
|
2616
|
+
|
|
2617
|
+
p.virtual = enabled;
|
|
2618
|
+
|
|
2619
|
+
this._hookEvents().invalidate()._destroyElements();
|
|
2620
|
+
|
|
2621
|
+
return this;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
/**
|
|
2625
|
+
* @returns {boolean} virtual mode
|
|
2626
|
+
*/
|
|
2627
|
+
isVirtual() {
|
|
2628
|
+
const p = this._p;
|
|
2629
|
+
return p.virtual;
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
/**
|
|
2633
|
+
* Sets estimated item height. <br />
|
|
2634
|
+
* No need to be accurate. <br />
|
|
2635
|
+
* The better the estimation - the better the scrollbar behavior will be. <br />
|
|
2636
|
+
* Applicable for virtual-mode only. <br />
|
|
2637
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2638
|
+
* @param {number} height - a positive number representing estimated item height.
|
|
2639
|
+
* @returns {VirtualListHelper}
|
|
2640
|
+
*/
|
|
2641
|
+
setEstimatedItemHeight(height) {
|
|
2642
|
+
const p = this._p;
|
|
2643
|
+
p.estimatedItemHeight = Math.abs((typeof height === 'number' ? height : Number(height)) || 20);
|
|
2644
|
+
return this;
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* @returns {number} current item height estimation
|
|
2649
|
+
*/
|
|
2650
|
+
getEstimatedItemHeight() {
|
|
2651
|
+
const p = this._p;
|
|
2652
|
+
return p.estimatedItemHeight;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Sets whether the virtual wrapper width should be set automatically. <br />
|
|
2657
|
+
* @param {boolean} enabled
|
|
2658
|
+
* @returns {VirtualListHelper}
|
|
2659
|
+
*/
|
|
2660
|
+
setAutoVirtualWrapperWidth(enabled) {
|
|
2661
|
+
const p = this._p;
|
|
2662
|
+
p.autoVirtualWrapperWidth = enabled === undefined ? true : !!enabled;
|
|
2663
|
+
|
|
2664
|
+
if (p.virtualWrapper) {
|
|
2665
|
+
if (p.autoVirtualWrapperWidth !== p.virtualWrapperWidthWasSet) {
|
|
2666
|
+
p.virtualWrapper.style.width = p.autoVirtualWrapperWidth ? '100%' : '';
|
|
2667
|
+
p.virtualWrapperWidthWasSet = p.autoVirtualWrapperWidth;
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
return this;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
/**
|
|
2675
|
+
* @returns {boolean} whether the virtual wrapper width should be set automatically
|
|
2676
|
+
*/
|
|
2677
|
+
isAutoVirtualWrapperWidth() {
|
|
2678
|
+
const p = this._p;
|
|
2679
|
+
return p.autoVirtualWrapperWidth;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
/**
|
|
2683
|
+
* Sets the amount of buffer items to keep on each end of the list. <br />
|
|
2684
|
+
* Applicable for virtual-mode only.
|
|
2685
|
+
* @param {number} buffer - a positive value representing the count of buffer items for each end.
|
|
2686
|
+
* @returns {VirtualListHelper}
|
|
2687
|
+
*/
|
|
2688
|
+
setBuffer(buffer) {
|
|
2689
|
+
const p = this._p;
|
|
2690
|
+
p.buffer = Math.abs(typeof buffer === 'number' ? buffer : Number(buffer) || 5);
|
|
2691
|
+
return this;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
/**
|
|
2695
|
+
* @returns {number} current buffer value
|
|
2696
|
+
*/
|
|
2697
|
+
getBuffer() {
|
|
2698
|
+
const p = this._p;
|
|
2699
|
+
return p.buffer;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
/**
|
|
2703
|
+
* The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
|
|
2704
|
+
* It's optional, and if it's present - it should return either a numeric height estimation,
|
|
2705
|
+
* or `undefined` to fall back to the default estimation. <br />
|
|
2706
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2707
|
+
* @param {VirtualListHelper~ItemHeightEstimatorFunction} fn
|
|
2708
|
+
* @returns {VirtualListHelper}
|
|
2709
|
+
*/
|
|
2710
|
+
setItemHeightEstimatorFn(fn) {
|
|
2711
|
+
const p = this._p;
|
|
2712
|
+
p.itemHeightEstimatorFn = fn;
|
|
2713
|
+
return this;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
/**
|
|
2717
|
+
* The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
|
|
2718
|
+
* It has no association with a specific item index. <br />
|
|
2719
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2720
|
+
* @param {VirtualListHelper~ItemElementCreatorFunction} fn
|
|
2721
|
+
* @returns {VirtualListHelper}
|
|
2722
|
+
*/
|
|
2723
|
+
setItemElementCreatorFn(fn) {
|
|
2724
|
+
const p = this._p;
|
|
2725
|
+
p.itemElementCreatorFn = fn || defaultElementCreator;
|
|
2726
|
+
return this;
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
/**
|
|
2730
|
+
* The `onItemRender` is a function called for rendering the contents of an item. <br />
|
|
2731
|
+
* It's passed an `Element` and an item index. <br />
|
|
2732
|
+
* You should `invalidate` if you want this to take effect on the existing rendering.
|
|
2733
|
+
* @param {VirtualListHelper~ItemRenderFunction} fn
|
|
2734
|
+
* @returns {VirtualListHelper}
|
|
2735
|
+
*/
|
|
2736
|
+
setOnItemRender(fn) {
|
|
2737
|
+
const p = this._p;
|
|
2738
|
+
p.onItemRender = fn;
|
|
2739
|
+
return this;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
/**
|
|
2743
|
+
* The `onItemUnrender` is a function called for freeing resources in an item element,
|
|
2744
|
+
* if you've attached something that needs to be explicitly freed. <br />
|
|
2745
|
+
* It's passed an `Element` only, and has no association with a specific index,
|
|
2746
|
+
* as by the time it's called - the indexes are probably not valid anymore.
|
|
2747
|
+
* @param {VirtualListHelper~ItemUnrenderFunction} fn
|
|
2748
|
+
* @returns {VirtualListHelper}
|
|
2749
|
+
*/
|
|
2750
|
+
setOnItemUnrender(fn) {
|
|
2751
|
+
const p = this._p;
|
|
2752
|
+
p.onItemUnrender = fn;
|
|
2753
|
+
return this;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
/**
|
|
2757
|
+
* The `onScrollHeightChange` is a function called when the scroll height changes.
|
|
2758
|
+
* @param {function(height: number)} fn
|
|
2759
|
+
* @returns {VirtualListHelper}
|
|
2760
|
+
*/
|
|
2761
|
+
setOnScrollHeightChange(fn) {
|
|
2762
|
+
const p = this._p;
|
|
2763
|
+
p.onScrollHeightChange = fn;
|
|
2764
|
+
return this;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
/**
|
|
2768
|
+
* Estimates the full scroll height. This gets better as more renderings occur.
|
|
2769
|
+
* @returns {number}
|
|
2770
|
+
*/
|
|
2771
|
+
estimateFullHeight() {
|
|
2772
|
+
const p = this._p;
|
|
2773
|
+
|
|
2774
|
+
if (p.count === 0)
|
|
2775
|
+
return 0;
|
|
2776
|
+
|
|
2777
|
+
if (p.virtual) {
|
|
2778
|
+
return this._calculateItemPosition(p.count) || 0;
|
|
2779
|
+
} else {
|
|
2780
|
+
const existingEls = p.existingEls;
|
|
2781
|
+
if (p.count === existingEls.length) {
|
|
2782
|
+
let rect1 = existingEls[0].getBoundingClientRect();
|
|
2783
|
+
let rect2 = existingEls[existingEls.length - 1].getBoundingClientRect();
|
|
2784
|
+
return rect2.top - rect1.top + rect2.height;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
return this._calculateItemPosition(p.count) || 0;
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
/**
|
|
2792
|
+
* States that the cached positions/heights are invalid,
|
|
2793
|
+
* and needs to be completely re-calculated.<br />
|
|
2794
|
+
* You should probably call `render()` after this.
|
|
2795
|
+
* @returns {VirtualListHelper}
|
|
2796
|
+
*/
|
|
2797
|
+
invalidatePositions() {
|
|
2798
|
+
const p = this._p;
|
|
2799
|
+
|
|
2800
|
+
p.itemPositionsNeedsUpdate = 0;
|
|
2801
|
+
p.cachedItemHeights = [];
|
|
2802
|
+
p.cachedItemEstimatedHeights = [];
|
|
2803
|
+
p.cachedItemPositions = [];
|
|
2804
|
+
p.cachedItemHeights.length = p.count;
|
|
2805
|
+
p.cachedItemEstimatedHeights.length = p.count;
|
|
2806
|
+
p.cachedItemPositions.length = p.count;
|
|
2807
|
+
|
|
2808
|
+
return this;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
/**
|
|
2812
|
+
* States that the indexes/item count/rendered content are invalid,
|
|
2813
|
+
* and needs to be completely re-calculated and re-rendered. <br />
|
|
2814
|
+
* You should probably call `render()` after this.
|
|
2815
|
+
* @returns {VirtualListHelper}
|
|
2816
|
+
*/
|
|
2817
|
+
invalidate() {
|
|
2818
|
+
const p = this._p;
|
|
2819
|
+
|
|
2820
|
+
this.invalidatePositions();
|
|
2821
|
+
|
|
2822
|
+
if (!p.virtual) {
|
|
2823
|
+
this._destroyElements();
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
for (let el of p.existingEls)
|
|
2827
|
+
delete el[ItemIndexSymbol];
|
|
2828
|
+
|
|
2829
|
+
return this;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
/**
|
|
2833
|
+
* Renders the current viewport. <br />
|
|
2834
|
+
* Call this after making changes to the list. <br />
|
|
2835
|
+
* In virtual mode, this is called automatically for every scroll event.
|
|
2836
|
+
*/
|
|
2837
|
+
render() {
|
|
2838
|
+
const p = this._p;
|
|
2839
|
+
const list = p.list;
|
|
2840
|
+
const virtual = p.virtual;
|
|
2841
|
+
let virtualWrapper = p.virtualWrapper;
|
|
2842
|
+
let itemParent = p.currentItemsParent;
|
|
2843
|
+
let scrollTop = list.scrollTop;
|
|
2844
|
+
let visibleHeight = list.clientHeight;
|
|
2845
|
+
let visibleBottom = scrollTop + visibleHeight;
|
|
2846
|
+
let count = p.count;
|
|
2847
|
+
let buffer = p.buffer;
|
|
2848
|
+
let onItemUnrender = p.onItemUnrender;
|
|
2849
|
+
let existingEls = p.existingEls;
|
|
2850
|
+
let existingCount = existingEls.length;
|
|
2851
|
+
|
|
2852
|
+
if (virtual) {
|
|
2853
|
+
const originalWidth = list.clientWidth;
|
|
2854
|
+
|
|
2855
|
+
if (!virtualWrapper) {
|
|
2856
|
+
virtualWrapper = p.virtualWrapper = p.userItemsParent;
|
|
2857
|
+
if (!virtualWrapper) {
|
|
2858
|
+
virtualWrapper = p.virtualWrapper = document.createElement('div');
|
|
2859
|
+
list.appendChild(virtualWrapper);
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
this._resetCurrentItemsParent();
|
|
2863
|
+
itemParent = p.currentItemsParent;
|
|
2864
|
+
|
|
2865
|
+
if (p.autoVirtualWrapperWidth) {
|
|
2866
|
+
virtualWrapper.style.width = '100%';
|
|
2867
|
+
p.virtualWrapperWidthWasSet = true;
|
|
2868
|
+
} else {
|
|
2869
|
+
p.virtualWrapperWidthWasSet = false;
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
// Mark all of them for potential reuse
|
|
2874
|
+
for (let i = 0; i < existingCount; i++) {
|
|
2875
|
+
existingEls[i][ReuseElSymbol] = true;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
// Make sure we have at least estimated positions for all items so we can translate scroll position
|
|
2879
|
+
this._calculateItemPosition(p.count - 1);
|
|
2880
|
+
|
|
2881
|
+
// Find existing elements index range
|
|
2882
|
+
let existingRange = this._getExistingElsRange();
|
|
2883
|
+
|
|
2884
|
+
// Find first visible element
|
|
2885
|
+
let firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
|
|
2886
|
+
let firstRenderIndex = Math.max(0, firstVisibleIndex - buffer);
|
|
2887
|
+
|
|
2888
|
+
// Iterate over viewport
|
|
2889
|
+
let index = firstRenderIndex;
|
|
2890
|
+
let renderPos = this._calculateItemPosition(index);
|
|
2891
|
+
let bufferEnd = buffer;
|
|
2892
|
+
|
|
2893
|
+
// we want to render until viewport's bottom + buffer items
|
|
2894
|
+
let maxIndexToRender = Math.max(index, binarySearchPosition(p.cachedItemPositions, visibleBottom - 1) + 1 + buffer);
|
|
2895
|
+
|
|
2896
|
+
let insertedItems = [];
|
|
2897
|
+
|
|
2898
|
+
/** @type DocumentFragment|null */
|
|
2899
|
+
let fragment = null;
|
|
2900
|
+
|
|
2901
|
+
// Find the element to insert before
|
|
2902
|
+
let before = virtualWrapper.childNodes[0];
|
|
2903
|
+
|
|
2904
|
+
const findElementToReuse = function (index) {
|
|
2905
|
+
// Find existing element to reuse
|
|
2906
|
+
/** @type Element|undefined */
|
|
2907
|
+
let existingEl = undefined;
|
|
2908
|
+
|
|
2909
|
+
if (existingRange.firstIndex !== -1 && index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
2910
|
+
existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2913
|
+
if (existingEl === undefined) {
|
|
2914
|
+
existingEl = (existingRange.firstIndex < firstRenderIndex || existingRange.firstValidArrayIndex > 0 ?
|
|
2915
|
+
existingEls.find((x) =>
|
|
2916
|
+
(x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
|
|
2917
|
+
x[ReuseElSymbol] === true) :
|
|
2918
|
+
undefined) ||
|
|
2919
|
+
findLast(existingEls, (x) => x[ReuseElSymbol] === true);
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
if (existingEl !== undefined) {
|
|
2923
|
+
delete existingEl[ReuseElSymbol];
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
return existingEl;
|
|
2927
|
+
};
|
|
2928
|
+
|
|
2929
|
+
// First we iterate and try to add all at once in a fragment, as much as we can.
|
|
2930
|
+
// And then reflow the at once.
|
|
2931
|
+
for (; index < count && index < maxIndexToRender; index++) {
|
|
2932
|
+
let existingEl = findElementToReuse(index);
|
|
2933
|
+
|
|
2934
|
+
if (before && before === existingEl)
|
|
2935
|
+
before = before.nextSibling;
|
|
2936
|
+
|
|
2937
|
+
// Dequeue the element by reusing or creating a new one
|
|
2938
|
+
const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
|
|
2939
|
+
insertedItems.push([itemEl, index]);
|
|
2940
|
+
|
|
2941
|
+
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
// Insert any remaining fragment
|
|
2945
|
+
if (fragment && fragment.childNodes.length > 0) {
|
|
2946
|
+
insertBefore(fragment, before, itemParent);
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
// Iterate on inserted items and reflow them
|
|
2950
|
+
for (let item of insertedItems) {
|
|
2951
|
+
const index = item[1];
|
|
2952
|
+
this._insertItemAndFlow(item[0], index, false /* inserted already */);
|
|
2953
|
+
renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
// See if we still need to insert more items
|
|
2957
|
+
if (renderPos < visibleBottom) {
|
|
2958
|
+
for (; (renderPos < visibleBottom || bufferEnd-- > 0) && index < count; index++) {
|
|
2959
|
+
let existingEl = findElementToReuse(index);
|
|
2960
|
+
|
|
2961
|
+
if (before && before === existingEl)
|
|
2962
|
+
before = before.nextSibling;
|
|
2963
|
+
|
|
2964
|
+
// Dequeue the element by reusing or creating a new one
|
|
2965
|
+
this._dequeueElementForIndex(existingEl, index, before, false);
|
|
2966
|
+
|
|
2967
|
+
// Increment pointers
|
|
2968
|
+
renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
// Calculate up-to-date scroll height
|
|
2973
|
+
let scrollHeight = this.estimateFullHeight();
|
|
2974
|
+
let scrollHeightPx = scrollHeight + 'px';
|
|
2975
|
+
|
|
2976
|
+
if (virtualWrapper.style.height !== scrollHeightPx) {var _p$onScrollHeightChan;
|
|
2977
|
+
p.virtualWrapper.style.height = scrollHeightPx;
|
|
2978
|
+
(_p$onScrollHeightChan = p.onScrollHeightChange) === null || _p$onScrollHeightChan === void 0 || _p$onScrollHeightChan.call(p, scrollHeight);
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
if (originalWidth !== list.clientWidth)
|
|
2982
|
+
this.render();
|
|
2983
|
+
} else {// non-virtual
|
|
2984
|
+
if (count !== existingEls.length) {
|
|
2985
|
+
for (let i = 0; i < existingCount; i++) {
|
|
2986
|
+
existingEls[i][ReuseElSymbol] = true;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
// Find the element to insert before
|
|
2990
|
+
let before = itemParent.childNodes[0];
|
|
2991
|
+
|
|
2992
|
+
/** @type DocumentFragment|null */
|
|
2993
|
+
let fragment = null;
|
|
2994
|
+
|
|
2995
|
+
for (let index = 0; index < count; index++) {
|
|
2996
|
+
// Find existing element to reuse
|
|
2997
|
+
let existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
|
|
2998
|
+
|
|
2999
|
+
if (existingEl !== undefined) {
|
|
3000
|
+
delete existingEl[ReuseElSymbol];
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
if (before && before === existingEl)
|
|
3004
|
+
before = before.nextSibling;
|
|
3005
|
+
|
|
3006
|
+
// Dequeue the element by reusing or creating a new one
|
|
3007
|
+
const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
|
|
3008
|
+
|
|
3009
|
+
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
// Insert any remaining fragment
|
|
3013
|
+
if (fragment && fragment.childNodes.length > 0) {
|
|
3014
|
+
insertBefore(fragment, before, itemParent);
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
|
|
3019
|
+
// Cleanup extra unused elements
|
|
3020
|
+
existingCount = existingEls.length; // May have changed
|
|
3021
|
+
for (let i = 0; i < existingCount; i++) {
|
|
3022
|
+
const el = existingEls[i];
|
|
3023
|
+
if (el[ReuseElSymbol] !== true) continue;
|
|
3024
|
+
|
|
3025
|
+
let parent = el.parentNode;
|
|
3026
|
+
if (parent)
|
|
3027
|
+
parent.removeChild(el);
|
|
3028
|
+
if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
|
|
3029
|
+
onItemUnrender(el);
|
|
3030
|
+
existingEls.splice(i, 1);
|
|
3031
|
+
|
|
3032
|
+
i--;
|
|
3033
|
+
existingCount--;
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
|
|
3037
|
+
/**
|
|
3038
|
+
* States that items were added at a certain position in the list. <br />
|
|
3039
|
+
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3040
|
+
* @param {number} count
|
|
3041
|
+
* @param {number} [atIndex=-1]
|
|
3042
|
+
* @returns {VirtualListHelper}
|
|
3043
|
+
*/
|
|
3044
|
+
addItemsAt(count, atIndex = -1) {
|
|
3045
|
+
if (typeof count !== 'number' || count <= 0)
|
|
3046
|
+
return this;
|
|
3047
|
+
|
|
3048
|
+
const p = this._p;
|
|
3049
|
+
|
|
3050
|
+
if (atIndex < 0 || atIndex >= p.count)
|
|
3051
|
+
atIndex = p.count;
|
|
3052
|
+
|
|
3053
|
+
p.count += count;
|
|
3054
|
+
|
|
3055
|
+
if (p.virtual) {
|
|
3056
|
+
if (atIndex >= 0 && atIndex < p.count) {
|
|
3057
|
+
this._invalidateItemIndexesAt(atIndex, -1);
|
|
3058
|
+
}
|
|
3059
|
+
} else
|
|
3060
|
+
{// non-virtual
|
|
3061
|
+
let existingEls = p.existingEls;
|
|
3062
|
+
let existingCount = existingEls.length;
|
|
3063
|
+
if (existingCount !== p.count - count)
|
|
3064
|
+
return this;
|
|
3065
|
+
|
|
3066
|
+
let existingRange = this._getExistingElsRange();
|
|
3067
|
+
if (existingRange.firstValidArrayIndex === -1)
|
|
3068
|
+
return this;
|
|
3069
|
+
|
|
3070
|
+
const itemParent = p.currentItemsParent;
|
|
3071
|
+
|
|
3072
|
+
let startIndex = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
|
|
3073
|
+
|
|
3074
|
+
this._pushItemIndexesAt(atIndex, count);
|
|
3075
|
+
|
|
3076
|
+
/** @type Node|undefined */
|
|
3077
|
+
let before = existingEls[startIndex - 1] ?
|
|
3078
|
+
existingEls[startIndex - 1].nextSibling :
|
|
3079
|
+
existingEls[0];
|
|
3080
|
+
|
|
3081
|
+
/** @type DocumentFragment|null */
|
|
3082
|
+
let fragment = null;
|
|
3083
|
+
|
|
3084
|
+
for (let index = atIndex, end = atIndex + count; index < end; index++) {
|
|
3085
|
+
const itemEl = this._dequeueElementForIndex(undefined, index, before, true);
|
|
3086
|
+
fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
// Insert any remaining fragment
|
|
3090
|
+
if (fragment && fragment.childNodes.length > 0) {
|
|
3091
|
+
insertBefore(fragment, before, itemParent);
|
|
3092
|
+
}
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
return this;
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
/**
|
|
3099
|
+
* States that items were removed at a certain position in the list. <br />
|
|
3100
|
+
* Virtual mode: Call `render()` to update the view after making changes.
|
|
3101
|
+
* @param {number} count
|
|
3102
|
+
* @param {number} atIndex
|
|
3103
|
+
* @returns {VirtualListHelper}
|
|
3104
|
+
*/
|
|
3105
|
+
removeItemsAt(count, atIndex) {
|
|
3106
|
+
const p = this._p;
|
|
3107
|
+
|
|
3108
|
+
if (typeof count !== 'number' || typeof atIndex !== 'number' || count <= 0 || atIndex < 0 || atIndex >= p.count)
|
|
3109
|
+
return this;
|
|
3110
|
+
|
|
3111
|
+
p.count -= Math.min(count, p.count - atIndex);
|
|
3112
|
+
|
|
3113
|
+
if (p.virtual) {
|
|
3114
|
+
this._invalidateItemIndexesAt(atIndex, -1);
|
|
3115
|
+
} else
|
|
3116
|
+
{// non-virtual
|
|
3117
|
+
let existingEls = p.existingEls;
|
|
3118
|
+
let existingCount = existingEls.length;
|
|
3119
|
+
if (existingCount !== p.count + count)
|
|
3120
|
+
return this;
|
|
3121
|
+
|
|
3122
|
+
let existingRange = this._getExistingElsRange();
|
|
3123
|
+
if (existingRange.firstValidArrayIndex === -1)
|
|
3124
|
+
return this;
|
|
3125
|
+
|
|
3126
|
+
this._pushItemIndexesAt(atIndex + count, -count);
|
|
3127
|
+
|
|
3128
|
+
const onItemUnrender = p.onItemUnrender;
|
|
3129
|
+
let index = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
|
|
3130
|
+
if (index < existingEls.length) {
|
|
3131
|
+
for (let i = 0; i < count; i++) {
|
|
3132
|
+
let itemEl = existingEls[index + i];
|
|
3133
|
+
|
|
3134
|
+
let parent = itemEl.parentNode;
|
|
3135
|
+
if (parent)
|
|
3136
|
+
parent.removeChild(itemEl);
|
|
3137
|
+
if (onItemUnrender && itemEl[ItemIndexSymbol] !== undefined)
|
|
3138
|
+
onItemUnrender(itemEl);
|
|
3139
|
+
}
|
|
3140
|
+
existingEls.splice(index, count);
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
return this;
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
/**
|
|
3148
|
+
* Mark an element for a re-render. <br />
|
|
3149
|
+
* Virtual mode: Call `render()` to update the view after making changes. <br />
|
|
3150
|
+
* Non-virtual mode - the element is re-rendered immediately.
|
|
3151
|
+
* @param {number} index - the index of the element to re-render
|
|
3152
|
+
* @returns {VirtualListHelper}
|
|
3153
|
+
*/
|
|
3154
|
+
refreshItemAt(index) {
|
|
3155
|
+
const p = this._p;
|
|
3156
|
+
|
|
3157
|
+
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3158
|
+
return this;
|
|
3159
|
+
|
|
3160
|
+
if (p.virtual) {
|
|
3161
|
+
this._invalidateItemIndexesAt(index, 1);
|
|
3162
|
+
} else
|
|
3163
|
+
{// non-virtual
|
|
3164
|
+
let existingEls = p.existingEls;
|
|
3165
|
+
let existingCount = existingEls.length;
|
|
3166
|
+
if (existingCount !== p.count)
|
|
3167
|
+
return this;
|
|
3168
|
+
|
|
3169
|
+
let existingRange = this._getExistingElsRange();
|
|
3170
|
+
|
|
3171
|
+
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3172
|
+
let itemEl = existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
|
|
3173
|
+
delete itemEl[ItemIndexSymbol];
|
|
3174
|
+
this._dequeueElementForIndex(itemEl, index, itemEl.nextSibling, false);
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3177
|
+
|
|
3178
|
+
return this;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
/**
|
|
3182
|
+
* Tests whether an item at the specified index is rendered.
|
|
3183
|
+
* @param {number} index - the index to test
|
|
3184
|
+
* @returns {boolean}
|
|
3185
|
+
*/
|
|
3186
|
+
isItemRendered(index) {
|
|
3187
|
+
const p = this._p;
|
|
3188
|
+
|
|
3189
|
+
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3190
|
+
return false;
|
|
3191
|
+
|
|
3192
|
+
let existingRange = this._getExistingElsRange();
|
|
3193
|
+
|
|
3194
|
+
return index >= existingRange.firstIndex && index <= existingRange.lastIndex;
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
/**
|
|
3198
|
+
* Retrieves DOM element for the item at the specified index - if it's currently rendered.
|
|
3199
|
+
* @param {number} index - the index to retrieve
|
|
3200
|
+
* @returns {Element|undefined}
|
|
3201
|
+
*/
|
|
3202
|
+
getItemElementAt(index) {
|
|
3203
|
+
const p = this._p;
|
|
3204
|
+
|
|
3205
|
+
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3206
|
+
return undefined;
|
|
3207
|
+
|
|
3208
|
+
let existingEls = p.existingEls;
|
|
3209
|
+
let existingRange = this._getExistingElsRange();
|
|
3210
|
+
|
|
3211
|
+
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3212
|
+
return existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
return undefined;
|
|
3216
|
+
}
|
|
3217
|
+
|
|
3218
|
+
/**
|
|
3219
|
+
* Retrieves the position for the specified index. <br />
|
|
3220
|
+
* Can be used to scroll to a specific item.
|
|
3221
|
+
* @param {number} index
|
|
3222
|
+
* @returns {number|undefined}
|
|
3223
|
+
*/
|
|
3224
|
+
getItemPosition(index) {
|
|
3225
|
+
const p = this._p;
|
|
3226
|
+
|
|
3227
|
+
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3228
|
+
return undefined;
|
|
3229
|
+
|
|
3230
|
+
if (p.virtual) {
|
|
3231
|
+
return this._calculateItemPosition(index);
|
|
3232
|
+
} else {
|
|
3233
|
+
let itemEl = this.getItemElementAt(index);
|
|
3234
|
+
if (itemEl === undefined)
|
|
3235
|
+
return undefined;
|
|
3236
|
+
|
|
3237
|
+
const list = p.list;
|
|
3238
|
+
return getElementOffset(itemEl).top - getElementOffset(list).top + list.scrollTop;
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3242
|
+
/**
|
|
3243
|
+
* Retrieves the item index for the specified element
|
|
3244
|
+
* @param {Element} el
|
|
3245
|
+
* @returns {number|undefined}
|
|
3246
|
+
*/
|
|
3247
|
+
getItemIndexFromElement(el) {
|
|
3248
|
+
return el ? el[ItemIndexSymbol] : undefined;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
/**
|
|
3252
|
+
* Retrieves the size (or estimated size, if unknown) for the specified index. <br />
|
|
3253
|
+
* @param {number} index
|
|
3254
|
+
* @returns {number|undefined}
|
|
3255
|
+
*/
|
|
3256
|
+
getItemSize(index) {
|
|
3257
|
+
const p = this._p;
|
|
3258
|
+
|
|
3259
|
+
if (typeof index !== 'number' || index < 0 || index >= p.count)
|
|
3260
|
+
return undefined;
|
|
3261
|
+
|
|
3262
|
+
let height = p.cachedItemHeights[index - 1]; // already calculated
|
|
3263
|
+
|
|
3264
|
+
if (height === undefined) {
|
|
3265
|
+
height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
|
|
3266
|
+
|
|
3267
|
+
if (typeof height !== 'number')
|
|
3268
|
+
height = p.estimatedItemHeight; // estimated
|
|
3269
|
+
|
|
3270
|
+
p.cachedItemEstimatedHeights[index - 1] = height;
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
return height;
|
|
3274
|
+
}
|
|
3275
|
+
|
|
3276
|
+
/**
|
|
3277
|
+
* Retrieves the number of items that fit into the current viewport.
|
|
3278
|
+
* @returns {number}
|
|
3279
|
+
*/
|
|
3280
|
+
getVisibleItemCount() {
|
|
3281
|
+
const p = this._p,list = p.list;
|
|
3282
|
+
|
|
3283
|
+
let scrollTop = list.scrollTop;
|
|
3284
|
+
let visibleHeight = list.clientHeight;
|
|
3285
|
+
let firstVisibleIndex, lastVisibleIndex;
|
|
3286
|
+
|
|
3287
|
+
if (p.virtual) {
|
|
3288
|
+
firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
|
|
3289
|
+
lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex);
|
|
3290
|
+
} else
|
|
3291
|
+
{
|
|
3292
|
+
const retriever = (i) => {
|
|
3293
|
+
let pos = this.getItemPosition(i);
|
|
3294
|
+
if (pos === undefined)
|
|
3295
|
+
pos = Infinity;
|
|
3296
|
+
return pos;
|
|
3297
|
+
};
|
|
3298
|
+
|
|
3299
|
+
firstVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop);
|
|
3300
|
+
lastVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop + visibleHeight, firstVisibleIndex);
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
if (this.getItemPosition(lastVisibleIndex) === scrollTop + visibleHeight)
|
|
3304
|
+
lastVisibleIndex--;
|
|
3305
|
+
return lastVisibleIndex - firstVisibleIndex + 1;
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
/**
|
|
3309
|
+
* Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
|
|
3310
|
+
* @param {*} ghostIndex - the value to pass as the index for the renderer function
|
|
3311
|
+
* @param {boolean} append - whether to append the item element to the DOM
|
|
3312
|
+
* @param {function(itemEl: Element)} ghostTester - the function that will receive the element, called synchronously.
|
|
3313
|
+
*/
|
|
3314
|
+
createGhostItemElement(ghostIndex, append, ghostTester) {
|
|
3315
|
+
const p = this._p;
|
|
3316
|
+
|
|
3317
|
+
let itemEl = this._dequeueElementForIndex(null, ghostIndex, false, true);
|
|
3318
|
+
try {
|
|
3319
|
+
if (append) {
|
|
3320
|
+
p.currentItemsParent.appendChild(itemEl);
|
|
3321
|
+
}
|
|
3322
|
+
ghostTester(itemEl);
|
|
3323
|
+
} finally {
|
|
3324
|
+
if (append) {
|
|
3325
|
+
let parent = itemEl.parentNode;
|
|
3326
|
+
if (parent)
|
|
3327
|
+
parent.removeChild(itemEl);
|
|
3328
|
+
}
|
|
3329
|
+
if (p.onItemUnrender)
|
|
3330
|
+
p.onItemUnrender(itemEl);
|
|
3331
|
+
}
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
/**
|
|
3335
|
+
* Reset the pointer to the current items wrapper
|
|
3336
|
+
* @private
|
|
3337
|
+
*/
|
|
3338
|
+
_resetCurrentItemsParent() {var _ref, _p$virtualWrapper;
|
|
3339
|
+
const p = this._p;
|
|
3340
|
+
p.currentItemsParent = (_ref = (_p$virtualWrapper = p.virtualWrapper) !== null && _p$virtualWrapper !== void 0 ? _p$virtualWrapper : p.userItemsParent) !== null && _ref !== void 0 ? _ref : p.list;
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
/**
|
|
3344
|
+
* Destroy all created elements, for cleanup
|
|
3345
|
+
* @returns {VirtualListHelper}
|
|
3346
|
+
* @private
|
|
3347
|
+
*/
|
|
3348
|
+
_destroyElements() {
|
|
3349
|
+
const p = this._p;
|
|
3350
|
+
const onItemUnrender = p.onItemUnrender;
|
|
3351
|
+
const existingEls = p.existingEls;
|
|
3352
|
+
|
|
3353
|
+
for (let i = 0; i < existingEls.length; i++) {
|
|
3354
|
+
const el = existingEls[i];
|
|
3355
|
+
|
|
3356
|
+
let parent = el.parentNode;
|
|
3357
|
+
if (parent)
|
|
3358
|
+
parent.removeChild(el);
|
|
3359
|
+
if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
|
|
3360
|
+
onItemUnrender(el);
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
existingEls.length = 0;
|
|
3364
|
+
|
|
3365
|
+
if (p.virtualWrapper) {
|
|
3366
|
+
if (p.virtualWrapper !== p.userItemsParent) {
|
|
3367
|
+
if (p.virtualWrapper.parentNode) {
|
|
3368
|
+
p.virtualWrapper.parentNode.removeChild(p.virtualWrapper);
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
p.virtualWrapper = null;
|
|
3372
|
+
this._resetCurrentItemsParent();
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
return this;
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
/**
|
|
3379
|
+
* Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
|
|
3380
|
+
* Applicable for virtual mode only.
|
|
3381
|
+
* @param {number} index
|
|
3382
|
+
* @param {number} count
|
|
3383
|
+
* @private
|
|
3384
|
+
*/
|
|
3385
|
+
_invalidateItemIndexesAt(index, count) {
|
|
3386
|
+
const p = this._p;
|
|
3387
|
+
|
|
3388
|
+
this._setItemPositionsNeedsUpdate(index);
|
|
3389
|
+
|
|
3390
|
+
let existingEls = p.existingEls;
|
|
3391
|
+
let existingCount = existingEls.length;
|
|
3392
|
+
let existingRange = this._getExistingElsRange();
|
|
3393
|
+
|
|
3394
|
+
if (existingRange.firstValidArrayIndex === -1)
|
|
3395
|
+
return;
|
|
3396
|
+
|
|
3397
|
+
if (count === -1)
|
|
3398
|
+
count = existingEls.length;
|
|
3399
|
+
|
|
3400
|
+
// Clean
|
|
3401
|
+
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3402
|
+
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex,
|
|
3403
|
+
c = 0;
|
|
3404
|
+
i < existingCount && c < count;
|
|
3405
|
+
i++, c++)
|
|
3406
|
+
delete existingEls[i][ItemIndexSymbol];
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
|
|
3410
|
+
/**
|
|
3411
|
+
* In/decrement the item-index marker for specific item(s). <br />
|
|
3412
|
+
* Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
|
|
3413
|
+
* Applicable for non-virtual mode only.
|
|
3414
|
+
* @param {number} index
|
|
3415
|
+
* @param {number} count
|
|
3416
|
+
* @private
|
|
3417
|
+
*/
|
|
3418
|
+
_pushItemIndexesAt(index, count) {
|
|
3419
|
+
const p = this._p;
|
|
3420
|
+
|
|
3421
|
+
let existingEls = p.existingEls;
|
|
3422
|
+
let existingCount = existingEls.length;
|
|
3423
|
+
let existingRange = this._getExistingElsRange();
|
|
3424
|
+
|
|
3425
|
+
if (existingRange.firstValidArrayIndex === -1)
|
|
3426
|
+
return;
|
|
3427
|
+
|
|
3428
|
+
// Clean
|
|
3429
|
+
if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
|
|
3430
|
+
for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex;
|
|
3431
|
+
i < existingCount;
|
|
3432
|
+
i++)
|
|
3433
|
+
existingEls[i][ItemIndexSymbol] += count;
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
/**
|
|
3438
|
+
* Hook relevant events
|
|
3439
|
+
* @returns {VirtualListHelper}
|
|
3440
|
+
* @private
|
|
3441
|
+
*/
|
|
3442
|
+
_hookEvents() {
|
|
3443
|
+
const p = this._p;
|
|
3444
|
+
|
|
3445
|
+
this._unhookEvents();
|
|
3446
|
+
|
|
3447
|
+
if (p.virtual && p.hookScrollEvent) {
|
|
3448
|
+
p.list && p.list.addEventListener('scroll', /**@type Function*/p.boundRender);
|
|
3449
|
+
}
|
|
3450
|
+
|
|
3451
|
+
return this;
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* Unhook previously hooked events
|
|
3456
|
+
* @returns {VirtualListHelper}
|
|
3457
|
+
* @private
|
|
3458
|
+
*/
|
|
3459
|
+
_unhookEvents() {
|
|
3460
|
+
const p = this._p;
|
|
3461
|
+
|
|
3462
|
+
p.list && p.list.removeEventListener('scroll', /**@type Function*/p.boundRender);
|
|
3463
|
+
|
|
3464
|
+
return this;
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
/**
|
|
3468
|
+
* Mark item index from which the positions are not considered valid anymore. <br />
|
|
3469
|
+
* Applicable for virtual mode only.
|
|
3470
|
+
* @param {number} value
|
|
3471
|
+
* @private
|
|
3472
|
+
*/
|
|
3473
|
+
_setItemPositionsNeedsUpdate(value) {
|
|
3474
|
+
const p = this._p;
|
|
3475
|
+
|
|
3476
|
+
if (value < p.itemPositionsNeedsUpdate) {
|
|
3477
|
+
p.itemPositionsNeedsUpdate = value;
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
|
|
3481
|
+
/**
|
|
3482
|
+
* Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
|
|
3483
|
+
* Allows calculating last+1 index too, to get the bottom-most position. <br />
|
|
3484
|
+
* Applicable for non-virtual mode only.
|
|
3485
|
+
* @param {number} index
|
|
3486
|
+
* @returns {number|undefined}
|
|
3487
|
+
* @private
|
|
3488
|
+
*/
|
|
3489
|
+
_calculateItemPosition(index) {
|
|
3490
|
+
const p = this._p;
|
|
3491
|
+
|
|
3492
|
+
const cachedItemPositions = p.cachedItemPositions;
|
|
3493
|
+
|
|
3494
|
+
if (index >= p.itemPositionsNeedsUpdate) {
|
|
3495
|
+
const count = p.count;
|
|
3496
|
+
const cachedItemHeights = p.cachedItemHeights;
|
|
3497
|
+
const cachedItemEstimatedHeights = p.cachedItemEstimatedHeights;
|
|
3498
|
+
const estimatedItemHeight = p.estimatedItemHeight;
|
|
3499
|
+
const itemHeightEstimatorFn = p.itemHeightEstimatorFn;
|
|
3500
|
+
|
|
3501
|
+
if (cachedItemHeights.length !== count) {
|
|
3502
|
+
cachedItemHeights.length = count;
|
|
3503
|
+
cachedItemEstimatedHeights.length = count;
|
|
3504
|
+
cachedItemPositions.length = count;
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
let fromIndex = p.itemPositionsNeedsUpdate;
|
|
3508
|
+
let toIndex = Math.min(index, count);
|
|
3509
|
+
|
|
3510
|
+
let pos = 0;
|
|
3511
|
+
|
|
3512
|
+
if (fromIndex > 0) {
|
|
3513
|
+
pos = cachedItemPositions[fromIndex - 1];
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
for (let i = fromIndex; i <= toIndex; i++) {
|
|
3517
|
+
if (i === 0) {
|
|
3518
|
+
cachedItemPositions[i] = pos;
|
|
3519
|
+
continue;
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
const prevIndex = i - 1;
|
|
3523
|
+
|
|
3524
|
+
let height = cachedItemHeights[prevIndex]; // already calculated
|
|
3525
|
+
|
|
3526
|
+
if (height === undefined) {
|
|
3527
|
+
height = itemHeightEstimatorFn ? itemHeightEstimatorFn(prevIndex) : null; // estimated per item
|
|
3528
|
+
|
|
3529
|
+
if (typeof height !== 'number')
|
|
3530
|
+
height = estimatedItemHeight; // estimated
|
|
3531
|
+
|
|
3532
|
+
cachedItemEstimatedHeights[prevIndex] = height;
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
pos += height;
|
|
3536
|
+
cachedItemPositions[i] = pos;
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
p.itemPositionsNeedsUpdate = toIndex + 1;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
// item after the last (calculate full height)
|
|
3543
|
+
if (index > 0 && index === p.count) {
|
|
3544
|
+
let height = p.cachedItemHeights[index - 1]; // already calculated
|
|
3545
|
+
|
|
3546
|
+
if (height === undefined) {
|
|
3547
|
+
height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
|
|
3548
|
+
|
|
3549
|
+
if (typeof height !== 'number')
|
|
3550
|
+
height = p.estimatedItemHeight; // estimated
|
|
3551
|
+
|
|
3552
|
+
p.cachedItemEstimatedHeights[index - 1] = height;
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
return cachedItemPositions[index - 1] + height;
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
return cachedItemPositions[index];
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
/**
|
|
3562
|
+
* Create (or reuse an existing) element for an item at the specified index,
|
|
3563
|
+
* and insert physically at specified position. <br />
|
|
3564
|
+
* This will also update the element's position in the `existingEls` array.
|
|
3565
|
+
* @param {Element|undefined} itemEl
|
|
3566
|
+
* @param {number} index
|
|
3567
|
+
* @param {Node|boolean|undefined} insertBefore
|
|
3568
|
+
* @param {boolean|undefined} avoidDomReflow
|
|
3569
|
+
* @returns {Element}
|
|
3570
|
+
* @private
|
|
3571
|
+
*/
|
|
3572
|
+
_dequeueElementForIndex(itemEl, index, insertBefore, avoidDomReflow) {
|
|
3573
|
+
const p = this._p;
|
|
3574
|
+
const virtualWrapper = p.virtualWrapper;
|
|
3575
|
+
p.currentItemsParent;
|
|
3576
|
+
const existingEls = p.existingEls;
|
|
3577
|
+
const onItemRender = p.onItemRender;
|
|
3578
|
+
const onItemUnrender = p.onItemUnrender;
|
|
3579
|
+
const isNew = !itemEl;
|
|
3580
|
+
const shouldReRender = isNew || index !== itemEl[ItemIndexSymbol];
|
|
3581
|
+
|
|
3582
|
+
if (itemEl) {
|
|
3583
|
+
if (onItemUnrender && shouldReRender) {
|
|
3584
|
+
onItemUnrender(itemEl);
|
|
3585
|
+
}
|
|
3586
|
+
} else {
|
|
3587
|
+
itemEl = p.itemElementCreatorFn();
|
|
3588
|
+
|
|
3589
|
+
if (virtualWrapper && insertBefore !== false) {
|
|
3590
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style.position = 'absolute';
|
|
3591
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style.top = '0';
|
|
3592
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style.left = '0';
|
|
3593
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style.right = '0';
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3597
|
+
// Render only if it's a new item element
|
|
3598
|
+
// OR the index of the existing element is not the same of the index to render
|
|
3599
|
+
if (shouldReRender) {
|
|
3600
|
+
itemEl.innerHTML = ''; // Basic cleanup
|
|
3601
|
+
|
|
3602
|
+
if (onItemRender)
|
|
3603
|
+
onItemRender(itemEl, index);
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
if (insertBefore !== false) {
|
|
3607
|
+
if (!(insertBefore instanceof Node))
|
|
3608
|
+
insertBefore = null;
|
|
3609
|
+
|
|
3610
|
+
// Remove from existing list
|
|
3611
|
+
if (!isNew) {
|
|
3612
|
+
let i = existingEls.indexOf(itemEl);
|
|
3613
|
+
if (i !== -1)
|
|
3614
|
+
existingEls.splice(i, 1);
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
// Insert into existing list
|
|
3618
|
+
let beforeIndex = insertBefore ? existingEls.indexOf(/**@type Element*/insertBefore) : -1;
|
|
3619
|
+
if (beforeIndex === -1) {
|
|
3620
|
+
existingEls.push(itemEl);
|
|
3621
|
+
} else {
|
|
3622
|
+
existingEls.splice(beforeIndex, 0, itemEl);
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
if (!avoidDomReflow) {
|
|
3626
|
+
this._insertItemAndFlow(itemEl, index, insertBefore);
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
|
|
3630
|
+
// Add index metadata to item
|
|
3631
|
+
itemEl[ItemIndexSymbol] = index;
|
|
3632
|
+
|
|
3633
|
+
return itemEl;
|
|
3634
|
+
}
|
|
3635
|
+
|
|
3636
|
+
/**
|
|
3637
|
+
* Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
|
|
3638
|
+
* @param {Element|undefined} itemEl
|
|
3639
|
+
* @param {number} index
|
|
3640
|
+
* @param {Node|boolean|undefined} before
|
|
3641
|
+
* @private
|
|
3642
|
+
*/
|
|
3643
|
+
_insertItemAndFlow(itemEl, index, before) {
|
|
3644
|
+
const p = this._p;
|
|
3645
|
+
const virtualWrapper = p.virtualWrapper;
|
|
3646
|
+
const itemParent = p.currentItemsParent;
|
|
3647
|
+
|
|
3648
|
+
if (before !== false) {
|
|
3649
|
+
if (!(before instanceof Node))
|
|
3650
|
+
before = null;
|
|
3651
|
+
|
|
3652
|
+
// Insert into DOM
|
|
3653
|
+
if (itemEl.parentNode !== itemParent ||
|
|
3654
|
+
itemEl.nextSibling !== before) {
|
|
3655
|
+
insertBefore(itemEl, before, itemParent);
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
|
|
3659
|
+
if (virtualWrapper) {
|
|
3660
|
+
// Calculate height
|
|
3661
|
+
let itemHeight = itemEl.getBoundingClientRect().height;
|
|
3662
|
+
|
|
3663
|
+
// Put calculated height into cache, and invalidate positions if it's different
|
|
3664
|
+
let cachedItemHeight = p.cachedItemHeights[index];
|
|
3665
|
+
if (cachedItemHeight !== itemHeight) {
|
|
3666
|
+
p.cachedItemHeights[index] = itemHeight;
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
if (cachedItemHeight !== undefined && itemHeight !== cachedItemHeight ||
|
|
3670
|
+
cachedItemHeight === undefined && itemHeight !== p.cachedItemEstimatedHeights[index]) {
|
|
3671
|
+
this._setItemPositionsNeedsUpdate(index + 1);
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
// Set item top position
|
|
3675
|
+
let pos = this._calculateItemPosition(index);
|
|
3676
|
+
const supportedTransform = getSupportedTransform();
|
|
3677
|
+
|
|
3678
|
+
if (supportedTransform === false) {
|
|
3679
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style.top = `${pos}px`;
|
|
3680
|
+
} else {
|
|
3681
|
+
(/**@type ElementCSSInlineStyle*/itemEl).style[supportedTransform] = `translateY(${pos}px)`;
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
/**
|
|
3687
|
+
* Fetches valid range of existingEls
|
|
3688
|
+
* @returns {{firstIndex: (*|number), firstValidArrayIndex: number, lastValidArrayIndex: number, lastIndex: (*|number)}}
|
|
3689
|
+
* @private
|
|
3690
|
+
*/
|
|
3691
|
+
_getExistingElsRange() {
|
|
3692
|
+
const p = this._p,existingEls = p.existingEls;
|
|
3693
|
+
|
|
3694
|
+
let firstValidArrayIndex = -1,lastValidArrayIndex = -1;
|
|
3695
|
+
|
|
3696
|
+
for (let i = 0, len = existingEls.length; i < len; i++) {
|
|
3697
|
+
if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
|
|
3698
|
+
continue;
|
|
3699
|
+
firstValidArrayIndex = i;
|
|
3700
|
+
break;
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
for (let i = existingEls.length - 1; i >= 0; i--) {
|
|
3704
|
+
if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
|
|
3705
|
+
continue;
|
|
3706
|
+
lastValidArrayIndex = i;
|
|
3707
|
+
break;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
let firstIndex = firstValidArrayIndex !== -1 ? existingEls[firstValidArrayIndex][ItemIndexSymbol] : -1;
|
|
3711
|
+
let lastIndex = lastValidArrayIndex !== -1 ? existingEls[lastValidArrayIndex][ItemIndexSymbol] : -1;
|
|
3712
|
+
|
|
3713
|
+
return {
|
|
3714
|
+
firstValidArrayIndex: firstValidArrayIndex,
|
|
3715
|
+
lastValidArrayIndex: lastValidArrayIndex,
|
|
3716
|
+
firstIndex: firstIndex,
|
|
3717
|
+
lastIndex: lastIndex
|
|
3718
|
+
};
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
/** Marks the item index associated with an item element */
|
|
3723
|
+
const ItemIndexSymbol = Symbol('index');
|
|
3724
|
+
|
|
3725
|
+
/** Marks an element for reuse */
|
|
3726
|
+
const ReuseElSymbol = Symbol('reuse');
|
|
3727
|
+
|
|
3728
|
+
/**
|
|
3729
|
+
* The default element creator
|
|
3730
|
+
* @returns {HTMLLIElement}
|
|
3731
|
+
*/
|
|
3732
|
+
const defaultElementCreator = () => {
|
|
3733
|
+
return document.createElement('li');
|
|
3734
|
+
};
|
|
3735
|
+
|
|
3736
|
+
/**
|
|
3737
|
+
* Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
|
|
3738
|
+
* @param {number[]} positions
|
|
3739
|
+
* @param {number} pos
|
|
3740
|
+
* @param {number} [start=0]
|
|
3741
|
+
* @param {number} [end=-1]
|
|
3742
|
+
* @returns {number}
|
|
3743
|
+
*/
|
|
3744
|
+
const binarySearchPosition = (positions, pos, start = 0, end = -1) => {
|
|
3745
|
+
let total = positions.length;
|
|
3746
|
+
if (end < 0)
|
|
3747
|
+
end += total;
|
|
3748
|
+
if (end <= start) return end; // 0 or 1 length array
|
|
3749
|
+
|
|
3750
|
+
while (start <= end) {
|
|
3751
|
+
let mid = Math.floor(start + (end - start) / 2);
|
|
3752
|
+
let midPos = positions[mid];
|
|
3753
|
+
|
|
3754
|
+
if (midPos === pos || midPos <= pos && mid < total && positions[mid + 1] > pos) {
|
|
3755
|
+
while (mid > 0 && positions[mid - 1] === midPos) // avoid bugs on 0-height items
|
|
3756
|
+
mid--;
|
|
3757
|
+
|
|
3758
|
+
return mid;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
if (midPos < pos)
|
|
3762
|
+
start = mid + 1;else
|
|
3763
|
+
|
|
3764
|
+
end = mid - 1;
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
return end === -1 ? 0 : total - 1;
|
|
3768
|
+
};
|
|
3769
|
+
|
|
3770
|
+
/**
|
|
3771
|
+
* Will look for the index in a virtual list of positions supplied by `total` and `fn`,
|
|
3772
|
+
* closest to the specified `pos` value (<= pos).
|
|
3773
|
+
* @param {number} total
|
|
3774
|
+
* @param {function(index: number):number} fn
|
|
3775
|
+
* @param {number} pos
|
|
3776
|
+
* @param {number} [start=0]
|
|
3777
|
+
* @param {number} [end=-1]
|
|
3778
|
+
* @returns {number}
|
|
3779
|
+
*/
|
|
3780
|
+
const binarySearchPositionByFn = (total, fn, pos, start = 0, end = -1) => {
|
|
3781
|
+
if (end < 0)
|
|
3782
|
+
end += total;
|
|
3783
|
+
if (end <= start) return end; // 0 or 1 length array
|
|
3784
|
+
|
|
3785
|
+
while (start <= end) {
|
|
3786
|
+
let mid = Math.floor(start + (end - start) / 2);
|
|
3787
|
+
let midPos = fn(mid);
|
|
3788
|
+
|
|
3789
|
+
if (midPos === pos || midPos <= pos && mid < total && fn(mid + 1) > pos) {
|
|
3790
|
+
while (mid > 0 && fn(mid - 1) === midPos) // avoid bugs on 0-height items
|
|
3791
|
+
mid--;
|
|
3792
|
+
|
|
3793
|
+
return mid;
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
if (midPos < pos)
|
|
3797
|
+
start = mid + 1;else
|
|
3798
|
+
|
|
3799
|
+
end = mid - 1;
|
|
3800
|
+
}
|
|
3801
|
+
|
|
3802
|
+
return end === -1 ? 0 : fn(total - 1);
|
|
3803
|
+
};
|
|
3804
|
+
|
|
3805
|
+
/**
|
|
3806
|
+
* Finds the last item in the array for which `fn` returns a truthy value
|
|
3807
|
+
* @param {Array} array
|
|
3808
|
+
* @param {Function} fn
|
|
3809
|
+
* @returns {undefined|*}
|
|
3810
|
+
*/
|
|
3811
|
+
const findLast = (array, fn) => {
|
|
3812
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
|
3813
|
+
if (fn(array[i])) {
|
|
3814
|
+
return array[i];
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
return undefined;
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
let _isTransformSupported = null;
|
|
3821
|
+
|
|
3822
|
+
const getSupportedTransform = () => {
|
|
3823
|
+
if (_isTransformSupported === null) {
|
|
3824
|
+
let prefixes = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
|
|
3825
|
+
let div = document.createElement('div');
|
|
3826
|
+
_isTransformSupported = false;
|
|
3827
|
+
for (let item of prefixes) {
|
|
3828
|
+
if (div && div.style[item] !== undefined) {
|
|
3829
|
+
_isTransformSupported = item;
|
|
3830
|
+
break;
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
}
|
|
3834
|
+
return _isTransformSupported;
|
|
3835
|
+
};
|
|
3836
|
+
|
|
3837
|
+
class DomEventsSink {
|
|
3838
|
+
constructor() {
|
|
3839
|
+
/**
|
|
3840
|
+
* @type {{el: EventTarget, name: string, handler: EventListenerOrEventListenerObject, useCapture: boolean}[]}
|
|
3841
|
+
* @private
|
|
3842
|
+
*/
|
|
3843
|
+
this._events = [];
|
|
3844
|
+
}
|
|
3845
|
+
|
|
3846
|
+
/**
|
|
3847
|
+
* @param {EventTarget} el
|
|
3848
|
+
* @param {string} eventName
|
|
3849
|
+
* @param {EventListenerOrEventListenerObject} handler
|
|
3850
|
+
* @param {boolean|AddEventListenerOptions} [optionsOrCapture=undefined]
|
|
3851
|
+
* @returns {DomEventsSink}
|
|
3852
|
+
*/
|
|
3853
|
+
add(el, eventName, handler, optionsOrCapture) {
|
|
3854
|
+
let parts = eventName.split('.');
|
|
3855
|
+
let name = parts[0];
|
|
3856
|
+
let namespace = parts[1];
|
|
3857
|
+
|
|
3858
|
+
el.addEventListener(name, handler, optionsOrCapture ? optionsOrCapture : false);
|
|
3859
|
+
let useCapture = optionsOrCapture === true || typeof optionsOrCapture === 'object' && optionsOrCapture.capture === true;
|
|
3860
|
+
this._events.push({ el: el, name: name, namespace: namespace, handler: handler, useCapture: useCapture });
|
|
3861
|
+
return this;
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
/**
|
|
3865
|
+
* @param {EventTarget} [el=undefined]
|
|
3866
|
+
* @param {string} [eventName=undefined]
|
|
3867
|
+
* @param {EventListenerOrEventListenerObject} [handler=undefined]
|
|
3868
|
+
* @param {boolean|EventListenerOptions} [optionsOrCapture=undefined]
|
|
3869
|
+
* @returns {DomEventsSink}
|
|
3870
|
+
*/
|
|
3871
|
+
remove(el, eventName, handler, optionsOrCapture) {
|
|
3872
|
+
let parts = eventName ? eventName.split('.') : '';
|
|
3873
|
+
let name = parts[0];
|
|
3874
|
+
let namespace = parts[1];
|
|
3875
|
+
|
|
3876
|
+
let useCapture = optionsOrCapture === true || typeof optionsOrCapture === 'object' && optionsOrCapture.capture === true;
|
|
3877
|
+
|
|
3878
|
+
let keep = [];
|
|
3879
|
+
let remove = [];
|
|
3880
|
+
|
|
3881
|
+
if (el || name || namespace || handler || optionsOrCapture !== undefined) {
|
|
3882
|
+
for (let item of this._events) {
|
|
3883
|
+
if (el && item.el !== el ||
|
|
3884
|
+
name && item.name !== name ||
|
|
3885
|
+
namespace && item.namespace !== namespace ||
|
|
3886
|
+
handler && item.handler !== handler ||
|
|
3887
|
+
optionsOrCapture !== undefined && item.useCapture !== useCapture) {
|
|
3888
|
+
keep.push(item);
|
|
3889
|
+
} else {
|
|
3890
|
+
remove.push(item);
|
|
3891
|
+
}
|
|
3892
|
+
}
|
|
3893
|
+
} else {
|
|
3894
|
+
remove = this._events;
|
|
3895
|
+
}
|
|
3896
|
+
|
|
3897
|
+
this._events = keep;
|
|
3898
|
+
|
|
3899
|
+
for (let item of remove) {
|
|
3900
|
+
item.el.removeEventListener(item.name, item.handler, item.useCapture);
|
|
3901
|
+
}
|
|
3902
|
+
return this;
|
|
3903
|
+
}
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
var h,c,m = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {},f = {};function p() {if (c) return h;c = 1;var e = function (e) {return e && e.Math === Math && e;};return h = e("object" == typeof globalThis && globalThis) || e("object" == typeof window && window) || e("object" == typeof self && self) || e("object" == typeof m && m) || e("object" == typeof h && h) || function () {return this;}() || Function("return this")();}var v,g,b,C,w,y,_,S,W = {};function R() {return g ? v : (g = 1, v = function (e) {try {return !!e();} catch (e) {return true;}});}function N() {if (C) return b;C = 1;var e = R();return b = !e(function () {return 7 !== Object.defineProperty({}, 1, { get: function () {return 7;} })[1];});}function T() {if (y) return w;y = 1;var e = R();return w = !e(function () {var e = function () {}.bind();return "function" != typeof e || e.hasOwnProperty("prototype");});}function L() {if (S) return _;S = 1;var e = T(),t = Function.prototype.call;return _ = e ? t.bind(t) : function () {return t.apply(t, arguments);}, _;}var E,x,z,P,F,O,H,M,A,k,I,B,j,D,V,$,U,q,X,Y,G,J,K,Q,Z,ee,te,re,ie,le,oe,ne,se,ae,de,ue,he,ce,me,fe,pe,ve = {};function ge() {return z ? x : (z = 1, x = function (e, t) {return { enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t };});}function be() {if (F) return P;F = 1;var e = T(),t = Function.prototype,r = t.call,i = e && t.bind.bind(r, r);return P = e ? i : function (e) {return function () {return r.apply(e, arguments);};}, P;}function Ce() {if (H) return O;H = 1;var e = be(),t = e({}.toString),r = e("".slice);return O = function (e) {return r(t(e), 8, -1);};}function we() {return I ? k : (I = 1, k = function (e) {return null == e;});}function ye() {if (j) return B;j = 1;var e = we(),t = TypeError;return B = function (r) {if (e(r)) throw new t("Can't call method on " + r);return r;};}function _e() {if (V) return D;V = 1;var e = function () {if (A) return M;A = 1;var e = be(),t = R(),r = Ce(),i = Object,l = e("".split);return M = t(function () {return !i("z").propertyIsEnumerable(0);}) ? function (e) {return "String" === r(e) ? l(e, "") : i(e);} : i;}(),t = ye();return D = function (r) {return e(t(r));};}function Se() {if (U) return $;U = 1;var e = "object" == typeof document && document.all;return $ = void 0 === e && void 0 !== e ? function (t) {return "function" == typeof t || t === e;} : function (e) {return "function" == typeof e;};}function We() {if (X) return q;X = 1;var e = Se();return q = function (t) {return "object" == typeof t ? null !== t : e(t);};}function Re() {if (G) return Y;G = 1;var e = p(),t = Se();return Y = function (r, i) {return arguments.length < 2 ? (l = e[r], t(l) ? l : void 0) : e[r] && e[r][i];var l;}, Y;}function Ne() {if (K) return J;K = 1;var e = be();return J = e({}.isPrototypeOf);}function Te() {if (Z) return Q;Z = 1;var e = p().navigator,t = e && e.userAgent;return Q = t ? String(t) : "";}function Le() {if (te) return ee;te = 1;var e,t,r = p(),i = Te(),l = r.process,o = r.Deno,n = l && l.versions || o && o.version,s = n && n.v8;return s && (t = (e = s.split("."))[0] > 0 && e[0] < 4 ? 1 : +(e[0] + e[1])), !t && i && (!(e = i.match(/Edge\/(\d+)/)) || e[1] >= 74) && (e = i.match(/Chrome\/(\d+)/)) && (t = +e[1]), ee = t;}function Ee() {if (ie) return re;ie = 1;var e = Le(),t = R(),r = p().String;return re = !!Object.getOwnPropertySymbols && !t(function () {var t = Symbol("symbol detection");return !r(t) || !(Object(t) instanceof Symbol) || !Symbol.sham && e && e < 41;});}function xe() {if (oe) return le;oe = 1;var e = Ee();return le = e && !Symbol.sham && "symbol" == typeof Symbol.iterator;}function ze() {if (se) return ne;se = 1;var e = Re(),t = Se(),r = Ne(),i = xe(),l = Object;return ne = i ? function (e) {return "symbol" == typeof e;} : function (i) {var o = e("Symbol");return t(o) && r(o.prototype, l(i));};}function Pe() {if (de) return ae;de = 1;var e = String;return ae = function (t) {try {return e(t);} catch (e) {return "Object";}};}function Fe() {if (he) return ue;he = 1;var e = Se(),t = Pe(),r = TypeError;return ue = function (i) {if (e(i)) return i;throw new r(t(i) + " is not a function");};}function Oe() {if (me) return ce;me = 1;var e = Fe(),t = we();return ce = function (r, i) {var l = r[i];return t(l) ? void 0 : e(l);};}function He() {if (pe) return fe;pe = 1;var e = L(),t = Se(),r = We(),i = TypeError;return fe = function (l, o) {var n, s;if ("string" === o && t(n = l.toString) && !r(s = e(n, l))) return s;if (t(n = l.valueOf) && !r(s = e(n, l))) return s;if ("string" !== o && t(n = l.toString) && !r(s = e(n, l))) return s;throw new i("Can't convert object to primitive value");};}var Me,Ae,ke,Ie,Be,je,De,Ve,$e,Ue,qe,Xe,Ye,Ge,Je,Ke,Qe,Ze,et,tt,rt,it,lt,ot,nt = { exports: {} };function st() {if (Ie) return ke;Ie = 1;var e = p(),t = Object.defineProperty;return ke = function (r, i) {try {t(e, r, { value: i, configurable: !0, writable: !0 });} catch (t) {e[r] = i;}return i;};}function at() {if (Be) return nt.exports;Be = 1;var e = Ae ? Me : (Ae = 1, Me = false),t = p(),r = st(),i = "__core-js_shared__",l = nt.exports = t[i] || r(i, {});return (l.versions || (l.versions = [])).push({ version: "3.47.0", mode: e ? "pure" : "global", copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)", license: "https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE", source: "https://github.com/zloirock/core-js" }), nt.exports;}function dt() {if (De) return je;De = 1;var e = at();return je = function (t, r) {return e[t] || (e[t] = r || {});};}function ut() {if ($e) return Ve;$e = 1;var e = ye(),t = Object;return Ve = function (r) {return t(e(r));};}function ht() {if (qe) return Ue;qe = 1;var e = be(),t = ut(),r = e({}.hasOwnProperty);return Ue = Object.hasOwn || function (e, i) {return r(t(e), i);};}function ct() {if (Ye) return Xe;Ye = 1;var e = be(),t = 0,r = Math.random(),i = e(1.1.toString);return Xe = function (e) {return "Symbol(" + (void 0 === e ? "" : e) + ")_" + i(++t + r, 36);};}function mt() {if (Je) return Ge;Je = 1;var e = p(),t = dt(),r = ht(),i = ct(),l = Ee(),o = xe(),n = e.Symbol,s = t("wks"),a = o ? n.for || n : n && n.withoutSetter || i;return Ge = function (e) {return r(s, e) || (s[e] = l && r(n, e) ? n[e] : a("Symbol." + e)), s[e];};}function ft() {if (Qe) return Ke;Qe = 1;var e = L(),t = We(),r = ze(),i = Oe(),l = He(),o = mt(),n = TypeError,s = o("toPrimitive");return Ke = function (o, a) {if (!t(o) || r(o)) return o;var d,u = i(o, s);if (u) {if (void 0 === a && (a = "default"), d = e(u, o, a), !t(d) || r(d)) return d;throw new n("Can't convert object to primitive value");}return void 0 === a && (a = "number"), l(o, a);};}function pt() {if (et) return Ze;et = 1;var e = ft(),t = ze();return Ze = function (r) {var i = e(r, "string");return t(i) ? i : i + "";};}function vt() {if (lt) return it;lt = 1;var e = N(),t = R(),r = function () {if (rt) return tt;rt = 1;var e = p(),t = We(),r = e.document,i = t(r) && t(r.createElement);return tt = function (e) {return i ? r.createElement(e) : {};};}();return it = !e && !t(function () {return 7 !== Object.defineProperty(r("div"), "a", { get: function () {return 7;} }).a;});}function gt() {if (ot) return W;ot = 1;var e = N(),t = L(),r = function () {if (E) return ve;E = 1;var e = {}.propertyIsEnumerable,t = Object.getOwnPropertyDescriptor,r = t && !e.call({ 1: 2 }, 1);return ve.f = r ? function (e) {var r = t(this, e);return !!r && r.enumerable;} : e, ve;}(),i = ge(),l = _e(),o = pt(),n = ht(),s = vt(),a = Object.getOwnPropertyDescriptor;return W.f = e ? a : function (e, d) {if (e = l(e), d = o(d), s) try {return a(e, d);} catch (e) {}if (n(e, d)) return i(!t(r.f, e, d), e[d]);}, W;}var bt,Ct,wt,yt,_t,St,Wt,Rt = {};function Nt() {if (yt) return wt;yt = 1;var e = We(),t = String,r = TypeError;return wt = function (i) {if (e(i)) return i;throw new r(t(i) + " is not an object");};}function Tt() {if (_t) return Rt;_t = 1;var e = N(),t = vt(),r = function () {if (Ct) return bt;Ct = 1;var e = N(),t = R();return bt = e && t(function () {return 42 !== Object.defineProperty(function () {}, "prototype", { value: 42, writable: false }).prototype;});}(),i = Nt(),l = pt(),o = TypeError,n = Object.defineProperty,s = Object.getOwnPropertyDescriptor,a = "enumerable",d = "configurable",u = "writable";return Rt.f = e ? r ? function (e, t, r) {if (i(e), t = l(t), i(r), "function" == typeof e && "prototype" === t && "value" in r && u in r && !r[u]) {var o = s(e, t);o && o[u] && (e[t] = r.value, r = { configurable: d in r ? r[d] : o[d], enumerable: a in r ? r[a] : o[a], writable: false });}return n(e, t, r);} : n : function (e, r, s) {if (i(e), r = l(r), i(s), t) try {return n(e, r, s);} catch (e) {}if ("get" in s || "set" in s) throw new o("Accessors not supported");return "value" in s && (e[r] = s.value), e;}, Rt;}function Lt() {if (Wt) return St;Wt = 1;var e = N(),t = Tt(),r = ge();return St = e ? function (e, i, l) {return t.f(e, i, r(1, l));} : function (e, t, r) {return e[t] = r, e;};}var Et,xt,zt,Pt,Ft,Ot,Ht,Mt,At,kt,It,Bt,jt,Dt,Vt,$t = { exports: {} };function Ut() {if (Pt) return zt;Pt = 1;var e = be(),t = Se(),r = at(),i = e(Function.toString);return t(r.inspectSource) || (r.inspectSource = function (e) {return i(e);}), zt = r.inspectSource;}function qt() {if (Mt) return Ht;Mt = 1;var e = dt(),t = ct(),r = e("keys");return Ht = function (e) {return r[e] || (r[e] = t(e));};}function Xt() {return kt ? At : (kt = 1, At = {});}function Yt() {if (jt) return $t.exports;jt = 1;var e = be(),t = R(),r = Se(),i = ht(),l = N(),o = function () {if (xt) return Et;xt = 1;var e = N(),t = ht(),r = Function.prototype,i = e && Object.getOwnPropertyDescriptor,l = t(r, "name"),o = l && "something" === function () {}.name,n = l && (!e || e && i(r, "name").configurable);return Et = { EXISTS: l, PROPER: o, CONFIGURABLE: n };}().CONFIGURABLE,n = Ut(),s = function () {if (Bt) return It;Bt = 1;var e,t,r,i = function () {if (Ot) return Ft;Ot = 1;var e = p(),t = Se(),r = e.WeakMap;return Ft = t(r) && /native code/.test(String(r));}(),l = p(),o = We(),n = Lt(),s = ht(),a = at(),d = qt(),u = Xt(),h = "Object already initialized",c = l.TypeError,m = l.WeakMap;if (i || a.state) {var f = a.state || (a.state = new m());f.get = f.get, f.has = f.has, f.set = f.set, e = function (e, t) {if (f.has(e)) throw new c(h);return t.facade = e, f.set(e, t), t;}, t = function (e) {return f.get(e) || {};}, r = function (e) {return f.has(e);};} else {var v = d("state");u[v] = true, e = function (e, t) {if (s(e, v)) throw new c(h);return t.facade = e, n(e, v, t), t;}, t = function (e) {return s(e, v) ? e[v] : {};}, r = function (e) {return s(e, v);};}return It = { set: e, get: t, has: r, enforce: function (i) {return r(i) ? t(i) : e(i, {});}, getterFor: function (e) {return function (r) {var i;if (!o(r) || (i = t(r)).type !== e) throw new c("Incompatible receiver, " + e + " required");return i;};} };}(),a = s.enforce,d = s.get,u = String,h = Object.defineProperty,c = e("".slice),m = e("".replace),f = e([].join),v = l && !t(function () {return 8 !== h(function () {}, "length", { value: 8 }).length;}),g = String(String).split("String"),b = $t.exports = function (e, t, r) {"Symbol(" === c(u(t), 0, 7) && (t = "[" + m(u(t), /^Symbol\(([^)]*)\).*$/, "$1") + "]"), r && r.getter && (t = "get " + t), r && r.setter && (t = "set " + t), (!i(e, "name") || o && e.name !== t) && (l ? h(e, "name", { value: t, configurable: true }) : e.name = t), v && r && i(r, "arity") && e.length !== r.arity && h(e, "length", { value: r.arity });try {r && i(r, "constructor") && r.constructor ? l && h(e, "prototype", { writable: !1 }) : e.prototype && (e.prototype = void 0);} catch (e) {}var n = a(e);return i(n, "source") || (n.source = f(g, "string" == typeof t ? t : "")), e;};return Function.prototype.toString = b(function () {return r(this) && d(this).source || n(this);}, "toString"), $t.exports;}function Gt() {if (Vt) return Dt;Vt = 1;var e = Se(),t = Tt(),r = Yt(),i = st();return Dt = function (l, o, n, s) {s || (s = {});var a = s.enumerable,d = void 0 !== s.name ? s.name : o;if (e(n) && r(n, d, s), s.global) a ? l[o] = n : i(o, n);else {try {s.unsafe ? l[o] && (a = !0) : delete l[o];} catch (e) {}a ? l[o] = n : t.f(l, o, { value: n, enumerable: false, configurable: !s.nonConfigurable, writable: !s.nonWritable });}return l;};}var Jt,Kt,Qt,Zt,er,tr,rr,ir,lr,or,nr,sr,ar,dr,ur,hr,cr,mr = {};function fr() {if (Zt) return Qt;Zt = 1;var e = function () {if (Kt) return Jt;Kt = 1;var e = Math.ceil,t = Math.floor;return Jt = Math.trunc || function (r) {var i = +r;return (i > 0 ? t : e)(i);};}();return Qt = function (t) {var r = +t;return r != r || 0 === r ? 0 : e(r);};}function pr() {if (tr) return er;tr = 1;var e = fr(),t = Math.max,r = Math.min;return er = function (i, l) {var o = e(i);return o < 0 ? t(o + l, 0) : r(o, l);};}function vr() {if (ir) return rr;ir = 1;var e = fr(),t = Math.min;return rr = function (r) {var i = e(r);return i > 0 ? t(i, 9007199254740991) : 0;};}function gr() {if (or) return lr;or = 1;var e = vr();return lr = function (t) {return e(t.length);};}var br,Cr,wr,yr,_r,Sr,Wr,Rr,Nr,Tr,Lr,Er,xr,zr,Pr,Fr,Or,Hr,Mr = {};function Ar() {if (wr) return Cr;wr = 1;var e = Re(),t = be(),r = function () {if (cr) return mr;cr = 1;var e = function () {if (dr) return ar;dr = 1;var e = be(),t = ht(),r = _e(),i = function () {if (sr) return nr;sr = 1;var e = _e(),t = pr(),r = gr(),i = function (i) {return function (l, o, n) {var s = e(l),a = r(s);if (0 === a) return !i && -1;var d,u = t(n, a);if (i && o != o) {for (; a > u;) if ((d = s[u++]) != d) return true;} else for (; a > u; u++) if ((i || u in s) && s[u] === o) return i || u || 0;return !i && -1;};};return nr = { includes: i(true), indexOf: i(false) };}().indexOf,l = Xt(),o = e([].push);return ar = function (e, n) {var s,a = r(e),d = 0,u = [];for (s in a) !t(l, s) && t(a, s) && o(u, s);for (; n.length > d;) t(a, s = n[d++]) && (~i(u, s) || o(u, s));return u;};}(),t = (hr ? ur : (hr = 1, ur = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"])).concat("length", "prototype");return mr.f = Object.getOwnPropertyNames || function (r) {return e(r, t);}, mr;}(),i = (br || (br = 1, Mr.f = Object.getOwnPropertySymbols), Mr),l = Nt(),o = t([].concat);return Cr = e("Reflect", "ownKeys") || function (e) {var t = r.f(l(e)),n = i.f;return n ? o(t, n(e)) : t;};}function kr() {if (_r) return yr;_r = 1;var e = ht(),t = Ar(),r = gt(),i = Tt();return yr = function (l, o, n) {for (var s = t(o), a = i.f, d = r.f, u = 0; u < s.length; u++) {var h = s[u];e(l, h) || n && e(n, h) || a(l, h, d(o, h));}};}function Ir() {if (Nr) return Rr;Nr = 1;var e = p(),t = gt().f,r = Lt(),i = Gt(),l = st(),o = kr(),n = function () {if (Wr) return Sr;Wr = 1;var e = R(),t = Se(),r = /#|\.prototype\./,i = function (r, i) {var a = o[l(r)];return a === s || a !== n && (t(i) ? e(i) : !!i);},l = i.normalize = function (e) {return String(e).replace(r, ".").toLowerCase();},o = i.data = {},n = i.NATIVE = "N",s = i.POLYFILL = "P";return Sr = i;}();return Rr = function (s, a) {var d,u,h,c,m,f = s.target,p = s.global,v = s.stat;if (d = p ? e : v ? e[f] || l(f, {}) : e[f] && e[f].prototype) for (u in a) {if (c = a[u], h = s.dontCallGetSet ? (m = t(d, u)) && m.value : d[u], !n(p ? u : f + (v ? "." : "#") + u, s.forced) && void 0 !== h) {if (typeof c == typeof h) continue;o(c, h);}(s.sham || h && h.sham) && r(c, "sham", true), i(d, u, c, s);}};}function Br() {if (xr) return Er;xr = 1;var e = function () {if (Lr) return Tr;Lr = 1;var e = {};return e[mt()("toStringTag")] = "z", Tr = "[object z]" === String(e);}(),t = Se(),r = Ce(),i = mt()("toStringTag"),l = Object,o = "Arguments" === r(function () {return arguments;}());return Er = e ? r : function (e) {var n, s, a;return void 0 === e ? "Undefined" : null === e ? "Null" : "string" == typeof (s = function (e, t) {try {return e[t];} catch (e) {}}(n = l(e), i)) ? s : o ? r(n) : "Object" === (a = r(n)) && t(n.callee) ? "Arguments" : a;};}function jr() {if (Pr) return zr;Pr = 1;var e = Br(),t = String;return zr = function (r) {if ("Symbol" === e(r)) throw new TypeError("Cannot convert a Symbol value to a string");return t(r);};}function Dr() {if (Or) return Fr;Or = 1;var e = Yt(),t = Tt();return Fr = function (r, i, l) {return l.get && e(l.get, i, { getter: true }), l.set && e(l.set, i, { setter: true }), t.f(r, i, l);};}!function () {if (Hr) return f;Hr = 1;var e = Ir(),t = N(),r = p(),i = be(),l = ht(),o = Se(),n = Ne(),s = jr(),a = Dr(),d = kr(),u = r.Symbol,h = u && u.prototype;if (t && o(u) && (!("description" in h) || void 0 !== u().description)) {var c = {},m = function () {var e = arguments.length < 1 || void 0 === arguments[0] ? void 0 : s(arguments[0]),t = n(h, this) ? new u(e) : void 0 === e ? u() : u(e);return "" === e && (c[t] = true), t;};d(m, u), m.prototype = h, h.constructor = m;var v = "Symbol(description detection)" === String(u("description detection")),g = i(h.valueOf),b = i(h.toString),C = /^Symbol\((.*)\)[^)]+$/,w = i("".replace),y = i("".slice);a(h, "description", { configurable: true, get: function () {var e = g(this);if (l(c, e)) return "";var t = b(e),r = v ? y(t, 7, -1) : w(t, C, "$1");return "" === r ? void 0 : r;} }), e({ global: true, constructor: true, forced: true }, { Symbol: m });}}();var Vr,$r,Ur,qr,Xr,Yr,Gr,Jr,Kr,Qr,Zr,ei,ti,ri,ii,li = {};function oi() {if ($r) return Vr;$r = 1;var e = Pe(),t = TypeError;return Vr = function (r, i) {if (!delete r[i]) throw new t("Cannot delete property " + e(i) + " of " + e(r));};}function ni() {if (qr) return Ur;qr = 1;var e = be();return Ur = e([].slice);}function si() {if (Jr) return Gr;Jr = 1;var e = R();return Gr = function (t, r) {var i = [][t];return !!i && e(function () {i.call(null, r || function () {return 1;}, 1);});};}!function () {if (ii) return li;ii = 1;var e = Ir(),t = be(),r = Fe(),i = ut(),l = gr(),o = oi(),n = jr(),s = R(),a = function () {if (Yr) return Xr;Yr = 1;var e = ni(),t = Math.floor,r = function (i, l) {var o = i.length;if (o < 8) for (var n, s, a = 1; a < o;) {for (s = a, n = i[a]; s && l(i[s - 1], n) > 0;) i[s] = i[--s];s !== a++ && (i[s] = n);} else for (var d = t(o / 2), u = r(e(i, 0, d), l), h = r(e(i, d), l), c = u.length, m = h.length, f = 0, p = 0; f < c || p < m;) i[f + p] = f < c && p < m ? l(u[f], h[p]) <= 0 ? u[f++] : h[p++] : f < c ? u[f++] : h[p++];return i;};return Xr = r;}(),d = si(),u = function () {if (Qr) return Kr;Qr = 1;var e = Te().match(/firefox\/(\d+)/i);return Kr = !!e && +e[1];}(),h = function () {if (ei) return Zr;ei = 1;var e = Te();return Zr = /MSIE|Trident/.test(e);}(),c = Le(),m = function () {if (ri) return ti;ri = 1;var e = Te().match(/AppleWebKit\/(\d+)\./);return ti = !!e && +e[1];}(),f = [],p = t(f.sort),v = t(f.push),g = s(function () {f.sort(void 0);}),b = s(function () {f.sort(null);}),C = d("sort"),w = !s(function () {if (c) return c < 70;if (!(u && u > 3)) {if (h) return true;if (m) return m < 603;var e,t,r,i,l = "";for (e = 65; e < 76; e++) {switch (t = String.fromCharCode(e), e) {case 66:case 69:case 70:case 72:r = 3;break;case 68:case 71:r = 4;break;default:r = 2;}for (i = 0; i < 47; i++) f.push({ k: t + i, v: r });}for (f.sort(function (e, t) {return t.v - e.v;}), i = 0; i < f.length; i++) t = f[i].k.charAt(0), l.charAt(l.length - 1) !== t && (l += t);return "DGBEFHACIJK" !== l;}});e({ target: "Array", proto: true, forced: g || !b || !C || !w }, { sort: function (e) { void 0 !== e && r(e);var t = i(this);if (w) return void 0 === e ? p(t) : p(t, e);var s,d,u = [],h = l(t);for (d = 0; d < h; d++) d in t && v(u, t[d]);for (a(u, function (e) {return function (t, r) {return void 0 === r ? -1 : void 0 === t ? 1 : void 0 !== e ? +e(t, r) || 0 : n(t) > n(r) ? 1 : -1;};}(e)), s = l(u), d = 0; d < s;) t[d] = u[d++];for (; d < h;) o(t, d++);return t;} });}();const ai = function (e, t) {for (let r = 0, i = e.length; r >= 0 && r < i; r += 1) if (t(e[r], r, e)) return e[r];},di = function (e) {return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/'/g, "'").replace(/"/g, """).replace(/\n/g, "<br />");};function ui() {let e = [];return Object.assign(e, ui.prototype), e.initialize.apply(e, arguments), e;}ui.prototype = [], ui.prototype.initialize = function (e) {e = e || {}, this.sortColumn = null == e.sortColumn ? [] : e.sortColumn;}, ui.prototype.add = function (e, t) {let r, i;if ("splice" in e && "length" in e) {if ("number" == typeof t) for (r = 0, i = e.length; r < i; r++) this.splice(t++, 0, e[r]);else for (r = 0, i = e.length; r < i; r++) this.push(e[r]);} else "number" == typeof t ? this.splice(t, 0, e) : this.push(e);}, ui.prototype.reset = function (e) {this.length = 0, e && this.add(e);}, ui.prototype.filteredCollection = function (e, t) {if (e && t) {let r = new ui({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let i, l = 0, o = this.length; l < o; l++) i = this[l], e(i, t) && (i.__i = l, r.push(i));return r;}return null;}, ui.prototype.onComparatorRequired = null, ui.prototype.customSortingProvider = null;let hi = ui.prototype.sort;function ci(e, t) {let r = e.column,i = e.comparePath || r;"string" == typeof i && (i = i.split("."));let l,o = i.length,n = o > 1,s = t ? 1 : -1,a = t ? -1 : 1;return function (e, t) {let r = e[i[0]],d = t[i[0]];if (n) for (l = 1; l < o; l++) r = r && r[i[l]], d = d && d[i[l]];return r === d ? 0 : null == r ? s : null == d ? a : r < d ? s : a;};}function mi() {let e = [];return Object.assign(e, mi.prototype), e.initialize.apply(e, arguments), e;}ui.prototype.sort = function () {let e;if (this.sortColumn.length) {let t = [];for (let r = 0; r < this.sortColumn.length; r++) {e = null;const i = ci(this.sortColumn[r], this.sortColumn[r].descending);this.onComparatorRequired && (e = this.onComparatorRequired(this.sortColumn[r].column, this.sortColumn[r].descending, i)), e || (e = i), t.push(e.bind(this));}if (1 === t.length) e = t[0];else {let r,i = t.length;e = function (e, l) {for (let o = 0; o < i; o++) if (r = t[o](e, l), 0 !== r) return r;return r;};}const r = (t) => hi.call(t, e);if (this.customSortingProvider) {let e = this.customSortingProvider(this, r);e !== this && this.splice(0, this.length, ...e);} else r(this);}return e;}, mi.prototype = [], mi.prototype.initialize = function () {}, mi.prototype.get = function (e) {for (let t = 0, r = this.length; t < r; t++) if (this[t].name === e) return this[t];return null;}, mi.prototype.indexOf = function (e) {for (let t = 0, r = this.length; t < r; t++) if (this[t].name === e) return t;return -1;}, mi.prototype.getByOrder = function (e) {for (let t = 0, r = this.length; t < r; t++) if (this[t].order === e) return this[t];return null;}, mi.prototype.normalizeOrder = function () {let e,t = [];for (e = 0; e < this.length; e++) t.push(this[e]);for (t.sort(function (e, t) {return e.order < t.order ? -1 : e.order > t.order ? 1 : 0;}), e = 0; e < t.length; e++) t[e].order = e;return this;}, mi.prototype.getColumns = function () {let e = [];for (let t, r = 0; r < this.length; r++) t = this[r], e.push(t);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}, mi.prototype.getVisibleColumns = function () {let e = [];for (let t, r = 0; r < this.length; r++) t = this[r], t.visible && e.push(t);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}, mi.prototype.getMaxOrder = function () {let e = 0;for (let t, r = 0; r < this.length; r++) t = this[r], t.order > e && (e = t.order);return e;}, mi.prototype.moveColumn = function (e, t) {if (e && t) {let r,i,l = e.order,o = t.order;if (l < o) for (r = l + 1; r <= o; r++) i = this.getByOrder(r), i.order--;else for (r = l - 1; r >= o; r--) i = this.getByOrder(r), i.order++;e.order = o;}return this;};class fi {static saveSelection(e) {let t = window.getSelection().getRangeAt(0);if (e !== t.commonAncestorContainer && !function (e, t) {for (; (e = e.parentNode) && e !== t;);return !!e;}(t.commonAncestorContainer, e)) return null;let r = t.cloneRange();r.selectNodeContents(e), r.setEnd(t.startContainer, t.startOffset);let i = r.toString().length;return { start: i, end: i + t.toString().length };}static restoreSelection(e, t) {let r,i = 0,l = [e],o = false,n = false,s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (r = l.pop());) if (3 === r.nodeType) {let e = i + r.length;!o && t.start >= i && t.start <= e && (s.setStart(r, t.start - i), o = true), o && t.end >= i && t.end <= e && (s.setEnd(r, t.end - i), n = true), i = e;} else {let e = r.childNodes.length;for (; e--;) l.push(r.childNodes[e]);}let a = window.getSelection();a.removeAllRanges(), a.addRange(s);}}function pi(e, t) {let r = t.column,i = null == t.keyword ? "" : t.keyword.toString();if (!i || !r) return true;let l = e[r];return null != l && (l = l.toString(), t.caseSensitive || (l = l.toLowerCase(), i = i.toLowerCase()), -1 !== l.indexOf(i));}const vi = Array.prototype.indexOf;let gi = document.createElement.bind(document);const bi = Object.prototype.hasOwnProperty,Ci = Symbol("safe"),wi = Symbol("hover_in"),yi = Symbol("hover_out"),_i = Symbol("row_click"),Si = Symbol("preview_cell"),Wi = Symbol("cell");function Ri(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}const Ni = (e) => /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(e.target.tagName);class Ti {constructor(e) {this._init(e), this.VERSION = Ti.VERSION;}_init(e) {e = e || {};let t = this._o = {},r = this._p = { eventsSink: new DomEventsSink(), mitt: { all: i = i || new Map(), on: function (e, t) {var r = i.get(e);r ? r.push(t) : i.set(e, [t]);}, off: function (e, t) {var r = i.get(e);r && (t ? r.splice(r.indexOf(t) >>> 0, 1) : i.set(e, []));}, emit: function (e, t) {var r = i.get(e);r && r.slice().map(function (e) {e(t);}), (r = i.get("*")) && r.slice().map(function (r) {r(e, t);});} }, tableSkeletonNeedsRendering: true };var i;this.el = e.el && e.el instanceof Element ? e.el : document.createElement("div"), this.el !== e.el && this.el.classList.add(e.className || "dgtable-wrapper"), r.eventsSink.add(this.el, "dragend.colresize", this._onEndDragColumnHeader.bind(this)), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = e.rowsBufferSize || 3, t.minColumnWidth = Math.max(e.minColumnWidth || 35, 0), t.resizeAreaWidth = e.resizeAreaWidth || 8, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns, t.sortableColumns = void 0 === e.sortableColumns ? 1 : parseInt(e.sortableColumns, 10) || 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.onComparatorRequired || "function" != typeof e.comparatorCallback || (t.onComparatorRequired = e.comparatorCallback), t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? Ti.Width.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let l = [];if (e.sortColumn) {let t = e.sortColumn;if (t && !Array.isArray(t) && (t = [t]), t) for (let e = 0, i = t.length; e < i; e++) {let i = t[e];"string" == typeof i && (i = { column: i, descending: false });let o = r.columns.get(i.column);o && l.push({ column: i.column, comparePath: o.comparePath || o.dataPath, descending: i.descending });}}r.rows = new ui({ sortColumn: l }), r.rows.onComparatorRequired = (e, r, i) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, r, i);}, r.rows.customSortingProvider = (e, r) => t.customSortingProvider ? t.customSortingProvider(e, r) : r(e), r.filteredRows = null, r.scrollbarWidth = 0, r.lastVirtualScrollHeight = 0, this._setupHovers();}_setupHovers() {const e = this._p;let t = (e) => {let t = e.currentTarget,r = e.relatedTarget;r === t || t.contains(r) || t[Si] && (r === t[Si] || t[Si].contains(r)) || this._cellMouseOverEvent(t);},r = (e) => {let t = e.currentTarget[Wi] || e.currentTarget,r = e.relatedTarget;r === this || t.contains(r) || t[Si] && (r === t[Si] || t[Si].contains(r)) || this._cellMouseOutEvent(t);};e._bindCellHoverIn = (e) => {e[wi] || e.addEventListener("mouseover", e[wi] = t);}, e._unbindCellHoverIn = (e) => {e[wi] && (e.removeEventListener("mouseover", e[wi]), e[wi] = null);}, e._bindCellHoverOut = (e) => {e[yi] || e.addEventListener("mouseout", e[yi] = r);}, e._unbindCellHoverOut = (e) => {e[yi] && (e.removeEventListener("mouseout", e[yi]), e[yi] = null);};}_setupVirtualTable() {var e;const t = this._p,r = this._o,i = r.tableClassName,l = i + "-row",o = i + "-row-alt",n = i + "-cell";let s = t.visibleColumns,a = s.length;t.notifyRendererOfColumnsConfig = () => {s = t.visibleColumns, a = s.length;for (let e, t = 0; t < a; t++) e = s[t], e._finalWidth = e.actualWidthConsideringScrollbarWidth || e.actualWidth;}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: r.virtualTable, buffer: r.rowsBufferSize, estimatedItemHeight: r.estimatedRowHeight ? r.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => gi("div"), onItemRender: (e, i) => {const d = t.filteredRows || t.rows,u = !!t.filteredRows,h = r.allowCellPreview;e.className = l, i % 2 == 1 && (e.className += " " + o);let c = d[i],m = u ? c.__i : i;e.vIndex = i, e.index = m;for (let r = 0; r < a; r++) {let i = s[r],l = gi("div");l.columnName = i.name, l.setAttribute("data-column", i.name), l.className = n, l.style.width = i._finalWidth + "px", i.cellClasses && (l.className += " " + i.cellClasses), h && t._bindCellHoverIn(l), l.appendChild(gi("div")).innerHTML = this._getHtmlForCell(c, i), e.appendChild(l);}e.addEventListener("click", e[_i] = (t) => {this.emit("rowclick", { event: t, filteredRowIndex: i, rowIndex: m, rowEl: e, rowData: c });}), this.emit("rowcreate", { filteredRowIndex: i, rowIndex: m, rowEl: e, rowData: c });}, onItemUnrender: (e) => {e[_i] && e.removeEventListener("click", e[_i]), this._unbindCellEventsForRow(e), this.emit("rowdestroy", e);}, onScrollHeightChange: (e) => {e > t._lastVirtualScrollHeight && !t.scrollbarWidth && this._updateLastCellWidthFromScrollbar(), t._lastVirtualScrollHeight = e;} }), t.virtualListHelper.setCount((null !== (e = t.filteredRows) && void 0 !== e ? e : t.rows).length), t.notifyRendererOfColumnsConfig();}trigger(e) {const t = this._p;if (!t) return;let r = t.events;if (bi.call(r, e)) {let t = r[e];for (let e = 0; e < t.length; e++) {let r = t[e];r.once && t.splice(e--, 1), r.cb.apply(this, Array.prototype.slice.call(arguments, 1));}}return this;}on(e, t) {return this._p.mitt.on(e, t), this;}once(e, t) {let r = (i) => {this._p.mitt.off(e, r), t(i);};return this._p.mitt.on(e, r), this;}off(e, t) {return e || e ? this._p.mitt.off(e, t) : this._p.mitt.all.clear(), this;}emit(e, t) {return this._p.mitt.emit(e, t), this;}_parseColumnWidth(e, t) {let r = Math.max(0, parseFloat(e)),i = Li.AUTO;return r > 0 && (e === r + "%" ? (i = Li.RELATIVE, r /= 100) : r > 0 && r < 1 ? i = Li.RELATIVE : (r < t && (r = t), i = Li.ABSOLUTE)), { width: r, mode: i };}_initColumnFromData(e) {let t = this._parseColumnWidth(e.width, e.ignoreMin ? 0 : this._o.minColumnWidth),r = { name: e.name, label: void 0 === e.label ? e.name : e.label, width: t.width, widthMode: t.mode, resizable: void 0 === e.resizable || e.resizable, sortable: void 0 === e.sortable || e.sortable, movable: void 0 === e.movable || e.movable, visible: void 0 === e.visible || e.visible, cellClasses: void 0 === e.cellClasses ? this._o.cellClasses : e.cellClasses, ignoreMin: void 0 !== e.ignoreMin && !!e.ignoreMin };return r.dataPath = void 0 === e.dataPath ? r.name : e.dataPath, r.comparePath = void 0 === e.comparePath ? r.dataPath : e.comparePath, "string" == typeof r.dataPath && (r.dataPath = r.dataPath.split(".")), "string" == typeof r.comparePath && (r.comparePath = r.comparePath.split(".")), r;}destroy() {var e, t, r;let i = this._p || {},l = this.el;if (this.__removed) return this;if (i.resizer && (i.resizer.remove(), i.resizer = null), null === (e = i.virtualListHelper) || void 0 === e || e.destroy(), i.virtualListHelper = null, this._destroyHeaderCells(), null === (t = i.table) || void 0 === t || t.remove(), null === (r = i.tbody) || void 0 === r || r.remove(), i.workerListeners) {for (let e = 0; e < i.workerListeners.length; e++) {let t = i.workerListeners[e];t.worker.removeEventListener("message", t.listener, false);}i.workerListeners.length = 0;}i.rows.length = i.columns.length = 0, i._deferredRender && clearTimeout(i._deferredRender);for (let e in this) bi.call(this, e) && (this[e] = null);return this.__removed = true, l && l.remove(), this;}close() {this.destroy();}remove() {this.destroy();}_unbindCellEventsForTable() {const e = this._p;if (e.headerRow) for (let t = 0, r = e.headerRow.childNodes, i = r.length; t < i; t++) for (let i = 0, l = r[t].childNodes, o = l.length; i < o; i++) e._unbindCellHoverIn(l[i]);return this;}_unbindCellEventsForRow(e) {const t = this._p;for (let r = 0, i = e.childNodes, l = i.length; r < l; r++) t._unbindCellHoverIn(i[r]);return this;}render() {const r = this._o,i = this._p;if (!this.el.offsetParent) return i._deferredRender || (i._deferredRender = setTimeout(() => {i._deferredRender = null, !this.__removed && this.el.offsetParent && this.render();})), this;if (true === i.tableSkeletonNeedsRendering) {var l;i.tableSkeletonNeedsRendering = false, r.width === Ti.Width.AUTO && this._clearSortArrows();let o = i.table && i.table.parentNode ? i.table.scrollTop : NaN,n = i.table && i.table.parentNode ? getScrollHorz(i.table) : NaN;this._renderSkeletonBase()._renderSkeletonBody().tableWidthChanged(true, false)._renderSkeletonHeaderCells(), i.virtualListHelper.setCount((null !== (l = i.filteredRows) && void 0 !== l ? l : i.rows).length), this._updateVirtualHeight(), this._updateLastCellWidthFromScrollbar(true), this._updateTableWidth(true);for (let e = 0; e < i.rows.sortColumn.length; e++) this._showSortArrow(i.rows.sortColumn[e].column, i.rows.sortColumn[e].descending);r.adjustColumnWidthForSortArrow && i.rows.sortColumn.length ? this.tableWidthChanged(true) : r.virtualTable || this.tableWidthChanged(), isNaN(o) || (i.table.scrollTop = o), isNaN(n) || (setScrollHorz(i.table, n), setScrollHorz(i.header, n)), this.emit("renderskeleton");}return i.virtualListHelper.render(), this.emit("render"), this;}clearAndRender(e) {var t;let r = this._p;return r.tableSkeletonNeedsRendering = true, null === (t = r.notifyRendererOfColumnsConfig) || void 0 === t || t.call(r), (void 0 === e || e) && this.render(), this;}_calculateTbodyWidth() {const e = this._p;let t = this._o.tableClassName,l = t + "-row",o = t + "-cell",n = e.visibleColumns,s = n.length;const a = gi("div");a.className = l, a.style.float = "left";let d = 0;for (let e = 0; e < s; e++) {const t = n[e],r = gi("div");r.className = o, r.style.width = t.actualWidth + "px", t.cellClasses && (r.className += " " + t.cellClasses), r.appendChild(gi("div")), a.appendChild(r), d += t.actualWidth;}const u = gi("div");u.className = this.el.className, setCssProps(u, { "z-index": -1, position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const h = gi("div");h.className = t, u.appendChild(h);const c = gi("div");c.className = t + "-body", c.style.width = d + 1e4 + "px", h.appendChild(c), c.appendChild(a), document.body.appendChild(u);const m = gi("div");setCssProps(m, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(m);let f = parseFloat(getComputedStyle(m).borderWidth),p = Math.round(f) !== f;m.remove();let v = getElementWidth(a, true, true, true);return v -= e.scrollbarWidth || 0, p && v++, u.remove(), v;}setColumns(e, t) {const r = this._p;e = e || [];let i = new mi();for (let t = 0, r = 0; t < e.length; t++) {let l = e[t],o = this._initColumnFromData(l);void 0 !== l.order ? (l.order > r && (r = l.order + 1), o.order = l.order) : o.order = r++, i.push(o);}return i.normalizeOrder(), r.columns = i, r.visibleColumns = i.getVisibleColumns(), this._ensureVisibleColumns().clearAndRender(t), this;}addColumn(e, t, r) {const i = this._p;let l = i.columns;if (e && !l.get(e.name)) {let o = null;void 0 !== t && (o = l.get(t) || l.getByOrder(t));let n = this._initColumnFromData(e);n.order = o ? o.order : l.getMaxOrder() + 1;for (let e = l.getMaxOrder(), t = n.order; e >= t; e--) {let t = l.getByOrder(e);t && t.order++;}l.push(n), l.normalizeOrder(), i.visibleColumns = l.getVisibleColumns(), this._ensureVisibleColumns().clearAndRender(r), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const r = this._p;let i = r.columns,l = i.indexOf(e);return l > -1 && (i.splice(l, 1), i.normalizeOrder(), r.visibleColumns = i.getVisibleColumns(), this._ensureVisibleColumns().clearAndRender(t), this.emit("removecolumn", e)), this;}setCellFormatter(e) {return e || ((e = (e) => "string" == typeof e ? di(e) : e)[Ci] = true), this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? di(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let r = this._o.filter || pi;"string" == typeof arguments[0] && "string" == typeof arguments[1] && (e = { column: arguments[0], keyword: arguments[1], caseSensitive: arguments[2] });let i = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(r, t.filterArgs), (i || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}_refilter() {const e = this._p;if (e.filteredRows && e.filterArgs) {let t = this._o.filter || pi;e.filteredRows = e.rows.filteredCollection(t, e.filterArgs);}return this;}setColumnLabel(e, t) {let r = this._p.columns.get(e);if (r && (r.label = void 0 === t ? r.name : t, r.element)) for (let e = 0; e < r.element.firstChild.childNodes.length; e++) {let t = r.element.firstChild.childNodes[e];if (3 === t.nodeType) {t.textContent = r.label;break;}}return this;}moveColumn(e, t, r = true) {const i = this._o,l = this._p;let o,n,a = l.columns,d = r ? l.visibleColumns : a.getColumns();if ("string" == typeof e ? o = a.get(e) : "number" == typeof e && (o = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), o && n && e !== t) {let e = o.order,t = n.order,r = a.moveColumn(o, n).getVisibleColumns();if (l.visibleColumns.length !== r.length || l.visibleColumns.some((e, t) => e !== r[t])) if (l.visibleColumns = r, this._ensureVisibleColumns(), i.virtualTable) this.clearAndRender();else {const r = scopedSelectorAll(l.headerRow, `>div.${i.tableClassName}-header-cell`);let o = e < t ? t + 1 : t,n = e;r[0].parentNode.insertBefore(r[n], r[o]);let a = l.visibleColumns[e];a = (a.actualWidthConsideringScrollbarWidth || a.actualWidth) + "px";let d = l.visibleColumns[t];d = (d.actualWidthConsideringScrollbarWidth || d.actualWidth) + "px";let u = l.tbody.childNodes;for (let r = 0, i = u.length; r < i; r++) {let i = u[r];1 === i.nodeType && (i.insertBefore(i.childNodes[n], i.childNodes[o]), i.childNodes[t].firstChild.style.width = d, i.childNodes[e].firstChild.style.width = a);}}this.emit("movecolumn", { name: o.name, src: e, dest: t });}return this;}sort(e, t, r) {const i = this._o,l = this._p;let o,n = l.columns.get(e),s = l.rows.sortColumn;if (n) {if (r) {for (let e = 0; e < s.length; e++) if (s[e].column === n.name) {e < s.length - 1 ? s.length = 0 : (t = s[s.length - 1].descending, s.splice(s.length - 1, 1));break;}(i.sortableColumns > 0 && s.length >= i.sortableColumns || s.length >= l.visibleColumns.length) && (s.length = 0);} else s.length = 0;t = void 0 !== t && t, s.push({ column: n.name, comparePath: n.comparePath || n.dataPath, descending: !!t });} else s.length = 0;this._clearSortArrows();for (let e = 0; e < s.length; e++) this._showSortArrow(s[e].column, s[e].descending);i.adjustColumnWidthForSortArrow && !l.tableSkeletonNeedsRendering && this.tableWidthChanged(true), l.rows.sortColumn = s, s.length && (o = l.rows.sort(!!l.filteredRows), l.filteredRows && l.filteredRows.sort(!!l.filteredRows)), l.virtualListHelper && l.virtualListHelper.invalidate().render();let a = [];for (let e = 0; e < s.length; e++) a.push({ column: s[e].column, descending: s[e].descending });return this.emit("sort", { sorts: a, comparator: o }), this;}resort() {const e = this._p;let t = e.columns,r = e.rows.sortColumn;if (r.length) {for (let e = 0; e < r.length; e++) t.get(r[e].column) || r.splice(e--, 1);let i;e.rows.sortColumn = r, r.length && (i = e.rows.sort(!!e.filteredRows), e.filteredRows && e.filteredRows.sort(!!e.filteredRows));let l = [];for (let e = 0; e < r.length; e++) l.push({ column: r[e].column, descending: r[e].descending });this.emit("sort", { sorts: l, resort: true, comparator: i });}return this;}_ensureVisibleColumns() {const e = this._p;return 0 === e.visibleColumns.length && e.columns.length && (e.columns[0].visible = true, e.visibleColumns.push(e.columns[0]), this.emit("showcolumn", e.columns[0].name)), this;}setColumnVisible(e, t) {const r = this._p;let i = r.columns.get(e);return t = !!t, i && !!i.visible !== t && (i.visible = t, r.visibleColumns = r.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), this._ensureVisibleColumns(), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setSortableColumns(e) {const t = this._p,r = this._o;if (r.sortableColumns !== e && (r.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, `>div.${r.tableClassName}-header-cell`);for (let i = 0, l = e.length; i < l; i++) e[i].classList[r.sortableColumns > 0 && t.visibleColumns[i].sortable ? "add" : "remove"]("sortable");}return this;}getSortableColumns() {return this._o.sortableColumns;}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setComparatorCallback(e) {return this.setOnComparatorRequired(e);}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}setColumnWidth(e, t) {let r = this._p.columns.get(e),i = this._parseColumnWidth(t, r.ignoreMin ? 0 : this._o.minColumnWidth);if (r) {let e = this._serializeColumnWidth(r);r.width = i.width, r.widthMode = i.mode;let t = this._serializeColumnWidth(r);e !== t && this.tableWidthChanged(true), this.emit("columnwidth", { name: r.name, width: t, oldWidth: e });}return this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? this._serializeColumnWidth(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);return t ? { order: t.order, width: this._serializeColumnWidth(t), visible: t.visible, label: t.label } : null;}getColumnsConfig() {const e = this._p;let t = {};for (let r = 0; r < e.columns.length; r++) t[e.columns[r].name] = this.getColumnConfig(e.columns[r].name);return t;}getSortedColumns() {const e = this._p;let t = [];for (let r = 0; r < e.rows.sortColumn.length; r++) {let i = e.rows.sortColumn[r];t.push({ column: i.column, descending: i.descending });}return t;}getHtmlForRowCell(e, t) {const r = this._p;if (e < 0 || e > r.rows.length - 1) return null;let i = r.columns.get(t);if (!i) return null;let l = r.rows[e];return this._getHtmlForCell(l, i);}getHtmlForRowDataCell(e, t) {let r = this._p.columns.get(t);return r ? this._getHtmlForCell(e, r) : null;}_getHtmlForCell(e, t) {let r = t.dataPath,i = e[r[0]];for (let e = 1; e < r.length && null != i; e++) i = i && i[r[e]];const l = this._o.cellFormatter;let o;if (l[Ci]) o = l(i, t.name, e);else try {o = l(i, t.name, e);} catch (e) {o = "[ERROR]", console.error("Failed to generate content for cell " + t.name, e);}return null == o && (o = ""), o;}getRowYPos(e) {return this._p.virtualListHelper.getItemPosition(e) || null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}_horizontalPadding(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}_horizontalBorderWidth(e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}_calculateWidthAvailableForColumns() {const e = this._o,t = this._p;let l, o, n;t.table && (o = t.table ? t.table.scrollTop : 0, n = t.table ? t.table.scrollLeft : 0, e.virtualTable && (l = t.table.style.display, t.table.style.display = "none"));let a = getElementWidth(this.el);t.table && (e.virtualTable && (t.table.style.display = l), t.table.scrollTop = o, t.table.scrollLeft = n, t.header.scrollLeft = n);let d = e.tableClassName;const u = gi("div");u.className = this.el.className, setCssProps(u, { "z-index": -1, position: "absolute", left: "0", top: "-9999px" });let h = gi("div");h.className = `${d}-header`, u.appendChild(h);let c = gi("div");c.index = null, c.vIndex = null, c.className = `${d}-header-row`, h.appendChild(c);for (let e = 0; e < t.visibleColumns.length; e++) {const r = t.visibleColumns[e],i = gi("div");i.className = `${d}-header-cell ${r.cellClasses || ""}`, i.columnName = r.name, i.appendChild(gi("div")), c.appendChild(i);}document.body.appendChild(u), a -= this._horizontalBorderWidth(c);let m = scopedSelectorAll(c, `>div.${d}-header-cell`);for (const e of m) {const r = getComputedStyle(e);if ("border-box" !== r.boxSizing) {a -= (parseFloat(r.borderRightWidth) || 0) + (parseFloat(r.borderLeftWidth) || 0) + this._horizontalPadding(e);const i = e.columnName,l = t.columns.get(i);l && (a -= l.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}_getTextWidth(e) {let t = this._o.tableClassName;const l = gi("div");l.className = this.el.className;const o = gi("div");o.className = t + "-header";const n = gi("div");n.className = t + "-header-row";const s = gi("div");s.className = t + "-header-cell";const a = gi("div");a.textContent = e, s.appendChild(a), n.appendChild(s), o.appendChild(n), l.appendChild(o), setCssProps(l, { position: "absolute", top: "-9999px", visibility: "hidden" }), document.body.appendChild(l);let d = getElementWidth(s);return l.remove(), d;}tableWidthChanged(e, t) {let r = this._o,i = this._p,l = this._calculateWidthAvailableForColumns(),o = l,n = 0;if (!i.table) return this;t = void 0 === t || t;let s = 0;if (i.tbody || (t = false), t && (s = parseFloat(i.tbody.style.minWidth) || 0), o !== i.lastDetectedWidth || e) {var a;i.lastDetectedWidth = l;let e = 0,d = [],u = 0;for (let e = 0; e < i.columns.length; e++) i.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < i.visibleColumns.length; t++) {let l = i.visibleColumns[t];if (l.widthMode === Li.ABSOLUTE) {let i = l.width;i += l.arrowProposedWidth || 0, !l.ignoreMin && i < r.minColumnWidth && (i = r.minColumnWidth), o -= i, e += i, i !== l.actualWidth && (l.actualWidth = i, d.push(t));} else if (l.widthMode === Li.AUTO) {let i = this._getTextWidth(l.label) + 20;i += l.arrowProposedWidth || 0, !l.ignoreMin && i < r.minColumnWidth && (i = r.minColumnWidth), o -= i, e += i, i !== l.actualWidth && (l.actualWidth = i, r.convertColumnWidthsToRelative || d.push(t));} else l.widthMode === Li.RELATIVE && (u += l.width, n++);}if (r.convertColumnWidthsToRelative) for (let t = 0; t < i.visibleColumns.length; t++) {let r = i.visibleColumns[t];r.widthMode === Li.AUTO && (r.widthMode = Li.RELATIVE, o += r.actualWidth, r.width = r.actualWidth / e, u += r.width, n++);}if (n && (u < 1 && r.relativeWidthGrowsToFillWidth || u > 1 && r.relativeWidthShrinksToFillWidth)) for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];t.widthMode === Li.RELATIVE && (t.width /= u);}let h = Math.max(0, o);0 === h && (h = i.table.clientWidth);let c = r.minColumnWidth / h;if (isNaN(c) && (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < i.visibleColumns.length; e++) {let r = i.visibleColumns[e];r.widthMode === Li.RELATIVE && !r.ignoreMin && r.width < c && (t += c - r.width, r.width = c);}for (let r = 0; r < i.visibleColumns.length; r++) {let l = i.visibleColumns[r];l.widthMode === Li.RELATIVE && !l.ignoreMin && l.width > c && t > 0 && (e = Math.min(t, l.width - c), l.width -= e, t -= e);}}if (r.autoFillTableWidth && o > 0) {let e = 0,t = o;for (let r = 0; r < i.visibleColumns.length; r++) {let l = i.visibleColumns[r];l.resizable || l.widthMode !== Li.ABSOLUTE || (e += l.width), l.widthMode === Li.RELATIVE && (t -= Math.round(h * l.width));}let r = (l - e) / (l - t - e) || NaN;for (let e = 0; e < i.visibleColumns.length && t > 0; e++) {let t = i.visibleColumns[e];if (t.resizable || t.widthMode !== Li.ABSOLUTE) if (t.widthMode === Li.RELATIVE) t.width *= r;else {let i = t.actualWidth * r;t.actualWidth !== i && (t.actualWidth = i, -1 === d.indexOf(e) && d.push(e));}}}for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];if (t.widthMode === Li.RELATIVE) {let r = Math.round(h * t.width);o -= r, n--, 0 === n && 1 === o && (r++, o--), -1 === o && (r--, o++), r !== t.actualWidth && (t.actualWidth = r, d.push(e));}}if (i.visibleColumns.length && (i.visibleColumns[i.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = i.visibleColumns[i.visibleColumns.length - 1].actualWidth - (i.scrollbarWidth || 0)), null === (a = i.notifyRendererOfColumnsConfig) || void 0 === a || a.call(i), t) {let e = this._calculateTbodyWidth();s < e && this._updateTableWidth(false);for (let e = 0; e < d.length; e++) this._resizeColumnElements(d[e]);s > e && this._updateTableWidth(false);}}return this;}tableHeightChanged() {let e = this._o,t = this._p;if (!t.table) return this;const r = getComputedStyle(t.table);let i = getElementHeight(this.el, true) - (parseFloat(r.borderTopWidth) || 0) - (parseFloat(r.borderBottomWidth) || 0);return i !== e.height && (e.height = i, t.tbody && (t.tbody.style.height = Math.max(e.height - getElementHeight(t.header, true, true, true), 1) + "px"), e.virtualTable && this.clearAndRender()), this;}addRows(e, t, r, i) {let l = this._p;return "boolean" == typeof t && (i = r, r = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > l.rows.length) && (t = l.rows.length), i = void 0 === i || !!i, e && (l.rows.add(e, t), l.filteredRows || r && l.rows.sortColumn.length ? (r && l.rows.sortColumn.length ? this.resort() : this._refilter(), l.tableSkeletonNeedsRendering = true, i && this.render()) : i && (l.virtualListHelper.addItemsAt(e.length, t), this._o.virtualTable ? this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(false) : l.tbody && this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(true)), this.emit("addrows", { count: e.length, clear: false })), this;}removeRows(e, t, r) {let i = this._p;return "number" != typeof t || t <= 0 || e < 0 || e > i.rows.length - 1 || (i.rows.splice(e, t), r = void 0 === r || !!r, i.filteredRows ? (this._refilter(), i.tableSkeletonNeedsRendering = true, r && this.render()) : r && (i.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable ? this._updateVirtualHeight()._updateLastCellWidthFromScrollbar().render()._updateTableWidth(false) : this.render()._updateLastCellWidthFromScrollbar()._updateTableWidth(true))), this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e, t = true) {let r = this._p;if (e < 0 || e > r.rows.length - 1) return this;let i = -1;return r.filteredRows && -1 === (i = r.filteredRows.indexOf(r.rows[e])) || (-1 === i && (i = e), r.virtualListHelper.refreshItemAt(i), t && r.virtualListHelper.render()), this;}getRowElement(e) {let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let r = -1;return t.filteredRows && -1 === (r = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === r && (r = e), t.virtualListHelper.getItemElementAt(r) || null);}refreshAllVirtualRows() {return this._p.virtualListHelper.invalidate().render(), this;}setRows(e, t) {let r = this._p;return r.rows.reset(e), t && r.rows.sortColumn.length ? this.resort() : this._refilter(), this.clearAndRender().trigger("addrows", { count: e.length, clear: true }), this;}getUrlForElementContent(e) {let t,r = document.getElementById(e);if (r) {let e = r.textContent;if ("function" == typeof Blob) t = new Blob([e]);else {let r = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;if (!r) return null;let i = new r();i.append(e), t = i.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, r) {if (this.isWorkerSupported()) {let i = this._p,l = new Worker(e),o = (e) => {e.data.append ? this.addRows(e.data.rows, r) : this.setRows(e.data.rows, r);};return l.addEventListener("message", o, false), i.workerListeners || (i.workerListeners = []), i.workerListeners.push({ worker: l, listener: o }), (t || void 0 === t) && l.postMessage(null), l;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let r = 0; r < t.workerListeners.length; r++) t.workerListeners[r].worker === e && (e.removeEventListener("message", t.workerListeners[r].listener, false), t.workerListeners.splice(r, 1), r--);return this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {const e = this._p;return e.resizer && (e.resizer.remove(), e.resizer = null, e.eventsSink.remove(document, ".colresize")), this;}_onTableScrolledHorizontally() {const e = this._p;e.header.scrollLeft = e.table.scrollLeft;}_getColumnByResizePosition(e) {let t = this._o,r = this._isTableRtl(),l = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);l[Wi] && (l = l[Wi]);let n = l.previousSibling;for (; n && 1 !== n.nodeType;) n = n.previousSibling;let s = !n,a = (e.pageX || e.clientX) - getElementOffset(l).left;if (r) {if (!s && getElementWidth(l, true, true, true) - a <= t.resizeAreaWidth / 2) return n.columnName;if (a <= t.resizeAreaWidth / 2) return l.columnName;} else {if (!s && a <= t.resizeAreaWidth / 2) return n.columnName;if (getElementWidth(l, true, true, true) - a <= t.resizeAreaWidth / 2) return l.columnName;}return null;}_onTouchStartColumnHeader(e) {const t = this._p;if (t.currentTouchId) return;let r = e.changedTouches[0];t.currentTouchId = r.identifier;let i,l = e.currentTarget,o = { x: r.pageX, y: r.pageY },n = o,s = function () {t.currentTouchId = null, t.eventsSink.remove(l, ".colheader"), clearTimeout(i);},a = (t, ...r) => {for (const t of e) e[t];for (const e of r) for (const t of ["target", "clientX", "clientY", "offsetX", "offsetY", "screenX", "screenY", "pageX", "pageY", "which"]) null != e[t] && e[t];return new MouseEvent(t, e);};l.dispatchEvent(a("mousedown", e.changedTouches[0], { button: 0, target: e.target })), i = setTimeout(() => {s(), t.eventsSink.add(l, "touchend.colheader", (e) => {Ni(e) || e.preventDefault(), t.eventsSink.remove(l, ".colheader");}, { once: true }).add(l, "touchcancel.colheader", (e) => {t.eventsSink.remove(l, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(n.x - o.x), 2) + Math.pow(Math.abs(n.y - o.y), 2)) < 9 && (this.cancelColumnResize(), l.dispatchEvent(a("mouseup", e.changedTouches[0], { button: 2, target: e.target })));}, 500), t.eventsSink.add(l, "touchend.colheader", (e) => {let r = ai(e.changedTouches, (e) => e.identifier === t.currentTouchId);r && (s(), Ni(e) || e.preventDefault(), n = { x: r.pageX, y: r.pageY }, (Math.sqrt(Math.pow(Math.abs(n.x - o.x), 2) + Math.pow(Math.abs(n.y - o.y), 2)) < 9 || t.resizer) && (l.dispatchEvent(a("mouseup", r, { 0: 2, target: e.target })), l.dispatchEvent(a("click", r, { button: 0, target: e.target }))));}).add(l, "touchcancel.colheader", s).add(l, "touchmove.colheader", (e) => {let r = ai(e.changedTouches, (e) => e.identifier === t.currentTouchId);r && (n = { x: r.pageX, y: r.pageY }, t.resizer && (e.preventDefault(), l.dispatchEvent(a("mousemove", r, { target: e.target }))));});}_onMouseDownColumnHeader(e) {if (0 !== e.button) return this;let t = this._o,n = this._p,s = this._getColumnByResizePosition(e);if (s) {let a = n.columns.get(s);if (!t.resizableColumns || !a || !a.resizable) return false;let d = this._isTableRtl();n.resizer && n.resizer.remove(), n.resizer = gi("div"), n.resizer.className = t.resizerClassName, setCssProps(n.resizer, { position: "absolute", display: "block", zIndex: -1, visibility: "hidden", width: "2px", background: "#000", opacity: .7 }), this.el.appendChild(n.resizer);let u = a.element,h = n.resizer.parentNode;const c = getComputedStyle(h),m = getComputedStyle(u);let f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;let v = getElementWidth(n.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(v / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(v / 2)), setCssProps(n.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(this.el, false, false, false) + "px" }), n.resizer.columnName = u.columnName;try {n.resizer.style.zIndex = "";} catch (e) {}n.eventsSink.add(document, "mousemove.colresize", this._onMouseMoveResizeArea.bind(this)).add(document, "mouseup.colresize", this._onEndDragColumnHeader.bind(this)), e.preventDefault();}}_onMouseMoveColumnHeader(e) {let t = this._o,r = this._p;if (t.resizableColumns) {let i = this._getColumnByResizePosition(e),l = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);i && r.columns.get(i).resizable ? l.style.cursor = "e-resize" : l.style.cursor = "";}}_onMouseUpColumnHeader(e) {if (2 === e.button) {let t = this._o,r = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`),n = getElementOffset(r);n.width = getElementWidth(r, true, true, true), n.height = getElementHeight(r, true, true, true), this.emit("headercontextmenu", { name: r.columnName, pageX: e.pageX, pageY: e.pageY, bounds: n });}return this;}_onMouseLeaveColumnHeader(e) {let t = this._o;e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`).style.cursor = "";}_onClickColumnHeader(e) {if (!Ni(e) && !this._getColumnByResizePosition(e)) {let t = this._o,r = this._p,i = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);if (t.sortableColumns) {let e = r.columns.get(i.columnName),l = r.rows.sortColumn;if (e && e.sortable) {let r = true,i = l.length ? l[l.length - 1] : null;i && i.column === e.name && (i.descending && t.allowCancelSort ? (r = false, l.splice(l.length - 1, 1)) : i.descending = !i.descending), r ? this.sort(e.name, void 0, true).render() : this.sort();}}}}_onStartDragColumnHeader(e) {let t = this._o,r = this._p;if (t.movableColumns) {let i = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`),l = r.columns.get(i.columnName);l && l.movable ? (i.style.opacity = .35, r.dragId = 161061273 * Math.random(), e.dataTransfer.setData("text", JSON.stringify({ dragId: r.dragId, column: l.name }))) : e.preventDefault();} else e.preventDefault();}_onMouseMoveResizeArea(e) {let t = this._p,r = t.columns.get(t.resizer.columnName),l = this._isTableRtl(),n = r.element,s = t.resizer.parentNode;const a = getComputedStyle(s),d = getComputedStyle(n);let u = getElementOffset(n),h = getElementOffset(s);h.left += parseFloat(a.borderLeftWidth) || 0, u.left -= h.left;let c = getElementWidth(t.resizer, true, true, true),m = "border-box" === d.boxSizing,f = e.pageX - h.left,p = u.left;p -= Math.ceil(c / 2), l ? (p += getElementWidth(n, true, true, true), p -= r.ignoreMin ? 0 : this._o.minColumnWidth, m || (p -= Math.ceil((parseFloat(d.borderLeftWidth) || 0) / 2), p -= this._horizontalPadding(n)), f > p && (f = p)) : (p += r.ignoreMin ? 0 : this._o.minColumnWidth, m || (p += Math.ceil((parseFloat(d.borderRightWidth) || 0) / 2), p += this._horizontalPadding(n)), f < p && (f = p)), t.resizer.style.left = f + "px";}_onEndDragColumnHeader(e) {let t = this._o,r = this._p;if (r.resizer) {r.eventsSink.remove(document, ".colresize");let l = r.columns.get(r.resizer.columnName),n = this._isTableRtl(),s = l.element,a = s.firstChild,d = r.resizer.parentNode;const u = getComputedStyle(d),h = getComputedStyle(s);let c = getElementOffset(s),m = getElementOffset(d);m.left += parseFloat(u.borderLeftWidth) || 0, c.left -= m.left;let f = getElementWidth(r.resizer, true, true, true),p = "border-box" === h.boxSizing,v = e.pageX - m.left,g = c.left,b = c.left,C = 0;if (g -= Math.ceil(f / 2), n) {if (!p) {v += this._horizontalPadding(s);const e = getComputedStyle(a || s);v += parseFloat(e.borderLeftWidth) || 0, v += parseFloat(e.borderRightWidth) || 0, v += l.arrowProposedWidth || 0;}g += getElementWidth(s, true, true, true), b = g - (l.ignoreMin ? 0 : this._o.minColumnWidth), v > b && (v = b), C = g - v;} else {if (!p) {v -= this._horizontalPadding(s);const e = getComputedStyle(a || s);v -= parseFloat(e.borderLeftWidth) || 0, v -= parseFloat(e.borderRightWidth) || 0, v -= l.arrowProposedWidth || 0;}b = g + (l.ignoreMin ? 0 : this._o.minColumnWidth), v < b && (v = b), C = v - g;}r.resizer.remove(), r.resizer = null;let w = C;if (l.widthMode === Li.RELATIVE) {let e = this._calculateWidthAvailableForColumns(),i = 0,o = 0;for (let t = 0; t < r.visibleColumns.length; t++) {let n = r.visibleColumns[t];n.name !== l.name && (n.widthMode === Li.RELATIVE ? (i += n.width, o++) : e -= n.actualWidth);}if (e = Math.max(1, e), 1 === e && (e = r.table.clientWidth), w = C / e, o > 0) {let e = w / ((1 - w) / i);i += w, (i < 1 && t.relativeWidthGrowsToFillWidth || i > 1 && t.relativeWidthShrinksToFillWidth) && (w = e);}w *= 100, w += "%";}this.setColumnWidth(l.name, w);} else e.target.style.opacity = null;}_onDragEnterColumnHeader(e) {let t = this._o,r = this._p;if (t.movableColumns) {let i = e.dataTransfer.getData("text");i = i ? JSON.parse(i) : null;let l = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);if (!i || r.dragId === i.dragId && l.columnName !== i.column) {let e = r.columns.get(l.columnName);e && (e.movable || e !== r.visibleColumns[0]) && l.classList.add("drag-over");}}}_onDragOverColumnHeader(e) {e.preventDefault();}_onDragLeaveColumnHeader(e) {let t = this._o,r = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);e.relatedTarget.contains(r.firstChild) || r.classList.remove("drag-over");}_onDropColumnHeader(e) {e.preventDefault();let t = this._o,r = this._p,i = JSON.parse(e.dataTransfer.getData("text")),l = e.target.closest(`div.${t.tableClassName}-header-cell,div.${t.cellPreviewClassName}`);if (t.movableColumns && i.dragId === r.dragId) {let e = i.column,t = l.columnName,o = r.columns.get(e),n = r.columns.get(t);o && n && o.movable && (n.movable || n !== r.visibleColumns[0]) && this.moveColumn(e, t);}l.classList.remove("drag-over");}_clearSortArrows() {let e = this._p;if (e.table) {let t = this._o.tableClassName,r = scopedSelectorAll(e.headerRow, `>div.${t}-header-cell.sorted`),i = Array.prototype.slice.call(r, 0).map((e) => scopedSelector(e, ">div>.sort-arrow")).filter((e) => !!e);for (const t of i) {let r = e.columns.get(t.parentNode.parentNode.columnName);r && (r.arrowProposedWidth = 0), t.remove();}for (const e of r) e.classList.remove("sorted", "desc");}return this;}_showSortArrow(e, t) {let r = this._p.columns.get(e);if (!r) return false;let i = gi("span");return i.className = "sort-arrow", r.element && (r.element.className += t ? " sorted desc" : " sorted", r.element.firstChild.insertBefore(i, r.element.firstChild.firstChild)), r.widthMode !== Li.RELATIVE && this._o.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = i.scrollWidth + (parseFloat(getComputedStyle(i).marginRight) || 0) + (parseFloat(getComputedStyle(i).marginLeft) || 0)), true;}_resizeColumnElements(e) {let t = this._p;const r = t.headerRow.querySelectorAll(`div.${this._o.tableClassName}-header-cell`)[e];let i = t.columns.get(r.columnName);if (i) {r.style.width = (i.actualWidthConsideringScrollbarWidth || i.actualWidth) + "px";let l = (i.actualWidthConsideringScrollbarWidth || i.actualWidth) + "px",o = t.tbody.childNodes;for (let t = 0, r = o.length; t < r; t++) {let r = o[t];1 === r.nodeType && (r.childNodes[e].style.width = l);}}return this;}_destroyHeaderCells() {let e = this._p;return e.headerRow && (e.headerRow = null), this;}_renderSkeletonBase() {var e;let t = this._p,r = this._o;null === (e = t.virtualListHelper) || void 0 === e || e.destroy(), t.virtualListHelper = null, t.table && r.virtualTable && (t.table.remove(), t.table = t.tbody = null), this._destroyHeaderCells(), t.currentTouchId = null, t.header && t.header.remove();let i = r.tableClassName,o = gi("div"),n = gi("div");return o.className = `${i}-header`, n.className = `${i}-header-row`, t.header = o, t.headerRow = n, o.appendChild(n), this.el.prepend(o), Ri(this.el), r.width === Ti.Width.SCROLL ? this.el.style.overflow = "hidden" : this.el.style.overflow = "", !r.height && r.virtualTable && (r.height = getElementHeight(this.el, true)), this;}_bindHeaderColumnEvents(e) {const t = e.firstChild;e.addEventListener("mousedown", this._onMouseDownColumnHeader.bind(this)), e.addEventListener("mousemove", this._onMouseMoveColumnHeader.bind(this)), e.addEventListener("mouseup", this._onMouseUpColumnHeader.bind(this)), e.addEventListener("mouseleave", this._onMouseLeaveColumnHeader.bind(this)), e.addEventListener("touchstart", this._onTouchStartColumnHeader.bind(this)), e.addEventListener("dragstart", this._onStartDragColumnHeader.bind(this)), e.addEventListener("click", this._onClickColumnHeader.bind(this)), e.addEventListener("contextmenu", (e) => {e.preventDefault();}), t.addEventListener("dragenter", this._onDragEnterColumnHeader.bind(this)), t.addEventListener("dragover", this._onDragOverColumnHeader.bind(this)), t.addEventListener("dragleave", this._onDragLeaveColumnHeader.bind(this)), t.addEventListener("drop", this._onDropColumnHeader.bind(this));}_renderSkeletonHeaderCells() {let e = this._p,t = this._o,r = t.allowCellPreview,i = t.allowHeaderCellPreview,l = t.tableClassName + "-header-cell",o = e.headerRow;for (let n = 0; n < e.visibleColumns.length; n++) {let s = e.visibleColumns[n];if (s.visible) {let a = gi("div");a.draggable = true, a.className = l, a.style.width = s.actualWidth + "px", t.sortableColumns && s.sortable && (a.className += " sortable"), a.columnName = s.name, a.setAttribute("data-column", s.name);let d = gi("div");d.innerHTML = t.headerCellFormatter(s.label, s.name), a.appendChild(d), r && i && e._bindCellHoverIn(a), o.appendChild(a), e.visibleColumns[n].element = a, this._bindHeaderColumnEvents(a), this._disableCssSelect(a);}}return this.emit("headerrowcreate", o), this;}_renderSkeletonBody() {let e = this._p,t = this._o,i = t.tableClassName;if (t.virtualTable && !e.virtualRowHeight) {let t = () => {let e = gi("div"),t = e.appendChild(gi("div")),r = t.appendChild(gi("div"));return e.className = `${i}-row`, t.className = `${i}-cell`, r.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;};const o = gi("div");o.className = this.el.className, setCssProps(o, { "z-index": -1, position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const n = gi("div");n.className = i, o.appendChild(n);const s = gi("div");s.className = `${i}-body`, s.style.width = "99999px", n.appendChild(s), document.body.appendChild(o);let a = t(),d = t(),u = t();s.appendChild(a), s.appendChild(d), s.appendChild(u), e.virtualRowHeightFirst = getElementHeight(a, true, true, true), e.virtualRowHeight = getElementHeight(d, true, true, true), e.virtualRowHeightLast = getElementHeight(u, true, true, true), o.remove();}if (!e.table) {let o = document.createDocumentFragment(),n = gi("div");n.className = i, t.virtualTable && (n.className += " virtual");const s = getComputedStyle(n);let a = t.height - getElementHeight(e.header, true, true, true);"border-box" !== s.boxSizing && (a -= parseFloat(s.borderTopWidth) || 0, a -= parseFloat(s.borderBottomWidth) || 0, a -= parseFloat(s.paddingTop) || 0, a -= parseFloat(s.paddingBottom) || 0), e.visibleHeight = a, setCssProps(n, { height: t.height ? a + "px" : "auto", display: "block", overflowY: "auto", overflowX: t.width === Ti.Width.SCROLL ? "auto" : "hidden" }), o.appendChild(n);let d = gi("div");d.className = t.tableClassName + "-body", d.style.minHeight = "1px", e.table = n, e.tbody = d, Ri(d), Ri(n), n.appendChild(d), this.el.appendChild(o), this._setupVirtualTable();}return this;}_renderSkeleton() {return this;}_updateVirtualHeight() {const e = this._o,t = this._p;if (!t.tbody) return this;if (e.virtualTable) {const e = t.virtualListHelper.estimateFullHeight();t.lastVirtualScrollHeight = e, t.tbody.style.height = e + "px";} else t.tbody.style.height = "";return this;}_updateLastCellWidthFromScrollbar(e) {const t = this._p;let r = t.table.offsetWidth - t.table.clientWidth;if (r !== t.scrollbarWidth || e) {var i;t.scrollbarWidth = r;for (let e = 0; e < t.columns.length; e++) t.columns[e].actualWidthConsideringScrollbarWidth = null;if (t.scrollbarWidth > 0 && t.visibleColumns.length > 0) {let e = t.visibleColumns.length - 1;t.visibleColumns[e].actualWidthConsideringScrollbarWidth = t.visibleColumns[e].actualWidth - t.scrollbarWidth;let r = t.visibleColumns[e].actualWidthConsideringScrollbarWidth + "px",i = t.tbody.childNodes;for (let t = 0, l = i.length; t < l; t++) {let l = i[t];1 === l.nodeType && (l.childNodes[e].style.width = r);}t.headerRow.childNodes[e].style.width = r;}null === (i = t.notifyRendererOfColumnsConfig) || void 0 === i || i.call(t);}return this;}_updateTableWidth(e) {const t = this._o,r = this._p;let l = this._calculateTbodyWidth();if (r.tbody.style.minWidth = l + "px", r.headerRow.style.minWidth = l + (r.scrollbarWidth || 0) + "px", r.eventsSink.remove(r.table, "scroll"), t.width === Ti.Width.AUTO) setElementWidth(r.table, getElementWidth(r.tbody, true, true, true)), setElementWidth(this.el, getElementWidth(r.table, true, true, true));else if (t.width === Ti.Width.SCROLL) {if (e) {let e = r.table ? r.table.scrollTop : 0,t = r.table ? r.table.scrollLeft : 0;!function (e) {let t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(this.el), r.table.crollTop = e, r.table.scrollLeft = t, r.header.scrollLeft = t;}r.eventsSink.add(r.table, "scroll", this._onTableScrolledHorizontally.bind(this));}return this;}_isTableRtl() {return "rtl" === getComputedStyle(this._p.table).direction;}_serializeColumnWidth(e) {return e.widthMode === Li.AUTO ? "auto" : e.widthMode === Li.RELATIVE ? 100 * e.width + "%" : e.width;}_disableCssSelect(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}_cellMouseOverEvent(e) {const t = this._o,n = this._p;let s = e.firstElementChild;if (!(s.scrollWidth - s.clientWidth > 1 || s.scrollHeight - s.clientHeight > 1)) return;this.hideCellPreview(), n.abortCellPreview = false;const a = e.parentElement,d = gi("div");d.innerHTML = e.innerHTML, d.className = t.cellPreviewClassName;let u = e.classList.contains(`${t.tableClassName}-header-cell`);u && (d.classList.add("header"), e.classList.contains("sortable") && d.classList.add("sortable"), d.draggable = true, this._bindHeaderColumnEvents(d));const h = getComputedStyle(e),c = getComputedStyle(s);let m = parseFloat(h.paddingLeft) || 0,f = parseFloat(h.paddingRight) || 0,p = parseFloat(h.paddingTop) || 0,v = parseFloat(h.paddingBottom) || 0,g = s.scrollWidth + (e.clientWidth - s.offsetWidth),b = "border-box" === h.boxSizing;if (b ? d.style.boxSizing = "border-box" : (g -= m + f, d.style.marginTop = (parseFloat(h.borderTopWidth) || 0) + "px"), !n.transparentBgColor1) {let e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", n.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", n.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}let C = { "box-sizing": b ? "border-box" : "content-box", width: g, "min-height": Math.max(getElementHeight(e), parseFloat(h.minHeight) || 0) + "px", "padding-left": m, "padding-right": f, "padding-top": p, "padding-bottom": v, overflow: "hidden", position: "absolute", "z-index": "-1", left: "0", top: "0", cursor: h.cursor },w = h.backgroundColor;w !== n.transparentBgColor1 && w !== n.transparentBgColor2 || (w = getComputedStyle(a).backgroundColor), w !== n.transparentBgColor1 && w !== n.transparentBgColor2 || (w = "#fff"), C["background-color"] = w, setCssProps(d, C), setCssProps(d.firstChild, { direction: c.direction, "white-space": c.whiteSpace, "min-height": c.minHeight, "line-height": c.lineHeight, font: c.font }), this.el.appendChild(d), u && this._disableCssSelect(d), d.rowVIndex = a.vIndex;let y = d.rowIndex = a.index;d.columnName = n.visibleColumns[vi.call(a.childNodes, e)].name;try {let t = fi.saveSelection(e);t && fi.restoreSelection(d, t);} catch (e) {}if (this.emit("cellpreview", { el: d.firstElementChild, name: d.columnName, rowIndex: null != y ? y : null, rowData: null == y ? null : n.rows[y], cell: e, cellEl: s }), n.abortCellPreview) return void d.remove();null != y && d.addEventListener("click", (e) => {this.emit("rowclick", { event: e, filteredRowIndex: a.vIndex, rowIndex: y, rowEl: a, rowData: n.rows[y] });});let _ = this.el,S = _ === window ? document : _;const W = getComputedStyle(_);let R = getElementOffset(e),N = getElementOffset(_),T = "right" === h.float,L = T ? "right" : "left";if (T) {let t = window.innerWidth;R.right = t - (R.left + getElementWidth(e, true, true, true)), N.right = t - (N.left + getElementWidth(_, true, true, true));}R.left -= parseFloat(W.borderLeftWidth) || 0, "right" === L && (R.right -= parseFloat(W.borderRightWidth) || 0), R.top -= parseFloat(W.borderTopWidth) || 0, R[L] += parseFloat(h[`border-${L}-width`]) || 0, R.top += parseFloat(h.borderTopWidth) || parseFloat(h.borderBottomWidth) || 0, R.left -= N.left, "right" === L && (R.right -= N.right), R.top -= N.top;let E = getElementWidth(_, false, false, false) - getElementWidth(d, true, true, true);R[L] = R[L] < 0 ? 0 : R[L] > E ? E : R[L];let x = getElementHeight(e, true, true, true),z = S.scrollTop + getElementHeight(_, true) - x;R.top > z && (R.top = Math.max(0, z));let P = { top: R.top + "px", "z-index": 9999 };P[L] = R[L] + "px", setCssProps(d, P), d[Wi] = e, n.cellPreviewCell = d, e[Si] = d, n._bindCellHoverOut(e), n._bindCellHoverOut(d), d.addEventListener("wheel", () => {this.hideCellPreview();});}_cellMouseOutEvent(e) {this.hideCellPreview();}hideCellPreview() {const e = this._p;if (e.cellPreviewCell) {var t;let r,i = e.cellPreviewCell,l = i[Wi];try {r = fi.saveSelection(i);} catch (e) {}e.cellPreviewCell.remove(), e._unbindCellHoverOut(l), e._unbindCellHoverOut(i);try {r && fi.restoreSelection(l, r);} catch (e) {}this.emit("cellpreviewdestroy", { el: i.firstChild, name: i.columnName, rowIndex: null !== (t = i.rowIndex) && void 0 !== t ? t : null, rowData: null == i.rowIndex ? null : e.rows[i.rowIndex], cell: l, cellEl: l.firstChild }), delete l[Si], delete i[Wi], e.cellPreviewCell = null, e.abortCellPreview = false;} else e.abortCellPreview = true;return this;}}Ti.VERSION = "@@VERSION";const Li = { AUTO: 0, ABSOLUTE: 1, RELATIVE: 2 };Ti.Width = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };
|
|
3907
|
+
|
|
3908
|
+
class DGTableJQuery extends Ti {
|
|
3909
|
+
constructor(options) {
|
|
3910
|
+
super(options);
|
|
3911
|
+
|
|
3912
|
+
this.$el = jQuery(this.el).
|
|
3913
|
+
data('dgtable', this).
|
|
3914
|
+
on('remove', () => this.destroy());
|
|
3915
|
+
|
|
3916
|
+
this.on('headerrowdestroy', () => {var _this$_p;
|
|
3917
|
+
const headerRow = (_this$_p = this._p) === null || _this$_p === void 0 ? void 0 : _this$_p.headerRow;
|
|
3918
|
+
if (!headerRow) return;
|
|
3919
|
+
|
|
3920
|
+
jQuery(headerRow).find(`div.${this._o.tableClassName}-header-cell`).remove();
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3924
|
+
destroy() {var _this$_p2, _this$_p3;
|
|
3925
|
+
if ((_this$_p2 = this._p) !== null && _this$_p2 !== void 0 && _this$_p2.table)
|
|
3926
|
+
jQuery(this._p.table).empty();
|
|
3927
|
+
if ((_this$_p3 = this._p) !== null && _this$_p3 !== void 0 && _this$_p3.tbody)
|
|
3928
|
+
jQuery(this._p.tbody).empty();
|
|
3929
|
+
return super.destroy();
|
|
3930
|
+
}
|
|
3931
|
+
}
|
|
3932
|
+
|
|
3933
|
+
module.exports = DGTableJQuery;
|
|
3934
|
+
|
|
3935
|
+
//# sourceMappingURL=lib.cjs.js.map
|