@bigbinary/neeto-templates-frontend 1.2.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -11
- package/app/javascript/src/translations/en.json +6 -0
- package/dist/index.cjs.js +693 -2618
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +655 -2586
- package/dist/index.js.map +1 -1
- package/package.json +17 -16
- package/types.d.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, createElement, memo } from 'react';
|
|
3
3
|
import { noop, removeBy, renameKeys } from '@bigbinary/neeto-cist';
|
|
4
|
-
import
|
|
4
|
+
import Modal from '@bigbinary/neetoui/Modal';
|
|
5
5
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
6
6
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
7
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
8
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
7
9
|
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { refetchTags, TagsComponent, NeetoTags } from '@bigbinary/neeto-tags-frontend';
|
|
11
|
+
import { useQuery, useInfiniteQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
12
|
+
import { useMutationWithInvalidation, useBreakpoints } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
8
13
|
import { prop, pluck } from 'ramda';
|
|
9
|
-
import { useQuery, useQueryClient, useMutation, useInfiniteQuery } from 'react-query';
|
|
10
14
|
import axios from 'axios';
|
|
11
|
-
import
|
|
12
|
-
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
13
|
-
import { t as t$1 } from 'i18next';
|
|
15
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
14
16
|
import classnames from 'classnames';
|
|
15
17
|
import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
+
import ResponsiveDevicePicker from '@bigbinary/neeto-molecules/ResponsiveDevicePicker';
|
|
19
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
20
|
+
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
21
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
18
22
|
import { useParams } from 'react-router-dom';
|
|
19
|
-
import { refetchTags, TagsComponent } from '@bigbinary/neeto-tags-frontend';
|
|
20
23
|
import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
21
24
|
import { useField, useFormikContext } from 'formik';
|
|
22
25
|
import Header from '@bigbinary/neeto-molecules/Header';
|
|
23
26
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
27
|
+
import Label from '@bigbinary/neetoui/Label';
|
|
28
|
+
import { t as t$1 } from 'i18next';
|
|
24
29
|
|
|
25
30
|
function _arrayWithHoles(arr) {
|
|
26
31
|
if (Array.isArray(arr)) return arr;
|
|
@@ -86,9 +91,10 @@ var DEFAULT_CATEGORY = {
|
|
|
86
91
|
name: "All"
|
|
87
92
|
};
|
|
88
93
|
var INFINITE_SCROLL_DELAY = 500;
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
var RESPONSIVE_DEVICES = {
|
|
95
|
+
DESKTOP: "desktop",
|
|
96
|
+
TABLET: "tablet",
|
|
97
|
+
MOBILE: "mobile"
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
function _typeof(o) {
|
|
@@ -246,2187 +252,139 @@ function useIntersectionObserver(args) {
|
|
|
246
252
|
observerRef.current = observer;
|
|
247
253
|
}, [rootMargin, threshold]);
|
|
248
254
|
var unobserve = useCallback(function () {
|
|
249
|
-
var currentObserver = observerRef.current;
|
|
250
|
-
var node = nodeRef.current;
|
|
251
|
-
|
|
252
|
-
if (node) {
|
|
253
|
-
currentObserver == null ? void 0 : currentObserver.unobserve(node);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
observerRef.current = null;
|
|
257
|
-
}, []); // React will call the ref callback with the DOM element when the component mounts,
|
|
258
|
-
// and call it with null when it unmounts.
|
|
259
|
-
// So, we don't need an useEffect etc to unobserve nodes.
|
|
260
|
-
// When nodeRef.current is null, it will be unobserved and observe function
|
|
261
|
-
// won't do anything.
|
|
262
|
-
|
|
263
|
-
var refCallback = useCallback(function (node) {
|
|
264
|
-
unobserve();
|
|
265
|
-
nodeRef.current = node;
|
|
266
|
-
observe();
|
|
267
|
-
}, [observe, unobserve]);
|
|
268
|
-
var rootRefCallback = useCallback(function (rootNode) {
|
|
269
|
-
unobserve();
|
|
270
|
-
rootRef.current = rootNode;
|
|
271
|
-
observe();
|
|
272
|
-
}, [observe, unobserve]);
|
|
273
|
-
return [refCallback, {
|
|
274
|
-
entry: entry,
|
|
275
|
-
rootRef: rootRefCallback
|
|
276
|
-
}];
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function _extends$1() {
|
|
280
|
-
_extends$1 = Object.assign || function (target) {
|
|
281
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
282
|
-
var source = arguments[i];
|
|
283
|
-
|
|
284
|
-
for (var key in source) {
|
|
285
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
286
|
-
target[key] = source[key];
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return target;
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
return _extends$1.apply(this, arguments);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function useTrackVisibility(args) {
|
|
298
|
-
var _result$entry;
|
|
299
|
-
|
|
300
|
-
var _useIntersectionObser = useIntersectionObserver(args),
|
|
301
|
-
ref = _useIntersectionObser[0],
|
|
302
|
-
result = _useIntersectionObser[1];
|
|
303
|
-
|
|
304
|
-
var isVisible = Boolean((_result$entry = result.entry) == null ? void 0 : _result$entry.isIntersecting);
|
|
305
|
-
|
|
306
|
-
var _useState = useState(isVisible),
|
|
307
|
-
wasEverVisible = _useState[0],
|
|
308
|
-
setWasEverVisible = _useState[1];
|
|
309
|
-
|
|
310
|
-
if (isVisible && !wasEverVisible) {
|
|
311
|
-
setWasEverVisible(true);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return [ref, _extends$1({}, result, {
|
|
315
|
-
isVisible: isVisible,
|
|
316
|
-
wasEverVisible: wasEverVisible
|
|
317
|
-
})];
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
var DEFAULT_DELAY_IN_MS = 100;
|
|
321
|
-
|
|
322
|
-
function useInfiniteScroll(_ref) {
|
|
323
|
-
var loading = _ref.loading,
|
|
324
|
-
hasNextPage = _ref.hasNextPage,
|
|
325
|
-
onLoadMore = _ref.onLoadMore,
|
|
326
|
-
rootMargin = _ref.rootMargin,
|
|
327
|
-
disabled = _ref.disabled,
|
|
328
|
-
_ref$delayInMs = _ref.delayInMs,
|
|
329
|
-
delayInMs = _ref$delayInMs === void 0 ? DEFAULT_DELAY_IN_MS : _ref$delayInMs;
|
|
330
|
-
|
|
331
|
-
var _useTrackVisibility = useTrackVisibility({
|
|
332
|
-
rootMargin: rootMargin
|
|
333
|
-
}),
|
|
334
|
-
ref = _useTrackVisibility[0],
|
|
335
|
-
_useTrackVisibility$ = _useTrackVisibility[1],
|
|
336
|
-
rootRef = _useTrackVisibility$.rootRef,
|
|
337
|
-
isVisible = _useTrackVisibility$.isVisible;
|
|
338
|
-
|
|
339
|
-
var shouldLoadMore = !disabled && !loading && isVisible && hasNextPage; // eslint-disable-next-line consistent-return
|
|
340
|
-
|
|
341
|
-
useEffect(function () {
|
|
342
|
-
if (shouldLoadMore) {
|
|
343
|
-
// When we trigger 'onLoadMore' and new items are added to the list,
|
|
344
|
-
// right before they become rendered on the screen, 'loading' becomes false
|
|
345
|
-
// and 'isVisible' can be true for a brief time, based on the scroll position.
|
|
346
|
-
// So, it triggers 'onLoadMore' just after the first one is finished.
|
|
347
|
-
// We use a small delay here to prevent this kind of situations.
|
|
348
|
-
// It can be configured by hook args.
|
|
349
|
-
var timer = setTimeout(function () {
|
|
350
|
-
onLoadMore();
|
|
351
|
-
}, delayInMs);
|
|
352
|
-
return function () {
|
|
353
|
-
clearTimeout(timer);
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
}, [onLoadMore, shouldLoadMore, delayInMs]);
|
|
357
|
-
return [ref, {
|
|
358
|
-
rootRef: rootRef
|
|
359
|
-
}];
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
var _rect, _path;
|
|
363
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
364
|
-
const SvgCustom = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
365
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
366
|
-
width: 46,
|
|
367
|
-
height: 46,
|
|
368
|
-
fill: "none"
|
|
369
|
-
}, props), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
|
|
370
|
-
width: 40,
|
|
371
|
-
height: 40,
|
|
372
|
-
x: 3,
|
|
373
|
-
y: 2,
|
|
374
|
-
fill: "#4558F9",
|
|
375
|
-
rx: 2
|
|
376
|
-
})), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
377
|
-
fill: "#fff",
|
|
378
|
-
fillRule: "evenodd",
|
|
379
|
-
d: "M23.75 16a.75.75 0 0 0-1.5 0v5.25H17a.75.75 0 0 0 0 1.5h5.25V28a.75.75 0 0 0 1.5 0v-5.25H29a.75.75 0 0 0 0-1.5h-5.25V16Z",
|
|
380
|
-
clipRule: "evenodd"
|
|
381
|
-
})));
|
|
382
|
-
|
|
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, '"');
|
|
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('✓'), 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('✓')
|
|
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;
|
|
255
|
+
var currentObserver = observerRef.current;
|
|
256
|
+
var node = nodeRef.current;
|
|
2323
257
|
|
|
2324
|
-
|
|
258
|
+
if (node) {
|
|
259
|
+
currentObserver == null ? void 0 : currentObserver.unobserve(node);
|
|
260
|
+
}
|
|
2325
261
|
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
}
|
|
2333
|
-
}
|
|
262
|
+
observerRef.current = null;
|
|
263
|
+
}, []); // React will call the ref callback with the DOM element when the component mounts,
|
|
264
|
+
// and call it with null when it unmounts.
|
|
265
|
+
// So, we don't need an useEffect etc to unobserve nodes.
|
|
266
|
+
// When nodeRef.current is null, it will be unobserved and observe function
|
|
267
|
+
// won't do anything.
|
|
2334
268
|
|
|
2335
|
-
|
|
2336
|
-
|
|
269
|
+
var refCallback = useCallback(function (node) {
|
|
270
|
+
unobserve();
|
|
271
|
+
nodeRef.current = node;
|
|
272
|
+
observe();
|
|
273
|
+
}, [observe, unobserve]);
|
|
274
|
+
var rootRefCallback = useCallback(function (rootNode) {
|
|
275
|
+
unobserve();
|
|
276
|
+
rootRef.current = rootNode;
|
|
277
|
+
observe();
|
|
278
|
+
}, [observe, unobserve]);
|
|
279
|
+
return [refCallback, {
|
|
280
|
+
entry: entry,
|
|
281
|
+
rootRef: rootRefCallback
|
|
282
|
+
}];
|
|
283
|
+
}
|
|
2337
284
|
|
|
2338
|
-
|
|
285
|
+
function _extends$1() {
|
|
286
|
+
_extends$1 = Object.assign || function (target) {
|
|
287
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
288
|
+
var source = arguments[i];
|
|
2339
289
|
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
2344
|
-
if (!options.allowPrototypes) {
|
|
2345
|
-
return;
|
|
2346
|
-
}
|
|
290
|
+
for (var key in source) {
|
|
291
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
292
|
+
target[key] = source[key];
|
|
2347
293
|
}
|
|
2348
|
-
|
|
294
|
+
}
|
|
2349
295
|
}
|
|
2350
296
|
|
|
2351
|
-
|
|
297
|
+
return target;
|
|
298
|
+
};
|
|
2352
299
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
}
|
|
300
|
+
return _extends$1.apply(this, arguments);
|
|
301
|
+
}
|
|
2356
302
|
|
|
2357
|
-
|
|
2358
|
-
|
|
303
|
+
function useTrackVisibility(args) {
|
|
304
|
+
var _result$entry;
|
|
2359
305
|
|
|
2360
|
-
var
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
}
|
|
306
|
+
var _useIntersectionObser = useIntersectionObserver(args),
|
|
307
|
+
ref = _useIntersectionObser[0],
|
|
308
|
+
result = _useIntersectionObser[1];
|
|
2364
309
|
|
|
2365
|
-
|
|
2366
|
-
throw new TypeError('Decoder has to be a function.');
|
|
2367
|
-
}
|
|
310
|
+
var isVisible = Boolean((_result$entry = result.entry) == null ? void 0 : _result$entry.isIntersecting);
|
|
2368
311
|
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
312
|
+
var _useState = useState(isVisible),
|
|
313
|
+
wasEverVisible = _useState[0],
|
|
314
|
+
setWasEverVisible = _useState[1];
|
|
2373
315
|
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
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
|
-
};
|
|
316
|
+
if (isVisible && !wasEverVisible) {
|
|
317
|
+
setWasEverVisible(true);
|
|
318
|
+
}
|
|
2394
319
|
|
|
2395
|
-
|
|
2396
|
-
|
|
320
|
+
return [ref, _extends$1({}, result, {
|
|
321
|
+
isVisible: isVisible,
|
|
322
|
+
wasEverVisible: wasEverVisible
|
|
323
|
+
})];
|
|
324
|
+
}
|
|
2397
325
|
|
|
2398
|
-
|
|
2399
|
-
return options.plainObjects ? Object.create(null) : {};
|
|
2400
|
-
}
|
|
326
|
+
var DEFAULT_DELAY_IN_MS = 100;
|
|
2401
327
|
|
|
2402
|
-
|
|
2403
|
-
|
|
328
|
+
function useInfiniteScroll(_ref) {
|
|
329
|
+
var loading = _ref.loading,
|
|
330
|
+
hasNextPage = _ref.hasNextPage,
|
|
331
|
+
onLoadMore = _ref.onLoadMore,
|
|
332
|
+
rootMargin = _ref.rootMargin,
|
|
333
|
+
disabled = _ref.disabled,
|
|
334
|
+
_ref$delayInMs = _ref.delayInMs,
|
|
335
|
+
delayInMs = _ref$delayInMs === void 0 ? DEFAULT_DELAY_IN_MS : _ref$delayInMs;
|
|
2404
336
|
|
|
2405
|
-
|
|
337
|
+
var _useTrackVisibility = useTrackVisibility({
|
|
338
|
+
rootMargin: rootMargin
|
|
339
|
+
}),
|
|
340
|
+
ref = _useTrackVisibility[0],
|
|
341
|
+
_useTrackVisibility$ = _useTrackVisibility[1],
|
|
342
|
+
rootRef = _useTrackVisibility$.rootRef,
|
|
343
|
+
isVisible = _useTrackVisibility$.isVisible;
|
|
2406
344
|
|
|
2407
|
-
|
|
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
|
-
}
|
|
345
|
+
var shouldLoadMore = !disabled && !loading && isVisible && hasNextPage; // eslint-disable-next-line consistent-return
|
|
2413
346
|
|
|
2414
|
-
|
|
2415
|
-
|
|
347
|
+
useEffect(function () {
|
|
348
|
+
if (shouldLoadMore) {
|
|
349
|
+
// When we trigger 'onLoadMore' and new items are added to the list,
|
|
350
|
+
// right before they become rendered on the screen, 'loading' becomes false
|
|
351
|
+
// and 'isVisible' can be true for a brief time, based on the scroll position.
|
|
352
|
+
// So, it triggers 'onLoadMore' just after the first one is finished.
|
|
353
|
+
// We use a small delay here to prevent this kind of situations.
|
|
354
|
+
// It can be configured by hook args.
|
|
355
|
+
var timer = setTimeout(function () {
|
|
356
|
+
onLoadMore();
|
|
357
|
+
}, delayInMs);
|
|
358
|
+
return function () {
|
|
359
|
+
clearTimeout(timer);
|
|
360
|
+
};
|
|
2416
361
|
}
|
|
362
|
+
}, [onLoadMore, shouldLoadMore, delayInMs]);
|
|
363
|
+
return [ref, {
|
|
364
|
+
rootRef: rootRef
|
|
365
|
+
}];
|
|
366
|
+
}
|
|
2417
367
|
|
|
2418
|
-
|
|
2419
|
-
};
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
368
|
+
var _rect, _path;
|
|
369
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
370
|
+
const SvgCustom = props => /*#__PURE__*/React.createElement("svg", _extends({
|
|
371
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
372
|
+
width: 46,
|
|
373
|
+
height: 46,
|
|
374
|
+
fill: "none"
|
|
375
|
+
}, props), _rect || (_rect = /*#__PURE__*/React.createElement("rect", {
|
|
376
|
+
width: 40,
|
|
377
|
+
height: 40,
|
|
378
|
+
x: 3,
|
|
379
|
+
y: 2,
|
|
380
|
+
fill: "#008068",
|
|
381
|
+
rx: 2
|
|
382
|
+
})), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
383
|
+
fill: "#fff",
|
|
384
|
+
fillRule: "evenodd",
|
|
385
|
+
d: "M23.75 16a.75.75 0 0 0-1.5 0v5.25H17a.75.75 0 0 0 0 1.5h5.25V28a.75.75 0 0 0 1.5 0v-5.25H29a.75.75 0 0 0 0-1.5h-5.25V16Z",
|
|
386
|
+
clipRule: "evenodd"
|
|
387
|
+
})));
|
|
2430
388
|
|
|
2431
389
|
var IMAGE_SIZE_LIMIT_IN_MEGABYTES = 1;
|
|
2432
390
|
var NEETO_TEMPLATES_URL = "/neeto_templates_engine/api/v1";
|
|
@@ -2441,12 +399,7 @@ var IMAGE_UPLOAD_CONFIG = {
|
|
|
2441
399
|
|
|
2442
400
|
var list$1 = function list(params) {
|
|
2443
401
|
return axios.get(TEMPLATES_URL, {
|
|
2444
|
-
params: params
|
|
2445
|
-
paramsSerializer: function paramsSerializer(params) {
|
|
2446
|
-
return lib.stringify(params, {
|
|
2447
|
-
arrayFormat: "brackets"
|
|
2448
|
-
});
|
|
2449
|
-
}
|
|
402
|
+
params: params
|
|
2450
403
|
});
|
|
2451
404
|
};
|
|
2452
405
|
var create$1 = function create(_ref) {
|
|
@@ -2478,23 +431,25 @@ var templatesApi = {
|
|
|
2478
431
|
var QUERY_KEYS = {
|
|
2479
432
|
TEMPLATES_LIST: "templates-list",
|
|
2480
433
|
TEMPLATE: "templates-detail",
|
|
2481
|
-
TEMPLATE_TAGS: "
|
|
434
|
+
TEMPLATE_TAGS: "tag-key"
|
|
2482
435
|
};
|
|
2483
436
|
|
|
2484
|
-
function ownKeys$
|
|
2485
|
-
function _objectSpread$
|
|
437
|
+
function ownKeys$5(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; }
|
|
438
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2486
439
|
var useFetchTemplates = function useFetchTemplates(_ref) {
|
|
2487
440
|
var searchTerm = _ref.searchTerm,
|
|
2488
441
|
category = _ref.category;
|
|
2489
|
-
return useInfiniteQuery(
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
442
|
+
return useInfiniteQuery({
|
|
443
|
+
queryKey: [QUERY_KEYS.TEMPLATES_LIST, searchTerm, category],
|
|
444
|
+
queryFn: function queryFn(_ref2) {
|
|
445
|
+
var _ref2$pageParam = _ref2.pageParam,
|
|
446
|
+
pageParam = _ref2$pageParam === void 0 ? 1 : _ref2$pageParam;
|
|
447
|
+
return templatesApi.list({
|
|
448
|
+
page: pageParam,
|
|
449
|
+
searchTerm: searchTerm,
|
|
450
|
+
category: category
|
|
451
|
+
});
|
|
452
|
+
},
|
|
2498
453
|
getNextPageParam: function getNextPageParam(lastPage) {
|
|
2499
454
|
return lastPage.hasNextPage ? lastPage.page + 1 : undefined;
|
|
2500
455
|
},
|
|
@@ -2512,31 +467,26 @@ var useFetchTemplates = function useFetchTemplates(_ref) {
|
|
|
2512
467
|
keepPreviousData: true
|
|
2513
468
|
});
|
|
2514
469
|
};
|
|
2515
|
-
var useCreateTemplate = function useCreateTemplate(
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
470
|
+
var useCreateTemplate = function useCreateTemplate() {
|
|
471
|
+
return useMutation({
|
|
472
|
+
mutationFn: templatesApi.create
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
var useFetchTemplate = function useFetchTemplate(_ref3, options) {
|
|
476
|
+
var resourceId = _ref3.resourceId;
|
|
477
|
+
return useQuery(_objectSpread$5({
|
|
478
|
+
queryKey: [QUERY_KEYS.TEMPLATE, resourceId],
|
|
479
|
+
queryFn: function queryFn() {
|
|
480
|
+
return templatesApi.fetch({
|
|
481
|
+
templateId: resourceId
|
|
482
|
+
});
|
|
2524
483
|
}
|
|
2525
|
-
}));
|
|
484
|
+
}, options));
|
|
2526
485
|
};
|
|
2527
|
-
var
|
|
486
|
+
var useUpdateTemplate = function useUpdateTemplate(_ref4) {
|
|
2528
487
|
var resourceId = _ref4.resourceId;
|
|
2529
|
-
return
|
|
2530
|
-
|
|
2531
|
-
templateId: resourceId
|
|
2532
|
-
});
|
|
2533
|
-
}, options);
|
|
2534
|
-
};
|
|
2535
|
-
var useUpdateTemplate = function useUpdateTemplate(_ref5) {
|
|
2536
|
-
var resourceId = _ref5.resourceId;
|
|
2537
|
-
var queryClient = useQueryClient();
|
|
2538
|
-
return useMutation(function (_ref6) {
|
|
2539
|
-
var template = _ref6.template;
|
|
488
|
+
return useMutationWithInvalidation(function (_ref5) {
|
|
489
|
+
var template = _ref5.template;
|
|
2540
490
|
return templatesApi.update({
|
|
2541
491
|
resourceId: resourceId,
|
|
2542
492
|
payload: {
|
|
@@ -2544,9 +494,9 @@ var useUpdateTemplate = function useUpdateTemplate(_ref5) {
|
|
|
2544
494
|
}
|
|
2545
495
|
});
|
|
2546
496
|
}, {
|
|
497
|
+
keysToInvalidate: [[QUERY_KEYS.TEMPLATES_LIST], [QUERY_KEYS.TEMPLATE, resourceId]],
|
|
2547
498
|
onSuccess: function onSuccess() {
|
|
2548
|
-
|
|
2549
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEMPLATES_LIST);
|
|
499
|
+
refetchTags();
|
|
2550
500
|
}
|
|
2551
501
|
});
|
|
2552
502
|
};
|
|
@@ -2559,119 +509,57 @@ var BlankCard = function BlankCard(_ref) {
|
|
|
2559
509
|
onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
2560
510
|
_ref$disabled = _ref.disabled,
|
|
2561
511
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
2562
|
-
return /*#__PURE__*/
|
|
2563
|
-
className: "neeto-ui-rounded-lg neeto-ui-bg-white hover:neeto-ui-bg-white neeto-ui-border-primary-500
|
|
512
|
+
return /*#__PURE__*/jsxs("div", {
|
|
513
|
+
className: "neeto-ui-rounded-lg neeto-ui-bg-white hover:neeto-ui-bg-white neeto-ui-border-primary-500 flex cursor-pointer flex-col items-center justify-center border border-dashed p-6 outline-none transition-all duration-300 ease-in-out hover:border-solid focus:border-solid",
|
|
2564
514
|
"data-cy": "start-from-scratch-button",
|
|
2565
515
|
tabIndex: 0,
|
|
2566
|
-
onClick: !disabled ? onClick : noop
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
role: "status"
|
|
2586
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
2587
|
-
"aria-hidden": "true",
|
|
2588
|
-
className: "neeto-ui-text-gray-400 inline h-4 w-4 animate-spin",
|
|
2589
|
-
fill: "none",
|
|
2590
|
-
viewBox: "0 0 100 101",
|
|
2591
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2592
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2593
|
-
d: "M100 50.59c0 27.615-22.386 50.001-50 50.001s-50-22.386-50-50 22.386-50 50-50 50 22.386 50 50zm-90.919 0c0 22.6 18.32 40.92 40.919 40.92 22.599 0 40.919-18.32 40.919-40.92 0-22.598-18.32-40.918-40.919-40.918-22.599 0-40.919 18.32-40.919 40.919z",
|
|
2594
|
-
fill: "currentColor"
|
|
2595
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2596
|
-
d: "M93.968 39.04c2.425-.636 3.894-3.128 3.04-5.486A50 50 0 0041.735 1.279c-2.474.414-3.922 2.919-3.285 5.344.637 2.426 3.12 3.849 5.6 3.484a40.916 40.916 0 0144.131 25.769c.902 2.34 3.361 3.802 5.787 3.165z",
|
|
2597
|
-
fill: "#3642df"
|
|
2598
|
-
})));
|
|
2599
|
-
};
|
|
2600
|
-
|
|
2601
|
-
var getMenuItems = function getMenuItems(_ref) {
|
|
2602
|
-
var handleCreateTemplate = _ref.handleCreateTemplate,
|
|
2603
|
-
isCreating = _ref.isCreating,
|
|
2604
|
-
template = _ref.template;
|
|
2605
|
-
return [{
|
|
2606
|
-
key: MENU_ITEMS.CREATE,
|
|
2607
|
-
"data-cy": "use-this-template-button",
|
|
2608
|
-
isDisabled: isCreating,
|
|
2609
|
-
label: t$1("neetoTemplate.templates.editTemplate"),
|
|
2610
|
-
suffix: isCreating && /*#__PURE__*/React__default.createElement(ButtonLoader, null),
|
|
2611
|
-
onClick: function onClick(event) {
|
|
2612
|
-
return handleCreateTemplate(event, template.id);
|
|
2613
|
-
}
|
|
2614
|
-
}, {
|
|
2615
|
-
key: MENU_ITEMS.PREVIEW,
|
|
2616
|
-
"data-cy": "template-preview-button",
|
|
2617
|
-
label: t$1("neetoTemplate.templates.preview")
|
|
2618
|
-
}];
|
|
516
|
+
onClick: !disabled ? onClick : noop,
|
|
517
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
518
|
+
className: "neeto-ui-text-primary-500 mb-4",
|
|
519
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
520
|
+
size: 40
|
|
521
|
+
})
|
|
522
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
523
|
+
className: "text-center",
|
|
524
|
+
lineHeight: "normal",
|
|
525
|
+
style: "h5",
|
|
526
|
+
weight: "semibold",
|
|
527
|
+
children: title
|
|
528
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
529
|
+
className: "neeto-ui-text-gray-600 text-center",
|
|
530
|
+
lineHeight: "leading-4",
|
|
531
|
+
style: "body3",
|
|
532
|
+
children: description
|
|
533
|
+
})]
|
|
534
|
+
});
|
|
2619
535
|
};
|
|
2620
536
|
|
|
2621
537
|
var Card = function Card(_ref) {
|
|
2622
538
|
var template = _ref.template,
|
|
2623
|
-
onClick = _ref.onClick
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
refetchResource: refetchResource
|
|
2628
|
-
}),
|
|
2629
|
-
createTemplate = _useCreateTemplate.mutate,
|
|
2630
|
-
isCreating = _useCreateTemplate.isLoading;
|
|
2631
|
-
var handleCreateTemplate = function handleCreateTemplate(e, templateId) {
|
|
2632
|
-
e.stopPropagation();
|
|
2633
|
-
createTemplate({
|
|
2634
|
-
id: templateId
|
|
2635
|
-
}, {
|
|
2636
|
-
onSuccess: function onSuccess(response) {
|
|
2637
|
-
return afterCreate(response);
|
|
2638
|
-
}
|
|
2639
|
-
});
|
|
2640
|
-
};
|
|
2641
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2642
|
-
className: "neeto-template neeto-ui-bg-white outline-none neeto-ui-shadow-sm hover:neeto-ui-border-gray-400 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border transition-colors duration-300 ease-in-out",
|
|
539
|
+
onClick = _ref.onClick;
|
|
540
|
+
return /*#__PURE__*/jsxs("div", {
|
|
541
|
+
onClick: onClick,
|
|
542
|
+
className: "neeto-template neeto-template-thumbnail neeto-ui-bg-white neeto-ui-shadow-xs hover:neeto-ui-border-gray-500 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border outline-none transition-colors duration-300 ease-in-out",
|
|
2643
543
|
"data-cy": "template-card",
|
|
2644
544
|
tabIndex: 0,
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
},
|
|
2664
|
-
dropdownProps: {
|
|
2665
|
-
onClick: function onClick(event) {
|
|
2666
|
-
return event.stopPropagation();
|
|
2667
|
-
}
|
|
2668
|
-
},
|
|
2669
|
-
menuItems: getMenuItems({
|
|
2670
|
-
handleCreateTemplate: handleCreateTemplate,
|
|
2671
|
-
isCreating: isCreating,
|
|
2672
|
-
template: template
|
|
2673
|
-
})
|
|
2674
|
-
})));
|
|
545
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
546
|
+
className: "neeto-template__header relative overflow-hidden",
|
|
547
|
+
children: /*#__PURE__*/jsx("img", {
|
|
548
|
+
className: "neeto-template__image",
|
|
549
|
+
"data-cy": "template-thumbnail-image",
|
|
550
|
+
src: template.imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
|
|
551
|
+
})
|
|
552
|
+
}), /*#__PURE__*/jsx("div", {
|
|
553
|
+
className: "neeto-template__description neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-3 py-1.5",
|
|
554
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
555
|
+
className: "neeto-template-thumbnail__title line-clamp-2",
|
|
556
|
+
"data-cy": "template-card-title",
|
|
557
|
+
lineHeight: "normal",
|
|
558
|
+
style: "h5",
|
|
559
|
+
children: template.title
|
|
560
|
+
})
|
|
561
|
+
})]
|
|
562
|
+
});
|
|
2675
563
|
};
|
|
2676
564
|
|
|
2677
565
|
var CategoryItem = function CategoryItem(_ref) {
|
|
@@ -2679,19 +567,24 @@ var CategoryItem = function CategoryItem(_ref) {
|
|
|
2679
567
|
count = _ref.count,
|
|
2680
568
|
isActive = _ref.isActive,
|
|
2681
569
|
setCurrentCategory = _ref.setCurrentCategory;
|
|
2682
|
-
return /*#__PURE__*/
|
|
570
|
+
return /*#__PURE__*/jsxs("button", {
|
|
2683
571
|
"data-cy": "category-".concat(joinHyphenCase(label)),
|
|
2684
572
|
tabIndex: 0,
|
|
2685
573
|
className: classnames("neeto-ui-rounded-lg outline-none flex w-full items-center justify-between gap-2 border border-solid px-3 py-2 text-sm font-medium leading-4 transition-all duration-300 ease-in-out", {
|
|
2686
574
|
"neeto-ui-text-gray-700 hover:neeto-ui-bg-gray-200 focus:neeto-ui-bg-gray-200 border-transparent": !isActive,
|
|
2687
575
|
"neeto-ui-text-gray-800 neeto-ui-bg-white neeto-ui-border-gray-300 focus:neeto-ui-border-gray-500": isActive
|
|
2688
576
|
}),
|
|
2689
|
-
onClick: setCurrentCategory
|
|
2690
|
-
|
|
577
|
+
onClick: setCurrentCategory,
|
|
578
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
579
|
+
children: label
|
|
580
|
+
}), /*#__PURE__*/jsx("span", {
|
|
581
|
+
children: count
|
|
582
|
+
})]
|
|
583
|
+
});
|
|
2691
584
|
};
|
|
2692
585
|
|
|
2693
|
-
function ownKeys$
|
|
2694
|
-
function _objectSpread$
|
|
586
|
+
function ownKeys$4(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; }
|
|
587
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2695
588
|
var List = function List(_ref) {
|
|
2696
589
|
var setCurrentScreen = _ref.setCurrentScreen,
|
|
2697
590
|
setSelectedTemplate = _ref.setSelectedTemplate,
|
|
@@ -2734,7 +627,7 @@ var List = function List(_ref) {
|
|
|
2734
627
|
setSelectedTemplate(template);
|
|
2735
628
|
};
|
|
2736
629
|
if (isTemplatesLoading) {
|
|
2737
|
-
return /*#__PURE__*/
|
|
630
|
+
return /*#__PURE__*/jsx(PageLoader, {});
|
|
2738
631
|
}
|
|
2739
632
|
var _data$tags = data.tags,
|
|
2740
633
|
tags = _data$tags === void 0 ? [] : _data$tags,
|
|
@@ -2742,83 +635,96 @@ var List = function List(_ref) {
|
|
|
2742
635
|
templates = _data$templates === void 0 ? [] : _data$templates,
|
|
2743
636
|
_data$templatesCount = data.templatesCount,
|
|
2744
637
|
templatesCount = _data$templatesCount === void 0 ? 0 : _data$templatesCount;
|
|
2745
|
-
var categories = [_objectSpread$
|
|
638
|
+
var categories = [_objectSpread$4(_objectSpread$4({}, DEFAULT_CATEGORY), {}, {
|
|
2746
639
|
count: templatesCount
|
|
2747
640
|
})].concat(_toConsumableArray(tags));
|
|
2748
|
-
return /*#__PURE__*/
|
|
2749
|
-
className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start"
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
641
|
+
return /*#__PURE__*/jsxs("div", {
|
|
642
|
+
className: "neeto-ui-bg-gray-100 relative flex min-h-full items-start",
|
|
643
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
644
|
+
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",
|
|
645
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
646
|
+
className: "space-y-4",
|
|
647
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
648
|
+
className: "space-y-1",
|
|
649
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
650
|
+
"data-cy": "create-new-form-title",
|
|
651
|
+
style: "h2",
|
|
652
|
+
weight: "semibold",
|
|
653
|
+
children: t("neetoTemplate.templates.createNewEntity")
|
|
654
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
655
|
+
lineHeight: "normal",
|
|
656
|
+
style: "body2",
|
|
657
|
+
children: t("neetoTemplate.templates.description")
|
|
658
|
+
})]
|
|
659
|
+
}), /*#__PURE__*/jsx(Search, {
|
|
660
|
+
autoFocus: true,
|
|
661
|
+
disableTrimOnBlur: true,
|
|
662
|
+
"data-cy": "template-search-input",
|
|
663
|
+
placeholder: t("neetoTemplate.templates.search"),
|
|
664
|
+
onSearch: function onSearch(value) {
|
|
665
|
+
return setSearchTerm(value);
|
|
666
|
+
}
|
|
667
|
+
})]
|
|
668
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
669
|
+
className: "space-y-3",
|
|
670
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
671
|
+
className: "uppercase",
|
|
672
|
+
"data-cy": "template-categories-label",
|
|
673
|
+
style: "h6",
|
|
674
|
+
children: t("neetoTemplate.templates.categories")
|
|
675
|
+
}), /*#__PURE__*/jsx("div", {
|
|
676
|
+
className: "space-y-2",
|
|
677
|
+
children: categories.map(function (_ref2) {
|
|
678
|
+
var id = _ref2.id,
|
|
679
|
+
name = _ref2.name,
|
|
680
|
+
count = _ref2.count;
|
|
681
|
+
return /*#__PURE__*/createElement(CategoryItem, {
|
|
682
|
+
count: count,
|
|
683
|
+
isActive: currentCategory.id === id,
|
|
684
|
+
key: id,
|
|
685
|
+
label: name,
|
|
686
|
+
setCurrentCategory: function setCurrentCategory() {
|
|
687
|
+
return _setCurrentCategory({
|
|
688
|
+
id: id,
|
|
689
|
+
name: name
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
})
|
|
694
|
+
})]
|
|
695
|
+
})]
|
|
696
|
+
}), /*#__PURE__*/jsx("div", {
|
|
697
|
+
className: "h-screen w-full overflow-y-auto py-8 pl-5 pr-4 md:pl-8 md:pr-20 xl:px-20",
|
|
698
|
+
ref: rootRef,
|
|
699
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
700
|
+
className: "flex-grow space-y-6",
|
|
701
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
702
|
+
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",
|
|
703
|
+
children: [/*#__PURE__*/jsx(BlankCard, {
|
|
704
|
+
description: t("neetoTemplate.templates.blankCard.description"),
|
|
705
|
+
disabled: isCreating,
|
|
706
|
+
icon: isCreating ? Spinner : SvgCustom,
|
|
707
|
+
title: t("neetoTemplate.templates.blankCard.title"),
|
|
708
|
+
onClick: onCreate
|
|
709
|
+
}), templates.map(function (template, index) {
|
|
710
|
+
return /*#__PURE__*/createElement(Card, {
|
|
711
|
+
afterCreate: afterCreate,
|
|
712
|
+
refetchResource: refetchResource,
|
|
713
|
+
template: template,
|
|
714
|
+
key: index,
|
|
715
|
+
onClick: function onClick() {
|
|
716
|
+
return handleCardClick(template);
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
})]
|
|
720
|
+
}), hasNextPage && /*#__PURE__*/jsx("div", {
|
|
721
|
+
className: "my-10 text-center",
|
|
722
|
+
ref: sentryRef,
|
|
723
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
724
|
+
})]
|
|
725
|
+
})
|
|
726
|
+
})]
|
|
727
|
+
});
|
|
2822
728
|
};
|
|
2823
729
|
|
|
2824
730
|
var Preview$1 = function Preview(_ref) {
|
|
@@ -2828,55 +734,87 @@ var Preview$1 = function Preview(_ref) {
|
|
|
2828
734
|
refetchResource = _ref.refetchResource;
|
|
2829
735
|
var _useTranslation = useTranslation(),
|
|
2830
736
|
t = _useTranslation.t;
|
|
2831
|
-
var
|
|
2832
|
-
|
|
2833
|
-
|
|
737
|
+
var _useBreakpoints = useBreakpoints(),
|
|
738
|
+
isSize = _useBreakpoints.isSize;
|
|
739
|
+
var _useCreateTemplate = useCreateTemplate(),
|
|
2834
740
|
createTemplate = _useCreateTemplate.mutate,
|
|
2835
|
-
isCreating = _useCreateTemplate.
|
|
741
|
+
isCreating = _useCreateTemplate.isPending;
|
|
742
|
+
var _useState = useState(RESPONSIVE_DEVICES.DESKTOP),
|
|
743
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
744
|
+
selectedDevice = _useState2[0],
|
|
745
|
+
setSelectedDevice = _useState2[1];
|
|
2836
746
|
var handleCreateTemplate = function handleCreateTemplate() {
|
|
2837
747
|
createTemplate({
|
|
2838
748
|
id: selectedTemplate.id
|
|
2839
749
|
}, {
|
|
2840
750
|
onSuccess: function onSuccess(response) {
|
|
2841
|
-
|
|
751
|
+
afterCreate(response);
|
|
752
|
+
refetchResource();
|
|
2842
753
|
}
|
|
2843
754
|
});
|
|
2844
755
|
};
|
|
2845
756
|
var title = selectedTemplate.title,
|
|
2846
757
|
previewUrl = selectedTemplate.previewUrl;
|
|
2847
|
-
return /*#__PURE__*/
|
|
2848
|
-
className: "
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
758
|
+
return /*#__PURE__*/jsxs("div", {
|
|
759
|
+
className: "neeto-templates-full-page-preview flex h-full w-full flex-col",
|
|
760
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
761
|
+
className: "neeto-templates-full-page-preview__header neeto-ui-border-gray-200 border-b px-4",
|
|
762
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
763
|
+
className: "mx-auto flex w-full max-w-6xl items-center justify-between py-[9px]",
|
|
764
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
765
|
+
className: "w-1/3",
|
|
766
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
767
|
+
className: "truncate leading-tight",
|
|
768
|
+
"data-cy": "preview-template-title",
|
|
769
|
+
style: "h3",
|
|
770
|
+
weight: "semibold",
|
|
771
|
+
children: title
|
|
772
|
+
})
|
|
773
|
+
}), /*#__PURE__*/jsx("div", {
|
|
774
|
+
className: "hidden flex-shrink-0 lg:flex",
|
|
775
|
+
children: /*#__PURE__*/jsx(ResponsiveDevicePicker, {
|
|
776
|
+
selectedDevice: selectedDevice,
|
|
777
|
+
onDeviceChange: setSelectedDevice
|
|
778
|
+
})
|
|
779
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
780
|
+
className: "flex w-1/3 items-center justify-end gap-2",
|
|
781
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
782
|
+
className: "flex-shrink-0",
|
|
783
|
+
"data-cy": "preview-template-back-button",
|
|
784
|
+
style: "secondary",
|
|
785
|
+
label: isSize("mobile") ? t("neetoTemplate.templates.back") : t("neetoTemplate.templates.backToTemplates"),
|
|
786
|
+
onClick: function onClick() {
|
|
787
|
+
return setCurrentScreen(TEMPLATE_SCREENS.LIST);
|
|
788
|
+
}
|
|
789
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
790
|
+
className: "flex-shrink-0",
|
|
791
|
+
"data-cy": "preview-use-template-button",
|
|
792
|
+
disabled: isCreating,
|
|
793
|
+
label: t("neetoTemplate.templates.editTemplate"),
|
|
794
|
+
loading: isCreating,
|
|
795
|
+
onClick: handleCreateTemplate
|
|
796
|
+
})]
|
|
797
|
+
})]
|
|
798
|
+
})
|
|
799
|
+
}), /*#__PURE__*/jsx("div", {
|
|
800
|
+
className: "neeto-ui-bg-gray-200 neeto-templates-full-page-preview__holder-wrapper min-h-0 flex-grow",
|
|
801
|
+
children: /*#__PURE__*/jsx("div", {
|
|
802
|
+
className: classnames("neeto-templates-full-page-preview__holder m-auto", {
|
|
803
|
+
"neeto-templates-full-page-preview__holder--desktop": selectedDevice === RESPONSIVE_DEVICES.DESKTOP,
|
|
804
|
+
"neeto-templates-full-page-preview__holder--tablet": selectedDevice === RESPONSIVE_DEVICES.TABLET,
|
|
805
|
+
"neeto-templates-full-page-preview__holder--mobile": selectedDevice === RESPONSIVE_DEVICES.MOBILE
|
|
806
|
+
}),
|
|
807
|
+
children: /*#__PURE__*/jsx("div", {
|
|
808
|
+
className: "neeto-templates-full-page-preview__device-border h-full w-full",
|
|
809
|
+
children: /*#__PURE__*/jsx("iframe", {
|
|
810
|
+
className: "neeto-templates-full-page-preview__iframe h-full w-full border-none",
|
|
811
|
+
"data-cy": "iframe-id",
|
|
812
|
+
src: previewUrl
|
|
813
|
+
})
|
|
814
|
+
})
|
|
815
|
+
})
|
|
816
|
+
})]
|
|
817
|
+
});
|
|
2880
818
|
};
|
|
2881
819
|
|
|
2882
820
|
var CreateTemplateModal = function CreateTemplateModal(_ref) {
|
|
@@ -2903,24 +841,26 @@ var CreateTemplateModal = function CreateTemplateModal(_ref) {
|
|
|
2903
841
|
}, 300); //To accommodate the animation duration.
|
|
2904
842
|
};
|
|
2905
843
|
|
|
2906
|
-
return /*#__PURE__*/
|
|
2907
|
-
className: "neeto-template-list h-screen w-screen overflow-y-auto",
|
|
844
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
2908
845
|
isOpen: isOpen,
|
|
846
|
+
className: "neeto-template-list h-screen w-screen overflow-y-auto",
|
|
847
|
+
closeButton: currentScreen === TEMPLATE_SCREENS.LIST,
|
|
2909
848
|
size: "fullScreen",
|
|
2910
|
-
onClose: onModalClose
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
849
|
+
onClose: onModalClose,
|
|
850
|
+
children: currentScreen === TEMPLATE_SCREENS.LIST ? /*#__PURE__*/jsx(List, {
|
|
851
|
+
afterCreate: afterCreate,
|
|
852
|
+
isCreating: isCreating,
|
|
853
|
+
onCreate: onCreate,
|
|
854
|
+
refetchResource: refetchResource,
|
|
855
|
+
setCurrentScreen: setCurrentScreen,
|
|
856
|
+
setSelectedTemplate: setSelectedTemplate
|
|
857
|
+
}) : /*#__PURE__*/jsx(Preview$1, {
|
|
858
|
+
afterCreate: afterCreate,
|
|
859
|
+
refetchResource: refetchResource,
|
|
860
|
+
selectedTemplate: selectedTemplate,
|
|
861
|
+
setCurrentScreen: setCurrentScreen
|
|
862
|
+
})
|
|
863
|
+
});
|
|
2924
864
|
};
|
|
2925
865
|
|
|
2926
866
|
var create = function create(payload) {
|
|
@@ -2938,21 +878,24 @@ var templateTagsApi = {
|
|
|
2938
878
|
list: list
|
|
2939
879
|
};
|
|
2940
880
|
|
|
2941
|
-
function ownKeys$
|
|
2942
|
-
function _objectSpread$
|
|
881
|
+
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; }
|
|
882
|
+
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; }
|
|
2943
883
|
var useCreateTemplateTag = function useCreateTemplateTag(options) {
|
|
2944
|
-
|
|
2945
|
-
|
|
884
|
+
return useMutation(_objectSpread$3(_objectSpread$3({
|
|
885
|
+
mutationFn: templateTagsApi.create
|
|
886
|
+
}, options), {}, {
|
|
2946
887
|
onSuccess: function onSuccess() {
|
|
2947
888
|
var _options$onSuccess;
|
|
2948
889
|
refetchTags();
|
|
2949
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEMPLATE_TAGS);
|
|
2950
890
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
|
|
2951
891
|
}
|
|
2952
892
|
}));
|
|
2953
893
|
};
|
|
2954
894
|
var useFetchTemplateTags = function useFetchTemplateTags() {
|
|
2955
|
-
return useQuery(
|
|
895
|
+
return useQuery({
|
|
896
|
+
queryKey: [QUERY_KEYS.TEMPLATE_TAGS],
|
|
897
|
+
queryFn: templateTagsApi.list
|
|
898
|
+
});
|
|
2956
899
|
};
|
|
2957
900
|
|
|
2958
901
|
var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
@@ -2968,7 +911,7 @@ var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
|
2968
911
|
setFieldValue("imageSignedId", file.signedId);
|
|
2969
912
|
return setValue(file.url);
|
|
2970
913
|
};
|
|
2971
|
-
return /*#__PURE__*/
|
|
914
|
+
return /*#__PURE__*/jsx(ImageUploader, {
|
|
2972
915
|
className: "h-52 w-full md:h-80",
|
|
2973
916
|
src: field.value,
|
|
2974
917
|
uploadConfig: IMAGE_UPLOAD_CONFIG,
|
|
@@ -2979,20 +922,22 @@ var FormikImageUploader = function FormikImageUploader(_ref) {
|
|
|
2979
922
|
var PageWrapper = function PageWrapper(_ref) {
|
|
2980
923
|
var children = _ref.children,
|
|
2981
924
|
className = _ref.className;
|
|
2982
|
-
return /*#__PURE__*/
|
|
2983
|
-
className: classnames("w-full flex-col", className)
|
|
2984
|
-
|
|
925
|
+
return /*#__PURE__*/jsx("div", {
|
|
926
|
+
className: classnames("w-full flex-col", className),
|
|
927
|
+
children: children
|
|
928
|
+
});
|
|
2985
929
|
};
|
|
2986
930
|
var PageHeader = function PageHeader(_ref2) {
|
|
2987
931
|
var title = _ref2.title,
|
|
2988
932
|
breadcrumbs = _ref2.breadcrumbs;
|
|
2989
|
-
return /*#__PURE__*/
|
|
2990
|
-
className: "w-full px-6"
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
933
|
+
return /*#__PURE__*/jsx("div", {
|
|
934
|
+
className: "w-full px-6",
|
|
935
|
+
children: /*#__PURE__*/jsx(Header, {
|
|
936
|
+
breadcrumbs: breadcrumbs,
|
|
937
|
+
size: "small",
|
|
938
|
+
title: title
|
|
939
|
+
})
|
|
940
|
+
});
|
|
2996
941
|
};
|
|
2997
942
|
var customPropEqualityCheck = function customPropEqualityCheck(prevProps, nextProps) {
|
|
2998
943
|
return prevProps.title === nextProps.title && prevProps.breadcrumbs === nextProps.breadcrumbs;
|
|
@@ -3002,13 +947,17 @@ var PageContent = function PageContent(_ref3) {
|
|
|
3002
947
|
var children = _ref3.children,
|
|
3003
948
|
_ref3$className = _ref3.className,
|
|
3004
949
|
className = _ref3$className === void 0 ? "" : _ref3$className;
|
|
3005
|
-
return /*#__PURE__*/
|
|
3006
|
-
className: "w-full px-6 pb-6"
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
950
|
+
return /*#__PURE__*/jsx(Scrollable, {
|
|
951
|
+
className: "w-full px-6 pb-6",
|
|
952
|
+
children: /*#__PURE__*/jsx("div", {
|
|
953
|
+
className: classnames(["mx-auto max-w-7xl", className]),
|
|
954
|
+
children: children
|
|
955
|
+
})
|
|
956
|
+
});
|
|
3010
957
|
};
|
|
3011
958
|
|
|
959
|
+
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; }
|
|
960
|
+
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; }
|
|
3012
961
|
var Tags = function Tags(_ref) {
|
|
3013
962
|
var allTags = _ref.allTags,
|
|
3014
963
|
selectedTags = _ref.selectedTags,
|
|
@@ -3040,44 +989,52 @@ var Tags = function Tags(_ref) {
|
|
|
3040
989
|
}
|
|
3041
990
|
});
|
|
3042
991
|
};
|
|
3043
|
-
return /*#__PURE__*/
|
|
3044
|
-
className: className
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
992
|
+
return /*#__PURE__*/jsxs("div", {
|
|
993
|
+
className: className,
|
|
994
|
+
children: [labelProps.label && /*#__PURE__*/jsx(Label, _objectSpread$2(_objectSpread$2({}, labelProps), {}, {
|
|
995
|
+
children: labelProps.label
|
|
996
|
+
})), /*#__PURE__*/jsx("div", {
|
|
997
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-lg neeto-ui-bg-white border p-4",
|
|
998
|
+
children: /*#__PURE__*/jsx(TagsComponent, {
|
|
999
|
+
allTags: allTags,
|
|
1000
|
+
selectedTags: selectedTags,
|
|
1001
|
+
buttonProps: {
|
|
1002
|
+
loading: isLoading,
|
|
1003
|
+
disabled: isLoading,
|
|
1004
|
+
iconPosition: "left"
|
|
1005
|
+
},
|
|
1006
|
+
onTagCreate: handleTagCreate,
|
|
1007
|
+
onTagDelete: handleTagRemove,
|
|
1008
|
+
onTagSelect: handleTagSelect
|
|
1009
|
+
})
|
|
1010
|
+
})]
|
|
1011
|
+
});
|
|
3059
1012
|
};
|
|
3060
1013
|
|
|
3061
1014
|
var Preview = function Preview(_ref) {
|
|
3062
1015
|
var template = _ref.template,
|
|
3063
1016
|
imageUrl = _ref.imageUrl;
|
|
3064
|
-
return /*#__PURE__*/
|
|
1017
|
+
return /*#__PURE__*/jsxs("div", {
|
|
3065
1018
|
className: "neeto-template neeto-ui-bg-white outline-none neeto-ui-shadow-sm hover:neeto-ui-border-gray-400 focus:neeto-ui-border-gray-500 neeto-ui-rounded-lg flex cursor-pointer flex-col overflow-hidden border transition-colors duration-300 ease-in-out",
|
|
3066
|
-
tabIndex: 0
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
1019
|
+
tabIndex: 0,
|
|
1020
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
1021
|
+
className: "neeto-template__header",
|
|
1022
|
+
children: /*#__PURE__*/jsx("img", {
|
|
1023
|
+
className: "neeto-template__image",
|
|
1024
|
+
"data-cy": "template-image-preview",
|
|
1025
|
+
src: imageUrl || "https://d2v7kzglnr2dnh.cloudfront.net/images/neetoForm/default-form-template.svg"
|
|
1026
|
+
})
|
|
1027
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1028
|
+
className: "neeto-ui-bg-white flex items-center justify-between gap-2 rounded-b-lg px-2 py-1.5",
|
|
1029
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1030
|
+
className: "neeto-ui-text-gray-800",
|
|
1031
|
+
"data-cy": "template-title-text",
|
|
1032
|
+
lineHeight: "normal",
|
|
1033
|
+
style: "body2",
|
|
1034
|
+
children: template.title
|
|
1035
|
+
})
|
|
1036
|
+
})]
|
|
1037
|
+
});
|
|
3081
1038
|
};
|
|
3082
1039
|
|
|
3083
1040
|
var buildSelectOptionsBy = function buildSelectOptionsBy(labelField) {
|
|
@@ -3104,8 +1061,8 @@ var buildTemplateUpdatePayload = function buildTemplateUpdatePayload(values) {
|
|
|
3104
1061
|
};
|
|
3105
1062
|
};
|
|
3106
1063
|
|
|
3107
|
-
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; }
|
|
3108
|
-
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; }
|
|
1064
|
+
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; }
|
|
1065
|
+
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; }
|
|
3109
1066
|
var TemplateSettings = function TemplateSettings(_ref) {
|
|
3110
1067
|
var _ref$onCancelTemplate = _ref.onCancelTemplatePreview,
|
|
3111
1068
|
onCancelTemplatePreview = _ref$onCancelTemplate === void 0 ? "" : _ref$onCancelTemplate,
|
|
@@ -3126,10 +1083,10 @@ var TemplateSettings = function TemplateSettings(_ref) {
|
|
|
3126
1083
|
resourceId: resourceId
|
|
3127
1084
|
}),
|
|
3128
1085
|
updateTemplate = _useUpdateTemplate.mutate,
|
|
3129
|
-
isUpdatingTemplate = _useUpdateTemplate.
|
|
1086
|
+
isUpdatingTemplate = _useUpdateTemplate.isPending;
|
|
3130
1087
|
var _useCreateTemplateTag = useCreateTemplateTag(),
|
|
3131
1088
|
createTemplateTag = _useCreateTemplateTag.mutate,
|
|
3132
|
-
isCreatingTags = _useCreateTemplateTag.
|
|
1089
|
+
isCreatingTags = _useCreateTemplateTag.isPending;
|
|
3133
1090
|
var _useFetchTemplateTags = useFetchTemplateTags(),
|
|
3134
1091
|
_useFetchTemplateTags2 = _useFetchTemplateTags.data,
|
|
3135
1092
|
templateTags = _useFetchTemplateTags2 === void 0 ? {} : _useFetchTemplateTags2,
|
|
@@ -3141,91 +1098,203 @@ var TemplateSettings = function TemplateSettings(_ref) {
|
|
|
3141
1098
|
};
|
|
3142
1099
|
var isLoading = isFetchingTemplate || isTagsLoading;
|
|
3143
1100
|
var tags = buildTagOptions(data === null || data === void 0 ? void 0 : data.tags);
|
|
3144
|
-
var resourceInitialValues = _objectSpread(_objectSpread({
|
|
1101
|
+
var resourceInitialValues = _objectSpread$1(_objectSpread$1({
|
|
3145
1102
|
imageUrl: null
|
|
3146
1103
|
}, data), {}, {
|
|
3147
1104
|
tags: tags
|
|
3148
1105
|
});
|
|
3149
|
-
return /*#__PURE__*/
|
|
3150
|
-
className: className
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
1106
|
+
return /*#__PURE__*/jsxs(PageWrapper, {
|
|
1107
|
+
className: className,
|
|
1108
|
+
children: [/*#__PURE__*/jsx(MemoizedPageHeader, {
|
|
1109
|
+
breadcrumbs: breadcrumbs,
|
|
1110
|
+
title: t("neetoTemplate.templateSettings.title")
|
|
1111
|
+
}), /*#__PURE__*/jsx(PageContent, {
|
|
1112
|
+
className: classnames({
|
|
1113
|
+
"min-h-0": !isLoading,
|
|
1114
|
+
"h-full": isLoading
|
|
1115
|
+
}),
|
|
1116
|
+
children: isLoading ? /*#__PURE__*/jsx(PageLoader, {}) : /*#__PURE__*/jsxs(Fragment, {
|
|
1117
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1118
|
+
className: "mb-1",
|
|
1119
|
+
"data-cy": "thank-you-action-text",
|
|
1120
|
+
style: "h2",
|
|
1121
|
+
weight: "semibold",
|
|
1122
|
+
children: t("neetoTemplate.templateSettings.configureTemplates")
|
|
1123
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
1124
|
+
className: "mb-2",
|
|
1125
|
+
"data-cy": "thank-you-description-label",
|
|
1126
|
+
style: "body2",
|
|
1127
|
+
children: t("neetoTemplate.templateSettings.subText")
|
|
1128
|
+
}), /*#__PURE__*/jsx(Form, {
|
|
1129
|
+
formikProps: {
|
|
1130
|
+
enableReinitialize: true,
|
|
1131
|
+
initialValues: resourceInitialValues,
|
|
1132
|
+
onSubmit: handleSubmit
|
|
1133
|
+
},
|
|
1134
|
+
children: function children(_ref2) {
|
|
1135
|
+
var values = _ref2.values,
|
|
1136
|
+
setFieldValue = _ref2.setFieldValue;
|
|
1137
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1138
|
+
className: "grid grid-cols-2 gap-8 pt-6",
|
|
1139
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1140
|
+
className: "space-y-4",
|
|
1141
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1142
|
+
className: "mb-3",
|
|
1143
|
+
style: "h4",
|
|
1144
|
+
weight: "semibold",
|
|
1145
|
+
children: t("neetoTemplate.templateSettings.imageLabel")
|
|
1146
|
+
}), /*#__PURE__*/jsx(FormikImageUploader, {
|
|
1147
|
+
name: "imageUrl"
|
|
1148
|
+
}), /*#__PURE__*/jsx(Tags, {
|
|
1149
|
+
allTags: buildSelectOptionsBy("name", templateTags.tags),
|
|
1150
|
+
className: "space-y-2",
|
|
1151
|
+
isLoading: isCreatingTags,
|
|
1152
|
+
selectedTags: values.tags,
|
|
1153
|
+
labelProps: {
|
|
1154
|
+
label: t("neetoTemplate.templateSettings.categoryLabel")
|
|
1155
|
+
},
|
|
1156
|
+
onCreate: createTemplateTag,
|
|
1157
|
+
onUpdate: function onUpdate(tags) {
|
|
1158
|
+
return setFieldValue("tags", tags);
|
|
1159
|
+
}
|
|
1160
|
+
}), /*#__PURE__*/jsx("div", {
|
|
1161
|
+
className: "mt-12 flex flex-row items-center justify-start",
|
|
1162
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1163
|
+
isSubmitting: isUpdatingTemplate,
|
|
1164
|
+
cancelButtonProps: {
|
|
1165
|
+
to: onCancelTemplatePreview,
|
|
1166
|
+
"data-cy": "reset-changes-button",
|
|
1167
|
+
onClick: noop
|
|
1168
|
+
}
|
|
1169
|
+
})
|
|
1170
|
+
})]
|
|
1171
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
1172
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1173
|
+
className: "mb-3",
|
|
1174
|
+
style: "h4",
|
|
1175
|
+
weight: "semibold",
|
|
1176
|
+
children: t("neetoTemplate.templateSettings.previewLabel")
|
|
1177
|
+
}), /*#__PURE__*/jsx(Preview, {
|
|
1178
|
+
imageUrl: values.imageUrl,
|
|
1179
|
+
template: data
|
|
1180
|
+
})]
|
|
1181
|
+
})]
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
})]
|
|
1185
|
+
})
|
|
1186
|
+
})]
|
|
1187
|
+
});
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1191
|
+
if (source == null) return {};
|
|
1192
|
+
var target = {};
|
|
1193
|
+
var sourceKeys = Object.keys(source);
|
|
1194
|
+
var key, i;
|
|
1195
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1196
|
+
key = sourceKeys[i];
|
|
1197
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1198
|
+
target[key] = source[key];
|
|
1199
|
+
}
|
|
1200
|
+
return target;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1204
|
+
if (source == null) return {};
|
|
1205
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
1206
|
+
var key, i;
|
|
1207
|
+
if (Object.getOwnPropertySymbols) {
|
|
1208
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1209
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1210
|
+
key = sourceSymbolKeys[i];
|
|
1211
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1212
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1213
|
+
target[key] = source[key];
|
|
3173
1214
|
}
|
|
3174
|
-
}
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
1215
|
+
}
|
|
1216
|
+
return target;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
var TAG_TYPES = [{
|
|
1220
|
+
id: 1,
|
|
1221
|
+
label: t$1("neetoTemplate.templatesTags.template"),
|
|
1222
|
+
url: "".concat(NEETO_TEMPLATES_URL, "/tags/template_tags"),
|
|
1223
|
+
columns: [{
|
|
1224
|
+
title: t$1("neetoTemplate.templatesTags.numberOfActiveTemplates"),
|
|
1225
|
+
key: "templates_count",
|
|
1226
|
+
dataIndex: "templatesCount",
|
|
1227
|
+
align: "center",
|
|
1228
|
+
width: 300,
|
|
1229
|
+
sorter: true,
|
|
1230
|
+
render: function render(templatesCount) {
|
|
1231
|
+
return templatesCount !== 0 ? /*#__PURE__*/jsxs(Typography, {
|
|
1232
|
+
style: "body1",
|
|
1233
|
+
children: [" ", templatesCount, " "]
|
|
1234
|
+
}) : "-";
|
|
1235
|
+
}
|
|
1236
|
+
}]
|
|
1237
|
+
}];
|
|
1238
|
+
|
|
1239
|
+
var _excluded = ["breadcrumbs", "tagsPath"];
|
|
1240
|
+
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; }
|
|
1241
|
+
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; }
|
|
1242
|
+
var TemplateTags = function TemplateTags(_ref) {
|
|
1243
|
+
var breadcrumbs = _ref.breadcrumbs,
|
|
1244
|
+
tagsPath = _ref.tagsPath,
|
|
1245
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
1246
|
+
var queryClient = useQueryClient();
|
|
1247
|
+
var invalidateTags = function invalidateTags() {
|
|
1248
|
+
queryClient.invalidateQueries({
|
|
1249
|
+
queryKey: [QUERY_KEYS.TEMPLATE_TAGS]
|
|
1250
|
+
});
|
|
1251
|
+
};
|
|
1252
|
+
var invalidateTagsAndTemplates = function invalidateTagsAndTemplates() {
|
|
1253
|
+
invalidateTags();
|
|
1254
|
+
queryClient.invalidateQueries({
|
|
1255
|
+
queryKey: [QUERY_KEYS.TEMPLATES_LIST]
|
|
1256
|
+
});
|
|
1257
|
+
queryClient.invalidateQueries({
|
|
1258
|
+
queryKey: [QUERY_KEYS.TEMPLATE]
|
|
1259
|
+
});
|
|
1260
|
+
};
|
|
1261
|
+
var config = _objectSpread({
|
|
1262
|
+
tagTypes: TAG_TYPES,
|
|
1263
|
+
tagsMergable: true,
|
|
1264
|
+
breadcrumbs: breadcrumbs,
|
|
1265
|
+
displayMenu: false,
|
|
1266
|
+
tagsPath: tagsPath,
|
|
1267
|
+
onTagRowClick: noop,
|
|
1268
|
+
createTags: {
|
|
1269
|
+
onSuccess: {
|
|
1270
|
+
callback: invalidateTags
|
|
3199
1271
|
}
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
template: data
|
|
3221
|
-
})));
|
|
3222
|
-
}))));
|
|
1272
|
+
},
|
|
1273
|
+
updateTags: {
|
|
1274
|
+
onSuccess: {
|
|
1275
|
+
callback: invalidateTagsAndTemplates
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
deleteTags: {
|
|
1279
|
+
onSuccess: {
|
|
1280
|
+
callback: invalidateTagsAndTemplates
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
mergeTags: {
|
|
1284
|
+
onSuccess: {
|
|
1285
|
+
callback: invalidateTagsAndTemplates
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
}, otherProps);
|
|
1289
|
+
return /*#__PURE__*/jsx(NeetoTags, {
|
|
1290
|
+
config: config
|
|
1291
|
+
});
|
|
3223
1292
|
};
|
|
3224
1293
|
|
|
3225
1294
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
3226
1295
|
|
|
3227
|
-
var css = ".neeto-template-list .neeto-ui-modal__close{z-index:1}.neeto-template__header{flex-grow:1;min-height:120px}.neeto-template__image{aspect-ratio:16/9;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;width:100%}.neeto-template__description{min-height:54px}.neeto-templates-share-preview{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-gray-300));box-shadow:var(--neeto-ui-shadow-m);display:flex;flex-direction:column;height:calc(100vh - 104px);width:100%}\n/*# sourceMappingURL=data:application/json;base64,
|
|
1296
|
+
var css = ".neeto-template-list .neeto-ui-modal__close{z-index:1}.neeto-template__header{flex-grow:1;min-height:120px}.neeto-template__image{aspect-ratio:16/9;max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;width:100%}.neeto-template__description{min-height:54px}.neeto-template-thumbnail .neeto-template__image{transition:transform .5s ease}.neeto-template-thumbnail .neeto-template-thumbnail__title{transition:color .5s ease}.neeto-template-thumbnail:hover .neeto-template__image{transform:scale(1.08)}.neeto-template-thumbnail:hover .neeto-template-thumbnail__title{color:rgb(var(--neeto-ui-black))!important}.neeto-templates-full-page-preview__holder{transition:all .2s ease-in-out}.neeto-templates-full-page-preview__holder--desktop{height:100%;max-width:100%;width:100%}.neeto-templates-full-page-preview__holder--tablet{height:1024px;margin-top:16px!important;max-height:calc(100% - 32px);max-width:768px}.neeto-templates-full-page-preview__holder--tablet .neeto-templates-full-page-preview__iframe{border:1px solid rgb(var(--neeto-ui-gray-300))!important}.neeto-templates-full-page-preview__holder--mobile{height:896px;margin-top:16px!important;max-height:calc(100% - 32px);max-width:384px}.neeto-templates-full-page-preview__holder--mobile .neeto-templates-full-page-preview__iframe{border:1px solid rgb(var(--neeto-ui-gray-300))!important}.neeto-templates-share-preview{background-color:rgb(var(--neeto-ui-white));border:thin solid rgb(var(--neeto-ui-gray-300));box-shadow:var(--neeto-ui-shadow-m);display:flex;flex-direction:column;height:calc(100vh - 104px);width:100%}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fdGVtcGxhdGUtbGlzdC5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL3RlbXBsYXRlcy9fc2hhcmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDRSw0Q0FDRSxTQ0FKLENES0Usd0JBRUUsV0FBQSxDQURBLGdCQ0RKLENES0UsdUJBRUUsaUJBQUEsQ0FHQSxlQUFBLENBREEsY0FBQSxDQURBLG1CQUFBLENBQUEsZ0JBQUEsQ0FGQSxVQ0NKLENES0UsNkJBQ0UsZUNISixDRFFFLGlEQUNFLDZCQ0xKLENET0UsMkRBQ0UseUJDTEosQ0RRSSx1REFDRSxxQkNOTixDRFFJLGlFQUNFLDBDQ05OLENEV0EsMkNBQ0UsOEJDUkYsQ0RXQSxvREFFRSxXQUFBLENBQ0EsY0FBQSxDQUZBLFVDTkYsQ0RXQSxtREFFRSxhQUFBLENBRUEseUJBQUEsQ0FEQSw0QkFBQSxDQUZBLGVDTEYsQ0RVRSw4RkFDRSx3RENSSixDRFlBLG1EQUVFLFlBQUEsQ0FFQSx5QkFBQSxDQURBLDRCQUFBLENBRkEsZUNORixDRFdFLDhGQUNFLHdEQ1RKLENDNURBLCtCQU9FLDJDQUFBLENBSkEsK0NBQUEsQ0FDQSxtQ0FBQSxDQUNBLFlBQUEsQ0FDQSxxQkFBQSxDQUpBLDBCQUFBLENBREEsVURxRUYiLCJzb3VyY2VzQ29udGVudCI6WyIubmVldG8tdGVtcGxhdGUtbGlzdCB7XG4gIC5uZWV0by11aS1tb2RhbF9fY2xvc2Uge1xuICAgIHotaW5kZXg6IDE7XG4gIH1cbn1cblxuLm5lZXRvLXRlbXBsYXRlIHtcbiAgJl9faGVhZGVyIHtcbiAgICBtaW4taGVpZ2h0OiAkbmVldG8tdGVtcGxhdGUtaGVhZGVyLW1pbi1oZWlnaHQ7XG4gICAgZmxleC1ncm93OiAxO1xuICB9XG5cbiAgJl9faW1hZ2Uge1xuICAgIHdpZHRoOiAxMDAlO1xuICAgIGFzcGVjdC1yYXRpbzogMTYgLyA5O1xuICAgIG9iamVjdC1maXQ6IGNvdmVyO1xuICAgIG1heC13aWR0aDogMTAwJTtcbiAgICBtYXgtaGVpZ2h0OiAxMDAlO1xuICB9XG4gICZfX2Rlc2NyaXB0aW9uIHtcbiAgICBtaW4taGVpZ2h0OiAkbmVldG8tdGVtcGxhdGUtZGVzY3JpcHRpb24tbWluLWhlaWdodDtcbiAgfVxufVxuXG4ubmVldG8tdGVtcGxhdGUtdGh1bWJuYWlsIHtcbiAgLm5lZXRvLXRlbXBsYXRlX19pbWFnZSB7XG4gICAgdHJhbnNpdGlvbjogdHJhbnNmb3JtIDAuNXMgZWFzZTtcbiAgfVxuICAubmVldG8tdGVtcGxhdGUtdGh1bWJuYWlsX190aXRsZSB7XG4gICAgdHJhbnNpdGlvbjogY29sb3IgMC41cyBlYXNlO1xuICB9XG4gICY6aG92ZXIge1xuICAgIC5uZWV0by10ZW1wbGF0ZV9faW1hZ2Uge1xuICAgICAgdHJhbnNmb3JtOiBzY2FsZSgxLjA4KTtcbiAgICB9XG4gICAgLm5lZXRvLXRlbXBsYXRlLXRodW1ibmFpbF9fdGl0bGUge1xuICAgICAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ibGFjaykpICFpbXBvcnRhbnQ7XG4gICAgfVxuICB9XG59XG5cbi5uZWV0by10ZW1wbGF0ZXMtZnVsbC1wYWdlLXByZXZpZXdfX2hvbGRlciB7XG4gIHRyYW5zaXRpb246IGFsbCAwLjJzIGVhc2UtaW4tb3V0O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19ob2xkZXItLWRlc2t0b3Age1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xuICBtYXgtd2lkdGg6IDEwMCU7XG59XG5cbi5uZWV0by10ZW1wbGF0ZXMtZnVsbC1wYWdlLXByZXZpZXdfX2hvbGRlci0tdGFibGV0IHtcbiAgbWF4LXdpZHRoOiA3NjhweDtcbiAgaGVpZ2h0OiAxMDI0cHg7XG4gIG1heC1oZWlnaHQ6IGNhbGMoMTAwJSAtIDMycHgpO1xuICBtYXJnaW4tdG9wOiAxNnB4ICFpbXBvcnRhbnQ7XG5cbiAgLm5lZXRvLXRlbXBsYXRlcy1mdWxsLXBhZ2UtcHJldmlld19faWZyYW1lIHtcbiAgICBib3JkZXI6IDFweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS0zMDApKSAhaW1wb3J0YW50O1xuICB9XG59XG5cbi5uZWV0by10ZW1wbGF0ZXMtZnVsbC1wYWdlLXByZXZpZXdfX2hvbGRlci0tbW9iaWxlIHtcbiAgbWF4LXdpZHRoOiAzODRweDtcbiAgaGVpZ2h0OiA4OTZweDtcbiAgbWF4LWhlaWdodDogY2FsYygxMDAlIC0gMzJweCk7XG4gIG1hcmdpbi10b3A6IDE2cHggIWltcG9ydGFudDtcblxuICAubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19pZnJhbWUge1xuICAgIGJvcmRlcjogMXB4IHNvbGlkIHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTMwMCkpICFpbXBvcnRhbnQ7XG4gIH1cbn1cbiIsIi5uZWV0by10ZW1wbGF0ZS1saXN0IC5uZWV0by11aS1tb2RhbF9fY2xvc2Uge1xuICB6LWluZGV4OiAxO1xufVxuXG4ubmVldG8tdGVtcGxhdGVfX2hlYWRlciB7XG4gIG1pbi1oZWlnaHQ6IDEyMHB4O1xuICBmbGV4LWdyb3c6IDE7XG59XG4ubmVldG8tdGVtcGxhdGVfX2ltYWdlIHtcbiAgd2lkdGg6IDEwMCU7XG4gIGFzcGVjdC1yYXRpbzogMTYvOTtcbiAgb2JqZWN0LWZpdDogY292ZXI7XG4gIG1heC13aWR0aDogMTAwJTtcbiAgbWF4LWhlaWdodDogMTAwJTtcbn1cbi5uZWV0by10ZW1wbGF0ZV9fZGVzY3JpcHRpb24ge1xuICBtaW4taGVpZ2h0OiA1NHB4O1xufVxuXG4ubmVldG8tdGVtcGxhdGUtdGh1bWJuYWlsIC5uZWV0by10ZW1wbGF0ZV9faW1hZ2Uge1xuICB0cmFuc2l0aW9uOiB0cmFuc2Zvcm0gMC41cyBlYXNlO1xufVxuLm5lZXRvLXRlbXBsYXRlLXRodW1ibmFpbCAubmVldG8tdGVtcGxhdGUtdGh1bWJuYWlsX190aXRsZSB7XG4gIHRyYW5zaXRpb246IGNvbG9yIDAuNXMgZWFzZTtcbn1cbi5uZWV0by10ZW1wbGF0ZS10aHVtYm5haWw6aG92ZXIgLm5lZXRvLXRlbXBsYXRlX19pbWFnZSB7XG4gIHRyYW5zZm9ybTogc2NhbGUoMS4wOCk7XG59XG4ubmVldG8tdGVtcGxhdGUtdGh1bWJuYWlsOmhvdmVyIC5uZWV0by10ZW1wbGF0ZS10aHVtYm5haWxfX3RpdGxlIHtcbiAgY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS1ibGFjaykpICFpbXBvcnRhbnQ7XG59XG5cbi5uZWV0by10ZW1wbGF0ZXMtZnVsbC1wYWdlLXByZXZpZXdfX2hvbGRlciB7XG4gIHRyYW5zaXRpb246IGFsbCAwLjJzIGVhc2UtaW4tb3V0O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19ob2xkZXItLWRlc2t0b3Age1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xuICBtYXgtd2lkdGg6IDEwMCU7XG59XG5cbi5uZWV0by10ZW1wbGF0ZXMtZnVsbC1wYWdlLXByZXZpZXdfX2hvbGRlci0tdGFibGV0IHtcbiAgbWF4LXdpZHRoOiA3NjhweDtcbiAgaGVpZ2h0OiAxMDI0cHg7XG4gIG1heC1oZWlnaHQ6IGNhbGMoMTAwJSAtIDMycHgpO1xuICBtYXJnaW4tdG9wOiAxNnB4ICFpbXBvcnRhbnQ7XG59XG4ubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19ob2xkZXItLXRhYmxldCAubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19pZnJhbWUge1xuICBib3JkZXI6IDFweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS0zMDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19ob2xkZXItLW1vYmlsZSB7XG4gIG1heC13aWR0aDogMzg0cHg7XG4gIGhlaWdodDogODk2cHg7XG4gIG1heC1oZWlnaHQ6IGNhbGMoMTAwJSAtIDMycHgpO1xuICBtYXJnaW4tdG9wOiAxNnB4ICFpbXBvcnRhbnQ7XG59XG4ubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19ob2xkZXItLW1vYmlsZSAubmVldG8tdGVtcGxhdGVzLWZ1bGwtcGFnZS1wcmV2aWV3X19pZnJhbWUge1xuICBib3JkZXI6IDFweCBzb2xpZCByZ2IodmFyKC0tbmVldG8tdWktZ3JheS0zMDApKSAhaW1wb3J0YW50O1xufVxuXG4ubmVldG8tdGVtcGxhdGVzLXNoYXJlLXByZXZpZXcge1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiBjYWxjKDEwMHZoIC0gMTA0cHgpO1xuICBib3JkZXI6IHRoaW4gc29saWQgcmdiKHZhcigtLW5lZXRvLXVpLWdyYXktMzAwKSk7XG4gIGJveC1zaGFkb3c6IHZhcigtLW5lZXRvLXVpLXNoYWRvdy1tKTtcbiAgZGlzcGxheTogZmxleDtcbiAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgYmFja2dyb3VuZC1jb2xvcjogcmdiKHZhcigtLW5lZXRvLXVpLXdoaXRlKSk7XG59IiwiLm5lZXRvLXRlbXBsYXRlcy1zaGFyZS1wcmV2aWV3IHtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogY2FsYygxMDB2aCAtIDEwNHB4KTtcbiAgYm9yZGVyOiB0aGluIHNvbGlkIHJnYih2YXIoLS1uZWV0by11aS1ncmF5LTMwMCkpO1xuICBib3gtc2hhZG93OiB2YXIoLS1uZWV0by11aS1zaGFkb3ctbSk7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIGZsZXgtZGlyZWN0aW9uOiBjb2x1bW47XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYih2YXIoLS1uZWV0by11aS13aGl0ZSkpO1xufVxuIl19 */";
|
|
3228
1297
|
n(css,{});
|
|
3229
1298
|
|
|
3230
|
-
export { CreateTemplateModal, TemplateSettings };
|
|
1299
|
+
export { CreateTemplateModal, TemplateSettings, TemplateTags };
|
|
3231
1300
|
//# sourceMappingURL=index.js.map
|