@fluxo-dev/api-client-base 0.0.13 → 0.0.15

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/index.cjs.js ADDED
@@ -0,0 +1,2825 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var axios = require('axios');
6
+ var state = require('@fluxo-dev/state');
7
+
8
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
+
10
+ var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
11
+
12
+ /******************************************************************************
13
+ Copyright (c) Microsoft Corporation.
14
+
15
+ Permission to use, copy, modify, and/or distribute this software for any
16
+ purpose with or without fee is hereby granted.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
19
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
21
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
+ PERFORMANCE OF THIS SOFTWARE.
25
+ ***************************************************************************** */
26
+
27
+ function __awaiter(thisArg, _arguments, P, generator) {
28
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
+ return new (P || (P = Promise))(function (resolve, reject) {
30
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
34
+ });
35
+ }
36
+
37
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
38
+ var e = new Error(message);
39
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
40
+ };
41
+
42
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
43
+
44
+ var check = function (it) {
45
+ return it && it.Math == Math && it;
46
+ };
47
+
48
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
49
+ var global$h =
50
+ // eslint-disable-next-line no-undef
51
+ check(typeof globalThis == 'object' && globalThis) ||
52
+ check(typeof window == 'object' && window) ||
53
+ check(typeof self == 'object' && self) ||
54
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
55
+ // eslint-disable-next-line no-new-func
56
+ Function('return this')();
57
+
58
+ var objectGetOwnPropertyDescriptor = {};
59
+
60
+ var fails$8 = function (exec) {
61
+ try {
62
+ return !!exec();
63
+ } catch (error) {
64
+ return true;
65
+ }
66
+ };
67
+
68
+ var fails$7 = fails$8;
69
+
70
+ // Thank's IE8 for his funny defineProperty
71
+ var descriptors = !fails$7(function () {
72
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
73
+ });
74
+
75
+ var objectPropertyIsEnumerable = {};
76
+
77
+ var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
78
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
79
+
80
+ // Nashorn ~ JDK8 bug
81
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
82
+
83
+ // `Object.prototype.propertyIsEnumerable` method implementation
84
+ // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
85
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
86
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
87
+ return !!descriptor && descriptor.enumerable;
88
+ } : nativePropertyIsEnumerable;
89
+
90
+ var createPropertyDescriptor$2 = function (bitmap, value) {
91
+ return {
92
+ enumerable: !(bitmap & 1),
93
+ configurable: !(bitmap & 2),
94
+ writable: !(bitmap & 4),
95
+ value: value
96
+ };
97
+ };
98
+
99
+ var toString = {}.toString;
100
+
101
+ var classofRaw$1 = function (it) {
102
+ return toString.call(it).slice(8, -1);
103
+ };
104
+
105
+ var fails$6 = fails$8;
106
+ var classof$7 = classofRaw$1;
107
+
108
+ var split = ''.split;
109
+
110
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
111
+ var indexedObject = fails$6(function () {
112
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
113
+ // eslint-disable-next-line no-prototype-builtins
114
+ return !Object('z').propertyIsEnumerable(0);
115
+ }) ? function (it) {
116
+ return classof$7(it) == 'String' ? split.call(it, '') : Object(it);
117
+ } : Object;
118
+
119
+ // `RequireObjectCoercible` abstract operation
120
+ // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
121
+ var requireObjectCoercible$3 = function (it) {
122
+ if (it == undefined) throw TypeError("Can't call method on " + it);
123
+ return it;
124
+ };
125
+
126
+ // toObject with fallback for non-array-like ES3 strings
127
+ var IndexedObject$1 = indexedObject;
128
+ var requireObjectCoercible$2 = requireObjectCoercible$3;
129
+
130
+ var toIndexedObject$3 = function (it) {
131
+ return IndexedObject$1(requireObjectCoercible$2(it));
132
+ };
133
+
134
+ var isObject$8 = function (it) {
135
+ return typeof it === 'object' ? it !== null : typeof it === 'function';
136
+ };
137
+
138
+ var isObject$7 = isObject$8;
139
+
140
+ // `ToPrimitive` abstract operation
141
+ // https://tc39.github.io/ecma262/#sec-toprimitive
142
+ // instead of the ES6 spec version, we didn't implement @@toPrimitive case
143
+ // and the second argument - flag - preferred type is a string
144
+ var toPrimitive$2 = function (input, PREFERRED_STRING) {
145
+ if (!isObject$7(input)) return input;
146
+ var fn, val;
147
+ if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$7(val = fn.call(input))) return val;
148
+ if (typeof (fn = input.valueOf) == 'function' && !isObject$7(val = fn.call(input))) return val;
149
+ if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject$7(val = fn.call(input))) return val;
150
+ throw TypeError("Can't convert object to primitive value");
151
+ };
152
+
153
+ var hasOwnProperty = {}.hasOwnProperty;
154
+
155
+ var has$8 = function (it, key) {
156
+ return hasOwnProperty.call(it, key);
157
+ };
158
+
159
+ var global$g = global$h;
160
+ var isObject$6 = isObject$8;
161
+
162
+ var document$2 = global$g.document;
163
+ // typeof document.createElement is 'object' in old IE
164
+ var EXISTS = isObject$6(document$2) && isObject$6(document$2.createElement);
165
+
166
+ var documentCreateElement$1 = function (it) {
167
+ return EXISTS ? document$2.createElement(it) : {};
168
+ };
169
+
170
+ var DESCRIPTORS$7 = descriptors;
171
+ var fails$5 = fails$8;
172
+ var createElement$1 = documentCreateElement$1;
173
+
174
+ // Thank's IE8 for his funny defineProperty
175
+ var ie8DomDefine = !DESCRIPTORS$7 && !fails$5(function () {
176
+ return Object.defineProperty(createElement$1('div'), 'a', {
177
+ get: function () { return 7; }
178
+ }).a != 7;
179
+ });
180
+
181
+ var DESCRIPTORS$6 = descriptors;
182
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
183
+ var createPropertyDescriptor$1 = createPropertyDescriptor$2;
184
+ var toIndexedObject$2 = toIndexedObject$3;
185
+ var toPrimitive$1 = toPrimitive$2;
186
+ var has$7 = has$8;
187
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
188
+
189
+ var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
190
+
191
+ // `Object.getOwnPropertyDescriptor` method
192
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
193
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$6 ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
194
+ O = toIndexedObject$2(O);
195
+ P = toPrimitive$1(P, true);
196
+ if (IE8_DOM_DEFINE$1) try {
197
+ return nativeGetOwnPropertyDescriptor(O, P);
198
+ } catch (error) { /* empty */ }
199
+ if (has$7(O, P)) return createPropertyDescriptor$1(!propertyIsEnumerableModule$1.f.call(O, P), O[P]);
200
+ };
201
+
202
+ var objectDefineProperty = {};
203
+
204
+ var isObject$5 = isObject$8;
205
+
206
+ var anObject$8 = function (it) {
207
+ if (!isObject$5(it)) {
208
+ throw TypeError(String(it) + ' is not an object');
209
+ } return it;
210
+ };
211
+
212
+ var DESCRIPTORS$5 = descriptors;
213
+ var IE8_DOM_DEFINE = ie8DomDefine;
214
+ var anObject$7 = anObject$8;
215
+ var toPrimitive = toPrimitive$2;
216
+
217
+ var nativeDefineProperty = Object.defineProperty;
218
+
219
+ // `Object.defineProperty` method
220
+ // https://tc39.github.io/ecma262/#sec-object.defineproperty
221
+ objectDefineProperty.f = DESCRIPTORS$5 ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
222
+ anObject$7(O);
223
+ P = toPrimitive(P, true);
224
+ anObject$7(Attributes);
225
+ if (IE8_DOM_DEFINE) try {
226
+ return nativeDefineProperty(O, P, Attributes);
227
+ } catch (error) { /* empty */ }
228
+ if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
229
+ if ('value' in Attributes) O[P] = Attributes.value;
230
+ return O;
231
+ };
232
+
233
+ var DESCRIPTORS$4 = descriptors;
234
+ var definePropertyModule$4 = objectDefineProperty;
235
+ var createPropertyDescriptor = createPropertyDescriptor$2;
236
+
237
+ var createNonEnumerableProperty$4 = DESCRIPTORS$4 ? function (object, key, value) {
238
+ return definePropertyModule$4.f(object, key, createPropertyDescriptor(1, value));
239
+ } : function (object, key, value) {
240
+ object[key] = value;
241
+ return object;
242
+ };
243
+
244
+ var redefine$3 = {exports: {}};
245
+
246
+ var global$f = global$h;
247
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$4;
248
+
249
+ var setGlobal$3 = function (key, value) {
250
+ try {
251
+ createNonEnumerableProperty$3(global$f, key, value);
252
+ } catch (error) {
253
+ global$f[key] = value;
254
+ } return value;
255
+ };
256
+
257
+ var global$e = global$h;
258
+ var setGlobal$2 = setGlobal$3;
259
+
260
+ var SHARED = '__core-js_shared__';
261
+ var store$3 = global$e[SHARED] || setGlobal$2(SHARED, {});
262
+
263
+ var sharedStore = store$3;
264
+
265
+ var store$2 = sharedStore;
266
+
267
+ var functionToString = Function.toString;
268
+
269
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
270
+ if (typeof store$2.inspectSource != 'function') {
271
+ store$2.inspectSource = function (it) {
272
+ return functionToString.call(it);
273
+ };
274
+ }
275
+
276
+ var inspectSource$3 = store$2.inspectSource;
277
+
278
+ var global$d = global$h;
279
+ var inspectSource$2 = inspectSource$3;
280
+
281
+ var WeakMap$1 = global$d.WeakMap;
282
+
283
+ var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource$2(WeakMap$1));
284
+
285
+ var shared$2 = {exports: {}};
286
+
287
+ var store$1 = sharedStore;
288
+
289
+ (shared$2.exports = function (key, value) {
290
+ return store$1[key] || (store$1[key] = value !== undefined ? value : {});
291
+ })('versions', []).push({
292
+ version: '3.6.5',
293
+ mode: 'global',
294
+ copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
295
+ });
296
+
297
+ var id = 0;
298
+ var postfix = Math.random();
299
+
300
+ var uid$2 = function (key) {
301
+ return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
302
+ };
303
+
304
+ var shared$1 = shared$2.exports;
305
+ var uid$1 = uid$2;
306
+
307
+ var keys = shared$1('keys');
308
+
309
+ var sharedKey$2 = function (key) {
310
+ return keys[key] || (keys[key] = uid$1(key));
311
+ };
312
+
313
+ var hiddenKeys$4 = {};
314
+
315
+ var NATIVE_WEAK_MAP = nativeWeakMap;
316
+ var global$c = global$h;
317
+ var isObject$4 = isObject$8;
318
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$4;
319
+ var objectHas = has$8;
320
+ var sharedKey$1 = sharedKey$2;
321
+ var hiddenKeys$3 = hiddenKeys$4;
322
+
323
+ var WeakMap = global$c.WeakMap;
324
+ var set$1, get, has$6;
325
+
326
+ var enforce = function (it) {
327
+ return has$6(it) ? get(it) : set$1(it, {});
328
+ };
329
+
330
+ var getterFor = function (TYPE) {
331
+ return function (it) {
332
+ var state;
333
+ if (!isObject$4(it) || (state = get(it)).type !== TYPE) {
334
+ throw TypeError('Incompatible receiver, ' + TYPE + ' required');
335
+ } return state;
336
+ };
337
+ };
338
+
339
+ if (NATIVE_WEAK_MAP) {
340
+ var store = new WeakMap();
341
+ var wmget = store.get;
342
+ var wmhas = store.has;
343
+ var wmset = store.set;
344
+ set$1 = function (it, metadata) {
345
+ wmset.call(store, it, metadata);
346
+ return metadata;
347
+ };
348
+ get = function (it) {
349
+ return wmget.call(store, it) || {};
350
+ };
351
+ has$6 = function (it) {
352
+ return wmhas.call(store, it);
353
+ };
354
+ } else {
355
+ var STATE = sharedKey$1('state');
356
+ hiddenKeys$3[STATE] = true;
357
+ set$1 = function (it, metadata) {
358
+ createNonEnumerableProperty$2(it, STATE, metadata);
359
+ return metadata;
360
+ };
361
+ get = function (it) {
362
+ return objectHas(it, STATE) ? it[STATE] : {};
363
+ };
364
+ has$6 = function (it) {
365
+ return objectHas(it, STATE);
366
+ };
367
+ }
368
+
369
+ var internalState = {
370
+ set: set$1,
371
+ get: get,
372
+ has: has$6,
373
+ enforce: enforce,
374
+ getterFor: getterFor
375
+ };
376
+
377
+ var global$b = global$h;
378
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$4;
379
+ var has$5 = has$8;
380
+ var setGlobal$1 = setGlobal$3;
381
+ var inspectSource$1 = inspectSource$3;
382
+ var InternalStateModule$1 = internalState;
383
+
384
+ var getInternalState$1 = InternalStateModule$1.get;
385
+ var enforceInternalState = InternalStateModule$1.enforce;
386
+ var TEMPLATE = String(String).split('String');
387
+
388
+ (redefine$3.exports = function (O, key, value, options) {
389
+ var unsafe = options ? !!options.unsafe : false;
390
+ var simple = options ? !!options.enumerable : false;
391
+ var noTargetGet = options ? !!options.noTargetGet : false;
392
+ if (typeof value == 'function') {
393
+ if (typeof key == 'string' && !has$5(value, 'name')) createNonEnumerableProperty$1(value, 'name', key);
394
+ enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
395
+ }
396
+ if (O === global$b) {
397
+ if (simple) O[key] = value;
398
+ else setGlobal$1(key, value);
399
+ return;
400
+ } else if (!unsafe) {
401
+ delete O[key];
402
+ } else if (!noTargetGet && O[key]) {
403
+ simple = true;
404
+ }
405
+ if (simple) O[key] = value;
406
+ else createNonEnumerableProperty$1(O, key, value);
407
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
408
+ })(Function.prototype, 'toString', function toString() {
409
+ return typeof this == 'function' && getInternalState$1(this).source || inspectSource$1(this);
410
+ });
411
+
412
+ var global$a = global$h;
413
+
414
+ var path$1 = global$a;
415
+
416
+ var path = path$1;
417
+ var global$9 = global$h;
418
+
419
+ var aFunction$5 = function (variable) {
420
+ return typeof variable == 'function' ? variable : undefined;
421
+ };
422
+
423
+ var getBuiltIn$5 = function (namespace, method) {
424
+ return arguments.length < 2 ? aFunction$5(path[namespace]) || aFunction$5(global$9[namespace])
425
+ : path[namespace] && path[namespace][method] || global$9[namespace] && global$9[namespace][method];
426
+ };
427
+
428
+ var objectGetOwnPropertyNames = {};
429
+
430
+ var ceil = Math.ceil;
431
+ var floor = Math.floor;
432
+
433
+ // `ToInteger` abstract operation
434
+ // https://tc39.github.io/ecma262/#sec-tointeger
435
+ var toInteger$3 = function (argument) {
436
+ return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
437
+ };
438
+
439
+ var toInteger$2 = toInteger$3;
440
+
441
+ var min$1 = Math.min;
442
+
443
+ // `ToLength` abstract operation
444
+ // https://tc39.github.io/ecma262/#sec-tolength
445
+ var toLength$4 = function (argument) {
446
+ return argument > 0 ? min$1(toInteger$2(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
447
+ };
448
+
449
+ var toInteger$1 = toInteger$3;
450
+
451
+ var max = Math.max;
452
+ var min = Math.min;
453
+
454
+ // Helper for a popular repeating case of the spec:
455
+ // Let integer be ? ToInteger(index).
456
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
457
+ var toAbsoluteIndex$1 = function (index, length) {
458
+ var integer = toInteger$1(index);
459
+ return integer < 0 ? max(integer + length, 0) : min(integer, length);
460
+ };
461
+
462
+ var toIndexedObject$1 = toIndexedObject$3;
463
+ var toLength$3 = toLength$4;
464
+ var toAbsoluteIndex = toAbsoluteIndex$1;
465
+
466
+ // `Array.prototype.{ indexOf, includes }` methods implementation
467
+ var createMethod = function (IS_INCLUDES) {
468
+ return function ($this, el, fromIndex) {
469
+ var O = toIndexedObject$1($this);
470
+ var length = toLength$3(O.length);
471
+ var index = toAbsoluteIndex(fromIndex, length);
472
+ var value;
473
+ // Array#includes uses SameValueZero equality algorithm
474
+ // eslint-disable-next-line no-self-compare
475
+ if (IS_INCLUDES && el != el) while (length > index) {
476
+ value = O[index++];
477
+ // eslint-disable-next-line no-self-compare
478
+ if (value != value) return true;
479
+ // Array#indexOf ignores holes, Array#includes - not
480
+ } else for (;length > index; index++) {
481
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
482
+ } return !IS_INCLUDES && -1;
483
+ };
484
+ };
485
+
486
+ var arrayIncludes = {
487
+ // `Array.prototype.includes` method
488
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
489
+ includes: createMethod(true),
490
+ // `Array.prototype.indexOf` method
491
+ // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
492
+ indexOf: createMethod(false)
493
+ };
494
+
495
+ var has$4 = has$8;
496
+ var toIndexedObject = toIndexedObject$3;
497
+ var indexOf = arrayIncludes.indexOf;
498
+ var hiddenKeys$2 = hiddenKeys$4;
499
+
500
+ var objectKeysInternal = function (object, names) {
501
+ var O = toIndexedObject(object);
502
+ var i = 0;
503
+ var result = [];
504
+ var key;
505
+ for (key in O) !has$4(hiddenKeys$2, key) && has$4(O, key) && result.push(key);
506
+ // Don't enum bug & hidden keys
507
+ while (names.length > i) if (has$4(O, key = names[i++])) {
508
+ ~indexOf(result, key) || result.push(key);
509
+ }
510
+ return result;
511
+ };
512
+
513
+ // IE8- don't enum bug keys
514
+ var enumBugKeys$3 = [
515
+ 'constructor',
516
+ 'hasOwnProperty',
517
+ 'isPrototypeOf',
518
+ 'propertyIsEnumerable',
519
+ 'toLocaleString',
520
+ 'toString',
521
+ 'valueOf'
522
+ ];
523
+
524
+ var internalObjectKeys$1 = objectKeysInternal;
525
+ var enumBugKeys$2 = enumBugKeys$3;
526
+
527
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
528
+
529
+ // `Object.getOwnPropertyNames` method
530
+ // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
531
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
532
+ return internalObjectKeys$1(O, hiddenKeys$1);
533
+ };
534
+
535
+ var objectGetOwnPropertySymbols = {};
536
+
537
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
538
+
539
+ var getBuiltIn$4 = getBuiltIn$5;
540
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
541
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
542
+ var anObject$6 = anObject$8;
543
+
544
+ // all object keys, includes non-enumerable and symbols
545
+ var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
546
+ var keys = getOwnPropertyNamesModule.f(anObject$6(it));
547
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
548
+ return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
549
+ };
550
+
551
+ var has$3 = has$8;
552
+ var ownKeys = ownKeys$1;
553
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
554
+ var definePropertyModule$3 = objectDefineProperty;
555
+
556
+ var copyConstructorProperties$1 = function (target, source) {
557
+ var keys = ownKeys(source);
558
+ var defineProperty = definePropertyModule$3.f;
559
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
560
+ for (var i = 0; i < keys.length; i++) {
561
+ var key = keys[i];
562
+ if (!has$3(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
563
+ }
564
+ };
565
+
566
+ var fails$4 = fails$8;
567
+
568
+ var replacement = /#|\.prototype\./;
569
+
570
+ var isForced$2 = function (feature, detection) {
571
+ var value = data[normalize(feature)];
572
+ return value == POLYFILL ? true
573
+ : value == NATIVE ? false
574
+ : typeof detection == 'function' ? fails$4(detection)
575
+ : !!detection;
576
+ };
577
+
578
+ var normalize = isForced$2.normalize = function (string) {
579
+ return String(string).replace(replacement, '.').toLowerCase();
580
+ };
581
+
582
+ var data = isForced$2.data = {};
583
+ var NATIVE = isForced$2.NATIVE = 'N';
584
+ var POLYFILL = isForced$2.POLYFILL = 'P';
585
+
586
+ var isForced_1 = isForced$2;
587
+
588
+ var global$8 = global$h;
589
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
590
+ var createNonEnumerableProperty = createNonEnumerableProperty$4;
591
+ var redefine$2 = redefine$3.exports;
592
+ var setGlobal = setGlobal$3;
593
+ var copyConstructorProperties = copyConstructorProperties$1;
594
+ var isForced$1 = isForced_1;
595
+
596
+ /*
597
+ options.target - name of the target object
598
+ options.global - target is the global object
599
+ options.stat - export as static methods of target
600
+ options.proto - export as prototype methods of target
601
+ options.real - real prototype method for the `pure` version
602
+ options.forced - export even if the native feature is available
603
+ options.bind - bind methods to the target, required for the `pure` version
604
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
605
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
606
+ options.sham - add a flag to not completely full polyfills
607
+ options.enumerable - export as enumerable property
608
+ options.noTargetGet - prevent calling a getter on target
609
+ */
610
+ var _export = function (options, source) {
611
+ var TARGET = options.target;
612
+ var GLOBAL = options.global;
613
+ var STATIC = options.stat;
614
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
615
+ if (GLOBAL) {
616
+ target = global$8;
617
+ } else if (STATIC) {
618
+ target = global$8[TARGET] || setGlobal(TARGET, {});
619
+ } else {
620
+ target = (global$8[TARGET] || {}).prototype;
621
+ }
622
+ if (target) for (key in source) {
623
+ sourceProperty = source[key];
624
+ if (options.noTargetGet) {
625
+ descriptor = getOwnPropertyDescriptor$1(target, key);
626
+ targetProperty = descriptor && descriptor.value;
627
+ } else targetProperty = target[key];
628
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
629
+ // contained in target
630
+ if (!FORCED && targetProperty !== undefined) {
631
+ if (typeof sourceProperty === typeof targetProperty) continue;
632
+ copyConstructorProperties(sourceProperty, targetProperty);
633
+ }
634
+ // add a flag to not completely full polyfills
635
+ if (options.sham || (targetProperty && targetProperty.sham)) {
636
+ createNonEnumerableProperty(sourceProperty, 'sham', true);
637
+ }
638
+ // extend global
639
+ redefine$2(target, key, sourceProperty, options);
640
+ }
641
+ };
642
+
643
+ var internalObjectKeys = objectKeysInternal;
644
+ var enumBugKeys$1 = enumBugKeys$3;
645
+
646
+ // `Object.keys` method
647
+ // https://tc39.github.io/ecma262/#sec-object.keys
648
+ var objectKeys$2 = Object.keys || function keys(O) {
649
+ return internalObjectKeys(O, enumBugKeys$1);
650
+ };
651
+
652
+ var requireObjectCoercible$1 = requireObjectCoercible$3;
653
+
654
+ // `ToObject` abstract operation
655
+ // https://tc39.github.io/ecma262/#sec-toobject
656
+ var toObject$2 = function (argument) {
657
+ return Object(requireObjectCoercible$1(argument));
658
+ };
659
+
660
+ var DESCRIPTORS$3 = descriptors;
661
+ var fails$3 = fails$8;
662
+ var objectKeys$1 = objectKeys$2;
663
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
664
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
665
+ var toObject$1 = toObject$2;
666
+ var IndexedObject = indexedObject;
667
+
668
+ var nativeAssign = Object.assign;
669
+ var defineProperty$2 = Object.defineProperty;
670
+
671
+ // `Object.assign` method
672
+ // https://tc39.github.io/ecma262/#sec-object.assign
673
+ var objectAssign = !nativeAssign || fails$3(function () {
674
+ // should have correct order of operations (Edge bug)
675
+ if (DESCRIPTORS$3 && nativeAssign({ b: 1 }, nativeAssign(defineProperty$2({}, 'a', {
676
+ enumerable: true,
677
+ get: function () {
678
+ defineProperty$2(this, 'b', {
679
+ value: 3,
680
+ enumerable: false
681
+ });
682
+ }
683
+ }), { b: 2 })).b !== 1) return true;
684
+ // should work with symbols and should have deterministic property order (V8 bug)
685
+ var A = {};
686
+ var B = {};
687
+ // eslint-disable-next-line no-undef
688
+ var symbol = Symbol();
689
+ var alphabet = 'abcdefghijklmnopqrst';
690
+ A[symbol] = 7;
691
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
692
+ return nativeAssign({}, A)[symbol] != 7 || objectKeys$1(nativeAssign({}, B)).join('') != alphabet;
693
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
694
+ var T = toObject$1(target);
695
+ var argumentsLength = arguments.length;
696
+ var index = 1;
697
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
698
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
699
+ while (argumentsLength > index) {
700
+ var S = IndexedObject(arguments[index++]);
701
+ var keys = getOwnPropertySymbols ? objectKeys$1(S).concat(getOwnPropertySymbols(S)) : objectKeys$1(S);
702
+ var length = keys.length;
703
+ var j = 0;
704
+ var key;
705
+ while (length > j) {
706
+ key = keys[j++];
707
+ if (!DESCRIPTORS$3 || propertyIsEnumerable.call(S, key)) T[key] = S[key];
708
+ }
709
+ } return T;
710
+ } : nativeAssign;
711
+
712
+ var $$4 = _export;
713
+ var assign = objectAssign;
714
+
715
+ // `Object.assign` method
716
+ // https://tc39.github.io/ecma262/#sec-object.assign
717
+ $$4({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
718
+ assign: assign
719
+ });
720
+
721
+ var global$7 = global$h;
722
+
723
+ var nativePromiseConstructor = global$7.Promise;
724
+
725
+ var redefine$1 = redefine$3.exports;
726
+
727
+ var redefineAll$1 = function (target, src, options) {
728
+ for (var key in src) redefine$1(target, key, src[key], options);
729
+ return target;
730
+ };
731
+
732
+ var fails$2 = fails$8;
733
+
734
+ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$2(function () {
735
+ // Chrome 38 Symbol has incorrect toString conversion
736
+ // eslint-disable-next-line no-undef
737
+ return !String(Symbol());
738
+ });
739
+
740
+ var NATIVE_SYMBOL$1 = nativeSymbol;
741
+
742
+ var useSymbolAsUid = NATIVE_SYMBOL$1
743
+ // eslint-disable-next-line no-undef
744
+ && !Symbol.sham
745
+ // eslint-disable-next-line no-undef
746
+ && typeof Symbol.iterator == 'symbol';
747
+
748
+ var global$6 = global$h;
749
+ var shared = shared$2.exports;
750
+ var has$2 = has$8;
751
+ var uid = uid$2;
752
+ var NATIVE_SYMBOL = nativeSymbol;
753
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
754
+
755
+ var WellKnownSymbolsStore = shared('wks');
756
+ var Symbol$1 = global$6.Symbol;
757
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
758
+
759
+ var wellKnownSymbol$d = function (name) {
760
+ if (!has$2(WellKnownSymbolsStore, name)) {
761
+ if (NATIVE_SYMBOL && has$2(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
762
+ else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
763
+ } return WellKnownSymbolsStore[name];
764
+ };
765
+
766
+ var defineProperty$1 = objectDefineProperty.f;
767
+ var has$1 = has$8;
768
+ var wellKnownSymbol$c = wellKnownSymbol$d;
769
+
770
+ var TO_STRING_TAG$2 = wellKnownSymbol$c('toStringTag');
771
+
772
+ var setToStringTag$1 = function (it, TAG, STATIC) {
773
+ if (it && !has$1(it = STATIC ? it : it.prototype, TO_STRING_TAG$2)) {
774
+ defineProperty$1(it, TO_STRING_TAG$2, { configurable: true, value: TAG });
775
+ }
776
+ };
777
+
778
+ var getBuiltIn$3 = getBuiltIn$5;
779
+ var definePropertyModule$2 = objectDefineProperty;
780
+ var wellKnownSymbol$b = wellKnownSymbol$d;
781
+ var DESCRIPTORS$2 = descriptors;
782
+
783
+ var SPECIES$3 = wellKnownSymbol$b('species');
784
+
785
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
786
+ var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
787
+ var defineProperty = definePropertyModule$2.f;
788
+
789
+ if (DESCRIPTORS$2 && Constructor && !Constructor[SPECIES$3]) {
790
+ defineProperty(Constructor, SPECIES$3, {
791
+ configurable: true,
792
+ get: function () { return this; }
793
+ });
794
+ }
795
+ };
796
+
797
+ var aFunction$4 = function (it) {
798
+ if (typeof it != 'function') {
799
+ throw TypeError(String(it) + ' is not a function');
800
+ } return it;
801
+ };
802
+
803
+ var anInstance$1 = function (it, Constructor, name) {
804
+ if (!(it instanceof Constructor)) {
805
+ throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
806
+ } return it;
807
+ };
808
+
809
+ var iterate$2 = {exports: {}};
810
+
811
+ var iterators = {};
812
+
813
+ var wellKnownSymbol$a = wellKnownSymbol$d;
814
+ var Iterators$1 = iterators;
815
+
816
+ var ITERATOR$2 = wellKnownSymbol$a('iterator');
817
+ var ArrayPrototype$1 = Array.prototype;
818
+
819
+ // check on default Array iterator
820
+ var isArrayIteratorMethod$1 = function (it) {
821
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype$1[ITERATOR$2] === it);
822
+ };
823
+
824
+ var aFunction$3 = aFunction$4;
825
+
826
+ // optional / simple context binding
827
+ var functionBindContext = function (fn, that, length) {
828
+ aFunction$3(fn);
829
+ if (that === undefined) return fn;
830
+ switch (length) {
831
+ case 0: return function () {
832
+ return fn.call(that);
833
+ };
834
+ case 1: return function (a) {
835
+ return fn.call(that, a);
836
+ };
837
+ case 2: return function (a, b) {
838
+ return fn.call(that, a, b);
839
+ };
840
+ case 3: return function (a, b, c) {
841
+ return fn.call(that, a, b, c);
842
+ };
843
+ }
844
+ return function (/* ...args */) {
845
+ return fn.apply(that, arguments);
846
+ };
847
+ };
848
+
849
+ var wellKnownSymbol$9 = wellKnownSymbol$d;
850
+
851
+ var TO_STRING_TAG$1 = wellKnownSymbol$9('toStringTag');
852
+ var test = {};
853
+
854
+ test[TO_STRING_TAG$1] = 'z';
855
+
856
+ var toStringTagSupport = String(test) === '[object z]';
857
+
858
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
859
+ var classofRaw = classofRaw$1;
860
+ var wellKnownSymbol$8 = wellKnownSymbol$d;
861
+
862
+ var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
863
+ // ES3 wrong here
864
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
865
+
866
+ // fallback for IE11 Script Access Denied error
867
+ var tryGet = function (it, key) {
868
+ try {
869
+ return it[key];
870
+ } catch (error) { /* empty */ }
871
+ };
872
+
873
+ // getting tag from ES6+ `Object.prototype.toString`
874
+ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
875
+ var O, tag, result;
876
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
877
+ // @@toStringTag case
878
+ : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
879
+ // builtinTag case
880
+ : CORRECT_ARGUMENTS ? classofRaw(O)
881
+ // ES3 arguments fallback
882
+ : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
883
+ };
884
+
885
+ var classof$5 = classof$6;
886
+ var Iterators = iterators;
887
+ var wellKnownSymbol$7 = wellKnownSymbol$d;
888
+
889
+ var ITERATOR$1 = wellKnownSymbol$7('iterator');
890
+
891
+ var getIteratorMethod$1 = function (it) {
892
+ if (it != undefined) return it[ITERATOR$1]
893
+ || it['@@iterator']
894
+ || Iterators[classof$5(it)];
895
+ };
896
+
897
+ var anObject$5 = anObject$8;
898
+
899
+ // call something on iterator step with safe closing on error
900
+ var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
901
+ try {
902
+ return ENTRIES ? fn(anObject$5(value)[0], value[1]) : fn(value);
903
+ // 7.4.6 IteratorClose(iterator, completion)
904
+ } catch (error) {
905
+ var returnMethod = iterator['return'];
906
+ if (returnMethod !== undefined) anObject$5(returnMethod.call(iterator));
907
+ throw error;
908
+ }
909
+ };
910
+
911
+ var anObject$4 = anObject$8;
912
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
913
+ var toLength$2 = toLength$4;
914
+ var bind$3 = functionBindContext;
915
+ var getIteratorMethod = getIteratorMethod$1;
916
+ var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
917
+
918
+ var Result = function (stopped, result) {
919
+ this.stopped = stopped;
920
+ this.result = result;
921
+ };
922
+
923
+ var iterate$1 = iterate$2.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
924
+ var boundFunction = bind$3(fn, that, AS_ENTRIES ? 2 : 1);
925
+ var iterator, iterFn, index, length, result, next, step;
926
+
927
+ if (IS_ITERATOR) {
928
+ iterator = iterable;
929
+ } else {
930
+ iterFn = getIteratorMethod(iterable);
931
+ if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
932
+ // optimisation for array iterators
933
+ if (isArrayIteratorMethod(iterFn)) {
934
+ for (index = 0, length = toLength$2(iterable.length); length > index; index++) {
935
+ result = AS_ENTRIES
936
+ ? boundFunction(anObject$4(step = iterable[index])[0], step[1])
937
+ : boundFunction(iterable[index]);
938
+ if (result && result instanceof Result) return result;
939
+ } return new Result(false);
940
+ }
941
+ iterator = iterFn.call(iterable);
942
+ }
943
+
944
+ next = iterator.next;
945
+ while (!(step = next.call(iterator)).done) {
946
+ result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
947
+ if (typeof result == 'object' && result && result instanceof Result) return result;
948
+ } return new Result(false);
949
+ };
950
+
951
+ iterate$1.stop = function (result) {
952
+ return new Result(true, result);
953
+ };
954
+
955
+ var wellKnownSymbol$6 = wellKnownSymbol$d;
956
+
957
+ var ITERATOR = wellKnownSymbol$6('iterator');
958
+ var SAFE_CLOSING = false;
959
+
960
+ try {
961
+ var called = 0;
962
+ var iteratorWithReturn = {
963
+ next: function () {
964
+ return { done: !!called++ };
965
+ },
966
+ 'return': function () {
967
+ SAFE_CLOSING = true;
968
+ }
969
+ };
970
+ iteratorWithReturn[ITERATOR] = function () {
971
+ return this;
972
+ };
973
+ // eslint-disable-next-line no-throw-literal
974
+ Array.from(iteratorWithReturn, function () { throw 2; });
975
+ } catch (error) { /* empty */ }
976
+
977
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
978
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
979
+ var ITERATION_SUPPORT = false;
980
+ try {
981
+ var object = {};
982
+ object[ITERATOR] = function () {
983
+ return {
984
+ next: function () {
985
+ return { done: ITERATION_SUPPORT = true };
986
+ }
987
+ };
988
+ };
989
+ exec(object);
990
+ } catch (error) { /* empty */ }
991
+ return ITERATION_SUPPORT;
992
+ };
993
+
994
+ var anObject$3 = anObject$8;
995
+ var aFunction$2 = aFunction$4;
996
+ var wellKnownSymbol$5 = wellKnownSymbol$d;
997
+
998
+ var SPECIES$2 = wellKnownSymbol$5('species');
999
+
1000
+ // `SpeciesConstructor` abstract operation
1001
+ // https://tc39.github.io/ecma262/#sec-speciesconstructor
1002
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1003
+ var C = anObject$3(O).constructor;
1004
+ var S;
1005
+ return C === undefined || (S = anObject$3(C)[SPECIES$2]) == undefined ? defaultConstructor : aFunction$2(S);
1006
+ };
1007
+
1008
+ var getBuiltIn$2 = getBuiltIn$5;
1009
+
1010
+ var html$2 = getBuiltIn$2('document', 'documentElement');
1011
+
1012
+ var getBuiltIn$1 = getBuiltIn$5;
1013
+
1014
+ var engineUserAgent = getBuiltIn$1('navigator', 'userAgent') || '';
1015
+
1016
+ var userAgent$1 = engineUserAgent;
1017
+
1018
+ var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent$1);
1019
+
1020
+ var global$5 = global$h;
1021
+ var fails$1 = fails$8;
1022
+ var classof$4 = classofRaw$1;
1023
+ var bind$2 = functionBindContext;
1024
+ var html$1 = html$2;
1025
+ var createElement = documentCreateElement$1;
1026
+ var IS_IOS$1 = engineIsIos;
1027
+
1028
+ var location = global$5.location;
1029
+ var set = global$5.setImmediate;
1030
+ var clear = global$5.clearImmediate;
1031
+ var process$3 = global$5.process;
1032
+ var MessageChannel = global$5.MessageChannel;
1033
+ var Dispatch = global$5.Dispatch;
1034
+ var counter = 0;
1035
+ var queue = {};
1036
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1037
+ var defer, channel, port;
1038
+
1039
+ var run = function (id) {
1040
+ // eslint-disable-next-line no-prototype-builtins
1041
+ if (queue.hasOwnProperty(id)) {
1042
+ var fn = queue[id];
1043
+ delete queue[id];
1044
+ fn();
1045
+ }
1046
+ };
1047
+
1048
+ var runner = function (id) {
1049
+ return function () {
1050
+ run(id);
1051
+ };
1052
+ };
1053
+
1054
+ var listener = function (event) {
1055
+ run(event.data);
1056
+ };
1057
+
1058
+ var post = function (id) {
1059
+ // old engines have not location.origin
1060
+ global$5.postMessage(id + '', location.protocol + '//' + location.host);
1061
+ };
1062
+
1063
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1064
+ if (!set || !clear) {
1065
+ set = function setImmediate(fn) {
1066
+ var args = [];
1067
+ var i = 1;
1068
+ while (arguments.length > i) args.push(arguments[i++]);
1069
+ queue[++counter] = function () {
1070
+ // eslint-disable-next-line no-new-func
1071
+ (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
1072
+ };
1073
+ defer(counter);
1074
+ return counter;
1075
+ };
1076
+ clear = function clearImmediate(id) {
1077
+ delete queue[id];
1078
+ };
1079
+ // Node.js 0.8-
1080
+ if (classof$4(process$3) == 'process') {
1081
+ defer = function (id) {
1082
+ process$3.nextTick(runner(id));
1083
+ };
1084
+ // Sphere (JS game engine) Dispatch API
1085
+ } else if (Dispatch && Dispatch.now) {
1086
+ defer = function (id) {
1087
+ Dispatch.now(runner(id));
1088
+ };
1089
+ // Browsers with MessageChannel, includes WebWorkers
1090
+ // except iOS - https://github.com/zloirock/core-js/issues/624
1091
+ } else if (MessageChannel && !IS_IOS$1) {
1092
+ channel = new MessageChannel();
1093
+ port = channel.port2;
1094
+ channel.port1.onmessage = listener;
1095
+ defer = bind$2(port.postMessage, port, 1);
1096
+ // Browsers with postMessage, skip WebWorkers
1097
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
1098
+ } else if (
1099
+ global$5.addEventListener &&
1100
+ typeof postMessage == 'function' &&
1101
+ !global$5.importScripts &&
1102
+ !fails$1(post) &&
1103
+ location.protocol !== 'file:'
1104
+ ) {
1105
+ defer = post;
1106
+ global$5.addEventListener('message', listener, false);
1107
+ // IE8-
1108
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
1109
+ defer = function (id) {
1110
+ html$1.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
1111
+ html$1.removeChild(this);
1112
+ run(id);
1113
+ };
1114
+ };
1115
+ // Rest old browsers
1116
+ } else {
1117
+ defer = function (id) {
1118
+ setTimeout(runner(id), 0);
1119
+ };
1120
+ }
1121
+ }
1122
+
1123
+ var task$1 = {
1124
+ set: set,
1125
+ clear: clear
1126
+ };
1127
+
1128
+ var global$4 = global$h;
1129
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1130
+ var classof$3 = classofRaw$1;
1131
+ var macrotask = task$1.set;
1132
+ var IS_IOS = engineIsIos;
1133
+
1134
+ var MutationObserver = global$4.MutationObserver || global$4.WebKitMutationObserver;
1135
+ var process$2 = global$4.process;
1136
+ var Promise$1 = global$4.Promise;
1137
+ var IS_NODE$1 = classof$3(process$2) == 'process';
1138
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
1139
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$4, 'queueMicrotask');
1140
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
1141
+
1142
+ var flush, head, last, notify$1, toggle, node, promise, then;
1143
+
1144
+ // modern engines have queueMicrotask method
1145
+ if (!queueMicrotask) {
1146
+ flush = function () {
1147
+ var parent, fn;
1148
+ if (IS_NODE$1 && (parent = process$2.domain)) parent.exit();
1149
+ while (head) {
1150
+ fn = head.fn;
1151
+ head = head.next;
1152
+ try {
1153
+ fn();
1154
+ } catch (error) {
1155
+ if (head) notify$1();
1156
+ else last = undefined;
1157
+ throw error;
1158
+ }
1159
+ } last = undefined;
1160
+ if (parent) parent.enter();
1161
+ };
1162
+
1163
+ // Node.js
1164
+ if (IS_NODE$1) {
1165
+ notify$1 = function () {
1166
+ process$2.nextTick(flush);
1167
+ };
1168
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
1169
+ } else if (MutationObserver && !IS_IOS) {
1170
+ toggle = true;
1171
+ node = document.createTextNode('');
1172
+ new MutationObserver(flush).observe(node, { characterData: true });
1173
+ notify$1 = function () {
1174
+ node.data = toggle = !toggle;
1175
+ };
1176
+ // environments with maybe non-completely correct, but existent Promise
1177
+ } else if (Promise$1 && Promise$1.resolve) {
1178
+ // Promise.resolve without an argument throws an error in LG WebOS 2
1179
+ promise = Promise$1.resolve(undefined);
1180
+ then = promise.then;
1181
+ notify$1 = function () {
1182
+ then.call(promise, flush);
1183
+ };
1184
+ // for other environments - macrotask based on:
1185
+ // - setImmediate
1186
+ // - MessageChannel
1187
+ // - window.postMessag
1188
+ // - onreadystatechange
1189
+ // - setTimeout
1190
+ } else {
1191
+ notify$1 = function () {
1192
+ // strange IE + webpack dev server bug - use .call(global)
1193
+ macrotask.call(global$4, flush);
1194
+ };
1195
+ }
1196
+ }
1197
+
1198
+ var microtask$1 = queueMicrotask || function (fn) {
1199
+ var task = { fn: fn, next: undefined };
1200
+ if (last) last.next = task;
1201
+ if (!head) {
1202
+ head = task;
1203
+ notify$1();
1204
+ } last = task;
1205
+ };
1206
+
1207
+ var newPromiseCapability$2 = {};
1208
+
1209
+ var aFunction$1 = aFunction$4;
1210
+
1211
+ var PromiseCapability = function (C) {
1212
+ var resolve, reject;
1213
+ this.promise = new C(function ($$resolve, $$reject) {
1214
+ if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
1215
+ resolve = $$resolve;
1216
+ reject = $$reject;
1217
+ });
1218
+ this.resolve = aFunction$1(resolve);
1219
+ this.reject = aFunction$1(reject);
1220
+ };
1221
+
1222
+ // 25.4.1.5 NewPromiseCapability(C)
1223
+ newPromiseCapability$2.f = function (C) {
1224
+ return new PromiseCapability(C);
1225
+ };
1226
+
1227
+ var anObject$2 = anObject$8;
1228
+ var isObject$3 = isObject$8;
1229
+ var newPromiseCapability$1 = newPromiseCapability$2;
1230
+
1231
+ var promiseResolve$1 = function (C, x) {
1232
+ anObject$2(C);
1233
+ if (isObject$3(x) && x.constructor === C) return x;
1234
+ var promiseCapability = newPromiseCapability$1.f(C);
1235
+ var resolve = promiseCapability.resolve;
1236
+ resolve(x);
1237
+ return promiseCapability.promise;
1238
+ };
1239
+
1240
+ var global$3 = global$h;
1241
+
1242
+ var hostReportErrors$1 = function (a, b) {
1243
+ var console = global$3.console;
1244
+ if (console && console.error) {
1245
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
1246
+ }
1247
+ };
1248
+
1249
+ var perform$1 = function (exec) {
1250
+ try {
1251
+ return { error: false, value: exec() };
1252
+ } catch (error) {
1253
+ return { error: true, value: error };
1254
+ }
1255
+ };
1256
+
1257
+ var global$2 = global$h;
1258
+ var userAgent = engineUserAgent;
1259
+
1260
+ var process$1 = global$2.process;
1261
+ var versions = process$1 && process$1.versions;
1262
+ var v8 = versions && versions.v8;
1263
+ var match, version;
1264
+
1265
+ if (v8) {
1266
+ match = v8.split('.');
1267
+ version = match[0] + match[1];
1268
+ } else if (userAgent) {
1269
+ match = userAgent.match(/Edge\/(\d+)/);
1270
+ if (!match || match[1] >= 74) {
1271
+ match = userAgent.match(/Chrome\/(\d+)/);
1272
+ if (match) version = match[1];
1273
+ }
1274
+ }
1275
+
1276
+ var engineV8Version = version && +version;
1277
+
1278
+ var $$3 = _export;
1279
+ var global$1 = global$h;
1280
+ var getBuiltIn = getBuiltIn$5;
1281
+ var NativePromise = nativePromiseConstructor;
1282
+ var redefine = redefine$3.exports;
1283
+ var redefineAll = redefineAll$1;
1284
+ var setToStringTag = setToStringTag$1;
1285
+ var setSpecies = setSpecies$1;
1286
+ var isObject$2 = isObject$8;
1287
+ var aFunction = aFunction$4;
1288
+ var anInstance = anInstance$1;
1289
+ var classof$2 = classofRaw$1;
1290
+ var inspectSource = inspectSource$3;
1291
+ var iterate = iterate$2.exports;
1292
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
1293
+ var speciesConstructor = speciesConstructor$1;
1294
+ var task = task$1.set;
1295
+ var microtask = microtask$1;
1296
+ var promiseResolve = promiseResolve$1;
1297
+ var hostReportErrors = hostReportErrors$1;
1298
+ var newPromiseCapabilityModule = newPromiseCapability$2;
1299
+ var perform = perform$1;
1300
+ var InternalStateModule = internalState;
1301
+ var isForced = isForced_1;
1302
+ var wellKnownSymbol$4 = wellKnownSymbol$d;
1303
+ var V8_VERSION = engineV8Version;
1304
+
1305
+ var SPECIES$1 = wellKnownSymbol$4('species');
1306
+ var PROMISE = 'Promise';
1307
+ var getInternalState = InternalStateModule.get;
1308
+ var setInternalState = InternalStateModule.set;
1309
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
1310
+ var PromiseConstructor = NativePromise;
1311
+ var TypeError$1 = global$1.TypeError;
1312
+ var document$1 = global$1.document;
1313
+ var process = global$1.process;
1314
+ var $fetch = getBuiltIn('fetch');
1315
+ var newPromiseCapability = newPromiseCapabilityModule.f;
1316
+ var newGenericPromiseCapability = newPromiseCapability;
1317
+ var IS_NODE = classof$2(process) == 'process';
1318
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$1.dispatchEvent);
1319
+ var UNHANDLED_REJECTION = 'unhandledrejection';
1320
+ var REJECTION_HANDLED = 'rejectionhandled';
1321
+ var PENDING = 0;
1322
+ var FULFILLED = 1;
1323
+ var REJECTED = 2;
1324
+ var HANDLED = 1;
1325
+ var UNHANDLED = 2;
1326
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
1327
+
1328
+ var FORCED = isForced(PROMISE, function () {
1329
+ var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
1330
+ if (!GLOBAL_CORE_JS_PROMISE) {
1331
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
1332
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
1333
+ // We can't detect it synchronously, so just check versions
1334
+ if (V8_VERSION === 66) return true;
1335
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
1336
+ if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true;
1337
+ }
1338
+ // We can't use @@species feature detection in V8 since it causes
1339
+ // deoptimization and performance degradation
1340
+ // https://github.com/zloirock/core-js/issues/679
1341
+ if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
1342
+ // Detect correctness of subclassing with @@species support
1343
+ var promise = PromiseConstructor.resolve(1);
1344
+ var FakePromise = function (exec) {
1345
+ exec(function () { /* empty */ }, function () { /* empty */ });
1346
+ };
1347
+ var constructor = promise.constructor = {};
1348
+ constructor[SPECIES$1] = FakePromise;
1349
+ return !(promise.then(function () { /* empty */ }) instanceof FakePromise);
1350
+ });
1351
+
1352
+ var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
1353
+ PromiseConstructor.all(iterable)['catch'](function () { /* empty */ });
1354
+ });
1355
+
1356
+ // helpers
1357
+ var isThenable = function (it) {
1358
+ var then;
1359
+ return isObject$2(it) && typeof (then = it.then) == 'function' ? then : false;
1360
+ };
1361
+
1362
+ var notify = function (promise, state, isReject) {
1363
+ if (state.notified) return;
1364
+ state.notified = true;
1365
+ var chain = state.reactions;
1366
+ microtask(function () {
1367
+ var value = state.value;
1368
+ var ok = state.state == FULFILLED;
1369
+ var index = 0;
1370
+ // variable length - can't use forEach
1371
+ while (chain.length > index) {
1372
+ var reaction = chain[index++];
1373
+ var handler = ok ? reaction.ok : reaction.fail;
1374
+ var resolve = reaction.resolve;
1375
+ var reject = reaction.reject;
1376
+ var domain = reaction.domain;
1377
+ var result, then, exited;
1378
+ try {
1379
+ if (handler) {
1380
+ if (!ok) {
1381
+ if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
1382
+ state.rejection = HANDLED;
1383
+ }
1384
+ if (handler === true) result = value;
1385
+ else {
1386
+ if (domain) domain.enter();
1387
+ result = handler(value); // can throw
1388
+ if (domain) {
1389
+ domain.exit();
1390
+ exited = true;
1391
+ }
1392
+ }
1393
+ if (result === reaction.promise) {
1394
+ reject(TypeError$1('Promise-chain cycle'));
1395
+ } else if (then = isThenable(result)) {
1396
+ then.call(result, resolve, reject);
1397
+ } else resolve(result);
1398
+ } else reject(value);
1399
+ } catch (error) {
1400
+ if (domain && !exited) domain.exit();
1401
+ reject(error);
1402
+ }
1403
+ }
1404
+ state.reactions = [];
1405
+ state.notified = false;
1406
+ if (isReject && !state.rejection) onUnhandled(promise, state);
1407
+ });
1408
+ };
1409
+
1410
+ var dispatchEvent = function (name, promise, reason) {
1411
+ var event, handler;
1412
+ if (DISPATCH_EVENT) {
1413
+ event = document$1.createEvent('Event');
1414
+ event.promise = promise;
1415
+ event.reason = reason;
1416
+ event.initEvent(name, false, true);
1417
+ global$1.dispatchEvent(event);
1418
+ } else event = { promise: promise, reason: reason };
1419
+ if (handler = global$1['on' + name]) handler(event);
1420
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
1421
+ };
1422
+
1423
+ var onUnhandled = function (promise, state) {
1424
+ task.call(global$1, function () {
1425
+ var value = state.value;
1426
+ var IS_UNHANDLED = isUnhandled(state);
1427
+ var result;
1428
+ if (IS_UNHANDLED) {
1429
+ result = perform(function () {
1430
+ if (IS_NODE) {
1431
+ process.emit('unhandledRejection', value, promise);
1432
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
1433
+ });
1434
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
1435
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
1436
+ if (result.error) throw result.value;
1437
+ }
1438
+ });
1439
+ };
1440
+
1441
+ var isUnhandled = function (state) {
1442
+ return state.rejection !== HANDLED && !state.parent;
1443
+ };
1444
+
1445
+ var onHandleUnhandled = function (promise, state) {
1446
+ task.call(global$1, function () {
1447
+ if (IS_NODE) {
1448
+ process.emit('rejectionHandled', promise);
1449
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
1450
+ });
1451
+ };
1452
+
1453
+ var bind$1 = function (fn, promise, state, unwrap) {
1454
+ return function (value) {
1455
+ fn(promise, state, value, unwrap);
1456
+ };
1457
+ };
1458
+
1459
+ var internalReject = function (promise, state, value, unwrap) {
1460
+ if (state.done) return;
1461
+ state.done = true;
1462
+ if (unwrap) state = unwrap;
1463
+ state.value = value;
1464
+ state.state = REJECTED;
1465
+ notify(promise, state, true);
1466
+ };
1467
+
1468
+ var internalResolve = function (promise, state, value, unwrap) {
1469
+ if (state.done) return;
1470
+ state.done = true;
1471
+ if (unwrap) state = unwrap;
1472
+ try {
1473
+ if (promise === value) throw TypeError$1("Promise can't be resolved itself");
1474
+ var then = isThenable(value);
1475
+ if (then) {
1476
+ microtask(function () {
1477
+ var wrapper = { done: false };
1478
+ try {
1479
+ then.call(value,
1480
+ bind$1(internalResolve, promise, wrapper, state),
1481
+ bind$1(internalReject, promise, wrapper, state)
1482
+ );
1483
+ } catch (error) {
1484
+ internalReject(promise, wrapper, error, state);
1485
+ }
1486
+ });
1487
+ } else {
1488
+ state.value = value;
1489
+ state.state = FULFILLED;
1490
+ notify(promise, state, false);
1491
+ }
1492
+ } catch (error) {
1493
+ internalReject(promise, { done: false }, error, state);
1494
+ }
1495
+ };
1496
+
1497
+ // constructor polyfill
1498
+ if (FORCED) {
1499
+ // 25.4.3.1 Promise(executor)
1500
+ PromiseConstructor = function Promise(executor) {
1501
+ anInstance(this, PromiseConstructor, PROMISE);
1502
+ aFunction(executor);
1503
+ Internal.call(this);
1504
+ var state = getInternalState(this);
1505
+ try {
1506
+ executor(bind$1(internalResolve, this, state), bind$1(internalReject, this, state));
1507
+ } catch (error) {
1508
+ internalReject(this, state, error);
1509
+ }
1510
+ };
1511
+ // eslint-disable-next-line no-unused-vars
1512
+ Internal = function Promise(executor) {
1513
+ setInternalState(this, {
1514
+ type: PROMISE,
1515
+ done: false,
1516
+ notified: false,
1517
+ parent: false,
1518
+ reactions: [],
1519
+ rejection: false,
1520
+ state: PENDING,
1521
+ value: undefined
1522
+ });
1523
+ };
1524
+ Internal.prototype = redefineAll(PromiseConstructor.prototype, {
1525
+ // `Promise.prototype.then` method
1526
+ // https://tc39.github.io/ecma262/#sec-promise.prototype.then
1527
+ then: function then(onFulfilled, onRejected) {
1528
+ var state = getInternalPromiseState(this);
1529
+ var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
1530
+ reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
1531
+ reaction.fail = typeof onRejected == 'function' && onRejected;
1532
+ reaction.domain = IS_NODE ? process.domain : undefined;
1533
+ state.parent = true;
1534
+ state.reactions.push(reaction);
1535
+ if (state.state != PENDING) notify(this, state, false);
1536
+ return reaction.promise;
1537
+ },
1538
+ // `Promise.prototype.catch` method
1539
+ // https://tc39.github.io/ecma262/#sec-promise.prototype.catch
1540
+ 'catch': function (onRejected) {
1541
+ return this.then(undefined, onRejected);
1542
+ }
1543
+ });
1544
+ OwnPromiseCapability = function () {
1545
+ var promise = new Internal();
1546
+ var state = getInternalState(promise);
1547
+ this.promise = promise;
1548
+ this.resolve = bind$1(internalResolve, promise, state);
1549
+ this.reject = bind$1(internalReject, promise, state);
1550
+ };
1551
+ newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
1552
+ return C === PromiseConstructor || C === PromiseWrapper
1553
+ ? new OwnPromiseCapability(C)
1554
+ : newGenericPromiseCapability(C);
1555
+ };
1556
+
1557
+ if (typeof NativePromise == 'function') {
1558
+ nativeThen = NativePromise.prototype.then;
1559
+
1560
+ // wrap native Promise#then for native async functions
1561
+ redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
1562
+ var that = this;
1563
+ return new PromiseConstructor(function (resolve, reject) {
1564
+ nativeThen.call(that, resolve, reject);
1565
+ }).then(onFulfilled, onRejected);
1566
+ // https://github.com/zloirock/core-js/issues/640
1567
+ }, { unsafe: true });
1568
+
1569
+ // wrap fetch result
1570
+ if (typeof $fetch == 'function') $$3({ global: true, enumerable: true, forced: true }, {
1571
+ // eslint-disable-next-line no-unused-vars
1572
+ fetch: function fetch(input /* , init */) {
1573
+ return promiseResolve(PromiseConstructor, $fetch.apply(global$1, arguments));
1574
+ }
1575
+ });
1576
+ }
1577
+ }
1578
+
1579
+ $$3({ global: true, wrap: true, forced: FORCED }, {
1580
+ Promise: PromiseConstructor
1581
+ });
1582
+
1583
+ setToStringTag(PromiseConstructor, PROMISE, false);
1584
+ setSpecies(PROMISE);
1585
+
1586
+ PromiseWrapper = getBuiltIn(PROMISE);
1587
+
1588
+ // statics
1589
+ $$3({ target: PROMISE, stat: true, forced: FORCED }, {
1590
+ // `Promise.reject` method
1591
+ // https://tc39.github.io/ecma262/#sec-promise.reject
1592
+ reject: function reject(r) {
1593
+ var capability = newPromiseCapability(this);
1594
+ capability.reject.call(undefined, r);
1595
+ return capability.promise;
1596
+ }
1597
+ });
1598
+
1599
+ $$3({ target: PROMISE, stat: true, forced: FORCED }, {
1600
+ // `Promise.resolve` method
1601
+ // https://tc39.github.io/ecma262/#sec-promise.resolve
1602
+ resolve: function resolve(x) {
1603
+ return promiseResolve(this, x);
1604
+ }
1605
+ });
1606
+
1607
+ $$3({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
1608
+ // `Promise.all` method
1609
+ // https://tc39.github.io/ecma262/#sec-promise.all
1610
+ all: function all(iterable) {
1611
+ var C = this;
1612
+ var capability = newPromiseCapability(C);
1613
+ var resolve = capability.resolve;
1614
+ var reject = capability.reject;
1615
+ var result = perform(function () {
1616
+ var $promiseResolve = aFunction(C.resolve);
1617
+ var values = [];
1618
+ var counter = 0;
1619
+ var remaining = 1;
1620
+ iterate(iterable, function (promise) {
1621
+ var index = counter++;
1622
+ var alreadyCalled = false;
1623
+ values.push(undefined);
1624
+ remaining++;
1625
+ $promiseResolve.call(C, promise).then(function (value) {
1626
+ if (alreadyCalled) return;
1627
+ alreadyCalled = true;
1628
+ values[index] = value;
1629
+ --remaining || resolve(values);
1630
+ }, reject);
1631
+ });
1632
+ --remaining || resolve(values);
1633
+ });
1634
+ if (result.error) reject(result.value);
1635
+ return capability.promise;
1636
+ },
1637
+ // `Promise.race` method
1638
+ // https://tc39.github.io/ecma262/#sec-promise.race
1639
+ race: function race(iterable) {
1640
+ var C = this;
1641
+ var capability = newPromiseCapability(C);
1642
+ var reject = capability.reject;
1643
+ var result = perform(function () {
1644
+ var $promiseResolve = aFunction(C.resolve);
1645
+ iterate(iterable, function (promise) {
1646
+ $promiseResolve.call(C, promise).then(capability.resolve, reject);
1647
+ });
1648
+ });
1649
+ if (result.error) reject(result.value);
1650
+ return capability.promise;
1651
+ }
1652
+ });
1653
+
1654
+ const LocalStorageConstants = {
1655
+ accessToken: 'access-token',
1656
+ userData: 'user-data'
1657
+ };
1658
+
1659
+ class HttpClient {
1660
+ get client() {
1661
+ return this._axiosInstance;
1662
+ }
1663
+ constructor(authenticationType, baseUrl) {
1664
+ this._axiosInstance = axios__default["default"].create({
1665
+ baseURL: baseUrl,
1666
+ headers: {
1667
+ 'Content-Type': 'application/json; charset=utf-8'
1668
+ }
1669
+ });
1670
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1671
+ // @ts-ignore
1672
+ this._axiosInstance.interceptors.request.use(config => __awaiter(this, void 0, void 0, function* () {
1673
+ const state$1 = state.store.getState();
1674
+ if (state$1.user.loggedIn) {
1675
+ return Object.assign(Object.assign({}, config), {
1676
+ headers: Object.assign(Object.assign({}, config.headers), {
1677
+ 'Authorization': 'Bearer ' + localStorage.getItem(LocalStorageConstants.accessToken)
1678
+ })
1679
+ });
1680
+ }
1681
+ return config;
1682
+ }));
1683
+ this._axiosInstance.interceptors.response.use(response => response.data, error => {
1684
+ if (error.response.status === 401) ;
1685
+ return Promise.reject({
1686
+ code: error.response.status,
1687
+ message: error.response.data
1688
+ });
1689
+ });
1690
+ }
1691
+ static Instance() {
1692
+ if (!HttpClient._instance) {
1693
+ throw new Error('HttpClient is not initialized. Please call HttpClient.Init() before using HttpClient.Instance()');
1694
+ }
1695
+ return HttpClient._instance;
1696
+ }
1697
+ static Init(authenticationType, baseUrl, apiKeyOrAccessToken) {
1698
+ if (HttpClient._instance) throw new Error('HttpClient is already initialized. Please call HttpClient.Instance() to get current instance.');
1699
+ HttpClient._instance = new HttpClient(authenticationType, baseUrl);
1700
+ }
1701
+ }
1702
+
1703
+ function e(e){this.message=e;}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw "Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e;}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";
1704
+
1705
+ class FluxoStateDispatcher {
1706
+ static dispatchUserLogin(data) {
1707
+ state.store.dispatch(state.userLogin(data));
1708
+ }
1709
+ static dispatchUserLogout() {
1710
+ state.store.dispatch(state.userLogout());
1711
+ }
1712
+ static dispatchAutoLoginSucceded(userInfo) {
1713
+ state.store.dispatch(state.autoLoginSucceded(userInfo));
1714
+ }
1715
+ static dispatchOpenSearchPanel() {
1716
+ state.store.dispatch(state.openSearchPanel({}));
1717
+ }
1718
+ static dispatchCloseSearchPanel() {
1719
+ state.store.dispatch(state.closeSearchPanel({}));
1720
+ }
1721
+ static dispatchSetUserIdle() {
1722
+ state.store.dispatch(state.setUserIdle({}));
1723
+ }
1724
+ static dispatchUnsetUserIdle() {
1725
+ state.store.dispatch(state.unsetUserIdle({}));
1726
+ }
1727
+ static dispatchOpenNavbar() {
1728
+ state.store.dispatch(state.openNavbar({}));
1729
+ }
1730
+ static dispatchCloseNavbar() {
1731
+ state.store.dispatch(state.closeNavbar({}));
1732
+ }
1733
+ static dispatchSetAppMenu(items) {
1734
+ state.store.dispatch(state.setAppMenu(items));
1735
+ }
1736
+ static dispatchSetRouteRules(rules) {
1737
+ state.store.dispatch(state.setRouteRules(rules));
1738
+ }
1739
+ static dispatchSetConfiguration(items) {
1740
+ state.store.dispatch(state.setConfiguration(items));
1741
+ }
1742
+ static dispatchSetSysFeatures(items) {
1743
+ state.store.dispatch(state.setSysFeatures(items));
1744
+ }
1745
+ static dispatchSetJitAppsFeatures(items) {
1746
+ state.store.dispatch(state.setJitAppsFeatures(items));
1747
+ }
1748
+ static dispatchSetUserPermissions(items) {
1749
+ state.store.dispatch(state.setUserPermissions(items));
1750
+ }
1751
+ }
1752
+
1753
+ class AuthService {
1754
+ constructor() {
1755
+ RefreshTokenManager.Init(this.refreshToken, this.logout);
1756
+ }
1757
+ setup() {
1758
+ return __awaiter(this, void 0, void 0, function* () {
1759
+ yield this.tryAutoLogin();
1760
+ });
1761
+ }
1762
+ tryAutoLogin() {
1763
+ return __awaiter(this, void 0, void 0, function* () {
1764
+ const accessToken = localStorage.getItem(LocalStorageConstants.accessToken);
1765
+ if (accessToken) {
1766
+ const decoded = o(accessToken);
1767
+ if (!decoded) {
1768
+ this.logout();
1769
+ return;
1770
+ }
1771
+ if (decoded.exp <= new Date().getTime() / 1000) {
1772
+ yield this.refreshToken();
1773
+ } else {
1774
+ // Avvio il timeout indicando il tempo di attesa come scadenza token - 30 secondi.
1775
+ // pertanto, 30 secondi prima della scadenza del token, Fluxo richiederà un nuovo token grazie al refresh token.
1776
+ RefreshTokenManager.Instance.start(AuthService.getJwtTokenRemainingLifetime() - 30000);
1777
+ }
1778
+ FluxoStateDispatcher.dispatchAutoLoginSucceded(localStorage.getItem(LocalStorageConstants.userData));
1779
+ }
1780
+ });
1781
+ }
1782
+ login(username, password) {
1783
+ return __awaiter(this, void 0, void 0, function* () {
1784
+ try {
1785
+ const data = yield HttpClient.Instance().client.post('/identity/authenticate', {
1786
+ username,
1787
+ password
1788
+ }, {
1789
+ withCredentials: true
1790
+ });
1791
+ localStorage.setItem(LocalStorageConstants.accessToken, data.token);
1792
+ localStorage.setItem(LocalStorageConstants.userData, JSON.stringify(data.userData));
1793
+ RefreshTokenManager.Instance.start(AuthService.getJwtTokenRemainingLifetime() - 60);
1794
+ FluxoStateDispatcher.dispatchUserLogin({
1795
+ data
1796
+ });
1797
+ } catch (err) {
1798
+ FluxoStateDispatcher.dispatchUserLogin(null);
1799
+ }
1800
+ });
1801
+ }
1802
+ logout() {
1803
+ RefreshTokenManager.Instance.stop();
1804
+ localStorage.removeItem(LocalStorageConstants.accessToken);
1805
+ localStorage.removeItem(LocalStorageConstants.userData);
1806
+ FluxoStateDispatcher.dispatchUserLogout();
1807
+ }
1808
+ refreshToken() {
1809
+ return __awaiter(this, void 0, void 0, function* () {
1810
+ try {
1811
+ const data = yield HttpClient.Instance().client.post('/identity/refresh-token', {}, {
1812
+ withCredentials: true
1813
+ });
1814
+ localStorage.setItem(LocalStorageConstants.accessToken, data.token);
1815
+ localStorage.setItem(LocalStorageConstants.userData, JSON.stringify(data.userData));
1816
+ RefreshTokenManager.Instance.stop();
1817
+ RefreshTokenManager.Instance.start(AuthService.getJwtTokenRemainingLifetime() - 10000);
1818
+ } catch (err) {
1819
+ localStorage.removeItem(LocalStorageConstants.accessToken);
1820
+ localStorage.removeItem(LocalStorageConstants.userData);
1821
+ this.logout();
1822
+ }
1823
+ });
1824
+ }
1825
+ static getJwtTokenRemainingLifetime() {
1826
+ const token = localStorage.getItem(LocalStorageConstants.accessToken);
1827
+ if (!token) {
1828
+ throw new Error('Called getJwtTokenRemainingLifetime but no access token found');
1829
+ }
1830
+ const decoded = o(token);
1831
+ const exp = +decoded.exp;
1832
+ const dateNow = new Date(Date.now()).getTime();
1833
+ const diff = exp * 1000 - dateNow;
1834
+ return diff <= 0 ? 0 : diff;
1835
+ }
1836
+ }
1837
+ class RefreshTokenManager {
1838
+ constructor(action, onErrorCallback) {
1839
+ this.event = new Event('build');
1840
+ this._refreshTokenInterval = null;
1841
+ this._actionOnTimeout = action;
1842
+ this._onErrorCallback = onErrorCallback;
1843
+ }
1844
+ static Init(actionOnTimeout, onErrorCallback) {
1845
+ this._instance = new this(actionOnTimeout, onErrorCallback);
1846
+ }
1847
+ static get Instance() {
1848
+ if (!this._instance) throw new Error('RefreshTokenManager not initialized');
1849
+ return this._instance;
1850
+ }
1851
+ start(timeoutMs) {
1852
+ console.info(' - start refresh token:' + timeoutMs + 'ms');
1853
+ if (this._actionOnTimeout === undefined) throw new Error('RefreshTokenManager not initialized');
1854
+ this._refreshTokenInterval = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1855
+ try {
1856
+ yield this._actionOnTimeout();
1857
+ } catch (err) {
1858
+ this._onErrorCallback();
1859
+ }
1860
+ }), timeoutMs);
1861
+ }
1862
+ stop() {
1863
+ console.info(' - stop refresh token');
1864
+ clearInterval(this._refreshTokenInterval);
1865
+ }
1866
+ }
1867
+
1868
+ class ConfigurationService {
1869
+ getInitialConfiguration() {
1870
+ return HttpClient.Instance().client.get('client/initial');
1871
+ }
1872
+ getClientUi() {
1873
+ return HttpClient.Instance().client.get('client/ui');
1874
+ }
1875
+ updateClientUi(clientUI) {
1876
+ return HttpClient.Instance().client.post('client/ui', clientUI);
1877
+ }
1878
+ getSystemFeatures() {
1879
+ return HttpClient.Instance().client.get('features/web');
1880
+ }
1881
+ saveAppMenu(webMenuId, menu) {
1882
+ return HttpClient.Instance().client.post(`client/menu/${webMenuId}/webapp`, menu);
1883
+ }
1884
+ createAppMenu(menu) {
1885
+ return HttpClient.Instance().client.post('client/menu/webapp', menu);
1886
+ }
1887
+ getAppMenuList() {
1888
+ return HttpClient.Instance().client.get('webmenu?includes=DomainRole,User');
1889
+ }
1890
+ getAppMenu(webMenuId) {
1891
+ return HttpClient.Instance().client.get(`client/menu/${webMenuId}/webapp`);
1892
+ }
1893
+ getMenuItemPermissions(domainRoleId) {
1894
+ return HttpClient.Instance().client.get(`webmenuitem/${domainRoleId}/permissions`);
1895
+ }
1896
+ addMenuItemPermission(domainRoleId, permissionId) {
1897
+ return HttpClient.Instance().client.post(`webmenuitem/${domainRoleId}/permissions`, {
1898
+ domainRoleId: domainRoleId,
1899
+ permissionId: permissionId
1900
+ });
1901
+ }
1902
+ removeMenuItemPermission(domainRoleId, permissionId) {
1903
+ return HttpClient.Instance().client.delete(`webmenuitem/${domainRoleId}/permissions/${permissionId}`);
1904
+ }
1905
+ }
1906
+
1907
+ var DESCRIPTORS$1 = descriptors;
1908
+ var definePropertyModule$1 = objectDefineProperty;
1909
+ var anObject$1 = anObject$8;
1910
+ var objectKeys = objectKeys$2;
1911
+
1912
+ // `Object.defineProperties` method
1913
+ // https://tc39.github.io/ecma262/#sec-object.defineproperties
1914
+ var objectDefineProperties = DESCRIPTORS$1 ? Object.defineProperties : function defineProperties(O, Properties) {
1915
+ anObject$1(O);
1916
+ var keys = objectKeys(Properties);
1917
+ var length = keys.length;
1918
+ var index = 0;
1919
+ var key;
1920
+ while (length > index) definePropertyModule$1.f(O, key = keys[index++], Properties[key]);
1921
+ return O;
1922
+ };
1923
+
1924
+ var anObject = anObject$8;
1925
+ var defineProperties = objectDefineProperties;
1926
+ var enumBugKeys = enumBugKeys$3;
1927
+ var hiddenKeys = hiddenKeys$4;
1928
+ var html = html$2;
1929
+ var documentCreateElement = documentCreateElement$1;
1930
+ var sharedKey = sharedKey$2;
1931
+
1932
+ var GT = '>';
1933
+ var LT = '<';
1934
+ var PROTOTYPE = 'prototype';
1935
+ var SCRIPT = 'script';
1936
+ var IE_PROTO = sharedKey('IE_PROTO');
1937
+
1938
+ var EmptyConstructor = function () { /* empty */ };
1939
+
1940
+ var scriptTag = function (content) {
1941
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1942
+ };
1943
+
1944
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1945
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1946
+ activeXDocument.write(scriptTag(''));
1947
+ activeXDocument.close();
1948
+ var temp = activeXDocument.parentWindow.Object;
1949
+ activeXDocument = null; // avoid memory leak
1950
+ return temp;
1951
+ };
1952
+
1953
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1954
+ var NullProtoObjectViaIFrame = function () {
1955
+ // Thrash, waste and sodomy: IE GC bug
1956
+ var iframe = documentCreateElement('iframe');
1957
+ var JS = 'java' + SCRIPT + ':';
1958
+ var iframeDocument;
1959
+ iframe.style.display = 'none';
1960
+ html.appendChild(iframe);
1961
+ // https://github.com/zloirock/core-js/issues/475
1962
+ iframe.src = String(JS);
1963
+ iframeDocument = iframe.contentWindow.document;
1964
+ iframeDocument.open();
1965
+ iframeDocument.write(scriptTag('document.F=Object'));
1966
+ iframeDocument.close();
1967
+ return iframeDocument.F;
1968
+ };
1969
+
1970
+ // Check for document.domain and active x support
1971
+ // No need to use active x approach when document.domain is not set
1972
+ // see https://github.com/es-shims/es5-shim/issues/150
1973
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1974
+ // avoid IE GC bug
1975
+ var activeXDocument;
1976
+ var NullProtoObject = function () {
1977
+ try {
1978
+ /* global ActiveXObject */
1979
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
1980
+ } catch (error) { /* ignore */ }
1981
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
1982
+ var length = enumBugKeys.length;
1983
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1984
+ return NullProtoObject();
1985
+ };
1986
+
1987
+ hiddenKeys[IE_PROTO] = true;
1988
+
1989
+ // `Object.create` method
1990
+ // https://tc39.github.io/ecma262/#sec-object.create
1991
+ var objectCreate = Object.create || function create(O, Properties) {
1992
+ var result;
1993
+ if (O !== null) {
1994
+ EmptyConstructor[PROTOTYPE] = anObject(O);
1995
+ result = new EmptyConstructor();
1996
+ EmptyConstructor[PROTOTYPE] = null;
1997
+ // add "__proto__" for Object.getPrototypeOf polyfill
1998
+ result[IE_PROTO] = O;
1999
+ } else result = NullProtoObject();
2000
+ return Properties === undefined ? result : defineProperties(result, Properties);
2001
+ };
2002
+
2003
+ var wellKnownSymbol$3 = wellKnownSymbol$d;
2004
+ var create = objectCreate;
2005
+ var definePropertyModule = objectDefineProperty;
2006
+
2007
+ var UNSCOPABLES = wellKnownSymbol$3('unscopables');
2008
+ var ArrayPrototype = Array.prototype;
2009
+
2010
+ // Array.prototype[@@unscopables]
2011
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
2012
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
2013
+ definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
2014
+ configurable: true,
2015
+ value: create(null)
2016
+ });
2017
+ }
2018
+
2019
+ // add a key to Array.prototype[@@unscopables]
2020
+ var addToUnscopables$2 = function (key) {
2021
+ ArrayPrototype[UNSCOPABLES][key] = true;
2022
+ };
2023
+
2024
+ var DESCRIPTORS = descriptors;
2025
+ var fails = fails$8;
2026
+ var has = has$8;
2027
+
2028
+ var defineProperty = Object.defineProperty;
2029
+ var cache = {};
2030
+
2031
+ var thrower = function (it) { throw it; };
2032
+
2033
+ var arrayMethodUsesToLength$1 = function (METHOD_NAME, options) {
2034
+ if (has(cache, METHOD_NAME)) return cache[METHOD_NAME];
2035
+ if (!options) options = {};
2036
+ var method = [][METHOD_NAME];
2037
+ var ACCESSORS = has(options, 'ACCESSORS') ? options.ACCESSORS : false;
2038
+ var argument0 = has(options, 0) ? options[0] : thrower;
2039
+ var argument1 = has(options, 1) ? options[1] : undefined;
2040
+
2041
+ return cache[METHOD_NAME] = !!method && !fails(function () {
2042
+ if (ACCESSORS && !DESCRIPTORS) return true;
2043
+ var O = { length: -1 };
2044
+
2045
+ if (ACCESSORS) defineProperty(O, 1, { enumerable: true, get: thrower });
2046
+ else O[1] = 1;
2047
+
2048
+ method.call(O, argument0, argument1);
2049
+ });
2050
+ };
2051
+
2052
+ var $$2 = _export;
2053
+ var $includes = arrayIncludes.includes;
2054
+ var addToUnscopables$1 = addToUnscopables$2;
2055
+ var arrayMethodUsesToLength = arrayMethodUsesToLength$1;
2056
+
2057
+ var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
2058
+
2059
+ // `Array.prototype.includes` method
2060
+ // https://tc39.github.io/ecma262/#sec-array.prototype.includes
2061
+ $$2({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
2062
+ includes: function includes(el /* , fromIndex = 0 */) {
2063
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2064
+ }
2065
+ });
2066
+
2067
+ // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
2068
+ addToUnscopables$1('includes');
2069
+
2070
+ var isObject$1 = isObject$8;
2071
+ var classof$1 = classofRaw$1;
2072
+ var wellKnownSymbol$2 = wellKnownSymbol$d;
2073
+
2074
+ var MATCH$1 = wellKnownSymbol$2('match');
2075
+
2076
+ // `IsRegExp` abstract operation
2077
+ // https://tc39.github.io/ecma262/#sec-isregexp
2078
+ var isRegexp = function (it) {
2079
+ var isRegExp;
2080
+ return isObject$1(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$1(it) == 'RegExp');
2081
+ };
2082
+
2083
+ var isRegExp = isRegexp;
2084
+
2085
+ var notARegexp = function (it) {
2086
+ if (isRegExp(it)) {
2087
+ throw TypeError("The method doesn't accept regular expressions");
2088
+ } return it;
2089
+ };
2090
+
2091
+ var wellKnownSymbol$1 = wellKnownSymbol$d;
2092
+
2093
+ var MATCH = wellKnownSymbol$1('match');
2094
+
2095
+ var correctIsRegexpLogic = function (METHOD_NAME) {
2096
+ var regexp = /./;
2097
+ try {
2098
+ '/./'[METHOD_NAME](regexp);
2099
+ } catch (e) {
2100
+ try {
2101
+ regexp[MATCH] = false;
2102
+ return '/./'[METHOD_NAME](regexp);
2103
+ } catch (f) { /* empty */ }
2104
+ } return false;
2105
+ };
2106
+
2107
+ var $$1 = _export;
2108
+ var notARegExp = notARegexp;
2109
+ var requireObjectCoercible = requireObjectCoercible$3;
2110
+ var correctIsRegExpLogic = correctIsRegexpLogic;
2111
+
2112
+ // `String.prototype.includes` method
2113
+ // https://tc39.github.io/ecma262/#sec-string.prototype.includes
2114
+ $$1({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
2115
+ includes: function includes(searchString /* , position = 0 */) {
2116
+ return !!~String(requireObjectCoercible(this))
2117
+ .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
2118
+ }
2119
+ });
2120
+
2121
+ class UserService {
2122
+ constructor() {}
2123
+ currentUserHasPermissions(requiredPermissions, strategy = 'all') {
2124
+ const userPermissions = state.store.getState().user.userPermissions;
2125
+ if (!userPermissions) {
2126
+ return false;
2127
+ }
2128
+ if (requiredPermissions.length === 0) {
2129
+ return true;
2130
+ }
2131
+ const checkerAll = (arr, target) => target.every(v => arr.includes(v));
2132
+ const checkerAny = (arr, target) => target.some(v => arr.includes(v));
2133
+ let result;
2134
+ if (strategy === 'all') {
2135
+ result = checkerAll(userPermissions, requiredPermissions);
2136
+ } else {
2137
+ result = checkerAny(userPermissions, requiredPermissions);
2138
+ }
2139
+ if (result) {
2140
+ return true;
2141
+ }
2142
+ return false;
2143
+ }
2144
+ getAllUsers() {
2145
+ return HttpClient.Instance().client.get(`/identity/user`);
2146
+ }
2147
+ createUser(user) {
2148
+ return HttpClient.Instance().client.post(`/identity/user`, user);
2149
+ }
2150
+ updateUser(userId, user) {
2151
+ return HttpClient.Instance().client.put(`/identity/user/${userId}`, user);
2152
+ }
2153
+ deleteUser(userId) {
2154
+ return HttpClient.Instance().client.delete(`/identity/user/${userId}`);
2155
+ }
2156
+ confirmEmail(user) {
2157
+ return HttpClient.Instance().client.post(`/identity/confirm/email`, user);
2158
+ }
2159
+ changePassword(changePassword) {
2160
+ return HttpClient.Instance().client.post(`/identity/changepassword`, changePassword);
2161
+ }
2162
+ forgotPassword(email) {
2163
+ return HttpClient.Instance().client.post(`/identity/forgotpassword/require/${encodeURI(email)}`, null);
2164
+ }
2165
+ forgotPasswordConfirm(forgotPassword) {
2166
+ return HttpClient.Instance().client.post(`/identity/forgotpassword/confirm`, forgotPassword);
2167
+ }
2168
+ disableUserLogin(userId) {
2169
+ return HttpClient.Instance().client.post(`/disableuser/${userId}`);
2170
+ }
2171
+ enableUserLogin(userId) {
2172
+ return HttpClient.Instance().client.post(`/enableuser/${userId}`);
2173
+ }
2174
+ }
2175
+
2176
+ class BaseCommonService {
2177
+ get baseApiPath() {
2178
+ return this._baseApiPath;
2179
+ }
2180
+ constructor(baseApiPath) {
2181
+ this._baseApiPath = baseApiPath;
2182
+ }
2183
+ find(take, skip, filters, include, namedFilters, orderBy) {
2184
+ let url = `/${this._baseApiPath}?take=${take}&skip=${skip}${filters ? `&filter=${encodeURIComponent(filters)}` : ''}${include ? `&includes=${encodeURIComponent(include)}` : ''}${orderBy ? `&orderBy=${encodeURIComponent(orderBy)}` : ''}`;
2185
+ if (namedFilters) {
2186
+ namedFilters.forEach(filter => {
2187
+ url += `&${filter.key}=${filter.value}`;
2188
+ });
2189
+ }
2190
+ return HttpClient.Instance().client.get(url);
2191
+ }
2192
+ create(entity) {
2193
+ return HttpClient.Instance().client.post(`/${this._baseApiPath}`, entity);
2194
+ }
2195
+ update(id, entity) {
2196
+ return HttpClient.Instance().client.put(`/${this._baseApiPath}/${id}`, entity);
2197
+ }
2198
+ delete(entityId) {
2199
+ return HttpClient.Instance().client.delete(`/${this._baseApiPath}/${entityId}`);
2200
+ }
2201
+ get(id, include) {
2202
+ return HttpClient.Instance().client.get(`/${this._baseApiPath}/${id}${include ? `?includes=${encodeURIComponent(include)}` : ''}`);
2203
+ }
2204
+ }
2205
+
2206
+ class DomainRoleService extends BaseCommonService {
2207
+ constructor() {
2208
+ super('domainroles');
2209
+ }
2210
+ getPermissions(domainRoleId) {
2211
+ return HttpClient.Instance().client.get(`domainroles/${domainRoleId}/permissions`);
2212
+ }
2213
+ addPermission(domainRoleId, permissionId) {
2214
+ return HttpClient.Instance().client.post(`domainroles/${domainRoleId}/permissions`, {
2215
+ domainRoleId: domainRoleId,
2216
+ permissionId: permissionId
2217
+ });
2218
+ }
2219
+ removePermission(domainRoleId, permissionId) {
2220
+ return HttpClient.Instance().client.delete(`domainroles/${domainRoleId}/permissions/${permissionId}`);
2221
+ }
2222
+ }
2223
+
2224
+ class ApiKeyService {
2225
+ constructor() {}
2226
+ getApiKeys() {
2227
+ return HttpClient.Instance().client.get(`/identity/apikey`);
2228
+ }
2229
+ create(apiKey) {
2230
+ return HttpClient.Instance().client.post(`/identity/apikey`, apiKey);
2231
+ }
2232
+ delete(apiKeyId) {
2233
+ return HttpClient.Instance().client.delete(`/identity/apikey/${apiKeyId}`);
2234
+ }
2235
+ enable(apiKeyId) {
2236
+ return HttpClient.Instance().client.get(`/identity/apikey/${apiKeyId}/enable`);
2237
+ }
2238
+ disable(apiKeyId) {
2239
+ return HttpClient.Instance().client.get(`/identity/apikey/${apiKeyId}/disable`);
2240
+ }
2241
+ }
2242
+
2243
+ class PermissionService {
2244
+ getPermissionScopes() {
2245
+ return HttpClient.Instance().client.get('identity/permissions/scopes');
2246
+ }
2247
+ getPermissionsInScope(scope, packageName, namespace) {
2248
+ return HttpClient.Instance().client.get(`identity/permissions/${scope}/${packageName}/${namespace}`);
2249
+ }
2250
+ createPermissionScope(data) {
2251
+ return HttpClient.Instance().client.post(`identity/permissions/scopes`, data);
2252
+ }
2253
+ deletePermissionScope(scope, packageName, namespace) {
2254
+ return HttpClient.Instance().client.delete(`identity/permissions/scopes/${scope}/${packageName}/${namespace}`);
2255
+ }
2256
+ installPermissions(data) {
2257
+ return HttpClient.Instance().client.post('apps/permissions/install', data);
2258
+ }
2259
+ createCustomPermission(data) {
2260
+ return HttpClient.Instance().client.post('identity/permissions/custom', data);
2261
+ }
2262
+ deleteCustomPermission(permissionId) {
2263
+ return HttpClient.Instance().client.delete(`identity/permissions/custom/${permissionId}`);
2264
+ }
2265
+ }
2266
+
2267
+ class RouteRuleService extends BaseCommonService {
2268
+ constructor() {
2269
+ super('route-rule');
2270
+ }
2271
+ getRouteRulesForScope(scope, packageName) {
2272
+ return HttpClient.Instance().client.get(`route-rule?scope=${scope}&packageName=${packageName}`);
2273
+ }
2274
+ getPermissions(routeRuleId) {
2275
+ return HttpClient.Instance().client.get(`route-rule/${routeRuleId}/permissions`);
2276
+ }
2277
+ addPermission(routeRuleId, permissionId) {
2278
+ return HttpClient.Instance().client.post(`route-rule/${routeRuleId}/permissions`, {
2279
+ domainRoleId: routeRuleId,
2280
+ permissionId: permissionId
2281
+ });
2282
+ }
2283
+ removePermission(routeRuleId, permissionId) {
2284
+ return HttpClient.Instance().client.delete(`route-rule/${routeRuleId}/permissions/${permissionId}`);
2285
+ }
2286
+ }
2287
+
2288
+ class SecurityFacade {
2289
+ constructor() {
2290
+ this._userService = new UserService();
2291
+ this._apiKeyService = new ApiKeyService();
2292
+ this._domainRoleService = new DomainRoleService();
2293
+ this._permissionService = new PermissionService();
2294
+ this._routeRuleService = new RouteRuleService();
2295
+ }
2296
+ get user() {
2297
+ return this._userService;
2298
+ }
2299
+ get permission() {
2300
+ return this._permissionService;
2301
+ }
2302
+ get routeRule() {
2303
+ return this._routeRuleService;
2304
+ }
2305
+ get apiKey() {
2306
+ return this._apiKeyService;
2307
+ }
2308
+ get domainRole() {
2309
+ return this._domainRoleService;
2310
+ }
2311
+ }
2312
+
2313
+ class DocumentationService {
2314
+ constructor() {
2315
+ this.getTypeNameFromFullName = typeFullName => {
2316
+ var _a;
2317
+ const tNameSplitted = (_a = typeFullName.split(',')[0]) === null || _a === void 0 ? void 0 : _a.split('.');
2318
+ if (tNameSplitted) {
2319
+ return tNameSplitted[tNameSplitted.length - 1];
2320
+ }
2321
+ return 'ERROR';
2322
+ };
2323
+ }
2324
+ getRestApiDocumentation() {
2325
+ return HttpClient.Instance().client.get('korebi/documentation');
2326
+ }
2327
+ getTypeSchema(typeFullyQualifiedName) {
2328
+ return HttpClient.Instance().client.get(`korebi/openapischema?types=${encodeURIComponent(typeFullyQualifiedName)}`);
2329
+ }
2330
+ searchType(typeName) {
2331
+ return HttpClient.Instance().client.get(`korebi/searchtypes?type=${encodeURIComponent(typeName)}`);
2332
+ }
2333
+ }
2334
+
2335
+ class IntellisenseService {
2336
+ complete(payload) {
2337
+ return HttpClient.Instance().client.post('korebi/intellisense/complete', payload);
2338
+ }
2339
+ signature(payload) {
2340
+ return HttpClient.Instance().client.post('korebi/intellisense/signature', payload);
2341
+ }
2342
+ hover(payload) {
2343
+ return HttpClient.Instance().client.post('korebi/intellisense/hover', payload);
2344
+ }
2345
+ codeCheck(payload) {
2346
+ return HttpClient.Instance().client.post('korebi/intellisense/codecheck', payload);
2347
+ }
2348
+ }
2349
+
2350
+ class AppServiceService {
2351
+ getAppService() {
2352
+ return HttpClient.Instance().client.get('korebi/apiservices');
2353
+ }
2354
+ }
2355
+
2356
+ class DynamicConfigurationService {
2357
+ getDynamicConfiguration() {
2358
+ return HttpClient.Instance().client.get('korebi/dynamicconfiguration');
2359
+ }
2360
+ simulateDynamicConfiguration(tenantJsonConfiguration) {
2361
+ return HttpClient.Instance().client.post('korebi/simulatedeploy', tenantJsonConfiguration);
2362
+ }
2363
+ deployDynamicConfiguration(tenantJsonConfiguration) {
2364
+ return HttpClient.Instance().client.post('korebi/deploy', tenantJsonConfiguration);
2365
+ }
2366
+ }
2367
+
2368
+ class KorebiFacade {
2369
+ constructor() {
2370
+ this._documentationService = new DocumentationService();
2371
+ this._appServiceService = new AppServiceService();
2372
+ this._dynamicConfigurationService = new DynamicConfigurationService();
2373
+ this._intellisenseService = new IntellisenseService();
2374
+ }
2375
+ get documentation() {
2376
+ return this._documentationService;
2377
+ }
2378
+ get appService() {
2379
+ return this._appServiceService;
2380
+ }
2381
+ get dynamicConfiguration() {
2382
+ return this._dynamicConfigurationService;
2383
+ }
2384
+ get intellisense() {
2385
+ return this._intellisenseService;
2386
+ }
2387
+ }
2388
+
2389
+ class AppService {
2390
+ getApps(onlyDeployed) {
2391
+ const url = onlyDeployed ? 'apps?onlyDeployed=true' : 'apps';
2392
+ return HttpClient.Instance().client.get(url);
2393
+ }
2394
+ activateApp(appId) {
2395
+ return HttpClient.Instance().client.post(`apps/${appId}/activate`, {});
2396
+ }
2397
+ deactivateApp(appId) {
2398
+ return HttpClient.Instance().client.post(`apps/${appId}/deactivate`, {});
2399
+ }
2400
+ installApp(data) {
2401
+ return HttpClient.Instance().client.post(`apps/install`, data, {
2402
+ headers: {
2403
+ "Content-Type": "multipart/form-data"
2404
+ }
2405
+ });
2406
+ }
2407
+ upgradeApp(appId, data) {
2408
+ return HttpClient.Instance().client.post(`apps/${appId}/upgrade`, data, {
2409
+ headers: {
2410
+ "Content-Type": "multipart/form-data"
2411
+ }
2412
+ });
2413
+ }
2414
+ uninstallApp(appId) {
2415
+ return HttpClient.Instance().client.delete(`apps/${appId}/uninstall`);
2416
+ }
2417
+ installEmbeddedModule(data) {
2418
+ return HttpClient.Instance().client.post(`apps/install/embedded`, data);
2419
+ }
2420
+ }
2421
+
2422
+ exports.AppType = void 0;
2423
+ (function (AppType) {
2424
+ AppType[AppType["Frontend"] = 0] = "Frontend";
2425
+ AppType[AppType["Backend"] = 1] = "Backend";
2426
+ })(exports.AppType || (exports.AppType = {}));
2427
+
2428
+ exports.AppState = void 0;
2429
+ (function (AppState) {
2430
+ AppState[AppState["Active"] = 0] = "Active";
2431
+ AppState[AppState["Inactive"] = 1] = "Inactive";
2432
+ })(exports.AppState || (exports.AppState = {}));
2433
+
2434
+ var classof = classofRaw$1;
2435
+
2436
+ // `IsArray` abstract operation
2437
+ // https://tc39.github.io/ecma262/#sec-isarray
2438
+ var isArray$2 = Array.isArray || function isArray(arg) {
2439
+ return classof(arg) == 'Array';
2440
+ };
2441
+
2442
+ var isArray$1 = isArray$2;
2443
+ var toLength$1 = toLength$4;
2444
+ var bind = functionBindContext;
2445
+
2446
+ // `FlattenIntoArray` abstract operation
2447
+ // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
2448
+ var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
2449
+ var targetIndex = start;
2450
+ var sourceIndex = 0;
2451
+ var mapFn = mapper ? bind(mapper, thisArg, 3) : false;
2452
+ var element;
2453
+
2454
+ while (sourceIndex < sourceLen) {
2455
+ if (sourceIndex in source) {
2456
+ element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
2457
+
2458
+ if (depth > 0 && isArray$1(element)) {
2459
+ targetIndex = flattenIntoArray$1(target, original, element, toLength$1(element.length), targetIndex, depth - 1) - 1;
2460
+ } else {
2461
+ if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
2462
+ target[targetIndex] = element;
2463
+ }
2464
+
2465
+ targetIndex++;
2466
+ }
2467
+ sourceIndex++;
2468
+ }
2469
+ return targetIndex;
2470
+ };
2471
+
2472
+ var flattenIntoArray_1 = flattenIntoArray$1;
2473
+
2474
+ var isObject = isObject$8;
2475
+ var isArray = isArray$2;
2476
+ var wellKnownSymbol = wellKnownSymbol$d;
2477
+
2478
+ var SPECIES = wellKnownSymbol('species');
2479
+
2480
+ // `ArraySpeciesCreate` abstract operation
2481
+ // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
2482
+ var arraySpeciesCreate$1 = function (originalArray, length) {
2483
+ var C;
2484
+ if (isArray(originalArray)) {
2485
+ C = originalArray.constructor;
2486
+ // cross-realm fallback
2487
+ if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
2488
+ else if (isObject(C)) {
2489
+ C = C[SPECIES];
2490
+ if (C === null) C = undefined;
2491
+ }
2492
+ } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
2493
+ };
2494
+
2495
+ var $ = _export;
2496
+ var flattenIntoArray = flattenIntoArray_1;
2497
+ var toObject = toObject$2;
2498
+ var toLength = toLength$4;
2499
+ var toInteger = toInteger$3;
2500
+ var arraySpeciesCreate = arraySpeciesCreate$1;
2501
+
2502
+ // `Array.prototype.flat` method
2503
+ // https://github.com/tc39/proposal-flatMap
2504
+ $({ target: 'Array', proto: true }, {
2505
+ flat: function flat(/* depthArg = 1 */) {
2506
+ var depthArg = arguments.length ? arguments[0] : undefined;
2507
+ var O = toObject(this);
2508
+ var sourceLen = toLength(O.length);
2509
+ var A = arraySpeciesCreate(O, 0);
2510
+ A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
2511
+ return A;
2512
+ }
2513
+ });
2514
+
2515
+ // this method was added to unscopables after implementation
2516
+ // in popular engines, so it's moved to a separate module
2517
+ var addToUnscopables = addToUnscopables$2;
2518
+
2519
+ addToUnscopables('flat');
2520
+
2521
+ class EmbeddedModule {
2522
+ get name() {
2523
+ return this._name;
2524
+ }
2525
+ get description() {
2526
+ return this._description;
2527
+ }
2528
+ get author() {
2529
+ return this._author;
2530
+ }
2531
+ get version() {
2532
+ return this._version;
2533
+ }
2534
+ get scope() {
2535
+ return this._scope;
2536
+ }
2537
+ get navigation() {
2538
+ return this._navigation;
2539
+ }
2540
+ constructor(name, description, author, version, scope) {
2541
+ this._navigation = [];
2542
+ this._name = name;
2543
+ this._description = description;
2544
+ this._author = author;
2545
+ this._version = version;
2546
+ this._scope = scope;
2547
+ }
2548
+ attachNavigation(navigationConfig) {
2549
+ this._navigation.push(navigationConfig);
2550
+ }
2551
+ getRouteObject(routes = undefined) {
2552
+ const r = routes !== null && routes !== void 0 ? routes : this._navigation.map(a => a.routes).map(a => a).flat();
2553
+ if (!r || r.length === 0) return [];
2554
+ const routeObject = [];
2555
+ r.map(route => {
2556
+ if (route.route) {
2557
+ let path = route.route;
2558
+ if (route.route === '/') {
2559
+ path = '';
2560
+ }
2561
+ if (route.route === "*") {
2562
+ path = '*';
2563
+ }
2564
+ routeObject.push({
2565
+ path: path,
2566
+ index: route.route === '/' ? undefined : false,
2567
+ element: route.component,
2568
+ children: route.routes && route.routes.length > 0 ? this.getRouteObject(route.routes) : []
2569
+ });
2570
+ }
2571
+ });
2572
+ return routeObject;
2573
+ }
2574
+ getEmbeddedModule() {
2575
+ const conf = {
2576
+ name: this._name,
2577
+ description: this._description,
2578
+ author: this._author,
2579
+ version: this._version,
2580
+ scope: this._scope,
2581
+ menu: this._navigation.map(a => a.menu)
2582
+ };
2583
+ return conf;
2584
+ }
2585
+ }
2586
+
2587
+ class ReportingService {
2588
+ getReportsList(scopeFilter) {
2589
+ return HttpClient.Instance().client.get(scopeFilter ? `reports/types/list?scopeFilter=${scopeFilter}` : 'reports/types/list');
2590
+ }
2591
+ createReport(command) {
2592
+ return HttpClient.Instance().client.post('reports', command);
2593
+ }
2594
+ getReportById(id) {
2595
+ return HttpClient.Instance().client.get(`reports/${id}`);
2596
+ }
2597
+ deleteReport(id) {
2598
+ return HttpClient.Instance().client.delete(`reports/${id}`);
2599
+ }
2600
+ getParametersSchema(fullScope) {
2601
+ return HttpClient.Instance().client.get(`reports/params/schema/${fullScope}`);
2602
+ }
2603
+ print(command) {
2604
+ return HttpClient.Instance().client.post('reports/print', command);
2605
+ }
2606
+ }
2607
+
2608
+ exports.PrinterType = void 0;
2609
+ (function (PrinterType) {
2610
+ PrinterType[PrinterType["Managed"] = 0] = "Managed";
2611
+ PrinterType[PrinterType["Unmanaged"] = 1] = "Unmanaged";
2612
+ })(exports.PrinterType || (exports.PrinterType = {}));
2613
+
2614
+ exports.PrintServerType = void 0;
2615
+ (function (PrintServerType) {
2616
+ PrintServerType[PrintServerType["Direct"] = 0] = "Direct";
2617
+ PrintServerType[PrintServerType["Remote"] = 1] = "Remote";
2618
+ })(exports.PrintServerType || (exports.PrintServerType = {}));
2619
+
2620
+ exports.PrinterManufacturer = void 0;
2621
+ (function (PrinterManufacturer) {
2622
+ PrinterManufacturer[PrinterManufacturer["Zebra"] = 0] = "Zebra";
2623
+ })(exports.PrinterManufacturer || (exports.PrinterManufacturer = {}));
2624
+
2625
+ exports.PrintServerManagedType = void 0;
2626
+ (function (PrintServerManagedType) {
2627
+ PrintServerManagedType[PrintServerManagedType["Ipp"] = 0] = "Ipp";
2628
+ PrintServerManagedType[PrintServerManagedType["Windows"] = 1] = "Windows";
2629
+ })(exports.PrintServerManagedType || (exports.PrintServerManagedType = {}));
2630
+
2631
+ class PrintingService {
2632
+ GetPrintServerList() {
2633
+ return HttpClient.Instance().client.get(`print-server?includes=Printers`);
2634
+ }
2635
+ GetPrintServer(printServerId) {
2636
+ return HttpClient.Instance().client.get(`print-server/${printServerId}`);
2637
+ }
2638
+ UpdatePrintServer(printServerId, command) {
2639
+ return HttpClient.Instance().client.put(`print-server/${printServerId}`, command);
2640
+ }
2641
+ GetPrintServerPrinters(printServerId) {
2642
+ return HttpClient.Instance().client.get(`print-server/${printServerId}/printers`);
2643
+ }
2644
+ CreatePrintServer(command) {
2645
+ return HttpClient.Instance().client.post(`print-server`, command);
2646
+ }
2647
+ AddPrinter(printServerId, command) {
2648
+ return HttpClient.Instance().client.post(`print-server/${printServerId}/virtual-printers`, command);
2649
+ }
2650
+ }
2651
+
2652
+ exports.WorkflowActionInputType = void 0;
2653
+ (function (WorkflowActionInputType) {
2654
+ WorkflowActionInputType[WorkflowActionInputType["none"] = 0] = "none";
2655
+ WorkflowActionInputType[WorkflowActionInputType["manual"] = 1] = "manual";
2656
+ WorkflowActionInputType[WorkflowActionInputType["dynamic"] = 2] = "dynamic";
2657
+ WorkflowActionInputType[WorkflowActionInputType["expression"] = 3] = "expression";
2658
+ })(exports.WorkflowActionInputType || (exports.WorkflowActionInputType = {}));
2659
+
2660
+ class WorkflowService {
2661
+ getActionsDefinition() {
2662
+ return HttpClient.Instance().client.get('workflow/designer/actions');
2663
+ }
2664
+ getTriggersDefinition() {
2665
+ return HttpClient.Instance().client.get('workflow/designer/triggers');
2666
+ }
2667
+ test(workflow) {
2668
+ return HttpClient.Instance().client.post('workflow/convert', workflow);
2669
+ }
2670
+ }
2671
+
2672
+ class FluxoClientBase {
2673
+ constructor() {
2674
+ this._authenticationType = null;
2675
+ this._securityFacade = null;
2676
+ this._authService = null;
2677
+ this._configurationService = null;
2678
+ this._korebiFacade = null;
2679
+ this._appsService = null;
2680
+ this._reportingService = null;
2681
+ this._printingService = null;
2682
+ this._workflowService = null;
2683
+ this._config = null;
2684
+ this._modules = [];
2685
+ this.getBearerToken = () => {
2686
+ const jwtToken = localStorage.getItem('access-token');
2687
+ return jwtToken !== null && jwtToken !== void 0 ? jwtToken : '';
2688
+ };
2689
+ }
2690
+ get modules() {
2691
+ return this._modules;
2692
+ }
2693
+ static get HttpClient() {
2694
+ return HttpClient.Instance();
2695
+ }
2696
+ register(module) {
2697
+ this._modules.push(module);
2698
+ }
2699
+ /**
2700
+ * Creates an instance of FluxoClient
2701
+ */
2702
+ setup(config, setState) {
2703
+ return __awaiter(this, void 0, void 0, function* () {
2704
+ this._config = config;
2705
+ console.info('-*-*-*- FluxoClient setup started -*-*-*-');
2706
+ this._authenticationType = config.authenticationType;
2707
+ if (this._authenticationType === state.AuthenticationType.ApiKey && !config.apiKey) {
2708
+ throw new Error('ApiKey is required in ApiKey Authentication mode.');
2709
+ }
2710
+ console.info('1) Set authentication type: ' + this._authenticationType);
2711
+ const apiKeyOrToken = config.authenticationType === state.AuthenticationType.ApiKey ? config.apiKey : this.getBearerToken();
2712
+ console.info('2) Initialize HTTPClient setup');
2713
+ HttpClient.Init(this._authenticationType, config.fluxoInstanceUrl, apiKeyOrToken);
2714
+ console.info('3) HTTPClient initialized');
2715
+ console.info('4) Initializa auth service');
2716
+ this._authService = new AuthService();
2717
+ yield this._authService.setup();
2718
+ console.info('5) Auth service initialized');
2719
+ console.info('6) Initialize sub services');
2720
+ /** other services **/
2721
+ this.AddSetupConfiguration(config);
2722
+ this._configurationService = new ConfigurationService();
2723
+ this._korebiFacade = new KorebiFacade();
2724
+ this._appsService = new AppService();
2725
+ this._securityFacade = new SecurityFacade();
2726
+ this._reportingService = new ReportingService();
2727
+ this._printingService = new PrintingService();
2728
+ this._workflowService = new WorkflowService();
2729
+ console.info('7) Sub services initialized');
2730
+ if (setState) state.store.dispatch(state.setFluxoClientConfiguration(config));
2731
+ console.info('-*-*-*- FluxoClient setup finished -*-*-*-');
2732
+ });
2733
+ }
2734
+ get clientConfig() {
2735
+ if (!this._config) throw new Error('FluxoClient is not initialized. Please call FluxoClient.Init() before using FluxoClient.Instance()');
2736
+ return this._config;
2737
+ }
2738
+ get security() {
2739
+ return this._securityFacade;
2740
+ }
2741
+ get auth() {
2742
+ return this._authService;
2743
+ }
2744
+ get configuration() {
2745
+ return this._configurationService;
2746
+ }
2747
+ get korebi() {
2748
+ return this._korebiFacade;
2749
+ }
2750
+ get apps() {
2751
+ return this._appsService;
2752
+ }
2753
+ get reporting() {
2754
+ return this._reportingService;
2755
+ }
2756
+ get printing() {
2757
+ return this._printingService;
2758
+ }
2759
+ get workflow() {
2760
+ return this._workflowService;
2761
+ }
2762
+ }
2763
+
2764
+ class FluxoClientSys {
2765
+ constructor() {}
2766
+ static Init(instance) {
2767
+ if (FluxoClientSys._initialized) throw new Error('FluxoClientBaseFactory is already initialized. Please call FluxoClientBaseFactory.Instance() to get current instance.');
2768
+ FluxoClientSys._instance = instance;
2769
+ FluxoClientSys._initialized = true;
2770
+ }
2771
+ static get Instance() {
2772
+ if (!FluxoClientSys._initialized) {
2773
+ throw new Error('FluxoClientBaseFactory is not initialized. Please call FluxoClientBaseFactory.Init() before using FluxoClientBaseFactory.Instance()');
2774
+ }
2775
+ return FluxoClientSys._instance;
2776
+ }
2777
+ }
2778
+ FluxoClientSys._initialized = false;
2779
+ FluxoClientSys._instance = null;
2780
+
2781
+ exports.AppMenuContextType = void 0;
2782
+ (function (AppMenuContextType) {
2783
+ AppMenuContextType[AppMenuContextType["Default"] = 0] = "Default";
2784
+ AppMenuContextType[AppMenuContextType["DomainRole"] = 1] = "DomainRole";
2785
+ AppMenuContextType[AppMenuContextType["User"] = 2] = "User";
2786
+ })(exports.AppMenuContextType || (exports.AppMenuContextType = {}));
2787
+
2788
+ class ServerFilterHelper {
2789
+ static getFilterString(filter, globalSearchQuery, globalSearchQueryFields, globalQueryOperator = 'or') {
2790
+ let filtersString = filter ? filter : '';
2791
+ const globalSearchFilterArray = [];
2792
+ if (globalSearchQuery && globalSearchQueryFields) {
2793
+ let gFilter = '';
2794
+ globalSearchQueryFields.forEach(field => {
2795
+ if (field.fieldType === 'string') gFilter = `(obj.${field.fieldName}.ToLower().Contains("${globalSearchQuery}".ToLower()))`;else gFilter = `(obj.${field.fieldName} == ${globalSearchQuery})`;
2796
+ globalSearchFilterArray.push(gFilter);
2797
+ });
2798
+ }
2799
+ if (globalSearchFilterArray.length > 0) {
2800
+ if (filtersString !== '') filtersString = filtersString + ` ${globalQueryOperator} ` + globalSearchFilterArray.join(" or ");else filtersString = globalSearchFilterArray.join(" or ");
2801
+ }
2802
+ return filtersString;
2803
+ }
2804
+ }
2805
+
2806
+ exports.ApiKeyService = ApiKeyService;
2807
+ exports.AppService = AppService;
2808
+ exports.AppServiceService = AppServiceService;
2809
+ exports.BaseCommonService = BaseCommonService;
2810
+ exports.DocumentationService = DocumentationService;
2811
+ exports.DomainRoleService = DomainRoleService;
2812
+ exports.DynamicConfigurationService = DynamicConfigurationService;
2813
+ exports.EmbeddedModule = EmbeddedModule;
2814
+ exports.FluxoClientBase = FluxoClientBase;
2815
+ exports.FluxoClientSys = FluxoClientSys;
2816
+ exports.FluxoStateDispatcher = FluxoStateDispatcher;
2817
+ exports.HttpClient = HttpClient;
2818
+ exports.IntellisenseService = IntellisenseService;
2819
+ exports.PermissionService = PermissionService;
2820
+ exports.PrintingService = PrintingService;
2821
+ exports.ReportingService = ReportingService;
2822
+ exports.RouteRuleService = RouteRuleService;
2823
+ exports.ServerFilterHelper = ServerFilterHelper;
2824
+ exports.UserService = UserService;
2825
+ exports.WorkflowService = WorkflowService;