@bigbinary/neeto-commons-frontend 2.0.1 → 2.0.4

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/utils.cjs.js ADDED
@@ -0,0 +1,1325 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var axios = require('axios');
6
+ var ramda = require('ramda');
7
+ var i18next = require('i18next');
8
+ var dayjs = require('dayjs');
9
+ var relativeTime = require('dayjs/plugin/relativeTime');
10
+ var updateLocale = require('dayjs/plugin/updateLocale');
11
+
12
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
+
14
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
15
+ var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
16
+ var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
17
+ var relativeTime__default = /*#__PURE__*/_interopDefaultLegacy(relativeTime);
18
+ var updateLocale__default = /*#__PURE__*/_interopDefaultLegacy(updateLocale);
19
+
20
+ var HEADERS_KEYS = {
21
+ xAuthEmail: "X-Auth-Email",
22
+ xAuthToken: "X-Auth-Token",
23
+ xCsrfToken: "X-CSRF-TOKEN"
24
+ };
25
+
26
+ var resetAuthTokens = function resetAuthTokens() {
27
+ ramda.values(HEADERS_KEYS).forEach(function (header) {
28
+ delete axios__default["default"].defaults.headers[header];
29
+ });
30
+ };
31
+
32
+ function _arrayWithHoles(arr) {
33
+ if (Array.isArray(arr)) return arr;
34
+ }
35
+
36
+ function _iterableToArrayLimit(arr, i) {
37
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
38
+
39
+ if (_i == null) return;
40
+ var _arr = [];
41
+ var _n = true;
42
+ var _d = false;
43
+
44
+ var _s, _e;
45
+
46
+ try {
47
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
48
+ _arr.push(_s.value);
49
+
50
+ if (i && _arr.length === i) break;
51
+ }
52
+ } catch (err) {
53
+ _d = true;
54
+ _e = err;
55
+ } finally {
56
+ try {
57
+ if (!_n && _i["return"] != null) _i["return"]();
58
+ } finally {
59
+ if (_d) throw _e;
60
+ }
61
+ }
62
+
63
+ return _arr;
64
+ }
65
+
66
+ function _arrayLikeToArray(arr, len) {
67
+ if (len == null || len > arr.length) len = arr.length;
68
+
69
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
70
+ arr2[i] = arr[i];
71
+ }
72
+
73
+ return arr2;
74
+ }
75
+
76
+ function _unsupportedIterableToArray(o, minLen) {
77
+ if (!o) return;
78
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
79
+ var n = Object.prototype.toString.call(o).slice(8, -1);
80
+ if (n === "Object" && o.constructor) n = o.constructor.name;
81
+ if (n === "Map" || n === "Set") return Array.from(o);
82
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
83
+ }
84
+
85
+ function _nonIterableRest() {
86
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
87
+ }
88
+
89
+ function _slicedToArray(arr, i) {
90
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
91
+ }
92
+
93
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
94
+ try {
95
+ var info = gen[key](arg);
96
+ var value = info.value;
97
+ } catch (error) {
98
+ reject(error);
99
+ return;
100
+ }
101
+
102
+ if (info.done) {
103
+ resolve(value);
104
+ } else {
105
+ Promise.resolve(value).then(_next, _throw);
106
+ }
107
+ }
108
+
109
+ function _asyncToGenerator(fn) {
110
+ return function () {
111
+ var self = this,
112
+ args = arguments;
113
+ return new Promise(function (resolve, reject) {
114
+ var gen = fn.apply(self, args);
115
+
116
+ function _next(value) {
117
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
118
+ }
119
+
120
+ function _throw(err) {
121
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
122
+ }
123
+
124
+ _next(undefined);
125
+ });
126
+ };
127
+ }
128
+
129
+ function _defineProperty(obj, key, value) {
130
+ if (key in obj) {
131
+ Object.defineProperty(obj, key, {
132
+ value: value,
133
+ enumerable: true,
134
+ configurable: true,
135
+ writable: true
136
+ });
137
+ } else {
138
+ obj[key] = value;
139
+ }
140
+
141
+ return obj;
142
+ }
143
+
144
+ var regeneratorRuntime$1 = {exports: {}};
145
+
146
+ var _typeof = {exports: {}};
147
+
148
+ (function (module) {
149
+ function _typeof(obj) {
150
+ "@babel/helpers - typeof";
151
+
152
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
153
+ return typeof obj;
154
+ } : function (obj) {
155
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
156
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
157
+ }
158
+
159
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
160
+ } (_typeof));
161
+
162
+ (function (module) {
163
+ var _typeof$1 = _typeof.exports["default"];
164
+
165
+ function _regeneratorRuntime() {
166
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
167
+
168
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
169
+ return exports;
170
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
171
+ var exports = {},
172
+ Op = Object.prototype,
173
+ hasOwn = Op.hasOwnProperty,
174
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
175
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
176
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
177
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
178
+
179
+ function define(obj, key, value) {
180
+ return Object.defineProperty(obj, key, {
181
+ value: value,
182
+ enumerable: !0,
183
+ configurable: !0,
184
+ writable: !0
185
+ }), obj[key];
186
+ }
187
+
188
+ try {
189
+ define({}, "");
190
+ } catch (err) {
191
+ define = function define(obj, key, value) {
192
+ return obj[key] = value;
193
+ };
194
+ }
195
+
196
+ function wrap(innerFn, outerFn, self, tryLocsList) {
197
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
198
+ generator = Object.create(protoGenerator.prototype),
199
+ context = new Context(tryLocsList || []);
200
+ return generator._invoke = function (innerFn, self, context) {
201
+ var state = "suspendedStart";
202
+ return function (method, arg) {
203
+ if ("executing" === state) throw new Error("Generator is already running");
204
+
205
+ if ("completed" === state) {
206
+ if ("throw" === method) throw arg;
207
+ return doneResult();
208
+ }
209
+
210
+ for (context.method = method, context.arg = arg;;) {
211
+ var delegate = context.delegate;
212
+
213
+ if (delegate) {
214
+ var delegateResult = maybeInvokeDelegate(delegate, context);
215
+
216
+ if (delegateResult) {
217
+ if (delegateResult === ContinueSentinel) continue;
218
+ return delegateResult;
219
+ }
220
+ }
221
+
222
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
223
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
224
+ context.dispatchException(context.arg);
225
+ } else "return" === context.method && context.abrupt("return", context.arg);
226
+ state = "executing";
227
+ var record = tryCatch(innerFn, self, context);
228
+
229
+ if ("normal" === record.type) {
230
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
231
+ return {
232
+ value: record.arg,
233
+ done: context.done
234
+ };
235
+ }
236
+
237
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
238
+ }
239
+ };
240
+ }(innerFn, self, context), generator;
241
+ }
242
+
243
+ function tryCatch(fn, obj, arg) {
244
+ try {
245
+ return {
246
+ type: "normal",
247
+ arg: fn.call(obj, arg)
248
+ };
249
+ } catch (err) {
250
+ return {
251
+ type: "throw",
252
+ arg: err
253
+ };
254
+ }
255
+ }
256
+
257
+ exports.wrap = wrap;
258
+ var ContinueSentinel = {};
259
+
260
+ function Generator() {}
261
+
262
+ function GeneratorFunction() {}
263
+
264
+ function GeneratorFunctionPrototype() {}
265
+
266
+ var IteratorPrototype = {};
267
+ define(IteratorPrototype, iteratorSymbol, function () {
268
+ return this;
269
+ });
270
+ var getProto = Object.getPrototypeOf,
271
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
272
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
273
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
274
+
275
+ function defineIteratorMethods(prototype) {
276
+ ["next", "throw", "return"].forEach(function (method) {
277
+ define(prototype, method, function (arg) {
278
+ return this._invoke(method, arg);
279
+ });
280
+ });
281
+ }
282
+
283
+ function AsyncIterator(generator, PromiseImpl) {
284
+ function invoke(method, arg, resolve, reject) {
285
+ var record = tryCatch(generator[method], generator, arg);
286
+
287
+ if ("throw" !== record.type) {
288
+ var result = record.arg,
289
+ value = result.value;
290
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
291
+ invoke("next", value, resolve, reject);
292
+ }, function (err) {
293
+ invoke("throw", err, resolve, reject);
294
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
295
+ result.value = unwrapped, resolve(result);
296
+ }, function (error) {
297
+ return invoke("throw", error, resolve, reject);
298
+ });
299
+ }
300
+
301
+ reject(record.arg);
302
+ }
303
+
304
+ var previousPromise;
305
+
306
+ this._invoke = function (method, arg) {
307
+ function callInvokeWithMethodAndArg() {
308
+ return new PromiseImpl(function (resolve, reject) {
309
+ invoke(method, arg, resolve, reject);
310
+ });
311
+ }
312
+
313
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
314
+ };
315
+ }
316
+
317
+ function maybeInvokeDelegate(delegate, context) {
318
+ var method = delegate.iterator[context.method];
319
+
320
+ if (undefined === method) {
321
+ if (context.delegate = null, "throw" === context.method) {
322
+ if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
323
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
324
+ }
325
+
326
+ return ContinueSentinel;
327
+ }
328
+
329
+ var record = tryCatch(method, delegate.iterator, context.arg);
330
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
331
+ var info = record.arg;
332
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
333
+ }
334
+
335
+ function pushTryEntry(locs) {
336
+ var entry = {
337
+ tryLoc: locs[0]
338
+ };
339
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
340
+ }
341
+
342
+ function resetTryEntry(entry) {
343
+ var record = entry.completion || {};
344
+ record.type = "normal", delete record.arg, entry.completion = record;
345
+ }
346
+
347
+ function Context(tryLocsList) {
348
+ this.tryEntries = [{
349
+ tryLoc: "root"
350
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
351
+ }
352
+
353
+ function values(iterable) {
354
+ if (iterable) {
355
+ var iteratorMethod = iterable[iteratorSymbol];
356
+ if (iteratorMethod) return iteratorMethod.call(iterable);
357
+ if ("function" == typeof iterable.next) return iterable;
358
+
359
+ if (!isNaN(iterable.length)) {
360
+ var i = -1,
361
+ next = function next() {
362
+ for (; ++i < iterable.length;) {
363
+ if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
364
+ }
365
+
366
+ return next.value = undefined, next.done = !0, next;
367
+ };
368
+
369
+ return next.next = next;
370
+ }
371
+ }
372
+
373
+ return {
374
+ next: doneResult
375
+ };
376
+ }
377
+
378
+ function doneResult() {
379
+ return {
380
+ value: undefined,
381
+ done: !0
382
+ };
383
+ }
384
+
385
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
386
+ var ctor = "function" == typeof genFun && genFun.constructor;
387
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
388
+ }, exports.mark = function (genFun) {
389
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
390
+ }, exports.awrap = function (arg) {
391
+ return {
392
+ __await: arg
393
+ };
394
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
395
+ return this;
396
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
397
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
398
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
399
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
400
+ return result.done ? result.value : iter.next();
401
+ });
402
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
403
+ return this;
404
+ }), define(Gp, "toString", function () {
405
+ return "[object Generator]";
406
+ }), exports.keys = function (object) {
407
+ var keys = [];
408
+
409
+ for (var key in object) {
410
+ keys.push(key);
411
+ }
412
+
413
+ return keys.reverse(), function next() {
414
+ for (; keys.length;) {
415
+ var key = keys.pop();
416
+ if (key in object) return next.value = key, next.done = !1, next;
417
+ }
418
+
419
+ return next.done = !0, next;
420
+ };
421
+ }, exports.values = values, Context.prototype = {
422
+ constructor: Context,
423
+ reset: function reset(skipTempReset) {
424
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
425
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
426
+ }
427
+ },
428
+ stop: function stop() {
429
+ this.done = !0;
430
+ var rootRecord = this.tryEntries[0].completion;
431
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
432
+ return this.rval;
433
+ },
434
+ dispatchException: function dispatchException(exception) {
435
+ if (this.done) throw exception;
436
+ var context = this;
437
+
438
+ function handle(loc, caught) {
439
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
440
+ }
441
+
442
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
443
+ var entry = this.tryEntries[i],
444
+ record = entry.completion;
445
+ if ("root" === entry.tryLoc) return handle("end");
446
+
447
+ if (entry.tryLoc <= this.prev) {
448
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
449
+ hasFinally = hasOwn.call(entry, "finallyLoc");
450
+
451
+ if (hasCatch && hasFinally) {
452
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
453
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
454
+ } else if (hasCatch) {
455
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
456
+ } else {
457
+ if (!hasFinally) throw new Error("try statement without catch or finally");
458
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
459
+ }
460
+ }
461
+ }
462
+ },
463
+ abrupt: function abrupt(type, arg) {
464
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
465
+ var entry = this.tryEntries[i];
466
+
467
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
468
+ var finallyEntry = entry;
469
+ break;
470
+ }
471
+ }
472
+
473
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
474
+ var record = finallyEntry ? finallyEntry.completion : {};
475
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
476
+ },
477
+ complete: function complete(record, afterLoc) {
478
+ if ("throw" === record.type) throw record.arg;
479
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
480
+ },
481
+ finish: function finish(finallyLoc) {
482
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
483
+ var entry = this.tryEntries[i];
484
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
485
+ }
486
+ },
487
+ "catch": function _catch(tryLoc) {
488
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
489
+ var entry = this.tryEntries[i];
490
+
491
+ if (entry.tryLoc === tryLoc) {
492
+ var record = entry.completion;
493
+
494
+ if ("throw" === record.type) {
495
+ var thrown = record.arg;
496
+ resetTryEntry(entry);
497
+ }
498
+
499
+ return thrown;
500
+ }
501
+ }
502
+
503
+ throw new Error("illegal catch attempt");
504
+ },
505
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
506
+ return this.delegate = {
507
+ iterator: values(iterable),
508
+ resultName: resultName,
509
+ nextLoc: nextLoc
510
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
511
+ }
512
+ }, exports;
513
+ }
514
+
515
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
516
+ } (regeneratorRuntime$1));
517
+
518
+ // TODO(Babel 8): Remove this file.
519
+
520
+ var runtime = regeneratorRuntime$1.exports();
521
+ var regenerator = runtime;
522
+
523
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
524
+ try {
525
+ regeneratorRuntime = runtime;
526
+ } catch (accidentalStrictMode) {
527
+ if (typeof globalThis === "object") {
528
+ globalThis.regeneratorRuntime = runtime;
529
+ } else {
530
+ Function("r", "regeneratorRuntime = r")(runtime);
531
+ }
532
+ }
533
+
534
+ var getRandomInt = function getRandomInt() {
535
+ var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Number.MAX_SAFE_INTEGER;
536
+ var b = arguments.length > 1 ? arguments[1] : undefined;
537
+
538
+ if (b) {
539
+ a = Math.ceil(a);
540
+ b = Math.floor(b);
541
+ } else {
542
+ b = a;
543
+ a = 0;
544
+ }
545
+
546
+ return Math.floor(Math.random() * (b - a) + a);
547
+ };
548
+ ramda.complement(ramda.isNil);
549
+ ramda.complement(ramda.isEmpty);
550
+ ramda.curry(function (x, y) {
551
+ return x !== y;
552
+ });
553
+ ramda.complement(ramda.equals);
554
+
555
+ var queryString = {};
556
+
557
+ var strictUriEncode = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);
558
+
559
+ var token = '%[a-f0-9]{2}';
560
+ var singleMatcher = new RegExp(token, 'gi');
561
+ var multiMatcher = new RegExp('(' + token + ')+', 'gi');
562
+
563
+ function decodeComponents(components, split) {
564
+ try {
565
+ // Try to decode the entire string first
566
+ return decodeURIComponent(components.join(''));
567
+ } catch (err) {
568
+ // Do nothing
569
+ }
570
+
571
+ if (components.length === 1) {
572
+ return components;
573
+ }
574
+
575
+ split = split || 1;
576
+
577
+ // Split the array in 2 parts
578
+ var left = components.slice(0, split);
579
+ var right = components.slice(split);
580
+
581
+ return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
582
+ }
583
+
584
+ function decode(input) {
585
+ try {
586
+ return decodeURIComponent(input);
587
+ } catch (err) {
588
+ var tokens = input.match(singleMatcher);
589
+
590
+ for (var i = 1; i < tokens.length; i++) {
591
+ input = decodeComponents(tokens, i).join('');
592
+
593
+ tokens = input.match(singleMatcher);
594
+ }
595
+
596
+ return input;
597
+ }
598
+ }
599
+
600
+ function customDecodeURIComponent(input) {
601
+ // Keep track of all the replacements and prefill the map with the `BOM`
602
+ var replaceMap = {
603
+ '%FE%FF': '\uFFFD\uFFFD',
604
+ '%FF%FE': '\uFFFD\uFFFD'
605
+ };
606
+
607
+ var match = multiMatcher.exec(input);
608
+ while (match) {
609
+ try {
610
+ // Decode as big chunks as possible
611
+ replaceMap[match[0]] = decodeURIComponent(match[0]);
612
+ } catch (err) {
613
+ var result = decode(match[0]);
614
+
615
+ if (result !== match[0]) {
616
+ replaceMap[match[0]] = result;
617
+ }
618
+ }
619
+
620
+ match = multiMatcher.exec(input);
621
+ }
622
+
623
+ // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
624
+ replaceMap['%C2'] = '\uFFFD';
625
+
626
+ var entries = Object.keys(replaceMap);
627
+
628
+ for (var i = 0; i < entries.length; i++) {
629
+ // Replace all decoded components
630
+ var key = entries[i];
631
+ input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
632
+ }
633
+
634
+ return input;
635
+ }
636
+
637
+ var decodeUriComponent = function (encodedURI) {
638
+ if (typeof encodedURI !== 'string') {
639
+ throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
640
+ }
641
+
642
+ try {
643
+ encodedURI = encodedURI.replace(/\+/g, ' ');
644
+
645
+ // Try the built in decoder first
646
+ return decodeURIComponent(encodedURI);
647
+ } catch (err) {
648
+ // Fallback to a more advanced decoder
649
+ return customDecodeURIComponent(encodedURI);
650
+ }
651
+ };
652
+
653
+ var splitOnFirst = (string, separator) => {
654
+ if (!(typeof string === 'string' && typeof separator === 'string')) {
655
+ throw new TypeError('Expected the arguments to be of type `string`');
656
+ }
657
+
658
+ if (separator === '') {
659
+ return [string];
660
+ }
661
+
662
+ const separatorIndex = string.indexOf(separator);
663
+
664
+ if (separatorIndex === -1) {
665
+ return [string];
666
+ }
667
+
668
+ return [
669
+ string.slice(0, separatorIndex),
670
+ string.slice(separatorIndex + separator.length)
671
+ ];
672
+ };
673
+
674
+ var filterObj = function (obj, predicate) {
675
+ var ret = {};
676
+ var keys = Object.keys(obj);
677
+ var isArr = Array.isArray(predicate);
678
+
679
+ for (var i = 0; i < keys.length; i++) {
680
+ var key = keys[i];
681
+ var val = obj[key];
682
+
683
+ if (isArr ? predicate.indexOf(key) !== -1 : predicate(key, val, obj)) {
684
+ ret[key] = val;
685
+ }
686
+ }
687
+
688
+ return ret;
689
+ };
690
+
691
+ (function (exports) {
692
+ const strictUriEncode$1 = strictUriEncode;
693
+ const decodeComponent = decodeUriComponent;
694
+ const splitOnFirst$1 = splitOnFirst;
695
+ const filterObject = filterObj;
696
+
697
+ const isNullOrUndefined = value => value === null || value === undefined;
698
+
699
+ const encodeFragmentIdentifier = Symbol('encodeFragmentIdentifier');
700
+
701
+ function encoderForArrayFormat(options) {
702
+ switch (options.arrayFormat) {
703
+ case 'index':
704
+ return key => (result, value) => {
705
+ const index = result.length;
706
+
707
+ if (
708
+ value === undefined ||
709
+ (options.skipNull && value === null) ||
710
+ (options.skipEmptyString && value === '')
711
+ ) {
712
+ return result;
713
+ }
714
+
715
+ if (value === null) {
716
+ return [...result, [encode(key, options), '[', index, ']'].join('')];
717
+ }
718
+
719
+ return [
720
+ ...result,
721
+ [encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')
722
+ ];
723
+ };
724
+
725
+ case 'bracket':
726
+ return key => (result, value) => {
727
+ if (
728
+ value === undefined ||
729
+ (options.skipNull && value === null) ||
730
+ (options.skipEmptyString && value === '')
731
+ ) {
732
+ return result;
733
+ }
734
+
735
+ if (value === null) {
736
+ return [...result, [encode(key, options), '[]'].join('')];
737
+ }
738
+
739
+ return [...result, [encode(key, options), '[]=', encode(value, options)].join('')];
740
+ };
741
+
742
+ case 'colon-list-separator':
743
+ return key => (result, value) => {
744
+ if (
745
+ value === undefined ||
746
+ (options.skipNull && value === null) ||
747
+ (options.skipEmptyString && value === '')
748
+ ) {
749
+ return result;
750
+ }
751
+
752
+ if (value === null) {
753
+ return [...result, [encode(key, options), ':list='].join('')];
754
+ }
755
+
756
+ return [...result, [encode(key, options), ':list=', encode(value, options)].join('')];
757
+ };
758
+
759
+ case 'comma':
760
+ case 'separator':
761
+ case 'bracket-separator': {
762
+ const keyValueSep = options.arrayFormat === 'bracket-separator' ?
763
+ '[]=' :
764
+ '=';
765
+
766
+ return key => (result, value) => {
767
+ if (
768
+ value === undefined ||
769
+ (options.skipNull && value === null) ||
770
+ (options.skipEmptyString && value === '')
771
+ ) {
772
+ return result;
773
+ }
774
+
775
+ // Translate null to an empty string so that it doesn't serialize as 'null'
776
+ value = value === null ? '' : value;
777
+
778
+ if (result.length === 0) {
779
+ return [[encode(key, options), keyValueSep, encode(value, options)].join('')];
780
+ }
781
+
782
+ return [[result, encode(value, options)].join(options.arrayFormatSeparator)];
783
+ };
784
+ }
785
+
786
+ default:
787
+ return key => (result, value) => {
788
+ if (
789
+ value === undefined ||
790
+ (options.skipNull && value === null) ||
791
+ (options.skipEmptyString && value === '')
792
+ ) {
793
+ return result;
794
+ }
795
+
796
+ if (value === null) {
797
+ return [...result, encode(key, options)];
798
+ }
799
+
800
+ return [...result, [encode(key, options), '=', encode(value, options)].join('')];
801
+ };
802
+ }
803
+ }
804
+
805
+ function parserForArrayFormat(options) {
806
+ let result;
807
+
808
+ switch (options.arrayFormat) {
809
+ case 'index':
810
+ return (key, value, accumulator) => {
811
+ result = /\[(\d*)\]$/.exec(key);
812
+
813
+ key = key.replace(/\[\d*\]$/, '');
814
+
815
+ if (!result) {
816
+ accumulator[key] = value;
817
+ return;
818
+ }
819
+
820
+ if (accumulator[key] === undefined) {
821
+ accumulator[key] = {};
822
+ }
823
+
824
+ accumulator[key][result[1]] = value;
825
+ };
826
+
827
+ case 'bracket':
828
+ return (key, value, accumulator) => {
829
+ result = /(\[\])$/.exec(key);
830
+ key = key.replace(/\[\]$/, '');
831
+
832
+ if (!result) {
833
+ accumulator[key] = value;
834
+ return;
835
+ }
836
+
837
+ if (accumulator[key] === undefined) {
838
+ accumulator[key] = [value];
839
+ return;
840
+ }
841
+
842
+ accumulator[key] = [].concat(accumulator[key], value);
843
+ };
844
+
845
+ case 'colon-list-separator':
846
+ return (key, value, accumulator) => {
847
+ result = /(:list)$/.exec(key);
848
+ key = key.replace(/:list$/, '');
849
+
850
+ if (!result) {
851
+ accumulator[key] = value;
852
+ return;
853
+ }
854
+
855
+ if (accumulator[key] === undefined) {
856
+ accumulator[key] = [value];
857
+ return;
858
+ }
859
+
860
+ accumulator[key] = [].concat(accumulator[key], value);
861
+ };
862
+
863
+ case 'comma':
864
+ case 'separator':
865
+ return (key, value, accumulator) => {
866
+ const isArray = typeof value === 'string' && value.includes(options.arrayFormatSeparator);
867
+ const isEncodedArray = (typeof value === 'string' && !isArray && decode(value, options).includes(options.arrayFormatSeparator));
868
+ value = isEncodedArray ? decode(value, options) : value;
869
+ const newValue = isArray || isEncodedArray ? value.split(options.arrayFormatSeparator).map(item => decode(item, options)) : value === null ? value : decode(value, options);
870
+ accumulator[key] = newValue;
871
+ };
872
+
873
+ case 'bracket-separator':
874
+ return (key, value, accumulator) => {
875
+ const isArray = /(\[\])$/.test(key);
876
+ key = key.replace(/\[\]$/, '');
877
+
878
+ if (!isArray) {
879
+ accumulator[key] = value ? decode(value, options) : value;
880
+ return;
881
+ }
882
+
883
+ const arrayValue = value === null ?
884
+ [] :
885
+ value.split(options.arrayFormatSeparator).map(item => decode(item, options));
886
+
887
+ if (accumulator[key] === undefined) {
888
+ accumulator[key] = arrayValue;
889
+ return;
890
+ }
891
+
892
+ accumulator[key] = [].concat(accumulator[key], arrayValue);
893
+ };
894
+
895
+ default:
896
+ return (key, value, accumulator) => {
897
+ if (accumulator[key] === undefined) {
898
+ accumulator[key] = value;
899
+ return;
900
+ }
901
+
902
+ accumulator[key] = [].concat(accumulator[key], value);
903
+ };
904
+ }
905
+ }
906
+
907
+ function validateArrayFormatSeparator(value) {
908
+ if (typeof value !== 'string' || value.length !== 1) {
909
+ throw new TypeError('arrayFormatSeparator must be single character string');
910
+ }
911
+ }
912
+
913
+ function encode(value, options) {
914
+ if (options.encode) {
915
+ return options.strict ? strictUriEncode$1(value) : encodeURIComponent(value);
916
+ }
917
+
918
+ return value;
919
+ }
920
+
921
+ function decode(value, options) {
922
+ if (options.decode) {
923
+ return decodeComponent(value);
924
+ }
925
+
926
+ return value;
927
+ }
928
+
929
+ function keysSorter(input) {
930
+ if (Array.isArray(input)) {
931
+ return input.sort();
932
+ }
933
+
934
+ if (typeof input === 'object') {
935
+ return keysSorter(Object.keys(input))
936
+ .sort((a, b) => Number(a) - Number(b))
937
+ .map(key => input[key]);
938
+ }
939
+
940
+ return input;
941
+ }
942
+
943
+ function removeHash(input) {
944
+ const hashStart = input.indexOf('#');
945
+ if (hashStart !== -1) {
946
+ input = input.slice(0, hashStart);
947
+ }
948
+
949
+ return input;
950
+ }
951
+
952
+ function getHash(url) {
953
+ let hash = '';
954
+ const hashStart = url.indexOf('#');
955
+ if (hashStart !== -1) {
956
+ hash = url.slice(hashStart);
957
+ }
958
+
959
+ return hash;
960
+ }
961
+
962
+ function extract(input) {
963
+ input = removeHash(input);
964
+ const queryStart = input.indexOf('?');
965
+ if (queryStart === -1) {
966
+ return '';
967
+ }
968
+
969
+ return input.slice(queryStart + 1);
970
+ }
971
+
972
+ function parseValue(value, options) {
973
+ if (options.parseNumbers && !Number.isNaN(Number(value)) && (typeof value === 'string' && value.trim() !== '')) {
974
+ value = Number(value);
975
+ } else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {
976
+ value = value.toLowerCase() === 'true';
977
+ }
978
+
979
+ return value;
980
+ }
981
+
982
+ function parse(query, options) {
983
+ options = Object.assign({
984
+ decode: true,
985
+ sort: true,
986
+ arrayFormat: 'none',
987
+ arrayFormatSeparator: ',',
988
+ parseNumbers: false,
989
+ parseBooleans: false
990
+ }, options);
991
+
992
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
993
+
994
+ const formatter = parserForArrayFormat(options);
995
+
996
+ // Create an object with no prototype
997
+ const ret = Object.create(null);
998
+
999
+ if (typeof query !== 'string') {
1000
+ return ret;
1001
+ }
1002
+
1003
+ query = query.trim().replace(/^[?#&]/, '');
1004
+
1005
+ if (!query) {
1006
+ return ret;
1007
+ }
1008
+
1009
+ for (const param of query.split('&')) {
1010
+ if (param === '') {
1011
+ continue;
1012
+ }
1013
+
1014
+ let [key, value] = splitOnFirst$1(options.decode ? param.replace(/\+/g, ' ') : param, '=');
1015
+
1016
+ // Missing `=` should be `null`:
1017
+ // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
1018
+ value = value === undefined ? null : ['comma', 'separator', 'bracket-separator'].includes(options.arrayFormat) ? value : decode(value, options);
1019
+ formatter(decode(key, options), value, ret);
1020
+ }
1021
+
1022
+ for (const key of Object.keys(ret)) {
1023
+ const value = ret[key];
1024
+ if (typeof value === 'object' && value !== null) {
1025
+ for (const k of Object.keys(value)) {
1026
+ value[k] = parseValue(value[k], options);
1027
+ }
1028
+ } else {
1029
+ ret[key] = parseValue(value, options);
1030
+ }
1031
+ }
1032
+
1033
+ if (options.sort === false) {
1034
+ return ret;
1035
+ }
1036
+
1037
+ return (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {
1038
+ const value = ret[key];
1039
+ if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
1040
+ // Sort object keys, not values
1041
+ result[key] = keysSorter(value);
1042
+ } else {
1043
+ result[key] = value;
1044
+ }
1045
+
1046
+ return result;
1047
+ }, Object.create(null));
1048
+ }
1049
+
1050
+ exports.extract = extract;
1051
+ exports.parse = parse;
1052
+
1053
+ exports.stringify = (object, options) => {
1054
+ if (!object) {
1055
+ return '';
1056
+ }
1057
+
1058
+ options = Object.assign({
1059
+ encode: true,
1060
+ strict: true,
1061
+ arrayFormat: 'none',
1062
+ arrayFormatSeparator: ','
1063
+ }, options);
1064
+
1065
+ validateArrayFormatSeparator(options.arrayFormatSeparator);
1066
+
1067
+ const shouldFilter = key => (
1068
+ (options.skipNull && isNullOrUndefined(object[key])) ||
1069
+ (options.skipEmptyString && object[key] === '')
1070
+ );
1071
+
1072
+ const formatter = encoderForArrayFormat(options);
1073
+
1074
+ const objectCopy = {};
1075
+
1076
+ for (const key of Object.keys(object)) {
1077
+ if (!shouldFilter(key)) {
1078
+ objectCopy[key] = object[key];
1079
+ }
1080
+ }
1081
+
1082
+ const keys = Object.keys(objectCopy);
1083
+
1084
+ if (options.sort !== false) {
1085
+ keys.sort(options.sort);
1086
+ }
1087
+
1088
+ return keys.map(key => {
1089
+ const value = object[key];
1090
+
1091
+ if (value === undefined) {
1092
+ return '';
1093
+ }
1094
+
1095
+ if (value === null) {
1096
+ return encode(key, options);
1097
+ }
1098
+
1099
+ if (Array.isArray(value)) {
1100
+ if (value.length === 0 && options.arrayFormat === 'bracket-separator') {
1101
+ return encode(key, options) + '[]';
1102
+ }
1103
+
1104
+ return value
1105
+ .reduce(formatter(key), [])
1106
+ .join('&');
1107
+ }
1108
+
1109
+ return encode(key, options) + '=' + encode(value, options);
1110
+ }).filter(x => x.length > 0).join('&');
1111
+ };
1112
+
1113
+ exports.parseUrl = (url, options) => {
1114
+ options = Object.assign({
1115
+ decode: true
1116
+ }, options);
1117
+
1118
+ const [url_, hash] = splitOnFirst$1(url, '#');
1119
+
1120
+ return Object.assign(
1121
+ {
1122
+ url: url_.split('?')[0] || '',
1123
+ query: parse(extract(url), options)
1124
+ },
1125
+ options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}
1126
+ );
1127
+ };
1128
+
1129
+ exports.stringifyUrl = (object, options) => {
1130
+ options = Object.assign({
1131
+ encode: true,
1132
+ strict: true,
1133
+ [encodeFragmentIdentifier]: true
1134
+ }, options);
1135
+
1136
+ const url = removeHash(object.url).split('?')[0] || '';
1137
+ const queryFromUrl = exports.extract(object.url);
1138
+ const parsedQueryFromUrl = exports.parse(queryFromUrl, {sort: false});
1139
+
1140
+ const query = Object.assign(parsedQueryFromUrl, object.query);
1141
+ let queryString = exports.stringify(query, options);
1142
+ if (queryString) {
1143
+ queryString = `?${queryString}`;
1144
+ }
1145
+
1146
+ let hash = getHash(object.url);
1147
+ if (object.fragmentIdentifier) {
1148
+ hash = `#${options[encodeFragmentIdentifier] ? encode(object.fragmentIdentifier, options) : object.fragmentIdentifier}`;
1149
+ }
1150
+
1151
+ return `${url}${queryString}${hash}`;
1152
+ };
1153
+
1154
+ exports.pick = (input, filter, options) => {
1155
+ options = Object.assign({
1156
+ parseFragmentIdentifier: true,
1157
+ [encodeFragmentIdentifier]: false
1158
+ }, options);
1159
+
1160
+ const {url, query, fragmentIdentifier} = exports.parseUrl(input, options);
1161
+ return exports.stringifyUrl({
1162
+ url,
1163
+ query: filterObject(query, filter),
1164
+ fragmentIdentifier
1165
+ }, options);
1166
+ };
1167
+
1168
+ exports.exclude = (input, filter, options) => {
1169
+ const exclusionFilter = Array.isArray(filter) ? key => !filter.includes(key) : (key, value) => !filter(key, value);
1170
+
1171
+ return exports.pick(input, exclusionFilter, options);
1172
+ };
1173
+ } (queryString));
1174
+
1175
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1176
+
1177
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1178
+ var withEventTargetValue = ramda.curry(function (func, event) {
1179
+ return func(event.target.value);
1180
+ });
1181
+ var getSubdomain = function getSubdomain() {
1182
+ var host = window.location.host;
1183
+ var parts = host.split(".");
1184
+ return parts.length >= 3 ? parts[0] : "";
1185
+ };
1186
+ var simulateApiCall = function simulateApiCall(result, error) {
1187
+ var errorProbability = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.1;
1188
+ var delay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : getRandomInt(350, 1000);
1189
+ return new Promise(function (resolve, reject) {
1190
+ return setTimeout(function () {
1191
+ var defaultErrorObj = {
1192
+ success: false,
1193
+ notice: i18next__default["default"].t("neetoCommons.notice.errorOccurred")
1194
+ };
1195
+ Math.random() < errorProbability ? reject(_objectSpread(_objectSpread({}, defaultErrorObj), error)) : resolve(result);
1196
+ }, delay);
1197
+ });
1198
+ };
1199
+ var copyToClipboard = /*#__PURE__*/function () {
1200
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(text) {
1201
+ var _ref2,
1202
+ _ref2$showToastr,
1203
+ showToastr,
1204
+ _ref2$message,
1205
+ message,
1206
+ _require,
1207
+ Toastr,
1208
+ textArea,
1209
+ _args = arguments;
1210
+
1211
+ return regenerator.wrap(function _callee$(_context) {
1212
+ while (1) {
1213
+ switch (_context.prev = _context.next) {
1214
+ case 0:
1215
+ _ref2 = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, _ref2$showToastr = _ref2.showToastr, showToastr = _ref2$showToastr === void 0 ? true : _ref2$showToastr, _ref2$message = _ref2.message, message = _ref2$message === void 0 ? i18next__default["default"].t("neetoCommons.toastr.success.copiedToClipboard") : _ref2$message;
1216
+
1217
+ /*
1218
+ This is a workaround to prevent the jest tests from failing. Once the issue in neetoUI
1219
+ https://github.com/bigbinary/neeto-ui/issues/1175 is resolved, this import can be moved to the top of the file.
1220
+ */
1221
+ _require = require("@bigbinary/neetoui"), Toastr = _require.Toastr;
1222
+ _context.prev = 2;
1223
+
1224
+ if (!(navigator.clipboard && window.isSecureContext)) {
1225
+ _context.next = 8;
1226
+ break;
1227
+ }
1228
+
1229
+ _context.next = 6;
1230
+ return navigator.clipboard.writeText(text);
1231
+
1232
+ case 6:
1233
+ _context.next = 18;
1234
+ break;
1235
+
1236
+ case 8:
1237
+ textArea = document.createElement("textarea");
1238
+ textArea.value = text;
1239
+ textArea.style.top = "0";
1240
+ textArea.style.left = "0";
1241
+ textArea.style.position = "fixed";
1242
+ document.body.appendChild(textArea);
1243
+ textArea.focus();
1244
+ textArea.select();
1245
+ document.execCommand("copy");
1246
+ document.body.removeChild(textArea);
1247
+
1248
+ case 18:
1249
+ showToastr && Toastr.success(message);
1250
+ _context.next = 24;
1251
+ break;
1252
+
1253
+ case 21:
1254
+ _context.prev = 21;
1255
+ _context.t0 = _context["catch"](2);
1256
+ Toastr.error(_context.t0);
1257
+
1258
+ case 24:
1259
+ case "end":
1260
+ return _context.stop();
1261
+ }
1262
+ }
1263
+ }, _callee, null, [[2, 21]]);
1264
+ }));
1265
+
1266
+ return function copyToClipboard(_x) {
1267
+ return _ref.apply(this, arguments);
1268
+ };
1269
+ }();
1270
+ var buildUrl = function buildUrl(route, params) {
1271
+ var placeHolders = [];
1272
+ ramda.toPairs(params).forEach(function (_ref3) {
1273
+ var _ref4 = _slicedToArray(_ref3, 2),
1274
+ key = _ref4[0],
1275
+ value = _ref4[1];
1276
+
1277
+ if (route.includes(":".concat(key))) {
1278
+ placeHolders.push(key);
1279
+ route = route.replace(":".concat(key), encodeURIComponent(value));
1280
+ }
1281
+ });
1282
+ var queryParams = ramda.omit(placeHolders, params);
1283
+ return ramda.isEmpty(queryParams) ? route : "".concat(route, "?").concat(queryString.stringify(queryParams));
1284
+ };
1285
+
1286
+ dayjs__default["default"].extend(relativeTime__default["default"]);
1287
+ dayjs__default["default"].extend(updateLocale__default["default"]);
1288
+ var timeFormat = {
1289
+ fromNow: function fromNow(time) {
1290
+ return dayjs__default["default"](time).fromNow();
1291
+ },
1292
+ time: function time(_time) {
1293
+ return dayjs__default["default"](_time).format("h:mm A");
1294
+ },
1295
+ date: function date(time) {
1296
+ return dayjs__default["default"](time).format("MMM D, YYYY");
1297
+ },
1298
+ dateWeek: function dateWeek(time) {
1299
+ return dayjs__default["default"](time).format("MMM D, YYYY ddd");
1300
+ },
1301
+ dateWeekWithoutYear: function dateWeekWithoutYear(time) {
1302
+ return dayjs__default["default"](time).format("MMM D, ddd");
1303
+ },
1304
+ dateTime: function dateTime(time) {
1305
+ return dayjs__default["default"](time).format("MMM D, YYYY h:mm A");
1306
+ },
1307
+ dateWeekTime: function dateWeekTime(time) {
1308
+ return dayjs__default["default"](time).format("MMM D, YYYY ddd h:mm A");
1309
+ },
1310
+ extended: function extended(time) {
1311
+ var dateTime = dayjs__default["default"](time).format("dddd MMMM D, YYYY h:mm A");
1312
+ var fromNow = dayjs__default["default"](time).fromNow();
1313
+ return "".concat(dateTime, " (").concat(fromNow, ")");
1314
+ }
1315
+ };
1316
+ var dateFormat = timeFormat;
1317
+
1318
+ exports.buildUrl = buildUrl;
1319
+ exports.copyToClipboard = copyToClipboard;
1320
+ exports.dateFormat = dateFormat;
1321
+ exports.getSubdomain = getSubdomain;
1322
+ exports.resetAuthTokens = resetAuthTokens;
1323
+ exports.simulateApiCall = simulateApiCall;
1324
+ exports.timeFormat = timeFormat;
1325
+ exports.withEventTargetValue = withEventTargetValue;