@canton-network/core-token-standard 1.10.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import createClient from 'openapi-fetch';
2
2
  import * as jsonTypeValidation from '@mojotech/json-type-validation';
3
- import * as types from '@daml/types';
3
+ import * as lodash from 'lodash';
4
4
 
5
5
  // Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
6
6
  // SPDX-License-Identifier: Apache-2.0
@@ -69,6 +69,8 @@ const MERGE_DELEGATION_PROPOSAL_TEMPLATE_ID = '#splice-util-token-standard-walle
69
69
  const MERGE_DELEGATION_TEMPLATE_ID = '#splice-util-token-standard-wallet:Splice.Util.Token.Wallet.MergeDelegation:MergeDelegation';
70
70
  const MERGE_DELEGATION_BATCH_MERGE_UTILITY = '#splice-util-token-standard-wallet:Splice.Util.Token.Wallet.MergeDelegation:BatchMergeUtility';
71
71
 
72
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
73
+
72
74
  function getAugmentedNamespace(n) {
73
75
  if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
74
76
  var f = n.default;
@@ -110,9 +112,3112 @@ var AllocationInstructionV1$1 = {};
110
112
 
111
113
  var module$8 = {};
112
114
 
113
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(jsonTypeValidation);
115
+ var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(jsonTypeValidation);
116
+
117
+ var types = {};
118
+
119
+ var lodash_isequal = {exports: {}};
120
+
121
+ /**
122
+ * Lodash (Custom Build) <https://lodash.com/>
123
+ * Build: `lodash modularize exports="npm" -o ./`
124
+ * Copyright JS Foundation and other contributors <https://js.foundation/>
125
+ * Released under MIT license <https://lodash.com/license>
126
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
127
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
128
+ */
129
+ lodash_isequal.exports;
130
+
131
+ var hasRequiredLodash_isequal;
132
+
133
+ function requireLodash_isequal () {
134
+ if (hasRequiredLodash_isequal) return lodash_isequal.exports;
135
+ hasRequiredLodash_isequal = 1;
136
+ (function (module, exports) {
137
+ /** Used as the size to enable large array optimizations. */
138
+ var LARGE_ARRAY_SIZE = 200;
139
+
140
+ /** Used to stand-in for `undefined` hash values. */
141
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
142
+
143
+ /** Used to compose bitmasks for value comparisons. */
144
+ var COMPARE_PARTIAL_FLAG = 1,
145
+ COMPARE_UNORDERED_FLAG = 2;
146
+
147
+ /** Used as references for various `Number` constants. */
148
+ var MAX_SAFE_INTEGER = 9007199254740991;
149
+
150
+ /** `Object#toString` result references. */
151
+ var argsTag = '[object Arguments]',
152
+ arrayTag = '[object Array]',
153
+ asyncTag = '[object AsyncFunction]',
154
+ boolTag = '[object Boolean]',
155
+ dateTag = '[object Date]',
156
+ errorTag = '[object Error]',
157
+ funcTag = '[object Function]',
158
+ genTag = '[object GeneratorFunction]',
159
+ mapTag = '[object Map]',
160
+ numberTag = '[object Number]',
161
+ nullTag = '[object Null]',
162
+ objectTag = '[object Object]',
163
+ promiseTag = '[object Promise]',
164
+ proxyTag = '[object Proxy]',
165
+ regexpTag = '[object RegExp]',
166
+ setTag = '[object Set]',
167
+ stringTag = '[object String]',
168
+ symbolTag = '[object Symbol]',
169
+ undefinedTag = '[object Undefined]',
170
+ weakMapTag = '[object WeakMap]';
171
+
172
+ var arrayBufferTag = '[object ArrayBuffer]',
173
+ dataViewTag = '[object DataView]',
174
+ float32Tag = '[object Float32Array]',
175
+ float64Tag = '[object Float64Array]',
176
+ int8Tag = '[object Int8Array]',
177
+ int16Tag = '[object Int16Array]',
178
+ int32Tag = '[object Int32Array]',
179
+ uint8Tag = '[object Uint8Array]',
180
+ uint8ClampedTag = '[object Uint8ClampedArray]',
181
+ uint16Tag = '[object Uint16Array]',
182
+ uint32Tag = '[object Uint32Array]';
183
+
184
+ /**
185
+ * Used to match `RegExp`
186
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
187
+ */
188
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
189
+
190
+ /** Used to detect host constructors (Safari). */
191
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
192
+
193
+ /** Used to detect unsigned integer values. */
194
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
195
+
196
+ /** Used to identify `toStringTag` values of typed arrays. */
197
+ var typedArrayTags = {};
198
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
199
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
200
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
201
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
202
+ typedArrayTags[uint32Tag] = true;
203
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
204
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
205
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
206
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
207
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
208
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
209
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
210
+ typedArrayTags[weakMapTag] = false;
211
+
212
+ /** Detect free variable `global` from Node.js. */
213
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
214
+
215
+ /** Detect free variable `self`. */
216
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
217
+
218
+ /** Used as a reference to the global object. */
219
+ var root = freeGlobal || freeSelf || Function('return this')();
220
+
221
+ /** Detect free variable `exports`. */
222
+ var freeExports = exports && !exports.nodeType && exports;
223
+
224
+ /** Detect free variable `module`. */
225
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
226
+
227
+ /** Detect the popular CommonJS extension `module.exports`. */
228
+ var moduleExports = freeModule && freeModule.exports === freeExports;
229
+
230
+ /** Detect free variable `process` from Node.js. */
231
+ var freeProcess = moduleExports && freeGlobal.process;
232
+
233
+ /** Used to access faster Node.js helpers. */
234
+ var nodeUtil = (function() {
235
+ try {
236
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
237
+ } catch (e) {}
238
+ }());
239
+
240
+ /* Node.js helper references. */
241
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
242
+
243
+ /**
244
+ * A specialized version of `_.filter` for arrays without support for
245
+ * iteratee shorthands.
246
+ *
247
+ * @private
248
+ * @param {Array} [array] The array to iterate over.
249
+ * @param {Function} predicate The function invoked per iteration.
250
+ * @returns {Array} Returns the new filtered array.
251
+ */
252
+ function arrayFilter(array, predicate) {
253
+ var index = -1,
254
+ length = array == null ? 0 : array.length,
255
+ resIndex = 0,
256
+ result = [];
257
+
258
+ while (++index < length) {
259
+ var value = array[index];
260
+ if (predicate(value, index, array)) {
261
+ result[resIndex++] = value;
262
+ }
263
+ }
264
+ return result;
265
+ }
266
+
267
+ /**
268
+ * Appends the elements of `values` to `array`.
269
+ *
270
+ * @private
271
+ * @param {Array} array The array to modify.
272
+ * @param {Array} values The values to append.
273
+ * @returns {Array} Returns `array`.
274
+ */
275
+ function arrayPush(array, values) {
276
+ var index = -1,
277
+ length = values.length,
278
+ offset = array.length;
279
+
280
+ while (++index < length) {
281
+ array[offset + index] = values[index];
282
+ }
283
+ return array;
284
+ }
285
+
286
+ /**
287
+ * A specialized version of `_.some` for arrays without support for iteratee
288
+ * shorthands.
289
+ *
290
+ * @private
291
+ * @param {Array} [array] The array to iterate over.
292
+ * @param {Function} predicate The function invoked per iteration.
293
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
294
+ * else `false`.
295
+ */
296
+ function arraySome(array, predicate) {
297
+ var index = -1,
298
+ length = array == null ? 0 : array.length;
299
+
300
+ while (++index < length) {
301
+ if (predicate(array[index], index, array)) {
302
+ return true;
303
+ }
304
+ }
305
+ return false;
306
+ }
307
+
308
+ /**
309
+ * The base implementation of `_.times` without support for iteratee shorthands
310
+ * or max array length checks.
311
+ *
312
+ * @private
313
+ * @param {number} n The number of times to invoke `iteratee`.
314
+ * @param {Function} iteratee The function invoked per iteration.
315
+ * @returns {Array} Returns the array of results.
316
+ */
317
+ function baseTimes(n, iteratee) {
318
+ var index = -1,
319
+ result = Array(n);
320
+
321
+ while (++index < n) {
322
+ result[index] = iteratee(index);
323
+ }
324
+ return result;
325
+ }
326
+
327
+ /**
328
+ * The base implementation of `_.unary` without support for storing metadata.
329
+ *
330
+ * @private
331
+ * @param {Function} func The function to cap arguments for.
332
+ * @returns {Function} Returns the new capped function.
333
+ */
334
+ function baseUnary(func) {
335
+ return function(value) {
336
+ return func(value);
337
+ };
338
+ }
339
+
340
+ /**
341
+ * Checks if a `cache` value for `key` exists.
342
+ *
343
+ * @private
344
+ * @param {Object} cache The cache to query.
345
+ * @param {string} key The key of the entry to check.
346
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
347
+ */
348
+ function cacheHas(cache, key) {
349
+ return cache.has(key);
350
+ }
351
+
352
+ /**
353
+ * Gets the value at `key` of `object`.
354
+ *
355
+ * @private
356
+ * @param {Object} [object] The object to query.
357
+ * @param {string} key The key of the property to get.
358
+ * @returns {*} Returns the property value.
359
+ */
360
+ function getValue(object, key) {
361
+ return object == null ? undefined : object[key];
362
+ }
363
+
364
+ /**
365
+ * Converts `map` to its key-value pairs.
366
+ *
367
+ * @private
368
+ * @param {Object} map The map to convert.
369
+ * @returns {Array} Returns the key-value pairs.
370
+ */
371
+ function mapToArray(map) {
372
+ var index = -1,
373
+ result = Array(map.size);
374
+
375
+ map.forEach(function(value, key) {
376
+ result[++index] = [key, value];
377
+ });
378
+ return result;
379
+ }
380
+
381
+ /**
382
+ * Creates a unary function that invokes `func` with its argument transformed.
383
+ *
384
+ * @private
385
+ * @param {Function} func The function to wrap.
386
+ * @param {Function} transform The argument transform.
387
+ * @returns {Function} Returns the new function.
388
+ */
389
+ function overArg(func, transform) {
390
+ return function(arg) {
391
+ return func(transform(arg));
392
+ };
393
+ }
394
+
395
+ /**
396
+ * Converts `set` to an array of its values.
397
+ *
398
+ * @private
399
+ * @param {Object} set The set to convert.
400
+ * @returns {Array} Returns the values.
401
+ */
402
+ function setToArray(set) {
403
+ var index = -1,
404
+ result = Array(set.size);
405
+
406
+ set.forEach(function(value) {
407
+ result[++index] = value;
408
+ });
409
+ return result;
410
+ }
411
+
412
+ /** Used for built-in method references. */
413
+ var arrayProto = Array.prototype,
414
+ funcProto = Function.prototype,
415
+ objectProto = Object.prototype;
416
+
417
+ /** Used to detect overreaching core-js shims. */
418
+ var coreJsData = root['__core-js_shared__'];
419
+
420
+ /** Used to resolve the decompiled source of functions. */
421
+ var funcToString = funcProto.toString;
422
+
423
+ /** Used to check objects for own properties. */
424
+ var hasOwnProperty = objectProto.hasOwnProperty;
425
+
426
+ /** Used to detect methods masquerading as native. */
427
+ var maskSrcKey = (function() {
428
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
429
+ return uid ? ('Symbol(src)_1.' + uid) : '';
430
+ }());
431
+
432
+ /**
433
+ * Used to resolve the
434
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
435
+ * of values.
436
+ */
437
+ var nativeObjectToString = objectProto.toString;
438
+
439
+ /** Used to detect if a method is native. */
440
+ var reIsNative = RegExp('^' +
441
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
442
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
443
+ );
444
+
445
+ /** Built-in value references. */
446
+ var Buffer = moduleExports ? root.Buffer : undefined,
447
+ Symbol = root.Symbol,
448
+ Uint8Array = root.Uint8Array,
449
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
450
+ splice = arrayProto.splice,
451
+ symToStringTag = Symbol ? Symbol.toStringTag : undefined;
452
+
453
+ /* Built-in method references for those with the same name as other `lodash` methods. */
454
+ var nativeGetSymbols = Object.getOwnPropertySymbols,
455
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
456
+ nativeKeys = overArg(Object.keys, Object);
457
+
458
+ /* Built-in method references that are verified to be native. */
459
+ var DataView = getNative(root, 'DataView'),
460
+ Map = getNative(root, 'Map'),
461
+ Promise = getNative(root, 'Promise'),
462
+ Set = getNative(root, 'Set'),
463
+ WeakMap = getNative(root, 'WeakMap'),
464
+ nativeCreate = getNative(Object, 'create');
465
+
466
+ /** Used to detect maps, sets, and weakmaps. */
467
+ var dataViewCtorString = toSource(DataView),
468
+ mapCtorString = toSource(Map),
469
+ promiseCtorString = toSource(Promise),
470
+ setCtorString = toSource(Set),
471
+ weakMapCtorString = toSource(WeakMap);
472
+
473
+ /** Used to convert symbols to primitives and strings. */
474
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
475
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
476
+
477
+ /**
478
+ * Creates a hash object.
479
+ *
480
+ * @private
481
+ * @constructor
482
+ * @param {Array} [entries] The key-value pairs to cache.
483
+ */
484
+ function Hash(entries) {
485
+ var index = -1,
486
+ length = entries == null ? 0 : entries.length;
487
+
488
+ this.clear();
489
+ while (++index < length) {
490
+ var entry = entries[index];
491
+ this.set(entry[0], entry[1]);
492
+ }
493
+ }
494
+
495
+ /**
496
+ * Removes all key-value entries from the hash.
497
+ *
498
+ * @private
499
+ * @name clear
500
+ * @memberOf Hash
501
+ */
502
+ function hashClear() {
503
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
504
+ this.size = 0;
505
+ }
506
+
507
+ /**
508
+ * Removes `key` and its value from the hash.
509
+ *
510
+ * @private
511
+ * @name delete
512
+ * @memberOf Hash
513
+ * @param {Object} hash The hash to modify.
514
+ * @param {string} key The key of the value to remove.
515
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
516
+ */
517
+ function hashDelete(key) {
518
+ var result = this.has(key) && delete this.__data__[key];
519
+ this.size -= result ? 1 : 0;
520
+ return result;
521
+ }
522
+
523
+ /**
524
+ * Gets the hash value for `key`.
525
+ *
526
+ * @private
527
+ * @name get
528
+ * @memberOf Hash
529
+ * @param {string} key The key of the value to get.
530
+ * @returns {*} Returns the entry value.
531
+ */
532
+ function hashGet(key) {
533
+ var data = this.__data__;
534
+ if (nativeCreate) {
535
+ var result = data[key];
536
+ return result === HASH_UNDEFINED ? undefined : result;
537
+ }
538
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
539
+ }
540
+
541
+ /**
542
+ * Checks if a hash value for `key` exists.
543
+ *
544
+ * @private
545
+ * @name has
546
+ * @memberOf Hash
547
+ * @param {string} key The key of the entry to check.
548
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
549
+ */
550
+ function hashHas(key) {
551
+ var data = this.__data__;
552
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
553
+ }
554
+
555
+ /**
556
+ * Sets the hash `key` to `value`.
557
+ *
558
+ * @private
559
+ * @name set
560
+ * @memberOf Hash
561
+ * @param {string} key The key of the value to set.
562
+ * @param {*} value The value to set.
563
+ * @returns {Object} Returns the hash instance.
564
+ */
565
+ function hashSet(key, value) {
566
+ var data = this.__data__;
567
+ this.size += this.has(key) ? 0 : 1;
568
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
569
+ return this;
570
+ }
571
+
572
+ // Add methods to `Hash`.
573
+ Hash.prototype.clear = hashClear;
574
+ Hash.prototype['delete'] = hashDelete;
575
+ Hash.prototype.get = hashGet;
576
+ Hash.prototype.has = hashHas;
577
+ Hash.prototype.set = hashSet;
578
+
579
+ /**
580
+ * Creates an list cache object.
581
+ *
582
+ * @private
583
+ * @constructor
584
+ * @param {Array} [entries] The key-value pairs to cache.
585
+ */
586
+ function ListCache(entries) {
587
+ var index = -1,
588
+ length = entries == null ? 0 : entries.length;
589
+
590
+ this.clear();
591
+ while (++index < length) {
592
+ var entry = entries[index];
593
+ this.set(entry[0], entry[1]);
594
+ }
595
+ }
596
+
597
+ /**
598
+ * Removes all key-value entries from the list cache.
599
+ *
600
+ * @private
601
+ * @name clear
602
+ * @memberOf ListCache
603
+ */
604
+ function listCacheClear() {
605
+ this.__data__ = [];
606
+ this.size = 0;
607
+ }
608
+
609
+ /**
610
+ * Removes `key` and its value from the list cache.
611
+ *
612
+ * @private
613
+ * @name delete
614
+ * @memberOf ListCache
615
+ * @param {string} key The key of the value to remove.
616
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
617
+ */
618
+ function listCacheDelete(key) {
619
+ var data = this.__data__,
620
+ index = assocIndexOf(data, key);
621
+
622
+ if (index < 0) {
623
+ return false;
624
+ }
625
+ var lastIndex = data.length - 1;
626
+ if (index == lastIndex) {
627
+ data.pop();
628
+ } else {
629
+ splice.call(data, index, 1);
630
+ }
631
+ --this.size;
632
+ return true;
633
+ }
634
+
635
+ /**
636
+ * Gets the list cache value for `key`.
637
+ *
638
+ * @private
639
+ * @name get
640
+ * @memberOf ListCache
641
+ * @param {string} key The key of the value to get.
642
+ * @returns {*} Returns the entry value.
643
+ */
644
+ function listCacheGet(key) {
645
+ var data = this.__data__,
646
+ index = assocIndexOf(data, key);
647
+
648
+ return index < 0 ? undefined : data[index][1];
649
+ }
650
+
651
+ /**
652
+ * Checks if a list cache value for `key` exists.
653
+ *
654
+ * @private
655
+ * @name has
656
+ * @memberOf ListCache
657
+ * @param {string} key The key of the entry to check.
658
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
659
+ */
660
+ function listCacheHas(key) {
661
+ return assocIndexOf(this.__data__, key) > -1;
662
+ }
663
+
664
+ /**
665
+ * Sets the list cache `key` to `value`.
666
+ *
667
+ * @private
668
+ * @name set
669
+ * @memberOf ListCache
670
+ * @param {string} key The key of the value to set.
671
+ * @param {*} value The value to set.
672
+ * @returns {Object} Returns the list cache instance.
673
+ */
674
+ function listCacheSet(key, value) {
675
+ var data = this.__data__,
676
+ index = assocIndexOf(data, key);
677
+
678
+ if (index < 0) {
679
+ ++this.size;
680
+ data.push([key, value]);
681
+ } else {
682
+ data[index][1] = value;
683
+ }
684
+ return this;
685
+ }
686
+
687
+ // Add methods to `ListCache`.
688
+ ListCache.prototype.clear = listCacheClear;
689
+ ListCache.prototype['delete'] = listCacheDelete;
690
+ ListCache.prototype.get = listCacheGet;
691
+ ListCache.prototype.has = listCacheHas;
692
+ ListCache.prototype.set = listCacheSet;
693
+
694
+ /**
695
+ * Creates a map cache object to store key-value pairs.
696
+ *
697
+ * @private
698
+ * @constructor
699
+ * @param {Array} [entries] The key-value pairs to cache.
700
+ */
701
+ function MapCache(entries) {
702
+ var index = -1,
703
+ length = entries == null ? 0 : entries.length;
704
+
705
+ this.clear();
706
+ while (++index < length) {
707
+ var entry = entries[index];
708
+ this.set(entry[0], entry[1]);
709
+ }
710
+ }
711
+
712
+ /**
713
+ * Removes all key-value entries from the map.
714
+ *
715
+ * @private
716
+ * @name clear
717
+ * @memberOf MapCache
718
+ */
719
+ function mapCacheClear() {
720
+ this.size = 0;
721
+ this.__data__ = {
722
+ 'hash': new Hash,
723
+ 'map': new (Map || ListCache),
724
+ 'string': new Hash
725
+ };
726
+ }
727
+
728
+ /**
729
+ * Removes `key` and its value from the map.
730
+ *
731
+ * @private
732
+ * @name delete
733
+ * @memberOf MapCache
734
+ * @param {string} key The key of the value to remove.
735
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
736
+ */
737
+ function mapCacheDelete(key) {
738
+ var result = getMapData(this, key)['delete'](key);
739
+ this.size -= result ? 1 : 0;
740
+ return result;
741
+ }
742
+
743
+ /**
744
+ * Gets the map value for `key`.
745
+ *
746
+ * @private
747
+ * @name get
748
+ * @memberOf MapCache
749
+ * @param {string} key The key of the value to get.
750
+ * @returns {*} Returns the entry value.
751
+ */
752
+ function mapCacheGet(key) {
753
+ return getMapData(this, key).get(key);
754
+ }
755
+
756
+ /**
757
+ * Checks if a map value for `key` exists.
758
+ *
759
+ * @private
760
+ * @name has
761
+ * @memberOf MapCache
762
+ * @param {string} key The key of the entry to check.
763
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
764
+ */
765
+ function mapCacheHas(key) {
766
+ return getMapData(this, key).has(key);
767
+ }
768
+
769
+ /**
770
+ * Sets the map `key` to `value`.
771
+ *
772
+ * @private
773
+ * @name set
774
+ * @memberOf MapCache
775
+ * @param {string} key The key of the value to set.
776
+ * @param {*} value The value to set.
777
+ * @returns {Object} Returns the map cache instance.
778
+ */
779
+ function mapCacheSet(key, value) {
780
+ var data = getMapData(this, key),
781
+ size = data.size;
782
+
783
+ data.set(key, value);
784
+ this.size += data.size == size ? 0 : 1;
785
+ return this;
786
+ }
787
+
788
+ // Add methods to `MapCache`.
789
+ MapCache.prototype.clear = mapCacheClear;
790
+ MapCache.prototype['delete'] = mapCacheDelete;
791
+ MapCache.prototype.get = mapCacheGet;
792
+ MapCache.prototype.has = mapCacheHas;
793
+ MapCache.prototype.set = mapCacheSet;
794
+
795
+ /**
796
+ *
797
+ * Creates an array cache object to store unique values.
798
+ *
799
+ * @private
800
+ * @constructor
801
+ * @param {Array} [values] The values to cache.
802
+ */
803
+ function SetCache(values) {
804
+ var index = -1,
805
+ length = values == null ? 0 : values.length;
806
+
807
+ this.__data__ = new MapCache;
808
+ while (++index < length) {
809
+ this.add(values[index]);
810
+ }
811
+ }
812
+
813
+ /**
814
+ * Adds `value` to the array cache.
815
+ *
816
+ * @private
817
+ * @name add
818
+ * @memberOf SetCache
819
+ * @alias push
820
+ * @param {*} value The value to cache.
821
+ * @returns {Object} Returns the cache instance.
822
+ */
823
+ function setCacheAdd(value) {
824
+ this.__data__.set(value, HASH_UNDEFINED);
825
+ return this;
826
+ }
827
+
828
+ /**
829
+ * Checks if `value` is in the array cache.
830
+ *
831
+ * @private
832
+ * @name has
833
+ * @memberOf SetCache
834
+ * @param {*} value The value to search for.
835
+ * @returns {number} Returns `true` if `value` is found, else `false`.
836
+ */
837
+ function setCacheHas(value) {
838
+ return this.__data__.has(value);
839
+ }
840
+
841
+ // Add methods to `SetCache`.
842
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
843
+ SetCache.prototype.has = setCacheHas;
844
+
845
+ /**
846
+ * Creates a stack cache object to store key-value pairs.
847
+ *
848
+ * @private
849
+ * @constructor
850
+ * @param {Array} [entries] The key-value pairs to cache.
851
+ */
852
+ function Stack(entries) {
853
+ var data = this.__data__ = new ListCache(entries);
854
+ this.size = data.size;
855
+ }
856
+
857
+ /**
858
+ * Removes all key-value entries from the stack.
859
+ *
860
+ * @private
861
+ * @name clear
862
+ * @memberOf Stack
863
+ */
864
+ function stackClear() {
865
+ this.__data__ = new ListCache;
866
+ this.size = 0;
867
+ }
868
+
869
+ /**
870
+ * Removes `key` and its value from the stack.
871
+ *
872
+ * @private
873
+ * @name delete
874
+ * @memberOf Stack
875
+ * @param {string} key The key of the value to remove.
876
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
877
+ */
878
+ function stackDelete(key) {
879
+ var data = this.__data__,
880
+ result = data['delete'](key);
881
+
882
+ this.size = data.size;
883
+ return result;
884
+ }
885
+
886
+ /**
887
+ * Gets the stack value for `key`.
888
+ *
889
+ * @private
890
+ * @name get
891
+ * @memberOf Stack
892
+ * @param {string} key The key of the value to get.
893
+ * @returns {*} Returns the entry value.
894
+ */
895
+ function stackGet(key) {
896
+ return this.__data__.get(key);
897
+ }
898
+
899
+ /**
900
+ * Checks if a stack value for `key` exists.
901
+ *
902
+ * @private
903
+ * @name has
904
+ * @memberOf Stack
905
+ * @param {string} key The key of the entry to check.
906
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
907
+ */
908
+ function stackHas(key) {
909
+ return this.__data__.has(key);
910
+ }
911
+
912
+ /**
913
+ * Sets the stack `key` to `value`.
914
+ *
915
+ * @private
916
+ * @name set
917
+ * @memberOf Stack
918
+ * @param {string} key The key of the value to set.
919
+ * @param {*} value The value to set.
920
+ * @returns {Object} Returns the stack cache instance.
921
+ */
922
+ function stackSet(key, value) {
923
+ var data = this.__data__;
924
+ if (data instanceof ListCache) {
925
+ var pairs = data.__data__;
926
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
927
+ pairs.push([key, value]);
928
+ this.size = ++data.size;
929
+ return this;
930
+ }
931
+ data = this.__data__ = new MapCache(pairs);
932
+ }
933
+ data.set(key, value);
934
+ this.size = data.size;
935
+ return this;
936
+ }
937
+
938
+ // Add methods to `Stack`.
939
+ Stack.prototype.clear = stackClear;
940
+ Stack.prototype['delete'] = stackDelete;
941
+ Stack.prototype.get = stackGet;
942
+ Stack.prototype.has = stackHas;
943
+ Stack.prototype.set = stackSet;
944
+
945
+ /**
946
+ * Creates an array of the enumerable property names of the array-like `value`.
947
+ *
948
+ * @private
949
+ * @param {*} value The value to query.
950
+ * @param {boolean} inherited Specify returning inherited property names.
951
+ * @returns {Array} Returns the array of property names.
952
+ */
953
+ function arrayLikeKeys(value, inherited) {
954
+ var isArr = isArray(value),
955
+ isArg = !isArr && isArguments(value),
956
+ isBuff = !isArr && !isArg && isBuffer(value),
957
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
958
+ skipIndexes = isArr || isArg || isBuff || isType,
959
+ result = skipIndexes ? baseTimes(value.length, String) : [],
960
+ length = result.length;
961
+
962
+ for (var key in value) {
963
+ if ((hasOwnProperty.call(value, key)) &&
964
+ !(skipIndexes && (
965
+ // Safari 9 has enumerable `arguments.length` in strict mode.
966
+ key == 'length' ||
967
+ // Node.js 0.10 has enumerable non-index properties on buffers.
968
+ (isBuff && (key == 'offset' || key == 'parent')) ||
969
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
970
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
971
+ // Skip index properties.
972
+ isIndex(key, length)
973
+ ))) {
974
+ result.push(key);
975
+ }
976
+ }
977
+ return result;
978
+ }
114
979
 
115
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(types);
980
+ /**
981
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
982
+ *
983
+ * @private
984
+ * @param {Array} array The array to inspect.
985
+ * @param {*} key The key to search for.
986
+ * @returns {number} Returns the index of the matched value, else `-1`.
987
+ */
988
+ function assocIndexOf(array, key) {
989
+ var length = array.length;
990
+ while (length--) {
991
+ if (eq(array[length][0], key)) {
992
+ return length;
993
+ }
994
+ }
995
+ return -1;
996
+ }
997
+
998
+ /**
999
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1000
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1001
+ * symbols of `object`.
1002
+ *
1003
+ * @private
1004
+ * @param {Object} object The object to query.
1005
+ * @param {Function} keysFunc The function to get the keys of `object`.
1006
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1007
+ * @returns {Array} Returns the array of property names and symbols.
1008
+ */
1009
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1010
+ var result = keysFunc(object);
1011
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1012
+ }
1013
+
1014
+ /**
1015
+ * The base implementation of `getTag` without fallbacks for buggy environments.
1016
+ *
1017
+ * @private
1018
+ * @param {*} value The value to query.
1019
+ * @returns {string} Returns the `toStringTag`.
1020
+ */
1021
+ function baseGetTag(value) {
1022
+ if (value == null) {
1023
+ return value === undefined ? undefinedTag : nullTag;
1024
+ }
1025
+ return (symToStringTag && symToStringTag in Object(value))
1026
+ ? getRawTag(value)
1027
+ : objectToString(value);
1028
+ }
1029
+
1030
+ /**
1031
+ * The base implementation of `_.isArguments`.
1032
+ *
1033
+ * @private
1034
+ * @param {*} value The value to check.
1035
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1036
+ */
1037
+ function baseIsArguments(value) {
1038
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1039
+ }
1040
+
1041
+ /**
1042
+ * The base implementation of `_.isEqual` which supports partial comparisons
1043
+ * and tracks traversed objects.
1044
+ *
1045
+ * @private
1046
+ * @param {*} value The value to compare.
1047
+ * @param {*} other The other value to compare.
1048
+ * @param {boolean} bitmask The bitmask flags.
1049
+ * 1 - Unordered comparison
1050
+ * 2 - Partial comparison
1051
+ * @param {Function} [customizer] The function to customize comparisons.
1052
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
1053
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1054
+ */
1055
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
1056
+ if (value === other) {
1057
+ return true;
1058
+ }
1059
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
1060
+ return value !== value && other !== other;
1061
+ }
1062
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1063
+ }
1064
+
1065
+ /**
1066
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
1067
+ * deep comparisons and tracks traversed objects enabling objects with circular
1068
+ * references to be compared.
1069
+ *
1070
+ * @private
1071
+ * @param {Object} object The object to compare.
1072
+ * @param {Object} other The other object to compare.
1073
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1074
+ * @param {Function} customizer The function to customize comparisons.
1075
+ * @param {Function} equalFunc The function to determine equivalents of values.
1076
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
1077
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1078
+ */
1079
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1080
+ var objIsArr = isArray(object),
1081
+ othIsArr = isArray(other),
1082
+ objTag = objIsArr ? arrayTag : getTag(object),
1083
+ othTag = othIsArr ? arrayTag : getTag(other);
1084
+
1085
+ objTag = objTag == argsTag ? objectTag : objTag;
1086
+ othTag = othTag == argsTag ? objectTag : othTag;
1087
+
1088
+ var objIsObj = objTag == objectTag,
1089
+ othIsObj = othTag == objectTag,
1090
+ isSameTag = objTag == othTag;
1091
+
1092
+ if (isSameTag && isBuffer(object)) {
1093
+ if (!isBuffer(other)) {
1094
+ return false;
1095
+ }
1096
+ objIsArr = true;
1097
+ objIsObj = false;
1098
+ }
1099
+ if (isSameTag && !objIsObj) {
1100
+ stack || (stack = new Stack);
1101
+ return (objIsArr || isTypedArray(object))
1102
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
1103
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1104
+ }
1105
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1106
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
1107
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
1108
+
1109
+ if (objIsWrapped || othIsWrapped) {
1110
+ var objUnwrapped = objIsWrapped ? object.value() : object,
1111
+ othUnwrapped = othIsWrapped ? other.value() : other;
1112
+
1113
+ stack || (stack = new Stack);
1114
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1115
+ }
1116
+ }
1117
+ if (!isSameTag) {
1118
+ return false;
1119
+ }
1120
+ stack || (stack = new Stack);
1121
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1122
+ }
1123
+
1124
+ /**
1125
+ * The base implementation of `_.isNative` without bad shim checks.
1126
+ *
1127
+ * @private
1128
+ * @param {*} value The value to check.
1129
+ * @returns {boolean} Returns `true` if `value` is a native function,
1130
+ * else `false`.
1131
+ */
1132
+ function baseIsNative(value) {
1133
+ if (!isObject(value) || isMasked(value)) {
1134
+ return false;
1135
+ }
1136
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1137
+ return pattern.test(toSource(value));
1138
+ }
1139
+
1140
+ /**
1141
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1142
+ *
1143
+ * @private
1144
+ * @param {*} value The value to check.
1145
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1146
+ */
1147
+ function baseIsTypedArray(value) {
1148
+ return isObjectLike(value) &&
1149
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1150
+ }
1151
+
1152
+ /**
1153
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1154
+ *
1155
+ * @private
1156
+ * @param {Object} object The object to query.
1157
+ * @returns {Array} Returns the array of property names.
1158
+ */
1159
+ function baseKeys(object) {
1160
+ if (!isPrototype(object)) {
1161
+ return nativeKeys(object);
1162
+ }
1163
+ var result = [];
1164
+ for (var key in Object(object)) {
1165
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
1166
+ result.push(key);
1167
+ }
1168
+ }
1169
+ return result;
1170
+ }
1171
+
1172
+ /**
1173
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1174
+ * partial deep comparisons.
1175
+ *
1176
+ * @private
1177
+ * @param {Array} array The array to compare.
1178
+ * @param {Array} other The other array to compare.
1179
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1180
+ * @param {Function} customizer The function to customize comparisons.
1181
+ * @param {Function} equalFunc The function to determine equivalents of values.
1182
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1183
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1184
+ */
1185
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1186
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1187
+ arrLength = array.length,
1188
+ othLength = other.length;
1189
+
1190
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1191
+ return false;
1192
+ }
1193
+ // Assume cyclic values are equal.
1194
+ var stacked = stack.get(array);
1195
+ if (stacked && stack.get(other)) {
1196
+ return stacked == other;
1197
+ }
1198
+ var index = -1,
1199
+ result = true,
1200
+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
1201
+
1202
+ stack.set(array, other);
1203
+ stack.set(other, array);
1204
+
1205
+ // Ignore non-index properties.
1206
+ while (++index < arrLength) {
1207
+ var arrValue = array[index],
1208
+ othValue = other[index];
1209
+
1210
+ if (customizer) {
1211
+ var compared = isPartial
1212
+ ? customizer(othValue, arrValue, index, other, array, stack)
1213
+ : customizer(arrValue, othValue, index, array, other, stack);
1214
+ }
1215
+ if (compared !== undefined) {
1216
+ if (compared) {
1217
+ continue;
1218
+ }
1219
+ result = false;
1220
+ break;
1221
+ }
1222
+ // Recursively compare arrays (susceptible to call stack limits).
1223
+ if (seen) {
1224
+ if (!arraySome(other, function(othValue, othIndex) {
1225
+ if (!cacheHas(seen, othIndex) &&
1226
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1227
+ return seen.push(othIndex);
1228
+ }
1229
+ })) {
1230
+ result = false;
1231
+ break;
1232
+ }
1233
+ } else if (!(
1234
+ arrValue === othValue ||
1235
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1236
+ )) {
1237
+ result = false;
1238
+ break;
1239
+ }
1240
+ }
1241
+ stack['delete'](array);
1242
+ stack['delete'](other);
1243
+ return result;
1244
+ }
1245
+
1246
+ /**
1247
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1248
+ * the same `toStringTag`.
1249
+ *
1250
+ * **Note:** This function only supports comparing values with tags of
1251
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1252
+ *
1253
+ * @private
1254
+ * @param {Object} object The object to compare.
1255
+ * @param {Object} other The other object to compare.
1256
+ * @param {string} tag The `toStringTag` of the objects to compare.
1257
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1258
+ * @param {Function} customizer The function to customize comparisons.
1259
+ * @param {Function} equalFunc The function to determine equivalents of values.
1260
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1261
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1262
+ */
1263
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1264
+ switch (tag) {
1265
+ case dataViewTag:
1266
+ if ((object.byteLength != other.byteLength) ||
1267
+ (object.byteOffset != other.byteOffset)) {
1268
+ return false;
1269
+ }
1270
+ object = object.buffer;
1271
+ other = other.buffer;
1272
+
1273
+ case arrayBufferTag:
1274
+ if ((object.byteLength != other.byteLength) ||
1275
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1276
+ return false;
1277
+ }
1278
+ return true;
1279
+
1280
+ case boolTag:
1281
+ case dateTag:
1282
+ case numberTag:
1283
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1284
+ // Invalid dates are coerced to `NaN`.
1285
+ return eq(+object, +other);
1286
+
1287
+ case errorTag:
1288
+ return object.name == other.name && object.message == other.message;
1289
+
1290
+ case regexpTag:
1291
+ case stringTag:
1292
+ // Coerce regexes to strings and treat strings, primitives and objects,
1293
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1294
+ // for more details.
1295
+ return object == (other + '');
1296
+
1297
+ case mapTag:
1298
+ var convert = mapToArray;
1299
+
1300
+ case setTag:
1301
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1302
+ convert || (convert = setToArray);
1303
+
1304
+ if (object.size != other.size && !isPartial) {
1305
+ return false;
1306
+ }
1307
+ // Assume cyclic values are equal.
1308
+ var stacked = stack.get(object);
1309
+ if (stacked) {
1310
+ return stacked == other;
1311
+ }
1312
+ bitmask |= COMPARE_UNORDERED_FLAG;
1313
+
1314
+ // Recursively compare objects (susceptible to call stack limits).
1315
+ stack.set(object, other);
1316
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1317
+ stack['delete'](object);
1318
+ return result;
1319
+
1320
+ case symbolTag:
1321
+ if (symbolValueOf) {
1322
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1323
+ }
1324
+ }
1325
+ return false;
1326
+ }
1327
+
1328
+ /**
1329
+ * A specialized version of `baseIsEqualDeep` for objects with support for
1330
+ * partial deep comparisons.
1331
+ *
1332
+ * @private
1333
+ * @param {Object} object The object to compare.
1334
+ * @param {Object} other The other object to compare.
1335
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1336
+ * @param {Function} customizer The function to customize comparisons.
1337
+ * @param {Function} equalFunc The function to determine equivalents of values.
1338
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1339
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1340
+ */
1341
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1342
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1343
+ objProps = getAllKeys(object),
1344
+ objLength = objProps.length,
1345
+ othProps = getAllKeys(other),
1346
+ othLength = othProps.length;
1347
+
1348
+ if (objLength != othLength && !isPartial) {
1349
+ return false;
1350
+ }
1351
+ var index = objLength;
1352
+ while (index--) {
1353
+ var key = objProps[index];
1354
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1355
+ return false;
1356
+ }
1357
+ }
1358
+ // Assume cyclic values are equal.
1359
+ var stacked = stack.get(object);
1360
+ if (stacked && stack.get(other)) {
1361
+ return stacked == other;
1362
+ }
1363
+ var result = true;
1364
+ stack.set(object, other);
1365
+ stack.set(other, object);
1366
+
1367
+ var skipCtor = isPartial;
1368
+ while (++index < objLength) {
1369
+ key = objProps[index];
1370
+ var objValue = object[key],
1371
+ othValue = other[key];
1372
+
1373
+ if (customizer) {
1374
+ var compared = isPartial
1375
+ ? customizer(othValue, objValue, key, other, object, stack)
1376
+ : customizer(objValue, othValue, key, object, other, stack);
1377
+ }
1378
+ // Recursively compare objects (susceptible to call stack limits).
1379
+ if (!(compared === undefined
1380
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1381
+ : compared
1382
+ )) {
1383
+ result = false;
1384
+ break;
1385
+ }
1386
+ skipCtor || (skipCtor = key == 'constructor');
1387
+ }
1388
+ if (result && !skipCtor) {
1389
+ var objCtor = object.constructor,
1390
+ othCtor = other.constructor;
1391
+
1392
+ // Non `Object` object instances with different constructors are not equal.
1393
+ if (objCtor != othCtor &&
1394
+ ('constructor' in object && 'constructor' in other) &&
1395
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1396
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1397
+ result = false;
1398
+ }
1399
+ }
1400
+ stack['delete'](object);
1401
+ stack['delete'](other);
1402
+ return result;
1403
+ }
1404
+
1405
+ /**
1406
+ * Creates an array of own enumerable property names and symbols of `object`.
1407
+ *
1408
+ * @private
1409
+ * @param {Object} object The object to query.
1410
+ * @returns {Array} Returns the array of property names and symbols.
1411
+ */
1412
+ function getAllKeys(object) {
1413
+ return baseGetAllKeys(object, keys, getSymbols);
1414
+ }
1415
+
1416
+ /**
1417
+ * Gets the data for `map`.
1418
+ *
1419
+ * @private
1420
+ * @param {Object} map The map to query.
1421
+ * @param {string} key The reference key.
1422
+ * @returns {*} Returns the map data.
1423
+ */
1424
+ function getMapData(map, key) {
1425
+ var data = map.__data__;
1426
+ return isKeyable(key)
1427
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1428
+ : data.map;
1429
+ }
1430
+
1431
+ /**
1432
+ * Gets the native function at `key` of `object`.
1433
+ *
1434
+ * @private
1435
+ * @param {Object} object The object to query.
1436
+ * @param {string} key The key of the method to get.
1437
+ * @returns {*} Returns the function if it's native, else `undefined`.
1438
+ */
1439
+ function getNative(object, key) {
1440
+ var value = getValue(object, key);
1441
+ return baseIsNative(value) ? value : undefined;
1442
+ }
1443
+
1444
+ /**
1445
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1446
+ *
1447
+ * @private
1448
+ * @param {*} value The value to query.
1449
+ * @returns {string} Returns the raw `toStringTag`.
1450
+ */
1451
+ function getRawTag(value) {
1452
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
1453
+ tag = value[symToStringTag];
1454
+
1455
+ try {
1456
+ value[symToStringTag] = undefined;
1457
+ var unmasked = true;
1458
+ } catch (e) {}
1459
+
1460
+ var result = nativeObjectToString.call(value);
1461
+ if (unmasked) {
1462
+ if (isOwn) {
1463
+ value[symToStringTag] = tag;
1464
+ } else {
1465
+ delete value[symToStringTag];
1466
+ }
1467
+ }
1468
+ return result;
1469
+ }
1470
+
1471
+ /**
1472
+ * Creates an array of the own enumerable symbols of `object`.
1473
+ *
1474
+ * @private
1475
+ * @param {Object} object The object to query.
1476
+ * @returns {Array} Returns the array of symbols.
1477
+ */
1478
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1479
+ if (object == null) {
1480
+ return [];
1481
+ }
1482
+ object = Object(object);
1483
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1484
+ return propertyIsEnumerable.call(object, symbol);
1485
+ });
1486
+ };
1487
+
1488
+ /**
1489
+ * Gets the `toStringTag` of `value`.
1490
+ *
1491
+ * @private
1492
+ * @param {*} value The value to query.
1493
+ * @returns {string} Returns the `toStringTag`.
1494
+ */
1495
+ var getTag = baseGetTag;
1496
+
1497
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1498
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
1499
+ (Map && getTag(new Map) != mapTag) ||
1500
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
1501
+ (Set && getTag(new Set) != setTag) ||
1502
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1503
+ getTag = function(value) {
1504
+ var result = baseGetTag(value),
1505
+ Ctor = result == objectTag ? value.constructor : undefined,
1506
+ ctorString = Ctor ? toSource(Ctor) : '';
1507
+
1508
+ if (ctorString) {
1509
+ switch (ctorString) {
1510
+ case dataViewCtorString: return dataViewTag;
1511
+ case mapCtorString: return mapTag;
1512
+ case promiseCtorString: return promiseTag;
1513
+ case setCtorString: return setTag;
1514
+ case weakMapCtorString: return weakMapTag;
1515
+ }
1516
+ }
1517
+ return result;
1518
+ };
1519
+ }
1520
+
1521
+ /**
1522
+ * Checks if `value` is a valid array-like index.
1523
+ *
1524
+ * @private
1525
+ * @param {*} value The value to check.
1526
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1527
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1528
+ */
1529
+ function isIndex(value, length) {
1530
+ length = length == null ? MAX_SAFE_INTEGER : length;
1531
+ return !!length &&
1532
+ (typeof value == 'number' || reIsUint.test(value)) &&
1533
+ (value > -1 && value % 1 == 0 && value < length);
1534
+ }
1535
+
1536
+ /**
1537
+ * Checks if `value` is suitable for use as unique object key.
1538
+ *
1539
+ * @private
1540
+ * @param {*} value The value to check.
1541
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1542
+ */
1543
+ function isKeyable(value) {
1544
+ var type = typeof value;
1545
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1546
+ ? (value !== '__proto__')
1547
+ : (value === null);
1548
+ }
1549
+
1550
+ /**
1551
+ * Checks if `func` has its source masked.
1552
+ *
1553
+ * @private
1554
+ * @param {Function} func The function to check.
1555
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1556
+ */
1557
+ function isMasked(func) {
1558
+ return !!maskSrcKey && (maskSrcKey in func);
1559
+ }
1560
+
1561
+ /**
1562
+ * Checks if `value` is likely a prototype object.
1563
+ *
1564
+ * @private
1565
+ * @param {*} value The value to check.
1566
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1567
+ */
1568
+ function isPrototype(value) {
1569
+ var Ctor = value && value.constructor,
1570
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1571
+
1572
+ return value === proto;
1573
+ }
1574
+
1575
+ /**
1576
+ * Converts `value` to a string using `Object.prototype.toString`.
1577
+ *
1578
+ * @private
1579
+ * @param {*} value The value to convert.
1580
+ * @returns {string} Returns the converted string.
1581
+ */
1582
+ function objectToString(value) {
1583
+ return nativeObjectToString.call(value);
1584
+ }
1585
+
1586
+ /**
1587
+ * Converts `func` to its source code.
1588
+ *
1589
+ * @private
1590
+ * @param {Function} func The function to convert.
1591
+ * @returns {string} Returns the source code.
1592
+ */
1593
+ function toSource(func) {
1594
+ if (func != null) {
1595
+ try {
1596
+ return funcToString.call(func);
1597
+ } catch (e) {}
1598
+ try {
1599
+ return (func + '');
1600
+ } catch (e) {}
1601
+ }
1602
+ return '';
1603
+ }
1604
+
1605
+ /**
1606
+ * Performs a
1607
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1608
+ * comparison between two values to determine if they are equivalent.
1609
+ *
1610
+ * @static
1611
+ * @memberOf _
1612
+ * @since 4.0.0
1613
+ * @category Lang
1614
+ * @param {*} value The value to compare.
1615
+ * @param {*} other The other value to compare.
1616
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1617
+ * @example
1618
+ *
1619
+ * var object = { 'a': 1 };
1620
+ * var other = { 'a': 1 };
1621
+ *
1622
+ * _.eq(object, object);
1623
+ * // => true
1624
+ *
1625
+ * _.eq(object, other);
1626
+ * // => false
1627
+ *
1628
+ * _.eq('a', 'a');
1629
+ * // => true
1630
+ *
1631
+ * _.eq('a', Object('a'));
1632
+ * // => false
1633
+ *
1634
+ * _.eq(NaN, NaN);
1635
+ * // => true
1636
+ */
1637
+ function eq(value, other) {
1638
+ return value === other || (value !== value && other !== other);
1639
+ }
1640
+
1641
+ /**
1642
+ * Checks if `value` is likely an `arguments` object.
1643
+ *
1644
+ * @static
1645
+ * @memberOf _
1646
+ * @since 0.1.0
1647
+ * @category Lang
1648
+ * @param {*} value The value to check.
1649
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1650
+ * else `false`.
1651
+ * @example
1652
+ *
1653
+ * _.isArguments(function() { return arguments; }());
1654
+ * // => true
1655
+ *
1656
+ * _.isArguments([1, 2, 3]);
1657
+ * // => false
1658
+ */
1659
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1660
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1661
+ !propertyIsEnumerable.call(value, 'callee');
1662
+ };
1663
+
1664
+ /**
1665
+ * Checks if `value` is classified as an `Array` object.
1666
+ *
1667
+ * @static
1668
+ * @memberOf _
1669
+ * @since 0.1.0
1670
+ * @category Lang
1671
+ * @param {*} value The value to check.
1672
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1673
+ * @example
1674
+ *
1675
+ * _.isArray([1, 2, 3]);
1676
+ * // => true
1677
+ *
1678
+ * _.isArray(document.body.children);
1679
+ * // => false
1680
+ *
1681
+ * _.isArray('abc');
1682
+ * // => false
1683
+ *
1684
+ * _.isArray(_.noop);
1685
+ * // => false
1686
+ */
1687
+ var isArray = Array.isArray;
1688
+
1689
+ /**
1690
+ * Checks if `value` is array-like. A value is considered array-like if it's
1691
+ * not a function and has a `value.length` that's an integer greater than or
1692
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1693
+ *
1694
+ * @static
1695
+ * @memberOf _
1696
+ * @since 4.0.0
1697
+ * @category Lang
1698
+ * @param {*} value The value to check.
1699
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1700
+ * @example
1701
+ *
1702
+ * _.isArrayLike([1, 2, 3]);
1703
+ * // => true
1704
+ *
1705
+ * _.isArrayLike(document.body.children);
1706
+ * // => true
1707
+ *
1708
+ * _.isArrayLike('abc');
1709
+ * // => true
1710
+ *
1711
+ * _.isArrayLike(_.noop);
1712
+ * // => false
1713
+ */
1714
+ function isArrayLike(value) {
1715
+ return value != null && isLength(value.length) && !isFunction(value);
1716
+ }
1717
+
1718
+ /**
1719
+ * Checks if `value` is a buffer.
1720
+ *
1721
+ * @static
1722
+ * @memberOf _
1723
+ * @since 4.3.0
1724
+ * @category Lang
1725
+ * @param {*} value The value to check.
1726
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1727
+ * @example
1728
+ *
1729
+ * _.isBuffer(new Buffer(2));
1730
+ * // => true
1731
+ *
1732
+ * _.isBuffer(new Uint8Array(2));
1733
+ * // => false
1734
+ */
1735
+ var isBuffer = nativeIsBuffer || stubFalse;
1736
+
1737
+ /**
1738
+ * Performs a deep comparison between two values to determine if they are
1739
+ * equivalent.
1740
+ *
1741
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
1742
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
1743
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
1744
+ * by their own, not inherited, enumerable properties. Functions and DOM
1745
+ * nodes are compared by strict equality, i.e. `===`.
1746
+ *
1747
+ * @static
1748
+ * @memberOf _
1749
+ * @since 0.1.0
1750
+ * @category Lang
1751
+ * @param {*} value The value to compare.
1752
+ * @param {*} other The other value to compare.
1753
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1754
+ * @example
1755
+ *
1756
+ * var object = { 'a': 1 };
1757
+ * var other = { 'a': 1 };
1758
+ *
1759
+ * _.isEqual(object, other);
1760
+ * // => true
1761
+ *
1762
+ * object === other;
1763
+ * // => false
1764
+ */
1765
+ function isEqual(value, other) {
1766
+ return baseIsEqual(value, other);
1767
+ }
1768
+
1769
+ /**
1770
+ * Checks if `value` is classified as a `Function` object.
1771
+ *
1772
+ * @static
1773
+ * @memberOf _
1774
+ * @since 0.1.0
1775
+ * @category Lang
1776
+ * @param {*} value The value to check.
1777
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1778
+ * @example
1779
+ *
1780
+ * _.isFunction(_);
1781
+ * // => true
1782
+ *
1783
+ * _.isFunction(/abc/);
1784
+ * // => false
1785
+ */
1786
+ function isFunction(value) {
1787
+ if (!isObject(value)) {
1788
+ return false;
1789
+ }
1790
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1791
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
1792
+ var tag = baseGetTag(value);
1793
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1794
+ }
1795
+
1796
+ /**
1797
+ * Checks if `value` is a valid array-like length.
1798
+ *
1799
+ * **Note:** This method is loosely based on
1800
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1801
+ *
1802
+ * @static
1803
+ * @memberOf _
1804
+ * @since 4.0.0
1805
+ * @category Lang
1806
+ * @param {*} value The value to check.
1807
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1808
+ * @example
1809
+ *
1810
+ * _.isLength(3);
1811
+ * // => true
1812
+ *
1813
+ * _.isLength(Number.MIN_VALUE);
1814
+ * // => false
1815
+ *
1816
+ * _.isLength(Infinity);
1817
+ * // => false
1818
+ *
1819
+ * _.isLength('3');
1820
+ * // => false
1821
+ */
1822
+ function isLength(value) {
1823
+ return typeof value == 'number' &&
1824
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1825
+ }
1826
+
1827
+ /**
1828
+ * Checks if `value` is the
1829
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1830
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1831
+ *
1832
+ * @static
1833
+ * @memberOf _
1834
+ * @since 0.1.0
1835
+ * @category Lang
1836
+ * @param {*} value The value to check.
1837
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1838
+ * @example
1839
+ *
1840
+ * _.isObject({});
1841
+ * // => true
1842
+ *
1843
+ * _.isObject([1, 2, 3]);
1844
+ * // => true
1845
+ *
1846
+ * _.isObject(_.noop);
1847
+ * // => true
1848
+ *
1849
+ * _.isObject(null);
1850
+ * // => false
1851
+ */
1852
+ function isObject(value) {
1853
+ var type = typeof value;
1854
+ return value != null && (type == 'object' || type == 'function');
1855
+ }
1856
+
1857
+ /**
1858
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1859
+ * and has a `typeof` result of "object".
1860
+ *
1861
+ * @static
1862
+ * @memberOf _
1863
+ * @since 4.0.0
1864
+ * @category Lang
1865
+ * @param {*} value The value to check.
1866
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1867
+ * @example
1868
+ *
1869
+ * _.isObjectLike({});
1870
+ * // => true
1871
+ *
1872
+ * _.isObjectLike([1, 2, 3]);
1873
+ * // => true
1874
+ *
1875
+ * _.isObjectLike(_.noop);
1876
+ * // => false
1877
+ *
1878
+ * _.isObjectLike(null);
1879
+ * // => false
1880
+ */
1881
+ function isObjectLike(value) {
1882
+ return value != null && typeof value == 'object';
1883
+ }
1884
+
1885
+ /**
1886
+ * Checks if `value` is classified as a typed array.
1887
+ *
1888
+ * @static
1889
+ * @memberOf _
1890
+ * @since 3.0.0
1891
+ * @category Lang
1892
+ * @param {*} value The value to check.
1893
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1894
+ * @example
1895
+ *
1896
+ * _.isTypedArray(new Uint8Array);
1897
+ * // => true
1898
+ *
1899
+ * _.isTypedArray([]);
1900
+ * // => false
1901
+ */
1902
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1903
+
1904
+ /**
1905
+ * Creates an array of the own enumerable property names of `object`.
1906
+ *
1907
+ * **Note:** Non-object values are coerced to objects. See the
1908
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1909
+ * for more details.
1910
+ *
1911
+ * @static
1912
+ * @since 0.1.0
1913
+ * @memberOf _
1914
+ * @category Object
1915
+ * @param {Object} object The object to query.
1916
+ * @returns {Array} Returns the array of property names.
1917
+ * @example
1918
+ *
1919
+ * function Foo() {
1920
+ * this.a = 1;
1921
+ * this.b = 2;
1922
+ * }
1923
+ *
1924
+ * Foo.prototype.c = 3;
1925
+ *
1926
+ * _.keys(new Foo);
1927
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1928
+ *
1929
+ * _.keys('hi');
1930
+ * // => ['0', '1']
1931
+ */
1932
+ function keys(object) {
1933
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1934
+ }
1935
+
1936
+ /**
1937
+ * This method returns a new empty array.
1938
+ *
1939
+ * @static
1940
+ * @memberOf _
1941
+ * @since 4.13.0
1942
+ * @category Util
1943
+ * @returns {Array} Returns the new empty array.
1944
+ * @example
1945
+ *
1946
+ * var arrays = _.times(2, _.stubArray);
1947
+ *
1948
+ * console.log(arrays);
1949
+ * // => [[], []]
1950
+ *
1951
+ * console.log(arrays[0] === arrays[1]);
1952
+ * // => false
1953
+ */
1954
+ function stubArray() {
1955
+ return [];
1956
+ }
1957
+
1958
+ /**
1959
+ * This method returns `false`.
1960
+ *
1961
+ * @static
1962
+ * @memberOf _
1963
+ * @since 4.13.0
1964
+ * @category Util
1965
+ * @returns {boolean} Returns `false`.
1966
+ * @example
1967
+ *
1968
+ * _.times(2, _.stubFalse);
1969
+ * // => [false, false]
1970
+ */
1971
+ function stubFalse() {
1972
+ return false;
1973
+ }
1974
+
1975
+ module.exports = isEqual;
1976
+ } (lodash_isequal, lodash_isequal.exports));
1977
+ return lodash_isequal.exports;
1978
+ }
1979
+
1980
+ /**
1981
+ * Wraps values in an `Ok` type.
1982
+ *
1983
+ * Example: `ok(5) // => {ok: true, result: 5}`
1984
+ */
1985
+
1986
+ var ok = function (result) { return ({ ok: true, result: result }); };
1987
+ /**
1988
+ * Typeguard for `Ok`.
1989
+ */
1990
+ var isOk = function (r) { return r.ok === true; };
1991
+ /**
1992
+ * Wraps errors in an `Err` type.
1993
+ *
1994
+ * Example: `err('on fire') // => {ok: false, error: 'on fire'}`
1995
+ */
1996
+ var err = function (error) { return ({ ok: false, error: error }); };
1997
+ /**
1998
+ * Typeguard for `Err`.
1999
+ */
2000
+ var isErr = function (r) { return r.ok === false; };
2001
+ /**
2002
+ * Create a `Promise` that either resolves with the result of `Ok` or rejects
2003
+ * with the error of `Err`.
2004
+ */
2005
+ var asPromise = function (r) {
2006
+ return r.ok === true ? Promise.resolve(r.result) : Promise.reject(r.error);
2007
+ };
2008
+ /**
2009
+ * Unwraps a `Result` and returns either the result of an `Ok`, or
2010
+ * `defaultValue`.
2011
+ *
2012
+ * Example:
2013
+ * ```
2014
+ * Result.withDefault(5, number().run(json))
2015
+ * ```
2016
+ *
2017
+ * It would be nice if `Decoder` had an instance method that mirrored this
2018
+ * function. Such a method would look something like this:
2019
+ * ```
2020
+ * class Decoder<A> {
2021
+ * runWithDefault = (defaultValue: A, json: any): A =>
2022
+ * Result.withDefault(defaultValue, this.run(json));
2023
+ * }
2024
+ *
2025
+ * number().runWithDefault(5, json)
2026
+ * ```
2027
+ * Unfortunately, the type of `defaultValue: A` on the method causes issues
2028
+ * with type inference on the `object` decoder in some situations. While these
2029
+ * inference issues can be solved by providing the optional type argument for
2030
+ * `object`s, the extra trouble and confusion doesn't seem worth it.
2031
+ */
2032
+ var withDefault = function (defaultValue, r) {
2033
+ return r.ok === true ? r.result : defaultValue;
2034
+ };
2035
+ /**
2036
+ * Return the successful result, or throw an error.
2037
+ */
2038
+ var withException = function (r) {
2039
+ if (r.ok === true) {
2040
+ return r.result;
2041
+ }
2042
+ else {
2043
+ throw r.error;
2044
+ }
2045
+ };
2046
+ /**
2047
+ * Given an array of `Result`s, return the successful values.
2048
+ */
2049
+ var successes = function (results) {
2050
+ return results.reduce(function (acc, r) { return (r.ok === true ? acc.concat(r.result) : acc); }, []);
2051
+ };
2052
+ /**
2053
+ * Apply `f` to the result of an `Ok`, or pass the error through.
2054
+ */
2055
+ var map = function (f, r) {
2056
+ return r.ok === true ? ok(f(r.result)) : r;
2057
+ };
2058
+ /**
2059
+ * Apply `f` to the result of two `Ok`s, or pass an error through. If both
2060
+ * `Result`s are errors then the first one is returned.
2061
+ */
2062
+ var map2 = function (f, ar, br) {
2063
+ return ar.ok === false ? ar :
2064
+ br.ok === false ? br :
2065
+ ok(f(ar.result, br.result));
2066
+ };
2067
+ /**
2068
+ * Apply `f` to the error of an `Err`, or pass the success through.
2069
+ */
2070
+ var mapError = function (f, r) {
2071
+ return r.ok === true ? r : err(f(r.error));
2072
+ };
2073
+ /**
2074
+ * Chain together a sequence of computations that may fail, similar to a
2075
+ * `Promise`. If the first computation fails then the error will propagate
2076
+ * through. If it succeeds, then `f` will be applied to the value, returning a
2077
+ * new `Result`.
2078
+ */
2079
+ var andThen = function (f, r) {
2080
+ return r.ok === true ? f(r.result) : r;
2081
+ };
2082
+
2083
+
2084
+ var result = Object.freeze({
2085
+ ok: ok,
2086
+ isOk: isOk,
2087
+ err: err,
2088
+ isErr: isErr,
2089
+ asPromise: asPromise,
2090
+ withDefault: withDefault,
2091
+ withException: withException,
2092
+ successes: successes,
2093
+ map: map,
2094
+ map2: map2,
2095
+ mapError: mapError,
2096
+ andThen: andThen
2097
+ });
2098
+
2099
+ /*! *****************************************************************************
2100
+ Copyright (c) Microsoft Corporation. All rights reserved.
2101
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
2102
+ this file except in compliance with the License. You may obtain a copy of the
2103
+ License at http://www.apache.org/licenses/LICENSE-2.0
2104
+
2105
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2106
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
2107
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
2108
+ MERCHANTABLITY OR NON-INFRINGEMENT.
2109
+
2110
+ See the Apache Version 2.0 License for specific language governing permissions
2111
+ and limitations under the License.
2112
+ ***************************************************************************** */
2113
+ /* global Reflect, Promise */
2114
+
2115
+
2116
+
2117
+ var __assign = function() {
2118
+ __assign = Object.assign || function __assign(t) {
2119
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2120
+ s = arguments[i];
2121
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2122
+ }
2123
+ return t;
2124
+ };
2125
+ return __assign.apply(this, arguments);
2126
+ };
2127
+
2128
+ function __rest(s, e) {
2129
+ var t = {};
2130
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2131
+ t[p] = s[p];
2132
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
2133
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
2134
+ t[p[i]] = s[p[i]];
2135
+ return t;
2136
+ }
2137
+
2138
+ var isEqual = requireLodash_isequal(); // this syntax avoids TS1192
2139
+ /**
2140
+ * Type guard for `DecoderError`. One use case of the type guard is in the
2141
+ * `catch` of a promise. Typescript types the error argument of `catch` as
2142
+ * `any`, so when dealing with a decoder as a promise you may need to
2143
+ * distinguish between a `DecoderError` and an error string.
2144
+ */
2145
+ var isDecoderError = function (a) {
2146
+ return a.kind === 'DecoderError' && typeof a.at === 'string' && typeof a.message === 'string';
2147
+ };
2148
+ /*
2149
+ * Helpers
2150
+ */
2151
+ var isJsonArray = function (json) { return Array.isArray(json); };
2152
+ var isJsonObject = function (json) {
2153
+ return typeof json === 'object' && json !== null && !isJsonArray(json);
2154
+ };
2155
+ var typeString = function (json) {
2156
+ switch (typeof json) {
2157
+ case 'string':
2158
+ return 'a string';
2159
+ case 'number':
2160
+ return 'a number';
2161
+ case 'boolean':
2162
+ return 'a boolean';
2163
+ case 'undefined':
2164
+ return 'undefined';
2165
+ case 'object':
2166
+ if (json instanceof Array) {
2167
+ return 'an array';
2168
+ }
2169
+ else if (json === null) {
2170
+ return 'null';
2171
+ }
2172
+ else {
2173
+ return 'an object';
2174
+ }
2175
+ default:
2176
+ return JSON.stringify(json);
2177
+ }
2178
+ };
2179
+ var expectedGot = function (expected, got) {
2180
+ return "expected " + expected + ", got " + typeString(got);
2181
+ };
2182
+ var printPath = function (paths) {
2183
+ return paths.map(function (path) { return (typeof path === 'string' ? "." + path : "[" + path + "]"); }).join('');
2184
+ };
2185
+ var prependAt = function (newAt, _a) {
2186
+ var at = _a.at, rest = __rest(_a, ["at"]);
2187
+ return (__assign({ at: newAt + (at || '') }, rest));
2188
+ };
2189
+ /**
2190
+ * Decoders transform json objects with unknown structure into known and
2191
+ * verified forms. You can create objects of type `Decoder<A>` with either the
2192
+ * primitive decoder functions, such as `boolean()` and `string()`, or by
2193
+ * applying higher-order decoders to the primitives, such as `array(boolean())`
2194
+ * or `dict(string())`.
2195
+ *
2196
+ * Each of the decoder functions are available both as a static method on
2197
+ * `Decoder` and as a function alias -- for example the string decoder is
2198
+ * defined at `Decoder.string()`, but is also aliased to `string()`. Using the
2199
+ * function aliases exported with the library is recommended.
2200
+ *
2201
+ * `Decoder` exposes a number of 'run' methods, which all decode json in the
2202
+ * same way, but communicate success and failure in different ways. The `map`
2203
+ * and `andThen` methods modify decoders without having to call a 'run' method.
2204
+ *
2205
+ * Alternatively, the main decoder `run()` method returns an object of type
2206
+ * `Result<A, DecoderError>`. This library provides a number of helper
2207
+ * functions for dealing with the `Result` type, so you can do all the same
2208
+ * things with a `Result` as with the decoder methods.
2209
+ */
2210
+ var Decoder = /** @class */ (function () {
2211
+ /**
2212
+ * The Decoder class constructor is kept private to separate the internal
2213
+ * `decode` function from the external `run` function. The distinction
2214
+ * between the two functions is that `decode` returns a
2215
+ * `Partial<DecoderError>` on failure, which contains an unfinished error
2216
+ * report. When `run` is called on a decoder, the relevant series of `decode`
2217
+ * calls is made, and then on failure the resulting `Partial<DecoderError>`
2218
+ * is turned into a `DecoderError` by filling in the missing information.
2219
+ *
2220
+ * While hiding the constructor may seem restrictive, leveraging the
2221
+ * provided decoder combinators and helper functions such as
2222
+ * `andThen` and `map` should be enough to build specialized decoders as
2223
+ * needed.
2224
+ */
2225
+ function Decoder(decode) {
2226
+ var _this = this;
2227
+ this.decode = decode;
2228
+ /**
2229
+ * Run the decoder and return a `Result` with either the decoded value or a
2230
+ * `DecoderError` containing the json input, the location of the error, and
2231
+ * the error message.
2232
+ *
2233
+ * Examples:
2234
+ * ```
2235
+ * number().run(12)
2236
+ * // => {ok: true, result: 12}
2237
+ *
2238
+ * string().run(9001)
2239
+ * // =>
2240
+ * // {
2241
+ * // ok: false,
2242
+ * // error: {
2243
+ * // kind: 'DecoderError',
2244
+ * // input: 9001,
2245
+ * // at: 'input',
2246
+ * // message: 'expected a string, got 9001'
2247
+ * // }
2248
+ * // }
2249
+ * ```
2250
+ */
2251
+ this.run = function (json) {
2252
+ return mapError(function (error) { return ({
2253
+ kind: 'DecoderError',
2254
+ input: json,
2255
+ at: 'input' + (error.at || ''),
2256
+ message: error.message || ''
2257
+ }); }, _this.decode(json));
2258
+ };
2259
+ /**
2260
+ * Run the decoder as a `Promise`.
2261
+ */
2262
+ this.runPromise = function (json) { return asPromise(_this.run(json)); };
2263
+ /**
2264
+ * Run the decoder and return the value on success, or throw an exception
2265
+ * with a formatted error string.
2266
+ */
2267
+ this.runWithException = function (json) { return withException(_this.run(json)); };
2268
+ /**
2269
+ * Construct a new decoder that applies a transformation to the decoded
2270
+ * result. If the decoder succeeds then `f` will be applied to the value. If
2271
+ * it fails the error will propagated through.
2272
+ *
2273
+ * Example:
2274
+ * ```
2275
+ * number().map(x => x * 5).run(10)
2276
+ * // => {ok: true, result: 50}
2277
+ * ```
2278
+ */
2279
+ this.map = function (f) {
2280
+ return new Decoder(function (json) { return map(f, _this.decode(json)); });
2281
+ };
2282
+ /**
2283
+ * Chain together a sequence of decoders. The first decoder will run, and
2284
+ * then the function will determine what decoder to run second. If the result
2285
+ * of the first decoder succeeds then `f` will be applied to the decoded
2286
+ * value. If it fails the error will propagate through.
2287
+ *
2288
+ * This is a very powerful method -- it can act as both the `map` and `where`
2289
+ * methods, can improve error messages for edge cases, and can be used to
2290
+ * make a decoder for custom types.
2291
+ *
2292
+ * Example of adding an error message:
2293
+ * ```
2294
+ * const versionDecoder = valueAt(['version'], number());
2295
+ * const infoDecoder3 = object({a: boolean()});
2296
+ *
2297
+ * const decoder = versionDecoder.andThen(version => {
2298
+ * switch (version) {
2299
+ * case 3:
2300
+ * return infoDecoder3;
2301
+ * default:
2302
+ * return fail(`Unable to decode info, version ${version} is not supported.`);
2303
+ * }
2304
+ * });
2305
+ *
2306
+ * decoder.run({version: 3, a: true})
2307
+ * // => {ok: true, result: {a: true}}
2308
+ *
2309
+ * decoder.run({version: 5, x: 'abc'})
2310
+ * // =>
2311
+ * // {
2312
+ * // ok: false,
2313
+ * // error: {... message: 'Unable to decode info, version 5 is not supported.'}
2314
+ * // }
2315
+ * ```
2316
+ *
2317
+ * Example of decoding a custom type:
2318
+ * ```
2319
+ * // nominal type for arrays with a length of at least one
2320
+ * type NonEmptyArray<T> = T[] & { __nonEmptyArrayBrand__: void };
2321
+ *
2322
+ * const nonEmptyArrayDecoder = <T>(values: Decoder<T>): Decoder<NonEmptyArray<T>> =>
2323
+ * array(values).andThen(arr =>
2324
+ * arr.length > 0
2325
+ * ? succeed(createNonEmptyArray(arr))
2326
+ * : fail(`expected a non-empty array, got an empty array`)
2327
+ * );
2328
+ * ```
2329
+ */
2330
+ this.andThen = function (f) {
2331
+ return new Decoder(function (json) {
2332
+ return andThen(function (value) { return f(value).decode(json); }, _this.decode(json));
2333
+ });
2334
+ };
2335
+ /**
2336
+ * Add constraints to a decoder _without_ changing the resulting type. The
2337
+ * `test` argument is a predicate function which returns true for valid
2338
+ * inputs. When `test` fails on an input, the decoder fails with the given
2339
+ * `errorMessage`.
2340
+ *
2341
+ * ```
2342
+ * const chars = (length: number): Decoder<string> =>
2343
+ * string().where(
2344
+ * (s: string) => s.length === length,
2345
+ * `expected a string of length ${length}`
2346
+ * );
2347
+ *
2348
+ * chars(5).run('12345')
2349
+ * // => {ok: true, result: '12345'}
2350
+ *
2351
+ * chars(2).run('HELLO')
2352
+ * // => {ok: false, error: {... message: 'expected a string of length 2'}}
2353
+ *
2354
+ * chars(12).run(true)
2355
+ * // => {ok: false, error: {... message: 'expected a string, got a boolean'}}
2356
+ * ```
2357
+ */
2358
+ this.where = function (test, errorMessage) {
2359
+ return _this.andThen(function (value) { return (test(value) ? Decoder.succeed(value) : Decoder.fail(errorMessage)); });
2360
+ };
2361
+ }
2362
+ /**
2363
+ * Decoder primitive that validates strings, and fails on all other input.
2364
+ */
2365
+ Decoder.string = function () {
2366
+ return new Decoder(function (json) {
2367
+ return typeof json === 'string'
2368
+ ? ok(json)
2369
+ : err({ message: expectedGot('a string', json) });
2370
+ });
2371
+ };
2372
+ /**
2373
+ * Decoder primitive that validates numbers, and fails on all other input.
2374
+ */
2375
+ Decoder.number = function () {
2376
+ return new Decoder(function (json) {
2377
+ return typeof json === 'number'
2378
+ ? ok(json)
2379
+ : err({ message: expectedGot('a number', json) });
2380
+ });
2381
+ };
2382
+ /**
2383
+ * Decoder primitive that validates booleans, and fails on all other input.
2384
+ */
2385
+ Decoder.boolean = function () {
2386
+ return new Decoder(function (json) {
2387
+ return typeof json === 'boolean'
2388
+ ? ok(json)
2389
+ : err({ message: expectedGot('a boolean', json) });
2390
+ });
2391
+ };
2392
+ Decoder.constant = function (value) {
2393
+ return new Decoder(function (json) {
2394
+ return isEqual(json, value)
2395
+ ? ok(value)
2396
+ : err({ message: "expected " + JSON.stringify(value) + ", got " + JSON.stringify(json) });
2397
+ });
2398
+ };
2399
+ Decoder.object = function (decoders) {
2400
+ return new Decoder(function (json) {
2401
+ if (isJsonObject(json) && decoders) {
2402
+ var obj = {};
2403
+ for (var key in decoders) {
2404
+ if (decoders.hasOwnProperty(key)) {
2405
+ var r = decoders[key].decode(json[key]);
2406
+ if (r.ok === true) {
2407
+ // tslint:disable-next-line:strict-type-predicates
2408
+ if (r.result !== undefined) {
2409
+ obj[key] = r.result;
2410
+ }
2411
+ }
2412
+ else if (json[key] === undefined) {
2413
+ return err({ message: "the key '" + key + "' is required but was not present" });
2414
+ }
2415
+ else {
2416
+ return err(prependAt("." + key, r.error));
2417
+ }
2418
+ }
2419
+ }
2420
+ return ok(obj);
2421
+ }
2422
+ else if (isJsonObject(json)) {
2423
+ return ok(json);
2424
+ }
2425
+ else {
2426
+ return err({ message: expectedGot('an object', json) });
2427
+ }
2428
+ });
2429
+ };
2430
+ Decoder.array = function (decoder) {
2431
+ return new Decoder(function (json) {
2432
+ if (isJsonArray(json) && decoder) {
2433
+ var decodeValue_1 = function (v, i) {
2434
+ return mapError(function (err$$1) { return prependAt("[" + i + "]", err$$1); }, decoder.decode(v));
2435
+ };
2436
+ return json.reduce(function (acc, v, i) {
2437
+ return map2(function (arr, result) { return arr.concat([result]); }, acc, decodeValue_1(v, i));
2438
+ }, ok([]));
2439
+ }
2440
+ else if (isJsonArray(json)) {
2441
+ return ok(json);
2442
+ }
2443
+ else {
2444
+ return err({ message: expectedGot('an array', json) });
2445
+ }
2446
+ });
2447
+ };
2448
+ Decoder.tuple = function (decoders) {
2449
+ return new Decoder(function (json) {
2450
+ if (isJsonArray(json)) {
2451
+ if (json.length !== decoders.length) {
2452
+ return err({
2453
+ message: "expected a tuple of length " + decoders.length + ", got one of length " + json.length
2454
+ });
2455
+ }
2456
+ var result = [];
2457
+ for (var i = 0; i < decoders.length; i++) {
2458
+ var nth = decoders[i].decode(json[i]);
2459
+ if (nth.ok) {
2460
+ result[i] = nth.result;
2461
+ }
2462
+ else {
2463
+ return err(prependAt("[" + i + "]", nth.error));
2464
+ }
2465
+ }
2466
+ return ok(result);
2467
+ }
2468
+ else {
2469
+ return err({ message: expectedGot("a tuple of length " + decoders.length, json) });
2470
+ }
2471
+ });
2472
+ };
2473
+ Decoder.union = function (ad, bd) {
2474
+ var decoders = [];
2475
+ for (var _i = 2; _i < arguments.length; _i++) {
2476
+ decoders[_i - 2] = arguments[_i];
2477
+ }
2478
+ return Decoder.oneOf.apply(Decoder, [ad, bd].concat(decoders));
2479
+ };
2480
+ Decoder.intersection = function (ad, bd) {
2481
+ var ds = [];
2482
+ for (var _i = 2; _i < arguments.length; _i++) {
2483
+ ds[_i - 2] = arguments[_i];
2484
+ }
2485
+ return new Decoder(function (json) {
2486
+ return [ad, bd].concat(ds).reduce(function (acc, decoder) { return map2(Object.assign, acc, decoder.decode(json)); }, ok({}));
2487
+ });
2488
+ };
2489
+ /**
2490
+ * Escape hatch to bypass validation. Always succeeds and types the result as
2491
+ * `any`. Useful for defining decoders incrementally, particularly for
2492
+ * complex objects.
2493
+ *
2494
+ * Example:
2495
+ * ```
2496
+ * interface User {
2497
+ * name: string;
2498
+ * complexUserData: ComplexType;
2499
+ * }
2500
+ *
2501
+ * const userDecoder: Decoder<User> = object({
2502
+ * name: string(),
2503
+ * complexUserData: anyJson()
2504
+ * });
2505
+ * ```
2506
+ */
2507
+ Decoder.anyJson = function () { return new Decoder(function (json) { return ok(json); }); };
2508
+ /**
2509
+ * Decoder identity function which always succeeds and types the result as
2510
+ * `unknown`.
2511
+ */
2512
+ Decoder.unknownJson = function () {
2513
+ return new Decoder(function (json) { return ok(json); });
2514
+ };
2515
+ /**
2516
+ * Decoder for json objects where the keys are unknown strings, but the values
2517
+ * should all be of the same type.
2518
+ *
2519
+ * Example:
2520
+ * ```
2521
+ * dict(number()).run({chocolate: 12, vanilla: 10, mint: 37});
2522
+ * // => {ok: true, result: {chocolate: 12, vanilla: 10, mint: 37}}
2523
+ * ```
2524
+ */
2525
+ Decoder.dict = function (decoder) {
2526
+ return new Decoder(function (json) {
2527
+ if (isJsonObject(json)) {
2528
+ var obj = {};
2529
+ for (var key in json) {
2530
+ if (json.hasOwnProperty(key)) {
2531
+ var r = decoder.decode(json[key]);
2532
+ if (r.ok === true) {
2533
+ obj[key] = r.result;
2534
+ }
2535
+ else {
2536
+ return err(prependAt("." + key, r.error));
2537
+ }
2538
+ }
2539
+ }
2540
+ return ok(obj);
2541
+ }
2542
+ else {
2543
+ return err({ message: expectedGot('an object', json) });
2544
+ }
2545
+ });
2546
+ };
2547
+ /**
2548
+ * Decoder for values that may be `undefined`. This is primarily helpful for
2549
+ * decoding interfaces with optional fields.
2550
+ *
2551
+ * Example:
2552
+ * ```
2553
+ * interface User {
2554
+ * id: number;
2555
+ * isOwner?: boolean;
2556
+ * }
2557
+ *
2558
+ * const decoder: Decoder<User> = object({
2559
+ * id: number(),
2560
+ * isOwner: optional(boolean())
2561
+ * });
2562
+ * ```
2563
+ */
2564
+ Decoder.optional = function (decoder) {
2565
+ return new Decoder(function (json) { return (json === undefined ? ok(undefined) : decoder.decode(json)); });
2566
+ };
2567
+ /**
2568
+ * Decoder that attempts to run each decoder in `decoders` and either succeeds
2569
+ * with the first successful decoder, or fails after all decoders have failed.
2570
+ *
2571
+ * Note that `oneOf` expects the decoders to all have the same return type,
2572
+ * while `union` creates a decoder for the union type of all the input
2573
+ * decoders.
2574
+ *
2575
+ * Examples:
2576
+ * ```
2577
+ * oneOf(string(), number().map(String))
2578
+ * oneOf(constant('start'), constant('stop'), succeed('unknown'))
2579
+ * ```
2580
+ */
2581
+ Decoder.oneOf = function () {
2582
+ var decoders = [];
2583
+ for (var _i = 0; _i < arguments.length; _i++) {
2584
+ decoders[_i] = arguments[_i];
2585
+ }
2586
+ return new Decoder(function (json) {
2587
+ var errors = [];
2588
+ for (var i = 0; i < decoders.length; i++) {
2589
+ var r = decoders[i].decode(json);
2590
+ if (r.ok === true) {
2591
+ return r;
2592
+ }
2593
+ else {
2594
+ errors[i] = r.error;
2595
+ }
2596
+ }
2597
+ var errorsList = errors
2598
+ .map(function (error) { return "at error" + (error.at || '') + ": " + error.message; })
2599
+ .join('", "');
2600
+ return err({
2601
+ message: "expected a value matching one of the decoders, got the errors [\"" + errorsList + "\"]"
2602
+ });
2603
+ });
2604
+ };
2605
+ /**
2606
+ * Decoder that always succeeds with either the decoded value, or a fallback
2607
+ * default value.
2608
+ */
2609
+ Decoder.withDefault = function (defaultValue, decoder) {
2610
+ return new Decoder(function (json) {
2611
+ return ok(withDefault(defaultValue, decoder.decode(json)));
2612
+ });
2613
+ };
2614
+ /**
2615
+ * Decoder that pulls a specific field out of a json structure, instead of
2616
+ * decoding and returning the full structure. The `paths` array describes the
2617
+ * object keys and array indices to traverse, so that values can be pulled out
2618
+ * of a nested structure.
2619
+ *
2620
+ * Example:
2621
+ * ```
2622
+ * const decoder = valueAt(['a', 'b', 0], string());
2623
+ *
2624
+ * decoder.run({a: {b: ['surprise!']}})
2625
+ * // => {ok: true, result: 'surprise!'}
2626
+ *
2627
+ * decoder.run({a: {x: 'cats'}})
2628
+ * // => {ok: false, error: {... at: 'input.a.b[0]' message: 'path does not exist'}}
2629
+ * ```
2630
+ *
2631
+ * Note that the `decoder` is ran on the value found at the last key in the
2632
+ * path, even if the last key is not found. This allows the `optional`
2633
+ * decoder to succeed when appropriate.
2634
+ * ```
2635
+ * const optionalDecoder = valueAt(['a', 'b', 'c'], optional(string()));
2636
+ *
2637
+ * optionalDecoder.run({a: {b: {c: 'surprise!'}}})
2638
+ * // => {ok: true, result: 'surprise!'}
2639
+ *
2640
+ * optionalDecoder.run({a: {b: 'cats'}})
2641
+ * // => {ok: false, error: {... at: 'input.a.b.c' message: 'expected an object, got "cats"'}
2642
+ *
2643
+ * optionalDecoder.run({a: {b: {z: 1}}})
2644
+ * // => {ok: true, result: undefined}
2645
+ * ```
2646
+ */
2647
+ Decoder.valueAt = function (paths, decoder) {
2648
+ return new Decoder(function (json) {
2649
+ var jsonAtPath = json;
2650
+ for (var i = 0; i < paths.length; i++) {
2651
+ if (jsonAtPath === undefined) {
2652
+ return err({
2653
+ at: printPath(paths.slice(0, i + 1)),
2654
+ message: 'path does not exist'
2655
+ });
2656
+ }
2657
+ else if (typeof paths[i] === 'string' && !isJsonObject(jsonAtPath)) {
2658
+ return err({
2659
+ at: printPath(paths.slice(0, i + 1)),
2660
+ message: expectedGot('an object', jsonAtPath)
2661
+ });
2662
+ }
2663
+ else if (typeof paths[i] === 'number' && !isJsonArray(jsonAtPath)) {
2664
+ return err({
2665
+ at: printPath(paths.slice(0, i + 1)),
2666
+ message: expectedGot('an array', jsonAtPath)
2667
+ });
2668
+ }
2669
+ else {
2670
+ jsonAtPath = jsonAtPath[paths[i]];
2671
+ }
2672
+ }
2673
+ return mapError(function (error) {
2674
+ return jsonAtPath === undefined
2675
+ ? { at: printPath(paths), message: 'path does not exist' }
2676
+ : prependAt(printPath(paths), error);
2677
+ }, decoder.decode(jsonAtPath));
2678
+ });
2679
+ };
2680
+ /**
2681
+ * Decoder that ignores the input json and always succeeds with `fixedValue`.
2682
+ */
2683
+ Decoder.succeed = function (fixedValue) {
2684
+ return new Decoder(function (json) { return ok(fixedValue); });
2685
+ };
2686
+ /**
2687
+ * Decoder that ignores the input json and always fails with `errorMessage`.
2688
+ */
2689
+ Decoder.fail = function (errorMessage) {
2690
+ return new Decoder(function (json) { return err({ message: errorMessage }); });
2691
+ };
2692
+ /**
2693
+ * Decoder that allows for validating recursive data structures. Unlike with
2694
+ * functions, decoders assigned to variables can't reference themselves
2695
+ * before they are fully defined. We can avoid prematurely referencing the
2696
+ * decoder by wrapping it in a function that won't be called until use, at
2697
+ * which point the decoder has been defined.
2698
+ *
2699
+ * Example:
2700
+ * ```
2701
+ * interface Comment {
2702
+ * msg: string;
2703
+ * replies: Comment[];
2704
+ * }
2705
+ *
2706
+ * const decoder: Decoder<Comment> = object({
2707
+ * msg: string(),
2708
+ * replies: lazy(() => array(decoder))
2709
+ * });
2710
+ * ```
2711
+ */
2712
+ Decoder.lazy = function (mkDecoder) {
2713
+ return new Decoder(function (json) { return mkDecoder().decode(json); });
2714
+ };
2715
+ return Decoder;
2716
+ }());
2717
+
2718
+ /* tslint:disable:variable-name */
2719
+ /** See `Decoder.string` */
2720
+ var string = Decoder.string;
2721
+ /** See `Decoder.number` */
2722
+ var number = Decoder.number;
2723
+ /** See `Decoder.boolean` */
2724
+ var boolean = Decoder.boolean;
2725
+ /** See `Decoder.anyJson` */
2726
+ var anyJson = Decoder.anyJson;
2727
+ /** See `Decoder.unknownJson` */
2728
+ var unknownJson = Decoder.unknownJson;
2729
+ /** See `Decoder.constant` */
2730
+ var constant = Decoder.constant;
2731
+ /** See `Decoder.object` */
2732
+ var object = Decoder.object;
2733
+ /** See `Decoder.array` */
2734
+ var array = Decoder.array;
2735
+ /** See `Decoder.tuple` */
2736
+ var tuple = Decoder.tuple;
2737
+ /** See `Decoder.dict` */
2738
+ var dict = Decoder.dict;
2739
+ /** See `Decoder.optional` */
2740
+ var optional = Decoder.optional;
2741
+ /** See `Decoder.oneOf` */
2742
+ var oneOf = Decoder.oneOf;
2743
+ /** See `Decoder.union` */
2744
+ var union = Decoder.union;
2745
+ /** See `Decoder.intersection` */
2746
+ var intersection = Decoder.intersection;
2747
+ /** See `Decoder.withDefault` */
2748
+ var withDefault$1 = Decoder.withDefault;
2749
+ /** See `Decoder.valueAt` */
2750
+ var valueAt = Decoder.valueAt;
2751
+ /** See `Decoder.succeed` */
2752
+ var succeed = Decoder.succeed;
2753
+ /** See `Decoder.fail` */
2754
+ var fail = Decoder.fail;
2755
+ /** See `Decoder.lazy` */
2756
+ var lazy = Decoder.lazy;
2757
+
2758
+ var index_es5 = /*#__PURE__*/Object.freeze({
2759
+ __proto__: null,
2760
+ Decoder: Decoder,
2761
+ Result: result,
2762
+ anyJson: anyJson,
2763
+ array: array,
2764
+ boolean: boolean,
2765
+ constant: constant,
2766
+ dict: dict,
2767
+ fail: fail,
2768
+ intersection: intersection,
2769
+ isDecoderError: isDecoderError,
2770
+ lazy: lazy,
2771
+ number: number,
2772
+ object: object,
2773
+ oneOf: oneOf,
2774
+ optional: optional,
2775
+ string: string,
2776
+ succeed: succeed,
2777
+ tuple: tuple,
2778
+ union: union,
2779
+ unknownJson: unknownJson,
2780
+ valueAt: valueAt,
2781
+ withDefault: withDefault$1
2782
+ });
2783
+
2784
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_es5);
2785
+
2786
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(lodash);
2787
+
2788
+ var hasRequiredTypes$1;
2789
+
2790
+ function requireTypes$1 () {
2791
+ if (hasRequiredTypes$1) return types;
2792
+ hasRequiredTypes$1 = 1;
2793
+ (function (exports) {
2794
+ var __assign = (types && types.__assign) || function () {
2795
+ __assign = Object.assign || function(t) {
2796
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2797
+ s = arguments[i];
2798
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2799
+ t[p] = s[p];
2800
+ }
2801
+ return t;
2802
+ };
2803
+ return __assign.apply(this, arguments);
2804
+ };
2805
+ var __createBinding = (types && types.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2806
+ if (k2 === undefined) k2 = k;
2807
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2808
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2809
+ desc = { enumerable: true, get: function() { return m[k]; } };
2810
+ }
2811
+ Object.defineProperty(o, k2, desc);
2812
+ }) : (function(o, m, k, k2) {
2813
+ if (k2 === undefined) k2 = k;
2814
+ o[k2] = m[k];
2815
+ }));
2816
+ var __setModuleDefault = (types && types.__setModuleDefault) || (Object.create ? (function(o, v) {
2817
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
2818
+ }) : function(o, v) {
2819
+ o["default"] = v;
2820
+ });
2821
+ var __importStar = (types && types.__importStar) || (function () {
2822
+ var ownKeys = function(o) {
2823
+ ownKeys = Object.getOwnPropertyNames || function (o) {
2824
+ var ar = [];
2825
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
2826
+ return ar;
2827
+ };
2828
+ return ownKeys(o);
2829
+ };
2830
+ return function (mod) {
2831
+ if (mod && mod.__esModule) return mod;
2832
+ var result = {};
2833
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2834
+ __setModuleDefault(result, mod);
2835
+ return result;
2836
+ };
2837
+ })();
2838
+ var __generator = (types && types.__generator) || function (thisArg, body) {
2839
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
2840
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2841
+ function verb(n) { return function (v) { return step([n, v]); }; }
2842
+ function step(op) {
2843
+ if (f) throw new TypeError("Generator is already executing.");
2844
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
2845
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2846
+ if (y = 0, t) op = [op[0] & 2, t.value];
2847
+ switch (op[0]) {
2848
+ case 0: case 1: t = op; break;
2849
+ case 4: _.label++; return { value: op[1], done: false };
2850
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2851
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2852
+ default:
2853
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2854
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2855
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2856
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2857
+ if (t[2]) _.ops.pop();
2858
+ _.trys.pop(); continue;
2859
+ }
2860
+ op = body.call(thisArg, _);
2861
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2862
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2863
+ }
2864
+ };
2865
+ var __importDefault = (types && types.__importDefault) || function (mod) {
2866
+ return (mod && mod.__esModule) ? mod : { "default": mod };
2867
+ };
2868
+ Object.defineProperty(exports, "__esModule", { value: true });
2869
+ exports.Map = exports.emptyMap = exports.TextMap = exports.Optional = exports.ContractId = exports.Date = exports.List = exports.Party = exports.Time = exports.Text = exports.Decimal = exports.Numeric = exports.Int = exports.Bool = exports.Unit = exports.lookupTemplate = exports.templateIdWithPackageId = exports.registerTemplate = void 0;
2870
+ exports.assembleTemplate = assembleTemplate;
2871
+ exports.assembleInterface = assembleInterface;
2872
+ exports.memo = memo;
2873
+ exports.lazyMemo = lazyMemo;
2874
+ // Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2875
+ // SPDX-License-Identifier: Apache-2.0
2876
+ var jtv = __importStar(require$$0);
2877
+ var lodash_1 = __importDefault(require$$1);
2878
+ function toInterfaceMixin() {
2879
+ return {
2880
+ toInterface: function (_, cid) {
2881
+ return cid;
2882
+ },
2883
+ unsafeFromInterface: function (_, cid) {
2884
+ return cid;
2885
+ },
2886
+ };
2887
+ }
2888
+ /**
2889
+ * @internal
2890
+ */
2891
+ function assembleTemplate(template) {
2892
+ return __assign(__assign({}, toInterfaceMixin()), template);
2893
+ }
2894
+ /**
2895
+ * @internal
2896
+ */
2897
+ function assembleInterface(templateId, templatIdWithPackageId, decoderSource, choices) {
2898
+ return __assign({ templateId: templateId, templateIdWithPackageId: templatIdWithPackageId, componentVersionString: "3.5.2",
2899
+ // `Interface<I> &` is a phantom intersection
2900
+ decoder: lazyMemo(function () { return decoderSource().decoder; }), keyDecoder: jtv.succeed(undefined) }, choices);
2901
+ }
2902
+ /**
2903
+ * @internal
2904
+ */
2905
+ var registeredTemplates = {};
2906
+ /**
2907
+ * @internal
2908
+ */
2909
+ var registerTemplate = function (template, packageSpecifiers) {
2910
+ if (packageSpecifiers === void 0) { packageSpecifiers = []; }
2911
+ var aliases = packageSpecifiers.map((0, exports.templateIdWithPackageId)(template));
2912
+ new Set([template.templateId].concat(aliases)).forEach(function (templateId) {
2913
+ if (templateId in registeredTemplates) {
2914
+ console.warn("Trying to re-register template ".concat(templateId, "."));
2915
+ }
2916
+ else {
2917
+ registeredTemplates[templateId] = template;
2918
+ console.debug("Registered template ".concat(templateId, "."));
2919
+ }
2920
+ });
2921
+ };
2922
+ exports.registerTemplate = registerTemplate;
2923
+ /**
2924
+ * @internal
2925
+ */
2926
+ var templateIdWithPackageId = function (t) {
2927
+ return function (pkgId) {
2928
+ return [pkgId].concat(t.templateId.split(":").slice(1)).join(":");
2929
+ };
2930
+ };
2931
+ exports.templateIdWithPackageId = templateIdWithPackageId;
2932
+ /**
2933
+ * @internal
2934
+ */
2935
+ var lookupTemplate = function (templateId) {
2936
+ var template = registeredTemplates[templateId];
2937
+ if (template === undefined) {
2938
+ throw Error("Failed to look up template ".concat(templateId, ". Make sure your @daml/types version agrees with the used Daml SDK version."));
2939
+ }
2940
+ return template;
2941
+ };
2942
+ exports.lookupTemplate = lookupTemplate;
2943
+ /**
2944
+ * @internal Turn a thunk into a memoized version of itself. The memoized thunk
2945
+ * invokes the original thunk only on its first invocation and caches the result
2946
+ * for later uses. We use this to implement a version of `jtv.lazy` with
2947
+ * memoization.
2948
+ */
2949
+ function memo(thunk) {
2950
+ var memoized = function () {
2951
+ var cache = thunk();
2952
+ memoized = function () { return cache; };
2953
+ return cache;
2954
+ };
2955
+ // NOTE(MH): Since we change `memoized` when the resultung thunk is invoked
2956
+ // for the first time, we need to return it "by reference". Thus, we return
2957
+ // a closure which contains a reference to `memoized`.
2958
+ return function () { return memoized(); };
2959
+ }
2960
+ /**
2961
+ * @internal Variation of `jtv.lazy` which memoizes the computed decoder on its
2962
+ * first invocation.
2963
+ */
2964
+ function lazyMemo(mkDecoder) {
2965
+ return jtv.lazy(memo(mkDecoder));
2966
+ }
2967
+ /**
2968
+ * Companion object of the [[Unit]] type.
2969
+ */
2970
+ exports.Unit = {
2971
+ decoder: jtv.object({}),
2972
+ encode: function (t) { return t; },
2973
+ };
2974
+ /**
2975
+ * Companion object of the [[Bool]] type.
2976
+ */
2977
+ exports.Bool = {
2978
+ decoder: jtv.boolean(),
2979
+ encode: function (b) { return b; },
2980
+ };
2981
+ /**
2982
+ * Companion object of the [[Int]] type.
2983
+ */
2984
+ exports.Int = {
2985
+ decoder: jtv.string(),
2986
+ encode: function (i) { return i; },
2987
+ };
2988
+ /**
2989
+ * Companion function of the [[Numeric]] type.
2990
+ */
2991
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2992
+ var Numeric = function (_) { return ({
2993
+ decoder: jtv.string(),
2994
+ encode: function (n) { return n; },
2995
+ }); };
2996
+ exports.Numeric = Numeric;
2997
+ /**
2998
+ * Companion object of the [[Decimal]] type.
2999
+ */
3000
+ exports.Decimal = (0, exports.Numeric)(10);
3001
+ /**
3002
+ * Companion object of the [[Text]] type.
3003
+ */
3004
+ exports.Text = {
3005
+ decoder: jtv.string(),
3006
+ encode: function (t) { return t; },
3007
+ };
3008
+ /**
3009
+ * Companion object of the [[Time]] type.
3010
+ */
3011
+ exports.Time = {
3012
+ decoder: jtv.string(),
3013
+ encode: function (t) { return t; },
3014
+ };
3015
+ /**
3016
+ * Companion object of the [[Party]] type.
3017
+ */
3018
+ exports.Party = {
3019
+ decoder: jtv.string(),
3020
+ encode: function (p) { return p; },
3021
+ };
3022
+ /**
3023
+ * Companion object of the [[List]] type.
3024
+ */
3025
+ var List = function (t) { return ({
3026
+ decoder: jtv.array(t.decoder),
3027
+ encode: function (l) { return l.map(function (element) { return t.encode(element); }); },
3028
+ }); };
3029
+ exports.List = List;
3030
+ /**
3031
+ * Companion object of the [[Date]] type.
3032
+ */
3033
+ exports.Date = {
3034
+ decoder: jtv.string(),
3035
+ encode: function (d) { return d; },
3036
+ };
3037
+ /**
3038
+ * Companion object of the [[ContractId]] type.
3039
+ */
3040
+ var ContractId = function (_t) { return ({
3041
+ decoder: jtv.string(),
3042
+ encode: function (c) { return c; },
3043
+ }); };
3044
+ exports.ContractId = ContractId;
3045
+ /**
3046
+ * This class does the actual work behind the [[Optional]] companion function. In addition to
3047
+ * implementing the [[Serializable]] interface it also stores the [[Serializable]] instance of the
3048
+ * payload of the [[Optional]] and uses it to provide a decoder for the [[OptionalInner]] type.
3049
+ *
3050
+ * @typeparam T The type of the optionally present value.
3051
+ */
3052
+ var OptionalWorker = /** @class */ (function () {
3053
+ function OptionalWorker(payload) {
3054
+ if (payload instanceof OptionalWorker) {
3055
+ var payloadInnerDecoder = payload.innerDecoder;
3056
+ this.innerDecoder = jtv.oneOf(jtv.constant([]), jtv.tuple([payloadInnerDecoder]));
3057
+ this.encode = function (o) {
3058
+ if (o === null) {
3059
+ // Top-level enclosing Optional where the type argument is also
3060
+ // Optional and we represent None.
3061
+ return null;
3062
+ }
3063
+ else {
3064
+ // The current type is Optional<Optional<...>> and the current value
3065
+ // is Some x. Therefore the nested value is represented as [] for
3066
+ // x = None or as [y] for x = Some y. In both cases mapping the
3067
+ // encoder of the type parameter does the right thing.
3068
+ return o.map(function (nested) { return payload.encode(nested); });
3069
+ }
3070
+ };
3071
+ }
3072
+ else {
3073
+ // NOTE(MH): `T` is not of the form `Optional<U>` here and hence `null`
3074
+ // does not extend `T`. Thus, `OptionalInner<T> = T`.
3075
+ this.innerDecoder = payload.decoder;
3076
+ this.encode = function (o) {
3077
+ if (o === null) {
3078
+ // This branch is only reached if we are at the top-level and the
3079
+ // entire type is a non-nested Optional, i.e. Optional<U> where U is
3080
+ // not Optional. Recursive calls from the other branch would stop
3081
+ // before reaching this case, as nested None are empty lists and
3082
+ // never null.
3083
+ return null;
3084
+ }
3085
+ else {
3086
+ return payload.encode(o);
3087
+ }
3088
+ };
3089
+ }
3090
+ this.decoder = jtv
3091
+ .optional(jtv.oneOf(jtv.constant(null), this.innerDecoder))
3092
+ .map(function (x) { return (x === undefined ? null : x); });
3093
+ }
3094
+ return OptionalWorker;
3095
+ }());
3096
+ /**
3097
+ * Companion function of the [[Optional]] type.
3098
+ */
3099
+ var Optional = function (t) {
3100
+ return new OptionalWorker(t);
3101
+ };
3102
+ exports.Optional = Optional;
3103
+ /**
3104
+ * Companion object of the [[TextMap]] type.
3105
+ */
3106
+ var TextMap = function (t) { return ({
3107
+ decoder: jtv.dict(t.decoder),
3108
+ encode: function (tm) {
3109
+ var out = {};
3110
+ Object.keys(tm).forEach(function (k) {
3111
+ out[k] = t.encode(tm[k]);
3112
+ });
3113
+ return out;
3114
+ },
3115
+ }); };
3116
+ exports.TextMap = TextMap;
3117
+ function it(arr) {
3118
+ var i;
3119
+ return __generator(this, function (_a) {
3120
+ switch (_a.label) {
3121
+ case 0:
3122
+ i = 0;
3123
+ _a.label = 1;
3124
+ case 1:
3125
+ if (!(i < arr.length)) return [3 /*break*/, 4];
3126
+ return [4 /*yield*/, lodash_1.default.cloneDeep(arr[i])];
3127
+ case 2:
3128
+ _a.sent();
3129
+ _a.label = 3;
3130
+ case 3:
3131
+ i++;
3132
+ return [3 /*break*/, 1];
3133
+ case 4: return [2 /*return*/, undefined];
3134
+ }
3135
+ });
3136
+ }
3137
+ // This code assumes that the decoder is only ever used in decoding values
3138
+ // straight from the API responses, and said raw responses are never reused
3139
+ // afterwards. This should be enforced by this class not being exported and the
3140
+ // daml-ledger module not letting raw JSON responses escape without going
3141
+ // through this.
3142
+ //
3143
+ // Without that assumption, the constructor would need to deep-copy its kvs
3144
+ // argument.
3145
+ var MapImpl = /** @class */ (function () {
3146
+ function MapImpl(kvs) {
3147
+ // sorting done so that generic object deep comparison would find equal
3148
+ // maps equal (as defined by jest's expect().toEqual())
3149
+ this._kvs = lodash_1.default.sortBy(kvs, function (kv) { return JSON.stringify(kv[0]); });
3150
+ this._keys = this._kvs.map(function (e) { return e[0]; });
3151
+ this._values = this._kvs.map(function (e) { return e[1]; });
3152
+ }
3153
+ MapImpl.prototype._idx = function (k) {
3154
+ return this._keys.findIndex(function (l) { return lodash_1.default.isEqual(k, l); });
3155
+ };
3156
+ MapImpl.prototype.has = function (k) {
3157
+ return this._idx(k) !== -1;
3158
+ };
3159
+ MapImpl.prototype.get = function (k) {
3160
+ return lodash_1.default.cloneDeep(this._values[this._idx(k)]);
3161
+ };
3162
+ MapImpl.prototype.set = function (k, v) {
3163
+ if (this.has(k)) {
3164
+ var cpy = this._kvs.slice();
3165
+ cpy[this._idx(k)] = lodash_1.default.cloneDeep([k, v]);
3166
+ return new MapImpl(cpy);
3167
+ }
3168
+ else {
3169
+ var head = lodash_1.default.cloneDeep([[k, v]]);
3170
+ return new MapImpl(head.concat(this._kvs));
3171
+ }
3172
+ };
3173
+ MapImpl.prototype.delete = function (k) {
3174
+ var i = this._idx(k);
3175
+ if (i !== -1) {
3176
+ return new MapImpl(this._kvs.slice(0, i).concat(this._kvs.slice(i + 1)));
3177
+ }
3178
+ else {
3179
+ return this;
3180
+ }
3181
+ };
3182
+ MapImpl.prototype.keys = function () {
3183
+ return it(this._keys);
3184
+ };
3185
+ MapImpl.prototype.values = function () {
3186
+ return it(this._values);
3187
+ };
3188
+ MapImpl.prototype.entries = function () {
3189
+ return it(this._kvs);
3190
+ };
3191
+ MapImpl.prototype.entriesArray = function () {
3192
+ return lodash_1.default.cloneDeep(this._kvs);
3193
+ };
3194
+ MapImpl.prototype.forEach = function (f, u) {
3195
+ var g = u ? f.bind(u) : f;
3196
+ for (var _i = 0, _a = this._kvs; _i < _a.length; _i++) {
3197
+ var _b = _a[_i], k = _b[0], v = _b[1];
3198
+ g(v, k, this);
3199
+ }
3200
+ };
3201
+ return MapImpl;
3202
+ }());
3203
+ var emptyMap = function () { return new MapImpl([]); };
3204
+ exports.emptyMap = emptyMap;
3205
+ /**
3206
+ * Companion function of the [[GenMap]] type.
3207
+ */
3208
+ var Map = function (kd, vd) { return ({
3209
+ decoder: jtv
3210
+ .array(jtv.tuple([kd.decoder, vd.decoder]))
3211
+ .map(function (kvs) { return new MapImpl(kvs); }),
3212
+ encode: function (m) {
3213
+ return m.entriesArray().map(function (e) { return [kd.encode(e[0]), vd.encode(e[1])]; });
3214
+ },
3215
+ }); };
3216
+ exports.Map = Map;
3217
+
3218
+ } (types));
3219
+ return types;
3220
+ }
116
3221
 
