@vertexvis/ui 0.1.1-canary.3 → 0.1.1-canary.5

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.
Files changed (46) hide show
  1. package/dist/cjs/{banner-1ae6f3cd.js → banner-08c5f50b.js} +1 -1
  2. package/dist/cjs/{icon-button-e153919d.js → icon-button-8c4a9cd6.js} +1 -1
  3. package/dist/cjs/{icon-a663714d.js → icon-dce835e0.js} +1 -1
  4. package/dist/cjs/{icon-helper-b0c91e68.js → icon-helper-c076290f.js} +5 -0
  5. package/dist/cjs/index.cjs.js +5 -5
  6. package/dist/cjs/tooltip-634eb8c9.js +333 -0
  7. package/dist/cjs/vertex-banner.cjs.entry.js +2 -2
  8. package/dist/cjs/vertex-icon-button.cjs.entry.js +2 -2
  9. package/dist/cjs/vertex-icon.cjs.entry.js +2 -2
  10. package/dist/cjs/vertex-tooltip.cjs.entry.js +1 -1
  11. package/dist/collection/components/icon/icon-helper.js +3 -0
  12. package/dist/collection/components/icon/icon.js +1 -1
  13. package/dist/collection/components/icon/icons/paper-airplane.js +2 -0
  14. package/dist/collection/components/icon-button/icon-button.js +1 -1
  15. package/dist/collection/types/icon.js +1 -0
  16. package/dist/components/components.esm.js +1 -1
  17. package/dist/components/index.esm.js +1 -1
  18. package/dist/components/p-3b794014.entry.js +1 -0
  19. package/dist/components/p-5fb1724f.js +1 -0
  20. package/dist/components/{p-9aba1a30.js → p-721ca850.js} +1 -1
  21. package/dist/components/p-91644b85.entry.js +1 -0
  22. package/dist/components/{p-39b59942.js → p-a399434b.js} +1 -1
  23. package/dist/components/p-b22ed1dd.entry.js +1 -0
  24. package/dist/components/{p-ecc73497.js → p-b74799f7.js} +1 -1
  25. package/dist/components/{p-3d790dea.js → p-c7a13d00.js} +1 -1
  26. package/dist/components/p-ef75393c.entry.js +1 -0
  27. package/dist/esm/{banner-fe82b75c.js → banner-014ee9ee.js} +1 -1
  28. package/dist/esm/{icon-6c6561ff.js → icon-a74a8129.js} +1 -1
  29. package/dist/esm/{icon-button-69b45dbb.js → icon-button-33aa27cb.js} +1 -1
  30. package/dist/esm/{icon-helper-83bf6296.js → icon-helper-2f57104b.js} +5 -0
  31. package/dist/esm/index.js +5 -5
  32. package/dist/esm/tooltip-bed548f4.js +331 -0
  33. package/dist/esm/vertex-banner.entry.js +2 -2
  34. package/dist/esm/vertex-icon-button.entry.js +2 -2
  35. package/dist/esm/vertex-icon.entry.js +2 -2
  36. package/dist/esm/vertex-tooltip.entry.js +1 -1
  37. package/dist/types/components/icon/icons/paper-airplane.d.ts +3 -0
  38. package/dist/types/types/icon.d.ts +1 -0
  39. package/package.json +3 -3
  40. package/dist/cjs/tooltip-9d097c55.js +0 -2188
  41. package/dist/components/p-155c38e2.entry.js +0 -1
  42. package/dist/components/p-45848878.js +0 -1
  43. package/dist/components/p-954c0e3a.entry.js +0 -1
  44. package/dist/components/p-cbfc041e.entry.js +0 -1
  45. package/dist/components/p-f4c3c58d.entry.js +0 -1
  46. package/dist/esm/tooltip-db8ebd41.js +0 -2186
