@bigbinary/neeto-templates-frontend 1.1.18 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useRef, useCallback, useEffect, memo } from 'react';
3
- import { noop, removeBy, renameKeys } from 'neetocist';
3
+ import { noop, removeBy, renameKeys } from '@bigbinary/neeto-cist';
4
4
  import { Typography, Spinner, Button, Modal, Label } from '@bigbinary/neetoui';
5
5
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
6
6
  import Search from '@bigbinary/neeto-molecules/Search';
@@ -8,7 +8,6 @@ import { useTranslation } from 'react-i18next';
8
8
  import { prop, pluck } from 'ramda';
9
9
  import { useQuery, useQueryClient, useMutation, useInfiniteQuery } from 'react-query';
10
10
  import axios from 'axios';
11
- import require$$0 from 'util';
12
11
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
13
12
  import { t as t$1 } from 'i18next';
14
13
  import classnames from 'classnames';
@@ -26,31 +25,31 @@ function _arrayWithHoles(arr) {
26
25
  if (Array.isArray(arr)) return arr;
27
26
  }
28
27
 
29
- function _iterableToArrayLimit(arr, i) {
30
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
31
- if (null != _i) {
32
- var _s,
33
- _e,
34
- _x,
35
- _r,
36
- _arr = [],
37
- _n = !0,
38
- _d = !1;
28
+ function _iterableToArrayLimit(r, l) {
29
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
30
+ if (null != t) {
31
+ var e,
32
+ n,
33
+ i,
34
+ u,
35
+ a = [],
36
+ f = !0,
37
+ o = !1;
39
38
  try {
40
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
41
- if (Object(_i) !== _i) return;
42
- _n = !1;
43
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
44
- } catch (err) {
45
- _d = !0, _e = err;
39
+ if (i = (t = t.call(r)).next, 0 === l) {
40
+ if (Object(t) !== t) return;
41
+ f = !1;
42
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
43
+ } catch (r) {
44
+ o = !0, n = r;
46
45
  } finally {
47
46
  try {
48
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
47
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
49
48
  } finally {
50
- if (_d) throw _e;
49
+ if (o) throw n;
51
50
  }
52
51
  }
53
- return _arr;
52
+ return a;
54
53
  }
55
54
  }
56
55
 
@@ -91,14 +90,14 @@ var MENU_ITEMS = {
91
90
  PREVIEW: "preview"
92
91
  };
93
92
 
94
- function _typeof(obj) {
93
+ function _typeof(o) {
95
94
  "@babel/helpers - typeof";
96
95
 
97
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
98
- return typeof obj;
99
- } : function (obj) {
100
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
101
- }, _typeof(obj);
96
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
97
+ return typeof o;
98
+ } : function (o) {
99
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
100
+ }, _typeof(o);
102
101
  }
103
102
 
104
103
  function _toPrimitive(input, hint) {
@@ -380,2054 +379,6 @@ const SvgCustom = props => /*#__PURE__*/React.createElement("svg", _extends({
380
379
  clipRule: "evenodd"
381
380
  })));
382
381
 
383
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
384
- var shams = function hasSymbols() {
385
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
386
- if (typeof Symbol.iterator === 'symbol') { return true; }
387
-
388
- var obj = {};
389
- var sym = Symbol('test');
390
- var symObj = Object(sym);
391
- if (typeof sym === 'string') { return false; }
392
-
393
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
394
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
395
-
396
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
397
- // if (sym instanceof Symbol) { return false; }
398
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
399
- // if (!(symObj instanceof Symbol)) { return false; }
400
-
401
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
402
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
403
-
404
- var symVal = 42;
405
- obj[sym] = symVal;
406
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
407
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
408
-
409
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
410
-
411
- var syms = Object.getOwnPropertySymbols(obj);
412
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
413
-
414
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
415
-
416
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
417
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
418
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
419
- }
420
-
421
- return true;
422
- };
423
-
424
- var origSymbol = typeof Symbol !== 'undefined' && Symbol;
425
- var hasSymbolSham = shams;
426
-
427
- var hasSymbols$1 = function hasNativeSymbols() {
428
- if (typeof origSymbol !== 'function') { return false; }
429
- if (typeof Symbol !== 'function') { return false; }
430
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
431
- if (typeof Symbol('bar') !== 'symbol') { return false; }
432
-
433
- return hasSymbolSham();
434
- };
435
-
436
- var test = {
437
- foo: {}
438
- };
439
-
440
- var $Object = Object;
441
-
442
- var hasProto$1 = function hasProto() {
443
- return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
444
- };
445
-
446
- /* eslint no-invalid-this: 1 */
447
-
448
- var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
449
- var slice = Array.prototype.slice;
450
- var toStr$1 = Object.prototype.toString;
451
- var funcType = '[object Function]';
452
-
453
- var implementation$1 = function bind(that) {
454
- var target = this;
455
- if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
456
- throw new TypeError(ERROR_MESSAGE + target);
457
- }
458
- var args = slice.call(arguments, 1);
459
-
460
- var bound;
461
- var binder = function () {
462
- if (this instanceof bound) {
463
- var result = target.apply(
464
- this,
465
- args.concat(slice.call(arguments))
466
- );
467
- if (Object(result) === result) {
468
- return result;
469
- }
470
- return this;
471
- } else {
472
- return target.apply(
473
- that,
474
- args.concat(slice.call(arguments))
475
- );
476
- }
477
- };
478
-
479
- var boundLength = Math.max(0, target.length - args.length);
480
- var boundArgs = [];
481
- for (var i = 0; i < boundLength; i++) {
482
- boundArgs.push('$' + i);
483
- }
484
-
485
- bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
486
-
487
- if (target.prototype) {
488
- var Empty = function Empty() {};
489
- Empty.prototype = target.prototype;
490
- bound.prototype = new Empty();
491
- Empty.prototype = null;
492
- }
493
-
494
- return bound;
495
- };
496
-
497
- var implementation = implementation$1;
498
-
499
- var functionBind = Function.prototype.bind || implementation;
500
-
501
- var bind$1 = functionBind;
502
-
503
- var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
504
-
505
- var undefined$1;
506
-
507
- var $SyntaxError = SyntaxError;
508
- var $Function = Function;
509
- var $TypeError$1 = TypeError;
510
-
511
- // eslint-disable-next-line consistent-return
512
- var getEvalledConstructor = function (expressionSyntax) {
513
- try {
514
- return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
515
- } catch (e) {}
516
- };
517
-
518
- var $gOPD = Object.getOwnPropertyDescriptor;
519
- if ($gOPD) {
520
- try {
521
- $gOPD({}, '');
522
- } catch (e) {
523
- $gOPD = null; // this is IE 8, which has a broken gOPD
524
- }
525
- }
526
-
527
- var throwTypeError = function () {
528
- throw new $TypeError$1();
529
- };
530
- var ThrowTypeError = $gOPD
531
- ? (function () {
532
- try {
533
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
534
- arguments.callee; // IE 8 does not throw here
535
- return throwTypeError;
536
- } catch (calleeThrows) {
537
- try {
538
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
539
- return $gOPD(arguments, 'callee').get;
540
- } catch (gOPDthrows) {
541
- return throwTypeError;
542
- }
543
- }
544
- }())
545
- : throwTypeError;
546
-
547
- var hasSymbols = hasSymbols$1();
548
- var hasProto = hasProto$1();
549
-
550
- var getProto = Object.getPrototypeOf || (
551
- hasProto
552
- ? function (x) { return x.__proto__; } // eslint-disable-line no-proto
553
- : null
554
- );
555
-
556
- var needsEval = {};
557
-
558
- var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
559
-
560
- var INTRINSICS = {
561
- '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
562
- '%Array%': Array,
563
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
564
- '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
565
- '%AsyncFromSyncIteratorPrototype%': undefined$1,
566
- '%AsyncFunction%': needsEval,
567
- '%AsyncGenerator%': needsEval,
568
- '%AsyncGeneratorFunction%': needsEval,
569
- '%AsyncIteratorPrototype%': needsEval,
570
- '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
571
- '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
572
- '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
573
- '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
574
- '%Boolean%': Boolean,
575
- '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
576
- '%Date%': Date,
577
- '%decodeURI%': decodeURI,
578
- '%decodeURIComponent%': decodeURIComponent,
579
- '%encodeURI%': encodeURI,
580
- '%encodeURIComponent%': encodeURIComponent,
581
- '%Error%': Error,
582
- '%eval%': eval, // eslint-disable-line no-eval
583
- '%EvalError%': EvalError,
584
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
585
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
586
- '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
587
- '%Function%': $Function,
588
- '%GeneratorFunction%': needsEval,
589
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
590
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
591
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
592
- '%isFinite%': isFinite,
593
- '%isNaN%': isNaN,
594
- '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
595
- '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
596
- '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
597
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
598
- '%Math%': Math,
599
- '%Number%': Number,
600
- '%Object%': Object,
601
- '%parseFloat%': parseFloat,
602
- '%parseInt%': parseInt,
603
- '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
604
- '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
605
- '%RangeError%': RangeError,
606
- '%ReferenceError%': ReferenceError,
607
- '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
608
- '%RegExp%': RegExp,
609
- '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
610
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
611
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
612
- '%String%': String,
613
- '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
614
- '%Symbol%': hasSymbols ? Symbol : undefined$1,
615
- '%SyntaxError%': $SyntaxError,
616
- '%ThrowTypeError%': ThrowTypeError,
617
- '%TypedArray%': TypedArray,
618
- '%TypeError%': $TypeError$1,
619
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
620
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
621
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
622
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
623
- '%URIError%': URIError,
624
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
625
- '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
626
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
627
- };
628
-
629
- if (getProto) {
630
- try {
631
- null.error; // eslint-disable-line no-unused-expressions
632
- } catch (e) {
633
- // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
634
- var errorProto = getProto(getProto(e));
635
- INTRINSICS['%Error.prototype%'] = errorProto;
636
- }
637
- }
638
-
639
- var doEval = function doEval(name) {
640
- var value;
641
- if (name === '%AsyncFunction%') {
642
- value = getEvalledConstructor('async function () {}');
643
- } else if (name === '%GeneratorFunction%') {
644
- value = getEvalledConstructor('function* () {}');
645
- } else if (name === '%AsyncGeneratorFunction%') {
646
- value = getEvalledConstructor('async function* () {}');
647
- } else if (name === '%AsyncGenerator%') {
648
- var fn = doEval('%AsyncGeneratorFunction%');
649
- if (fn) {
650
- value = fn.prototype;
651
- }
652
- } else if (name === '%AsyncIteratorPrototype%') {
653
- var gen = doEval('%AsyncGenerator%');
654
- if (gen && getProto) {
655
- value = getProto(gen.prototype);
656
- }
657
- }
658
-
659
- INTRINSICS[name] = value;
660
-
661
- return value;
662
- };
663
-
664
- var LEGACY_ALIASES = {
665
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
666
- '%ArrayPrototype%': ['Array', 'prototype'],
667
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
668
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
669
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
670
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
671
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
672
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
673
- '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
674
- '%BooleanPrototype%': ['Boolean', 'prototype'],
675
- '%DataViewPrototype%': ['DataView', 'prototype'],
676
- '%DatePrototype%': ['Date', 'prototype'],
677
- '%ErrorPrototype%': ['Error', 'prototype'],
678
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
679
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
680
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
681
- '%FunctionPrototype%': ['Function', 'prototype'],
682
- '%Generator%': ['GeneratorFunction', 'prototype'],
683
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
684
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
685
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
686
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
687
- '%JSONParse%': ['JSON', 'parse'],
688
- '%JSONStringify%': ['JSON', 'stringify'],
689
- '%MapPrototype%': ['Map', 'prototype'],
690
- '%NumberPrototype%': ['Number', 'prototype'],
691
- '%ObjectPrototype%': ['Object', 'prototype'],
692
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
693
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
694
- '%PromisePrototype%': ['Promise', 'prototype'],
695
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
696
- '%Promise_all%': ['Promise', 'all'],
697
- '%Promise_reject%': ['Promise', 'reject'],
698
- '%Promise_resolve%': ['Promise', 'resolve'],
699
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
700
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
701
- '%RegExpPrototype%': ['RegExp', 'prototype'],
702
- '%SetPrototype%': ['Set', 'prototype'],
703
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
704
- '%StringPrototype%': ['String', 'prototype'],
705
- '%SymbolPrototype%': ['Symbol', 'prototype'],
706
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
707
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
708
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
709
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
710
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
711
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
712
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
713
- '%URIErrorPrototype%': ['URIError', 'prototype'],
714
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
715
- '%WeakSetPrototype%': ['WeakSet', 'prototype']
716
- };
717
-
718
- var bind = functionBind;
719
- var hasOwn$1 = src;
720
- var $concat$1 = bind.call(Function.call, Array.prototype.concat);
721
- var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
722
- var $replace$1 = bind.call(Function.call, String.prototype.replace);
723
- var $strSlice = bind.call(Function.call, String.prototype.slice);
724
- var $exec = bind.call(Function.call, RegExp.prototype.exec);
725
-
726
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
727
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
728
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
729
- var stringToPath = function stringToPath(string) {
730
- var first = $strSlice(string, 0, 1);
731
- var last = $strSlice(string, -1);
732
- if (first === '%' && last !== '%') {
733
- throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
734
- } else if (last === '%' && first !== '%') {
735
- throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
736
- }
737
- var result = [];
738
- $replace$1(string, rePropName, function (match, number, quote, subString) {
739
- result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
740
- });
741
- return result;
742
- };
743
- /* end adaptation */
744
-
745
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
746
- var intrinsicName = name;
747
- var alias;
748
- if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
749
- alias = LEGACY_ALIASES[intrinsicName];
750
- intrinsicName = '%' + alias[0] + '%';
751
- }
752
-
753
- if (hasOwn$1(INTRINSICS, intrinsicName)) {
754
- var value = INTRINSICS[intrinsicName];
755
- if (value === needsEval) {
756
- value = doEval(intrinsicName);
757
- }
758
- if (typeof value === 'undefined' && !allowMissing) {
759
- throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
760
- }
761
-
762
- return {
763
- alias: alias,
764
- name: intrinsicName,
765
- value: value
766
- };
767
- }
768
-
769
- throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
770
- };
771
-
772
- var getIntrinsic = function GetIntrinsic(name, allowMissing) {
773
- if (typeof name !== 'string' || name.length === 0) {
774
- throw new $TypeError$1('intrinsic name must be a non-empty string');
775
- }
776
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
777
- throw new $TypeError$1('"allowMissing" argument must be a boolean');
778
- }
779
-
780
- if ($exec(/^%?[^%]*%?$/, name) === null) {
781
- throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
782
- }
783
- var parts = stringToPath(name);
784
- var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
785
-
786
- var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
787
- var intrinsicRealName = intrinsic.name;
788
- var value = intrinsic.value;
789
- var skipFurtherCaching = false;
790
-
791
- var alias = intrinsic.alias;
792
- if (alias) {
793
- intrinsicBaseName = alias[0];
794
- $spliceApply(parts, $concat$1([0, 1], alias));
795
- }
796
-
797
- for (var i = 1, isOwn = true; i < parts.length; i += 1) {
798
- var part = parts[i];
799
- var first = $strSlice(part, 0, 1);
800
- var last = $strSlice(part, -1);
801
- if (
802
- (
803
- (first === '"' || first === "'" || first === '`')
804
- || (last === '"' || last === "'" || last === '`')
805
- )
806
- && first !== last
807
- ) {
808
- throw new $SyntaxError('property names with quotes must have matching quotes');
809
- }
810
- if (part === 'constructor' || !isOwn) {
811
- skipFurtherCaching = true;
812
- }
813
-
814
- intrinsicBaseName += '.' + part;
815
- intrinsicRealName = '%' + intrinsicBaseName + '%';
816
-
817
- if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
818
- value = INTRINSICS[intrinsicRealName];
819
- } else if (value != null) {
820
- if (!(part in value)) {
821
- if (!allowMissing) {
822
- throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
823
- }
824
- return void undefined$1;
825
- }
826
- if ($gOPD && (i + 1) >= parts.length) {
827
- var desc = $gOPD(value, part);
828
- isOwn = !!desc;
829
-
830
- // By convention, when a data property is converted to an accessor
831
- // property to emulate a data property that does not suffer from
832
- // the override mistake, that accessor's getter is marked with
833
- // an `originalValue` property. Here, when we detect this, we
834
- // uphold the illusion by pretending to see that original data
835
- // property, i.e., returning the value rather than the getter
836
- // itself.
837
- if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
838
- value = desc.get;
839
- } else {
840
- value = value[part];
841
- }
842
- } else {
843
- isOwn = hasOwn$1(value, part);
844
- value = value[part];
845
- }
846
-
847
- if (isOwn && !skipFurtherCaching) {
848
- INTRINSICS[intrinsicRealName] = value;
849
- }
850
- }
851
- }
852
- return value;
853
- };
854
-
855
- var callBind$1 = {exports: {}};
856
-
857
- callBind$1.exports;
858
-
859
- (function (module) {
860
-
861
- var bind = functionBind;
862
- var GetIntrinsic = getIntrinsic;
863
-
864
- var $apply = GetIntrinsic('%Function.prototype.apply%');
865
- var $call = GetIntrinsic('%Function.prototype.call%');
866
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
867
-
868
- var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
869
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
870
- var $max = GetIntrinsic('%Math.max%');
871
-
872
- if ($defineProperty) {
873
- try {
874
- $defineProperty({}, 'a', { value: 1 });
875
- } catch (e) {
876
- // IE 8 has a broken defineProperty
877
- $defineProperty = null;
878
- }
879
- }
880
-
881
- module.exports = function callBind(originalFunction) {
882
- var func = $reflectApply(bind, $call, arguments);
883
- if ($gOPD && $defineProperty) {
884
- var desc = $gOPD(func, 'length');
885
- if (desc.configurable) {
886
- // original length, plus the receiver, minus any additional arguments (after the receiver)
887
- $defineProperty(
888
- func,
889
- 'length',
890
- { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
891
- );
892
- }
893
- }
894
- return func;
895
- };
896
-
897
- var applyBind = function applyBind() {
898
- return $reflectApply(bind, $apply, arguments);
899
- };
900
-
901
- if ($defineProperty) {
902
- $defineProperty(module.exports, 'apply', { value: applyBind });
903
- } else {
904
- module.exports.apply = applyBind;
905
- }
906
- } (callBind$1));
907
-
908
- var callBindExports = callBind$1.exports;
909
-
910
- var GetIntrinsic$1 = getIntrinsic;
911
-
912
- var callBind = callBindExports;
913
-
914
- var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
915
-
916
- var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
917
- var intrinsic = GetIntrinsic$1(name, !!allowMissing);
918
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
919
- return callBind(intrinsic);
920
- }
921
- return intrinsic;
922
- };
923
-
924
- var util_inspect = require$$0.inspect;
925
-
926
- var hasMap = typeof Map === 'function' && Map.prototype;
927
- var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
928
- var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
929
- var mapForEach = hasMap && Map.prototype.forEach;
930
- var hasSet = typeof Set === 'function' && Set.prototype;
931
- var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
932
- var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
933
- var setForEach = hasSet && Set.prototype.forEach;
934
- var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
935
- var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
936
- var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
937
- var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
938
- var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
939
- var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
940
- var booleanValueOf = Boolean.prototype.valueOf;
941
- var objectToString = Object.prototype.toString;
942
- var functionToString = Function.prototype.toString;
943
- var $match = String.prototype.match;
944
- var $slice = String.prototype.slice;
945
- var $replace = String.prototype.replace;
946
- var $toUpperCase = String.prototype.toUpperCase;
947
- var $toLowerCase = String.prototype.toLowerCase;
948
- var $test = RegExp.prototype.test;
949
- var $concat = Array.prototype.concat;
950
- var $join = Array.prototype.join;
951
- var $arrSlice = Array.prototype.slice;
952
- var $floor = Math.floor;
953
- var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
954
- var gOPS = Object.getOwnPropertySymbols;
955
- var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
956
- var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
957
- // ie, `has-tostringtag/shams
958
- var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
959
- ? Symbol.toStringTag
960
- : null;
961
- var isEnumerable = Object.prototype.propertyIsEnumerable;
962
-
963
- var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
964
- [].__proto__ === Array.prototype // eslint-disable-line no-proto
965
- ? function (O) {
966
- return O.__proto__; // eslint-disable-line no-proto
967
- }
968
- : null
969
- );
970
-
971
- function addNumericSeparator(num, str) {
972
- if (
973
- num === Infinity
974
- || num === -Infinity
975
- || num !== num
976
- || (num && num > -1000 && num < 1000)
977
- || $test.call(/e/, str)
978
- ) {
979
- return str;
980
- }
981
- var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
982
- if (typeof num === 'number') {
983
- var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
984
- if (int !== num) {
985
- var intStr = String(int);
986
- var dec = $slice.call(str, intStr.length + 1);
987
- return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
988
- }
989
- }
990
- return $replace.call(str, sepRegex, '$&_');
991
- }
992
-
993
- var utilInspect = util_inspect;
994
- var inspectCustom = utilInspect.custom;
995
- var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
996
-
997
- var objectInspect = function inspect_(obj, options, depth, seen) {
998
- var opts = options || {};
999
-
1000
- if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
1001
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
1002
- }
1003
- if (
1004
- has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
1005
- ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
1006
- : opts.maxStringLength !== null
1007
- )
1008
- ) {
1009
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
1010
- }
1011
- var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
1012
- if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
1013
- throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
1014
- }
1015
-
1016
- if (
1017
- has$3(opts, 'indent')
1018
- && opts.indent !== null
1019
- && opts.indent !== '\t'
1020
- && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
1021
- ) {
1022
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1023
- }
1024
- if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
1025
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1026
- }
1027
- var numericSeparator = opts.numericSeparator;
1028
-
1029
- if (typeof obj === 'undefined') {
1030
- return 'undefined';
1031
- }
1032
- if (obj === null) {
1033
- return 'null';
1034
- }
1035
- if (typeof obj === 'boolean') {
1036
- return obj ? 'true' : 'false';
1037
- }
1038
-
1039
- if (typeof obj === 'string') {
1040
- return inspectString(obj, opts);
1041
- }
1042
- if (typeof obj === 'number') {
1043
- if (obj === 0) {
1044
- return Infinity / obj > 0 ? '0' : '-0';
1045
- }
1046
- var str = String(obj);
1047
- return numericSeparator ? addNumericSeparator(obj, str) : str;
1048
- }
1049
- if (typeof obj === 'bigint') {
1050
- var bigIntStr = String(obj) + 'n';
1051
- return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
1052
- }
1053
-
1054
- var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
1055
- if (typeof depth === 'undefined') { depth = 0; }
1056
- if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
1057
- return isArray$3(obj) ? '[Array]' : '[Object]';
1058
- }
1059
-
1060
- var indent = getIndent(opts, depth);
1061
-
1062
- if (typeof seen === 'undefined') {
1063
- seen = [];
1064
- } else if (indexOf(seen, obj) >= 0) {
1065
- return '[Circular]';
1066
- }
1067
-
1068
- function inspect(value, from, noIndent) {
1069
- if (from) {
1070
- seen = $arrSlice.call(seen);
1071
- seen.push(from);
1072
- }
1073
- if (noIndent) {
1074
- var newOpts = {
1075
- depth: opts.depth
1076
- };
1077
- if (has$3(opts, 'quoteStyle')) {
1078
- newOpts.quoteStyle = opts.quoteStyle;
1079
- }
1080
- return inspect_(value, newOpts, depth + 1, seen);
1081
- }
1082
- return inspect_(value, opts, depth + 1, seen);
1083
- }
1084
-
1085
- if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
1086
- var name = nameOf(obj);
1087
- var keys = arrObjKeys(obj, inspect);
1088
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
1089
- }
1090
- if (isSymbol(obj)) {
1091
- var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
1092
- return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
1093
- }
1094
- if (isElement(obj)) {
1095
- var s = '<' + $toLowerCase.call(String(obj.nodeName));
1096
- var attrs = obj.attributes || [];
1097
- for (var i = 0; i < attrs.length; i++) {
1098
- s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
1099
- }
1100
- s += '>';
1101
- if (obj.childNodes && obj.childNodes.length) { s += '...'; }
1102
- s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
1103
- return s;
1104
- }
1105
- if (isArray$3(obj)) {
1106
- if (obj.length === 0) { return '[]'; }
1107
- var xs = arrObjKeys(obj, inspect);
1108
- if (indent && !singleLineValues(xs)) {
1109
- return '[' + indentedJoin(xs, indent) + ']';
1110
- }
1111
- return '[ ' + $join.call(xs, ', ') + ' ]';
1112
- }
1113
- if (isError(obj)) {
1114
- var parts = arrObjKeys(obj, inspect);
1115
- if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1116
- return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1117
- }
1118
- if (parts.length === 0) { return '[' + String(obj) + ']'; }
1119
- return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1120
- }
1121
- if (typeof obj === 'object' && customInspect) {
1122
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1123
- return utilInspect(obj, { depth: maxDepth - depth });
1124
- } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1125
- return obj.inspect();
1126
- }
1127
- }
1128
- if (isMap(obj)) {
1129
- var mapParts = [];
1130
- if (mapForEach) {
1131
- mapForEach.call(obj, function (value, key) {
1132
- mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
1133
- });
1134
- }
1135
- return collectionOf('Map', mapSize.call(obj), mapParts, indent);
1136
- }
1137
- if (isSet(obj)) {
1138
- var setParts = [];
1139
- if (setForEach) {
1140
- setForEach.call(obj, function (value) {
1141
- setParts.push(inspect(value, obj));
1142
- });
1143
- }
1144
- return collectionOf('Set', setSize.call(obj), setParts, indent);
1145
- }
1146
- if (isWeakMap(obj)) {
1147
- return weakCollectionOf('WeakMap');
1148
- }
1149
- if (isWeakSet(obj)) {
1150
- return weakCollectionOf('WeakSet');
1151
- }
1152
- if (isWeakRef(obj)) {
1153
- return weakCollectionOf('WeakRef');
1154
- }
1155
- if (isNumber(obj)) {
1156
- return markBoxed(inspect(Number(obj)));
1157
- }
1158
- if (isBigInt(obj)) {
1159
- return markBoxed(inspect(bigIntValueOf.call(obj)));
1160
- }
1161
- if (isBoolean(obj)) {
1162
- return markBoxed(booleanValueOf.call(obj));
1163
- }
1164
- if (isString(obj)) {
1165
- return markBoxed(inspect(String(obj)));
1166
- }
1167
- if (!isDate(obj) && !isRegExp$1(obj)) {
1168
- var ys = arrObjKeys(obj, inspect);
1169
- var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
1170
- var protoTag = obj instanceof Object ? '' : 'null prototype';
1171
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
1172
- var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
1173
- var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
1174
- if (ys.length === 0) { return tag + '{}'; }
1175
- if (indent) {
1176
- return tag + '{' + indentedJoin(ys, indent) + '}';
1177
- }
1178
- return tag + '{ ' + $join.call(ys, ', ') + ' }';
1179
- }
1180
- return String(obj);
1181
- };
1182
-
1183
- function wrapQuotes(s, defaultStyle, opts) {
1184
- var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
1185
- return quoteChar + s + quoteChar;
1186
- }
1187
-
1188
- function quote(s) {
1189
- return $replace.call(String(s), /"/g, '&quot;');
1190
- }
1191
-
1192
- function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1193
- function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1194
- function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1195
- function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1196
- function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1197
- function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1198
- function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
1199
-
1200
- // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
1201
- function isSymbol(obj) {
1202
- if (hasShammedSymbols) {
1203
- return obj && typeof obj === 'object' && obj instanceof Symbol;
1204
- }
1205
- if (typeof obj === 'symbol') {
1206
- return true;
1207
- }
1208
- if (!obj || typeof obj !== 'object' || !symToString) {
1209
- return false;
1210
- }
1211
- try {
1212
- symToString.call(obj);
1213
- return true;
1214
- } catch (e) {}
1215
- return false;
1216
- }
1217
-
1218
- function isBigInt(obj) {
1219
- if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
1220
- return false;
1221
- }
1222
- try {
1223
- bigIntValueOf.call(obj);
1224
- return true;
1225
- } catch (e) {}
1226
- return false;
1227
- }
1228
-
1229
- var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
1230
- function has$3(obj, key) {
1231
- return hasOwn.call(obj, key);
1232
- }
1233
-
1234
- function toStr(obj) {
1235
- return objectToString.call(obj);
1236
- }
1237
-
1238
- function nameOf(f) {
1239
- if (f.name) { return f.name; }
1240
- var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
1241
- if (m) { return m[1]; }
1242
- return null;
1243
- }
1244
-
1245
- function indexOf(xs, x) {
1246
- if (xs.indexOf) { return xs.indexOf(x); }
1247
- for (var i = 0, l = xs.length; i < l; i++) {
1248
- if (xs[i] === x) { return i; }
1249
- }
1250
- return -1;
1251
- }
1252
-
1253
- function isMap(x) {
1254
- if (!mapSize || !x || typeof x !== 'object') {
1255
- return false;
1256
- }
1257
- try {
1258
- mapSize.call(x);
1259
- try {
1260
- setSize.call(x);
1261
- } catch (s) {
1262
- return true;
1263
- }
1264
- return x instanceof Map; // core-js workaround, pre-v2.5.0
1265
- } catch (e) {}
1266
- return false;
1267
- }
1268
-
1269
- function isWeakMap(x) {
1270
- if (!weakMapHas || !x || typeof x !== 'object') {
1271
- return false;
1272
- }
1273
- try {
1274
- weakMapHas.call(x, weakMapHas);
1275
- try {
1276
- weakSetHas.call(x, weakSetHas);
1277
- } catch (s) {
1278
- return true;
1279
- }
1280
- return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
1281
- } catch (e) {}
1282
- return false;
1283
- }
1284
-
1285
- function isWeakRef(x) {
1286
- if (!weakRefDeref || !x || typeof x !== 'object') {
1287
- return false;
1288
- }
1289
- try {
1290
- weakRefDeref.call(x);
1291
- return true;
1292
- } catch (e) {}
1293
- return false;
1294
- }
1295
-
1296
- function isSet(x) {
1297
- if (!setSize || !x || typeof x !== 'object') {
1298
- return false;
1299
- }
1300
- try {
1301
- setSize.call(x);
1302
- try {
1303
- mapSize.call(x);
1304
- } catch (m) {
1305
- return true;
1306
- }
1307
- return x instanceof Set; // core-js workaround, pre-v2.5.0
1308
- } catch (e) {}
1309
- return false;
1310
- }
1311
-
1312
- function isWeakSet(x) {
1313
- if (!weakSetHas || !x || typeof x !== 'object') {
1314
- return false;
1315
- }
1316
- try {
1317
- weakSetHas.call(x, weakSetHas);
1318
- try {
1319
- weakMapHas.call(x, weakMapHas);
1320
- } catch (s) {
1321
- return true;
1322
- }
1323
- return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
1324
- } catch (e) {}
1325
- return false;
1326
- }
1327
-
1328
- function isElement(x) {
1329
- if (!x || typeof x !== 'object') { return false; }
1330
- if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
1331
- return true;
1332
- }
1333
- return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
1334
- }
1335
-
1336
- function inspectString(str, opts) {
1337
- if (str.length > opts.maxStringLength) {
1338
- var remaining = str.length - opts.maxStringLength;
1339
- var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
1340
- return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
1341
- }
1342
- // eslint-disable-next-line no-control-regex
1343
- var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
1344
- return wrapQuotes(s, 'single', opts);
1345
- }
1346
-
1347
- function lowbyte(c) {
1348
- var n = c.charCodeAt(0);
1349
- var x = {
1350
- 8: 'b',
1351
- 9: 't',
1352
- 10: 'n',
1353
- 12: 'f',
1354
- 13: 'r'
1355
- }[n];
1356
- if (x) { return '\\' + x; }
1357
- return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
1358
- }
1359
-
1360
- function markBoxed(str) {
1361
- return 'Object(' + str + ')';
1362
- }
1363
-
1364
- function weakCollectionOf(type) {
1365
- return type + ' { ? }';
1366
- }
1367
-
1368
- function collectionOf(type, size, entries, indent) {
1369
- var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
1370
- return type + ' (' + size + ') {' + joinedEntries + '}';
1371
- }
1372
-
1373
- function singleLineValues(xs) {
1374
- for (var i = 0; i < xs.length; i++) {
1375
- if (indexOf(xs[i], '\n') >= 0) {
1376
- return false;
1377
- }
1378
- }
1379
- return true;
1380
- }
1381
-
1382
- function getIndent(opts, depth) {
1383
- var baseIndent;
1384
- if (opts.indent === '\t') {
1385
- baseIndent = '\t';
1386
- } else if (typeof opts.indent === 'number' && opts.indent > 0) {
1387
- baseIndent = $join.call(Array(opts.indent + 1), ' ');
1388
- } else {
1389
- return null;
1390
- }
1391
- return {
1392
- base: baseIndent,
1393
- prev: $join.call(Array(depth + 1), baseIndent)
1394
- };
1395
- }
1396
-
1397
- function indentedJoin(xs, indent) {
1398
- if (xs.length === 0) { return ''; }
1399
- var lineJoiner = '\n' + indent.prev + indent.base;
1400
- return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
1401
- }
1402
-
1403
- function arrObjKeys(obj, inspect) {
1404
- var isArr = isArray$3(obj);
1405
- var xs = [];
1406
- if (isArr) {
1407
- xs.length = obj.length;
1408
- for (var i = 0; i < obj.length; i++) {
1409
- xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
1410
- }
1411
- }
1412
- var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
1413
- var symMap;
1414
- if (hasShammedSymbols) {
1415
- symMap = {};
1416
- for (var k = 0; k < syms.length; k++) {
1417
- symMap['$' + syms[k]] = syms[k];
1418
- }
1419
- }
1420
-
1421
- for (var key in obj) { // eslint-disable-line no-restricted-syntax
1422
- if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1423
- if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
1424
- if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
1425
- // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
1426
- continue; // eslint-disable-line no-restricted-syntax, no-continue
1427
- } else if ($test.call(/[^\w$]/, key)) {
1428
- xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
1429
- } else {
1430
- xs.push(key + ': ' + inspect(obj[key], obj));
1431
- }
1432
- }
1433
- if (typeof gOPS === 'function') {
1434
- for (var j = 0; j < syms.length; j++) {
1435
- if (isEnumerable.call(obj, syms[j])) {
1436
- xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
1437
- }
1438
- }
1439
- }
1440
- return xs;
1441
- }
1442
-
1443
- var GetIntrinsic = getIntrinsic;
1444
- var callBound = callBound$1;
1445
- var inspect = objectInspect;
1446
-
1447
- var $TypeError = GetIntrinsic('%TypeError%');
1448
- var $WeakMap = GetIntrinsic('%WeakMap%', true);
1449
- var $Map = GetIntrinsic('%Map%', true);
1450
-
1451
- var $weakMapGet = callBound('WeakMap.prototype.get', true);
1452
- var $weakMapSet = callBound('WeakMap.prototype.set', true);
1453
- var $weakMapHas = callBound('WeakMap.prototype.has', true);
1454
- var $mapGet = callBound('Map.prototype.get', true);
1455
- var $mapSet = callBound('Map.prototype.set', true);
1456
- var $mapHas = callBound('Map.prototype.has', true);
1457
-
1458
- /*
1459
- * This function traverses the list returning the node corresponding to the
1460
- * given key.
1461
- *
1462
- * That node is also moved to the head of the list, so that if it's accessed
1463
- * again we don't need to traverse the whole list. By doing so, all the recently
1464
- * used nodes can be accessed relatively quickly.
1465
- */
1466
- var listGetNode = function (list, key) { // eslint-disable-line consistent-return
1467
- for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
1468
- if (curr.key === key) {
1469
- prev.next = curr.next;
1470
- curr.next = list.next;
1471
- list.next = curr; // eslint-disable-line no-param-reassign
1472
- return curr;
1473
- }
1474
- }
1475
- };
1476
-
1477
- var listGet = function (objects, key) {
1478
- var node = listGetNode(objects, key);
1479
- return node && node.value;
1480
- };
1481
- var listSet = function (objects, key, value) {
1482
- var node = listGetNode(objects, key);
1483
- if (node) {
1484
- node.value = value;
1485
- } else {
1486
- // Prepend the new node to the beginning of the list
1487
- objects.next = { // eslint-disable-line no-param-reassign
1488
- key: key,
1489
- next: objects.next,
1490
- value: value
1491
- };
1492
- }
1493
- };
1494
- var listHas = function (objects, key) {
1495
- return !!listGetNode(objects, key);
1496
- };
1497
-
1498
- var sideChannel = function getSideChannel() {
1499
- var $wm;
1500
- var $m;
1501
- var $o;
1502
- var channel = {
1503
- assert: function (key) {
1504
- if (!channel.has(key)) {
1505
- throw new $TypeError('Side channel does not contain ' + inspect(key));
1506
- }
1507
- },
1508
- get: function (key) { // eslint-disable-line consistent-return
1509
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1510
- if ($wm) {
1511
- return $weakMapGet($wm, key);
1512
- }
1513
- } else if ($Map) {
1514
- if ($m) {
1515
- return $mapGet($m, key);
1516
- }
1517
- } else {
1518
- if ($o) { // eslint-disable-line no-lonely-if
1519
- return listGet($o, key);
1520
- }
1521
- }
1522
- },
1523
- has: function (key) {
1524
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1525
- if ($wm) {
1526
- return $weakMapHas($wm, key);
1527
- }
1528
- } else if ($Map) {
1529
- if ($m) {
1530
- return $mapHas($m, key);
1531
- }
1532
- } else {
1533
- if ($o) { // eslint-disable-line no-lonely-if
1534
- return listHas($o, key);
1535
- }
1536
- }
1537
- return false;
1538
- },
1539
- set: function (key, value) {
1540
- if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1541
- if (!$wm) {
1542
- $wm = new $WeakMap();
1543
- }
1544
- $weakMapSet($wm, key, value);
1545
- } else if ($Map) {
1546
- if (!$m) {
1547
- $m = new $Map();
1548
- }
1549
- $mapSet($m, key, value);
1550
- } else {
1551
- if (!$o) {
1552
- /*
1553
- * Initialize the linked list as an empty node, so that we don't have
1554
- * to special-case handling of the first node: we can always refer to
1555
- * it as (previous node).next, instead of something like (list).head
1556
- */
1557
- $o = { key: {}, next: null };
1558
- }
1559
- listSet($o, key, value);
1560
- }
1561
- }
1562
- };
1563
- return channel;
1564
- };
1565
-
1566
- var replace = String.prototype.replace;
1567
- var percentTwenties = /%20/g;
1568
-
1569
- var Format = {
1570
- RFC1738: 'RFC1738',
1571
- RFC3986: 'RFC3986'
1572
- };
1573
-
1574
- var formats$3 = {
1575
- 'default': Format.RFC3986,
1576
- formatters: {
1577
- RFC1738: function (value) {
1578
- return replace.call(value, percentTwenties, '+');
1579
- },
1580
- RFC3986: function (value) {
1581
- return String(value);
1582
- }
1583
- },
1584
- RFC1738: Format.RFC1738,
1585
- RFC3986: Format.RFC3986
1586
- };
1587
-
1588
- var formats$2 = formats$3;
1589
-
1590
- var has$2 = Object.prototype.hasOwnProperty;
1591
- var isArray$2 = Array.isArray;
1592
-
1593
- var hexTable = (function () {
1594
- var array = [];
1595
- for (var i = 0; i < 256; ++i) {
1596
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
1597
- }
1598
-
1599
- return array;
1600
- }());
1601
-
1602
- var compactQueue = function compactQueue(queue) {
1603
- while (queue.length > 1) {
1604
- var item = queue.pop();
1605
- var obj = item.obj[item.prop];
1606
-
1607
- if (isArray$2(obj)) {
1608
- var compacted = [];
1609
-
1610
- for (var j = 0; j < obj.length; ++j) {
1611
- if (typeof obj[j] !== 'undefined') {
1612
- compacted.push(obj[j]);
1613
- }
1614
- }
1615
-
1616
- item.obj[item.prop] = compacted;
1617
- }
1618
- }
1619
- };
1620
-
1621
- var arrayToObject = function arrayToObject(source, options) {
1622
- var obj = options && options.plainObjects ? Object.create(null) : {};
1623
- for (var i = 0; i < source.length; ++i) {
1624
- if (typeof source[i] !== 'undefined') {
1625
- obj[i] = source[i];
1626
- }
1627
- }
1628
-
1629
- return obj;
1630
- };
1631
-
1632
- var merge = function merge(target, source, options) {
1633
- /* eslint no-param-reassign: 0 */
1634
- if (!source) {
1635
- return target;
1636
- }
1637
-
1638
- if (typeof source !== 'object') {
1639
- if (isArray$2(target)) {
1640
- target.push(source);
1641
- } else if (target && typeof target === 'object') {
1642
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
1643
- target[source] = true;
1644
- }
1645
- } else {
1646
- return [target, source];
1647
- }
1648
-
1649
- return target;
1650
- }
1651
-
1652
- if (!target || typeof target !== 'object') {
1653
- return [target].concat(source);
1654
- }
1655
-
1656
- var mergeTarget = target;
1657
- if (isArray$2(target) && !isArray$2(source)) {
1658
- mergeTarget = arrayToObject(target, options);
1659
- }
1660
-
1661
- if (isArray$2(target) && isArray$2(source)) {
1662
- source.forEach(function (item, i) {
1663
- if (has$2.call(target, i)) {
1664
- var targetItem = target[i];
1665
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
1666
- target[i] = merge(targetItem, item, options);
1667
- } else {
1668
- target.push(item);
1669
- }
1670
- } else {
1671
- target[i] = item;
1672
- }
1673
- });
1674
- return target;
1675
- }
1676
-
1677
- return Object.keys(source).reduce(function (acc, key) {
1678
- var value = source[key];
1679
-
1680
- if (has$2.call(acc, key)) {
1681
- acc[key] = merge(acc[key], value, options);
1682
- } else {
1683
- acc[key] = value;
1684
- }
1685
- return acc;
1686
- }, mergeTarget);
1687
- };
1688
-
1689
- var assign = function assignSingleSource(target, source) {
1690
- return Object.keys(source).reduce(function (acc, key) {
1691
- acc[key] = source[key];
1692
- return acc;
1693
- }, target);
1694
- };
1695
-
1696
- var decode = function (str, decoder, charset) {
1697
- var strWithoutPlus = str.replace(/\+/g, ' ');
1698
- if (charset === 'iso-8859-1') {
1699
- // unescape never throws, no try...catch needed:
1700
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1701
- }
1702
- // utf-8
1703
- try {
1704
- return decodeURIComponent(strWithoutPlus);
1705
- } catch (e) {
1706
- return strWithoutPlus;
1707
- }
1708
- };
1709
-
1710
- var encode = function encode(str, defaultEncoder, charset, kind, format) {
1711
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1712
- // It has been adapted here for stricter adherence to RFC 3986
1713
- if (str.length === 0) {
1714
- return str;
1715
- }
1716
-
1717
- var string = str;
1718
- if (typeof str === 'symbol') {
1719
- string = Symbol.prototype.toString.call(str);
1720
- } else if (typeof str !== 'string') {
1721
- string = String(str);
1722
- }
1723
-
1724
- if (charset === 'iso-8859-1') {
1725
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1726
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1727
- });
1728
- }
1729
-
1730
- var out = '';
1731
- for (var i = 0; i < string.length; ++i) {
1732
- var c = string.charCodeAt(i);
1733
-
1734
- if (
1735
- c === 0x2D // -
1736
- || c === 0x2E // .
1737
- || c === 0x5F // _
1738
- || c === 0x7E // ~
1739
- || (c >= 0x30 && c <= 0x39) // 0-9
1740
- || (c >= 0x41 && c <= 0x5A) // a-z
1741
- || (c >= 0x61 && c <= 0x7A) // A-Z
1742
- || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
1743
- ) {
1744
- out += string.charAt(i);
1745
- continue;
1746
- }
1747
-
1748
- if (c < 0x80) {
1749
- out = out + hexTable[c];
1750
- continue;
1751
- }
1752
-
1753
- if (c < 0x800) {
1754
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1755
- continue;
1756
- }
1757
-
1758
- if (c < 0xD800 || c >= 0xE000) {
1759
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1760
- continue;
1761
- }
1762
-
1763
- i += 1;
1764
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1765
- /* eslint operator-linebreak: [2, "before"] */
1766
- out += hexTable[0xF0 | (c >> 18)]
1767
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
1768
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
1769
- + hexTable[0x80 | (c & 0x3F)];
1770
- }
1771
-
1772
- return out;
1773
- };
1774
-
1775
- var compact = function compact(value) {
1776
- var queue = [{ obj: { o: value }, prop: 'o' }];
1777
- var refs = [];
1778
-
1779
- for (var i = 0; i < queue.length; ++i) {
1780
- var item = queue[i];
1781
- var obj = item.obj[item.prop];
1782
-
1783
- var keys = Object.keys(obj);
1784
- for (var j = 0; j < keys.length; ++j) {
1785
- var key = keys[j];
1786
- var val = obj[key];
1787
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1788
- queue.push({ obj: obj, prop: key });
1789
- refs.push(val);
1790
- }
1791
- }
1792
- }
1793
-
1794
- compactQueue(queue);
1795
-
1796
- return value;
1797
- };
1798
-
1799
- var isRegExp = function isRegExp(obj) {
1800
- return Object.prototype.toString.call(obj) === '[object RegExp]';
1801
- };
1802
-
1803
- var isBuffer = function isBuffer(obj) {
1804
- if (!obj || typeof obj !== 'object') {
1805
- return false;
1806
- }
1807
-
1808
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1809
- };
1810
-
1811
- var combine = function combine(a, b) {
1812
- return [].concat(a, b);
1813
- };
1814
-
1815
- var maybeMap = function maybeMap(val, fn) {
1816
- if (isArray$2(val)) {
1817
- var mapped = [];
1818
- for (var i = 0; i < val.length; i += 1) {
1819
- mapped.push(fn(val[i]));
1820
- }
1821
- return mapped;
1822
- }
1823
- return fn(val);
1824
- };
1825
-
1826
- var utils$2 = {
1827
- arrayToObject: arrayToObject,
1828
- assign: assign,
1829
- combine: combine,
1830
- compact: compact,
1831
- decode: decode,
1832
- encode: encode,
1833
- isBuffer: isBuffer,
1834
- isRegExp: isRegExp,
1835
- maybeMap: maybeMap,
1836
- merge: merge
1837
- };
1838
-
1839
- var getSideChannel = sideChannel;
1840
- var utils$1 = utils$2;
1841
- var formats$1 = formats$3;
1842
- var has$1 = Object.prototype.hasOwnProperty;
1843
-
1844
- var arrayPrefixGenerators = {
1845
- brackets: function brackets(prefix) {
1846
- return prefix + '[]';
1847
- },
1848
- comma: 'comma',
1849
- indices: function indices(prefix, key) {
1850
- return prefix + '[' + key + ']';
1851
- },
1852
- repeat: function repeat(prefix) {
1853
- return prefix;
1854
- }
1855
- };
1856
-
1857
- var isArray$1 = Array.isArray;
1858
- var push = Array.prototype.push;
1859
- var pushToArray = function (arr, valueOrArray) {
1860
- push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
1861
- };
1862
-
1863
- var toISO = Date.prototype.toISOString;
1864
-
1865
- var defaultFormat = formats$1['default'];
1866
- var defaults$1 = {
1867
- addQueryPrefix: false,
1868
- allowDots: false,
1869
- charset: 'utf-8',
1870
- charsetSentinel: false,
1871
- delimiter: '&',
1872
- encode: true,
1873
- encoder: utils$1.encode,
1874
- encodeValuesOnly: false,
1875
- format: defaultFormat,
1876
- formatter: formats$1.formatters[defaultFormat],
1877
- // deprecated
1878
- indices: false,
1879
- serializeDate: function serializeDate(date) {
1880
- return toISO.call(date);
1881
- },
1882
- skipNulls: false,
1883
- strictNullHandling: false
1884
- };
1885
-
1886
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
1887
- return typeof v === 'string'
1888
- || typeof v === 'number'
1889
- || typeof v === 'boolean'
1890
- || typeof v === 'symbol'
1891
- || typeof v === 'bigint';
1892
- };
1893
-
1894
- var sentinel = {};
1895
-
1896
- var stringify$1 = function stringify(
1897
- object,
1898
- prefix,
1899
- generateArrayPrefix,
1900
- commaRoundTrip,
1901
- strictNullHandling,
1902
- skipNulls,
1903
- encoder,
1904
- filter,
1905
- sort,
1906
- allowDots,
1907
- serializeDate,
1908
- format,
1909
- formatter,
1910
- encodeValuesOnly,
1911
- charset,
1912
- sideChannel
1913
- ) {
1914
- var obj = object;
1915
-
1916
- var tmpSc = sideChannel;
1917
- var step = 0;
1918
- var findFlag = false;
1919
- while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
1920
- // Where object last appeared in the ref tree
1921
- var pos = tmpSc.get(object);
1922
- step += 1;
1923
- if (typeof pos !== 'undefined') {
1924
- if (pos === step) {
1925
- throw new RangeError('Cyclic object value');
1926
- } else {
1927
- findFlag = true; // Break while
1928
- }
1929
- }
1930
- if (typeof tmpSc.get(sentinel) === 'undefined') {
1931
- step = 0;
1932
- }
1933
- }
1934
-
1935
- if (typeof filter === 'function') {
1936
- obj = filter(prefix, obj);
1937
- } else if (obj instanceof Date) {
1938
- obj = serializeDate(obj);
1939
- } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1940
- obj = utils$1.maybeMap(obj, function (value) {
1941
- if (value instanceof Date) {
1942
- return serializeDate(value);
1943
- }
1944
- return value;
1945
- });
1946
- }
1947
-
1948
- if (obj === null) {
1949
- if (strictNullHandling) {
1950
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
1951
- }
1952
-
1953
- obj = '';
1954
- }
1955
-
1956
- if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
1957
- if (encoder) {
1958
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
1959
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
1960
- }
1961
- return [formatter(prefix) + '=' + formatter(String(obj))];
1962
- }
1963
-
1964
- var values = [];
1965
-
1966
- if (typeof obj === 'undefined') {
1967
- return values;
1968
- }
1969
-
1970
- var objKeys;
1971
- if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
1972
- // we need to join elements in
1973
- if (encodeValuesOnly && encoder) {
1974
- obj = utils$1.maybeMap(obj, encoder);
1975
- }
1976
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
1977
- } else if (isArray$1(filter)) {
1978
- objKeys = filter;
1979
- } else {
1980
- var keys = Object.keys(obj);
1981
- objKeys = sort ? keys.sort(sort) : keys;
1982
- }
1983
-
1984
- var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
1985
-
1986
- for (var j = 0; j < objKeys.length; ++j) {
1987
- var key = objKeys[j];
1988
- var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
1989
-
1990
- if (skipNulls && value === null) {
1991
- continue;
1992
- }
1993
-
1994
- var keyPrefix = isArray$1(obj)
1995
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
1996
- : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
1997
-
1998
- sideChannel.set(object, step);
1999
- var valueSideChannel = getSideChannel();
2000
- valueSideChannel.set(sentinel, sideChannel);
2001
- pushToArray(values, stringify(
2002
- value,
2003
- keyPrefix,
2004
- generateArrayPrefix,
2005
- commaRoundTrip,
2006
- strictNullHandling,
2007
- skipNulls,
2008
- generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
2009
- filter,
2010
- sort,
2011
- allowDots,
2012
- serializeDate,
2013
- format,
2014
- formatter,
2015
- encodeValuesOnly,
2016
- charset,
2017
- valueSideChannel
2018
- ));
2019
- }
2020
-
2021
- return values;
2022
- };
2023
-
2024
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
2025
- if (!opts) {
2026
- return defaults$1;
2027
- }
2028
-
2029
- if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
2030
- throw new TypeError('Encoder has to be a function.');
2031
- }
2032
-
2033
- var charset = opts.charset || defaults$1.charset;
2034
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2035
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2036
- }
2037
-
2038
- var format = formats$1['default'];
2039
- if (typeof opts.format !== 'undefined') {
2040
- if (!has$1.call(formats$1.formatters, opts.format)) {
2041
- throw new TypeError('Unknown format option provided.');
2042
- }
2043
- format = opts.format;
2044
- }
2045
- var formatter = formats$1.formatters[format];
2046
-
2047
- var filter = defaults$1.filter;
2048
- if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
2049
- filter = opts.filter;
2050
- }
2051
-
2052
- return {
2053
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
2054
- allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
2055
- charset: charset,
2056
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
2057
- delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
2058
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
2059
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
2060
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
2061
- filter: filter,
2062
- format: format,
2063
- formatter: formatter,
2064
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
2065
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
2066
- sort: typeof opts.sort === 'function' ? opts.sort : null,
2067
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
2068
- };
2069
- };
2070
-
2071
- var stringify_1 = function (object, opts) {
2072
- var obj = object;
2073
- var options = normalizeStringifyOptions(opts);
2074
-
2075
- var objKeys;
2076
- var filter;
2077
-
2078
- if (typeof options.filter === 'function') {
2079
- filter = options.filter;
2080
- obj = filter('', obj);
2081
- } else if (isArray$1(options.filter)) {
2082
- filter = options.filter;
2083
- objKeys = filter;
2084
- }
2085
-
2086
- var keys = [];
2087
-
2088
- if (typeof obj !== 'object' || obj === null) {
2089
- return '';
2090
- }
2091
-
2092
- var arrayFormat;
2093
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
2094
- arrayFormat = opts.arrayFormat;
2095
- } else if (opts && 'indices' in opts) {
2096
- arrayFormat = opts.indices ? 'indices' : 'repeat';
2097
- } else {
2098
- arrayFormat = 'indices';
2099
- }
2100
-
2101
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
2102
- if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2103
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2104
- }
2105
- var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
2106
-
2107
- if (!objKeys) {
2108
- objKeys = Object.keys(obj);
2109
- }
2110
-
2111
- if (options.sort) {
2112
- objKeys.sort(options.sort);
2113
- }
2114
-
2115
- var sideChannel = getSideChannel();
2116
- for (var i = 0; i < objKeys.length; ++i) {
2117
- var key = objKeys[i];
2118
-
2119
- if (options.skipNulls && obj[key] === null) {
2120
- continue;
2121
- }
2122
- pushToArray(keys, stringify$1(
2123
- obj[key],
2124
- key,
2125
- generateArrayPrefix,
2126
- commaRoundTrip,
2127
- options.strictNullHandling,
2128
- options.skipNulls,
2129
- options.encode ? options.encoder : null,
2130
- options.filter,
2131
- options.sort,
2132
- options.allowDots,
2133
- options.serializeDate,
2134
- options.format,
2135
- options.formatter,
2136
- options.encodeValuesOnly,
2137
- options.charset,
2138
- sideChannel
2139
- ));
2140
- }
2141
-
2142
- var joined = keys.join(options.delimiter);
2143
- var prefix = options.addQueryPrefix === true ? '?' : '';
2144
-
2145
- if (options.charsetSentinel) {
2146
- if (options.charset === 'iso-8859-1') {
2147
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
2148
- prefix += 'utf8=%26%2310003%3B&';
2149
- } else {
2150
- // encodeURIComponent('✓')
2151
- prefix += 'utf8=%E2%9C%93&';
2152
- }
2153
- }
2154
-
2155
- return joined.length > 0 ? prefix + joined : '';
2156
- };
2157
-
2158
- var utils = utils$2;
2159
-
2160
- var has = Object.prototype.hasOwnProperty;
2161
- var isArray = Array.isArray;
2162
-
2163
- var defaults = {
2164
- allowDots: false,
2165
- allowPrototypes: false,
2166
- allowSparse: false,
2167
- arrayLimit: 20,
2168
- charset: 'utf-8',
2169
- charsetSentinel: false,
2170
- comma: false,
2171
- decoder: utils.decode,
2172
- delimiter: '&',
2173
- depth: 5,
2174
- ignoreQueryPrefix: false,
2175
- interpretNumericEntities: false,
2176
- parameterLimit: 1000,
2177
- parseArrays: true,
2178
- plainObjects: false,
2179
- strictNullHandling: false
2180
- };
2181
-
2182
- var interpretNumericEntities = function (str) {
2183
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2184
- return String.fromCharCode(parseInt(numberStr, 10));
2185
- });
2186
- };
2187
-
2188
- var parseArrayValue = function (val, options) {
2189
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2190
- return val.split(',');
2191
- }
2192
-
2193
- return val;
2194
- };
2195
-
2196
- // This is what browsers will submit when the ✓ character occurs in an
2197
- // application/x-www-form-urlencoded body and the encoding of the page containing
2198
- // the form is iso-8859-1, or when the submitted form has an accept-charset
2199
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2200
- // the ✓ character, such as us-ascii.
2201
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2202
-
2203
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2204
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2205
-
2206
- var parseValues = function parseQueryStringValues(str, options) {
2207
- var obj = { __proto__: null };
2208
-
2209
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2210
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2211
- var parts = cleanStr.split(options.delimiter, limit);
2212
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2213
- var i;
2214
-
2215
- var charset = options.charset;
2216
- if (options.charsetSentinel) {
2217
- for (i = 0; i < parts.length; ++i) {
2218
- if (parts[i].indexOf('utf8=') === 0) {
2219
- if (parts[i] === charsetSentinel) {
2220
- charset = 'utf-8';
2221
- } else if (parts[i] === isoSentinel) {
2222
- charset = 'iso-8859-1';
2223
- }
2224
- skipIndex = i;
2225
- i = parts.length; // The eslint settings do not allow break;
2226
- }
2227
- }
2228
- }
2229
-
2230
- for (i = 0; i < parts.length; ++i) {
2231
- if (i === skipIndex) {
2232
- continue;
2233
- }
2234
- var part = parts[i];
2235
-
2236
- var bracketEqualsPos = part.indexOf(']=');
2237
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2238
-
2239
- var key, val;
2240
- if (pos === -1) {
2241
- key = options.decoder(part, defaults.decoder, charset, 'key');
2242
- val = options.strictNullHandling ? null : '';
2243
- } else {
2244
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2245
- val = utils.maybeMap(
2246
- parseArrayValue(part.slice(pos + 1), options),
2247
- function (encodedVal) {
2248
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2249
- }
2250
- );
2251
- }
2252
-
2253
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2254
- val = interpretNumericEntities(val);
2255
- }
2256
-
2257
- if (part.indexOf('[]=') > -1) {
2258
- val = isArray(val) ? [val] : val;
2259
- }
2260
-
2261
- if (has.call(obj, key)) {
2262
- obj[key] = utils.combine(obj[key], val);
2263
- } else {
2264
- obj[key] = val;
2265
- }
2266
- }
2267
-
2268
- return obj;
2269
- };
2270
-
2271
- var parseObject = function (chain, val, options, valuesParsed) {
2272
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
2273
-
2274
- for (var i = chain.length - 1; i >= 0; --i) {
2275
- var obj;
2276
- var root = chain[i];
2277
-
2278
- if (root === '[]' && options.parseArrays) {
2279
- obj = [].concat(leaf);
2280
- } else {
2281
- obj = options.plainObjects ? Object.create(null) : {};
2282
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2283
- var index = parseInt(cleanRoot, 10);
2284
- if (!options.parseArrays && cleanRoot === '') {
2285
- obj = { 0: leaf };
2286
- } else if (
2287
- !isNaN(index)
2288
- && root !== cleanRoot
2289
- && String(index) === cleanRoot
2290
- && index >= 0
2291
- && (options.parseArrays && index <= options.arrayLimit)
2292
- ) {
2293
- obj = [];
2294
- obj[index] = leaf;
2295
- } else if (cleanRoot !== '__proto__') {
2296
- obj[cleanRoot] = leaf;
2297
- }
2298
- }
2299
-
2300
- leaf = obj;
2301
- }
2302
-
2303
- return leaf;
2304
- };
2305
-
2306
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2307
- if (!givenKey) {
2308
- return;
2309
- }
2310
-
2311
- // Transform dot notation to bracket notation
2312
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2313
-
2314
- // The regex chunks
2315
-
2316
- var brackets = /(\[[^[\]]*])/;
2317
- var child = /(\[[^[\]]*])/g;
2318
-
2319
- // Get the parent
2320
-
2321
- var segment = options.depth > 0 && brackets.exec(key);
2322
- var parent = segment ? key.slice(0, segment.index) : key;
2323
-
2324
- // Stash the parent if it exists
2325
-
2326
- var keys = [];
2327
- if (parent) {
2328
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2329
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
2330
- if (!options.allowPrototypes) {
2331
- return;
2332
- }
2333
- }
2334
-
2335
- keys.push(parent);
2336
- }
2337
-
2338
- // Loop through children appending to the array until we hit depth
2339
-
2340
- var i = 0;
2341
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2342
- i += 1;
2343
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2344
- if (!options.allowPrototypes) {
2345
- return;
2346
- }
2347
- }
2348
- keys.push(segment[1]);
2349
- }
2350
-
2351
- // If there's a remainder, just add whatever is left
2352
-
2353
- if (segment) {
2354
- keys.push('[' + key.slice(segment.index) + ']');
2355
- }
2356
-
2357
- return parseObject(keys, val, options, valuesParsed);
2358
- };
2359
-
2360
- var normalizeParseOptions = function normalizeParseOptions(opts) {
2361
- if (!opts) {
2362
- return defaults;
2363
- }
2364
-
2365
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
2366
- throw new TypeError('Decoder has to be a function.');
2367
- }
2368
-
2369
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2370
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2371
- }
2372
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2373
-
2374
- return {
2375
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
2376
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2377
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2378
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2379
- charset: charset,
2380
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2381
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2382
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2383
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2384
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2385
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2386
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2387
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2388
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2389
- parseArrays: opts.parseArrays !== false,
2390
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2391
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2392
- };
2393
- };
2394
-
2395
- var parse$1 = function (str, opts) {
2396
- var options = normalizeParseOptions(opts);
2397
-
2398
- if (str === '' || str === null || typeof str === 'undefined') {
2399
- return options.plainObjects ? Object.create(null) : {};
2400
- }
2401
-
2402
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2403
- var obj = options.plainObjects ? Object.create(null) : {};
2404
-
2405
- // Iterate over the keys and setup the new object
2406
-
2407
- var keys = Object.keys(tempObj);
2408
- for (var i = 0; i < keys.length; ++i) {
2409
- var key = keys[i];
2410
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2411
- obj = utils.merge(obj, newObj, options);
2412
- }
2413
-
2414
- if (options.allowSparse === true) {
2415
- return obj;
2416
- }
2417
-
2418
- return utils.compact(obj);
2419
- };
2420
-
2421
- var stringify = stringify_1;
2422
- var parse = parse$1;
2423
- var formats = formats$3;
2424
-
2425
- var lib = {
2426
- formats: formats,
2427
- parse: parse,
2428
- stringify: stringify
2429
- };
2430
-
2431
382
  var IMAGE_SIZE_LIMIT_IN_MEGABYTES = 1;
