kwikid-forms 0.6.46 → 0.6.48

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.
@@ -389,14 +389,24 @@
389
389
  }) : function (o, v) {
390
390
  o["default"] = v;
391
391
  };
392
+ var ownKeys = function (o) {
393
+ ownKeys = Object.getOwnPropertyNames || function (o) {
394
+ var ar = [];
395
+ for (var k in o)
396
+ if (Object.prototype.hasOwnProperty.call(o, k))
397
+ ar[ar.length] = k;
398
+ return ar;
399
+ };
400
+ return ownKeys(o);
401
+ };
392
402
  function __importStar(mod) {
393
403
  if (mod && mod.__esModule)
394
404
  return mod;
395
405
  var result = {};
396
406
  if (mod != null)
397
- for (var k in mod)
398
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
399
- __createBinding(result, mod, k);
407
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++)
408
+ if (k[i] !== "default")
409
+ __createBinding(result, mod, k[i]);
400
410
  __setModuleDefault(result, mod);
401
411
  return result;
402
412
  }
@@ -491,12 +501,24 @@
491
501
  }
492
502
  return next();
493
503
  }
504
+ function __rewriteRelativeImportExtension(path, preserveJsx) {
505
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
506
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
507
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
508
+ });
509
+ }
510
+ return path;
511
+ }
494
512
  var tslib_es6 = {
495
513
  __extends: __extends,
496
514
  __assign: __assign,
497
515
  __rest: __rest,
498
516
  __decorate: __decorate,
499
517
  __param: __param,
518
+ __esDecorate: __esDecorate,
519
+ __runInitializers: __runInitializers,
520
+ __propKey: __propKey,
521
+ __setFunctionName: __setFunctionName,
500
522
  __metadata: __metadata,
501
523
  __awaiter: __awaiter,
502
524
  __generator: __generator,
@@ -519,6 +541,7 @@
519
541
  __classPrivateFieldIn: __classPrivateFieldIn,
520
542
  __addDisposableResource: __addDisposableResource,
521
543
  __disposeResources: __disposeResources,
544
+ __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
522
545
  };
523
546
 