@@ -1,2186 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-72f28b71.js';
2
- import { _ as __extends, a as __read } from './tslib.es6-99cd0de8.js';
3
- import { c as classnames } from './index-9c609209.js';
4
- import { g as getBoundingClientRect } from './dom-9d0f7bf4.js';
5
- import { a as getSlottedContent } from './slots-fbb5afb3.js';
6
-
7
- /**
8
- * A module for defining functional schemas to map between different types. This
9
- * module is useful for parsing to or from JSON/protobufs to domain types.
10
- *
11
- * Mappers support greedy validation, so all validation errors are aggregated
12
- * and reported vs failing on the first invalid input.
13
- *
14
- * @example
15
- *
16
- * ```ts
17
- * import { Mapper as M } from '@vertexvis/utils';
18
- *
19
- * interface Address {
20
- * address: string;
21
- * city: string;
22
- * state: string;
23
- * zip: string;
24
- * }
25
- *
26
- * interface Person {
27
- * name: string;
28
- * addresses: Address[];
29
- * }
30
- *
31
- * type AddressJson = Partial<Address>;
32
- * type PersonJson = {
33
- * name?: string;
34
- * addresses?: AddressJson[];
35
- * }
36
- *
37
- * const mapAddress: M.Func<AddressJson, Address> = M.defineMapper(
38
- * M.read(
39
- * M.requireProp('address'),
40
- * M.requireProp('city'),
41
- * M.requireProp('state'),
42
- * M.requireProp('zip')
43
- * ),
44
- * ([address, city, state, zip]) => ({
45
- * address, city, state, zip
46
- * })
47
- * );
48
- *
49
- * const mapPerson: M.Func<PersonJson, Person> = M.defineMapper(
50
- * M.read(
51
- * M.requireProp('name'),
52
- * M.mapProp(
53
- * 'addresses',
54
- * M.compose(M.required('addresses'), M.mapArray(mapAddress))
55
- * )
56
- * ),
57
- * ([name, addresses]) => ({ name, addresses })
58
- * );
59
- *
60
- * const person = mapPerson({
61
- * name: 'John',
62
- * addresses: [{ address: '123', city: 'Ames', state: 'IA', zip: '50010' }]
63
- * });
64
- *
65
- * const invalidPerson = mapPerson({
66
- * addresses: [{ city: 'Ames', state: 'IA', zip: '50010' }]
67
- * });
68
- * ```
69
- * // {
70
- * // errors: ["Name is required.", "Address is required."]
71
- * // }
72
- *
73
- * @module
74
- */
75
- /**
76
- * An error that is thrown when validation of a schema fails.
77
- *
78
- * @see {@link ifInvalidThrow} - for throwing errors on invalid input.
79
- */
80
- /** @class */ ((function (_super) {
81
- __extends(MapperValidationError, _super);
82
- function MapperValidationError(errors) {
83
- var _this = _super.call(this, 'Validation error mapping object.') || this;
84
- _this.errors = errors;
85
- Object.setPrototypeOf(_this, MapperValidationError.prototype);
86
- return _this;
87
- }
88
- return MapperValidationError;
89
- })(Error));
90
-
91
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
92
-
93
- var lodash_isequal = {exports: {}};
94
-
95
- /**
96
- * Lodash (Custom Build) <https://lodash.com/>
97
- * Build: `lodash modularize exports="npm" -o ./`
98
- * Copyright JS Foundation and other contributors <https://js.foundation/>
99
- * Released under MIT license <https://lodash.com/license>
100
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
101
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
102
- */
103
-
104
- (function (module, exports) {
105
- /** Used as the size to enable large array optimizations. */
106
- var LARGE_ARRAY_SIZE = 200;
107
-
108
- /** Used to stand-in for `undefined` hash values. */
109
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
110
-
111
- /** Used to compose bitmasks for value comparisons. */
112
- var COMPARE_PARTIAL_FLAG = 1,
113
- COMPARE_UNORDERED_FLAG = 2;
114
-
115
- /** Used as references for various `Number` constants. */
116
- var MAX_SAFE_INTEGER = 9007199254740991;
117
-
118
- /** `Object#toString` result references. */
119
- var argsTag = '[object Arguments]',
120
- arrayTag = '[object Array]',
121
- asyncTag = '[object AsyncFunction]',
122
- boolTag = '[object Boolean]',
123
- dateTag = '[object Date]',
124
- errorTag = '[object Error]',
125
- funcTag = '[object Function]',
126
- genTag = '[object GeneratorFunction]',
127
- mapTag = '[object Map]',
128
- numberTag = '[object Number]',
129
- nullTag = '[object Null]',
130
- objectTag = '[object Object]',
131
- promiseTag = '[object Promise]',
132
- proxyTag = '[object Proxy]',
133
- regexpTag = '[object RegExp]',
134
- setTag = '[object Set]',
135
- stringTag = '[object String]',
136
- symbolTag = '[object Symbol]',
137
- undefinedTag = '[object Undefined]',
138
- weakMapTag = '[object WeakMap]';
139
-
140
- var arrayBufferTag = '[object ArrayBuffer]',
141
- dataViewTag = '[object DataView]',
142
- float32Tag = '[object Float32Array]',
143
- float64Tag = '[object Float64Array]',
144
- int8Tag = '[object Int8Array]',
145
- int16Tag = '[object Int16Array]',
146
- int32Tag = '[object Int32Array]',
147
- uint8Tag = '[object Uint8Array]',
148
- uint8ClampedTag = '[object Uint8ClampedArray]',
149
- uint16Tag = '[object Uint16Array]',
150
- uint32Tag = '[object Uint32Array]';
151
-
152
- /**
153
- * Used to match `RegExp`
154
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
155
- */
156
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
157
-
158
- /** Used to detect host constructors (Safari). */
159
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
160
-
161
- /** Used to detect unsigned integer values. */
162
- var reIsUint = /^(?:0|[1-9]\d*)$/;
163
-
164
- /** Used to identify `toStringTag` values of typed arrays. */
165
- var typedArrayTags = {};
166
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
167
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
168
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
169
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
170
- typedArrayTags[uint32Tag] = true;
171
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
172
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
173
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
174
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
175
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
176
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
177
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
178
- typedArrayTags[weakMapTag] = false;
179
-
180
- /** Detect free variable `global` from Node.js. */
181
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
182
-
183
- /** Detect free variable `self`. */
184
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
185
-
186
- /** Used as a reference to the global object. */
187
- var root = freeGlobal || freeSelf || Function('return this')();
188
-
189
- /** Detect free variable `exports`. */
190
- var freeExports = exports && !exports.nodeType && exports;
191
-
192
- /** Detect free variable `module`. */
193
- var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
194
-
195
- /** Detect the popular CommonJS extension `module.exports`. */
196
- var moduleExports = freeModule && freeModule.exports === freeExports;
197
-
198
- /** Detect free variable `process` from Node.js. */
199
- var freeProcess = moduleExports && freeGlobal.process;
200
-
201
- /** Used to access faster Node.js helpers. */
202
- var nodeUtil = (function() {
203
- try {
204
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
205
- } catch (e) {}
206
- }());
207
-
208
- /* Node.js helper references. */
209
- var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
210
-
211
- /**
212
- * A specialized version of `_.filter` for arrays without support for
213
- * iteratee shorthands.
214
- *
215
- * @private
216
- * @param {Array} [array] The array to iterate over.
217
- * @param {Function} predicate The function invoked per iteration.
218
- * @returns {Array} Returns the new filtered array.
219
- */
220
- function arrayFilter(array, predicate) {
221
- var index = -1,
222
- length = array == null ? 0 : array.length,
223
- resIndex = 0,
224
- result = [];
225
-
226
- while (++index < length) {
227
- var value = array[index];
228
- if (predicate(value, index, array)) {
229
- result[resIndex++] = value;
230
- }
231
- }
232
- return result;
233
- }
234
-
235
- /**
236
- * Appends the elements of `values` to `array`.
237
- *
238
- * @private
239
- * @param {Array} array The array to modify.
240
- * @param {Array} values The values to append.
241
- * @returns {Array} Returns `array`.
242
- */
243
- function arrayPush(array, values) {
244
- var index = -1,
245
- length = values.length,
246
- offset = array.length;
247
-
248
- while (++index < length) {
249
- array[offset + index] = values[index];
250
- }
251
- return array;
252
- }
253
-
254
- /**
255
- * A specialized version of `_.some` for arrays without support for iteratee
256
- * shorthands.
257
- *
258
- * @private
259
- * @param {Array} [array] The array to iterate over.
260
- * @param {Function} predicate The function invoked per iteration.
261
- * @returns {boolean} Returns `true` if any element passes the predicate check,
262
- * else `false`.
263
- */
264
- function arraySome(array, predicate) {
265
- var index = -1,
266
- length = array == null ? 0 : array.length;
267
-
268
- while (++index < length) {
269
- if (predicate(array[index], index, array)) {
270
- return true;
271
- }
272
- }
273
- return false;
274
- }
275
-
276
- /**
277
- * The base implementation of `_.times` without support for iteratee shorthands
278
- * or max array length checks.
279
- *
280
- * @private
281
- * @param {number} n The number of times to invoke `iteratee`.
282
- * @param {Function} iteratee The function invoked per iteration.
283
- * @returns {Array} Returns the array of results.
284
- */
285
- function baseTimes(n, iteratee) {
286
- var index = -1,
287
- result = Array(n);
288
-
289
- while (++index < n) {
290
- result[index] = iteratee(index);
291
- }
292
- return result;
293
- }
294
-
295
- /**
296
- * The base implementation of `_.unary` without support for storing metadata.
297
- *
298
- * @private
299
- * @param {Function} func The function to cap arguments for.
300
- * @returns {Function} Returns the new capped function.
301
- */
302
- function baseUnary(func) {
303
- return function(value) {
304
- return func(value);
305
- };
306
- }
307
-
308
- /**
309
- * Checks if a `cache` value for `key` exists.
310
- *
311
- * @private
312
- * @param {Object} cache The cache to query.
313
- * @param {string} key The key of the entry to check.
314
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
315
- */
316
- function cacheHas(cache, key) {
317
- return cache.has(key);
318
- }
319
-
320
- /**
321
- * Gets the value at `key` of `object`.
322
- *
323
- * @private
324
- * @param {Object} [object] The object to query.
325
- * @param {string} key The key of the property to get.
326
- * @returns {*} Returns the property value.
327
- */
328
- function getValue(object, key) {
329
- return object == null ? undefined : object[key];
330
- }
331
-
332
- /**
333
- * Converts `map` to its key-value pairs.
334
- *
335
- * @private
336
- * @param {Object} map The map to convert.
337
- * @returns {Array} Returns the key-value pairs.
338
- */
339
- function mapToArray(map) {
340
- var index = -1,
341
- result = Array(map.size);
342
-
343
- map.forEach(function(value, key) {
344
- result[++index] = [key, value];
345
- });
346
- return result;
347
- }
348
-
349
- /**
350
- * Creates a unary function that invokes `func` with its argument transformed.
351
- *
352
- * @private
353
- * @param {Function} func The function to wrap.
354
- * @param {Function} transform The argument transform.
355
- * @returns {Function} Returns the new function.
356
- */
357
- function overArg(func, transform) {
358
- return function(arg) {
359
- return func(transform(arg));
360
- };
361
- }
362
-
363
- /**
364
- * Converts `set` to an array of its values.
365
- *
366
- * @private
367
- * @param {Object} set The set to convert.
368
- * @returns {Array} Returns the values.
369
- */
370
- function setToArray(set) {
371
- var index = -1,
372
- result = Array(set.size);
373
-
374
- set.forEach(function(value) {
375
- result[++index] = value;
376
- });
377
- return result;
378
- }
379
-
380
- /** Used for built-in method references. */
381
- var arrayProto = Array.prototype,
382
- funcProto = Function.prototype,
383
- objectProto = Object.prototype;
384
-
385
- /** Used to detect overreaching core-js shims. */
386
- var coreJsData = root['__core-js_shared__'];
387
-
388
- /** Used to resolve the decompiled source of functions. */
389
- var funcToString = funcProto.toString;
390
-
391
- /** Used to check objects for own properties. */
392
- var hasOwnProperty = objectProto.hasOwnProperty;
393
-
394
- /** Used to detect methods masquerading as native. */
395
- var maskSrcKey = (function() {
396
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
397
- return uid ? ('Symbol(src)_1.' + uid) : '';
398
- }());
399
-
400
- /**
401
- * Used to resolve the
402
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
403
- * of values.
404
- */
405
- var nativeObjectToString = objectProto.toString;
406
-
407
- /** Used to detect if a method is native. */
408
- var reIsNative = RegExp('^' +
409
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
410
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
411
- );
412
-
413
- /** Built-in value references. */
414
- var Buffer = moduleExports ? root.Buffer : undefined,
415
- Symbol = root.Symbol,
416
- Uint8Array = root.Uint8Array,
417
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
418
- splice = arrayProto.splice,
419
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
420
-
421
- /* Built-in method references for those with the same name as other `lodash` methods. */
422
- var nativeGetSymbols = Object.getOwnPropertySymbols,
423
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
424
- nativeKeys = overArg(Object.keys, Object);
425
-
426
- /* Built-in method references that are verified to be native. */
427
- var DataView = getNative(root, 'DataView'),
428
- Map = getNative(root, 'Map'),
429
- Promise = getNative(root, 'Promise'),
430
- Set = getNative(root, 'Set'),
431
- WeakMap = getNative(root, 'WeakMap'),
432
- nativeCreate = getNative(Object, 'create');
433
-
434
- /** Used to detect maps, sets, and weakmaps. */
435
- var dataViewCtorString = toSource(DataView),
436
- mapCtorString = toSource(Map),
437
- promiseCtorString = toSource(Promise),
438
- setCtorString = toSource(Set),
439
- weakMapCtorString = toSource(WeakMap);
440
-
441
- /** Used to convert symbols to primitives and strings. */
442
- var symbolProto = Symbol ? Symbol.prototype : undefined,
443
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
444
-
445
- /**
446
- * Creates a hash object.
447
- *
448
- * @private
449
- * @constructor
450
- * @param {Array} [entries] The key-value pairs to cache.
451
- */
452
- function Hash(entries) {
453
- var index = -1,
454
- length = entries == null ? 0 : entries.length;
455
-
456
- this.clear();
457
- while (++index < length) {
458
- var entry = entries[index];
459
- this.set(entry[0], entry[1]);
460
- }
461
- }
462
-
463
- /**
464
- * Removes all key-value entries from the hash.
465
- *
466
- * @private
467
- * @name clear
468
- * @memberOf Hash
469
- */
470
- function hashClear() {
471
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
472
- this.size = 0;
473
- }
474
-
475
- /**
476
- * Removes `key` and its value from the hash.
477
- *
478
- * @private
479
- * @name delete
480
- * @memberOf Hash
481
- * @param {Object} hash The hash to modify.
482
- * @param {string} key The key of the value to remove.
483
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
484
- */
485
- function hashDelete(key) {
486
- var result = this.has(key) && delete this.__data__[key];
487
- this.size -= result ? 1 : 0;
488
- return result;
489
- }
490
-
491
- /**
492
- * Gets the hash value for `key`.
493
- *
494
- * @private
495
- * @name get
496
- * @memberOf Hash
497
- * @param {string} key The key of the value to get.
498
- * @returns {*} Returns the entry value.
499
- */
500
- function hashGet(key) {
501
- var data = this.__data__;
502
- if (nativeCreate) {
503
- var result = data[key];
504
- return result === HASH_UNDEFINED ? undefined : result;
505
- }
506
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
507
- }
508
-
509
- /**
510
- * Checks if a hash value for `key` exists.
511
- *
512
- * @private
513
- * @name has
514
- * @memberOf Hash
515
- * @param {string} key The key of the entry to check.
516
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
517
- */
518
- function hashHas(key) {
519
- var data = this.__data__;
520
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
521
- }
522
-
523
- /**
524
- * Sets the hash `key` to `value`.
525
- *
526
- * @private
527
- * @name set
528
- * @memberOf Hash
529
- * @param {string} key The key of the value to set.
530
- * @param {*} value The value to set.
531
- * @returns {Object} Returns the hash instance.
532
- */
533
- function hashSet(key, value) {
534
- var data = this.__data__;
535
- this.size += this.has(key) ? 0 : 1;
536
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
537
- return this;
538
- }
539
-
540
- // Add methods to `Hash`.
541
- Hash.prototype.clear = hashClear;
542
- Hash.prototype['delete'] = hashDelete;
543
- Hash.prototype.get = hashGet;
544
- Hash.prototype.has = hashHas;
545
- Hash.prototype.set = hashSet;
546
-
547
- /**
548
- * Creates an list cache object.
549
- *
550
- * @private
551
- * @constructor
552
- * @param {Array} [entries] The key-value pairs to cache.
553
- */
554
- function ListCache(entries) {
555
- var index = -1,
556
- length = entries == null ? 0 : entries.length;
557
-
558
- this.clear();
559
- while (++index < length) {
560
- var entry = entries[index];
561
- this.set(entry[0], entry[1]);
562
- }
563
- }
564
-
565
- /**
566
- * Removes all key-value entries from the list cache.
567
- *
568
- * @private
569
- * @name clear
570
- * @memberOf ListCache
571
- */
572
- function listCacheClear() {
573
- this.__data__ = [];
574
- this.size = 0;
575
- }
576
-
577
- /**
578
- * Removes `key` and its value from the list cache.
579
- *
580
- * @private
581
- * @name delete
582
- * @memberOf ListCache
583
- * @param {string} key The key of the value to remove.
584
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
585
- */
586
- function listCacheDelete(key) {
587
- var data = this.__data__,
588
- index = assocIndexOf(data, key);
589
-
590
- if (index < 0) {
591
- return false;
592
- }
593
- var lastIndex = data.length - 1;
594
- if (index == lastIndex) {
595
- data.pop();
596
- } else {
597
- splice.call(data, index, 1);
598
- }
599
- --this.size;
600
- return true;
601
- }
602
-
603
- /**
604
- * Gets the list cache value for `key`.
605
- *
606
- * @private
607
- * @name get
608
- * @memberOf ListCache
609
- * @param {string} key The key of the value to get.
610
- * @returns {*} Returns the entry value.
611
- */
612
- function listCacheGet(key) {
613
- var data = this.__data__,
614
- index = assocIndexOf(data, key);
615
-
616
- return index < 0 ? undefined : data[index][1];
617
- }
618
-
619
- /**
620
- * Checks if a list cache value for `key` exists.
621
- *
622
- * @private
623
- * @name has
624
- * @memberOf ListCache
625
- * @param {string} key The key of the entry to check.
626
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
627
- */
628
- function listCacheHas(key) {
629
- return assocIndexOf(this.__data__, key) > -1;
630
- }
631
-
632
- /**
633
- * Sets the list cache `key` to `value`.
634
- *
635
- * @private
636
- * @name set
637
- * @memberOf ListCache
638
- * @param {string} key The key of the value to set.
639
- * @param {*} value The value to set.
640
- * @returns {Object} Returns the list cache instance.
641
- */
642
- function listCacheSet(key, value) {
643
- var data = this.__data__,
644
- index = assocIndexOf(data, key);
645
-
646
- if (index < 0) {
647
- ++this.size;
648
- data.push([key, value]);
649
- } else {
650
- data[index][1] = value;
651
- }
652
- return this;
653
- }
654
-
655
- // Add methods to `ListCache`.
656
- ListCache.prototype.clear = listCacheClear;
657
- ListCache.prototype['delete'] = listCacheDelete;
658
- ListCache.prototype.get = listCacheGet;
659
- ListCache.prototype.has = listCacheHas;
660
- ListCache.prototype.set = listCacheSet;
661
-
662
- /**
663
- * Creates a map cache object to store key-value pairs.
664
- *
665
- * @private
666
- * @constructor
667
- * @param {Array} [entries] The key-value pairs to cache.
668
- */
669
- function MapCache(entries) {
670
- var index = -1,
671
- length = entries == null ? 0 : entries.length;
672
-
673
- this.clear();
674
- while (++index < length) {
675
- var entry = entries[index];
676
- this.set(entry[0], entry[1]);
677
- }
678
- }
679
-
680
- /**
681
- * Removes all key-value entries from the map.
682
- *
683
- * @private
684
- * @name clear
685
- * @memberOf MapCache
686
- */
687
- function mapCacheClear() {
688
- this.size = 0;
689
- this.__data__ = {
690
- 'hash': new Hash,
691
- 'map': new (Map || ListCache),
692
- 'string': new Hash
693
- };
694
- }
695
-
696
- /**
697
- * Removes `key` and its value from the map.
698
- *
699
- * @private
700
- * @name delete
701
- * @memberOf MapCache
702
- * @param {string} key The key of the value to remove.
703
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
704
- */
705
- function mapCacheDelete(key) {
706
- var result = getMapData(this, key)['delete'](key);
707
- this.size -= result ? 1 : 0;
708
- return result;
709
- }
710
-
711
- /**
712
- * Gets the map value for `key`.
713
- *
714
- * @private
715
- * @name get
716
- * @memberOf MapCache
717
- * @param {string} key The key of the value to get.
718
- * @returns {*} Returns the entry value.
719
- */
720
- function mapCacheGet(key) {
721
- return getMapData(this, key).get(key);
722
- }
723
-
724
- /**
725
- * Checks if a map value for `key` exists.
726
- *
727
- * @private
728
- * @name has
729
- * @memberOf MapCache
730
- * @param {string} key The key of the entry to check.
731
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
732
- */
733
- function mapCacheHas(key) {
734
- return getMapData(this, key).has(key);
735
- }
736
-
737
- /**
738
- * Sets the map `key` to `value`.
739
- *
740
- * @private
741
- * @name set
742
- * @memberOf MapCache
743
- * @param {string} key The key of the value to set.
744
- * @param {*} value The value to set.
745
- * @returns {Object} Returns the map cache instance.
746
- */
747
- function mapCacheSet(key, value) {
748
- var data = getMapData(this, key),
749
- size = data.size;
750
-
751
- data.set(key, value);
752
- this.size += data.size == size ? 0 : 1;
753
- return this;
754
- }
755
-
756
- // Add methods to `MapCache`.
757
- MapCache.prototype.clear = mapCacheClear;
758
- MapCache.prototype['delete'] = mapCacheDelete;
759
- MapCache.prototype.get = mapCacheGet;
760
- MapCache.prototype.has = mapCacheHas;
761
- MapCache.prototype.set = mapCacheSet;
762
-
763
- /**
764
- *
765
- * Creates an array cache object to store unique values.
766
- *
767
- * @private
768
- * @constructor
769
- * @param {Array} [values] The values to cache.
770
- */
771
- function SetCache(values) {
772
- var index = -1,
773
- length = values == null ? 0 : values.length;
774
-
775
- this.__data__ = new MapCache;
776
- while (++index < length) {
777
- this.add(values[index]);
778
- }
779
- }
780
-
781
- /**
782
- * Adds `value` to the array cache.
783
- *
784
- * @private
785
- * @name add
786
- * @memberOf SetCache
787
- * @alias push
788
- * @param {*} value The value to cache.
789
- * @returns {Object} Returns the cache instance.
790
- */
791
- function setCacheAdd(value) {
792
- this.__data__.set(value, HASH_UNDEFINED);
793
- return this;
794
- }
795
-
796
- /**
797
- * Checks if `value` is in the array cache.
798
- *
799
- * @private
800
- * @name has
801
- * @memberOf SetCache
802
- * @param {*} value The value to search for.
803
- * @returns {number} Returns `true` if `value` is found, else `false`.
804
- */
805
- function setCacheHas(value) {
806
- return this.__data__.has(value);
807
- }
808
-
809
- // Add methods to `SetCache`.
810
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
811
- SetCache.prototype.has = setCacheHas;
812
-
813
- /**
814
- * Creates a stack cache object to store key-value pairs.
815
- *
816
- * @private
817
- * @constructor
818
- * @param {Array} [entries] The key-value pairs to cache.
819
- */
820
- function Stack(entries) {
821
- var data = this.__data__ = new ListCache(entries);
822
- this.size = data.size;
823
- }
824
-
825
- /**
826
- * Removes all key-value entries from the stack.
827
- *
828
- * @private
829
- * @name clear
830
- * @memberOf Stack
831
- */
832
- function stackClear() {
833
- this.__data__ = new ListCache;
834
- this.size = 0;
835
- }
836
-
837
- /**
838
- * Removes `key` and its value from the stack.
839
- *
840
- * @private
841
- * @name delete
842
- * @memberOf Stack
843
- * @param {string} key The key of the value to remove.
844
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
845
- */
846
- function stackDelete(key) {
847
- var data = this.__data__,
848
- result = data['delete'](key);
849
-
850
- this.size = data.size;
851
- return result;
852
- }
853
-
854
- /**
855
- * Gets the stack value for `key`.
856
- *
857
- * @private
858
- * @name get
859
- * @memberOf Stack
860
- * @param {string} key The key of the value to get.
861
- * @returns {*} Returns the entry value.
862
- */
863
- function stackGet(key) {
864
- return this.__data__.get(key);
865
- }
866
-
867
- /**
868
- * Checks if a stack value for `key` exists.
869
- *
870
- * @private
871
- * @name has
872
- * @memberOf Stack
873
- * @param {string} key The key of the entry to check.
874
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
875
- */
876
- function stackHas(key) {
877
- return this.__data__.has(key);
878
- }
879
-
880
- /**
881
- * Sets the stack `key` to `value`.
882
- *
883
- * @private
884
- * @name set
885
- * @memberOf Stack
886
- * @param {string} key The key of the value to set.
887
- * @param {*} value The value to set.
888
- * @returns {Object} Returns the stack cache instance.
889
- */
890
- function stackSet(key, value) {
891
- var data = this.__data__;
892
- if (data instanceof ListCache) {
893
- var pairs = data.__data__;
894
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
895
- pairs.push([key, value]);
896
- this.size = ++data.size;
897
- return this;
898
- }
899
- data = this.__data__ = new MapCache(pairs);
900
- }
901
- data.set(key, value);
902
- this.size = data.size;
903
- return this;
904
- }
905
-
906
- // Add methods to `Stack`.
907
- Stack.prototype.clear = stackClear;
908
- Stack.prototype['delete'] = stackDelete;
909
- Stack.prototype.get = stackGet;
910
- Stack.prototype.has = stackHas;
911
- Stack.prototype.set = stackSet;
912
-
913
- /**
914
- * Creates an array of the enumerable property names of the array-like `value`.
915
- *
916
- * @private
917
- * @param {*} value The value to query.
918
- * @param {boolean} inherited Specify returning inherited property names.
919
- * @returns {Array} Returns the array of property names.
920
- */
921
- function arrayLikeKeys(value, inherited) {
922
- var isArr = isArray(value),
923
- isArg = !isArr && isArguments(value),
924
- isBuff = !isArr && !isArg && isBuffer(value),
925
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
926
- skipIndexes = isArr || isArg || isBuff || isType,
927
- result = skipIndexes ? baseTimes(value.length, String) : [],
928
- length = result.length;
929
-
930
- for (var key in value) {
931
- if ((inherited || hasOwnProperty.call(value, key)) &&
932
- !(skipIndexes && (
933
- // Safari 9 has enumerable `arguments.length` in strict mode.
934
- key == 'length' ||
935
- // Node.js 0.10 has enumerable non-index properties on buffers.
936
- (isBuff && (key == 'offset' || key == 'parent')) ||
937
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
938
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
939
- // Skip index properties.
940
- isIndex(key, length)
941
- ))) {
942
- result.push(key);
943
- }
944
- }
945
- return result;
946
- }
947
-
948
- /**
949
- * Gets the index at which the `key` is found in `array` of key-value pairs.
950
- *
951
- * @private
952
- * @param {Array} array The array to inspect.
953
- * @param {*} key The key to search for.
954
- * @returns {number} Returns the index of the matched value, else `-1`.
955
- */
956
- function assocIndexOf(array, key) {
957
- var length = array.length;
958
- while (length--) {
959
- if (eq(array[length][0], key)) {
960
- return length;
961
- }
962
- }
963
- return -1;
964
- }
965
-
966
- /**
967
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
968
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
969
- * symbols of `object`.
970
- *
971
- * @private
972
- * @param {Object} object The object to query.
973
- * @param {Function} keysFunc The function to get the keys of `object`.
974
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
975
- * @returns {Array} Returns the array of property names and symbols.
976
- */
977
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
978
- var result = keysFunc(object);
979
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
980
- }
981
-
982
- /**
983
- * The base implementation of `getTag` without fallbacks for buggy environments.
984
- *
985
- * @private
986
- * @param {*} value The value to query.
987
- * @returns {string} Returns the `toStringTag`.
988
- */
989
- function baseGetTag(value) {
990
- if (value == null) {
991
- return value === undefined ? undefinedTag : nullTag;
992
- }
993
- return (symToStringTag && symToStringTag in Object(value))
994
- ? getRawTag(value)
995
- : objectToString(value);
996
- }
997
-
998
- /**
999
- * The base implementation of `_.isArguments`.
1000
- *
1001
- * @private
1002
- * @param {*} value The value to check.
1003
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1004
- */
1005
- function baseIsArguments(value) {
1006
- return isObjectLike(value) && baseGetTag(value) == argsTag;
1007
- }
1008
-
1009
- /**
1010
- * The base implementation of `_.isEqual` which supports partial comparisons
1011
- * and tracks traversed objects.
1012
- *
1013
- * @private
1014
- * @param {*} value The value to compare.
1015
- * @param {*} other The other value to compare.
1016
- * @param {boolean} bitmask The bitmask flags.
1017
- * 1 - Unordered comparison
1018
- * 2 - Partial comparison
1019
- * @param {Function} [customizer] The function to customize comparisons.
1020
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
1021
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1022
- */
1023
- function baseIsEqual(value, other, bitmask, customizer, stack) {
1024
- if (value === other) {
1025
- return true;
1026
- }
1027
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
1028
- return value !== value && other !== other;
1029
- }
1030
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1031
- }
1032
-
1033
- /**
1034
- * A specialized version of `baseIsEqual` for arrays and objects which performs
1035
- * deep comparisons and tracks traversed objects enabling objects with circular
1036
- * references to be compared.
1037
- *
1038
- * @private
1039
- * @param {Object} object The object to compare.
1040
- * @param {Object} other The other object to compare.
1041
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1042
- * @param {Function} customizer The function to customize comparisons.
1043
- * @param {Function} equalFunc The function to determine equivalents of values.
1044
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
1045
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1046
- */
1047
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1048
- var objIsArr = isArray(object),
1049
- othIsArr = isArray(other),
1050
- objTag = objIsArr ? arrayTag : getTag(object),
1051
- othTag = othIsArr ? arrayTag : getTag(other);
1052
-
1053
- objTag = objTag == argsTag ? objectTag : objTag;
1054
- othTag = othTag == argsTag ? objectTag : othTag;
1055
-
1056
- var objIsObj = objTag == objectTag,
1057
- othIsObj = othTag == objectTag,
1058
- isSameTag = objTag == othTag;
1059
-
1060
- if (isSameTag && isBuffer(object)) {
1061
- if (!isBuffer(other)) {
1062
- return false;
1063
- }
1064
- objIsArr = true;
1065
- objIsObj = false;
1066
- }
1067
- if (isSameTag && !objIsObj) {
1068
- stack || (stack = new Stack);
1069
- return (objIsArr || isTypedArray(object))
1070
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
1071
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1072
- }
1073
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1074
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
1075
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
1076
-
1077
- if (objIsWrapped || othIsWrapped) {
1078
- var objUnwrapped = objIsWrapped ? object.value() : object,
1079
- othUnwrapped = othIsWrapped ? other.value() : other;
1080
-
1081
- stack || (stack = new Stack);
1082
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1083
- }
1084
- }
1085
- if (!isSameTag) {
1086
- return false;
1087
- }
1088
- stack || (stack = new Stack);
1089
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1090
- }
1091
-
1092
- /**
1093
- * The base implementation of `_.isNative` without bad shim checks.
1094
- *
1095
- * @private
1096
- * @param {*} value The value to check.
1097
- * @returns {boolean} Returns `true` if `value` is a native function,
1098
- * else `false`.
1099
- */
1100
- function baseIsNative(value) {
1101
- if (!isObject(value) || isMasked(value)) {
1102
- return false;
1103
- }
1104
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1105
- return pattern.test(toSource(value));
1106
- }
1107
-
1108
- /**
1109
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
1110
- *
1111
- * @private
1112
- * @param {*} value The value to check.
1113
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1114
- */
1115
- function baseIsTypedArray(value) {
1116
- return isObjectLike(value) &&
1117
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1118
- }
1119
-
1120
- /**
1121
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1122
- *
1123
- * @private
1124
- * @param {Object} object The object to query.
1125
- * @returns {Array} Returns the array of property names.
1126
- */
1127
- function baseKeys(object) {
1128
- if (!isPrototype(object)) {
1129
- return nativeKeys(object);
1130
- }
1131
- var result = [];
1132
- for (var key in Object(object)) {
1133
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
1134
- result.push(key);
1135
- }
1136
- }
1137
- return result;
1138
- }
1139
-
1140
- /**
1141
- * A specialized version of `baseIsEqualDeep` for arrays with support for
1142
- * partial deep comparisons.
1143
- *
1144
- * @private
1145
- * @param {Array} array The array to compare.
1146
- * @param {Array} other The other array to compare.
1147
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1148
- * @param {Function} customizer The function to customize comparisons.
1149
- * @param {Function} equalFunc The function to determine equivalents of values.
1150
- * @param {Object} stack Tracks traversed `array` and `other` objects.
1151
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1152
- */
1153
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1154
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1155
- arrLength = array.length,
1156
- othLength = other.length;
1157
-
1158
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1159
- return false;
1160
- }
1161
- // Assume cyclic values are equal.
1162
- var stacked = stack.get(array);
1163
- if (stacked && stack.get(other)) {
1164
- return stacked == other;
1165
- }
1166
- var index = -1,
1167
- result = true,
1168
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
1169
-
1170
- stack.set(array, other);
1171
- stack.set(other, array);
1172
-
1173
- // Ignore non-index properties.
1174
- while (++index < arrLength) {
1175
- var arrValue = array[index],
1176
- othValue = other[index];
1177
-
1178
- if (customizer) {
1179
- var compared = isPartial
1180
- ? customizer(othValue, arrValue, index, other, array, stack)
1181
- : customizer(arrValue, othValue, index, array, other, stack);
1182
- }
1183
- if (compared !== undefined) {
1184
- if (compared) {
1185
- continue;
1186
- }
1187
- result = false;
1188
- break;
1189
- }
1190
- // Recursively compare arrays (susceptible to call stack limits).
1191
- if (seen) {
1192
- if (!arraySome(other, function(othValue, othIndex) {
1193
- if (!cacheHas(seen, othIndex) &&
1194
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1195
- return seen.push(othIndex);
1196
- }
1197
- })) {
1198
- result = false;
1199
- break;
1200
- }
1201
- } else if (!(
1202
- arrValue === othValue ||
1203
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
1204
- )) {
1205
- result = false;
1206
- break;
1207
- }
1208
- }
1209
- stack['delete'](array);
1210
- stack['delete'](other);
1211
- return result;
1212
- }
1213
-
1214
- /**
1215
- * A specialized version of `baseIsEqualDeep` for comparing objects of
1216
- * the same `toStringTag`.
1217
- *
1218
- * **Note:** This function only supports comparing values with tags of
1219
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1220
- *
1221
- * @private
1222
- * @param {Object} object The object to compare.
1223
- * @param {Object} other The other object to compare.
1224
- * @param {string} tag The `toStringTag` of the objects to compare.
1225
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1226
- * @param {Function} customizer The function to customize comparisons.
1227
- * @param {Function} equalFunc The function to determine equivalents of values.
1228
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1229
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1230
- */
1231
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1232
- switch (tag) {
1233
- case dataViewTag:
1234
- if ((object.byteLength != other.byteLength) ||
1235
- (object.byteOffset != other.byteOffset)) {
1236
- return false;
1237
- }
1238
- object = object.buffer;
1239
- other = other.buffer;
1240
-
1241
- case arrayBufferTag:
1242
- if ((object.byteLength != other.byteLength) ||
1243
- !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1244
- return false;
1245
- }
1246
- return true;
1247
-
1248
- case boolTag:
1249
- case dateTag:
1250
- case numberTag:
1251
- // Coerce booleans to `1` or `0` and dates to milliseconds.
1252
- // Invalid dates are coerced to `NaN`.
1253
- return eq(+object, +other);
1254
-
1255
- case errorTag:
1256
- return object.name == other.name && object.message == other.message;
1257
-
1258
- case regexpTag:
1259
- case stringTag:
1260
- // Coerce regexes to strings and treat strings, primitives and objects,
1261
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1262
- // for more details.
1263
- return object == (other + '');
1264
-
1265
- case mapTag:
1266
- var convert = mapToArray;
1267
-
1268
- case setTag:
1269
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1270
- convert || (convert = setToArray);
1271
-
1272
- if (object.size != other.size && !isPartial) {
1273
- return false;
1274
- }
1275
- // Assume cyclic values are equal.
1276
- var stacked = stack.get(object);
1277
- if (stacked) {
1278
- return stacked == other;
1279
- }
1280
- bitmask |= COMPARE_UNORDERED_FLAG;
1281
-
1282
- // Recursively compare objects (susceptible to call stack limits).
1283
- stack.set(object, other);
1284
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1285
- stack['delete'](object);
1286
- return result;
1287
-
1288
- case symbolTag:
1289
- if (symbolValueOf) {
1290
- return symbolValueOf.call(object) == symbolValueOf.call(other);
1291
- }
1292
- }
1293
- return false;
1294
- }
1295
-
1296
- /**
1297
- * A specialized version of `baseIsEqualDeep` for objects with support for
1298
- * partial deep comparisons.
1299
- *
1300
- * @private
1301
- * @param {Object} object The object to compare.
1302
- * @param {Object} other The other object to compare.
1303
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1304
- * @param {Function} customizer The function to customize comparisons.
1305
- * @param {Function} equalFunc The function to determine equivalents of values.
1306
- * @param {Object} stack Tracks traversed `object` and `other` objects.
1307
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1308
- */
1309
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1310
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1311
- objProps = getAllKeys(object),
1312
- objLength = objProps.length,
1313
- othProps = getAllKeys(other),
1314
- othLength = othProps.length;
1315
-
1316
- if (objLength != othLength && !isPartial) {
1317
- return false;
1318
- }
1319
- var index = objLength;
1320
- while (index--) {
1321
- var key = objProps[index];
1322
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1323
- return false;
1324
- }
1325
- }
1326
- // Assume cyclic values are equal.
1327
- var stacked = stack.get(object);
1328
- if (stacked && stack.get(other)) {
1329
- return stacked == other;
1330
- }
1331
- var result = true;
1332
- stack.set(object, other);
1333
- stack.set(other, object);
1334
-
1335
- var skipCtor = isPartial;
1336
- while (++index < objLength) {
1337
- key = objProps[index];
1338
- var objValue = object[key],
1339
- othValue = other[key];
1340
-
1341
- if (customizer) {
1342
- var compared = isPartial
1343
- ? customizer(othValue, objValue, key, other, object, stack)
1344
- : customizer(objValue, othValue, key, object, other, stack);
1345
- }
1346
- // Recursively compare objects (susceptible to call stack limits).
1347
- if (!(compared === undefined
1348
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1349
- : compared
1350
- )) {
1351
- result = false;
1352
- break;
1353
- }
1354
- skipCtor || (skipCtor = key == 'constructor');
1355
- }
1356
- if (result && !skipCtor) {
1357
- var objCtor = object.constructor,
1358
- othCtor = other.constructor;
1359
-
1360
- // Non `Object` object instances with different constructors are not equal.
1361
- if (objCtor != othCtor &&
1362
- ('constructor' in object && 'constructor' in other) &&
1363
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1364
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1365
- result = false;
1366
- }
1367
- }
1368
- stack['delete'](object);
1369
- stack['delete'](other);
1370
- return result;
1371
- }
1372
-
1373
- /**
1374
- * Creates an array of own enumerable property names and symbols of `object`.
1375
- *
1376
- * @private
1377
- * @param {Object} object The object to query.
1378
- * @returns {Array} Returns the array of property names and symbols.
1379
- */
1380
- function getAllKeys(object) {
1381
- return baseGetAllKeys(object, keys, getSymbols);
1382
- }
1383
-
1384
- /**
1385
- * Gets the data for `map`.
1386
- *
1387
- * @private
1388
- * @param {Object} map The map to query.
1389
- * @param {string} key The reference key.
1390
- * @returns {*} Returns the map data.
1391
- */
1392
- function getMapData(map, key) {
1393
- var data = map.__data__;
1394
- return isKeyable(key)
1395
- ? data[typeof key == 'string' ? 'string' : 'hash']
1396
- : data.map;
1397
- }
1398
-
1399
- /**
1400
- * Gets the native function at `key` of `object`.
1401
- *
1402
- * @private
1403
- * @param {Object} object The object to query.
1404
- * @param {string} key The key of the method to get.
1405
- * @returns {*} Returns the function if it's native, else `undefined`.
1406
- */
1407
- function getNative(object, key) {
1408
- var value = getValue(object, key);
1409
- return baseIsNative(value) ? value : undefined;
1410
- }
1411
-
1412
- /**
1413
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1414
- *
1415
- * @private
1416
- * @param {*} value The value to query.
1417
- * @returns {string} Returns the raw `toStringTag`.
1418
- */
1419
- function getRawTag(value) {
1420
- var isOwn = hasOwnProperty.call(value, symToStringTag),
1421
- tag = value[symToStringTag];
1422
-
1423
- try {
1424
- value[symToStringTag] = undefined;
1425
- var unmasked = true;
1426
- } catch (e) {}
1427
-
1428
- var result = nativeObjectToString.call(value);
1429
- if (unmasked) {
1430
- if (isOwn) {
1431
- value[symToStringTag] = tag;
1432
- } else {
1433
- delete value[symToStringTag];
1434
- }
1435
- }
1436
- return result;
1437
- }
1438
-
1439
- /**
1440
- * Creates an array of the own enumerable symbols of `object`.
1441
- *
1442
- * @private
1443
- * @param {Object} object The object to query.
1444
- * @returns {Array} Returns the array of symbols.
1445
- */
1446
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1447
- if (object == null) {
1448
- return [];
1449
- }
1450
- object = Object(object);
1451
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
1452
- return propertyIsEnumerable.call(object, symbol);
1453
- });
1454
- };
1455
-
1456
- /**
1457
- * Gets the `toStringTag` of `value`.
1458
- *
1459
- * @private
1460
- * @param {*} value The value to query.
1461
- * @returns {string} Returns the `toStringTag`.
1462
- */
1463
- var getTag = baseGetTag;
1464
-
1465
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1466
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
1467
- (Map && getTag(new Map) != mapTag) ||
1468
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
1469
- (Set && getTag(new Set) != setTag) ||
1470
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1471
- getTag = function(value) {
1472
- var result = baseGetTag(value),
1473
- Ctor = result == objectTag ? value.constructor : undefined,
1474
- ctorString = Ctor ? toSource(Ctor) : '';
1475
-
1476
- if (ctorString) {
1477
- switch (ctorString) {
1478
- case dataViewCtorString: return dataViewTag;
1479
- case mapCtorString: return mapTag;
1480
- case promiseCtorString: return promiseTag;
1481
- case setCtorString: return setTag;
1482
- case weakMapCtorString: return weakMapTag;
1483
- }
1484
- }
1485
- return result;
1486
- };
1487
- }
1488
-
1489
- /**
1490
- * Checks if `value` is a valid array-like index.
1491
- *
1492
- * @private
1493
- * @param {*} value The value to check.
1494
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1495
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1496
- */
1497
- function isIndex(value, length) {
1498
- length = length == null ? MAX_SAFE_INTEGER : length;
1499
- return !!length &&
1500
- (typeof value == 'number' || reIsUint.test(value)) &&
1501
- (value > -1 && value % 1 == 0 && value < length);
1502
- }
1503
-
1504
- /**
1505
- * Checks if `value` is suitable for use as unique object key.
1506
- *
1507
- * @private
1508
- * @param {*} value The value to check.
1509
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1510
- */
1511
- function isKeyable(value) {
1512
- var type = typeof value;
1513
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1514
- ? (value !== '__proto__')
1515
- : (value === null);
1516
- }
1517
-
1518
- /**
1519
- * Checks if `func` has its source masked.
1520
- *
1521
- * @private
1522
- * @param {Function} func The function to check.
1523
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1524
- */
1525
- function isMasked(func) {
1526
- return !!maskSrcKey && (maskSrcKey in func);
1527
- }
1528
-
1529
- /**
1530
- * Checks if `value` is likely a prototype object.
1531
- *
1532
- * @private
1533
- * @param {*} value The value to check.
1534
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1535
- */
1536
- function isPrototype(value) {
1537
- var Ctor = value && value.constructor,
1538
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1539
-
1540
- return value === proto;
1541
- }
1542
-
1543
- /**
1544
- * Converts `value` to a string using `Object.prototype.toString`.
1545
- *
1546
- * @private
1547
- * @param {*} value The value to convert.
1548
- * @returns {string} Returns the converted string.
1549
- */
1550
- function objectToString(value) {
1551
- return nativeObjectToString.call(value);
1552
- }
1553
-
1554
- /**
1555
- * Converts `func` to its source code.
1556
- *
1557
- * @private
1558
- * @param {Function} func The function to convert.
1559
- * @returns {string} Returns the source code.
1560
- */
1561
- function toSource(func) {
1562
- if (func != null) {
1563
- try {
1564
- return funcToString.call(func);
1565
- } catch (e) {}
1566
- try {
1567
- return (func + '');
1568
- } catch (e) {}
1569
- }
1570
- return '';
1571
- }
1572
-
1573
- /**
1574
- * Performs a
1575
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1576
- * comparison between two values to determine if they are equivalent.
1577
- *
1578
- * @static
1579
- * @memberOf _
1580
- * @since 4.0.0
1581
- * @category Lang
1582
- * @param {*} value The value to compare.
1583
- * @param {*} other The other value to compare.
1584
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1585
- * @example
1586
- *
1587
- * var object = { 'a': 1 };
1588
- * var other = { 'a': 1 };
1589
- *
1590
- * _.eq(object, object);
1591
- * // => true
1592
- *
1593
- * _.eq(object, other);
1594
- * // => false
1595
- *
1596
- * _.eq('a', 'a');
1597
- * // => true
1598
- *
1599
- * _.eq('a', Object('a'));
1600
- * // => false
1601
- *
1602
- * _.eq(NaN, NaN);
1603
- * // => true
1604
- */
1605
- function eq(value, other) {
1606
- return value === other || (value !== value && other !== other);
1607
- }
1608
-
1609
- /**
1610
- * Checks if `value` is likely an `arguments` object.
1611
- *
1612
- * @static
1613
- * @memberOf _
1614
- * @since 0.1.0
1615
- * @category Lang
1616
- * @param {*} value The value to check.
1617
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1618
- * else `false`.
1619
- * @example
1620
- *
1621
- * _.isArguments(function() { return arguments; }());
1622
- * // => true
1623
- *
1624
- * _.isArguments([1, 2, 3]);
1625
- * // => false
1626
- */
1627
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1628
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1629
- !propertyIsEnumerable.call(value, 'callee');
1630
- };
1631
-
1632
- /**
1633
- * Checks if `value` is classified as an `Array` object.
1634
- *
1635
- * @static
1636
- * @memberOf _
1637
- * @since 0.1.0
1638
- * @category Lang
1639
- * @param {*} value The value to check.
1640
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1641
- * @example
1642
- *
1643
- * _.isArray([1, 2, 3]);
1644
- * // => true
1645
- *
1646
- * _.isArray(document.body.children);
1647
- * // => false
1648
- *
1649
- * _.isArray('abc');
1650
- * // => false
1651
- *
1652
- * _.isArray(_.noop);
1653
- * // => false
1654
- */
1655
- var isArray = Array.isArray;
1656
-
1657
- /**
1658
- * Checks if `value` is array-like. A value is considered array-like if it's
1659
- * not a function and has a `value.length` that's an integer greater than or
1660
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1661
- *
1662
- * @static
1663
- * @memberOf _
1664
- * @since 4.0.0
1665
- * @category Lang
1666
- * @param {*} value The value to check.
1667
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1668
- * @example
1669
- *
1670
- * _.isArrayLike([1, 2, 3]);
1671
- * // => true
1672
- *
1673
- * _.isArrayLike(document.body.children);
1674
- * // => true
1675
- *
1676
- * _.isArrayLike('abc');
1677
- * // => true
1678
- *
1679
- * _.isArrayLike(_.noop);
1680
- * // => false
1681
- */
1682
- function isArrayLike(value) {
1683
- return value != null && isLength(value.length) && !isFunction(value);
1684
- }
1685
-
1686
- /**
1687
- * Checks if `value` is a buffer.
1688
- *
1689
- * @static
1690
- * @memberOf _
1691
- * @since 4.3.0
1692
- * @category Lang
1693
- * @param {*} value The value to check.
1694
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1695
- * @example
1696
- *
1697
- * _.isBuffer(new Buffer(2));
1698
- * // => true
1699
- *
1700
- * _.isBuffer(new Uint8Array(2));
1701
- * // => false
1702
- */
1703
- var isBuffer = nativeIsBuffer || stubFalse;
1704
-
1705
- /**
1706
- * Performs a deep comparison between two values to determine if they are
1707
- * equivalent.
1708
- *
1709
- * **Note:** This method supports comparing arrays, array buffers, booleans,
1710
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
1711
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
1712
- * by their own, not inherited, enumerable properties. Functions and DOM
1713
- * nodes are compared by strict equality, i.e. `===`.
1714
- *
1715
- * @static
1716
- * @memberOf _
1717
- * @since 0.1.0
1718
- * @category Lang
1719
- * @param {*} value The value to compare.
1720
- * @param {*} other The other value to compare.
1721
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1722
- * @example
1723
- *
1724
- * var object = { 'a': 1 };
1725
- * var other = { 'a': 1 };
1726
- *
1727
- * _.isEqual(object, other);
1728
- * // => true
1729
- *
1730
- * object === other;
1731
- * // => false
1732
- */
1733
- function isEqual(value, other) {
1734
- return baseIsEqual(value, other);
1735
- }
1736
-
1737
- /**
1738
- * Checks if `value` is classified as a `Function` object.
1739
- *
1740
- * @static
1741
- * @memberOf _
1742
- * @since 0.1.0
1743
- * @category Lang
1744
- * @param {*} value The value to check.
1745
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1746
- * @example
1747
- *
1748
- * _.isFunction(_);
1749
- * // => true
1750
- *
1751
- * _.isFunction(/abc/);
1752
- * // => false
1753
- */
1754
- function isFunction(value) {
1755
- if (!isObject(value)) {
1756
- return false;
1757
- }
1758
- // The use of `Object#toString` avoids issues with the `typeof` operator
1759
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
1760
- var tag = baseGetTag(value);
1761
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1762
- }
1763
-
1764
- /**
1765
- * Checks if `value` is a valid array-like length.
1766
- *
1767
- * **Note:** This method is loosely based on
1768
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1769
- *
1770
- * @static
1771
- * @memberOf _
1772
- * @since 4.0.0
1773
- * @category Lang
1774
- * @param {*} value The value to check.
1775
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1776
- * @example
1777
- *
1778
- * _.isLength(3);
1779
- * // => true
1780
- *
1781
- * _.isLength(Number.MIN_VALUE);
1782
- * // => false
1783
- *
1784
- * _.isLength(Infinity);
1785
- * // => false
1786
- *
1787
- * _.isLength('3');
1788
- * // => false
1789
- */
1790
- function isLength(value) {
1791
- return typeof value == 'number' &&
1792
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1793
- }
1794
-
1795
- /**
1796
- * Checks if `value` is the
1797
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1798
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1799
- *
1800
- * @static
1801
- * @memberOf _
1802
- * @since 0.1.0
1803
- * @category Lang
1804
- * @param {*} value The value to check.
1805
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1806
- * @example
1807
- *
1808
- * _.isObject({});
1809
- * // => true
1810
- *
1811
- * _.isObject([1, 2, 3]);
1812
- * // => true
1813
- *
1814
- * _.isObject(_.noop);
1815
- * // => true
1816
- *
1817
- * _.isObject(null);
1818
- * // => false
1819
- */
1820
- function isObject(value) {
1821
- var type = typeof value;
1822
- return value != null && (type == 'object' || type == 'function');
1823
- }
1824
-
1825
- /**
1826
- * Checks if `value` is object-like. A value is object-like if it's not `null`
1827
- * and has a `typeof` result of "object".
1828
- *
1829
- * @static
1830
- * @memberOf _
1831
- * @since 4.0.0
1832
- * @category Lang
1833
- * @param {*} value The value to check.
1834
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1835
- * @example
1836
- *
1837
- * _.isObjectLike({});
1838
- * // => true
1839
- *
1840
- * _.isObjectLike([1, 2, 3]);
1841
- * // => true
1842
- *
1843
- * _.isObjectLike(_.noop);
1844
- * // => false
1845
- *
1846
- * _.isObjectLike(null);
1847
- * // => false
1848
- */
1849
- function isObjectLike(value) {
1850
- return value != null && typeof value == 'object';
1851
- }
1852
-
1853
- /**
1854
- * Checks if `value` is classified as a typed array.
1855
- *
1856
- * @static
1857
- * @memberOf _
1858
- * @since 3.0.0
1859
- * @category Lang
1860
- * @param {*} value The value to check.
1861
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1862
- * @example
1863
- *
1864
- * _.isTypedArray(new Uint8Array);
1865
- * // => true
1866
- *
1867
- * _.isTypedArray([]);
1868
- * // => false
1869
- */
1870
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1871
-
1872
- /**
1873
- * Creates an array of the own enumerable property names of `object`.
1874
- *
1875
- * **Note:** Non-object values are coerced to objects. See the
1876
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1877
- * for more details.
1878
- *
1879
- * @static
1880
- * @since 0.1.0
1881
- * @memberOf _
1882
- * @category Object
1883
- * @param {Object} object The object to query.
1884
- * @returns {Array} Returns the array of property names.
1885
- * @example
1886
- *
1887
- * function Foo() {
1888
- * this.a = 1;
1889
- * this.b = 2;
1890
- * }
1891
- *
1892
- * Foo.prototype.c = 3;
1893
- *
1894
- * _.keys(new Foo);
1895
- * // => ['a', 'b'] (iteration order is not guaranteed)
1896
- *
1897
- * _.keys('hi');
1898
- * // => ['0', '1']
1899
- */
1900
- function keys(object) {
1901
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1902
- }
1903
-
1904
- /**
1905
- * This method returns a new empty array.
1906
- *
1907
- * @static
1908
- * @memberOf _
1909
- * @since 4.13.0
1910
- * @category Util
1911
- * @returns {Array} Returns the new empty array.
1912
- * @example
1913
- *
1914
- * var arrays = _.times(2, _.stubArray);
1915
- *
1916
- * console.log(arrays);
1917
- * // => [[], []]
1918
- *
1919
- * console.log(arrays[0] === arrays[1]);
1920
- * // => false
1921
- */
1922
- function stubArray() {
1923
- return [];
1924
- }
1925
-
1926
- /**
1927
- * This method returns `false`.
1928
- *
1929
- * @static
1930
- * @memberOf _
1931
- * @since 4.13.0
1932
- * @category Util
1933
- * @returns {boolean} Returns `false`.
1934
- * @example
1935
- *
1936
- * _.times(2, _.stubFalse);
1937
- * // => [false, false]
1938
- */
1939
- function stubFalse() {
1940
- return false;
1941
- }
1942
-
1943
- module.exports = isEqual;
1944
- }(lodash_isequal, lodash_isequal.exports));
1945
-
1946
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
1947
- // require the crypto API and do not support built-in fallback to lower quality random number
1948
- // generators (like Math.random()).
1949
- var getRandomValues;
1950
- var rnds8 = new Uint8Array(16);
1951
- function rng() {
1952
- // lazy load so that environments that need to polyfill have a chance to do so
1953
- if (!getRandomValues) {
1954
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1955
- // find the complete implementation of crypto (msCrypto) on IE11.
1956
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
1957
-
1958
- if (!getRandomValues) {
1959
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1960
- }
1961
- }
1962
-
1963
- return getRandomValues(rnds8);
1964
- }
1965
-
1966
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
1967
-
1968
- function validate(uuid) {
1969
- return typeof uuid === 'string' && REGEX.test(uuid);
1970
- }
1971
-
1972
- /**
1973
- * Convert array of 16 byte values to UUID string format of the form:
1974
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1975
- */
1976
-
1977
- var byteToHex = [];
1978
-
1979
- for (var i = 0; i < 256; ++i) {
1980
- byteToHex.push((i + 0x100).toString(16).substr(1));
1981
- }
1982
-
1983
- function stringify(arr) {
1984
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1985
- // Note: Be careful editing this code! It's been tuned for performance
1986
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1987
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
1988
- // of the following:
1989
- // - One or more input array values don't map to a hex octet (leading to
1990
- // "undefined" in the uuid)
1991
- // - Invalid input values for the RFC `version` or `variant` fields
1992
-
1993
- if (!validate(uuid)) {
1994
- throw TypeError('Stringified UUID is invalid');
1995
- }
1996
-
1997
- return uuid;
1998
- }
1999
-
2000
- function v4(options, buf, offset) {
2001
- options = options || {};
2002
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
2003
-
2004
- rnds[6] = rnds[6] & 0x0f | 0x40;
2005
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
2006
-
2007
- if (buf) {
2008
- offset = offset || 0;
2009
-
2010
- for (var i = 0; i < 16; ++i) {
2011
- buf[offset + i] = rnds[i];
2012
- }
2013
-
2014
- return buf;
2015
- }
2016
-
2017
- return stringify(rnds);
2018
- }
2019
-
2020
- function create() {
2021
- return v4();
2022
- }
2023
- function fromMsbLsb(msb, lsb) {
2024
- function digits(val, ds) {
2025
- var hi = BigInt(1) << (ds * BigInt(4));
2026
- return (hi | (val & (hi - BigInt(1)))).toString(16).substring(1);
2027
- }
2028
- var msbB = typeof msb === 'string' ? BigInt(msb) : msb;
2029
- var lsbB = typeof lsb === 'string' ? BigInt(lsb) : lsb;
2030
- var sec1 = digits(msbB >> BigInt(32), BigInt(8));
2031
- var sec2 = digits(msbB >> BigInt(16), BigInt(4));
2032
- var sec3 = digits(msbB, BigInt(4));
2033
- var sec4 = digits(lsbB >> BigInt(48), BigInt(4));
2034
- var sec5 = digits(lsbB, BigInt(12));
2035
- return "".concat(sec1, "-").concat(sec2, "-").concat(sec3, "-").concat(sec4, "-").concat(sec5);
2036
- }
2037
- function toMsbLsb(id) {
2038
- var _a = __read(id.split('-'), 5), c1 = _a[0], c2 = _a[1], c3 = _a[2], c4 = _a[3], c5 = _a[4];
2039
- if (c1 == null || c2 == null || c3 == null || c4 == null || c5 == null) {
2040
- throw new Error("Invalid UUID string ".concat(id));
2041
- }
2042
- var msb = BigInt.asIntN(64, BigInt("0x".concat(c1 + c2 + c3)));
2043
- var lsb = BigInt.asIntN(64, BigInt("0x".concat(c4 + c5)));
2044
- return { msb: msb.toString(), lsb: lsb.toString() };
2045
- }
2046
-
2047
- var uuid = /*#__PURE__*/Object.freeze({
2048
- __proto__: null,
2049
- create: create,
2050
- fromMsbLsb: fromMsbLsb,
2051
- toMsbLsb: toMsbLsb
2052
- });
2053
-
2054
- const tooltipCss = ":host{--tooltip-width:auto;--tooltip-white-space:normal;display:flex}.popover{width:100%;height:100%}.target{display:flex;width:100%;height:100%}.content-hidden{display:none}.tooltip{display:flex;justify-content:center;text-align:center;width:var(--tooltip-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-xxs);background-color:var(--vertex-ui-neutral-700);color:var(--vertex-ui-white);padding:0.25rem 0.5rem;border-radius:4px;pointer-events:none;white-space:var(--tooltip-white-space);user-select:none}.tooltip.hidden{display:none}";
2055
-
2056
- const TOOLTIP_OPEN_DELAY = 500;
2057
- const Tooltip = class {
2058
- constructor(hostRef) {
2059
- registerInstance(this, hostRef);
2060
- this.pointerEntered = false;
2061
- this.content = undefined;
2062
- this.disabled = undefined;
2063
- this.placement = 'bottom';
2064
- this.delay = TOOLTIP_OPEN_DELAY;
2065
- this.animated = true;
2066
- this.open = false;
2067
- this.handlePointerEnter = this.handlePointerEnter.bind(this);
2068
- this.handlePointerLeave = this.handlePointerLeave.bind(this);
2069
- this.handleContentChange = this.handleContentChange.bind(this);
2070
- this.handleDisabledChange = this.handleDisabledChange.bind(this);
2071
- this.tooltipId = `vertex-tooltip-${uuid.create()}`;
2072
- }
2073
- disconnectedCallback() {
2074
- this.removeElement();
2075
- this.clearOpenTimeout();
2076
- this.pointerEntered = false;
2077
- }
2078
- handleContentChange() {
2079
- if (this.internalContentElement != null) {
2080
- this.updateContentElementChildren(this.internalContentElement);
2081
- }
2082
- }
2083
- handleDisabledChange() {
2084
- if (this.internalContentElement != null) {
2085
- this.updateContentElementClass(this.internalContentElement);
2086
- }
2087
- if (!this.disabled && this.pointerEntered) {
2088
- this.handlePointerEnter();
2089
- }
2090
- }
2091
- render() {
2092
- return (h(Host, null, h("div", { class: "target", ref: (el) => {
2093
- this.targetElement = el;
2094
- }, onPointerEnter: this.handlePointerEnter, onPointerLeave: this.handlePointerLeave }, h("slot", null)), h("div", { class: "content-hidden", ref: (el) => {
2095
- this.contentElement = el;
2096
- } }, h("slot", { name: "content", onSlotchange: this.handleContentChange }))));
2097
- }
2098
- addElement() {
2099
- if (this.targetElement != null) {
2100
- const popover = this.createPopoverElement(this.targetElement);
2101
- const content = this.createContentElement();
2102
- this.updateContentElementChildren(content);
2103
- popover.appendChild(content);
2104
- this.hostElement.ownerDocument.body.appendChild(popover);
2105
- }
2106
- }
2107
- removeElement() {
2108
- const popover = this.hostElement.ownerDocument.getElementById(this.tooltipId);
2109
- if (popover != null) {
2110
- popover.remove();
2111
- }
2112
- this.internalContentElement = undefined;
2113
- }
2114
- createPopoverElement(anchorElement) {
2115
- const popover = this.hostElement.ownerDocument.createElement('vertex-popover');
2116
- popover.id = this.tooltipId;
2117
- popover.setAttribute('class', 'vertex-tooltip-popover');
2118
- popover.open = this.open;
2119
- popover.resizeBehavior = 'fixed';
2120
- popover.backdrop = false;
2121
- popover.placement = this.placement;
2122
- popover.animated = this.animated;
2123
- popover.anchorBounds = getBoundingClientRect(anchorElement);
2124
- return popover;
2125
- }
2126
- createContentElement() {
2127
- this.internalContentElement =
2128
- this.hostElement.ownerDocument.createElement('div');
2129
- this.internalContentElement.setAttribute('class', classnames('vertex-tooltip-content', {
2130
- hidden: !this.open || this.disabled,
2131
- }));
2132
- return this.internalContentElement;
2133
- }
2134
- updateContentElementClass(element) {
2135
- element.setAttribute('class', classnames('vertex-tooltip-content', {
2136
- hidden: !this.open || this.disabled,
2137
- }));
2138
- }
2139
- updateContentElementChildren(element) {
2140
- var _a;
2141
- this.displayedSlottedContent =
2142
- (_a = getSlottedContent(this.contentElement)) !== null && _a !== void 0 ? _a : this.displayedSlottedContent;
2143
- if (this.content != null) {
2144
- element.innerText = this.content;
2145
- }
2146
- else if (this.displayedSlottedContent != null) {
2147
- element.appendChild(this.displayedSlottedContent);
2148
- }
2149
- }
2150
- handlePointerEnter() {
2151
- if (this.openTimeout == null && !this.disabled) {
2152
- this.createOpenTimeout();
2153
- }
2154
- else if (this.openTimeout == null) {
2155
- this.pointerEntered = true;
2156
- }
2157
- }
2158
- handlePointerLeave() {
2159
- this.clearOpenTimeout();
2160
- this.removeElement();
2161
- this.open = false;
2162
- this.pointerEntered = false;
2163
- }
2164
- createOpenTimeout() {
2165
- this.openTimeout = setTimeout(() => {
2166
- this.open = true;
2167
- this.openTimeout = undefined;
2168
- this.addElement();
2169
- }, this.delay);
2170
- this.pointerEntered = false;
2171
- }
2172
- clearOpenTimeout() {
2173
- if (this.openTimeout != null) {
2174
- clearTimeout(this.openTimeout);
2175
- this.openTimeout = undefined;
2176
- }
2177
- }
2178
- get hostElement() { return getElement(this); }
2179
- static get watchers() { return {
2180
- "content": ["handleContentChange"],
2181
- "disabled": ["handleDisabledChange"]
2182
- }; }
2183
- };
2184
- Tooltip.style = tooltipCss;
2185
-
2186
- export { Tooltip as T };