2432
383
  var NEETO_TEMPLATES_URL = "/neeto_templates_engine/api/v1";
2433
384
  var TEMPLATE_TAGS_URL = "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags");
@@ -2441,12 +392,7 @@ var IMAGE_UPLOAD_CONFIG = {
2441
392
 
2442
393
  var list$1 = function list(params) {
2443
394
  return axios.get(TEMPLATES_URL, {
2444
- params: params,
2445
- paramsSerializer: function paramsSerializer(params) {
2446
- return lib.stringify(params, {
2447
- arrayFormat: "brackets"
2448
- });
2449
- }
395
+ params: params
2450
396
  });
2451
397
  };
2452
398
  var create$1 = function create(_ref) {
@@ -2481,8 +427,8 @@ var QUERY_KEYS = {
2481
427
  TEMPLATE_TAGS: "template-tags"
2482
428
  };
2483
429
 
2484
- function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2485
- function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
430
+ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
431
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2486
432
  var useFetchTemplates = function useFetchTemplates(_ref) {
2487
433
  var searchTerm = _ref.searchTerm,
2488
434
  category = _ref.category;
@@ -2520,7 +466,7 @@ var useCreateTemplate = function useCreateTemplate(_ref3, options) {
2520
466
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2521
467
  args[_key] = arguments[_key];
2522
468
  }
2523
- options === null || options === void 0 ? void 0 : options.onSuccess.apply(options, args);
469
+ options === null || options === void 0 || options.onSuccess.apply(options, args);
2524
470
  }
2525
471
  }));