524
547
  function convertFormListConfig(formsList) {
@@ -3186,6 +3209,7 @@
3186
3209
 
3187
3210
  var EActionKey;
3188
3211
  (function (EActionKey) {
3212
+ EActionKey["REMOVE_KEY_FROM_OBJECT_PATH"] = "REMOVE_KEY_FROM_OBJECT_PATH";
3189
3213
  EActionKey["SET_VALUE"] = "SET_VALUE";
3190
3214
  EActionKey["SET_FIELD_DEFAULT_VALUE"] = "SET_FIELD_DEFAULT_VALUE";
3191
3215
  EActionKey["SET_API_STATUS"] = "SET_API_STATUS";
@@ -3363,10 +3387,12 @@
3363
3387
  };
3364
3388
  // Function to preprocess header data
3365
3389
  KwikIDFormViewApiService.prototype.preProcessHeader = function (headerData, isVerifySignature) {
3366
- if (!headerData)
3390
+ if (!headerData) {
3367
3391
  headerData = {};
3368
- if (!headerData.headers)
3392
+ }
3393
+ if (!headerData.headers) {
3369
3394
  headerData.headers = {};
3395
+ }
3370
3396
  // Generate a unique identifier if signature verification is required
3371
3397
  if (isVerifySignature) {
3372
3398
  headerData.headers.xrid = uuid.v4();
@@ -5090,11 +5116,11 @@
5090
5116
  (function () { return __awaiter(_this, void 0, void 0, function () {
5091
5117
  var res;
5092
5118
  var _this = this;
5093
- return __generator(this, function (_15) {
5094
- switch (_15.label) {
5119
+ return __generator(this, function (_13) {
5120
+ switch (_13.label) {
5095
5121
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
5096
5122
  case 1:
5097
- res = _15.sent();
5123
+ res = _13.sent();
5098
5124
  if (res) {
5099
5125
  this.loading = false;
5100
5126
  this.activeCameraRecordingTimerSubcription = this.cameraRecordService
@@ -5116,7 +5142,7 @@
5116
5142
  }); })();
5117
5143
  };
5118
5144
  KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
5119
- var _15, _16, _17, _18;
5145
+ var _13, _14, _15, _16;
5120
5146
  var _this = this;
5121
5147
  var _a, _b, _c, _d;
5122
5148
  var verifyChange = function (key) {
@@ -5147,9 +5173,9 @@
5147
5173
  ? changes.popupFormCallback.currentValue.popupFormData.data
5148
5174
  : changes.popupFormCallback.currentValue.popupFormData;
5149
5175
  var popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
5150
- this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_15 = {},
5151
- _15[popupFormConfig.key] = popupFormData,
5152
- _15));
5176
+ this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_13 = {},
5177
+ _13[popupFormConfig.key] = popupFormData,
5178
+ _13));
5153
5179
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
5154
5180
  if (kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue, "stopTaskExecution")) {
5155
5181
  this.stopTaskExecution =
@@ -5211,9 +5237,9 @@
5211
5237
  emitEvent: false,
5212
5238
  onlySelf: false
5213
5239
  });
5214
- this.formGroup.patchValue((_16 = {},
5215
- _16[field_1.key] = kwikidToolkit.getObjectDeepCopy([imageData]),
5216
- _16), { emitEvent: false });
5240
+ this.formGroup.patchValue((_14 = {},
5241
+ _14[field_1.key] = kwikidToolkit.getObjectDeepCopy([imageData]),
5242
+ _14), { emitEvent: false });
5217
5243
  this.formGroup.controls[field_1.key].updateValueAndValidity({
5218
5244
  emitEvent: false
5219
5245
  });
@@ -5235,11 +5261,11 @@
5235
5261
  EXTRA_DATA: this.extraData
5236
5262
  }, this.takeAction.bind(this));
5237
5263
  (function () { return __awaiter(_this, void 0, void 0, function () {
5238
- return __generator(this, function (_15) {
5239
- switch (_15.label) {
5264
+ return __generator(this, function (_13) {
5265
+ switch (_13.label) {
5240
5266
  case 0: return [4 /*yield*/, ruleEngine_1.run(field_1.validation)];
5241
5267
  case 1:
5242
- _15.sent();
5268
+ _13.sent();
5243
5269
  return [2 /*return*/];
5244
5270
  }
5245
5271
  });
@@ -5280,9 +5306,9 @@
5280
5306
  emitEvent: false,
5281
5307
  onlySelf: false
5282
5308
  });
5283
- this.formGroup.patchValue((_17 = {},
5284
- _17[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
5285
- _17), { emitEvent: false });
5309
+ this.formGroup.patchValue((_15 = {},
5310
+ _15[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
5311
+ _15), { emitEvent: false });
5286
5312
  this.formGroup.controls[field_1.key].updateValueAndValidity({
5287
5313
  emitEvent: false
5288
5314
  });
@@ -5304,11 +5330,11 @@
5304
5330
  EXTRA_DATA: this.extraData
5305
5331
  }, this.takeAction.bind(this));
5306
5332
  (function () { return __awaiter(_this, void 0, void 0, function () {
5307
- return __generator(this, function (_15) {
5308
- switch (_15.label) {
5333
+ return __generator(this, function (_13) {
5334
+ switch (_13.label) {
5309
5335
  case 0: return [4 /*yield*/, ruleEngine_2.run(field_1.validation)];
5310
5336
  case 1:
5311
- _15.sent();
5337
+ _13.sent();
5312
5338
  return [2 /*return*/];
5313
5339
  }
5314
5340
  });
@@ -5345,9 +5371,9 @@
5345
5371
  emitEvent: false,
5346
5372
  onlySelf: false
5347
5373
  });
5348
- this.formGroup.patchValue((_18 = {},
5349
- _18[field_1.key] = kwikidToolkit.getObjectDeepCopy(response),
5350
- _18), { emitEvent: false });
5374
+ this.formGroup.patchValue((_16 = {},
5375
+ _16[field_1.key] = kwikidToolkit.getObjectDeepCopy(response),
5376
+ _16), { emitEvent: false });
5351
5377
  this.formGroup.controls[field_1.key].updateValueAndValidity({
5352
5378
  emitEvent: false
5353
5379
  });
@@ -5369,11 +5395,11 @@
5369
5395
  }, this.takeAction.bind(this));
5370
5396
  (function () { return __awaiter(_this, void 0, void 0, function () {
5371
5397
  var api;
5372
- return __generator(this, function (_15) {
5373
- switch (_15.label) {
5398
+ return __generator(this, function (_13) {
5399
+ switch (_13.label) {
5374
5400
  case 0: return [4 /*yield*/, apis_1.validateResponse()];
5375
5401
  case 1:
5376
- api = _15.sent();
5402
+ api = _13.sent();
5377
5403
  field_1.api = api;
5378
5404
  return [2 /*return*/];
5379
5405
  }
@@ -5393,11 +5419,11 @@
5393
5419
  EXTRA_DATA: this.extraData
5394
5420
  }, this.takeAction.bind(this));
5395
5421
  (function () { return __awaiter(_this, void 0, void 0, function () {
5396
- return __generator(this, function (_15) {
5397
- switch (_15.label) {
5422
+ return __generator(this, function (_13) {
5423
+ switch (_13.label) {
5398
5424
  case 0: return [4 /*yield*/, ruleEngine_3.run(field_1.validation)];
5399
5425
  case 1:
5400
- _15.sent();
5426
+ _13.sent();
5401
5427
  return [2 /*return*/];
5402
5428
  }
5403
5429
  });
@@ -5438,11 +5464,11 @@
5438
5464
  }, this.takeAction.bind(this));
5439
5465
  (function () { return __awaiter(_this, void 0, void 0, function () {
5440
5466
  var api;
5441
- return __generator(this, function (_15) {
5442
- switch (_15.label) {
5467
+ return __generator(this, function (_13) {
5468
+ switch (_13.label) {
5443
5469
  case 0: return [4 /*yield*/, apis_2.validateResponse()];
5444
5470
  case 1:
5445
- api = _15.sent();
5471
+ api = _13.sent();
5446
5472
  field_1.api = api;
5447
5473
  return [2 /*return*/];
5448
5474
  }
@@ -5487,11 +5513,11 @@
5487
5513
  EXTRA_DATA: this.extraData
5488
5514
  }, this.takeAction.bind(this));
5489
5515
  (function () { return __awaiter(_this, void 0, void 0, function () {
5490
- return __generator(this, function (_15) {
5491
- switch (_15.label) {
5516
+ return __generator(this, function (_13) {
5517
+ switch (_13.label) {
5492
5518
  case 0: return [4 /*yield*/, ruleEngine_4.run(field_2.validation)];
5493
5519
  case 1:
5494
- _15.sent();
5520
+ _13.sent();
5495
5521
  return [2 /*return*/];
5496
5522
  }
5497
5523
  });
@@ -5506,11 +5532,11 @@
5506
5532
  if (verifyChange("formConfig")) {
5507
5533
  this.formConfig = changes.formConfig.currentValue;
5508
5534
  (function () { return __awaiter(_this, void 0, void 0, function () {
5509
- return __generator(this, function (_15) {
5510
- switch (_15.label) {
5535
+ return __generator(this, function (_13) {
5536
+ switch (_13.label) {
5511
5537
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
5512
5538
  case 1:
5513
- _15.sent();
5539
+ _13.sent();
5514
5540
  return [2 /*return*/];
5515
5541
  }
5516
5542
  });
@@ -5530,11 +5556,11 @@
5530
5556
  };
5531
5557
  KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
5532
5558
  return __awaiter(this, void 0, void 0, function () {
5533
- var _15, _16, preTask, task, e_1_1, _17, _loop_1, this_1, _18, _19, field, _20, _21, field, ruleEngine, e_2_1;
5534
- var e_1, _22, e_3, _23, e_2, _24;
5559
+ var _13, _14, preTask, task, e_1_1, _15, _loop_1, this_1, _16, _17, field, _18, _19, field, ruleEngine, e_2_1;
5560
+ var e_1, _20, e_3, _21, e_2, _22;
5535
5561
  var _this = this;
5536
- return __generator(this, function (_25) {
5537
- switch (_25.label) {
5562
+ return __generator(this, function (_23) {
5563
+ switch (_23.label) {
5538
5564
  case 0:
5539
5565
  formConfig = new Converter().convertFormConfig(formConfig);
5540
5566
  formConfig = new Converter().updateFormConfigProperties(formConfig);
@@ -5548,14 +5574,14 @@
5548
5574
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
5549
5575
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "pre"))) return [3 /*break*/, 10];
5550
5576
  this.triggerLogs(ELogEventType$1.FORM__TASK_PRE, {});
5551
- _25.label = 1;
5577
+ _23.label = 1;
5552
5578
  case 1:
5553
- _25.trys.push([1, 7, 8, 9]);
5554
- _15 = __values(this.formConfig.tasks.pre), _16 = _15.next();
5555
- _25.label = 2;
5579
+ _23.trys.push([1, 7, 8, 9]);
5580
+ _13 = __values(this.formConfig.tasks.pre), _14 = _13.next();
5581
+ _23.label = 2;
5556
5582
  case 2:
5557
- if (!!_16.done) return [3 /*break*/, 6];
5558
- preTask = _16.value;
5583
+ if (!!_14.done) return [3 /*break*/, 6];
5584
+ preTask = _14.value;
5559
5585
  task = new Tasks(preTask, {
5560
5586
  FORM_CONFIG: this.formConfig,
5561
5587
  FORM_FIELDS: this.formFields,
@@ -5575,7 +5601,7 @@
5575
5601
  }
5576
5602
  return [4 /*yield*/, task.execute()];
5577
5603
  case 3:
5578
- _25.sent();
5604
+ _23.sent();
5579
5605
  // Wait for ngOnChanges to be called before continuing to the next task
5580
5606
  return [4 /*yield*/, new Promise(function (resolve) {
5581
5607
  var intervalId = setInterval(function () {
@@ -5587,33 +5613,33 @@
5587
5613
  })];
5588
5614
  case 4:
5589
5615
  // Wait for ngOnChanges to be called before continuing to the next task
5590
- _25.sent();
5616
+ _23.sent();
5591
5617
  if (this.stopTaskExecution) {
5592
5618
  return [3 /*break*/, 6];
5593
5619
  }
5594
- _25.label = 5;
5620
+ _23.label = 5;
5595
5621
  case 5:
5596
- _16 = _15.next();
5622
+ _14 = _13.next();
5597
5623
  return [3 /*break*/, 2];
5598
5624
  case 6: return [3 /*break*/, 9];
5599
5625
  case 7:
5600
- e_1_1 = _25.sent();
5626
+ e_1_1 = _23.sent();
5601
5627
  e_1 = { error: e_1_1 };
5602
5628
  return [3 /*break*/, 9];
5603
5629
  case 8:
5604
5630
  try {
5605
- if (_16 && !_16.done && (_22 = _15.return)) _22.call(_15);
5631
+ if (_14 && !_14.done && (_20 = _13.return)) _20.call(_13);
5606
5632
  }
5607
5633
  finally { if (e_1) throw e_1.error; }
5608
5634
  return [7 /*endfinally*/];
5609
5635
  case 9:
5610
5636
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
5611
- _25.label = 10;
5637
+ _23.label = 10;
5612
5638
  case 10:
5613
5639
  if (this.stopTaskExecution) {
5614
5640
  return [2 /*return*/, false];
5615
5641
  }
5616
- _17 = this;
5642
+ _15 = this;
5617
5643
  return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, {
5618
5644
  FORM_CONFIG: this.formConfig,
5619
5645
  FORM_DATA: this.formData,
@@ -5624,7 +5650,7 @@
5624
5650
  EXTRA_DATA: this.extraData
5625
5651
  }, this.takeAction.bind(this))];
5626
5652
  case 11:
5627
- _17.formGroup = _25.sent();
5653
+ _15.formGroup = _23.sent();
5628
5654
  /**
5629
5655
  * For some reason if their a field of type 'IMAGE' then
5630
5656
  * formData is adding a 'undefined' key with last image's value from the array.
@@ -5634,41 +5660,41 @@
5634
5660
  delete this.formData.undefined;
5635
5661
  }
5636
5662
  _loop_1 = function (field) {
5637
- var _26, _27, _28, _29;
5663
+ var _24, _25, _26, _27;
5638
5664
  if (field.isFormElement) {
5639
- this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_26 = {}, _26[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _26));
5640
- this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_27 = {}, _27[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _27));
5665
+ this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_24 = {}, _24[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _24));
5666
+ this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_25 = {}, _25[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _25));
5641
5667
  if (field.type === EFieldType.FILE) {
5642
5668
  this_1.files[field.key] = this_1.formGroup.controls[field.key].value;
5643
5669
  }
5644
5670
  if (field.type === EFieldType.CAPTURE) {
5645
5671
  this_1.resetCamera();
5646
- this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_28 = {}, _28[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _28));
5672
+ this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_26 = {}, _26[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _26));
5647
5673
  this_1.mediaFiles[field.key] = this_1.formGroup.controls[field.key].value;
5648
5674
  }
5649
5675
  if (field.type === EFieldType.RECORD) {
5650
5676
  this_1.resetCamera();
5651
- this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_29 = {}, _29[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _29));
5677
+ this_1.cameraData = Object.assign(Object.assign({}, this_1.cameraData), (_27 = {}, _27[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _27));
5652
5678
  this_1.mediaFiles[field.key] = this_1.formGroup.controls[field.key].value;
5653
5679
  }
5654
5680
  this_1.formGroup.controls[field.key].valueChanges
5655
5681
  .pipe(operators.pairwise())
5656
- .subscribe(function (_15) {
5657
- var _16, _17, _18, _19;
5658
- var _20 = __read(_15, 2), previousValue = _20[0], currentValue = _20[1];
5659
- _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_16 = {}, _16[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _16));
5660
- _this.formData = Object.assign(Object.assign({}, _this.formData), (_17 = {}, _17[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _17));
5682
+ .subscribe(function (_13) {
5683
+ var _14, _15, _16, _17;
5684
+ var _18 = __read(_13, 2), previousValue = _18[0], currentValue = _18[1];
5685
+ _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_14 = {}, _14[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _14));
5686
+ _this.formData = Object.assign(Object.assign({}, _this.formData), (_15 = {}, _15[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _15));
5661
5687
  if (field.type === EFieldType.FILE) {
5662
5688
  _this.files[field.key] = currentValue;
5663
5689
  }
5664
5690
  if (field.type === EFieldType.CAPTURE) {
5665
5691
  _this.resetCamera();
5666
- _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_18 = {}, _18[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _18));
5692
+ _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_16 = {}, _16[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _16));
5667
5693
  _this.mediaFiles[field.key] = currentValue;
5668
5694
  }
5669
5695
  if (field.type === EFieldType.RECORD) {
5670
5696
  _this.resetCamera();
5671
- _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_19 = {}, _19[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _19));
5697
+ _this.cameraData = Object.assign(Object.assign({}, _this.cameraData), (_17 = {}, _17[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _17));
5672
5698
  _this.mediaFiles[field.key] = currentValue;
5673
5699
  }
5674
5700
  });
@@ -5676,26 +5702,26 @@
5676
5702
  };
5677
5703
  this_1 = this;
5678
5704
  try {
5679
- for (_18 = __values(this.formFields), _19 = _18.next(); !_19.done; _19 = _18.next()) {
5680
- field = _19.value;
5705
+ for (_16 = __values(this.formFields), _17 = _16.next(); !_17.done; _17 = _16.next()) {
5706
+ field = _17.value;
5681
5707
  _loop_1(field);
5682
5708
  }
5683
5709
  }
5684
5710
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
5685
5711
  finally {
5686
5712
  try {
5687
- if (_19 && !_19.done && (_23 = _18.return)) _23.call(_18);
5713
+ if (_17 && !_17.done && (_21 = _16.return)) _21.call(_16);
5688
5714
  }
5689
5715
  finally { if (e_3) throw e_3.error; }
5690
5716
  }
5691
- _25.label = 12;
5717
+ _23.label = 12;
5692
5718
  case 12:
5693
- _25.trys.push([12, 18, 19, 20]);
5694
- _20 = __values(this.formFields), _21 = _20.next();
5695
- _25.label = 13;
5719
+ _23.trys.push([12, 18, 19, 20]);
5720
+ _18 = __values(this.formFields), _19 = _18.next();
5721
+ _23.label = 13;
5696
5722
  case 13:
5697
- if (!!_21.done) return [3 /*break*/, 17];
5698
- field = _21.value;
5723
+ if (!!_19.done) return [3 /*break*/, 17];
5724
+ field = _19.value;
5699
5725
  if (!field.isFormElement) return [3 /*break*/, 16];
5700
5726
  if (!kwikidToolkit.checkObjectKeyExists(field, "validation")) return [3 /*break*/, 15];
5701
5727
  if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 15];
@@ -5711,8 +5737,8 @@
5711
5737
  }, this.takeAction.bind(this));
5712
5738
  return [4 /*yield*/, ruleEngine.run(field.validation)];
5713
5739
  case 14:
5714
- _25.sent();
5715
- _25.label = 15;
5740
+ _23.sent();
5741
+ _23.label = 15;
5716
5742
  case 15:
5717
5743
  if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
5718
5744
  this.handleConnectedElements({
@@ -5720,18 +5746,18 @@
5720
5746
  value: this.formGroup.controls[field.key].value
5721
5747
  }, "ON_INIT");
5722
5748
  }
5723
- _25.label = 16;
5749
+ _23.label = 16;
5724
5750
  case 16:
5725
- _21 = _20.next();
5751
+ _19 = _18.next();
5726
5752
  return [3 /*break*/, 13];
5727
5753
  case 17: return [3 /*break*/, 20];
5728
5754
  case 18:
5729
- e_2_1 = _25.sent();
5755
+ e_2_1 = _23.sent();
5730
5756
  e_2 = { error: e_2_1 };
5731
5757
  return [3 /*break*/, 20];
5732
5758
  case 19:
5733
5759
  try {
5734
- if (_21 && !_21.done && (_24 = _20.return)) _24.call(_20);
5760
+ if (_19 && !_19.done && (_22 = _18.return)) _22.call(_18);
5735
5761
  }
5736
5762
  finally { if (e_2) throw e_2.error; }
5737
5763
  return [7 /*endfinally*/];
@@ -5769,10 +5795,10 @@
5769
5795
  };
5770
5796
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
5771
5797
  return __awaiter(this, void 0, void 0, function () {
5772
- var rulesMapping, _15, _16, action, conditionSuccess, actions, e_4_1;
5773
- var e_4, _17;
5774
- return __generator(this, function (_18) {
5775
- switch (_18.label) {
5798
+ var rulesMapping, _13, _14, action, conditionSuccess, actions, e_4_1;
5799
+ var e_4, _15;
5800
+ return __generator(this, function (_16) {
5801
+ switch (_16.label) {
5776
5802
  case 0:
5777
5803
  if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
5778
5804
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
@@ -5784,14 +5810,14 @@
5784
5810
  ALL_FORMS_DATA: this.allFormsData,
5785
5811
  EXTRA_DATA: this.extraData
5786
5812
  }).mapping();
5787
- _18.label = 1;
5813
+ _16.label = 1;
5788
5814
  case 1:
5789
- _18.trys.push([1, 6, 7, 8]);
5790
- _15 = __values(childFieldGroupConfig.actions), _16 = _15.next();
5791
- _18.label = 2;
5815
+ _16.trys.push([1, 6, 7, 8]);
5816
+ _13 = __values(childFieldGroupConfig.actions), _14 = _13.next();
5817
+ _16.label = 2;
5792
5818
  case 2:
5793
- if (!!_16.done) return [3 /*break*/, 5];
5794
- action = _16.value;
5819
+ if (!!_14.done) return [3 /*break*/, 5];
5820
+ action = _14.value;
5795
5821
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
5796
5822
  if (!conditionSuccess) return [3 /*break*/, 4];
5797
5823
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -5806,19 +5832,19 @@
5806
5832
  }, this.takeActionOnFieldGroup.bind(this));
5807
5833
  return [4 /*yield*/, actions.execute()];
5808
5834
  case 3:
5809
- _18.sent();
5810
- _18.label = 4;
5835
+ _16.sent();
5836
+ _16.label = 4;
5811
5837
  case 4:
5812
- _16 = _15.next();
5838
+ _14 = _13.next();
5813
5839
  return [3 /*break*/, 2];
5814
5840
  case 5: return [3 /*break*/, 8];
5815
5841
  case 6:
5816
- e_4_1 = _18.sent();
5842
+ e_4_1 = _16.sent();
5817
5843
  e_4 = { error: e_4_1 };
5818
5844
  return [3 /*break*/, 8];
5819
5845
  case 7:
5820
5846
  try {
5821
- if (_16 && !_16.done && (_17 = _15.return)) _17.call(_15);
5847
+ if (_14 && !_14.done && (_15 = _13.return)) _15.call(_13);
5822
5848
  }
5823
5849
  finally { if (e_4) throw e_4.error; }
5824
5850
  return [7 /*endfinally*/];
@@ -5829,15 +5855,15 @@
5829
5855
  };
5830
5856
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
5831
5857
  return __awaiter(this, void 0, void 0, function () {
5832
- return __generator(this, function (_15) {
5833
- switch (_15.label) {
5858
+ return __generator(this, function (_13) {
5859
+ switch (_13.label) {
5834
5860
  case 0:
5835
5861
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
5836
5862
  if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5837
5863
  return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
5838
5864
  case 1:
5839
- _15.sent();
5840
- _15.label = 2;
5865
+ _13.sent();
5866
+ _13.label = 2;
5841
5867
  case 2: return [2 /*return*/];
5842
5868
  }
5843
5869
  });
@@ -5845,10 +5871,10 @@
5845
5871
  };
5846
5872
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
5847
5873
  return __awaiter(this, void 0, void 0, function () {
5848
- var rulesMapping, _15, _16, action, conditionSuccess, actions, e_5_1;
5849
- var e_5, _17;
5850
- return __generator(this, function (_18) {
5851
- switch (_18.label) {
5874
+ var rulesMapping, _13, _14, action, conditionSuccess, actions, e_5_1;
5875
+ var e_5, _15;
5876
+ return __generator(this, function (_16) {
5877
+ switch (_16.label) {
5852
5878
  case 0:
5853
5879
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
5854
5880
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
@@ -5860,14 +5886,14 @@
5860
5886
  ALL_FORMS_DATA: this.allFormsData,
5861
5887
  EXTRA_DATA: this.extraData
5862
5888
  }).mapping();
5863
- _18.label = 1;
5889
+ _16.label = 1;
5864
5890
  case 1:
5865
- _18.trys.push([1, 6, 7, 8]);
5866
- _15 = __values(connectedFieldConfig.actions), _16 = _15.next();
5867
- _18.label = 2;
5891
+ _16.trys.push([1, 6, 7, 8]);
5892
+ _13 = __values(connectedFieldConfig.actions), _14 = _13.next();
5893
+ _16.label = 2;
5868
5894
  case 2:
5869
- if (!!_16.done) return [3 /*break*/, 5];
5870
- action = _16.value;
5895
+ if (!!_14.done) return [3 /*break*/, 5];
5896
+ action = _14.value;
5871
5897
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
5872
5898
  if (!conditionSuccess) return [3 /*break*/, 4];
5873
5899
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -5882,19 +5908,19 @@
5882
5908
  }, this.takeAction.bind(this));
5883
5909
  return [4 /*yield*/, actions.execute()];
5884
5910
  case 3:
5885
- _18.sent();
5886
- _18.label = 4;
5911
+ _16.sent();
5912
+ _16.label = 4;
5887
5913
  case 4:
5888
- _16 = _15.next();
5914
+ _14 = _13.next();
5889
5915
  return [3 /*break*/, 2];
5890
5916
  case 5: return [3 /*break*/, 8];
5891
5917
  case 6:
5892
- e_5_1 = _18.sent();
5918
+ e_5_1 = _16.sent();
5893
5919
  e_5 = { error: e_5_1 };
5894
5920
  return [3 /*break*/, 8];
5895
5921
  case 7:
5896
5922
  try {
5897
- if (_16 && !_16.done && (_17 = _15.return)) _17.call(_15);
5923
+ if (_14 && !_14.done && (_15 = _13.return)) _15.call(_13);
5898
5924
  }
5899
5925
  finally { if (e_5) throw e_5.error; }
5900
5926
  return [7 /*endfinally*/];
@@ -5906,16 +5932,16 @@
5906
5932
  KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
5907
5933
  return __awaiter(this, void 0, void 0, function () {
5908
5934
  var connectedField;
5909
- return __generator(this, function (_15) {
5910
- switch (_15.label) {
5935
+ return __generator(this, function (_13) {
5936
+ switch (_13.label) {
5911
5937
  case 0:
5912
5938
  connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig.key);
5913
5939
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
5914
5940
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5915
5941
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
5916
5942
  case 1:
5917
- connectedField = _15.sent();
5918
- _15.label = 2;
5943
+ connectedField = _13.sent();
5944
+ _13.label = 2;
5919
5945
  case 2:
5920
5946
  if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
5921
5947
  if (connectedFieldConfig.handleNestedFields) {
@@ -5930,67 +5956,67 @@
5930
5956
  KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
5931
5957
  return __awaiter(this, void 0, void 0, function () {
5932
5958
  var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_6_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_7_1;
5933
- var e_6, _15, e_7, _16;
5934
- return __generator(this, function (_17) {
5935
- switch (_17.label) {
5959
+ var e_6, _13, e_7, _14;
5960
+ return __generator(this, function (_15) {
5961
+ switch (_15.label) {
5936
5962
  case 0:
5937
5963
  currentField = getFormFieldByKey(this.formFields, e.key);
5938
5964
  if (!(currentField !== undefined)) return [3 /*break*/, 17];
5939
5965
  if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
5940
5966
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
5941
5967
  connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
5942
- _17.label = 1;
5968
+ _15.label = 1;
5943
5969
  case 1:
5944
- _17.trys.push([1, 6, 7, 8]);
5970
+ _15.trys.push([1, 6, 7, 8]);
5945
5971
  connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5946
- _17.label = 2;
5972
+ _15.label = 2;
5947
5973
  case 2:
5948
5974
  if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
5949
5975
  connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
5950
5976
  return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
5951
5977
  case 3:
5952
- _17.sent();
5953
- _17.label = 4;
5978
+ _15.sent();
5979
+ _15.label = 4;
5954
5980
  case 4:
5955
5981
  connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5956
5982
  return [3 /*break*/, 2];
5957
5983
  case 5: return [3 /*break*/, 8];
5958
5984
  case 6:
5959
- e_6_1 = _17.sent();
5985
+ e_6_1 = _15.sent();
5960
5986
  e_6 = { error: e_6_1 };
5961
5987
  return [3 /*break*/, 8];
5962
5988
  case 7:
5963
5989
  try {
5964
- if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_15 = connectedFieldGroups_1.return)) _15.call(connectedFieldGroups_1);
5990
+ if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_13 = connectedFieldGroups_1.return)) _13.call(connectedFieldGroups_1);
5965
5991
  }
5966
5992
  finally { if (e_6) throw e_6.error; }
5967
5993
  return [7 /*endfinally*/];
5968
5994
  case 8:
5969
5995
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
5970
5996
  connectedFields = currentField.connectedElements.connectedFields;
5971
- _17.label = 9;
5997
+ _15.label = 9;
5972
5998
  case 9:
5973
- _17.trys.push([9, 14, 15, 16]);
5999
+ _15.trys.push([9, 14, 15, 16]);
5974
6000
  connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
5975
- _17.label = 10;
6001
+ _15.label = 10;
5976
6002
  case 10:
5977
6003
  if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
5978
6004
  connectedFieldConfig = connectedFields_1_1.value;
5979
6005
  return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
5980
6006
  case 11:
5981
- currentField = _17.sent();
5982
- _17.label = 12;
6007
+ currentField = _15.sent();
6008
+ _15.label = 12;
5983
6009
  case 12:
5984
6010
  connectedFields_1_1 = connectedFields_1.next();
5985
6011
  return [3 /*break*/, 10];
5986
6012
  case 13: return [3 /*break*/, 16];
5987
6013
  case 14:
5988
- e_7_1 = _17.sent();
6014
+ e_7_1 = _15.sent();
5989
6015
  e_7 = { error: e_7_1 };
5990
6016
  return [3 /*break*/, 16];
5991
6017
  case 15:
5992
6018
  try {
5993
- if (connectedFields_1_1 && !connectedFields_1_1.done && (_16 = connectedFields_1.return)) _16.call(connectedFields_1);
6019
+ if (connectedFields_1_1 && !connectedFields_1_1.done && (_14 = connectedFields_1.return)) _14.call(connectedFields_1);
5994
6020
  }
5995
6021
  finally { if (e_7) throw e_7.error; }
5996
6022
  return [7 /*endfinally*/];
@@ -6002,15 +6028,15 @@
6002
6028
  });
6003
6029
  };
6004
6030
  KwikIDFormViewComponent.prototype.handleRemovedFile = function (e) {
6005
- var _15;
6031
+ var _13;
6006
6032
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
6007
6033
  this.showApiLoader();
6008
6034
  if (this.formGroup.controls[e.key].enabled) {
6009
6035
  this.files[e.key] = e.files;
6010
6036
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
6011
- this.formGroup.patchValue((_15 = {},
6012
- _15[e.key] = this.formData[e.key],
6013
- _15), { emitEvent: false });
6037
+ this.formGroup.patchValue((_13 = {},
6038
+ _13[e.key] = this.formData[e.key],
6039
+ _13), { emitEvent: false });
6014
6040
  }
6015
6041
  this.triggerLogs(ELogEventType$1.FORM__FIELD_FILE_REMOVE, Object.assign(Object.assign(Object.assign({ field_key: e.key }, ((_b = (_a = e.file) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : { file_name: (_c = e.file) === null || _c === void 0 ? void 0 : _c.name })), ((_e = (_d = e.file) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : { file_size: (_f = e.file) === null || _f === void 0 ? void 0 : _f.size })), ((_h = (_g = e.file) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : { file_type: (_j = e.file) === null || _j === void 0 ? void 0 : _j.type })));
6016
6042
  this.hideApiLoader();
@@ -6029,9 +6055,9 @@
6029
6055
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
6030
6056
  return __awaiter(this, void 0, void 0, function () {
6031
6057
  var field, values, values_1, values_1_1, value, e_8_1, _loop_2, this_2, values_2, values_2_1, value, e_9_1;
6032
- var e_8, _15, e_9, _16;
6033
- return __generator(this, function (_17) {
6034
- switch (_17.label) {
6058
+ var e_8, _13, e_9, _14;
6059
+ return __generator(this, function (_15) {
6060
+ switch (_15.label) {
6035
6061
  case 0:
6036
6062
  this.showApiLoader();
6037
6063
  field = getFormFieldByKey(this.formFields, e.key);
@@ -6039,42 +6065,42 @@
6039
6065
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
6040
6066
  kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
6041
6067
  field.properties.uploadFileToServer)) return [3 /*break*/, 9];
6042
- _17.label = 1;
6068
+ _15.label = 1;
6043
6069
  case 1:
6044
- _17.trys.push([1, 6, 7, 8]);
6070
+ _15.trys.push([1, 6, 7, 8]);
6045
6071
  values_1 = __values(values), values_1_1 = values_1.next();
6046
- _17.label = 2;
6072
+ _15.label = 2;
6047
6073
  case 2:
6048
6074
  if (!!values_1_1.done) return [3 /*break*/, 5];
6049
6075
  value = values_1_1.value;
6050
6076
  return [4 /*yield*/, this.uploadFile(field, value)];
6051
6077
  case 3:
6052
- _17.sent();
6053
- _17.label = 4;
6078
+ _15.sent();
6079
+ _15.label = 4;
6054
6080
  case 4:
6055
6081
  values_1_1 = values_1.next();
6056
6082
  return [3 /*break*/, 2];
6057
6083
  case 5: return [3 /*break*/, 8];
6058
6084
  case 6:
6059
- e_8_1 = _17.sent();
6085
+ e_8_1 = _15.sent();
6060
6086
  e_8 = { error: e_8_1 };
6061
6087
  return [3 /*break*/, 8];
6062
6088
  case 7:
6063
6089
  try {
6064
- if (values_1_1 && !values_1_1.done && (_15 = values_1.return)) _15.call(values_1);
6090
+ if (values_1_1 && !values_1_1.done && (_13 = values_1.return)) _13.call(values_1);
6065
6091
  }
6066
6092
  finally { if (e_8) throw e_8.error; }
6067
6093
  return [7 /*endfinally*/];
6068
6094
  case 8: return [3 /*break*/, 18];
6069
6095
  case 9:
6070
6096
  _loop_2 = function (value) {
6071
- var updatedFile, _18;
6072
- return __generator(this, function (_19) {
6073
- switch (_19.label) {
6097
+ var updatedFile, _16;
6098
+ return __generator(this, function (_17) {
6099
+ switch (_17.label) {
6074
6100
  case 0:
6075
6101
  this_2.updateFiles(value, "LOADING", e.key);
6076
6102
  this_2.triggerLogs(ELogEventType$1.FORM__FIELD_FILE_ADD, Object.assign(Object.assign(Object.assign({ field_key: e.key }, ((_b = (_a = e.file) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : { file_name: (_c = e.file) === null || _c === void 0 ? void 0 : _c.name })), ((_e = (_d = e.file) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : { file_size: (_f = e.file) === null || _f === void 0 ? void 0 : _f.size })), ((_h = (_g = e.file) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : { file_type: (_j = e.file) === null || _j === void 0 ? void 0 : _j.type })));
6077
- _18 = kwikidToolkit.getObjectDeepCopy;
6103
+ _16 = kwikidToolkit.getObjectDeepCopy;
6078
6104
  return [4 /*yield*/, new Promise(function (resolve) {
6079
6105
  setTimeout(function () {
6080
6106
  resolve({
@@ -6088,42 +6114,42 @@
6088
6114
  }, FORM_VIEW_TIMERS.WAIT_FOR_FILE_METADATA_DEEPCOPY); // 1000 ms = 1 sec
6089
6115
  })];
6090
6116
  case 1:
6091
- updatedFile = _18.apply(void 0, [_19.sent()]);
6117
+ updatedFile = _16.apply(void 0, [_17.sent()]);
6092
6118
  this_2.updateFiles(updatedFile, "NORMAL", e.key);
6093
6119
  return [2 /*return*/];
6094
6120
  }
6095
6121
  });
6096
6122
  };
6097
6123
  this_2 = this;
6098
- _17.label = 10;
6124
+ _15.label = 10;
6099
6125
  case 10:
6100
- _17.trys.push([10, 15, 16, 17]);
6126
+ _15.trys.push([10, 15, 16, 17]);
6101
6127
  values_2 = __values(values), values_2_1 = values_2.next();
6102
- _17.label = 11;
6128
+ _15.label = 11;
6103
6129
  case 11:
6104
6130
  if (!!values_2_1.done) return [3 /*break*/, 14];
6105
6131
  value = values_2_1.value;
6106
6132
  return [5 /*yield**/, _loop_2(value)];
6107
6133
  case 12:
6108
- _17.sent();
6109
- _17.label = 13;
6134
+ _15.sent();
6135
+ _15.label = 13;
6110
6136
  case 13:
6111
6137
  values_2_1 = values_2.next();
6112
6138
  return [3 /*break*/, 11];
6113
6139
  case 14: return [3 /*break*/, 17];
6114
6140
  case 15:
6115
- e_9_1 = _17.sent();
6141
+ e_9_1 = _15.sent();
6116
6142
  e_9 = { error: e_9_1 };
6117
6143
  return [3 /*break*/, 17];
6118
6144
  case 16:
6119
6145
  try {
6120
- if (values_2_1 && !values_2_1.done && (_16 = values_2.return)) _16.call(values_2);
6146
+ if (values_2_1 && !values_2_1.done && (_14 = values_2.return)) _14.call(values_2);
6121
6147
  }
6122
6148
  finally { if (e_9) throw e_9.error; }
6123
6149
  return [7 /*endfinally*/];
6124
6150
  case 17:
6125
6151
  this.hideApiLoader();
6126
- _17.label = 18;
6152
+ _15.label = 18;
6127
6153
  case 18: return [2 /*return*/];
6128
6154
  }
6129
6155
  });
@@ -6131,7 +6157,7 @@
6131
6157
  };
6132
6158
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
6133
6159
  KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
6134
- var _15;
6160
+ var _13;
6135
6161
  var _this = this;
6136
6162
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
6137
6163
  if (this.formGroup.controls[e.key].enabled) {
@@ -6141,9 +6167,9 @@
6141
6167
  this.mediaFiles[e.key] = e.mediaFiles;
6142
6168
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
6143
6169
  this.cameraData[e.key] = convertFormFieldValueToStandardFormat(field_3, this.formData[e.key]);
6144
- this.formGroup.patchValue((_15 = {},
6145
- _15[e.key] = this.formData[e.key],
6146
- _15), { emitEvent: false });
6170
+ this.formGroup.patchValue((_13 = {},
6171
+ _13[e.key] = this.formData[e.key],
6172
+ _13), { emitEvent: false });
6147
6173
  this.triggerLogs(ELogEventType$1.FORM__FIELD_MEDIA_FILE_REMOVE, Object.assign(Object.assign(Object.assign({ field_key: e.key }, ((_b = (_a = e.file) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : { file_name: (_c = e.file) === null || _c === void 0 ? void 0 : _c.name })), ((_e = (_d = e.file) === null || _d === void 0 ? void 0 : _d.size) !== null && _e !== void 0 ? _e : { file_size: (_f = e.file) === null || _f === void 0 ? void 0 : _f.size })), ((_h = (_g = e.file) === null || _g === void 0 ? void 0 : _g.type) !== null && _h !== void 0 ? _h : { file_type: (_j = e.file) === null || _j === void 0 ? void 0 : _j.type })));
6148
6174
  this.getUnsavedDataState.emit(true);
6149
6175
  if (field_3.isFormElement &&
@@ -6160,11 +6186,11 @@
6160
6186
  EXTRA_DATA: this.extraData
6161
6187
  }, this.takeAction.bind(this));
6162
6188
  (function () { return __awaiter(_this, void 0, void 0, function () {
6163
- return __generator(this, function (_15) {
6164
- switch (_15.label) {
6189
+ return __generator(this, function (_13) {
6190
+ switch (_13.label) {
6165
6191
  case 0: return [4 /*yield*/, ruleEngine_5.run(field_3.validation)];
6166
6192
  case 1:
6167
- _15.sent();
6193
+ _13.sent();
6168
6194
  return [2 /*return*/];
6169
6195
  }
6170
6196
  });
@@ -6185,9 +6211,9 @@
6185
6211
  KwikIDFormViewComponent.prototype.handleOnClickInputCamera = function (e, field) {
6186
6212
  var _a, _b, _c, _d, _e, _f;
6187
6213
  return __awaiter(this, void 0, void 0, function () {
6188
- var fieldKey, fieldCameraConfig, _15, cameraHelper, _16, _17;
6189
- return __generator(this, function (_18) {
6190
- switch (_18.label) {
6214
+ var fieldKey, fieldCameraConfig, _13, cameraHelper, _14, _15;
6215
+ return __generator(this, function (_16) {
6216
+ switch (_16.label) {
6191
6217
  case 0:
6192
6218
  this.loaderService.show({
6193
6219
  loaderText: "Loading Camera...",
@@ -6202,8 +6228,8 @@
6202
6228
  field_type: field.type,
6203
6229
  camera_type: this.activeCameraType
6204
6230
  });
6205
- _15 = this.activeCameraType;
6206
- switch (_15) {
6231
+ _13 = this.activeCameraType;
6232
+ switch (_13) {
6207
6233
  case "CAPTURE": return [3 /*break*/, 1];
6208
6234
  case "RECORD": return [3 /*break*/, 4];
6209
6235
  }
@@ -6226,13 +6252,13 @@
6226
6252
  ALL_FORMS_DATA: this.allFormsData,
6227
6253
  EXTRA_DATA: this.extraData
6228
6254
  });
6229
- _16 = this;
6230
- _17 = {};
6255
+ _14 = this;
6256
+ _15 = {};
6231
6257
  return [4 /*yield*/, cameraHelper.getCameraWatermarkData()];
6232
6258
  case 2:
6233
- _16.activeCameraData = (_17.watermark = _18.sent(),
6234
- _17);
6235
- _18.label = 3;
6259
+ _14.activeCameraData = (_15.watermark = _16.sent(),
6260
+ _15);
6261
+ _16.label = 3;
6236
6262
  case 3: return [3 /*break*/, 6];
6237
6263
  case 4:
6238
6264
  this.activeCameraConfig = kwikidToolkit.mergeObjectsDeep([
@@ -6259,10 +6285,10 @@
6259
6285
  KwikIDFormViewComponent.prototype.setCameraMedia = function (media) {
6260
6286
  return __awaiter(this, void 0, void 0, function () {
6261
6287
  var field, activeCameraData, updatedMedia, ruleEngine_6;
6262
- var _15;
6288
+ var _13;
6263
6289
  var _this = this;
6264
- return __generator(this, function (_16) {
6265
- switch (_16.label) {
6290
+ return __generator(this, function (_14) {
6291
+ switch (_14.label) {
6266
6292
  case 0:
6267
6293
  field = getFormFieldByKey(this.formFields, this.activeCameraFieldKey);
6268
6294
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
@@ -6270,7 +6296,7 @@
6270
6296
  field.properties.uploadFileToServer)) return [3 /*break*/, 2];
6271
6297
  return [4 /*yield*/, this.uploadFile(field, media)];
6272
6298
  case 1:
6273
- _16.sent();
6299
+ _14.sent();
6274
6300
  return [3 /*break*/, 3];
6275
6301
  case 2:
6276
6302
  activeCameraData = this.activeCameraData;
@@ -6293,9 +6319,9 @@
6293
6319
  emitEvent: false,
6294
6320
  onlySelf: false
6295
6321
  });
6296
- this.formGroup.patchValue((_15 = {},
6297
- _15[field.key] = kwikidToolkit.getObjectDeepCopy([updatedMedia]),
6298
- _15), { emitEvent: false });
6322
+ this.formGroup.patchValue((_13 = {},
6323
+ _13[field.key] = kwikidToolkit.getObjectDeepCopy([updatedMedia]),
6324
+ _13), { emitEvent: false });
6299
6325
  this.formGroup.controls[field.key].updateValueAndValidity({
6300
6326
  emitEvent: false
6301
6327
  });
@@ -6317,11 +6343,11 @@
6317
6343
  EXTRA_DATA: this.extraData
6318
6344
  }, this.takeAction.bind(this));
6319
6345
  (function () { return __awaiter(_this, void 0, void 0, function () {
6320
- return __generator(this, function (_15) {
6321
- switch (_15.label) {
6346
+ return __generator(this, function (_13) {
6347
+ switch (_13.label) {
6322
6348
  case 0: return [4 /*yield*/, ruleEngine_6.run(field.validation)];
6323
6349
  case 1:
6324
- _15.sent();
6350
+ _13.sent();
6325
6351
  return [2 /*return*/];
6326
6352
  }
6327
6353
  });
@@ -6338,7 +6364,7 @@
6338
6364
  field_key: field.key,
6339
6365
  field_type: field.type
6340
6366
  });
6341
- _16.label = 3;
6367
+ _14.label = 3;
6342
6368
  case 3: return [2 /*return*/];
6343
6369
  }
6344
6370
  });
@@ -6471,7 +6497,7 @@
6471
6497
  * This method is used to update the files array with the new file and it's state and response from the api of uploading the file.
6472
6498
  */
6473
6499
  KwikIDFormViewComponent.prototype.updateFiles = function (file, state, key) {
6474
- var _15;
6500
+ var _13;
6475
6501
  var _this = this;
6476
6502
  var _a;
6477
6503
  var fileWithState = kwikidToolkit.mergeObjects(file, { state: state });
@@ -6499,9 +6525,9 @@
6499
6525
  emitEvent: false,
6500
6526
  onlySelf: false
6501
6527
  });
6502
- this.formGroup.patchValue((_15 = {},
6503
- _15[key] = normalFiles,
6504
- _15), { emitEvent: false });
6528
+ this.formGroup.patchValue((_13 = {},
6529
+ _13[key] = normalFiles,
6530
+ _13), { emitEvent: false });
6505
6531
  this.getUnsavedDataState.emit(true);
6506
6532
  if (field.isFormElement &&
6507
6533
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -6517,11 +6543,11 @@
6517
6543
  EXTRA_DATA: this.extraData
6518
6544
  }, this.takeAction.bind(this));
6519
6545
  (function () { return __awaiter(_this, void 0, void 0, function () {
6520
- return __generator(this, function (_15) {
6521
- switch (_15.label) {
6546
+ return __generator(this, function (_13) {
6547
+ switch (_13.label) {
6522
6548
  case 0: return [4 /*yield*/, ruleEngine_7.run(field.validation)];
6523
6549
  case 1:
6524
- _15.sent();
6550
+ _13.sent();
6525
6551
  return [2 /*return*/];
6526
6552
  }
6527
6553
  });
@@ -6539,15 +6565,15 @@
6539
6565
  * This is a api upload mocking method. Set's to loading at first at point when API is called and then changes the status to random status after 2 seconds of delay showing a mocked response from API.
6540
6566
  */
6541
6567
  KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
6542
- var _a, _b, _c, _d, _e, _f;
6568
+ var _a, _b, _c, _d, _e, _f, _g, _h;
6543
6569
  return __awaiter(this, void 0, void 0, function () {
6544
- var _15, ocrPayload, facematchPayload, facematchSources, facematchSources_1, facematchSources_1_1, facematchSourceConfig, source, sourceValue, facematchSource, e_10_1, watermarkPayload, watermarkSources, watermarkSources_1, watermarkSources_1_1, watermarkSourceConfig, source, sourceValue, watermarkSource, e_11_1, imageUploadPayload;
6545
- var e_10, _16, e_11, _17;
6546
- return __generator(this, function (_18) {
6547
- switch (_18.label) {
6570
+ var _13, ocrPayload, facematchPayload, facematchSources, facematchSources_1, facematchSources_1_1, facematchSourceConfig, source, sourceValue, facematchSource, e_10_1, watermarkPayload, watermarkSources, watermarkSources_1, watermarkSources_1_1, watermarkSourceConfig, source, sourceValue, watermarkSource, e_11_1, livelinessPayload, imageUploadPayload;
6571
+ var e_10, _14, e_11, _15;
6572
+ return __generator(this, function (_16) {
6573
+ switch (_16.label) {
6548
6574
  case 0:
6549
- _15 = field.type;
6550
- switch (_15) {
6575
+ _13 = field.type;
6576
+ switch (_13) {
6551
6577
  case EFieldType.FILE: return [3 /*break*/, 1];
6552
6578
  case EFieldType.CAPTURE: return [3 /*break*/, 2];
6553
6579
  case EFieldType.RECORD: return [3 /*break*/, 19];
@@ -6600,11 +6626,11 @@
6600
6626
  field.properties.features.facematch.isFacematchFromServer;
6601
6627
  facematchPayload.images = [];
6602
6628
  facematchSources = field.properties.features.facematch.sources;
6603
- _18.label = 3;
6629
+ _16.label = 3;
6604
6630
  case 3:
6605
- _18.trys.push([3, 8, 9, 10]);
6631
+ _16.trys.push([3, 8, 9, 10]);
6606
6632
  facematchSources_1 = __values(facematchSources), facematchSources_1_1 = facematchSources_1.next();
6607
- _18.label = 4;
6633
+ _16.label = 4;
6608
6634
  case 4:
6609
6635
  if (!!facematchSources_1_1.done) return [3 /*break*/, 7];
6610
6636
  facematchSourceConfig = facematchSources_1_1.value;
@@ -6620,24 +6646,24 @@
6620
6646
  });
6621
6647
  return [4 /*yield*/, source.getValueFromSource(facematchSourceConfig)];
6622
6648
  case 5:
6623
- sourceValue = _18.sent();
6649
+ sourceValue = _16.sent();
6624
6650
  facematchSource = {
6625
6651
  key: facematchSourceConfig.id,
6626
6652
  value: sourceValue
6627
6653
  };
6628
6654
  facematchPayload.images.push(facematchSource);
6629
- _18.label = 6;
6655
+ _16.label = 6;
6630
6656
  case 6:
6631
6657
  facematchSources_1_1 = facematchSources_1.next();
6632
6658
  return [3 /*break*/, 4];
6633
6659
  case 7: return [3 /*break*/, 10];
6634
6660
  case 8:
6635
- e_10_1 = _18.sent();
6661
+ e_10_1 = _16.sent();
6636
6662
  e_10 = { error: e_10_1 };
6637
6663
  return [3 /*break*/, 10];
6638
6664
  case 9:
6639
6665
  try {
6640
- if (facematchSources_1_1 && !facematchSources_1_1.done && (_16 = facematchSources_1.return)) _16.call(facematchSources_1);
6666
+ if (facematchSources_1_1 && !facematchSources_1_1.done && (_14 = facematchSources_1.return)) _14.call(facematchSources_1);
6641
6667
  }
6642
6668
  finally { if (e_10) throw e_10.error; }
6643
6669
  return [7 /*endfinally*/];
@@ -6651,11 +6677,11 @@
6651
6677
  watermarkPayload.data = [];
6652
6678
  watermarkSources = field.properties.features.watermark.sources;
6653
6679
  watermarkPayload.config = field.properties.features.watermark.sources;
6654
- _18.label = 11;
6680
+ _16.label = 11;
6655
6681
  case 11:
6656
- _18.trys.push([11, 16, 17, 18]);
6682
+ _16.trys.push([11, 16, 17, 18]);
6657
6683
  watermarkSources_1 = __values(watermarkSources), watermarkSources_1_1 = watermarkSources_1.next();
6658
- _18.label = 12;
6684
+ _16.label = 12;
6659
6685
  case 12:
6660
6686
  if (!!watermarkSources_1_1.done) return [3 /*break*/, 15];
6661
6687
  watermarkSourceConfig = watermarkSources_1_1.value;
@@ -6671,34 +6697,40 @@
6671
6697
  });
6672
6698
  return [4 /*yield*/, source.getValueFromSource(watermarkSourceConfig)];
6673
6699
  case 13:
6674
- sourceValue = _18.sent();
6700
+ sourceValue = _16.sent();
6675
6701
  watermarkSource = {
6676
6702
  key: watermarkSourceConfig.id,
6677
6703
  value: sourceValue
6678
6704
  };
6679
6705
  watermarkPayload.data.push(watermarkSource);
6680
- _18.label = 14;
6706
+ _16.label = 14;
6681
6707
  case 14:
6682
6708
  watermarkSources_1_1 = watermarkSources_1.next();
6683
6709
  return [3 /*break*/, 12];
6684
6710
  case 15: return [3 /*break*/, 18];
6685
6711
  case 16:
6686
- e_11_1 = _18.sent();
6712
+ e_11_1 = _16.sent();
6687
6713
  e_11 = { error: e_11_1 };
6688
6714
  return [3 /*break*/, 18];
6689
6715
  case 17:
6690
6716
  try {
6691
- if (watermarkSources_1_1 && !watermarkSources_1_1.done && (_17 = watermarkSources_1.return)) _17.call(watermarkSources_1);
6717
+ if (watermarkSources_1_1 && !watermarkSources_1_1.done && (_15 = watermarkSources_1.return)) _15.call(watermarkSources_1);
6692
6718
  }
6693
6719
  finally { if (e_11) throw e_11.error; }
6694
6720
  return [7 /*endfinally*/];
6695
6721
  case 18:
6696
- imageUploadPayload = Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
6722
+ livelinessPayload = {};
6723
+ if (kwikidToolkit.isNotEmptyValue((_h = (_g = field === null || field === void 0 ? void 0 : field.properties) === null || _g === void 0 ? void 0 : _g.features) === null || _h === void 0 ? void 0 : _h.liveliness)) {
6724
+ livelinessPayload = field.properties.features.liveliness;
6725
+ }
6726
+ imageUploadPayload = Object.assign(Object.assign(Object.assign(Object.assign({ image: file }, ((ocrPayload === null || ocrPayload === void 0 ? void 0 : ocrPayload.isEnabled) && {
6697
6727
  ocr: ocrPayload
6698
6728
  })), ((facematchPayload === null || facematchPayload === void 0 ? void 0 : facematchPayload.isEnabled) && {
6699
6729
  facematch: facematchPayload
6700
6730
  })), ((watermarkPayload === null || watermarkPayload === void 0 ? void 0 : watermarkPayload.isEnabled) && {
6701
6731
  watermark: watermarkPayload
6732
+ })), ((livelinessPayload === null || livelinessPayload === void 0 ? void 0 : livelinessPayload.isEnabled) && {
6733
+ liveliness: livelinessPayload
6702
6734
  }));
6703
6735
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_UPLOAD_IMAGE, {
6704
6736
  field_key: field.key,
@@ -6745,11 +6777,11 @@
6745
6777
  });
6746
6778
  };
6747
6779
  KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
6748
- var e_12, _15;
6780
+ var e_12, _13;
6749
6781
  var formData = this.formGroup.getRawValue();
6750
6782
  try {
6751
- for (var _16 = __values(this.formFields), _17 = _16.next(); !_17.done; _17 = _16.next()) {
6752
- var field_4 = _17.value;
6783
+ for (var _14 = __values(this.formFields), _15 = _14.next(); !_15.done; _15 = _14.next()) {
6784
+ var field_4 = _15.value;
6753
6785
  if (field_4.isFormElement) {
6754
6786
  if (field_4.hidden) {
6755
6787
  delete formData[field_4.key];
@@ -6763,22 +6795,22 @@
6763
6795
  catch (e_12_1) { e_12 = { error: e_12_1 }; }
6764
6796
  finally {
6765
6797
  try {
6766
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
6798
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
6767
6799
  }
6768
6800
  finally { if (e_12) throw e_12.error; }
6769
6801
  }
6770
6802
  var extendedFormData = this.formFields.reduce(function (result, field, index) {
6771
- var _15;
6803
+ var _13;
6772
6804
  if (field.isFormElement && !field.hidden) {
6773
- var fieldData = (_15 = {},
6774
- _15[field.key] = {
6805
+ var fieldData = (_13 = {},
6806
+ _13[field.key] = {
6775
6807
  key: field.key,
6776
6808
  label: field.label,
6777
6809
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
6778
6810
  type: field.type,
6779
6811
  index: index
6780
6812
  },
6781
- _15);
6813
+ _13);
6782
6814
  result[field.key] = fieldData[field.key];
6783
6815
  }
6784
6816
  return result;
@@ -6834,10 +6866,10 @@
6834
6866
  KwikIDFormViewComponent.prototype.handleOnClickLiveLocation = function (e) {
6835
6867
  return __awaiter(this, void 0, void 0, function () {
6836
6868
  var field, ruleEngine_8;
6837
- var _15;
6869
+ var _13;
6838
6870
  var _this = this;
6839
- return __generator(this, function (_16) {
6840
- switch (_16.label) {
6871
+ return __generator(this, function (_14) {
6872
+ switch (_14.label) {
6841
6873
  case 0:
6842
6874
  field = getFormFieldByKey(this.formFields, e.key);
6843
6875
  this.triggerLogs(ELogEventType$1.FORM__LIVE_LOCATION_BUTTON_CLICK, {
@@ -6848,9 +6880,9 @@
6848
6880
  field.api.status.value = EApiStatusType.LOADING;
6849
6881
  field.showLoader = true;
6850
6882
  this.showApiLoader();
6851
- this.formGroup.patchValue((_15 = {},
6852
- _15[e.key] = e.value,
6853
- _15), { emitEvent: false });
6883
+ this.formGroup.patchValue((_13 = {},
6884
+ _13[e.key] = e.value,
6885
+ _13), { emitEvent: false });
6854
6886
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
6855
6887
  this.getUnsavedDataState.emit(true);
6856
6888
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
@@ -6868,7 +6900,7 @@
6868
6900
  }, FORM_VIEW_TIMERS.TIMER_300); // 1000 ms = 1 sec
6869
6901
  })];
6870
6902
  case 2:
6871
- _16.sent();
6903
+ _14.sent();
6872
6904
  // set button status to success
6873
6905
  field.api.status.value = EApiStatusType.SUCCESS;
6874
6906
  field.showLoader = false;
@@ -6886,11 +6918,11 @@
6886
6918
  EXTRA_DATA: this.extraData
6887
6919
  }, this.takeAction.bind(this));
6888
6920
  (function () { return __awaiter(_this, void 0, void 0, function () {
6889
- return __generator(this, function (_15) {
6890
- switch (_15.label) {
6921
+ return __generator(this, function (_13) {
6922
+ switch (_13.label) {
6891
6923
  case 0: return [4 /*yield*/, ruleEngine_8.run(field.validation)];
6892
6924
  case 1:
6893
- _15.sent();
6925
+ _13.sent();
6894
6926
  return [2 /*return*/];
6895
6927
  }
6896
6928
  });
@@ -6904,7 +6936,7 @@
6904
6936
  }, "ON_CHANGE");
6905
6937
  }
6906
6938
  this.hideApiLoader();
6907
- _16.label = 3;
6939
+ _14.label = 3;
6908
6940
  case 3: return [2 /*return*/];
6909
6941
  }
6910
6942
  });
@@ -6912,11 +6944,11 @@
6912
6944
  };
6913
6945
  // DOM Event Handlers
6914
6946
  KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
6915
- var _15;
6947
+ var _13;
6916
6948
  var _this = this;
6917
- this.formGroup.patchValue((_15 = {},
6918
- _15[e.key] = e.value,
6919
- _15), { emitEvent: false });
6949
+ this.formGroup.patchValue((_13 = {},
6950
+ _13[e.key] = e.value,
6951
+ _13), { emitEvent: false });
6920
6952
  var field = getFormFieldByKey(this.formFields, e.key);
6921
6953
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
6922
6954
  this.getUnsavedDataState.emit(true);
@@ -6934,11 +6966,11 @@
6934
6966
  EXTRA_DATA: this.extraData
6935
6967
  }, this.takeAction.bind(this));
6936
6968
  (function () { return __awaiter(_this, void 0, void 0, function () {
6937
- return __generator(this, function (_15) {
6938
- switch (_15.label) {
6969
+ return __generator(this, function (_13) {
6970
+ switch (_13.label) {
6939
6971
  case 0: return [4 /*yield*/, ruleEngine_9.run(field.validation)];
6940
6972
  case 1:
6941
- _15.sent();
6973
+ _13.sent();
6942
6974
  return [2 /*return*/];
6943
6975
  }
6944
6976
  });
@@ -6957,33 +6989,33 @@
6957
6989
  return __awaiter(this, void 0, void 0, function () {
6958
6990
  var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
6959
6991
  var _this = this;
6960
- return __generator(this, function (_15) {
6992
+ return __generator(this, function (_13) {
6961
6993
  this.triggerLogs(ELogEventType$1.FORM__FIELD_RESET_BUTTON_CLICK, {
6962
6994
  field_key: field.key
6963
6995
  });
6964
6996
  resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
6965
- var _15, _16, f, _17, _18, action, resetField, actions, e_13_1, e_14_1, _19, _20, fg, _21, _22, action, _23, _24, fieldKey, resetField, actions, e_15_1, e_16_1, e_17_1;
6966
- var e_14, _25, e_13, _26, e_17, _27, e_16, _28, e_15, _29;
6967
- return __generator(this, function (_30) {
6968
- switch (_30.label) {
6997
+ var _13, _14, f, _15, _16, action, resetField, actions, e_13_1, e_14_1, _17, _18, fg, _19, _20, action, _21, _22, fieldKey, resetField, actions, e_15_1, e_16_1, e_17_1;
6998
+ var e_14, _23, e_13, _24, e_17, _25, e_16, _26, e_15, _27;
6999
+ return __generator(this, function (_28) {
7000
+ switch (_28.label) {
6969
7001
  case 0:
6970
7002
  if (!kwikidToolkit.checkObjectPathExists(field, "reset.fields")) return [3 /*break*/, 14];
6971
- _30.label = 1;
7003
+ _28.label = 1;
6972
7004
  case 1:
6973
- _30.trys.push([1, 12, 13, 14]);
6974
- _15 = __values(field.reset.fields), _16 = _15.next();
6975
- _30.label = 2;
7005
+ _28.trys.push([1, 12, 13, 14]);
7006
+ _13 = __values(field.reset.fields), _14 = _13.next();
7007
+ _28.label = 2;
6976
7008
  case 2:
6977
- if (!!_16.done) return [3 /*break*/, 11];
6978
- f = _16.value;
6979
- _30.label = 3;
7009
+ if (!!_14.done) return [3 /*break*/, 11];
7010
+ f = _14.value;
7011
+ _28.label = 3;
6980
7012
  case 3:
6981
- _30.trys.push([3, 8, 9, 10]);
6982
- _17 = (e_13 = void 0, __values(f.actions)), _18 = _17.next();
6983
- _30.label = 4;
7013
+ _28.trys.push([3, 8, 9, 10]);
7014
+ _15 = (e_13 = void 0, __values(f.actions)), _16 = _15.next();
7015
+ _28.label = 4;
6984
7016
  case 4:
6985
- if (!!_18.done) return [3 /*break*/, 7];
6986
- action = _18.value;
7017
+ if (!!_16.done) return [3 /*break*/, 7];
7018
+ action = _16.value;
6987
7019
  resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
6988
7020
  actions = new kwikidToolkit.Action(action, {}, {
6989
7021
  FIELD_CONFIG: resetField,
@@ -6997,62 +7029,62 @@
6997
7029
  }, this.takeAction.bind(this));
6998
7030
  return [4 /*yield*/, actions.execute()];
6999
7031
  case 5:
7000
- _30.sent();
7001
- _30.label = 6;
7032
+ _28.sent();
7033
+ _28.label = 6;
7002
7034
  case 6:
7003
- _18 = _17.next();
7035
+ _16 = _15.next();
7004
7036
  return [3 /*break*/, 4];
7005
7037
  case 7: return [3 /*break*/, 10];
7006
7038
  case 8:
7007
- e_13_1 = _30.sent();
7039
+ e_13_1 = _28.sent();
7008
7040
  e_13 = { error: e_13_1 };
7009
7041
  return [3 /*break*/, 10];
7010
7042
  case 9:
7011
7043
  try {
7012
- if (_18 && !_18.done && (_26 = _17.return)) _26.call(_17);
7044
+ if (_16 && !_16.done && (_24 = _15.return)) _24.call(_15);
7013
7045
  }
7014
7046
  finally { if (e_13) throw e_13.error; }
7015
7047
  return [7 /*endfinally*/];
7016
7048
  case 10:
7017
- _16 = _15.next();
7049
+ _14 = _13.next();
7018
7050
  return [3 /*break*/, 2];
7019
7051
  case 11: return [3 /*break*/, 14];
7020
7052
  case 12:
7021
- e_14_1 = _30.sent();
7053
+ e_14_1 = _28.sent();
7022
7054
  e_14 = { error: e_14_1 };
7023
7055
  return [3 /*break*/, 14];
7024
7056
  case 13:
7025
7057
  try {
7026
- if (_16 && !_16.done && (_25 = _15.return)) _25.call(_15);
7058
+ if (_14 && !_14.done && (_23 = _13.return)) _23.call(_13);
7027
7059
  }
7028
7060
  finally { if (e_14) throw e_14.error; }
7029
7061
  return [7 /*endfinally*/];
7030
7062
  case 14:
7031
7063
  if (!kwikidToolkit.checkObjectPathExists(field, "reset.fieldGroups")) return [3 /*break*/, 34];
7032
- _30.label = 15;
7064
+ _28.label = 15;
7033
7065
  case 15:
7034
- _30.trys.push([15, 32, 33, 34]);
7035
- _19 = __values(field.reset.fieldGroups), _20 = _19.next();
7036
- _30.label = 16;
7066
+ _28.trys.push([15, 32, 33, 34]);
7067
+ _17 = __values(field.reset.fieldGroups), _18 = _17.next();
7068
+ _28.label = 16;
7037
7069
  case 16:
7038
- if (!!_20.done) return [3 /*break*/, 31];
7039
- fg = _20.value;
7040
- _30.label = 17;
7070
+ if (!!_18.done) return [3 /*break*/, 31];
7071
+ fg = _18.value;
7072
+ _28.label = 17;
7041
7073
  case 17:
7042
- _30.trys.push([17, 28, 29, 30]);
7043
- _21 = (e_16 = void 0, __values(fg.actions)), _22 = _21.next();
7044
- _30.label = 18;
7074
+ _28.trys.push([17, 28, 29, 30]);
7075
+ _19 = (e_16 = void 0, __values(fg.actions)), _20 = _19.next();
7076
+ _28.label = 18;
7045
7077
  case 18:
7046
- if (!!_22.done) return [3 /*break*/, 27];
7047
- action = _22.value;
7048
- _30.label = 19;
7078
+ if (!!_20.done) return [3 /*break*/, 27];
7079
+ action = _20.value;
7080
+ _28.label = 19;
7049
7081
  case 19:
7050
- _30.trys.push([19, 24, 25, 26]);
7051
- _23 = (e_15 = void 0, __values(this.fieldGroups[fg.groupKey])), _24 = _23.next();
7052
- _30.label = 20;
7082
+ _28.trys.push([19, 24, 25, 26]);
7083
+ _21 = (e_15 = void 0, __values(this.fieldGroups[fg.groupKey])), _22 = _21.next();
7084
+ _28.label = 20;
7053
7085
  case 20:
7054
- if (!!_24.done) return [3 /*break*/, 23];
7055
- fieldKey = _24.value;
7086
+ if (!!_22.done) return [3 /*break*/, 23];
7087
+ fieldKey = _22.value;
7056
7088
  resetField = getFormFieldByKey(this.formFields, fieldKey);
7057
7089
  actions = new kwikidToolkit.Action(action, {}, {
7058
7090
  FIELD_CONFIG: resetField,
@@ -7066,47 +7098,47 @@
7066
7098
  }, this.takeActionOnFieldGroup.bind(this));
7067
7099
  return [4 /*yield*/, actions.execute()];
7068
7100
  case 21:
7069
- _30.sent();
7070
- _30.label = 22;
7101
+ _28.sent();
7102
+ _28.label = 22;
7071
7103
  case 22:
7072
- _24 = _23.next();
7104
+ _22 = _21.next();
7073
7105
  return [3 /*break*/, 20];
7074
7106
  case 23: return [3 /*break*/, 26];
7075
7107
  case 24:
7076
- e_15_1 = _30.sent();
7108
+ e_15_1 = _28.sent();
7077
7109
  e_15 = { error: e_15_1 };
7078
7110
  return [3 /*break*/, 26];
7079
7111
  case 25:
7080
7112
  try {
7081
- if (_24 && !_24.done && (_29 = _23.return)) _29.call(_23);
7113
+ if (_22 && !_22.done && (_27 = _21.return)) _27.call(_21);
7082
7114
  }
7083
7115
  finally { if (e_15) throw e_15.error; }
7084
7116
  return [7 /*endfinally*/];
7085
7117
  case 26:
7086
- _22 = _21.next();
7118
+ _20 = _19.next();
7087
7119
  return [3 /*break*/, 18];
7088
7120
  case 27: return [3 /*break*/, 30];
7089
7121
  case 28:
7090
- e_16_1 = _30.sent();
7122
+ e_16_1 = _28.sent();
7091
7123
  e_16 = { error: e_16_1 };
7092
7124
  return [3 /*break*/, 30];
7093
7125
  case 29:
7094
7126
  try {
7095
- if (_22 && !_22.done && (_28 = _21.return)) _28.call(_21);
7127
+ if (_20 && !_20.done && (_26 = _19.return)) _26.call(_19);
7096
7128
  }
7097
7129
  finally { if (e_16) throw e_16.error; }
7098
7130
  return [7 /*endfinally*/];
7099
7131
  case 30:
7100
- _20 = _19.next();
7132
+ _18 = _17.next();
7101
7133
  return [3 /*break*/, 16];
7102
7134
  case 31: return [3 /*break*/, 34];
7103
7135
  case 32:
7104
- e_17_1 = _30.sent();
7136
+ e_17_1 = _28.sent();
7105
7137
  e_17 = { error: e_17_1 };
7106
7138
  return [3 /*break*/, 34];
7107
7139
  case 33:
7108
7140
  try {
7109
- if (_20 && !_20.done && (_27 = _19.return)) _27.call(_19);
7141
+ if (_18 && !_18.done && (_25 = _17.return)) _25.call(_17);
7110
7142
  }
7111
7143
  finally { if (e_17) throw e_17.error; }
7112
7144
  return [7 /*endfinally*/];
@@ -7131,9 +7163,9 @@
7131
7163
  KwikIDFormViewComponent.prototype.handleFieldApiCall = function (field, api) {
7132
7164
  return __awaiter(this, void 0, void 0, function () {
7133
7165
  var apis;
7134
- var _15, _16;
7135
- return __generator(this, function (_17) {
7136
- switch (_17.label) {
7166
+ var _13, _14;
7167
+ return __generator(this, function (_15) {
7168
+ switch (_15.label) {
7137
7169
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
7138
7170
  FIELD_CONFIG: field,
7139
7171
  API_CONFIG: api,
@@ -7146,13 +7178,13 @@
7146
7178
  EXTRA_DATA: this.extraData
7147
7179
  })];
7148
7180
  case 1:
7149
- api = _17.sent();
7181
+ api = _15.sent();
7150
7182
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
7151
7183
  if (kwikidToolkit.checkObjectKeyExists(field.api, "request")) {
7152
- this.formData = Object.assign(Object.assign({}, this.formData), (_15 = {}, _15[field.key] = api.response.value, _15));
7153
- this.formGroup.patchValue((_16 = {},
7154
- _16[field.key] = api.response.value,
7155
- _16), { emitEvent: false });
7184
+ this.formData = Object.assign(Object.assign({}, this.formData), (_13 = {}, _13[field.key] = api.response.value, _13));
7185
+ this.formGroup.patchValue((_14 = {},
7186
+ _14[field.key] = api.response.value,
7187
+ _14), { emitEvent: false });
7156
7188
  }
7157
7189
  apis = new Apis({
7158
7190
  FIELD_CONFIG: field,
@@ -7168,14 +7200,14 @@
7168
7200
  }, this.takeAction.bind(this));
7169
7201
  return [4 /*yield*/, apis.validateResponse()];
7170
7202
  case 2:
7171
- api = _17.sent();
7203
+ api = _15.sent();
7172
7204
  return [3 /*break*/, 4];
7173
7205
  case 3:
7174
7206
  setTimeout(function () {
7175
7207
  field.api.status.value = EApiStatusType.FAILED;
7176
7208
  field.showLoader = false;
7177
7209
  }, FORM_VIEW_TIMERS.TIMER_500);
7178
- _17.label = 4;
7210
+ _15.label = 4;
7179
7211
  case 4: return [2 /*return*/, { field: field, api: api }];
7180
7212
  }
7181
7213
  });
@@ -7184,8 +7216,8 @@
7184
7216
  KwikIDFormViewComponent.prototype.handleApiCall = function (api) {
7185
7217
  return __awaiter(this, void 0, void 0, function () {
7186
7218
  var apis;
7187
- return __generator(this, function (_15) {
7188
- switch (_15.label) {
7219
+ return __generator(this, function (_13) {
7220
+ switch (_13.label) {
7189
7221
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
7190
7222
  FORM_CONFIG: this.formConfig,
7191
7223
  API_CONFIG: api,
@@ -7198,7 +7230,7 @@
7198
7230
  EXTRA_DATA: this.extraData
7199
7231
  })];
7200
7232
  case 1:
7201
- api = _15.sent();
7233
+ api = _13.sent();
7202
7234
  apis = new Apis({
7203
7235
  FORM_CONFIG: this.formConfig,
7204
7236
  API_CONFIG: api,
@@ -7213,36 +7245,36 @@
7213
7245
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
7214
7246
  return [4 /*yield*/, apis.validateResponse()];
7215
7247
  case 2:
7216
- api = _15.sent();
7217
- _15.label = 3;
7248
+ api = _13.sent();
7249
+ _13.label = 3;
7218
7250
  case 3: return [2 /*return*/, { api: api }];
7219
7251
  }
7220
7252
  });
7221
7253
  });
7222
7254
  };
7223
7255
  KwikIDFormViewComponent.prototype.executeApiCall = function (api, object) {
7224
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
7256
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
7225
7257
  return __awaiter(this, void 0, void 0, function () {
7226
- var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, isDecryptResponse, isVerifySignature, executedApiCall, _13_1, body, isEncryptRequestBody, isDecryptResponse, isVerifySignature, executedApiCall, _14_1;
7227
- return __generator(this, function (_15) {
7228
- switch (_15.label) {
7258
+ var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, isDecryptResponse, isVerifySignature, executedApiCall, _11_1, body, isEncryptRequestBody, isDecryptResponse, isVerifySignature, executedApiCall, _12_1;
7259
+ return __generator(this, function (_13) {
7260
+ switch (_13.label) {
7229
7261
  case 0:
7230
7262
  apis = new Apis(object, this.takeAction.bind(this));
7231
7263
  return [4 /*yield*/, apis.setUrl()];
7232
7264
  case 1:
7233
- api = _15.sent();
7265
+ api = _13.sent();
7234
7266
  return [4 /*yield*/, apis.setRequestHeaders()];
7235
7267
  case 2:
7236
- api = _15.sent();
7268
+ api = _13.sent();
7237
7269
  return [4 /*yield*/, apis.validateRequestHeaders()];
7238
7270
  case 3:
7239
- api = _15.sent();
7271
+ api = _13.sent();
7240
7272
  return [4 /*yield*/, apis.setRequestBody()];
7241
7273
  case 4:
7242
- api = _15.sent();
7274
+ api = _13.sent();
7243
7275
  return [4 /*yield*/, apis.validateRequestBody()];
7244
7276
  case 5:
7245
- api = _15.sent();
7277
+ api = _13.sent();
7246
7278
  apiCallResponse = {};
7247
7279
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 17];
7248
7280
  if (!(kwikidToolkit.checkObjectKeyExists(api.request.url, "type") &&
@@ -7253,7 +7285,7 @@
7253
7285
  }, FORM_VIEW_TIMERS.WAIT_FOR_API_MOCK_DATA); // 1000 ms = 1 sec
7254
7286
  })];
7255
7287
  case 6:
7256
- apiCallResponse = _15.sent();
7288
+ apiCallResponse = _13.sent();
7257
7289
  apiCallResponseStatusCode =
7258
7290
  (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : FORM_VIEW_TIMERS.API_MOCK_SUCCESS_STATUS_CODE; // Default Status Code for Mocked APIs
7259
7291
  return [3 /*break*/, 16];
@@ -7267,21 +7299,21 @@
7267
7299
  form_api_method: method,
7268
7300
  form_api_key: (_g = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _g !== void 0 ? _g : ""
7269
7301
  });
7270
- _15.label = 8;
7302
+ _13.label = 8;
7271
7303
  case 8:
7272
- _15.trys.push([8, 10, , 11]);
7304
+ _13.trys.push([8, 10, , 11]);
7273
7305
  isDecryptResponse = (_j = (_h = api === null || api === void 0 ? void 0 : api.response) === null || _h === void 0 ? void 0 : _h.isSecure) !== null && _j !== void 0 ? _j : false;
7274
7306
  isVerifySignature = (_l = (_k = api === null || api === void 0 ? void 0 : api.response) === null || _k === void 0 ? void 0 : _k.isVerifySignature) !== null && _l !== void 0 ? _l : false;
7275
7307
  return [4 /*yield*/, this.formViewApiService.executeApiCall(url, "GET", {}, // No request body for GET method
7276
7308
  headers, false, // isEncryptRequestBody is not applicable for GET method
7277
7309
  isDecryptResponse, isVerifySignature)];
7278
7310
  case 9:
7279
- executedApiCall = _15.sent();
7311
+ executedApiCall = _13.sent();
7280
7312
  apiCallResponse = executedApiCall.data;
7281
7313
  apiCallResponseStatusCode = executedApiCall.status;
7282
7314
  return [3 /*break*/, 11];
7283
7315
  case 10:
7284
- _13_1 = _15.sent();
7316
+ _11_1 = _13.sent();
7285
7317
  // Handle any errors
7286
7318
  apiCallResponse = {};
7287
7319
  apiCallResponseStatusCode =
@@ -7297,17 +7329,17 @@
7297
7329
  this.triggerLogs(ELogEventType$1.FORM__API_REQUEST, Object.assign({ form_api_method: method, form_api_key: (_x = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _x !== void 0 ? _x : "", form_api_request_encrypted: isEncryptRequestBody }, (!isEncryptRequestBody && {
7298
7330
  form_api_request_body: body
7299
7331
  })));
7300
- _15.label = 13;
7332
+ _13.label = 13;
7301
7333
  case 13:
7302
- _15.trys.push([13, 15, , 16]);
7334
+ _13.trys.push([13, 15, , 16]);
7303
7335
  return [4 /*yield*/, this.formViewApiService.executeApiCall(url, "POST", body, headers, isEncryptRequestBody, isDecryptResponse, isVerifySignature)];
7304
7336
  case 14:
7305
- executedApiCall = _15.sent();
7337
+ executedApiCall = _13.sent();
7306
7338
  apiCallResponse = executedApiCall.data;
7307
7339
  apiCallResponseStatusCode = executedApiCall.status;
7308
7340
  return [3 /*break*/, 16];
7309
7341
  case 15:
7310
- _14_1 = _15.sent();
7342
+ _12_1 = _13.sent();
7311
7343
  // Handle any errors
7312
7344
  apiCallResponse = {};
7313
7345
  apiCallResponseStatusCode =
@@ -7316,15 +7348,15 @@
7316
7348
  case 16:
7317
7349
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
7318
7350
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "status", apiCallResponseStatusCode);
7319
- this.triggerLogs(ELogEventType$1.FORM__API_RESPONSE, Object.assign(Object.assign({ form_api_key: (_y = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _y !== void 0 ? _y : "", form_api_response_encrypted: (_0 = (_z = api === null || api === void 0 ? void 0 : api.response) === null || _z === void 0 ? void 0 : _z.isSecure) !== null && _0 !== void 0 ? _0 : false }, (((_2 = !((_1 = api === null || api === void 0 ? void 0 : api.response) === null || _1 === void 0 ? void 0 : _1.isSecure)) !== null && _2 !== void 0 ? _2 : false) && {
7351
+ this.triggerLogs(ELogEventType$1.FORM__API_RESPONSE, Object.assign(Object.assign({ form_api_key: (_y = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _y !== void 0 ? _y : "", form_api_response_encrypted: (_0 = (_z = api === null || api === void 0 ? void 0 : api.response) === null || _z === void 0 ? void 0 : _z.isSecure) !== null && _0 !== void 0 ? _0 : false }, (!((_1 = api === null || api === void 0 ? void 0 : api.response) === null || _1 === void 0 ? void 0 : _1.isSecure) && {
7320
7352
  form_api_response_body: apiCallResponse !== null && apiCallResponse !== void 0 ? apiCallResponse : {}
7321
7353
  })), { form_api_status_code: apiCallResponseStatusCode }));
7322
7354
  return [3 /*break*/, 18];
7323
7355
  case 17:
7324
- this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_INVALID, Object.assign({ form_api_key: (_3 = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _3 !== void 0 ? _3 : "", form_api_request_encrypted: (_6 = (_5 = (_4 = api === null || api === void 0 ? void 0 : api.request) === null || _4 === void 0 ? void 0 : _4.body) === null || _5 === void 0 ? void 0 : _5.isSecure) !== null && _6 !== void 0 ? _6 : false }, (((_9 = !((_8 = (_7 = api === null || api === void 0 ? void 0 : api.request) === null || _7 === void 0 ? void 0 : _7.body) === null || _8 === void 0 ? void 0 : _8.isSecure)) !== null && _9 !== void 0 ? _9 : false) && {
7325
- form_api_request_body: (_12 = (_11 = (_10 = api === null || api === void 0 ? void 0 : api.request) === null || _10 === void 0 ? void 0 : _10.body) === null || _11 === void 0 ? void 0 : _11.value) !== null && _12 !== void 0 ? _12 : {}
7356
+ this.triggerLogs(ELogEventType$1.FORM__API_REQUEST_INVALID, Object.assign({ form_api_key: (_2 = api === null || api === void 0 ? void 0 : api.apiKey) !== null && _2 !== void 0 ? _2 : "", form_api_request_encrypted: (_5 = (_4 = (_3 = api === null || api === void 0 ? void 0 : api.request) === null || _3 === void 0 ? void 0 : _3.body) === null || _4 === void 0 ? void 0 : _4.isSecure) !== null && _5 !== void 0 ? _5 : false }, (!((_7 = (_6 = api === null || api === void 0 ? void 0 : api.request) === null || _6 === void 0 ? void 0 : _6.body) === null || _7 === void 0 ? void 0 : _7.isSecure) && {
7357
+ form_api_request_body: (_10 = (_9 = (_8 = api === null || api === void 0 ? void 0 : api.request) === null || _8 === void 0 ? void 0 : _8.body) === null || _9 === void 0 ? void 0 : _9.value) !== null && _10 !== void 0 ? _10 : {}
7326
7358
  })));
7327
- _15.label = 18;
7359
+ _13.label = 18;
7328
7360
  case 18: return [2 /*return*/, api];
7329
7361
  }
7330
7362
  });
@@ -7362,8 +7394,8 @@
7362
7394
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
7363
7395
  return __awaiter(this, void 0, void 0, function () {
7364
7396
  var field, apis;
7365
- return __generator(this, function (_15) {
7366
- switch (_15.label) {
7397
+ return __generator(this, function (_13) {
7398
+ switch (_13.label) {
7367
7399
  case 0:
7368
7400
  field = getFormFieldByKey(this.formFields, e.key);
7369
7401
  if (!(field.type === EFieldType.API)) return [3 /*break*/, 5];
@@ -7378,7 +7410,7 @@
7378
7410
  if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
7379
7411
  return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
7380
7412
  case 1:
7381
- _15.sent();
7413
+ _13.sent();
7382
7414
  return [3 /*break*/, 4];
7383
7415
  case 2:
7384
7416
  apis = new Apis({
@@ -7394,11 +7426,11 @@
7394
7426
  }, this.takeAction.bind(this));
7395
7427
  return [4 /*yield*/, apis.callNextApi(field.api.entrypoint)];
7396
7428
  case 3:
7397
- _15.sent();
7398
- _15.label = 4;
7429
+ _13.sent();
7430
+ _13.label = 4;
7399
7431
  case 4:
7400
7432
  this.hideApiLoader();
7401
- _15.label = 5;
7433
+ _13.label = 5;
7402
7434
  case 5: return [2 /*return*/];
7403
7435
  }
7404
7436
  });
@@ -7444,11 +7476,11 @@
7444
7476
  };
7445
7477
  KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
7446
7478
  return __awaiter(this, void 0, void 0, function () {
7447
- var controls, firstFieldWithError, controls_1, controls_1_1, control, field, _15, _16, field, ruleEngine, e_18_1, formData, _17, _18, field, extendedFormData, _19, _20, postTask, task, e_19_1;
7448
- var e_20, _21, e_18, _22, e_21, _23, e_19, _24;
7479
+ var controls, firstFieldWithError, controls_1, controls_1_1, control, field, _13, _14, field, ruleEngine, e_18_1, formData, _15, _16, field, extendedFormData, _17, _18, postTask, task, e_19_1;
7480
+ var e_20, _19, e_18, _20, e_21, _21, e_19, _22;
7449
7481
  var _this = this;
7450
- return __generator(this, function (_25) {
7451
- switch (_25.label) {
7482
+ return __generator(this, function (_23) {
7483
+ switch (_23.label) {
7452
7484
  case 0:
7453
7485
  if (e) {
7454
7486
  this.triggerLogs(ELogEventType$1.FORM__SAVE_BUTTON_CLICK, {});
@@ -7478,7 +7510,7 @@
7478
7510
  catch (e_20_1) { e_20 = { error: e_20_1 }; }
7479
7511
  finally {
7480
7512
  try {
7481
- if (controls_1_1 && !controls_1_1.done && (_21 = controls_1.return)) _21.call(controls_1);
7513
+ if (controls_1_1 && !controls_1_1.done && (_19 = controls_1.return)) _19.call(controls_1);
7482
7514
  }
7483
7515
  finally { if (e_20) throw e_20.error; }
7484
7516
  }
@@ -7490,14 +7522,14 @@
7490
7522
  // }, 3000);
7491
7523
  return [2 /*return*/];
7492
7524
  }
7493
- _25.label = 1;
7525
+ _23.label = 1;
7494
7526
  case 1:
7495
- _25.trys.push([1, 6, 7, 8]);
7496
- _15 = __values(this.formFields), _16 = _15.next();
7497
- _25.label = 2;
7527
+ _23.trys.push([1, 6, 7, 8]);
7528
+ _13 = __values(this.formFields), _14 = _13.next();
7529
+ _23.label = 2;
7498
7530
  case 2:
7499
- if (!!_16.done) return [3 /*break*/, 5];
7500
- field = _16.value;
7531
+ if (!!_14.done) return [3 /*break*/, 5];
7532
+ field = _14.value;
7501
7533
  if (!(field.isFormElement &&
7502
7534
  !field.hidden &&
7503
7535
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -7514,7 +7546,7 @@
7514
7546
  }, this.takeAction.bind(this));
7515
7547
  return [4 /*yield*/, ruleEngine.run(field.validation)];
7516
7548
  case 3:
7517
- _25.sent();
7549
+ _23.sent();
7518
7550
  if (!field.validation.is_valid) {
7519
7551
  this.toggleErrorNotification(true);
7520
7552
  setTimeout(function () {
@@ -7522,26 +7554,26 @@
7522
7554
  }, FORM_VIEW_TIMERS.INVALID_FIELDS_SAVE_FORM_ERROR_TOGGLE);
7523
7555
  return [2 /*return*/];
7524
7556
  }
7525
- _25.label = 4;
7557
+ _23.label = 4;
7526
7558
  case 4:
7527
- _16 = _15.next();
7559
+ _14 = _13.next();
7528
7560
  return [3 /*break*/, 2];
7529
7561
  case 5: return [3 /*break*/, 8];
7530
7562
  case 6:
7531
- e_18_1 = _25.sent();
7563
+ e_18_1 = _23.sent();
7532
7564
  e_18 = { error: e_18_1 };
7533
7565
  return [3 /*break*/, 8];
7534
7566
  case 7:
7535
7567
  try {
7536
- if (_16 && !_16.done && (_22 = _15.return)) _22.call(_15);
7568
+ if (_14 && !_14.done && (_20 = _13.return)) _20.call(_13);
7537
7569
  }
7538
7570
  finally { if (e_18) throw e_18.error; }
7539
7571
  return [7 /*endfinally*/];
7540
7572
  case 8:
7541
7573
  formData = this.formGroup.getRawValue();
7542
7574
  try {
7543
- for (_17 = __values(this.formFields), _18 = _17.next(); !_18.done; _18 = _17.next()) {
7544
- field = _18.value;
7575
+ for (_15 = __values(this.formFields), _16 = _15.next(); !_16.done; _16 = _15.next()) {
7576
+ field = _16.value;
7545
7577
  if (field.isFormElement) {
7546
7578
  if (field.hidden) {
7547
7579
  delete formData[field.key];
@@ -7555,22 +7587,22 @@
7555
7587
  catch (e_21_1) { e_21 = { error: e_21_1 }; }
7556
7588
  finally {
7557
7589
  try {
7558
- if (_18 && !_18.done && (_23 = _17.return)) _23.call(_17);
7590
+ if (_16 && !_16.done && (_21 = _15.return)) _21.call(_15);
7559
7591
  }
7560
7592
  finally { if (e_21) throw e_21.error; }
7561
7593
  }
7562
7594
  extendedFormData = this.formFields.reduce(function (result, field, index) {
7563
- var _15;
7595
+ var _13;
7564
7596
  if (field.isFormElement && !field.hidden) {
7565
- var fieldData = (_15 = {},
7566
- _15[field.key] = {
7597
+ var fieldData = (_13 = {},
7598
+ _13[field.key] = {
7567
7599
  key: field.key,
7568
7600
  label: field.label,
7569
7601
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
7570
7602
  type: field.type,
7571
7603
  index: index
7572
7604
  },
7573
- _15);
7605
+ _13);
7574
7606
  result[field.key] = fieldData[field.key];
7575
7607
  }
7576
7608
  return result;
@@ -7584,14 +7616,14 @@
7584
7616
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
7585
7617
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
7586
7618
  this.triggerLogs(ELogEventType$1.FORM__TASK_POST, {});
7587
- _25.label = 9;
7619
+ _23.label = 9;
7588
7620
  case 9:
7589
- _25.trys.push([9, 15, 16, 17]);
7590
- _19 = __values(this.formConfig.tasks.post), _20 = _19.next();
7591
- _25.label = 10;
7621
+ _23.trys.push([9, 15, 16, 17]);
7622
+ _17 = __values(this.formConfig.tasks.post), _18 = _17.next();
7623
+ _23.label = 10;
7592
7624
  case 10:
7593
- if (!!_20.done) return [3 /*break*/, 14];
7594
- postTask = _20.value;
7625
+ if (!!_18.done) return [3 /*break*/, 14];
7626
+ postTask = _18.value;
7595
7627
  task = new Tasks(postTask, {
7596
7628
  FORM_CONFIG: this.formConfig,
7597
7629
  FORM_FIELDS: this.formFields,
@@ -7611,7 +7643,7 @@
7611
7643
  }
7612
7644
  return [4 /*yield*/, task.execute()];
7613
7645
  case 11:
7614
- _25.sent();
7646
+ _23.sent();
7615
7647
  // Wait for ngOnChanges to be called before continuing to the next task
7616
7648
  return [4 /*yield*/, new Promise(function (resolve) {
7617
7649
  var intervalId = setInterval(function () {
@@ -7623,22 +7655,22 @@
7623
7655
  })];
7624
7656
  case 12:
7625
7657
  // Wait for ngOnChanges to be called before continuing to the next task
7626
- _25.sent();
7658
+ _23.sent();
7627
7659
  if (this.stopTaskExecution) {
7628
7660
  return [3 /*break*/, 14];
7629
7661
  }
7630
- _25.label = 13;
7662
+ _23.label = 13;
7631
7663
  case 13:
7632
- _20 = _19.next();
7664
+ _18 = _17.next();
7633
7665
  return [3 /*break*/, 10];
7634
7666
  case 14: return [3 /*break*/, 17];
7635
7667
  case 15:
7636
- e_19_1 = _25.sent();
7668
+ e_19_1 = _23.sent();
7637
7669
  e_19 = { error: e_19_1 };
7638
7670
  return [3 /*break*/, 17];
7639
7671
  case 16:
7640
7672
  try {
7641
- if (_20 && !_20.done && (_24 = _19.return)) _24.call(_19);
7673
+ if (_18 && !_18.done && (_22 = _17.return)) _22.call(_17);
7642
7674
  }
7643
7675
  finally { if (e_19) throw e_19.error; }
7644
7676
  return [7 /*endfinally*/];
@@ -7660,7 +7692,7 @@
7660
7692
  data: kwikidToolkit.mergeObjects(formData, this.popupFormData, this.taskData),
7661
7693
  extendedData: extendedFormData
7662
7694
  });
7663
- _25.label = 19;
7695
+ _23.label = 19;
7664
7696
  case 19: return [2 /*return*/];
7665
7697
  }
7666
7698
  });
@@ -7668,7 +7700,7 @@
7668
7700
  };
7669
7701
  KwikIDFormViewComponent.prototype.handleOnApiTimerStop = function (e) {
7670
7702
  return __awaiter(this, void 0, void 0, function () {
7671
- return __generator(this, function (_15) {
7703
+ return __generator(this, function (_13) {
7672
7704
  this.fieldApiTimerMessageHide(e.key);
7673
7705
  return [2 /*return*/];
7674
7706
  });
@@ -7704,17 +7736,17 @@
7704
7736
  });
7705
7737
  };
7706
7738
  KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
7707
- var e_22, _15;
7739
+ var e_22, _13;
7708
7740
  try {
7709
- for (var _16 = __values(this.fieldGroups[fieldGroup]), _17 = _16.next(); !_17.done; _17 = _16.next()) {
7710
- var fieldKey = _17.value;
7741
+ for (var _14 = __values(this.fieldGroups[fieldGroup]), _15 = _14.next(); !_15.done; _15 = _14.next()) {
7742
+ var fieldKey = _15.value;
7711
7743
  this.fieldHide(fieldKey);
7712
7744
  }
7713
7745
  }
7714
7746
  catch (e_22_1) { e_22 = { error: e_22_1 }; }
7715
7747
  finally {
7716
7748
  try {
7717
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
7749
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
7718
7750
  }
7719
7751
  finally { if (e_22) throw e_22.error; }
7720
7752
  }
@@ -7732,17 +7764,17 @@
7732
7764
  });
7733
7765
  };
7734
7766
  KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
7735
- var e_23, _15;
7767
+ var e_23, _13;
7736
7768
  try {
7737
- for (var _16 = __values(this.fieldGroups[fieldGroup]), _17 = _16.next(); !_17.done; _17 = _16.next()) {
7738
- var fieldKey = _17.value;
7769
+ for (var _14 = __values(this.fieldGroups[fieldGroup]), _15 = _14.next(); !_15.done; _15 = _14.next()) {
7770
+ var fieldKey = _15.value;
7739
7771
  this.fieldShow(fieldKey);
7740
7772
  }
7741
7773
  }
7742
7774
  catch (e_23_1) { e_23 = { error: e_23_1 }; }
7743
7775
  finally {
7744
7776
  try {
7745
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
7777
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
7746
7778
  }
7747
7779
  finally { if (e_23) throw e_23.error; }
7748
7780
  }
@@ -7770,17 +7802,17 @@
7770
7802
  });
7771
7803
  };
7772
7804
  KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
7773
- var e_24, _15;
7805
+ var e_24, _13;
7774
7806
  try {
7775
- for (var _16 = __values(this.fieldGroups[fieldGroup]), _17 = _16.next(); !_17.done; _17 = _16.next()) {
7776
- var fieldKey = _17.value;
7807
+ for (var _14 = __values(this.fieldGroups[fieldGroup]), _15 = _14.next(); !_15.done; _15 = _14.next()) {
7808
+ var fieldKey = _15.value;
7777
7809
  this.fieldDisable(fieldKey);
7778
7810
  }
7779
7811
  }
7780
7812
  catch (e_24_1) { e_24 = { error: e_24_1 }; }
7781
7813
  finally {
7782
7814
  try {
7783
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
7815
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
7784
7816
  }
7785
7817
  finally { if (e_24) throw e_24.error; }
7786
7818
  }
@@ -7808,23 +7840,23 @@
7808
7840
  });
7809
7841
  };
7810
7842
  KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
7811
- var e_25, _15;
7843
+ var e_25, _13;
7812
7844
  try {
7813
- for (var _16 = __values(this.fieldGroups[fieldGroup]), _17 = _16.next(); !_17.done; _17 = _16.next()) {
7814
- var fieldKey = _17.value;
7845
+ for (var _14 = __values(this.fieldGroups[fieldGroup]), _15 = _14.next(); !_15.done; _15 = _14.next()) {
7846
+ var fieldKey = _15.value;
7815
7847
  this.fieldEnable(fieldKey);
7816
7848
  }
7817
7849
  }
7818
7850
  catch (e_25_1) { e_25 = { error: e_25_1 }; }
7819
7851
  finally {
7820
7852
  try {
7821
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
7853
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
7822
7854
  }
7823
7855
  finally { if (e_25) throw e_25.error; }
7824
7856
  }
7825
7857
  };
7826
7858
  KwikIDFormViewComponent.prototype.fieldReset = function (fieldKey) {
7827
- var _15;
7859
+ var _13;
7828
7860
  // Find the field and its index in the formFields array
7829
7861
  var field = getFormFieldByKey(this.formFields, fieldKey);
7830
7862
  var fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
@@ -7835,9 +7867,9 @@
7835
7867
  emitEvent: false,
7836
7868
  onlySelf: true
7837
7869
  });
7838
- this.formGroup.patchValue((_15 = {},
7839
- _15[field.key] = resetValue,
7840
- _15), { emitEvent: false });
7870
+ this.formGroup.patchValue((_13 = {},
7871
+ _13[field.key] = resetValue,
7872
+ _13), { emitEvent: false });
7841
7873
  this.formGroup.controls[field.key].updateValueAndValidity({
7842
7874
  emitEvent: true
7843
7875
  });
@@ -7881,17 +7913,17 @@
7881
7913
  });
7882
7914
  };
7883
7915
  KwikIDFormViewComponent.prototype.fieldGroupReset = function (fieldGroup) {
7884
- var e_26, _15;
7916
+ var e_26, _13;
7885
7917
  try {
7886
- for (var _16 = __values(this.fieldGroups[fieldGroup]), _17 = _16.next(); !_17.done; _17 = _16.next()) {
7887
- var fieldKey = _17.value;
7918
+ for (var _14 = __values(this.fieldGroups[fieldGroup]), _15 = _14.next(); !_15.done; _15 = _14.next()) {
7919
+ var fieldKey = _15.value;
7888
7920
  this.fieldReset(fieldKey);
7889
7921
  }
7890
7922
  }
7891
7923
  catch (e_26_1) { e_26 = { error: e_26_1 }; }
7892
7924
  finally {
7893
7925
  try {
7894
- if (_17 && !_17.done && (_15 = _16.return)) _15.call(_16);
7926
+ if (_15 && !_15.done && (_13 = _14.return)) _13.call(_14);
7895
7927
  }
7896
7928
  finally { if (e_26) throw e_26.error; }
7897
7929
  }
@@ -8009,7 +8041,7 @@
8009
8041
  KwikIDFormViewComponent.prototype.fieldApiTimerMessageShow = function (fieldKey, timer) {
8010
8042
  return __awaiter(this, void 0, void 0, function () {
8011
8043
  var field, fieldIndex;
8012
- return __generator(this, function (_15) {
8044
+ return __generator(this, function (_13) {
8013
8045
  field = getFormFieldByKey(this.formFields, fieldKey);
8014
8046
  fieldIndex = this.formFields.findIndex(function (_) {
8015
8047
  return field.key === _.key;
@@ -8030,7 +8062,7 @@
8030
8062
  return __awaiter(this, void 0, void 0, function () {
8031
8063
  var field, fieldIndex, ruleEngine_10;
8032
8064
  var _this = this;
8033
- return __generator(this, function (_15) {
8065
+ return __generator(this, function (_13) {
8034
8066
  field = getFormFieldByKey(this.formFields, fieldKey);
8035
8067
  fieldIndex = this.formFields.findIndex(function (_) {
8036
8068
  return field.key === _.key;
@@ -8050,11 +8082,11 @@
8050
8082
  EXTRA_DATA: this.extraData
8051
8083
  }, this.takeAction.bind(this));
8052
8084
  (function () { return __awaiter(_this, void 0, void 0, function () {
8053
- return __generator(this, function (_15) {
8054
- switch (_15.label) {
8085
+ return __generator(this, function (_13) {
8086
+ switch (_13.label) {
8055
8087
  case 0: return [4 /*yield*/, ruleEngine_10.run(field.validation)];
8056
8088
  case 1:
8057
- _15.sent();
8089
+ _13.sent();
8058
8090
  return [2 /*return*/];
8059
8091
  }
8060
8092
  });
@@ -8076,16 +8108,42 @@
8076
8108
  });
8077
8109
  });
8078
8110
  };
8111
+ KwikIDFormViewComponent.prototype.removeKeyFromObjectPath = function (action, object) {
8112
+ var _a, _b, _c, _d;
8113
+ return __awaiter(this, void 0, void 0, function () {
8114
+ var source, sourceValue, objectKey, objectPath;
8115
+ return __generator(this, function (_13) {
8116
+ source = new kwikidToolkit.Source(object);
8117
+ sourceValue = action.props.source;
8118
+ objectKey = (_b = (_a = sourceValue === null || sourceValue === void 0 ? void 0 : sourceValue.props) === null || _a === void 0 ? void 0 : _a.object) === null || _b === void 0 ? void 0 : _b.key;
8119
+ objectPath = (_d = (_c = sourceValue === null || sourceValue === void 0 ? void 0 : sourceValue.props) === null || _c === void 0 ? void 0 : _c.object) === null || _d === void 0 ? void 0 : _d.path;
8120
+ if (sourceValue.key === kwikidToolkit.ESourceKey.OBJECT &&
8121
+ kwikidToolkit.isNotEmptyString(objectKey) &&
8122
+ kwikidToolkit.isNotEmptyString(objectPath)) {
8123
+ if (kwikidToolkit.checkObjectKeyExists(source._object, objectKey)) {
8124
+ source._object[objectKey] = kwikidToolkit.removeKeyFromObjectPath(source._object[objectKey], objectPath);
8125
+ }
8126
+ }
8127
+ object.FIELD_CONFIG = source._object.FIELD_CONFIG;
8128
+ this.formData = source._object.FORM_DATA;
8129
+ this.patchFormGroup(this.formData);
8130
+ this.allFormsData = source._object.ALL_FORMS_DATA;
8131
+ this.previousFormData = source._object.PREVIOUS_FORM_DATA;
8132
+ this.extraData = source._object.EXTRA_DATA;
8133
+ return [2 /*return*/];
8134
+ });
8135
+ });
8136
+ };
8079
8137
  KwikIDFormViewComponent.prototype.setValue = function (action, object) {
8080
8138
  return __awaiter(this, void 0, void 0, function () {
8081
8139
  var source, sourceValue;
8082
- return __generator(this, function (_15) {
8083
- switch (_15.label) {
8140
+ return __generator(this, function (_13) {
8141
+ switch (_13.label) {
8084
8142
  case 0:
8085
8143
  source = new kwikidToolkit.Source(object);
8086
8144
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
8087
8145
  case 1:
8088
- sourceValue = _15.sent();
8146
+ sourceValue = _13.sent();
8089
8147
  source.setValueToSource(action.props.value.destination, sourceValue);
8090
8148
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
8091
8149
  this.formData = source.object.FORM_DATA;
@@ -8101,13 +8159,13 @@
8101
8159
  KwikIDFormViewComponent.prototype.setFieldDefaultValue = function (action, object) {
8102
8160
  return __awaiter(this, void 0, void 0, function () {
8103
8161
  var source, sourceValue;
8104
- return __generator(this, function (_15) {
8105
- switch (_15.label) {
8162
+ return __generator(this, function (_13) {
8163
+ switch (_13.label) {
8106
8164
  case 0:
8107
8165
  source = new kwikidToolkit.Source(object);
8108
8166
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
8109
8167
  case 1:
8110
- sourceValue = _15.sent();
8168
+ sourceValue = _13.sent();
8111
8169
  source.setValueToSource({
8112
8170
  key: kwikidToolkit.ESourceKey.OBJECT,
8113
8171
  props: {
@@ -8140,7 +8198,7 @@
8140
8198
  KwikIDFormViewComponent.prototype.setApiStatus = function (action, object) {
8141
8199
  return __awaiter(this, void 0, void 0, function () {
8142
8200
  var source, sourceValue;
8143
- return __generator(this, function (_15) {
8201
+ return __generator(this, function (_13) {
8144
8202
  source = new kwikidToolkit.Source(object);
8145
8203
  sourceValue = action.props.status;
8146
8204
  source.setValueToSource({
@@ -8160,13 +8218,13 @@
8160
8218
  KwikIDFormViewComponent.prototype.setApiHeaderValue = function (action, object) {
8161
8219
  return __awaiter(this, void 0, void 0, function () {
8162
8220
  var source, sourceValue;
8163
- return __generator(this, function (_15) {
8164
- switch (_15.label) {
8221
+ return __generator(this, function (_13) {
8222
+ switch (_13.label) {
8165
8223
  case 0:
8166
8224
  source = new kwikidToolkit.Source(object);
8167
8225
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
8168
8226
  case 1:
8169
- sourceValue = _15.sent();
8227
+ sourceValue = _13.sent();
8170
8228
  source.setValueToSource({
8171
8229
  key: kwikidToolkit.ESourceKey.OBJECT,
8172
8230
  props: {
@@ -8185,7 +8243,7 @@
8185
8243
  KwikIDFormViewComponent.prototype.setApiHeaderValidity = function (action, object) {
8186
8244
  return __awaiter(this, void 0, void 0, function () {
8187
8245
  var source, sourceValue;
8188
- return __generator(this, function (_15) {
8246
+ return __generator(this, function (_13) {
8189
8247
  source = new kwikidToolkit.Source(object);
8190
8248
  sourceValue = action.props.valid;
8191
8249
  source.setValueToSource({
@@ -8205,13 +8263,13 @@
8205
8263
  KwikIDFormViewComponent.prototype.setApiBodyValue = function (action, object) {
8206
8264
  return __awaiter(this, void 0, void 0, function () {
8207
8265
  var source, sourceValue;
8208
- return __generator(this, function (_15) {
8209
- switch (_15.label) {
8266
+ return __generator(this, function (_13) {
8267
+ switch (_13.label) {
8210
8268
  case 0:
8211
8269
  source = new kwikidToolkit.Source(object);
8212
8270
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
8213
8271
  case 1:
8214
- sourceValue = _15.sent();
8272
+ sourceValue = _13.sent();
8215
8273
  source.setValueToSource({
8216
8274
  key: kwikidToolkit.ESourceKey.OBJECT,
8217
8275
  props: {
@@ -8230,7 +8288,7 @@
8230
8288
  KwikIDFormViewComponent.prototype.setApiBodyValidity = function (action, object) {
8231
8289
  return __awaiter(this, void 0, void 0, function () {
8232
8290
  var source, sourceValue;
8233
- return __generator(this, function (_15) {
8291
+ return __generator(this, function (_13) {
8234
8292
  source = new kwikidToolkit.Source(object);
8235
8293
  sourceValue = action.props.valid;
8236
8294
  source.setValueToSource({
@@ -8250,7 +8308,7 @@
8250
8308
  KwikIDFormViewComponent.prototype.setFieldValidity = function (action, object) {
8251
8309
  return __awaiter(this, void 0, void 0, function () {
8252
8310
  var source, sourceValue;
8253
- return __generator(this, function (_15) {
8311
+ return __generator(this, function (_13) {
8254
8312
  source = new kwikidToolkit.Source(object);
8255
8313
  sourceValue = action.props.valid;
8256
8314
  source.setValueToSource({
@@ -8271,18 +8329,18 @@
8271
8329
  KwikIDFormViewComponent.prototype.setDropdownOptions = function (action, object) {
8272
8330
  return __awaiter(this, void 0, void 0, function () {
8273
8331
  var source, sourceValue, appendToPath, appendToPathStr, optionsPath;
8274
- return __generator(this, function (_15) {
8275
- switch (_15.label) {
8332
+ return __generator(this, function (_13) {
8333
+ switch (_13.label) {
8276
8334
  case 0:
8277
8335
  source = new kwikidToolkit.Source(object);
8278
8336
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
8279
8337
  case 1:
8280
- sourceValue = _15.sent();
8338
+ sourceValue = _13.sent();
8281
8339
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 4];
8282
8340
  if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 3];
8283
8341
  return [4 /*yield*/, source.getValueFromSource(action.props.options.appendToPath.source)];
8284
8342
  case 2:
8285
- appendToPath = _15.sent();
8343
+ appendToPath = _13.sent();
8286
8344
  if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
8287
8345
  appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
8288
8346
  optionsPath = "" + action.props.options.path + appendToPathStr;
@@ -8291,7 +8349,7 @@
8291
8349
  return [3 /*break*/, 4];
8292
8350
  case 3:
8293
8351
  sourceValue = kwikidToolkit.getObjectValueFromPath(sourceValue, action.props.options.path);
8294
- _15.label = 4;
8352
+ _13.label = 4;
8295
8353
  case 4:
8296
8354
  source.setValueToSource(action.props.value.destination, sourceValue);
8297
8355
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
@@ -8307,19 +8365,19 @@
8307
8365
  KwikIDFormViewComponent.prototype.apiCall = function (action, object) {
8308
8366
  return __awaiter(this, void 0, void 0, function () {
8309
8367
  var apiConfig, response;
8310
- var _15;
8311
- return __generator(this, function (_16) {
8312
- switch (_16.label) {
8368
+ var _13;
8369
+ return __generator(this, function (_14) {
8370
+ switch (_14.label) {
8313
8371
  case 0:
8314
8372
  apiConfig = this.formConfig.apis[action.props.formApiKey];
8315
8373
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
8316
8374
  case 1:
8317
- response = _16.sent();
8375
+ response = _14.sent();
8318
8376
  apiConfig = response.api;
8319
8377
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, apiConfig);
8320
- this.formData = kwikidToolkit.mergeObjects(this.formData, (_15 = {},
8321
- _15[action.props.formApiKey] = apiConfig.response.value,
8322
- _15));
8378
+ this.formData = kwikidToolkit.mergeObjects(this.formData, (_13 = {},
8379
+ _13[action.props.formApiKey] = apiConfig.response.value,
8380
+ _13));
8323
8381
  return [2 /*return*/, apiConfig];
8324
8382
  }
8325
8383
  });
@@ -8328,13 +8386,13 @@
8328
8386
  KwikIDFormViewComponent.prototype.fieldApiCall = function (action, object) {
8329
8387
  return __awaiter(this, void 0, void 0, function () {
8330
8388
  var apiConfig;
8331
- return __generator(this, function (_15) {
8332
- switch (_15.label) {
8389
+ return __generator(this, function (_13) {
8390
+ switch (_13.label) {
8333
8391
  case 0:
8334
8392
  this.showApiLoader();
8335
8393
  return [4 /*yield*/, this.apiCall(action, object)];
8336
8394
  case 1:
8337
- apiConfig = _15.sent();
8395
+ apiConfig = _13.sent();
8338
8396
  this.hideApiLoader();
8339
8397
  return [2 /*return*/];
8340
8398
  }
@@ -8344,8 +8402,8 @@
8344
8402
  KwikIDFormViewComponent.prototype.fieldMultipleApiCalls = function (action, object) {
8345
8403
  return __awaiter(this, void 0, void 0, function () {
8346
8404
  var entrypointApiKey, field, endpoints, nextApiIndex, apiConfig, response;
8347
- return __generator(this, function (_15) {
8348
- switch (_15.label) {
8405
+ return __generator(this, function (_13) {
8406
+ switch (_13.label) {
8349
8407
  case 0:
8350
8408
  entrypointApiKey = action.props.apiKey;
8351
8409
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
@@ -8354,7 +8412,7 @@
8354
8412
  apiConfig = endpoints[nextApiIndex];
8355
8413
  return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
8356
8414
  case 1:
8357
- response = _15.sent();
8415
+ response = _13.sent();
8358
8416
  // eslint-disable-next-line prefer-destructuring
8359
8417
  field = response.field;
8360
8418
  field.api.endpoints[nextApiIndex] = response.api;
@@ -8366,15 +8424,16 @@
8366
8424
  KwikIDFormViewComponent.prototype.fieldMultipleApiCallsEnd = function (action, object) {
8367
8425
  return __awaiter(this, void 0, void 0, function () {
8368
8426
  var field, multipleApiCallResponses;
8369
- var _15;
8370
- return __generator(this, function (_16) {
8427
+ var _13;
8428
+ return __generator(this, function (_14) {
8371
8429
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
8372
8430
  multipleApiCallResponses = {};
8373
8431
  field.api.endpoints.forEach(function (api) {
8374
- if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
8432
+ if (kwikidToolkit.checkObjectKeyExists(api.response, "value")) {
8375
8433
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
8434
+ }
8376
8435
  });
8377
- this.formData = Object.assign(Object.assign({}, this.formData), (_15 = {}, _15[field.key] = multipleApiCallResponses, _15));
8436
+ this.formData = Object.assign(Object.assign({}, this.formData), (_13 = {}, _13[field.key] = multipleApiCallResponses, _13));
8378
8437
  this.patchFormGroup(this.formData);
8379
8438
  return [2 /*return*/];
8380
8439
  });
@@ -8383,17 +8442,17 @@
8383
8442
  KwikIDFormViewComponent.prototype.taskApiCall = function (action, object) {
8384
8443
  return __awaiter(this, void 0, void 0, function () {
8385
8444
  var apiConfig;
8386
- var _15;
8387
- return __generator(this, function (_16) {
8388
- switch (_16.label) {
8445
+ var _13;
8446
+ return __generator(this, function (_14) {
8447
+ switch (_14.label) {
8389
8448
  case 0:
8390
8449
  this.showApiLoader();
8391
8450
  return [4 /*yield*/, this.apiCall(action, object)];
8392
8451
  case 1:
8393
- apiConfig = _16.sent();
8394
- this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_15 = {},
8395
- _15[action.props.formApiKey] = apiConfig.response.value,
8396
- _15));
8452
+ apiConfig = _14.sent();
8453
+ this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_13 = {},
8454
+ _13[action.props.formApiKey] = apiConfig.response.value,
8455
+ _13));
8397
8456
  this.waitingForChanges = false;
8398
8457
  this.hideApiLoader();
8399
8458
  return [2 /*return*/];
@@ -8404,8 +8463,8 @@
8404
8463
  KwikIDFormViewComponent.prototype.taskMultipleApiCalls = function (action, object) {
8405
8464
  return __awaiter(this, void 0, void 0, function () {
8406
8465
  var multipleApiConfig, entrypointApiKey_1, endpoints, nextApiIndex, apiConfig, response, apis;
8407
- return __generator(this, function (_15) {
8408
- switch (_15.label) {
8466
+ return __generator(this, function (_13) {
8467
+ switch (_13.label) {
8409
8468
  case 0:
8410
8469
  this.showApiLoader();
8411
8470
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
@@ -8416,7 +8475,7 @@
8416
8475
  apiConfig = endpoints[nextApiIndex];
8417
8476
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
8418
8477
  case 1:
8419
- response = _15.sent();
8478
+ response = _13.sent();
8420
8479
  multipleApiConfig.endpoints[nextApiIndex] = response.api;
8421
8480
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, multipleApiConfig);
8422
8481
  this.hideApiLoader();
@@ -8435,8 +8494,8 @@
8435
8494
  }, this.takeAction.bind(this));
8436
8495
  return [4 /*yield*/, apis.callNextApi(multipleApiConfig.entrypoint)];
8437
8496
  case 3:
8438
- _15.sent();
8439
- _15.label = 4;
8497
+ _13.sent();
8498
+ _13.label = 4;
8440
8499
  case 4: return [2 /*return*/];
8441
8500
  }
8442
8501
  });
@@ -8445,15 +8504,16 @@
8445
8504
  KwikIDFormViewComponent.prototype.taskMultipleApiCallsEnd = function (action, object) {
8446
8505
  return __awaiter(this, void 0, void 0, function () {
8447
8506
  var multipleApiConfig, multipleApiCallResponses;
8448
- var _15;
8449
- return __generator(this, function (_16) {
8507
+ var _13;
8508
+ return __generator(this, function (_14) {
8450
8509
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
8451
8510
  multipleApiCallResponses = {};
8452
8511
  multipleApiConfig.endpoints.forEach(function (api) {
8453
- if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
8512
+ if (kwikidToolkit.checkObjectKeyExists(api.response, "value")) {
8454
8513
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
8514
+ }
8455
8515
  });
8456
- this.taskData = Object.assign(Object.assign({}, this.taskData), (_15 = {}, _15[action.props.formApiKey] = multipleApiCallResponses, _15));
8516
+ this.taskData = Object.assign(Object.assign({}, this.taskData), (_13 = {}, _13[action.props.formApiKey] = multipleApiCallResponses, _13));
8457
8517
  this.waitingForChanges = false;
8458
8518
  this.hideApiLoader();
8459
8519
  return [2 /*return*/];
@@ -8668,7 +8728,7 @@
8668
8728
  };
8669
8729
  KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
8670
8730
  return __awaiter(this, void 0, void 0, function () {
8671
- return __generator(this, function (_15) {
8731
+ return __generator(this, function (_13) {
8672
8732
  /**
8673
8733
  * This below code is currently commented because not all actions need to be logged at backend.
8674
8734
  * Will look later into where only specific actions needs to be logged or all.
@@ -8712,12 +8772,12 @@
8712
8772
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
8713
8773
  var _a, _b, _c, _d, _e, _f;
8714
8774
  return __awaiter(this, void 0, void 0, function () {
8715
- var _15, fieldErrorShowSource, fieldErrorShowSourceValue, fieldErrorHideSource, fieldErrorHideSourceValue, redirectToUrlSource, redirectToUrlSourceValue, previewErrorShowSource, previewErrorShowSourceValue, fieldHtmlMessageSource, fieldHtmlMessageSourceValue;
8716
- return __generator(this, function (_16) {
8717
- switch (_16.label) {
8775
+ var _13, fieldErrorShowSource, fieldErrorShowSourceValue, fieldErrorHideSource, fieldErrorHideSourceValue, redirectToUrlSource, redirectToUrlSourceValue, previewErrorShowSource, previewErrorShowSourceValue, fieldHtmlMessageSource, fieldHtmlMessageSourceValue;
8776
+ return __generator(this, function (_14) {
8777
+ switch (_14.label) {
8718
8778
  case 0:
8719
- _15 = action.key;
8720
- switch (_15) {
8779
+ _13 = action.key;
8780
+ switch (_13) {
8721
8781
  case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
8722
8782
  case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
8723
8783
  case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
@@ -8731,66 +8791,67 @@
8731
8791
  case EActionKey.FIELD_MESSAGES_HIDE: return [3 /*break*/, 15];
8732
8792
  case EActionKey.FIELD_API_TIMER_MESSAGE_SHOW: return [3 /*break*/, 16];
8733
8793
  case EActionKey.FIELD_API_TIMER_MESSAGE_HIDE: return [3 /*break*/, 18];
8734
- case EActionKey.SET_VALUE: return [3 /*break*/, 20];
8735
- case EActionKey.SET_FIELD_DEFAULT_VALUE: return [3 /*break*/, 22];
8736
- case EActionKey.SET_API_STATUS: return [3 /*break*/, 24];
8737
- case EActionKey.SET_API_HEADER_VALUE: return [3 /*break*/, 26];
8738
- case EActionKey.SET_API_HEADER_VALIDITY: return [3 /*break*/, 28];
8739
- case EActionKey.SET_API_BODY_VALUE: return [3 /*break*/, 30];
8740
- case EActionKey.SET_API_BODY_VALIDITY: return [3 /*break*/, 32];
8741
- case EActionKey.SET_DROPDOWN_OPTIONS: return [3 /*break*/, 34];
8742
- case EActionKey.SET_FIELD_VALIDITY: return [3 /*break*/, 36];
8743
- case EActionKey.HANDLE_CONNECTED_ELEMENTS: return [3 /*break*/, 38];
8744
- case EActionKey.API_CALL: return [3 /*break*/, 39];
8745
- case EActionKey.API_CALL_MULTIPLE: return [3 /*break*/, 41];
8746
- case EActionKey.API_CALL_MULTIPLE_END: return [3 /*break*/, 43];
8747
- case EActionKey.TASK_API_CALL: return [3 /*break*/, 45];
8748
- case EActionKey.TASK_API_CALL_MULTIPLE: return [3 /*break*/, 47];
8749
- case EActionKey.TASK_API_CALL_MULTIPLE_END: return [3 /*break*/, 49];
8750
- case EActionKey.REDIRECT_TO_URL: return [3 /*break*/, 51];
8751
- case EActionKey.PREVIEW_DIALOG_SHOW: return [3 /*break*/, 54];
8752
- case EActionKey.PREVIEW_ERROR_SHOW: return [3 /*break*/, 55];
8753
- case EActionKey.POPUP_FORM_SHOW: return [3 /*break*/, 58];
8754
- case EActionKey.STOP_WAITING: return [3 /*break*/, 59];
8755
- case EActionKey.SCROLL_TO_FIELD: return [3 /*break*/, 60];
8756
- case EActionKey.NOTIFICATION_ERROR_SHOW: return [3 /*break*/, 61];
8757
- case EActionKey.NOTIFICATION_ERROR_HIDE: return [3 /*break*/, 62];
8758
- case EActionKey.RESUME_TASK_EXECUTION: return [3 /*break*/, 63];
8759
- case EActionKey.STOP_TASK_EXECUTION: return [3 /*break*/, 64];
8760
- case EActionKey.DIALOG_SHOW: return [3 /*break*/, 65];
8761
- case EActionKey.DIALOG_HIDE: return [3 /*break*/, 66];
8762
- case EActionKey.SAVE_FORM: return [3 /*break*/, 67];
8763
- case EActionKey.ALERT_SHOW: return [3 /*break*/, 68];
8764
- case EActionKey.SET_HTML: return [3 /*break*/, 69];
8765
- }
8766
- return [3 /*break*/, 72];
8794
+ case EActionKey.REMOVE_KEY_FROM_OBJECT_PATH: return [3 /*break*/, 20];
8795
+ case EActionKey.SET_VALUE: return [3 /*break*/, 22];
8796
+ case EActionKey.SET_FIELD_DEFAULT_VALUE: return [3 /*break*/, 24];
8797
+ case EActionKey.SET_API_STATUS: return [3 /*break*/, 26];
8798
+ case EActionKey.SET_API_HEADER_VALUE: return [3 /*break*/, 28];
8799
+ case EActionKey.SET_API_HEADER_VALIDITY: return [3 /*break*/, 30];
8800
+ case EActionKey.SET_API_BODY_VALUE: return [3 /*break*/, 32];
8801
+ case EActionKey.SET_API_BODY_VALIDITY: return [3 /*break*/, 34];
8802
+ case EActionKey.SET_DROPDOWN_OPTIONS: return [3 /*break*/, 36];
8803
+ case EActionKey.SET_FIELD_VALIDITY: return [3 /*break*/, 38];
8804
+ case EActionKey.HANDLE_CONNECTED_ELEMENTS: return [3 /*break*/, 40];
8805
+ case EActionKey.API_CALL: return [3 /*break*/, 41];
8806
+ case EActionKey.API_CALL_MULTIPLE: return [3 /*break*/, 43];
8807
+ case EActionKey.API_CALL_MULTIPLE_END: return [3 /*break*/, 45];
8808
+ case EActionKey.TASK_API_CALL: return [3 /*break*/, 47];
8809
+ case EActionKey.TASK_API_CALL_MULTIPLE: return [3 /*break*/, 49];
8810
+ case EActionKey.TASK_API_CALL_MULTIPLE_END: return [3 /*break*/, 51];
8811
+ case EActionKey.REDIRECT_TO_URL: return [3 /*break*/, 53];
8812
+ case EActionKey.PREVIEW_DIALOG_SHOW: return [3 /*break*/, 56];
8813
+ case EActionKey.PREVIEW_ERROR_SHOW: return [3 /*break*/, 57];
8814
+ case EActionKey.POPUP_FORM_SHOW: return [3 /*break*/, 60];
8815
+ case EActionKey.STOP_WAITING: return [3 /*break*/, 61];
8816
+ case EActionKey.SCROLL_TO_FIELD: return [3 /*break*/, 62];
8817
+ case EActionKey.NOTIFICATION_ERROR_SHOW: return [3 /*break*/, 63];
8818
+ case EActionKey.NOTIFICATION_ERROR_HIDE: return [3 /*break*/, 64];
8819
+ case EActionKey.RESUME_TASK_EXECUTION: return [3 /*break*/, 65];
8820
+ case EActionKey.STOP_TASK_EXECUTION: return [3 /*break*/, 66];
8821
+ case EActionKey.DIALOG_SHOW: return [3 /*break*/, 67];
8822
+ case EActionKey.DIALOG_HIDE: return [3 /*break*/, 68];
8823
+ case EActionKey.SAVE_FORM: return [3 /*break*/, 69];
8824
+ case EActionKey.ALERT_SHOW: return [3 /*break*/, 70];
8825
+ case EActionKey.SET_HTML: return [3 /*break*/, 71];
8826
+ }
8827
+ return [3 /*break*/, 74];
8767
8828
  case 1:
8768
8829
  this.fieldHide(action.props.fieldKey);
8769
- return [3 /*break*/, 73];
8830
+ return [3 /*break*/, 75];
8770
8831
  case 2:
8771
8832
  this.fieldShow(action.props.fieldKey);
8772
- return [3 /*break*/, 73];
8833
+ return [3 /*break*/, 75];
8773
8834
  case 3:
8774
8835
  this.fieldDisable(action.props.fieldKey);
8775
- return [3 /*break*/, 73];
8836
+ return [3 /*break*/, 75];
8776
8837
  case 4:
8777
8838
  this.fieldEnable(action.props.fieldKey);
8778
- return [3 /*break*/, 73];
8839
+ return [3 /*break*/, 75];
8779
8840
  case 5:
8780
8841
  this.fieldEnable(action.props.fieldKey);
8781
- return [3 /*break*/, 73];
8842
+ return [3 /*break*/, 75];
8782
8843
  case 6:
8783
8844
  this.fieldEnable(action.props.fieldKey);
8784
- return [3 /*break*/, 73];
8845
+ return [3 /*break*/, 75];
8785
8846
  case 7:
8786
8847
  this.fieldReset(action.props.fieldKey);
8787
- return [3 /*break*/, 73];
8848
+ return [3 /*break*/, 75];
8788
8849
  case 8:
8789
8850
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 10];
8790
8851
  fieldErrorShowSource = new kwikidToolkit.Source(object);
8791
8852
  return [4 /*yield*/, fieldErrorShowSource.getValueFromSource(action.props.message.source)];
8792
8853
  case 9:
8793
- fieldErrorShowSourceValue = _16.sent();
8854
+ fieldErrorShowSourceValue = _14.sent();
8794
8855
  if (typeof fieldErrorShowSourceValue === "string" ||
8795
8856
  typeof fieldErrorShowSourceValue === "number") {
8796
8857
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
@@ -8799,17 +8860,17 @@
8799
8860
  fieldErrorShowSourceValue = "";
8800
8861
  }
8801
8862
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorShowSourceValue);
8802
- _16.label = 10;
8863
+ _14.label = 10;
8803
8864
  case 10:
8804
8865
  action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
8805
8866
  this.fieldErrorShow(action.props.fieldKey, action.props.message);
8806
- return [3 /*break*/, 73];
8867
+ return [3 /*break*/, 75];
8807
8868
  case 11:
8808
8869
  if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 13];
8809
8870
  fieldErrorHideSource = new kwikidToolkit.Source(object);
8810
8871
  return [4 /*yield*/, fieldErrorHideSource.getValueFromSource(action.props.message.source)];
8811
8872
  case 12:
8812
- fieldErrorHideSourceValue = _16.sent();
8873
+ fieldErrorHideSourceValue = _14.sent();
8813
8874
  if (typeof fieldErrorHideSourceValue === "string" ||
8814
8875
  typeof fieldErrorHideSourceValue === "number") {
8815
8876
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
@@ -8818,110 +8879,114 @@
8818
8879
  fieldErrorHideSourceValue = "";
8819
8880
  }
8820
8881
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorHideSourceValue);
8821
- _16.label = 13;
8882
+ _14.label = 13;
8822
8883
  case 13:
8823
8884
  this.fieldErrorHide(action.props.fieldKey, action.props.message);
8824
- return [3 /*break*/, 73];
8885
+ return [3 /*break*/, 75];
8825
8886
  case 14:
8826
8887
  this.fieldMessageShow(action.props.fieldKey, action.props.message);
8827
- return [3 /*break*/, 73];
8888
+ return [3 /*break*/, 75];
8828
8889
  case 15:
8829
8890
  this.fieldMessageHide(action.props.fieldKey, action.props.message);
8830
- return [3 /*break*/, 73];
8891
+ return [3 /*break*/, 75];
8831
8892
  case 16: return [4 /*yield*/, this.fieldApiTimerMessageShow(action.props.fieldKey, action.props.timer)];
8832
8893
  case 17:
8833
- _16.sent();
8834
- return [3 /*break*/, 73];
8894
+ _14.sent();
8895
+ return [3 /*break*/, 75];
8835
8896
  case 18: return [4 /*yield*/, this.fieldApiTimerMessageHide(action.props.fieldKey)];
8836
8897
  case 19:
8837
- _16.sent();
8838
- return [3 /*break*/, 73];
8839
- case 20: return [4 /*yield*/, this.setValue(action, object)];
8898
+ _14.sent();
8899
+ return [3 /*break*/, 75];
8900
+ case 20: return [4 /*yield*/, this.removeKeyFromObjectPath(action, object)];
8840
8901
  case 21:
8841
- _16.sent();
8842
- return [3 /*break*/, 73];
8843
- case 22: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
8902
+ _14.sent();
8903
+ return [3 /*break*/, 75];
8904
+ case 22: return [4 /*yield*/, this.setValue(action, object)];
8844
8905
  case 23:
8845
- _16.sent();
8846
- return [3 /*break*/, 73];
8847
- case 24: return [4 /*yield*/, this.setApiStatus(action, object)];
8906
+ _14.sent();
8907
+ return [3 /*break*/, 75];
8908
+ case 24: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
8848
8909
  case 25:
8849
- _16.sent();
8850
- return [3 /*break*/, 73];
8851
- case 26: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
8910
+ _14.sent();
8911
+ return [3 /*break*/, 75];
8912
+ case 26: return [4 /*yield*/, this.setApiStatus(action, object)];
8852
8913
  case 27:
8853
- _16.sent();
8854
- return [3 /*break*/, 73];
8855
- case 28: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
8914
+ _14.sent();
8915
+ return [3 /*break*/, 75];
8916
+ case 28: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
8856
8917
  case 29:
8857
- _16.sent();
8858
- return [3 /*break*/, 73];
8859
- case 30: return [4 /*yield*/, this.setApiBodyValue(action, object)];
8918
+ _14.sent();
8919
+ return [3 /*break*/, 75];
8920
+ case 30: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
8860
8921
  case 31:
8861
- _16.sent();
8862
- return [3 /*break*/, 73];
8863
- case 32: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
8922
+ _14.sent();
8923
+ return [3 /*break*/, 75];
8924
+ case 32: return [4 /*yield*/, this.setApiBodyValue(action, object)];
8864
8925
  case 33:
8865
- _16.sent();
8866
- return [3 /*break*/, 73];
8867
- case 34: return [4 /*yield*/, this.setDropdownOptions(action, object)];
8926
+ _14.sent();
8927
+ return [3 /*break*/, 75];
8928
+ case 34: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
8868
8929
  case 35:
8869
- _16.sent();
8870
- return [3 /*break*/, 73];
8871
- case 36: return [4 /*yield*/, this.setFieldValidity(action, object)];
8930
+ _14.sent();
8931
+ return [3 /*break*/, 75];
8932
+ case 36: return [4 /*yield*/, this.setDropdownOptions(action, object)];
8872
8933
  case 37:
8873
- _16.sent();
8874
- return [3 /*break*/, 73];
8875
- case 38:
8876
- this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
8877
- return [3 /*break*/, 73];
8878
- case 39: return [4 /*yield*/, this.fieldApiCall(action, object)];
8934
+ _14.sent();
8935
+ return [3 /*break*/, 75];
8936
+ case 38: return [4 /*yield*/, this.setFieldValidity(action, object)];
8937
+ case 39:
8938
+ _14.sent();
8939
+ return [3 /*break*/, 75];
8879
8940
  case 40:
8880
- _16.sent();
8881
- return [3 /*break*/, 73];
8882
- case 41: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
8941
+ this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
8942
+ return [3 /*break*/, 75];
8943
+ case 41: return [4 /*yield*/, this.fieldApiCall(action, object)];
8883
8944
  case 42:
8884
- _16.sent();
8885
- return [3 /*break*/, 73];
8886
- case 43: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
8945
+ _14.sent();
8946
+ return [3 /*break*/, 75];
8947
+ case 43: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
8887
8948
  case 44:
8888
- _16.sent();
8889
- return [3 /*break*/, 73];
8890
- case 45: return [4 /*yield*/, this.taskApiCall(action, object)];
8949
+ _14.sent();
8950
+ return [3 /*break*/, 75];
8951
+ case 45: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
8891
8952
  case 46:
8892
- _16.sent();
8893
- return [3 /*break*/, 73];
8894
- case 47: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
8953
+ _14.sent();
8954
+ return [3 /*break*/, 75];
8955
+ case 47: return [4 /*yield*/, this.taskApiCall(action, object)];
8895
8956
  case 48:
8896
- _16.sent();
8897
- return [3 /*break*/, 73];
8898
- case 49: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
8957
+ _14.sent();
8958
+ return [3 /*break*/, 75];
8959
+ case 49: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
8899
8960
  case 50:
8900
- _16.sent();
8901
- return [3 /*break*/, 73];
8902
- case 51:
8903
- if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 53];
8961
+ _14.sent();
8962
+ return [3 /*break*/, 75];
8963
+ case 51: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
8964
+ case 52:
8965
+ _14.sent();
8966
+ return [3 /*break*/, 75];
8967
+ case 53:
8968
+ if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 55];
8904
8969
  redirectToUrlSource = new kwikidToolkit.Source(object);
8905
8970
  return [4 /*yield*/, redirectToUrlSource.getValueFromSource(action.props.url.source)];
8906
- case 52:
8907
- redirectToUrlSourceValue = _16.sent();
8971
+ case 54:
8972
+ redirectToUrlSourceValue = _14.sent();
8908
8973
  if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
8909
8974
  redirectToUrlSourceValue = "";
8910
8975
  }
8911
8976
  action = kwikidToolkit.setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
8912
- _16.label = 53;
8913
- case 53:
8977
+ _14.label = 55;
8978
+ case 55:
8914
8979
  this.redirectToUrl(action);
8915
- return [3 /*break*/, 73];
8916
- case 54:
8980
+ return [3 /*break*/, 75];
8981
+ case 56:
8917
8982
  this.showPreview(action.props);
8918
- return [3 /*break*/, 73];
8919
- case 55:
8920
- if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 57];
8983
+ return [3 /*break*/, 75];
8984
+ case 57:
8985
+ if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 59];
8921
8986
  previewErrorShowSource = new kwikidToolkit.Source(object);
8922
8987
  return [4 /*yield*/, previewErrorShowSource.getValueFromSource(action.props.message.source)];
8923
- case 56:
8924
- previewErrorShowSourceValue = _16.sent();
8988
+ case 58:
8989
+ previewErrorShowSourceValue = _14.sent();
8925
8990
  if (typeof previewErrorShowSourceValue === "string" ||
8926
8991
  typeof previewErrorShowSourceValue === "number") {
8927
8992
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
@@ -8930,54 +8995,54 @@
8930
8995
  previewErrorShowSourceValue = "";
8931
8996
  }
8932
8997
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", previewErrorShowSourceValue);
8933
- _16.label = 57;
8934
- case 57:
8998
+ _14.label = 59;
8999
+ case 59:
8935
9000
  this.showErrorPreview(action.props);
8936
- return [3 /*break*/, 73];
8937
- case 58:
9001
+ return [3 /*break*/, 75];
9002
+ case 60:
8938
9003
  this.showPopupForm(action.props.popupFormKey, (_b = (_a = action.props) === null || _a === void 0 ? void 0 : _a.popupType) !== null && _b !== void 0 ? _b : "DIALOG");
8939
- return [3 /*break*/, 73];
8940
- case 59:
9004
+ return [3 /*break*/, 75];
9005
+ case 61:
8941
9006
  this.waitingForChanges = false;
8942
- return [3 /*break*/, 73];
8943
- case 60:
9007
+ return [3 /*break*/, 75];
9008
+ case 62:
8944
9009
  this.handleOnScrollToField(action.props.fieldKey);
8945
- return [3 /*break*/, 73];
8946
- case 61:
9010
+ return [3 /*break*/, 75];
9011
+ case 63:
8947
9012
  this.toggleErrorNotification(true);
8948
- return [3 /*break*/, 73];
8949
- case 62:
9013
+ return [3 /*break*/, 75];
9014
+ case 64:
8950
9015
  this.toggleErrorNotification(false);
8951
- return [3 /*break*/, 73];
8952
- case 63:
9016
+ return [3 /*break*/, 75];
9017
+ case 65:
8953
9018
  this.stopTaskExecution = false;
8954
- return [3 /*break*/, 73];
8955
- case 64:
9019
+ return [3 /*break*/, 75];
9020
+ case 66:
8956
9021
  this.stopTaskExecution = true;
8957
- return [3 /*break*/, 73];
8958
- case 65:
9022
+ return [3 /*break*/, 75];
9023
+ case 67:
8959
9024
  this.dialogShow({
8960
9025
  html: (_c = action.props) === null || _c === void 0 ? void 0 : _c.html,
8961
9026
  label: (_d = action.props) === null || _d === void 0 ? void 0 : _d.label,
8962
9027
  size: (_e = action.props) === null || _e === void 0 ? void 0 : _e.size,
8963
9028
  button: (_f = action.props) === null || _f === void 0 ? void 0 : _f.button
8964
9029
  });
8965
- return [3 /*break*/, 73];
8966
- case 66:
9030
+ return [3 /*break*/, 75];
9031
+ case 68:
8967
9032
  this.dialogHide();
8968
- return [3 /*break*/, 73];
8969
- case 67:
9033
+ return [3 /*break*/, 75];
9034
+ case 69:
8970
9035
  this.handleOnClickSaveForm(undefined);
8971
- return [3 /*break*/, 73];
8972
- case 68:
9036
+ return [3 /*break*/, 75];
9037
+ case 70:
8973
9038
  this.alertShow(action.props.type, action.props.message);
8974
- return [3 /*break*/, 73];
8975
- case 69:
8976
- if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 71];
9039
+ return [3 /*break*/, 75];
9040
+ case 71:
9041
+ if (!kwikidToolkit.checkObjectKeyExists(action.props.message, "source")) return [3 /*break*/, 73];
8977
9042
  fieldHtmlMessageSource = new kwikidToolkit.Source(object);
8978
9043
  return [4 /*yield*/, fieldHtmlMessageSource.getValueFromSource(action.props.message.source)];
8979
- case 70:
8980
- fieldHtmlMessageSourceValue = _16.sent();
9044
+ case 72:
9045
+ fieldHtmlMessageSourceValue = _14.sent();
8981
9046
  if (typeof fieldHtmlMessageSourceValue === "string" ||
8982
9047
  typeof fieldHtmlMessageSourceValue === "number") {
8983
9048
  fieldHtmlMessageSourceValue = String(fieldHtmlMessageSourceValue);
@@ -8986,13 +9051,13 @@
8986
9051
  fieldHtmlMessageSourceValue = "";
8987
9052
  }
8988
9053
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldHtmlMessageSourceValue);
8989
- _16.label = 71;
8990
- case 71:
9054
+ _14.label = 73;
9055
+ case 73:
8991
9056
  action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
8992
9057
  this.setHtml(action.props.fieldKey, action.props.message);
8993
- return [3 /*break*/, 73];
8994
- case 72: return [3 /*break*/, 73];
8995
- case 73: return [2 /*return*/];
9058
+ return [3 /*break*/, 75];
9059
+ case 74: return [3 /*break*/, 75];
9060
+ case 75: return [2 /*return*/];
8996
9061
  }
8997
9062
  });
8998
9063
  });
@@ -9181,6 +9246,9 @@
9181
9246
  __decorate([
9182
9247
  kwikidToolkit.logMethod
9183
9248
  ], KwikIDFormViewComponent.prototype, "fieldMessageHide", null);
9249
+ __decorate([
9250
+ kwikidToolkit.logMethod
9251
+ ], KwikIDFormViewComponent.prototype, "removeKeyFromObjectPath", null);
9184
9252
  __decorate([
9185
9253
  kwikidToolkit.logMethod
9186
9254
  ], KwikIDFormViewComponent.prototype, "setValue", null);
@@ -9346,7 +9414,7 @@
9346
9414
  type: i0.Output
9347
9415
  }], onClickViewForms: [{
9348
9416
  type: i0.Output
9349
- }], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], handleOnApiTimerStop: [], handleOnScrollToField: [], toggleErrorNotification: [], togglePermissionErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldGroupReset: [], fieldHideApiLoader: [], fieldShowApiLoader: [], setHtml: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
9417
+ }], resetCamera: [], ngOnInit: [], ngOnChanges: [], ngOnDestroy: [], triggerLogs: [], initFormConfig: [], setFormFieldsFromFormConfig: [], setFormFieldGroupsFromFormConfig: [], setFormDataFromAllFormsData: [], handleConnectedElementFieldGroupActions: [], handleConnectedElementFieldGroup: [], handleConnectedElementFieldActions: [], handleConnectedElementFields: [], handleConnectedElements: [], handleRemovedFile: [], handleViewButtonClick: [], handleGetKeyValueFile: [], handleOnClickGetRemovedMediaFile: [], handleOnClickInputCamera: [], setCameraMedia: [], handleGetCameraMedia: [], handleOnClickSaveCameraMedia: [], handleOnClickCameraBack: [], handleOnClickCameraClose: [], updateFiles: [], uploadFile: [], handleOnClickFormFieldButton: [], handleOnLocationPermission: [], handleOnClickLiveLocation: [], handleGetKeyValue: [], handleOnClickResetFormFields: [], handleFieldApiCall: [], handleApiCall: [], executeApiCall: [], isValidRequestHeadersAndBody: [], handleOnClickApiCall: [], handleOnClickGoBack: [], handleOnClickViewForms: [], handleOnClickSaveForm: [], handleOnApiTimerStop: [], handleOnScrollToField: [], toggleErrorNotification: [], togglePermissionErrorNotification: [], fieldHide: [], fieldGroupHide: [], fieldShow: [], fieldGroupShow: [], fieldDisable: [], fieldGroupDisable: [], fieldEnable: [], fieldGroupEnable: [], fieldReset: [], fieldGroupReset: [], fieldHideApiLoader: [], fieldShowApiLoader: [], setHtml: [], fieldErrorShow: [], fieldErrorHide: [], fieldMessageShow: [], fieldMessageHide: [], removeKeyFromObjectPath: [], setValue: [], setFieldDefaultValue: [], setApiStatus: [], setApiHeaderValue: [], setApiHeaderValidity: [], setApiBodyValue: [], setApiBodyValidity: [], setFieldValidity: [], setDropdownOptions: [], apiCall: [], fieldApiCall: [], fieldMultipleApiCalls: [], fieldMultipleApiCallsEnd: [], taskApiCall: [], taskMultipleApiCalls: [], taskMultipleApiCallsEnd: [], dialogShow: [], dialogHide: [], redirectToUrl: [], patchFieldControlValue: [], setFieldControlValue: [], patchFormGroup: [], isFieldValid: [], isFieldEnabled: [], getFormGroupRawValues: [], showPreview: [], showErrorPreview: [], showPopupForm: [], alertShow: [], takeActionOnFieldGroup: [], takeAction: [] } });
9350
9418
 
9351
9419
  /* eslint-disable no-unused-vars */
9352
9420
  var EFormType;
@@ -9980,6 +10048,22 @@
9980
10048
  form = kwikidToolkit.setValueToObjectPath(form, "status", "completed");
9981
10049
  form = kwikidToolkit.setValueToObjectPath(form, "disabled", false);
9982
10050
  }
10051
+ else if (kwikidToolkit.checkObjectKeyExists(form, "dependentOn")) {
10052
+ var isDependent = form.dependentOn.every(function (r) { return formsListCompleted.includes(r); });
10053
+ if (isDependent) {
10054
+ form = kwikidToolkit.setValueToObjectPath(form, "status", "editable");
10055
+ form = kwikidToolkit.setValueToObjectPath(form, "disabled", false);
10056
+ }
10057
+ else {
10058
+ form = kwikidToolkit.setValueToObjectPath(form, "status", "locked");
10059
+ form = kwikidToolkit.setValueToObjectPath(form, "disabled", true);
10060
+ }
10061
+ }
10062
+ else {
10063
+ form = kwikidToolkit.setValueToObjectPath(form, "dependentOn", []);
10064
+ form = kwikidToolkit.setValueToObjectPath(form, "status", "editable");
10065
+ form = kwikidToolkit.setValueToObjectPath(form, "disabled", false);
10066
+ }
9983
10067
  }
9984
10068
  }
9985
10069
  }
@@ -10795,8 +10879,9 @@
10795
10879
  function JsonFormatPipe() {
10796
10880
  }
10797
10881
  JsonFormatPipe.prototype.transform = function (value) {
10798
- if (!value)
10882
+ if (!value) {
10799
10883
  return "";
10884
+ }
10800
10885
  // Trim spaces from start and end, then JSON.stringify with indentation for formatting
10801
10886
  return JSON.stringify(value, null, 2).trim();
10802
10887
  };