117
3222
  var lib$1 = {};
118
3223
 
@@ -132,9 +3237,9 @@ function requireModule$7 () {
132
3237
  (function (exports) {
133
3238
  Object.defineProperty(exports, "__esModule", { value: true });
134
3239
  /* eslint-disable-next-line no-unused-vars */
135
- var jtv = require$$0;
3240
+ var jtv = require$$0$1;
136
3241
  /* eslint-disable-next-line no-unused-vars */
137
- var damlTypes = require$$1;
3242
+ var damlTypes = requireTypes$1();
138
3243
 
139
3244
 
140
3245
  exports.Archive = {
@@ -228,9 +3333,9 @@ function requireModule$6 () {
228
3333
  (function (exports) {
229
3334
  Object.defineProperty(exports, "__esModule", { value: true });
230
3335
  /* eslint-disable-next-line no-unused-vars */
231
- var jtv = require$$0;
3336
+ var jtv = require$$0$1;
232
3337
  /* eslint-disable-next-line no-unused-vars */
233
- var damlTypes = require$$1;
3338
+ var damlTypes = requireTypes$1();
234
3339
 
235
3340
 
236
3341
  exports.RelTime = {
@@ -313,9 +3418,9 @@ function requireModule$5 () {
313
3418
  (function (exports) {
314
3419
  Object.defineProperty(exports, "__esModule", { value: true });
315
3420
  /* eslint-disable-next-line no-unused-vars */
316
- var jtv = require$$0;
3421
+ var jtv = require$$0$1;
317
3422
  /* eslint-disable-next-line no-unused-vars */
318
- var damlTypes = require$$1;
3423
+ var damlTypes = requireTypes$1();
319
3424
 
320
3425
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
321
3426
  var pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946 = requireLib$1();
@@ -429,9 +3534,9 @@ function requireModule$4 () {
429
3534
  (function (exports) {
430
3535
  Object.defineProperty(exports, "__esModule", { value: true });
431
3536
  /* eslint-disable-next-line no-unused-vars */
432
- var jtv = require$$0;
3537
+ var jtv = require$$0$1;
433
3538
  /* eslint-disable-next-line no-unused-vars */
434
- var damlTypes = require$$1;
3539
+ var damlTypes = requireTypes$1();
435
3540
 
436
3541
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
437
3542
  var pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946 = requireLib$1();
@@ -508,9 +3613,9 @@ function requireModule$3 () {
508
3613
  (function (exports) {
509
3614
  Object.defineProperty(exports, "__esModule", { value: true });
510
3615
  /* eslint-disable-next-line no-unused-vars */
511
- var jtv = require$$0;
3616
+ var jtv = require$$0$1;
512
3617
  /* eslint-disable-next-line no-unused-vars */
513
- var damlTypes = require$$1;
3618
+ var damlTypes = requireTypes$1();
514
3619
 
515
3620
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
516
3621
 
@@ -717,9 +3822,9 @@ function requireModule$2 () {
717
3822
  (function (exports) {
718
3823
  Object.defineProperty(exports, "__esModule", { value: true });
719
3824
  /* eslint-disable-next-line no-unused-vars */
720
- var jtv = require$$0;
3825
+ var jtv = require$$0$1;
721
3826
  /* eslint-disable-next-line no-unused-vars */
722
- var damlTypes = require$$1;
3827
+ var damlTypes = requireTypes$1();
723
3828
 
724
3829
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
725
3830
 
@@ -957,9 +4062,9 @@ function requireModule$1 () {
957
4062
  (function (exports) {
958
4063
  Object.defineProperty(exports, "__esModule", { value: true });
959
4064
  /* eslint-disable-next-line no-unused-vars */
960
- var jtv = require$$0;
4065
+ var jtv = require$$0$1;
961
4066
  /* eslint-disable-next-line no-unused-vars */
962
- var damlTypes = require$$1;
4067
+ var damlTypes = requireTypes$1();
963
4068
 
964
4069
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
965
4070
 
@@ -1125,9 +4230,9 @@ function requireModule () {
1125
4230
  (function (exports) {
1126
4231
  Object.defineProperty(exports, "__esModule", { value: true });
1127
4232
  /* eslint-disable-next-line no-unused-vars */
1128
- var jtv = require$$0;
4233
+ var jtv = require$$0$1;
1129
4234
  /* eslint-disable-next-line no-unused-vars */
1130
- var damlTypes = require$$1;
4235
+ var damlTypes = requireTypes$1();
1131
4236
 
1132
4237
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
1133
4238