2526
472
  };
@@ -2690,8 +636,8 @@ var CategoryItem = function CategoryItem(_ref) {
2690
636
  }, /*#__PURE__*/React__default.createElement("span", null, label), /*#__PURE__*/React__default.createElement("span", null, count));
2691
637
  };
2692
638
 
2693
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2694
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
639
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
640
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2695
641
  var List = function List(_ref) {
2696
642
  var setCurrentScreen = _ref.setCurrentScreen,
2697
643
  setSelectedTemplate = _ref.setSelectedTemplate,
@@ -2748,7 +694,7 @@ var List = function List(_ref) {
2748
694
  return /*#__PURE__*/React__default.createElement("div", {
2749
695
  className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start"
2750
696
  }, /*#__PURE__*/React__default.createElement("div", {
2751
- className: "sticky left-0 top-0 w-80 flex-shrink-0 space-y-8 py-6 pl-16"
697
+ className: "sticky left-0 top-0 w-52 flex-shrink-0 space-y-8 py-6 pl-4 md:w-72 md:pl-10 lg:w-80 xl:pl-16"
2752
698
  }, /*#__PURE__*/React__default.createElement("div", {
2753
699
  className: "space-y-4"
2754
700
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -2763,6 +709,7 @@ var List = function List(_ref) {
2763
709
  }, t("neetoTemplate.templates.description"))), /*#__PURE__*/React__default.createElement(Search, {
2764
710
  autoFocus: true,
2765
711
  disableTrimOnBlur: true,
712
+ "data-cy": "template-search-input",
2766
713
  placeholder: t("neetoTemplate.templates.search"),
2767
714
  onSearch: function onSearch(value) {
2768
715
  return setSearchTerm(value);
@@ -2792,12 +739,12 @@ var List = function List(_ref) {
2792
739
  }
2793
740
  });
2794
741
  })))), /*#__PURE__*/React__default.createElement("div", {
2795
- className: "overflow-y-auto px-16 py-6",
742
+ className: "h-screen overflow-y-auto py-8 pl-5 pr-4 md:pl-8 md:pr-20 xl:px-20",
2796
743
  ref: rootRef
2797
744
  }, /*#__PURE__*/React__default.createElement("div", {
2798
745
  className: "flex-grow space-y-6"
2799
746
  }, /*#__PURE__*/React__default.createElement("div", {
2800
- className: "grid grid-cols-2 gap-6 md:grid-cols-3 2xl:grid-cols-4"
747
+ className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 lg:gap-5 xl:gap-6 2xl:grid-cols-4"
2801
748
  }, /*#__PURE__*/React__default.createElement(BlankCard, {
2802
749
  description: t("neetoTemplate.templates.blankCard.description"),
2803
750
  disabled: isCreating,
@@ -2806,10 +753,10 @@ var List = function List(_ref) {
2806
753
  onClick: onCreate
2807
754
  }), templates.map(function (template, index) {
2808
755
  return /*#__PURE__*/React__default.createElement(Card, {
2809
- key: index,
2810
- template: template,
2811
756
  afterCreate: afterCreate,
2812
757
  refetchResource: refetchResource,
758
+ template: template,
759
+ key: index,
2813
760
  onClick: function onClick() {
2814
761
  return handleCardClick(template);
2815
762
  }
@@ -2846,10 +793,11 @@ var Preview$1 = function Preview(_ref) {
2846
793
  return /*#__PURE__*/React__default.createElement("div", {
2847
794
  className: "m-auto flex h-full w-full max-w-5xl flex-col space-y-6 py-6"
2848
795
  }, /*#__PURE__*/React__default.createElement("div", {
2849
- className: "flex items-center justify-between gap-6"
796
+ className: "flex flex-col items-center justify-between gap-6 pl-4 pr-16 md:flex-row md:pr-20 xl:px-0"
2850
797
  }, /*#__PURE__*/React__default.createElement("div", {
2851
798
  className: "flex min-w-0 flex-grow items-center gap-2"
2852
799
  }, /*#__PURE__*/React__default.createElement(Button, {
800
+ className: "flex-shrink-0",
2853
801
  "data-cy": "preview-template-back-button",
2854
802
  icon: LeftArrow,
2855
803
  style: "text",
@@ -2862,6 +810,7 @@ var Preview$1 = function Preview(_ref) {
2862
810
  style: "h2",
2863
811
  weight: "semibold"
2864
812
  }, title)), /*#__PURE__*/React__default.createElement(Button, {
813
+ className: "flex-shrink-0",
2865
814
  "data-cy": "preview-use-template-button",
2866
815
  disabled: isCreating,
2867
816
  label: t("neetoTemplate.templates.editTemplate"),
@@ -2935,8 +884,8 @@ var templateTagsApi = {
2935
884
  list: list
2936
885
  };
2937
886
 
2938
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2939
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
887
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
888
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2940
889
  var useCreateTemplateTag = function useCreateTemplateTag(options) {
2941
890
  var queryClient = useQueryClient();
2942
891
  return useMutation(templateTagsApi.create, _objectSpread$1(_objectSpread$1({}, options), {}, {
@@ -2944,7 +893,7 @@ var useCreateTemplateTag = function useCreateTemplateTag(options) {
2944
893
  var _options$onSuccess;
2945
894
  refetchTags();
2946
895
  queryClient.invalidateQueries(QUERY_KEYS.TEMPLATE_TAGS);
2947
- options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options);
896
+ options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
2948
897
  }
2949
898
  }));
2950
899
  };
@@ -2966,7 +915,7 @@ var FormikImageUploader = function FormikImageUploader(_ref) {
2966
915
  return setValue(file.url);
2967
916
  };
2968
917
  return /*#__PURE__*/React__default.createElement(ImageUploader, {
2969
- className: "h-80 w-full",
918
+ className: "h-52 w-full md:h-80",
2970
919
  src: field.value,
2971
920
  uploadConfig: IMAGE_UPLOAD_CONFIG,
2972
921
  onUploadComplete: handleImageUpload
@@ -3065,17 +1014,20 @@ var Preview = function Preview(_ref) {
3065
1014
  className: "neeto-template__header"
3066
1015
  }, /*#__PURE__*/React__default.createElement("img", {
3067
1016
  className: "neeto-template__image",
1017
+ "data-cy": "template-image-preview",
3068
1018
  src: imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
3069
1019
  })), /*#__PURE__*/React__default.createElement("div", {
3070
1020
  className: "neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-2 py-1.5"
3071
1021
  }, /*#__PURE__*/React__default.createElement(Typography, {
3072
1022
  className: "neeto-ui-text-gray-800",
1023
+ "data-cy": "template-title-text",
3073
1024
  lineHeight: "normal",
3074
1025
  style: "body2"
3075
1026
  }, template.title)));
3076
1027
  };
3077
1028
 
3078
- var buildSelectOptionsBy = function buildSelectOptionsBy(labelField, options) {
1029
+ var buildSelectOptionsBy = function buildSelectOptionsBy(labelField) {
1030
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3079
1031
  var valueField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "id";
3080
1032
  return options.map(function (option) {
3081
1033
  return {
@@ -3098,8 +1050,8 @@ var buildTemplateUpdatePayload = function buildTemplateUpdatePayload(values) {
3098
1050
  };
3099
1051
  };
3100
1052
 
3101
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3102
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1053
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1054
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3103
1055
  var TemplateSettings = function TemplateSettings(_ref) {
3104
1056
  var _ref$onCancelTemplate = _ref.onCancelTemplatePreview,
3105
1057
  onCancelTemplatePreview = _ref$onCancelTemplate === void 0 ? "" : _ref$onCancelTemplate,
@@ -3146,7 +1098,10 @@ var TemplateSettings = function TemplateSettings(_ref) {
3146
1098
  breadcrumbs: breadcrumbs,
3147
1099
  title: t("neetoTemplate.templateSettings.title")
3148
1100
  }), /*#__PURE__*/React__default.createElement(PageContent, {
3149
- className: "h-full"
1101
+ className: classnames({
1102
+ "min-h-0": !isLoading,
1103
+ "h-full": isLoading
1104
+ })
3150
1105
  }, isLoading ? /*#__PURE__*/React__default.createElement(PageLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography, {
3151
1106
  className: "mb-1",
3152
1107
  "data-cy": "thank-you-action-text",
@@ -3191,7 +1146,7 @@ var TemplateSettings = function TemplateSettings(_ref) {
3191
1146
  }), /*#__PURE__*/React__default.createElement("div", {
3192
1147
  className: "mt-12 flex flex-row items-center justify-start"
3193
1148
  }, /*#__PURE__*/React__default.createElement(Button, {
3194
- className: "mr-3",
1149
+ className: "mr-3 flex-shrink-0",
3195
1150
  "data-cy": "save-changes-button",
3196
1151
  disabled: !dirty,
3197
1152
  loading: isUpdatingTemplate,